summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwn
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-12-07 08:20:24 +0000
committeradrian <adrian@FreeBSD.org>2013-12-07 08:20:24 +0000
commitccb968bcb9edd96c1847dd26eeb1150fce97c995 (patch)
tree6fe2557ed82b19af142de6ef56229b5663508222 /sys/dev/iwn
parent261e81f3a9122b8e3543964d22c214c6cf998ccd (diff)
downloadFreeBSD-src-ccb968bcb9edd96c1847dd26eeb1150fce97c995.zip
FreeBSD-src-ccb968bcb9edd96c1847dd26eeb1150fce97c995.tar.gz
Refactor out the scan channel to be assigned early on in iwn_scan()
rather than it all being a mess of 'c' and 'ic->ic_curchan'. Tested: * Intel 5100 (STA)
Diffstat (limited to 'sys/dev/iwn')
-rw-r--r--sys/dev/iwn/if_iwn.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index c51ae38..8b4f70c 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -6385,6 +6385,9 @@ iwn_scan(struct iwn_softc *sc)
return (EAGAIN);
}
+ /* Assign the scan channel */
+ c = ic->ic_curchan;
+
sc->rxon = &sc->rx_on[IWN_RXON_BSS_CTX];
buf = malloc(IWN_SCAN_MAXSZ, M_DEVBUF, M_NOWAIT | M_ZERO);
if (buf == NULL) {
@@ -6422,7 +6425,7 @@ iwn_scan(struct iwn_softc *sc)
IWN_RXCHAIN_VALID(sc->rxchainmask) |
IWN_RXCHAIN_FORCE_MIMO_SEL(sc->rxchainmask) |
IWN_RXCHAIN_DRIVER_FORCE;
- if (IEEE80211_IS_CHAN_A(ic->ic_curchan) &&
+ if (IEEE80211_IS_CHAN_A(c) &&
sc->hw_type == IWN_HW_REV_TYPE_4965) {
/* Ant A must be avoided in 5GHz because of an HW bug. */
rxchain |= IWN_RXCHAIN_FORCE_SEL(IWN_ANT_B);
@@ -6436,7 +6439,7 @@ iwn_scan(struct iwn_softc *sc)
tx->id = sc->broadcast_id;
tx->lifetime = htole32(IWN_LIFETIME_INFINITE);
- if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) {
+ if (IEEE80211_IS_CHAN_5GHZ(c)) {
/* Send probe requests at 6Mbps. */
tx->rate = htole32(0xd);
rs = &ic->ic_sup_rates[IEEE80211_MODE_11A];
@@ -6540,7 +6543,6 @@ iwn_scan(struct iwn_softc *sc)
hdr->crc_threshold = is_active ?
IWN_GOOD_CRC_TH_DEFAULT : IWN_GOOD_CRC_TH_NEVER;
- c = ic->ic_curchan;
chan = (struct iwn_scan_chan *)frm;
chan->chan = htole16(ieee80211_chan2ieee(ic, c));
chan->flags = 0;
OpenPOWER on IntegriCloud