dect
/
linux-2.6
Archived
13
0
Fork 0

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: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Ivo van Doorn 2008-02-03 15:51:13 +01:00 committed by John W. Linville
parent 70e2fed4ec
commit f5507ce90b
5 changed files with 10 additions and 35 deletions

View File

@ -358,18 +358,9 @@ static int rt2500usb_config_preamble(struct rt2x00_dev *rt2x00dev,
}
static void rt2500usb_config_phymode(struct rt2x00_dev *rt2x00dev,
const int phymode,
const int 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,
@ -507,6 +498,8 @@ static void rt2500usb_config_duration(struct rt2x00_dev *rt2x00dev,
u16 reg;
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);
rt2x00_set_field16(&reg, TXRX_CSR18_INTERVAL,
@ -519,8 +512,7 @@ static void rt2500usb_config(struct rt2x00_dev *rt2x00dev,
const unsigned int flags)
{
if (flags & CONFIG_UPDATE_PHYMODE)
rt2500usb_config_phymode(rt2x00dev, libconf->phymode,
libconf->basic_rates);
rt2500usb_config_phymode(rt2x00dev, libconf->basic_rates);
if (flags & CONFIG_UPDATE_CHANNEL)
rt2500usb_config_channel(rt2x00dev, &libconf->rf,
libconf->conf->power_level);

View File

@ -135,7 +135,7 @@
* Misc MAC_CSR registers.
* MAC_CSR9: Timer control.
* MAC_CSR10: Slot time.
* MAC_CSR11: IFS.
* MAC_CSR11: SIFS.
* MAC_CSR12: EIFS.
* MAC_CSR13: Power mode0.
* MAC_CSR14: Power mode1.

View File

@ -390,10 +390,6 @@ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
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
* of a particular chipset. This is used by rt2x00lib
@ -433,7 +429,7 @@ struct rt2x00lib_conf {
struct antenna_setup ant;
int phymode;
enum ieee80211_band band;
int basic_rates;
int slot_time;

View File

@ -229,23 +229,10 @@ config:
memset(&libconf, 0, sizeof(libconf));
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];
rate = &band->bitrates[band->n_bitrates - 1];
libconf.band = conf->channel->band;
libconf.basic_rates = rt2x00_get_rate(rate->hw_value)->ratemask;
}

View File

@ -896,7 +896,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
* Rates: CCK.
* 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_bitrates = 4;
sbands[IEEE80211_BAND_2GHZ].channels = channels;
@ -909,7 +909,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
* Rates: CCK, OFDM.
* 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_bitrates = spec->num_rates;
sbands[IEEE80211_BAND_2GHZ].channels = channels;
@ -922,7 +922,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
* Rates: OFDM.
* 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_bitrates = spec->num_rates - 4;
sbands[IEEE80211_BAND_5GHZ].channels = &channels[14];