Commit 493cf04f authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

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: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2b63a41d
...@@ -228,7 +228,6 @@ struct ath_buf { ...@@ -228,7 +228,6 @@ struct ath_buf {
dma_addr_t bf_daddr; /* physical addr of desc */ dma_addr_t bf_daddr; /* physical addr of desc */
dma_addr_t bf_buf_addr; /* physical addr of data buffer, for DMA */ dma_addr_t bf_buf_addr; /* physical addr of data buffer, for DMA */
bool bf_stale; bool bf_stale;
u16 bf_flags;
struct ath_buf_state bf_state; struct ath_buf_state bf_state;
}; };
......
...@@ -73,45 +73,39 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp, ...@@ -73,45 +73,39 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
struct sk_buff *skb = bf->bf_mpdu; struct sk_buff *skb = bf->bf_mpdu;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ath_desc *ds; struct ath_tx_info info;
struct ath9k_11n_rate_series series[4];
int flags, ctsrate = 0, ctsduration = 0;
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
u8 chainmask = ah->txchainmask;
u8 rate = 0; u8 rate = 0;
ath9k_reset_beacon_status(sc); ath9k_reset_beacon_status(sc);
ds = bf->bf_desc;
flags = ATH9K_TXDESC_NOACK;
ds->ds_link = 0;
sband = &sc->sbands[common->hw->conf.channel->band]; sband = &sc->sbands[common->hw->conf.channel->band];
rate = sband->bitrates[rateidx].hw_value; rate = sband->bitrates[rateidx].hw_value;
if (sc->sc_flags & SC_OP_PREAMBLE_SHORT) if (sc->sc_flags & SC_OP_PREAMBLE_SHORT)
rate |= sband->bitrates[rateidx].hw_value_short; rate |= sband->bitrates[rateidx].hw_value_short;
ath9k_hw_set11n_txdesc(ah, ds, skb->len + FCS_LEN, memset(&info, 0, sizeof(info));
ATH9K_PKT_TYPE_BEACON, info.pkt_len = skb->len + FCS_LEN;
MAX_RATE_POWER, info.type = ATH9K_PKT_TYPE_BEACON;
ATH9K_TXKEYIX_INVALID, info.txpower = MAX_RATE_POWER;
ATH9K_KEY_TYPE_CLEAR, info.keyix = ATH9K_TXKEYIX_INVALID;
flags); info.keytype = ATH9K_KEY_TYPE_CLEAR;
info.flags = ATH9K_TXDESC_NOACK;
/* NB: beacon's BufLen must be a multiple of 4 bytes */
ath9k_hw_filltxdesc(ah, ds, roundup(skb->len, 4), info.buf_addr[0] = bf->bf_buf_addr;
true, true, ds, bf->bf_buf_addr, info.buf_len[0] = roundup(skb->len, 4);
sc->beacon.beaconq);
info.is_first = true;
memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4); info.is_last = true;
series[0].Tries = 1;
series[0].Rate = rate; info.qcu = sc->beacon.beaconq;
series[0].ChSel = ath_txchainmask_reduction(sc,
ah->txchainmask, series[0].Rate); info.rates[0].Tries = 1;
series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0; info.rates[0].Rate = rate;
ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration, info.rates[0].ChSel = ath_txchainmask_reduction(sc, chainmask, rate);
series, 4, 0);
ath9k_hw_set_desc_link(ah, ds, 0); ath9k_hw_set_txdesc(ah, bf->bf_desc, &info);
} }
static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment