summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-02-03 15:51:13 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:19:38 -0500
commitf5507ce90be4e00a84b5bb4c7b4324455aa6ee21 (patch)
tree5a68598ccffb2c0226994237a46edd81909699f5 /drivers
parent70e2fed4ec14df84ed72554d573794714b15a078 (diff)
downloadop-kernel-dev-f5507ce90be4e00a84b5bb4c7b4324455aa6ee21.zip
op-kernel-dev-f5507ce90be4e00a84b5bb4c7b4324455aa6ee21.tar.gz
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c14
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c17
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c6
5 files changed, 10 insertions, 35 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 38c968e..df176cd 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -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);
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.h b/drivers/net/wireless/rt2x00/rt2500usb.h
index 23ba0c1..647cd2d5 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.h
+++ b/drivers/net/wireless/rt2x00/rt2500usb.h
@@ -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.
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 4fa762b..93dbe2b 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -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;
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index a4d7917..6995912 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -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;
}
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index f0ba481..72c4f13 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -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];
OpenPOWER on IntegriCloud