wifi: rtw89: 8852b: don't support LPS-PG mode after firmware 0.29.26.0
authorPing-Ke Shih <pkshih@realtek.com>
Mon, 23 Jan 2023 06:54:00 +0000 (14:54 +0800)
committerKalle Valo <kvalo@kernel.org>
Mon, 13 Feb 2023 17:17:36 +0000 (19:17 +0200)
Due to firmware size limit of 8852b, LPS-PG mode isn't supported after
0.29.26.0, and then we have more space to support other features, such as
P2P-PS, hardware scan and so on.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230123065401.14174-6-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/fw.c

index 78ce64d1a387d2e716f73167b62bdb31a12a4424..3ed2f3a966353ac251d6c2f6c6ba5708726a8664 100644 (file)
@@ -1764,7 +1764,8 @@ static enum rtw89_ps_mode rtw89_update_ps_mode(struct rtw89_dev *rtwdev)
            RTW89_CHK_FW_FEATURE(NO_DEEP_PS, &rtwdev->fw))
                return RTW89_PS_MODE_NONE;
 
-       if (chip->ps_mode_supported & BIT(RTW89_PS_MODE_PWR_GATED))
+       if ((chip->ps_mode_supported & BIT(RTW89_PS_MODE_PWR_GATED)) &&
+           !RTW89_CHK_FW_FEATURE(NO_LPS_PG, &rtwdev->fw))
                return RTW89_PS_MODE_PWR_GATED;
 
        if (chip->ps_mode_supported & BIT(RTW89_PS_MODE_CLK_GATED))
@@ -3160,7 +3161,6 @@ int rtw89_core_init(struct rtw89_dev *rtwdev)
        rtw89_core_ppdu_sts_init(rtwdev);
        rtw89_traffic_stats_init(rtwdev, &rtwdev->stats);
 
-       rtwdev->ps_mode = rtw89_update_ps_mode(rtwdev);
        rtwdev->hal.rx_fltr = DEFAULT_AX_RX_FLTR;
 
        INIT_WORK(&btc->eapol_notify_work, rtw89_btc_ntfy_eapol_packet_work);
@@ -3316,6 +3316,8 @@ int rtw89_chip_info_setup(struct rtw89_dev *rtwdev)
        if (ret)
                return ret;
 
+       rtwdev->ps_mode = rtw89_update_ps_mode(rtwdev);
+
        return 0;
 }
 EXPORT_SYMBOL(rtw89_chip_info_setup);
index 505e3b20436ac00232360ba5821183b9cb221095..75705dcc0996e9708a72e23b0376e1a4b2e13e31 100644 (file)
@@ -3023,6 +3023,7 @@ enum rtw89_fw_feature {
        RTW89_FW_FEATURE_CRASH_TRIGGER,
        RTW89_FW_FEATURE_PACKET_DROP,
        RTW89_FW_FEATURE_NO_DEEP_PS,
+       RTW89_FW_FEATURE_NO_LPS_PG,
 };
 
 struct rtw89_fw_suit {
index dc90074261244ce783e448af0b09e368a77a35aa..4da5eedbf8aacc9b8acca9f9b84f446fdba282ab 100644 (file)
@@ -255,6 +255,7 @@ static const struct __fw_feat_cfg fw_feat_tbl[] = {
        __CFG_FW_FEAT(RTL8852A, ge, 0, 13, 35, 0, TX_WAKE),
        __CFG_FW_FEAT(RTL8852A, ge, 0, 13, 36, 0, CRASH_TRIGGER),
        __CFG_FW_FEAT(RTL8852A, ge, 0, 13, 38, 0, PACKET_DROP),
+       __CFG_FW_FEAT(RTL8852B, ge, 0, 29, 26, 0, NO_LPS_PG),
        __CFG_FW_FEAT(RTL8852C, ge, 0, 27, 20, 0, PACKET_DROP),
        __CFG_FW_FEAT(RTL8852C, le, 0, 27, 33, 0, NO_DEEP_PS),
        __CFG_FW_FEAT(RTL8852C, ge, 0, 27, 34, 0, TX_WAKE),