linux/generic: Add support for 3.0-rc3
[openwrt.git] / package / hostapd / patches / 510-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 @@ -159,10 +160,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 @@ -780,6 +785,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 $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
41 @$(E) " LD " $@
42 @@ -820,6 +831,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 $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
54 @$(E) " LD " $@
55 --- a/wpa_supplicant/Makefile
56 +++ b/wpa_supplicant/Makefile
57 @@ -53,6 +53,7 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr
58 OBJS_c += ../src/utils/wpa_debug.o
59
60 -include .config
61 +-include $(if $(MULTICALL),../hostapd/.config)
62
63 ifndef CONFIG_OS
64 ifdef CONFIG_NATIVE_WINDOWS
65 @@ -634,6 +635,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 @@ -642,9 +647,11 @@ NEED_EAP_COMMON=y
77 NEED_RSN_AUTHENTICATOR=y
78 CFLAGS += -DCONFIG_AP
79 OBJS += ap.o
80 +ifndef MULTICALL
81 CFLAGS += -DCONFIG_NO_RADIUS
82 CFLAGS += -DCONFIG_NO_ACCOUNTING
83 CFLAGS += -DCONFIG_NO_VLAN
84 +endif
85 OBJS += ../src/ap/hostapd.o
86 OBJS += ../src/ap/wpa_auth_glue.o
87 OBJS += ../src/ap/utils.o
88 @@ -688,10 +695,18 @@ CFLAGS += -DEAP_SERVER_WSC
89 OBJS += ../src/ap/wps_hostapd.o
90 OBJS += ../src/eap_server/eap_server_wsc.o
91 endif
92 +else
93 + ifdef MULTICALL
94 + OBJS += ../src/eap_server/eap_server.o
95 + OBJS += ../src/eap_server/eap_server_identity.o
96 + OBJS += ../src/eap_server/eap_server_methods.o
97 + endif
98 endif
99
100 ifdef NEED_RSN_AUTHENTICATOR
101 +ifndef MULTICALL
102 CFLAGS += -DCONFIG_NO_RADIUS
103 +endif
104 NEED_AES_WRAP=y
105 OBJS += ../src/ap/wpa_auth.o
106 OBJS += ../src/ap/wpa_auth_ie.o
107 @@ -1352,6 +1367,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
108 $(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
109 @$(E) " LD " $@
110
111 +wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
112 + $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c
113 + @$(E) " CC " $<
114 + @rm -f $@
115 + @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
116 +
117 wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
118 $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
119 @$(E) " LD " $@
120 @@ -1412,6 +1433,12 @@ eap_ikev2.so: ../src/eap_peer/eap_ikev2.
121 $(Q)$(CC) -c -o $@ $(CFLAGS) $<
122 @$(E) " CC " $<
123
124 +dump_cflags:
125 + @echo -n $(CFLAGS) " "
126 +
127 +dump_ldflags:
128 + @echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " "
129 +
130 wpa_supplicant.exe: wpa_supplicant
131 mv -f $< $@
132 wpa_cli.exe: wpa_cli
133 --- a/src/drivers/driver.h
134 +++ b/src/drivers/driver.h
135 @@ -3199,8 +3199,8 @@ union wpa_event_data {
136 * Driver wrapper code should call this function whenever an event is received
137 * from the driver.
138 */
139 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
140 - union wpa_event_data *data);
141 +extern void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
142 + union wpa_event_data *data);
143
144
145 /*
146 --- a/src/ap/drv_callbacks.c
147 +++ b/src/ap/drv_callbacks.c
148 @@ -448,8 +448,8 @@ static void hostapd_event_eapol_rx(struc
149 }
150
151
152 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
153 - union wpa_event_data *data)
154 +void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
155 + union wpa_event_data *data)
156 {
157 struct hostapd_data *hapd = ctx;
158
159 --- a/wpa_supplicant/wpa_priv.c
160 +++ b/wpa_supplicant/wpa_priv.c
161 @@ -825,8 +825,8 @@ static void wpa_priv_send_ft_response(st
162 }
163
164
165 -void wpa_supplicant_event(void *ctx, wpa_event_type event,
166 - union wpa_event_data *data)
167 +static void supplicant_event(void *ctx, wpa_event_type event,
168 + union wpa_event_data *data)
169 {
170 struct wpa_priv_interface *iface = ctx;
171
172 @@ -968,6 +968,7 @@ int main(int argc, char *argv[])
173 if (os_program_init())
174 return -1;
175
176 + wpa_supplicant_event = supplicant_event;
177 wpa_priv_fd_workaround();
178
179 for (;;) {
180 --- a/wpa_supplicant/events.c
181 +++ b/wpa_supplicant/events.c
182 @@ -1746,8 +1746,8 @@ static void wpa_supplicant_event_unprot_
183 }
184
185
186 -void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
187 - union wpa_event_data *data)
188 +void supplicant_event(void *ctx, enum wpa_event_type event,
189 + union wpa_event_data *data)
190 {
191 struct wpa_supplicant *wpa_s = ctx;
192 u16 reason_code = 0;
193 --- a/wpa_supplicant/wpa_supplicant.c
194 +++ b/wpa_supplicant/wpa_supplicant.c
195 @@ -2314,6 +2314,9 @@ static void wpa_supplicant_deinit_iface(
196 wpa_drv_deinit(wpa_s);
197 }
198
199 +extern void supplicant_event(void *ctx, enum wpa_event_type event,
200 + union wpa_event_data *data);
201 +
202
203 /**
204 * wpa_supplicant_add_iface - Add a new network interface
205 @@ -2497,6 +2500,7 @@ struct wpa_global * wpa_supplicant_init(
206 wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
207 #endif /* CONFIG_NO_WPA_MSG */
208
209 + wpa_supplicant_event = supplicant_event;
210 wpa_debug_open_file(params->wpa_debug_file_path);
211 if (params->wpa_debug_syslog)
212 wpa_debug_open_syslog();
213 --- a/hostapd/main.c
214 +++ b/hostapd/main.c
215 @@ -502,6 +502,9 @@ static const char * hostapd_msg_ifname_c
216 return NULL;
217 }
218
219 +void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
220 + union wpa_event_data *data);
221 +
222
223 int main(int argc, char *argv[])
224 {
225 @@ -514,6 +517,7 @@ int main(int argc, char *argv[])
226 if (os_program_init())
227 return -1;
228
229 + wpa_supplicant_event = hostapd_wpa_event;
230 for (;;) {
231 c = getopt(argc, argv, "Bdf:hKP:tv");
232 if (c < 0)
233 --- a/src/drivers/drivers.c
234 +++ b/src/drivers/drivers.c
235 @@ -13,7 +13,11 @@
236 */
237
238 #include "includes.h"
239 +#include "common.h"
240 +#include "driver.h"
241
242 +void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
243 + union wpa_event_data *data);
244
245 #ifdef CONFIG_DRIVER_WEXT
246 extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
This page took 0.049318 seconds and 5 git commands to generate.