diff options
author | 2016-01-13 14:39:35 +0000 | |
---|---|---|
committer | 2016-01-13 14:39:35 +0000 | |
commit | a0e2f488c39b581625beb83237cac854c69877cd (patch) | |
tree | f6dd7a862c9802bd651497eeb88dffc3e9f9db20 | |
parent | Fix fallout from turbo mode removal commit: Channel initialization (diff) | |
download | wireguard-openbsd-a0e2f488c39b581625beb83237cac854c69877cd.tar.xz wireguard-openbsd-a0e2f488c39b581625beb83237cac854c69877cd.zip |
Revert most of if_iwm.c r1.155. Use of channel zero was a symptom of
another bug introduced in my turbo mode removal commit; Now fixed.
Keep the debug printf added in r1.155.
-rw-r--r-- | sys/dev/pci/if_iwn.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 42411fc5158..03e69451e20 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.156 2016/01/13 08:32:19 stsp Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.157 2016/01/13 14:39:35 stsp Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -4447,9 +4447,15 @@ 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 = 1; + sc->rxon.chan = ieee80211_chan2ieee(ic, ic->ic_ibss_chan); sc->rxon.flags = htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF); - sc->rxon.flags |= htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ); + 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))); + } switch (ic->ic_opmode) { case IEEE80211_M_STA: sc->rxon.mode = IWN_MODE_STA; |