3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-29 13:59:24 +01:00

device: Remove device_network_find

Switch to using station_network_find instead
This commit is contained in:
Denis Kenzior 2018-09-04 16:09:08 -05:00
parent dcfdd0ccde
commit 1962549152
3 changed files with 7 additions and 14 deletions

View File

@ -158,12 +158,6 @@ static void periodic_scan_stop(struct device *device)
} }
} }
struct network *device_network_find(struct device *device, const char *ssid,
enum security security)
{
return station_network_find(device->station, ssid, security);
}
static void device_enter_state(struct device *device, enum station_state state) static void device_enter_state(struct device *device, enum station_state state)
{ {
struct station *station = device->station; struct station *station = device->station;
@ -993,6 +987,7 @@ static bool device_hidden_network_scan_results(uint32_t wiphy_id,
void *userdata) void *userdata)
{ {
struct device *device = userdata; struct device *device = userdata;
struct station *station = device->station;
struct network *network_psk; struct network *network_psk;
struct network *network_open; struct network *network_open;
struct network *network; struct network *network;
@ -1035,8 +1030,8 @@ next:
l_queue_destroy(bss_list, NULL); l_queue_destroy(bss_list, NULL);
network_psk = device_network_find(device, ssid, SECURITY_PSK); network_psk = station_network_find(station, ssid, SECURITY_PSK);
network_open = device_network_find(device, ssid, SECURITY_NONE); network_open = station_network_find(station, ssid, SECURITY_NONE);
if (!network_psk && !network_open) { if (!network_psk && !network_open) {
dbus_pending_reply(&msg, dbus_error_not_found(msg)); dbus_pending_reply(&msg, dbus_error_not_found(msg));
@ -1061,6 +1056,7 @@ static struct l_dbus_message *device_connect_hidden_network(struct l_dbus *dbus,
void *user_data) void *user_data)
{ {
struct device *device = user_data; struct device *device = user_data;
struct station *station = device->station;
const char *ssid; const char *ssid;
struct scan_parameters params = { struct scan_parameters params = {
.flush = true, .flush = true,
@ -1085,8 +1081,8 @@ static struct l_dbus_message *device_connect_hidden_network(struct l_dbus *dbus,
known_networks_find(ssid, SECURITY_NONE)) known_networks_find(ssid, SECURITY_NONE))
return dbus_error_already_provisioned(message); return dbus_error_already_provisioned(message);
if (device_network_find(device, ssid, SECURITY_PSK) || if (station_network_find(station, ssid, SECURITY_PSK) ||
device_network_find(device, ssid, SECURITY_NONE)) station_network_find(station, ssid, SECURITY_NONE))
return dbus_error_not_hidden(message); return dbus_error_not_hidden(message);
params.ssid = ssid; params.ssid = ssid;

View File

@ -22,7 +22,6 @@
#include <stdbool.h> #include <stdbool.h>
enum security;
struct scan_bss; struct scan_bss;
struct wiphy; struct wiphy;
struct netdev; struct netdev;
@ -35,8 +34,6 @@ void device_disassociated(struct device *device);
void device_transition_start(struct device *device, struct scan_bss *bss); void device_transition_start(struct device *device, struct scan_bss *bss);
void device_set_scan_results(struct device *device, struct l_queue *bss_list, void device_set_scan_results(struct device *device, struct l_queue *bss_list,
bool add_to_autoconnect); bool add_to_autoconnect);
struct network *device_network_find(struct device *device, const char *ssid,
enum security security);
bool device_set_autoconnect(struct device *device, bool autoconnect); bool device_set_autoconnect(struct device *device, bool autoconnect);
int __device_connect_network(struct device *device, struct network *network, int __device_connect_network(struct device *device, struct network *network,

View File

@ -120,7 +120,7 @@ static void wsc_try_credentials(struct wsc *wsc)
struct scan_bss *bss; struct scan_bss *bss;
for (i = 0; i < wsc->n_creds; i++) { for (i = 0; i < wsc->n_creds; i++) {
network = device_network_find(device, network = station_network_find(wsc->station,
wsc->creds[i].ssid, wsc->creds[i].ssid,
wsc->creds[i].security); wsc->creds[i].security);
if (!network) if (!network)