3 @@ -168,9 +168,21 @@ OBJS += ../src/eapol_auth/eapol_auth_sm.
6 CFLAGS += -DUBUS_SUPPORT
7 -OBJS += ../src/utils/uloop.o
8 OBJS += ../src/ap/ubus.o
15 +CFLAGS += -DUCODE_SUPPORT
16 +OBJS += ../src/utils/ucode.o
17 +OBJS += ../src/ap/ucode.o
22 +OBJS += ../src/utils/uloop.o
26 ifdef CONFIG_CODE_COVERAGE
29 @@ -991,6 +991,7 @@ int main(int argc, char *argv[])
32 hostapd_global_ctrl_iface_init(&interfaces);
33 + hostapd_ucode_init(&interfaces);
35 if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
36 wpa_printf(MSG_ERROR, "Failed to start eloop");
37 @@ -1000,6 +1001,7 @@ int main(int argc, char *argv[])
41 + hostapd_ucode_free();
42 hostapd_global_ctrl_iface_deinit(&interfaces);
43 /* Deinitialize all interfaces */
44 for (i = 0; i < interfaces.count; i++) {
45 --- a/src/ap/hostapd.h
46 +++ b/src/ap/hostapd.h
48 #include "ap_config.h"
49 #include "drivers/driver.h"
53 #define OCE_STA_CFON_ENABLED(hapd) \
54 ((hapd->conf->oce & OCE_STA_CFON) && \
55 @@ -51,6 +52,10 @@ struct hapd_interfaces {
56 struct hostapd_config * (*config_read_cb)(const char *config_fname);
57 int (*ctrl_iface_init)(struct hostapd_data *hapd);
58 void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
59 + int (*ctrl_iface_recv)(struct hostapd_data *hapd,
60 + char *buf, char *reply, int reply_size,
61 + struct sockaddr_storage *from,
63 int (*for_each_interface)(struct hapd_interfaces *interfaces,
64 int (*cb)(struct hostapd_iface *iface,
65 void *ctx), void *ctx);
66 @@ -186,6 +191,7 @@ struct hostapd_data {
67 struct hostapd_config *iconf;
68 struct hostapd_bss_config *conf;
69 struct hostapd_ubus_bss ubus;
70 + struct hostapd_ucode_bss ucode;
71 int interface_added; /* virtual interface added for this BSS */
72 unsigned int started:1;
73 unsigned int disabled:1;
74 @@ -506,6 +512,7 @@ struct hostapd_sta_info {
76 struct hostapd_iface {
77 struct hapd_interfaces *interfaces;
78 + struct hostapd_ucode_iface ucode;
81 struct hostapd_config *conf;
82 --- a/src/ap/hostapd.c
83 +++ b/src/ap/hostapd.c
84 @@ -276,6 +276,8 @@ int hostapd_reload_config(struct hostapd
88 + hostapd_ucode_reload_bss(hapd, reconf);
90 if (iface->config_fname == NULL) {
91 /* Only in-memory config in use - assume it has been updated */
92 hostapd_clear_old(iface);
93 @@ -455,6 +457,7 @@ void hostapd_free_hapd_data(struct hosta
94 hapd->beacon_set_done = 0;
96 wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
97 + hostapd_ucode_free_bss(hapd);
98 hostapd_ubus_free_bss(hapd);
99 accounting_deinit(hapd);
100 hostapd_deinit_wpa(hapd);
101 @@ -619,6 +622,7 @@ void hostapd_cleanup_iface_partial(struc
102 static void hostapd_cleanup_iface(struct hostapd_iface *iface)
104 wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface);
105 + hostapd_ucode_free_iface(iface);
106 eloop_cancel_timeout(channel_list_update_timeout, iface, NULL);
107 eloop_cancel_timeout(hostapd_interface_setup_failure_handler, iface,
109 @@ -1209,6 +1213,7 @@ static int hostapd_start_beacon(struct h
110 hapd->driver->set_operstate(hapd->drv_priv, 1);
112 hostapd_ubus_add_bss(hapd);
113 + hostapd_ucode_add_bss(hapd);
117 --- a/wpa_supplicant/Makefile
118 +++ b/wpa_supplicant/Makefile
119 @@ -197,8 +197,20 @@ endif
121 CFLAGS += -DUBUS_SUPPORT
128 +CFLAGS += -DUCODE_SUPPORT
129 +OBJS += ../src/utils/ucode.o
135 OBJS += ../src/utils/uloop.o
136 -LIBS += -lubox -lubus
140 ifdef CONFIG_CODE_COVERAGE
141 --- a/wpa_supplicant/wpa_supplicant.c
142 +++ b/wpa_supplicant/wpa_supplicant.c
143 @@ -7636,6 +7636,7 @@ struct wpa_supplicant * wpa_supplicant_a
144 #endif /* CONFIG_P2P */
146 wpas_ubus_add_bss(wpa_s);
147 + wpas_ucode_add_bss(wpa_s);
151 @@ -7663,6 +7664,7 @@ int wpa_supplicant_remove_iface(struct w
152 struct wpa_supplicant *parent = wpa_s->parent;
153 #endif /* CONFIG_MESH */
155 + wpas_ucode_free_bss(wpa_s);
156 wpas_ubus_free_bss(wpa_s);
158 /* Remove interface from the global list of interfaces */
159 @@ -7973,6 +7975,7 @@ struct wpa_global * wpa_supplicant_init(
161 eloop_register_timeout(WPA_SUPPLICANT_CLEANUP_INTERVAL, 0,
162 wpas_periodic, global, NULL);
163 + wpas_ucode_init(global);
167 @@ -8011,12 +8014,8 @@ int wpa_supplicant_run(struct wpa_global
168 eloop_register_signal_terminate(wpa_supplicant_terminate, global);
169 eloop_register_signal_reconfig(wpa_supplicant_reconfig, global);
171 - wpas_ubus_add(global);
175 - wpas_ubus_free(global);
180 @@ -8049,6 +8048,8 @@ void wpa_supplicant_deinit(struct wpa_gl
182 wpas_notify_supplicant_deinitialized(global);
186 eap_peer_unregister_methods();
188 eap_server_unregister_methods();
189 --- a/wpa_supplicant/wpa_supplicant_i.h
190 +++ b/wpa_supplicant/wpa_supplicant_i.h
193 #include "pasn/pasn_common.h"
197 extern const char *const wpa_supplicant_version;
198 extern const char *const wpa_supplicant_license;
199 @@ -659,6 +660,7 @@ struct wpa_supplicant {
200 unsigned char perm_addr[ETH_ALEN];
202 struct wpas_ubus_bss ubus;
203 + struct wpas_ucode_bss ucode;
204 #ifdef CONFIG_MATCH_IFACE
206 #endif /* CONFIG_MATCH_IFACE */
207 --- a/hostapd/ctrl_iface.c
208 +++ b/hostapd/ctrl_iface.c
209 @@ -4921,6 +4921,7 @@ try_again:
213 + interface->ctrl_iface_recv = hostapd_ctrl_iface_receive_process;
214 wpa_msg_register_cb(hostapd_ctrl_iface_msg_cb);
217 @@ -5022,6 +5023,7 @@ fail:
220 interface->global_ctrl_sock = s;
221 + interface->ctrl_iface_recv = hostapd_ctrl_iface_receive_process;
222 eloop_register_read_sock(s, hostapd_global_ctrl_iface_receive,