device: fix vlan device issues with disappearing lower devices
[project/netifd.git] / wireless.h
index f734770fdb92421b5ed89fd45e33d59b39276be0..690c79789cca0311e633b410dc24fbf1850a1e74 100644 (file)
@@ -30,7 +30,7 @@ struct wireless_driver {
        struct {
                char *buf;
                struct uci_blob_param_list *config;
-       } device, interface;
+       } device, interface, vlan, station;
 };
 
 struct wireless_device {
@@ -43,6 +43,8 @@ struct wireless_device {
 
        struct wireless_driver *drv;
        struct vlist_tree interfaces;
+       struct vlist_tree vlans;
+       struct vlist_tree stations;
        char *name;
 
        struct netifd_process script_task;
@@ -70,6 +72,8 @@ struct wireless_device {
        int retry;
 
        int vif_idx;
+       int vlan_idx;
+       int sta_idx;
 };
 
 struct wireless_interface {
@@ -84,8 +88,39 @@ struct wireless_interface {
 
        const char *ifname;
        struct blob_attr *network;
+       bool proxyarp;
        bool isolate;
        bool ap_mode;
+       int multicast_to_unicast;
+};
+
+struct wireless_vlan {
+       struct vlist_node node;
+       const char *section;
+       char *name;
+
+       struct wireless_device *wdev;
+       char *vif;
+
+       struct blob_attr *config;
+       struct blob_attr *data;
+
+       const char *ifname;
+       struct blob_attr *network;
+       int multicast_to_unicast;
+       bool isolate;
+};
+
+struct wireless_station {
+       struct vlist_node node;
+       const char *section;
+       char *name;
+
+       struct wireless_device *wdev;
+       char *vif;
+
+       struct blob_attr *config;
+       struct blob_attr *data;
 };
 
 struct wireless_process {
@@ -95,6 +130,7 @@ struct wireless_process {
        int pid;
 
        bool required;
+       bool keep;
 };
 
 void wireless_device_create(struct wireless_driver *drv, const char *name, struct blob_attr *data);
@@ -103,11 +139,14 @@ void wireless_device_set_down(struct wireless_device *wdev);
 void wireless_device_reconf(struct wireless_device *wdev);
 void wireless_device_status(struct wireless_device *wdev, struct blob_buf *b);
 void wireless_device_get_validate(struct wireless_device *wdev, struct blob_buf *b);
-void wireless_interface_create(struct wireless_device *wdev, struct blob_attr *data, const char *section);
+struct wireless_interface* wireless_interface_create(struct wireless_device *wdev, struct blob_attr *data, const char *section);
+void wireless_vlan_create(struct wireless_device *wdev, char *vif, struct blob_attr *data, const char *section);
+void wireless_station_create(struct wireless_device *wdev, char *vif, struct blob_attr *data, const char *section);
 int wireless_device_notify(struct wireless_device *wdev, struct blob_attr *data,
                           struct ubus_request_data *req);
 
 void wireless_start_pending(void);
 void wireless_init(void);
+void wireless_device_hotplug_event(const char *name, bool add);
 
 #endif