diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-01-13 08:26:38 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-01-13 08:26:38 +0000 |
commit | 261512c5f8bc58c57710d5c9dea6d49cd3b3d698 (patch) | |
tree | cb3246000ddad13a43ca4bb5b742ed43c1b41a44 /sys | |
parent | 76a4d129112619ab1a6771b828b7eb6361ea6665 (diff) |
Fix iwn(4) firmware SYSASSERT during hardware initialization.
For some reason we would end up passing channel number zero to
the RXON firmware command, which the firmware doesn't like.
ok sthen@ reyk@
and also tested by stefan@, deraadt@, mikeb@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_iwn.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 8bdb11aa13f..dff1cefc9cb 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.154 2016/01/12 10:53:39 stsp Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.155 2016/01/13 08:26:37 stsp Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -4455,15 +4455,9 @@ iwn_config(struct iwn_softc *sc) IEEE80211_ADDR_COPY(ic->ic_myaddr, LLADDR(ifp->if_sadl)); IEEE80211_ADDR_COPY(sc->rxon.myaddr, ic->ic_myaddr); IEEE80211_ADDR_COPY(sc->rxon.wlap, ic->ic_myaddr); - sc->rxon.chan = ieee80211_chan2ieee(ic, ic->ic_ibss_chan); + sc->rxon.chan = 1; sc->rxon.flags = htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF); - if (IEEE80211_IS_CHAN_2GHZ(ic->ic_ibss_chan)) { - sc->rxon.flags |= htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ); - if (ic->ic_flags & IEEE80211_F_USEPROT) - sc->rxon.flags |= htole32(IWN_RXON_TGG_PROT); - DPRINTF(("%s: 2ghz prot 0x%x\n", __func__, - le32toh(sc->rxon.flags))); - } + sc->rxon.flags |= htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ); switch (ic->ic_opmode) { case IEEE80211_M_STA: sc->rxon.mode = IWN_MODE_STA; @@ -4489,6 +4483,9 @@ iwn_config(struct iwn_softc *sc) IWN_RXCHAIN_IDLE_COUNT(2); sc->rxon.rxchain = htole16(rxchain); DPRINTF(("setting configuration\n")); + DPRINTF(("%s: rxon chan %d flags %x cck %x ofdm %x\n", __func__, + sc->rxon.chan, le32toh(sc->rxon.flags), sc->rxon.cck_mask, + sc->rxon.ofdm_mask)); error = iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 0); if (error != 0) { printf("%s: RXON command failed\n", sc->sc_dev.dv_xname); |