diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-11-29 15:54:02 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-11-29 15:54:06 +0100 |
commit | 943ae5b9f838fa58d6048ca599d86526b5088b8c (patch) | |
tree | f1cae2d852899d4a4431f8e428afad3242c85a83 /ubus.c | |
parent | edeaec0b8752bbadeb5b94c2b238e07dc4a1b4e4 (diff) |
wireless: add support for global up/down command
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'ubus.c')
-rw-r--r-- | ubus.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -983,10 +983,16 @@ netifd_handle_wdev_up(struct ubus_context *ctx, struct ubus_object *obj, int ret; wdev = get_wdev(msg, &ret); - if (!wdev) + if (ret == UBUS_STATUS_NOT_FOUND) return ret; - wireless_device_set_up(wdev); + if (wdev) { + wireless_device_set_up(wdev); + } else { + vlist_for_each_element(&wireless_devices, wdev, node) + wireless_device_set_up(wdev); + } + return 0; } @@ -999,10 +1005,16 @@ netifd_handle_wdev_down(struct ubus_context *ctx, struct ubus_object *obj, int ret; wdev = get_wdev(msg, &ret); - if (!wdev) + if (ret == UBUS_STATUS_NOT_FOUND) return ret; - wireless_device_set_down(wdev); + if (wdev) { + wireless_device_set_down(wdev); + } else { + vlist_for_each_element(&wireless_devices, wdev, node) + wireless_device_set_down(wdev); + } + return 0; } |