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);
 }
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to