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;
}
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;
}