Commit 29ed2d76 authored by Po-Hao Huang's avatar Po-Hao Huang Committed by Kalle Valo
Browse files

rtw88: 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: default avatarPo-Hao Huang <phhuang@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220318034316.40720-1-pkshih@realtek.com
parent c5f67574
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -280,6 +280,7 @@ static void rtw_ips_work(struct work_struct *work)
	struct rtw_dev *rtwdev = container_of(work, struct rtw_dev, ips_work);
	struct rtw_dev *rtwdev = container_of(work, struct rtw_dev, ips_work);


	mutex_lock(&rtwdev->mutex);
	mutex_lock(&rtwdev->mutex);
	if (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE)
		rtw_enter_ips(rtwdev);
		rtw_enter_ips(rtwdev);
	mutex_unlock(&rtwdev->mutex);
	mutex_unlock(&rtwdev->mutex);
}
}
@@ -1353,7 +1354,7 @@ void rtw_core_scan_start(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif,


	rtw_leave_lps(rtwdev);
	rtw_leave_lps(rtwdev);


	if (hw_scan && rtwvif->net_type == RTW_NET_NO_LINK) {
	if (hw_scan && (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE)) {
		ret = rtw_leave_ips(rtwdev);
		ret = rtw_leave_ips(rtwdev);
		if (ret) {
		if (ret) {
			rtw_err(rtwdev, "failed to leave idle state\n");
			rtw_err(rtwdev, "failed to leave idle state\n");
@@ -1389,7 +1390,7 @@ void rtw_core_scan_complete(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,


	rtw_coex_scan_notify(rtwdev, COEX_SCAN_FINISH);
	rtw_coex_scan_notify(rtwdev, COEX_SCAN_FINISH);


	if (rtwvif->net_type == RTW_NET_NO_LINK && hw_scan)
	if (hw_scan && (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE))
		ieee80211_queue_work(rtwdev->hw, &rtwdev->ips_work);
		ieee80211_queue_work(rtwdev->hw, &rtwdev->ips_work);
}
}