Date: Sat, 7 Dec 2013 08:20:24 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259062 - head/sys/dev/iwn Message-ID: <201312070820.rB78KO81062445@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Sat Dec 7 08:20:24 2013 New Revision: 259062 URL: http://svnweb.freebsd.org/changeset/base/259062 Log: 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) Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sat Dec 7 08:03:10 2013 (r259061) +++ head/sys/dev/iwn/if_iwn.c Sat Dec 7 08:20:24 2013 (r259062) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312070820.rB78KO81062445>