Skip to content

Commit ee20d53

Browse files
Po Hao HuangKalle Valo
authored andcommitted
rtw89: change idle mode condition during hw_scan
Previously we only consider single interface's status, idle mode behavior could be unexpected when multiple interfaces is active. Change to enter/leave idle mode by mac80211's configuration state. Signed-off-by: Po Hao Huang <phhuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220401055043.12512-2-pkshih@realtek.com
1 parent 9fb4862 commit ee20d53

File tree

1 file changed

+4
-4
lines changed
  • drivers/net/wireless/realtek/rtw89

1 file changed

+4
-4
lines changed

drivers/net/wireless/realtek/rtw89/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,9 +1940,9 @@ static void rtw89_ips_work(struct work_struct *work)
19401940
{
19411941
struct rtw89_dev *rtwdev = container_of(work, struct rtw89_dev,
19421942
ips_work);
1943-
19441943
mutex_lock(&rtwdev->mutex);
1945-
rtw89_enter_ips(rtwdev);
1944+
if (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE)
1945+
rtw89_enter_ips(rtwdev);
19461946
mutex_unlock(&rtwdev->mutex);
19471947
}
19481948

@@ -2848,7 +2848,7 @@ void rtw89_core_scan_start(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif,
28482848

28492849
rtwdev->scanning = true;
28502850
rtw89_leave_lps(rtwdev);
2851-
if (hw_scan && rtwvif->net_type == RTW89_NET_TYPE_NO_LINK)
2851+
if (hw_scan && (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE))
28522852
rtw89_leave_ips(rtwdev);
28532853

28542854
ether_addr_copy(rtwvif->mac_addr, mac_addr);
@@ -2872,7 +2872,7 @@ void rtw89_core_scan_complete(struct rtw89_dev *rtwdev,
28722872

28732873
rtwdev->scanning = false;
28742874
rtwdev->dig.bypass_dig = true;
2875-
if (hw_scan && rtwvif->net_type == RTW89_NET_TYPE_NO_LINK)
2875+
if (hw_scan && (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE))
28762876
ieee80211_queue_work(rtwdev->hw, &rtwdev->ips_work);
28772877
}
28782878

0 commit comments

Comments
 (0)