Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224600
b: refs/heads/master
c: 2d3bcba
h: refs/heads/master
v: v3
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Nov 17, 2010
1 parent a1c96bd commit 3c20527
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 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: 9a6b82706317333a1fab5dcafa2c33b91253a7a2
refs/heads/master: 2d3bcba0827013dfc60f727e7370dea00bc0638a
2 changes: 0 additions & 2 deletions trunk/drivers/net/wireless/ath/ath9k/ath9k.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ enum buffer_type {
#define bf_al bf_state.bfs_al
#define bf_frmlen bf_state.bfs_frmlen
#define bf_retries bf_state.bfs_retries
#define bf_seqno bf_state.bfs_seqno
#define bf_tidno bf_state.bfs_tidno
#define bf_keyix bf_state.bfs_keyix
#define bf_keytype bf_state.bfs_keytype
Expand Down Expand Up @@ -221,7 +220,6 @@ struct ath_buf_state {
int bfs_nframes;
u16 bfs_al;
u16 bfs_frmlen;
int bfs_seqno;
int bfs_tidno;
int bfs_retries;
u8 bf_type;
Expand Down
44 changes: 28 additions & 16 deletions trunk/drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ static void ath_tx_resume_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
spin_unlock_bh(&txq->axq_lock);
}

static u16 ath_frame_seqno(struct sk_buff *skb)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
return le16_to_cpu(hdr->seq_ctrl) >> IEEE80211_SEQ_SEQ_SHIFT;
}

