Date: Sun, 8 May 2011 11:05:03 +0000 (UTC) From: Bernhard Schmidt <bschmidt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r221642 - head/sys/dev/iwn Message-ID: <201105081105.p48B53qZ042928@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bschmidt Date: Sun May 8 11:05:03 2011 New Revision: 221642 URL: http://svn.freebsd.org/changeset/base/221642 Log: Read chainmask information before announcing it. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 11:03:16 2011 (r221641) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 11:05:03 2011 (r221642) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105081105.p48B53qZ042928>