1 Index: madwifi-dfs-r3053/tools/80211debug.c
2 ===================================================================
3 --- madwifi-dfs-r3053.orig/tools/80211debug.c 2007-12-13 05:25:10.786240140 +0100
4 +++ madwifi-dfs-r3053/tools/80211debug.c 2007-12-13 05:25:11.226265215 +0100
10 +#include "do_multi.h"
14 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
18 #endif /* __linux__ */
23 +a80211debug_init(int argc, char *argv[])
29 main(int argc, char *argv[])
33 const char *ifname = "ath0";
36 Index: madwifi-dfs-r3053/tools/80211stats.c
37 ===================================================================
38 --- madwifi-dfs-r3053.orig/tools/80211stats.c 2007-12-13 05:25:10.794240595 +0100
39 +++ madwifi-dfs-r3053/tools/80211stats.c 2007-12-13 05:25:11.226265215 +0100
41 #include "net80211/ieee80211_crypto.h"
42 #include "net80211/ieee80211_ioctl.h"
45 +#include "do_multi.h"
48 #ifndef SIOCG80211STATS
49 #define SIOCG80211STATS (SIOCDEVPRIVATE + 2)
58 +a80211stats_init(int argc, char *argv[])
64 main(int argc, char *argv[])
69 struct ieee80211req_sta_info *si;
70 u_int8_t buf[24*1024], *cp;
71 Index: madwifi-dfs-r3053/tools/athchans.c
72 ===================================================================
73 --- madwifi-dfs-r3053.orig/tools/athchans.c 2007-12-13 05:25:10.798240825 +0100
74 +++ madwifi-dfs-r3053/tools/athchans.c 2007-12-13 05:25:11.238265900 +0100
76 #include "net80211/ieee80211_crypto.h"
77 #include "net80211/ieee80211_ioctl.h"
80 +#include "do_multi.h"
84 static const char *progname;
89 #define MAXCHAN ((int)(sizeof(struct ieee80211req_chanlist) * NBBY))
94 +athchans_init(int argc, char *argv[])
100 main(int argc, char *argv[])
104 const char *ifname = "wifi0";
105 struct ieee80211req_chanlist chanlist;
107 Index: madwifi-dfs-r3053/tools/athctrl.c
108 ===================================================================
109 --- madwifi-dfs-r3053.orig/tools/athctrl.c 2007-12-13 05:25:10.806241280 +0100
110 +++ madwifi-dfs-r3053/tools/athctrl.c 2007-12-13 05:25:11.242266126 +0100
116 +#include "do_multi.h"
120 setsysctrl(const char *dev, const char *control , u_long value)
129 +athctrl_init(int argc, char *argv[])
135 main(int argc, char *argv[])
139 char device[IFNAMSIZ + 1];
142 Index: madwifi-dfs-r3053/tools/athdebug.c
143 ===================================================================
144 --- madwifi-dfs-r3053.orig/tools/athdebug.c 2007-12-13 05:25:10.814241735 +0100
145 +++ madwifi-dfs-r3053/tools/athdebug.c 2007-12-13 05:25:11.242266126 +0100
151 +#include "do_multi.h"
155 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
159 #endif /* __linux__ */
164 +athdebug_init(int argc, char *argv[])
170 main(int argc, char *argv[])
176 const char *ifname = "wifi0";
178 Index: madwifi-dfs-r3053/tools/athkey.c
179 ===================================================================
180 --- madwifi-dfs-r3053.orig/tools/athkey.c 2007-12-13 05:25:10.818241964 +0100
181 +++ madwifi-dfs-r3053/tools/athkey.c 2007-12-13 05:25:11.242266126 +0100
183 #include "net80211/ieee80211_crypto.h"
184 #include "net80211/ieee80211_ioctl.h"
187 +#include "do_multi.h"
191 static const char *progname;
200 +athkey_init(int argc, char *argv[])
206 main(int argc, char *argv[])
210 const char *ifname = "wifi0";
211 struct ieee80211req_key setkey;
212 struct ieee80211req_del_key delkey;
213 Index: madwifi-dfs-r3053/tools/athstats.c
214 ===================================================================
215 --- madwifi-dfs-r3053.orig/tools/athstats.c 2007-12-13 05:25:10.826242419 +0100
216 +++ madwifi-dfs-r3053/tools/athstats.c 2007-12-13 05:25:11.242266126 +0100
219 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
222 +#include "do_multi.h"
225 static const struct {
235 +athstats_init(int argc, char *argv[])
241 main(int argc, char *argv[])
247 const char *ifname = "wifi0";
249 Index: madwifi-dfs-r3053/tools/do_multi.c
250 ===================================================================
251 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
252 +++ madwifi-dfs-r3053/tools/do_multi.c 2007-12-13 05:25:11.242266126 +0100
255 +#include "do_multi.h"
258 +main(int argc, char *argv[])
263 + progname = basename(argv[0]);
265 + if(strcmp(progname, "80211debug") == 0)
266 + ret = a80211debug_init(argc, argv);
267 + if(strcmp(progname, "80211stats") == 0)
268 + ret = a80211stats_init(argc, argv);
269 + if(strcmp(progname, "athchans") == 0)
270 + ret = athchans_init(argc, argv);
271 + if(strcmp(progname, "athctrl") == 0)
272 + ret = athctrl_init(argc, argv);
273 + if(strcmp(progname, "athdebug") == 0)
274 + ret = athdebug_init(argc, argv);
275 + if(strcmp(progname, "athkey") == 0)
276 + ret = athkey_init(argc, argv);
277 + if(strcmp(progname, "athstats") == 0)
278 + ret = athstats_init(argc, argv);
279 + if(strcmp(progname, "wlanconfig") == 0)
280 + ret = wlanconfig_init(argc, argv);
281 + if(strcmp(progname, "ath_info") == 0)
282 + ret = athinfo_init(argc, argv);
286 Index: madwifi-dfs-r3053/tools/do_multi.h
287 ===================================================================
288 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
289 +++ madwifi-dfs-r3053/tools/do_multi.h 2007-12-13 05:25:11.246266355 +0100
292 +int a80211debug_init(int argc, char *argv[]);
293 +int a80211stats_init(int argc, char *argv[]);
294 +int athchans_init(int argc, char *argv[]);
295 +int athctrl_init(int argc, char *argv[]);
296 +int athdebug_init(int argc, char *argv[]);
297 +int athkey_init(int argc, char *argv[]);
298 +int athstats_init(int argc, char *argv[]);
299 +int wlanconfig_init(int argc, char *argv[]);
300 +int athinfo_init(int argc, char *argv[]);
301 Index: madwifi-dfs-r3053/tools/Makefile
302 ===================================================================
303 --- madwifi-dfs-r3053.orig/tools/Makefile 2007-12-13 05:25:10.842243330 +0100
304 +++ madwifi-dfs-r3053/tools/Makefile 2007-12-13 05:25:11.246266355 +0100
309 -ALL= athstats 80211stats athkey athchans athctrl \
310 +ALLPROGS= athstats 80211stats athkey athchans athctrl \
311 athdebug 80211debug wlanconfig ath_info
313 +OBJS= $(patsubst %,%.o,$(ALLPROGS) do_multi)
314 +ALL= ${OBJS} madwifi_multi
318 INCS= -I. -I$(HAL) -I$(TOP) -I$(ATH_HAL)
323 -athstats: athstats.c
324 - $(CC) -o athstats $(ALL_CFLAGS) -I$(TOP)/ath $(LDFLAGS) athstats.c
325 -80211stats: 80211stats.c
326 - $(CC) -o 80211stats $(ALL_CFLAGS) $(LDFLAGS) 80211stats.c
328 - $(CC) -o athkey $(ALL_CFLAGS) $(LDFLAGS) athkey.c
329 -athchans: athchans.c
330 - $(CC) -o athchans $(ALL_CFLAGS) $(LDFLAGS) athchans.c
332 - $(CC) -o athctrl $(ALL_CFLAGS) $(LDFLAGS) athctrl.c
333 -athdebug: athdebug.c
334 - $(CC) -o athdebug $(ALL_CFLAGS) $(LDFLAGS) athdebug.c
335 -wlanconfig: wlanconfig.c
336 - $(CC) -o wlanconfig $(ALL_CFLAGS) $(LDFLAGS) wlanconfig.c
337 -80211debug: 80211debug.c
338 - $(CC) -o 80211debug $(ALL_CFLAGS) $(LDFLAGS) 80211debug.c
339 -ath_info: ath_info.c
340 - $(CC) -o ath_info $(CFLAGS) ath_info.c
342 +athstats.o: athstats.c
343 + ${CC} -c -o athstats.o -DDOMULTI=1 ${ALL_CFLAGS} -I../ath athstats.c
344 +80211stats.o: 80211stats.c
345 + ${CC} -c -o 80211stats.o -DDOMULTI=1 ${ALL_CFLAGS} 80211stats.c
346 +ath_info.o: ath_info.c
347 + ${CC} -c -o ath_info.o -DDOMULTI=1 ${ALL_CFLAGS} ath_info.c
349 + ${CC} -c -o athkey.o -DDOMULTI=1 ${ALL_CFLAGS} athkey.c
350 +athchans.o: athchans.c
351 + ${CC} -c -o athchans.o -DDOMULTI=1 ${ALL_CFLAGS} athchans.c
352 +athctrl.o: athctrl.c
353 + ${CC} -c -o athctrl.o -DDOMULTI=1 ${ALL_CFLAGS} athctrl.c
354 +athdebug.o: athdebug.c
355 + ${CC} -c -o athdebug.o -DDOMULTI=1 ${ALL_CFLAGS} athdebug.c
356 +wlanconfig.o: wlanconfig.c
357 + ${CC} -c -o wlanconfig.o -DDOMULTI=1 ${ALL_CFLAGS} wlanconfig.c
358 +80211debug.o: 80211debug.c
359 + ${CC} -c -o 80211debug.o -DDOMULTI=1 ${ALL_CFLAGS} 80211debug.c
360 +do_multi.o: do_multi.c
361 + ${CC} -c -o do_multi.o -DDOMULTI=1 ${ALL_CFLAGS} do_multi.c
362 +madwifi_multi: $(OBJS)
363 + ${CC} -o madwifi_multi ${LDFLAGS} ${OBJS}
364 + for i in athstats 80211stats athkey athchans athctrl athdebug wlanconfig 80211debug; do \
365 + ln -s -f madwifi_multi $$i; \
369 install -d $(DESTDIR)$(BINDIR)
370 Index: madwifi-dfs-r3053/tools/wlanconfig.c
371 ===================================================================
372 --- madwifi-dfs-r3053.orig/tools/wlanconfig.c 2007-12-13 05:25:10.850243788 +0100
373 +++ madwifi-dfs-r3053/tools/wlanconfig.c 2007-12-13 05:25:11.246266355 +0100
375 #include "net80211/ieee80211_crypto.h"
376 #include "net80211/ieee80211_ioctl.h"
379 +#include "do_multi.h"
383 * These are taken from ieee80211_node.h
387 static int verbose = 0;
392 +wlanconfig_init(int argc, char *argv[])
398 main(int argc, char *argv[])
402 const char *ifname, *cmd;
403 unsigned char bnounit = 0;
404 char *if_base = NULL;
405 Index: madwifi-dfs-r3053/tools/ath_info.c
406 ===================================================================
407 --- madwifi-dfs-r3053.orig/tools/ath_info.c 2007-12-13 05:25:10.858244244 +0100
408 +++ madwifi-dfs-r3053/tools/ath_info.c 2007-12-13 05:25:11.246266355 +0100
410 "unlawful radio transmissions!\n\n");
415 +athinfo_init(int argc, char *argv[])
417 int main(int argc, char *argv[])
421 u_int16_t eeprom_header, srev, phy_rev_5ghz, phy_rev_2ghz;