Fwd: [PATCH: iwn(4)] Fix channel switching in monitor mode

Adrian Chadd adrian at freebsd.org
Fri Sep 16 22:01:08 UTC 2011

---------- Forwarded message ----------
From: Juergen Lock <nox at jelal.kn-bremen.de>
Date: 17 September 2011 01:37
Subject: [PATCH: iwn(4)] Fix channel switching in monitor mode
To: freebsd-current at freebsd.org
Cc: freebsd-mobile at freebsd.org


 I just got a "Centrino Advanced-N 6230" half-size mini-pcie card
(using iwn6000g2bfw.ko firmware, my Dell Precision M4500 laptop
came with an unsupported Broadcom BCM4313:


), and found channel switching didn't work in monitor mode, the
patch below seems to fix it - also at:


 (I also applied the two patches from the `"Intel Centrino Advanced-N +
WiMAX 6250" doesn't work' thread tho I'm not 100% sure they are needed
for this nic:





 And here is the channel switching patch:

--- src/sys/dev/iwn/if_iwn.c.orig
+++ src/sys/dev/iwn/if_iwn.c
@@ -6984,12 +6984,24 @@ iwn_set_channel(struct ieee80211com *ic)
       const struct ieee80211_channel *c = ic->ic_curchan;
       struct ifnet *ifp = ic->ic_ifp;
       struct iwn_softc *sc = ifp->if_softc;
+       int error;

       sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq);
       sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags);
       sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq);
       sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags);
+       /*
+        * Only need to set the channel in Monitor mode. AP scanning and auth
+        * are already taken care of by their respective firmware commands.
+        */
+       if (ic->ic_opmode == IEEE80211_M_MONITOR) {
+               error = iwn_config(sc);
+               if (error != 0)
+                       device_printf(sc->sc_dev,
+                           "error %d settting channel\n", error);
+       }

freebsd-current at freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscribe at freebsd.org"

More information about the freebsd-wireless mailing list