summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbschmidt <bschmidt@FreeBSD.org>2011-05-08 11:05:03 +0000
committerbschmidt <bschmidt@FreeBSD.org>2011-05-08 11:05:03 +0000
commit141d7e265f2d310c96089c289c0c38c9b096b986 (patch)
tree61fa512a31265fa04ea29d2d29dc03626eb1f326
parent641edf4468d4fefc4ddc327e14bb40fd1eb64c67 (diff)
downloadFreeBSD-src-141d7e265f2d310c96089c289c0c38c9b096b986.zip
FreeBSD-src-141d7e265f2d310c96089c289c0c38c9b096b986.tar.gz
Read chainmask information before announcing it.
-rw-r--r--sys/dev/iwn/if_iwn.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index efac31a..940f266 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -550,21 +550,6 @@ iwn_attach(device_t dev)
/* Clear pending interrupts. */
IWN_WRITE(sc, IWN_INT, 0xffffffff);
- /* Count the number of available chains. */
- sc->ntxchains =
- ((sc->txchainmask >> 2) & 1) +
- ((sc->txchainmask >> 1) & 1) +
- ((sc->txchainmask >> 0) & 1);
- sc->nrxchains =
- ((sc->rxchainmask >> 2) & 1) +
- ((sc->rxchainmask >> 1) & 1) +
- ((sc->rxchainmask >> 0) & 1);
- if (bootverbose) {
- device_printf(dev, "MIMO %dT%dR, %.4s, address %6D\n",
- sc->ntxchains, sc->nrxchains, sc->eeprom_domain,
- macaddr, ":");
- }
-
ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211);
if (ifp == NULL) {
device_printf(dev, "can not allocate ifnet structure\n");
@@ -592,6 +577,28 @@ iwn_attach(device_t dev)
if (sc->hw_type != IWN_HW_REV_TYPE_4965)
ic->ic_caps |= IEEE80211_C_BGSCAN; /* background scanning */
+ /* Read MAC address, channels, etc from EEPROM. */
+ if ((error = iwn_read_eeprom(sc, macaddr)) != 0) {
+ device_printf(dev, "could not read EEPROM, error %d\n",
+ error);
+ goto fail;
+ }
+
+ /* Count the number of available chains. */
+ sc->ntxchains =
+ ((sc->txchainmask >> 2) & 1) +
+ ((sc->txchainmask >> 1) & 1) +
+ ((sc->txchainmask >> 0) & 1);
+ sc->nrxchains =
+ ((sc->rxchainmask >> 2) & 1) +
+ ((sc->rxchainmask >> 1) & 1) +
+ ((sc->rxchainmask >> 0) & 1);
+ if (bootverbose) {
+ device_printf(dev, "MIMO %dT%dR, %.4s, address %6D\n",
+ sc->ntxchains, sc->nrxchains, sc->eeprom_domain,
+ macaddr, ":");
+ }
+
#if 0 /* HT */
/* XXX disable until HT channel setup works */
ic->ic_htcaps =
@@ -623,13 +630,6 @@ iwn_attach(device_t dev)
ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_DIS;
#endif
- /* Read MAC address, channels, etc from EEPROM. */
- if ((error = iwn_read_eeprom(sc, macaddr)) != 0) {
- device_printf(dev, "could not read EEPROM, error %d\n",
- error);
- goto fail;
- }
-
#if 0 /* HT */
/* Set supported HT rates. */
ic->ic_sup_mcs[0] = 0xff;
OpenPOWER on IntegriCloud