Commit f5507ce9 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville

rt2x00: Remove HWMODE_{A,B,G}

rt2500usb initialized the SIFS and EIFS without using the
values coming from rt2x000lib. After this is fixed HWMODE_{A,B,G}
is now unused and can be removed in favour of the ieee80211_band
enumeration which could still be usefull later.
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 70e2fed4
...@@ -358,18 +358,9 @@ static int rt2500usb_config_preamble(struct rt2x00_dev *rt2x00dev, ...@@ -358,18 +358,9 @@ static int rt2500usb_config_preamble(struct rt2x00_dev *rt2x00dev,
} }
static void rt2500usb_config_phymode(struct rt2x00_dev *rt2x00dev, static void rt2500usb_config_phymode(struct rt2x00_dev *rt2x00dev,
const int phymode,
const int basic_rate_mask) const int basic_rate_mask)
{ {
rt2500usb_register_write(rt2x00dev, TXRX_CSR11, basic_rate_mask); rt2500usb_register_write(rt2x00dev, TXRX_CSR11, basic_rate_mask);
if (phymode == HWMODE_B) {
rt2500usb_register_write(rt2x00dev, MAC_CSR11, 0x000b);
rt2500usb_register_write(rt2x00dev, MAC_CSR12, 0x0040);
} else {
rt2500usb_register_write(rt2x00dev, MAC_CSR11, 0x0005);
rt2500usb_register_write(rt2x00dev, MAC_CSR12, 0x016c);
}
} }
static void rt2500usb_config_channel(struct rt2x00_dev *rt2x00dev, static void rt2500usb_config_channel(struct rt2x00_dev *rt2x00dev,
...@@ -507,6 +498,8 @@ static void rt2500usb_config_duration(struct rt2x00_dev *rt2x00dev, ...@@ -507,6 +498,8 @@ static void rt2500usb_config_duration(struct rt2x00_dev *rt2x00dev,
u16 reg; u16 reg;
rt2500usb_register_write(rt2x00dev, MAC_CSR10, libconf->slot_time); rt2500usb_register_write(rt2x00dev, MAC_CSR10, libconf->slot_time);
rt2500usb_register_write(rt2x00dev, MAC_CSR11, libconf->sifs);
rt2500usb_register_write(rt2x00dev, MAC_CSR12, libconf->eifs);
rt2500usb_register_read(rt2x00dev, TXRX_CSR18, &reg); rt2500usb_register_read(rt2x00dev, TXRX_CSR18, &reg);
rt2x00_set_field16(&reg, TXRX_CSR18_INTERVAL, rt2x00_set_field16(&reg, TXRX_CSR18_INTERVAL,
...@@ -519,8 +512,7 @@ static void rt2500usb_config(struct rt2x00_dev *rt2x00dev, ...@@ -519,8 +512,7 @@ static void rt2500usb_config(struct rt2x00_dev *rt2x00dev,
const unsigned int flags) const unsigned int flags)
{ {
if (flags & CONFIG_UPDATE_PHYMODE) if (flags & CONFIG_UPDATE_PHYMODE)
rt2500usb_config_phymode(rt2x00dev, libconf->phymode, rt2500usb_config_phymode(rt2x00dev, libconf->basic_rates);
libconf->basic_rates);
if (flags & CONFIG_UPDATE_CHANNEL) if (flags & CONFIG_UPDATE_CHANNEL)
rt2500usb_config_channel(rt2x00dev, &libconf->rf, rt2500usb_config_channel(rt2x00dev, &libconf->rf,
libconf->conf->power_level); libconf->conf->power_level);
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
* Misc MAC_CSR registers. * Misc MAC_CSR registers.
* MAC_CSR9: Timer control. * MAC_CSR9: Timer control.
* MAC_CSR10: Slot time. * MAC_CSR10: Slot time.
* MAC_CSR11: IFS. * MAC_CSR11: SIFS.
* MAC_CSR12: EIFS. * MAC_CSR12: EIFS.
* MAC_CSR13: Power mode0. * MAC_CSR13: Power mode0.
* MAC_CSR14: Power mode1. * MAC_CSR14: Power mode1.
......
...@@ -390,10 +390,6 @@ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif) ...@@ -390,10 +390,6 @@ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
return (struct rt2x00_intf *)vif->drv_priv; return (struct rt2x00_intf *)vif->drv_priv;
} }
#define HWMODE_B 0
#define HWMODE_G 1
#define HWMODE_A 2
/* /*
* Details about the supported modes, rates and channels * Details about the supported modes, rates and channels
* of a particular chipset. This is used by rt2x00lib * of a particular chipset. This is used by rt2x00lib
...@@ -433,7 +429,7 @@ struct rt2x00lib_conf { ...@@ -433,7 +429,7 @@ struct rt2x00lib_conf {
struct antenna_setup ant; struct antenna_setup ant;
int phymode; enum ieee80211_band band;
int basic_rates; int basic_rates;
int slot_time; int slot_time;
......
...@@ -229,23 +229,10 @@ config: ...@@ -229,23 +229,10 @@ config:
memset(&libconf, 0, sizeof(libconf)); memset(&libconf, 0, sizeof(libconf));
if (flags & CONFIG_UPDATE_PHYMODE) { if (flags & CONFIG_UPDATE_PHYMODE) {
switch (conf->channel->band) {
case IEEE80211_BAND_5GHZ:
libconf.phymode = HWMODE_A;
break;
case IEEE80211_BAND_2GHZ:
/* Uh oh. what about B? */
libconf.phymode = HWMODE_G;
break;
default:
ERROR(rt2x00dev,
"Attempt to configure unsupported mode (%d)"
"Defaulting to 802.11b", conf->channel->band);
libconf.phymode = HWMODE_B;
}
band = &rt2x00dev->bands[conf->channel->band]; band = &rt2x00dev->bands[conf->channel->band];
rate = &band->bitrates[band->n_bitrates - 1]; rate = &band->bitrates[band->n_bitrates - 1];
libconf.band = conf->channel->band;
libconf.basic_rates = rt2x00_get_rate(rate->hw_value)->ratemask; libconf.basic_rates = rt2x00_get_rate(rate->hw_value)->ratemask;
} }
......
...@@ -896,7 +896,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, ...@@ -896,7 +896,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
* Rates: CCK. * Rates: CCK.
* Channels: 2.4 GHz * Channels: 2.4 GHz
*/ */
if (spec->num_modes > HWMODE_B) { if (spec->num_modes > 0) {
sbands[IEEE80211_BAND_2GHZ].n_channels = 14; sbands[IEEE80211_BAND_2GHZ].n_channels = 14;
sbands[IEEE80211_BAND_2GHZ].n_bitrates = 4; sbands[IEEE80211_BAND_2GHZ].n_bitrates = 4;
sbands[IEEE80211_BAND_2GHZ].channels = channels; sbands[IEEE80211_BAND_2GHZ].channels = channels;
...@@ -909,7 +909,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, ...@@ -909,7 +909,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
* Rates: CCK, OFDM. * Rates: CCK, OFDM.
* Channels: 2.4 GHz * Channels: 2.4 GHz
*/ */
if (spec->num_modes > HWMODE_G) { if (spec->num_modes > 1) {
sbands[IEEE80211_BAND_2GHZ].n_channels = 14; sbands[IEEE80211_BAND_2GHZ].n_channels = 14;
sbands[IEEE80211_BAND_2GHZ].n_bitrates = spec->num_rates; sbands[IEEE80211_BAND_2GHZ].n_bitrates = spec->num_rates;
sbands[IEEE80211_BAND_2GHZ].channels = channels; sbands[IEEE80211_BAND_2GHZ].channels = channels;
...@@ -922,7 +922,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, ...@@ -922,7 +922,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
* Rates: OFDM. * Rates: OFDM.
* Channels: OFDM, UNII, HiperLAN2. * Channels: OFDM, UNII, HiperLAN2.
*/ */
if (spec->num_modes > HWMODE_A) { if (spec->num_modes > 2) {
sbands[IEEE80211_BAND_5GHZ].n_channels = spec->num_channels - 14; sbands[IEEE80211_BAND_5GHZ].n_channels = spec->num_channels - 14;
sbands[IEEE80211_BAND_5GHZ].n_bitrates = spec->num_rates - 4; sbands[IEEE80211_BAND_5GHZ].n_bitrates = spec->num_rates - 4;
sbands[IEEE80211_BAND_5GHZ].channels = &channels[14]; sbands[IEEE80211_BAND_5GHZ].channels = &channels[14];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment