Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Mar 2018 07:59:14 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r330232 - stable/11/sys/net80211
Message-ID:  <201803010759.w217xEfO099517@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Thu Mar  1 07:59:14 2018
New Revision: 330232
URL: https://svnweb.freebsd.org/changeset/base/330232

Log:
  MFC r307602:
  
  [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)

Modified:
  stable/11/sys/net80211/ieee80211_scan_sw.c
  stable/11/sys/net80211/ieee80211_var.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/net80211/ieee80211_scan_sw.c
==============================================================================
--- stable/11/sys/net80211/ieee80211_scan_sw.c	Thu Mar  1 07:55:48 2018	(r330231)
+++ stable/11/sys/net80211/ieee80211_scan_sw.c	Thu Mar  1 07:59:14 2018	(r330232)
@@ -410,6 +410,12 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanne
 	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)
 {
@@ -506,6 +512,12 @@ ieee80211_swscan_probe_curchan(struct ieee80211vap *va
 	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.
 	 * XXX remove dependence on ic/vap->iv_bss
@@ -611,7 +623,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 */
@@ -864,7 +883,12 @@ scan_done(struct ieee80211_scan_state *ss, int scandon
 	 * 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;
 

Modified: stable/11/sys/net80211/ieee80211_var.h
==============================================================================
--- stable/11/sys/net80211/ieee80211_var.h	Thu Mar  1 07:55:48 2018	(r330231)
+++ stable/11/sys/net80211/ieee80211_var.h	Thu Mar  1 07:59:14 2018	(r330232)
@@ -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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803010759.w217xEfO099517>