tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
gc private 802.11 rateset declarations
OK to commit this? I don't have any of the devices unfortunately.
G/C custom rateset definitions.
use standard where applicable.
Built tested only.
Index: dev/ic/atw.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/atw.c,v
retrieving revision 1.162
diff -u -r1.162 atw.c
--- dev/ic/atw.c 23 Oct 2017 09:25:31 -0000 1.162
+++ dev/ic/atw.c 29 Apr 2018 20:48:13 -0000
@@ -514,7 +514,7 @@
};
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 @@
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.
Index: dev/ic/rt2560.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/rt2560.c,v
retrieving revision 1.32
diff -u -r1.32 rt2560.c
--- dev/ic/rt2560.c 8 Feb 2018 09:05:19 -0000 1.32
+++ dev/ic/rt2560.c 29 Apr 2018 20:48:14 -0000
@@ -143,18 +143,6 @@
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 @@
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 @@
}
/* 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++) {
Index: dev/ic/rt2661.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/rt2661.c,v
retrieving revision 1.36
diff -u -r1.36 rt2661.c
--- dev/ic/rt2661.c 23 Oct 2017 09:31:17 -0000 1.36
+++ dev/ic/rt2661.c 29 Apr 2018 20:48:14 -0000
@@ -167,18 +167,6 @@
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 @@
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 @@
}
/* 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 @@
* 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;
}
Index: dev/pci/if_ipw.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ipw.c,v
retrieving revision 1.67
diff -u -r1.67 if_ipw.c
--- dev/pci/if_ipw.c 16 Jan 2018 07:05:24 -0000 1.67
+++ dev/pci/if_ipw.c 29 Apr 2018 20:48:16 -0000
@@ -133,12 +133,6 @@
static void ipw_write_mem_1(struct ipw_softc *, bus_size_t, uint8_t *,
bus_size_t);
-/*
- * Supported rates for 802.11b mode (in 500Kbps unit).
- */
-static const struct ieee80211_rateset ipw_rateset_11b =
- { 4, { 2, 4, 11, 22 } };
-
static inline uint8_t
MEM_READ_1(struct ipw_softc *sc, uint32_t addr)
{
@@ -282,7 +276,7 @@
ic->ic_myaddr[5] = val & 0xff;
/* set supported .11b rates */
- ic->ic_sup_rates[IEEE80211_MODE_11B] = ipw_rateset_11b;
+ ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b;
/* set supported .11b channels (read from EEPROM) */
if ((val = ipw_read_prom_word(sc, IPW_EEPROM_CHANNEL_LIST)) == 0)
Index: dev/pci/if_iwi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_iwi.c,v
retrieving revision 1.105
diff -u -r1.105 if_iwi.c
--- dev/pci/if_iwi.c 16 Jan 2018 07:05:24 -0000 1.105
+++ dev/pci/if_iwi.c 29 Apr 2018 20:48:16 -0000
@@ -147,18 +147,6 @@
static void iwi_led_set(struct iwi_softc *, uint32_t, int);
static void iwi_sysctlattach(struct iwi_softc *);
-/*
- * Supported rates for 802.11a/b/g modes (in 500Kbps unit).
- */
-static const struct ieee80211_rateset iwi_rateset_11a =
- { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } };
-
-static const struct ieee80211_rateset iwi_rateset_11b =
- { 4, { 2, 4, 11, 22 } };
-
-static const struct ieee80211_rateset iwi_rateset_11g =
- { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } };
-
static inline uint8_t
MEM_READ_1(struct iwi_softc *sc, uint32_t addr)
{
@@ -329,7 +317,7 @@
if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_PRO_WL_2915ABG_1 ||
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_PRO_WL_2915ABG_2) {
/* set supported .11a rates (2915ABG only) */
- ic->ic_sup_rates[IEEE80211_MODE_11A] = iwi_rateset_11a;
+ ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a;
/* set supported .11a channels */
for (i = 36; i <= 64; i += 4) {
@@ -345,8 +333,8 @@
}
/* set supported .11b and .11g rates */
- ic->ic_sup_rates[IEEE80211_MODE_11B] = iwi_rateset_11b;
- ic->ic_sup_rates[IEEE80211_MODE_11G] = iwi_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++) {
Index: dev/pci/if_iwn.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_iwn.c,v
retrieving revision 1.88
diff -u -r1.88 if_iwn.c
--- dev/pci/if_iwn.c 28 Jan 2018 16:12:41 -0000 1.88
+++ dev/pci/if_iwn.c 29 Apr 2018 20:48:19 -0000
@@ -118,18 +118,6 @@
PCI_PRODUCT_INTEL_WIFI_LINK_105_2,
};
-/*
- * Supported rates for 802.11a/b/g modes (in 500Kbps unit).
- */
-static const struct ieee80211_rateset iwn_rateset_11a =
- { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } };
-
-static const struct ieee80211_rateset iwn_rateset_11b =
- { 4, { 2, 4, 11, 22 } };
-
-static const struct ieee80211_rateset iwn_rateset_11g =
- { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } };
-
static int iwn_match(device_t , struct cfdata *, void *);
static void iwn_attach(device_t , device_t , void *);
static int iwn4965_attach(struct iwn_softc *, pci_product_id_t);
@@ -567,10 +555,10 @@
#endif /* !IEEE80211_NO_HT */
/* Set supported legacy rates. */
- ic->ic_sup_rates[IEEE80211_MODE_11B] = iwn_rateset_11b;
- ic->ic_sup_rates[IEEE80211_MODE_11G] = iwn_rateset_11g;
+ ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b;
+ ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g;
if (sc->sc_flags & IWN_FLAG_HAS_5GHZ) {
- ic->ic_sup_rates[IEEE80211_MODE_11A] = iwn_rateset_11a;
+ ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a;
}
#ifndef IEEE80211_NO_HT
if (sc->sc_flags & IWN_FLAG_HAS_11N) {
Index: dev/usb/if_atu.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/if_atu.c,v
retrieving revision 1.56
diff -u -r1.56 if_atu.c
--- dev/usb/if_atu.c 21 Jan 2018 13:57:11 -0000 1.56
+++ dev/usb/if_atu.c 29 Apr 2018 20:48:20 -0000
@@ -1434,11 +1434,7 @@
#endif
i = 0;
- ic->ic_sup_rates[IEEE80211_MODE_11B].rs_rates[i++] = 2;
- ic->ic_sup_rates[IEEE80211_MODE_11B].rs_rates[i++] = 4;
- ic->ic_sup_rates[IEEE80211_MODE_11B].rs_rates[i++] = 11;
- ic->ic_sup_rates[IEEE80211_MODE_11B].rs_rates[i++] = 22;
- ic->ic_sup_rates[IEEE80211_MODE_11B].rs_nrates = i;
+ ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b;
for (i = 1; i <= 14; i++) {
ic->ic_channels[i].ic_flags = IEEE80211_CHAN_B |
Index: dev/usb/if_rum.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/if_rum.c,v
retrieving revision 1.59
diff -u -r1.59 if_rum.c
--- dev/usb/if_rum.c 21 Jan 2018 13:57:12 -0000 1.59
+++ dev/usb/if_rum.c 29 Apr 2018 20:48:20 -0000
@@ -207,18 +207,6 @@
static void rum_amrr_update(struct usbd_xfer *, void *,
usbd_status);
-/*
- * Supported rates for 802.11a/b/g modes (in 500Kbps unit).
- */
-static const struct ieee80211_rateset rum_rateset_11a =
- { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } };
-
-static const struct ieee80211_rateset rum_rateset_11b =
- { 4, { 2, 4, 11, 22 } };
-
-static const struct ieee80211_rateset rum_rateset_11g =
- { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } };
-
static const struct {
uint32_t reg;
uint32_t val;
@@ -413,7 +401,7 @@
if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) {
/* set supported .11a rates */
- ic->ic_sup_rates[IEEE80211_MODE_11A] = rum_rateset_11a;
+ ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a;
/* set supported .11a channels */
for (i = 34; i <= 46; i += 4) {
@@ -439,8 +427,8 @@
}
/* set supported .11b and .11g rates */
- ic->ic_sup_rates[IEEE80211_MODE_11B] = rum_rateset_11b;
- ic->ic_sup_rates[IEEE80211_MODE_11G] = rum_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++) {
Index: dev/usb/if_ural.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/if_ural.c,v
retrieving revision 1.53
diff -u -r1.53 if_ural.c
--- dev/usb/if_ural.c 21 Jan 2018 13:57:12 -0000 1.53
+++ dev/usb/if_ural.c 29 Apr 2018 20:48:21 -0000
@@ -174,18 +174,6 @@
usbd_status status);
/*
- * Supported rates for 802.11a/b/g modes (in 500Kbps unit).
- */
-static const struct ieee80211_rateset ural_rateset_11a =
- { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } };
-
-static const struct ieee80211_rateset ural_rateset_11b =
- { 4, { 2, 4, 11, 22 } };
-
-static const struct ieee80211_rateset ural_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 {
@@ -470,7 +458,7 @@
if (sc->rf_rev == RAL_RF_5222) {
/* set supported .11a rates */
- ic->ic_sup_rates[IEEE80211_MODE_11A] = ural_rateset_11a;
+ ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a;
/* set supported .11a channels */
for (i = 36; i <= 64; i += 4) {
@@ -491,8 +479,8 @@
}
/* set supported .11b and .11g rates */
- ic->ic_sup_rates[IEEE80211_MODE_11B] = ural_rateset_11b;
- ic->ic_sup_rates[IEEE80211_MODE_11G] = ural_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++) {
Index: dev/usb/if_zyd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/if_zyd.c,v
retrieving revision 1.45
diff -u -r1.45 if_zyd.c
--- dev/usb/if_zyd.c 21 Jan 2018 13:57:12 -0000 1.45
+++ dev/usb/if_zyd.c 29 Apr 2018 20:48:22 -0000
@@ -239,12 +239,6 @@
Static void zyd_amrr_timeout(void *);
Static void zyd_newassoc(struct ieee80211_node *, int);
-static const struct ieee80211_rateset zyd_rateset_11b =
- { 4, { 2, 4, 11, 22 } };
-
-static const struct ieee80211_rateset zyd_rateset_11g =
- { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } };
-
int
zyd_match(device_t parent, cfdata_t match, void *aux)
{
@@ -419,8 +413,8 @@
IEEE80211_C_WEP; /* s/w WEP */
/* set supported .11b and .11g rates */
- ic->ic_sup_rates[IEEE80211_MODE_11B] = zyd_rateset_11b;
- ic->ic_sup_rates[IEEE80211_MODE_11G] = zyd_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++) {
Home |
Main Index |
Thread Index |
Old Index