1 Index: madwifi-trunk-r3776/ath/if_ath.c
2 ===================================================================
3 --- madwifi-trunk-r3776.orig/ath/if_ath.c 2008-07-17 00:53:04.000000000 +0200
4 +++ madwifi-trunk-r3776/ath/if_ath.c 2008-07-17 01:15:21.000000000 +0200
6 static void ath_set_dfs_cac_time(struct ieee80211com *, unsigned int seconds);
8 static unsigned int ath_test_radar(struct ieee80211com *);
9 -static unsigned int ath_dump_hal_map(struct ieee80211com *ic);
12 +static unsigned int ath_dump_hal_map(struct ieee80211com *ic);
14 static u_int32_t ath_get_clamped_maxtxpower(struct ath_softc *sc);
15 static u_int32_t ath_set_clamped_maxtxpower(struct ath_softc *sc,
16 u_int32_t new_clamped_maxtxpower);
18 unsigned int param, unsigned int value);
20 static u_int32_t ath_get_real_maxtxpower(struct ath_softc *sc);
23 static int ath_txq_check(struct ath_softc *sc, struct ath_txq *txq, const char *msg);
26 static int ath_countrycode = CTRY_DEFAULT; /* country code */
27 static int ath_outdoor = AH_FALSE; /* enable outdoor use */
33 ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL);
34 sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL);
35 DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid);
38 /* Allocate space for dynamically determined maximum VAP count */
41 ic->ic_vap_delete = ath_vap_delete;
43 ic->ic_test_radar = ath_test_radar;
45 ic->ic_dump_hal_map = ath_dump_hal_map;
48 ic->ic_set_dfs_testmode = ath_set_dfs_testmode;
49 ic->ic_get_dfs_testmode = ath_get_dfs_testmode;
50 @@ -1285,12 +1294,14 @@
51 /* If no default VAP debug flags are passed, allow a few to
52 * transfer down from the driver to new VAPs so we can have load
53 * time debugging for VAPs too. */
56 ((sc->sc_debug & ATH_DEBUG_RATE) ? IEEE80211_MSG_XRATE : 0) |
57 ((sc->sc_debug & ATH_DEBUG_XMIT) ? IEEE80211_MSG_OUTPUT : 0) |
58 ((sc->sc_debug & ATH_DEBUG_RECV) ? IEEE80211_MSG_INPUT : 0) |
63 ic->ic_debug = (sc->sc_default_ieee80211_debug & IEEE80211_MSG_IC);
71 ath_txq_dump(struct ath_softc *sc, struct ath_txq *txq)
80 * Insert a buffer on a txq
82 ath_tx_timeout(struct net_device *dev)
84 struct ath_softc *sc = dev->priv;
89 if (ath_chan_unavail(sc))
91 @@ -8393,12 +8408,14 @@
92 (dev->flags & IFF_RUNNING) ? "" : "NOT ",
93 sc->sc_invalid ? "in" : "");
96 for (i = 0; i < HAL_NUM_TX_QUEUES; i++) {
97 if (ATH_TXQ_SETUP(sc, i)) {
98 ath_txq_check(sc, &sc->sc_txq[i], __func__);
99 ath_txq_dump(sc, &sc->sc_txq[i]);
104 if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) {
105 sc->sc_stats.ast_watchdog++;
106 @@ -10638,6 +10655,7 @@
112 sc->sc_debug = (val & ~ATH_DEBUG_GLOBAL);
113 ath_debug_global = (val & ATH_DEBUG_GLOBAL);
114 @@ -10645,6 +10663,7 @@
122 @@ -10818,9 +10837,11 @@
124 ath_hal_getregdomain(ah, &val);
128 val = sc->sc_debug | ath_debug_global;
132 val = sc->sc_txantenna;
134 @@ -11939,6 +11960,7 @@
137 /* This is called by a private ioctl (iwpriv) to dump the HAL obfuscation table */
140 ath_dump_hal_map(struct ieee80211com *ic)
142 @@ -11947,7 +11969,7 @@
143 ath_hal_dump_map(sc->sc_ah);
148 /* If we are shutting down or blowing off the DFS channel availability check
149 * then we call this to stop the behavior before we take the rest of the
150 * necessary actions (such as a DFS reaction to radar). */
151 Index: madwifi-trunk-r3776/ath_rate/amrr/amrr.c
152 ===================================================================
153 --- madwifi-trunk-r3776.orig/ath_rate/amrr/amrr.c 2008-07-17 00:21:30.000000000 +0200
154 +++ madwifi-trunk-r3776/ath_rate/amrr/amrr.c 2008-07-17 00:53:20.000000000 +0200
163 #define DPRINTF(sc, _fmt, ...) do { \
164 if (sc->sc_debug & 0x10) \
165 Index: madwifi-trunk-r3776/ath_rate/minstrel/minstrel.c
166 ===================================================================
167 --- madwifi-trunk-r3776.orig/ath_rate/minstrel/minstrel.c 2008-07-17 00:47:36.000000000 +0200
168 +++ madwifi-trunk-r3776/ath_rate/minstrel/minstrel.c 2008-07-17 01:16:06.000000000 +0200
171 #include "minstrel.h"
174 #define MINSTREL_DEBUG
176 #ifdef MINSTREL_DEBUG
178 ATH_DEBUG_RATE = 0x00000010 /* rate control */
180 (struct ieee80211_node_table *)&vap->iv_ic->ic_sta;
182 unsigned int this_tp, this_prob, this_eprob;
183 - struct ath_softc *sc = vap->iv_ic->ic_dev->priv;;
185 + struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
188 IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
189 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
190 Index: madwifi-trunk-r3776/ath_rate/onoe/onoe.c
191 ===================================================================
192 --- madwifi-trunk-r3776.orig/ath_rate/onoe/onoe.c 2008-07-17 00:21:29.000000000 +0200
193 +++ madwifi-trunk-r3776/ath_rate/onoe/onoe.c 2008-07-17 00:53:20.000000000 +0200
203 ATH_DEBUG_RATE = 0x00000010, /* rate control */
204 Index: madwifi-trunk-r3776/ath_rate/sample/sample.c
205 ===================================================================
206 --- madwifi-trunk-r3776.orig/ath_rate/sample/sample.c 2008-07-17 00:21:30.000000000 +0200
207 +++ madwifi-trunk-r3776/ath_rate/sample/sample.c 2008-07-17 00:53:20.000000000 +0200
212 -#define SAMPLE_DEBUG
214 +#define SAMPLE_DEBUG
218 ATH_DEBUG_RATE = 0x00000010, /* rate control */
219 Index: madwifi-trunk-r3776/tools/do_multi.c
220 ===================================================================
221 --- madwifi-trunk-r3776.orig/tools/do_multi.c 2008-07-17 00:46:52.000000000 +0200
222 +++ madwifi-trunk-r3776/tools/do_multi.c 2008-07-17 00:53:20.000000000 +0200
225 progname = basename(argv[0]);
228 if(strcmp(progname, "80211debug") == 0)
229 ret = a80211debug_init(argc, argv);
231 if(strcmp(progname, "80211stats") == 0)
232 ret = a80211stats_init(argc, argv);
233 if(strcmp(progname, "athchans") == 0)
234 ret = athchans_init(argc, argv);
235 if(strcmp(progname, "athctrl") == 0)
236 ret = athctrl_init(argc, argv);
238 if(strcmp(progname, "athdebug") == 0)
239 ret = athdebug_init(argc, argv);
241 if(strcmp(progname, "athkey") == 0)
242 ret = athkey_init(argc, argv);
243 if(strcmp(progname, "athstats") == 0)
244 Index: madwifi-trunk-r3776/tools/Makefile
245 ===================================================================
246 --- madwifi-trunk-r3776.orig/tools/Makefile 2008-07-17 00:45:15.000000000 +0200
247 +++ madwifi-trunk-r3776/tools/Makefile 2008-07-17 01:10:33.000000000 +0200
250 ATH_HAL = $(TOP)/ath_hal
257 # Path to the HAL source code.
263 +INCS = -I. -I$(HAL) -I$(TOP) -I$(ATH_HAL) -I$(TOP)/ath
264 +CFLAGS = -g -O2 -Wall
265 +ALL_CFLAGS = $(CFLAGS) $(INCS)
268 PROGRAMS = athstats 80211stats athkey athchans athctrl \
269 - athdebug 80211debug wlanconfig wpakey
272 +ifeq ($(ATH_DEBUG),1)
273 + PROGRAMS += athdebug 80211debug
274 + ALL_CFLAGS += -DAR_DEBUG
277 OBJS = $(patsubst %,%.o,$(PROGRAMS)) ath_info/ath_info.o
280 -INCS = -I. -I$(HAL) -I$(TOP) -I$(ATH_HAL) -I$(TOP)/ath
281 -CFLAGS = -g -O2 -Wall
282 -ALL_CFLAGS = $(CFLAGS) $(INCS)
285 all: all-subdirs compile
287 Index: madwifi-trunk-r3776/ath/if_ath_hal.h
288 ===================================================================
289 --- madwifi-trunk-r3776.orig/ath/if_ath_hal.h 2008-07-17 00:21:39.000000000 +0200
290 +++ madwifi-trunk-r3776/ath/if_ath_hal.h 2008-07-17 00:53:20.000000000 +0200
291 @@ -1263,6 +1263,7 @@
293 tail -f /var/log/messages | sed -f hal_unmangle.sed
296 static inline void ath_hal_dump_map(struct ath_hal *ah)
298 #ifdef CONFIG_KALLSYMS
299 @@ -1527,7 +1528,7 @@
300 #endif /* #ifndef CONFIG_KALLSYMS */
305 #include "if_ath_hal_wrappers.h"
306 #include "if_ath_hal_extensions.h"
308 Index: madwifi-trunk-r3776/net80211/ieee80211_var.h
309 ===================================================================
310 --- madwifi-trunk-r3776.orig/net80211/ieee80211_var.h 2008-07-17 00:21:29.000000000 +0200
311 +++ madwifi-trunk-r3776/net80211/ieee80211_var.h 2008-07-17 00:53:20.000000000 +0200
313 /* inject a fake radar signal -- used while on a 802.11h DFS channels */
314 unsigned int (*ic_test_radar)(struct ieee80211com *);
318 unsigned int (*ic_dump_hal_map)(struct ieee80211com *);
321 /* DFS channel availability check time (in seconds) */
322 void (*ic_set_dfs_cac_time)(struct ieee80211com *, unsigned int);
323 unsigned int (*ic_get_dfs_cac_time)(struct ieee80211com *);
324 Index: madwifi-trunk-r3776/net80211/ieee80211_wireless.c
325 ===================================================================
326 --- madwifi-trunk-r3776.orig/net80211/ieee80211_wireless.c 2008-07-17 00:21:29.000000000 +0200
327 +++ madwifi-trunk-r3776/net80211/ieee80211_wireless.c 2008-07-17 00:53:20.000000000 +0200
328 @@ -1557,6 +1557,7 @@
334 ieee80211_ioctl_hal_map(struct net_device *dev, struct iw_request_info *info,
335 void *w, char *extra)
336 @@ -1567,7 +1568,7 @@
337 params[0] = ic->ic_dump_hal_map(ic);
344 ieee80211_ioctl_radar(struct net_device *dev, struct iw_request_info *info,
345 @@ -5296,8 +5297,10 @@
346 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getwmmparams" },
347 { IEEE80211_IOCTL_RADAR,
348 0, 0, "doth_radar" },
350 { IEEE80211_IOCTL_HALMAP,
351 0, 0, "dump_hal_map" },
354 * These depends on sub-ioctl support which added in version 12.
356 @@ -5751,7 +5754,9 @@
357 set_priv(IEEE80211_IOCTL_SETMLME, ieee80211_ioctl_setmlme),
358 set_priv(IEEE80211_IOCTL_SETKEY, ieee80211_ioctl_setkey),
359 set_priv(IEEE80211_IOCTL_DELKEY, ieee80211_ioctl_delkey),
361 set_priv(IEEE80211_IOCTL_HALMAP, ieee80211_ioctl_hal_map),
363 set_priv(IEEE80211_IOCTL_ADDMAC, ieee80211_ioctl_addmac),
364 set_priv(IEEE80211_IOCTL_DELMAC, ieee80211_ioctl_delmac),
365 set_priv(IEEE80211_IOCTL_WDSADDMAC, ieee80211_ioctl_wdsmac),
366 Index: madwifi-trunk-r3776/ath/if_ath_debug.h
367 ===================================================================
368 --- madwifi-trunk-r3776.orig/ath/if_ath_debug.h 2008-07-17 00:21:39.000000000 +0200
369 +++ madwifi-trunk-r3776/ath/if_ath_debug.h 2008-07-17 00:53:20.000000000 +0200
371 ATH_DEBUG_GLOBAL = (ATH_DEBUG_SKB|ATH_DEBUG_SKB_REF)
374 +#define EPRINTF(_sc, _fmt, ...) \
375 + printk(KERN_ERR "%s: %s: " _fmt, \
376 + SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
380 /* DEBUG-ONLY DEFINITIONS */
382 ath_keyprint((_sc), __func__, _ix, _hk, _mac); \
385 -#else /* #ifdef AR_DEBUG */
387 -#define DFLAG_ISSET(sc, _m) 0
388 -#define DPRINTF(sc, _m, _fmt, ...)
389 -#define KEYPRINTF(sc, k, ix, mac)
391 -#endif /* #ifdef AR_DEBUG */
393 #define IFF_DUMPPKTS(_sc, _m) DFLAG_ISSET((_sc), (_m))
395 -#define EPRINTF(_sc, _fmt, ...) \
396 - printk(KERN_ERR "%s: %s: " _fmt, \
397 - SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
399 #define WPRINTF(_sc, _fmt, ...) \
400 printk(KERN_WARNING "%s: %s: " _fmt, \
401 SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
403 #define IPRINTF(_sc, _fmt, ...) \
404 printk(KERN_INFO "%s: %s: " _fmt, \
405 SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__)
407 +#define DFLAG_ISSET(sc, _m) 0
408 +#define DPRINTF(sc, _m, _fmt, ...)
409 +#define KEYPRINTF(sc, k, ix, mac)
410 +#define WPRINTF(...)
411 +#define IPRINTF(...)
412 +#define IFF_DUMPPKTS(...) 0
416 #endif /* #ifndef _IF_ATH_DEBUG_H_ */
417 Index: madwifi-trunk-r3776/ath/if_ath_pci.c
418 ===================================================================
419 --- madwifi-trunk-r3776.orig/ath/if_ath_pci.c 2008-07-17 00:21:39.000000000 +0200
420 +++ madwifi-trunk-r3776/ath/if_ath_pci.c 2008-07-17 00:53:20.000000000 +0200
425 - if (pci_enable_device(pdev))
426 + if (pci_enable_device(pdev)) {
427 + printk(KERN_ERR "%s: failed to enable PCI device\n", dev_info);
431 /* XXX 32-bit addressing only */
432 if (pci_set_dma_mask(pdev, 0xffffffff)) {
434 sc->aps_sc.sc_ledpin = 1;
437 - if (ath_attach(vdevice, dev, NULL) != 0)
438 + if ((i = ath_attach(vdevice, dev, NULL)) != 0) {
439 + printk(KERN_ERR "%s: ath_attach failed: %d\n", dev_info, i);
443 athname = ath_hal_probe(id->vendor, vdevice);
444 printk(KERN_INFO "%s: %s: %s: mem=0x%llx, irq=%d\n",