From 187ea7f5d12eb8f4b22d0b9cd41acc44a5ef7a99 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 4 Sep 2018 16:26:33 -0500 Subject: [PATCH] device/network: Use station_is_busy --- src/device.c | 11 ++--------- src/device.h | 2 -- src/network.c | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/device.c b/src/device.c index 16da3f21..b67f9ccf 100644 --- a/src/device.c +++ b/src/device.c @@ -115,19 +115,12 @@ static bool new_scan_results(uint32_t wiphy_id, uint32_t ifindex, int err, } /* TODO: Remove when Station/Device is split */ -bool device_is_busy(struct device *device) +static bool device_is_busy(struct device *device) { - enum station_state state; - if (!device->powered || !device->station) return false; - state = station_get_state(device->station); - if (state != STATION_STATE_DISCONNECTED && - state != STATION_STATE_AUTOCONNECT) - return true; - - return false; + return station_is_busy(device->station); } static void periodic_scan_trigger(int err, void *user_data) diff --git a/src/device.h b/src/device.h index ca94d2cc..25930cb5 100644 --- a/src/device.h +++ b/src/device.h @@ -28,8 +28,6 @@ struct netdev; struct network; struct device; -bool device_is_busy(struct device *device); - void device_disassociated(struct device *device); void device_transition_start(struct device *device, struct scan_bss *bss); void device_set_scan_results(struct device *device, struct l_queue *bss_list, diff --git a/src/network.c b/src/network.c index 6705d076..d2664b80 100644 --- a/src/network.c +++ b/src/network.c @@ -1008,7 +1008,7 @@ static struct l_dbus_message *network_connect(struct l_dbus *dbus, l_debug(""); - if (device_is_busy(device)) + if (station_is_busy(station)) return dbus_error_busy(message); /*