Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(35) |
Feb
(46) |
Mar
(38) |
Apr
(3) |
May
(41) |
Jun
(102) |
Jul
(32) |
Aug
(84) |
Sep
(69) |
Oct
(32) |
Nov
(3) |
Dec
(11) |
2005 |
Jan
(14) |
Feb
(113) |
Mar
(73) |
Apr
(74) |
May
(28) |
Jun
(51) |
Jul
(55) |
Aug
(5) |
Sep
(2) |
Oct
(78) |
Nov
(97) |
Dec
(24) |
2006 |
Jan
(48) |
Feb
(36) |
Mar
(31) |
Apr
(48) |
May
(78) |
Jun
(46) |
Jul
(46) |
Aug
(9) |
Sep
(41) |
Oct
(44) |
Nov
(33) |
Dec
(39) |
2007 |
Jan
(185) |
Feb
(109) |
Mar
(84) |
Apr
(53) |
May
(109) |
Jun
(112) |
Jul
(99) |
Aug
(71) |
Sep
(14) |
Oct
(102) |
Nov
(178) |
Dec
(109) |
2008 |
Jan
(216) |
Feb
(47) |
Mar
(49) |
Apr
(178) |
May
(95) |
Jun
(60) |
Jul
(91) |
Aug
(17) |
Sep
(15) |
Oct
(2) |
Nov
(7) |
Dec
(24) |
2009 |
Jan
(39) |
Feb
(12) |
Mar
|
Apr
(63) |
May
(17) |
Jun
(36) |
Jul
(14) |
Aug
(11) |
Sep
(9) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
(19) |
Feb
|
Mar
(9) |
Apr
(1) |
May
|
Jun
(4) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(6) |
Jun
(5) |
Jul
(2) |
Aug
(18) |
Sep
|
Oct
(7) |
Nov
(2) |
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
(9) |
2
|
3
|
4
(3) |
5
(5) |
6
(6) |
7
(1) |
8
(3) |
9
(1) |
10
(3) |
11
|
12
(3) |
13
|
14
|
15
(4) |
16
(1) |
17
(1) |
18
(3) |
19
(7) |
20
(1) |
21
(3) |
22
(3) |
23
|
24
(1) |
25
|
26
(1) |
27
|
28
|
29
|
30
(1) |
|
|
|
|
|
From: Scott Raynel <svn-commits@ma...> - 2008-06-30 05:27:58
|
Project : madwifi Revision : 3747 Author : scottr (Scott Raynel) Date : 2008-06-30 07:27:52 +0200 (Mon, 30 Jun 2008) Log Message : Fix compilation when fast frames are disabled. Affected Files: * madwifi/trunk/ath/if_ath.c updated Modified: madwifi/trunk/ath/if_ath.c =================================================================== --- madwifi/trunk/ath/if_ath.c 2008-06-26 08:23:41 UTC (rev 3746) +++ madwifi/trunk/ath/if_ath.c 2008-06-30 05:27:52 UTC (rev 3747) @@ -2868,9 +2868,10 @@ struct ath_txq *txq, struct ath_buf *bf, int framelen) { struct ath_hal *ah = sc->sc_ah; + +#ifdef ATH_SUPERG_FF struct ath_desc *ds = bf->bf_desc; -#ifdef ATH_SUPERG_FF /* Go to the last descriptor. * NB: This code assumes that the descriptors for a buf are allocated, * contiguously. This assumption is made elsewhere too. */ @@ -3269,6 +3270,9 @@ struct ath_buf *tbf; struct sk_buff *tskb; int framecnt; + struct sk_buff *original_skb = __skb; /* ALWAYS FREE THIS ONE!!! */ + struct ath_node *an; + struct sk_buff *skb = NULL; /* We will use the requeue flag to denote when to stuff a skb back into * the OS queues. This should NOT be done under low memory conditions, * such as skb allocation failure. However, it should be done for the @@ -3278,14 +3282,11 @@ #ifdef ATH_SUPERG_FF unsigned int pktlen; struct ieee80211com *ic = &sc->sc_ic; - struct ath_node *an; struct ath_txq *txq = NULL; - struct sk_buff *skb = NULL; /* NB: NEVER free __skb, leave it alone and use original_skb instead! * IF original_skb is NULL it means the ownership was taken! * *** ALWAYS *** free any skb != __skb when cleaning up - unless it was * taken. */ - struct sk_buff *original_skb = __skb; /* ALWAYS FREE THIS ONE!!! */ int ff_flush; #endif ieee80211_skb_track(original_skb); @@ -3366,10 +3367,7 @@ requeue = 0; goto hardstart_fail; } -#endif - -#ifdef ATH_SUPERG_FF /* NB: use this lock to protect an->an_tx_ffbuf (and txq->axq_stageq) * in athff_can_aggregate() call too. */ ATH_TXQ_LOCK_IRQ(txq); @@ -12500,10 +12498,13 @@ } snprintf(sacontext, sizeof(sacontext), "%s staging area", context); + +#ifdef ATH_SUPERG_FF TAILQ_FOREACH(tbf, &txq->axq_stageq, bf_stagelist) { ath_scanbufs_found_buf_locked(sc, dd, dd_bufs_found, tbf, sacontext); } +#endif } static void @@ -12535,10 +12536,13 @@ "] mcast queue staging area", DEV_NAME(av->av_vap.iv_dev), av, MAC_ADDR(av->av_vap.iv_bssid)); + +#ifdef ATH_SUPERG_FF TAILQ_FOREACH(tbf, &av->av_mcastq.axq_stageq, bf_stagelist) { ath_scanbufs_found_buf_locked(sc, dd, dd_bufs_found, tbf, context); } +#endif } } |
From: Scott Raynel <svn-commits@ma...> - 2008-06-26 08:23:50
|
Project : madwifi Revision : 3746 Author : scottr (Scott Raynel) Date : 2008-06-26 10:23:41 +0200 (Thu, 26 Jun 2008) Log Message : Register sysctl before doing pci registration. This fixes a bug when renaming multiple wireless cards on slow devices. The pci registration causes udev to rename the device but the sysctl is not registered yet so the device renames but the corresponding sysctl entries are not renamed. Affected Files: * madwifi/trunk/ath/if_ath.c updated * madwifi/trunk/ath/if_ath_pci.c updated Modified: madwifi/trunk/ath/if_ath.c =================================================================== --- madwifi/trunk/ath/if_ath.c 2008-06-24 03:09:25 UTC (rev 3745) +++ madwifi/trunk/ath/if_ath.c 2008-06-26 08:23:41 UTC (rev 3746) @@ -11024,6 +11024,10 @@ unsigned int i, space; char *dev_name = NULL; + /* Prevent multiple registrations */ + if (sc->sc_sysctls) + return; + space = 5 * sizeof(struct ctl_table) + sizeof(ath_sysctl_template); sc->sc_sysctls = kzalloc(space, GFP_KERNEL); if (sc->sc_sysctls == NULL) { @@ -11041,6 +11045,8 @@ dev_name = kmalloc((strlen(DEV_NAME(sc->sc_dev)) + 1) * sizeof(char), GFP_KERNEL); if (dev_name == NULL) { EPRINTF(sc, "Insufficient memory for device name storage!\n"); + kfree(sc->sc_sysctls); + sc->sc_sysctls = NULL; return; } strncpy(dev_name, DEV_NAME(sc->sc_dev), strlen(DEV_NAME(sc->sc_dev)) + 1); Modified: madwifi/trunk/ath/if_ath_pci.c =================================================================== --- madwifi/trunk/ath/if_ath_pci.c 2008-06-24 03:09:25 UTC (rev 3745) +++ madwifi/trunk/ath/if_ath_pci.c 2008-06-26 08:23:41 UTC (rev 3746) @@ -380,10 +380,12 @@ static int __init init_ath_pci(void) { - int status = pci_register_driver(&ath_pci_driver); - if (status) + int status; + ath_sysctl_register(); + if ((status = pci_register_driver(&ath_pci_driver))) { + ath_sysctl_unregister(); return (status); - ath_sysctl_register(); + } return (0); } module_init(init_ath_pci); |
From: Matthew W. S. Bell <svn-commits@ma...> - 2008-06-24 03:09:36
|
Project : madwifi Revision : 3745 Author : mentor (Matthew W. S. Bell) Date : 2008-06-24 05:09:25 +0200 (Tue, 24 Jun 2008) Log Message : Add an error message if a unique BSSID is requested but the hardware does not support the BSSID mask Affected Files: * madwifi/trunk/ath/if_ath.c updated Modified: madwifi/trunk/ath/if_ath.c =================================================================== --- madwifi/trunk/ath/if_ath.c 2008-06-22 05:32:29 UTC (rev 3744) +++ madwifi/trunk/ath/if_ath.c 2008-06-24 03:09:25 UTC (rev 3745) @@ -1301,30 +1301,31 @@ /* Use RadioTAP interface type for monitor mode. */ dev->type = ARPHRD_IEEE80211_RADIOTAP; - if ((flags & IEEE80211_CLONE_BSSID) && sc->sc_hasbmask) { - struct ieee80211vap *v; - uint64_t id_mask; - unsigned int id; + if (flags & IEEE80211_CLONE_BSSID) { + if (sc->sc_hasbmask) { + struct ieee80211vap *v; + uint64_t id_mask = 0; + unsigned int id; - /* - * Hardware supports the bssid mask and a unique - * bssid was requested. Assign a new mac address - * and expand our bssid mask to cover the active - * virtual APs with distinct addresses. - */ + /* Hardware supports the BSSID mask and a unique + * BSSID was requested. Assign a new MAC address + * and expand our BSSID mask to cover the active + * virtual APs with distinct addresses. */ + /* Do a full search to mark all the allocated VAPs. */ + TAILQ_FOREACH(v, &ic->ic_vaps, iv_next) + id_mask |= (1 << ATH_GET_VAP_ID(v->iv_myaddr)); - /* do a full search to mark all the allocated VAPs */ - id_mask = 0; - TAILQ_FOREACH(v, &ic->ic_vaps, iv_next) - id_mask |= (1 << ATH_GET_VAP_ID(v->iv_myaddr)); - - for (id = 1; id < ath_maxvaps; id++) { - /* get the first available slot */ - if ((id_mask & (1 << id)) == 0) { - ATH_SET_VAP_BSSID(vap->iv_myaddr, id); - ATH_SET_VAP_BSSID(vap->iv_bssid, id); - break; + for (id = 1; id < ath_maxvaps; id++) { + /* Get the first available slot. */ + if ((id_mask & (1 << id)) == 0) { + ATH_SET_VAP_BSSID(vap->iv_myaddr, id); + ATH_SET_VAP_BSSID(vap->iv_bssid, id); + break; + } } + } else { + EPRINTF(sc, "Unique BSSID requested on HW that does" + "does not support the necessary features."); } } avp->av_bslot = -1; |
From: Pavel Roskin <svn-commits@ma...> - 2008-06-22 05:33:23
|
Project : madwifi Revision : 3739 Author : proski (Pavel Roskin) Date : 2008-06-20 18:55:43 +0200 (Fri, 20 Jun 2008) Log Message : Add "+" to MAC revision names that don't match exactly Fix MAC revision for AR2425. Add revision for AR5513. Don't show MAC version, we cannot calculate it reliably. Affected Files: * ath_info/trunk/ath_info.c updated Modified: ath_info/trunk/ath_info.c =================================================================== --- ath_info/trunk/ath_info.c 2008-06-20 07:32:16 UTC (rev 3738) +++ ath_info/trunk/ath_info.c 2008-06-20 16:55:43 UTC (rev 3739) @@ -73,6 +73,7 @@ #define AR5K_SREV_MAC_AR5212 0x50 #define AR5K_SREV_MAC_AR5213 0x55 #define AR5K_SREV_MAC_AR5213A 0x59 +#define AR5K_SREV_MAC_AR5513 0x61 #define AR5K_SREV_MAC_AR2413 0x78 #define AR5K_SREV_MAC_AR2414 0x79 #define AR5K_SREV_MAC_AR2424 0xa0 @@ -81,7 +82,7 @@ #define AR5K_SREV_MAC_AR5414 0xa5 #define AR5K_SREV_MAC_AR5416 0xc0 #define AR5K_SREV_MAC_AR5418 0xca -#define AR5K_SREV_MAC_AR2425 0xe0 +#define AR5K_SREV_MAC_AR2425 0xe2 /* Known PHY revision numbers */ #define AR5K_SREV_PHY_5110 0x00 @@ -1304,15 +1305,18 @@ static const char *ath5k_hw_get_mac_name(u_int8_t val) { - const char *name = "?????"; + static char name[16]; unsigned int i; for (i = 0; i < ARRAY_SIZE(ath5k_mac_names); i++) { - if (val >= ath5k_mac_names[i].sr_val) { - name = ath5k_mac_names[i].sr_name; - } + if (val <= ath5k_mac_names[i].sr_val) + break; } + if (val == ath5k_mac_names[i].sr_val) + return ath5k_mac_names[i].sr_name; + + snprintf(name, sizeof(name), "%s+", ath5k_mac_names[i - 1].sr_name); return name; } @@ -2126,9 +2130,6 @@ printf(" -==Device Information==-\n"); - printf("MAC Version: %-5s (0x%02x)\n", - ath5k_hw_get_mac_name(mac_version), mac_version); - printf("MAC Revision: %-5s (0x%02x)\n", ath5k_hw_get_mac_name(mac_revision), mac_revision); |
From: Matthew W. S. Bell <svn-commits@ma...> - 2008-06-22 05:32:37
|
Project : madwifi Revision : 3744 Author : mentor (Matthew W. S. Bell) Date : 2008-06-22 07:32:29 +0200 (Sun, 22 Jun 2008) Log Message : Add an informational message when debug flags are changed. Affected Files: * madwifi/trunk/ath/if_ath.c updated * madwifi/trunk/net80211/ieee80211_linux.c updated Modified: madwifi/trunk/ath/if_ath.c =================================================================== --- madwifi/trunk/ath/if_ath.c 2008-06-22 02:12:53 UTC (rev 3743) +++ madwifi/trunk/ath/if_ath.c 2008-06-22 05:32:29 UTC (rev 3744) @@ -10613,6 +10613,9 @@ case ATH_DEBUG: sc->sc_debug = (val & ~ATH_DEBUG_GLOBAL); ath_debug_global = (val & ATH_DEBUG_GLOBAL); + IPRINTF(sc, "Ath. debug flags changed to " + "0x%08x.\n", val); + break; case ATH_TXANTENNA: /* Modified: madwifi/trunk/net80211/ieee80211_linux.c =================================================================== --- madwifi/trunk/net80211/ieee80211_linux.c 2008-06-22 02:12:53 UTC (rev 3743) +++ madwifi/trunk/net80211/ieee80211_linux.c 2008-06-22 05:32:29 UTC (rev 3744) @@ -542,6 +542,8 @@ if (ret == 0) { vap->iv_debug = (val & ~IEEE80211_MSG_IC); vap->iv_ic->ic_debug = (val & IEEE80211_MSG_IC); + printk(KERN_INFO "%s debug flags changed to 0x%08x.\n", + vap->iv_dev->name, val); } } else { /* VAP specific and 'global' debug flags */ |
From: Matthew W. S. Bell <svn-commits@ma...> - 2008-06-22 05:16:40
|
Project : madwifi Revision : 3743 Author : mentor (Matthew W. S. Bell) Date : 2008-06-22 04:12:53 +0200 (Sun, 22 Jun 2008) Log Message : Convert various _debug style char *func and int line passing to use dump_stack. This may possibly be a tad noisy still. Affected Files: * madwifi/trunk/ath/if_ath.c updated * madwifi/trunk/ath/if_athvar.h updated * madwifi/trunk/net80211/ieee80211_node.c updated * madwifi/trunk/net80211/ieee80211_node.h updated * madwifi/trunk/net80211/ieee80211_scan.c updated * madwifi/trunk/net80211/ieee80211_skb.c updated * madwifi/trunk/net80211/ieee80211_skb.h updated * madwifi/trunk/net80211/ieee80211_var.h updated Modified: madwifi/trunk/ath/if_ath.c =================================================================== --- madwifi/trunk/ath/if_ath.c 2008-06-21 14:40:43 UTC (rev 3742) +++ madwifi/trunk/ath/if_ath.c 2008-06-22 02:12:53 UTC (rev 3743) @@ -164,18 +164,9 @@ static int ath_desc_alloc(struct ath_softc *); static void ath_desc_free(struct ath_softc *); -#ifdef IEEE80211_DEBUG_REFCNT -static struct ieee80211_node *ath_node_alloc_debug(struct ieee80211vap *, - const char *func, int line); -static void ath_node_cleanup_debug(struct ieee80211_node *, const char *func, - int line); -static void ath_node_free_debug(struct ieee80211_node *, const char *func, - int line); -#else static struct ieee80211_node *ath_node_alloc(struct ieee80211vap *); static void ath_node_cleanup(struct ieee80211_node *); static void ath_node_free(struct ieee80211_node *); -#endif static u_int8_t ath_node_getrssi(const struct ieee80211_node *); static struct sk_buff *ath_rxbuf_take_skb(struct ath_softc *, struct ath_buf *); @@ -276,51 +267,14 @@ static const char *ath_get_hal_status_desc(HAL_STATUS status); static int ath_rcv_dev_event(struct notifier_block *, unsigned long, void *); -#ifdef IEEE80211_DEBUG_REFCNT -#define ath_return_txbuf(_sc, _pbuf) \ - ath_return_txbuf_debug(_sc, _pbuf, __func__, __LINE__) -static void ath_return_txbuf_debug(struct ath_softc *sc, struct ath_buf **buf, - const char *func, int line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ static void ath_return_txbuf(struct ath_softc *sc, struct ath_buf **buf); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ - -#ifdef IEEE80211_DEBUG_REFCNT -#define ath_return_txbuf_locked(_sc, _pbuf) \ - ath_return_txbuf_locked_debug(_sc, _pbuf, __func__, __LINE__) -static void ath_return_txbuf_locked_debug(struct ath_softc *sc, struct ath_buf **buf, - const char *func, int line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ static void ath_return_txbuf_locked(struct ath_softc *sc, struct ath_buf **buf); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ath_return_txbuf_list(_sc, _head) \ - ath_return_txbuf_list_debug(_sc, _head, __func__, __LINE__) -static void ath_return_txbuf_list_debug(struct ath_softc *sc, ath_bufhead *bfhead, - const char *func, int line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ static void ath_return_txbuf_list(struct ath_softc *sc, ath_bufhead *bfhead); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ - -#ifdef IEEE80211_DEBUG_REFCNT -#define ath_return_txbuf_list_locked(_sc, _head) \ - ath_return_txbuf_list_locked_debug(_sc, _head, __func__, __LINE__) -static void ath_return_txbuf_list_locked_debug(struct ath_softc *sc, ath_bufhead *bfhead, - const char *func, int line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ static void ath_return_txbuf_list_locked(struct ath_softc *sc, ath_bufhead *bfhead); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ -#ifdef IEEE80211_DEBUG_REFCNT -#define cleanup_ath_buf(_sc, _buf, _dir) \ - cleanup_ath_buf_debug(_sc, _buf, _dir, __func__, __LINE__) -static struct ath_buf *cleanup_ath_buf_debug(struct ath_softc *sc, struct ath_buf *buf, - int direction, const char *func, int line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ -static struct ath_buf *cleanup_ath_buf(struct ath_softc *sc, struct ath_buf *buf, - int direction); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ +static struct ath_buf *cleanup_ath_buf(struct ath_softc *sc, + struct ath_buf *buf, int direction); /* Regulatory agency testing - continuous transmit support */ static void txcont_on(struct ieee80211com *ic); @@ -1036,19 +990,11 @@ /* call MI attach routine. */ ieee80211_ifattach(ic); /* override default methods */ -#ifdef IEEE80211_DEBUG_REFCNT - ic->ic_node_alloc_debug = ath_node_alloc_debug; - sc->sc_node_free_debug = ic->ic_node_free_debug; - ic->ic_node_free_debug = ath_node_free_debug; - sc->sc_node_cleanup_debug = ic->ic_node_cleanup_debug; - ic->ic_node_cleanup_debug = ath_node_cleanup_debug; -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ ic->ic_node_alloc = ath_node_alloc; sc->sc_node_free = ic->ic_node_free; ic->ic_node_free = ath_node_free; sc->sc_node_cleanup = ic->ic_node_cleanup; ic->ic_node_cleanup = ath_node_cleanup; -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ ic->ic_node_getrssi = ath_node_getrssi; #ifdef ATH_SUPERG_XR @@ -3210,11 +3156,7 @@ STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list); /* This should be redundant, unless someone illegally * accessed the buffer after returning it. */ -#ifdef IEEE80211_DEBUG_REFCNT - cleanup_ath_buf_debug(sc, bf, BUS_DMA_TODEVICE, func, line); -#else cleanup_ath_buf(sc, bf, BUS_DMA_TODEVICE); -#endif atomic_inc(&sc->sc_txbuf_counter); #ifdef IEEE80211_DEBUG_REFCNT bf->bf_taken_at_func = func; @@ -5747,11 +5689,7 @@ } static struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ath_node_alloc_debug(struct ieee80211vap *vap, const char *func, int line) -#else ath_node_alloc(struct ieee80211vap *vap) -#endif { struct ath_softc *sc = vap->iv_ic->ic_dev->priv; const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space; @@ -5778,11 +5716,7 @@ } static void -#ifdef IEEE80211_DEBUG_REFCNT -ath_node_cleanup_debug(struct ieee80211_node *ni, const char *func, int line) -#else ath_node_cleanup(struct ieee80211_node *ni) -#endif { struct ieee80211com *ic = ni->ni_ic; struct ath_softc *sc = ni->ni_ic->ic_dev->priv; @@ -5803,22 +5737,14 @@ while (an->an_uapsd_qdepth) { bf = STAILQ_FIRST(&an->an_uapsd_q); STAILQ_REMOVE_HEAD(&an->an_uapsd_q, bf_list); -#ifdef IEEE80211_DEBUG_REFCNT - ath_return_txbuf_debug(sc, &bf, func, line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ ath_return_txbuf(sc, &bf); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ an->an_uapsd_qdepth--; } while (an->an_uapsd_overflowqdepth) { bf = STAILQ_FIRST(&an->an_uapsd_overflowq); STAILQ_REMOVE_HEAD(&an->an_uapsd_overflowq, bf_list); -#ifdef IEEE80211_DEBUG_REFCNT - ath_return_txbuf_debug(sc, &bf, func, line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ ath_return_txbuf(sc, &bf); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ an->an_uapsd_overflowqdepth--; } @@ -5827,29 +5753,16 @@ sc->sc_rc->ops->node_cleanup(sc, ATH_NODE(ni)); ATH_NODE_UAPSD_LOCK_IRQ(an); -#ifdef IEEE80211_DEBUG_REFCNT - sc->sc_node_cleanup_debug(ni, func, line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ sc->sc_node_cleanup(ni); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ ATH_NODE_UAPSD_UNLOCK_IRQ(an); } static void -#ifdef IEEE80211_DEBUG_REFCNT -ath_node_free_debug(struct ieee80211_node *ni, const char *func, int line) -#else ath_node_free(struct ieee80211_node *ni) -#endif { - struct ath_softc *sc = ni->ni_ic->ic_dev->priv; + struct ath_softc *sc = (struct ath_softc *)ni->ni_ic; -#ifdef IEEE80211_DEBUG_REFCNT - sc->sc_node_free_debug(ni, func, line); -#else sc->sc_node_free(ni); -#endif - #ifdef ATH_SUPERG_XR ath_grppoll_period_update(sc); #endif @@ -6190,22 +6103,12 @@ #endif static struct sk_buff * -#ifdef IEEE80211_DEBUG_REFCNT -#define ath_alloc_skb(_size, _align) \ - ath_alloc_skb_debug(_size, _align, __func__, __LINE__) -ath_alloc_skb_debug(u_int size, u_int align, const char *func, int line) -#else ath_alloc_skb(u_int size, u_int align) -#endif { struct sk_buff *skb; u_int off; -#ifdef IEEE80211_DEBUG_REFCNT - skb = ieee80211_dev_alloc_skb_debug(size + align - 1, func, line); -#else skb = ieee80211_dev_alloc_skb(size + align - 1); -#endif if (skb != NULL) { off = ((unsigned long) skb->data) % align; if (off != 0) @@ -12320,12 +12223,7 @@ /* Caller must have the TXBUF_LOCK */ static void -#ifdef IEEE80211_DEBUG_REFCNT -ath_return_txbuf_locked_debug(struct ath_softc *sc, struct ath_buf **bf, - const char *func, int line) -#else ath_return_txbuf_locked(struct ath_softc *sc, struct ath_buf **bf) -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ { struct ath_buf *bfaddr; ATH_TXBUF_LOCK_ASSERT(sc); @@ -12333,19 +12231,16 @@ if ((bf == NULL) || ((*bf) == NULL)) return; bfaddr = *bf; -#ifdef IEEE80211_DEBUG_REFCNT - cleanup_ath_buf_debug(sc, (*bf), BUS_DMA_TODEVICE, func, line); -#else cleanup_ath_buf(sc, (*bf), BUS_DMA_TODEVICE); -#endif STAILQ_INSERT_TAIL(&sc->sc_txbuf, (*bf), bf_list); *bf = NULL; atomic_dec(&sc->sc_txbuf_counter); #ifdef IEEE80211_DEBUG_REFCNT DPRINTF(sc, ATH_DEBUG_TXBUF, - "[TXBUF=%03d/%03d] (invoked from %s:%d) returned txbuf %p.\n", - ath_get_buffer_count(sc), ATH_TXBUF, - func, line, bfaddr); + "[TXBUF=%03d/%03d] returned txbuf %p.\n", + ath_get_buffer_count(sc), ATH_TXBUF); + if (DFLAG_ISSET(sc, ATH_DEBUG_TXBUF)) + dump_stack(); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ if (netif_queue_stopped(sc->sc_dev) && (ath_get_buffers_available(sc) > ATH_TXBUF_MGT_RESERVED) && @@ -12367,30 +12262,16 @@ /* Takes the TXBUF_LOCK */ static void -#ifdef IEEE80211_DEBUG_REFCNT -ath_return_txbuf_debug(struct ath_softc *sc, struct ath_buf **bf, - const char *func, int line) -#else ath_return_txbuf(struct ath_softc *sc, struct ath_buf **bf) -#endif { ATH_TXBUF_LOCK_IRQ(sc); -#ifdef IEEE80211_DEBUG_REFCNT - ath_return_txbuf_locked_debug(sc, bf, func, line); -#else ath_return_txbuf_locked(sc, bf); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ ATH_TXBUF_UNLOCK_IRQ(sc); } /* Takes the lock */ static void -#ifdef IEEE80211_DEBUG_REFCNT -ath_return_txbuf_list_debug(struct ath_softc *sc, ath_bufhead *bfhead, - const char *func, int line) -#else ath_return_txbuf_list(struct ath_softc *sc, ath_bufhead *bfhead) -#endif { if (!bfhead) return; @@ -12398,11 +12279,7 @@ if (!STAILQ_EMPTY(bfhead)) { struct ath_buf *tbf, *nextbf; STAILQ_FOREACH_SAFE(tbf, bfhead, bf_list, nextbf) { -#ifdef IEEE80211_DEBUG_REFCNT - ath_return_txbuf_locked_debug(sc, &tbf, func, line); -#else ath_return_txbuf_locked(sc, &tbf); -#endif } } ATH_TXBUF_UNLOCK_IRQ(sc); @@ -12410,12 +12287,7 @@ } /* Caller must have the lock */ static void -#ifdef IEEE80211_DEBUG_REFCNT -ath_return_txbuf_list_locked_debug(struct ath_softc *sc, ath_bufhead *bfhead, - const char *func, int line) -#else ath_return_txbuf_list_locked(struct ath_softc *sc, ath_bufhead *bfhead) -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ { ATH_TXBUF_LOCK_ASSERT(sc); if (!bfhead) @@ -12424,23 +12296,14 @@ if (!STAILQ_EMPTY(bfhead)) { struct ath_buf *tbf, *nextbf; STAILQ_FOREACH_SAFE(tbf, bfhead, bf_list, nextbf) { -#ifdef IEEE80211_DEBUG_REFCNT - ath_return_txbuf_locked_debug(sc, &tbf, func, line); -#else ath_return_txbuf_locked(sc, &tbf); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ } } STAILQ_INIT(bfhead); } static struct ath_buf * -#ifdef IEEE80211_DEBUG_REFCNT -cleanup_ath_buf_debug(struct ath_softc *sc, struct ath_buf *bf, int direction, - const char *func, int line) -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ cleanup_ath_buf(struct ath_softc *sc, struct ath_buf *bf, int direction) -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ { if (bf == NULL) return bf; Modified: madwifi/trunk/ath/if_athvar.h =================================================================== --- madwifi/trunk/ath/if_athvar.h 2008-06-21 14:40:43 UTC (rev 3742) +++ madwifi/trunk/ath/if_athvar.h 2008-06-22 02:12:53 UTC (rev 3743) @@ -648,13 +648,8 @@ int sc_default_ieee80211_debug; /* default debug flags for new VAPs */ int (*sc_recv_mgmt)(struct ieee80211vap *, struct ieee80211_node *, struct sk_buff *, int, int, u_int64_t); -#ifdef IEEE80211_DEBUG_REFCNT - void (*sc_node_cleanup_debug)(struct ieee80211_node *, const char *func, int line); - void (*sc_node_free_debug)(struct ieee80211_node *, const char *func, int line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ void (*sc_node_cleanup)(struct ieee80211_node *); void (*sc_node_free)(struct ieee80211_node *); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ void *sc_bdev; /* associated bus device */ struct ath_hal *sc_ah; /* Atheros HAL */ spinlock_t sc_hal_lock; /* hardware access lock */ Modified: madwifi/trunk/net80211/ieee80211_node.c =================================================================== --- madwifi/trunk/net80211/ieee80211_node.c 2008-06-21 14:40:43 UTC (rev 3742) +++ madwifi/trunk/net80211/ieee80211_node.c 2008-06-22 02:12:53 UTC (rev 3743) @@ -66,53 +66,22 @@ ((_vap)->iv_aid_bitmap[IEEE80211_AID(_b) / 32] & \ (1 << (IEEE80211_AID(_b) % 32))) -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_alloc_node(_vap, _mac) \ - ieee80211_alloc_node_debug(_vap, _mac, __func__, __LINE__) -static struct ieee80211_node *ieee80211_alloc_node_debug(struct ieee80211vap *, - const u_int8_t *, const char *func, int line); -#else static struct ieee80211_node *ieee80211_alloc_node(struct ieee80211vap *, const u_int8_t *); -#endif static int ieee80211_sta_join1(struct ieee80211_node *); -#ifdef IEEE80211_DEBUG_REFCNT -static struct ieee80211_node *node_alloc_debug(struct ieee80211vap *, - const char *func, int line); -static void node_cleanup_debug(struct ieee80211_node *, const char *func, - int line); -static void node_free_debug(struct ieee80211_node *, const char *func, - int line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ static struct ieee80211_node *node_alloc(struct ieee80211vap *); static void node_cleanup(struct ieee80211_node *); static void node_free(struct ieee80211_node *); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ static int32_t node_count(struct ieee80211com *ic); static u_int8_t node_getrssi(const struct ieee80211_node *); -#ifdef IEEE80211_DEBUG_REFCNT -#define node_table_leave_locked(_table, _node) \ - node_table_leave_locked_debug(_table, _node, __func__, __LINE__) -static void node_table_leave_locked_debug(struct ieee80211_node_table *, - struct ieee80211_node *, const char *func, int line); -#else static void node_table_leave_locked(struct ieee80211_node_table *, struct ieee80211_node *); -#endif - -#ifdef IEEE80211_DEBUG_REFCNT -#define node_table_join_locked(_table, _node) \ - node_table_join_locked_debug(_table, _node, __func__, __LINE__) -static void node_table_join_locked_debug(struct ieee80211_node_table *, - struct ieee80211_node *, const char *func, int line); -#else static void node_table_join_locked(struct ieee80211_node_table *, struct ieee80211_node *); -#endif static void ieee80211_node_timeout(unsigned long); @@ -135,15 +104,9 @@ ic->ic_inact.data = (unsigned long) ic; mod_timer(&ic->ic_inact, jiffies + IEEE80211_INACT_WAIT * HZ); -#ifdef IEEE80211_DEBUG_REFCNT - ic->ic_node_alloc_debug = node_alloc_debug; - ic->ic_node_free_debug = node_free_debug; - ic->ic_node_cleanup_debug = node_cleanup_debug; -#else ic->ic_node_alloc = node_alloc; ic->ic_node_free = node_free; ic->ic_node_cleanup = node_cleanup; -#endif ic->ic_node_count = node_count; ic->ic_node_getrssi = node_getrssi; @@ -780,25 +743,15 @@ mod_timer(&nt->nt_wds_aging_timer, jiffies + HZ * WDS_AGING_TIMER_VAL); } -static __inline -void -#ifdef IEEE80211_DEBUG_REFCNT -node_table_join_locked_debug(struct ieee80211_node_table *nt, - struct ieee80211_node *ni, const char *func, int line) -#else -node_table_join_locked(struct ieee80211_node_table *nt, +static __inline void +node_table_join_locked(struct ieee80211_node_table *nt, struct ieee80211_node *ni) -#endif { struct ieee80211_node *tni = NULL; IEEE80211_NODE_TABLE_LOCK_ASSERT(nt); ni->ni_table = nt; -#ifdef IEEE80211_DEBUG_REFCNT - tni = ieee80211_ref_node_debug(ni, func, line); -#else tni = ieee80211_ref_node(ni); -#endif TAILQ_INSERT_TAIL(&nt->nt_node, tni, ni_list); tni = NULL; @@ -806,15 +759,9 @@ ni, ni_hash); } -static __inline -void -#ifdef IEEE80211_DEBUG_REFCNT -node_table_leave_locked_debug(struct ieee80211_node_table *nt, - struct ieee80211_node *ni, const char *func, int line) -#else +static __inline void node_table_leave_locked(struct ieee80211_node_table *nt, struct ieee80211_node *ni) -#endif { struct ieee80211_node *hni; IEEE80211_NODE_TABLE_LOCK_ASSERT(nt); @@ -825,28 +772,20 @@ LIST_REMOVE(ni, ni_hash); } ni->ni_table = NULL; -#ifdef IEEE80211_DEBUG_REFCNT - ieee80211_unref_node_debug(&ni, func, line); -#else ieee80211_unref_node(&ni); -#endif } /* This is overridden by ath_node_alloc in ath/if_ath.c, and so - * should never get called. - */ + * should never get called. */ static struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -node_alloc_debug(struct ieee80211vap *vap, const char *func, int line) -#else node_alloc(struct ieee80211vap *vap) -#endif { struct ieee80211_node *ni; MALLOC(ni, struct ieee80211_node *, sizeof(struct ieee80211_node), M_80211_NODE, M_NOWAIT | M_ZERO); - printk(KERN_ERR "%s: ERROR, this function should never be called!", __func__); + printk(KERN_ERR "%s: ERROR, this function should never be called!", + __func__); dump_stack(); return ni; } @@ -860,11 +799,7 @@ * Context: hwIRQ, softIRQ and process context */ static void -#ifdef IEEE80211_DEBUG_REFCNT -node_cleanup_debug(struct ieee80211_node *ni, const char *func, int line) -#else node_cleanup(struct ieee80211_node *ni) -#endif { struct ieee80211vap *vap = ni->ni_vap; @@ -875,9 +810,10 @@ ni->ni_flags &= ~IEEE80211_NODE_PWR_MGT; #ifdef IEEE80211_DEBUG_REFCNT IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni, - "%s (%s%d): power save mode off, %u STAs in PS mode", - __func__, func, line, + "Power save mode off, %u STAs in PS mode", vap->iv_ps_sta); + if (ieee80211_msg_is_reported(vap, IEEE80211_MSG_POWER)) + dump_stack(); #endif if (ni->ni_flags & IEEE80211_NODE_UAPSD_TRIG) { ni->ni_flags &= ~IEEE80211_NODE_UAPSD_TRIG; @@ -887,9 +823,7 @@ } } - /* - * Drain power save queue and, if needed, clear TIM. - */ + /* Drain power save queue and, if needed, clear TIM. */ if (ieee80211_node_saveq_drain(ni) != 0 && vap->iv_set_tim != NULL) vap->iv_set_tim(ni, 0); @@ -908,13 +842,8 @@ * XXX does this leave us open to inheriting old state? */ - if (ni->ni_rxfrag != NULL) { -#ifdef IEEE80211_DEBUG_REFCNT - ieee80211_dev_kfree_skb_debug(&ni->ni_rxfrag, func, line); -#else + if (ni->ni_rxfrag != NULL) ieee80211_dev_kfree_skb(&ni->ni_rxfrag); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ - } ieee80211_crypto_delkey(vap, &ni->ni_ucastkey, ni); ni->ni_rxkeyoff = 0; } @@ -926,10 +855,6 @@ int show_counter, int refcnt_adjust, const struct ieee80211_node *ni, -#ifdef IEEE80211_DEBUG_REFCNT - const char *func1, int line1, -#endif - const char *func2, int line2, const char *message, ...) { @@ -952,18 +877,10 @@ } va_start(args, message); vsnprintf(expanded_message, sizeof(expanded_message), message, args); -#ifdef IEEE80211_DEBUG_REFCNT - printk(KERN_DEBUG "%s/%s: %s%s:%d -> %s:%d %s [node %p<" MAC_FMT ">%s%s%s%s, refs=%02d]\n", -#else - printk(KERN_DEBUG "%s/%s: %s%s:%d %s [node %p<" MAC_FMT ">%s%s%s%s, refs=%02d]\n", -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ + printk(KERN_DEBUG "%s/%s: %s %s [node %p<" MAC_FMT ">%s%s%s%s, refs=%02d]\n", ni->ni_ic->ic_dev->name, ni->ni_vap->iv_dev->name, node_count, -#ifdef IEEE80211_DEBUG_REFCNT - func1, line1, -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ - func2, line2, expanded_message, ni, MAC_ADDR(ni->ni_macaddr), ni->ni_table != NULL ? " in " : "", @@ -971,19 +888,18 @@ ni->ni_table != NULL ? " table" : "", ni->ni_table != NULL ? "" : " (not in any tables)", adjusted_refcount); + dump_stack(); va_end(args); } -EXPORT_SYMBOL(node_print_message); +#else +# define node_print_message(...) #endif static void -#ifdef IEEE80211_DEBUG_REFCNT -node_free_debug(struct ieee80211_node *ni, const char *func, int line) -#else node_free(struct ieee80211_node *ni) -#endif { - KASSERT(atomic_read(&ni->ni_refcnt) == 0, ("node being free whilst still referenced")); + KASSERT(atomic_read(&ni->ni_refcnt) == 0, + ("node being free whilst still referenced")); if (ni->ni_challenge != NULL) FREE(ni->ni_challenge, M_DEVBUF); @@ -1031,24 +947,14 @@ * count of one, and adds it to the node table. */ struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_alloc_node_table_debug(struct ieee80211vap *vap, - const u_int8_t *macaddr, - const char *func, int line) -#else ieee80211_alloc_node_table(struct ieee80211vap *vap, const u_int8_t *macaddr) -#endif { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node_table *nt = &ic->ic_sta; struct ieee80211_node *ni; -#ifdef IEEE80211_DEBUG_REFCNT - ni = ieee80211_alloc_node_debug(vap, macaddr, func, line); -#else ni = ieee80211_alloc_node(vap, macaddr); -#endif if (ni != NULL) { ni->ni_inact = ni->ni_inact_reload = nt->nt_inact_init; @@ -1056,24 +962,17 @@ IEEE80211_NODE_SAVEQ_INIT(ni, "unknown"); IEEE80211_NODE_TABLE_LOCK_IRQ(nt); -#ifdef IEEE80211_DEBUG_REFCNT - node_table_join_locked_debug(nt, ni, func, line); -#else node_table_join_locked(nt, ni); -#endif IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt); } else { - printk(KERN_ERR "Failed to allocate node for " MAC_FMT ".\n", MAC_ADDR(macaddr)); + printk(KERN_ERR "Failed to allocate node for " MAC_FMT ".\n", + MAC_ADDR(macaddr)); } return ni; } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_alloc_node_table_debug); -#else EXPORT_SYMBOL(ieee80211_alloc_node_table); -#endif /* Allocate a node structure and initialise specialised structures * This function does not add the node to the node table, thus this @@ -1081,21 +980,13 @@ * This is useful when sending one off errors or request denials. */ static struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_alloc_node_debug(struct ieee80211vap *vap, const u_int8_t *macaddr, const char *func, int line) -#else ieee80211_alloc_node(struct ieee80211vap *vap, const u_int8_t *macaddr) -#endif { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni; /* This always allocates zeroed memoery */ -#ifdef IEEE80211_DEBUG_REFCNT - ni = ic->ic_node_alloc_debug(vap, func, line); -#else ni = ic->ic_node_alloc(vap); -#endif if (ni != NULL) { atomic_set(&ni->ni_refcnt, 1); IEEE80211_ADDR_COPY(ni->ni_macaddr, macaddr); @@ -1111,17 +1002,12 @@ ni->ni_vap = vap; ni->ni_ic = ic; atomic_inc(&ni->ni_ic->ic_node_counter); -#ifdef IEEE80211_DEBUG - node_print_message(IEEE80211_MSG_NODE|IEEE80211_MSG_NODE_REF, + + node_print_message(IEEE80211_MSG_NODE | IEEE80211_MSG_NODE_REF, 1 /* show counter */, 0 /* adjust refcount */, ni, -#ifdef IEEE80211_DEBUG_REFCNT - func, line, -#endif - __func__, __LINE__, "alloc" /* message */); -#endif } else { /* XXX msg */ vap->iv_stats.is_rx_nodealloc++; @@ -1130,22 +1016,17 @@ return ni; } -/* Add wds address to the node table */ +/* Add wds address to the node table. */ int -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_add_wds_addr_debug(struct ieee80211_node_table *nt, - struct ieee80211_node *ni, const u_int8_t *macaddr, u_int8_t wds_static, - const char *func, int line) -#else ieee80211_add_wds_addr(struct ieee80211_node_table *nt, struct ieee80211_node *ni, const u_int8_t *macaddr, u_int8_t wds_static) -#endif { int hash; struct ieee80211_wds_addr *wds; - MALLOC(wds, struct ieee80211_wds_addr *, sizeof(struct ieee80211_wds_addr), - M_80211_WDS, M_NOWAIT | M_ZERO); + MALLOC(wds, struct ieee80211_wds_addr *, + sizeof(struct ieee80211_wds_addr), + M_80211_WDS, M_NOWAIT | M_ZERO); if (wds == NULL) { /* XXX msg */ return 1; @@ -1158,29 +1039,17 @@ IEEE80211_ADDR_COPY(wds->wds_macaddr, macaddr); IEEE80211_NODE_TABLE_LOCK_IRQ(nt); -#ifdef IEEE80211_DEBUG_REFCNT - wds->wds_ni = ieee80211_ref_node_debug(ni, func, line); -#else wds->wds_ni = ieee80211_ref_node(ni); -#endif LIST_INSERT_HEAD(&nt->nt_wds_hash[hash], wds, wds_hash); IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt); return 0; } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_add_wds_addr_debug); -#else EXPORT_SYMBOL(ieee80211_add_wds_addr); -#endif /* remove wds address from the wds hash table */ void -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_remove_wds_addr_debug(struct ieee80211_node_table *nt, const u_int8_t *macaddr, - const char *func, int line) -#else -ieee80211_remove_wds_addr(struct ieee80211_node_table *nt, const u_int8_t *macaddr) -#endif +ieee80211_remove_wds_addr(struct ieee80211_node_table *nt, + const u_int8_t *macaddr) { int hash; struct ieee80211_wds_addr *wds, *twds; @@ -1190,31 +1059,19 @@ LIST_FOREACH_SAFE(wds, &nt->nt_wds_hash[hash], wds_hash, twds) { if (IEEE80211_ADDR_EQ(wds->wds_macaddr, macaddr)) { LIST_REMOVE(wds, wds_hash); -#ifdef IEEE80211_DEBUG_REFCNT - ieee80211_unref_node_debug(&wds->wds_ni, func, line); -#else ieee80211_unref_node(&wds->wds_ni); -#endif FREE(wds, M_80211_WDS); break; } } IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt); } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_remove_wds_addr_debug); -#else EXPORT_SYMBOL(ieee80211_remove_wds_addr); -#endif /* Remove node references from wds table */ void -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_del_wds_node_debug(struct ieee80211_node_table *nt, struct ieee80211_node *ni, - const char *func, int line) -#else -ieee80211_del_wds_node(struct ieee80211_node_table *nt, struct ieee80211_node *ni) -#endif +ieee80211_del_wds_node(struct ieee80211_node_table *nt, + struct ieee80211_node *ni) { int hash; struct ieee80211_wds_addr *wds, *twds; @@ -1224,22 +1081,14 @@ LIST_FOREACH_SAFE(wds, &nt->nt_wds_hash[hash], wds_hash, twds) { if (wds->wds_ni == ni) { LIST_REMOVE(wds, wds_hash); -#ifdef IEEE80211_DEBUG_REFCNT - ieee80211_unref_node_debug(&wds->wds_ni, func, line); -#else ieee80211_unref_node(&wds->wds_ni); -#endif FREE(wds, M_80211_WDS); } } } IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt); } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_del_wds_node_debug); -#else EXPORT_SYMBOL(ieee80211_del_wds_node); -#endif static void ieee80211_node_wds_ageout(unsigned long data) @@ -1271,30 +1120,17 @@ * If tmp is 0, it is added to the node table and the reference is used. * If tmp is 1, then the caller gets to use the reference. */ struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_dup_bss_debug(struct ieee80211vap *vap, const u_int8_t *macaddr, - unsigned char tmp, const char *func, int line) -#else ieee80211_dup_bss(struct ieee80211vap *vap, const u_int8_t *macaddr, unsigned char tmp) -#endif { struct ieee80211_node *ni; /* FIXME: Hack */ if (tmp) { -#ifdef IEEE80211_DEBUG_REFCNT - ni = ieee80211_alloc_node_debug(vap, macaddr, func, line); -#else ni = ieee80211_alloc_node(vap, macaddr); -#endif } else { -#ifdef IEEE80211_DEBUG_REFCNT - ni = ieee80211_alloc_node_table_debug(vap, macaddr, func, line); -#else ni = ieee80211_alloc_node_table(vap, macaddr); -#endif IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC, "%s: ni:%p allocated for " MAC_FMT "\n", __func__, ni, MAC_ADDR(macaddr)); @@ -1312,13 +1148,8 @@ } static struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_find_wds_node_locked_debug(struct ieee80211_node_table *nt, - const u_int8_t *macaddr, const char *func, int line) -#else ieee80211_find_wds_node_locked(struct ieee80211_node_table *nt, const u_int8_t *macaddr) -#endif { struct ieee80211_wds_addr *wds; int hash; @@ -1327,32 +1158,19 @@ hash = IEEE80211_NODE_HASH(macaddr); LIST_FOREACH(wds, &nt->nt_wds_hash[hash], wds_hash) { if (IEEE80211_ADDR_EQ(wds->wds_macaddr, macaddr)) { + /* Reset the aging count. */ if (wds->wds_agingcount != WDS_AGING_STATIC) - wds->wds_agingcount = WDS_AGING_COUNT; /* reset the aging count */ -#ifdef IEEE80211_DEBUG_REFCNT - return ieee80211_ref_node_debug(wds->wds_ni, func, line); -#else + wds->wds_agingcount = WDS_AGING_COUNT; return ieee80211_ref_node(wds->wds_ni); -#endif } } return NULL; } /* NB: A node reference is acquired here; the caller MUST release it. */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_find_node_locked(nt, mac) \ - ieee80211_find_node_locked_debug(nt, mac, __func__, __LINE__) -#endif - static struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_find_node_locked_debug(struct ieee80211_node_table *nt, - const u_int8_t *macaddr, const char *func, int line) -#else ieee80211_find_node_locked(struct ieee80211_node_table *nt, const u_int8_t *macaddr) -#endif { struct ieee80211_node *ni; int hash; @@ -1363,11 +1181,7 @@ hash = IEEE80211_NODE_HASH(macaddr); LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) { if (IEEE80211_ADDR_EQ(ni->ni_macaddr, macaddr)) { -#ifdef IEEE80211_DEBUG_REFCNT - ieee80211_ref_node_debug(ni, func, line); -#else ieee80211_ref_node(ni); -#endif return ni; } } @@ -1375,68 +1189,37 @@ /* Now, we look for the desired mac address in the 4 address nodes. */ LIST_FOREACH(wds, &nt->nt_wds_hash[hash], wds_hash) { - if (IEEE80211_ADDR_EQ(wds->wds_macaddr, macaddr)) { -#ifdef IEEE80211_DEBUG_REFCNT - return ieee80211_ref_node_debug(wds->wds_ni, func, line); -#else + if (IEEE80211_ADDR_EQ(wds->wds_macaddr, macaddr)) return ieee80211_ref_node(wds->wds_ni); -#endif - } } return NULL; } struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_find_wds_node_debug(struct ieee80211_node_table *nt, const u_int8_t *macaddr, - const char *func, int line) -#else -ieee80211_find_wds_node(struct ieee80211_node_table *nt, const u_int8_t *macaddr) -#endif +ieee80211_find_wds_node(struct ieee80211_node_table *nt, + const u_int8_t *macaddr) { struct ieee80211_node *ni; IEEE80211_NODE_TABLE_LOCK_IRQ(nt); -#ifdef IEEE80211_DEBUG_REFCNT - ni = ieee80211_find_wds_node_locked_debug(nt, macaddr, func, line); -#else ni = ieee80211_find_wds_node_locked(nt, macaddr); -#endif IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt); return ni; } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_find_wds_node_debug); -#else EXPORT_SYMBOL(ieee80211_find_wds_node); -#endif struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_find_node_debug(struct ieee80211_node_table *nt, - const u_int8_t *macaddr, const char *func, int line) -#else ieee80211_find_node(struct ieee80211_node_table *nt, const u_int8_t *macaddr) -#endif { struct ieee80211_node *ni; IEEE80211_NODE_TABLE_LOCK_IRQ(nt); -#ifdef IEEE80211_DEBUG_REFCNT - ni = ieee80211_find_node_locked_debug(nt, macaddr, func, line); -#else ni = ieee80211_find_node_locked(nt, macaddr); -#endif IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt); return ni; } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_find_node_debug); -#else EXPORT_SYMBOL(ieee80211_find_node); -#endif - /* * Fake up a node; this handles node discovery in adhoc mode. * Note that for the driver's benefit we we treat this like @@ -1446,14 +1229,8 @@ * Caller must ieee80211_ref_node() */ struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_fakeup_adhoc_node_debug(struct ieee80211vap *vap, - const u_int8_t macaddr[IEEE80211_ADDR_LEN], - const char *func, int line) -#else ieee80211_fakeup_adhoc_node(struct ieee80211vap *vap, const u_int8_t macaddr[IEEE80211_ADDR_LEN]) -#endif { struct ieee80211_node *ni; @@ -1535,13 +1312,8 @@ * NB: A node reference is acquired here; the caller MUST release it. */ struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_find_rxnode_debug(struct ieee80211com *ic, - const struct ieee80211_frame_min *wh, const char *func, int line) -#else ieee80211_find_rxnode(struct ieee80211com *ic, const struct ieee80211_frame_min *wh) -#endif { #define IS_CTL(wh) \ ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) @@ -1552,24 +1324,16 @@ struct ieee80211_node_table *nt; struct ieee80211_node *ni; - /* XXX check ic_bss first in station mode */ - /* XXX 4-address frames? */ + /* XXX: check ic_bss first in station mode */ + /* XXX: 4-address frames? */ nt = &ic->ic_sta; IEEE80211_NODE_TABLE_LOCK_IRQ(nt); /* NB: Control frames typically have one address, except * for RTS and PSPOLL */ if (IS_CTL(wh) && !IS_PSPOLL(wh) && !IS_RTS(wh)) -#ifdef IEEE80211_DEBUG_REFCNT - ni = ieee80211_find_node_locked_debug(nt, wh->i_addr1, func, line); -#else ni = ieee80211_find_node_locked(nt, wh->i_addr1); -#endif else -#ifdef IEEE80211_DEBUG_REFCNT - ni = ieee80211_find_node_locked_debug(nt, wh->i_addr2, func, line); -#else ni = ieee80211_find_node_locked(nt, wh->i_addr2); -#endif IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt); return ni; @@ -1577,11 +1341,7 @@ #undef IS_CTL #undef IS_RTS } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_find_rxnode_debug); -#else EXPORT_SYMBOL(ieee80211_find_rxnode); -#endif /* * Return the appropriate node for sending a data frame. This handles node @@ -1590,61 +1350,32 @@ * NB: A node reference is acquired here; the caller MUST release it. */ struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_find_txnode_debug(struct ieee80211vap *vap, const u_int8_t *mac, - const char *func, int line) -#else ieee80211_find_txnode(struct ieee80211vap *vap, const u_int8_t *mac) -#endif { struct ieee80211_node_table *nt; struct ieee80211_node *ni = NULL; - /* - * The destination address should be in the node table + /* The destination address should be in the node table * unless we are operating in station mode or this is a - * multicast/broadcast frame. - */ - if (vap->iv_opmode == IEEE80211_M_STA || IEEE80211_IS_MULTICAST(mac)) { -#ifdef IEEE80211_DEBUG_REFCNT - return ieee80211_ref_node_debug(vap->iv_bss, func, line); -#else + * multicast/broadcast frame. */ + if (vap->iv_opmode == IEEE80211_M_STA || IEEE80211_IS_MULTICAST(mac)) return ieee80211_ref_node(vap->iv_bss); -#endif - } /* XXX: Can't hold lock across dup_bss due to recursive locking. */ nt = &vap->iv_ic->ic_sta; IEEE80211_NODE_TABLE_LOCK_IRQ(nt); -#ifdef IEEE80211_DEBUG_REFCNT - ni = ieee80211_find_node_locked_debug(nt, mac, func, line); -#else ni = ieee80211_find_node_locked(nt, mac); -#endif IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt); if (ni == NULL) { if (vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_AHDEMO) { - /* - * In adhoc mode cons up a node for the destination. + /* In adhoc mode cons up a node for the destination. * Note that we need an additional reference for the - * caller to be consistent with ieee80211_find_node. - */ -#ifdef IEEE80211_DEBUG_REFCNT - ni = ieee80211_fakeup_adhoc_node_debug(vap, mac, - func, line); -#else + * caller to be consistent with ieee80211_find_node. */ ni = ieee80211_fakeup_adhoc_node(vap, mac); -#endif - - if (ni != NULL) { -#ifdef IEEE80211_DEBUG_REFCNT - ieee80211_ref_node_debug(ni, func, line); -#else + if (ni != NULL) ieee80211_ref_node(ni); -#endif - } } else { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_OUTPUT, mac, "no node, discard frame (%s)", __func__); @@ -1653,49 +1384,28 @@ } return ni; } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_find_txnode_debug); -#else EXPORT_SYMBOL(ieee80211_find_txnode); -#endif -/* Context: hwIRQ, softIRQ and process context - */ +/* Context: hwIRQ, softIRQ and process context. */ void -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_free_node_debug(struct ieee80211_node *ni, const char *func, int line) -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ ieee80211_free_node(struct ieee80211_node *ni) -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ { struct ieee80211vap *vap = ni->ni_vap; atomic_dec(&ni->ni_ic->ic_node_counter); -#ifdef IEEE80211_DEBUG - node_print_message(IEEE80211_MSG_NODE|IEEE80211_MSG_NODE_REF, + + node_print_message(IEEE80211_MSG_NODE | IEEE80211_MSG_NODE_REF, 1 /* show counter */, 0 /* adjust refcount */, ni, -#ifdef IEEE80211_DEBUG_REFCNT - func, line, -#endif - __func__, __LINE__, "free" /* message */); -#endif + if (vap->iv_aid_bitmap != NULL) IEEE80211_AID_CLR(vap, ni->ni_associd); -#ifdef IEEE80211_DEBUG_REFCNT - vap->iv_ic->ic_node_free_debug(ni, func, line); -#else vap->iv_ic->ic_node_free(ni); -#endif } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_free_node_debug); -#else EXPORT_SYMBOL(ieee80211_free_node); -#endif static void _reset_node(void *arg, struct ieee80211_node *ni) { @@ -1733,11 +1443,7 @@ if (vap->iv_aid_bitmap != NULL) IEEE80211_AID_CLR(vap, ni->ni_associd); } -#ifdef IEEE80211_DEBUG_REFCNT - ic->ic_node_cleanup_debug(ni, __func__, __LINE__); -#else ic->ic_node_cleanup(ni); -#endif } del_timer(&nt->nt_wds_aging_timer); IEEE80211_SCAN_LOCK_DESTROY(nt); @@ -1884,14 +1590,17 @@ } void -ieee80211_iterate_nodes(struct ieee80211_node_table *nt, ieee80211_iter_func *f, void *arg) +ieee80211_iterate_nodes(struct ieee80211_node_table *nt, + ieee80211_iter_func *f, void *arg) { ieee80211_iterate_dev_nodes(NULL, nt, f, arg); } EXPORT_SYMBOL(ieee80211_iterate_nodes); void -ieee80211_iterate_dev_nodes(struct net_device *dev, struct ieee80211_node_table *nt, ieee80211_iter_func *f, void *arg) +ieee80211_iterate_dev_nodes(struct net_device *dev, + struct ieee80211_node_table *nt, + ieee80211_iter_func *f, void *arg) { struct ieee80211_node *ni; u_int gen; @@ -1906,7 +1615,7 @@ continue; /* skip node not for this vap */ if (ni->ni_scangen != gen) { ni->ni_scangen = gen; - (void) ieee80211_ref_node(ni); + (void)ieee80211_ref_node(ni); IEEE80211_NODE_TABLE_UNLOCK_IRQ_EARLY(nt); (*f)(arg, ni); @@ -2322,11 +2031,7 @@ ieee80211_sta_leave(ni); done: /* Run a cleanup */ -#ifdef IEEE80211_DEBUG_REFCNT - ic->ic_node_cleanup_debug(ni, __func__, __LINE__); -#else ic->ic_node_cleanup(ni); -#endif } EXPORT_SYMBOL(ieee80211_node_leave); @@ -2395,60 +2100,32 @@ EXPORT_SYMBOL(ieee80211_node_reset); struct ieee80211_node * -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_ref_node_debug(struct ieee80211_node *ni, const char *func, int line) -#else ieee80211_ref_node(struct ieee80211_node *ni) -#endif { if (ni == NULL) { printk(KERN_ERR "%s: NULL node.\n", __func__); dump_stack(); - return ni; - } - if (atomic_read(&ni->ni_refcnt) < 1) { -#ifdef IEEE80211_DEBUG + }else if (atomic_read(&ni->ni_refcnt) < 1) { node_print_message(IEEE80211_MSG_ANY, 0 /* show counter */, 0 /* adjust refcount */, ni, -#ifdef IEEE80211_DEBUG_REFCNT - func, line, -#endif - __func__, __LINE__, - "attempt to access node with invalid refcount of %d." - " No changes made." /* message */, + "attempt to access node with invalid " + "refcount of %d. No changes made.", atomic_read(&ni->ni_refcnt)); -#endif - dump_stack(); - return ni; + } else { + atomic_inc(&ni->ni_refcnt); + node_print_message(IEEE80211_MSG_NODE_REF, + 0 /* show counter */, + 0 /* adjust refcount */, + ni, "ref"); } - atomic_inc(&ni->ni_refcnt); -#ifdef IEEE80211_DEBUG - node_print_message(IEEE80211_MSG_NODE_REF, - 0 /* show counter */, - 0 /* adjust refcount */, - ni, -#ifdef IEEE80211_DEBUG_REFCNT - func, line, -#endif - __func__, __LINE__, - "ref" /* message */); -#endif return ni; } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_ref_node_debug); -#else EXPORT_SYMBOL(ieee80211_ref_node); -#endif void -#ifdef IEEE80211_DEBUG_REFCNT -ieee80211_unref_node_debug(struct ieee80211_node **pni, const char *func, int line) -#else ieee80211_unref_node(struct ieee80211_node **pni) -#endif { struct ieee80211_node *ni = NULL; if (pni == NULL) { @@ -2463,48 +2140,27 @@ return; } if (atomic_read(&ni->ni_refcnt) < 1) { -#ifdef IEEE80211_DEBUG node_print_message(IEEE80211_MSG_ANY, 0 /* show counter */, 0 /* adjust refcount */, ni, -#ifdef IEEE80211_DEBUG_REFCNT - func, line, -#endif - __func__, __LINE__, - "attempt to access node with invalid refcount of %d." - " No changes made." /* message */, + "attempt to access node with invalid " + "refcount of %d. No changes made.", atomic_read(&ni->ni_refcnt)); -#endif dump_stack(); return; } -#ifdef IEEE80211_DEBUG node_print_message(IEEE80211_MSG_NODE_REF, 0 /* show counter */, -1 /* adjust refcount */, ni, -#ifdef IEEE80211_DEBUG_REFCNT - func, line, -#endif - __func__, __LINE__, "unref" /* message */); -#endif - if (atomic_dec_and_test(&ni->ni_refcnt)) { -#ifdef IEEE80211_DEBUG_REFCNT - ieee80211_free_node_debug(ni, func, line); -#else /* #ifdef IEEE80211_DEBUG_REFCNT */ + if (atomic_dec_and_test(&ni->ni_refcnt)) ieee80211_free_node(ni); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ - } *pni = NULL; } -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_unref_node_debug); -#else EXPORT_SYMBOL(ieee80211_unref_node); -#endif int32_t ieee80211_get_node_count(struct ieee80211com *ic) Modified: madwifi/trunk/net80211/ieee80211_node.h =================================================================== --- madwifi/trunk/net80211/ieee80211_node.h 2008-06-21 14:40:43 UTC (rev 3742) +++ madwifi/trunk/net80211/ieee80211_node.h 2008-06-22 02:12:53 UTC (rev 3743) @@ -257,88 +257,34 @@ /* Allocates a new ieee80211_node * that has a reference count of one, and * adds it to the node table. */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_alloc_node_table(_vap, _mac) \ - ieee80211_alloc_node_table_debug(_vap, _mac, __func__, __LINE__) -struct ieee80211_node *ieee80211_alloc_node_table_debug(struct ieee80211vap *, - const u_int8_t *, const char *name, int line); -#else struct ieee80211_node *ieee80211_alloc_node_table(struct ieee80211vap *, const u_int8_t *); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ /* Allocates a new ieee80211_node * that has a reference count. * If tmp is 0, it is added to the node table and the reference is used. * If tmp is 1, then the caller gets to use the reference. */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_dup_bss(_vap, _mac, _tmp) \ - ieee80211_dup_bss_debug(_vap, _mac, _tmp, __func__, __LINE__) -struct ieee80211_node *ieee80211_dup_bss_debug(struct ieee80211vap *, - const u_int8_t *, unsigned char tmp, const char *, int); -#else struct ieee80211_node *ieee80211_dup_bss(struct ieee80211vap *, const u_int8_t *, unsigned char tmp); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ void ieee80211_node_reset(struct ieee80211_node *, struct ieee80211vap *); -/* Returns a ieee80211_node * with refcount incremented, if found */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_find_node(_nt, _mac) \ - ieee80211_find_node_debug(_nt, _mac, __func__, __LINE__) -struct ieee80211_node *ieee80211_find_node_debug(struct ieee80211_node_table *, - const u_int8_t *, const char *, int); -#else +/* The following return node reference that the caller must manage. */ struct ieee80211_node *ieee80211_find_node(struct ieee80211_node_table *, const u_int8_t *); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ - -/* Returns a ieee80211_node * with refcount incremented, if found */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_find_rxnode(_nt, _wh) \ - ieee80211_find_rxnode_debug(_nt, _wh, __func__, __LINE__) -struct ieee80211_node *ieee80211_find_rxnode_debug(struct ieee80211com *, - const struct ieee80211_frame_min *, const char *, int); -#else struct ieee80211_node *ieee80211_find_rxnode(struct ieee80211com *, const struct ieee80211_frame_min *); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ - -/* Returns a ieee80211_node * with refcount incremented, if found */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_find_txnode(_nt, _mac) \ - ieee80211_find_txnode_debug(_nt, _mac, __func__, __LINE__) -struct ieee80211_node *ieee80211_find_txnode_debug(struct ieee80211vap *, - const u_int8_t *, const char *, int); -#else struct ieee80211_node *ieee80211_find_txnode(struct ieee80211vap *, const u_int8_t *); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_free_node(_ni) \ - ieee80211_free_node_debug(_ni, __func__, __LINE__) -void ieee80211_free_node_debug(struct ieee80211_node *ni, const char *func, int line); -#else void ieee80211_free_node(struct ieee80211_node *ni); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ /* Reference counting only needs to be locked out against the transitions, * 0->1 and 1->0 (i.e., when we do not own the reference we are getting). * This only happens when finding the a node reference from the node table, * which is locked seperately. Thus, we do not need to lock the follwoing * functions. - * Increment the reference counter for ieee80211_node * - */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_ref_node(_ni) \ - ieee80211_ref_node_debug(_ni, __func__, __LINE__) -struct ieee80211_node * -ieee80211_ref_node_debug(struct ieee80211_node *ni, const char *func, int line); -#else -struct ieee80211_node * -ieee80211_ref_node(struct ieee80211_node *ni); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ + * Increment the reference counter for ieee80211_node *. */ +struct ieee80211_node *ieee80211_ref_node(struct ieee80211_node *ni); #define PASS_NODE(_ni) \ ieee80211_pass_node(&_ni) @@ -350,58 +296,21 @@ return (tmp); } -/* Decrement ieee80211_node * refcount, and relinquish the pointer. */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_unref_node(_pni) \ - ieee80211_unref_node_debug(_pni, __func__, __LINE__) -void -ieee80211_unref_node_debug(struct ieee80211_node **pni, const char *func, int line); -#else -void -ieee80211_unref_node(struct ieee80211_node **pni); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ +void ieee80211_unref_node(struct ieee80211_node **pni); /* Increments reference count of ieee80211_node *ni */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_add_wds_addr(_table, _node, _mac, _static) \ - ieee80211_add_wds_addr_debug(_table, _node, _mac, _static, __func__, __LINE__) -int ieee80211_add_wds_addr_debug(struct ieee80211_node_table *, struct ieee80211_node *, - const u_int8_t *, u_int8_t, const char *func, int line); -#else int ieee80211_add_wds_addr(struct ieee80211_node_table *, struct ieee80211_node *, const u_int8_t *, u_int8_t); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ /* Decrements reference count of ieee80211_node *ni */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_remove_wds_addr(_table, _mac) \ - ieee80211_remove_wds_addr_debug(_table, _mac, __func__, __LINE__) -void ieee80211_remove_wds_addr_debug(struct ieee80211_node_table *, const u_int8_t *, - const char *func, int line); -#else void ieee80211_remove_wds_addr(struct ieee80211_node_table *, const u_int8_t *); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ /* Decrements reference count of node, if found */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_del_wds_node(_table, _node) \ - ieee80211_del_wds_node_debug(_table, _node, __func__, __LINE__) -void ieee80211_del_wds_node_debug(struct ieee80211_node_table *, struct ieee80211_node *, - const char *func, int line); -#else void ieee80211_del_wds_node(struct ieee80211_node_table *, struct ieee80211_node *); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ /* Increments reference count of node, if found */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_find_wds_node(_table, _mac) \ - ieee80211_find_wds_node_debug(_table, _mac, __func__, __LINE__) -struct ieee80211_node *ieee80211_find_wds_node_debug(struct ieee80211_node_table *, - const u_int8_t *, const char *func, int line); -#else struct ieee80211_node *ieee80211_find_wds_node(struct ieee80211_node_table *, const u_int8_t *); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ typedef void ieee80211_iter_func(void *, struct ieee80211_node *); void ieee80211_iterate_nodes(struct ieee80211_node_table *, ieee80211_iter_func *, void *); @@ -411,15 +320,8 @@ struct ieee80211_node *); void ieee80211_dump_nodes(struct ieee80211_node_table *); /* Returns a node with refcount of one. Caller must release that reference */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_fakeup_adhoc_node(_vap, _mac) \ - ieee80211_fakeup_adhoc_node_debug(_vap, _mac, __func__, __LINE__) -struct ieee80211_node *ieee80211_fakeup_adhoc_node_debug(struct ieee80211vap *, - const u_int8_t macaddr[], const char *, int); -#else struct ieee80211_node *ieee80211_fakeup_adhoc_node(struct ieee80211vap *, const u_int8_t macaddr[]); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ struct ieee80211_scanparams; /* Returns a node with refcount of one. Caller must release that reference */ struct ieee80211_node *ieee80211_add_neighbor(struct ieee80211vap *, Modified: madwifi/trunk/net80211/ieee80211_scan.c =================================================================== --- madwifi/trunk/net80211/ieee80211_scan.c 2008-06-21 14:40:43 UTC (rev 3742) +++ madwifi/trunk/net80211/ieee80211_scan.c 2008-06-22 02:12:53 UTC (rev 3743) @@ -435,9 +435,8 @@ * the requested scan has not, then we update the running scan * flag. This is needed when wpa_supplicant is used with * ap_scan=1. Without it, the driver will never associate. */ - - if (((flags & IEEE80211_SCAN_NOPICK) == 0) - && (ss->ss_flags & IEEE80211_SCAN_NOPICK)) { + if (((flags & IEEE80211_SCAN_NOPICK) == 0) && + (ss->ss_flags & IEEE80211_SCAN_NOPICK)) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: clearing SCAN_NOPICK flag\n", __func__); Modified: madwifi/trunk/net80211/ieee80211_skb.c =================================================================== --- madwifi/trunk/net80211/ieee80211_skb.c 2008-06-21 14:40:43 UTC (rev 3742) +++ madwifi/trunk/net80211/ieee80211_skb.c 2008-06-22 02:12:53 UTC (rev 3743) @@ -99,10 +99,7 @@ static void skb_print_message( int show_counter, const struct sk_buff *skb, -#ifdef IEEE80211_DEBUG_REFCNT - const char *func1, int line1, -#endif - const char *func2, int line2, + const char *func, int line, const char *message, ...) { @@ -126,19 +123,15 @@ } va_start(args, message); vsnprintf(expanded_message, sizeof(expanded_message), message, args); -#ifdef IEEE80211_DEBUG_REFCNT - printk(KERN_DEBUG "%s: %s%s:%d -> %s:%d %s\n", -#else printk(KERN_DEBUG "%s: %s%s:%d %s\n", -#endif ((skb != NULL) ? DEV_NAME(skb->dev) : "none"), skb_count, -#ifdef IEEE80211_DEBUG_REFCNT - func1, line1, -#endif - func2, line2, + func, line, expanded_message); va_end(args); +#ifdef IEEE80211_DEBUG_REFCNT + dump_stack(); +#endif } #ifdef IEEE80211_DEBUG_REFCNT @@ -146,13 +139,11 @@ static void print_skb_refchange_message( const struct sk_buff *skb, int users_adjustment, - const char *func1, int line1, - const char *func2, int line2); + const char *func, int line); static void print_skb_trackchange_message( const struct sk_buff *skb, int users_adjustment, - const char *func1, int line1, - const char *func2, int line2, + const char *func, int line, char *message); /* Called automatically when an SKB reaches zero users, @@ -160,20 +151,19 @@ #ifdef IEEE80211_DEBUG_REFCNT_SKBDEST static void skb_destructor(struct sk_buff *skb); #endif -static void get_skb_description(char *dst, int dst_size, const char *label, const struct sk_buff *skb, int users_adjustment); +static void get_skb_description(char *dst, int dst_size, const char *label, + const struct sk_buff *skb, int users_adjustment); static struct sk_buff * clean_clone_or_copy(struct sk_buff *skb); static struct sk_buff * track_skb(struct sk_buff *skb, int users_adjustment, - const char *func1, int line1, - const char *func2, int line2); + const char *func, int line); static struct sk_buff * untrack_skb(struct sk_buff *skb, int users_adjustment, - const char *func1, int line1, - const char *func2, int line2); + const char *func, int line); #define UNREF_USE_KFREE_SKB 0 #define UNREF_USE_DEV_KFREE_SKB_ANY 1 @@ -183,15 +173,13 @@ /* Assumes SKB is not yet freed at the time of the call and shows the new users * count as (users - 1). */ static void unref_skb(struct sk_buff *skb, int type, - const char *func1, int line1, - const char *func2, int line2); + const char *func, int line); /* Assumes SKB reference counter has already been updated and reports count as * atomic_read(&skb->users). */ static struct sk_buff * ref_skb(struct sk_buff *skb, - const char *func1, int line1, - const char *func2, int line2); + const char *func, int line); #ifdef IEEE80211_DEBUG_REFCNT_SKBDEST @@ -248,8 +236,7 @@ static void print_skb_refchange_message( const struct sk_buff *skb, int users_adjustment, - const char *func1, int line1, - const char *func2, int line2) + const char *func, int line) { char skb_desc[128] = { '\0' }; if (0 == (ath_debug_global & GLOBAL_DEBUG_SKB_REF)) @@ -257,14 +244,13 @@ get_skb_description(skb_desc, sizeof(skb_desc), "skb", skb, users_adjustment); skb_print_message(0 /* no global count */, skb, - func1, line1, func2, line2, + func, line, skb_desc); } static void print_skb_trackchange_message( const struct sk_buff *skb, int users_adjustment, - const char *func1, int line1, - const char *func2, int line2, + const char *func, int line, char *message) { char skb_desc[128] = { '\0' }; @@ -273,7 +259,7 @@ get_skb_description(skb_desc, sizeof(skb_desc), "skb", skb, users_adjustment); skb_print_message(1 /* show global count */, skb, - func1, line1, func2, line2, + func, line, "%s%s", skb_desc, message); } @@ -286,25 +272,24 @@ static struct sk_buff * track_skb(struct sk_buff *skb, int users_adjustment, - const char *func1, int line1, - const char *func2, int line2) + const char *func, int line) { if (NULL == skb) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func2, line2, "ERROR: NULL skb received. Skipping."); return NULL; } if (M_FLAG_GET(skb, M_SKB_TRACKED)) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func2, line2, "ERROR: Already tracked skb received. Skipping."); dump_stack(); return skb; } if (skb_shared(skb)) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func2, line2, "ERROR: Shared skb received. References leaked??"); dump_stack(); } @@ -312,7 +297,7 @@ atomic_inc(&skb_refs_counter); M_FLAG_SET(skb, M_SKB_TRACKED); print_skb_trackchange_message(skb, users_adjustment, - func1, line1, func2, line2, + func2, line2, " is now ** TRACKED **"); #ifdef IEEE80211_DEBUG_REFCNT_SKBDEST /* Install our debug destructor, chaining to the original... */ @@ -326,27 +311,24 @@ static struct sk_buff * untrack_skb(struct sk_buff *skb, int users_adjustment, - const char *func1, int line1, - const char *func2, int line2) + const char *func, int line) { if (NULL == skb) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func, line, "ERROR: NULL skb received. No changes made."); return NULL; } if (!M_FLAG_GET(skb, M_SKB_TRACKED)) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func, line, "ERROR: Untracked skb received. No changes made."); - dump_stack(); return skb; } if (skb_shared(skb)) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func, line, "ERROR: Shared skb received. References leaked??"); - dump_stack(); } atomic_dec(&skb_total_counter); atomic_dec(&skb_refs_counter); @@ -359,7 +341,7 @@ } #endif /* #ifdef IEEE80211_DEBUG_REFCNT_SKBDEST */ print_skb_trackchange_message(skb, users_adjustment, - func1, line1, func2, line2, + func, line, " is now ** UNTRACKED **"); return skb; } @@ -373,19 +355,18 @@ * count as (users - 1). */ static void unref_skb(struct sk_buff *skb, int type, - const char *func1, int line1, - const char *func2, int line2) + const char *func, int line) { if (NULL == skb) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func, line, "ERROR: NULL skb received."); dump_stack(); return; } if (!M_FLAG_GET(skb, M_SKB_TRACKED)) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func, line, "ERROR: Untracked skb received. Probable duplicate free error!"); dump_stack(); return; @@ -393,7 +374,7 @@ /* If free is unacceptable for current user count, report the error. */ if (atomic_read(&skb->users) < 1) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func, line, "ERROR: free an skb with %d users", atomic_read(&skb->users)); dump_stack(); @@ -402,7 +383,7 @@ if (skb_shared(skb)) { atomic_dec(&skb_refs_counter); - print_skb_refchange_message(skb, -1, func1, line1, func2, line2); + print_skb_refchange_message(skb, -1, func2, line2); } else { if (SKB_NI(skb) != NULL) { @@ -415,7 +396,7 @@ * report it again in the destructor. */ SKB_NI(skb) = NULL; } - untrack_skb(skb, -1, func1, line1, func2, line2); + untrack_skb(skb, -1, func, line); } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) @@ -423,7 +404,7 @@ (type == UNREF_USE_KFREE_SKB || type == UNREF_USE_DEV_KFREE_SKB)) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func, line, "ERROR: free an skb in interrupt context using a non-" "safe form of skb free function."); type = UNREF_USE_DEV_KFREE_SKB_ANY; @@ -453,25 +434,24 @@ * atomic_read(&skb->users). */ static struct sk_buff * ref_skb(struct sk_buff *skb, - const char *func1, int line1, - const char *func2, int line2) + const char *func, int line) { if (NULL == skb) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func, line, "ERROR: NULL skb received. No changes made."); dump_stack(); return NULL; } if (!M_FLAG_GET(skb, M_SKB_TRACKED)) { skb_print_message(0 /* show_counter */, - skb, func1, line1, func2, line2, + skb, func, line, "ERROR: Untracked skb received. Probable use after free! " "No changes made."); dump_stack(); return skb; } - print_skb_refchange_message(skb, 0, func1, line1, func2, line2); + print_skb_refchange_message(skb, 0, func, line); return skb; } @@ -485,11 +465,7 @@ * If SKB refcount is going to zero: * - Free the node reference and set it to null. * - Break the linked list, clearing next skb's prev pointer if possible. */ -#ifdef IEEE80211_DEBUG_REFCNT -void ieee80211_dev_kfree_skb_debug(struct sk_buff **pskb, const char *func, int line) -#else void ieee80211_dev_kfree_skb(struct sk_buff **pskb) -#endif { struct sk_buff *skb; @@ -505,17 +481,12 @@ skb->next = NULL; } - if (SKB_NI(skb) != NULL) { -#ifdef IEEE80211_DEBUG_REFCNT - ieee80211_unref_node_debug(&SKB_NI(skb), func, line); -#else + if (SKB_NI(skb) != NULL) ieee80211_unref_node(&SKB_NI(skb)); -#endif - } #ifdef IEEE80211_DEBUG_REFCNT unref_skb(skb, UNREF_USE_DEV_KFREE_SKB_ANY, - func, line, __func__, __LINE__); + __func__, __LINE__); #else dev_kfree_skb_any(skb); #endif @@ -525,13 +496,8 @@ /* ieee80211_dev_kfree_skb_list will invoke ieee80211_dev_kfree_skb on each node in * a list of skbs, starting with the first. */ -#ifdef IEEE80211_DEBUG_REFCNT void -ieee80211_dev_kfree_skb_list_debug(struct sk_buff **pskb, const char *func, int line) -#else -void ieee80211_dev_kfree_skb_list(struct sk_buff **pskb) -#endif { struct sk_buff *skb, *tskb; @@ -542,33 +508,21 @@ while (skb) { tskb = skb->next; -#ifdef IEEE80211_DEBUG_REFCNT - ieee80211_dev_kfree_skb_debug(&skb, func, line); -#else ieee80211_dev_kfree_skb(&skb); -#endif skb = tskb; } *pskb = NULL; } -#ifdef IEEE80211_DEBUG_REFCNT struct sk_buff * -ieee80211_dev_alloc_skb_debug(int size, const char *func, int line) -#else -struct sk_buff * ieee80211_dev_alloc_skb(int size) -#endif { struct sk_buff *skb = dev_alloc_skb(size); if (skb == NULL) { skb_print_message( 0 /* show_counter */, NULL /* skb */, -#ifdef IEEE80211_DEBUG_REFCNT - func, line, -#endif __func__, __LINE__, "sk_buff allocation of size %u failed", size); @@ -576,39 +530,28 @@ } #ifdef IEEE80211_DEBUG_REFCNT - return track_skb(skb, 0, func, line, __func__, __LINE__); + return track_skb(skb, 0, __func__, __LINE__); #else return skb; #endif } -#ifdef IEEE80211_DEBUG_REFCNT void -ieee80211_skb_track_debug(struct sk_buff *skb, const char *func, int line) { +ieee80211_skb_track(struct sk_buff *skb) { +#ifdef IEEE80211_DEBUG_REFCNT track_skb(skb, 0 /* users_adjustment */, - func, line, __func__, __LINE__); -} + __func__, __LINE__); #else -void -ieee80211_skb_track(struct sk_buff *skb) { /* Just a dumb counter, in no-debug builds */ atomic_inc(&skb_total_counter); -} #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ +} -#ifdef IEEE80211_DEBUG_REFCNT void -ieee80211_skb_untrack_debug(struct sk_buff *skb, const char *func, int line) { - untrack_skb(skb, 0 /* users_adjustment */, - func, line, __func__, __LINE__); -} -#else -void ieee80211_skb_untrack(struct sk_buff *skb) { /* Just a dumb counter, in no-debug builds */ atomic_dec(&skb_total_counter); } -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ #ifdef IEEE80211_DEBUG_REFCNT int @@ -634,79 +577,83 @@ struct vlan_group *grp, unsigned short vlan_tag, const char *func, int line) { return vlan_hwaccel_rx( - untrack_skb(skb, 0, func, line, __func__, __LINE__), + untrack_skb(skb, 0, __func__, __LINE__), grp, vlan_tag); } int netif_rx_debug(struct sk_buff *skb, const char *func, int line) { - return netif_rx(untrack_skb(skb, 0, func, line, __func__, __LINE__)); + return netif_rx(untrack_skb(skb, 0, __func__, __LINE__)); } -struct sk_buff * alloc_skb_debug(unsigned int length, gfp_t gfp_mask, +struct sk_buff *alloc_skb_debug(unsigned int length, gfp_t gfp_mask, const char *func, int line) { - return track_skb(alloc_skb(length, gfp_mask), 0 /* users_adjustment */, - func, line, __func__, __LINE__); + return track_skb(alloc_skb(length, gfp_mask), + 0 /* users_adjustment */, + __func__, __LINE__); } -struct sk_buff * dev_alloc_skb_debug(unsigned int length, +struct sk_buff *dev_alloc_skb_debug(unsigned int length, const char *func, int line) { - return track_skb(dev_alloc_skb(length), 0 /* users_adjustment */, - func, line, __func__, __LINE__); + return track_skb(dev_alloc_skb(length), + 0 /* users_adjustment */, + __func__, __LINE__); } -struct sk_buff * skb_clone_debug(struct sk_buff *skb, gfp_t pri, +struct sk_buff *skb_clone_debug(struct sk_buff *skb, gfp_t pri, const char *func, int line) { return track_skb( - clean_clone_or_copy(skb_clone(skb, pri)), 0 /* users_adjustment */, - func, line, __func__, __LINE__); + clean_clone_or_copy(skb_clone(skb, pri)), + 0 /* users_adjustment */, + __func__, __LINE__); } -struct sk_buff * skb_copy_debug(struct sk_buff *skb, gfp_t pri, +struct sk_buff *skb_copy_debug(struct sk_buff *skb, gfp_t pri, const char *func, int line) { return track_skb( clean_clone_or_copy(skb_copy(skb, pri)), 0 /* users_adjustment */, - func, line, __func__, __LINE__); + __func__, __LINE__); } -struct sk_buff * skb_get_debug(struct sk_buff *skb, +struct sk_buff *skb_get_debug(struct sk_buff *skb, const char *func, int line) { return ref_skb(skb_get(skb), - func, line, __func__, __LINE__); + __func__, __LINE__); } -struct sk_buff * skb_realloc_headroom_debug(struct sk_buff *skb, unsigned int headroom, +struct sk_buff *skb_realloc_headroom_debug(struct sk_buff *skb, unsigned int headroom, const char *func, int line) { /* skb_realloc_headroom ALWAYS returns a copy or a clone, refcount of * new one is always zero and refcount of original is not touched. */ return track_skb( - clean_clone_or_copy(skb_realloc_headroom(skb, headroom)), + clean_clone_or_copy( + skb_realloc_headroom(skb, headroom)), 0 /* users_adjustment */, - func, line, __func__, __LINE__); + __func__, __LINE__); } -struct sk_buff * pskb_copy_debug(struct sk_buff *skb, gfp_t pri, +struct sk_buff *pskb_copy_debug(struct sk_buff *skb, gfp_t pri, const char *func, int line) { return track_skb( - clean_clone_or_copy(pskb_copy(skb, pri)), - 0 /* users_adjustment */, - func, line, __func__, __LINE__); + clean_clone_or_copy(pskb_copy(skb, pri)), + 0 /* users_adjustment */, + __func__, __LINE__); } int dev_queue_xmit_debug(struct sk_buff *skb, const char *func, int line) { - return dev_queue_xmit(untrack_skb(skb, 0, func, line, __func__, __LINE__)); + return dev_queue_xmit(untrack_skb(skb, 0, __func__, __LINE__)); } -struct sk_buff * skb_share_check_debug(struct sk_buff *skb, gfp_t pri, +struct sk_buff *skb_share_check_debug(struct sk_buff *skb, gfp_t pri, const char *func, int line) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) @@ -716,9 +663,9 @@ struct sk_buff *nskb = track_skb( clean_clone_or_copy(skb_clone(skb, pri)), 0, - func, line, __func__, __LINE__); + __func__, __LINE__); unref_skb(skb, UNREF_USE_DEV_KFREE_SKB_ANY, - func, line, __func__, __LINE__); + __func__, __LINE__); skb = nskb; } return skb; @@ -731,7 +678,7 @@ unref_skb(skb, UNREF_USE_DEV_KFREE_SKB_ANY, func, line, __func__, __LINE__); } -struct sk_buff * skb_unshare_debug(struct sk_buff *skb, gfp_t pri, +struct sk_buff *skb_unshare_debug(struct sk_buff *skb, gfp_t pri, const char *func, int line) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) @@ -740,15 +687,15 @@ if (skb_cloned(skb)) { struct sk_buff *nskb = track_skb( clean_clone_or_copy(skb_copy(skb, pri)), 0, - func, line, __func__, __LINE__); + __func__, __LINE__); unref_skb(skb, UNREF_USE_DEV_KFREE_SKB_ANY, - func, line, __func__, __LINE__); + __func__, __LINE__); skb = nskb; } return skb; } -struct sk_buff * skb_copy_expand_debug(const struct sk_buff *skb, int newheadroom, +struct sk_buff *skb_copy_expand_debug(const struct sk_buff *skb, int newheadroom, int newtailroom, gfp_t gfp_mask, const char *func, int line) { @@ -756,7 +703,7 @@ clean_clone_or_copy( skb_copy_expand(skb, newheadroom, newtailroom, gfp_mask)), 0 /* users_adjustment */, - func, line, __func__, __LINE__); + __func__, __LINE__); } EXPORT_SYMBOL(vlan_hwaccel_rx_debug); @@ -774,22 +721,13 @@ EXPORT_SYMBOL(skb_unshare_debug); EXPORT_SYMBOL(skb_copy_expand_debug); -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ - -#ifdef IEEE80211_DEBUG_REFCNT -EXPORT_SYMBOL(ieee80211_dev_kfree_skb_debug); -EXPORT_SYMBOL(ieee80211_dev_kfree_skb_list_debug); -EXPORT_SYMBOL(ieee80211_dev_alloc_skb_debug); -EXPORT_SYMBOL(ieee80211_skb_track_debug); -EXPORT_SYMBOL(ieee80211_skb_untrack_debug); EXPORT_SYMBOL(ieee80211_skb_counter); EXPORT_SYMBOL(ieee80211_skb_references); -#else -EXPORT_SYMBOL(ieee80211_dev_kfree_skb); -EXPORT_SYMBOL(ieee80211_dev_kfree_skb_list); +#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ + EXPORT_SYMBOL(ieee80211_dev_alloc_skb); -EXPORT_SYMBOL(ieee80211_skb_track); EXPORT_SYMBOL(ieee80211_skb_untrack); -#endif +EXPORT_SYMBOL(ieee80211_dev_kfree_skb_list); +EXPORT_SYMBOL(ieee80211_dev_kfree_skb); +EXPORT_SYMBOL(ieee80211_skb_track); - Modified: madwifi/trunk/net80211/ieee80211_skb.h =================================================================== --- madwifi/trunk/net80211/ieee80211_skb.h 2008-06-21 14:40:43 UTC (rev 3742) +++ madwifi/trunk/net80211/ieee80211_skb.h 2008-06-22 02:12:53 UTC (rev 3743) @@ -81,13 +81,7 @@ * If SKB refcount is going to zero: * - Free the node reference and set it to null. * - Break the linked list, clearing next skb's prev pointer if possible. */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_dev_kfree_skb(_pskb) \ - ieee80211_dev_kfree_skb_debug(_pskb, __func__, __LINE__) -void ieee80211_dev_kfree_skb_debug(struct sk_buff **pskb, const char *func, int line); -#else void ieee80211_dev_kfree_skb(struct sk_buff **pskb); -#endif static inline void ieee80211_skb_copy_noderef(struct sk_buff *src, struct sk_buff *dst) @@ -98,35 +92,12 @@ /* ieee80211_dev_kfree_skb_list will invoke ieee80211_dev_kfree_skb on each node in * a list of skbs, starting with the first. */ -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_dev_kfree_skb_list(_pskb) \ - ieee80211_dev_kfree_skb_list_debug(_pskb, __func__, __LINE__) -void ieee80211_dev_kfree_skb_list_debug(struct sk_buff **pskb, const char *func, int line); -#else void ieee80211_dev_kfree_skb_list(struct sk_buff **pskb); -#endif -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_dev_alloc_skb(_size) \ - ieee80211_dev_alloc_skb_debug(_size, __func__, __LINE__) -struct sk_buff *ieee80211_dev_alloc_skb_debug(int size, const char *func, int line); -#else struct sk_buff *ieee80211_dev_alloc_skb(int size); -#endif -#ifdef IEEE80211_DEBUG_REFCNT -#define ieee80211_skb_track(_skb) \ - ieee80211_skb_track_debug(_skb, __func__, __LINE__) -#define ieee80211_skb_untrack(_skb) \ - ieee80211_skb_untrack_debug(_skb, __func__, __LINE__) -void ieee80211_skb_track_debug(struct sk_buff *skb, - const char *func, int line); -void ieee80211_skb_untrack_debug(struct sk_buff *skb, - const char *func, int line); -#else void ieee80211_skb_track(struct sk_buff *skb); void ieee80211_skb_untrack(struct sk_buff *skb); -#endif #ifdef IEEE80211_DEBUG_REFCNT int ieee80211_skb_counter(void); Modified: madwifi/trunk/net80211/ieee80211_var.h =================================================================== --- madwifi/trunk/net80211/ieee80211_var.h 2008-06-21 14:40:43 UTC (rev 3742) +++ madwifi/trunk/net80211/ieee80211_var.h 2008-06-22 02:12:53 UTC (rev 3743) @@ -464,18 +464,9 @@ /* Node state management */ int32_t (*ic_node_count)(struct ieee80211com *); -#ifdef IEEE80211_DEBUG_REFCNT - struct ieee80211_node *(*ic_node_alloc_debug)(struct ieee80211vap *, - const char *func, int line); - void (*ic_node_cleanup_debug)(struct ieee80211_node *, - const char *func, int line); - void (*ic_node_free_debug)(struct ieee80211_node *, - const char *func, int line); -#else struct ieee80211_node *(*ic_node_alloc)(struct ieee80211vap *); void (*ic_node_cleanup)(struct ieee80211_node *); void (*ic_node_free)(struct ieee80211_node *); -#endif u_int8_t (*ic_node_getrssi)(const struct ieee80211_node *); u_int8_t (*ic_node_move_data)(const struct ieee80211_node *); |
From: Matthew W. S. Bell <svn-commits@ma...> - 2008-06-21 18:43:20
|
Project : madwifi Revision : 3741 Author : mentor (Matthew W. S. Bell) Date : 2008-06-21 16:28:07 +0200 (Sat, 21 Jun 2008) Log Message : Remove mystery mode define, and tidy also Affected Files: * madwifi/trunk/ath/if_ath.c updated Modified: madwifi/trunk/ath/if_ath.c =================================================================== --- madwifi/trunk/ath/if_ath.c 2008-06-21 14:21:28 UTC (rev 3740) +++ madwifi/trunk/ath/if_ath.c 2008-06-21 14:28:07 UTC (rev 3741) @@ -11190,7 +11190,6 @@ static void ath_announce(struct net_device *dev) { -#define HAL_MODE_DUALBAND (HAL_MODE_11A|HAL_MODE_11B) struct ath_softc *sc = dev->priv; struct ath_hal *ah = sc->sc_ah; u_int modes, cc; @@ -11204,26 +11203,23 @@ ath5k_chip_name(AR5K_VERSION_RAD, ah->ah_phyRev), ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf); - /* - * Print radio revision(s). We check the wireless modes - * to avoid falsely printing revs for inoperable parts. - * Dual-band radio revs are returned in the 5 GHz rev number. - */ + /* Print radio revision(s). We check the wireless modes to avoid + * falsely printing revs for inoperable parts. Dual-band radio rev's + * are returned in the 5 GHz rev. number. */ ath_hal_getcountrycode(ah, &cc); modes = ath_hal_getwirelessmodes(ah, cc); - if ((modes & HAL_MODE_DUALBAND) == HAL_MODE_DUALBAND) { - if (ah->ah_analog5GhzRev && ah->ah_analog2GhzRev) { + if ((modes & (HAL_MODE_11A | HAL_MODE_11B)) == + (HAL_MODE_11A | HAL_MODE_11B)) { + if (ah->ah_analog5GhzRev && ah->ah_analog2GhzRev) printk("5 GHz Radio %d.%d 2 GHz Radio %d.%d)\n", ah->ah_analog5GhzRev >> 4, ah->ah_analog5GhzRev & 0xf, ah->ah_analog2GhzRev >> 4, ah->ah_analog2GhzRev & 0xf); - } - else { + else printk("Radio %d.%d)\n", ah->ah_analog5GhzRev >> 4, ah->ah_analog5GhzRev & 0xf); - } } else { printk("Radio %d.%d)\n", ah->ah_analog5GhzRev >> 4, @@ -11232,7 +11228,7 @@ for (i = 0; i <= WME_AC_VO; i++) { struct ath_txq *txq = sc->sc_ac2q[i]; - printk(KERN_INFO "%s: Use hw queue %u for %s traffic\n", + printk(KERN_INFO "%s: Use H/W queue %u for %s traffic\n", DEV_NAME(dev), txq->axq_qnum, ieee80211_wme_acnames[i]); @@ -11251,7 +11247,6 @@ DEV_NAME(dev), sc->sc_cabq->axq_qnum); printk(KERN_INFO "%s: Use hw queue %u for beacons\n", DEV_NAME(dev), sc->sc_bhalq); -#undef HAL_MODE_DUALBAND } /* |
From: Matthew W. S. Bell <svn-commits@ma...> - 2008-06-21 18:43:20
|
Project : madwifi Revision : 3740 Author : mentor (Matthew W. S. Bell) Date : 2008-06-21 16:21:28 +0200 (Sat, 21 Jun 2008) Log Message : pci_register_driver does not error out if no devices are found. The driver just remains loaded anyway. Affected Files: * madwifi/trunk/ath/if_ath_pci.c updated Modified: madwifi/trunk/ath/if_ath_pci.c =================================================================== --- madwifi/trunk/ath/if_ath_pci.c 2008-06-20 16:55:43 UTC (rev 3739) +++ madwifi/trunk/ath/if_ath_pci.c 2008-06-21 14:21:28 UTC (rev 3740) @@ -380,12 +380,12 @@ static int __init init_ath_pci(void) { + int status; printk(KERN_INFO "%s: %s\n", dev_info, version); - if (pci_register_driver(&ath_pci_driver) < 0) { - printk(KERN_ERR "%s: No devices found, driver not installed.\n", dev_info); - return (-ENODEV); - } + status = pci_register_driver(&ath_pci_driver); + if (status) + return (status); ath_sysctl_register(); return (0); } |
From: Matthew W. S. Bell <svn-commits@ma...> - 2008-06-21 16:46:40
|
Project : madwifi Revision : 3742 Author : mentor (Matthew W. S. Bell) Date : 2008-06-21 16:40:43 +0200 (Sat, 21 Jun 2008) Log Message : Make module loading and unloading much less noisy. I don't believe any of this ifnromation is particularly useful for dbeugging, and definitely not for operational use. Affected Files: * madwifi/trunk/ath/if_ath.c updated * madwifi/trunk/ath/if_ath_pci.c updated * madwifi/trunk/ath_hal/ah_os.c updated * madwifi/trunk/ath_rate/amrr/amrr.c updated * madwifi/trunk/ath_rate/minstrel/minstrel.c updated * madwifi/trunk/ath_rate/onoe/onoe.c updated * madwifi/trunk/ath_rate/sample/sample.c updated * madwifi/trunk/net80211/ieee80211.c updated * madwifi/trunk/net80211/ieee80211_linux.c updated Modified: madwifi/trunk/ath/if_ath.c =================================================================== --- madwifi/trunk/ath/if_ath.c 2008-06-21 14:28:07 UTC (rev 3741) +++ madwifi/trunk/ath/if_ath.c 2008-06-21 14:40:43 UTC (rev 3742) @@ -595,8 +595,8 @@ "supported by the HAL.\n"); hal_tpc = 0; } - IPRINTF(sc, "HAL managed transmit power control (TPC) %s.\n", - hal_tpc ? "enabled" : "disabled"); + DPRINTF(sc, ATH_DEBUG_ANY, "HAL managed transmit power control (TPC) " + "%s.\n", hal_tpc ? "enabled" : "disabled"); ath_hal_settpc(ah, hal_tpc); #else sc->sc_hastpc = 0; @@ -623,7 +623,8 @@ } else { ath_hal_setintmit(ah, sc->sc_useintmit); - IPRINTF(sc, "Interference mitigation is supported. Currently %s.\n", + DPRINTF(sc, ATH_DEBUG_ANY, "Interference mitigation is " + "supported. Currently %s.\n", (sc->sc_useintmit ? "enabled" : "disabled")); } @@ -11193,7 +11194,9 @@ struct ath_softc *sc = dev->priv; struct ath_hal *ah = sc->sc_ah; u_int modes, cc; +#if 0 unsigned int i; +#endif printk(KERN_INFO "%s: Atheros AR%s chip found (MAC %d.%d, ", DEV_NAME(dev), @@ -11226,6 +11229,8 @@ ah->ah_analog5GhzRev & 0xf); } +/* Disabled - this information is not operationally useful. */ +#if 0 for (i = 0; i <= WME_AC_VO; i++) { struct ath_txq *txq = sc->sc_ac2q[i]; printk(KERN_INFO "%s: Use H/W queue %u for %s traffic\n", @@ -11247,6 +11252,7 @@ DEV_NAME(dev), sc->sc_cabq->axq_qnum); printk(KERN_INFO "%s: Use hw queue %u for beacons\n", DEV_NAME(dev), sc->sc_bhalq); +#endif } /* Modified: madwifi/trunk/ath/if_ath_pci.c =================================================================== --- madwifi/trunk/ath/if_ath_pci.c 2008-06-21 14:28:07 UTC (rev 3741) +++ madwifi/trunk/ath/if_ath_pci.c 2008-06-21 14:40:43 UTC (rev 3742) @@ -380,10 +380,7 @@ static int __init init_ath_pci(void) { - int status; - printk(KERN_INFO "%s: %s\n", dev_info, version); - - status = pci_register_driver(&ath_pci_driver); + int status = pci_register_driver(&ath_pci_driver); if (status) return (status); ath_sysctl_register(); @@ -396,8 +393,6 @@ { ath_sysctl_unregister(); pci_unregister_driver(&ath_pci_driver); - - printk(KERN_INFO "%s: driver unloaded\n", dev_info); } module_exit(exit_ath_pci); Modified: madwifi/trunk/ath_hal/ah_os.c =================================================================== --- madwifi/trunk/ath_hal/ah_os.c 2008-06-21 14:28:07 UTC (rev 3741) +++ madwifi/trunk/ath_hal/ah_os.c 2008-06-21 14:40:43 UTC (rev 3742) @@ -1082,7 +1082,9 @@ * Module glue. */ #include "version.h" +#if 0 static char *dev_info = "ath_hal"; +#endif MODULE_AUTHOR("Errno Consulting, Sam Leffler"); MODULE_DESCRIPTION("Atheros Hardware Access Layer (HAL)"); @@ -1122,7 +1124,6 @@ kmmio_logmsg = _kmmio_logmsg; #endif - printk("%s: %s (", dev_info, ath_hal_version); sep = ""; for (i = 0; ath_hal_buildopts[i] != NULL; i++) { printk("%s%s", sep, ath_hal_buildopts[i]); @@ -1141,6 +1142,5 @@ kmmio_logmsg = NULL; #endif ath_hal_sysctl_unregister(); - printk("%s: driver unloaded\n", dev_info); } module_exit(exit_ath_hal); Modified: madwifi/trunk/ath_rate/amrr/amrr.c =================================================================== --- madwifi/trunk/ath_rate/amrr/amrr.c 2008-06-21 14:28:07 UTC (rev 3741) +++ madwifi/trunk/ath_rate/amrr/amrr.c 2008-06-21 14:40:43 UTC (rev 3742) @@ -555,8 +555,10 @@ }; #include "release.h" +#if 0 static char *version = "0.1 (" RELEASE_VERSION ")"; static char *dev_info = "ath_rate_amrr"; +#endif MODULE_AUTHOR("INRIA, Mathieu Lacage"); MODULE_DESCRIPTION("AMRR Rate control algorithm"); @@ -570,10 +572,7 @@ static int __init init_ath_rate_amrr(void) { - int ret; - printk(KERN_INFO "%s: %s\n", dev_info, version); - - ret = ieee80211_rate_register(&ath_rate_ops); + int ret = ieee80211_rate_register(&ath_rate_ops); if (ret) return ret; @@ -588,7 +587,5 @@ if (ath_sysctl_header != NULL) unregister_sysctl_table(ath_sysctl_header); ieee80211_rate_unregister(&ath_rate_ops); - - printk(KERN_INFO "%s: unloaded\n", dev_info); } module_exit(exit_ath_rate_amrr); Modified: madwifi/trunk/ath_rate/minstrel/minstrel.c =================================================================== --- madwifi/trunk/ath_rate/minstrel/minstrel.c 2008-06-21 14:28:07 UTC (rev 3741) +++ madwifi/trunk/ath_rate/minstrel/minstrel.c 2008-06-21 14:40:43 UTC (rev 3742) @@ -133,8 +133,9 @@ #define ONE_SECOND (1000 * 1000) /* 1 second, or 1000 milliseconds; eternity, in other words */ #include "release.h" - +#if 0 static char *version = "1.2 (" RELEASE_VERSION ")"; +#endif static char *dev_info = "ath_rate_minstrel"; #define STALE_FAILURE_TIMEOUT_MS 10000 @@ -1091,14 +1092,15 @@ static int __init ath_rate_minstrel_init(void) { - printk(KERN_INFO "%s: Minstrel automatic rate control " - "algorithm %s\n", dev_info, version); +/* Debugging output - disabled as noisy. */ +#if 0 printk(KERN_INFO "%s: look around rate set to %d%%\n", dev_info, ath_lookaround_rate); printk(KERN_INFO "%s: EWMA rolloff level set to %d%%\n", dev_info, ath_ewma_level); - printk(KERN_INFO "%s: max segment size in the mrr set " + printk(KERN_INFO "%s: max segment size in the MRR set " "to %d us\n", dev_info, ath_segment_size); +#endif return ieee80211_rate_register(&ath_rate_ops); } module_init(ath_rate_minstrel_init); @@ -1106,7 +1108,6 @@ static void __exit ath_rate_minstrel_exit(void) { ieee80211_rate_unregister(&ath_rate_ops); - printk(KERN_INFO "%s: unloaded\n", dev_info); } module_exit(ath_rate_minstrel_exit); Modified: madwifi/trunk/ath_rate/onoe/onoe.c =================================================================== --- madwifi/trunk/ath_rate/onoe/onoe.c 2008-06-21 14:28:07 UTC (rev 3741) +++ madwifi/trunk/ath_rate/onoe/onoe.c 2008-06-21 14:40:43 UTC (rev 3742) @@ -502,8 +502,10 @@ }; #include "release.h" +#if 0 static char *version = "1.0 (" RELEASE_VERSION ")"; static char *dev_info = "ath_rate_onoe"; +#endif MODULE_AUTHOR("Errno Consulting, Sam Leffler"); MODULE_DESCRIPTION("Atsushi Onoe's rate control algorithm for Atheros devices"); @@ -517,10 +519,7 @@ static int __init init_ath_rate_onoe(void) { - int ret; - printk(KERN_INFO "%s: %s\n", dev_info, version); - - ret = ieee80211_rate_register(&ath_rate_ops); + int ret = ieee80211_rate_register(&ath_rate_ops); if (ret) return ret; @@ -535,7 +534,5 @@ if (ath_sysctl_header != NULL) unregister_sysctl_table(ath_sysctl_header); ieee80211_rate_unregister(&ath_rate_ops); - - printk(KERN_INFO "%s: unloaded\n", dev_info); } module_exit(exit_ath_rate_onoe); Modified: madwifi/trunk/ath_rate/sample/sample.c =================================================================== --- madwifi/trunk/ath_rate/sample/sample.c 2008-06-21 14:28:07 UTC (rev 3741) +++ madwifi/trunk/ath_rate/sample/sample.c 2008-06-21 14:40:43 UTC (rev 3742) @@ -110,7 +110,9 @@ */ #include "release.h" +#if 0 static char *version = "1.2 (" RELEASE_VERSION ")"; +#endif static char *dev_info = "ath_rate_sample"; @@ -1136,7 +1138,6 @@ static int __init init_ath_rate_sample(void) { - printk(KERN_INFO "%s: %s\n", dev_info, version); return ieee80211_rate_register(&ath_rate_ops); } module_init(init_ath_rate_sample); @@ -1145,6 +1146,5 @@ exit_ath_rate_sample(void) { ieee80211_rate_unregister(&ath_rate_ops); - printk(KERN_INFO "%s: unloaded\n", dev_info); } module_exit(exit_ath_rate_sample); Modified: madwifi/trunk/net80211/ieee80211.c =================================================================== --- madwifi/trunk/net80211/ieee80211.c 2008-06-21 14:28:07 UTC (rev 3741) +++ madwifi/trunk/net80211/ieee80211.c 2008-06-21 14:40:43 UTC (rev 3742) @@ -1152,6 +1152,8 @@ void ieee80211_announce(struct ieee80211com *ic) { +/* Disabled - creates noise but no useful information. */ +#if 0 struct net_device *dev = ic->ic_dev; int i, mode, rate, mword; struct ieee80211_rateset *rs; @@ -1184,6 +1186,7 @@ if (ic->ic_caps & IEEE80211_C_TKIP) printk(" TKIP"); printk("\n"); +#endif } EXPORT_SYMBOL(ieee80211_announce); Modified: madwifi/trunk/net80211/ieee80211_linux.c =================================================================== --- madwifi/trunk/net80211/ieee80211_linux.c 2008-06-21 14:28:07 UTC (rev 3741) +++ madwifi/trunk/net80211/ieee80211_linux.c 2008-06-21 14:40:43 UTC (rev 3742) @@ -982,8 +982,10 @@ * Module glue. */ #include "release.h" +#if 0 static char *version = RELEASE_VERSION; static char *dev_info = "wlan"; +#endif MODULE_AUTHOR("Errno Consulting, Sam Leffler"); MODULE_DESCRIPTION("802.11 wireless LAN protocol support"); @@ -1000,7 +1002,6 @@ init_wlan(void) { register_netdevice_notifier(&ieee80211_event_block); - printk(KERN_INFO "%s: %s\n", dev_info, version); return 0; } module_init(init_wlan); @@ -1009,6 +1010,5 @@ exit_wlan(void) { unregister_netdevice_notifier(&ieee80211_event_block); - printk(KERN_INFO "%s: driver unloaded\n", dev_info); } module_exit(exit_wlan); |
From: Michael Taylor <svn-commits@ma...> - 2008-06-20 07:32:24
|
Project : madwifi Revision : 3738 Author : mtaylor (Michael Taylor) Date : 2008-06-20 09:32:16 +0200 (Fri, 20 Jun 2008) Log Message : Revert portion of commit 3265 which introduced some poor use of strncat (my bad) and needlessly complicated the debug output with prefixes. Thanks, Pavel! :-) Affected Files: * madwifi/trunk/ath/if_ath.c updated Modified: madwifi/trunk/ath/if_ath.c =================================================================== --- madwifi/trunk/ath/if_ath.c 2008-06-19 20:00:03 UTC (rev 3737) +++ madwifi/trunk/ath/if_ath.c 2008-06-20 07:32:16 UTC (rev 3738) @@ -3722,46 +3722,24 @@ "CLR", }; unsigned int i, n; - static const int MLEN = 1024; - static const int BLEN = 64; - char m[MLEN+1], b[BLEN+1]; - m[MLEN] = '\0'; - b[BLEN] = '\0'; - snprintf(b, BLEN, "%s: [%02u] %-7s ", - tag, ix, ciphers[hk->kv_type]); - strncat(m, b, MLEN); - for (i = 0, n = hk->kv_len; i < n; i++) { - snprintf(b, BLEN, "%02x", hk->kv_val[i]); - strncat(m, b, MLEN); - } - - snprintf(b, BLEN, " mac " MAC_FMT, MAC_ADDR(mac)); - strncat(m, b, MLEN); - + printk("%s: [%02u] %-7s ", tag, ix, ciphers[hk->kv_type]); + for (i = 0, n = hk->kv_len; i < n; i++) + printk("%02x", hk->kv_val[i]); + printk(" mac " MAC_FMT, MAC_ADDR(mac)); if (hk->kv_type == HAL_CIPHER_TKIP) { - snprintf(b, BLEN, " %s ", - sc->sc_splitmic ? "mic" : "rxmic"); - strncat(m, b, MLEN); - - for (i = 0; i < sizeof(hk->kv_mic); i++) { - snprintf(b, BLEN, "%02x", hk->kv_mic[i]); - strncat(m, b, MLEN); - } + printk(" %s ", sc->sc_splitmic ? "mic" : "rxmic"); + for (i = 0; i < sizeof(hk->kv_mic); i++) + printk("%02x", hk->kv_mic[i]); #if HAL_ABI_VERSION > 0x06052200 if (!sc->sc_splitmic) { - strncat(m, " txmic ", MLEN); - for (i = 0; i < sizeof(hk->kv_txmic); i++) { - snprintf(b, BLEN, - "%02x", hk->kv_txmic[i]); - strncat(m, b, MLEN); - } + printk(" txmic "); + for (i = 0; i < sizeof(hk->kv_txmic); i++) + printk("%02x", hk->kv_txmic[i]); } #endif } - strncat(m, "\n", MLEN); - - DPRINTF(sc, ATH_DEBUG_ANY, "%s", m); + printk("\n"); } #endif |
From: Benoit Papillault <svn-commits@ma...> - 2008-06-19 20:00:10
|
Project : madwifi Revision : 3737 Author : benoit (Benoit Papillault) Date : 2008-06-19 22:00:03 +0200 (Thu, 19 Jun 2008) Log Message : Added XR phy value. This value is at least used by HAL 0.9.30.13 on AR5212 Affected Files: * madwifi/branches/madwifi-dfs/net80211/_ieee80211.h updated Modified: madwifi/branches/madwifi-dfs/net80211/_ieee80211.h =================================================================== --- madwifi/branches/madwifi-dfs/net80211/_ieee80211.h 2008-06-19 19:58:54 UTC (rev 3736) +++ madwifi/branches/madwifi-dfs/net80211/_ieee80211.h 2008-06-19 20:00:03 UTC (rev 3737) @@ -34,11 +34,16 @@ #ifndef _NET80211__IEEE80211_H_ #define _NET80211__IEEE80211_H_ +/* Warning : ieee80211_phytype is used by the HAL in its ABI, so this + * enumeration cannot be changed */ + enum ieee80211_phytype { IEEE80211_T_DS, /* direct sequence spread spectrum */ IEEE80211_T_FH, /* frequency hopping */ IEEE80211_T_OFDM, /* frequency division multiplexing */ IEEE80211_T_TURBO, /* high rate OFDM, aka turbo mode */ + IEEE80211_T_XR = 5 /* XR rate (OFDM extended range), used + * in HAL_RATE_TABLE */ }; #define IEEE80211_T_CCK IEEE80211_T_DS /* more common nomenclature */ |
From: Benoit Papillault <svn-commits@ma...> - 2008-06-19 19:58:58
|
Project : madwifi Revision : 3736 Author : benoit (Benoit Papillault) Date : 2008-06-19 21:58:54 +0200 (Thu, 19 Jun 2008) Log Message : Merge r3717 from trunk : Diversity and Antenna code cleanup * set HW/HAL diversity settings on HW/HAL reset (it was buggy in IBSS mode) * Do not care about XR support (diversity was enabled by default anyway) when enabling/disabling diversity Affected Files: * madwifi/branches/madwifi-dfs/ath/if_athvar.h updated Modified: madwifi/branches/madwifi-dfs/ath/if_athvar.h =================================================================== --- madwifi/branches/madwifi-dfs/ath/if_athvar.h 2008-06-19 19:58:39 UTC (rev 3735) +++ madwifi/branches/madwifi-dfs/ath/if_athvar.h 2008-06-19 19:58:54 UTC (rev 3736) @@ -697,6 +697,8 @@ u_int8_t sc_protrix; /* protection rate index */ u_int8_t sc_mcastantenna; /* Multicast antenna number */ u_int8_t sc_txantenna; /* data tx antenna (fixed or auto) */ + u_int8_t sc_rxantenna; /* current default antenna */ + u_int8_t sc_numrxotherant; /* RXs on non-default antenna */ u_int16_t sc_nvaps; /* # of active virtual APs */ u_int8_t sc_nstavaps; /* # of active station VAPs */ u_int8_t sc_nmonvaps; /* # of monitor VAPs */ @@ -727,8 +729,6 @@ spinlock_t sc_rxbuflock; struct ATH_TQ_STRUCT sc_rxtq; /* rx intr tasklet */ struct ATH_TQ_STRUCT sc_rxorntq; /* rxorn intr tasklet */ - u_int8_t sc_defant; /* current default antenna */ - u_int8_t sc_rxotherant; /* RXs on non-default antenna */ u_int16_t sc_cachelsz; /* cache line size */ struct ath_descdma sc_txdma; /* TX descriptors */ |
From: Benoit Papillault <svn-commits@ma...> - 2008-06-19 19:58:44
|
Project : madwifi Revision : 3735 Author : benoit (Benoit Papillault) Date : 2008-06-19 21:58:39 +0200 (Thu, 19 Jun 2008) Log Message : Merge r3717 from trunk : Diversity and Antenna code cleanup * set HW/HAL diversity settings on HW/HAL reset (it was buggy in IBSS mode) * Do not care about XR support (diversity was enabled by default anyway) when enabling/disabling diversity Affected Files: * madwifi/branches/madwifi-dfs/ath/if_ath.c updated Modified: madwifi/branches/madwifi-dfs/ath/if_ath.c =================================================================== --- madwifi/branches/madwifi-dfs/ath/if_ath.c 2008-06-19 16:58:07 UTC (rev 3734) +++ madwifi/branches/madwifi-dfs/ath/if_ath.c 2008-06-19 19:58:39 UTC (rev 3735) @@ -941,6 +941,8 @@ ic->ic_updateslot = ath_updateslot; atomic_set(&ic->ic_node_counter, 0); ic->ic_debug = 0; + sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL); + sc->sc_default_ieee80211_debug = ieee80211_debug; ic->ic_wme.wme_update = ath_wme_update; ic->ic_uapsd_flush = ath_uapsd_flush; @@ -1086,27 +1088,21 @@ */ ic->ic_flags |= IEEE80211_F_DATAPAD; - /* - * Query the HAL about antenna support - * Enable rx fast diversity if HAL has support - */ - if (ath_hal_hasdiversity(ah)) { - sc->sc_hasdiversity = 1; - ath_hal_setdiversity(ah, AH_TRUE); - sc->sc_diversity = 1; - } else { - sc->sc_hasdiversity = 0; - sc->sc_diversity = 0; - ath_hal_setdiversity(ah, AH_FALSE); - } - sc->sc_defant = ath_hal_getdefantenna(ah); + /* Query the HAL about antenna support + * Enable RX fast diversity if HAL has support. */ + sc->sc_hasdiversity = sc->sc_diversity = !!ath_hal_hasdiversity(ah); + ath_hal_setdiversity(ah, sc->sc_diversity); + sc->sc_rxantenna = ath_hal_getdefantenna(ah); + sc->sc_txantenna = 0; /* default to auto-selection */ + /* * Not all chips have the VEOL support we want to * use with IBSS beacons; check here for it. */ sc->sc_hasveol = ath_hal_hasveol(ah); + sc->sc_txintrperiod = ATH_TXQ_INTR_PERIOD; /* get mac address from hardware */ ath_hal_getmac(ah, ic->ic_myaddr); @@ -1928,7 +1924,8 @@ ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin); ath_update_txpow(sc); /* update tx power state */ ath_radar_update(sc); - ath_setdefantenna(sc, sc->sc_defant); + ath_hal_setdiversity(sc->sc_ah, sc->sc_diversity); + ath_setdefantenna(sc, sc->sc_rxantenna); ath_rp_flush(sc); return ret; @@ -3332,7 +3329,7 @@ unsigned int pktlen, hdrlen, try0, power; HAL_PKT_TYPE atype; u_int flags; - u_int8_t antenna, txrate; + u_int8_t txrate; struct ath_txq *txq = NULL; struct ath_desc *ds = NULL; struct ieee80211_frame *wh; @@ -3373,7 +3370,6 @@ flags |= HAL_TXDESC_INTREQ; - antenna = sc->sc_txantenna; /* XXX check return value? */ ath_hal_setuptxdesc(ah, ds, @@ -3383,7 +3379,7 @@ power, /* txpower */ txrate, try0, /* series 0 rate/tries */ HAL_TXKEYIX_INVALID, /* key cache index */ - antenna, /* antenna mode */ + sc->sc_txantenna, /* antenna mode */ flags, /* flags */ 0, /* rts/cts rate */ 0, /* rts/cts duration */ @@ -5085,7 +5081,7 @@ struct ieee80211com *ic = bf->bf_node->ni_ic; struct sk_buff *skb = bf->bf_skb; struct ath_hal *ah = sc->sc_ah; - struct ath_desc *ds; + struct ath_desc *ds = bf->bf_desc; unsigned int flags; int antenna = sc->sc_txantenna; const HAL_RATE_TABLE *rt; @@ -5095,22 +5091,16 @@ DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "skb=%p skb->len=%u\n", skb, skb->len); - /* setup descriptors */ - ds = bf->bf_desc; - flags = HAL_TXDESC_NOACK; #ifdef ATH_SUPERG_DYNTURBO if (sc->sc_dturbo_switch) flags |= HAL_TXDESC_INTREQ; #endif - - ds->ds_link = 0; - /* - * Switch antenna every beacon if txantenna is not set + + /* Switch antenna every beacon if txantenna is not set * Should only switch every beacon period, not for all * SWBAs - * XXX: assumes two antennae - */ + * XXX: assumes two antennae */ if (antenna == 0) { if (sc->sc_stagbeacons) antenna = ((sc->sc_stats.ast_be_xmit / @@ -5119,7 +5109,6 @@ antenna = (sc->sc_stats.ast_be_xmit & 1 ? 2 : 1); } - ds->ds_data = bf->bf_skbaddr; /* * Calculate rate code. * XXX everything at min xmit rate @@ -5146,6 +5135,8 @@ rate = rt->info[IEEE80211_XR_DEFAULT_RATE_INDEX].rateCode; } #endif + ds->ds_link = 0; + ds->ds_data = bf->bf_skbaddr; ath_hal_setuptxdesc(ah, ds, skb->len + IEEE80211_CRC_LEN, /* frame length */ sizeof(struct ieee80211_frame), /* header length */ @@ -5459,22 +5450,21 @@ } else if ((sc->sc_updateslot == COMMIT) && (sc->sc_slotupdate == slot)) ath_setslottime(sc); /* commit change to hardware */ - if ((!sc->sc_stagbeacons || slot == 0) && (!sc->sc_diversity)) { + /* If HW fast diversity is not enabled and there is not default RX + * antenna set, check recent per-antenna transmit statistics and flip + * the default RX antenna if noticeably more frames went out on the + * non-default antenna. */ + if ((!sc->sc_stagbeacons || slot == 0) && + !sc->sc_diversity && !sc->sc_rxantenna) { unsigned int otherant; - /* - * Check recent per-antenna transmit statistics and flip - * the default rx antenna if noticeably more frames went out - * on the non-default antenna. Only do this if rx diversity - * is off. - * XXX assumes 2 antennae - */ - otherant = sc->sc_defant & 1 ? 2 : 1; - if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + + /* XXX: assumes 2 antennae. */ + otherant = sc->sc_rxantenna & 1 ? 2 : 1; + if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_rxantenna] + ATH_ANTENNA_DIFF) { DPRINTF(sc, ATH_DEBUG_BEACON, - "Flip default antenna to %u, %u > %u\n", + "Flip default RX antenna to %u, %u > %u\n", otherant, sc->sc_ant_tx[otherant], - sc->sc_ant_tx[sc->sc_defant]); + sc->sc_ant_tx[sc->sc_rxantenna]); ath_setdefantenna(sc, otherant); } sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0; @@ -6888,12 +6878,12 @@ { struct ath_hal *ah = sc->sc_ah; - /* XXX block beacon interrupts */ + /* XXX: block beacon interrupts */ ath_hal_setdefantenna(ah, antenna); - if (sc->sc_defant != antenna) + if (sc->sc_rxantenna != antenna) sc->sc_stats.ast_ant_defswitch++; - sc->sc_defant = antenna; - sc->sc_rxotherant = 0; + sc->sc_rxantenna = antenna; + sc->sc_numrxotherant = 0; } static void @@ -7152,17 +7142,16 @@ type = ieee80211_input_all(ic, skb, rs->rs_rssi, bf->bf_tsf); } + /* XXX: Why do this? */ if (sc->sc_diversity) { - /* - * When using hardware fast diversity, change the default rx - * antenna if rx diversity chooses the other antenna 3 - * times in a row. - */ - if (sc->sc_defant != rs->rs_antenna) { - if (++sc->sc_rxotherant >= 3) + /* When using hardware fast diversity, change the + * default RX antenna if RX diversity chooses the + * other antenna 3 times in a row. */ + if (sc->sc_rxantenna != rs->rs_antenna) { + if (++sc->sc_numrxotherant >= 3) ath_setdefantenna(sc, rs->rs_antenna); } else - sc->sc_rxotherant = 0; + sc->sc_numrxotherant = 0; } if (sc->sc_softled) { /* @@ -8425,12 +8414,10 @@ } #endif - /* - * sc_txantenna == 0 means transmit diversity mode. + /* sc_txantenna == 0 means transmit diversity mode. * sc_txantenna == 1 or sc_txantenna == 2 means the user has selected * the first or second antenna port. - * If the user has set the txantenna, use it for multicast frames too. - */ + * If the user has set the txantenna, use it for multicast frames too. */ if (ismcast && !sc->sc_txantenna) { antenna = sc->sc_mcastantenna + 1; sc->sc_mcastantenna = (sc->sc_mcastantenna + 1) & 0x1; @@ -8452,9 +8439,7 @@ try0, keyix, antenna, flags, ctsrate, ctsduration, icvlen, ivlen, comp); - /* - * Formulate first tx descriptor with tx controls. - */ + /* Formulate first tx descriptor with tx controls. */ /* XXX check return value? */ ath_hal_setuptxdesc(ah, ds, pktlen, /* packet length */ @@ -11146,7 +11131,7 @@ * 1 = antenna port 1 * 2 = antenna port 2 */ - if (val > 2) + if (val < 0 || val > 2) ret = -EINVAL; else ath_setdefantenna(sc, val); @@ -11156,19 +11141,16 @@ * 0 = disallow use of diversity * 1 = allow use of diversity */ - if (val > 1) { + if (val != 0 && val != 1) { ret = -EINVAL; break; } - /* Don't enable diversity if XR is enabled */ - if (((!sc->sc_hasdiversity) || - (sc->sc_xrtxq != NULL)) && - val) { + if (sc->sc_hasdiversity && + ath_hal_setdiversity(ah, val)) { + sc->sc_diversity = val; + } else { ret = -EINVAL; - break; } - sc->sc_diversity = val; - ath_hal_setdiversity(ah, val); break; case ATH_TXINTRPERIOD: /* XXX: validate? */ @@ -11304,7 +11286,7 @@ val = ath_hal_getdefantenna(ah); break; case ATH_DIVERSITY: - val = sc->sc_diversity; + val = ath_hal_getdiversity(ah); break; case ATH_TXINTRPERIOD: val = sc->sc_txintrperiod; @@ -11571,13 +11553,6 @@ kfree(sc->sc_sysctls); sc->sc_sysctls = NULL; } - - /* initialize values */ - ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL); - sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL); - sc->sc_default_ieee80211_debug = ieee80211_debug; - sc->sc_txantenna = 0; /* default to auto-selection */ - sc->sc_txintrperiod = ATH_TXQ_INTR_PERIOD; } static void @@ -11851,7 +11826,8 @@ vap->iv_ath_cap &= ~IEEE80211_ATHC_COMP; vap->iv_des_ssid[0].len = 0; vap->iv_des_nssid = 1; - sc->sc_txantenna = sc->sc_defant = sc->sc_mcastantenna = sc->sc_rxotherant = 1; + sc->sc_txantenna = sc->sc_rxantenna = sc->sc_mcastantenna = 1; + sc->sc_numrxotherant = 0; sc->sc_diversity = 0; memset(vap->iv_des_ssid[0].ssid, 0, IEEE80211_ADDR_LEN); ath_hal_setdiversity(sc->sc_ah, 0); |
From: Pavel Roskin <svn-commits@ma...> - 2008-06-19 16:58:13
|
Project : madwifi Revision : 3734 Author : proski (Pavel Roskin) Date : 2008-06-19 18:58:07 +0200 (Thu, 19 Jun 2008) Log Message : KASSERT should add newline at the end to match FreeBSD behavior Fix KASSERT calls that add their own newline. Affected Files: * madwifi/trunk/ath/if_ath.c updated * madwifi/trunk/ath_rate/minstrel/minstrel.c updated * madwifi/trunk/ath_rate/sample/sample.c updated * madwifi/trunk/include/compat.h updated * madwifi/trunk/net80211/ieee80211_crypto_ccmp.c updated * madwifi/trunk/net80211/ieee80211_crypto_tkip.c updated * madwifi/trunk/net80211/ieee80211_node.c updated * madwifi/trunk/net80211/ieee80211_proto.c updated Modified: madwifi/trunk/ath/if_ath.c =================================================================== --- madwifi/trunk/ath/if_ath.c 2008-06-19 02:34:23 UTC (rev 3733) +++ madwifi/trunk/ath/if_ath.c 2008-06-19 16:58:07 UTC (rev 3734) @@ -8255,7 +8255,7 @@ (struct ieee80211_qosframe *)bf->bf_skb->data; an = ATH_NODE(ni); KASSERT(ni != NULL, ("Processing U-APSD txq for " - "ath_buf with no node!\n")); + "ath_buf with no node!")); if (qwh->i_qos[0] & IEEE80211_QOS_EOSP) { DPRINTF(sc, ATH_DEBUG_UAPSD, "EOSP detected for node (" MAC_FMT ") on desc %p\n", @@ -12537,7 +12537,7 @@ descdma_get_buffer(struct ath_descdma *dd, int index) { KASSERT((index >= 0 && index < dd->dd_nbuf), - ("Invalid index, %d, requested for %s dma buffers.\n", index, dd->dd_name)); + ("Invalid index, %d, requested for %s dma buffers", index, dd->dd_name)); return dd->dd_bufptr + index; } Modified: madwifi/trunk/ath_rate/minstrel/minstrel.c =================================================================== --- madwifi/trunk/ath_rate/minstrel/minstrel.c 2008-06-19 02:34:23 UTC (rev 3733) +++ madwifi/trunk/ath_rate/minstrel/minstrel.c 2008-06-19 16:58:07 UTC (rev 3734) @@ -386,7 +386,7 @@ *try0 = sn->retry_adjusted_count[ndx]; KASSERT((ndx < sn->num_rates), - ("%s: bad ndx (%d/%d) for " MAC_FMT "?\n", + ("%s: bad ndx (%d/%d) for " MAC_FMT "?", dev_info, ndx, sn->num_rates, MAC_ADDR(an->an_node.ni_macaddr))); @@ -420,17 +420,17 @@ rc3 = 0; KASSERT((rc1 >= 0) && (rc1 < sn->num_rates), - ("%s: bad rc1 (%d/%d) for " MAC_FMT "?\n", + ("%s: bad rc1 (%d/%d) for " MAC_FMT "?", dev_info, rc1, sn->num_rates, MAC_ADDR(an->an_node.ni_macaddr))); KASSERT((rc2 >= 0) && (rc2 < sn->num_rates), - ("%s: bad rc2 (%d/%d) for " MAC_FMT "?\n", + ("%s: bad rc2 (%d/%d) for " MAC_FMT "?", dev_info, rc2, sn->num_rates, MAC_ADDR(an->an_node.ni_macaddr))); KASSERT((rc3 >= 0) && (rc3 < sn->num_rates), - ("%s: bad rc3 (%d/%d) for " MAC_FMT "?\n", + ("%s: bad rc3 (%d/%d) for " MAC_FMT "?", dev_info, rc3, sn->num_rates, MAC_ADDR(an->an_node.ni_macaddr))); Modified: madwifi/trunk/ath_rate/sample/sample.c =================================================================== --- madwifi/trunk/ath_rate/sample/sample.c 2008-06-19 02:34:23 UTC (rev 3733) +++ madwifi/trunk/ath_rate/sample/sample.c 2008-06-19 16:58:07 UTC (rev 3734) @@ -490,7 +490,7 @@ } KASSERT(ndx >= 0 && ndx < sn->num_rates, - ("%s: bad ndx (%u/%u) for " MAC_FMT "?\n", + ("%s: bad ndx (%u/%u) for " MAC_FMT "?", dev_info, ndx, sn->num_rates, MAC_ADDR(an->an_node.ni_macaddr))); Modified: madwifi/trunk/include/compat.h =================================================================== --- madwifi/trunk/include/compat.h 2008-06-19 02:34:23 UTC (rev 3733) +++ madwifi/trunk/include/compat.h 2008-06-19 16:58:07 UTC (rev 3734) @@ -115,6 +115,7 @@ #define KASSERT(exp, msg) do { \ if (unlikely(!(exp))) { \ printk msg; \ + printk("\n"); \ BUG(); \ } \ } while (0) Modified: madwifi/trunk/net80211/ieee80211_crypto_ccmp.c =================================================================== --- madwifi/trunk/net80211/ieee80211_crypto_ccmp.c 2008-06-19 02:34:23 UTC (rev 3733) +++ madwifi/trunk/net80211/ieee80211_crypto_ccmp.c 2008-06-19 16:58:07 UTC (rev 3734) @@ -541,7 +541,7 @@ space_next = len > space ? len - space : 0; KASSERT(skb->len >= space_next, ("not enough data in following buffer, " - "skb len %u need %u\n", skb->len, space_next)); + "skb len %u need %u", skb->len, space_next)); xor_block(b + space, pos_next, space_next); CCMP_ENCRYPT(i, b, b0, pos, e, space); @@ -644,7 +644,7 @@ space_next = len > space ? len - space : 0; KASSERT(skb->len >= space_next, ("not enough data in following buffer, " - "skb len %u need %u\n", skb->len, space_next)); + "skb len %u need %u", skb->len, space_next)); xor_block(b+space, pos_next, space_next); CCMP_DECRYPT(i, b, b0, pos, a, space); Modified: madwifi/trunk/net80211/ieee80211_crypto_tkip.c =================================================================== --- madwifi/trunk/net80211/ieee80211_crypto_tkip.c 2008-06-19 02:34:23 UTC (rev 3733) +++ madwifi/trunk/net80211/ieee80211_crypto_tkip.c 2008-06-19 16:58:07 UTC (rev 3734) @@ -881,7 +881,7 @@ break; skb = skb->next; if (skb == NULL) { - KASSERT(0, ("out of data, data_len %lu\n", + KASSERT(0, ("out of data, data_len %lu", (unsigned long)data_len)); break; } @@ -893,7 +893,7 @@ data_next = skb->data; KASSERT(skb->len >= sizeof(uint32_t) - space, ("not enough data in following buffer, " - "skb len %u need %u\n", skb->len, + "skb len %u need %u", skb->len, (int)sizeof(uint32_t) - space)); switch (space) { case 1: Modified: madwifi/trunk/net80211/ieee80211_node.c =================================================================== --- madwifi/trunk/net80211/ieee80211_node.c 2008-06-19 02:34:23 UTC (rev 3733) +++ madwifi/trunk/net80211/ieee80211_node.c 2008-06-19 16:58:07 UTC (rev 3734) @@ -2113,7 +2113,7 @@ if (IEEE80211_IS_CHAN_ANYG(ic->ic_bsschan)) ieee80211_node_join_11g(ni); - KASSERT(ni->ni_suppchans == NULL, ("not a reassociation, but suppchans bitmap not NULL\n")); + KASSERT(ni->ni_suppchans == NULL, ("not a reassociation, but suppchans bitmap not NULL")); /* Use node's new suppchans as the current */ ni->ni_suppchans = ni->ni_suppchans_new; ni->ni_suppchans_new = NULL; Modified: madwifi/trunk/net80211/ieee80211_proto.c =================================================================== --- madwifi/trunk/net80211/ieee80211_proto.c 2008-06-19 02:34:23 UTC (rev 3733) +++ madwifi/trunk/net80211/ieee80211_proto.c 2008-06-19 16:58:07 UTC (rev 3734) @@ -1573,7 +1573,7 @@ case IEEE80211_S_SCAN: /* adhoc/hostap mode */ case IEEE80211_S_ASSOC: /* infra mode */ KASSERT(ni->ni_txrate < ni->ni_rates.rs_nrates, - ("%s: bogus xmit rate %u setup\n", __func__, + ("%s: bogus xmit rate %u setup", __func__, ni->ni_txrate)); #ifdef IEEE80211_DEBUG if (ieee80211_msg_debug(vap)) { @@ -1681,14 +1681,14 @@ tmpvap->iv_state == IEEE80211_S_AUTH || tmpvap->iv_state == IEEE80211_S_ASSOC) { KASSERT((nscanning <= 1), ("Two VAPs cannot scan at " - "the same time\n")); + "the same time")); nscanning++; } } KASSERT(!(nscanning && nrunning), ("SCAN and RUN can't happen at the " - "same time\n")); + "same time")); KASSERT((nscanning <= 1), ("Two VAPs must not SCAN at the " - "same time\n")); + "same time")); if (nrunning > 0) return IEEE80211_S_RUN; @@ -1725,7 +1725,7 @@ } if (tmpvap->iv_state == IEEE80211_S_RUN) { KASSERT((nscanning == 0), ("SCAN and RUN can't happen " - "at the same time\n")); + "at the same time")); nrunning++; } if (tmpvap->iv_state == IEEE80211_S_SCAN || @@ -1733,9 +1733,9 @@ tmpvap->iv_state == IEEE80211_S_AUTH || tmpvap->iv_state == IEEE80211_S_ASSOC) { KASSERT((nscanning == 0), ("Two VAPs cannot scan at " - "the same time\n")); + "the same time")); KASSERT((nrunning == 0), ("SCAN and RUN can't happen " - "at the same time\n")); + "at the same time")); nscanning++; } } |
From: Matthew W. S. Bell <svn-commits@ma...> - 2008-06-19 02:34:27
|
Project : madwifi Revision : 3733 Author : mentor (Matthew W. S. Bell) Date : 2008-06-19 04:34:23 +0200 (Thu, 19 Jun 2008) Log Message : Update roaming iwpriv names to reflect actual format of rate data (i.e., increments of 0.5). Also, update comments and token names to reflect reality/actual usage. Remove some entirely purposeless padding bytes. Affected Files: * madwifi/trunk/net80211/_ieee80211.h updated * madwifi/trunk/net80211/ieee80211_scan.c updated * madwifi/trunk/net80211/ieee80211_scan_sta.c updated * madwifi/trunk/net80211/ieee80211_wireless.c updated Modified: madwifi/trunk/net80211/_ieee80211.h =================================================================== --- madwifi/trunk/net80211/_ieee80211.h 2008-06-19 00:33:04 UTC (rev 3732) +++ madwifi/trunk/net80211/_ieee80211.h 2008-06-19 02:34:23 UTC (rev 3733) @@ -307,12 +307,10 @@ struct ieee80211_roam { int8_t rssi11a; /* rssi thresh for 11a bss */ - int8_t rssi11b; /* for 11g sta in 11b bss */ + int8_t rssi11g; /* for 11g */ int8_t rssi11bOnly; /* for 11b sta */ - u_int8_t pad1; u_int8_t rate11a; /* rate thresh for 11a bss */ - u_int8_t rate11b; /* for 11g sta in 11b bss */ + u_int8_t rate11g; /* for 11g */ u_int8_t rate11bOnly; /* for 11b sta */ - u_int8_t pad2; }; #endif /* _NET80211__IEEE80211_H_ */ Modified: madwifi/trunk/net80211/ieee80211_scan.c =================================================================== --- madwifi/trunk/net80211/ieee80211_scan.c 2008-06-19 00:33:04 UTC (rev 3732) +++ madwifi/trunk/net80211/ieee80211_scan.c 2008-06-19 02:34:23 UTC (rev 3733) @@ -88,10 +88,10 @@ */ #define SCAN_VALID_DEFAULT 60 /* scan cache valid age (secs) */ #define ROAM_RSSI_11A_DEFAULT 9 /* rssi threshold for 11a bss */ -#define ROAM_RSSI_11B_DEFAULT 9 /* rssi threshold for 11b bss */ +#define ROAM_RSSI_11G_DEFAULT 9 /* rssi threshold for 11g bss */ #define ROAM_RSSI_11BONLY_DEFAULT 9 /* rssi threshold for 11b-only bss */ #define ROAM_RATE_11A_DEFAULT 2 * 24 /* tx rate threshold for 11a bss */ -#define ROAM_RATE_11B_DEFAULT 2 * 9 /* tx rate threshold for 11b bss */ +#define ROAM_RATE_11G_DEFAULT 2 * 9 /* tx rate threshold for 11g bss */ #define ROAM_RATE_11BONLY_DEFAULT 2 * 5 /* tx rate threshold for 11b-only bss */ static void scan_restart_pwrsav(unsigned long); @@ -142,10 +142,10 @@ vap->iv_bgscanintvl = IEEE80211_BGSCAN_INTVAL_DEFAULT * HZ; vap->iv_scanvalid = SCAN_VALID_DEFAULT * HZ; vap->iv_roam.rssi11a = ROAM_RSSI_11A_DEFAULT; - vap->iv_roam.rssi11b = ROAM_RSSI_11B_DEFAULT; + vap->iv_roam.rssi11g = ROAM_RSSI_11G_DEFAULT; vap->iv_roam.rssi11bOnly = ROAM_RSSI_11BONLY_DEFAULT; vap->iv_roam.rate11a = ROAM_RATE_11A_DEFAULT; - vap->iv_roam.rate11b = ROAM_RATE_11B_DEFAULT; + vap->iv_roam.rate11g = ROAM_RATE_11G_DEFAULT; vap->iv_roam.rate11bOnly = ROAM_RATE_11BONLY_DEFAULT; } Modified: madwifi/trunk/net80211/ieee80211_scan_sta.c =================================================================== --- madwifi/trunk/net80211/ieee80211_scan_sta.c 2008-06-19 00:33:04 UTC (rev 3732) +++ madwifi/trunk/net80211/ieee80211_scan_sta.c 2008-06-19 02:34:23 UTC (rev 3733) @@ -984,10 +984,9 @@ return; } - /* XXX do we need 11g too? */ if (IEEE80211_IS_CHAN_ANYG(ic->ic_bsschan)) { - roamRate = vap->iv_roam.rate11b; - roamRssi = vap->iv_roam.rssi11b; + roamRate = vap->iv_roam.rate11g; + roamRssi = vap->iv_roam.rssi11g; } else if (IEEE80211_IS_CHAN_B(ic->ic_bsschan)) { roamRate = vap->iv_roam.rate11bOnly; roamRssi = vap->iv_roam.rssi11bOnly; Modified: madwifi/trunk/net80211/ieee80211_wireless.c =================================================================== --- madwifi/trunk/net80211/ieee80211_wireless.c 2008-06-19 00:33:04 UTC (rev 3732) +++ madwifi/trunk/net80211/ieee80211_wireless.c 2008-06-19 02:34:23 UTC (rev 3733) @@ -2799,7 +2799,7 @@ vap->iv_roam.rssi11bOnly = value; break; case IEEE80211_PARAM_ROAM_RSSI_11G: - vap->iv_roam.rssi11b = value; + vap->iv_roam.rssi11g = value; break; case IEEE80211_PARAM_ROAM_RATE_11A: vap->iv_roam.rate11a = value; @@ -2808,7 +2808,7 @@ vap->iv_roam.rate11bOnly = value; break; case IEEE80211_PARAM_ROAM_RATE_11G: - vap->iv_roam.rate11b = value; + vap->iv_roam.rate11g = value; break; case IEEE80211_PARAM_UAPSDINFO: if (vap->iv_opmode == IEEE80211_M_HOSTAP) { @@ -3166,7 +3166,7 @@ param[0] = vap->iv_roam.rssi11bOnly; break; case IEEE80211_PARAM_ROAM_RSSI_11G: - param[0] = vap->iv_roam.rssi11b; + param[0] = vap->iv_roam.rssi11g; break; case IEEE80211_PARAM_ROAM_RATE_11A: param[0] = vap->iv_roam.rate11a; @@ -3175,7 +3175,7 @@ param[0] = vap->iv_roam.rate11bOnly; break; case IEEE80211_PARAM_ROAM_RATE_11G: - param[0] = vap->iv_roam.rate11b; + param[0] = vap->iv_roam.rate11g; break; case IEEE80211_PARAM_UAPSDINFO: if (vap->iv_opmode == IEEE80211_M_HOSTAP) { @@ -5595,17 +5595,17 @@ { IEEE80211_PARAM_ROAM_RSSI_11G, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_rssi11g" }, { IEEE80211_PARAM_ROAM_RATE_11A, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "rate11a" }, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "rate11a_x2" }, { IEEE80211_PARAM_ROAM_RATE_11A, - 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_rate11a" }, + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_rate11a_x2" }, { IEEE80211_PARAM_ROAM_RATE_11B, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "rate11b" }, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "rate11b_x2" }, { IEEE80211_PARAM_ROAM_RATE_11B, - 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_rate11b" }, + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_rate11b_x2" }, { IEEE80211_PARAM_ROAM_RATE_11G, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "rate11g" }, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "rate11g_x2" }, { IEEE80211_PARAM_ROAM_RATE_11G, - 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_rate11g" }, + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_rate11g_x2" }, { IEEE80211_PARAM_UAPSDINFO, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "uapsd" }, { IEEE80211_PARAM_UAPSDINFO, |
From: Matthew W. S. Bell <svn-commits@ma...> - 2008-06-19 00:33:08
|
Project : madwifi Revision : 3732 Author : mentor (Matthew W. S. Bell) Date : 2008-06-19 02:33:04 +0200 (Thu, 19 Jun 2008) Log Message : Use POSIX preferred (and easier to read) $() form rather than `` Affected Files: * madwifi/trunk/ath_hal/Makefile updated * madwifi/trunk/patch-kernel/install.sh updated * madwifi/trunk/scripts/madwifi-unload updated Modified: madwifi/trunk/ath_hal/Makefile =================================================================== --- madwifi/trunk/ath_hal/Makefile 2008-06-19 00:22:42 UTC (rev 3731) +++ madwifi/trunk/ath_hal/Makefile 2008-06-19 00:33:04 UTC (rev 3732) @@ -88,7 +88,7 @@ # Replace as many hashed names as possible with meaningful # ones in the symbol table of the binary kernel module for HAL. $(filter-out -O binary -S,$(OBJCOPY)) \ - `cat $(TOP)/scripts/hal_unmangle.objcopy` \ + $$(cat $(TOP)/scripts/hal_unmangle.objcopy) \ $(obj)/$(TARGET).hal.o .PHONY: install Modified: madwifi/trunk/patch-kernel/install.sh =================================================================== --- madwifi/trunk/patch-kernel/install.sh 2008-06-19 00:22:42 UTC (rev 3731) +++ madwifi/trunk/patch-kernel/install.sh 2008-06-19 00:33:04 UTC (rev 3732) @@ -14,7 +14,7 @@ } SRC=.. -KERNEL_VERSION=`uname -r` +KERNEL_VERSION=$(uname -r) if test -n "$1"; then KERNEL_PATH="$1" @@ -74,19 +74,19 @@ echo "Copying source files" -FILES=`cd ${SRC} && find ath ath_hal ath_rate hal include net80211 -name '*.[ch]'` +FILES=$(cd ${SRC} && find ath ath_hal ath_rate hal include net80211 -name '*.[ch]') for f in $FILES; do case $f in *.mod.c) continue;; esac - mkdir -p `dirname ${MADWIFI}/$f` + mkdir -p $(dirname ${MADWIFI}/$f) cp -f ${SRC}/$f ${MADWIFI}/$f done echo "Copying makefiles" -FILES=`cd ${SRC} && find . -name Makefile.kernel` +FILES=$(cd ${SRC} && find . -name Makefile.kernel) for f in $FILES; do - cp -f ${SRC}/$f `dirname ${MADWIFI}/$f`/Makefile + cp -f ${SRC}/$f $(dirname ${MADWIFI}/$f)/Makefile done cp -f ${SRC}/ath_hal/ah_target.inc ${MADWIFI}/ath_hal Modified: madwifi/trunk/scripts/madwifi-unload =================================================================== --- madwifi/trunk/scripts/madwifi-unload 2008-06-19 00:22:42 UTC (rev 3731) +++ madwifi/trunk/scripts/madwifi-unload 2008-06-19 00:33:04 UTC (rev 3732) @@ -3,7 +3,7 @@ : ${PATTERN='\(ath_.*\|wlan_.*\|wlan\)$'} : ${MAX_TRIES=10} -test "`id -u`" = 0 || { +test "$(id -u)" = 0 || { echo "ERROR: You must be root to run this script" >&2 exit 1 } @@ -18,7 +18,7 @@ skipped=0 IFS=' ' - for line in `cat /proc/modules`; do + for line in $(cat /proc/modules); do IFS=' ' set x $line name="$2" |
From: Matthew W. S. Bell <svn-commits@ma...> - 2008-06-19 00:22:48
|
Project : madwifi Revision : 3731 Author : mentor (Matthew W. S. Bell) Date : 2008-06-19 02:22:42 +0200 (Thu, 19 Jun 2008) Log Message : Typo in CONFIG_PARISC. Guess PARISC users are a bit thin on the ground then. Affected Files: * madwifi/trunk/ath_hal/ah_os.h updated Modified: madwifi/trunk/ath_hal/ah_os.h =================================================================== --- madwifi/trunk/ath_hal/ah_os.h 2008-06-18 05:10:34 UTC (rev 3730) +++ madwifi/trunk/ath_hal/ah_os.h 2008-06-19 00:22:42 UTC (rev 3731) @@ -166,7 +166,7 @@ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)) && \ (AH_BYTE_ORDER == AH_BIG_ENDIAN) && \ !defined(CONFIG_GENERIC_IOMAP) && \ - !defined(CONFIG_PARICS) && \ + !defined(CONFIG_PARISC) && \ !(defined(CONFIG_PPC64) && \ (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))) && \ !defined(CONFIG_PPC_MERGE) && \ |
From: Pavel Roskin <svn-commits@ma...> - 2008-06-18 05:10:43
|
Project : madwifi Revision : 3730 Author : proski (Pavel Roskin) Date : 2008-06-18 07:10:34 +0200 (Wed, 18 Jun 2008) Log Message : Allow enabling crypto tests by passing CRYPTO_TESTING=1 to make Affected Files: * madwifi/trunk/Makefile updated Modified: madwifi/trunk/Makefile =================================================================== --- madwifi/trunk/Makefile 2008-06-18 03:17:19 UTC (rev 3729) +++ madwifi/trunk/Makefile 2008-06-18 05:10:34 UTC (rev 3730) @@ -49,6 +49,10 @@ obj-y := ath/ ath_hal/ ath_rate/ net80211/ +ifdef CRYPTO_TESTING +obj-y += regression/ +endif + .PHONY: all all: modules tools |
From: Scott Raynel <svn-commits@ma...> - 2008-06-18 03:17:23
|
Project : madwifi Revision : 3729 Author : scottr (Scott Raynel) Date : 2008-06-18 05:17:19 +0200 (Wed, 18 Jun 2008) Log Message : Don't override DESTDIR Affected Files: * ath_info/trunk/Makefile updated Modified: ath_info/trunk/Makefile =================================================================== --- ath_info/trunk/Makefile 2008-06-18 03:00:40 UTC (rev 3728) +++ ath_info/trunk/Makefile 2008-06-18 03:17:19 UTC (rev 3729) @@ -6,7 +6,6 @@ CC = $(USER_CROSS_COMPILE)gcc CFLAGS = -g -O2 -W -Wall LDFLAGS = -DESTDIR = PREFIX = /usr/local BINDIR = $(PREFIX)/bin MANDIR = $(PREFIX)/share/man |
From: Pavel Roskin <svn-commits@ma...> - 2008-06-18 03:00:46
|
Project : madwifi Revision : 3728 Author : proski (Pavel Roskin) Date : 2008-06-18 05:00:40 +0200 (Wed, 18 Jun 2008) Log Message : Merge changes to svn:ignore from trunk References: r3703, r3727 Affected Files: * madwifi/branches/madwifi-dfs/ properties updated * madwifi/branches/madwifi-dfs/ath/ properties updated * madwifi/branches/madwifi-dfs/ath_hal/ properties updated * madwifi/branches/madwifi-dfs/ath_rate/ properties updated * madwifi/branches/madwifi-dfs/ath_rate/amrr/ properties updated * madwifi/branches/madwifi-dfs/ath_rate/minstrel/ properties updated * madwifi/branches/madwifi-dfs/ath_rate/onoe/ properties updated * madwifi/branches/madwifi-dfs/ath_rate/sample/ properties updated * madwifi/branches/madwifi-dfs/net80211/ properties updated * madwifi/branches/madwifi-dfs/regression/ properties updated * madwifi/branches/madwifi-dfs/regression/ccmp/ properties updated * madwifi/branches/madwifi-dfs/regression/tkip/ properties updated * madwifi/branches/madwifi-dfs/regression/wep/ properties updated Property changes on: madwifi/branches/madwifi-dfs ___________________________________________________________________ Name: svn:ignore - *.symvers .tmp_versions svnversion.h + *.markers *.order *.symvers .tmp_versions svnversion.h Property changes on: madwifi/branches/madwifi-dfs/ath ___________________________________________________________________ Name: svn:ignore - .*.cmd .*.flags *.o *.ko *.mod.c + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/branches/madwifi-dfs/ath_hal ___________________________________________________________________ Name: svn:ignore - .*.cmd .*.flags *.o *.ko *.mod.c uudecode + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags uudecode Property changes on: madwifi/branches/madwifi-dfs/ath_rate ___________________________________________________________________ Name: svn:ignore + modules.order Property changes on: madwifi/branches/madwifi-dfs/ath_rate/amrr ___________________________________________________________________ Name: svn:ignore - .*.cmd .*.flags *.o *.ko *.mod.c + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/branches/madwifi-dfs/ath_rate/minstrel ___________________________________________________________________ Name: svn:ignore - .*.cmd .*.flags *.o *.ko *.mod.c + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/branches/madwifi-dfs/ath_rate/onoe ___________________________________________________________________ Name: svn:ignore - .*.cmd .*.flags *.o *.ko *.mod.c + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/branches/madwifi-dfs/ath_rate/sample ___________________________________________________________________ Name: svn:ignore - .*.cmd .*.flags *.o *.ko *.mod.c + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/branches/madwifi-dfs/net80211 ___________________________________________________________________ Name: svn:ignore - .*.cmd .*.flags *.o *.ko *.mod.c + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/branches/madwifi-dfs/regression ___________________________________________________________________ Name: svn:ignore + modules.order Property changes on: madwifi/branches/madwifi-dfs/regression/ccmp ___________________________________________________________________ Name: svn:ignore - .*.cmd .*.flags *.o *.ko *.mod.c + *.ko *.mod.c *.o .*.cmd .*.flags modules.order Property changes on: madwifi/branches/madwifi-dfs/regression/tkip ___________________________________________________________________ Name: svn:ignore - .*.cmd .*.flags *.o *.ko *.mod.c + *.ko *.mod.c *.o .*.cmd .*.flags modules.order Property changes on: madwifi/branches/madwifi-dfs/regression/wep ___________________________________________________________________ Name: svn:ignore - .*.cmd .*.flags *.o *.ko *.mod.c + *.ko *.mod.c *.o .*.cmd .*.flags modules.order |
From: Pavel Roskin <svn-commits@ma...> - 2008-06-17 22:32:12
|
Project : madwifi Revision : 3727 Author : proski (Pavel Roskin) Date : 2008-06-18 00:32:04 +0200 (Wed, 18 Jun 2008) Log Message : Ignore *.markers and *.order Module.markers is created when compiling for a kernel with kernel markers enabled. modules.order was ignored already, but it would be better to be prepared if "modules" becomes "Module" or something like that. Affected Files: * madwifi/trunk/ properties updated * madwifi/trunk/ath/ properties updated * madwifi/trunk/ath_hal/ properties updated * madwifi/trunk/ath_rate/amrr/ properties updated * madwifi/trunk/ath_rate/minstrel/ properties updated * madwifi/trunk/ath_rate/onoe/ properties updated * madwifi/trunk/ath_rate/sample/ properties updated * madwifi/trunk/net80211/ properties updated Property changes on: madwifi/trunk ___________________________________________________________________ Name: svn:ignore - *.symvers .tmp_versions modules.order svnversion.h + *.markers *.order *.symvers .tmp_versions svnversion.h Property changes on: madwifi/trunk/ath ___________________________________________________________________ Name: svn:ignore - *.ko *.mod.c *.o .*.cmd .*.flags modules.order + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/trunk/ath_hal ___________________________________________________________________ Name: svn:ignore - *.ko *.mod.c *.o .*.cmd .*.flags modules.order uudecode + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags uudecode Property changes on: madwifi/trunk/ath_rate/amrr ___________________________________________________________________ Name: svn:ignore - *.ko *.mod.c *.o .*.cmd .*.flags modules.order + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/trunk/ath_rate/minstrel ___________________________________________________________________ Name: svn:ignore - *.ko *.mod.c *.o .*.cmd .*.flags modules.order + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/trunk/ath_rate/onoe ___________________________________________________________________ Name: svn:ignore - *.ko *.mod.c *.o .*.cmd .*.flags modules.order + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/trunk/ath_rate/sample ___________________________________________________________________ Name: svn:ignore - *.ko *.mod.c *.o .*.cmd .*.flags modules.order + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags Property changes on: madwifi/trunk/net80211 ___________________________________________________________________ Name: svn:ignore - *.ko *.mod.c *.o .*.cmd .*.flags modules.order + *.ko *.markers *.mod.c *.o *.order .*.cmd .*.flags |
From: Kel Modderman <svn-commits@ma...> - 2008-06-16 08:50:33
|
Project : madwifi Revision : 3726 Author : kelmo (Kel Modderman) Date : 2008-06-16 10:50:30 +0200 (Mon, 16 Jun 2008) Log Message : Fix format string bugs. Closes: #1999 Affected Files: * madwifi/trunk/ath_hal/ah_os.c updated * madwifi/trunk/net80211/ieee80211_linux.c updated Modified: madwifi/trunk/ath_hal/ah_os.c =================================================================== --- madwifi/trunk/ath_hal/ah_os.c 2008-06-13 15:12:46 UTC (rev 3725) +++ madwifi/trunk/ath_hal/ah_os.c 2008-06-16 08:50:30 UTC (rev 3726) @@ -448,7 +448,7 @@ if (static_label) { if (strncmp(static_label, "ATH5K_", 6) == 0) static_label += 6; - snprintf(buf, buflen, static_label); + snprintf(buf, buflen, "%s", static_label); return AH_TRUE; } Modified: madwifi/trunk/net80211/ieee80211_linux.c =================================================================== --- madwifi/trunk/net80211/ieee80211_linux.c 2008-06-13 15:12:46 UTC (rev 3725) +++ madwifi/trunk/net80211/ieee80211_linux.c 2008-06-16 08:50:30 UTC (rev 3726) @@ -380,7 +380,7 @@ { #ifdef CONFIG_KMOD int rv; - rv = request_module(modname); + rv = request_module("%s", modname); if (rv < 0) printk(KERN_ERR "failed to automatically load module: %s; " \ "errno: %d\n", modname, rv); |
From: Pavel Roskin <svn-commits@ma...> - 2008-06-15 10:24:38
|
Project : madwifi Revision : 3722 Author : proski (Pavel Roskin) Date : 2008-06-12 19:44:56 +0200 (Thu, 12 Jun 2008) Log Message : Merge all changes from trunk up to r3721 Affected Files: * madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath.c updated * madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_ahb.c updated * madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_hal_extensions.h updated * madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_pci.c updated * madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.c updated * madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.h updated * madwifi/branches/madwifi-hal-0.10.5.6/ath/if_athvar.h updated * madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/Makefile updated * madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.c updated * madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.h updated * madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/amrr/amrr.c updated * madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/minstrel/minstrel.c updated * madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/onoe/onoe.c updated * madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/sample/sample.c updated * madwifi/branches/madwifi-hal-0.10.5.6/include/compat.h updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/_ieee80211.h updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_beacon.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.h updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_ccmp.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_tkip.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_wep.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_input.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.h updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_monitor.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.h updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_output.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_power.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.h updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan_sta.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.h updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_var.h updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_wireless.c updated * madwifi/branches/madwifi-hal-0.10.5.6/net80211/if_media.c updated * madwifi/branches/madwifi-hal-0.10.5.6/regression/wep/test_wep.c updated * madwifi/branches/madwifi-hal-0.10.5.6/tools/80211debug.c updated * madwifi/branches/madwifi-hal-0.10.5.6/tools/80211stats.c updated * madwifi/branches/madwifi-hal-0.10.5.6/tools/athdebug.c updated * madwifi/branches/madwifi-hal-0.10.5.6/tools/athstats.c updated * madwifi/branches/madwifi-hal-0.10.5.6/tools/wireless_copy.h updated * madwifi/branches/madwifi-hal-0.10.5.6/tools/wlanconfig.c updated Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -126,7 +126,7 @@ }; static struct ieee80211vap *ath_vap_create(struct ieee80211com *, - const char *, int, int, struct net_device *); + const char *, int, int, struct net_device *); static void ath_vap_delete(struct ieee80211vap *); static int ath_init(struct net_device *); static int ath_reset(struct net_device *); @@ -166,10 +166,10 @@ #ifdef IEEE80211_DEBUG_REFCNT static struct ieee80211_node *ath_node_alloc_debug(struct ieee80211vap *, - const char* func, int line); -static void ath_node_cleanup_debug(struct ieee80211_node *, const char* func, + const char *func, int line); +static void ath_node_cleanup_debug(struct ieee80211_node *, const char *func, int line); -static void ath_node_free_debug(struct ieee80211_node *, const char* func, +static void ath_node_free_debug(struct ieee80211_node *, const char *func, int line); #else static struct ieee80211_node *ath_node_alloc(struct ieee80211vap *); @@ -243,7 +243,7 @@ static void ath_registers_dump_delta(struct ieee80211com *ic); static void ath_registers_mark(struct ieee80211com *ic); static unsigned int ath_read_register(struct ieee80211com *ic, - unsigned int address, unsigned int* value); + unsigned int address, unsigned int *value); static unsigned int ath_write_register(struct ieee80211com *ic, unsigned int address, unsigned int value); static void ath_ar5212_registers_dump(struct ath_softc *sc); @@ -280,7 +280,7 @@ #define ath_return_txbuf(_sc, _pbuf) \ ath_return_txbuf_debug(_sc, _pbuf, __func__, __LINE__) static void ath_return_txbuf_debug(struct ath_softc *sc, struct ath_buf **buf, - const char* func, int line); + const char *func, int line); #else /* #ifdef IEEE80211_DEBUG_REFCNT */ static void ath_return_txbuf(struct ath_softc *sc, struct ath_buf **buf); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ @@ -289,7 +289,7 @@ #define ath_return_txbuf_locked(_sc, _pbuf) \ ath_return_txbuf_locked_debug(_sc, _pbuf, __func__, __LINE__) static void ath_return_txbuf_locked_debug(struct ath_softc *sc, struct ath_buf **buf, - const char* func, int line); + const char *func, int line); #else /* #ifdef IEEE80211_DEBUG_REFCNT */ static void ath_return_txbuf_locked(struct ath_softc *sc, struct ath_buf **buf); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ @@ -298,7 +298,7 @@ #define ath_return_txbuf_list(_sc, _head) \ ath_return_txbuf_list_debug(_sc, _head, __func__, __LINE__) static void ath_return_txbuf_list_debug(struct ath_softc *sc, ath_bufhead *bfhead, - const char* func, int line); + const char *func, int line); #else /* #ifdef IEEE80211_DEBUG_REFCNT */ static void ath_return_txbuf_list(struct ath_softc *sc, ath_bufhead *bfhead); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ @@ -307,7 +307,7 @@ #define ath_return_txbuf_list_locked(_sc, _head) \ ath_return_txbuf_list_locked_debug(_sc, _head, __func__, __LINE__) static void ath_return_txbuf_list_locked_debug(struct ath_softc *sc, ath_bufhead *bfhead, - const char* func, int line); + const char *func, int line); #else /* #ifdef IEEE80211_DEBUG_REFCNT */ static void ath_return_txbuf_list_locked(struct ath_softc *sc, ath_bufhead *bfhead); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ @@ -315,10 +315,10 @@ #ifdef IEEE80211_DEBUG_REFCNT #define cleanup_ath_buf(_sc, _buf, _dir) \ cleanup_ath_buf_debug(_sc, _buf, _dir, __func__, __LINE__) -static struct ath_buf* cleanup_ath_buf_debug(struct ath_softc *sc, struct ath_buf *buf, - int direction, const char* func, int line); +static struct ath_buf *cleanup_ath_buf_debug(struct ath_softc *sc, struct ath_buf *buf, + int direction, const char *func, int line); #else /* #ifdef IEEE80211_DEBUG_REFCNT */ -static struct ath_buf* cleanup_ath_buf(struct ath_softc *sc, struct ath_buf *buf, +static struct ath_buf *cleanup_ath_buf(struct ath_softc *sc, struct ath_buf *buf, int direction); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ @@ -337,18 +337,18 @@ /* 802.11h DFS support functions */ static void ath_dfs_cac_completed(unsigned long); -static void ath_interrupt_dfs_cac(struct ath_softc *sc, const char* reason); +static void ath_interrupt_dfs_cac(struct ath_softc *sc, const char *reason); -static inline int ath_chan_unavail(struct ath_softc* sc); +static inline int ath_chan_unavail(struct ath_softc *sc); #define ath_cac_running_dbgmsg(_sc) \ _ath_cac_running_dbgmsg((_sc), __func__) #define ath_chan_unavail_dbgmsg(_sc) \ _ath_chan_unavail_dbgmsg((_sc), __func__) static inline int _ath_cac_running_dbgmsg(struct ath_softc *sc, - const char* func); + const char *func); static inline int _ath_chan_unavail_dbgmsg(struct ath_softc *sc, - const char* func); + const char *func); /* 802.11h DFS testing functions */ static int ath_get_dfs_testmode(struct ieee80211com *); @@ -370,7 +370,7 @@ static void ath_scanbufs(struct ath_softc *sc); static int ath_debug_iwpriv(struct ieee80211com *ic, - unsigned int param, unsigned int value); + unsigned int param, unsigned int value); static u_int32_t ath_get_real_maxtxpower(struct ath_softc *sc); static int ath_txq_check(struct ath_softc *sc, struct ath_txq *txq, const char *msg); @@ -550,12 +550,12 @@ atomic_set(&sc->sc_txbuf_counter, 0); - ATH_INIT_TQUEUE(&sc->sc_rxtq, ath_rx_tasklet, dev); - ATH_INIT_TQUEUE(&sc->sc_txtq, ath_tx_tasklet, dev); - ATH_INIT_TQUEUE(&sc->sc_bmisstq, ath_bmiss_tasklet, dev); - ATH_INIT_TQUEUE(&sc->sc_bstucktq, ath_bstuck_tasklet, dev); - ATH_INIT_TQUEUE(&sc->sc_rxorntq, ath_rxorn_tasklet, dev); - ATH_INIT_TQUEUE(&sc->sc_fataltq, ath_fatal_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_rxtq, ath_rx_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_txtq, ath_tx_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_bmisstq, ath_bmiss_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_bstucktq, ath_bstuck_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_rxorntq, ath_rxorn_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_fataltq, ath_fatal_tasklet, dev); /* * Attach the HAL and verify ABI compatibility by checking @@ -884,6 +884,8 @@ ic->ic_updateslot = ath_updateslot; atomic_set(&ic->ic_node_counter, 0); ic->ic_debug = 0; + sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL); + sc->sc_default_ieee80211_debug = ieee80211_debug; ic->ic_wme.wme_update = ath_wme_update; ic->ic_uapsd_flush = ath_uapsd_flush; @@ -1005,27 +1007,21 @@ */ ic->ic_flags |= IEEE80211_F_DATAPAD; - /* - * Query the HAL about antenna support - * Enable rx fast diversity if HAL has support - */ - if (ath_hal_hasdiversity(ah)) { - sc->sc_hasdiversity = 1; - ath_hal_setdiversity(ah, AH_TRUE); - sc->sc_diversity = 1; - } else { - sc->sc_hasdiversity = 0; - sc->sc_diversity = 0; - ath_hal_setdiversity(ah, AH_FALSE); - } - sc->sc_defant = ath_hal_getdefantenna(ah); + /* Query the HAL about antenna support + * Enable RX fast diversity if HAL has support. */ + sc->sc_hasdiversity = sc->sc_diversity = !!ath_hal_hasdiversity(ah); + ath_hal_setdiversity(ah, sc->sc_diversity); + sc->sc_rxantenna = ath_hal_getdefantenna(ah); + sc->sc_txantenna = 0; /* default to auto-selection */ + /* * Not all chips have the VEOL support we want to * use with IBSS beacons; check here for it. */ sc->sc_hasveol = ath_hal_hasveol(ah); + sc->sc_txintrperiod = ATH_TXQ_INTR_PERIOD; /* get mac address from hardware */ ath_hal_getmac(ah, ic->ic_myaddr); @@ -1063,33 +1059,33 @@ ic->ic_vap_create = ath_vap_create; ic->ic_vap_delete = ath_vap_delete; - ic->ic_test_radar = ath_test_radar; - ic->ic_dump_hal_map = ath_dump_hal_map; + ic->ic_test_radar = ath_test_radar; + ic->ic_dump_hal_map = ath_dump_hal_map; - ic->ic_set_dfs_testmode = ath_set_dfs_testmode; - ic->ic_get_dfs_testmode = ath_get_dfs_testmode; + ic->ic_set_dfs_testmode = ath_set_dfs_testmode; + ic->ic_get_dfs_testmode = ath_get_dfs_testmode; - ic->ic_set_txcont = ath_set_txcont; - ic->ic_get_txcont = ath_get_txcont; + ic->ic_set_txcont = ath_set_txcont; + ic->ic_get_txcont = ath_get_txcont; - ic->ic_set_txcont_power = ath_set_txcont_power; - ic->ic_get_txcont_power = ath_get_txcont_power; + ic->ic_set_txcont_power = ath_set_txcont_power; + ic->ic_get_txcont_power = ath_get_txcont_power; - ic->ic_set_txcont_rate = ath_set_txcont_rate; - ic->ic_get_txcont_rate = ath_get_txcont_rate; + ic->ic_set_txcont_rate = ath_set_txcont_rate; + ic->ic_get_txcont_rate = ath_get_txcont_rate; - ic->ic_scan_start = ath_scan_start; - ic->ic_scan_end = ath_scan_end; - ic->ic_set_channel = ath_set_channel; + ic->ic_scan_start = ath_scan_start; + ic->ic_scan_end = ath_scan_end; + ic->ic_set_channel = ath_set_channel; #ifdef ATH_REVERSE_ENGINEERING - ic->ic_read_register = ath_read_register; - ic->ic_write_register = ath_write_register; - ic->ic_registers_dump = ath_registers_dump; - ic->ic_registers_dump_delta = ath_registers_dump_delta; - ic->ic_registers_mark = ath_registers_mark; + ic->ic_read_register = ath_read_register; + ic->ic_write_register = ath_write_register; + ic->ic_registers_dump = ath_registers_dump; + ic->ic_registers_dump_delta = ath_registers_dump_delta; + ic->ic_registers_mark = ath_registers_mark; #endif /* #ifdef ATH_REVERSE_ENGINEERING */ - ic->ic_debug_ath_iwpriv = ath_debug_iwpriv; + ic->ic_debug_ath_iwpriv = ath_debug_iwpriv; ic->ic_set_coverageclass = ath_set_coverageclass; ic->ic_mhz2ieee = ath_mhz2ieee; @@ -1598,14 +1594,14 @@ void ath_suspend(struct net_device *dev) { - DPRINTF(((struct ath_softc*)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags); + DPRINTF(((struct ath_softc *)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags); ath_stop(dev); } void ath_resume(struct net_device *dev) { - DPRINTF(((struct ath_softc*)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags); + DPRINTF(((struct ath_softc *)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags); ath_init(dev); } @@ -1640,9 +1636,9 @@ } } -static HAL_BOOL ath_hw_reset(struct ath_softc* sc, HAL_OPMODE opmode, - HAL_CHANNEL *channel, HAL_BOOL bChannelChange, - HAL_STATUS *status) +static HAL_BOOL ath_hw_reset(struct ath_softc *sc, HAL_OPMODE opmode, + HAL_CHANNEL *channel, HAL_BOOL bChannelChange, + HAL_STATUS *status) { HAL_BOOL ret; unsigned long __axq_lockflags[HAL_NUM_TX_QUEUES]; @@ -1653,53 +1649,64 @@ * lock all TXQ to avoid race condition with * ath_tx_txqaddbuf() and ath_tx_processq() */ - for (i=0; i<HAL_NUM_TX_QUEUES; i++) { - if (ATH_TXQ_SETUP(sc, i)) { - txq = &sc->sc_txq[i]; - spin_lock_irqsave(&txq->axq_lock, __axq_lockflags[i]); - } + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(sc, i)) { + txq = &sc->sc_txq[i]; + spin_lock_irqsave(&txq->axq_lock, __axq_lockflags[i]); + } } ret = ath_hal_reset(sc->sc_ah, sc->sc_opmode, channel, bChannelChange, status); /* Restore all TXDP pointers, if appropriate, and unlock in * the reverse order we locked */ - for (i=HAL_NUM_TX_QUEUES-1; i>=0; i--) { - /* only take care of configured TXQ */ - if (ATH_TXQ_SETUP(sc, i)) { - struct ath_buf * bf; - u_int32_t txdp; + for (i = HAL_NUM_TX_QUEUES - 1; i >= 0; i--) { + /* only take care of configured TXQ */ + if (ATH_TXQ_SETUP(sc, i)) { + struct ath_buf *bf; + u_int32_t txdp; - txq = &sc->sc_txq[i]; + txq = &sc->sc_txq[i]; - /* Check that TXDP is NULL */ - txdp = ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum); - if (txdp != 0) { - DPRINTF(sc, ATH_DEBUG_WATCHDOG, - "TXQ%d: BUG TXDP:%08x is not NULL\n", - txq->axq_qnum, txdp); - } + /* Check that TXDP is NULL */ + txdp = ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum); + if (txdp != 0) { + DPRINTF(sc, ATH_DEBUG_WATCHDOG, + "TXQ%d: BUG TXDP:%08x is " + "not NULL\n", + txq->axq_qnum, txdp); + } - bf = STAILQ_FIRST(&txq->axq_q); - if (bf != NULL) { - DPRINTF(sc, ATH_DEBUG_WATCHDOG, - "TXQ%d: restoring TXDP:%08llx\n", - txq->axq_qnum, (u_int64_t)bf->bf_daddr); - ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); - txdp = ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum); - if (txdp != bf->bf_daddr) { - DPRINTF(sc, ATH_DEBUG_WATCHDOG, - "TXQ%d: BUG failed to restore TXDP:%08llx (is %08x)\n", - txq->axq_qnum, (u_int64_t)bf->bf_daddr, txdp); - } - ath_hal_txstart(sc->sc_ah, txq->axq_qnum); - } - spin_unlock_irqrestore(&txq->axq_lock, __axq_lockflags[i]); - } + bf = STAILQ_FIRST(&txq->axq_q); + if (bf != NULL) { + DPRINTF(sc, ATH_DEBUG_WATCHDOG, + "TXQ%d: restoring " + "TXDP:%08llx\n", + txq->axq_qnum, + (u_int64_t)bf->bf_daddr); + ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, + bf->bf_daddr); + txdp = ath_hal_gettxbuf(sc->sc_ah, + txq->axq_qnum); + if (txdp != bf->bf_daddr) { + DPRINTF(sc, ATH_DEBUG_WATCHDOG, + "TXQ%d: BUG failed to " + "restore TXDP:%08llx " + "(is %08x)\n", + txq->axq_qnum, + (u_int64_t)bf->bf_daddr, + txdp); + } + ath_hal_txstart(sc->sc_ah, txq->axq_qnum); + } + spin_unlock_irqrestore(&txq->axq_lock, + __axq_lockflags[i]); + } } #ifdef ATH_CAP_TPC if (sc->sc_hastpc && (hal_tpc != ath_hal_gettpc(sc->sc_ah))) { - EPRINTF(sc, "TPC HAL capability out of sync. Got %d!\n", ath_hal_gettpc(sc->sc_ah)); + EPRINTF(sc, "TPC HAL capability out of sync. Got %d!\n", + ath_hal_gettpc(sc->sc_ah)); ath_hal_settpc(sc->sc_ah, hal_tpc); } #endif @@ -1713,7 +1720,8 @@ if (sc->sc_softled) ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin); ath_update_txpow(sc); /* Update TX power state. */ - ath_setdefantenna(sc, sc->sc_defant); + ath_hal_setdiversity(sc->sc_ah, sc->sc_diversity); + ath_setdefantenna(sc, sc->sc_rxantenna); /* XXX: Any other clobbered features? */ ath_radar_update(sc); @@ -1725,14 +1733,14 @@ /* Channel Availability Check is running, or a channel has already found to be * unavailable. */ static int -ath_chan_unavail(struct ath_softc* sc) { +ath_chan_unavail(struct ath_softc *sc) { return sc->sc_dfs_cac || ((sc->sc_curchan.privFlags & CHANNEL_DFS) && (sc->sc_curchan.privFlags & CHANNEL_INTERFERENCE)); } static inline int -_ath_cac_running_dbgmsg(struct ath_softc *sc, const char* func) { +_ath_cac_running_dbgmsg(struct ath_softc *sc, const char *func) { int b = sc->sc_dfs_cac; if (b) DPRINTF(sc, ATH_DEBUG_DOTH, @@ -1742,7 +1750,7 @@ } static inline int -_ath_chan_unavail_dbgmsg(struct ath_softc *sc, const char* func) { +_ath_chan_unavail_dbgmsg(struct ath_softc *sc, const char *func) { int b = ath_chan_unavail(sc); if (b) DPRINTF(sc, ATH_DEBUG_DOTH, @@ -1794,7 +1802,7 @@ } static void -ath_intr_process_rx_descriptors(struct ath_softc *sc, int* pneedmark, u_int64_t hw_tsf) +ath_intr_process_rx_descriptors(struct ath_softc *sc, int *pneedmark, u_int64_t hw_tsf) { struct ath_hal *ah = sc->sc_ah; struct ath_desc *ds; @@ -1940,7 +1948,7 @@ bus_dma_sync_single(sc->sc_bdev, bf->bf_skbaddr, sizeof(struct ieee80211_qosframe), BUS_DMA_FROMDEVICE); - qwh = (struct ieee80211_qosframe *) skb->data; + qwh = (struct ieee80211_qosframe *)skb->data; /* Find the node; it MUST be in the keycache. */ if (rs->rs_keyix == HAL_RXKEYIX_INVALID || @@ -2203,8 +2211,8 @@ DPRINTF(sc, ATH_DEBUG_TSF, "TSF error: bf_tsf=%10llx " "sc_last_tsf=%10llx\n", - bf->bf_tsf, - sc->sc_last_tsf); + bf->bf_tsf, + sc->sc_last_tsf); } sc->sc_last_tsf = bf->bf_tsf; } @@ -2445,8 +2453,8 @@ * track us. This especially * noticeable with Windows clients. */ mod_timer(&sc->sc_dturbo_switch_mode, - jiffies + - msecs_to_jiffies(10)); + jiffies + + msecs_to_jiffies(10)); } } #endif @@ -2475,7 +2483,7 @@ ath_hal_intrset(ah, sc->sc_imask); } - /* Let the HAL handle the event.*/ + /* Let the HAL handle the event. */ ath_hal_mibevent(ah, &sc->sc_halstats); ath_override_intmit_if_disabled(sc); } @@ -2621,9 +2629,9 @@ } /* Enable interrupts. */ sc->sc_imask = HAL_INT_RX | HAL_INT_TX - | HAL_INT_RXEOL | HAL_INT_RXORN - | HAL_INT_FATAL | HAL_INT_GLOBAL - | (sc->sc_needmib ? HAL_INT_MIB : 0); + | HAL_INT_RXEOL | HAL_INT_RXORN + | HAL_INT_FATAL | HAL_INT_GLOBAL + | (sc->sc_needmib ? HAL_INT_MIB : 0); /* Push changes to sc_imask to hardware */ ath_hal_intrset(ah, sc->sc_imask); @@ -2861,11 +2869,15 @@ j = 0; STAILQ_FOREACH(bf, &txq->axq_q, bf_list) { + HAL_STATUS status = + ath_hal_txprocdesc(sc->sc_ah, + bf->bf_desc, + &bf->bf_dsstatus.ds_txstat); DPRINTF(sc, ATH_DEBUG_WATCHDOG, " [%3u] bf_daddr:%08llx " - "ds_link:%08x ds_hw3:%08x\n", - j++, - (u_int64_t)bf->bf_daddr, bf->bf_desc->ds_link, - bf->bf_desc->ds_hw[3]); + "ds_link:%08x %s\n", + j++, + (u_int64_t)bf->bf_daddr, bf->bf_desc->ds_link, + status == HAL_EINPROGRESS ? "pending" : "done"); } } @@ -2996,7 +3008,7 @@ unsigned int pktlen, hdrlen, try0, power; HAL_PKT_TYPE atype; u_int flags; - u_int8_t antenna, txrate; + u_int8_t txrate; struct ath_txq *txq = NULL; struct ath_desc *ds = NULL; struct ieee80211_frame *wh; @@ -3036,7 +3048,6 @@ flags |= HAL_TXDESC_INTREQ; - antenna = sc->sc_txantenna; /* XXX check return value? */ ath_hal_setuptxdesc(ah, ds, @@ -3046,7 +3057,7 @@ power, /* txpower */ txrate, try0, /* series 0 rate/tries */ HAL_TXKEYIX_INVALID, /* key cache index */ - antenna, /* antenna mode */ + sc->sc_txantenna, /* antenna mode */ flags, /* flags */ 0, /* rts/cts rate */ 0, /* rts/cts duration */ @@ -3171,7 +3182,7 @@ #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ static -struct ath_buf* +struct ath_buf * #ifdef IEEE80211_DEBUG_REFCNT _take_txbuf_locked_debug(struct ath_softc *sc, int for_management, const char *func, int line) @@ -3179,7 +3190,7 @@ _take_txbuf_locked(struct ath_softc *sc, int for_management) #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ { - struct ath_buf* bf = NULL; + struct ath_buf *bf = NULL; ATH_TXBUF_LOCK_ASSERT(sc); /* Reserve at least ATH_TXBUF_MGT_RESERVED buffers for management frames */ if (ath_get_buffers_available(sc) <= ATH_TXBUF_MGT_RESERVED) { @@ -3231,14 +3242,14 @@ } static -struct ath_buf* +struct ath_buf * #ifdef IEEE80211_DEBUG_REFCNT _take_txbuf_debug(struct ath_softc *sc, int for_management, - const char *func, int line) { + const char *func, int line) { #else _take_txbuf(struct ath_softc *sc, int for_management) { #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ - struct ath_buf* bf = NULL; + struct ath_buf *bf = NULL; ATH_TXBUF_LOCK_IRQ(sc); #ifdef IEEE80211_DEBUG_REFCNT bf = _take_txbuf_locked_debug(sc, for_management, func, line); @@ -3325,12 +3336,12 @@ struct ieee80211com *ic = &sc->sc_ic; struct ath_node *an; struct ath_txq *txq = NULL; - struct sk_buff* skb = NULL; + struct sk_buff *skb = NULL; /* NB: NEVER free __skb, leave it alone and use original_skb instead! * IF original_skb is NULL it means the ownership was taken! * *** ALWAYS *** free any skb != __skb when cleaning up - unless it was * taken. */ - struct sk_buff* original_skb = __skb; /* ALWAYS FREE THIS ONE!!! */ + struct sk_buff *original_skb = __skb; /* ALWAYS FREE THIS ONE!!! */ int ff_flush; #endif ieee80211_skb_track(original_skb); @@ -4303,8 +4314,8 @@ mfilt[0] = mfilt[1] = ~0; ath_hal_setmcastfilter(ah, mfilt[0], mfilt[1]); DPRINTF(sc, ATH_DEBUG_STATE, - "Set RX filter: 0x%x, MC filter: %08x:%08x\n", - rfilt, mfilt[0], mfilt[1]); + "Set RX filter: 0x%x, MC filter: %08x:%08x\n", + rfilt, mfilt[0], mfilt[1]); } static inline int @@ -4322,7 +4333,7 @@ /* short slot time - 802.11a, and 802.11g turbo in turbo mode with short slot time */ return (slottime * 2) + 8; } - + /* constant for CCK mib processing time */ return (slottime * 2) + 18; } @@ -4513,20 +4524,22 @@ * Calculate BSS traffic over the previous interval. */ bss_traffic = (sc->sc_devstats.tx_bytes + sc->sc_devstats.rx_bytes) - - sc->sc_dturbo_bytes; + - sc->sc_dturbo_bytes; sc->sc_dturbo_bytes = sc->sc_devstats.tx_bytes - + sc->sc_devstats.rx_bytes; + + sc->sc_devstats.rx_bytes; if (ic->ic_ath_cap & IEEE80211_ATHC_BOOST) { /* Before switching to base mode, make sure that the * conditions (low RSSI, low BW) to switch mode hold for some * time and time in turbo exceeds minimum turbo time. */ if ((sc->sc_dturbo_tcount >= sc->sc_dturbo_turbo_tmin) && (sc->sc_dturbo_hold == 0) && - (bss_traffic < sc->sc_dturbo_bw_base || !sc->sc_rate_recn_state)) { + (bss_traffic < sc->sc_dturbo_bw_base || + !sc->sc_rate_recn_state)) { sc->sc_dturbo_hold = 1; } else { if (sc->sc_dturbo_hold && - bss_traffic >= sc->sc_dturbo_bw_turbo && sc->sc_rate_recn_state) { + bss_traffic >= sc->sc_dturbo_bw_turbo && + sc->sc_rate_recn_state) { /* out of hold state */ sc->sc_dturbo_hold = 0; sc->sc_dturbo_hold_count = sc->sc_dturbo_hold_max; @@ -4853,7 +4866,7 @@ struct ieee80211com *ic = SKB_NI(bf->bf_skb)->ni_ic; struct sk_buff *skb = bf->bf_skb; struct ath_hal *ah = sc->sc_ah; - struct ath_desc *ds; + struct ath_desc *ds = bf->bf_desc; unsigned int flags; int antenna = sc->sc_txantenna; const HAL_RATE_TABLE *rt; @@ -4863,22 +4876,16 @@ DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "skb=%p skb->len=%u\n", skb, skb->len); - /* setup descriptors */ - ds = bf->bf_desc; - flags = HAL_TXDESC_NOACK; #ifdef ATH_SUPERG_DYNTURBO if (sc->sc_dturbo_switch) flags |= HAL_TXDESC_INTREQ; #endif - - ds->ds_link = 0; - /* - * Switch antenna every beacon if txantenna is not set + + /* Switch antenna every beacon if txantenna is not set * Should only switch every beacon period, not for all * SWBAs - * XXX: assumes two antennae - */ + * XXX: assumes two antennae */ if (antenna == 0) { if (sc->sc_stagbeacons) antenna = ((sc->sc_stats.ast_be_xmit / @@ -4887,7 +4894,6 @@ antenna = (sc->sc_stats.ast_be_xmit & 1 ? 2 : 1); } - ds->ds_data = bf->bf_skbaddr; /* * Calculate rate code. * XXX everything at min xmit rate @@ -4914,6 +4920,8 @@ rate = rt->info[IEEE80211_XR_DEFAULT_RATE_INDEX].rateCode; } #endif + ds->ds_link = 0; + ds->ds_data = bf->bf_skbaddr; ath_hal_setuptxdesc(ah, ds, skb->len + IEEE80211_CRC_LEN, /* frame length */ sizeof(struct ieee80211_frame), /* header length */ @@ -5278,22 +5286,21 @@ } else if ((sc->sc_updateslot == COMMIT) && (sc->sc_slotupdate == slot)) ath_setslottime(sc); /* commit change to hardware */ - if ((!sc->sc_stagbeacons || slot == 0) && (!sc->sc_diversity)) { + /* If HW fast diversity is not enabled and there is not default RX + * antenna set, check recent per-antenna transmit statistics and flip + * the default RX antenna if noticeably more frames went out on the + * non-default antenna. */ + if ((!sc->sc_stagbeacons || slot == 0) && + !sc->sc_diversity && !sc->sc_rxantenna) { unsigned int otherant; - /* - * Check recent per-antenna transmit statistics and flip - * the default rx antenna if noticeably more frames went out - * on the non-default antenna. Only do this if rx diversity - * is off. - * XXX assumes 2 antennae - */ - otherant = sc->sc_defant & 1 ? 2 : 1; - if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + + /* XXX: assumes 2 antennae. */ + otherant = sc->sc_rxantenna & 1 ? 2 : 1; + if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_rxantenna] + ATH_ANTENNA_DIFF) { DPRINTF(sc, ATH_DEBUG_BEACON, - "Flip default antenna to %u, %u > %u\n", + "Flip default RX antenna to %u, %u > %u\n", otherant, sc->sc_ant_tx[otherant], - sc->sc_ant_tx[sc->sc_defant]); + sc->sc_ant_tx[sc->sc_rxantenna]); ath_setdefantenna(sc, otherant); } sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0; @@ -5762,7 +5769,7 @@ static struct ieee80211_node * #ifdef IEEE80211_DEBUG_REFCNT -ath_node_alloc_debug(struct ieee80211vap *vap, const char* func, int line) +ath_node_alloc_debug(struct ieee80211vap *vap, const char *func, int line) #else ath_node_alloc(struct ieee80211vap *vap) #endif @@ -5793,7 +5800,7 @@ static void #ifdef IEEE80211_DEBUG_REFCNT -ath_node_cleanup_debug(struct ieee80211_node *ni, const char* func, int line) +ath_node_cleanup_debug(struct ieee80211_node *ni, const char *func, int line) #else ath_node_cleanup(struct ieee80211_node *ni) #endif @@ -5851,7 +5858,7 @@ static void #ifdef IEEE80211_DEBUG_REFCNT -ath_node_free_debug(struct ieee80211_node *ni, const char* func, int line) +ath_node_free_debug(struct ieee80211_node *ni, const char *func, int line) #else ath_node_free(struct ieee80211_node *ni) #endif @@ -6207,7 +6214,7 @@ #ifdef IEEE80211_DEBUG_REFCNT #define ath_alloc_skb(_size, _align) \ ath_alloc_skb_debug(_size, _align, __func__, __LINE__) -ath_alloc_skb_debug(u_int size, u_int align, const char* func, int line) +ath_alloc_skb_debug(u_int size, u_int align, const char *func, int line) #else ath_alloc_skb(u_int size, u_int align) #endif @@ -6320,67 +6327,28 @@ /* This function calculates the presence of, and then removes any padding * bytes between the frame header and frame body, and returns a modified - * SKB. If padding is removed and copy_skb is specified, then a new SKB is - * created, otherwise the same SKB is used. - * - * NB: MAY ALLOCATE */ -static struct sk_buff * -ath_skb_removepad(struct sk_buff *skb, unsigned int copy_skb) + * SKB. */ +static void +ath_skb_removepad(struct ieee80211com *ic, struct sk_buff *skb) { - struct sk_buff *tskb = skb; struct ieee80211_frame *wh = (struct ieee80211_frame *)skb->data; unsigned int padbytes = 0, headersize = 0; + + KASSERT(ic->ic_flags & IEEE80211_F_DATAPAD, + ("data padding not enabled?")); /* Only non-control frames have bodies, and hence padding. */ if (IEEE80211_FRM_HAS_BODY(wh)) { headersize = ieee80211_anyhdrsize(wh); padbytes = roundup(headersize, 4) - headersize; if (padbytes > 0) { - if (copy_skb) { - /* Copy skb and remove HW pad bytes */ - tskb = skb_copy(skb, GFP_ATOMIC); - if (tskb == NULL) - return NULL; - ieee80211_skb_copy_noderef(skb, tskb); - } - memmove(tskb->data + padbytes, tskb->data, headersize); - skb_pull(tskb, padbytes); + memmove(skb->data + padbytes, skb->data, headersize); + skb_pull(skb, padbytes); } } - return tskb; } /* - * Add a prism2 header to a received frame and - * dispatch it to capture tools like kismet. - */ -static void -ath_capture(struct net_device *dev, const struct ath_buf *bf, - struct sk_buff *skb, u_int64_t tsf, unsigned int tx) -{ - struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; - struct sk_buff *tskb = NULL; - - KASSERT(ic->ic_flags & IEEE80211_F_DATAPAD, - ("data padding not enabled?")); - - if (sc->sc_nmonvaps <= 0) - return; - - /* Never copy the SKB, as it is ours on the RX side, and this is the - * last process on the TX side and we only modify our own headers. */ - tskb = ath_skb_removepad(skb, 0 /* Copy SKB */); - if (tskb == NULL) { - DPRINTF(sc, ATH_DEBUG_ANY, - "Dropping; ath_skb_removepad failed!\n"); - return; - } - - ieee80211_input_monitor(ic, tskb, bf, tx, tsf, sc); -} - -/* * Intercept management frames to collect beacon RSSI data and to do * ibss merges. This function is called for all management frames, * including those belonging to other BSS. @@ -6409,7 +6377,7 @@ /* Lookup the new node if any (this grabs a reference to it). */ ni = ieee80211_find_rxnode(vap->iv_ic, - (const struct ieee80211_frame_min *)skb->data); + (const struct ieee80211_frame_min *)skb->data); if (ni == NULL) { DPRINTF(sc, ATH_DEBUG_BEACON, "Dropping; node unknown.\n"); return 0; @@ -6420,8 +6388,8 @@ /* Update beacon RSSI statistics, (apply to "pure" STA only) * AND only for our AP's beacons */ if (vap->iv_opmode == IEEE80211_M_STA && - sc->sc_ic.ic_opmode == IEEE80211_M_STA && - ni == vap->iv_bss) + sc->sc_ic.ic_opmode == IEEE80211_M_STA && + ni == vap->iv_bss) ATH_RSSI_LPF(sc->sc_halstats.ns_avgbrssi, rssi); if ((sc->sc_syncbeacon || (vap->iv_flags_ext & IEEE80211_FEXT_APPIE_UPDATE)) && @@ -6496,12 +6464,12 @@ { struct ath_hal *ah = sc->sc_ah; - /* XXX block beacon interrupts */ + /* XXX: block beacon interrupts */ ath_hal_setdefantenna(ah, antenna); - if (sc->sc_defant != antenna) + if (sc->sc_rxantenna != antenna) sc->sc_stats.ast_ant_defswitch++; - sc->sc_defant = antenna; - sc->sc_rxotherant = 0; + sc->sc_rxantenna = antenna; + sc->sc_numrxotherant = 0; } static void @@ -6638,7 +6606,8 @@ skb_put(skb, len); skb->protocol = __constant_htons(ETH_P_CONTROL); - ath_capture(dev, bf, skb, bf->bf_tsf, 0 /* RX */); + ath_skb_removepad(ic, skb); + ieee80211_input_monitor(ic, skb, bf, 0 /* RX */, bf->bf_tsf, sc); /* Finished monitor mode handling, now reject error frames * before passing to other VAPs. Ignore MIC failures here, as @@ -6681,8 +6650,8 @@ /* Normal receive. */ if (IFF_DUMPPKTS(sc, ATH_DEBUG_RECV)) ieee80211_dump_pkt(ic, skb->data, skb->len, - sc->sc_hwmap[rs->rs_rate].ieeerate, - rs->rs_rssi); + sc->sc_hwmap[rs->rs_rate].ieeerate, + rs->rs_rssi, 0); { struct ieee80211_frame *wh = @@ -6746,15 +6715,16 @@ } skb = NULL; /* SKB is no longer ours. */ + /* XXX: Why do this? */ if (sc->sc_diversity) { - /* When using hardware fast diversity, change the default RX - * antenna if RX diversity chooses the other antenna 3 - * times in a row. */ - if (sc->sc_defant != rs->rs_antenna) { - if (++sc->sc_rxotherant >= 3) + /* When using hardware fast diversity, change the + * default RX antenna if RX diversity chooses the + * other antenna 3 times in a row. */ + if (sc->sc_rxantenna != rs->rs_antenna) { + if (++sc->sc_numrxotherant >= 3) ath_setdefantenna(sc, rs->rs_antenna); } else - sc->sc_rxotherant = 0; + sc->sc_numrxotherant = 0; } if (sc->sc_softled) { @@ -6791,7 +6761,7 @@ if (!bf_processed) DPRINTF(sc, ATH_DEBUG_RX_PROC, "Warning: %s got scheduled when no receive " - "buffers were ready. Were they cleared?\n", + "buffers were ready. Were they cleared?\n", __func__); DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: cycle completed. " " %d rx buf processed. %d were errors. %d skb accepted.\n", @@ -6843,8 +6813,8 @@ * use some fudge factor. */ interval = XR_DEFAULT_POLL_INTERVAL - - ((XR_DEFAULT_POLL_INTERVAL - XR_MIN_POLL_INTERVAL) * xrsta) / - (normalsta * XR_GRPPOLL_PERIOD_FACTOR); + ((XR_DEFAULT_POLL_INTERVAL - XR_MIN_POLL_INTERVAL) * xrsta) / + (normalsta * XR_GRPPOLL_PERIOD_FACTOR); if (interval < XR_MIN_POLL_INTERVAL) interval = XR_MIN_POLL_INTERVAL; @@ -6915,8 +6885,8 @@ if (qnum >= ARRAY_SIZE(sc->sc_txq)) { EPRINTF(sc, "HAL hardware queue number, %u, is out of range." " The highest queue number is %u!\n", - qnum, - (unsigned)ARRAY_SIZE(sc->sc_txq)); + qnum, + (unsigned)ARRAY_SIZE(sc->sc_txq)); ath_hal_releasetxqueue(ah, qnum); return; } @@ -7220,8 +7190,8 @@ #ifdef ATH_SUPERG_COMP /* allocate compression scratch buffer for data queues */ - if (((qtype == HAL_TX_QUEUE_DATA)|| (qtype == HAL_TX_QUEUE_UAPSD)) - && ath_hal_compressionsupported(ah)) { + if (((qtype == HAL_TX_QUEUE_DATA)|| (qtype == HAL_TX_QUEUE_UAPSD)) && + ath_hal_compressionsupported(ah)) { compbufsz = roundup(HAL_COMP_BUF_MAX_SIZE, HAL_COMP_BUF_ALIGN_SIZE) + HAL_COMP_BUF_ALIGN_SIZE; compbuf = (char *)bus_alloc_consistent(sc->sc_bdev, @@ -7269,8 +7239,8 @@ if (qnum >= ARRAY_SIZE(sc->sc_txq)) { EPRINTF(sc, "HAL hardware queue number, %u, is out of range." " The highest queue number is %u!\n", - qnum, - (unsigned)ARRAY_SIZE(sc->sc_txq)); + qnum, + (unsigned)ARRAY_SIZE(sc->sc_txq)); #ifdef ATH_SUPERG_COMP if (compbuf) { bus_free_consistent(sc->sc_bdev, compbufsz, @@ -7314,8 +7284,8 @@ if (ac >= ARRAY_SIZE(sc->sc_ac2q)) { EPRINTF(sc, "AC, %u, is out of range. " - "The maximum AC is %u!\n", - ac, (unsigned)ARRAY_SIZE(sc->sc_ac2q)); + "The maximum AC is %u!\n", + ac, (unsigned)ARRAY_SIZE(sc->sc_ac2q)); return 0; } txq = ath_txq_setup(sc, HAL_TX_QUEUE_DATA, haltype); @@ -7370,9 +7340,9 @@ ath_txq_update(sc, sc->sc_uapsdq, WME_AC_VO); return !ath_txq_update(sc, sc->sc_ac2q[WME_AC_BE], WME_AC_BE) || - !ath_txq_update(sc, sc->sc_ac2q[WME_AC_BK], WME_AC_BK) || - !ath_txq_update(sc, sc->sc_ac2q[WME_AC_VI], WME_AC_VI) || - !ath_txq_update(sc, sc->sc_ac2q[WME_AC_VO], WME_AC_VO) ? EIO : 0; + !ath_txq_update(sc, sc->sc_ac2q[WME_AC_BK], WME_AC_BK) || + !ath_txq_update(sc, sc->sc_ac2q[WME_AC_VI], WME_AC_VI) || + !ath_txq_update(sc, sc->sc_ac2q[WME_AC_VO], WME_AC_VO) ? EIO : 0; } /* @@ -7971,7 +7941,7 @@ if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) /* FFXXX: need multi-skb version to dump entire FF */ ieee80211_dump_pkt(ic, skb->data, skb->len, - sc->sc_hwmap[txrate].ieeerate, -1); + sc->sc_hwmap[txrate].ieeerate, -1, 1); /* * Determine if a tx interrupt should be generated for @@ -8006,12 +7976,10 @@ } #endif - /* - * sc_txantenna == 0 means transmit diversity mode. + /* sc_txantenna == 0 means transmit diversity mode. * sc_txantenna == 1 or sc_txantenna == 2 means the user has selected * the first or second antenna port. - * If the user has set the txantenna, use it for multicast frames too. - */ + * If the user has set the txantenna, use it for multicast frames too. */ if (ismcast && !sc->sc_txantenna) { antenna = sc->sc_mcastantenna + 1; sc->sc_mcastantenna = (sc->sc_mcastantenna + 1) & 0x1; @@ -8033,9 +8001,7 @@ try0, keyix, antenna, flags, ctsrate, ctsduration, icvlen, ivlen, comp); - /* - * Formulate first tx descriptor with tx controls. - */ + /* Formulate first tx descriptor with tx controls. */ /* XXX check return value? */ ath_hal_setuptxdesc(ah, ds, pktlen, /* packet length */ @@ -8098,8 +8064,10 @@ ath_desc_swap(ds); DPRINTF(sc, ATH_DEBUG_XMIT, "Q%d: %08x %08x %08x %08x %08x %08x\n", - M_FLAG_GET(skb, M_UAPSD) ? 0 : txq->axq_qnum, ds->ds_link, ds->ds_data, - ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1]); + M_FLAG_GET(skb, M_UAPSD) ? 0 : txq->axq_qnum, + ds->ds_link, ds->ds_data, + ds->ds_ctl0, ds->ds_ctl1, + ds->ds_hw[0], ds->ds_hw[1]); #else /* ATH_SUPERG_FF */ { struct sk_buff *tskb; @@ -8319,10 +8287,10 @@ DPRINTF(sc, ATH_DEBUG_TX_PROC, "Updating frame's sequence number " "from %d to %d\n", - ((le16toh(*(__le16 *)&wh->i_seq[0]) & + ((le16toh(*(__le16 *)&wh->i_seq[0]) & IEEE80211_SEQ_SEQ_MASK)) >> IEEE80211_SEQ_SEQ_SHIFT, - ts->ts_seqnum); + ts->ts_seqnum); *(__le16 *)&wh->i_seq[0] = htole16( ts->ts_seqnum << IEEE80211_SEQ_SEQ_SHIFT | @@ -8350,22 +8318,26 @@ unsigned int i; #endif - /* ath_capture modifies skb data; must be last process - * in TX path. */ - tskb = skb->next; + /* HW is now finished with the SKB, so it is safe to + * remove padding. */ + ath_skb_removepad(&sc->sc_ic, skb); DPRINTF(sc, ATH_DEBUG_TX_PROC, "capture skb %p\n", bf->bf_skb); - ath_capture(sc->sc_dev, bf, skb, bf->bf_tsf, 1 /* TX */); + tskb = skb->next; + ieee80211_input_monitor(&sc->sc_ic, skb, bf, + 1 /* TX */, bf->bf_tsf, sc); skb = tskb; #ifdef ATH_SUPERG_FF /* Handle every skb after the first one - these are FF * extra buffers */ for (i = 0; i < bf->bf_numdescff; i++) { - tskb = skb->next; + ath_skb_removepad(&sc->sc_ic, skb); /* XXX: padding for FF? */ DPRINTF(sc, ATH_DEBUG_TX_PROC, "capture skb %p\n", skb); - ath_capture(sc->sc_dev, bf, skb, bf->bf_tsf, 1 /* TX */); + tskb = skb->next; + ieee80211_input_monitor(&sc->sc_ic, skb, bf, + 1 /* TX */, bf->bf_tsf, sc); skb = tskb; } bf->bf_numdescff = 0; @@ -8429,8 +8401,8 @@ ath_tx_processq(sc, &sc->sc_txq[2]); if (txqactive(sc->sc_ah, 3)) ath_tx_processq(sc, &sc->sc_txq[3]); - if (ATH_TXQ_SETUP(sc, sc->sc_cabq->axq_qnum) - && STAILQ_FIRST(&sc->sc_cabq->axq_q)) { + if (ATH_TXQ_SETUP(sc, sc->sc_cabq->axq_qnum) && + STAILQ_FIRST(&sc->sc_cabq->axq_q)) { DPRINTF(sc, ATH_DEBUG_BEACON, "Processing CABQ... it is active in HAL.\n"); ath_tx_processq(sc, sc->sc_cabq); @@ -8467,7 +8439,7 @@ * sc_uapsdq */ for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { if (ATH_TXQ_SETUP(sc, i) && (txqactive(sc->sc_ah, i) || - (sc->sc_cabq->axq_qnum == i))) { + (sc->sc_cabq->axq_qnum == i))) { if (sc->sc_cabq->axq_qnum == i) DPRINTF(sc, ATH_DEBUG_BEACON, "Processing CABQ... it is setup and active in HAL.\n"); @@ -8499,8 +8471,10 @@ sc->sc_invalid ? "in" : ""); for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { - ath_txq_check(sc, &sc->sc_txq[i], __func__); - ath_txq_dump(sc, &sc->sc_txq[i]); + if (ATH_TXQ_SETUP(sc, i)) { + ath_txq_check(sc, &sc->sc_txq[i], __func__); + ath_txq_dump(sc, &sc->sc_txq[i]); + } } if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { @@ -8934,7 +8908,7 @@ } /* Update calibration interval based on whether I gain and Q - * gain adjustments completed.*/ + * gain adjustments completed. */ sc->sc_calinterval_sec = (isIQdone == AH_TRUE) ? ATH_LONG_CALINTERVAL_SECS : ATH_SHORT_CALINTERVAL_SECS; @@ -9669,7 +9643,7 @@ if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { KASSERT(ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE, ("new node with a ucast key already setup (keyix %u)", - ni->ni_ucastkey.wk_keyix)); + ni->ni_ucastkey.wk_keyix)); /* NB: 5210 has no passthru/clr key support */ if (sc->sc_hasclrkey) ath_setup_stationkey(ni); @@ -10061,7 +10035,7 @@ if (rt->rateCount > IEEE80211_RATE_MAXSIZE) { DPRINTF(sc, ATH_DEBUG_ANY, "The rate table is too small (%u > %u)\n", - rt->rateCount, IEEE80211_RATE_MAXSIZE); + rt->rateCount, IEEE80211_RATE_MAXSIZE); maxrates = IEEE80211_RATE_MAXSIZE; } else maxrates = rt->rateCount; @@ -10077,7 +10051,7 @@ if (rt->rateCount > IEEE80211_RATE_MAXSIZE) { DPRINTF(sc, ATH_DEBUG_ANY, "The rate table is too small (%u > %u)\n", - rt->rateCount, IEEE80211_RATE_MAXSIZE); + rt->rateCount, IEEE80211_RATE_MAXSIZE); maxrates = IEEE80211_RATE_MAXSIZE; } else maxrates = rt->rateCount; @@ -10260,10 +10234,10 @@ if (!(ic->ic_ath_cap & an->an_node.ni_ath_flags & IEEE80211_ATHC_FF)) return AH_FALSE; if (!(ic->ic_opmode == IEEE80211_M_STA || - ic->ic_opmode == IEEE80211_M_HOSTAP)) + ic->ic_opmode == IEEE80211_M_HOSTAP)) return AH_FALSE; if ((ic->ic_opmode == IEEE80211_M_HOSTAP) && - ETHER_IS_MULTICAST(eh->ether_dhost)) + ETHER_IS_MULTICAST(eh->ether_dhost)) return AH_FALSE; #ifdef ATH_SUPERG_XR @@ -10301,19 +10275,19 @@ const struct ath_desc *ds = bf->bf_desc; u_int8_t status = done ? rs->rs_status : 0; printk("R (%p %08llx) %08x %08x %08x %08x %08x %08x%s%s%s%s%s%s%s%s%s\n", - ds, (u_int64_t)bf->bf_daddr, - ds->ds_link, ds->ds_data, - ds->ds_ctl0, ds->ds_ctl1, - ds->ds_hw[0], ds->ds_hw[1], - status ? "" : " OK", - status & HAL_RXERR_CRC ? " ERR_CRC" : "", - status & HAL_RXERR_PHY ? " ERR_PHY" : "", - status & HAL_RXERR_FIFO ? " ERR_FIFO" : "", - status & HAL_RXERR_DECRYPT ? " ERR_DECRYPT" : "", - status & HAL_RXERR_MIC ? " ERR_MIC" : "", - status & 0x20 ? " (1<<5)" : "", - status & 0x40 ? " (1<<6)" : "", - status & 0x80 ? " (1<<7)" : ""); + ds, (u_int64_t)bf->bf_daddr, + ds->ds_link, ds->ds_data, + ds->ds_ctl0, ds->ds_ctl1, + ds->ds_hw[0], ds->ds_hw[1], + status ? "" : " OK", + status & HAL_RXERR_CRC ? " ERR_CRC" : "", + status & HAL_RXERR_PHY ? " ERR_PHY" : "", + status & HAL_RXERR_FIFO ? " ERR_FIFO" : "", + status & HAL_RXERR_DECRYPT ? " ERR_DECRYPT" : "", + status & HAL_RXERR_MIC ? " ERR_MIC" : "", + status & 0x20 ? " (1<<5)" : "", + status & 0x40 ? " (1<<6)" : "", + status & 0x80 ? " (1<<7)" : ""); } static void @@ -10325,20 +10299,20 @@ u_int8_t status = done ? ts->ts_status : 0; DPRINTF(sc, ATH_DEBUG_ANY, - "T (%p %08llx) %08x %08x %08x %08x %08x %08x %08x %08x%s%s%s%s%s%s%s%s%s\n", - ds, (u_int64_t)bf->bf_daddr, - ds->ds_link, ds->ds_data, - ds->ds_ctl0, ds->ds_ctl1, - ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3], - status ? "" : " OK", - status & HAL_TXERR_XRETRY ? " ERR_XRETRY" : "", - status & HAL_TXERR_FILT ? " ERR_FILT" : "", - status & HAL_TXERR_FIFO ? " ERR_FIFO" : "", - status & HAL_TXERR_XTXOP ? " ERR_XTXOP" : "", - status & HAL_TXERR_DESC_CFG_ERR ? " ERR_DESC_CFG_ERR" : "", - status & HAL_TXERR_DATA_UNDERRUN ? " ERR_DATA_UNDERRUN" : "", - status & HAL_TXERR_DELIM_UNDERRUN ? " ERR_DELIM_UNDERRUN" : "", - status & 0x80 ? " (1<<7)" : ""); + "T (%p %08llx) %08x %08x %08x %08x %08x %08x %08x %08x%s%s%s%s%s%s%s%s%s\n", + ds, (u_int64_t)bf->bf_daddr, + ds->ds_link, ds->ds_data, + ds->ds_ctl0, ds->ds_ctl1, + ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3], + status ? "" : " OK", + status & HAL_TXERR_XRETRY ? " ERR_XRETRY" : "", + status & HAL_TXERR_FILT ? " ERR_FILT" : "", + status & HAL_TXERR_FIFO ? " ERR_FIFO" : "", + status & HAL_TXERR_XTXOP ? " ERR_XTXOP" : "", + status & HAL_TXERR_DESC_CFG_ERR ? " ERR_DESC_CFG_ERR" : "", + status & HAL_TXERR_DATA_UNDERRUN ? " ERR_DATA_UNDERRUN" : "", + status & HAL_TXERR_DELIM_UNDERRUN ? " ERR_DELIM_UNDERRUN" : "", + status & 0x80 ? " (1<<7)" : ""); } #endif /* AR_DEBUG */ @@ -10793,7 +10767,7 @@ } /* Don't enable diversity if XR is enabled */ if (((!sc->sc_hasdiversity) || - (sc->sc_xrtxq != NULL)) && + (sc->sc_xrtxq != NULL)) && val) { ret = -EINVAL; break; @@ -10969,7 +10943,7 @@ case ATH_INTMIT: val = sc->sc_useintmit; break; - default: + default: ret = -EINVAL; break; } @@ -11213,13 +11187,6 @@ kfree(sc->sc_sysctls); sc->sc_sysctls = NULL; } - - /* initialize values */ - ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL); - sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL); - sc->sc_default_ieee80211_debug = ieee80211_debug; - sc->sc_txantenna = 0; /* default to auto-selection */ - sc->sc_txintrperiod = ATH_TXQ_INTR_PERIOD; } static void @@ -11389,7 +11356,7 @@ unregister_sysctl_table(ath_sysctl_header); } -static const char* +static const char * ath_get_hal_status_desc(HAL_STATUS status) { if ((status > 0) && (status < (sizeof(hal_status_desc) / @@ -11490,7 +11457,8 @@ vap->iv_ath_cap &= ~IEEE80211_ATHC_COMP; vap->iv_des_ssid[0].len = 0; vap->iv_des_nssid = 1; - sc->sc_txantenna = sc->sc_defant = sc->sc_mcastantenna = sc->sc_rxotherant = 1; + sc->sc_txantenna = sc->sc_rxantenna = sc->sc_mcastantenna = 1; + sc->sc_numrxotherant = 0; sc->sc_diversity = 0; memset(vap->iv_des_ssid[0].ssid, 0, IEEE80211_ADDR_LEN); ath_hal_setdiversity(sc->sc_ah, 0); @@ -11606,8 +11574,8 @@ #define AR5K_AR5212_DCU_MISC_POST_FR_BKOFF_DIS 0x00200000 #define AR5K_AR5212_DCU_CHAN_TIME_DUR 0x000fffff #define AR5K_AR5212_DCU_CHAN_TIME_ENABLE 0x00100000 -#define AR5K_AR5212_QCU(_n, _a) (((_n) << 2) + _a) -#define AR5K_AR5212_DCU(_n, _a) AR5K_AR5212_QCU(_n, _a) +#define AR5K_AR5212_QCU(_n, _a) (((_n) << 2) + _a) +#define AR5K_AR5212_DCU(_n, _a) AR5K_AR5212_QCU(_n, _a) #define AR5K_AR5212_DCU_MISC(_n) AR5K_AR5212_DCU(_n, 0x1100) #define AR5K_AR5212_DCU_CHAN_TIME(_n) AR5K_AR5212_DCU(_n, 0x10c0) /* NB: This section of direct hardware access contains @@ -11646,11 +11614,11 @@ AR5K_AR5212_DCU_GBL_IFS_SLOT) & ~AR5K_AR5212_DCU_GBL_IFS_SLOT_M) | 1); OS_REG_WRITE(ah, AR5K_AR5212_DCU_GBL_IFS_MISC, - OS_REG_READ(ah, AR5K_AR5212_DCU_GBL_IFS_MISC) & - ~AR5K_AR5212_DCU_GBL_IFS_MISC_SIFS_DUR_USEC & - ~AR5K_AR5212_DCU_GBL_IFS_MISC_USEC_DUR & - ~AR5K_AR5212_DCU_GBL_IFS_MISC_DCU_ARB_DELAY & - ~AR5K_AR5212_DCU_GBL_IFS_MISC_LFSR_SLICE); + OS_REG_READ(ah, AR5K_AR5212_DCU_GBL_IFS_MISC) & + ~AR5K_AR5212_DCU_GBL_IFS_MISC_SIFS_DUR_USEC & + ~AR5K_AR5212_DCU_GBL_IFS_MISC_USEC_DUR & + ~AR5K_AR5212_DCU_GBL_IFS_MISC_DCU_ARB_DELAY & + ~AR5K_AR5212_DCU_GBL_IFS_MISC_LFSR_SLICE); /* Disable queue backoff (default was like 256 or 0x100) */ for (q = 0; q < 4; q++) { @@ -11708,7 +11676,7 @@ /* Queue a self-looped packet for the specified hardware queue. */ static void -txcont_queue_packet(struct ieee80211com *ic, struct ath_txq* txq) +txcont_queue_packet(struct ieee80211com *ic, struct ath_txq *txq) { struct net_device *dev = ic->ic_dev; struct ath_softc *sc = dev->priv; @@ -11718,7 +11686,7 @@ unsigned int i; /* maximum supported size, subtracting headers and required slack */ unsigned int datasz = 4028; - struct ieee80211_frame* wh = NULL; + struct ieee80211_frame *wh = NULL; unsigned char *data = NULL; unsigned char *crc = NULL; @@ -11738,7 +11706,7 @@ EPRINTF(sc, "alloc_skb(...) returned null!\n"); BUG(); } - wh = (struct ieee80211_frame*)skb_put(skb, + wh = (struct ieee80211_frame *)skb_put(skb, sizeof(struct ieee80211_frame)); if (NULL == bf) { EPRINTF(sc, "ath_take_txbuf(sc) returned null!\n"); @@ -11799,42 +11767,42 @@ ath_hal_settxpowlimit(ah, sc->sc_txcont_power/2); ath_hal_settpc(ah, 0); ath_hal_setuptxdesc(ah, - bf->bf_desc, /* the descriptor */ - skb->len, /* packet length */ - sizeof(struct ieee80211_frame), /* header length */ - HAL_PKT_TYPE_NORMAL, /* Atheros packet type */ - sc->sc_txcont_power, /* txpower in 0.5dBm + bf->bf_desc, /* the descriptor */ + skb->len, /* packet length */ + sizeof(struct ieee80211_frame), /* header length */ + HAL_PKT_TYPE_NORMAL, /* Atheros packet type */ + sc->sc_txcont_power, /* txpower in 0.5dBm * increments, range 0-n * depending upon card * typically 60-100 max */ - ath_get_txcont_adj_ratecode(sc), /* series 0 rate */ - 0, /* series 0 retries */ - HAL_TXKEYIX_INVALID, /* key cache index */ - sc->sc_txantenna, /* antenna mode */ - bf->bf_flags, /* flags */ - 0, /* rts/cts rate */ - 0, /* rts/cts duration */ - 0, /* comp icv len */ - 0, /* comp iv len */ - ATH_COMP_PROC_NO_COMP_NO_CCS /* comp scheme */ - ); + ath_get_txcont_adj_ratecode(sc),/* series 0 rate */ + 0, /* series 0 retries */ + HAL_TXKEYIX_INVALID, /* key cache index */ + sc->sc_txantenna, /* antenna mode */ + bf->bf_flags, /* flags */ + 0, /* rts/cts rate */ + 0, /* rts/cts duration */ + 0, /* comp icv len */ + 0, /* comp iv len */ + ATH_COMP_PROC_NO_COMP_NO_CCS /* comp scheme */ + ); ath_hal_filltxdesc(ah, - bf->bf_desc, /* Descriptor to fill */ - skb->len, /* buffer length */ - AH_TRUE, /* is first segment */ - AH_TRUE, /* is last segment */ - bf->bf_desc /* first descriptor */ - ); + bf->bf_desc, /* Descriptor to fill */ + skb->len, /* buffer length */ + AH_TRUE, /* is first segment */ + AH_TRUE, /* is last segment */ + bf->bf_desc /* first descriptor */ + ); /* Byteswap (as necessary) */ ath_desc_swap(bf->bf_desc); /* queue the self-linked frame */ ath_tx_txqaddbuf(sc, NULL, /* node */ - txq, /* hardware queue */ - bf, /* atheros buffer */ - bf->bf_skb->len /* frame length */ - ); + txq, /* hardware queue */ + bf, /* atheros buffer */ + bf->bf_skb->len /* frame length */ + ); ath_hal_txstart(ah, txq->axq_qnum); } ath_hal_intrset(ah, sc->sc_imask); @@ -12065,7 +12033,7 @@ * then we call this to stop the behavior before we take the rest of the * necessary actions (such as a DFS reaction to radar). */ static void -ath_interrupt_dfs_cac(struct ath_softc *sc, const char* reason) +ath_interrupt_dfs_cac(struct ath_softc *sc, const char *reason) { struct timeval tv; @@ -12097,9 +12065,9 @@ * implementing AP requested mute tests in station mode later. */ void -ath_radar_detected(struct ath_softc *sc, const char* cause) { - struct ath_hal* ah = sc->sc_ah; - struct ieee80211com* ic = &sc->sc_ic; +ath_radar_detected(struct ath_softc *sc, const char *cause) { + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_channel ichan; struct timeval tv; @@ -12232,8 +12200,8 @@ continue; value = ath_reg_read(sc, address); ath_hal_print_decoded_register(sc->sc_ah, SC_DEV_NAME(sc), - address, value, value, - AH_FALSE); + address, value, value, + AH_FALSE); } while ((address += 4) < MAX_REGISTER_ADDRESS); } #endif /* #ifdef ATH_REVERSE_ENGINEERING */ @@ -12252,10 +12220,10 @@ if (ath_regdump_filter(sc, address)) continue; value = ath_reg_read(sc, address); - p_old = (unsigned int*)&sc->register_snapshot[address]; + p_old = (unsigned int *)&sc->register_snapshot[address]; if (*p_old != value) { ath_hal_print_decoded_register(sc->sc_ah, SC_DEV_NAME(sc), - address, *p_old, value, AH_FALSE); + address, *p_old, value, AH_FALSE); } } while ((address += 4) < MAX_REGISTER_ADDRESS); } @@ -12271,7 +12239,7 @@ unsigned int address = MIN_REGISTER_ADDRESS; do { - *((unsigned int*)&sc->register_snapshot[address]) = + *((unsigned int *)&sc->register_snapshot[address]) = ath_regdump_filter(sc, address) ? 0x0 : ath_reg_read(sc, address); } while ((address += 4) < MAX_REGISTER_ADDRESS); @@ -12282,7 +12250,7 @@ #ifdef ATH_REVERSE_ENGINEERING static unsigned int ath_read_register(struct ieee80211com *ic, unsigned int address, - unsigned int* value) + unsigned int *value) { struct ath_softc *sc = ic->ic_dev->priv; if (address >= MAX_REGISTER_ADDRESS) { @@ -12375,7 +12343,7 @@ static void #ifdef IEEE80211_DEBUG_REFCNT ath_return_txbuf_locked_debug(struct ath_softc *sc, struct ath_buf **bf, - const char* func, int line) + const char *func, int line) #else ath_return_txbuf_locked(struct ath_softc *sc, struct ath_buf **bf) #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ @@ -12404,16 +12372,16 @@ (ath_get_buffers_available(sc) > ATH_TXBUF_MGT_RESERVED) && (!ath_chan_unavail(sc))) { DPRINTF(sc, ATH_DEBUG_TXBUF | ATH_DEBUG_RESET, - "Waking device queue with %d available buffers.\n", - ath_get_buffers_available(sc)); + "Waking device queue with %d available buffers.\n", + ath_get_buffers_available(sc)); netif_wake_queue(sc->sc_dev); } #if 0 else if (ath_chan_unavail(sc)) { DPRINTF(sc, (ATH_DEBUG_TXBUF | ATH_DEBUG_RESET | - ATH_DEBUG_DOTH), - "Not waking device queue. Channel " - "is not available.\n"); + ATH_DEBUG_DOTH), + "Not waking device queue. Channel " + "is not available.\n"); } #endif } @@ -12422,7 +12390,7 @@ static void #ifdef IEEE80211_DEBUG_REFCNT ath_return_txbuf_debug(struct ath_softc *sc, struct ath_buf **bf, - const char* func, int line) + const char *func, int line) #else ath_return_txbuf(struct ath_softc *sc, struct ath_buf **bf) #endif @@ -12440,7 +12408,7 @@ static void #ifdef IEEE80211_DEBUG_REFCNT ath_return_txbuf_list_debug(struct ath_softc *sc, ath_bufhead *bfhead, - const char* func, int line) + const char *func, int line) #else ath_return_txbuf_list(struct ath_softc *sc, ath_bufhead *bfhead) #endif @@ -12449,9 +12417,8 @@ return; ATH_TXBUF_LOCK_IRQ(sc); if (!STAILQ_EMPTY(bfhead)) { - struct ath_buf* tbf; - struct ath_buf* tempbf; - STAILQ_FOREACH_SAFE(tbf, bfhead, bf_list, tempbf) { + struct ath_buf *tbf, *nextbf; + STAILQ_FOREACH_SAFE(tbf, bfhead, bf_list, nextbf) { #ifdef IEEE80211_DEBUG_REFCNT ath_return_txbuf_locked_debug(sc, &tbf, func, line); #else @@ -12466,7 +12433,7 @@ static void #ifdef IEEE80211_DEBUG_REFCNT ath_return_txbuf_list_locked_debug(struct ath_softc *sc, ath_bufhead *bfhead, - const char* func, int line) + const char *func, int line) #else ath_return_txbuf_list_locked(struct ath_softc *sc, ath_bufhead *bfhead) #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ @@ -12476,9 +12443,8 @@ return; if (!STAILQ_EMPTY(bfhead)) { - struct ath_buf* tbf; - struct ath_buf* tempbf; - STAILQ_FOREACH_SAFE(tbf, bfhead, bf_list, tempbf) { + struct ath_buf *tbf, *nextbf; + STAILQ_FOREACH_SAFE(tbf, bfhead, bf_list, nextbf) { #ifdef IEEE80211_DEBUG_REFCNT ath_return_txbuf_locked_debug(sc, &tbf, func, line); #else @@ -12489,10 +12455,10 @@ STAILQ_INIT(bfhead); } -static struct ath_buf* +static struct ath_buf * #ifdef IEEE80211_DEBUG_REFCNT cleanup_ath_buf_debug(struct ath_softc *sc, struct ath_buf *bf, int direction, - const char* func, int line) + const char *func, int line) #else /* #ifdef IEEE80211_DEBUG_REFCNT */ cleanup_ath_buf(struct ath_softc *sc, struct ath_buf *bf, int direction) #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ @@ -12515,9 +12481,9 @@ #ifdef ATH_SUPERG_FF { unsigned int i = 0; - struct sk_buff* next_ffskb = NULL; + struct sk_buff *next_ffskb = NULL; /* Start with the second skb for FF */ - struct sk_buff* ffskb = bf->bf_skb ? + struct sk_buff *ffskb = bf->bf_skb ? bf->bf_skb->next : NULL; while (ffskb) { next_ffskb = ffskb->next; @@ -12555,20 +12521,20 @@ #define SCANTXBUF_NAMSIZ 64 static inline int -descdma_contains_buffer(struct ath_descdma* dd, struct ath_buf* bf) { +descdma_contains_buffer(struct ath_descdma *dd, struct ath_buf *bf) { return (bf >= (dd->dd_bufptr)) && bf < (dd->dd_bufptr + dd->dd_nbuf); } static inline int -descdma_index_of_buffer(struct ath_descdma* dd, struct ath_buf* bf) { +descdma_index_of_buffer(struct ath_descdma *dd, struct ath_buf *bf) { if (!descdma_contains_buffer(dd, bf)) return -1; return bf - dd->dd_bufptr; } -static inline struct ath_buf* -descdma_get_buffer(struct ath_descdma* dd, int index) +static inline struct ath_buf * +descdma_get_buffer(struct ath_descdma *dd, int index) { KASSERT((index >= 0 && index < dd->dd_nbuf), ("Invalid index, %d, requested for %s dma buffers.\n", index, dd->dd_name)); @@ -12576,7 +12542,7 @@ } static int ath_debug_iwpriv(struct ieee80211com *ic, - unsigned int param, unsigned int value) + unsigned int param, unsigned int value) { struct ath_softc *sc = ic->ic_dev->priv; switch (param) { @@ -12633,9 +12599,9 @@ } static void -ath_scanbufs_found_buf_locked(struct ath_softc *sc, struct ath_descdma* dd, - unsigned long* dd_bufs_found, struct ath_buf *tbf, - const char* context) +ath_scanbufs_found_buf_locked(struct ath_softc *sc, struct ath_descdma *dd, + unsigned long *dd_bufs_found, struct ath_buf *tbf, + const char *context) { int index = descdma_index_of_buffer(dd, tbf); if (-1 != index) { @@ -12657,9 +12623,9 @@ } static void -ath_scanbufs_in_buflist_locked(struct ath_softc *sc, struct ath_descdma* dd, - unsigned long* dd_bufs_found, ath_bufhead *bufs, - const char* context) +ath_scanbufs_in_buflist_locked(struct ath_softc *sc, struct ath_descdma *dd, + unsigned long *dd_bufs_found, ath_bufhead *bufs, + const char *context) { struct ath_buf *tbf; STAILQ_FOREACH(tbf, bufs, bf_list) { @@ -12669,9 +12635,9 @@ } static void -ath_scanbufs_in_txq_locked(struct ath_softc *sc, struct ath_descdma* dd, - unsigned long* dd_bufs_found, struct ath_txq* txq, - const char* context) +ath_scanbufs_in_txq_locked(struct ath_softc *sc, struct ath_descdma *dd, + unsigned long *dd_bufs_found, struct ath_txq *txq, + const char *context) { struct ath_buf *tbf; char sacontext[SCANTXBUF_NAMSIZ]; @@ -12689,8 +12655,8 @@ } static void -ath_scanbufs_in_vap_locked(struct ath_softc *sc, struct ath_descdma* dd, - unsigned long* dd_bufs_found, struct ath_vap *av) +ath_scanbufs_in_vap_locked(struct ath_softc *sc, struct ath_descdma *dd, + unsigned long *dd_bufs_found, struct ath_vap *av) { char context[SCANTXBUF_NAMSIZ]; if (av->av_bcbuf && dd == &sc->sc_bdma) { @@ -12725,8 +12691,8 @@ } static void -ath_scanbufs_in_all_vaps_locked(struct ath_softc *sc, struct ath_descdma* dd, - unsigned long* dd_bufs_found) +ath_scanbufs_in_all_vaps_locked(struct ath_softc *sc, struct ath_descdma *dd, + unsigned long *dd_bufs_found) { struct ieee80211vap *vap; TAILQ_FOREACH(vap, &sc->sc_ic.ic_vaps, iv_next) { @@ -12735,8 +12701,8 @@ } static void -ath_scanbufs_in_all_nodetable_locked(struct ath_softc *sc, struct ath_descdma* dd, - unsigned long* dd_bufs_found, +ath_scanbufs_in_all_nodetable_locked(struct ath_softc *sc, struct ath_descdma *dd, + unsigned long *dd_bufs_found, struct ieee80211_node_table *nt) { struct ieee80211_node *node = NULL; @@ -12752,7 +12718,7 @@ DEV_NAME(athnode->an_node.ni_vap->iv_dev), MAC_ADDR(athnode->an_node.ni_bssid)); ath_scanbufs_in_buflist_locked(sc, dd, dd_bufs_found, - &athnode->an_uapsd_q, context); + &athnode->an_uapsd_q, context); snprintf(context, sizeof(context), "node %p[" MAC_FMT " on %s[" MAC_FMT "]] uapsd_overflowq", @@ -12761,15 +12727,15 @@ DEV_NAME(athnode->an_node.ni_vap->iv_dev), MAC_ADDR(athnode->an_node.ni_bssid)); ath_scanbufs_in_buflist_locked(sc, dd, dd_bufs_found, - &athnode->an_uapsd_overflowq, + &athnode->an_uapsd_overflowq, context); } } static void ath_scanbufs_in_all_hwtxq_locked(struct ath_softc *sc, - struct ath_descdma* dd, - unsigned long* dd_bufs_found) + struct ath_descdma *dd, + unsigned long *dd_bufs_found) { int q = HAL_NUM_TX_QUEUES; char context[SCANTXBUF_NAMSIZ]; @@ -12782,8 +12748,8 @@ } static void ath_scanbufs_print_leaks(struct ath_softc *sc, - struct ath_descdma* dd, - unsigned long* dd_bufs_found) + struct ath_descdma *dd, + unsigned long *dd_bufs_found) { int index; struct ath_buf *lostbf; @@ -12812,13 +12778,13 @@ /* Set up a list of dma areas to scan for. Unfortunately the locks * are all external to this, so they were specified above with the * standard lock macros... */ - struct ath_descdma* descdma[] = { + struct ath_descdma *descdma[] = { &sc->sc_txdma, &sc->sc_rxdma, &sc->sc_bdma, &sc->sc_grppolldma }; - struct ath_descdma* dd; + struct ath_descdma *dd; unsigned long *dd_bufs_found; /* NB: Locking sequence is critical to avoid deadlocks !!! */ Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_ahb.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_ahb.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_ahb.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -74,7 +74,7 @@ if (((devid & AR5315_REV_MAJ_M) == AR5315_REV_MAJ) || ((devid & AR5315_REV_MAJ_M) == AR5317_REV_MAJ)) { u_int32_t reg; - u_int32_t *en = (u_int32_t *) AR5315_AHB_ARB_CTL; + u_int32_t *en = (u_int32_t *)AR5315_AHB_ARB_CTL; KASSERT(wlanNum == 0, ("invalid wlan # %d", wlanNum)); @@ -135,7 +135,7 @@ u_int32_t enable; if (((devid & AR5315_REV_MAJ_M) == AR5315_REV_MAJ) || ((devid & AR5315_REV_MAJ_M) == AR5317_REV_MAJ)) { - u_int32_t *en = (u_int32_t *) AR5315_AHB_ARB_CTL; + u_int32_t *en = (u_int32_t *)AR5315_AHB_ARB_CTL; KASSERT(wlanNum == 0, ("invalid wlan # %d", wlanNum)); @@ -229,7 +229,7 @@ goto bad3; } dev->mem_end = dev->mem_start + AR531X_WLANX_LEN; - sc->aps_sc.sc_iobase = (void __iomem *) dev->mem_start; + sc->aps_sc.sc_iobase = (void __iomem *)dev->mem_start; sc->aps_sc.sc_bdev = NULL; if (request_irq(dev->irq, ath_intr, IRQF_SHARED, dev->name, dev)) { @@ -264,7 +264,7 @@ u_int16_t devid; struct ar531x_config *config; - config = (struct ar531x_config *) pdev->dev.platform_data; + config = (struct ar531x_config *)pdev->dev.platform_data; devid = (long) config->tag; config->tag = NULL; @@ -274,7 +274,7 @@ static int ahb_wmac_remove(struct platform_device *pdev) { - exit_ath_wmac(pdev->id, (struct ar531x_config *) pdev->dev.platform_data); + exit_ath_wmac(pdev->id, (struct ar531x_config *)pdev->dev.platform_data); return 0; } Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_hal_extensions.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_hal_extensions.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_hal_extensions.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -125,10 +125,10 @@ #define DEFAULT_ENABLE_AR5K_PHY_WEAK_OFDM_11A 1 #define IS_CHAN_ANY(ah) \ - (((struct ieee80211com*)ah->ah_sc)->ic_bsschan == IEEE80211_CHAN_ANYC) + (((struct ieee80211com *)ah->ah_sc)->ic_bsschan == IEEE80211_CHAN_ANYC) #define IS_BG_OR_ANY(ah) \ - (IS_CHAN_ANY(ah) || (!(ieee80211_chan2mode(((struct ieee80211com*)ah->ah_sc)->ic_bsschan) & \ + (IS_CHAN_ANY(ah) || (!(ieee80211_chan2mode(((struct ieee80211com *)ah->ah_sc)->ic_bsschan) & \ (IEEE80211_MODE_11A | IEEE80211_MODE_TURBO_A)))) #define DEFAULT_ENABLE_AR5K_PHY_WEAK_OFDM (IS_BG_OR_ANY(ah) ? \ @@ -167,7 +167,7 @@ #define AR5K_STA_ID1_NO_KEYSRCH 0x00080000 /* No key search */ #define AR5K_STA_ID1_NO_PSPOLL 0x00100000 /* No power save polling [5210] */ #define AR5K_STA_ID1_PCF_5211 0x00100000 /* Enable PCF on [5211+] */ -#define AR5K_STA_ID1_PCF_5210 0x00200000 /* Enable PCF on [5210]*/ +#define AR5K_STA_ID1_PCF_5210 0x00200000 /* Enable PCF on [5210] */ #define AR5K_STA_ID1_PCF (ah->ah_version == AR5K_AR5210 ? \ AR5K_STA_ID1_PCF_5210 : AR5K_STA_ID1_PCF_5211) #define AR5K_STA_ID1_DEFAULT_ANTENNA 0x00200000 /* Use default antenna */ @@ -238,7 +238,7 @@ }; -int ath_set_ack_bitrate(struct ath_softc* sc, int); +int ath_set_ack_bitrate(struct ath_softc *sc, int); int ar_device(int devid); const char * ath5k_chip_name(enum ath5k_srev_type type, u_int16_t val); @@ -280,7 +280,7 @@ (value & (mask >> shift)); } -static inline void override_warning(struct ath_hal *ah, const char* name, +static inline void override_warning(struct ath_hal *ah, const char *name, u_int32_t reg, u_int32_t mask, u_int32_t shift, u_int32_t expected, int is_signed) { @@ -305,7 +305,7 @@ #endif } -static inline void verification_warning(struct ath_hal *ah, const char* name, +static inline void verification_warning(struct ath_hal *ah, const char *name, u_int32_t reg, u_int32_t mask, u_int32_t shift, u_int32_t expected, int is_signed) { Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_pci.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_pci.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_pci.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -210,7 +210,7 @@ SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - sc->aps_sc.sc_bdev = (void *) pdev; + sc->aps_sc.sc_bdev = (void *)pdev; pci_set_drvdata(pdev, dev); Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -363,7 +363,7 @@ #define MR_FAIL_MAX_PERIOD 5 #ifdef AR_DEBUG -static const char* get_match_result_desc(u_int32_t code) { +static const char *get_match_result_desc(u_int32_t code) { switch (code) { case MR_MATCH: return "MATCH"; @@ -534,7 +534,7 @@ struct ath_rp *last_pulse, u_int32_t *num_bursts, size_t bursts_buflen, - struct lp_burst* bursts) + struct lp_burst *bursts) { int i = 0; struct ath_rp *newer = NULL; @@ -566,7 +566,7 @@ tsf_delta -= tsf_adjustment; } - /* If we are in range for pulse, assume it is a pulse*/ + /* If we are in range for pulse, assume it is a pulse. */ if ((tsf_delta >= LP_MIN_PRI) && (tsf_delta <= LP_MAX_PRI)) { bursts[waveform_num_bursts].lpb_num_pulses++; bursts[waveform_num_bursts].lpb_min_possible_tsf = @@ -617,9 +617,9 @@ static HAL_BOOL rp_analyze_long_pulse( struct ath_softc *sc, struct ath_rp *last_pulse, - u_int32_t* bc, - u_int32_t* matched, u_int32_t* missed, - u_int32_t* noise, u_int32_t* pulses) + u_int32_t *bc, + u_int32_t *matched, u_int32_t *missed, + u_int32_t *noise, u_int32_t *pulses) { int i; int32_t found_radar = 0; @@ -824,7 +824,7 @@ * pulse, ie t0_min - PERIOD * BURST_MAX * * - on this timescale, we matched the number of hit/missed using T - - * PERIOD*n taking into account the 2% error margin (using + * PERIOD * n taking into account the 2% error margin (using * min_rep_int, max_rep_int) * * At the end, we have a number of pulse hit for each PRF @@ -1226,7 +1226,7 @@ #endif /* AR_DEBUG */ #ifdef ATH_RADAR_LONG_PULSE -static const char* get_longpulse_desc(int lp) { +static const char *get_longpulse_desc(int lp) { switch (lp) { case 8: return "FCC [5, 8 pulses]"; case 9: return "FCC [5, 9 pulses]"; @@ -1521,7 +1521,7 @@ static void ath_rp_tasklet(TQUEUE_ARG data) { - struct net_device *dev = (struct net_device *) data; + struct net_device *dev = (struct net_device *)data; struct ath_softc *sc = dev->priv; if (sc->sc_rp_analyse != NULL) Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -157,12 +157,12 @@ /* Returns true if radar detection is enabled. */ int ath_radar_is_enabled(struct ath_softc *sc); /* Read the radar pulse detection parameters. */ -void ath_radar_get_params(struct ath_softc *sc, RADAR_PARAM* rp); +void ath_radar_get_params(struct ath_softc *sc, RADAR_PARAM *rp); /* Update the radar pulse detection parameters. * If rp is NULL, defaults are used for all fields. * If any member of rp is set to RADAR_PARAM_USE_DEFAULT, the default * is used for that field. */ -void ath_radar_set_params(struct ath_softc *sc, RADAR_PARAM* rp); +void ath_radar_set_params(struct ath_softc *sc, RADAR_PARAM *rp); /* Update channel's DFS flags based upon whether DFS is reqired */ int ath_radar_correct_dfs_flags(struct ath_softc *sc, HAL_CHANNEL *hchan); /* Returns true if DFS is required for the regulatory domain, country and Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath/if_athvar.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_athvar.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath/if_athvar.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -86,8 +86,8 @@ #define flush_scheduled_work() flush_scheduled_tasks() #define ATH_INIT_WORK(t, f) do { \ memset((t), 0, sizeof(struct tq_struct)); \ - (t)->routine = (void (*)(void*)) (f); \ - (t)->data=(void *) (t); \ + (t)->routine = (void (*)(void *)) (f); \ + (t)->data = (void *)(t); \ } while (0) #else #include <linux/workqueue.h> @@ -146,7 +146,7 @@ } if (sizeof_priv) - dev->priv = (void *) (((long)(dev + 1) + 31) & ~31); + dev->priv = (void *)(((long)(dev + 1) + 31) & ~31); setup(dev); strcpy(dev->name, mask); @@ -440,7 +440,7 @@ struct ath_desc_status bf_dsstatus; /* tx/rx descriptor status */ dma_addr_t bf_daddr; /* physical addr of desc */ struct sk_buff *bf_skb; /* skbuff for buf */ - dma_addr_t bf_skbaddr; /* physical addr of skb data - always used by one desc*/ + dma_addr_t bf_skbaddr; /* physical addr of skb data - always used by one desc */ u_int32_t bf_status; /* status flags */ u_int16_t bf_flags; /* tx descriptor flags */ u_int64_t bf_tsf; @@ -454,7 +454,7 @@ dma_addr_t bf_skbaddrff[ATH_TXDESC - 1]; /* extra addrs for FF */ #endif int bf_taken_at_line; /* XXX: Want full alloc backtrace */ - const char* bf_taken_at_func; + const char *bf_taken_at_func; }; /* The last descriptor for a buffer. @@ -649,8 +649,8 @@ int (*sc_recv_mgmt)(struct ieee80211vap *, struct ieee80211_node *, struct sk_buff *, int, int, u_int64_t); #ifdef IEEE80211_DEBUG_REFCNT - void (*sc_node_cleanup_debug)(struct ieee80211_node *, const char* func, int line); - void (*sc_node_free_debug)(struct ieee80211_node *, const char* func, int line); + void (*sc_node_cleanup_debug)(struct ieee80211_node *, const char *func, int line); + void (*sc_node_free_debug)(struct ieee80211_node *, const char *func, int line); #else /* #ifdef IEEE80211_DEBUG_REFCNT */ void (*sc_node_cleanup)(struct ieee80211_node *); void (*sc_node_free)(struct ieee80211_node *); @@ -726,6 +726,8 @@ u_int8_t sc_protrix; /* protection rate index */ u_int8_t sc_mcastantenna; /* Multicast antenna number */ u_int8_t sc_txantenna; /* data tx antenna (fixed or auto) */ + u_int8_t sc_rxantenna; /* current default antenna */ + u_int8_t sc_numrxotherant; /* RXs on non-default antenna */ u_int16_t sc_nvaps; /* # of active virtual APs */ u_int8_t sc_nstavaps; /* # of active station VAPs */ u_int8_t sc_nmonvaps; /* # of monitor VAPs */ @@ -756,8 +758,6 @@ spinlock_t sc_rxbuflock; struct ATH_TQ_STRUCT sc_rxtq; /* rx intr tasklet */ struct ATH_TQ_STRUCT sc_rxorntq; /* rxorn intr tasklet */ - u_int8_t sc_defant; /* current default antenna */ - u_int8_t sc_rxotherant; /* RXs on non-default antenna */ u_int16_t sc_cachelsz; /* cache line size */ struct ath_descdma sc_txdma; /* TX descriptors */ @@ -1018,6 +1018,6 @@ "MadWifi" : \ DEV_NAME(_v->iv_ic->ic_dev)) -void ath_radar_detected(struct ath_softc *sc, const char* message); +void ath_radar_detected(struct ath_softc *sc, const char *message); #endif /* _DEV_ATH_ATHVAR_H */ Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/Makefile =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/Makefile 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/Makefile 2008-06-12 17:44:56 UTC (rev 3722) @@ -85,8 +85,8 @@ else $(call if_changed,uudecode) endif - # Replace as many hashed names as possible with meaningful - # ones in the symbol table of the binary kernel module for HAL. +# Replace as many hashed names as possible with meaningful +# ones in the symbol table of the binary kernel module for HAL. $(filter-out -O binary -S,$(OBJCOPY)) \ `cat $(TOP)/scripts/hal_unmangle.objcopy` \ $(obj)/$(TARGET).hal.o Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -117,7 +117,7 @@ #ifdef AH_ASSERT void __ahdecl -ath_hal_assert_failed(const char* filename, int lineno, const char *msg) +ath_hal_assert_failed(const char *filename, int lineno, const char *msg) { printk(KERN_ERR "Atheros HAL assertion failure: %s: line %u: %s\n", filename, lineno, msg); @@ -152,7 +152,7 @@ static struct alq *ath_hal_alq = NULL; static u_int ath_hal_alq_lost; /* count of lost records */ static const char *ath_hal_logfile = "/var/log/ath_hal.log"; -static u_int ath_hal_alq_qsize = 8*1024; +static u_int ath_hal_alq_qsize = 8 * 1024; static int @@ -209,7 +209,7 @@ } static inline void -ath_hal_logvprintf(struct ath_hal *ah, const char* fmt, va_list ap) +ath_hal_logvprintf(struct ath_hal *ah, const char *fmt, va_list ap) { struct ale *ale; if (!ath_hal_alq) { @@ -241,7 +241,7 @@ #endif /* AH_DEBUG_ALQ */ static inline void -_hal_vprintf(struct ath_hal *ah, HAL_BOOL prefer_alq, const char* fmt, va_list ap) +_hal_vprintf(struct ath_hal *ah, HAL_BOOL prefer_alq, const char *fmt, va_list ap) { char buf[MSG_MAXLEN]; #ifdef AH_DEBUG_ALQ @@ -255,7 +255,7 @@ } void __ahdecl -ath_hal_printf(struct ath_hal *ah, HAL_BOOL prefer_alq, const char* fmt, ...) +ath_hal_printf(struct ath_hal *ah, HAL_BOOL prefer_alq, const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -268,9 +268,9 @@ * for). Names were taken from openhal ar5212regs.h. Return AH_TRUE if the * name is a known ar5212 register, and AH_FALSE otherwise. */ HAL_BOOL -ath_hal_lookup_register_name(struct ath_hal *ah, char* buf, int buflen, +ath_hal_lookup_register_name(struct ath_hal *ah, char *buf, int buflen, u_int32_t address) { - const char* static_label = NULL; + const char *static_label = NULL; memset(buf, 0, buflen); #if 0 /* Enable once for each new board/magic type */ printk("MAGIC: %x\n", ah->ah_magic); @@ -459,7 +459,7 @@ int key = ((address - 0x8800) / keytable_entry_size); int reg = ((address - 0x8800) % keytable_entry_size) / sizeof(u_int32_t); - char* format = NULL; + char *format = NULL; switch (reg) { case 0: format = "KEY(%3d).KEYBITS[031:000]"; break; case 1: format = "KEY(%3d).KEYBITS[047:032]"; break; @@ -572,7 +572,7 @@ EXPORT_SYMBOL(ath_hal_lookup_register_name); static void -_print_decoded_register_delta(struct ath_hal *ah, const char* device_name, +_print_decoded_register_delta(struct ath_hal *ah, const char *device_name, HAL_BOOL prefer_alq, int regop, u_int32_t address, u_int32_t v_old, u_int32_t v_new, HAL_BOOL verbose) @@ -655,7 +655,7 @@ * names) we can add it to this helper function and a subsequent line is * printed with the status in symbolic form. */ static void -_print_decoded_register_bitfields(struct ath_hal *ah, const char* device_name, +_print_decoded_register_bitfields(struct ath_hal *ah, const char *device_name, HAL_BOOL prefer_alq, int regop, u_int32_t address, u_int32_t old_v, u_int32_t v, HAL_BOOL verbose) @@ -824,7 +824,7 @@ /* Print out a single register name/address/value in hex and binary */ static inline void -_print_decoded_register(struct ath_hal *ah, const char* device_name, +_print_decoded_register(struct ath_hal *ah, const char *device_name, HAL_BOOL prefer_alq, int regop, u_int32_t address, u_int32_t oldval, u_int32_t newval, HAL_BOOL verbose) @@ -837,7 +837,7 @@ /* Print out a single register name/address/value in hex and binary */ static inline void -_print_undecoded_register(struct ath_hal *ah, const char* device_name, +_print_undecoded_register(struct ath_hal *ah, const char *device_name, HAL_BOOL prefer_alq, int regop, u_int32_t address, u_int32_t newval) { @@ -855,7 +855,7 @@ /* Print out a single register name/address/value in hex and binary */ void ath_hal_print_decoded_register(struct ath_hal *ah, - const char* device_name, + const char *device_name, u_int32_t address, u_int32_t oldval, u_int32_t newval, HAL_BOOL bitfields) { @@ -867,7 +867,7 @@ /* Print out a single register in simple undecoded form */ void ath_hal_print_register(struct ath_hal *ah, - const char* device_name, + const char *device_name, u_int32_t address, u_int32_t newval) { _print_undecoded_register(ah, device_name, AH_FALSE /* don't use alq */, @@ -956,7 +956,7 @@ } void __ahdecl -ath_hal_free(void* p) +ath_hal_free(void *p) { kfree(p); } Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -151,19 +151,27 @@ #endif /* AH_BYTE_ORDER */ /* - * Some big-endian architectures don't set CONFIG_GENERIC_IOMAP, but fail to - * implement iowrite32be and ioread32be. Provide compatibility macros when - * it's needed. + * The HAL programs big-endian platforms to use byte-swapped hardware registers. + * This is done to avoid the byte swapping needed to access PCI devices. * - * As of Linux 2.6.24, only MIPS, PARISC and PowerPC implement iowrite32be and - * ioread32be as functions. + * Many big-endian architectures provide I/O functions that avoid byte swapping. + * We use them when possible. Otherwise, we provide replacements. The downside + * or the replacements is that we may be byte-swapping data twice, so we try to + * avoid it. * - * The downside or the replacement macros it that we may be byte-swapping data - * for the second time, so the native implementations should be preferred. + * We use raw access for Linux prior to 2.6.12. For newer version, we need to + * use ioread32() and iowrite32(), which would take care of indirect access to + * the registers. */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)) && \ - !defined(CONFIG_GENERIC_IOMAP) && (AH_BYTE_ORDER == AH_BIG_ENDIAN) && \ - !defined(__mips__) && !defined(__hppa__) && !defined(__powerpc__) + (AH_BYTE_ORDER == AH_BIG_ENDIAN) && \ + !defined(CONFIG_GENERIC_IOMAP) && \ + !defined(CONFIG_PARICS) && \ + !(defined(CONFIG_PPC64) && \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))) && \ + !defined(CONFIG_PPC_MERGE) && \ + !(defined(CONFIG_MIPS) && \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21))) # ifndef iowrite32be # define iowrite32be(_val, _addr) iowrite32(swab32((_val)), (_addr)) # endif @@ -177,54 +185,53 @@ * debugging is enabled (AH_DEBUG) or it's explicitly requested for the target. * * The hardware registers use little-endian byte order natively. Big-endian - * systems are configured by HAL to enable hardware byte-swap of register reads - * and writes at reset. This avoid the need to byte-swap the data in software. - * However, the registers in a certain area from 0x4000 to 0x4fff (PCI clock - * domain registers) are not byte swapped! + * systems are configured by HAL to byte-swap of register reads and writes. + * However, the registers in the areas 0x4000-0x4fff and 0x7000-0x7fff are not + * byte swapped! * * Since Linux I/O primitives default to little-endian operations, we only * need to suppress byte-swapping on big-endian systems outside the area used * by the PCI clock domain registers. */ #if (AH_BYTE_ORDER == AH_BIG_ENDIAN) -#define is_reg_le(__reg) ((0x4000 <= (__reg) && (__reg) < 0x5000) || \ - (0x7000 <= (__reg) && (__reg) < 0x8000)) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12) -#define _OS_REG_WRITE(_ah, _reg, _val) do { \ +# define is_reg_le(__reg) ((0x4000 <= (__reg) && (__reg) < 0x5000) || \ + (0x7000 <= (__reg) && (__reg) < 0x8000)) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12) +# define _OS_REG_WRITE(_ah, _reg, _val) do { \ is_reg_le(_reg) ? \ - iowrite32((_val), (_ah)->ah_sh + (_reg)) : \ - iowrite32be((_val), (_ah)->ah_sh + (_reg)); \ + iowrite32((_val), (_ah)->ah_sh + (_reg)) : \ + iowrite32be((_val), (_ah)->ah_sh + (_reg)); \ } while (0) -#define _OS_REG_READ(_ah, _reg) \ +# define _OS_REG_READ(_ah, _reg) \ (is_reg_le(_reg) ? \ - ioread32((_ah)->ah_sh + (_reg)) : \ - ioread32be((_ah)->ah_sh + (_reg))) -#else -#define _OS_REG_WRITE(_ah, _reg, _val) do { \ - writel(is_reg_le(_reg) ? \ - (_val) : cpu_to_le32(_val), \ - (_ah)->ah_sh + (_reg)); \ + ioread32((_ah)->ah_sh + (_reg)) : \ + ioread32be((_ah)->ah_sh + (_reg))) +# else /* Linux < 2.6.12 */ +# define _OS_REG_WRITE(_ah, _reg, _val) do { \ + writel(is_reg_le(_reg) ? \ + (_val) : cpu_to_le32(_val), \ + (_ah)->ah_sh + (_reg)); \ } while (0) -#define _OS_REG_READ(_ah, _reg) \ +# define _OS_REG_READ(_ah, _reg) \ (is_reg_le(_reg) ? \ - readl((_ah)->ah_sh + (_reg)) : \ - cpu_to_le32(readl((_ah)->ah_sh + (_reg)))) -#endif /* KERNEL_VERSION(2,6,12) */ -#else /* AH_BYTE_ORDER != AH_BIG_ENDIAN */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12) -#define _OS_REG_WRITE(_ah, _reg, _val) do { \ + readl((_ah)->ah_sh + (_reg)) : \ + cpu_to_le32(readl((_ah)->ah_sh + (_reg)))) +# endif /* Linux < 2.6.12 */ +#else /* Little endian */ +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12) +# define _OS_REG_WRITE(_ah, _reg, _val) do { \ iowrite32((_val), (_ah)->ah_sh + (_reg)); \ } while (0) -#define _OS_REG_READ(_ah, _reg) \ +# define _OS_REG_READ(_ah, _reg) \ ioread32((_ah)->ah_sh + (_reg)) -#else -#define _OS_REG_WRITE(_ah, _reg, _val) do { \ +# else /* Linux < 2.6.12 */ +# define _OS_REG_WRITE(_ah, _reg, _val) do { \ writel((_val), (_ah)->ah_sh + (_reg)); \ } while (0) -#define _OS_REG_READ(_ah, _reg) \ +# define _OS_REG_READ(_ah, _reg) \ readl((_ah)->ah_sh + (_reg)) -#endif /* KERNEL_VERSION(2,6,12) */ -#endif /* AH_BYTE_ORDER != AH_BIG_ENDIAN */ +# endif /* Linux < 2.6.12 */ +#endif /* Little endian */ #define HAL_DEBUG_OFF 0 /* Show register accesses */ @@ -289,16 +296,16 @@ void ath_hal_print_decoded_register(struct ath_hal *ah, - const char* device_name, + const char *device_name, u_int32_t address, u_int32_t oldval, u_int32_t newval, HAL_BOOL bitfields); void ath_hal_print_register(struct ath_hal *ah, - const char* device_name, + const char *device_name, u_int32_t address, u_int32_t value); HAL_BOOL -ath_hal_lookup_register_name(struct ath_hal *ah, char* buf, int buflen, +ath_hal_lookup_register_name(struct ath_hal *ah, char *buf, int buflen, u_int32_t address); #endif /* _ATH_AH_OSDEP_H_ */ Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/amrr/amrr.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/amrr/amrr.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/amrr/amrr.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -317,7 +317,7 @@ { struct ieee80211com *ic = vap->iv_ic; struct ath_softc *sc = ic->ic_dev->priv; - struct amrr_softc *asc = (struct amrr_softc *) sc->sc_rc; + struct amrr_softc *asc = (struct amrr_softc *)sc->sc_rc; struct ieee80211_node *ni; if (state == IEEE80211_S_INIT) { @@ -473,7 +473,7 @@ static void ath_rate_detach(struct ath_ratectrl *arc) { - struct amrr_softc *asc = (struct amrr_softc *) arc; + struct amrr_softc *asc = (struct amrr_softc *)arc; del_timer(&asc->timer); kfree(asc); @@ -520,7 +520,7 @@ }; static ctl_table ath_rate_table[] = { { .ctl_name = CTL_AUTO, - .procname = "rate", + .procname = "rate_amrr", .mode = 0555, .child = ath_rate_static_sysctls }, { 0 } Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/minstrel/minstrel.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/minstrel/minstrel.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/minstrel/minstrel.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -770,7 +770,7 @@ static void ath_timer_function(unsigned long data) { - struct minstrel_softc *ssc = (struct minstrel_softc *) data; + struct minstrel_softc *ssc = (struct minstrel_softc *)data; struct ath_softc *sc = ssc->sc; struct ieee80211com *ic; struct net_device *dev = ssc->sc_dev; @@ -815,7 +815,7 @@ static void ath_rate_statistics(void *arg, struct ieee80211_node *ni) { - struct ath_node *an = (struct ath_node *) ni; + struct ath_node *an = (struct ath_node *)ni; struct ieee80211_rateset *rs = &ni->ni_rates; struct minstrel_node *rn = ATH_NODE_MINSTREL(an); unsigned int i; @@ -933,7 +933,7 @@ static void ath_rate_detach(struct ath_ratectrl *arc) { - struct minstrel_softc *osc = (struct minstrel_softc *) arc; + struct minstrel_softc *osc = (struct minstrel_softc *)arc; osc->close_timer_now = 1; del_timer(&osc->timer); kfree(osc); @@ -948,7 +948,7 @@ struct ieee80211_node *ni; struct minstrel_node *odst; struct ieee80211_node_table *nt = - (struct ieee80211_node_table *) &vap->iv_ic->ic_sta; + (struct ieee80211_node_table *)&vap->iv_ic->ic_sta; unsigned int x = 0; unsigned int this_tp, this_prob, this_eprob; struct ath_softc *sc = vap->iv_ic->ic_dev->priv;; Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/onoe/onoe.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/onoe/onoe.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/onoe/onoe.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -423,7 +423,7 @@ static void ath_rate_detach(struct ath_ratectrl *arc) { - struct onoe_softc *osc = (struct onoe_softc *) arc; + struct onoe_softc *osc = (struct onoe_softc *)arc; kfree(osc); _MOD_DEC_USE(THIS_MODULE); @@ -467,7 +467,7 @@ }; static ctl_table ath_rate_table[] = { { .ctl_name = CTL_AUTO, - .procname = "rate", + .procname = "rate_onoe", .mode = 0555, .child = ath_rate_static_sysctls }, { 0 } Modified: madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/sample/sample.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/sample/sample.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/sample/sample.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -983,7 +983,7 @@ static void ath_rate_detach(struct ath_ratectrl *arc) { - struct sample_softc *osc = (struct sample_softc *) arc; + struct sample_softc *osc = (struct sample_softc *)arc; kfree(osc); _MOD_DEC_USE(THIS_MODULE); } @@ -996,7 +996,7 @@ struct ath_node *an; struct sample_node *sn; struct ieee80211_node_table *nt = - (struct ieee80211_node_table *) &vap->iv_ic->ic_sta; + (struct ieee80211_node_table *)&vap->iv_ic->ic_sta; unsigned int ndx; unsigned int size_bin; Modified: madwifi/branches/madwifi-hal-0.10.5.6/include/compat.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/include/compat.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/include/compat.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -58,20 +58,6 @@ #define __force #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) -typedef int gfp_t; -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3) -static inline void *kzalloc(size_t size, gfp_t flags) -{ - void *p = kmalloc(size, flags); - if (likely(p != NULL)) - memset(p, 0, size); - return p; -} -#endif - #ifndef container_of #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ @@ -115,36 +101,37 @@ #define __offsetof(t,m) offsetof(t,m) -#ifndef ALIGNED_POINTER /* - * ALIGNED_POINTER is a boolean macro that checks whether an address - * is valid to fetch data elements of type t from on this architecture. - * This does not reflect the optimal alignment, just the possibility - * (within reasonable limits). - * + * NetBSD/FreeBSD defines for file version. */ -#define ALIGNED_POINTER(p,t) 1 -#endif +#define __FBSDID(_s) +#define __KERNEL_RCSID(_n,_s) +/* + * Fixes for Linux API changes + */ #ifdef __KERNEL__ -#define KASSERT(exp, msg) do { \ + +#define KASSERT(exp, msg) do { \ if (unlikely(!(exp))) { \ printk msg; \ BUG(); \ } \ } while (0) -#endif /* __KERNEL__ */ -/* - * NetBSD/FreeBSD defines for file version. - */ -#define __FBSDID(_s) -#define __KERNEL_RCSID(_n,_s) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) +typedef int gfp_t; +#endif -/* - * Fixes for Linux API changes - */ -#ifdef __KERNEL__ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3) +static inline void *kzalloc(size_t size, gfp_t flags) +{ + void *p = kmalloc(size, flags); + if (likely(p != NULL)) + memset(p, 0, size); + return p; +} +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) #define ATH_REGISTER_SYSCTL_TABLE(t) register_sysctl_table(t, 1) Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/_ieee80211.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/_ieee80211.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/_ieee80211.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -147,7 +147,7 @@ #define IEEE80211_CHAN_MAX 255 #define IEEE80211_CHAN_BYTES 32 /* howmany(IEEE80211_CHAN_MAX, NBBY) */ #define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ -#define IEEE80211_CHAN_ANYC ((struct ieee80211_channel *) IEEE80211_CHAN_ANY) +#define IEEE80211_CHAN_ANYC ((struct ieee80211_channel *)IEEE80211_CHAN_ANY) #define IEEE80211_RADAR_CHANCHANGE_TBTT_COUNT 0 #define IEEE80211_DEFAULT_CHANCHANGE_TBTT_COUNT 3 Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -64,7 +64,7 @@ }; EXPORT_SYMBOL(ieee80211_phymode_name); -const char* ieee80211_opmode_name[] = { +const char *ieee80211_opmode_name[] = { "ibss", /* IEEE80211_M_IBSS = 0 - IBSS (adhoc) station */ "station", /* IEEE80211_M_STA = 1 - infrastructure station */ "wds", /* IEEE80211_M_WDS = 2 - WDS link */ @@ -78,7 +78,7 @@ EXPORT_SYMBOL(ieee80211_opmode_name); -static void ieee80211com_media_status(struct net_device*, struct ifmediareq *); +static void ieee80211com_media_status(struct net_device *, struct ifmediareq *); static int ieee80211com_media_change(struct net_device *); static struct net_device_stats *ieee80211_getstats(struct net_device *); static int ieee80211_change_mtu(struct net_device *, int); @@ -860,7 +860,7 @@ void ieee80211_expire_excl_restrictions(struct ieee80211com *ic) { - struct ieee80211_channel* c = NULL; + struct ieee80211_channel *c = NULL; struct net_device *dev = ic->ic_dev; struct timeval tv_now; int i; @@ -939,7 +939,7 @@ static void ieee80211_expire_dfs_excl_timer(unsigned long data) { - struct ieee80211com *ic = (struct ieee80211com *) data; + struct ieee80211com *ic = (struct ieee80211com *)data; struct ieee80211vap *vap; printk(KERN_INFO "%s: %s: expiring Non-Occupancy Period\n", Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_beacon.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_beacon.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_beacon.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -117,7 +117,7 @@ *frm++ = 0; *frm++ = 0; /* TODO: ATIM window */ bo->bo_tim_len = 0; } else { - struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *) frm; + struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *)frm; tie->tim_ie = IEEE80211_ELEMID_TIM; tie->tim_len = 4; /* length */ @@ -400,7 +400,7 @@ if (vap->iv_opmode == IEEE80211_M_HOSTAP) { /* NB: no IBSS support*/ struct ieee80211_tim_ie *tie = - (struct ieee80211_tim_ie *) bo->bo_tim; + (struct ieee80211_tim_ie *)bo->bo_tim; if (vap->iv_flags & IEEE80211_F_TIMUPDATE) { u_int timlen, timoff, i; /* Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -644,7 +644,7 @@ * This assumes unicast keys are only configured when * the key id in the header is meaningless (typically 0). */ - wh = (struct ieee80211_frame *) skb->data; + wh = (struct ieee80211_frame *)skb->data; ivp = skb->data + hdrlen; keyid = ivp[IEEE80211_WEP_IVLEN]; if (IEEE80211_IS_MULTICAST(wh->i_addr1) || Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -151,7 +151,7 @@ void ieee80211_crypto_register(const struct ieee80211_cipher *); void ieee80211_crypto_unregister(const struct ieee80211_cipher *); -int ieee80211_crypto_available(struct ieee80211vap*, u_int); +int ieee80211_crypto_available(struct ieee80211vap *, u_int); struct ieee80211_key *ieee80211_crypto_encap(struct ieee80211_node *, struct sk_buff *); Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_ccmp.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_ccmp.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_ccmp.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -415,7 +415,7 @@ ((struct ieee80211_frame_addr4 *)wh)->i_addr4); if (IS_QOS_DATA(wh)) { struct ieee80211_qosframe_addr4 *qwh4 = - (struct ieee80211_qosframe_addr4 *) wh; + (struct ieee80211_qosframe_addr4 *)wh; aad[30] = qwh4->i_qos[0] & 0x0f;/* just priority bits */ aad[31] = 0; b0[1] = aad[30]; @@ -428,7 +428,7 @@ } else { if (IS_QOS_DATA(wh)) { struct ieee80211_qosframe *qwh = - (struct ieee80211_qosframe*) wh; + (struct ieee80211_qosframe *)wh; aad[24] = qwh->i_qos[0] & 0x0f; /* just priority bits */ aad[25] = 0; b0[1] = aad[24]; @@ -470,7 +470,7 @@ ccmp_encrypt(struct ieee80211_key *key, struct sk_buff *skb0, int hdrlen) { struct ccmp_ctx *ctx = key->wk_private; - struct ieee80211_frame *wh = (struct ieee80211_frame *) skb0->data; + struct ieee80211_frame *wh = (struct ieee80211_frame *)skb0->data; struct sk_buff *skb; int data_len, i; uint8_t aad[2 * AES_BLOCK_LEN], b0[AES_BLOCK_LEN], b[AES_BLOCK_LEN]; @@ -583,7 +583,7 @@ ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct sk_buff *skb0, int hdrlen) { struct ccmp_ctx *ctx = key->wk_private; - struct ieee80211_frame *wh = (struct ieee80211_frame *) skb0->data; + struct ieee80211_frame *wh = (struct ieee80211_frame *)skb0->data; struct sk_buff *skb; uint8_t aad[2 * AES_BLOCK_LEN]; uint8_t b0[AES_BLOCK_LEN], b[AES_BLOCK_LEN], a[AES_BLOCK_LEN]; Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_tkip.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_tkip.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_tkip.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -161,7 +161,7 @@ if (vap->iv_flags & IEEE80211_F_COUNTERM) { #ifdef IEEE80211_DEBUG struct ieee80211_frame *wh = - (struct ieee80211_frame *) skb->data; + (struct ieee80211_frame *)skb->data; #endif IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, @@ -210,7 +210,7 @@ if ((k->wk_flags & IEEE80211_KEY_SWMIC) || force_sw) { struct ieee80211_frame *wh = - (struct ieee80211_frame *) skb0->data; + (struct ieee80211_frame *)skb0->data; struct ieee80211vap *vap = ctx->tc_vap; struct ieee80211com *ic = ctx->tc_ic; int hdrlen; @@ -353,7 +353,7 @@ skb = skb->next; pktlen += skb->len; } - wh = (struct ieee80211_frame *) skb0->data; + wh = (struct ieee80211_frame *)skb0->data; /* NB: skb left pointing at last in chain */ if ((k->wk_flags & IEEE80211_KEY_SWMIC) || force_sw) { struct ieee80211vap *vap = ctx->tc_vap; @@ -576,7 +576,7 @@ { /* Make temporary area overlap WEP seed so that the final copy can be * avoided on little endian hosts. */ - u16 *PPK = (u16 *) &WEPSeed[4]; + u16 *PPK = (u16 *)&WEPSeed[4]; /* Step 1 - make copy of TTAK and bring in TSC */ PPK[0] = TTAK[0]; @@ -587,15 +587,15 @@ PPK[5] = TTAK[4] + IV16; /* Step 2 - 96-bit bijective mixing using S-box */ - PPK[0] += _S_(PPK[5] ^ Mk16_le((const __le16 *) &TK[0])); - PPK[1] += _S_(PPK[0] ^ Mk16_le((const __le16 *) &TK[2])); - PPK[2] += _S_(PPK[1] ^ Mk16_le((const __le16 *) &TK[4])); - PPK[3] += _S_(PPK[2] ^ Mk16_le((const __le16 *) &TK[6])); - PPK[4] += _S_(PPK[3] ^ Mk16_le((const __le16 *) &TK[8])); - PPK[5] += _S_(PPK[4] ^ Mk16_le((const __le16 *) &TK[10])); + PPK[0] += _S_(PPK[5] ^ Mk16_le((const __le16 *)&TK[0])); + PPK[1] += _S_(PPK[0] ^ Mk16_le((const __le16 *)&TK[2])); + PPK[2] += _S_(PPK[1] ^ Mk16_le((const __le16 *)&TK[4])); + PPK[3] += _S_(PPK[2] ^ Mk16_le((const __le16 *)&TK[6])); + PPK[4] += _S_(PPK[3] ^ Mk16_le((const __le16 *)&TK[8])); + PPK[5] += _S_(PPK[4] ^ Mk16_le((const __le16 *)&TK[10])); - PPK[0] += RotR1(PPK[5] ^ Mk16_le((const __le16 *) &TK[12])); - PPK[1] += RotR1(PPK[0] ^ Mk16_le((const __le16 *) &TK[14])); + PPK[0] += RotR1(PPK[5] ^ Mk16_le((const __le16 *)&TK[12])); + PPK[1] += RotR1(PPK[0] ^ Mk16_le((const __le16 *)&TK[14])); PPK[2] += RotR1(PPK[1]); PPK[3] += RotR1(PPK[2]); PPK[4] += RotR1(PPK[3]); @@ -606,7 +606,7 @@ WEPSeed[0] = Hi8(IV16); WEPSeed[1] = (Hi8(IV16) | 0x20) & 0x7F; WEPSeed[2] = Lo8(IV16); - WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((const __le16 *) &TK[0])) >> 1); + WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((const __le16 *)&TK[0])) >> 1); #if _BYTE_ORDER == _BIG_ENDIAN { @@ -809,7 +809,7 @@ michael_mic_hdr(const struct ieee80211_frame *wh0, u8 hdr[16]) { const struct ieee80211_frame_addr4 *wh = - (const struct ieee80211_frame_addr4 *) wh0; + (const struct ieee80211_frame_addr4 *)wh0; switch (wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) { case IEEE80211_FC1_DIR_NODS: @@ -832,7 +832,7 @@ if (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS) { const struct ieee80211_qosframe *qwh = - (const struct ieee80211_qosframe *) wh; + (const struct ieee80211_qosframe *)wh; hdr[12] = qwh->i_qos[0] & IEEE80211_QOS_TID; } else hdr[12] = 0; @@ -849,7 +849,7 @@ const uint8_t *data; u_int space; - michael_mic_hdr((struct ieee80211_frame *) skb->data, hdr); + michael_mic_hdr((struct ieee80211_frame *)skb->data, hdr); l = get_le32(key); r = get_le32(key + 4); @@ -952,7 +952,7 @@ tkip_encrypt(struct tkip_ctx *ctx, struct ieee80211_key *key, struct sk_buff *skb0, int hdrlen) { - struct ieee80211_frame *wh = (struct ieee80211_frame *) skb0->data; + struct ieee80211_frame *wh = (struct ieee80211_frame *)skb0->data; struct ieee80211vap *vap = ctx->tc_vap; struct sk_buff *skb; size_t pktlen; @@ -996,7 +996,7 @@ tkip_decrypt(struct tkip_ctx *ctx, struct ieee80211_key *key, struct sk_buff *skb0, int hdrlen) { - struct ieee80211_frame *wh = (struct ieee80211_frame *) skb0->data; + struct ieee80211_frame *wh = (struct ieee80211_frame *)skb0->data; struct ieee80211vap *vap = ctx->tc_vap; struct sk_buff *skb; size_t pktlen; @@ -1016,7 +1016,7 @@ iv16 = (u16) ctx->rx_rsc; iv32 = (u32) (ctx->rx_rsc >> 16); - wh = (struct ieee80211_frame *) skb0->data; + wh = (struct ieee80211_frame *)skb0->data; tid = 0; if (IEEE80211_QOS_HAS_SEQ(wh)) tid = ((struct ieee80211_qosframe *)wh)->i_qos[0] & IEEE80211_QOS_TID; Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_wep.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_wep.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_wep.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -358,7 +358,7 @@ if (data_len != 0) { /* out of data */ #ifdef IEEE80211_DEBUG const struct ieee80211_frame *wh = - (const struct ieee80211_frame *) skb0->data; + (const struct ieee80211_frame *)skb0->data; #endif IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, @@ -377,7 +377,7 @@ if (skb_tailroom(skb) < wep.ic_trailer) { #ifdef IEEE80211_DEBUG const struct ieee80211_frame *wh = - (const struct ieee80211_frame *) skb0->data; + (const struct ieee80211_frame *)skb0->data; #endif /* NB: should not happen */ IEEE80211_NOTE_MAC(ctx->wc_vap, IEEE80211_MSG_CRYPTO, @@ -458,7 +458,7 @@ if (data_len != 0) { /* out of data */ #ifdef IEEE80211_DEBUG const struct ieee80211_frame *wh = - (const struct ieee80211_frame *) skb0->data; + (const struct ieee80211_frame *)skb0->data; #endif IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_input.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_input.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_input.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -170,7 +170,7 @@ set_quality(&thr.low, vap->iv_spy.thr_low, vap->iv_ic->ic_channoise); set_quality(&thr.high, vap->iv_spy.thr_high, vap->iv_ic->ic_channoise); wireless_send_event(vap->iv_dev, - SIOCGIWTHRSPY, &wrq, (char*) &thr); + SIOCGIWTHRSPY, &wrq, (char *)&thr); break; } } @@ -207,7 +207,7 @@ #ifdef ATH_SUPERG_FF struct llc *llc; #endif - int hdrspace; + int hdrlen; u_int8_t dir, type = -1, subtype; u_int8_t *bssid; u_int16_t rxseq; @@ -431,11 +431,11 @@ switch (type) { case IEEE80211_FC0_TYPE_DATA: - hdrspace = ieee80211_hdrspace(ic, wh); - if (skb->len < hdrspace) { + hdrlen = ieee80211_hdrsize(wh); + if (skb->len < hdrlen) { IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, wh, "data", "too short: len %u, expecting %u", - skb->len, hdrspace); + skb->len, hdrlen); vap->iv_stats.is_rx_tooshort++; goto out; /* XXX */ } @@ -624,7 +624,7 @@ IEEE80211_NODE_STAT(ni, rx_noprivacy); goto out; } - key = ieee80211_crypto_decap(ni, skb, hdrspace); + key = ieee80211_crypto_decap(ni, skb, hdrlen); if (key == NULL) { /* NB: stats+msgs handled in crypto_decap */ IEEE80211_NODE_STAT(ni, rx_wepfail); @@ -639,7 +639,7 @@ * Next up, any fragmentation. */ if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - skb = ieee80211_defrag(ni, skb, hdrspace); + skb = ieee80211_defrag(ni, skb, hdrlen); if (skb == NULL) { /* Fragment dropped or frame not complete yet */ goto out; @@ -651,7 +651,7 @@ * Next strip any MSDU crypto bits. */ if (key != NULL && - !ieee80211_crypto_demic(vap, key, skb, hdrspace, 0)) { + !ieee80211_crypto_demic(vap, key, skb, hdrlen, 0)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, ni->ni_macaddr, "data", "%s", "demic error"); IEEE80211_NODE_STAT(ni, rx_demicfail); @@ -661,7 +661,7 @@ /* * Finally, strip the 802.11 header. */ - skb = ieee80211_decap(vap, skb, hdrspace); + skb = ieee80211_decap(vap, skb, hdrlen); if (skb == NULL) { /* don't count Null data frames as errors */ if (subtype == IEEE80211_FC0_SUBTYPE_NODATA) @@ -672,7 +672,7 @@ IEEE80211_NODE_STAT(ni, rx_decap); goto err; } - eh = (struct ether_header *) skb->data; + eh = (struct ether_header *)skb->data; if (!accept_data_frame(vap, ni, key, skb, eh)) goto out; @@ -685,7 +685,7 @@ #ifdef ATH_SUPERG_FF /* check for FF */ - llc = (struct llc *) (skb->data + sizeof(struct ether_header)); + llc = (struct llc *)(skb->data + sizeof(struct ether_header)); if (ntohs(llc->llc_snap.ether_type) == (u_int16_t)ATH_ETH_TYPE) { struct sk_buff *skb1 = NULL; struct ether_header *eh_tmp; @@ -812,8 +812,8 @@ vap->iv_stats.is_rx_noprivacy++; goto out; } - hdrspace = ieee80211_hdrspace(ic, wh); - key = ieee80211_crypto_decap(ni, skb, hdrspace); + hdrlen = ieee80211_hdrsize(wh); + key = ieee80211_crypto_decap(ni, skb, hdrlen); if (key == NULL) { /* NB: stats+msgs handled in crypto_decap */ goto out; @@ -970,7 +970,7 @@ static struct sk_buff * ieee80211_defrag(struct ieee80211_node *ni, struct sk_buff *skb, int hdrlen) { - struct ieee80211_frame *wh = (struct ieee80211_frame *) skb->data; + struct ieee80211_frame *wh = (struct ieee80211_frame *)skb->data; u_int16_t rxseq, last_rxseq; u_int8_t fragno, last_fragno; u_int8_t more_frag = wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG; @@ -1015,7 +1015,7 @@ if (ni->ni_rxfrag) { struct ieee80211_frame *lwh; - lwh = (struct ieee80211_frame *) ni->ni_rxfrag->data; + lwh = (struct ieee80211_frame *)ni->ni_rxfrag->data; last_rxseq = le16_to_cpu(*(__le16 *)lwh->i_seq) >> IEEE80211_SEQ_SEQ_SHIFT; last_fragno = le16_to_cpu(*(__le16 *)lwh->i_seq) & @@ -1081,7 +1081,7 @@ /* Update tail and length */ skb_put(ni->ni_rxfrag, skb->len - hdrlen); /* Keep a copy of last sequence and fragno */ - *(__le16 *) lwh->i_seq = *(__le16 *) wh->i_seq; + *(__le16 *)lwh->i_seq = *(__le16 *)wh->i_seq; } /* we're done with the fragment */ ieee80211_dev_kfree_skb(&skb); @@ -1103,7 +1103,7 @@ { struct ieee80211vap *vap = ni->ni_vap; struct net_device *dev = vap->iv_dev; - struct ether_header *eh = (struct ether_header *) skb->data; + struct ether_header *eh = (struct ether_header *)skb->data; struct ieee80211_node *tni; int ret; @@ -1149,19 +1149,21 @@ } } if (skb1 != NULL) { - struct ieee80211_node *tni; skb1->dev = dev; skb_reset_mac_header(skb1); skb_set_network_header(skb1, sizeof(struct ether_header)); skb1->protocol = __constant_htons(ETH_P_802_2); + + /* This SKB is being emitted to the physical/parent + * device, which maintains node references. However, + * there is kernel code in between which does not. + * Therefore, the ref. is cleaned if the SKB is + * dropped. */ + tni = SKB_NI(skb1); /* XXX: Insert vlan tag before queuing it? */ - tni = SKB_NI(skb1); /* Remember node so we can free it. */ if (dev_queue_xmit(skb1) == NET_XMIT_DROP) { - /* If queue dropped the packet because device - * was too busy */ vap->iv_devstats.tx_dropped++; - /* node reference was leaked */ if (tni != NULL) ieee80211_unref_node(&tni); } @@ -1184,16 +1186,14 @@ tni = SKB_NI(skb); if ((ni->ni_vlan != 0) && (vap->iv_vlgrp != NULL)) /* Attach VLAN tag. */ - ret = vlan_hwaccel_receive_skb(skb, + ret = vlan_hwaccel_rx(skb, vap->iv_vlgrp, ni->ni_vlan); else ret = netif_rx(skb); - if (ret == NET_RX_DROP) { - /* Cleanup if passing SKB to ourselves failed. */ - if (tni != NULL) - ieee80211_unref_node(&tni); + if (ret == NET_RX_DROP) vap->iv_devstats.rx_dropped++; - } + if (tni != NULL) + ieee80211_unref_node(&tni); skb = NULL; /* SKB is no longer ours */ } } @@ -1214,7 +1214,7 @@ memcpy(&wh, skb->data, hdrlen); /* Make a copy of the variably sized .11 header */ - llc = (struct llc *) skb_pull(skb, hdrlen); + llc = (struct llc *)skb_pull(skb, hdrlen); /* XXX: For some unknown reason some APs think they are from DEC and * use an OUI of 00-00-f8. This should be killed as soon as sanity is * restored. */ @@ -1226,7 +1226,7 @@ llc = NULL; } - eh = (struct ether_header *) skb_push(skb, sizeof(struct ether_header)); + eh = (struct ether_header *)skb_push(skb, sizeof(struct ether_header)); switch (wh.i_fc[1] & IEEE80211_FC1_DIR_MASK) { case IEEE80211_FC1_DIR_NODS: IEEE80211_ADDR_COPY(eh->ether_dhost, wh.i_addr1); @@ -1251,16 +1251,6 @@ else eh->ether_type = ether_type; - if (!ALIGNED_POINTER(skb->data + sizeof(*eh), u_int32_t)) { - struct sk_buff *tskb; - - /* XXX: does this always work? */ - tskb = skb_copy(skb, GFP_ATOMIC); - if (tskb) - ieee80211_skb_copy_noderef(skb, tskb); - ieee80211_dev_kfree_skb(&skb); - skb = tskb; - } return skb; } @@ -2209,7 +2199,7 @@ struct ieee80211com *ic = ni->ni_ic; #endif /* ATH_SUPERG_DYNTURBO */ struct ieee80211_ie_athAdvCap *athIe = - (struct ieee80211_ie_athAdvCap *) ie; + (struct ieee80211_ie_athAdvCap *)ie; ni->ni_ath_flags = athIe->athAdvCap_capability; if (ni->ni_ath_flags & IEEE80211_ATHC_COMP) @@ -2281,7 +2271,6 @@ if (filter_type && ((vap->app_filter & filter_type) == filter_type)) { struct sk_buff *skb1; - struct ieee80211_node *tni; skb1 = skb_copy(skb, GFP_ATOMIC); if (skb1 == NULL) @@ -2295,18 +2284,13 @@ skb1->pkt_type = PACKET_OTHERHOST; skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ - tni = SKB_NI(skb1); - if (netif_rx(skb1) == NET_RX_DROP) { - /* If netif_rx dropped the packet because - * device was too busy */ - if (tni != NULL) { - /* node reference was leaked */ - ieee80211_unref_node(&tni); - } - vap->iv_devstats.rx_dropped++; - } vap->iv_devstats.rx_packets++; vap->iv_devstats.rx_bytes += skb1->len; + + if (SKB_NI(skb1) != NULL) + ieee80211_unref_node(&SKB_NI(skb1)); + if (netif_rx(skb1) == NET_RX_DROP) + vap->iv_devstats.rx_dropped++; } } @@ -2314,7 +2298,7 @@ ieee80211_saveath(struct ieee80211_node *ni, u_int8_t *ie) { const struct ieee80211_ie_athAdvCap *athIe = - (const struct ieee80211_ie_athAdvCap *) ie; + (const struct ieee80211_ie_athAdvCap *)ie; ieee80211_saveie(&ni->ni_ath_ie, ie); if (athIe != NULL) { @@ -3045,7 +3029,7 @@ if (ni_or_null == NULL) ni = vap->iv_bss; - wh = (struct ieee80211_frame *) skb->data; + wh = (struct ieee80211_frame *)skb->data; frm = (u_int8_t *)&wh[1]; efrm = skb->data + skb->len; @@ -3355,7 +3339,7 @@ * power save mode for any reason. */ struct ieee80211_tim_ie *tim = - (struct ieee80211_tim_ie *) scan.tim; + (struct ieee80211_tim_ie *)scan.tim; int aid = IEEE80211_AID(ni->ni_associd); int ix = aid / NBBY; int min = tim->tim_bitctl &~ 1; @@ -4147,7 +4131,7 @@ if (ni->ni_associd == 0) { IEEE80211_DISCARD(vap, IEEE80211_MSG_POWER | IEEE80211_MSG_DEBUG, - (struct ieee80211_frame *) wh, "ps-poll", + (struct ieee80211_frame *)wh, "ps-poll", "%s", "unassociated station"); vap->iv_stats.is_ps_unassoc++; IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_DEAUTH, @@ -4159,7 +4143,7 @@ if (aid != ni->ni_associd) { IEEE80211_DISCARD(vap, IEEE80211_MSG_POWER | IEEE80211_MSG_DEBUG, - (struct ieee80211_frame *) wh, "ps-poll", + (struct ieee80211_frame *)wh, "ps-poll", "aid mismatch: sta aid 0x%x poll aid 0x%x", ni->ni_associd, aid); vap->iv_stats.is_ps_badaid++; @@ -4214,11 +4198,11 @@ return -1; memcpy(&eh_src, skb->data, sizeof(struct ether_header)); - llc = (struct llc *) skb_pull(skb, sizeof(struct ether_header)); + llc = (struct llc *)skb_pull(skb, sizeof(struct ether_header)); eh_src.ether_type = llc->llc_un.type_snap.ether_type; skb_pull(skb, LLC_SNAPFRAMELEN); - eh_dst = (struct ether_header *) skb_push(skb, sizeof(struct ether_header)); + eh_dst = (struct ether_header *)skb_push(skb, sizeof(struct ether_header)); memcpy(eh_dst, &eh_src, sizeof(struct ether_header)); return 0; @@ -4261,8 +4245,7 @@ struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_frame *wh; struct ieee80211_key *key; - int hdrspace; - struct ieee80211com *ic = vap->iv_ic; + int hdrlen; if (skb->len < sizeof(struct ieee80211_frame_min)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, @@ -4273,13 +4256,13 @@ } wh = (struct ieee80211_frame *)skb->data; - hdrspace = ieee80211_hdrspace(ic, wh); + hdrlen = ieee80211_hdrsize(wh); - key = ieee80211_crypto_decap(ni, skb, hdrspace); + key = ieee80211_crypto_decap(ni, skb, hdrlen); if (key == NULL) { /* NB: stats+msgs handled in crypto_decap */ IEEE80211_NODE_STAT(ni, rx_wepfail); - } else if (!ieee80211_crypto_demic(vap, key, skb, hdrspace, 1)) { + } else if (!ieee80211_crypto_demic(vap, key, skb, hdrlen, 1)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, ni->ni_macaddr, "data", "%s", "demic error"); IEEE80211_NODE_STAT(ni, rx_demicfail); Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -136,7 +136,7 @@ struct sk_buff * #ifdef IEEE80211_DEBUG_REFCNT ieee80211_getmgtframe_debug(u_int8_t **frm, u_int pktlen, - const char* func, int line) + const char *func, int line) #else ieee80211_getmgtframe(u_int8_t **frm, u_int pktlen) #endif @@ -432,7 +432,8 @@ proc_ieee80211_read(struct file *file, char __user *buf, size_t len, loff_t *offset) { loff_t pos = *offset; - struct proc_ieee80211_priv *pv = (struct proc_ieee80211_priv *) file->private_data; + struct proc_ieee80211_priv *pv = + (struct proc_ieee80211_priv *)file->private_data; if (!pv->rbuf) return -EINVAL; @@ -485,7 +486,7 @@ { loff_t pos = *offset; struct proc_ieee80211_priv *pv = - (struct proc_ieee80211_priv *) file->private_data; + (struct proc_ieee80211_priv *)file->private_data; if (!pv->wbuf) return -EINVAL; @@ -508,7 +509,7 @@ proc_ieee80211_close(struct inode *inode, struct file *file) { struct proc_ieee80211_priv *pv = - (struct proc_ieee80211_priv *) file->private_data; + (struct proc_ieee80211_priv *)file->private_data; if (pv->rbuf) vfree(pv->rbuf); if (pv->wbuf) @@ -958,7 +959,7 @@ ieee80211_rcv_dev_event(struct notifier_block *this, unsigned long event, void *ptr) { - struct net_device *dev = (struct net_device *) ptr; + struct net_device *dev = (struct net_device *)ptr; if (!dev || dev->open != &ieee80211_open) return 0; Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -468,7 +468,7 @@ #define ieee80211_getmgtframe(_ppfrm, _pktlen) \ ieee80211_getmgtframe_debug(_ppfrm, _pktlen, __func__, __LINE__) extern struct sk_buff * ieee80211_getmgtframe_debug(u_int8_t **frm, u_int pktlen, - const char* func, int line); + const char *func, int line); #else extern struct sk_buff * ieee80211_getmgtframe(u_int8_t **frm, u_int pktlen); #endif @@ -612,10 +612,6 @@ #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) #define IEEE80211_VLAN_TAG_USED 1 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20) -#define vlan_hwaccel_receive_skb(skb, grp, tag) vlan_hwaccel_rx(skb, grp, tag) -#endif - #ifndef VLAN_GROUP_ARRAY_PART_LEN #define vlan_group_set_device(group, vid, dev) do { \ group->vlan_devices[vid] = dev; \ Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_monitor.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_monitor.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_monitor.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -129,7 +129,7 @@ { struct ieee80211_phy_params *ph = &(SKB_CB(skb)->phy); SKB_CB(skb)->flags = M_RAW; - SKB_NI(skb) = NULL; + SKB_NI(skb) = ieee80211_ref_node(vap->iv_bss); /* send at a static rate if it is configured */ ph->rate[0] = vap->iv_fixed_rate > 0 ? vap->iv_fixed_rate : 2; @@ -139,7 +139,7 @@ switch (skb->dev->type) { case ARPHRD_IEEE80211: { - struct ieee80211_frame *wh = (struct ieee80211_frame *) skb->data; + struct ieee80211_frame *wh = (struct ieee80211_frame *)skb->data; if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) ph->try[0] = 1; break; @@ -147,7 +147,7 @@ case ARPHRD_IEEE80211_PRISM: { struct ieee80211_frame *wh = NULL; struct wlan_ng_prism2_header *p2h = - (struct wlan_ng_prism2_header *) skb->data; + (struct wlan_ng_prism2_header *)skb->data; /* does it look like there is a prism header here? */ if (skb->len > sizeof(struct wlan_ng_prism2_header) && p2h->msgcode == DIDmsg_lnxind_wlansniffrm && @@ -155,7 +155,7 @@ ph->rate[0] = p2h->rate.data; skb_pull(skb, sizeof(struct wlan_ng_prism2_header)); } - wh = (struct ieee80211_frame *) skb->data; + wh = (struct ieee80211_frame *)skb->data; if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) ph->try[0] = 1; break; @@ -182,7 +182,7 @@ /* skip the chain of additional bitmaps following it_present */ while (present_ext & (1 << IEEE80211_RADIOTAP_EXT)) { - if (p+4 > end) { + if (p + 4 > end) { /* An extended bitmap would now follow, but there is * no place for it. Stop parsing. */ present = 0; @@ -265,7 +265,7 @@ case ARPHRD_IEEE80211_ATHDESC: { if (skb->len > ATHDESC_HEADER_SIZE) { struct ar5212_openbsd_desc *desc = - (struct ar5212_openbsd_desc *) (skb->data + 8); + (struct ar5212_openbsd_desc *)(skb->data + 8); ph->power = desc->xmit_power; ph->rate[0] = ratecode_to_dot11(desc->xmit_rate0); ph->rate[1] = ratecode_to_dot11(desc->xmit_rate1); @@ -302,6 +302,7 @@ int noise = 0, antenna = 0, ieeerate = 0; u_int32_t rssi = 0; u_int8_t pkttype = 0; + if (tx) { rssi = bf->bf_dsstatus.ds_txstat.ts_rssi; antenna = bf->bf_dsstatus.ds_txstat.ts_antenna; @@ -461,7 +462,7 @@ break; } - th = (struct ath_tx_radiotap_header *) skb_push(skb1, + th = (struct ath_tx_radiotap_header *)skb_push(skb1, sizeof(struct ath_tx_radiotap_header)); memset(th, 0, sizeof(struct ath_tx_radiotap_header)); th->wt_ihdr.it_version = 0; @@ -490,7 +491,7 @@ break; } - th = (struct ath_rx_radiotap_header *) skb_push(skb1, + th = (struct ath_rx_radiotap_header *)skb_push(skb1, sizeof(struct ath_rx_radiotap_header)); memset(th, 0, sizeof(struct ath_rx_radiotap_header)); th->wr_ihdr.it_version = 0; @@ -574,17 +575,14 @@ skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ - if (netif_rx(skb1) == NET_RX_DROP) { - /* If netif_rx dropped the packet because - * device was too busy, reclaim the ref. in - * the skb. */ - if (SKB_NI(skb1) != NULL) - ieee80211_unref_node(&SKB_NI(skb1)); - vap->iv_devstats.rx_dropped++; - } - vap->iv_devstats.rx_packets++; vap->iv_devstats.rx_bytes += skb1->len; + + if (SKB_NI(skb1) != NULL) + ieee80211_unref_node(&SKB_NI(skb1)); + if (netif_rx(skb1) == NET_RX_DROP) + vap->iv_devstats.rx_dropped++; + skb1 = NULL; } } } Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -70,7 +70,7 @@ #define ieee80211_alloc_node(_vap, _mac) \ ieee80211_alloc_node_debug(_vap, _mac, __func__, __LINE__) static struct ieee80211_node *ieee80211_alloc_node_debug(struct ieee80211vap *, - const u_int8_t *, const char* func, int line); + const u_int8_t *, const char *func, int line); #else static struct ieee80211_node *ieee80211_alloc_node(struct ieee80211vap *, const u_int8_t *); @@ -80,10 +80,10 @@ #ifdef IEEE80211_DEBUG_REFCNT static struct ieee80211_node *node_alloc_debug(struct ieee80211vap *, - const char* func, int line); -static void node_cleanup_debug(struct ieee80211_node *, const char* func, + const char *func, int line); +static void node_cleanup_debug(struct ieee80211_node *, const char *func, int line); -static void node_free_debug(struct ieee80211_node *, const char* func, +static void node_free_debug(struct ieee80211_node *, const char *func, int line); #else /* #ifdef IEEE80211_DEBUG_REFCNT */ static struct ieee80211_node *node_alloc(struct ieee80211vap *); @@ -98,7 +98,7 @@ #define node_table_leave_locked(_table, _node) \ node_table_leave_locked_debug(_table, _node, __func__, __LINE__) static void node_table_leave_locked_debug(struct ieee80211_node_table *, - struct ieee80211_node *, const char* func, int line); + struct ieee80211_node *, const char *func, int line); #else static void node_table_leave_locked(struct ieee80211_node_table *, struct ieee80211_node *); @@ -108,7 +108,7 @@ #define node_table_join_locked(_table, _node) \ node_table_join_locked_debug(_table, _node, __func__, __LINE__) static void node_table_join_locked_debug(struct ieee80211_node_table *, - struct ieee80211_node *, const char* func, int line); + struct ieee80211_node *, const char *func, int line); #else static void node_table_join_locked(struct ieee80211_node_table *, struct ieee80211_node *); @@ -296,7 +296,7 @@ } void -ieee80211_create_ibss(struct ieee80211vap* vap, struct ieee80211_channel *chan) +ieee80211_create_ibss(struct ieee80211vap *vap, struct ieee80211_channel *chan) { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni; @@ -671,7 +671,7 @@ void ieee80211_sta_join1_tasklet(IEEE80211_TQUEUE_ARG data) { - struct ieee80211vap *vap= (struct ieee80211vap *) data; + struct ieee80211vap *vap= (struct ieee80211vap *)data; int rc; rc = ieee80211_new_state(vap, vap->iv_nsparams.newstate, vap->iv_nsparams.arg); @@ -784,7 +784,7 @@ void #ifdef IEEE80211_DEBUG_REFCNT node_table_join_locked_debug(struct ieee80211_node_table *nt, - struct ieee80211_node *ni, const char* func, int line) + struct ieee80211_node *ni, const char *func, int line) #else node_table_join_locked(struct ieee80211_node_table *nt, struct ieee80211_node *ni) @@ -810,7 +810,7 @@ void #ifdef IEEE80211_DEBUG_REFCNT node_table_leave_locked_debug(struct ieee80211_node_table *nt, - struct ieee80211_node *ni, const char* func, int line) + struct ieee80211_node *ni, const char *func, int line) #else node_table_leave_locked(struct ieee80211_node_table *nt, struct ieee80211_node *ni) @@ -838,7 +838,7 @@ */ static struct ieee80211_node * #ifdef IEEE80211_DEBUG_REFCNT -node_alloc_debug(struct ieee80211vap *vap, const char* func, int line) +node_alloc_debug(struct ieee80211vap *vap, const char *func, int line) #else node_alloc(struct ieee80211vap *vap) #endif @@ -861,7 +861,7 @@ */ static void #ifdef IEEE80211_DEBUG_REFCNT -node_cleanup_debug(struct ieee80211_node *ni, const char* func, int line) +node_cleanup_debug(struct ieee80211_node *ni, const char *func, int line) #else node_cleanup(struct ieee80211_node *ni) #endif @@ -927,10 +927,10 @@ int refcnt_adjust, const struct ieee80211_node *ni, #ifdef IEEE80211_DEBUG_REFCNT - const char* func1, int line1, + const char *func1, int line1, #endif - const char* func2, int line2, - const char* message, + const char *func2, int line2, + const char *message, ...) { va_list args; @@ -978,7 +978,7 @@ static void #ifdef IEEE80211_DEBUG_REFCNT -node_free_debug(struct ieee80211_node *ni, const char* func, int line) +node_free_debug(struct ieee80211_node *ni, const char *func, int line) #else node_free(struct ieee80211_node *ni) #endif @@ -1027,14 +1027,14 @@ * used by the routines below to create entries with a * specific purpose. * Dont assume a BSS? - * Allocates a new ieee80211_node* that has a reference + * Allocates a new struct ieee80211_node that has a reference * count of one, and adds it to the node table. */ struct ieee80211_node * #ifdef IEEE80211_DEBUG_REFCNT ieee80211_alloc_node_table_debug(struct ieee80211vap *vap, const u_int8_t *macaddr, - const char* func, int line) + const char *func, int line) #else ieee80211_alloc_node_table(struct ieee80211vap *vap, const u_int8_t *macaddr) @@ -1082,7 +1082,7 @@ */ static struct ieee80211_node * #ifdef IEEE80211_DEBUG_REFCNT -ieee80211_alloc_node_debug(struct ieee80211vap *vap, const u_int8_t *macaddr, const char* func, int line) +ieee80211_alloc_node_debug(struct ieee80211vap *vap, const u_int8_t *macaddr, const char *func, int line) #else ieee80211_alloc_node(struct ieee80211vap *vap, const u_int8_t *macaddr) #endif @@ -1135,7 +1135,7 @@ #ifdef IEEE80211_DEBUG_REFCNT ieee80211_add_wds_addr_debug(struct ieee80211_node_table *nt, struct ieee80211_node *ni, const u_int8_t *macaddr, u_int8_t wds_static, - const char* func, int line) + const char *func, int line) #else ieee80211_add_wds_addr(struct ieee80211_node_table *nt, struct ieee80211_node *ni, const u_int8_t *macaddr, u_int8_t wds_static) @@ -1177,7 +1177,7 @@ void #ifdef IEEE80211_DEBUG_REFCNT ieee80211_remove_wds_addr_debug(struct ieee80211_node_table *nt, const u_int8_t *macaddr, - const char* func, int line) + const char *func, int line) #else ieee80211_remove_wds_addr(struct ieee80211_node_table *nt, const u_int8_t *macaddr) #endif @@ -1211,7 +1211,7 @@ void #ifdef IEEE80211_DEBUG_REFCNT ieee80211_del_wds_node_debug(struct ieee80211_node_table *nt, struct ieee80211_node *ni, - const char* func, int line) + const char *func, int line) #else ieee80211_del_wds_node(struct ieee80211_node_table *nt, struct ieee80211_node *ni) #endif @@ -1267,13 +1267,13 @@ /* Add the specified station to the station table. - * Allocates a new ieee80211_node* that has a reference count of one + * Allocates a new struct ieee80211_node that has a reference count of one * If tmp is 0, it is added to the node table and the reference is used. * If tmp is 1, then the caller gets to use the reference. */ struct ieee80211_node * #ifdef IEEE80211_DEBUG_REFCNT ieee80211_dup_bss_debug(struct ieee80211vap *vap, const u_int8_t *macaddr, - unsigned char tmp, const char* func, int line) + unsigned char tmp, const char *func, int line) #else ieee80211_dup_bss(struct ieee80211vap *vap, const u_int8_t *macaddr, unsigned char tmp) @@ -1314,7 +1314,7 @@ static struct ieee80211_node * #ifdef IEEE80211_DEBUG_REFCNT ieee80211_find_wds_node_locked_debug(struct ieee80211_node_table *nt, - const u_int8_t *macaddr, const char* func, int line) + const u_int8_t *macaddr, const char *func, int line) #else ieee80211_find_wds_node_locked(struct ieee80211_node_table *nt, const u_int8_t *macaddr) @@ -1389,7 +1389,7 @@ struct ieee80211_node * #ifdef IEEE80211_DEBUG_REFCNT ieee80211_find_wds_node_debug(struct ieee80211_node_table *nt, const u_int8_t *macaddr, - const char* func, int line) + const char *func, int line) #else ieee80211_find_wds_node(struct ieee80211_node_table *nt, const u_int8_t *macaddr) #endif @@ -1449,7 +1449,7 @@ #ifdef IEEE80211_DEBUG_REFCNT ieee80211_fakeup_adhoc_node_debug(struct ieee80211vap *vap, const u_int8_t macaddr[IEEE80211_ADDR_LEN], - const char* func, int line) + const char *func, int line) #else ieee80211_fakeup_adhoc_node(struct ieee80211vap *vap, const u_int8_t macaddr[IEEE80211_ADDR_LEN]) @@ -1875,7 +1875,7 @@ static void ieee80211_node_timeout(unsigned long arg) { - struct ieee80211com *ic = (struct ieee80211com *) arg; + struct ieee80211com *ic = (struct ieee80211com *)arg; ieee80211_scan_timeout(ic); ieee80211_timeout_stations(&ic->ic_sta); @@ -1954,7 +1954,7 @@ ieee80211_dump_nodes(struct ieee80211_node_table *nt) { ieee80211_iterate_nodes(nt, - (ieee80211_iter_func *) ieee80211_dump_node, nt); + (ieee80211_iter_func *)ieee80211_dump_node, nt); } /* @@ -2169,7 +2169,7 @@ if (ni->ni_needed_chans != NULL) { /* remove nodes which don't support one of ni->ni_needed_chans */ - ieee80211_iterate_nodes(&ic->ic_sta, &remove_worse_nodes, (void*)ni); + ieee80211_iterate_nodes(&ic->ic_sta, &remove_worse_nodes, (void *)ni); FREE(ni->ni_needed_chans, M_DEVBUF); ni->ni_needed_chans = NULL; } @@ -2452,13 +2452,13 @@ { struct ieee80211_node *ni = NULL; if (pni == NULL) { - printk(KERN_ERR "%s: NULL ieee80211_node**\n", __func__); + printk(KERN_ERR "%s: NULL ieee80211_node **\n", __func__); dump_stack(); return; } ni = *pni; if (ni == NULL) { - printk(KERN_ERR "%s: NULL ieee80211_node*\n", __func__); + printk(KERN_ERR "%s: NULL ieee80211_node *\n", __func__); dump_stack(); return; } Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -134,7 +134,7 @@ u_int8_t *ni_needed_chans; /* nodes which don't support these will be removed */ u_int8_t ni_n_needed_chans; /* size of ni_needed_chans list */ u_int16_t ni_txseqs[17]; /* tx seq per-tid */ - u_int16_t ni_rxseqs[17]; /* rx seq previous per-tid*/ + u_int16_t ni_rxseqs[17]; /* rx seq previous per-tid */ unsigned long ni_rxfragstamp; /* time stamp of last rx frag */ struct sk_buff *ni_rxfrag; /* rx frag reassembly */ struct ieee80211_rsnparms ni_rsn; /* RSN/WPA parameters */ @@ -255,26 +255,26 @@ struct timer_list nt_wds_aging_timer; /* timer to age out wds entries */ }; -/* Allocates a new ieee80211_node* that has a reference count of one, and +/* Allocates a new ieee80211_node * that has a reference count of one, and * adds it to the node table. */ #ifdef IEEE80211_DEBUG_REFCNT #define ieee80211_alloc_node_table(_vap, _mac) \ ieee80211_alloc_node_table_debug(_vap, _mac, __func__, __LINE__) struct ieee80211_node *ieee80211_alloc_node_table_debug(struct ieee80211vap *, - const u_int8_t *, const char* name, int line); + const u_int8_t *, const char *name, int line); #else struct ieee80211_node *ieee80211_alloc_node_table(struct ieee80211vap *, const u_int8_t *); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ -/* Allocates a new ieee80211_node* that has a reference count. +/* Allocates a new ieee80211_node * that has a reference count. * If tmp is 0, it is added to the node table and the reference is used. * If tmp is 1, then the caller gets to use the reference. */ #ifdef IEEE80211_DEBUG_REFCNT #define ieee80211_dup_bss(_vap, _mac, _tmp) \ ieee80211_dup_bss_debug(_vap, _mac, _tmp, __func__, __LINE__) struct ieee80211_node *ieee80211_dup_bss_debug(struct ieee80211vap *, - const u_int8_t *, unsigned char tmp, const char*, int); + const u_int8_t *, unsigned char tmp, const char *, int); #else struct ieee80211_node *ieee80211_dup_bss(struct ieee80211vap *, const u_int8_t *, unsigned char tmp); @@ -282,7 +282,7 @@ void ieee80211_node_reset(struct ieee80211_node *, struct ieee80211vap *); -/* Returns a ieee80211_node* with refcount incremented, if found */ +/* Returns a ieee80211_node * with refcount incremented, if found */ #ifdef IEEE80211_DEBUG_REFCNT #define ieee80211_find_node(_nt, _mac) \ ieee80211_find_node_debug(_nt, _mac, __func__, __LINE__) @@ -293,7 +293,7 @@ const u_int8_t *); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ -/* Returns a ieee80211_node* with refcount incremented, if found */ +/* Returns a ieee80211_node * with refcount incremented, if found */ #ifdef IEEE80211_DEBUG_REFCNT #define ieee80211_find_rxnode(_nt, _wh) \ ieee80211_find_rxnode_debug(_nt, _wh, __func__, __LINE__) @@ -304,7 +304,7 @@ const struct ieee80211_frame_min *); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ -/* Returns a ieee80211_node* with refcount incremented, if found */ +/* Returns a ieee80211_node * with refcount incremented, if found */ #ifdef IEEE80211_DEBUG_REFCNT #define ieee80211_find_txnode(_nt, _mac) \ ieee80211_find_txnode_debug(_nt, _mac, __func__, __LINE__) @@ -328,7 +328,7 @@ * This only happens when finding the a node reference from the node table, * which is locked seperately. Thus, we do not need to lock the follwoing * functions. - * Increment the reference counter for ieee80211_node* + * Increment the reference counter for ieee80211_node * */ #ifdef IEEE80211_DEBUG_REFCNT #define ieee80211_ref_node(_ni) \ @@ -350,7 +350,7 @@ return (tmp); } -/* Decrement ieee80211_node* refcount, and relinquish the pointer. */ +/* Decrement ieee80211_node * refcount, and relinquish the pointer. */ #ifdef IEEE80211_DEBUG_REFCNT #define ieee80211_unref_node(_pni) \ ieee80211_unref_node_debug(_pni, __func__, __LINE__) @@ -366,7 +366,7 @@ #define ieee80211_add_wds_addr(_table, _node, _mac, _static) \ ieee80211_add_wds_addr_debug(_table, _node, _mac, _static, __func__, __LINE__) int ieee80211_add_wds_addr_debug(struct ieee80211_node_table *, struct ieee80211_node *, - const u_int8_t *, u_int8_t, const char* func, int line); + const u_int8_t *, u_int8_t, const char *func, int line); #else int ieee80211_add_wds_addr(struct ieee80211_node_table *, struct ieee80211_node *, const u_int8_t *, u_int8_t); @@ -377,7 +377,7 @@ #define ieee80211_remove_wds_addr(_table, _mac) \ ieee80211_remove_wds_addr_debug(_table, _mac, __func__, __LINE__) void ieee80211_remove_wds_addr_debug(struct ieee80211_node_table *, const u_int8_t *, - const char* func, int line); + const char *func, int line); #else void ieee80211_remove_wds_addr(struct ieee80211_node_table *, const u_int8_t *); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ @@ -387,7 +387,7 @@ #define ieee80211_del_wds_node(_table, _node) \ ieee80211_del_wds_node_debug(_table, _node, __func__, __LINE__) void ieee80211_del_wds_node_debug(struct ieee80211_node_table *, struct ieee80211_node *, - const char* func, int line); + const char *func, int line); #else void ieee80211_del_wds_node(struct ieee80211_node_table *, struct ieee80211_node *); #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ @@ -397,7 +397,7 @@ #define ieee80211_find_wds_node(_table, _mac) \ ieee80211_find_wds_node_debug(_table, _mac, __func__, __LINE__) struct ieee80211_node *ieee80211_find_wds_node_debug(struct ieee80211_node_table *, - const u_int8_t *, const char* func, int line); + const u_int8_t *, const char *func, int line); #else struct ieee80211_node *ieee80211_find_wds_node(struct ieee80211_node_table *, const u_int8_t *); @@ -415,7 +415,7 @@ #define ieee80211_fakeup_adhoc_node(_vap, _mac) \ ieee80211_fakeup_adhoc_node_debug(_vap, _mac, __func__, __LINE__) struct ieee80211_node *ieee80211_fakeup_adhoc_node_debug(struct ieee80211vap *, - const u_int8_t macaddr[], const char*, int); + const u_int8_t macaddr[], const char *, int); #else struct ieee80211_node *ieee80211_fakeup_adhoc_node(struct ieee80211vap *, const u_int8_t macaddr[]); Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_output.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_output.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_output.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -83,7 +83,7 @@ ieee80211_classify(struct ieee80211_node *ni, struct sk_buff *skb) { struct ieee80211vap *vap = ni->ni_vap; - struct ether_header *eh = (struct ether_header *) skb->data; + struct ether_header *eh = (struct ether_header *)skb->data; int v_wme_ac = 0, d_wme_ac = 0; /* default priority */ @@ -898,7 +898,7 @@ * add first skb tunnel hdrs */ - llc = (struct llc *) skb_push(skb, LLC_SNAPFRAMELEN); + llc = (struct llc *)skb_push(skb, LLC_SNAPFRAMELEN); llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; llc->llc_control = LLC_UI; llc->llc_snap.org_code[0] = 0; @@ -906,7 +906,7 @@ llc->llc_snap.org_code[2] = 0; llc->llc_snap.ether_type = eh.ether_type; - eh_inter = (struct ether_header *) skb_push(skb, sizeof(struct ether_header)); + eh_inter = (struct ether_header *)skb_push(skb, sizeof(struct ether_header)); memcpy(eh_inter, &eh, sizeof(struct ether_header) - sizeof eh.ether_type); eh_inter->ether_type = htons(payload); @@ -914,7 +914,7 @@ /* XXX: the offset of 2, below, should be computed. but... it will not * practically ever change. */ - ffhdr = (struct athl2p_tunnel_hdr *) skb_push(skb, sizeof(struct athl2p_tunnel_hdr) + 2); + ffhdr = (struct athl2p_tunnel_hdr *)skb_push(skb, sizeof(struct athl2p_tunnel_hdr) + 2); memset(ffhdr, 0, sizeof(struct athl2p_tunnel_hdr) + 2); /* @@ -923,7 +923,7 @@ payload = skb2->len + LLC_SNAPFRAMELEN; - llc = (struct llc *) skb_push(skb2, LLC_SNAPFRAMELEN); + llc = (struct llc *)skb_push(skb2, LLC_SNAPFRAMELEN); if (llc == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPG, "%s: failed to push llc for 2nd skb (%p)\n", @@ -937,7 +937,7 @@ llc->llc_snap.org_code[2] = 0; llc->llc_snap.ether_type = eh2.ether_type; - eh_inter = (struct ether_header *) skb_push(skb2, sizeof(struct ether_header)); + eh_inter = (struct ether_header *)skb_push(skb2, sizeof(struct ether_header)); if (eh_inter == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPG, "%s: failed to push eth hdr for 2nd skb (%p)\n", @@ -953,7 +953,7 @@ } #endif - llc = (struct llc *) skb_push(skb, LLC_SNAPFRAMELEN); + llc = (struct llc *)skb_push(skb, LLC_SNAPFRAMELEN); llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; llc->llc_control = LLC_UI; #ifndef ATH_SUPERG_FF @@ -976,7 +976,7 @@ #endif /* ATH_SUPERG_FF */ datalen = skb->len; /* NB: w/o 802.11 header */ - wh = (struct ieee80211_frame *) skb_push(skb, hdrsize); + wh = (struct ieee80211_frame *)skb_push(skb, hdrsize); wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_DATA; wh->i_dur = 0; if (use4addr) { @@ -1031,7 +1031,7 @@ wh->i_fc[1] |= IEEE80211_FC1_PWR_MGT; if (addqos) { struct ieee80211_qosframe *qwh = - (struct ieee80211_qosframe *) wh; + (struct ieee80211_qosframe *)wh; u_int8_t *qos; int tid; @@ -1066,7 +1066,7 @@ tailsize = IEEE80211_CRC_LEN; if (key != NULL) { - cip = (struct ieee80211_cipher *) key->wk_cipher; + cip = (struct ieee80211_cipher *)key->wk_cipher; ciphdrsize = cip->ic_header; tailsize += (cip->ic_trailer + cip->ic_miclen); @@ -1127,7 +1127,7 @@ void *pdu; fragnum = 0; - wh = twh = (struct ieee80211_frame *) skb->data; + wh = twh = (struct ieee80211_frame *)skb->data; /* ** Setup WLAN headers as fragment headers @@ -1149,8 +1149,8 @@ /* * Copy WLAN header into each frag header skb */ - twh = (struct ieee80211_frame *) skb_put(tskb, hdrsize); - memcpy((void *) twh, (void *) wh, hdrsize); + twh = (struct ieee80211_frame *)skb_put(tskb, hdrsize); + memcpy((void *)twh, (void *)wh, hdrsize); *(__le16 *)&twh->i_seq[0] |= htole16((fragnum & IEEE80211_SEQ_FRAG_MASK) << @@ -1170,7 +1170,7 @@ * more efficient than cloning skbs. */ pdu = skb_put(tskb, pdulen); - memcpy(pdu, (void *) skb->data+offset, pdulen); + memcpy(pdu, (void *)skb->data + offset, pdulen); offset += pdusize; datalen -= pdusize; @@ -1528,7 +1528,7 @@ ieee80211_add_wme(u_int8_t *frm, struct ieee80211_node *ni) { static const u_int8_t oui[4] = { WME_OUI_BYTES, WME_OUI_TYPE }; - struct ieee80211_ie_wme *ie = (struct ieee80211_ie_wme *) frm; + struct ieee80211_ie_wme *ie = (struct ieee80211_ie_wme *)frm; struct ieee80211_wme_state *wme = &ni->ni_ic->ic_wme; struct ieee80211vap *vap = ni->ni_vap; @@ -1572,7 +1572,7 @@ frm += 2; \ } while (0) static const u_int8_t oui[4] = { WME_OUI_BYTES, WME_OUI_TYPE }; - struct ieee80211_wme_param *ie = (struct ieee80211_wme_param *) frm; + struct ieee80211_wme_param *ie = (struct ieee80211_wme_param *)frm; int i; *frm++ = IEEE80211_ELEMID_VENDOR; @@ -1613,7 +1613,7 @@ static const u_int8_t oui[6] = {(ATH_OUI & 0xff), ((ATH_OUI >>8) & 0xff), ((ATH_OUI >> 16) & 0xff), ATH_OUI_TYPE, ATH_OUI_SUBTYPE, ATH_OUI_VERSION}; - struct ieee80211_ie_athAdvCap *ie = (struct ieee80211_ie_athAdvCap *) frm; + struct ieee80211_ie_athAdvCap *ie = (struct ieee80211_ie_athAdvCap *)frm; *frm++ = IEEE80211_ELEMID_VENDOR; *frm++ = 0; /* Length filled in below */ @@ -1639,7 +1639,7 @@ static const u_int8_t oui[6] = {(ATH_OUI & 0xff), ((ATH_OUI >>8) & 0xff), ((ATH_OUI >> 16) & 0xff), ATH_OUI_TYPE_XR, ATH_OUI_SUBTYPE_XR, ATH_OUI_VER_XR}; - struct ieee80211_xr_param *ie = (struct ieee80211_xr_param *) frm; + struct ieee80211_xr_param *ie = (struct ieee80211_xr_param *)frm; *frm++ = IEEE80211_ELEMID_VENDOR; *frm++ = 0; /* Length filled in below */ @@ -2207,7 +2207,7 @@ SKB_NI(skb) = ieee80211_ref_node(ni); skb->priority = WME_AC_VO; - wh = (struct ieee80211_ctlframe_addr2 *) skb_put(skb, sizeof(struct ieee80211_ctlframe_addr2)); + wh = (struct ieee80211_ctlframe_addr2 *)skb_put(skb, sizeof(struct ieee80211_ctlframe_addr2)); wh->i_aidordur = htole16(0xc000 | IEEE80211_NODE_AID(ni)); IEEE80211_ADDR_COPY(wh->i_addr1, vap->iv_bssid); Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_power.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_power.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_power.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -224,7 +224,8 @@ ni->ni_stats.ns_psq_drops, IEEE80211_PS_MAX_QUEUE); #ifdef IEEE80211_DEBUG if (ieee80211_msg_dumppkts(vap)) - ieee80211_dump_pkt(ni->ni_ic, skb->data, skb->len, -1, -1); + ieee80211_dump_pkt(ni->ni_ic, skb->data, + skb->len, -1, -1, 1); #endif if (SKB_NI(skb) != NULL) ieee80211_unref_node(&SKB_NI(skb)); Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -313,8 +313,8 @@ EXPORT_SYMBOL(ieee80211_print_essid); void -ieee80211_dump_pkt(struct ieee80211com *ic, - const u_int8_t *buf, int len, int rate, int rssi) +ieee80211_dump_pkt(struct ieee80211com *ic, const u_int8_t *buf, + int len, int rate, int rssi, int tx) { const struct ieee80211_frame *wh; int i; @@ -365,7 +365,10 @@ if (wh->i_fc[1] & IEEE80211_FC1_PROT) { int off; - off = ieee80211_anyhdrspace(ic, wh); + if (tx) + off = ieee80211_anyhdrspace(ic, wh); + else + off = ieee80211_anyhdrsize(wh); printk(" Prot. [IV %.02x %.02x %.02x", buf[off + 0], buf[off + 1], buf[off + 2]); if (buf[off + IEEE80211_WEP_IVLEN] & IEEE80211_WEP_EXTIV) @@ -1236,7 +1239,7 @@ static void ieee80211_sta_swbmiss(unsigned long arg) { - struct ieee80211vap *vap = (struct ieee80211vap *) arg; + struct ieee80211vap *vap = (struct ieee80211vap *)arg; ieee80211_beacon_miss(vap->iv_ic); } @@ -1247,7 +1250,7 @@ static void ieee80211_tx_timeout(unsigned long arg) { - struct ieee80211vap *vap = (struct ieee80211vap *) arg; + struct ieee80211vap *vap = (struct ieee80211vap *)arg; IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: state %s%s\n", __func__, @@ -1696,7 +1699,7 @@ } static void -dump_vap_states(struct ieee80211com *ic, struct ieee80211vap* highlighed) +dump_vap_states(struct ieee80211com *ic, struct ieee80211vap *highlighed) { /* RE-count the number of VAPs in RUN, SCAN states */ int nrunning = 0; Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -252,7 +252,8 @@ int ieee80211_new_state(struct ieee80211vap *, enum ieee80211_state, int); void ieee80211_print_essid(const u_int8_t *, int); #ifdef IEEE80211_DEBUG -void ieee80211_dump_pkt(struct ieee80211com *, const u_int8_t *, int, int, int); +void ieee80211_dump_pkt(struct ieee80211com *, const u_int8_t *, + int, int, int, int); #else #define ieee80211_dump_pkt(...) #endif Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -68,7 +68,7 @@ struct tasklet_struct ss_pwrsav; /* sta ps ena tasklet */ struct timer_list ss_scan_timer; /* scan timer */ }; -#define SCAN_PRIVATE(ss) ((struct scan_state *) ss) +#define SCAN_PRIVATE(_ss) ((struct scan_state *)(_ss)) /* * Amount of time to go off-channel during a background @@ -90,9 +90,9 @@ #define ROAM_RSSI_11A_DEFAULT 9 /* rssi threshold for 11a bss */ #define ROAM_RSSI_11B_DEFAULT 9 /* rssi threshold for 11b bss */ #define ROAM_RSSI_11BONLY_DEFAULT 9 /* rssi threshold for 11b-only bss */ -#define ROAM_RATE_11A_DEFAULT 2*24 /* tx rate threshold for 11a bss */ -#define ROAM_RATE_11B_DEFAULT 2*9 /* tx rate threshold for 11b bss */ -#define ROAM_RATE_11BONLY_DEFAULT 2*5 /* tx rate threshold for 11b-only bss */ +#define ROAM_RATE_11A_DEFAULT 2 * 24 /* tx rate threshold for 11a bss */ +#define ROAM_RATE_11B_DEFAULT 2 * 9 /* tx rate threshold for 11b bss */ +#define ROAM_RATE_11BONLY_DEFAULT 2 * 5 /* tx rate threshold for 11b-only bss */ static void scan_restart_pwrsav(unsigned long); static void scan_next(unsigned long); @@ -286,7 +286,7 @@ static void scan_restart_pwrsav(unsigned long arg) { - struct scan_state *ss = (struct scan_state *) arg; + struct scan_state *ss = (struct scan_state *)arg; struct ieee80211vap *vap = ss->base.ss_vap; struct ieee80211com *ic = vap->iv_ic; int delay; @@ -630,7 +630,7 @@ scan_next(unsigned long arg) { #define ISCAN_REP (ISCAN_MINDWELL | ISCAN_START | ISCAN_DISCARD) - struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *) arg; + struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *)arg; struct ieee80211vap *vap = ss->ss_vap; struct ieee80211com *ic = vap->iv_ic; struct ieee80211_channel *chan; Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan_sta.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan_sta.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan_sta.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -284,7 +284,7 @@ ise->se_timoff = sp->timoff; if (sp->tim != NULL) { const struct ieee80211_tim_ie *tim = - (const struct ieee80211_tim_ie *) sp->tim; + (const struct ieee80211_tim_ie *)sp->tim; ise->se_dtimperiod = tim->tim_period; } saveie(&ise->se_wme_ie, sp->wme); @@ -950,7 +950,8 @@ * a reference to an entry w/o holding the lock on the table. */ static struct sta_entry * -sta_lookup(struct sta_table *st, const u_int8_t macaddr[IEEE80211_ADDR_LEN], struct ieee80211_scan_ssid* essid) +sta_lookup(struct sta_table *st, const u_int8_t macaddr[IEEE80211_ADDR_LEN], + struct ieee80211_scan_ssid *essid) { struct sta_entry *se; int hash = STA_HASH(macaddr); Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -82,7 +82,7 @@ #undef skb_realloc_headroom #undef skb_share_check #undef skb_unshare -#undef vlan_hwaccel_receive_skb +#undef vlan_hwaccel_rx atomic_t skb_total_counter = ATOMIC_INIT(0); EXPORT_SYMBOL(skb_total_counter); @@ -100,10 +100,10 @@ int show_counter, const struct sk_buff *skb, #ifdef IEEE80211_DEBUG_REFCNT - const char* func1, int line1, + const char *func1, int line1, #endif - const char* func2, int line2, - const char* message, + const char *func2, int line2, + const char *message, ...) { va_list args; @@ -146,34 +146,34 @@ static void print_skb_refchange_message( const struct sk_buff *skb, int users_adjustment, - const char* func1, int line1, - const char* func2, int line2); + const char *func1, int line1, + const char *func2, int line2); static void print_skb_trackchange_message( const struct sk_buff *skb, int users_adjustment, - const char* func1, int line1, - const char* func2, int line2, - char* message); + const char *func1, int line1, + const char *func2, int line2, + char *message); /* Called automatically when an SKB reaches zero users, * reporting any leaked node references. */ #ifdef IEEE80211_DEBUG_REFCNT_SKBDEST -static void skb_destructor(struct sk_buff* skb); +static void skb_destructor(struct sk_buff *skb); #endif -static void get_skb_description(char *dst, int dst_size, const char* label, const struct sk_buff *skb, int users_adjustment); +static void get_skb_description(char *dst, int dst_size, const char *label, const struct sk_buff *skb, int users_adjustment); static struct sk_buff * clean_clone_or_copy(struct sk_buff *skb); static struct sk_buff * track_skb(struct sk_buff *skb, int users_adjustment, - const char* func1, int line1, - const char* func2, int line2); + const char *func1, int line1, + const char *func2, int line2); static struct sk_buff * untrack_skb(struct sk_buff *skb, int users_adjustment, - const char* func1, int line1, - const char* func2, int line2); + const char *func1, int line1, + const char *func2, int line2); #define UNREF_USE_KFREE_SKB 0 #define UNREF_USE_DEV_KFREE_SKB_ANY 1 @@ -183,20 +183,20 @@ /* Assumes SKB is not yet freed at the time of the call and shows the new users * count as (users - 1). */ static void unref_skb(struct sk_buff *skb, int type, - const char* func1, int line1, - const char* func2, int line2); + const char *func1, int line1, + const char *func2, int line2); /* Assumes SKB reference counter has already been updated and reports count as * atomic_read(&skb->users). */ static struct sk_buff * ref_skb(struct sk_buff *skb, - const char* func1, int line1, - const char* func2, int line2); + const char *func1, int line1, + const char *func2, int line2); #ifdef IEEE80211_DEBUG_REFCNT_SKBDEST /* Destructor for reporting node reference leaks */ -static void skb_destructor(struct sk_buff* skb) { +static void skb_destructor(struct sk_buff *skb) { /* Report any node reference leaks - caused by kernel net device queue * dropping buffer, rather than passing it to the driver. */ if (SKB_NI(skb) != NULL) { @@ -213,7 +213,7 @@ EXPORT_SYMBOL(skb_destructor); #endif /* #ifdef IEEE80211_DEBUG_REFCNT_SKBDEST */ -static void get_skb_description(char *dst, int dst_size, const char* label, const struct sk_buff *skb, int users_adjustment) { +static void get_skb_description(char *dst, int dst_size, const char *label, const struct sk_buff *skb, int users_adjustment) { dst[0] = '\0'; if (NULL != skb) { int adj_users = atomic_read(&skb->users) + users_adjustment; @@ -248,8 +248,8 @@ static void print_skb_refchange_message( const struct sk_buff *skb, int users_adjustment, - const char* func1, int line1, - const char* func2, int line2) + const char *func1, int line1, + const char *func2, int line2) { char skb_desc[128] = { '\0' }; if (0 == (ath_debug_global & GLOBAL_DEBUG_SKB_REF)) @@ -263,9 +263,9 @@ static void print_skb_trackchange_message( const struct sk_buff *skb, int users_adjustment, - const char* func1, int line1, - const char* func2, int line2, - char* message) + const char *func1, int line1, + const char *func2, int line2, + char *message) { char skb_desc[128] = { '\0' }; if (0 == (ath_debug_global & GLOBAL_DEBUG_SKB)) @@ -286,8 +286,8 @@ static struct sk_buff * track_skb(struct sk_buff *skb, int users_adjustment, - const char* func1, int line1, - const char* func2, int line2) + const char *func1, int line1, + const char *func2, int line2) { if (NULL == skb) { skb_print_message(0 /* show_counter */, @@ -326,8 +326,8 @@ static struct sk_buff * untrack_skb(struct sk_buff *skb, int users_adjustment, - const char* func1, int line1, - const char* func2, int line2) + const char *func1, int line1, + const char *func2, int line2) { if (NULL == skb) { skb_print_message(0 /* show_counter */, @@ -373,8 +373,8 @@ * count as (users - 1). */ static void unref_skb(struct sk_buff *skb, int type, - const char* func1, int line1, - const char* func2, int line2) + const char *func1, int line1, + const char *func2, int line2) { if (NULL == skb) { skb_print_message(0 /* show_counter */, @@ -453,8 +453,8 @@ * atomic_read(&skb->users). */ static struct sk_buff * ref_skb(struct sk_buff *skb, - const char* func1, int line1, - const char* func2, int line2) + const char *func1, int line1, + const char *func2, int line2) { if (NULL == skb) { skb_print_message(0 /* show_counter */, @@ -486,9 +486,9 @@ * - Free the node reference and set it to null. * - Break the linked list, clearing next skb's prev pointer if possible. */ #ifdef IEEE80211_DEBUG_REFCNT -void ieee80211_dev_kfree_skb_debug(struct sk_buff** pskb, const char* func, int line) +void ieee80211_dev_kfree_skb_debug(struct sk_buff **pskb, const char *func, int line) #else -void ieee80211_dev_kfree_skb(struct sk_buff** pskb) +void ieee80211_dev_kfree_skb(struct sk_buff **pskb) #endif { struct sk_buff *skb; @@ -527,10 +527,10 @@ * a list of skbs, starting with the first. */ #ifdef IEEE80211_DEBUG_REFCNT void -ieee80211_dev_kfree_skb_list_debug(struct sk_buff** pskb, const char* func, int line) +ieee80211_dev_kfree_skb_list_debug(struct sk_buff **pskb, const char *func, int line) #else void -ieee80211_dev_kfree_skb_list(struct sk_buff** pskb) +ieee80211_dev_kfree_skb_list(struct sk_buff **pskb) #endif { struct sk_buff *skb, *tskb; @@ -554,10 +554,10 @@ } #ifdef IEEE80211_DEBUG_REFCNT -struct sk_buff* -ieee80211_dev_alloc_skb_debug(int size, const char* func, int line) +struct sk_buff * +ieee80211_dev_alloc_skb_debug(int size, const char *func, int line) #else -struct sk_buff* +struct sk_buff * ieee80211_dev_alloc_skb(int size) #endif { @@ -584,7 +584,7 @@ #ifdef IEEE80211_DEBUG_REFCNT void -ieee80211_skb_track_debug(struct sk_buff *skb, const char* func, int line) { +ieee80211_skb_track_debug(struct sk_buff *skb, const char *func, int line) { track_skb(skb, 0 /* users_adjustment */, func, line, __func__, __LINE__); } @@ -598,7 +598,7 @@ #ifdef IEEE80211_DEBUG_REFCNT void -ieee80211_skb_untrack_debug(struct sk_buff *skb, const char* func, int line) { +ieee80211_skb_untrack_debug(struct sk_buff *skb, const char *func, int line) { untrack_skb(skb, 0 /* users_adjustment */, func, line, __func__, __LINE__); } @@ -630,15 +630,15 @@ #ifdef IEEE80211_DEBUG_REFCNT -int vlan_hwaccel_receive_skb_debug(struct sk_buff *skb, +int vlan_hwaccel_rx_debug(struct sk_buff *skb, struct vlan_group *grp, unsigned short vlan_tag, - const char* func, int line) { - return vlan_hwaccel_receive_skb( + const char *func, int line) { + return vlan_hwaccel_rx( untrack_skb(skb, 0, func, line, __func__, __LINE__), grp, vlan_tag); } -int netif_rx_debug(struct sk_buff *skb, const char* func, int line) { +int netif_rx_debug(struct sk_buff *skb, const char *func, int line) { return netif_rx(untrack_skb(skb, 0, func, line, __func__, __LINE__)); } @@ -725,7 +725,7 @@ } void kfree_skb_fast_debug(struct sk_buff *skb, - const char* func, int line) + const char *func, int line) { /* NOT so fast... */ unref_skb(skb, UNREF_USE_DEV_KFREE_SKB_ANY, func, line, __func__, __LINE__); @@ -759,7 +759,7 @@ func, line, __func__, __LINE__); } -EXPORT_SYMBOL(vlan_hwaccel_receive_skb_debug); +EXPORT_SYMBOL(vlan_hwaccel_rx_debug); EXPORT_SYMBOL(netif_rx_debug); EXPORT_SYMBOL(alloc_skb_debug); EXPORT_SYMBOL(dev_alloc_skb_debug); Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -66,7 +66,7 @@ /* SKBs on the power save queue are tagged with an age and * timed out. We reuse the hardware checksum field in the * mbuf packet header to store this data. - * XXX: use private cb area. */ + * XXX: use private CB area. */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) #define skb_age csum_offset #else @@ -84,9 +84,9 @@ #ifdef IEEE80211_DEBUG_REFCNT #define ieee80211_dev_kfree_skb(_pskb) \ ieee80211_dev_kfree_skb_debug(_pskb, __func__, __LINE__) -void ieee80211_dev_kfree_skb_debug(struct sk_buff** pskb, const char* func, int line); +void ieee80211_dev_kfree_skb_debug(struct sk_buff **pskb, const char *func, int line); #else -void ieee80211_dev_kfree_skb(struct sk_buff** pskb); +void ieee80211_dev_kfree_skb(struct sk_buff **pskb); #endif static inline void ieee80211_skb_copy_noderef(struct sk_buff *src, @@ -96,24 +96,22 @@ SKB_NI(dst) = ieee80211_ref_node(SKB_NI(src)); } -/* - * ieee80211_dev_kfree_skb_list will invoke ieee80211_dev_kfree_skb on each node in - * a list of skbs, starting with the first. -*/ +/* ieee80211_dev_kfree_skb_list will invoke ieee80211_dev_kfree_skb on each node in + * a list of skbs, starting with the first. */ #ifdef IEEE80211_DEBUG_REFCNT #define ieee80211_dev_kfree_skb_list(_pskb) \ ieee80211_dev_kfree_skb_list_debug(_pskb, __func__, __LINE__) -void ieee80211_dev_kfree_skb_list_debug(struct sk_buff** pskb, const char* func, int line); +void ieee80211_dev_kfree_skb_list_debug(struct sk_buff **pskb, const char *func, int line); #else -void ieee80211_dev_kfree_skb_list(struct sk_buff** pskb); +void ieee80211_dev_kfree_skb_list(struct sk_buff **pskb); #endif #ifdef IEEE80211_DEBUG_REFCNT #define ieee80211_dev_alloc_skb(_size) \ ieee80211_dev_alloc_skb_debug(_size, __func__, __LINE__) -struct sk_buff* ieee80211_dev_alloc_skb_debug(int size, const char* func, int line); +struct sk_buff *ieee80211_dev_alloc_skb_debug(int size, const char *func, int line); #else -struct sk_buff* ieee80211_dev_alloc_skb(int size); +struct sk_buff *ieee80211_dev_alloc_skb(int size); #endif #ifdef IEEE80211_DEBUG_REFCNT @@ -122,9 +120,9 @@ #define ieee80211_skb_untrack(_skb) \ ieee80211_skb_untrack_debug(_skb, __func__, __LINE__) void ieee80211_skb_track_debug(struct sk_buff *skb, - const char* func, int line); + const char *func, int line); void ieee80211_skb_untrack_debug(struct sk_buff *skb, - const char* func, int line); + const char *func, int line); #else void ieee80211_skb_track(struct sk_buff *skb); void ieee80211_skb_untrack(struct sk_buff *skb); @@ -144,35 +142,34 @@ #ifdef IEEE80211_DEBUG_REFCNT -int vlan_hwaccel_receive_skb_debug(struct sk_buff *skb, - struct vlan_group *grp, unsigned short vlan_tag, - const char* func, int line); -int netif_rx_debug(struct sk_buff *skb, const char* func, int line); -struct sk_buff * alloc_skb_debug(unsigned int length, gfp_t gfp_mask, - const char *func, int line); -struct sk_buff * dev_alloc_skb_debug(unsigned int length, - const char *func, int line); -struct sk_buff * skb_clone_debug(struct sk_buff *skb, gfp_t pri, - const char *func, int line); -struct sk_buff * skb_copy_debug(struct sk_buff *skb, gfp_t pri, - const char *func, int line); -struct sk_buff * skb_get_debug(struct sk_buff *skb, - const char *func, int line); -struct sk_buff * skb_realloc_headroom_debug(struct sk_buff *skb, unsigned int headroom, - const char *func, int line); -struct sk_buff * pskb_copy_debug(struct sk_buff *skb, gfp_t pri, - const char *func, int line); +int vlan_hwaccel_rx_debug(struct sk_buff *skb, struct vlan_group *grp, + unsigned short vlan_tag, const char *func, int line); +int netif_rx_debug(struct sk_buff *skb, const char *func, int line); +struct sk_buff *alloc_skb_debug(unsigned int length, gfp_t gfp_mask, + const char *func, int line); +struct sk_buff *dev_alloc_skb_debug(unsigned int length, + const char *func, int line); +struct sk_buff *skb_clone_debug(struct sk_buff *skb, gfp_t pri, + const char *func, int line); +struct sk_buff *skb_copy_debug(struct sk_buff *skb, gfp_t pri, + const char *func, int line); +struct sk_buff *skb_get_debug(struct sk_buff *skb, + const char *func, int line); +struct sk_buff *skb_realloc_headroom_debug(struct sk_buff *skb, unsigned int headroom, + const char *func, int line); +struct sk_buff *pskb_copy_debug(struct sk_buff *skb, gfp_t pri, + const char *func, int line); int dev_queue_xmit_debug(struct sk_buff *skb, - const char *func, int line); -struct sk_buff * skb_share_check_debug(struct sk_buff *skb, gfp_t pri, - const char *func, int line); -void kfree_skb_fast_debug(struct sk_buff *skb, - const char* func, int line); -struct sk_buff * skb_unshare_debug(struct sk_buff *skb, gfp_t pri, - const char *func, int line); -struct sk_buff * skb_copy_expand_debug(const struct sk_buff *skb, int newheadroom, - int newtailroom, gfp_t gfp_mask, - const char *func, int line); + const char *func, int line); +struct sk_buff *skb_share_check_debug(struct sk_buff *skb, gfp_t pri, + const char *func, int line); +void kfree_skb_fast_debug(struct sk_buff *skb, + const char *func, int line); +struct sk_buff *skb_unshare_debug(struct sk_buff *skb, gfp_t pri, + const char *func, int line); +struct sk_buff *skb_copy_expand_debug(const struct sk_buff *skb, int newheadroom, + int newtailroom, gfp_t gfp_mask, + const char *func, int line); #undef alloc_skb #undef dev_alloc_skb @@ -191,14 +188,14 @@ #undef skb_realloc_headroom #undef skb_share_check #undef skb_unshare -#undef vlan_hwaccel_receive_skb +#undef vlan_hwaccel_rx #define skb_unshare(_skb, _pri) \ skb_unshare_debug(_skb, _pri, __func__, __LINE__) #define skb_copy_expand(_skb, _newheadroom, _newtailroom, _gfp_mask) \ skb_copy_expand_debug(_skb, _newheadroom, _newtailroom, _gfp_mask, __func__, __LINE__) -#define vlan_hwaccel_receive_skb(_skb, _grp, _tag) \ - vlan_hwaccel_receive_skb_debug(_skb, _grp, _tag, __func__, __LINE__) +#define vlan_hwaccel_rx(_skb, _grp, _tag) \ + vlan_hwaccel_rx_debug(_skb, _grp, _tag, __func__, __LINE__) #define netif_rx(_skb) \ netif_rx_debug(_skb, __func__, __LINE__) #define alloc_skb(_length, _gfp_mask) \ Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_var.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_var.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_var.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -87,7 +87,7 @@ IEEE80211_BMISSTHRESH_BMIN : (_bmt)) #define IEEE80211_BGSCAN_INTVAL_MIN 15 /* min bg scan intvl (secs) */ -#define IEEE80211_BGSCAN_INTVAL_DEFAULT (5*60) /* default bg scan intvl */ +#define IEEE80211_BGSCAN_INTVAL_DEFAULT (5 * 60) /* default BG scan int. */ #define IEEE80211_BGSCAN_IDLE_MIN 100 /* min idle time (ms) */ #define IEEE80211_BGSCAN_IDLE_DEFAULT 250 /* default idle time (ms) */ @@ -239,7 +239,7 @@ u_int16_t iv_sta_assoc; /* stations associated */ u_int16_t iv_ps_sta; /* stations in power save */ u_int16_t iv_ps_pending; /* PS STAs w/ pending frames */ - u_int8_t *iv_tim_bitmap; /* power-save stations w/ data*/ + u_int8_t *iv_tim_bitmap; /* power-save stations w/ data */ u_int16_t iv_tim_len; /* ic_tim_bitmap size (bytes) */ u_int8_t iv_dtim_period; /* DTIM period */ u_int8_t iv_dtim_count; /* DTIM count from last bcn */ @@ -317,7 +317,7 @@ u_int32_t ic_caps; /* capabilities */ u_int8_t ic_ath_cap; /* Atheros adv. capabilities */ u_int8_t ic_promisc; /* VAPs needing promisc mode */ - u_int8_t ic_allmulti; /* VAPs needing all multicast*/ + u_int8_t ic_allmulti; /* VAPs needing all multicast */ u_int8_t ic_nopened; /* VAPs been opened */ struct ieee80211_rateset ic_sup_rates[IEEE80211_MODE_MAX]; struct ieee80211_rateset ic_sup_xr_rates; @@ -376,13 +376,13 @@ * association of the STA and disassociation of x other STAs (out of * y associated STAs in total), the number of common channel * increases by z, then such an action is performed if - * 1000*x/y < z*ic_sc_slcg + * 1000 * x/y < z * ic_sc_slcg * ic_sc_sldg is the permil of Stations Lost per rssi Db Gained, the * parameter used by SC_LOOSE algorithm. If due to the switch, * the maximum RSSI of received packets on the current channel would * decrease by z decibels and x stations from the set of y stations * would be lost, then such a switch will be performed if - * 1000*x/y < z*ic_sc_sldg + * 1000 * x/y < z * ic_sc_sldg * ic_sc_ie is the Supported Channels IE that is about to be sent along * with (re)assoc requests (STA mode) */ @@ -466,11 +466,11 @@ int32_t (*ic_node_count)(struct ieee80211com *); #ifdef IEEE80211_DEBUG_REFCNT struct ieee80211_node *(*ic_node_alloc_debug)(struct ieee80211vap *, - const char* func, int line); + const char *func, int line); void (*ic_node_cleanup_debug)(struct ieee80211_node *, - const char* func, int line); + const char *func, int line); void (*ic_node_free_debug)(struct ieee80211_node *, - const char* func, int line); + const char *func, int line); #else struct ieee80211_node *(*ic_node_alloc)(struct ieee80211vap *); void (*ic_node_cleanup)(struct ieee80211_node *); Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_wireless.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_wireless.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_wireless.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -166,7 +166,7 @@ * to be base zero. */ static int -getiwkeyix(struct ieee80211vap *vap, const struct iw_point* erq, ieee80211_keyix_t *rkix) +getiwkeyix(struct ieee80211vap *vap, const struct iw_point *erq, ieee80211_keyix_t *rkix) { ieee80211_keyix_t kix; @@ -912,7 +912,7 @@ struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni = vap->iv_bss; - struct iw_range *range = (struct iw_range *) extra; + struct iw_range *range = (struct iw_range *)extra; struct ieee80211_rateset *rs; u_int8_t reported[IEEE80211_CHAN_BYTES]; /* XXX stack usage? */ int i, r; @@ -1100,8 +1100,8 @@ unsigned int number = vap->iv_spy.num; int i; - address = (struct sockaddr *) extra; - spy_stat = (struct iw_quality *) (extra + number * sizeof(struct sockaddr)); + address = (struct sockaddr *)extra; + spy_stat = (struct iw_quality *)(extra + number * sizeof(struct sockaddr)); for (i = 0; i < number; i++) { memcpy(address[i].sa_data, &vap->iv_spy.mac[i * IEEE80211_ADDR_LEN], @@ -1184,7 +1184,7 @@ struct ieee80211com *ic = vap->iv_ic; struct iw_thrspy *threshold; - threshold = (struct iw_thrspy *) extra; + threshold = (struct iw_thrspy *)extra; /* set threshold values */ set_quality(&(threshold->low), vap->iv_spy.thr_low, ic->ic_channoise); @@ -1431,7 +1431,7 @@ ieee80211_get_txcont(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; params[0] = ic->ic_get_txcont(ic); @@ -1442,7 +1442,7 @@ ieee80211_get_dfs_cac_time(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; params[0] = ic->ic_get_dfs_cac_time(ic); @@ -1453,7 +1453,7 @@ ieee80211_get_dfs_excl_period(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; params[0] = ic->ic_get_dfs_excl_period(ic); @@ -1463,7 +1463,7 @@ ieee80211_set_dfs_cac_time(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; ic->ic_set_dfs_cac_time(ic, params[1]); @@ -1473,7 +1473,7 @@ ieee80211_set_dfs_excl_period (struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; ic->ic_set_dfs_excl_period(ic, params[1]); @@ -1484,7 +1484,7 @@ ieee80211_get_dfs_testmode(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; params[0] = ic->ic_get_dfs_testmode(ic); @@ -1495,7 +1495,7 @@ ieee80211_get_txcont_rate(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; params[0] = ic->ic_get_txcont_rate(ic); @@ -1506,7 +1506,7 @@ ieee80211_set_txcont(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; ic->ic_set_txcont(ic, params[1]); @@ -1517,7 +1517,7 @@ ieee80211_set_dfs_testmode(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; ic->ic_set_dfs_testmode(ic, params[1]); @@ -1528,7 +1528,7 @@ ieee80211_set_txcont_rate(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; ic->ic_set_txcont_rate(ic, params[1]); @@ -1539,7 +1539,7 @@ ieee80211_set_txcont_power(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; ic->ic_set_txcont_power(ic, params[1]); @@ -1550,7 +1550,7 @@ ieee80211_get_txcont_power(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; params[0] = ic->ic_get_txcont_power(ic); @@ -1561,7 +1561,7 @@ ieee80211_ioctl_hal_map(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; params[0] = ic->ic_dump_hal_map(ic); @@ -1573,7 +1573,7 @@ ieee80211_ioctl_radar(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - int *params = (int*) extra; + int *params = (int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; if (!(ic->ic_flags & IEEE80211_F_DOTH)) @@ -1600,7 +1600,7 @@ static int ieee80211_dump_registers(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - unsigned int *params = (unsigned int*) extra; + unsigned int *params = (unsigned int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; switch (params[1]) { @@ -1623,7 +1623,7 @@ static int ieee80211_ioctl_writereg(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - unsigned int *params = (unsigned int*) extra; + unsigned int *params = (unsigned int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; return ic->ic_write_register(ic, params[0], params[1]); @@ -1634,7 +1634,7 @@ static int ieee80211_ioctl_readreg(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) { - unsigned int *params = (unsigned int*) extra; + unsigned int *params = (unsigned int *)extra; struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; return ic->ic_read_register(ic, params[0], ¶ms[0]); @@ -1819,7 +1819,7 @@ iwe.u.data.flags = 1; iwe.u.data.length = se->se_ssid[1]; current_ev = iwe_stream_add_point(current_ev, - end_buf, &iwe, (char *) se->se_ssid+2); + end_buf, &iwe, (char *)se->se_ssid + 2); /* We ran out of space in the buffer. */ if (last_ev == current_ev) @@ -2269,7 +2269,7 @@ struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn; - unsigned int *i = (unsigned int *) extra; + unsigned int *i = (unsigned int *)extra; unsigned int param = i[0]; /* parameter id is 1st */ unsigned int value = i[1]; /* NB: most values are TYPE_INT */ int retv = 0; @@ -2952,7 +2952,7 @@ struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn; - unsigned int *param = (unsigned int *) extra; + unsigned int *param = (unsigned int *)extra; switch (param[0]) { case IEEE80211_PARAM_AUTHMODE: @@ -4009,7 +4009,7 @@ struct iw_request_info *info, void *w, char *extra) { struct ieee80211vap *vap = dev->priv; - unsigned int *param = (unsigned int *) extra; + unsigned int *param = (unsigned int *)extra; unsigned int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE; unsigned int bss = param[2]; struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme; @@ -4097,7 +4097,7 @@ struct iw_request_info *info, void *w, char *extra) { struct ieee80211vap *vap = dev->priv; - unsigned int *param = (unsigned int *) extra; + unsigned int *param = (unsigned int *)extra; unsigned int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE; struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme; struct chanAccParams *chanParams = (param[2] == 0) ? @@ -4490,7 +4490,7 @@ { struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; - unsigned int *param = (unsigned int *) extra; + unsigned int *param = (unsigned int *)extra; if (!(ic->ic_flags & IEEE80211_F_DOTH)) return 0; @@ -4525,7 +4525,7 @@ memcpy(mlme.im_macaddr, wextmlme->addr.sa_data, IEEE80211_ADDR_LEN); - return ieee80211_ioctl_setmlme(dev, NULL, NULL, (char*)&mlme); + return ieee80211_ioctl_setmlme(dev, NULL, NULL, (char *)&mlme); } @@ -4567,7 +4567,7 @@ else args[1] = 0; - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } static int @@ -4618,7 +4618,7 @@ dev->name, iwciph); return -EINVAL; } - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } /* TODO We don't enforce wep key lengths. */ @@ -4636,7 +4636,7 @@ dev->name, iwciph); return -EINVAL; } - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } static int @@ -4653,7 +4653,7 @@ if (iwkm & IW_AUTH_KEY_MGMT_PSK) args[1] |= WPA_ASE_8021X_PSK; - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } static int @@ -4663,7 +4663,7 @@ int args[2]; args[0] = IEEE80211_PARAM_COUNTERMEASURES; args[1] = erq->value; - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } static int @@ -4673,7 +4673,7 @@ int args[2]; args[0] = IEEE80211_PARAM_DROPUNENCRYPTED; args[1] = erq->value; - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } @@ -4700,7 +4700,7 @@ } else { args[1] = IEEE80211_AUTH_OPEN; } - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } static int @@ -4716,7 +4716,7 @@ else args[1] = 0; /* disable WPA1 and WPA2 */ - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } static int @@ -4732,7 +4732,7 @@ else args[1] = 0; - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } static int @@ -4753,7 +4753,7 @@ default: return -EINVAL; } - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } static int @@ -4763,7 +4763,7 @@ int args[2]; args[0] = IEEE80211_PARAM_PRIVACY; args[1] = erq->value; - return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); + return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); } /* @@ -4833,7 +4833,7 @@ int rc; int arg = IEEE80211_PARAM_WPA; - rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char*)&arg); + rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); if (rc) return rc; @@ -4863,7 +4863,7 @@ int rc; int arg = IEEE80211_PARAM_UCASTCIPHER; - rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char*)&arg); + rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); if (rc) return rc; @@ -4881,7 +4881,7 @@ int rc; int arg = IEEE80211_PARAM_MCASTCIPHER; - rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char*)&arg); + rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); if (rc) return rc; @@ -4899,7 +4899,7 @@ int rc; arg = IEEE80211_PARAM_KEYMGTALGS; - rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char*)&arg); + rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); if (rc) return rc; erq->value = 0; @@ -4918,7 +4918,7 @@ int rc; arg = IEEE80211_PARAM_COUNTERMEASURES; - rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char*)&arg); + rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); if (rc) return rc; erq->value = arg; @@ -4932,7 +4932,7 @@ int arg; int rc; arg = IEEE80211_PARAM_DROPUNENCRYPTED; - rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char*)&arg); + rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); if (rc) return rc; erq->value = arg; @@ -4953,7 +4953,7 @@ int rc; int arg = IEEE80211_PARAM_WPA; - rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char*)&arg); + rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); if (rc) return rc; @@ -4977,7 +4977,7 @@ int arg; arg = IEEE80211_PARAM_ROAMING; - rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char*)&arg); + rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); if (rc) return rc; @@ -5001,7 +5001,7 @@ int rc; int arg; arg = IEEE80211_PARAM_PRIVACY; - rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char*)&arg); + rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); if (rc) return rc; erq->value = arg; @@ -5147,7 +5147,7 @@ dk.idk_keyix = kix; memcpy(&dk.idk_macaddr, ext->addr.sa_data, IEEE80211_ADDR_LEN); - return ieee80211_ioctl_delkey(dev, NULL, NULL, (char*)&dk); + return ieee80211_ioctl_delkey(dev, NULL, NULL, (char *)&dk); } /* TODO This memcmp for the broadcast address seems hackish, but @@ -5224,7 +5224,7 @@ memcpy(&kr.ik_keyrsc, ext->rx_seq, sizeof(kr.ik_keyrsc)); } - return ieee80211_ioctl_setkey(dev, NULL, NULL, (char*)&kr); + return ieee80211_ioctl_setkey(dev, NULL, NULL, (char *)&kr); } #endif /* WIRELESS_EXT >= 18 */ @@ -5752,11 +5752,11 @@ }; static struct iw_handler_def ieee80211_iw_handler_def = { - .standard = (iw_handler *) ieee80211_handlers, + .standard = (iw_handler *)ieee80211_handlers, .num_standard = ARRAY_SIZE(ieee80211_handlers), - .private = (iw_handler *) ieee80211_priv_handlers, + .private = (iw_handler *)ieee80211_priv_handlers, .num_private = ARRAY_SIZE(ieee80211_priv_handlers), - .private_args = (struct iw_priv_args *) ieee80211_priv_args, + .private_args = (struct iw_priv_args *)ieee80211_priv_args, .num_private_args = ARRAY_SIZE(ieee80211_priv_args), #if IW_HANDLER_VERSION >= 7 .get_wireless_stats = ieee80211_iw_getstats, @@ -5782,13 +5782,13 @@ vap->iv_ic->ic_vap_delete(vap); return 0; case IEEE80211_IOCTL_GETKEY: - return ieee80211_ioctl_getkey(dev, (struct iwreq *) ifr); + return ieee80211_ioctl_getkey(dev, (struct iwreq *)ifr); case IEEE80211_IOCTL_GETWPAIE: - return ieee80211_ioctl_getwpaie(dev, (struct iwreq *) ifr); + return ieee80211_ioctl_getwpaie(dev, (struct iwreq *)ifr); case IEEE80211_IOCTL_STA_STATS: - return ieee80211_ioctl_getstastats(dev, (struct iwreq *) ifr); + return ieee80211_ioctl_getstastats(dev, (struct iwreq *)ifr); case IEEE80211_IOCTL_STA_INFO: - return ieee80211_ioctl_getstainfo(dev, (struct iwreq *) ifr); + return ieee80211_ioctl_getstainfo(dev, (struct iwreq *)ifr); case IEEE80211_IOCTL_SCAN_RESULTS: return ieee80211_ioctl_getscanresults(dev, (struct iwreq *)ifr); } @@ -5828,7 +5828,7 @@ * outside our control (e.g. in the driver). * Must be called with rtnl_lock held */ -struct ieee80211vap* +struct ieee80211vap * ieee80211_create_vap(struct ieee80211com *ic, char *name, struct net_device *mdev, int opmode, int opflags) { Modified: madwifi/branches/madwifi-hal-0.10.5.6/net80211/if_media.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/net80211/if_media.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/net80211/if_media.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -192,7 +192,7 @@ struct ifmedia *ifm, u_long cmd) { struct ifmedia_entry *match; - struct ifmediareq *ifmr = (struct ifmediareq *) ifr; + struct ifmediareq *ifmr = (struct ifmediareq *)ifr; int error = 0, sticky; if (dev == NULL || ifr == NULL || ifm == NULL) Modified: madwifi/branches/madwifi-hal-0.10.5.6/regression/wep/test_wep.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/regression/wep/test_wep.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/regression/wep/test_wep.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -257,7 +257,7 @@ /* * Encrypt frame. */ - ctx = (struct wep_ctx_hw *) key->wk_private; + ctx = (struct wep_ctx_hw *)key->wk_private; memcpy(&ctx->wc_iv, t->iv, sizeof(t->iv)); /* for encap/encrypt */ if (!(*cip->ic_encap)(key, skb, t->keyix << 6)) { printk("FAIL: wep encap failed\n"); Modified: madwifi/branches/madwifi-hal-0.10.5.6/tools/80211debug.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/tools/80211debug.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/tools/80211debug.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -168,7 +168,7 @@ if (fd == NULL) return -1; /* XXX: only handle ints */ - if (fscanf(fd, "%u", (int *) oldp) != 1) { + if (fscanf(fd, "%u", (int *)oldp) != 1) { fclose(fd); return -1; } Modified: madwifi/branches/madwifi-hal-0.10.5.6/tools/80211stats.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/tools/80211stats.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/tools/80211stats.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -174,14 +174,14 @@ (void) memset(&iwr, 0, sizeof(iwr)); (void) strncpy(iwr.ifr_name, ifr.ifr_name, sizeof(iwr.ifr_name)); - iwr.u.data.pointer = (void *) &stats; + iwr.u.data.pointer = (void *)&stats; iwr.u.data.length = sizeof(stats); memcpy(stats.is_u.macaddr, macaddr, IEEE80211_ADDR_LEN); if (ioctl(s, IEEE80211_IOCTL_STA_STATS, &iwr) < 0) err(1, "unable to get station stats for %s", - ether_ntoa((const struct ether_addr*) macaddr)); + ether_ntoa((const struct ether_addr*)macaddr)); - fprintf(fd, "%s:\n", ether_ntoa((const struct ether_addr*) macaddr)); + fprintf(fd, "%s:\n", ether_ntoa((const struct ether_addr *)macaddr)); sep = "\t"; STAT(rx_data, "%u"); @@ -294,7 +294,7 @@ */ (void) memset(&iwr, 0, sizeof(iwr)); (void) strncpy(iwr.ifr_name, ifr.ifr_name, sizeof(iwr.ifr_name)); - iwr.u.data.pointer = (void *) buf; + iwr.u.data.pointer = (void *)buf; iwr.u.data.length = sizeof(buf); if (ioctl(s, IEEE80211_IOCTL_STA_INFO, &iwr) < 0) err(1, "unable to get station information"); @@ -302,7 +302,7 @@ if (len >= sizeof(struct ieee80211req_sta_info)) { cp = buf; do { - si = (struct ieee80211req_sta_info *) cp; + si = (struct ieee80211req_sta_info *)cp; print_sta_stats(stdout, si->isi_macaddr); cp += si->isi_len, len -= si->isi_len; } while (len >= sizeof(struct ieee80211req_sta_info)); Modified: madwifi/branches/madwifi-hal-0.10.5.6/tools/athdebug.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/tools/athdebug.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/tools/athdebug.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -177,7 +177,7 @@ if (fd == NULL) return -1; /* XXX: only handle ints */ - if (fscanf(fd, "%u", (int *) oldp) != 1) { + if (fscanf(fd, "%u", (int *)oldp) != 1) { fclose(fd); return -1; } Modified: madwifi/branches/madwifi-hal-0.10.5.6/tools/athstats.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/tools/athstats.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/tools/athstats.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -68,7 +68,7 @@ static const struct { u_int phyerr; - const char* desc; + const char *desc; } phyerrdescriptions[] = { { HAL_PHYERR_UNDERRUN, "transmit underrun" }, { HAL_PHYERR_TIMING, "timing error" }, @@ -177,7 +177,7 @@ } static u_int -getifrate(int s, const char* ifname) +getifrate(int s, const char *ifname) { struct iwreq wrq; Modified: madwifi/branches/madwifi-hal-0.10.5.6/tools/wireless_copy.h =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/tools/wireless_copy.h 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/tools/wireless_copy.h 2008-06-12 17:44:56 UTC (rev 3722) @@ -519,7 +519,7 @@ /* Retry limits and lifetime flags available */ #define IW_RETRY_ON 0x0000 /* No details... */ #define IW_RETRY_TYPE 0xF000 /* Type of parameter */ -#define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries*/ +#define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries */ #define IW_RETRY_LIFETIME 0x2000 /* Maximum duration of retries in us */ #define IW_RETRY_MODIFIER 0x000F /* Modify a parameter */ #define IW_RETRY_MIN 0x0001 /* Value is a minimum */ @@ -1083,8 +1083,8 @@ /* iw_point events are special. First, the payload (extra data) come at * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second, * we omit the pointer, so start at an offset. */ -#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \ - (char *) NULL) +#define IW_EV_POINT_OFF (((char *)&(((struct iw_point *)NULL)->length)) - \ + (char *)NULL) #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ IW_EV_POINT_OFF) Modified: madwifi/branches/madwifi-hal-0.10.5.6/tools/wlanconfig.c =================================================================== --- madwifi/branches/madwifi-hal-0.10.5.6/tools/wlanconfig.c 2008-06-12 14:50:36 UTC (rev 3721) +++ madwifi/branches/madwifi-hal-0.10.5.6/tools/wlanconfig.c 2008-06-12 17:44:56 UTC (rev 3722) @@ -173,7 +173,7 @@ free(if_base); if_base = NULL; - ifr.ifr_data = (void *) &cp; + ifr.ifr_data = (void *)&cp; vap_create(&ifr); printf("%s\n", ifr.ifr_name); } else if (streq(cmd, "destroy")) { @@ -434,12 +434,12 @@ } static void -printie(const char* tag, const uint8_t *ie, size_t ielen, int maxlen) +printie(const char *tag, const uint8_t *ie, size_t ielen, int maxlen) { printf("%s", tag); if (verbose) { - maxlen -= strlen(tag)+2; - if (2*ielen > maxlen) + maxlen -= strlen(tag) + 2; + if (2 * ielen > maxlen) maxlen--; printf("<"); for (; ielen > 0; ie++, ielen--) { @@ -565,7 +565,7 @@ static void list_stations(const char *ifname) { - uint8_t buf[24*1024]; + uint8_t buf[24 * 1024]; struct iwreq iwr; uint8_t *cp; int s, len; @@ -576,7 +576,7 @@ (void) memset(&iwr, 0, sizeof(iwr)); (void) strncpy(iwr.ifr_name, ifname, sizeof(iwr.ifr_name)); - iwr.u.data.pointer = (void *) buf; + iwr.u.data.pointer = (void *)buf; iwr.u.data.length = sizeof(buf); if (ioctl(s, IEEE80211_IOCTL_STA_INFO, &iwr) < 0) errx(1, "unable to get station information"); @@ -607,7 +607,7 @@ struct ieee80211req_sta_info *si; uint8_t *vp; - si = (struct ieee80211req_sta_info *) cp; + si = (struct ieee80211req_sta_info *)cp; vp = (u_int8_t *)(si+1); printf("%s %4u %4d %3dM %4d %4d %5d %6d %7d %6d %7d %-4.4s %-5.5s %3x %8x %8s", ieee80211_ntoa(si->isi_macaddr), @@ -683,8 +683,8 @@ struct ieee80211req_scan_result *sr; uint8_t *vp; - sr = (struct ieee80211req_scan_result *) cp; - vp = (u_int8_t *)(sr+1); + sr = (struct ieee80211req_scan_result *)cp; + vp = (u_int8_t *)(sr + 1); printf("%-14.*s %s %3d %3dM %2d:%-2d %3d %-4.4s", copy_essid(ssid, sizeof(ssid), vp, sr->isr_ssid_len), ssid, |
From: Benoit Papillault <svn-commits@ma...> - 2008-06-15 09:51:20
|
Project : madwifi Revision : 3723 Author : benoit (Benoit Papillault) Date : 2008-06-13 14:36:32 +0200 (Fri, 13 Jun 2008) Log Message : Fixed a compiling bug. Patch from XazZ. Affected Files: * madwifi/trunk/ath/Makefile.kernel updated Modified: madwifi/trunk/ath/Makefile.kernel =================================================================== --- madwifi/trunk/ath/Makefile.kernel 2008-06-12 17:44:56 UTC (rev 3722) +++ madwifi/trunk/ath/Makefile.kernel 2008-06-13 12:36:32 UTC (rev 3723) @@ -37,11 +37,11 @@ ifneq ($(VERSION).$(PATCHLEVEL),2.4) obj-$(CONFIG_ATHEROS) += ath_$(BUSNAME).o -ath_$(BUSNAME)-objs := if_ath.o if_ath_radar.o if_ath_$(BUSNAME).o +ath_$(BUSNAME)-objs := if_ath.o if_ath_radar.o if_ath_hal_extensions.o if_ath_$(BUSNAME).o endif ifeq ($(VERSION).$(PATCHLEVEL),2.4) -obj-$(CONFIG_ATHEROS) := if_ath.o if_ath_$(BUSNAME).o +obj-$(CONFIG_ATHEROS) := if_ath.o if_ath_radar.o if_ath_hal_extensions.o if_ath_$(BUSNAME).o O_TARGET := ath_$(BUSNAME).o include $(TOPDIR)/Rules.make |
From: Benoit Papillault <svn-commits@ma...> - 2008-06-15 09:34:49
|
Project : madwifi Revision : 3724 Author : benoit (Benoit Papillault) Date : 2008-06-13 17:09:58 +0200 (Fri, 13 Jun 2008) Log Message : Fix needed for wpa_supplicant. It might not be the best fix. Affected Files: * madwifi/trunk/net80211/ieee80211_scan.c updated Modified: madwifi/trunk/net80211/ieee80211_scan.c =================================================================== --- madwifi/trunk/net80211/ieee80211_scan.c 2008-06-13 12:36:32 UTC (rev 3723) +++ madwifi/trunk/net80211/ieee80211_scan.c 2008-06-13 15:09:58 UTC (rev 3724) @@ -430,6 +430,19 @@ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: %s scan already in progress\n", __func__, ss->ss_flags & IEEE80211_SCAN_ACTIVE ? "active" : "passive"); + + /* If the running scanning has the flag SCAN_NOPICK set, but + * the requested scan has not, then we update the running scan + * flag. This is needed when wpa_supplicant is used with + * ap_scan=1. Without it, the driver will never associate. */ + + if (((flags & IEEE80211_SCAN_NOPICK) == 0) + && (ss->ss_flags & IEEE80211_SCAN_NOPICK)) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, + "%s: clearing SCAN_NOPICK flag\n", + __func__); + ss->ss_flags &= ~IEEE80211_SCAN_NOPICK; + } } scanning = (ic->ic_flags & IEEE80211_F_SCAN); |