summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-03-23 00:35:20 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-03-23 00:35:20 +0000
commitb8aed918656d98041cef3e5f753fced7b425b3fc (patch)
treecee084c2c1da3d4d63557a034cfe8aadc47e67dc
parent0e415c733949c8a247ac491b14e7decf2cd71988 (diff)
Not all iwm hardware supports the 5GHz band. Make setting 11a rates
and scanning conditional on the 5GHz support bit in the nvm. Problem reported and fix tested by Mattieu Baptiste. ok stsp@ kettenis@
-rw-r--r--sys/dev/pci/if_iwm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index 6072e6a5196..6d3e5d52555 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.38 2015/03/16 04:09:53 jsg Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.39 2015/03/23 00:35:19 jsg Exp $ */
/*
* Copyright (c) 2014 genua mbh <info@genua.de>
@@ -5471,7 +5471,8 @@ iwm_endscan_cb(void *arg)
DPRINTF(("scan ended\n"));
- if (sc->sc_scanband == IEEE80211_CHAN_2GHZ) {
+ if (sc->sc_scanband == IEEE80211_CHAN_2GHZ &&
+ sc->sc_nvm.sku_cap_band_52GHz_enable) {
int error;
done = 0;
if ((error = iwm_mvm_scan_request(sc,
@@ -6410,6 +6411,11 @@ iwm_preinit(struct iwm_softc *sc)
IWM_UCODE_API(sc->sc_fwver),
ether_sprintf(sc->sc_nvm.hw_addr));
+ /* not all hardware can do 5GHz band */
+ if (!sc->sc_nvm.sku_cap_band_52GHz_enable)
+ memset(&ic->ic_sup_rates[IEEE80211_MODE_11A], 0,
+ sizeof(ic->ic_sup_rates[IEEE80211_MODE_11A]));
+
/* Reattach net80211 so MAC address and channel map are picked up. */
ieee80211_ifdetach(ifp);
ieee80211_ifattach(ifp);