[net80211] Initial full-offload scan support.

This is a very simple addition to the net80211 scan support.

It doesn't implement a replacement scan interface - it just disables
the pieces that we should disable to make this lifecycle a bit
more managable.

There's more work to come before full scan offload support is available
but it should be good enough for driver work.

* add a flag to say "full offload"
* don't do probe requests when scanning full-offload - firmware can do that
* don't do powersave transitions and buffering - firmware can do that

tested:

* iwm(4) - STA mode
* ath10k port (local, not in freebsd-head yet)

Reviewed by:	avos
Differential Revision:	https://reviews.freebsd.org/D8262
This commit is contained in:
Adrian Chadd 2016-10-19 05:03:46 +00:00
parent b95d46da24
commit 84c7170e29
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=307602
2 changed files with 28 additions and 3 deletions

View File

@ -412,6 +412,12 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanner *scan,
return (ic->ic_flags & IEEE80211_F_SCAN);
}
/*
* Taskqueue work to cancel a scan.
*
* Note: for offload scan devices, we may want to call into the
* driver to try and cancel scanning, however it may not be cancelable.
*/
static void
cancel_scan(struct ieee80211vap *vap, int any, const char *func)
{
@ -511,6 +517,12 @@ ieee80211_swscan_probe_curchan(struct ieee80211vap *vap, int force)
struct ifnet *ifp = vap->iv_ifp;
int i;
/*
* Full-offload scan devices don't require this.
*/
if (vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD)
return;
/*
* Send directed probe requests followed by any
* broadcast probe request.
@ -617,7 +629,14 @@ scan_start(void *arg, int pending)
return;
}
if (vap->iv_opmode == IEEE80211_M_STA &&
/*
* Put the station into power save mode.
*
* This is only required if we're not a full-offload devices;
* those devices manage scan/traffic differently.
*/
if (((vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) == 0) &&
vap->iv_opmode == IEEE80211_M_STA &&
vap->iv_state == IEEE80211_S_RUN) {
if ((vap->iv_bss->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) {
/* Enable station power save mode */
@ -870,7 +889,12 @@ scan_done(struct ieee80211_scan_state *ss, int scandone)
* waiting for us.
*/
if (scandone) {
vap->iv_sta_ps(vap, 0);
/*
* If we're not a scan offload device, come back out of
* station powersave. Offload devices handle this themselves.
*/
if ((vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) == 0)
vap->iv_sta_ps(vap, 0);
if (ss->ss_next >= ss->ss_last)
ic->ic_flags_ext &= ~IEEE80211_FEXT_BGSCAN;

View File

@ -601,11 +601,12 @@ MALLOC_DECLARE(M_80211_VAP);
#define IEEE80211_FEXT_WDSLEGACY 0x00010000 /* CONF: legacy WDS operation */
#define IEEE80211_FEXT_PROBECHAN 0x00020000 /* CONF: probe passive channel*/
#define IEEE80211_FEXT_UNIQMAC 0x00040000 /* CONF: user or computed mac */
#define IEEE80211_FEXT_SCAN_OFFLOAD 0x00080000 /* CONF: scan is fully offloaded */
#define IEEE80211_FEXT_BITS \
"\20\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \
"\0114ADDR\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\16STATEWAIT\17REINIT" \
"\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC"
"\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC\24SCAN_OFFLOAD"
/* ic_flags_ht/iv_flags_ht */
#define IEEE80211_FHT_NONHT_PR 0x00000001 /* STATUS: non-HT sta present */