@@ -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");