wifi: rtw89: Override antenna number for RTL8852BE-VS
PATCH v2 1/1 wifi: rtw89: Override antenna number for RTL8852BE-VS
RTL8852BE-VS (PCI ID 10ec:b85b, RFE type 41) has only one spatial stream and likely one physical antenna, but the firmware reports two antennas. This results in the driver configuring the wrong RF path, which leads to very poor reception. Users complain that 5 GHz networks are not visible.
Hardcode the number of antennas for this RFE type to one, and the correct RF path for the Bluetooth coexistence code. This is what the vendor driver does.
---
v2:
- Return immediately when rtw8852bx_read_efuse() returns an error.
- Rebase on top of the latest rtw-next.
--- drivers/net/wireless/realtek/rtw89/core.h | 1 + drivers/net/wireless/realtek/rtw89/mac.c | 5 ++++ drivers/net/wireless/realtek/rtw89/rtw8852b.c | 24 ++++++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw89/core.h +1 -0
@@ -6572,6 +6572,7 @@ enum rtw89_quirks {RTW89_QUIRK_THERMAL_PROT_VCORE ,RTW89_QUIRK_HW_INFO_SYSFS ,RTW89_QUIRK_DISABLE_2GHZ , +RTW89_QUIRK_1ANT , NUM_OF_RTW89_QUIRKS, };
drivers/net/wireless/realtek/rtw89/mac.c +5 -0
@@ -3244,6 +3244,11 @@ static int rtw89_mac_setup_phycap_part0(struct rtw89_dev *rtwdev) tx_ant =u32_get_bits (phycap->w3,RTW89_C2HREG_PHYCAP_W3_ANT_TX_NUM ); rx_ant =u32_get_bits (phycap->w3,RTW89_C2HREG_PHYCAP_W3_ANT_RX_NUM ); +if (test_bit (RTW89_QUIRK_1ANT , rtwdev->quirks)) { + tx_ant =1 ; + rx_ant =1 ; + } + hal->tx_nss = tx_nss ?min_t (u8, tx_nss, chip->tx_nss) : chip->tx_nss; hal->rx_nss = rx_nss ?min_t (u8, rx_nss, chip->rx_nss) : chip->rx_nss;
drivers/net/wireless/realtek/rtw89/rtw8852b.c +23 -1
@@ -353,6 +353,21 @@ static const struct rtw89_btc_fbtc_mreg rtw89_btc_8852b_mon_reg[] = {static const u8 rtw89_btc_8852b_wl_rssi_thres[BTC_WL_RSSI_THMAX ] = {70 ,60 ,50 ,40 };static const u8 rtw89_btc_8852b_bt_rssi_thres[BTC_BT_RSSI_THMAX ] = {50 ,40 ,30 ,20 }; +static int rtw8852b_read_efuse (struct rtw89_dev *rtwdev,u8 *log_map, +enum rtw89_efuse_block block) +{ +int ret; + + ret =rtw8852bx_read_efuse (rtwdev, log_map, block); +if (ret) +return ret; + +if (rtwdev->efuse.rfe_type ==41 ) +set_bit (RTW89_QUIRK_1ANT , rtwdev->quirks); + +return 0 ; +} +static void rtw8852b_pwr_sps_ana (struct rtw89_dev *rtwdev) {rtw89_write16 (rtwdev,R_AX_SPS_ANA_ON_CTRL2 ,RTL8852B_DEFAULT_SPS_ANA );
@@ -773,6 +788,13 @@ static void rtw8852b_btc_set_rfe(struct rtw89_dev *rtwdev) md->bt0_pos =BTC_BT_BTG ;/* the only BT shares the BTG antenna with WL path B */ dm->ant_xmap[BTC_RF_S1 ][BTC_BT_1ST ] =1 ; + +if (test_bit (RTW89_QUIRK_1ANT , rtwdev->quirks)) { + md->ant.num =1 ; + md->ant.single_pos =RF_PATH_B ; + md->ant.btg_pos =RF_PATH_B ; + md->ant.stream_cnt =1 ; + } } rtwdev->btc.btg_pos = md->ant.btg_pos; rtwdev->btc.ant_type = md->ant.type;
@@ -856,7 +878,7 @@ static const struct rtw89_chip_ops rtw8852b_chip_ops = { .write_rf = rtw89_phy_write_rf_v1, .set_channel = rtw8852b_set_channel, .set_channel_help = rtw8852b_set_channel_help, - .read_efuse = rtw8852bx_read_efuse, + .read_efuse = rtw8852b_read_efuse, .read_phycap = rtw8852bx_read_phycap, .fem_setup = NULL, .data_setup = NULL,
Signature · 1 line
2.55.0
Ping-Ke Shih
maintainerQuoted 5 lines · Bitterblue Smith
RTL8852BE-VS (PCI ID 10ec:b85b, RFE type 41) has only one spatial stream and likely one physical antenna, but the firmware reports two antennas. This results in the driver configuring the wrong RF path, which leads to very poor reception. Users complain that 5 GHz networks are not visible.
Quoted 7 lines
Hardcode the number of antennas for this RFE type to one, and the correct RF path for the Bluetooth coexistence code. This is what the vendor driver does.
1 patch(es) applied to rtw-next branch of rtw.git, thanks.
411e89374aa2 wifi: rtw89: Override antenna number for RTL8852BE-VS