5 /* Linux 2.6.18+ uses <linux/utsrelease.h> */
7 -#include <linux/utsrelease.h>
8 + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
9 + #include <generated/utsrelease.h>
11 + #include <linux/utsrelease.h>
15 char *uts_release = UTS_RELEASE;
18 @@ -11580,227 +11580,231 @@ static int mincalibrate = 1; /* once a
19 static int maxint = 0x7fffffff; /* 32-bit big */
21 static const ctl_table ath_sysctl_template[] = {
22 - { .ctl_name = CTL_AUTO,
24 .procname = "dev_vendor",
26 .proc_handler = ath_sysctl_hwinfo,
27 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
28 .strategy = &sysctl_string,
32 .extra2 = (void *)ATH_CARD_VENDOR,
34 - { .ctl_name = CTL_AUTO,
36 .procname = "dev_name",
38 .proc_handler = ath_sysctl_hwinfo,
39 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
40 .strategy = &sysctl_string,
44 .extra2 = (void *)ATH_CARD_NAME,
46 - { .ctl_name = CTL_AUTO,
48 .procname = "slottime",
50 .proc_handler = ath_sysctl_halparam,
51 .extra2 = (void *)ATH_SLOTTIME,
53 - { .ctl_name = CTL_AUTO,
55 .procname = "acktimeout",
57 .proc_handler = ath_sysctl_halparam,
58 .extra2 = (void *)ATH_ACKTIMEOUT,
60 - { .ctl_name = CTL_AUTO,
62 .procname = "ctstimeout",
64 .proc_handler = ath_sysctl_halparam,
65 .extra2 = (void *)ATH_CTSTIMEOUT,
67 - { .ctl_name = CTL_AUTO,
69 .procname = "distance",
71 .proc_handler = ath_sysctl_halparam,
72 .extra2 = (void *)ATH_DISTANCE,
74 - { .ctl_name = CTL_AUTO,
78 .proc_handler = ath_sysctl_halparam,
79 .extra2 = (void *)ATH_SILENT,
81 - { .ctl_name = CTL_AUTO,
83 .procname = "softled",
85 .proc_handler = ath_sysctl_halparam,
86 .extra2 = (void *)ATH_SOFTLED,
88 - { .ctl_name = CTL_AUTO,
92 .proc_handler = ath_sysctl_halparam,
93 .extra2 = (void *)ATH_LEDPIN,
95 - { .ctl_name = CTL_AUTO,
97 .procname = "countrycode",
99 .proc_handler = ath_sysctl_halparam,
100 .extra2 = (void *)ATH_COUNTRYCODE,
102 - { .ctl_name = CTL_AUTO,
103 + { CTLNAME(CTL_AUTO)
104 .procname = "outdoor",
106 .proc_handler = ath_sysctl_halparam,
107 .extra2 = (void *)ATH_OUTDOOR,
109 - { .ctl_name = CTL_AUTO,
110 + { CTLNAME(CTL_AUTO)
111 .procname = "regdomain",
113 .proc_handler = ath_sysctl_halparam,
114 .extra2 = (void *)ATH_REGDOMAIN,
117 - { .ctl_name = CTL_AUTO,
118 + { CTLNAME(CTL_AUTO)
121 .proc_handler = ath_sysctl_halparam,
122 .extra2 = (void *)ATH_DEBUG,
125 - { .ctl_name = CTL_AUTO,
126 + { CTLNAME(CTL_AUTO)
127 .procname = "poweroffset",
129 .proc_handler = ath_sysctl_halparam,
130 .extra2 = (void *)ATH_POWEROFFSET,
132 - { .ctl_name = CTL_AUTO,
133 + { CTLNAME(CTL_AUTO)
134 .procname = "txantenna",
136 .proc_handler = ath_sysctl_halparam,
137 .extra2 = (void *)ATH_TXANTENNA,
139 - { .ctl_name = CTL_AUTO,
140 + { CTLNAME(CTL_AUTO)
141 .procname = "rxantenna",
143 .proc_handler = ath_sysctl_halparam,
144 .extra2 = (void *)ATH_RXANTENNA,
146 - { .ctl_name = CTL_AUTO,
147 + { CTLNAME(CTL_AUTO)
148 .procname = "diversity",
150 .proc_handler = ath_sysctl_halparam,
151 .extra2 = (void *)ATH_DIVERSITY,
153 - { .ctl_name = CTL_AUTO,
154 + { CTLNAME(CTL_AUTO)
155 .procname = "txintrperiod",
157 .proc_handler = ath_sysctl_halparam,
158 .extra2 = (void *)ATH_TXINTRPERIOD,
160 - { .ctl_name = CTL_AUTO,
161 + { CTLNAME(CTL_AUTO)
162 .procname = "fftxqmin",
164 .proc_handler = ath_sysctl_halparam,
165 .extra2 = (void *)ATH_FFTXQMIN,
168 - { .ctl_name = CTL_AUTO,
169 + { CTLNAME(CTL_AUTO)
170 .procname = "xrpollperiod",
172 .proc_handler = ath_sysctl_halparam,
173 .extra2 = (void *)ATH_XR_POLL_PERIOD,
175 - { .ctl_name = CTL_AUTO,
176 + { CTLNAME(CTL_AUTO)
177 .procname = "xrpollcount",
179 .proc_handler = ath_sysctl_halparam,
180 .extra2 = (void *)ATH_XR_POLL_COUNT,
183 - { .ctl_name = CTL_AUTO,
184 + { CTLNAME(CTL_AUTO)
185 .procname = "ackrate",
187 .proc_handler = ath_sysctl_halparam,
188 .extra2 = (void *)ATH_ACKRATE,
190 - { .ctl_name = CTL_AUTO,
191 + { CTLNAME(CTL_AUTO)
192 .procname = "channelbw",
194 .proc_handler = ath_sysctl_halparam,
195 .extra2 = (void *)ATH_CHANBW,
197 - { .ctl_name = CTL_AUTO,
198 + { CTLNAME(CTL_AUTO)
201 .proc_handler = ath_sysctl_halparam,
202 .extra2 = (void *)ATH_RP,
204 - { .ctl_name = CTL_AUTO,
205 + { CTLNAME(CTL_AUTO)
206 .procname = "radar_print",
208 .proc_handler = ath_sysctl_halparam,
209 .extra2 = (void *)ATH_RP_PRINT,
211 - { .ctl_name = CTL_AUTO,
212 + { CTLNAME(CTL_AUTO)
213 .procname = "radar_print_all",
215 .proc_handler = ath_sysctl_halparam,
216 .extra2 = (void *)ATH_RP_PRINT_ALL,
218 - { .ctl_name = CTL_AUTO,
219 + { CTLNAME(CTL_AUTO)
220 .procname = "radar_dump",
222 .proc_handler = ath_sysctl_halparam,
223 .extra2 = (void *)ATH_RP_PRINT_MEM,
225 - { .ctl_name = CTL_AUTO,
226 + { CTLNAME(CTL_AUTO)
227 .procname = "radar_dump_all",
229 .proc_handler = ath_sysctl_halparam,
230 .extra2 = (void *)ATH_RP_PRINT_MEM_ALL,
232 - { .ctl_name = CTL_AUTO,
233 + { CTLNAME(CTL_AUTO)
234 .procname = "rp_flush",
236 .proc_handler = ath_sysctl_halparam,
237 .extra2 = (void *)ATH_RP_FLUSH,
239 - { .ctl_name = CTL_AUTO,
240 + { CTLNAME(CTL_AUTO)
243 .proc_handler = ath_sysctl_halparam,
244 .extra2 = (void *)ATH_PANIC,
246 - { .ctl_name = CTL_AUTO,
247 + { CTLNAME(CTL_AUTO)
248 .procname = "rp_ignored",
250 .proc_handler = ath_sysctl_halparam,
251 .extra2 = (void *)ATH_RP_IGNORED,
253 - { .ctl_name = CTL_AUTO,
254 + { CTLNAME(CTL_AUTO)
255 .procname = "radar_ignored",
257 .proc_handler = ath_sysctl_halparam,
258 .extra2 = (void *)ATH_RADAR_IGNORED,
260 - { .ctl_name = CTL_AUTO,
261 + { CTLNAME(CTL_AUTO)
262 .procname = "intmit",
264 .proc_handler = ath_sysctl_halparam,
265 .extra2 = (void *)ATH_INTMIT,
267 - { .ctl_name = CTL_AUTO,
268 + { CTLNAME(CTL_AUTO)
269 .procname = "noise_immunity",
271 .proc_handler = ath_sysctl_halparam,
272 .extra2 = (void *)ATH_NOISE_IMMUNITY,
274 - { .ctl_name = CTL_AUTO,
275 + { CTLNAME(CTL_AUTO)
276 .procname = "ofdm_weak_det",
278 .proc_handler = ath_sysctl_halparam,
279 .extra2 = (void *)ATH_OFDM_WEAK_DET,
281 - { .ctl_name = CTL_AUTO,
282 + { CTLNAME(CTL_AUTO)
283 .procname = "cca_thresh",
285 .proc_handler = ath_sysctl_halparam,
286 @@ -11838,12 +11842,16 @@ ath_dynamic_sysctl_register(struct ath_s
288 /* setup the table */
289 memset(sc->sc_sysctls, 0, space);
290 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
291 sc->sc_sysctls[0].ctl_name = CTL_DEV;
293 sc->sc_sysctls[0].procname = "dev";
294 sc->sc_sysctls[0].mode = 0555;
295 sc->sc_sysctls[0].child = &sc->sc_sysctls[2];
296 /* [1] is NULL terminator */
297 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
298 sc->sc_sysctls[2].ctl_name = CTL_AUTO;
300 sc->sc_sysctls[2].procname = dev_name;
301 sc->sc_sysctls[2].mode = 0555;
302 sc->sc_sysctls[2].child = &sc->sc_sysctls[4];
303 @@ -11966,7 +11974,7 @@ ath_announce(struct net_device *dev)
305 static ctl_table ath_static_sysctls[] = {
307 - { .ctl_name = CTL_AUTO,
308 + { CTLNAME(CTL_AUTO)
312 @@ -11974,14 +11982,14 @@ static ctl_table ath_static_sysctls[] =
313 .proc_handler = proc_dointvec
316 - { .ctl_name = CTL_AUTO,
317 + { CTLNAME(CTL_AUTO)
318 .procname = "xchanmode",
320 .data = &ath_xchanmode,
321 .maxlen = sizeof(ath_xchanmode),
322 .proc_handler = proc_dointvec
324 - { .ctl_name = CTL_AUTO,
325 + { CTLNAME(CTL_AUTO)
326 .procname = "calibrate",
328 .data = &ath_calinterval,
329 @@ -11993,14 +12001,14 @@ static ctl_table ath_static_sysctls[] =
332 static ctl_table ath_ath_table[] = {
333 - { .ctl_name = DEV_ATH,
337 .child = ath_static_sysctls
340 static ctl_table ath_root_table[] = {
341 - { .ctl_name = CTL_DEV,
345 .child = ath_ath_table
346 --- a/ath/if_ath_ahb.h
347 +++ b/ath/if_ath_ahb.h
349 do { (void) (start); (void) (size); } while (0)
352 +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
353 +#define bus_dma_sync_single dma_sync_single_for_cpu
355 #define bus_dma_sync_single dma_sync_single
357 #define bus_map_single dma_map_single
358 #define bus_unmap_single dma_unmap_single
359 #define bus_alloc_consistent(_hwdev, _sz, _hdma) \
360 --- a/ath_hal/ah_os.c
361 +++ b/ath_hal/ah_os.c
362 @@ -518,7 +518,7 @@ EXPORT_SYMBOL(ath_hal_memcmp);
364 static ctl_table ath_hal_sysctls[] = {
366 - { .ctl_name = CTL_AUTO,
367 + { CTLNAME(CTL_AUTO)
370 .data = &ath_hal_debug,
371 @@ -526,21 +526,21 @@ static ctl_table ath_hal_sysctls[] = {
372 .proc_handler = proc_dointvec
375 - { .ctl_name = CTL_AUTO,
376 + { CTLNAME(CTL_AUTO)
377 .procname = "dma_beacon_response_time",
378 .data = &ath_hal_dma_beacon_response_time,
379 .maxlen = sizeof(ath_hal_dma_beacon_response_time),
381 .proc_handler = proc_dointvec
383 - { .ctl_name = CTL_AUTO,
384 + { CTLNAME(CTL_AUTO)
385 .procname = "sw_beacon_response_time",
387 .data = &ath_hal_sw_beacon_response_time,
388 .maxlen = sizeof(ath_hal_sw_beacon_response_time),
389 .proc_handler = proc_dointvec
391 - { .ctl_name = CTL_AUTO,
392 + { CTLNAME(CTL_AUTO)
393 .procname = "swba_backoff",
395 .data = &ath_hal_additional_swba_backoff,
396 @@ -548,19 +548,19 @@ static ctl_table ath_hal_sysctls[] = {
397 .proc_handler = proc_dointvec
400 - { .ctl_name = CTL_AUTO,
401 + { CTLNAME(CTL_AUTO)
404 .proc_handler = sysctl_hw_ath_hal_log
406 - { .ctl_name = CTL_AUTO,
407 + { CTLNAME(CTL_AUTO)
408 .procname = "alq_size",
410 .data = &ath_hal_alq_qsize,
411 .maxlen = sizeof(ath_hal_alq_qsize),
412 .proc_handler = proc_dointvec
414 - { .ctl_name = CTL_AUTO,
415 + { CTLNAME(CTL_AUTO)
416 .procname = "alq_lost",
418 .data = &ath_hal_alq_lost,
419 @@ -571,21 +571,21 @@ static ctl_table ath_hal_sysctls[] = {
422 static ctl_table ath_hal_table[] = {
423 - { .ctl_name = CTL_AUTO,
424 + { CTLNAME(CTL_AUTO)
427 .child = ath_hal_sysctls
430 static ctl_table ath_ath_table[] = {
431 - { .ctl_name = DEV_ATH,
435 .child = ath_hal_table
438 static ctl_table ath_root_table[] = {
439 - { .ctl_name = CTL_DEV,
443 .child = ath_ath_table
444 --- a/include/compat.h
445 +++ b/include/compat.h
446 @@ -193,6 +193,12 @@ static inline int timeval_compare(struct
447 #define __skb_queue_after(_list, _old, _new) __skb_append(_old, _new, _list)
450 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
451 +#define CTLNAME(x) .ctl_name = x,
456 #endif /* __KERNEL__ */
458 #endif /* _ATH_COMPAT_H_ */
459 --- a/net80211/ieee80211_linux.c
460 +++ b/net80211/ieee80211_linux.c
461 @@ -699,39 +699,39 @@ IEEE80211_SYSCTL_DECL(ieee80211_sysctl_m
463 static const ctl_table ieee80211_sysctl_template[] = {
464 #ifdef IEEE80211_DEBUG
465 - { .ctl_name = CTL_AUTO,
466 + { CTLNAME(CTL_AUTO)
469 .proc_handler = ieee80211_sysctl_debug
472 - { .ctl_name = CTL_AUTO,
473 + { CTLNAME(CTL_AUTO)
474 .procname = "dev_type",
476 .proc_handler = ieee80211_sysctl_dev_type
478 - { .ctl_name = CTL_AUTO,
479 + { CTLNAME(CTL_AUTO)
480 .procname = "monitor_nods_only",
482 .proc_handler = ieee80211_sysctl_monitor_nods_only
484 - { .ctl_name = CTL_AUTO,
485 + { CTLNAME(CTL_AUTO)
486 .procname = "monitor_txf_len",
488 .proc_handler = ieee80211_sysctl_monitor_txf_len
490 - { .ctl_name = CTL_AUTO,
491 + { CTLNAME(CTL_AUTO)
492 .procname = "monitor_phy_errors",
494 .proc_handler = ieee80211_sysctl_monitor_phy_errors
496 - { .ctl_name = CTL_AUTO,
497 + { CTLNAME(CTL_AUTO)
498 .procname = "monitor_crc_errors",
500 .proc_handler = ieee80211_sysctl_monitor_crc_errors
502 /* NB: must be last entry before NULL */
503 - { .ctl_name = CTL_AUTO,
504 + { CTLNAME(CTL_AUTO)
505 .procname = "%parent",
508 @@ -786,12 +786,16 @@ ieee80211_virtfs_latevattach(struct ieee
510 /* setup the table */
511 memset(vap->iv_sysctls, 0, space);
512 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
513 vap->iv_sysctls[0].ctl_name = CTL_NET;
515 vap->iv_sysctls[0].procname = "net";
516 vap->iv_sysctls[0].mode = 0555;
517 vap->iv_sysctls[0].child = &vap->iv_sysctls[2];
518 /* [1] is NULL terminator */
519 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
520 vap->iv_sysctls[2].ctl_name = CTL_AUTO;
522 vap->iv_sysctls[2].procname = devname; /* XXX bad idea? */
523 vap->iv_sysctls[2].mode = 0555;
524 vap->iv_sysctls[2].child = &vap->iv_sysctls[4];