diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-08-19 17:46:38 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-09-03 19:57:24 +0300 |
commit | 3972cc579140e48e8390fff5e94f6e9e78c3dd87 (patch) | |
tree | dac0697037842e81332943083b019f63951bf144 /drivers/net/wireless/realtek | |
parent | be49b1f111c76ce20a60a90587e2b8e8ab809a06 (diff) | |
download | talos-op-linux-3972cc579140e48e8390fff5e94f6e9e78c3dd87.tar.gz talos-op-linux-3972cc579140e48e8390fff5e94f6e9e78c3dd87.zip |
rtl8xxxu: Determine the need for SGI before handling specific TX desc formats
In order to be able to split out the TX descriptor handling code,
determine in advance the need to mark SGI.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek')
-rw-r--r-- | drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 2f951cf788aa..6dc3f52d0aaf 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -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; + bool usedesc40, ampdu_enable, sgi = false; if (skb_headroom(skb) < tx_desc_size) { dev_warn(dev, @@ -4854,6 +4854,12 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw, else rate = tx_rate->hw_value; + if (rate_flag & IEEE80211_TX_RC_SHORT_GI || + (ieee80211_is_data_qos(hdr->frame_control) && + sta && sta->ht_cap.cap & + (IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20))) + sgi = true; + seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)); if (!usedesc40) { tx_desc->txdw5 = cpu_to_le32(rate); @@ -4886,12 +4892,8 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw, (sta && vif && vif->bss_conf.use_short_preamble)) tx_desc->txdw4 |= cpu_to_le32(TXDESC32_SHORT_PREAMBLE); - if (rate_flag & IEEE80211_TX_RC_SHORT_GI || - (ieee80211_is_data_qos(hdr->frame_control) && - sta && sta->ht_cap.cap & - (IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20))) { + if (sgi) tx_desc->txdw5 |= cpu_to_le32(TXDESC32_SHORT_GI); - } if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) { /* |