2 * netifd - network interface daemon
3 * Copyright (C) 2013 Felix Fietkau <nbd@openwrt.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 #ifndef __NETIFD_WIRELESS_H
15 #define __NETIFD_WIRELESS_H
17 #include <libubox/utils.h>
18 #include <libubox/list.h>
19 #include "interface.h"
21 extern struct vlist_tree wireless_devices
;
22 extern struct avl_tree wireless_drivers
;
24 struct wireless_driver
{
32 struct uci_blob_param_list
*config
;
33 } device
, interface
, vlan
, station
;
36 struct wireless_device
{
37 struct vlist_node node
;
39 struct list_head handler
;
45 struct wireless_driver
*drv
;
46 struct vlist_tree interfaces
;
49 struct netifd_process script_task
;
50 struct uloop_timeout timeout
;
51 struct uloop_timeout poll
;
53 struct list_head script_proc
;
54 struct uloop_fd script_proc_fd
;
55 struct uloop_timeout script_check
;
57 struct ubus_request_data
*kill_request
;
59 struct blob_attr
*prev_config
;
60 struct blob_attr
*config
;
61 struct blob_attr
*data
;
65 bool retry_setup_failed
;
67 enum interface_state state
;
68 enum interface_config_state config_state
;
76 struct wireless_interface
{
77 struct vlist_node node
;
81 struct vlist_tree vlans
;
82 struct vlist_tree stations
;
83 struct wireless_device
*wdev
;
85 struct blob_attr
*config
;
86 struct blob_attr
*data
;
89 struct blob_attr
*network
;
90 struct blob_attr
*network_vlan
;
95 int multicast_to_unicast
;
101 struct wireless_vlan
{
102 struct vlist_node node
;
106 struct blob_attr
*config
;
107 struct blob_attr
*data
;
110 struct blob_attr
*network
;
111 struct blob_attr
*network_vlan
;
112 int multicast_to_unicast
;
117 struct wireless_station
{
118 struct vlist_node node
;
122 struct blob_attr
*config
;
123 struct blob_attr
*data
;
126 struct wireless_process
{
127 struct list_head list
;
136 void wireless_device_create(struct wireless_driver
*drv
, const char *name
, struct blob_attr
*data
);
137 void wireless_device_set_up(struct wireless_device
*wdev
);
138 void wireless_device_set_down(struct wireless_device
*wdev
);
139 void wireless_device_reconf(struct wireless_device
*wdev
);
140 void wireless_device_status(struct wireless_device
*wdev
, struct blob_buf
*b
);
141 void wireless_device_get_validate(struct wireless_device
*wdev
, struct blob_buf
*b
);
142 struct wireless_interface
* wireless_interface_create(struct wireless_device
*wdev
, struct blob_attr
*data
, const char *section
);
143 void wireless_vlan_create(struct wireless_interface
*vif
, struct blob_attr
*data
, const char *section
);
144 void wireless_station_create(struct wireless_interface
*vif
, struct blob_attr
*data
, const char *section
);
145 int wireless_device_notify(struct wireless_device
*wdev
, struct blob_attr
*data
,
146 struct ubus_request_data
*req
);
148 void wireless_check_network_enabled(void);
149 void wireless_start_pending(int timeout
);
150 void wireless_init(void);
151 void wireless_device_hotplug_event(const char *name
, bool add
);