Deleted Added
full compact
if_ath_tx.c (234009) if_ath_tx.c (234324)
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 234009 2012-04-08 00:40:16Z adrian $");
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_tx.c 234324 2012-04-15 20:29:39Z 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

--- 4169 unchanged lines hidden (view full) ---

4209/*
4210 * Return net80211 TID struct pointer, or NULL for none
4211 */
4212struct ieee80211_tx_ampdu *
4213ath_tx_get_tx_tid(struct ath_node *an, int tid)
4214{
4215 struct ieee80211_node *ni = &an->an_node;
4216 struct ieee80211_tx_ampdu *tap;
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

--- 4169 unchanged lines hidden (view full) ---

4209/*
4210 * Return net80211 TID struct pointer, or NULL for none
4211 */
4212struct ieee80211_tx_ampdu *
4213ath_tx_get_tx_tid(struct ath_node *an, int tid)
4214{
4215 struct ieee80211_node *ni = &an->an_node;
4216 struct ieee80211_tx_ampdu *tap;
4217 int ac;
4218
4219 if (tid == IEEE80211_NONQOS_TID)
4220 return NULL;
4221
4217
4218 if (tid == IEEE80211_NONQOS_TID)
4219 return NULL;
4220
4222 ac = TID_TO_WME_AC(tid);
4223
4224 tap = &ni->ni_tx_ampdu[ac];
4221 tap = &ni->ni_tx_ampdu[tid];
4225 return tap;
4226}
4227
4228/*
4229 * Is AMPDU-TX running?
4230 */
4231static int
4232ath_tx_ampdu_running(struct ath_softc *sc, struct ath_node *an, int tid)

--- 41 unchanged lines hidden (view full) ---

4274 *
4275 * XXX there's no timeout handler we can override?
4276 */
4277int
4278ath_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
4279 int dialogtoken, int baparamset, int batimeout)
4280{
4281 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
4222 return tap;
4223}
4224
4225/*
4226 * Is AMPDU-TX running?
4227 */
4228static int
4229ath_tx_ampdu_running(struct ath_softc *sc, struct ath_node *an, int tid)

--- 41 unchanged lines hidden (view full) ---

4271 *
4272 * XXX there's no timeout handler we can override?
4273 */
4274int
4275ath_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
4276 int dialogtoken, int baparamset, int batimeout)
4277{
4278 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
4282 int tid = WME_AC_TO_TID(tap->txa_ac);
4279 int tid = tap->txa_tid;
4283 struct ath_node *an = ATH_NODE(ni);
4284 struct ath_tid *atid = &an->an_tid[tid];
4285
4286 /*
4287 * XXX danger Will Robinson!
4288 *
4289 * Although the taskqueue may be running and scheduling some more
4290 * packets, these should all be _before_ the addba sequence number.

--- 50 unchanged lines hidden (view full) ---

4341 * frames; thus updating the BAW. For now though, I'll just slide the
4342 * window.
4343 */
4344int
4345ath_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
4346 int status, int code, int batimeout)
4347{
4348 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
4280 struct ath_node *an = ATH_NODE(ni);
4281 struct ath_tid *atid = &an->an_tid[tid];
4282
4283 /*
4284 * XXX danger Will Robinson!
4285 *
4286 * Although the taskqueue may be running and scheduling some more
4287 * packets, these should all be _before_ the addba sequence number.

--- 50 unchanged lines hidden (view full) ---

4338 * frames; thus updating the BAW. For now though, I'll just slide the
4339 * window.
4340 */
4341int
4342ath_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
4343 int status, int code, int batimeout)
4344{
4345 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
4349 int tid = WME_AC_TO_TID(tap->txa_ac);
4346 int tid = tap->txa_tid;
4350 struct ath_node *an = ATH_NODE(ni);
4351 struct ath_tid *atid = &an->an_tid[tid];
4352 int r;
4353
4354 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
4355 "%s: called; status=%d, code=%d, batimeout=%d\n", __func__,
4356 status, code, batimeout);
4357

--- 24 unchanged lines hidden (view full) ---

4382
4383/*
4384 * Stop ADDBA on a queue.
4385 */
4386void
4387ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
4388{
4389 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
4347 struct ath_node *an = ATH_NODE(ni);
4348 struct ath_tid *atid = &an->an_tid[tid];
4349 int r;
4350
4351 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
4352 "%s: called; status=%d, code=%d, batimeout=%d\n", __func__,
4353 status, code, batimeout);
4354

