Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Oct 2016 05:03:46 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r307602 - head/sys/net80211
Message-ID:  <201610190503.u9J53kIV066160@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Wed Oct 19 05:03:46 2016
New Revision: 307602
URL: https://svnweb.freebsd.org/changeset/base/307602

Log:
  [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

Modified:
  head/sys/net80211/ieee80211_scan_sw.c
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net80211/ieee80211_scan_sw.c
==============================================================================
--- head/sys/net80211/ieee80211_scan_sw.c	Wed Oct 19 02:39:24 2016	(r307601)
+++ head/sys/net80211/ieee80211_scan_sw.c	Wed Oct 19 05:03:46 2016	(r307602)
@@ -412,6 +412,12 @@ ieee80211_swscan_bg_scan(const struct ie
 	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)
 {
@@ -512,6 +518,12 @@ ieee80211_swscan_probe_curchan(struct ie
 	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
@@ -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 *s
 	 * 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: head/sys/net80211/ieee80211_var.h
==============================================================================
--- head/sys/net80211/ieee80211_var.h	Wed Oct 19 02:39:24 2016	(r307601)
+++ head/sys/net80211/ieee80211_var.h	Wed Oct 19 05:03:46 2016	(r307602)
@@ -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?201610190503.u9J53kIV066160>