Commit 67368f14 authored by Chin-Yen Lee's avatar Chin-Yen Lee Committed by Kalle Valo

rtw88: refine the setting of rsvd pages for different firmware

The original setting of rsvd pages is compilcated and lead to
error for connecting to AP after resuming from pno mode.
We refine the setting based on different firmware and the link state
to avoid it.
Signed-off-by: default avatarChin-Yen Lee <timlee@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210728014335.8785-3-pkshih@realtek.com
parent 02a55c00
......@@ -443,37 +443,31 @@ static void rtw_wow_fw_media_status(struct rtw_dev *rtwdev, bool connect)
rtw_iterate_stas_atomic(rtwdev, rtw_wow_fw_media_status_iter, &data);
}
static void rtw_wow_config_pno_rsvd_page(struct rtw_dev *rtwdev,
struct rtw_vif *rtwvif)
static int rtw_wow_config_wow_fw_rsvd_page(struct rtw_dev *rtwdev)
{
rtw_add_rsvd_page_pno(rtwdev, rtwvif);
}
static void rtw_wow_config_linked_rsvd_page(struct rtw_dev *rtwdev,
struct rtw_vif *rtwvif)
{
rtw_add_rsvd_page_sta(rtwdev, rtwvif);
}
struct ieee80211_vif *wow_vif = rtwdev->wow.wow_vif;
struct rtw_vif *rtwvif = (struct rtw_vif *)wow_vif->drv_priv;
static void rtw_wow_config_rsvd_page(struct rtw_dev *rtwdev,
struct rtw_vif *rtwvif)
{
rtw_remove_rsvd_page(rtwdev, rtwvif);
if (rtw_wow_mgd_linked(rtwdev)) {
rtw_wow_config_linked_rsvd_page(rtwdev, rtwvif);
} else if (test_bit(RTW_FLAG_WOWLAN, rtwdev->flags) &&
rtw_wow_no_link(rtwdev)) {
rtw_wow_config_pno_rsvd_page(rtwdev, rtwvif);
}
if (rtw_wow_no_link(rtwdev))
rtw_add_rsvd_page_pno(rtwdev, rtwvif);
else
rtw_add_rsvd_page_sta(rtwdev, rtwvif);
return rtw_fw_download_rsvd_page(rtwdev);
}
static int rtw_wow_dl_fw_rsvd_page(struct rtw_dev *rtwdev)
static int rtw_wow_config_normal_fw_rsvd_page(struct rtw_dev *rtwdev)
{
struct ieee80211_vif *wow_vif = rtwdev->wow.wow_vif;
struct rtw_vif *rtwvif = (struct rtw_vif *)wow_vif->drv_priv;
rtw_wow_config_rsvd_page(rtwdev, rtwvif);
rtw_remove_rsvd_page(rtwdev, rtwvif);
rtw_add_rsvd_page_sta(rtwdev, rtwvif);
if (rtw_wow_no_link(rtwdev))
return 0;
return rtw_fw_download_rsvd_page(rtwdev);
}
......@@ -671,7 +665,7 @@ static int rtw_wow_enable(struct rtw_dev *rtwdev)
set_bit(RTW_FLAG_WOWLAN, rtwdev->flags);
ret = rtw_wow_dl_fw_rsvd_page(rtwdev);
ret = rtw_wow_config_wow_fw_rsvd_page(rtwdev);
if (ret) {
rtw_err(rtwdev, "failed to download wowlan rsvd page\n");
goto error;
......@@ -744,7 +738,7 @@ static int rtw_wow_disable(struct rtw_dev *rtwdev)
goto out;
}
ret = rtw_wow_dl_fw_rsvd_page(rtwdev);
ret = rtw_wow_config_normal_fw_rsvd_page(rtwdev);
if (ret)
rtw_err(rtwdev, "failed to download normal rsvd page\n");
......
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