diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-09-14 15:24:22 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-16 16:45:40 -0400 |
commit | 493cf04fd37bf265dc3c9aad357e3e34654c86e3 (patch) | |
tree | 834da35a27d459a4ed0a8208616a51e327c29ba5 /drivers/net/wireless/ath/ath9k/beacon.c | |
parent | 2b63a41d14245345d6c498506c5634613afa80c0 (diff) |
ath9k: use the new API for setting tx descriptors
With the new API, tx descriptors can be written in one single pass
instead of having to re-read and rewrite fields from multiple places.
This makes the code easier to read and also slightly improves performance
on embedded MIPS hardware.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/beacon.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index b97d01d2eece..9cdeaebc844f 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -73,45 +73,39 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp, | |||
73 | struct sk_buff *skb = bf->bf_mpdu; | 73 | struct sk_buff *skb = bf->bf_mpdu; |
74 | struct ath_hw *ah = sc->sc_ah; | 74 | struct ath_hw *ah = sc->sc_ah; |
75 | struct ath_common *common = ath9k_hw_common(ah); | 75 | struct ath_common *common = ath9k_hw_common(ah); |
76 | struct ath_desc *ds; | 76 | struct ath_tx_info info; |
77 | struct ath9k_11n_rate_series series[4]; | ||
78 | int flags, ctsrate = 0, ctsduration = 0; | ||
79 | struct ieee80211_supported_band *sband; | 77 | struct ieee80211_supported_band *sband; |
78 | u8 chainmask = ah->txchainmask; | ||
80 | u8 rate = 0; | 79 | u8 rate = 0; |
81 | 80 | ||
82 | ath9k_reset_beacon_status(sc); | 81 | ath9k_reset_beacon_status(sc); |
83 | 82 | ||
84 | ds = bf->bf_desc; | ||
85 | flags = ATH9K_TXDESC_NOACK; | ||
86 | |||
87 | ds->ds_link = 0; | ||
88 | |||
89 | sband = &sc->sbands[common->hw->conf.channel->band]; | 83 | sband = &sc->sbands[common->hw->conf.channel->band]; |
90 | rate = sband->bitrates[rateidx].hw_value; | 84 | rate = sband->bitrates[rateidx].hw_value; |
91 | if (sc->sc_flags & SC_OP_PREAMBLE_SHORT) | 85 | if (sc->sc_flags & SC_OP_PREAMBLE_SHORT) |
92 | rate |= sband->bitrates[rateidx].hw_value_short; | 86 | rate |= sband->bitrates[rateidx].hw_value_short; |
93 | 87 | ||
94 | ath9k_hw_set11n_txdesc(ah, ds, skb->len + FCS_LEN, | 88 | memset(&info, 0, sizeof(info)); |
95 | ATH9K_PKT_TYPE_BEACON, | 89 | info.pkt_len = skb->len + FCS_LEN; |
96 | MAX_RATE_POWER, | 90 | info.type = ATH9K_PKT_TYPE_BEACON; |
97 | ATH9K_TXKEYIX_INVALID, | 91 | info.txpower = MAX_RATE_POWER; |
98 | ATH9K_KEY_TYPE_CLEAR, | 92 | info.keyix = ATH9K_TXKEYIX_INVALID; |
99 | flags); | 93 | info.keytype = ATH9K_KEY_TYPE_CLEAR; |
100 | 94 | info.flags = ATH9K_TXDESC_NOACK; | |
101 | /* NB: beacon's BufLen must be a multiple of 4 bytes */ | 95 | |
102 | ath9k_hw_filltxdesc(ah, ds, roundup(skb->len, 4), | 96 | info.buf_addr[0] = bf->bf_buf_addr; |
103 | true, true, ds, bf->bf_buf_addr, | 97 | info.buf_len[0] = roundup(skb->len, 4); |
104 | sc->beacon.beaconq); | 98 | |
105 | 99 | info.is_first = true; | |
106 | memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4); | 100 | info.is_last = true; |
107 | series[0].Tries = 1; | 101 | |
108 | series[0].Rate = rate; | 102 | info.qcu = sc->beacon.beaconq; |
109 | series[0].ChSel = ath_txchainmask_reduction(sc, | 103 | |
110 | ah->txchainmask, series[0].Rate); | 104 | info.rates[0].Tries = 1; |
111 | series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0; | 105 | info.rates[0].Rate = rate; |
112 | ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration, | 106 | info.rates[0].ChSel = ath_txchainmask_reduction(sc, chainmask, rate); |
113 | series, 4, 0); | 107 | |
114 | ath9k_hw_set_desc_link(ah, ds, 0); | 108 | ath9k_hw_set_txdesc(ah, bf->bf_desc, &info); |
115 | } | 109 | } |
116 | 110 | ||
117 | static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) | 111 | static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) |