On Sun, Mar 22, 2015 at 06:49:33AM -0400, Ted Unangst wrote:
> Jonathan Gray wrote:
> > On Sun, Mar 22, 2015 at 09:16:08AM +0100, Stefan Sperling wrote:
> > >
> > > If the firmare image is not present at boot, no interface is created.
> > > After installing the firmware with fw_update (which succeeds because
> > > it looks for "iwm" in dmesg not ifconfig) there is no way to recover
> > > the interface without a reboot because 'ifconfig iwm0' doesn't work.
>
> > If the mac address and the supported 802.11 modes depend on
> > having the firmware loaded, is it really worth adding a
> > interface that allows invalid parameters to be set?
>
> Maybe? See above. If I don't have firmware when I boot, but install firmware
> later, the interface should still be useable. Putting the interface into a
> "must reboot" state should be considered a bug.
>
I'd be surprised if the 802.11 reattach doesn't cause problems...
Anyway here is the minimal version
diff --git sys/dev/pci/if_iwm.c sys/dev/pci/if_iwm.c
index 6072e6a..58a50d4 100644
--- sys/dev/pci/if_iwm.c
+++ sys/dev/pci/if_iwm.c
@@ -6410,6 +6410,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);