1 Index: madwifi-trunk-r3314/kernelversion.c
2 ===================================================================
3 --- madwifi-trunk-r3314.orig/kernelversion.c 2010-03-03 11:24:57.250287480 +0100
4 +++ madwifi-trunk-r3314/kernelversion.c 2010-03-03 11:25:30.255287207 +0100
7 /* Linux 2.6.18+ uses <linux/utsrelease.h> */
9 -#include <linux/utsrelease.h>
10 + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
11 + #include <generated/utsrelease.h>
13 + #include <linux/utsrelease.h>
17 char *uts_release = UTS_RELEASE;
18 Index: madwifi-trunk-r3314/ath/if_ath.c
19 ===================================================================
20 --- madwifi-trunk-r3314.orig/ath/if_ath.c 2010-03-03 11:25:33.266287431 +0100
21 +++ madwifi-trunk-r3314/ath/if_ath.c 2010-03-03 12:07:39.606288303 +0100
22 @@ -11580,227 +11580,231 @@
23 static int maxint = 0x7fffffff; /* 32-bit big */
25 static const ctl_table ath_sysctl_template[] = {
26 - { .ctl_name = CTL_AUTO,
28 .procname = "dev_vendor",
30 .proc_handler = ath_sysctl_hwinfo,
31 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
32 .strategy = &sysctl_string,
36 .extra2 = (void *)ATH_CARD_VENDOR,
38 - { .ctl_name = CTL_AUTO,
40 .procname = "dev_name",
42 .proc_handler = ath_sysctl_hwinfo,
43 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
44 .strategy = &sysctl_string,
48 .extra2 = (void *)ATH_CARD_NAME,
50 - { .ctl_name = CTL_AUTO,
52 .procname = "slottime",
54 .proc_handler = ath_sysctl_halparam,
55 .extra2 = (void *)ATH_SLOTTIME,
57 - { .ctl_name = CTL_AUTO,
59 .procname = "acktimeout",
61 .proc_handler = ath_sysctl_halparam,
62 .extra2 = (void *)ATH_ACKTIMEOUT,
64 - { .ctl_name = CTL_AUTO,
66 .procname = "ctstimeout",
68 .proc_handler = ath_sysctl_halparam,
69 .extra2 = (void *)ATH_CTSTIMEOUT,
71 - { .ctl_name = CTL_AUTO,
73 .procname = "distance",
75 .proc_handler = ath_sysctl_halparam,
76 .extra2 = (void *)ATH_DISTANCE,
78 - { .ctl_name = CTL_AUTO,
82 .proc_handler = ath_sysctl_halparam,
83 .extra2 = (void *)ATH_SILENT,
85 - { .ctl_name = CTL_AUTO,
87 .procname = "softled",
89 .proc_handler = ath_sysctl_halparam,
90 .extra2 = (void *)ATH_SOFTLED,
92 - { .ctl_name = CTL_AUTO,
96 .proc_handler = ath_sysctl_halparam,
97 .extra2 = (void *)ATH_LEDPIN,
99 - { .ctl_name = CTL_AUTO,
100 + { CTLNAME(CTL_AUTO)
101 .procname = "countrycode",
103 .proc_handler = ath_sysctl_halparam,
104 .extra2 = (void *)ATH_COUNTRYCODE,
106 - { .ctl_name = CTL_AUTO,
107 + { CTLNAME(CTL_AUTO)
108 .procname = "outdoor",
110 .proc_handler = ath_sysctl_halparam,
111 .extra2 = (void *)ATH_OUTDOOR,
113 - { .ctl_name = CTL_AUTO,
114 + { CTLNAME(CTL_AUTO)
115 .procname = "regdomain",
117 .proc_handler = ath_sysctl_halparam,
118 .extra2 = (void *)ATH_REGDOMAIN,
121 - { .ctl_name = CTL_AUTO,
122 + { CTLNAME(CTL_AUTO)
125 .proc_handler = ath_sysctl_halparam,
126 .extra2 = (void *)ATH_DEBUG,
129 - { .ctl_name = CTL_AUTO,
130 + { CTLNAME(CTL_AUTO)
131 .procname = "poweroffset",
133 .proc_handler = ath_sysctl_halparam,
134 .extra2 = (void *)ATH_POWEROFFSET,
136 - { .ctl_name = CTL_AUTO,
137 + { CTLNAME(CTL_AUTO)
138 .procname = "txantenna",
140 .proc_handler = ath_sysctl_halparam,
141 .extra2 = (void *)ATH_TXANTENNA,
143 - { .ctl_name = CTL_AUTO,
144 + { CTLNAME(CTL_AUTO)
145 .procname = "rxantenna",
147 .proc_handler = ath_sysctl_halparam,
148 .extra2 = (void *)ATH_RXANTENNA,
150 - { .ctl_name = CTL_AUTO,
151 + { CTLNAME(CTL_AUTO)
152 .procname = "diversity",
154 .proc_handler = ath_sysctl_halparam,
155 .extra2 = (void *)ATH_DIVERSITY,
157 - { .ctl_name = CTL_AUTO,
158 + { CTLNAME(CTL_AUTO)
159 .procname = "txintrperiod",
161 .proc_handler = ath_sysctl_halparam,
162 .extra2 = (void *)ATH_TXINTRPERIOD,
164 - { .ctl_name = CTL_AUTO,
165 + { CTLNAME(CTL_AUTO)
166 .procname = "fftxqmin",
168 .proc_handler = ath_sysctl_halparam,
169 .extra2 = (void *)ATH_FFTXQMIN,
172 - { .ctl_name = CTL_AUTO,
173 + { CTLNAME(CTL_AUTO)
174 .procname = "xrpollperiod",
176 .proc_handler = ath_sysctl_halparam,
177 .extra2 = (void *)ATH_XR_POLL_PERIOD,
179 - { .ctl_name = CTL_AUTO,
180 + { CTLNAME(CTL_AUTO)
181 .procname = "xrpollcount",
183 .proc_handler = ath_sysctl_halparam,
184 .extra2 = (void *)ATH_XR_POLL_COUNT,
187 - { .ctl_name = CTL_AUTO,
188 + { CTLNAME(CTL_AUTO)
189 .procname = "ackrate",
191 .proc_handler = ath_sysctl_halparam,
192 .extra2 = (void *)ATH_ACKRATE,
194 - { .ctl_name = CTL_AUTO,
195 + { CTLNAME(CTL_AUTO)
196 .procname = "channelbw",
198 .proc_handler = ath_sysctl_halparam,
199 .extra2 = (void *)ATH_CHANBW,
201 - { .ctl_name = CTL_AUTO,
202 + { CTLNAME(CTL_AUTO)
205 .proc_handler = ath_sysctl_halparam,
206 .extra2 = (void *)ATH_RP,
208 - { .ctl_name = CTL_AUTO,
209 + { CTLNAME(CTL_AUTO)
210 .procname = "radar_print",
212 .proc_handler = ath_sysctl_halparam,
213 .extra2 = (void *)ATH_RP_PRINT,
215 - { .ctl_name = CTL_AUTO,
216 + { CTLNAME(CTL_AUTO)
217 .procname = "radar_print_all",
219 .proc_handler = ath_sysctl_halparam,
220 .extra2 = (void *)ATH_RP_PRINT_ALL,
222 - { .ctl_name = CTL_AUTO,
223 + { CTLNAME(CTL_AUTO)
224 .procname = "radar_dump",
226 .proc_handler = ath_sysctl_halparam,
227 .extra2 = (void *)ATH_RP_PRINT_MEM,
229 - { .ctl_name = CTL_AUTO,
230 + { CTLNAME(CTL_AUTO)
231 .procname = "radar_dump_all",
233 .proc_handler = ath_sysctl_halparam,
234 .extra2 = (void *)ATH_RP_PRINT_MEM_ALL,
236 - { .ctl_name = CTL_AUTO,
237 + { CTLNAME(CTL_AUTO)
238 .procname = "rp_flush",
240 .proc_handler = ath_sysctl_halparam,
241 .extra2 = (void *)ATH_RP_FLUSH,
243 - { .ctl_name = CTL_AUTO,
244 + { CTLNAME(CTL_AUTO)
247 .proc_handler = ath_sysctl_halparam,
248 .extra2 = (void *)ATH_PANIC,
250 - { .ctl_name = CTL_AUTO,
251 + { CTLNAME(CTL_AUTO)
252 .procname = "rp_ignored",
254 .proc_handler = ath_sysctl_halparam,
255 .extra2 = (void *)ATH_RP_IGNORED,
257 - { .ctl_name = CTL_AUTO,
258 + { CTLNAME(CTL_AUTO)
259 .procname = "radar_ignored",
261 .proc_handler = ath_sysctl_halparam,
262 .extra2 = (void *)ATH_RADAR_IGNORED,
264 - { .ctl_name = CTL_AUTO,
265 + { CTLNAME(CTL_AUTO)
266 .procname = "intmit",
268 .proc_handler = ath_sysctl_halparam,
269 .extra2 = (void *)ATH_INTMIT,
271 - { .ctl_name = CTL_AUTO,
272 + { CTLNAME(CTL_AUTO)
273 .procname = "noise_immunity",
275 .proc_handler = ath_sysctl_halparam,
276 .extra2 = (void *)ATH_NOISE_IMMUNITY,
278 - { .ctl_name = CTL_AUTO,
279 + { CTLNAME(CTL_AUTO)
280 .procname = "ofdm_weak_det",
282 .proc_handler = ath_sysctl_halparam,
283 .extra2 = (void *)ATH_OFDM_WEAK_DET,
285 - { .ctl_name = CTL_AUTO,
286 + { CTLNAME(CTL_AUTO)
287 .procname = "cca_thresh",
289 .proc_handler = ath_sysctl_halparam,
290 @@ -11838,12 +11842,16 @@
292 /* setup the table */
293 memset(sc->sc_sysctls, 0, space);
294 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
295 sc->sc_sysctls[0].ctl_name = CTL_DEV;
297 sc->sc_sysctls[0].procname = "dev";
298 sc->sc_sysctls[0].mode = 0555;
299 sc->sc_sysctls[0].child = &sc->sc_sysctls[2];
300 /* [1] is NULL terminator */
301 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
302 sc->sc_sysctls[2].ctl_name = CTL_AUTO;
304 sc->sc_sysctls[2].procname = dev_name;
305 sc->sc_sysctls[2].mode = 0555;
306 sc->sc_sysctls[2].child = &sc->sc_sysctls[4];
307 @@ -11966,7 +11974,7 @@
309 static ctl_table ath_static_sysctls[] = {
311 - { .ctl_name = CTL_AUTO,
312 + { CTLNAME(CTL_AUTO)
316 @@ -11974,14 +11982,14 @@
317 .proc_handler = proc_dointvec
320 - { .ctl_name = CTL_AUTO,
321 + { CTLNAME(CTL_AUTO)
322 .procname = "xchanmode",
324 .data = &ath_xchanmode,
325 .maxlen = sizeof(ath_xchanmode),
326 .proc_handler = proc_dointvec
328 - { .ctl_name = CTL_AUTO,
329 + { CTLNAME(CTL_AUTO)
330 .procname = "calibrate",
332 .data = &ath_calinterval,
333 @@ -11993,14 +12001,14 @@
336 static ctl_table ath_ath_table[] = {
337 - { .ctl_name = DEV_ATH,
341 .child = ath_static_sysctls
344 static ctl_table ath_root_table[] = {
345 - { .ctl_name = CTL_DEV,
349 .child = ath_ath_table
350 Index: madwifi-trunk-r3314/ath/if_ath_ahb.h
351 ===================================================================
352 --- madwifi-trunk-r3314.orig/ath/if_ath_ahb.h 2010-03-03 11:32:20.295286997 +0100
353 +++ madwifi-trunk-r3314/ath/if_ath_ahb.h 2010-03-03 11:32:56.782287828 +0100
355 do { (void) (start); (void) (size); } while (0)
358 +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
359 +#define bus_dma_sync_single dma_sync_single_for_cpu
361 #define bus_dma_sync_single dma_sync_single
363 #define bus_map_single dma_map_single
364 #define bus_unmap_single dma_unmap_single
365 #define bus_alloc_consistent(_hwdev, _sz, _hdma) \
366 Index: madwifi-trunk-r3314/ath_hal/ah_os.c
367 ===================================================================
368 --- madwifi-trunk-r3314.orig/ath_hal/ah_os.c 2010-03-03 12:12:00.246286932 +0100
369 +++ madwifi-trunk-r3314/ath_hal/ah_os.c 2010-03-03 12:12:59.503287204 +0100
372 static ctl_table ath_hal_sysctls[] = {
374 - { .ctl_name = CTL_AUTO,
375 + { CTLNAME(CTL_AUTO)
378 .data = &ath_hal_debug,
379 @@ -526,21 +526,21 @@
380 .proc_handler = proc_dointvec
383 - { .ctl_name = CTL_AUTO,
384 + { CTLNAME(CTL_AUTO)
385 .procname = "dma_beacon_response_time",
386 .data = &ath_hal_dma_beacon_response_time,
387 .maxlen = sizeof(ath_hal_dma_beacon_response_time),
389 .proc_handler = proc_dointvec
391 - { .ctl_name = CTL_AUTO,
392 + { CTLNAME(CTL_AUTO)
393 .procname = "sw_beacon_response_time",
395 .data = &ath_hal_sw_beacon_response_time,
396 .maxlen = sizeof(ath_hal_sw_beacon_response_time),
397 .proc_handler = proc_dointvec
399 - { .ctl_name = CTL_AUTO,
400 + { CTLNAME(CTL_AUTO)
401 .procname = "swba_backoff",
403 .data = &ath_hal_additional_swba_backoff,
404 @@ -548,19 +548,19 @@
405 .proc_handler = proc_dointvec
408 - { .ctl_name = CTL_AUTO,
409 + { CTLNAME(CTL_AUTO)
412 .proc_handler = sysctl_hw_ath_hal_log
414 - { .ctl_name = CTL_AUTO,
415 + { CTLNAME(CTL_AUTO)
416 .procname = "alq_size",
418 .data = &ath_hal_alq_qsize,
419 .maxlen = sizeof(ath_hal_alq_qsize),
420 .proc_handler = proc_dointvec
422 - { .ctl_name = CTL_AUTO,
423 + { CTLNAME(CTL_AUTO)
424 .procname = "alq_lost",
426 .data = &ath_hal_alq_lost,
427 @@ -571,21 +571,21 @@
430 static ctl_table ath_hal_table[] = {
431 - { .ctl_name = CTL_AUTO,
432 + { CTLNAME(CTL_AUTO)
435 .child = ath_hal_sysctls
438 static ctl_table ath_ath_table[] = {
439 - { .ctl_name = DEV_ATH,
443 .child = ath_hal_table
446 static ctl_table ath_root_table[] = {
447 - { .ctl_name = CTL_DEV,
451 .child = ath_ath_table
452 Index: madwifi-trunk-r3314/include/compat.h
453 ===================================================================
454 --- madwifi-trunk-r3314.orig/include/compat.h 2010-03-03 11:58:09.526287574 +0100
455 +++ madwifi-trunk-r3314/include/compat.h 2010-03-03 12:09:53.194286975 +0100
457 #define __skb_queue_after(_list, _old, _new) __skb_append(_old, _new, _list)
460 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
461 +#define CTLNAME(x) .ctl_name = x,
466 #endif /* __KERNEL__ */
468 #endif /* _ATH_COMPAT_H_ */
469 Index: madwifi-trunk-r3314/net80211/ieee80211_linux.c
470 ===================================================================
471 --- madwifi-trunk-r3314.orig/net80211/ieee80211_linux.c 2010-03-03 11:56:37.423286722 +0100
472 +++ madwifi-trunk-r3314/net80211/ieee80211_linux.c 2010-03-03 12:11:06.962288262 +0100
473 @@ -699,39 +699,39 @@
475 static const ctl_table ieee80211_sysctl_template[] = {
476 #ifdef IEEE80211_DEBUG
477 - { .ctl_name = CTL_AUTO,
478 + { CTLNAME(CTL_AUTO)
481 .proc_handler = ieee80211_sysctl_debug
484 - { .ctl_name = CTL_AUTO,
485 + { CTLNAME(CTL_AUTO)
486 .procname = "dev_type",
488 .proc_handler = ieee80211_sysctl_dev_type
490 - { .ctl_name = CTL_AUTO,
491 + { CTLNAME(CTL_AUTO)
492 .procname = "monitor_nods_only",
494 .proc_handler = ieee80211_sysctl_monitor_nods_only
496 - { .ctl_name = CTL_AUTO,
497 + { CTLNAME(CTL_AUTO)
498 .procname = "monitor_txf_len",
500 .proc_handler = ieee80211_sysctl_monitor_txf_len
502 - { .ctl_name = CTL_AUTO,
503 + { CTLNAME(CTL_AUTO)
504 .procname = "monitor_phy_errors",
506 .proc_handler = ieee80211_sysctl_monitor_phy_errors
508 - { .ctl_name = CTL_AUTO,
509 + { CTLNAME(CTL_AUTO)
510 .procname = "monitor_crc_errors",
512 .proc_handler = ieee80211_sysctl_monitor_crc_errors
514 /* NB: must be last entry before NULL */
515 - { .ctl_name = CTL_AUTO,
516 + { CTLNAME(CTL_AUTO)
517 .procname = "%parent",
520 @@ -786,12 +786,16 @@
522 /* setup the table */
523 memset(vap->iv_sysctls, 0, space);
524 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
525 vap->iv_sysctls[0].ctl_name = CTL_NET;
527 vap->iv_sysctls[0].procname = "net";
528 vap->iv_sysctls[0].mode = 0555;
529 vap->iv_sysctls[0].child = &vap->iv_sysctls[2];
530 /* [1] is NULL terminator */
531 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
532 vap->iv_sysctls[2].ctl_name = CTL_AUTO;
534 vap->iv_sysctls[2].procname = devname; /* XXX bad idea? */
535 vap->iv_sysctls[2].mode = 0555;
536 vap->iv_sysctls[2].child = &vap->iv_sysctls[4];