mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
allow net80211 to fillin rate sets
MFC after: 2 weeks
This commit is contained in:
parent
15aaece8bd
commit
fa393cd523
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167470
@ -173,12 +173,6 @@ static devclass_t ipw_devclass;
|
||||
|
||||
DRIVER_MODULE(ipw, pci, ipw_driver, ipw_devclass, 0, 0);
|
||||
|
||||
/*
|
||||
* Supported rates for 802.11b mode (in 500Kbps unit).
|
||||
*/
|
||||
static const struct ieee80211_rateset ipw_rateset_11b =
|
||||
{ 4, { 2, 4, 11, 22 } };
|
||||
|
||||
static int
|
||||
ipw_probe(device_t dev)
|
||||
{
|
||||
@ -293,9 +287,6 @@ ipw_attach(device_t dev)
|
||||
ic->ic_myaddr[4] = val >> 8;
|
||||
ic->ic_myaddr[5] = val & 0xff;
|
||||
|
||||
/* set supported .11b rates */
|
||||
ic->ic_sup_rates[IEEE80211_MODE_11B] = ipw_rateset_11b;
|
||||
|
||||
/* set supported .11b channels */
|
||||
for (i = 1; i < 14; i++) {
|
||||
ic->ic_channels[i].ic_freq =
|
||||
|
@ -208,18 +208,6 @@ static devclass_t iwi_devclass;
|
||||
|
||||
DRIVER_MODULE(iwi, pci, iwi_driver, iwi_devclass, 0, 0);
|
||||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
@ -393,9 +381,6 @@ iwi_attach(device_t dev)
|
||||
ic->ic_myaddr[5] = val >> 8;
|
||||
|
||||
if (pci_get_device(dev) >= 0x4223) {
|
||||
/* set supported .11a rates (2915ABG only) */
|
||||
ic->ic_sup_rates[IEEE80211_MODE_11A] = iwi_rateset_11a;
|
||||
|
||||
/* set supported .11a channels */
|
||||
for (i = 36; i <= 64; i += 4) {
|
||||
ic->ic_channels[i].ic_freq =
|
||||
@ -409,10 +394,6 @@ iwi_attach(device_t dev)
|
||||
}
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
||||
/* set supported .11b and .11g channels (1 through 14) */
|
||||
for (i = 1; i <= 14; i++) {
|
||||
ic->ic_channels[i].ic_freq =
|
||||
|
@ -151,18 +151,6 @@ static void rt2560_stop(void *);
|
||||
static int rt2560_raw_xmit(struct ieee80211_node *, struct mbuf *,
|
||||
const struct ieee80211_bpf_params *);
|
||||
|
||||
/*
|
||||
* 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 } };
|
||||
|
||||
static const struct {
|
||||
uint32_t reg;
|
||||
uint32_t val;
|
||||
@ -287,9 +275,6 @@ rt2560_attach(device_t dev, int id)
|
||||
IEEE80211_C_WPA; /* 802.11i */
|
||||
|
||||
if (sc->rf_rev == RT2560_RF_5222) {
|
||||
/* set supported .11a rates */
|
||||
ic->ic_sup_rates[IEEE80211_MODE_11A] = rt2560_rateset_11a;
|
||||
|
||||
/* set supported .11a channels */
|
||||
for (i = 36; i <= 64; i += 4) {
|
||||
ic->ic_channels[i].ic_freq =
|
||||
@ -308,10 +293,6 @@ rt2560_attach(device_t dev, 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;
|
||||
|
||||
/* set supported .11b and .11g channels (1 through 14) */
|
||||
for (i = 1; i <= 14; i++) {
|
||||
ic->ic_channels[i].ic_freq =
|
||||
@ -2090,7 +2071,7 @@ rt2560_start(struct ifnet *ifp)
|
||||
static void
|
||||
rt2560_watchdog(void *arg)
|
||||
{
|
||||
struct rt2560_softc *sc = (struct rt2560_softc *)arg;
|
||||
struct rt2560_softc *sc = arg;
|
||||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
|
||||
if (sc->sc_tx_timer > 0) {
|
||||
|
@ -159,18 +159,6 @@ static int rt2661_prepare_beacon(struct rt2661_softc *);
|
||||
static void rt2661_enable_tsf_sync(struct rt2661_softc *);
|
||||
static int rt2661_get_rssi(struct rt2661_softc *, uint8_t);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
@ -317,9 +305,6 @@ rt2661_attach(device_t dev, int id)
|
||||
IEEE80211_C_WPA; /* 802.11i */
|
||||
|
||||
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;
|
||||
|
||||
/* set supported .11a channels */
|
||||
for (i = 36; i <= 64; i += 4) {
|
||||
ic->ic_channels[i].ic_freq =
|
||||
@ -338,10 +323,6 @@ rt2661_attach(device_t dev, 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;
|
||||
|
||||
/* set supported .11b and .11g channels (1 through 14) */
|
||||
for (i = 1; i <= 14; i++) {
|
||||
ic->ic_channels[i].ic_freq =
|
||||
@ -2090,6 +2071,7 @@ rt2661_set_basicrates(struct rt2661_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;
|
||||
int i, j;
|
||||
@ -2104,7 +2086,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; ic->ic_sup_rates[IEEE80211_MODE_11G].rs_rates[j] != RV(rate); j++);
|
||||
|
||||
mask |= 1 << j;
|
||||
}
|
||||
|
@ -174,18 +174,6 @@ static void ural_amrr_update(usbd_xfer_handle, usbd_private_handle,
|
||||
static void ural_ratectl(struct ural_amrr *,
|
||||
struct ieee80211_node *);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
@ -468,9 +456,6 @@ USB_ATTACH(ural)
|
||||
IEEE80211_C_WPA; /* 802.11i */
|
||||
|
||||
if (sc->rf_rev == RAL_RF_5222) {
|
||||
/* set supported .11a rates */
|
||||
ic->ic_sup_rates[IEEE80211_MODE_11A] = ural_rateset_11a;
|
||||
|
||||
/* set supported .11a channels */
|
||||
for (i = 36; i <= 64; i += 4) {
|
||||
ic->ic_channels[i].ic_freq =
|
||||
@ -489,10 +474,6 @@ USB_ATTACH(ural)
|
||||
}
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
||||
/* set supported .11b and .11g channels (1 through 14) */
|
||||
for (i = 1; i <= 14; i++) {
|
||||
ic->ic_channels[i].ic_freq =
|
||||
|
Loading…
Reference in New Issue
Block a user