diff options
| author | maya <maya@NetBSD.org> | 2018-05-01 16:18:13 +0000 |
|---|---|---|
| committer | maya <maya@NetBSD.org> | 2018-05-01 16:18:13 +0000 |
| commit | 5366ef43b53d63d81ecc71786daabcae5f6e0432 (patch) | |
| tree | 290a904cbfd82a86b88ead17f680ad15059778eb /sys/dev/ic | |
| parent | 998e151a3256eb8414bf80b560e38d6d47891929 (diff) | |
GC private 802.11 rateset declarations, use the standard ones.
Build tested only.
Diffstat (limited to 'sys/dev/ic')
| -rw-r--r-- | sys/dev/ic/atw.c | 13 | ||||
| -rw-r--r-- | sys/dev/ic/rt2560.c | 22 | ||||
| -rw-r--r-- | sys/dev/ic/rt2661.c | 24 |
3 files changed, 15 insertions, 44 deletions
diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index b844fd75d9f..45ea53cdd84 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $NetBSD: atw.c,v 1.162 2017/10/23 09:25:31 msaitoh Exp $ */ +/* $NetBSD: atw.c,v 1.163 2018/05/01 16:18:13 maya Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.162 2017/10/23 09:25:31 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.163 2018/05/01 16:18:13 maya Exp $"); #include <sys/param.h> @@ -514,7 +514,7 @@ atw_attach(struct atw_softc *sc) }; struct ieee80211com *ic = &sc->sc_ic; struct ifnet *ifp = &sc->sc_if; - int country_code, error, i, nrate, srom_major; + int country_code, error, i, srom_major; u_int32_t reg; static const char *type_strings[] = {"Intersil (not supported)", "RFMD", "Marvel (not supported)"}; @@ -781,12 +781,7 @@ atw_attach(struct atw_softc *sc) ic->ic_caps = IEEE80211_C_PMGT | IEEE80211_C_IBSS | IEEE80211_C_HOSTAP | IEEE80211_C_MONITOR; - nrate = 0; - ic->ic_sup_rates[IEEE80211_MODE_11B].rs_rates[nrate++] = 2; - ic->ic_sup_rates[IEEE80211_MODE_11B].rs_rates[nrate++] = 4; - ic->ic_sup_rates[IEEE80211_MODE_11B].rs_rates[nrate++] = 11; - ic->ic_sup_rates[IEEE80211_MODE_11B].rs_rates[nrate++] = 22; - ic->ic_sup_rates[IEEE80211_MODE_11B].rs_nrates = nrate; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; /* * Call MI attach routines. diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index 4b24ddf8a7a..f5d4d240984 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $NetBSD: rt2560.c,v 1.32 2018/02/08 09:05:19 dholland Exp $ */ +/* $NetBSD: rt2560.c,v 1.33 2018/05/01 16:18:13 maya Exp $ */ /* $OpenBSD: rt2560.c,v 1.15 2006/04/20 20:31:12 miod Exp $ */ /* $FreeBSD: rt2560.c,v 1.3 2006/03/21 21:15:43 damien Exp $*/ @@ -24,7 +24,7 @@ * http://www.ralinktech.com/ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.32 2018/02/08 09:05:19 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.33 2018/05/01 16:18:13 maya Exp $"); #include <sys/param.h> @@ -143,18 +143,6 @@ static void rt2560_stop(struct ifnet *, int); static void rt2560_softintr(void *); /* - * Supported rates for 802.11a/b/g modes (in 500Kbps unit). - */ -static const struct ieee80211_rateset rt2560_rateset_11a = - { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } }; - -static const struct ieee80211_rateset rt2560_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - -static const struct ieee80211_rateset rt2560_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - -/* * Default values for MAC registers; values taken from the reference driver. */ static const struct { @@ -420,7 +408,7 @@ rt2560_attach(void *xsc, int id) if (sc->rf_rev == RT2560_RF_5222) { /* set supported .11a rates */ - ic->ic_sup_rates[IEEE80211_MODE_11A] = rt2560_rateset_11a; + ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a; /* set supported .11a channels */ for (i = 36; i <= 64; i += 4) { @@ -441,8 +429,8 @@ rt2560_attach(void *xsc, int id) } /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = rt2560_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = rt2560_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* set supported .11b and .11g channels (1 through 14) */ for (i = 1; i <= 14; i++) { diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c index 2be74b5e2f0..67de4d2a805 100644 --- a/sys/dev/ic/rt2661.c +++ b/sys/dev/ic/rt2661.c @@ -1,4 +1,4 @@ -/* $NetBSD: rt2661.c,v 1.36 2017/10/23 09:31:17 msaitoh Exp $ */ +/* $NetBSD: rt2661.c,v 1.37 2018/05/01 16:18:13 maya Exp $ */ /* $OpenBSD: rt2661.c,v 1.17 2006/05/01 08:41:11 damien Exp $ */ /* $FreeBSD: rt2560.c,v 1.5 2006/06/02 19:59:31 csjp Exp $ */ @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.36 2017/10/23 09:31:17 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.37 2018/05/01 16:18:13 maya Exp $"); #include <sys/param.h> @@ -167,18 +167,6 @@ static void rt2661_enable_tsf_sync(struct rt2661_softc *); static int rt2661_get_rssi(struct rt2661_softc *, uint8_t); static void rt2661_softintr(void *); -/* - * Supported rates for 802.11a/b/g modes (in 500Kbps unit). - */ -static const struct ieee80211_rateset rt2661_rateset_11a = - { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } }; - -static const struct ieee80211_rateset rt2661_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - -static const struct ieee80211_rateset rt2661_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - static const struct { uint32_t reg; uint32_t val; @@ -309,7 +297,7 @@ rt2661_attach(void *xsc, int id) if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325) { /* set supported .11a rates */ - ic->ic_sup_rates[IEEE80211_MODE_11A] = rt2661_rateset_11a; + ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a; /* set supported .11a channels */ for (i = 36; i <= 64; i += 4) { @@ -330,8 +318,8 @@ rt2661_attach(void *xsc, int id) } /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = rt2661_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = rt2661_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* set supported .11b and .11g channels (1 through 14) */ for (i = 1; i <= 14; i++) { @@ -2180,7 +2168,7 @@ rt2661_set_basicrates(struct rt2661_softc *sc, * Find h/w rate index. We know it exists because the rate * set has already been negotiated. */ - for (j = 0; rt2661_rateset_11g.rs_rates[j] != RV(rate); j++); + for (j = 0; ieee80211_std_rateset_11g.rs_rates[j] != RV(rate); j++); mask |= 1 << j; } |
