fix for madwifi radiotap support (patch by jwright)
[openwrt.git] / target / linux / package / madwifi / patches / 102-multicall_binary.patch
1 diff -ruN madwifi-ng-r1451-20060212/102-multicall_binary.patch madwifi-ng-r1451-20060212-patch/102-multicall_binary.patch
2 --- madwifi-ng-r1451-20060212/102-multicall_binary.patch        1969-12-31 19:00:00.000000000 -0500
3 +++ madwifi-ng-r1451-20060212-patch/102-multicall_binary.patch  2006-02-16 11:32:56.000000000 -0500
4 @@ -0,0 +1,367 @@
5 +diff -urN madwifi-ng-r1416-20060126/tools/80211debug.c madwifi-ng-r1416-20060126-owrt/tools/80211debug.c
6 +--- madwifi-ng-r1416-20060126/tools/80211debug.c       2005-11-23 22:23:20.000000000 +0100
7 ++++ madwifi-ng-r1416-20060126-owrt/tools/80211debug.c  2006-01-26 11:26:44.000000000 +0100
8 +@@ -49,6 +49,10 @@
9 + #include <getopt.h>
10 + #include <err.h>
11
12 ++#ifdef DOMULTI
13 ++#include "do_multi.h"
14 ++#endif
15 ++
16 + #define       N(a)    (sizeof(a)/sizeof(a[0]))
17
18 + const char *progname;
19 +@@ -176,9 +180,19 @@
20 + }
21 + #endif /* __linux__ */
22
23 ++#ifdef DOMULTI
24 ++
25 ++int
26 ++a80211debug_init(int argc, char *argv[])
27 ++{
28 ++
29 ++#else
30 ++
31 + int
32 + main(int argc, char *argv[])
33 + {
34 ++
35 ++#endif
36 +       const char *ifname = "ath0";
37 +       const char *cp, *tp;
38 +       const char *sep;
39 +diff -urN madwifi-ng-r1416-20060126/tools/80211stats.c madwifi-ng-r1416-20060126-owrt/tools/80211stats.c
40 +--- madwifi-ng-r1416-20060126/tools/80211stats.c       2005-11-23 22:52:24.000000000 +0100
41 ++++ madwifi-ng-r1416-20060126-owrt/tools/80211stats.c  2006-01-26 11:26:44.000000000 +0100
42 +@@ -58,6 +58,10 @@
43 + #include "net80211/ieee80211_crypto.h"
44 + #include "net80211/ieee80211_ioctl.h"
45
46 ++#ifdef DOMULTI
47 ++#include "do_multi.h"
48 ++#endif
49 ++
50 + #ifndef SIOCG80211STATS
51 + #define       SIOCG80211STATS (SIOCDEVPRIVATE+2)
52 + #endif
53 +@@ -239,9 +243,19 @@
54 + #undef STAT
55 + }
56
57 ++#ifdef DOMULTI
58 ++
59 ++int
60 ++a80211stats_init(int argc, char *argv[])
61 ++{
62 ++
63 ++#else
64 ++
65 + int
66 + main(int argc, char *argv[])
67 + {
68 ++
69 ++#endif
70 +       int c, len;
71 +       struct ieee80211req_sta_info *si;
72 +       u_int8_t buf[24*1024], *cp;
73 +diff -urN madwifi-ng-r1416-20060126/tools/athchans.c madwifi-ng-r1416-20060126-owrt/tools/athchans.c
74 +--- madwifi-ng-r1416-20060126/tools/athchans.c 2005-11-24 00:07:30.000000000 +0100
75 ++++ madwifi-ng-r1416-20060126-owrt/tools/athchans.c    2006-01-26 11:26:44.000000000 +0100
76 +@@ -57,6 +57,10 @@
77 + #include "net80211/ieee80211_crypto.h"
78 + #include "net80211/ieee80211_ioctl.h"
79
80 ++#ifdef DOMULTI
81 ++#include "do_multi.h"
82 ++#endif
83 ++
84 + static        int s = -1;
85 + const char *progname;
86
87 +@@ -134,9 +138,20 @@
88 + }
89
90 + #define       MAXCHAN ((int)(sizeof(struct ieee80211req_chanlist) * NBBY))
91 ++
92 ++#ifdef DOMULTI
93 ++
94 ++int
95 ++athchans_init(int argc, char *argv[])
96 ++{
97 ++
98 ++#else
99 ++
100 + int
101 + main(int argc, char *argv[])
102 + {
103 ++
104 ++#endif
105 +       const char *ifname = "wifi0";
106 +       struct ieee80211req_chanlist chanlist;
107 +       int c;
108 +diff -urN madwifi-ng-r1416-20060126/tools/athctrl.c madwifi-ng-r1416-20060126-owrt/tools/athctrl.c
109 +--- madwifi-ng-r1416-20060126/tools/athctrl.c  2005-11-23 22:23:20.000000000 +0100
110 ++++ madwifi-ng-r1416-20060126-owrt/tools/athctrl.c     2006-01-26 11:26:44.000000000 +0100
111 +@@ -52,6 +52,10 @@
112
113 + #include <net/if.h>
114
115 ++#ifdef DOMULTI
116 ++#include "do_multi.h"
117 ++#endif
118 ++
119 + static int
120 + setsysctrl(const char *dev, const char *control , u_long value)
121 + {
122 +@@ -83,9 +87,19 @@
123 +     exit(1);
124 + }
125
126 ++#ifdef DOMULTI
127 ++
128 ++int
129 ++athctrl_init(int argc, char *argv[])
130 ++{
131 ++
132 ++#else
133 ++
134 + int
135 + main(int argc, char *argv[])
136 + {
137 ++
138 ++#endif
139 +       char device[IFNAMSIZ + 1];
140 +       int distance = -1;
141 +       int c;
142 +diff -urN madwifi-ng-r1416-20060126/tools/athdebug.c madwifi-ng-r1416-20060126-owrt/tools/athdebug.c
143 +--- madwifi-ng-r1416-20060126/tools/athdebug.c 2005-11-23 22:23:20.000000000 +0100
144 ++++ madwifi-ng-r1416-20060126-owrt/tools/athdebug.c    2006-01-26 11:26:44.000000000 +0100
145 +@@ -52,6 +52,10 @@
146 + #include <getopt.h>
147 + #include <err.h>
148
149 ++#ifdef DOMULTI
150 ++#include "do_multi.h"
151 ++#endif
152 ++
153 + #define       N(a)    (sizeof(a)/sizeof(a[0]))
154
155 + const char *progname;
156 +@@ -170,9 +174,20 @@
157 + }
158 + #endif /* __linux__ */
159
160 ++#ifdef DOMULTI
161 ++
162 ++int
163 ++athdebug_init(int argc, char *argv[])
164 ++{
165 ++
166 ++#else
167 ++
168 + int
169 + main(int argc, char *argv[])
170 + {
171 ++
172 ++#endif
173 ++
174 + #ifdef __linux__
175 +       const char *ifname = "wifi0";
176 + #else
177 +diff -urN madwifi-ng-r1416-20060126/tools/athkey.c madwifi-ng-r1416-20060126-owrt/tools/athkey.c
178 +--- madwifi-ng-r1416-20060126/tools/athkey.c   2005-11-24 00:07:30.000000000 +0100
179 ++++ madwifi-ng-r1416-20060126-owrt/tools/athkey.c      2006-01-26 11:26:44.000000000 +0100
180 +@@ -57,6 +57,10 @@
181 + #include "net80211/ieee80211_crypto.h"
182 + #include "net80211/ieee80211_ioctl.h"
183
184 ++#ifdef DOMULTI
185 ++#include "do_multi.h"
186 ++#endif
187 ++
188 + static        int s = -1;
189 + const char *progname;
190
191 +@@ -207,9 +211,19 @@
192 +       exit(-1);
193 + }
194
195 ++#ifdef DOMULTI
196 ++
197 ++int
198 ++athkey_init(int argc, char *argv[])
199 ++{
200 ++
201 ++#else
202 ++
203 + int
204 + main(int argc, char *argv[])
205 + {
206 ++
207 ++#endif
208 +       const char *ifname = "wifi0";
209 +       struct ieee80211req_key setkey;
210 +       struct ieee80211req_del_key delkey;
211 +diff -urN madwifi-ng-r1416-20060126/tools/athstats.c madwifi-ng-r1416-20060126-owrt/tools/athstats.c
212 +--- madwifi-ng-r1416-20060126/tools/athstats.c 2006-01-16 09:59:07.000000000 +0100
213 ++++ madwifi-ng-r1416-20060126-owrt/tools/athstats.c    2006-01-26 11:26:44.000000000 +0100
214 +@@ -64,6 +64,10 @@
215 + #include "ah_desc.h"
216 + #include "if_athioctl.h"
217
218 ++#ifdef DOMULTI
219 ++#include "do_multi.h"
220 ++#endif
221 ++
222 + static const struct {
223 +       u_int           phyerr;
224 +       const char*     desc;
225 +@@ -242,9 +246,20 @@
226 +       signalled = 1;
227 + }
228
229 ++#ifdef DOMULTI
230 ++
231 ++int
232 ++athstats_init(int argc, char *argv[])
233 ++{
234 ++
235 ++#else
236 ++
237 + int
238 + main(int argc, char *argv[])
239 + {
240 ++
241 ++#endif
242 ++
243 + #ifdef __linux__
244 +       const char *ifname = "wifi0";
245 + #else
246 +diff -urN madwifi-ng-r1416-20060126/tools/do_multi.c madwifi-ng-r1416-20060126-owrt/tools/do_multi.c
247 +--- madwifi-ng-r1416-20060126/tools/do_multi.c 1970-01-01 01:00:00.000000000 +0100
248 ++++ madwifi-ng-r1416-20060126-owrt/tools/do_multi.c    2006-01-26 11:26:44.000000000 +0100
249 +@@ -0,0 +1,30 @@
250 ++#include <string.h>
251 ++#include "do_multi.h"
252 ++
253 ++int
254 ++main(int argc, char *argv[])
255 ++{
256 ++    char *progname;
257 ++    int ret = 0;
258 ++
259 ++    progname = basename(argv[0]);
260 ++
261 ++    if(strcmp(progname, "80211debug") == 0)
262 ++      ret = a80211debug_init(argc, argv);
263 ++    if(strcmp(progname, "80211stats") == 0)
264 ++      ret = a80211stats_init(argc, argv);
265 ++    if(strcmp(progname, "athchans") == 0)
266 ++      ret = athchans_init(argc, argv);
267 ++    if(strcmp(progname, "athctrl") == 0)
268 ++      ret =  athctrl_init(argc, argv);
269 ++    if(strcmp(progname, "athdebug") == 0)
270 ++      ret =  athdebug_init(argc, argv);
271 ++    if(strcmp(progname, "athkey") == 0)
272 ++      ret =  athkey_init(argc, argv);
273 ++    if(strcmp(progname, "athstats") == 0)
274 ++      ret =  athstats_init(argc, argv);
275 ++    if(strcmp(progname, "wlanconfig") == 0)
276 ++      ret =  wlanconfig_init(argc, argv);
277 ++    
278 ++    return ret;
279 ++}
280 +diff -urN madwifi-ng-r1416-20060126/tools/do_multi.h madwifi-ng-r1416-20060126-owrt/tools/do_multi.h
281 +--- madwifi-ng-r1416-20060126/tools/do_multi.h 1970-01-01 01:00:00.000000000 +0100
282 ++++ madwifi-ng-r1416-20060126-owrt/tools/do_multi.h    2006-01-26 11:26:44.000000000 +0100
283 +@@ -0,0 +1,9 @@
284 ++
285 ++int a80211debug_init(int argc, char *argv[]);
286 ++int a80211stats_init(int argc, char *argv[]);
287 ++int athchans_init(int argc, char *argv[]);
288 ++int athctrl_init(int argc, char *argv[]);
289 ++int athdebug_init(int argc, char *argv[]);
290 ++int athkey_init(int argc, char *argv[]);
291 ++int athstats_init(int argc, char *argv[]);
292 ++int wlanconfig_init(int argc, char *argv[]);
293 +diff -urN madwifi-ng-r1416-20060126/tools/Makefile madwifi-ng-r1416-20060126-owrt/tools/Makefile
294 +--- madwifi-ng-r1416-20060126/tools/Makefile   2006-01-04 09:16:11.000000000 +0100
295 ++++ madwifi-ng-r1416-20060126-owrt/tools/Makefile      2006-01-26 14:52:45.000000000 +0100
296 +@@ -50,6 +50,12 @@
297 + ALL=  athstats 80211stats athkey athchans athctrl \
298 +       athdebug 80211debug wlanconfig
299
300 ++ifdef DOMULTI
301 ++OBJS= do_multi.o athstats.o 80211stats.o athkey.o athchans.o athctrl.o \
302 ++      athdebug.o 80211debug.o wlanconfig.o 
303 ++ALL=  ${OBJS} madwifi_multi
304 ++endif
305 ++
306 + all:  ${ALL}
307
308 + INCS+=        -I. -I${HAL} -I${DEPTH}
309 +@@ -59,6 +65,28 @@
310
311 + all:  ${ALL}
312
313 ++athstats.o: athstats.c
314 ++      ${CC} -c -o athstats.o -DDOMULTI=1 ${ALL_CFLAGS} -I../ath athstats.c
315 ++80211stats.o: 80211stats.c
316 ++      ${CC} -c -o 80211stats.o -DDOMULTI=1 ${ALL_CFLAGS} 80211stats.c
317 ++athkey.o: athkey.c
318 ++      ${CC} -c -o athkey.o -DDOMULTI=1 ${ALL_CFLAGS} athkey.c
319 ++athchans.o: athchans.c
320 ++      ${CC} -c -o athchans.o -DDOMULTI=1 ${ALL_CFLAGS} athchans.c
321 ++athctrl.o: athctrl.c
322 ++      ${CC} -c -o athctrl.o -DDOMULTI=1 ${ALL_CFLAGS} athctrl.c
323 ++athdebug.o: athdebug.c
324 ++      ${CC} -c -o athdebug.o -DDOMULTI=1 ${ALL_CFLAGS} athdebug.c
325 ++wlanconfig.o: wlanconfig.c
326 ++      ${CC} -c -o wlanconfig.o -DDOMULTI=1 ${ALL_CFLAGS} wlanconfig.c
327 ++80211debug.o: 80211debug.c
328 ++      ${CC} -c -o 80211debug.o -DDOMULTI=1 ${ALL_CFLAGS} 80211debug.c
329 ++madwifi_multi:
330 ++      ${CC} -o madwifi_multi ${LDFLAGS} ${OBJS}
331 ++      for i in athstats 80211stats athkey athchans athctrl athdebug wlanconfig 80211debug; do \
332 ++      ln -s -f madwifi_multi $$i; \
333 ++      done
334 ++
335 + athstats: athstats.c
336 +       ${CC} -o athstats ${ALL_CFLAGS} -I../ath ${LDFLAGS} athstats.c
337 + 80211stats: 80211stats.c
338 +diff -urN madwifi-ng-r1416-20060126/tools/wlanconfig.c madwifi-ng-r1416-20060126-owrt/tools/wlanconfig.c
339 +--- madwifi-ng-r1416-20060126/tools/wlanconfig.c       2006-01-22 10:58:31.000000000 +0100
340 ++++ madwifi-ng-r1416-20060126-owrt/tools/wlanconfig.c  2006-01-26 11:26:44.000000000 +0100
341 +@@ -57,6 +57,10 @@
342 + #include "net80211/ieee80211_crypto.h"
343 + #include "net80211/ieee80211_ioctl.h"
344
345 ++#ifdef DOMULTI
346 ++#include "do_multi.h"
347 ++#endif
348 ++
349 + /*
350 +  * These are taken from ieee80211_node.h
351 +  */
352 +@@ -91,9 +95,19 @@
353
354 + int   verbose = 0;
355
356 ++#ifdef DOMULTI
357 ++
358 ++int
359 ++wlanconfig_init(int argc, char *argv[])
360 ++{
361 ++
362 ++#else
363 ++
364 + int
365 + main(int argc, char *argv[])
366 + {
367 ++
368 ++#endif
369 +       const char *ifname, *cmd;
370
371 +       if (argc < 2)
372 diff -ruN madwifi-ng-r1451-20060212/tools/80211debug.c madwifi-ng-r1451-20060212-patch/tools/80211debug.c
373 --- madwifi-ng-r1451-20060212/tools/80211debug.c        2006-02-01 15:07:11.000000000 -0500
374 +++ madwifi-ng-r1451-20060212-patch/tools/80211debug.c  2006-02-16 11:33:14.000000000 -0500
375 @@ -49,6 +49,10 @@
376  #include <getopt.h>
377  #include <err.h>
378  
379 +#ifdef DOMULTI
380 +#include "do_multi.h"
381 +#endif
382 +
383  #define        N(a)    (sizeof(a)/sizeof(a[0]))
384  
385  const char *progname;
386 @@ -176,9 +180,19 @@
387  }
388  #endif /* __linux__ */
389  
390 +#ifdef DOMULTI
391 +
392 +int
393 +a80211debug_init(int argc, char *argv[])
394 +{
395 +
396 +#else
397 +
398  int
399  main(int argc, char *argv[])
400  {
401 +
402 +#endif
403         const char *ifname = "ath0";
404         const char *cp, *tp;
405         const char *sep;
406 diff -ruN madwifi-ng-r1451-20060212/tools/80211stats.c madwifi-ng-r1451-20060212-patch/tools/80211stats.c
407 --- madwifi-ng-r1451-20060212/tools/80211stats.c        2006-02-01 15:10:07.000000000 -0500
408 +++ madwifi-ng-r1451-20060212-patch/tools/80211stats.c  2006-02-16 11:33:14.000000000 -0500
409 @@ -58,6 +58,10 @@
410  #include "net80211/ieee80211_crypto.h"
411  #include "net80211/ieee80211_ioctl.h"
412  
413 +#ifdef DOMULTI
414 +#include "do_multi.h"
415 +#endif
416 +
417  #ifndef SIOCG80211STATS
418  #define        SIOCG80211STATS (SIOCDEVPRIVATE + 2)
419  #endif
420 @@ -239,9 +243,19 @@
421  #undef STAT
422  }
423  
424 +#ifdef DOMULTI
425 +
426 +int
427 +a80211stats_init(int argc, char *argv[])
428 +{
429 +
430 +#else
431 +
432  int
433  main(int argc, char *argv[])
434  {
435 +
436 +#endif
437         int c, len;
438         struct ieee80211req_sta_info *si;
439         u_int8_t buf[24*1024], *cp;
440 diff -ruN madwifi-ng-r1451-20060212/tools/Makefile madwifi-ng-r1451-20060212-patch/tools/Makefile
441 --- madwifi-ng-r1451-20060212/tools/Makefile    2006-01-04 03:16:11.000000000 -0500
442 +++ madwifi-ng-r1451-20060212-patch/tools/Makefile      2006-02-16 11:38:53.000000000 -0500
443 @@ -50,6 +50,12 @@
444  ALL=   athstats 80211stats athkey athchans athctrl \
445         athdebug 80211debug wlanconfig
446  
447 +ifdef DOMULTI
448 +OBJS=  do_multi.o athstats.o 80211stats.o athkey.o athchans.o athctrl.o \
449 +       athdebug.o 80211debug.o wlanconfig.o 
450 +ALL=   ${OBJS} madwifi_multi
451 +endif
452 +
453  all:   ${ALL}
454  
455  INCS+= -I. -I${HAL} -I${DEPTH}
456 @@ -59,6 +65,30 @@
457  
458  all:   ${ALL}
459  
460 +athstats.o: athstats.c
461 +       ${CC} -c -o athstats.o -DDOMULTI=1 ${ALL_CFLAGS} -I../ath athstats.c
462 +80211stats.o: 80211stats.c
463 +       ${CC} -c -o 80211stats.o -DDOMULTI=1 ${ALL_CFLAGS} 80211stats.c
464 +athkey.o: athkey.c
465 +       ${CC} -c -o athkey.o -DDOMULTI=1 ${ALL_CFLAGS} athkey.c
466 +athchans.o: athchans.c
467 +       ${CC} -c -o athchans.o -DDOMULTI=1 ${ALL_CFLAGS} athchans.c
468 +athctrl.o: athctrl.c
469 +       ${CC} -c -o athctrl.o -DDOMULTI=1 ${ALL_CFLAGS} athctrl.c
470 +athdebug.o: athdebug.c
471 +       ${CC} -c -o athdebug.o -DDOMULTI=1 ${ALL_CFLAGS} athdebug.c
472 +wlanconfig.o: wlanconfig.c
473 +       ${CC} -c -o wlanconfig.o -DDOMULTI=1 ${ALL_CFLAGS} wlanconfig.c
474 +80211debug.o: 80211debug.c
475 +       ${CC} -c -o 80211debug.o -DDOMULTI=1 ${ALL_CFLAGS} 80211debug.c
476 +do_multi.o: do_multi.c
477 +       ${CC} -c -o do_multi.o -DDOMULTI=1 ${ALL_CFLAGS} do_multi.c
478 +madwifi_multi:
479 +       ${CC} -o madwifi_multi ${LDFLAGS} ${OBJS}
480 +       for i in athstats 80211stats athkey athchans athctrl athdebug wlanconfig 80211debug; do \
481 +       ln -s -f madwifi_multi $$i; \
482 +       done
483 +
484  athstats: athstats.c
485         ${CC} -o athstats ${ALL_CFLAGS} -I../ath ${LDFLAGS} athstats.c
486  80211stats: 80211stats.c
487 diff -ruN madwifi-ng-r1451-20060212/tools/athchans.c madwifi-ng-r1451-20060212-patch/tools/athchans.c
488 --- madwifi-ng-r1451-20060212/tools/athchans.c  2006-02-01 15:07:11.000000000 -0500
489 +++ madwifi-ng-r1451-20060212-patch/tools/athchans.c    2006-02-16 11:33:14.000000000 -0500
490 @@ -57,6 +57,10 @@
491  #include "net80211/ieee80211_crypto.h"
492  #include "net80211/ieee80211_ioctl.h"
493  
494 +#ifdef DOMULTI
495 +#include "do_multi.h"
496 +#endif
497 +
498  static int s = -1;
499  const char *progname;
500  
501 @@ -134,9 +138,20 @@
502  }
503  
504  #define        MAXCHAN ((int)(sizeof(struct ieee80211req_chanlist) * NBBY))
505 +
506 +#ifdef DOMULTI
507 +
508 +int
509 +athchans_init(int argc, char *argv[])
510 +{
511 +
512 +#else
513 +
514  int
515  main(int argc, char *argv[])
516  {
517 +
518 +#endif
519         const char *ifname = "wifi0";
520         struct ieee80211req_chanlist chanlist;
521         int c;
522 diff -ruN madwifi-ng-r1451-20060212/tools/athctrl.c madwifi-ng-r1451-20060212-patch/tools/athctrl.c
523 --- madwifi-ng-r1451-20060212/tools/athctrl.c   2006-02-03 07:03:03.000000000 -0500
524 +++ madwifi-ng-r1451-20060212-patch/tools/athctrl.c     2006-02-16 11:33:14.000000000 -0500
525 @@ -53,6 +53,10 @@
526  
527  #include <net/if.h>
528  
529 +#ifdef DOMULTI
530 +#include "do_multi.h"
531 +#endif
532 +
533  static int
534  setsysctrl(const char *dev, const char *control , u_long value)
535  {
536 @@ -87,9 +91,19 @@
537      exit(1);
538  }
539  
540 +#ifdef DOMULTI
541 +
542 +int
543 +athctrl_init(int argc, char *argv[])
544 +{
545 +
546 +#else
547 +
548  int
549  main(int argc, char *argv[])
550  {
551 +
552 +#endif
553         char device[IFNAMSIZ + 1];
554         int distance = -1;
555         int c;
556 diff -ruN madwifi-ng-r1451-20060212/tools/athdebug.c madwifi-ng-r1451-20060212-patch/tools/athdebug.c
557 --- madwifi-ng-r1451-20060212/tools/athdebug.c  2006-02-06 15:20:57.000000000 -0500
558 +++ madwifi-ng-r1451-20060212-patch/tools/athdebug.c    2006-02-16 11:33:14.000000000 -0500
559 @@ -52,6 +52,10 @@
560  #include <getopt.h>
561  #include <err.h>
562  
563 +#ifdef DOMULTI
564 +#include "do_multi.h"
565 +#endif
566 +
567  #define        N(a)    (sizeof(a)/sizeof(a[0]))
568  
569  const char *progname;
570 @@ -170,9 +174,20 @@
571  }
572  #endif /* __linux__ */
573  
574 +#ifdef DOMULTI
575 +
576 +int
577 +athdebug_init(int argc, char *argv[])
578 +{
579 +
580 +#else
581 +
582  int
583  main(int argc, char *argv[])
584  {
585 +
586 +#endif
587 +
588  #ifdef __linux__
589         const char *ifname = "wifi0";
590  #else
591 diff -ruN madwifi-ng-r1451-20060212/tools/athkey.c madwifi-ng-r1451-20060212-patch/tools/athkey.c
592 --- madwifi-ng-r1451-20060212/tools/athkey.c    2006-02-01 15:07:11.000000000 -0500
593 +++ madwifi-ng-r1451-20060212-patch/tools/athkey.c      2006-02-16 11:33:45.000000000 -0500
594 @@ -57,6 +57,10 @@
595  #include "net80211/ieee80211_crypto.h"
596  #include "net80211/ieee80211_ioctl.h"
597  
598 +#ifdef DOMULTI
599 +#include "do_multi.h"
600 +#endif
601 +
602  static int s = -1;
603  const char *progname;
604  
605 @@ -207,9 +211,19 @@
606         exit(-1);
607  }
608  
609 +#ifdef DOMULTI
610 +
611 +int
612 +athkey_init(int argc, char *argv[])
613 +{
614 +
615 +#else
616 +
617  int
618  main(int argc, char *argv[])
619  {
620 +
621 +#endif
622         const char *ifname = "wifi0";
623         struct ieee80211req_key setkey;
624         struct ieee80211req_del_key delkey;
625 diff -ruN madwifi-ng-r1451-20060212/tools/athstats.c madwifi-ng-r1451-20060212-patch/tools/athstats.c
626 --- madwifi-ng-r1451-20060212/tools/athstats.c  2006-02-01 15:07:11.000000000 -0500
627 +++ madwifi-ng-r1451-20060212-patch/tools/athstats.c    2006-02-16 11:33:14.000000000 -0500
628 @@ -64,6 +64,10 @@
629  #include "ah_desc.h"
630  #include "if_athioctl.h"
631  
632 +#ifdef DOMULTI
633 +#include "do_multi.h"
634 +#endif
635 +
636  static const struct {
637         u_int           phyerr;
638         const char*     desc;
639 @@ -242,9 +246,20 @@
640         signalled = 1;
641  }
642  
643 +#ifdef DOMULTI
644 +
645 +int
646 +athstats_init(int argc, char *argv[])
647 +{
648 +
649 +#else
650 +
651  int
652  main(int argc, char *argv[])
653  {
654 +
655 +#endif
656 +
657  #ifdef __linux__
658         const char *ifname = "wifi0";
659  #else
660 diff -ruN madwifi-ng-r1451-20060212/tools/do_multi.c madwifi-ng-r1451-20060212-patch/tools/do_multi.c
661 --- madwifi-ng-r1451-20060212/tools/do_multi.c  1969-12-31 19:00:00.000000000 -0500
662 +++ madwifi-ng-r1451-20060212-patch/tools/do_multi.c    2006-02-16 11:33:14.000000000 -0500
663 @@ -0,0 +1,30 @@
664 +#include <string.h>
665 +#include "do_multi.h"
666 +
667 +int
668 +main(int argc, char *argv[])
669 +{
670 +    char *progname;
671 +    int ret = 0;
672 +
673 +    progname = basename(argv[0]);
674 +
675 +    if(strcmp(progname, "80211debug") == 0)
676 +       ret = a80211debug_init(argc, argv);
677 +    if(strcmp(progname, "80211stats") == 0)
678 +       ret = a80211stats_init(argc, argv);
679 +    if(strcmp(progname, "athchans") == 0)
680 +       ret = athchans_init(argc, argv);
681 +    if(strcmp(progname, "athctrl") == 0)
682 +       ret =  athctrl_init(argc, argv);
683 +    if(strcmp(progname, "athdebug") == 0)
684 +       ret =  athdebug_init(argc, argv);
685 +    if(strcmp(progname, "athkey") == 0)
686 +       ret =  athkey_init(argc, argv);
687 +    if(strcmp(progname, "athstats") == 0)
688 +       ret =  athstats_init(argc, argv);
689 +    if(strcmp(progname, "wlanconfig") == 0)
690 +       ret =  wlanconfig_init(argc, argv);
691 +    
692 +    return ret;
693 +}
694 diff -ruN madwifi-ng-r1451-20060212/tools/do_multi.h madwifi-ng-r1451-20060212-patch/tools/do_multi.h
695 --- madwifi-ng-r1451-20060212/tools/do_multi.h  1969-12-31 19:00:00.000000000 -0500
696 +++ madwifi-ng-r1451-20060212-patch/tools/do_multi.h    2006-02-16 11:33:14.000000000 -0500
697 @@ -0,0 +1,9 @@
698 +
699 +int a80211debug_init(int argc, char *argv[]);
700 +int a80211stats_init(int argc, char *argv[]);
701 +int athchans_init(int argc, char *argv[]);
702 +int athctrl_init(int argc, char *argv[]);
703 +int athdebug_init(int argc, char *argv[]);
704 +int athkey_init(int argc, char *argv[]);
705 +int athstats_init(int argc, char *argv[]);
706 +int wlanconfig_init(int argc, char *argv[]);
707 diff -ruN madwifi-ng-r1451-20060212/tools/wlanconfig.c madwifi-ng-r1451-20060212-patch/tools/wlanconfig.c
708 --- madwifi-ng-r1451-20060212/tools/wlanconfig.c        2006-02-01 15:07:11.000000000 -0500
709 +++ madwifi-ng-r1451-20060212-patch/tools/wlanconfig.c  2006-02-16 11:33:14.000000000 -0500
710 @@ -59,6 +59,10 @@
711  #include "net80211/ieee80211_crypto.h"
712  #include "net80211/ieee80211_ioctl.h"
713  
714 +#ifdef DOMULTI
715 +#include "do_multi.h"
716 +#endif
717 +
718  /*
719   * These are taken from ieee80211_node.h
720   */
721 @@ -92,9 +96,19 @@
722  
723  int verbose = 0;
724  
725 +#ifdef DOMULTI
726 +
727 +int
728 +wlanconfig_init(int argc, char *argv[])
729 +{
730 +
731 +#else
732 +
733  int
734  main(int argc, char *argv[])
735  {
736 +
737 +#endif
738         const char *ifname, *cmd;
739  
740         if (argc < 2)