[package] base-files: add an experimental "-c" flag which tries to preserve *all...
[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 @@ -739,6 +744,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 @@ -777,6 +788,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 @@ -581,6 +582,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 @@ -635,6 +640,12 @@ CFLAGS += -DEAP_SERVER_WSC
77 OBJS += ../src/ap/wps_hostapd.o
78 OBJS += ../src/eap_server/eap_server_wsc.o
79 endif
80 +else
81 + ifdef MULTICALL
82 + OBJS += ../src/eap_server/eap_server.o
83 + OBJS += ../src/eap_server/eap_server_identity.o
84 + OBJS += ../src/eap_server/eap_server_methods.o
85 + endif
86 endif
87
88 ifdef NEED_RSN_AUTHENTICATOR
89 @@ -1270,6 +1281,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 @@ -1329,6 +1346,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 @@ -2465,8 +2465,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 @@ -375,8 +375,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 @@ -453,5 +453,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 @@ -1582,8 +1582,8 @@ static void ft_rx_action(struct wpa_supp
173 #endif /* CONFIG_IEEE80211R */
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 u16 reason_code = 0;
183 --- a/wpa_supplicant/wpa_supplicant.c
184 +++ b/wpa_supplicant/wpa_supplicant.c
185 @@ -2228,6 +2228,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 @@ -2246,6 +2249,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 @@ -479,6 +479,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 @@ -490,6 +493,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.056509 seconds and 5 git commands to generate.