ubus_notify(ubus_ctx, &iface->ubus, event, b.head, -1);
}
+void
+netifd_ubus_wireless_notify(struct wireless_device *wdev, bool up)
+{
+ const char *event = (up) ? "wireless.update" : "wireless.down";
+
+ blob_buf_init(&b, 0);
+ wireless_device_status(wdev, &b);
+ ubus_notify(ubus_ctx, &wireless_object, event, b.head, -1);
+}
+
void
netifd_ubus_add_interface(struct interface *iface)
{
#ifndef __NETIFD_UBUS_H
#define __NETIFD_UBUS_H
+struct wireless_device;
typedef void (*procd_data_cb)(struct blob_attr *data);
extern struct ubus_context *ubus_ctx;
void netifd_ubus_interface_notify(struct interface *iface, bool up);
void netifd_ubus_device_notify(const char *event, struct blob_attr *data, int timeout);
void netifd_ubus_get_procd_data(const char *type, procd_data_cb cb);
+void netifd_ubus_wireless_notify(struct wireless_device *wdev, bool up);
#endif
wdev->state = IFS_DOWN;
wireless_device_free_state(wdev);
wdev_handle_config_change(wdev);
+ netifd_ubus_wireless_notify(wdev, false);
}
/* timeout callback to protect the tear down */
vlist_for_each_element(&vif->vlans, vlan, node)
wireless_vlan_handle_link(vlan, true);
}
+ netifd_ubus_wireless_notify(wdev, true);
}
static void