From owner-svn-src-head@freebsd.org Tue Sep 15 03:01:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03837A03C84; Tue, 15 Sep 2015 03:01:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5DCF19DF; Tue, 15 Sep 2015 03:01:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8F31f89015621; Tue, 15 Sep 2015 03:01:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8F31foB015620; Tue, 15 Sep 2015 03:01:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201509150301.t8F31foB015620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 15 Sep 2015 03:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287804 - head/sys/dev/usb/wlan 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.20 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: Tue, 15 Sep 2015 03:01:42 -0000 Author: adrian Date: Tue Sep 15 03:01:40 2015 New Revision: 287804 URL: https://svnweb.freebsd.org/changeset/base/287804 Log: Replace the scan event input path hack with the new rx-stats based method. This allows for arbitrary channel info to be placed in the input call rather than the totally gross hack of overriding ic_curchan. Without this I'm sure ic_curchan setting was racing with the scan code setting the channel itself.. Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Mon Sep 14 21:26:48 2015 (r287803) +++ head/sys/dev/usb/wlan/if_rsu.c Tue Sep 15 03:01:40 2015 (r287804) @@ -1151,8 +1151,8 @@ rsu_event_survey(struct rsu_softc *sc, u { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_frame *wh; - struct ieee80211_channel *c; struct ndis_wlan_bssid_ex *bss; + struct ieee80211_rx_stats rxs; struct mbuf *m; int pktlen; @@ -1192,17 +1192,19 @@ rsu_event_survey(struct rsu_softc *sc, u /* Finalize mbuf. */ m->m_pkthdr.len = m->m_len = pktlen; - /* Fix the channel. */ - c = ieee80211_find_channel_byieee(ic, - le32toh(bss->config.dsconfig), - IEEE80211_CHAN_G); - if (c) { - ic->ic_curchan = c; - ieee80211_radiotap_chan_change(ic); - } + + /* Set channel flags for input path */ + bzero(&rxs, sizeof(rxs)); + rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; + rxs.c_ieee = le32toh(bss->config.dsconfig); + rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ); + rxs.rssi = le32toh(bss->rssi); + rxs.nf = 0; /* XXX */ + /* XXX avoid a LOR */ RSU_UNLOCK(sc); - ieee80211_input_all(ic, m, le32toh(bss->rssi), 0); + ieee80211_input_mimo_all(ic, m, &rxs); RSU_LOCK(sc); }