diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-05-15 21:08:18 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-05-15 21:08:18 +0200 |
commit | e784303c4ca8ee86e57521a00ef5f9d0e98617f8 (patch) | |
tree | 578583593f9684c1a5976d885fbf7e3c0a5c63f2 /wireless.c | |
parent | a0f359bf861f060d563dd0424d51dac1bf96340c (diff) |
wireless: fix cancelling setup
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'wireless.c')
-rw-r--r-- | wireless.c | 31 |
1 files changed, 17 insertions, 14 deletions
@@ -317,17 +317,6 @@ wireless_device_mark_down(struct wireless_device *wdev) } static void -wireless_device_mark_up(struct wireless_device *wdev) -{ - struct wireless_interface *vif; - - D(WIRELESS, "Wireless device '%s' is now up\n", wdev->name); - wdev->state = IFS_UP; - vlist_for_each_element(&wdev->interfaces, vif, node) - wireless_interface_handle_link(vif, true); -} - -static void wireless_device_setup_timeout(struct uloop_timeout *timeout) { struct wireless_device *wdev = container_of(timeout, struct wireless_device, timeout); @@ -361,6 +350,23 @@ __wireless_device_set_down(struct wireless_device *wdev) } static void +wireless_device_mark_up(struct wireless_device *wdev) +{ + struct wireless_interface *vif; + + if (wdev->cancel) { + wdev->cancel = false; + __wireless_device_set_down(wdev); + return; + } + + D(WIRELESS, "Wireless device '%s' is now up\n", wdev->name); + wdev->state = IFS_UP; + vlist_for_each_element(&wdev->interfaces, vif, node) + wireless_interface_handle_link(vif, true); +} + +static void wireless_device_retry_setup(struct wireless_device *wdev) { if (wdev->state == IFS_TEARDOWN || wdev->state == IFS_DOWN || wdev->cancel) @@ -897,9 +903,6 @@ wireless_device_notify(struct wireless_device *wdev, struct blob_attr *data, if (wdev->state != IFS_SETUP) return UBUS_STATUS_PERMISSION_DENIED; - if (wdev->cancel) - return 0; - wireless_device_mark_up(wdev); break; case NOTIFY_CMD_SET_DATA: |