Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Jun 2011 11:41:06 +0000 (UTC)
From:      Bernhard Schmidt <bschmidt@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: r223241 - stable/8/sys/dev/iwn
Message-ID:  <201106181141.p5IBf66g038973@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bschmidt
Date: Sat Jun 18 11:41:06 2011
New Revision: 223241
URL: http://svn.freebsd.org/changeset/base/223241

Log:
  MFC r220687:
  Obtain the channel number directly from the laster RXON command, also
  chan is an uint8_t.

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	Sat Jun 18 11:39:09 2011	(r223240)
+++ stable/8/sys/dev/iwn/if_iwn.c	Sat Jun 18 11:41:06 2011	(r223241)
@@ -1732,7 +1732,8 @@ iwn_read_eeprom_band(struct iwn_softc *s
 	struct iwn_eeprom_chan *channels = sc->eeprom_channels[n];
 	const struct iwn_chan_band *band = &iwn_bands[n];
 	struct ieee80211_channel *c;
-	int i, chan, nflags;
+	uint8_t chan;
+	int i, nflags;
 
 	for (i = 0; i < band->nchan; i++) {
 		if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) {
@@ -3806,8 +3807,6 @@ iwn4965_set_txpower(struct iwn_softc *sc
 	((y1) + fdivround(((int)(x) - (x1)) * ((y2) - (y1)), (x2) - (x1), n))
 
 	static const int tdiv[IWN_NATTEN_GROUPS] = { 9, 8, 8, 8, 6 };
-	struct ifnet *ifp = sc->sc_ifp;
-	struct ieee80211com *ic = ifp->if_l2com;
 	struct iwn_ucode_info *uc = &sc->ucode_info;
 	struct iwn4965_cmd_txpower cmd;
 	struct iwn4965_eeprom_chan_samples *chans;
@@ -3816,8 +3815,8 @@ iwn4965_set_txpower(struct iwn_softc *sc
 	const uint8_t *rf_gain, *dsp_gain;
 	uint8_t chan;
 
-	/* Retrieve channel number. */
-	chan = ieee80211_chan2ieee(ic, ch);
+	/* Retrieve current channel from last RXON. */
+	chan = sc->rxon.chan;
 	DPRINTF(sc, IWN_DEBUG_RESET, "setting TX power for channel %d\n",
 	    chan);
 



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