static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
{
struct ath_txq *txq = tid->ac->txq;
Expand All @@ -157,7 +163,7 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
list_move_tail(&bf->list, &bf_head);

if (bf_isretried(bf)) {
ath_tx_update_baw(sc, tid, bf->bf_seqno);
ath_tx_update_baw(sc, tid, ath_frame_seqno(bf->bf_mpdu));
ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
} else {
ath_tx_send_normal(sc, txq, tid, &bf_head);
Expand All @@ -184,14 +190,11 @@ static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
}

static void ath_tx_addto_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
struct ath_buf *bf)
u16 seqno)
{
int index, cindex;

if (bf_isretried(bf))
return;

index = ATH_BA_INDEX(tid->seq_start, bf->bf_seqno);
index = ATH_BA_INDEX(tid->seq_start, seqno);
cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
__set_bit(cindex, tid->tx_buf);

Expand All @@ -215,6 +218,7 @@ static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq,
struct ath_buf *bf;
struct list_head bf_head;
struct ath_tx_status ts;
u16 bf_seqno;

memset(&ts, 0, sizeof(ts));
INIT_LIST_HEAD(&bf_head);
Expand All @@ -226,8 +230,9 @@ static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq,
bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
list_move_tail(&bf->list, &bf_head);

bf_seqno = ath_frame_seqno(bf->bf_mpdu);
if (bf_isretried(bf))
ath_tx_update_baw(sc, tid, bf->bf_seqno);
ath_tx_update_baw(sc, tid, bf_seqno);

spin_unlock(&txq->axq_lock);
ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
Expand Down Expand Up @@ -316,6 +321,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0;
bool rc_update = true;
struct ieee80211_tx_rate rates[4];
u16 bf_seqno;
int nframes;

skb = bf->bf_mpdu;
Expand Down Expand Up @@ -392,8 +398,9 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,

skb = bf->bf_mpdu;
tx_info = IEEE80211_SKB_CB(skb);
bf_seqno = ath_frame_seqno(skb);

if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, bf->bf_seqno))) {
if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, bf_seqno))) {
/* transmit completion, subframe is
* acked by block ack */
acked_cnt++;
Expand Down Expand Up @@ -442,7 +449,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
* block-ack window
*/
spin_lock_bh(&txq->axq_lock);
ath_tx_update_baw(sc, tid, bf->bf_seqno);
ath_tx_update_baw(sc, tid, bf_seqno);
spin_unlock_bh(&txq->axq_lock);

if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) {
Expand Down Expand Up @@ -471,7 +478,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
if (!tbf) {
spin_lock_bh(&txq->axq_lock);
ath_tx_update_baw(sc, tid,
bf->bf_seqno);
bf_seqno);
spin_unlock_bh(&txq->axq_lock);

bf->bf_state.bf_type |=
Expand Down Expand Up @@ -674,14 +681,16 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
al_delta, h_baw = tid->baw_size / 2;
enum ATH_AGGR_STATUS status = ATH_AGGR_DONE;
struct ieee80211_tx_info *tx_info;
u16 bf_seqno;

bf_first = list_first_entry(&tid->buf_q, struct ath_buf, list);

do {
bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
bf_seqno = ath_frame_seqno(bf->bf_mpdu);

/* do not step over block-ack window */
if (!BAW_WITHIN(tid->seq_start, tid->baw_size, bf->bf_seqno)) {
if (!BAW_WITHIN(tid->seq_start, tid->baw_size, bf_seqno)) {
status = ATH_AGGR_BAW_CLOSED;
break;
}
Expand Down Expand Up @@ -726,7 +735,8 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, 0);

/* link buffers of this frame to the aggregate */
ath_tx_addto_baw(sc, tid, bf);
if (!bf_isretried(bf))
ath_tx_addto_baw(sc, tid, bf_seqno);
ath9k_hw_set11n_aggr_middle(sc->sc_ah, bf->bf_desc, ndelim);
list_move_tail(&bf->list, bf_q);
if (bf_prev) {
Expand Down Expand Up @@ -1288,10 +1298,12 @@ static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_atx_tid *tid,
struct ath_tx_control *txctl)
{
struct ath_buf *bf;
u16 bf_seqno;

bf = list_first_entry(bf_head, struct ath_buf, list);
bf->bf_state.bf_type |= BUF_AMPDU;
TX_STAT_INC(txctl->txq->axq_qnum, a_queued);
bf_seqno = ath_frame_seqno(bf->bf_mpdu);

/*
* Do not queue to h/w when any of the following conditions is true:
Expand All @@ -1301,7 +1313,7 @@ static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_atx_tid *tid,
* - h/w queue depth exceeds low water mark
*/
if (!list_empty(&tid->buf_q) || tid->paused ||
!BAW_WITHIN(tid->seq_start, tid->baw_size, bf->bf_seqno) ||
!BAW_WITHIN(tid->seq_start, tid->baw_size, bf_seqno) ||
txctl->txq->axq_depth >= ATH_AGGR_MIN_QDEPTH) {
/*
* Add this frame to software queue for scheduling later
Expand All @@ -1313,7 +1325,8 @@ static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_atx_tid *tid,
}

/* Add sub-frame to BAW */
ath_tx_addto_baw(sc, tid, bf);
if (!bf_isretried(bf))
ath_tx_addto_baw(sc, tid, bf_seqno);

/* Queue to h/w without aggregation */
bf->bf_nframes = 1;
Expand Down Expand Up @@ -1394,7 +1407,6 @@ static void assign_aggr_tid_seqno(struct sk_buff *skb,
*/
tid = ATH_AN_2_TID(an, bf->bf_tidno);
hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT);
bf->bf_seqno = tid->seq_next;
INCR(tid->seq_next, IEEE80211_SEQ_MAX);
}

Expand Down Expand Up @@ -1903,7 +1915,7 @@ static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf,
}

while (bf) {
ba_index = ATH_BA_INDEX(seq_st, bf->bf_seqno);
ba_index = ATH_BA_INDEX(seq_st, ath_frame_seqno(bf->bf_mpdu));
if (!txok || (isaggr && !ATH_BA_ISSET(ba, ba_index)))
nbad++;

Expand Down

0 comments on commit 3c20527

Please sign in to comment.