Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121772
b: refs/heads/master
c: a37c2c7
h: refs/heads/master
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Nov 10, 2008
1 parent 34756cc commit de67fbc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 102e0572d330e6cdb89a8f8fbd3999e3c67a1f9e
refs/heads/master: a37c2c79404940dfc5e88c851c3de5328975b1a9
8 changes: 5 additions & 3 deletions trunk/drivers/net/wireless/ath9k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,10 @@ struct ath_txq {
struct list_head axq_acq;
};

#define AGGR_CLEANUP BIT(1)
#define AGGR_ADDBA_COMPLETE BIT(2)
#define AGGR_ADDBA_PROGRESS BIT(3)

/* per TID aggregate tx state for a destination */
struct ath_atx_tid {
struct list_head list; /* round-robin tid entry */
Expand All @@ -462,9 +466,7 @@ struct ath_atx_tid {
int baw_tail; /* next unused tx buffer slot */
int sched;
int paused;
int cleanup_inprogress;
u32 addba_exchangecomplete:1;
int32_t addba_exchangeinprogress;
u8 state;
int addba_exchangeattempts;
};

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/ath9k/rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1909,8 +1909,8 @@ static void ath_tx_aggr_resp(struct ath_softc *sc,
state = si->ampdu_mlme.tid_state_tx[tidno];

if (state & HT_ADDBA_RECEIVED_MSK) {
txtid->addba_exchangecomplete = 1;
txtid->addba_exchangeinprogress = 0;
txtid->state |= AGGR_ADDBA_COMPLETE;
txtid->state &= ~AGGR_ADDBA_PROGRESS;
txtid->baw_size = buffersize;

DPRINTF(sc, ATH_DBG_AGGR,
Expand Down
49 changes: 20 additions & 29 deletions trunk/drivers/net/wireless/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ static int ath_tx_findindex(const struct ath9k_rate_table *rt, int rate)

/* Check if it's okay to send out aggregates */

static int ath_aggr_query(struct ath_softc *sc,
struct ath_node *an, u8 tidno)
static int ath_aggr_query(struct ath_softc *sc, struct ath_node *an, u8 tidno)
{
struct ath_atx_tid *tid;
tid = ATH_AN_2_TID(an, tidno);

if (tid->addba_exchangecomplete || tid->addba_exchangeinprogress)
if (tid->state & AGGR_ADDBA_COMPLETE ||
tid->state & AGGR_ADDBA_PROGRESS)
return 1;
else
return 0;
Expand Down Expand Up @@ -886,7 +886,7 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc,
/* transmit completion */
} else {

if (!tid->cleanup_inprogress &&
if (!(tid->state & AGGR_CLEANUP) &&
ds->ds_txstat.ts_flags != ATH9K_TX_SW_ABORTED) {
if (bf->bf_retries < ATH_MAX_SW_RETRIES) {
ath_tx_set_retry(sc, bf);
Expand Down Expand Up @@ -1014,16 +1014,16 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc,
bf = bf_next;
}

if (tid->cleanup_inprogress) {
if (tid->state & AGGR_CLEANUP) {
/* check to see if we're done with cleaning the h/w queue */
spin_lock_bh(&txq->axq_lock);

if (tid->baw_head == tid->baw_tail) {
tid->addba_exchangecomplete = 0;
tid->state &= ~AGGR_ADDBA_COMPLETE;
tid->addba_exchangeattempts = 0;
spin_unlock_bh(&txq->axq_lock);

tid->cleanup_inprogress = false;
tid->state &= ~AGGR_CLEANUP;

/* send buffered frames as singles */
ath_tx_flush_tid(sc, tid);
Expand Down Expand Up @@ -2335,17 +2335,8 @@ enum ATH_AGGR_CHECK ath_tx_aggr_check(struct ath_softc *sc,
/* ADDBA exchange must be completed before sending aggregates */
txtid = ATH_AN_2_TID(an, tidno);

if (txtid->addba_exchangecomplete)
return AGGR_EXCHANGE_DONE;

if (txtid->cleanup_inprogress)
return AGGR_CLEANUP_PROGRESS;

if (txtid->addba_exchangeinprogress)
return AGGR_EXCHANGE_PROGRESS;

if (!txtid->addba_exchangecomplete) {
if (!txtid->addba_exchangeinprogress &&
if (!(txtid->state & AGGR_ADDBA_COMPLETE)) {
if (!(txtid->state & AGGR_ADDBA_PROGRESS) &&
(txtid->addba_exchangeattempts < ADDBA_EXCHANGE_ATTEMPTS)) {
txtid->addba_exchangeattempts++;
return AGGR_REQUIRED;
Expand All @@ -2367,7 +2358,7 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,

if (sc->sc_flags & SC_OP_TXAGGR) {
txtid = ATH_AN_2_TID(an, tid);
txtid->addba_exchangeinprogress = 1;
txtid->state |= AGGR_ADDBA_PROGRESS;
ath_tx_pause_tid(sc, txtid);
}

Expand Down Expand Up @@ -2401,10 +2392,10 @@ void ath_tx_aggr_teardown(struct ath_softc *sc, struct ath_node *an, u8 tid)

DPRINTF(sc, ATH_DBG_AGGR, "%s: teardown TX aggregation\n", __func__);

if (txtid->cleanup_inprogress) /* cleanup is in progress */
if (txtid->state & AGGR_CLEANUP) /* cleanup is in progress */
return;

if (!txtid->addba_exchangecomplete) {
if (!(txtid->state & AGGR_ADDBA_COMPLETE)) {
txtid->addba_exchangeattempts = 0;
return;
}
Expand Down Expand Up @@ -2434,9 +2425,9 @@ void ath_tx_aggr_teardown(struct ath_softc *sc, struct ath_node *an, u8 tid)

if (txtid->baw_head != txtid->baw_tail) {
spin_unlock_bh(&txq->axq_lock);
txtid->cleanup_inprogress = true;
txtid->state |= AGGR_CLEANUP;
} else {
txtid->addba_exchangecomplete = 0;
txtid->state &= ~AGGR_ADDBA_COMPLETE;
txtid->addba_exchangeattempts = 0;
spin_unlock_bh(&txq->axq_lock);
ath_tx_flush_tid(sc, txtid);
Expand Down Expand Up @@ -2527,16 +2518,16 @@ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an)
tid->baw_head = tid->baw_tail = 0;
tid->sched = false;
tid->paused = false;
tid->cleanup_inprogress = false;
tid->state &= ~AGGR_CLEANUP;
INIT_LIST_HEAD(&tid->buf_q);

acno = TID_TO_WME_AC(tidno);
tid->ac = &an->an_aggr.tx.ac[acno];

/* ADDBA state */
tid->addba_exchangecomplete = 0;
tid->addba_exchangeinprogress = 0;
tid->addba_exchangeattempts = 0;
tid->state &= ~AGGR_ADDBA_COMPLETE;
tid->state &= ~AGGR_ADDBA_PROGRESS;
tid->addba_exchangeattempts = 0;
}

/*
Expand Down Expand Up @@ -2596,9 +2587,9 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an)
list_del(&tid->list);
tid->sched = false;
ath_tid_drain(sc, txq, tid);
tid->addba_exchangecomplete = 0;
tid->state &= ~AGGR_ADDBA_COMPLETE;
tid->addba_exchangeattempts = 0;
tid->cleanup_inprogress = false;
tid->state &= ~AGGR_CLEANUP;
}
}

Expand Down

0 comments on commit de67fbc

Please sign in to comment.