4 * This software is derived from work of Atsushi Onoe; his contribution
5 * is greatly appreciated.
8 #include "if_ath_debug.h"
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);
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 */
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 @@
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 @@
67 sc->sc_debug = (val & ~ATH_DEBUG_GLOBAL);
68 ath_debug_global = (val & ATH_DEBUG_GLOBAL);
73 @@ -10918,9 +10926,11 @@
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 @@
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 @@
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
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)
182 ALLPROGS= athstats 80211stats athkey athchans athctrl \
183 athdebug 80211debug wlanconfig ath_info
187 INCS= -I. -I../ath -I$(HAL) -I$(TOP) -I$(ATH_HAL)
189 -ALL_CFLAGS= $(CFLAGS) $(INCS)
190 +ALL_CFLAGS= $(CFLAGS) $(INCS) $(DEBUG)
194 --- a/net80211/ieee80211_linux.h
195 +++ b/net80211/ieee80211_linux.h
197 #ifndef _NET80211_IEEE80211_LINUX_H_
198 #define _NET80211_IEEE80211_LINUX_H_
200 -#define IEEE80211_DEBUG
201 -#define IEEE80211_DEBUG_REFCNT /* Node reference count debugging */
202 /* #define ATH_DEBUG_SPINLOCKS */ /* announce before spinlocking */
204 #include <linux/wireless.h>
212 +DEBUG = -DAR_DEBUG -DIEEE80211_DEBUG
213 +COPTS+= $(WARNINGS) $(DEBUG)
214 INCS= -include $(TOP)/include/compat.h -I$(TOP)/include
216 # TARGET defines the target platform architecture. It must match one of
217 --- a/ath/if_ath_radar.c
218 +++ b/ath/if_ath_radar.c
220 * $Id: if_ath_radar.c 2464 2007-06-15 22:51:56Z mtaylor $
225 #include "if_ath_debug.h"
227 #ifndef AUTOCONF_INCLUDED
229 #include <net80211/if_llc.h>
234 #include "net80211/if_athproto.h"
235 #include "if_athvar.h"
237 --- a/ath/if_ath_hal.h
238 +++ b/ath/if_ath_hal.h
239 @@ -1081,6 +1081,7 @@
241 tail -f /var/log/messages | sed -f hal_unmangle.sed
244 static inline void ath_hal_dump_map(struct ath_hal *ah)
246 #ifdef CONFIG_KALLSYMS
247 @@ -1345,7 +1346,7 @@
248 #endif /* #ifndef CONFIG_KALLSYMS */
253 #include "if_ath_hal_wrappers.h"
255 #endif /* #ifndef _IF_ATH_HAL_H_ */
256 --- a/net80211/ieee80211_var.h
257 +++ b/net80211/ieee80211_var.h
259 /* inject a fake radar signal -- used while on a 802.11h DFS channels */
260 unsigned int (*ic_test_radar)(struct ieee80211com *);
264 unsigned int (*ic_dump_hal_map)(struct ieee80211com *);
267 /* DFS channel availability check time (in seconds) */
268 void (*ic_set_dfs_cac_time)(struct ieee80211com *, unsigned int);
269 unsigned int (*ic_get_dfs_cac_time)(struct ieee80211com *);
270 --- a/net80211/ieee80211_wireless.c
271 +++ b/net80211/ieee80211_wireless.c
272 @@ -1548,6 +1548,7 @@
278 ieee80211_ioctl_hal_map(struct net_device *dev, struct iw_request_info *info,
279 void *w, char *extra)
280 @@ -1558,7 +1559,7 @@
281 params[0] = ic->ic_dump_hal_map(ic);
288 ieee80211_ioctl_radar(struct net_device *dev, struct iw_request_info *info,
289 @@ -5258,8 +5259,10 @@
290 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getwmmparams" },
291 { IEEE80211_IOCTL_RADAR,
292 0, 0, "doth_radar" },
294 { IEEE80211_IOCTL_HALMAP,
295 0, 0, "dump_hal_map" },
298 * These depends on sub-ioctl support which added in version 12.
300 @@ -5695,7 +5698,9 @@
301 set_priv(IEEE80211_IOCTL_SETMLME, ieee80211_ioctl_setmlme),
302 set_priv(IEEE80211_IOCTL_SETKEY, ieee80211_ioctl_setkey),
303 set_priv(IEEE80211_IOCTL_DELKEY, ieee80211_ioctl_delkey),
305 set_priv(IEEE80211_IOCTL_HALMAP, ieee80211_ioctl_hal_map),
307 set_priv(IEEE80211_IOCTL_ADDMAC, ieee80211_ioctl_addmac),
308 set_priv(IEEE80211_IOCTL_DELMAC, ieee80211_ioctl_delmac),
309 set_priv(IEEE80211_IOCTL_WDSADDMAC, ieee80211_ioctl_wdsmac),
310 --- a/ath/if_ath_debug.h
311 +++ b/ath/if_ath_debug.h
313 ath_keyprint((_sc), __func__, _ix, _hk, _mac); \
316 -#else /* #ifdef AR_DEBUG */
318 -#define DFLAG_ISSET(sc, _m) 0
319 -#define DPRINTF(sc, _m, _fmt, ...)
320 -#define KEYPRINTF(sc, k, ix, mac)
322 -#endif /* #ifdef AR_DEBUG */
324 #define IFF_DUMPPKTS(_sc, _m) DFLAG_ISSET((_sc), (_m))
327 #define IPRINTF(_sc, _fmt, ...) \
328 printk(KERN_INFO "%s: %s: " _fmt, \
329 SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
331 +#define DFLAG_ISSET(sc, _m) 0
332 +#define DPRINTF(sc, _m, _fmt, ...)
333 +#define KEYPRINTF(sc, k, ix, mac)
334 +#define EPRINTF(...)
335 +#define WPRINTF(...)
336 +#define IPRINTF(...)
337 +#define IFF_DUMPPKTS(...) 0
341 #endif /* #ifndef _IF_ATH_DEBUG_H_ */
342 --- a/net80211/ieee80211_node.c
343 +++ b/net80211/ieee80211_node.c
348 +#ifndef IEEE80211_DEBUG
349 +#define node_print_message(...) do {} while(0)
351 static void node_print_message(
358 -EXPORT_SYMBOL(node_print_message);
362 #ifdef IEEE80211_DEBUG_REFCNT