4 * This software is derived from work of Atsushi Onoe; his contribution
5 * is greatly appreciated.
8 #include "if_ath_debug.h"
11 @@ -368,8 +367,10 @@ static unsigned int ath_get_dfs_cac_time
12 static void ath_set_dfs_cac_time(struct ieee80211com *, unsigned int seconds);
14 static unsigned int ath_test_radar(struct ieee80211com *);
15 -static unsigned int ath_dump_hal_map(struct ieee80211com *ic);
18 +static unsigned int ath_dump_hal_map(struct ieee80211com *ic);
20 static u_int32_t ath_get_clamped_maxtxpower(struct ath_softc *sc);
21 static u_int32_t ath_set_clamped_maxtxpower(struct ath_softc *sc,
22 u_int32_t new_clamped_maxtxpower);
23 @@ -520,9 +521,11 @@ ath_attach(u_int16_t devid, struct net_d
28 ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL);
29 sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL);
30 DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid);
33 /* Allocate space for dynamically determined maximum VAP count */
35 @@ -1038,8 +1041,9 @@ ath_attach(u_int16_t devid, struct net_d
36 ic->ic_vap_delete = ath_vap_delete;
38 ic->ic_test_radar = ath_test_radar;
40 ic->ic_dump_hal_map = ath_dump_hal_map;
43 ic->ic_set_dfs_testmode = ath_set_dfs_testmode;
44 ic->ic_get_dfs_testmode = ath_get_dfs_testmode;
46 @@ -1297,12 +1301,14 @@ ath_vap_create(struct ieee80211com *ic,
47 /* If no default VAP debug flags are passed, allow a few to
48 * transfer down from the driver to new VAPs so we can have load
49 * time debugging for VAPs too. */
52 ((sc->sc_debug & ATH_DEBUG_RATE) ? IEEE80211_MSG_XRATE : 0) |
53 ((sc->sc_debug & ATH_DEBUG_XMIT) ? IEEE80211_MSG_OUTPUT : 0) |
54 ((sc->sc_debug & ATH_DEBUG_RECV) ? IEEE80211_MSG_INPUT : 0) |
59 ic->ic_debug = (sc->sc_default_ieee80211_debug & IEEE80211_MSG_IC);
61 @@ -10496,9 +10502,11 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
67 sc->sc_debug = (val & ~ATH_DEBUG_GLOBAL);
68 ath_debug_global = (val & ATH_DEBUG_GLOBAL);
73 @@ -10918,9 +10926,11 @@ ath_dynamic_sysctl_register(struct ath_s
76 /* initialize values */
78 ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL);
79 sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL);
80 sc->sc_default_ieee80211_debug = ieee80211_debug;
82 sc->sc_txantenna = 0; /* default to auto-selection */
83 sc->sc_txintrperiod = ATH_TXQ_INTR_PERIOD;
85 @@ -11762,6 +11772,7 @@ ath_test_radar(struct ieee80211com *ic)
88 /* This is called by a private ioctl (iwpriv) to dump the HAL obfuscation table */
91 ath_dump_hal_map(struct ieee80211com *ic)
93 @@ -11770,7 +11781,7 @@ ath_dump_hal_map(struct ieee80211com *ic
94 ath_hal_dump_map(sc->sc_ah);
99 /* If we are shutting down or blowing off the DFS channel availability check
100 * then we call this to stop the behavior before we take the rest of the
101 * necessary actions (such as a DFS reaction to radar). */
102 --- a/ath_rate/amrr/amrr.c
103 +++ b/ath_rate/amrr/amrr.c
112 #define DPRINTF(sc, _fmt, ...) do { \
113 if (sc->sc_debug & 0x10) \
114 --- a/ath_rate/minstrel/minstrel.c
115 +++ b/ath_rate/minstrel/minstrel.c
118 #include "minstrel.h"
121 #define MINSTREL_DEBUG
123 #ifdef MINSTREL_DEBUG
125 ATH_DEBUG_RATE = 0x00000010 /* rate control */
126 --- a/ath_rate/onoe/onoe.c
127 +++ b/ath_rate/onoe/onoe.c
137 ATH_DEBUG_RATE = 0x00000010, /* rate control */
138 --- a/ath_rate/sample/sample.c
139 +++ b/ath_rate/sample/sample.c
144 -#define SAMPLE_DEBUG
146 +#define SAMPLE_DEBUG
150 ATH_DEBUG_RATE = 0x00000010, /* rate control */
151 --- a/tools/do_multi.c
152 +++ b/tools/do_multi.c
153 @@ -10,16 +10,20 @@ main(int argc, char *argv[])
155 progname = basename(argv[0]);
158 if(strcmp(progname, "80211debug") == 0)
159 ret = a80211debug_init(argc, argv);
161 if(strcmp(progname, "80211stats") == 0)
162 ret = a80211stats_init(argc, argv);
163 if(strcmp(progname, "athchans") == 0)
164 ret = athchans_init(argc, argv);
165 if(strcmp(progname, "athctrl") == 0)
166 ret = athctrl_init(argc, argv);
168 if(strcmp(progname, "athdebug") == 0)
169 ret = athdebug_init(argc, argv);
171 if(strcmp(progname, "athkey") == 0)
172 ret = athkey_init(argc, argv);
173 if(strcmp(progname, "athstats") == 0)
176 @@ -48,14 +48,16 @@ endif
182 ALLPROGS= athstats 80211stats athkey athchans athctrl \
183 - athdebug 80211debug wlanconfig ath_info
184 + $(if $(DEBUG),athdebug 80211debug) wlanconfig ath_info
186 OBJS= $(patsubst %,%.o,$(ALLPROGS))
188 INCS= -I. -I../ath -I$(HAL) -I$(TOP) -I$(ATH_HAL)
190 -ALL_CFLAGS= $(CFLAGS) $(INCS)
191 +ALL_CFLAGS= $(CFLAGS) $(INCS) $(DEBUG)
195 --- a/net80211/ieee80211_linux.h
196 +++ b/net80211/ieee80211_linux.h
198 #ifndef _NET80211_IEEE80211_LINUX_H_
199 #define _NET80211_IEEE80211_LINUX_H_
201 -#define IEEE80211_DEBUG
202 -#define IEEE80211_DEBUG_REFCNT /* Node reference count debugging */
203 /* #define ATH_DEBUG_SPINLOCKS */ /* announce before spinlocking */
205 #include <linux/wireless.h>
208 @@ -147,8 +147,9 @@ ATH_RATE= $(TOP)/ath_rate
214 +WARNINGS = -Wno-unused
215 +# DEBUG = -DAR_DEBUG -DIEEE80211_DEBUG
216 +COPTS+= $(WARNINGS) $(DEBUG)
217 INCS= -include $(TOP)/include/compat.h -I$(TOP)/include
219 # TARGET defines the target platform architecture. It must match one of
220 --- a/ath/if_ath_radar.c
221 +++ b/ath/if_ath_radar.c
223 * $Id: if_ath_radar.c 2464 2007-06-15 22:51:56Z mtaylor $
228 #include "if_ath_debug.h"
230 #ifndef AUTOCONF_INCLUDED
232 #include <net80211/if_llc.h>
237 #include "net80211/if_athproto.h"
238 #include "if_athvar.h"
240 --- a/ath/if_ath_hal.h
241 +++ b/ath/if_ath_hal.h
242 @@ -1081,6 +1081,7 @@ static inline HAL_BOOL ath_hal_disable(s
244 tail -f /var/log/messages | sed -f hal_unmangle.sed
247 static inline void ath_hal_dump_map(struct ath_hal *ah)
249 #ifdef CONFIG_KALLSYMS
250 @@ -1345,7 +1346,7 @@ static inline void ath_hal_dump_map(stru
251 #endif /* #ifndef CONFIG_KALLSYMS */
256 #include "if_ath_hal_wrappers.h"
258 #endif /* #ifndef _IF_ATH_HAL_H_ */
259 --- a/net80211/ieee80211_var.h
260 +++ b/net80211/ieee80211_var.h
261 @@ -492,9 +492,10 @@ struct ieee80211com {
262 /* inject a fake radar signal -- used while on a 802.11h DFS channels */
263 unsigned int (*ic_test_radar)(struct ieee80211com *);
267 unsigned int (*ic_dump_hal_map)(struct ieee80211com *);
270 /* DFS channel availability check time (in seconds) */
271 void (*ic_set_dfs_cac_time)(struct ieee80211com *, unsigned int);
272 unsigned int (*ic_get_dfs_cac_time)(struct ieee80211com *);
273 --- a/net80211/ieee80211_wireless.c
274 +++ b/net80211/ieee80211_wireless.c
275 @@ -1548,6 +1548,7 @@ ieee80211_get_txcont_power(struct net_de
281 ieee80211_ioctl_hal_map(struct net_device *dev, struct iw_request_info *info,
282 void *w, char *extra)
283 @@ -1558,7 +1559,7 @@ ieee80211_ioctl_hal_map(struct net_devic
284 params[0] = ic->ic_dump_hal_map(ic);
291 ieee80211_ioctl_radar(struct net_device *dev, struct iw_request_info *info,
292 @@ -5258,8 +5259,10 @@ static const struct iw_priv_args ieee802
293 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getwmmparams" },
294 { IEEE80211_IOCTL_RADAR,
295 0, 0, "doth_radar" },
297 { IEEE80211_IOCTL_HALMAP,
298 0, 0, "dump_hal_map" },
301 * These depends on sub-ioctl support which added in version 12.
303 @@ -5695,7 +5698,9 @@ static const iw_handler ieee80211_priv_h
304 set_priv(IEEE80211_IOCTL_SETMLME, ieee80211_ioctl_setmlme),
305 set_priv(IEEE80211_IOCTL_SETKEY, ieee80211_ioctl_setkey),
306 set_priv(IEEE80211_IOCTL_DELKEY, ieee80211_ioctl_delkey),
308 set_priv(IEEE80211_IOCTL_HALMAP, ieee80211_ioctl_hal_map),
310 set_priv(IEEE80211_IOCTL_ADDMAC, ieee80211_ioctl_addmac),
311 set_priv(IEEE80211_IOCTL_DELMAC, ieee80211_ioctl_delmac),
312 set_priv(IEEE80211_IOCTL_WDSADDMAC, ieee80211_ioctl_wdsmac),
313 --- a/ath/if_ath_debug.h
314 +++ b/ath/if_ath_debug.h
315 @@ -54,6 +54,10 @@ enum {
316 ATH_DEBUG_GLOBAL = (ATH_DEBUG_SKB|ATH_DEBUG_SKB_REF)
319 +#define EPRINTF(_sc, _fmt, ...) \
320 + printk(KERN_ERR "%s: %s: " _fmt, \
321 + SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
325 /* DEBUG-ONLY DEFINITIONS */
326 @@ -68,20 +72,9 @@ enum {
327 ath_keyprint((_sc), __func__, _ix, _hk, _mac); \
330 -#else /* #ifdef AR_DEBUG */
332 -#define DFLAG_ISSET(sc, _m) 0
333 -#define DPRINTF(sc, _m, _fmt, ...)
334 -#define KEYPRINTF(sc, k, ix, mac)
336 -#endif /* #ifdef AR_DEBUG */
338 #define IFF_DUMPPKTS(_sc, _m) DFLAG_ISSET((_sc), (_m))
340 -#define EPRINTF(_sc, _fmt, ...) \
341 - printk(KERN_ERR "%s: %s: " _fmt, \
342 - SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
344 #define WPRINTF(_sc, _fmt, ...) \
345 printk(KERN_WARNING "%s: %s: " _fmt, \
346 SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
347 @@ -89,5 +82,14 @@ enum {
348 #define IPRINTF(_sc, _fmt, ...) \
349 printk(KERN_INFO "%s: %s: " _fmt, \
350 SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
352 +#define DFLAG_ISSET(sc, _m) 0
353 +#define DPRINTF(sc, _m, _fmt, ...)
354 +#define KEYPRINTF(sc, k, ix, mac)
355 +#define WPRINTF(...)
356 +#define IPRINTF(...)
357 +#define IFF_DUMPPKTS(...) 0
361 #endif /* #ifndef _IF_ATH_DEBUG_H_ */
362 --- a/net80211/ieee80211_node.c
363 +++ b/net80211/ieee80211_node.c
364 @@ -920,6 +920,9 @@ node_cleanup(struct ieee80211_node *ni)
368 +#ifndef IEEE80211_DEBUG
369 +#define node_print_message(...) do {} while(0)
371 static void node_print_message(
374 @@ -972,7 +975,7 @@ static void node_print_message(
378 -EXPORT_SYMBOL(node_print_message);
382 #ifdef IEEE80211_DEBUG_REFCNT
383 --- a/ath/if_ath_pci.c
384 +++ b/ath/if_ath_pci.c
385 @@ -134,8 +134,10 @@ ath_pci_probe(struct pci_dev *pdev, cons
389 - if (pci_enable_device(pdev))
390 + if (pci_enable_device(pdev)) {
391 + printk(KERN_ERR "%s: failed to enable PCI device\n", dev_info);
395 /* XXX 32-bit addressing only */
396 if (pci_set_dma_mask(pdev, 0xffffffff)) {
397 @@ -244,8 +246,10 @@ ath_pci_probe(struct pci_dev *pdev, cons
398 sc->aps_sc.sc_ledpin = 1;
401 - if (ath_attach(vdevice, dev, NULL) != 0)
402 + if ((i = ath_attach(vdevice, dev, NULL)) != 0) {
403 + printk(KERN_ERR "%s: ath_attach failed: %d\n", dev_info, i);
407 athname = ath_hal_probe(id->vendor, vdevice);
408 printk(KERN_INFO "%s: %s: %s: mem=0x%lx, irq=%d\n",