From owner-svn-src-head@FreeBSD.ORG Sat Dec 7 08:32:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 111AECD3; Sat, 7 Dec 2013 08:32:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E49DC1E23; Sat, 7 Dec 2013 08:32:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB78WFDF066224; Sat, 7 Dec 2013 08:32:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB78WFV7066223; Sat, 7 Dec 2013 08:32:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312070832.rB78WFV7066223@svn.freebsd.org> From: Adrian Chadd Date: Sat, 7 Dec 2013 08:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259064 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2013 08:32:16 -0000 Author: adrian Date: Sat Dec 7 08:32:15 2013 New Revision: 259064 URL: http://svnweb.freebsd.org/changeset/base/259064 Log: Refactor out the scan id and scan vap as part of the scan work. Make the scan state optional - we'll obviously need a vap, but we now won't require the scan state. the only thing the scan state is needed for is to check for the list of SSIDs to scan - which we can now just plain ignore by passing in NULL as the scan state pointer. Tested: * Intel 5100 (STA) Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sat Dec 7 08:25:24 2013 (r259063) +++ head/sys/dev/iwn/if_iwn.c Sat Dec 7 08:32:15 2013 (r259064) @@ -282,7 +282,8 @@ static int iwn_send_advanced_btcoex(stru static int iwn5000_runtime_calib(struct iwn_softc *); static int iwn_config(struct iwn_softc *); static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int); -static int iwn_scan(struct iwn_softc *, struct ieee80211_channel *); +static int iwn_scan(struct iwn_softc *, struct ieee80211vap *, + struct ieee80211_scan_state *, struct ieee80211_channel *); static int iwn_auth(struct iwn_softc *, struct ieee80211vap *vap); static int iwn_run(struct iwn_softc *, struct ieee80211vap *vap); static int iwn_ampdu_rx_start(struct ieee80211_node *, @@ -6352,12 +6353,12 @@ iwn_get_passive_dwell_time(struct iwn_so } static int -iwn_scan(struct iwn_softc *sc, struct ieee80211_channel *c) +iwn_scan(struct iwn_softc *sc, struct ieee80211vap *vap, + struct ieee80211_scan_state *ss, struct ieee80211_channel *c) { struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211_scan_state *ss = ic->ic_scan; /*XXX*/ - struct ieee80211_node *ni = ss->ss_vap->iv_bss; + struct ieee80211_node *ni = vap->iv_bss; struct iwn_scan_hdr *hdr; struct iwn_cmd_data *tx; struct iwn_scan_essid *essid; @@ -6465,22 +6466,26 @@ iwn_scan(struct iwn_softc *sc, struct ie /* * If we're scanning for a specific SSID, add it to the command. + * + * XXX maybe look at adding support for scanning multiple SSIDs? */ essid = (struct iwn_scan_essid *)(tx + 1); - if (ss->ss_ssid[0].len != 0) { - essid[0].id = IEEE80211_ELEMID_SSID; - essid[0].len = ss->ss_ssid[0].len; - memcpy(essid[0].data, ss->ss_ssid[0].ssid, ss->ss_ssid[0].len); - } + if (ss != NULL) { + if (ss->ss_ssid[0].len != 0) { + essid[0].id = IEEE80211_ELEMID_SSID; + essid[0].len = ss->ss_ssid[0].len; + memcpy(essid[0].data, ss->ss_ssid[0].ssid, ss->ss_ssid[0].len); + } - DPRINTF(sc, IWN_DEBUG_SCAN, "%s: ssid_len=%d, ssid=%*s\n", - __func__, - ss->ss_ssid[0].len, - ss->ss_ssid[0].len, - ss->ss_ssid[0].ssid); + DPRINTF(sc, IWN_DEBUG_SCAN, "%s: ssid_len=%d, ssid=%*s\n", + __func__, + ss->ss_ssid[0].len, + ss->ss_ssid[0].len, + ss->ss_ssid[0].ssid); - if (ss->ss_nssid > 0) - is_active = 1; + if (ss->ss_nssid > 0) + is_active = 1; + } /* * Build a probe request frame. Most of the following code is a @@ -8488,7 +8493,7 @@ iwn_scan_curchan(struct ieee80211_scan_s int error; IWN_LOCK(sc); - error = iwn_scan(sc, ic->ic_curchan); + error = iwn_scan(sc, vap, ss, ic->ic_curchan); IWN_UNLOCK(sc); if (error != 0) ieee80211_cancel_scan(vap);