Skip to content

Commit

Permalink
wifi: rtw88: add flag check before enter or leave IPS
Browse files Browse the repository at this point in the history
Enter or leave IPS controlled by mac80211 before driver support HW
scan. After support HW scan, driver need to control IPS before start
HW scan and scan complete, but mac80211 also ask driver enter or leave
IPS. Therefore, we add flag check in IPS to prevent entering or
leaving IPS twice.

Signed-off-by: Chih-Kang Chang <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
Chih-Kang Chang authored and Kalle Valo committed Aug 10, 2022
1 parent d08458b commit 6bf3a08
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/wireless/realtek/rtw88/ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ static int rtw_ips_pwr_up(struct rtw_dev *rtwdev)
rtw_err(rtwdev, "leave idle state failed\n");

rtw_set_channel(rtwdev);
clear_bit(RTW_FLAG_INACTIVE_PS, rtwdev->flags);

return ret;
}

int rtw_enter_ips(struct rtw_dev *rtwdev)
{
set_bit(RTW_FLAG_INACTIVE_PS, rtwdev->flags);
if (test_and_set_bit(RTW_FLAG_INACTIVE_PS, rtwdev->flags))
return 0;

rtw_coex_ips_notify(rtwdev, COEX_IPS_ENTER);

Expand All @@ -50,6 +50,9 @@ int rtw_leave_ips(struct rtw_dev *rtwdev)
{
int ret;

if (!test_and_clear_bit(RTW_FLAG_INACTIVE_PS, rtwdev->flags))
return 0;

rtw_hci_link_ps(rtwdev, false);

ret = rtw_ips_pwr_up(rtwdev);
Expand Down

0 comments on commit 6bf3a08

Please sign in to comment.