if_ath.c (220185) | if_ath.c (220324) |
---|---|
1/*- 2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 220185 2011-03-31 08:07:13Z adrian $"); | 31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 220324 2011-04-04 14:52:31Z adrian $"); |
32 33/* 34 * Driver for the Atheros Wireless LAN controller. 35 * 36 * This software is derived from work of Atsushi Onoe; his contribution 37 * is greatly appreciated. 38 */ 39 --- 550 unchanged lines hidden (view full) --- 590 /* 591 * Check for misc other capabilities. 592 */ 593 if (ath_hal_hasbursting(ah)) 594 ic->ic_caps |= IEEE80211_C_BURST; 595 sc->sc_hasbmask = ath_hal_hasbssidmask(ah); 596 sc->sc_hasbmatch = ath_hal_hasbssidmatch(ah); 597 sc->sc_hastsfadd = ath_hal_hastsfadjust(ah); | 32 33/* 34 * Driver for the Atheros Wireless LAN controller. 35 * 36 * This software is derived from work of Atsushi Onoe; his contribution 37 * is greatly appreciated. 38 */ 39 --- 550 unchanged lines hidden (view full) --- 590 /* 591 * Check for misc other capabilities. 592 */ 593 if (ath_hal_hasbursting(ah)) 594 ic->ic_caps |= IEEE80211_C_BURST; 595 sc->sc_hasbmask = ath_hal_hasbssidmask(ah); 596 sc->sc_hasbmatch = ath_hal_hasbssidmatch(ah); 597 sc->sc_hastsfadd = ath_hal_hastsfadjust(ah); |
598 sc->sc_rxslink = ath_hal_self_linked_final_rxdesc(ah); |
|
598 if (ath_hal_hasfastframes(ah)) 599 ic->ic_caps |= IEEE80211_C_FF; 600 wmodes = ath_hal_getwirelessmodes(ah); 601 if (wmodes & (HAL_MODE_108G|HAL_MODE_TURBO)) 602 ic->ic_caps |= IEEE80211_C_TURBOP; 603#ifdef IEEE80211_SUPPORT_TDMA 604 if (ath_hal_macversion(ah) > 0x78) { 605 ic->ic_caps |= IEEE80211_C_TDMA; /* capable of TDMA */ --- 2524 unchanged lines hidden (view full) --- 3130 * each descriptor as self-linked and add it to the end. As 3131 * each additional descriptor is added the previous self-linked 3132 * entry is ``fixed'' naturally. This should be safe even 3133 * if DMA is happening. When processing RX interrupts we 3134 * never remove/process the last, self-linked, entry on the 3135 * descriptor list. This insures the hardware always has 3136 * someplace to write a new frame. 3137 */ | 599 if (ath_hal_hasfastframes(ah)) 600 ic->ic_caps |= IEEE80211_C_FF; 601 wmodes = ath_hal_getwirelessmodes(ah); 602 if (wmodes & (HAL_MODE_108G|HAL_MODE_TURBO)) 603 ic->ic_caps |= IEEE80211_C_TURBOP; 604#ifdef IEEE80211_SUPPORT_TDMA 605 if (ath_hal_macversion(ah) > 0x78) { 606 ic->ic_caps |= IEEE80211_C_TDMA; /* capable of TDMA */ --- 2524 unchanged lines hidden (view full) --- 3131 * each descriptor as self-linked and add it to the end. As 3132 * each additional descriptor is added the previous self-linked 3133 * entry is ``fixed'' naturally. This should be safe even 3134 * if DMA is happening. When processing RX interrupts we 3135 * never remove/process the last, self-linked, entry on the 3136 * descriptor list. This insures the hardware always has 3137 * someplace to write a new frame. 3138 */ |
3139 /* 3140 * 11N: we can no longer afford to self link the last descriptor. 3141 * MAC acknowledges BA status as long as it copies frames to host 3142 * buffer (or rx fifo). This can incorrectly acknowledge packets 3143 * to a sender if last desc is self-linked. 3144 */ |
|
3138 ds = bf->bf_desc; | 3145 ds = bf->bf_desc; |
3139 ds->ds_link = bf->bf_daddr; /* link to self */ | 3146 if (sc->sc_rxslink) 3147 ds->ds_link = bf->bf_daddr; /* link to self */ 3148 else 3149 ds->ds_link = 0; /* terminate the list */ |
3140 ds->ds_data = bf->bf_segs[0].ds_addr; 3141 ath_hal_setuprxdesc(ah, ds 3142 , m->m_len /* buffer size */ 3143 , 0 3144 ); 3145 3146 if (sc->sc_rxlink != NULL) 3147 *sc->sc_rxlink = bf->bf_daddr; --- 168 unchanged lines hidden (view full) --- 3316 3317 DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); 3318 ngood = 0; 3319 nf = ath_hal_getchannoise(ah, sc->sc_curchan); 3320 sc->sc_stats.ast_rx_noise = nf; 3321 tsf = ath_hal_gettsf64(ah); 3322 do { 3323 bf = STAILQ_FIRST(&sc->sc_rxbuf); | 3150 ds->ds_data = bf->bf_segs[0].ds_addr; 3151 ath_hal_setuprxdesc(ah, ds 3152 , m->m_len /* buffer size */ 3153 , 0 3154 ); 3155 3156 if (sc->sc_rxlink != NULL) 3157 *sc->sc_rxlink = bf->bf_daddr; --- 168 unchanged lines hidden (view full) --- 3326 3327 DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); 3328 ngood = 0; 3329 nf = ath_hal_getchannoise(ah, sc->sc_curchan); 3330 sc->sc_stats.ast_rx_noise = nf; 3331 tsf = ath_hal_gettsf64(ah); 3332 do { 3333 bf = STAILQ_FIRST(&sc->sc_rxbuf); |
3324 if (bf == NULL) { /* NB: shouldn't happen */ | 3334 if (sc->sc_rxslink && bf == NULL) { /* NB: shouldn't happen */ |
3325 if_printf(ifp, "%s: no buffer!\n", __func__); 3326 break; | 3335 if_printf(ifp, "%s: no buffer!\n", __func__); 3336 break; |
3337 } else if (bf == NULL) { 3338 /* 3339 * End of List: 3340 * this can happen for non-self-linked RX chains 3341 */ 3342 sc->sc_stats.ast_rx_hitqueueend++; 3343 break; |
|
3327 } 3328 m = bf->bf_m; 3329 if (m == NULL) { /* NB: shouldn't happen */ 3330 /* 3331 * If mbuf allocation failed previously there 3332 * will be no mbuf; try again to re-populate it. 3333 */ 3334 /* XXX make debug msg */ --- 2262 unchanged lines hidden --- | 3344 } 3345 m = bf->bf_m; 3346 if (m == NULL) { /* NB: shouldn't happen */ 3347 /* 3348 * If mbuf allocation failed previously there 3349 * will be no mbuf; try again to re-populate it. 3350 */ 3351 /* XXX make debug msg */ --- 2262 unchanged lines hidden --- |