Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Oct 2011 19:25:12 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r226317 - stable/8/sys/dev/iwn
Message-ID:  <201110121925.p9CJPCVc080647@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Wed Oct 12 19:25:12 2011
New Revision: 226317
URL: http://svn.freebsd.org/changeset/base/226317

Log:
  MFC: r225686
  
  Manually set the channel when using monitor mode - the firmware
  doesn't select it automatically.
  
  Submitted by:	nox
  Reviewed by:	bschmidt
  PR:		kern/160815

Modified:
  stable/8/sys/dev/iwn/if_iwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/iwn/if_iwn.c
==============================================================================
--- stable/8/sys/dev/iwn/if_iwn.c	Wed Oct 12 19:23:28 2011	(r226316)
+++ stable/8/sys/dev/iwn/if_iwn.c	Wed Oct 12 19:25:12 2011	(r226317)
@@ -6656,12 +6656,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,
+		    "%s: error %d settting channel\n", __func__, error);
+	}
 	IWN_UNLOCK(sc);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110121925.p9CJPCVc080647>