Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtw88: fix short GI capability based on current bandwidth

Fix the transmission is not sent with short GI under
some conditions even if the receiver supports short GI.
If VHT capability IE exists in the beacon, the original
code uses the short GI for 80M field as driver's short GI
setting for transmission, even the current bandwidth is
not 80MHz.

Short GI supported fields for 20M/40M are informed in HT
capability information element, and short GI supported
field for 80M is informed in VHT capability information
element.

These three fields may be set to different values.
Driver needs to record each short GI support field for
each bandwidth, and send correct info depends on current
bandwidth to the WiFi firmware.

Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Tsang-Shian Lin <thlin@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200717064937.27966-3-yhchuang@realtek.com

authored by

Tsang-Shian Lin and committed by
Kalle Valo
4dd86b90 ae44fa99

+6 -5
+6 -5
drivers/net/wireless/realtek/rtw88/main.c
··· 722 722 stbc_en = VHT_STBC_EN; 723 723 if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC) 724 724 ldpc_en = VHT_LDPC_EN; 725 - if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) 726 - is_support_sgi = true; 727 725 } else if (sta->ht_cap.ht_supported) { 728 726 ra_mask |= (sta->ht_cap.mcs.rx_mask[1] << 20) | 729 727 (sta->ht_cap.mcs.rx_mask[0] << 12); ··· 729 731 stbc_en = HT_STBC_EN; 730 732 if (sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING) 731 733 ldpc_en = HT_LDPC_EN; 732 - if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20 || 733 - sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) 734 - is_support_sgi = true; 735 734 } 736 735 737 736 if (efuse->hw_cap.nss == 1) ··· 770 775 switch (sta->bandwidth) { 771 776 case IEEE80211_STA_RX_BW_80: 772 777 bw_mode = RTW_CHANNEL_WIDTH_80; 778 + is_support_sgi = sta->vht_cap.vht_supported && 779 + (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80); 773 780 break; 774 781 case IEEE80211_STA_RX_BW_40: 775 782 bw_mode = RTW_CHANNEL_WIDTH_40; 783 + is_support_sgi = sta->ht_cap.ht_supported && 784 + (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40); 776 785 break; 777 786 default: 778 787 bw_mode = RTW_CHANNEL_WIDTH_20; 788 + is_support_sgi = sta->ht_cap.ht_supported && 789 + (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20); 779 790 break; 780 791 } 781 792