Skip to content

Commit

Permalink
rtl8xxxu: Determine need for shore preamble before updating TX descri…
Browse files Browse the repository at this point in the history
…ptors

Another patch to move this detection out of the code handling the TX
descriptor update.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Jes Sorensen authored and Kalle Valo committed Sep 3, 2016
1 parent 3972cc5 commit 99afaac
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4770,7 +4770,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
u16 rate_flag = tx_info->control.rates[0].flags;
int tx_desc_size = priv->fops->tx_desc_size;
int ret;
bool usedesc40, ampdu_enable, sgi = false;
bool usedesc40, ampdu_enable, sgi = false, short_preamble = false;

if (skb_headroom(skb) < tx_desc_size) {
dev_warn(dev,
Expand Down Expand Up @@ -4860,6 +4860,10 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
(IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20)))
sgi = true;

if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
(sta && vif && vif->bss_conf.use_short_preamble))
short_preamble = true;

seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
if (!usedesc40) {
tx_desc->txdw5 = cpu_to_le32(rate);
Expand Down Expand Up @@ -4888,8 +4892,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
if (ieee80211_is_data_qos(hdr->frame_control))
tx_desc->txdw4 |= cpu_to_le32(TXDESC32_QOS);

if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
(sta && vif && vif->bss_conf.use_short_preamble))
if (short_preamble)
tx_desc->txdw4 |= cpu_to_le32(TXDESC32_SHORT_PREAMBLE);

if (sgi)
Expand Down Expand Up @@ -4935,8 +4938,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
cpu_to_le32(TXDESC40_RETRY_LIMIT_ENABLE);
}

if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
(sta && vif && vif->bss_conf.use_short_preamble))
if (short_preamble)
tx_desc40->txdw5 |=
cpu_to_le32(TXDESC40_SHORT_PREAMBLE);

Expand Down

0 comments on commit 99afaac

Please sign in to comment.