From owner-svn-src-stable-11@freebsd.org Thu Mar 1 07:59:15 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 169DFF3A4ED; Thu, 1 Mar 2018 07:59:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5FF573AE6; Thu, 1 Mar 2018 07:59:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95A6C25BA4; Thu, 1 Mar 2018 07:59:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w217xE6D099521; Thu, 1 Mar 2018 07:59:14 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217xEfO099517; Thu, 1 Mar 2018 07:59:14 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010759.w217xEfO099517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 07:59:14 +0000 (UTC) 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 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 330232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 07:59:15 -0000 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 */