From: Felix Fietkau Date: Fri, 29 Nov 2013 14:54:02 +0000 (+0100) Subject: wireless: add support for global up/down command X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=943ae5b9f838fa58d6048ca599d86526b5088b8c;p=oweals%2Fnetifd.git wireless: add support for global up/down command Signed-off-by: Felix Fietkau --- diff --git a/ubus.c b/ubus.c index d8c6a4f..e563e1f 100644 --- a/ubus.c +++ b/ubus.c @@ -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; }