if_ath_tx.c (235750) | if_ath_tx.c (235774) |
---|---|
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_tx.c 235750 2012-05-21 22:43:38Z adrian $"); | 31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_tx.c 235774 2012-05-22 06:31:03Z 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 --- 1535 unchanged lines hidden (view full) --- 1575 * Sending a BAR frame can occur from the net80211 txa timer 1576 * (ie, retries) or from the ath txtask (completion call.) 1577 * It queues directly to hardware because the TID is paused 1578 * at this point (and won't be unpaused until the BAR has 1579 * either been TXed successfully or max retries has been 1580 * reached.) 1581 */ 1582 if (txq == &avp->av_mcastq) { | 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 --- 1535 unchanged lines hidden (view full) --- 1575 * Sending a BAR frame can occur from the net80211 txa timer 1576 * (ie, retries) or from the ath txtask (completion call.) 1577 * It queues directly to hardware because the TID is paused 1578 * at this point (and won't be unpaused until the BAR has 1579 * either been TXed successfully or max retries has been 1580 * reached.) 1581 */ 1582 if (txq == &avp->av_mcastq) { |
1583 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, | 1583 DPRINTF(sc, ATH_DEBUG_SW_TX, |
1584 "%s: bf=%p: mcastq: TX'ing\n", __func__, bf); 1585 ATH_TXQ_LOCK(txq); 1586 ath_tx_xmit_normal(sc, txq, bf); 1587 ATH_TXQ_UNLOCK(txq); 1588 } else if (type == IEEE80211_FC0_TYPE_CTL && 1589 subtype == IEEE80211_FC0_SUBTYPE_BAR) { | 1584 "%s: bf=%p: mcastq: TX'ing\n", __func__, bf); 1585 ATH_TXQ_LOCK(txq); 1586 ath_tx_xmit_normal(sc, txq, bf); 1587 ATH_TXQ_UNLOCK(txq); 1588 } else if (type == IEEE80211_FC0_TYPE_CTL && 1589 subtype == IEEE80211_FC0_SUBTYPE_BAR) { |
1590 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, | 1590 DPRINTF(sc, ATH_DEBUG_SW_TX, |
1591 "%s: BAR: TX'ing direct\n", __func__); 1592 ATH_TXQ_LOCK(txq); 1593 ath_tx_xmit_normal(sc, txq, bf); 1594 ATH_TXQ_UNLOCK(txq); 1595 } else { 1596 /* add to software queue */ | 1591 "%s: BAR: TX'ing direct\n", __func__); 1592 ATH_TXQ_LOCK(txq); 1593 ath_tx_xmit_normal(sc, txq, bf); 1594 ATH_TXQ_UNLOCK(txq); 1595 } else { 1596 /* add to software queue */ |
1597 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, | 1597 DPRINTF(sc, ATH_DEBUG_SW_TX, |
1598 "%s: bf=%p: swq: TX'ing\n", __func__, bf); 1599 ath_tx_swq(sc, ni, txq, bf); 1600 } 1601#else 1602 /* 1603 * For now, since there's no software queue, 1604 * direct-dispatch to the hardware. 1605 */ --- 1502 unchanged lines hidden (view full) --- 3108static void 3109ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_node *an, int tid) 3110{ 3111 struct ath_tid *atid = &an->an_tid[tid]; 3112 struct ieee80211_tx_ampdu *tap; 3113 struct ath_buf *bf, *bf_next; 3114 ath_bufhead bf_cq; 3115 | 1598 "%s: bf=%p: swq: TX'ing\n", __func__, bf); 1599 ath_tx_swq(sc, ni, txq, bf); 1600 } 1601#else 1602 /* 1603 * For now, since there's no software queue, 1604 * direct-dispatch to the hardware. 1605 */ --- 1502 unchanged lines hidden (view full) --- 3108static void 3109ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_node *an, int tid) 3110{ 3111 struct ath_tid *atid = &an->an_tid[tid]; 3112 struct ieee80211_tx_ampdu *tap; 3113 struct ath_buf *bf, *bf_next; 3114 ath_bufhead bf_cq; 3115 |
3116 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, | 3116 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, |
3117 "%s: TID %d: called\n", __func__, tid); 3118 3119 TAILQ_INIT(&bf_cq); 3120 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 3121 3122 /* 3123 * Update the frames in the software TX queue: 3124 * --- 1206 unchanged lines hidden (view full) --- 4331 * negotiation to "hang", as they quickly fall outside the BAW. 4332 * 4333 * The "eventual" solution should be to tag these packets with 4334 * dobaw. Although net80211 has given us a sequence number, 4335 * it'll be "after" the left edge of the BAW and thus it'll 4336 * fall within it. 4337 */ 4338 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); | 3117 "%s: TID %d: called\n", __func__, tid); 3118 3119 TAILQ_INIT(&bf_cq); 3120 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 3121 3122 /* 3123 * Update the frames in the software TX queue: 3124 * --- 1206 unchanged lines hidden (view full) --- 4331 * negotiation to "hang", as they quickly fall outside the BAW. 4332 * 4333 * The "eventual" solution should be to tag these packets with 4334 * dobaw. Although net80211 has given us a sequence number, 4335 * it'll be "after" the left edge of the BAW and thus it'll 4336 * fall within it. 4337 */ 4338 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); |
4339 ath_tx_tid_pause(sc, atid); | 4339 /* 4340 * This is a bit annoying. Until net80211 HT code inherits some 4341 * (any) locking, we may have this called in parallel BUT only 4342 * one response/timeout will be called. Grr. 4343 */ 4344 if (atid->addba_tx_pending == 0) { 4345 ath_tx_tid_pause(sc, atid); 4346 atid->addba_tx_pending = 1; 4347 } |
4340 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 4341 4342 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4343 "%s: called; dialogtoken=%d, baparamset=%d, batimeout=%d\n", 4344 __func__, dialogtoken, baparamset, batimeout); 4345 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4346 "%s: txa_start=%d, ni_txseqs=%d\n", 4347 __func__, tap->txa_start, ni->ni_txseqs[tid]); --- 44 unchanged lines hidden (view full) --- 4392 * Call this first, so the interface flags get updated 4393 * before the TID is unpaused. Otherwise a race condition 4394 * exists where the unpaused TID still doesn't yet have 4395 * IEEE80211_AGGR_RUNNING set. 4396 */ 4397 r = sc->sc_addba_response(ni, tap, status, code, batimeout); 4398 4399 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); | 4348 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 4349 4350 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4351 "%s: called; dialogtoken=%d, baparamset=%d, batimeout=%d\n", 4352 __func__, dialogtoken, baparamset, batimeout); 4353 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4354 "%s: txa_start=%d, ni_txseqs=%d\n", 4355 __func__, tap->txa_start, ni->ni_txseqs[tid]); --- 44 unchanged lines hidden (view full) --- 4400 * Call this first, so the interface flags get updated 4401 * before the TID is unpaused. Otherwise a race condition 4402 * exists where the unpaused TID still doesn't yet have 4403 * IEEE80211_AGGR_RUNNING set. 4404 */ 4405 r = sc->sc_addba_response(ni, tap, status, code, batimeout); 4406 4407 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); |
4408 atid->addba_tx_pending = 0; |
|
4400 /* 4401 * XXX dirty! 4402 * Slide the BAW left edge to wherever net80211 left it for us. 4403 * Read above for more information. 4404 */ 4405 tap->txa_start = ni->ni_txseqs[tid]; 4406 ath_tx_tid_resume(sc, atid); 4407 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); --- 87 unchanged lines hidden (view full) --- 4495 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; 4496 int tid = tap->txa_tid; 4497 struct ath_node *an = ATH_NODE(ni); 4498 struct ath_tid *atid = &an->an_tid[tid]; 4499 4500 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4501 "%s: called; resuming\n", __func__); 4502 | 4409 /* 4410 * XXX dirty! 4411 * Slide the BAW left edge to wherever net80211 left it for us. 4412 * Read above for more information. 4413 */ 4414 tap->txa_start = ni->ni_txseqs[tid]; 4415 ath_tx_tid_resume(sc, atid); 4416 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); --- 87 unchanged lines hidden (view full) --- 4504 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; 4505 int tid = tap->txa_tid; 4506 struct ath_node *an = ATH_NODE(ni); 4507 struct ath_tid *atid = &an->an_tid[tid]; 4508 4509 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4510 "%s: called; resuming\n", __func__); 4511 |
4512 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 4513 atid->addba_tx_pending = 0; 4514 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 4515 |
|
4503 /* Note: This updates the aggregate state to (again) pending */ 4504 sc->sc_addba_response_timeout(ni, tap); 4505 4506 /* Unpause the TID; which reschedules it */ 4507 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 4508 ath_tx_tid_resume(sc, atid); 4509 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 4510} | 4516 /* Note: This updates the aggregate state to (again) pending */ 4517 sc->sc_addba_response_timeout(ni, tap); 4518 4519 /* Unpause the TID; which reschedules it */ 4520 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 4521 ath_tx_tid_resume(sc, atid); 4522 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 4523} |