hostapd: fix compile error in the roboswitch driver
[openwrt.git] / package / hostapd / patches / 200-multicall.patch
1 --- a/hostapd/Makefile
2 +++ b/hostapd/Makefile
3 @@ -14,6 +14,7 @@ CFLAGS += -I../src/utils
4 # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
5
6 -include .config
7 +-include $(if $(MULTICALL), ../wpa_supplicant/.config)
8
9 ifndef CONFIG_OS
10 ifdef CONFIG_NATIVE_WINDOWS
11 @@ -157,10 +158,14 @@ ifdef CONFIG_IEEE80211N
12 CFLAGS += -DCONFIG_IEEE80211N
13 endif
14
15 +ifndef MULTICALL
16 +CFLAGS += -DNO_SUPPLICANT
17 +endif
18 +
19 include ../src/drivers/drivers.mak
20 -OBJS += $(DRV_AP_OBJS)
21 -CFLAGS += $(DRV_AP_CFLAGS)
22 -LDFLAGS += $(DRV_AP_LDFLAGS)
23 +OBJS += $(sort $(DRV_AP_OBJS) $(if $(MULTICALL),$(DRV_WPA_OBJS)))
24 +CFLAGS += $(DRV_AP_CFLAGS) $(if $(MULTICALL),$(DRV_WPA_CFLAGS))
25 +LDFLAGS += $(DRV_AP_LDFLAGS) $(if $(MULTICALL),$(DRV_WPA_LDFLAGS))
26 LIBS += $(DRV_AP_LIBS)
27
28 ifdef CONFIG_L2_PACKET
29 @@ -738,6 +743,12 @@ install: all
30
31 BCHECK=../src/drivers/build.hostapd
32
33 +hostapd_multi.a: $(BCHECK) $(OBJS)
34 + $(Q)$(CC) -c -o hostapd_multi.o -Dmain=hostapd_main $(CFLAGS) main.c
35 + @$(E) " CC " $<
36 + @rm -f $@
37 + @$(AR) cr $@ hostapd_multi.o $(OBJS)
38 +
39 hostapd: $(BCHECK) $(OBJS)
40 $(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
41
42 @@ -776,6 +787,12 @@ HOBJS += ../src/crypto/aes-internal.o
43 HOBJS += ../src/crypto/aes-internal-enc.o
44 endif
45
46 +dump_cflags:
47 + @echo -n $(CFLAGS) " "
48 +
49 +dump_ldflags:
50 + @echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " "
51 +
52 nt_password_hash: $(NOBJS)
53 $(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
54
55 --- a/wpa_supplicant/Makefile
56 +++ b/wpa_supplicant/Makefile
57 @@ -52,6 +52,7 @@ OBJS_p += ../src/utils/wpabuf.o
58 OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
59
60 -include .config
61 +-include $(if $(MULTICALL),../hostapd/.config)
62
63 ifndef CONFIG_OS
64 ifdef CONFIG_NATIVE_WINDOWS
65 @@ -579,6 +580,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
66 CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
67 LIBS += -ldl -rdynamic
68 endif
69 +else
70 + ifdef MULTICALL
71 + OBJS += ../src/eap_common/eap_common.o
72 + endif
73 endif
74
75 ifdef CONFIG_AP
76 @@ -631,6 +636,12 @@ CFLAGS += -DEAP_SERVER_WSC
77 OBJS += ../src/ap/wps_hostapd.o
78 OBJS += ../src/eap_server/eap_wsc.o
79 endif
80 +else
81 + ifdef MULTICALL
82 + OBJS += ../src/eap_server/eap.o
83 + OBJS += ../src/eap_server/eap_identity.o
84 + OBJS += ../src/eap_server/eap_methods.o
85 + endif
86 endif
87
88 ifdef NEED_RSN_AUTHENTICATOR
89 @@ -1260,6 +1271,12 @@ BCHECK=../src/drivers/build.wpa_supplica
90 wpa_priv: $(BCHECK) $(OBJS_priv)
91 $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
92
93 +wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
94 + $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c
95 + @$(E) " CC " $<
96 + @rm -f $@
97 + @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
98 +
99 wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
100 $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
101
102 @@ -1319,6 +1336,12 @@ endif
103 $(Q)$(CC) -c -o $@ $(CFLAGS) $<
104 @$(E) " CC " $<
105
106 +dump_cflags:
107 + @echo -n $(CFLAGS) " "
108 +
109 +dump_ldflags:
110 + @echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " "
111 +
112 wpa_supplicant.exe: wpa_supplicant
113 mv -f $< $@
114 wpa_cli.exe: wpa_cli
115 --- a/src/drivers/driver.h
116 +++ b/src/drivers/driver.h
117 @@ -2384,8 +2384,8 @@ union wpa_event_data {
118 * Driver wrapper code should call this function whenever an event is received
119 * from the driver.
120 */
121 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
122 - union wpa_event_data *data);
123 +extern void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
124 + union wpa_event_data *data);
125
126
127 /*
128 --- a/src/ap/drv_callbacks.c
129 +++ b/src/ap/drv_callbacks.c
130 @@ -337,8 +337,8 @@ static void hostapd_event_eapol_rx(struc
131 }
132
133
134 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
135 - union wpa_event_data *data)
136 +void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
137 + union wpa_event_data *data)
138 {
139 struct hostapd_data *hapd = ctx;
140
141 @@ -415,5 +415,6 @@ void wpa_supplicant_event(void *ctx, enu
142 break;
143 }
144 }
145 -
146 #endif /* HOSTAPD */
147 +
148 +
149 --- a/wpa_supplicant/wpa_priv.c
150 +++ b/wpa_supplicant/wpa_priv.c
151 @@ -825,8 +825,8 @@ static void wpa_priv_send_ft_response(st
152 }
153
154
155 -void wpa_supplicant_event(void *ctx, wpa_event_type event,
156 - union wpa_event_data *data)
157 +static void supplicant_event(void *ctx, wpa_event_type event,
158 + union wpa_event_data *data)
159 {
160 struct wpa_priv_interface *iface = ctx;
161
162 @@ -968,6 +968,7 @@ int main(int argc, char *argv[])
163 if (os_program_init())
164 return -1;
165
166 + wpa_supplicant_event = supplicant_event;
167 wpa_priv_fd_workaround();
168
169 for (;;) {
170 --- a/wpa_supplicant/events.c
171 +++ b/wpa_supplicant/events.c
172 @@ -1425,8 +1425,8 @@ static void wpa_supplicant_event_ibss_rs
173 #endif /* CONFIG_IBSS_RSN */
174
175
176 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
177 - union wpa_event_data *data)
178 +void supplicant_event(void *ctx, enum wpa_event_type event,
179 + union wpa_event_data *data)
180 {
181 struct wpa_supplicant *wpa_s = ctx;
182
183 --- a/wpa_supplicant/wpa_supplicant.c
184 +++ b/wpa_supplicant/wpa_supplicant.c
185 @@ -2215,6 +2215,9 @@ struct wpa_supplicant * wpa_supplicant_g
186 return NULL;
187 }
188
189 +extern void supplicant_event(void *ctx, enum wpa_event_type event,
190 + union wpa_event_data *data);
191 +
192
193 /**
194 * wpa_supplicant_init - Initialize %wpa_supplicant
195 @@ -2233,6 +2236,7 @@ struct wpa_global * wpa_supplicant_init(
196 if (params == NULL)
197 return NULL;
198
199 + wpa_supplicant_event = supplicant_event;
200 wpa_debug_open_file(params->wpa_debug_file_path);
201 if (params->wpa_debug_syslog)
202 wpa_debug_open_syslog();
203 --- a/hostapd/main.c
204 +++ b/hostapd/main.c
205 @@ -478,6 +478,9 @@ static void usage(void)
206 exit(1);
207 }
208
209 +void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
210 + union wpa_event_data *data);
211 +
212
213 int main(int argc, char *argv[])
214 {
215 @@ -489,6 +492,7 @@ int main(int argc, char *argv[])
216 if (os_program_init())
217 return -1;
218
219 + wpa_supplicant_event = hostapd_wpa_event;
220 for (;;) {
221 c = getopt(argc, argv, "BdhKP:tv");
222 if (c < 0)
223 --- a/src/drivers/drivers.c
224 +++ b/src/drivers/drivers.c
225 @@ -13,7 +13,11 @@
226 */
227
228 #include "includes.h"
229 +#include "common.h"
230 +#include "driver.h"
231
232 +void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
233 + union wpa_event_data *data);
234
235 #ifdef CONFIG_DRIVER_WEXT
236 extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
This page took 0.046739 seconds and 5 git commands to generate.