1 Index: madwifi-ng-r2568-20070710/tools/80211debug.c
2 ===================================================================
3 --- madwifi-ng-r2568-20070710.orig/tools/80211debug.c 2007-07-23 01:48:38.846193887 +0200
4 +++ madwifi-ng-r2568-20070710/tools/80211debug.c 2007-07-23 01:48:39.578235605 +0200
10 +#include "do_multi.h"
13 #define N(a) (sizeof(a)/sizeof(a[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-ng-r2568-20070710/tools/80211stats.c
37 ===================================================================
38 --- madwifi-ng-r2568-20070710.orig/tools/80211stats.c 2007-07-23 01:48:38.854194346 +0200
39 +++ madwifi-ng-r2568-20070710/tools/80211stats.c 2007-07-23 01:48:39.578235605 +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-r2568-20070710/tools/athchans.c
72 ===================================================================
73 --- madwifi-ng-r2568-20070710.orig/tools/athchans.c 2007-07-23 01:48:38.858194572 +0200
74 +++ madwifi-ng-r2568-20070710/tools/athchans.c 2007-07-23 01:48:39.598236745 +0200
76 #include "net80211/ieee80211_crypto.h"
77 #include "net80211/ieee80211_ioctl.h"
80 +#include "do_multi.h"
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-r2568-20070710/tools/athctrl.c
108 ===================================================================
109 --- madwifi-ng-r2568-20070710.orig/tools/athctrl.c 2007-07-23 01:48:38.866195027 +0200
110 +++ madwifi-ng-r2568-20070710/tools/athctrl.c 2007-07-23 01:48:39.626238340 +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-r2568-20070710/tools/athdebug.c
143 ===================================================================
144 --- madwifi-ng-r2568-20070710.orig/tools/athdebug.c 2007-07-23 01:48:38.874195486 +0200
145 +++ madwifi-ng-r2568-20070710/tools/athdebug.c 2007-07-23 01:48:39.650239706 +0200
151 +#include "do_multi.h"
154 #define N(a) (sizeof(a)/sizeof(a[0]))
156 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-r2568-20070710/tools/athkey.c
179 ===================================================================
180 --- madwifi-ng-r2568-20070710.orig/tools/athkey.c 2007-07-23 01:48:38.878195712 +0200
181 +++ madwifi-ng-r2568-20070710/tools/athkey.c 2007-07-23 01:48:39.698242443 +0200
183 #include "net80211/ieee80211_crypto.h"
184 #include "net80211/ieee80211_ioctl.h"
187 +#include "do_multi.h"
191 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-r2568-20070710/tools/athstats.c
214 ===================================================================
215 --- madwifi-ng-r2568-20070710.orig/tools/athstats.c 2007-07-23 01:48:38.886196167 +0200
216 +++ madwifi-ng-r2568-20070710/tools/athstats.c 2007-07-23 01:48:39.726244040 +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-r2568-20070710/tools/do_multi.c
250 ===================================================================
251 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
252 +++ madwifi-ng-r2568-20070710/tools/do_multi.c 2007-07-23 01:48:39.754245634 +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);
284 Index: madwifi-ng-r2568-20070710/tools/do_multi.h
285 ===================================================================
286 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
287 +++ madwifi-ng-r2568-20070710/tools/do_multi.h 2007-07-23 01:48:39.778247001 +0200
290 +int a80211debug_init(int argc, char *argv[]);
291 +int a80211stats_init(int argc, char *argv[]);
292 +int athchans_init(int argc, char *argv[]);
293 +int athctrl_init(int argc, char *argv[]);
294 +int athdebug_init(int argc, char *argv[]);
295 +int athkey_init(int argc, char *argv[]);
296 +int athstats_init(int argc, char *argv[]);
297 +int wlanconfig_init(int argc, char *argv[]);
298 Index: madwifi-ng-r2568-20070710/tools/Makefile
299 ===================================================================
300 --- madwifi-ng-r2568-20070710.orig/tools/Makefile 2007-07-23 01:48:38.902197078 +0200
301 +++ madwifi-ng-r2568-20070710/tools/Makefile 2007-07-23 01:48:39.798248141 +0200
304 ALL= athstats 80211stats athkey athchans athctrl \
305 athdebug 80211debug wlanconfig
308 +OBJS= do_multi.o athstats.o 80211stats.o athkey.o athchans.o athctrl.o \
309 + athdebug.o 80211debug.o wlanconfig.o
310 +ALL= ${OBJS} madwifi_multi
319 +athstats.o: athstats.c
320 + ${CC} -c -o athstats.o -DDOMULTI=1 ${ALL_CFLAGS} -I../ath athstats.c
321 +80211stats.o: 80211stats.c
322 + ${CC} -c -o 80211stats.o -DDOMULTI=1 ${ALL_CFLAGS} 80211stats.c
324 + ${CC} -c -o athkey.o -DDOMULTI=1 ${ALL_CFLAGS} athkey.c
325 +athchans.o: athchans.c
326 + ${CC} -c -o athchans.o -DDOMULTI=1 ${ALL_CFLAGS} athchans.c
327 +athctrl.o: athctrl.c
328 + ${CC} -c -o athctrl.o -DDOMULTI=1 ${ALL_CFLAGS} athctrl.c
329 +athdebug.o: athdebug.c
330 + ${CC} -c -o athdebug.o -DDOMULTI=1 ${ALL_CFLAGS} athdebug.c
331 +wlanconfig.o: wlanconfig.c
332 + ${CC} -c -o wlanconfig.o -DDOMULTI=1 ${ALL_CFLAGS} wlanconfig.c
333 +80211debug.o: 80211debug.c
334 + ${CC} -c -o 80211debug.o -DDOMULTI=1 ${ALL_CFLAGS} 80211debug.c
335 +do_multi.o: do_multi.c
336 + ${CC} -c -o do_multi.o -DDOMULTI=1 ${ALL_CFLAGS} do_multi.c
338 + ${CC} -o madwifi_multi ${LDFLAGS} ${OBJS}
339 + for i in athstats 80211stats athkey athchans athctrl athdebug wlanconfig 80211debug; do \
340 + ln -s -f madwifi_multi $$i; \
344 $(CC) -o athstats $(ALL_CFLAGS) -I$(TOP)/ath $(LDFLAGS) athstats.c
345 80211stats: 80211stats.c
346 Index: madwifi-ng-r2568-20070710/tools/wlanconfig.c
347 ===================================================================
348 --- madwifi-ng-r2568-20070710.orig/tools/wlanconfig.c 2007-07-23 01:48:38.910197536 +0200
349 +++ madwifi-ng-r2568-20070710/tools/wlanconfig.c 2007-07-23 01:48:39.850251108 +0200
351 #include "net80211/ieee80211_crypto.h"
352 #include "net80211/ieee80211_ioctl.h"
355 +#include "do_multi.h"
359 * These are taken from ieee80211_node.h
368 +wlanconfig_init(int argc, char *argv[])
374 main(int argc, char *argv[])
378 const char *ifname, *cmd;
379 unsigned char bnounit = 0;
380 char *if_base = NULL;