aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2022-03-24 17:49:59 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2022-03-24 18:00:54 +0000
commit196cfd0b2eb640a63d007a7e9c3a74e4256255f3 (patch)
tree1d9bbe32d778c205a153ac0fee5626eb61fea87b /sys
parent321735f451d1eaa710a768d9e35ff87acb089d35 (diff)
downloadsrc-196cfd0b2eb640a63d007a7e9c3a74e4256255f3.tar.gz
src-196cfd0b2eb640a63d007a7e9c3a74e4256255f3.zip
LinuxKPI: 802.11: improve hw_scan fallback to sw_scan
Extending what was started in d3ef7fb459ff924911e5276db0c04b13cd8074d9, 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
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 727c0e276af9..384d068d7920 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -2547,17 +2547,27 @@ sw_scan:
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);
}
}
}