Commit 79258659 authored by Chih-Kang Chang's avatar Chih-Kang Chang Committed by Ping-Ke Shih

wifi: rtw89: add polling for LPS H2C to ensure FW received

We add polling after sending LPS H2C to ensure that the Firmware is
received and executes RPWM thereafter. Otherwise, if the Firmware
executes RPWM without receiving LPS H2C, it will cause beacon loss in
WoWLAN mode due to the inability to obtain channel and bandwidth
information from H2C.
Signed-off-by: default avatarChih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240620055825.17592-8-pkshih@realtek.com
parent 2e256487
...@@ -2496,6 +2496,7 @@ int rtw89_fw_h2c_lps_ch_info(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif) ...@@ -2496,6 +2496,7 @@ int rtw89_fw_h2c_lps_ch_info(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)
struct rtw89_h2c_lps_ch_info *h2c; struct rtw89_h2c_lps_ch_info *h2c;
u32 len = sizeof(*h2c); u32 len = sizeof(*h2c);
struct sk_buff *skb; struct sk_buff *skb;
u32 done;
int ret; int ret;
if (chip->chip_gen != RTW89_CHIP_BE) if (chip->chip_gen != RTW89_CHIP_BE)
...@@ -2519,12 +2520,18 @@ int rtw89_fw_h2c_lps_ch_info(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif) ...@@ -2519,12 +2520,18 @@ int rtw89_fw_h2c_lps_ch_info(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)
H2C_CAT_OUTSRC, H2C_CL_OUTSRC_DM, H2C_CAT_OUTSRC, H2C_CL_OUTSRC_DM,
H2C_FUNC_FW_LPS_CH_INFO, 0, 0, len); H2C_FUNC_FW_LPS_CH_INFO, 0, 0, len);
rtw89_phy_write32_mask(rtwdev, R_CHK_LPS_STAT, B_CHK_LPS_STAT, 0);
ret = rtw89_h2c_tx(rtwdev, skb, false); ret = rtw89_h2c_tx(rtwdev, skb, false);
if (ret) { if (ret) {
rtw89_err(rtwdev, "failed to send h2c\n"); rtw89_err(rtwdev, "failed to send h2c\n");
goto fail; goto fail;
} }
ret = read_poll_timeout(rtw89_phy_read32_mask, done, done, 50, 5000,
true, rtwdev, R_CHK_LPS_STAT, B_CHK_LPS_STAT);
if (ret)
rtw89_warn(rtwdev, "h2c_lps_ch_info done polling timeout\n");
return 0; return 0;
fail: fail:
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
......
...@@ -7818,6 +7818,8 @@ ...@@ -7818,6 +7818,8 @@
#define B_UPD_P0_EN BIT(31) #define B_UPD_P0_EN BIT(31)
#define R_EMLSR 0x0044 #define R_EMLSR 0x0044
#define B_EMLSR_PARM GENMASK(27, 12) #define B_EMLSR_PARM GENMASK(27, 12)
#define R_CHK_LPS_STAT 0x0058
#define B_CHK_LPS_STAT BIT(0)
#define R_SPOOF_CG 0x00B4 #define R_SPOOF_CG 0x00B4
#define B_SPOOF_CG_EN BIT(17) #define B_SPOOF_CG_EN BIT(17)
#define R_CHINFO_SEG 0x00B4 #define R_CHINFO_SEG 0x00B4
......
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