4 static void ath_set_dfs_cac_time(struct ieee80211com *, unsigned int seconds);
6 static unsigned int ath_test_radar(struct ieee80211com *);
7 -static unsigned int ath_dump_hal_map(struct ieee80211com *ic);
10 +static unsigned int ath_dump_hal_map(struct ieee80211com *ic);
12 static u_int32_t ath_get_clamped_maxtxpower(struct ath_softc *sc);
13 static u_int32_t ath_set_clamped_maxtxpower(struct ath_softc *sc,
14 u_int32_t new_clamped_maxtxpower);
16 unsigned int param, unsigned int value);
18 static u_int32_t ath_get_real_maxtxpower(struct ath_softc *sc);
21 static int ath_txq_check(struct ath_softc *sc, struct ath_txq *txq, const char *msg);
24 static int ath_countrycode = CTRY_DEFAULT; /* country code */
25 static int ath_outdoor = AH_FALSE; /* enable outdoor use */
31 ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL);
32 sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL);
33 DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid);
36 /* Allocate space for dynamically determined maximum VAP count */
39 ic->ic_vap_delete = ath_vap_delete;
41 ic->ic_test_radar = ath_test_radar;
43 ic->ic_dump_hal_map = ath_dump_hal_map;
46 ic->ic_set_dfs_testmode = ath_set_dfs_testmode;
47 ic->ic_get_dfs_testmode = ath_get_dfs_testmode;
48 @@ -1285,12 +1294,14 @@
49 /* If no default VAP debug flags are passed, allow a few to
50 * transfer down from the driver to new VAPs so we can have load
51 * time debugging for VAPs too. */
54 ((sc->sc_debug & ATH_DEBUG_RATE) ? IEEE80211_MSG_XRATE : 0) |
55 ((sc->sc_debug & ATH_DEBUG_XMIT) ? IEEE80211_MSG_OUTPUT : 0) |
56 ((sc->sc_debug & ATH_DEBUG_RECV) ? IEEE80211_MSG_INPUT : 0) |
61 ic->ic_debug = (sc->sc_default_ieee80211_debug & IEEE80211_MSG_IC);
69 ath_txq_dump(struct ath_softc *sc, struct ath_txq *txq)
78 * Insert a buffer on a txq
80 ath_tx_timeout(struct net_device *dev)
82 struct ath_softc *sc = dev->priv;
87 if (ath_chan_unavail(sc))
89 @@ -8393,12 +8408,14 @@
90 (dev->flags & IFF_RUNNING) ? "" : "NOT ",
91 sc->sc_invalid ? "in" : "");
94 for (i = 0; i < HAL_NUM_TX_QUEUES; i++) {
95 if (ATH_TXQ_SETUP(sc, i)) {
96 ath_txq_check(sc, &sc->sc_txq[i], __func__);
97 ath_txq_dump(sc, &sc->sc_txq[i]);
102 if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) {
103 sc->sc_stats.ast_watchdog++;
104 @@ -10638,6 +10655,7 @@
110 sc->sc_debug = (val & ~ATH_DEBUG_GLOBAL);
111 ath_debug_global = (val & ATH_DEBUG_GLOBAL);
112 @@ -10645,6 +10663,7 @@
120 @@ -10818,9 +10837,11 @@
122 ath_hal_getregdomain(ah, &val);
126 val = sc->sc_debug | ath_debug_global;
130 val = sc->sc_txantenna;
132 @@ -11939,6 +11960,7 @@
135 /* This is called by a private ioctl (iwpriv) to dump the HAL obfuscation table */
138 ath_dump_hal_map(struct ieee80211com *ic)
140 @@ -11947,7 +11969,7 @@
141 ath_hal_dump_map(sc->sc_ah);
146 /* If we are shutting down or blowing off the DFS channel availability check
147 * then we call this to stop the behavior before we take the rest of the
148 * necessary actions (such as a DFS reaction to radar). */
149 --- a/ath_rate/amrr/amrr.c
150 +++ b/ath_rate/amrr/amrr.c
159 #define DPRINTF(sc, _fmt, ...) do { \
160 if (sc->sc_debug & 0x10) \
161 --- a/ath_rate/minstrel/minstrel.c
162 +++ b/ath_rate/minstrel/minstrel.c
165 #include "minstrel.h"
168 #define MINSTREL_DEBUG
170 #ifdef MINSTREL_DEBUG
172 ATH_DEBUG_RATE = 0x00000010 /* rate control */
174 (struct ieee80211_node_table *)&vap->iv_ic->ic_sta;
176 unsigned int this_tp, this_prob, this_eprob;
177 - struct ath_softc *sc = vap->iv_ic->ic_dev->priv;;
179 + struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
182 IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
183 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
184 --- a/ath_rate/onoe/onoe.c
185 +++ b/ath_rate/onoe/onoe.c
195 ATH_DEBUG_RATE = 0x00000010, /* rate control */
196 --- a/ath_rate/sample/sample.c
197 +++ b/ath_rate/sample/sample.c
202 -#define SAMPLE_DEBUG
204 +#define SAMPLE_DEBUG
208 ATH_DEBUG_RATE = 0x00000010, /* rate control */
209 --- a/tools/do_multi.c
210 +++ b/tools/do_multi.c
213 progname = basename(argv[0]);
216 if(strcmp(progname, "80211debug") == 0)
217 ret = a80211debug_init(argc, argv);
219 if(strcmp(progname, "80211stats") == 0)
220 ret = a80211stats_init(argc, argv);
221 if(strcmp(progname, "athchans") == 0)
222 ret = athchans_init(argc, argv);
223 if(strcmp(progname, "athctrl") == 0)
224 ret = athctrl_init(argc, argv);
226 if(strcmp(progname, "athdebug") == 0)
227 ret = athdebug_init(argc, argv);
229 if(strcmp(progname, "athkey") == 0)
230 ret = athkey_init(argc, argv);
231 if(strcmp(progname, "athstats") == 0)
236 ATH_HAL = $(TOP)/ath_hal
243 # Path to the HAL source code.
249 +INCS = -I. -I$(HAL) -I$(TOP) -I$(ATH_HAL) -I$(TOP)/ath
250 +CFLAGS = -g -O2 -Wall
251 +ALL_CFLAGS = $(CFLAGS) $(INCS)
254 PROGRAMS = athstats 80211stats athkey athchans athctrl \
255 - athdebug 80211debug wlanconfig wpakey
258 +ifeq ($(ATH_DEBUG),1)
259 + PROGRAMS += athdebug 80211debug
260 + ALL_CFLAGS += -DAR_DEBUG
263 OBJS = $(patsubst %,%.o,$(PROGRAMS)) ath_info/ath_info.o
266 -INCS = -I. -I$(HAL) -I$(TOP) -I$(ATH_HAL) -I$(TOP)/ath
267 -CFLAGS = -g -O2 -Wall
268 -ALL_CFLAGS = $(CFLAGS) $(INCS)
271 all: all-subdirs compile
273 --- a/ath/if_ath_hal.h
274 +++ b/ath/if_ath_hal.h
275 @@ -1263,6 +1263,7 @@
277 tail -f /var/log/messages | sed -f hal_unmangle.sed
280 static inline void ath_hal_dump_map(struct ath_hal *ah)
282 #ifdef CONFIG_KALLSYMS
283 @@ -1527,7 +1528,7 @@
284 #endif /* #ifndef CONFIG_KALLSYMS */
289 #include "if_ath_hal_wrappers.h"
290 #include "if_ath_hal_extensions.h"
292 --- a/net80211/ieee80211_var.h
293 +++ b/net80211/ieee80211_var.h
295 /* inject a fake radar signal -- used while on a 802.11h DFS channels */
296 unsigned int (*ic_test_radar)(struct ieee80211com *);
300 unsigned int (*ic_dump_hal_map)(struct ieee80211com *);
303 /* DFS channel availability check time (in seconds) */
304 void (*ic_set_dfs_cac_time)(struct ieee80211com *, unsigned int);
305 unsigned int (*ic_get_dfs_cac_time)(struct ieee80211com *);
306 --- a/net80211/ieee80211_wireless.c
307 +++ b/net80211/ieee80211_wireless.c
308 @@ -1557,6 +1557,7 @@
314 ieee80211_ioctl_hal_map(struct net_device *dev, struct iw_request_info *info,
315 void *w, char *extra)
316 @@ -1567,7 +1568,7 @@
317 params[0] = ic->ic_dump_hal_map(ic);
324 ieee80211_ioctl_radar(struct net_device *dev, struct iw_request_info *info,
325 @@ -5296,8 +5297,10 @@
326 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getwmmparams" },
327 { IEEE80211_IOCTL_RADAR,
328 0, 0, "doth_radar" },
330 { IEEE80211_IOCTL_HALMAP,
331 0, 0, "dump_hal_map" },
334 * These depends on sub-ioctl support which added in version 12.
336 @@ -5751,7 +5754,9 @@
337 set_priv(IEEE80211_IOCTL_SETMLME, ieee80211_ioctl_setmlme),
338 set_priv(IEEE80211_IOCTL_SETKEY, ieee80211_ioctl_setkey),
339 set_priv(IEEE80211_IOCTL_DELKEY, ieee80211_ioctl_delkey),
341 set_priv(IEEE80211_IOCTL_HALMAP, ieee80211_ioctl_hal_map),
343 set_priv(IEEE80211_IOCTL_ADDMAC, ieee80211_ioctl_addmac),
344 set_priv(IEEE80211_IOCTL_DELMAC, ieee80211_ioctl_delmac),
345 set_priv(IEEE80211_IOCTL_WDSADDMAC, ieee80211_ioctl_wdsmac),
346 --- a/ath/if_ath_debug.h
347 +++ b/ath/if_ath_debug.h
349 ATH_DEBUG_GLOBAL = (ATH_DEBUG_SKB|ATH_DEBUG_SKB_REF)
352 +#define EPRINTF(_sc, _fmt, ...) \
353 + printk(KERN_ERR "%s: %s: " _fmt, \
354 + SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
358 /* DEBUG-ONLY DEFINITIONS */
360 ath_keyprint((_sc), __func__, _ix, _hk, _mac); \
363 -#else /* #ifdef AR_DEBUG */
365 -#define DFLAG_ISSET(sc, _m) 0
366 -#define DPRINTF(sc, _m, _fmt, ...)
367 -#define KEYPRINTF(sc, k, ix, mac)
369 -#endif /* #ifdef AR_DEBUG */
371 #define IFF_DUMPPKTS(_sc, _m) DFLAG_ISSET((_sc), (_m))
373 -#define EPRINTF(_sc, _fmt, ...) \
374 - printk(KERN_ERR "%s: %s: " _fmt, \
375 - SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
377 #define WPRINTF(_sc, _fmt, ...) \
378 printk(KERN_WARNING "%s: %s: " _fmt, \
379 SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
381 #define IPRINTF(_sc, _fmt, ...) \
382 printk(KERN_INFO "%s: %s: " _fmt, \
383 SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
385 +#define DFLAG_ISSET(sc, _m) 0
386 +#define DPRINTF(sc, _m, _fmt, ...)
387 +#define KEYPRINTF(sc, k, ix, mac)
388 +#define WPRINTF(...)
389 +#define IPRINTF(...)
390 +#define IFF_DUMPPKTS(...) 0
394 #endif /* #ifndef _IF_ATH_DEBUG_H_ */
395 --- a/ath/if_ath_pci.c
396 +++ b/ath/if_ath_pci.c
401 - if (pci_enable_device(pdev))
402 + if (pci_enable_device(pdev)) {
403 + printk(KERN_ERR "%s: failed to enable PCI device\n", dev_info);
407 /* XXX 32-bit addressing only */
408 if (pci_set_dma_mask(pdev, 0xffffffff)) {
410 sc->aps_sc.sc_ledpin = 1;
413 - if (ath_attach(vdevice, dev, NULL) != 0)
414 + if ((i = ath_attach(vdevice, dev, NULL)) != 0) {
415 + printk(KERN_ERR "%s: ath_attach failed: %d\n", dev_info, i);
419 athname = ath_hal_probe(id->vendor, vdevice);
420 printk(KERN_INFO "%s: %s: %s: mem=0x%llx, irq=%d\n",