LinuxKPI: 802.11: improve hw_scan fallback to sw_scan

Extending what was started in d3ef7fb459,
when a driver signals that hw_scan is not possible and expects a sw_scan
to be preformed we triggered a sw_scan towards the driver but did not
let net80211 know.
Cancel the initial scan towards net80211.  If we we defer to sw_scan
then clear IEEE80211_FEXT_SCAN_OFFLOAD so net80211 will send probe
requests, and actively start a new scan with net80211.
This may have to be further refined in the future but seems to work
for the moment.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
This commit is contained in:
Bjoern A. Zeeb 2022-03-24 17:49:59 +00:00
parent 321735f451
commit 196cfd0b2e

View file

@ -2547,17 +2547,27 @@ lkpi_ic_scan_start(struct ieee80211com *ic)
free(hw_req, M_LKPI80211);
lhw->hw_req = NULL;
ieee80211_cancel_scan(vap);
/*
* XXX-SIGH magic number.
* rtw88 has a magic "return 1" if offloading scan is
* not possible. Fall back to sw scan in that case.
*/
if (error == 1)
if (error == 1) {
vap->iv_flags_ext &= ~IEEE80211_FEXT_SCAN_OFFLOAD;
ieee80211_start_scan(vap,
IEEE80211_SCAN_ACTIVE |
IEEE80211_SCAN_NOPICK |
IEEE80211_SCAN_ONCE,
IEEE80211_SCAN_FOREVER,
ss->ss_mindwell ? ss->ss_mindwell : msecs_to_ticks(20),
ss->ss_maxdwell ? ss->ss_maxdwell : msecs_to_ticks(200),
vap->iv_des_nssid, vap->iv_des_ssid);
goto sw_scan;
}
ic_printf(ic, "ERROR: %s: hw_scan returned %d\n",
__func__, error);
ieee80211_cancel_scan(vap);
}
}
}