summaryrefslogtreecommitdiffstats
path: root/sys/dev/ral/rt2560.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ral/rt2560.c')
-rw-r--r--sys/dev/ral/rt2560.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c
index ea9c416..07fe55e 100644
--- a/sys/dev/ral/rt2560.c
+++ b/sys/dev/ral/rt2560.c
@@ -2301,7 +2301,6 @@ static void
rt2560_set_basicrates(struct rt2560_softc *sc,
const struct ieee80211_rateset *rs)
{
-#define RV(r) ((r) & IEEE80211_RATE_VAL)
struct ieee80211com *ic = &sc->sc_ic;
uint32_t mask = 0;
uint8_t rate;
@@ -2313,13 +2312,13 @@ rt2560_set_basicrates(struct rt2560_softc *sc,
if (!(rate & IEEE80211_RATE_BASIC))
continue;
- mask |= 1 << ieee80211_legacy_rate_lookup(ic->ic_rt, RV(rate));
+ mask |= 1 << ieee80211_legacy_rate_lookup(ic->ic_rt,
+ IEEE80211_RV(rate));
}
RAL_WRITE(sc, RT2560_ARSP_PLCP_1, mask);
DPRINTF(sc, "Setting basic rate mask to 0x%x\n", mask);
-#undef RV
}
static void
@@ -2478,7 +2477,6 @@ rt2560_scan_end(struct ieee80211com *ic)
static int
rt2560_bbp_init(struct rt2560_softc *sc)
{
-#define N(a) (sizeof (a) / sizeof ((a)[0]))
int i, ntries;
/* wait for BBP to be ready */
@@ -2493,7 +2491,7 @@ rt2560_bbp_init(struct rt2560_softc *sc)
}
/* initialize BBP registers to default values */
- for (i = 0; i < N(rt2560_def_bbp); i++) {
+ for (i = 0; i < nitems(rt2560_def_bbp); i++) {
rt2560_bbp_write(sc, rt2560_def_bbp[i].reg,
rt2560_def_bbp[i].val);
}
@@ -2507,7 +2505,6 @@ rt2560_bbp_init(struct rt2560_softc *sc)
rt2560_bbp_write(sc, 17, 0x48); /* XXX restore bbp17 */
return 0;
-#undef N
}
static void
@@ -2560,7 +2557,6 @@ rt2560_set_rxantenna(struct rt2560_softc *sc, int antenna)
static void
rt2560_init_locked(struct rt2560_softc *sc)
{
-#define N(a) (sizeof (a) / sizeof ((a)[0]))
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
uint32_t tmp;
@@ -2590,7 +2586,7 @@ rt2560_init_locked(struct rt2560_softc *sc)
RAL_WRITE(sc, RT2560_RXCSR2, sc->rxq.physaddr);
/* initialize MAC registers to default values */
- for (i = 0; i < N(rt2560_def_mac); i++)
+ for (i = 0; i < nitems(rt2560_def_mac); i++)
RAL_WRITE(sc, rt2560_def_mac[i].reg, rt2560_def_mac[i].val);
rt2560_set_macaddr(sc, vap ? vap->iv_myaddr : ic->ic_macaddr);
@@ -2641,7 +2637,6 @@ rt2560_init_locked(struct rt2560_softc *sc)
sc->sc_flags |= RT2560_F_RUNNING;
callout_reset(&sc->watchdog_ch, hz, rt2560_watchdog, sc);
-#undef N
}
static void
OpenPOWER on IntegriCloud