summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbschmidt <bschmidt@FreeBSD.org>2011-04-16 07:17:03 +0000
committerbschmidt <bschmidt@FreeBSD.org>2011-04-16 07:17:03 +0000
commit20625a61f28ec8ef23e483d7b8e65d2030d9249a (patch)
tree7a59d058c363d23dffeeeb74be0b1df27231c161
parent4cd56ff29fbff0da6eef2729ec88f7fda7a1b9f0 (diff)
downloadFreeBSD-src-20625a61f28ec8ef23e483d7b8e65d2030d9249a.zip
FreeBSD-src-20625a61f28ec8ef23e483d7b8e65d2030d9249a.tar.gz
Obtain the channel number directly from the laster RXON command, also
chan is an uint8_t.
-rw-r--r--sys/dev/iwn/if_iwn.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index 38b96de..dc12fbf 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -1732,7 +1732,8 @@ iwn_read_eeprom_band(struct iwn_softc *sc, int n)
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, struct ieee80211_channel *ch,
((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, struct ieee80211_channel *ch,
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);
OpenPOWER on IntegriCloud