diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-11-14 09:20:06 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-17 16:19:16 -0500 |
commit | 269c44bc8415ad78fb4dc3de25e6de3420332e9f (patch) | |
tree | 77bd26de425335ce8f19d097a6e728817d5ef055 /drivers/net/wireless | |
parent | 3017047f564d5101009c8318b94bdacd3ca3312e (diff) |
ath9k: remove bfs_al from struct ath_buf_state
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 34 |
2 files changed, 18 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index e78f7f9bc3c..b70ac3a6db2 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -102,7 +102,6 @@ enum buffer_type { | |||
102 | }; | 102 | }; |
103 | 103 | ||
104 | #define bf_nframes bf_state.bfs_nframes | 104 | #define bf_nframes bf_state.bfs_nframes |
105 | #define bf_al bf_state.bfs_al | ||
106 | #define bf_frmlen bf_state.bfs_frmlen | 105 | #define bf_frmlen bf_state.bfs_frmlen |
107 | #define bf_retries bf_state.bfs_retries | 106 | #define bf_retries bf_state.bfs_retries |
108 | #define bf_isht(bf) (bf->bf_state.bf_type & BUF_HT) | 107 | #define bf_isht(bf) (bf->bf_state.bf_type & BUF_HT) |
@@ -215,11 +214,10 @@ struct ath_atx_ac { | |||
215 | 214 | ||
216 | struct ath_buf_state { | 215 | struct ath_buf_state { |
217 | int bfs_nframes; | 216 | int bfs_nframes; |
218 | u16 bfs_al; | ||
219 | u16 bfs_frmlen; | ||
220 | int bfs_retries; | 217 | int bfs_retries; |
221 | u8 bf_type; | 218 | u8 bf_type; |
222 | u8 bfs_paprd; | 219 | u8 bfs_paprd; |
220 | u16 bfs_frmlen; | ||
223 | enum ath9k_internal_frame_type bfs_ftype; | 221 | enum ath9k_internal_frame_type bfs_ftype; |
224 | }; | 222 | }; |
225 | 223 | ||
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 176d88c154c..88efcc1671b 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -56,7 +56,7 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, | |||
56 | struct ath_tx_status *ts, int txok, int sendbar); | 56 | struct ath_tx_status *ts, int txok, int sendbar); |
57 | static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, | 57 | static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, |
58 | struct list_head *head); | 58 | struct list_head *head); |
59 | static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf); | 59 | static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int len); |
60 | static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf, | 60 | static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf, |
61 | struct ath_tx_status *ts, int txok); | 61 | struct ath_tx_status *ts, int txok); |
62 | static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts, | 62 | static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts, |
@@ -674,7 +674,8 @@ static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid, | |||
674 | static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc, | 674 | static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc, |
675 | struct ath_txq *txq, | 675 | struct ath_txq *txq, |
676 | struct ath_atx_tid *tid, | 676 | struct ath_atx_tid *tid, |
677 | struct list_head *bf_q) | 677 | struct list_head *bf_q, |
678 | int *aggr_len) | ||
678 | { | 679 | { |
679 | #define PADBYTES(_len) ((4 - ((_len) % 4)) % 4) | 680 | #define PADBYTES(_len) ((4 - ((_len) % 4)) % 4) |
680 | struct ath_buf *bf, *bf_first, *bf_prev = NULL; | 681 | struct ath_buf *bf, *bf_first, *bf_prev = NULL; |
@@ -750,7 +751,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc, | |||
750 | 751 | ||
751 | } while (!list_empty(&tid->buf_q)); | 752 | } while (!list_empty(&tid->buf_q)); |
752 | 753 | ||
753 | bf_first->bf_al = al; | 754 | *aggr_len = al; |
754 | bf_first->bf_nframes = nframes; | 755 | bf_first->bf_nframes = nframes; |
755 | 756 | ||
756 | return status; | 757 | return status; |
@@ -763,6 +764,7 @@ static void ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
763 | struct ath_buf *bf; | 764 | struct ath_buf *bf; |
764 | enum ATH_AGGR_STATUS status; | 765 | enum ATH_AGGR_STATUS status; |
765 | struct list_head bf_q; | 766 | struct list_head bf_q; |
767 | int aggr_len; | ||
766 | 768 | ||
767 | do { | 769 | do { |
768 | if (list_empty(&tid->buf_q)) | 770 | if (list_empty(&tid->buf_q)) |
@@ -770,7 +772,7 @@ static void ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
770 | 772 | ||
771 | INIT_LIST_HEAD(&bf_q); | 773 | INIT_LIST_HEAD(&bf_q); |
772 | 774 | ||
773 | status = ath_tx_form_aggr(sc, txq, tid, &bf_q); | 775 | status = ath_tx_form_aggr(sc, txq, tid, &bf_q, &aggr_len); |
774 | 776 | ||
775 | /* | 777 | /* |
776 | * no frames picked up to be aggregated; | 778 | * no frames picked up to be aggregated; |
@@ -786,15 +788,15 @@ static void ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
786 | if (bf->bf_nframes == 1) { | 788 | if (bf->bf_nframes == 1) { |
787 | bf->bf_state.bf_type &= ~BUF_AGGR; | 789 | bf->bf_state.bf_type &= ~BUF_AGGR; |
788 | ath9k_hw_clr11n_aggr(sc->sc_ah, bf->bf_desc); | 790 | ath9k_hw_clr11n_aggr(sc->sc_ah, bf->bf_desc); |
789 | ath_buf_set_rate(sc, bf); | 791 | ath_buf_set_rate(sc, bf, bf->bf_frmlen); |
790 | ath_tx_txqaddbuf(sc, txq, &bf_q); | 792 | ath_tx_txqaddbuf(sc, txq, &bf_q); |
791 | continue; | 793 | continue; |
792 | } | 794 | } |
793 | 795 | ||
794 | /* setup first desc of aggregate */ | 796 | /* setup first desc of aggregate */ |
795 | bf->bf_state.bf_type |= BUF_AGGR; | 797 | bf->bf_state.bf_type |= BUF_AGGR; |
796 | ath_buf_set_rate(sc, bf); | 798 | ath_buf_set_rate(sc, bf, aggr_len); |
797 | ath9k_hw_set11n_aggr_first(sc->sc_ah, bf->bf_desc, bf->bf_al); | 799 | ath9k_hw_set11n_aggr_first(sc->sc_ah, bf->bf_desc, aggr_len); |
798 | 800 | ||
799 | /* anchor last desc of aggregate */ | 801 | /* anchor last desc of aggregate */ |
800 | ath9k_hw_set11n_aggr_last(sc->sc_ah, bf->bf_lastbf->bf_desc); | 802 | ath9k_hw_set11n_aggr_last(sc->sc_ah, bf->bf_lastbf->bf_desc); |
@@ -1333,7 +1335,7 @@ static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_atx_tid *tid, | |||
1333 | /* Queue to h/w without aggregation */ | 1335 | /* Queue to h/w without aggregation */ |
1334 | bf->bf_nframes = 1; | 1336 | bf->bf_nframes = 1; |
1335 | bf->bf_lastbf = bf; | 1337 | bf->bf_lastbf = bf; |
1336 | ath_buf_set_rate(sc, bf); | 1338 | ath_buf_set_rate(sc, bf, bf->bf_frmlen); |
1337 | ath_tx_txqaddbuf(sc, txctl->txq, bf_head); | 1339 | ath_tx_txqaddbuf(sc, txctl->txq, bf_head); |
1338 | } | 1340 | } |
1339 | 1341 | ||
@@ -1352,7 +1354,7 @@ static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, | |||
1352 | 1354 | ||
1353 | bf->bf_nframes = 1; | 1355 | bf->bf_nframes = 1; |
1354 | bf->bf_lastbf = bf; | 1356 | bf->bf_lastbf = bf; |
1355 | ath_buf_set_rate(sc, bf); | 1357 | ath_buf_set_rate(sc, bf, bf->bf_frmlen); |
1356 | ath_tx_txqaddbuf(sc, txq, bf_head); | 1358 | ath_tx_txqaddbuf(sc, txq, bf_head); |
1357 | TX_STAT_INC(txq->axq_qnum, queued); | 1359 | TX_STAT_INC(txq->axq_qnum, queued); |
1358 | } | 1360 | } |
@@ -1430,13 +1432,11 @@ static int setup_tx_flags(struct sk_buff *skb) | |||
1430 | * width - 0 for 20 MHz, 1 for 40 MHz | 1432 | * width - 0 for 20 MHz, 1 for 40 MHz |
1431 | * half_gi - to use 4us v/s 3.6 us for symbol time | 1433 | * half_gi - to use 4us v/s 3.6 us for symbol time |
1432 | */ | 1434 | */ |
1433 | static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, struct ath_buf *bf, | 1435 | static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, int pktlen, |
1434 | int width, int half_gi, bool shortPreamble) | 1436 | int width, int half_gi, bool shortPreamble) |
1435 | { | 1437 | { |
1436 | u32 nbits, nsymbits, duration, nsymbols; | 1438 | u32 nbits, nsymbits, duration, nsymbols; |
1437 | int streams, pktlen; | 1439 | int streams; |
1438 | |||
1439 | pktlen = bf_isaggr(bf) ? bf->bf_al : bf->bf_frmlen; | ||
1440 | 1440 | ||
1441 | /* find number of symbols: PLCP + data */ | 1441 | /* find number of symbols: PLCP + data */ |
1442 | streams = HT_RC_2_STREAMS(rix); | 1442 | streams = HT_RC_2_STREAMS(rix); |
@@ -1455,7 +1455,7 @@ static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, struct ath_buf *bf, | |||
1455 | return duration; | 1455 | return duration; |
1456 | } | 1456 | } |
1457 | 1457 | ||
1458 | static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | 1458 | static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int len) |
1459 | { | 1459 | { |
1460 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1460 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
1461 | struct ath9k_11n_rate_series series[4]; | 1461 | struct ath9k_11n_rate_series series[4]; |
@@ -1518,7 +1518,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
1518 | if (rates[i].flags & IEEE80211_TX_RC_MCS) { | 1518 | if (rates[i].flags & IEEE80211_TX_RC_MCS) { |
1519 | /* MCS rates */ | 1519 | /* MCS rates */ |
1520 | series[i].Rate = rix | 0x80; | 1520 | series[i].Rate = rix | 0x80; |
1521 | series[i].PktDuration = ath_pkt_duration(sc, rix, bf, | 1521 | series[i].PktDuration = ath_pkt_duration(sc, rix, len, |
1522 | is_40, is_sgi, is_sp); | 1522 | is_40, is_sgi, is_sp); |
1523 | if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC)) | 1523 | if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC)) |
1524 | series[i].RateFlags |= ATH9K_RATESERIES_STBC; | 1524 | series[i].RateFlags |= ATH9K_RATESERIES_STBC; |
@@ -1542,11 +1542,11 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
1542 | } | 1542 | } |
1543 | 1543 | ||
1544 | series[i].PktDuration = ath9k_hw_computetxtime(sc->sc_ah, | 1544 | series[i].PktDuration = ath9k_hw_computetxtime(sc->sc_ah, |
1545 | phy, rate->bitrate * 100, bf->bf_frmlen, rix, is_sp); | 1545 | phy, rate->bitrate * 100, len, rix, is_sp); |
1546 | } | 1546 | } |
1547 | 1547 | ||
1548 | /* For AR5416 - RTS cannot be followed by a frame larger than 8K */ | 1548 | /* For AR5416 - RTS cannot be followed by a frame larger than 8K */ |
1549 | if (bf_isaggr(bf) && (bf->bf_al > sc->sc_ah->caps.rts_aggr_limit)) | 1549 | if (bf_isaggr(bf) && (len > sc->sc_ah->caps.rts_aggr_limit)) |
1550 | flags &= ~ATH9K_TXDESC_RTSENA; | 1550 | flags &= ~ATH9K_TXDESC_RTSENA; |
1551 | 1551 | ||
1552 | /* ATH9K_TXDESC_RTSENA and ATH9K_TXDESC_CTSENA are mutually exclusive. */ | 1552 | /* ATH9K_TXDESC_RTSENA and ATH9K_TXDESC_CTSENA are mutually exclusive. */ |