1 Index: madwifi-ng-r2756-20071018/tools/80211debug.c
2 ===================================================================
3 --- madwifi-ng-r2756-20071018.orig/tools/80211debug.c 2007-10-24 06:20:16.793646294 +0200
4 +++ madwifi-ng-r2756-20071018/tools/80211debug.c 2007-10-24 06:20:17.233671372 +0200
10 +#include "do_multi.h"
13 #define N(a) (sizeof(a)/sizeof(a[0]))
15 static const char *progname;
18 #endif /* __linux__ */
23 +a80211debug_init(int argc, char *argv[])
29 main(int argc, char *argv[])
33 const char *ifname = "ath0";
36 Index: madwifi-ng-r2756-20071018/tools/80211stats.c
37 ===================================================================
38 --- madwifi-ng-r2756-20071018.orig/tools/80211stats.c 2007-10-24 06:20:16.801646748 +0200
39 +++ madwifi-ng-r2756-20071018/tools/80211stats.c 2007-10-24 06:20:17.233671372 +0200
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-ng-r2756-20071018/tools/athchans.c
72 ===================================================================
73 --- madwifi-ng-r2756-20071018.orig/tools/athchans.c 2007-10-24 06:20:16.805646977 +0200
74 +++ madwifi-ng-r2756-20071018/tools/athchans.c 2007-10-24 06:20:17.241671823 +0200
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-ng-r2756-20071018/tools/athctrl.c
108 ===================================================================
109 --- madwifi-ng-r2756-20071018.orig/tools/athctrl.c 2007-10-24 06:20:16.813647434 +0200
110 +++ madwifi-ng-r2756-20071018/tools/athctrl.c 2007-10-24 06:20:17.245672052 +0200
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-ng-r2756-20071018/tools/athdebug.c
143 ===================================================================
144 --- madwifi-ng-r2756-20071018.orig/tools/athdebug.c 2007-10-24 06:20:16.821647888 +0200
145 +++ madwifi-ng-r2756-20071018/tools/athdebug.c 2007-10-24 06:20:17.249672281 +0200
151 +#include "do_multi.h"
154 #define N(a) (sizeof(a)/sizeof(a[0]))
156 static const char *progname;
159 #endif /* __linux__ */
164 +athdebug_init(int argc, char *argv[])
170 main(int argc, char *argv[])
176 const char *ifname = "wifi0";
178 Index: madwifi-ng-r2756-20071018/tools/athkey.c
179 ===================================================================
180 --- madwifi-ng-r2756-20071018.orig/tools/athkey.c 2007-10-24 06:20:16.825648116 +0200
181 +++ madwifi-ng-r2756-20071018/tools/athkey.c 2007-10-24 06:20:17.249672281 +0200
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-ng-r2756-20071018/tools/athstats.c
214 ===================================================================
215 --- madwifi-ng-r2756-20071018.orig/tools/athstats.c 2007-10-24 06:20:16.833648573 +0200
216 +++ madwifi-ng-r2756-20071018/tools/athstats.c 2007-10-24 06:20:17.249672281 +0200
218 #include "wireless_copy.h"
219 #include "if_athioctl.h"
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-ng-r2756-20071018/tools/do_multi.c
250 ===================================================================
251 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
252 +++ madwifi-ng-r2756-20071018/tools/do_multi.c 2007-10-24 06:20:17.249672281 +0200
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-ng-r2756-20071018/tools/do_multi.h
287 ===================================================================
288 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
289 +++ madwifi-ng-r2756-20071018/tools/do_multi.h 2007-10-24 06:20:17.249672281 +0200
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-ng-r2756-20071018/tools/Makefile
302 ===================================================================
303 --- madwifi-ng-r2756-20071018.orig/tools/Makefile 2007-10-24 06:20:16.849649487 +0200
304 +++ madwifi-ng-r2756-20071018/tools/Makefile 2007-10-24 06:20:17.253672511 +0200
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-ng-r2756-20071018/tools/wlanconfig.c
371 ===================================================================
372 --- madwifi-ng-r2756-20071018.orig/tools/wlanconfig.c 2007-10-24 06:20:16.857649938 +0200
373 +++ madwifi-ng-r2756-20071018/tools/wlanconfig.c 2007-10-24 06:20:17.253672511 +0200
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-ng-r2756-20071018/tools/ath_info.c
406 ===================================================================
407 --- madwifi-ng-r2756-20071018.orig/tools/ath_info.c 2007-10-24 06:20:16.865650396 +0200
408 +++ madwifi-ng-r2756-20071018/tools/ath_info.c 2007-10-24 06:20:17.253672511 +0200
410 "unlawful radio transmissions!\n\n");
415 +athinfo_init(int argc, char *argv[])
418 main(int argc, char *argv[])
422 u_int16_t eeprom_header, srev, phy_rev_5ghz, phy_rev_2ghz;