diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-09-14 15:24:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-16 16:45:37 -0400 |
commit | 55797b1ae5bfc33f1c0f978cdc7cd89a8d9460fc (patch) | |
tree | a6f2750f258529b857b862b1a5a014ed5be95895 | |
parent | 3483288caf3d979e6b032d62f75f57893adf0d53 (diff) |
ath9k: remove ATH_TX_XRETRY and BUF_XRETRY flags
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 23 |
4 files changed, 13 insertions, 29 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 45be0a3fe5c1..c016a7ae056e 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -87,17 +87,14 @@ struct ath_config { | |||
87 | * @BUF_AMPDU: This buffer is an ampdu, as part of an aggregate (during TX) | 87 | * @BUF_AMPDU: This buffer is an ampdu, as part of an aggregate (during TX) |
88 | * @BUF_AGGR: Indicates whether the buffer can be aggregated | 88 | * @BUF_AGGR: Indicates whether the buffer can be aggregated |
89 | * (used in aggregation scheduling) | 89 | * (used in aggregation scheduling) |
90 | * @BUF_XRETRY: To denote excessive retries of the buffer | ||
91 | */ | 90 | */ |
92 | enum buffer_type { | 91 | enum buffer_type { |
93 | BUF_AMPDU = BIT(0), | 92 | BUF_AMPDU = BIT(0), |
94 | BUF_AGGR = BIT(1), | 93 | BUF_AGGR = BIT(1), |
95 | BUF_XRETRY = BIT(2), | ||
96 | }; | 94 | }; |
97 | 95 | ||
98 | #define bf_isampdu(bf) (bf->bf_state.bf_type & BUF_AMPDU) | 96 | #define bf_isampdu(bf) (bf->bf_state.bf_type & BUF_AMPDU) |
99 | #define bf_isaggr(bf) (bf->bf_state.bf_type & BUF_AGGR) | 97 | #define bf_isaggr(bf) (bf->bf_state.bf_type & BUF_AGGR) |
100 | #define bf_isxretried(bf) (bf->bf_state.bf_type & BUF_XRETRY) | ||
101 | 98 | ||
102 | #define ATH_TXSTATUS_RING_SIZE 64 | 99 | #define ATH_TXSTATUS_RING_SIZE 64 |
103 | 100 | ||
@@ -277,8 +274,7 @@ struct ath_tx_control { | |||
277 | }; | 274 | }; |
278 | 275 | ||
279 | #define ATH_TX_ERROR 0x01 | 276 | #define ATH_TX_ERROR 0x01 |
280 | #define ATH_TX_XRETRY 0x02 | 277 | #define ATH_TX_BAR 0x02 |
281 | #define ATH_TX_BAR 0x04 | ||
282 | 278 | ||
283 | /** | 279 | /** |
284 | * @txq_map: Index is mac80211 queue number. This is | 280 | * @txq_map: Index is mac80211 queue number. This is |
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 7f143872dc83..179da2099270 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -826,7 +826,8 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf, | |||
826 | } | 826 | } |
827 | 827 | ||
828 | void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, | 828 | void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, |
829 | struct ath_tx_status *ts, struct ath_txq *txq) | 829 | struct ath_tx_status *ts, struct ath_txq *txq, |
830 | unsigned int flags) | ||
830 | { | 831 | { |
831 | #define TX_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].ts\ | 832 | #define TX_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].ts\ |
832 | [sc->debug.tsidx].c) | 833 | [sc->debug.tsidx].c) |
@@ -836,12 +837,12 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, | |||
836 | sc->debug.stats.txstats[qnum].tx_bytes_all += bf->bf_mpdu->len; | 837 | sc->debug.stats.txstats[qnum].tx_bytes_all += bf->bf_mpdu->len; |
837 | 838 | ||
838 | if (bf_isampdu(bf)) { | 839 | if (bf_isampdu(bf)) { |
839 | if (bf_isxretried(bf)) | 840 | if (flags & ATH_TX_BAR) |
840 | TX_STAT_INC(qnum, a_xretries); | 841 | TX_STAT_INC(qnum, a_xretries); |
841 | else | 842 | else |
842 | TX_STAT_INC(qnum, a_completed); | 843 | TX_STAT_INC(qnum, a_completed); |
843 | } else { | 844 | } else { |
844 | if (bf_isxretried(bf)) | 845 | if (ts->ts_status & ATH9K_TXERR_XRETRY) |
845 | TX_STAT_INC(qnum, xretries); | 846 | TX_STAT_INC(qnum, xretries); |
846 | else | 847 | else |
847 | TX_STAT_INC(qnum, completed); | 848 | TX_STAT_INC(qnum, completed); |
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h index 95f85bdc8db7..39f89bc9abcd 100644 --- a/drivers/net/wireless/ath/ath9k/debug.h +++ b/drivers/net/wireless/ath/ath9k/debug.h | |||
@@ -230,7 +230,8 @@ int ath9k_init_debug(struct ath_hw *ah); | |||
230 | void ath9k_debug_samp_bb_mac(struct ath_softc *sc); | 230 | void ath9k_debug_samp_bb_mac(struct ath_softc *sc); |
231 | void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); | 231 | void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); |
232 | void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, | 232 | void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, |
233 | struct ath_tx_status *ts, struct ath_txq *txq); | 233 | struct ath_tx_status *ts, struct ath_txq *txq, |
234 | unsigned int flags); | ||
234 | void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs); | 235 | void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs); |
235 | 236 | ||
236 | #else | 237 | #else |
@@ -252,7 +253,8 @@ static inline void ath_debug_stat_interrupt(struct ath_softc *sc, | |||
252 | static inline void ath_debug_stat_tx(struct ath_softc *sc, | 253 | static inline void ath_debug_stat_tx(struct ath_softc *sc, |
253 | struct ath_buf *bf, | 254 | struct ath_buf *bf, |
254 | struct ath_tx_status *ts, | 255 | struct ath_tx_status *ts, |
255 | struct ath_txq *txq) | 256 | struct ath_txq *txq, |
257 | unsigned int flags) | ||
256 | { | 258 | { |
257 | } | 259 | } |
258 | 260 | ||
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index cb37047e71d2..54049824bf69 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -390,7 +390,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
390 | while (bf) { | 390 | while (bf) { |
391 | bf_next = bf->bf_next; | 391 | bf_next = bf->bf_next; |
392 | 392 | ||
393 | bf->bf_state.bf_type |= BUF_XRETRY; | ||
394 | if (!bf->bf_stale || bf_next != NULL) | 393 | if (!bf->bf_stale || bf_next != NULL) |
395 | list_move_tail(&bf->list, &bf_head); | 394 | list_move_tail(&bf->list, &bf_head); |
396 | 395 | ||
@@ -470,7 +469,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
470 | clear_filter = true; | 469 | clear_filter = true; |
471 | txpending = 1; | 470 | txpending = 1; |
472 | } else { | 471 | } else { |
473 | bf->bf_state.bf_type |= BUF_XRETRY; | ||
474 | txfail = 1; | 472 | txfail = 1; |
475 | sendbar = 1; | 473 | sendbar = 1; |
476 | txfail_cnt++; | 474 | txfail_cnt++; |
@@ -523,13 +521,11 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
523 | ath_tx_update_baw(sc, tid, seqno); | 521 | ath_tx_update_baw(sc, tid, seqno); |
524 | spin_unlock_bh(&txq->axq_lock); | 522 | spin_unlock_bh(&txq->axq_lock); |
525 | 523 | ||
526 | bf->bf_state.bf_type |= | ||
527 | BUF_XRETRY; | ||
528 | ath_tx_rc_status(sc, bf, ts, nframes, | 524 | ath_tx_rc_status(sc, bf, ts, nframes, |
529 | nbad, 0, false); | 525 | nbad, 0, false); |
530 | ath_tx_complete_buf(sc, bf, txq, | 526 | ath_tx_complete_buf(sc, bf, txq, |
531 | &bf_head, | 527 | &bf_head, |
532 | ts, 0, 0); | 528 | ts, 0, 1); |
533 | break; | 529 | break; |
534 | } | 530 | } |
535 | 531 | ||
@@ -1953,10 +1949,9 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
1953 | if (tx_flags & ATH_TX_BAR) | 1949 | if (tx_flags & ATH_TX_BAR) |
1954 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; | 1950 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; |
1955 | 1951 | ||
1956 | if (!(tx_flags & (ATH_TX_ERROR | ATH_TX_XRETRY))) { | 1952 | if (!(tx_flags & ATH_TX_ERROR)) |
1957 | /* Frame was ACKed */ | 1953 | /* Frame was ACKed */ |
1958 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | 1954 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
1959 | } | ||
1960 | 1955 | ||
1961 | padpos = ath9k_cmn_padpos(hdr->frame_control); | 1956 | padpos = ath9k_cmn_padpos(hdr->frame_control); |
1962 | padsize = padpos & 3; | 1957 | padsize = padpos & 3; |
@@ -2006,13 +2001,9 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, | |||
2006 | if (sendbar) | 2001 | if (sendbar) |
2007 | tx_flags = ATH_TX_BAR; | 2002 | tx_flags = ATH_TX_BAR; |
2008 | 2003 | ||
2009 | if (!txok) { | 2004 | if (!txok) |
2010 | tx_flags |= ATH_TX_ERROR; | 2005 | tx_flags |= ATH_TX_ERROR; |
2011 | 2006 | ||
2012 | if (bf_isxretried(bf)) | ||
2013 | tx_flags |= ATH_TX_XRETRY; | ||
2014 | } | ||
2015 | |||
2016 | dma_unmap_single(sc->dev, bf->bf_buf_addr, skb->len, DMA_TO_DEVICE); | 2007 | dma_unmap_single(sc->dev, bf->bf_buf_addr, skb->len, DMA_TO_DEVICE); |
2017 | bf->bf_buf_addr = 0; | 2008 | bf->bf_buf_addr = 0; |
2018 | 2009 | ||
@@ -2024,7 +2015,7 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, | |||
2024 | else | 2015 | else |
2025 | complete(&sc->paprd_complete); | 2016 | complete(&sc->paprd_complete); |
2026 | } else { | 2017 | } else { |
2027 | ath_debug_stat_tx(sc, bf, ts, txq); | 2018 | ath_debug_stat_tx(sc, bf, ts, txq, tx_flags); |
2028 | ath_tx_complete(sc, skb, tx_flags, txq); | 2019 | ath_tx_complete(sc, skb, tx_flags, txq); |
2029 | } | 2020 | } |
2030 | /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't | 2021 | /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't |
@@ -2115,12 +2106,6 @@ static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq, | |||
2115 | spin_unlock_bh(&txq->axq_lock); | 2106 | spin_unlock_bh(&txq->axq_lock); |
2116 | 2107 | ||
2117 | if (!bf_isampdu(bf)) { | 2108 | if (!bf_isampdu(bf)) { |
2118 | /* | ||
2119 | * This frame is sent out as a single frame. | ||
2120 | * Use hardware retry status for this frame. | ||
2121 | */ | ||
2122 | if (ts->ts_status & ATH9K_TXERR_XRETRY) | ||
2123 | bf->bf_state.bf_type |= BUF_XRETRY; | ||
2124 | ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok, true); | 2109 | ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok, true); |
2125 | ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok, 0); | 2110 | ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok, 0); |
2126 | } else | 2111 | } else |