--- 24 unchanged lines hidden (view full) ---

4379
4380/*
4381 * Stop ADDBA on a queue.
4382 */
4383void
4384ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
4385{
4386 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
4390 int tid = WME_AC_TO_TID(tap->txa_ac);
4387 int tid = tap->txa_tid;
4391 struct ath_node *an = ATH_NODE(ni);
4392 struct ath_tid *atid = &an->an_tid[tid];
4393
4394 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: called\n", __func__);
4395
4396 /* Pause TID traffic early, so there aren't any races */
4397 ATH_TXQ_LOCK(sc->sc_ac2q[atid->tid]);
4398 ath_tx_tid_pause(sc, atid);

--- 20 unchanged lines hidden (view full) ---

4419 * XXX This uses a hard-coded max BAR count value; the whole
4420 * XXX BAR TX success or failure should be better handled!
4421 */
4422void
4423ath_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
4424 int status)
4425{
4426 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
4388 struct ath_node *an = ATH_NODE(ni);
4389 struct ath_tid *atid = &an->an_tid[tid];
4390
4391 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: called\n", __func__);
4392
4393 /* Pause TID traffic early, so there aren't any races */
4394 ATH_TXQ_LOCK(sc->sc_ac2q[atid->tid]);
4395 ath_tx_tid_pause(sc, atid);

--- 20 unchanged lines hidden (view full) ---

4416 * XXX This uses a hard-coded max BAR count value; the whole
4417 * XXX BAR TX success or failure should be better handled!
4418 */
4419void
4420ath_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
4421 int status)
4422{
4423 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
4427 int tid = WME_AC_TO_TID(tap->txa_ac);
4424 int tid = tap->txa_tid;
4428 struct ath_node *an = ATH_NODE(ni);
4429 struct ath_tid *atid = &an->an_tid[tid];
4430 int attempts = tap->txa_attempts;
4431
4432 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
4433 "%s: called; status=%d\n", __func__, status);
4434
4435 /* Note: This may update the BAW details */

--- 16 unchanged lines hidden (view full) ---

4452 * This is called whenever the pending ADDBA request times out.
4453 * Unpause and reschedule the TID.
4454 */
4455void
4456ath_addba_response_timeout(struct ieee80211_node *ni,
4457 struct ieee80211_tx_ampdu *tap)
4458{
4459 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
4425 struct ath_node *an = ATH_NODE(ni);
4426 struct ath_tid *atid = &an->an_tid[tid];
4427 int attempts = tap->txa_attempts;
4428
4429 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
4430 "%s: called; status=%d\n", __func__, status);
4431
4432 /* Note: This may update the BAW details */

--- 16 unchanged lines hidden (view full) ---

4449 * This is called whenever the pending ADDBA request times out.
4450 * Unpause and reschedule the TID.
4451 */
4452void
4453ath_addba_response_timeout(struct ieee80211_node *ni,
4454 struct ieee80211_tx_ampdu *tap)
4455{
4456 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc;
4460 int tid = WME_AC_TO_TID(tap->txa_ac);
4457 int tid = tap->txa_tid;
4461 struct ath_node *an = ATH_NODE(ni);
4462 struct ath_tid *atid = &an->an_tid[tid];
4463
4464 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
4465 "%s: called; resuming\n", __func__);
4466
4467 /* Note: This updates the aggregate state to (again) pending */
4468 sc->sc_addba_response_timeout(ni, tap);
4469
4470 /* Unpause the TID; which reschedules it */
4471 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]);
4472 ath_tx_tid_resume(sc, atid);
4473 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]);
4474}
4458 struct ath_node *an = ATH_NODE(ni);
4459 struct ath_tid *atid = &an->an_tid[tid];
4460
4461 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
4462 "%s: called; resuming\n", __func__);
4463
4464 /* Note: This updates the aggregate state to (again) pending */
4465 sc->sc_addba_response_timeout(ni, tap);
4466
4467 /* Unpause the TID; which reschedules it */
4468 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]);
4469 ath_tx_tid_resume(sc, atid);
4470 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]);
4471}