aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/if_ndis/if_ndis.c
diff options
context:
space:
mode:
authorAndriy Voskoboinyk <avos@FreeBSD.org>2016-01-07 18:41:03 +0000
committerAndriy Voskoboinyk <avos@FreeBSD.org>2016-01-07 18:41:03 +0000
commit0046e1868fb0f7704f0ba2fd9ec63321adbf0a8e (patch)
tree29432600c74c3421aff456667f70f13cde56fddc /sys/dev/if_ndis/if_ndis.c
parent9030be4bad005c75a8a2df81f7e4b1a33913876e (diff)
downloadsrc-0046e1868fb0f7704f0ba2fd9ec63321adbf0a8e.tar.gz
src-0046e1868fb0f7704f0ba2fd9ec63321adbf0a8e.zip
Notes
Diffstat (limited to 'sys/dev/if_ndis/if_ndis.c')
-rw-r--r--sys/dev/if_ndis/if_ndis.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index bb1f19ecfabf..47594fc60224 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -724,8 +724,8 @@ ndis_80211attach(struct ndis_softc *sc)
ndis_80211_rates_ex rates;
struct ndis_80211_nettype_list *ntl;
uint32_t arg;
- int mode, i, r, len;
- uint8_t bands = 0;
+ int mode, i, r, len, nonettypes = 1;
+ uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)] = { 0 };
callout_init(&sc->ndis_scan_callout, 1);
@@ -751,8 +751,9 @@ ndis_80211attach(struct ndis_softc *sc)
for (i = 0; i < ntl->ntl_items; i++) {
mode = ndis_nettype_mode(ntl->ntl_type[i]);
if (mode) {
+ nonettypes = 0;
setbit(ic->ic_modecaps, mode);
- setbit(&bands, mode);
+ setbit(bands, mode);
} else
device_printf(sc->ndis_dev, "Unknown nettype %d\n",
ntl->ntl_type[i]);
@@ -760,9 +761,9 @@ ndis_80211attach(struct ndis_softc *sc)
free(ntl, M_DEVBUF);
nonettypes:
/* Default to 11b channels if the card did not supply any */
- if (bands == 0) {
+ if (nonettypes) {
setbit(ic->ic_modecaps, IEEE80211_MODE_11B);
- setbit(&bands, IEEE80211_MODE_11B);
+ setbit(bands, IEEE80211_MODE_11B);
}
len = sizeof(rates);
bzero((char *)&rates, len);
@@ -859,7 +860,7 @@ nonettypes:
#undef INCRATE
#undef TESTSETRATE
- ieee80211_init_channels(ic, NULL, &bands);
+ ieee80211_init_channels(ic, NULL, bands);
/*
* To test for WPA support, we need to see if we can