summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/wlan/if_urtw.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/wlan/if_urtw.c')
-rw-r--r--sys/dev/usb/wlan/if_urtw.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c
index 105fd9d..0f7b4d9 100644
--- a/sys/dev/usb/wlan/if_urtw.c
+++ b/sys/dev/usb/wlan/if_urtw.c
@@ -785,7 +785,8 @@ urtw_attach(device_t dev)
struct urtw_softc *sc = device_get_softc(dev);
struct usb_attach_arg *uaa = device_get_ivars(dev);
struct ieee80211com *ic = &sc->sc_ic;
- uint8_t bands, iface_index = URTW_IFACE_INDEX; /* XXX */
+ uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+ uint8_t iface_index = URTW_IFACE_INDEX; /* XXX */
uint16_t n_setup;
uint32_t data;
usb_error_t error;
@@ -876,10 +877,10 @@ urtw_attach(device_t dev)
IEEE80211_C_BGSCAN | /* capable of bg scanning */
IEEE80211_C_WPA; /* 802.11i */
- bands = 0;
- setbit(&bands, IEEE80211_MODE_11B);
- setbit(&bands, IEEE80211_MODE_11G);
- ieee80211_init_channels(ic, NULL, &bands);
+ memset(bands, 0, sizeof(bands));
+ setbit(bands, IEEE80211_MODE_11B);
+ setbit(bands, IEEE80211_MODE_11G);
+ ieee80211_init_channels(ic, NULL, bands);
ieee80211_ifattach(ic);
ic->ic_raw_xmit = urtw_raw_xmit;
OpenPOWER on IntegriCloud