From 9c2f5157e79ad3b61010120d7f03c4d3223d3c38 Mon Sep 17 00:00:00 2001 From: avos Date: Fri, 29 Apr 2016 22:14:11 +0000 Subject: net80211 + drivers: hide size of 'bands' array behind a macro. Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'. No functional changes. --- sys/dev/bwi/if_bwi.c | 2 +- sys/dev/if_ndis/if_ndis.c | 2 +- sys/dev/iwi/if_iwi.c | 2 +- sys/dev/malo/if_malo.c | 2 +- sys/dev/otus/if_otus.c | 2 +- sys/dev/ral/rt2560.c | 2 +- sys/dev/ral/rt2661.c | 2 +- sys/dev/ral/rt2860.c | 2 +- sys/dev/rtwn/if_rtwn.c | 2 +- sys/dev/urtwn/if_urtwn.c | 2 +- sys/dev/usb/wlan/if_rsu.c | 2 +- sys/dev/usb/wlan/if_rum.c | 2 +- sys/dev/usb/wlan/if_run.c | 2 +- sys/dev/usb/wlan/if_uath.c | 2 +- sys/dev/usb/wlan/if_upgt.c | 2 +- sys/dev/usb/wlan/if_ural.c | 2 +- sys/dev/usb/wlan/if_urtw.c | 2 +- sys/dev/usb/wlan/if_zyd.c | 2 +- sys/net80211/_ieee80211.h | 1 + 19 files changed, 19 insertions(+), 18 deletions(-) (limited to 'sys') diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index 00e89f3..2bb5f8a 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -356,7 +356,7 @@ bwi_attach(struct bwi_softc *sc) device_t dev = sc->sc_dev; struct bwi_mac *mac; struct bwi_phy *phy; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int i, error; BWI_LOCK_INIT(sc); diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index 5084202..0e3643a 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -725,7 +725,7 @@ ndis_80211attach(struct ndis_softc *sc) struct ndis_80211_nettype_list *ntl; uint32_t arg; int mode, i, r, len, nonettypes = 1; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)] = { 0 }; + uint8_t bands[IEEE80211_MODE_BYTES] = { 0 }; callout_init(&sc->ndis_scan_callout, 1); diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 55004f6..88dfc48 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -271,7 +271,7 @@ iwi_attach(device_t dev) struct iwi_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint16_t val; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int i, error; sc->sc_dev = dev; diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c index b7e1a7f..e1959e2 100644 --- a/sys/dev/malo/if_malo.c +++ b/sys/dev/malo/if_malo.c @@ -174,7 +174,7 @@ malo_attach(uint16_t devid, struct malo_softc *sc) struct ieee80211com *ic = &sc->malo_ic; struct malo_hal *mh; int error; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; MALO_LOCK_INIT(sc); callout_init_mtx(&sc->malo_watchdog_timer, &sc->malo_mtx, 0); diff --git a/sys/dev/otus/if_otus.c b/sys/dev/otus/if_otus.c index 517ff2a..d291132 100644 --- a/sys/dev/otus/if_otus.c +++ b/sys/dev/otus/if_otus.c @@ -624,7 +624,7 @@ otus_attachhook(struct otus_softc *sc) struct ieee80211com *ic = &sc->sc_ic; usb_device_request_t req; uint32_t in, out; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int error; /* Not locked */ diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c index 5ac753c..b8a92f4 100644 --- a/sys/dev/ral/rt2560.c +++ b/sys/dev/ral/rt2560.c @@ -199,7 +199,7 @@ rt2560_attach(device_t dev, int id) { struct rt2560_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int error; sc->sc_dev = dev; diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c index 2e9ceec..9bf3cee 100644 --- a/sys/dev/ral/rt2661.c +++ b/sys/dev/ral/rt2661.c @@ -199,7 +199,7 @@ rt2661_attach(device_t dev, int id) struct rt2661_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t val; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int error, ac, ntries; sc->sc_id = id; diff --git a/sys/dev/ral/rt2860.c b/sys/dev/ral/rt2860.c index c50c14d..bcd276e 100644 --- a/sys/dev/ral/rt2860.c +++ b/sys/dev/ral/rt2860.c @@ -232,7 +232,7 @@ rt2860_attach(device_t dev, int id) struct rt2860_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t tmp; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int error, ntries, qid; sc->sc_dev = dev; diff --git a/sys/dev/rtwn/if_rtwn.c b/sys/dev/rtwn/if_rtwn.c index 0f7422f..f24fa1d 100644 --- a/sys/dev/rtwn/if_rtwn.c +++ b/sys/dev/rtwn/if_rtwn.c @@ -251,7 +251,7 @@ rtwn_attach(device_t dev) struct rtwn_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t lcsr; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int i, count, error, rid; sc->sc_dev = dev; diff --git a/sys/dev/urtwn/if_urtwn.c b/sys/dev/urtwn/if_urtwn.c index d79ea2b..dce9d19 100644 --- a/sys/dev/urtwn/if_urtwn.c +++ b/sys/dev/urtwn/if_urtwn.c @@ -490,7 +490,7 @@ urtwn_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct urtwn_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int error; device_set_usb_desc(self); diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c index 6ee1c24..08740b3 100644 --- a/sys/dev/usb/wlan/if_rsu.c +++ b/sys/dev/usb/wlan/if_rsu.c @@ -404,7 +404,7 @@ rsu_attach(device_t self) struct rsu_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; int error; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; struct usb_interface *iface; const char *rft; diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index 323de8d..1de8bb8 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -477,7 +477,7 @@ rum_attach(device_t self) struct rum_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; uint32_t tmp; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int error, ntries; diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index fe115ed..74a83ec 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -704,7 +704,7 @@ run_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct ieee80211com *ic = &sc->sc_ic; uint32_t ver; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int ntries, error; diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c index 404fdd8..470be6f 100644 --- a/sys/dev/usb/wlan/if_uath.c +++ b/sys/dev/usb/wlan/if_uath.c @@ -328,7 +328,7 @@ uath_attach(device_t dev) struct uath_softc *sc = device_get_softc(dev); struct usb_attach_arg *uaa = device_get_ivars(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index = UATH_IFACE_INDEX; /* XXX */ usb_error_t error; diff --git a/sys/dev/usb/wlan/if_upgt.c b/sys/dev/usb/wlan/if_upgt.c index 7f1e8ad..11eec38 100644 --- a/sys/dev/usb/wlan/if_upgt.c +++ b/sys/dev/usb/wlan/if_upgt.c @@ -243,7 +243,7 @@ upgt_attach(device_t dev) struct upgt_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; struct usb_attach_arg *uaa = device_get_ivars(dev); - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index = UPGT_IFACE_INDEX; int error; diff --git a/sys/dev/usb/wlan/if_ural.c b/sys/dev/usb/wlan/if_ural.c index 259c158..f27ccd1 100644 --- a/sys/dev/usb/wlan/if_ural.c +++ b/sys/dev/usb/wlan/if_ural.c @@ -424,7 +424,7 @@ ural_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct ural_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int error; diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c index 0f7b4d9..8895705 100644 --- a/sys/dev/usb/wlan/if_urtw.c +++ b/sys/dev/usb/wlan/if_urtw.c @@ -785,7 +785,7 @@ 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[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index = URTW_IFACE_INDEX; /* XXX */ uint16_t n_setup; uint32_t data; diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c index 161d26b..af2e6fc 100644 --- a/sys/dev/usb/wlan/if_zyd.c +++ b/sys/dev/usb/wlan/if_zyd.c @@ -334,7 +334,7 @@ zyd_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); struct zyd_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int error; diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 4ff395d..3146c35 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -70,6 +70,7 @@ enum ieee80211_phymode { IEEE80211_MODE_QUARTER = 11, /* OFDM, 1/4x clock */ }; #define IEEE80211_MODE_MAX (IEEE80211_MODE_QUARTER+1) +#define IEEE80211_MODE_BYTES 2 /* howmany(IEEE80211_MODE_MAX, NBBY) */ /* * Operating mode. Devices do not necessarily support -- cgit v1.1