Commit ee20d538 authored by Po Hao Huang's avatar Po Hao Huang Committed by Kalle Valo

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: 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/20220401055043.12512-2-pkshih@realtek.com
parent 9fb4862e
...@@ -1940,8 +1940,8 @@ static void rtw89_ips_work(struct work_struct *work) ...@@ -1940,8 +1940,8 @@ static void rtw89_ips_work(struct work_struct *work)
{ {
struct rtw89_dev *rtwdev = container_of(work, struct rtw89_dev, struct rtw89_dev *rtwdev = container_of(work, struct rtw89_dev,
ips_work); ips_work);
mutex_lock(&rtwdev->mutex); mutex_lock(&rtwdev->mutex);
if (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE)
rtw89_enter_ips(rtwdev); rtw89_enter_ips(rtwdev);
mutex_unlock(&rtwdev->mutex); mutex_unlock(&rtwdev->mutex);
} }
...@@ -2848,7 +2848,7 @@ void rtw89_core_scan_start(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif, ...@@ -2848,7 +2848,7 @@ void rtw89_core_scan_start(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif,
rtwdev->scanning = true; rtwdev->scanning = true;
rtw89_leave_lps(rtwdev); rtw89_leave_lps(rtwdev);
if (hw_scan && rtwvif->net_type == RTW89_NET_TYPE_NO_LINK) if (hw_scan && (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE))
rtw89_leave_ips(rtwdev); rtw89_leave_ips(rtwdev);
ether_addr_copy(rtwvif->mac_addr, mac_addr); ether_addr_copy(rtwvif->mac_addr, mac_addr);
...@@ -2872,7 +2872,7 @@ void rtw89_core_scan_complete(struct rtw89_dev *rtwdev, ...@@ -2872,7 +2872,7 @@ void rtw89_core_scan_complete(struct rtw89_dev *rtwdev,
rtwdev->scanning = false; rtwdev->scanning = false;
rtwdev->dig.bypass_dig = true; rtwdev->dig.bypass_dig = true;
if (hw_scan && rtwvif->net_type == RTW89_NET_TYPE_NO_LINK) 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);
} }
......
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