kern/160815: [patch] [iwn] Fix channel switching in monitor mode

Juergen Lock nox at FreeBSD.org
Mon Sep 19 00:10:09 UTC 2011


>Number:         160815
>Category:       kern
>Synopsis:       [patch] [iwn] Fix channel switching in monitor mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 19 00:10:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Juergen Lock
>Release:        FreeBSD 8.2-STABLE i386
>Organization:
me?  organized??
>Environment:
System: FreeBSD enceladus.kn-bremen.de 9.0-BETA1 FreeBSD 9.0-BETA1 #1: Thu Sep 15 23:06:39 CEST 2011     nox at enceladus.kn-bremen.de:/usr/obj/usr/src/sys/ENCELADUS  amd64


>Description:
	As mentioned earler on -current,

		http://lists.freebsd.org/pipermail/freebsd-current/2011-September/027418.html

	I have a "Centrino Advanced-N 6230" half-size mini-pcie
	card and found channel switching didn't work in monitor
	mode, the patch below seems to fix it.

>How-To-Repeat:
	# ifconfig wlan0 create wlandev iwn0 wlanmode monitor ...

>Fix:

--- 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;
 
 	IWN_LOCK(sc);
 	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);
+	}
 	IWN_UNLOCK(sc);
 }
 


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list