diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00config.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 6 |
5 files changed, 10 insertions, 35 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 38c968ee50f1..df176cd2ef42 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, | |||
358 | } | 358 | } |
359 | 359 | ||
360 | static void rt2500usb_config_phymode(struct rt2x00_dev *rt2x00dev, | 360 | static void rt2500usb_config_phymode(struct rt2x00_dev *rt2x00dev, |
361 | const int phymode, | ||
362 | const int basic_rate_mask) | 361 | const int basic_rate_mask) |
363 | { | 362 | { |
364 | rt2500usb_register_write(rt2x00dev, TXRX_CSR11, basic_rate_mask); | 363 | rt2500usb_register_write(rt2x00dev, TXRX_CSR11, basic_rate_mask); |
365 | |||
366 | if (phymode == HWMODE_B) { | ||
367 | rt2500usb_register_write(rt2x00dev, MAC_CSR11, 0x000b); | ||
368 | rt2500usb_register_write(rt2x00dev, MAC_CSR12, 0x0040); | ||
369 | } else { | ||
370 | rt2500usb_register_write(rt2x00dev, MAC_CSR11, 0x0005); | ||
371 | rt2500usb_register_write(rt2x00dev, MAC_CSR12, 0x016c); | ||
372 | } | ||
373 | } | 364 | } |
374 | 365 | ||
375 | static void rt2500usb_config_channel(struct rt2x00_dev *rt2x00dev, | 366 | static void rt2500usb_config_channel(struct rt2x00_dev *rt2x00dev, |
@@ -507,6 +498,8 @@ static void rt2500usb_config_duration(struct rt2x00_dev *rt2x00dev, | |||
507 | u16 reg; | 498 | u16 reg; |
508 | 499 | ||
509 | rt2500usb_register_write(rt2x00dev, MAC_CSR10, libconf->slot_time); | 500 | rt2500usb_register_write(rt2x00dev, MAC_CSR10, libconf->slot_time); |
501 | rt2500usb_register_write(rt2x00dev, MAC_CSR11, libconf->sifs); | ||
502 | rt2500usb_register_write(rt2x00dev, MAC_CSR12, libconf->eifs); | ||
510 | 503 | ||
511 | rt2500usb_register_read(rt2x00dev, TXRX_CSR18, ®); | 504 | rt2500usb_register_read(rt2x00dev, TXRX_CSR18, ®); |
512 | rt2x00_set_field16(®, TXRX_CSR18_INTERVAL, | 505 | rt2x00_set_field16(®, TXRX_CSR18_INTERVAL, |
@@ -519,8 +512,7 @@ static void rt2500usb_config(struct rt2x00_dev *rt2x00dev, | |||
519 | const unsigned int flags) | 512 | const unsigned int flags) |
520 | { | 513 | { |
521 | if (flags & CONFIG_UPDATE_PHYMODE) | 514 | if (flags & CONFIG_UPDATE_PHYMODE) |
522 | rt2500usb_config_phymode(rt2x00dev, libconf->phymode, | 515 | rt2500usb_config_phymode(rt2x00dev, libconf->basic_rates); |
523 | libconf->basic_rates); | ||
524 | if (flags & CONFIG_UPDATE_CHANNEL) | 516 | if (flags & CONFIG_UPDATE_CHANNEL) |
525 | rt2500usb_config_channel(rt2x00dev, &libconf->rf, | 517 | rt2500usb_config_channel(rt2x00dev, &libconf->rf, |
526 | libconf->conf->power_level); | 518 | libconf->conf->power_level); |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.h b/drivers/net/wireless/rt2x00/rt2500usb.h index 23ba0c15741f..647cd2d56ab9 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.h +++ b/drivers/net/wireless/rt2x00/rt2500usb.h | |||
@@ -135,7 +135,7 @@ | |||
135 | * Misc MAC_CSR registers. | 135 | * Misc MAC_CSR registers. |
136 | * MAC_CSR9: Timer control. | 136 | * MAC_CSR9: Timer control. |
137 | * MAC_CSR10: Slot time. | 137 | * MAC_CSR10: Slot time. |
138 | * MAC_CSR11: IFS. | 138 | * MAC_CSR11: SIFS. |
139 | * MAC_CSR12: EIFS. | 139 | * MAC_CSR12: EIFS. |
140 | * MAC_CSR13: Power mode0. | 140 | * MAC_CSR13: Power mode0. |
141 | * MAC_CSR14: Power mode1. | 141 | * MAC_CSR14: Power mode1. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 4fa762bdb734..93dbe2b286d5 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) | |||
390 | return (struct rt2x00_intf *)vif->drv_priv; | 390 | return (struct rt2x00_intf *)vif->drv_priv; |
391 | } | 391 | } |
392 | 392 | ||
393 | #define HWMODE_B 0 | ||
394 | #define HWMODE_G 1 | ||
395 | #define HWMODE_A 2 | ||
396 | |||
397 | /* | 393 | /* |
398 | * Details about the supported modes, rates and channels | 394 | * Details about the supported modes, rates and channels |
399 | * of a particular chipset. This is used by rt2x00lib | 395 | * of a particular chipset. This is used by rt2x00lib |
@@ -433,7 +429,7 @@ struct rt2x00lib_conf { | |||
433 | 429 | ||
434 | struct antenna_setup ant; | 430 | struct antenna_setup ant; |
435 | 431 | ||
436 | int phymode; | 432 | enum ieee80211_band band; |
437 | 433 | ||
438 | int basic_rates; | 434 | int basic_rates; |
439 | int slot_time; | 435 | int slot_time; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c index a4d7917f2df5..69959124d25d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/drivers/net/wireless/rt2x00/rt2x00config.c | |||
@@ -229,23 +229,10 @@ config: | |||
229 | memset(&libconf, 0, sizeof(libconf)); | 229 | memset(&libconf, 0, sizeof(libconf)); |
230 | 230 | ||
231 | if (flags & CONFIG_UPDATE_PHYMODE) { | 231 | if (flags & CONFIG_UPDATE_PHYMODE) { |
232 | switch (conf->channel->band) { | ||
233 | case IEEE80211_BAND_5GHZ: | ||
234 | libconf.phymode = HWMODE_A; | ||
235 | break; | ||
236 | case IEEE80211_BAND_2GHZ: | ||
237 | /* Uh oh. what about B? */ | ||
238 | libconf.phymode = HWMODE_G; | ||
239 | break; | ||
240 | default: | ||
241 | ERROR(rt2x00dev, | ||
242 | "Attempt to configure unsupported mode (%d)" | ||
243 | "Defaulting to 802.11b", conf->channel->band); | ||
244 | libconf.phymode = HWMODE_B; | ||
245 | } | ||
246 | |||
247 | band = &rt2x00dev->bands[conf->channel->band]; | 232 | band = &rt2x00dev->bands[conf->channel->band]; |
248 | rate = &band->bitrates[band->n_bitrates - 1]; | 233 | rate = &band->bitrates[band->n_bitrates - 1]; |
234 | |||
235 | libconf.band = conf->channel->band; | ||
249 | libconf.basic_rates = rt2x00_get_rate(rate->hw_value)->ratemask; | 236 | libconf.basic_rates = rt2x00_get_rate(rate->hw_value)->ratemask; |
250 | } | 237 | } |
251 | 238 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index f0ba481c51e6..72c4f13a5336 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, | |||
896 | * Rates: CCK. | 896 | * Rates: CCK. |
897 | * Channels: 2.4 GHz | 897 | * Channels: 2.4 GHz |
898 | */ | 898 | */ |
899 | if (spec->num_modes > HWMODE_B) { | 899 | if (spec->num_modes > 0) { |
900 | sbands[IEEE80211_BAND_2GHZ].n_channels = 14; | 900 | sbands[IEEE80211_BAND_2GHZ].n_channels = 14; |
901 | sbands[IEEE80211_BAND_2GHZ].n_bitrates = 4; | 901 | sbands[IEEE80211_BAND_2GHZ].n_bitrates = 4; |
902 | sbands[IEEE80211_BAND_2GHZ].channels = channels; | 902 | sbands[IEEE80211_BAND_2GHZ].channels = channels; |
@@ -909,7 +909,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, | |||
909 | * Rates: CCK, OFDM. | 909 | * Rates: CCK, OFDM. |
910 | * Channels: 2.4 GHz | 910 | * Channels: 2.4 GHz |
911 | */ | 911 | */ |
912 | if (spec->num_modes > HWMODE_G) { | 912 | if (spec->num_modes > 1) { |
913 | sbands[IEEE80211_BAND_2GHZ].n_channels = 14; | 913 | sbands[IEEE80211_BAND_2GHZ].n_channels = 14; |
914 | sbands[IEEE80211_BAND_2GHZ].n_bitrates = spec->num_rates; | 914 | sbands[IEEE80211_BAND_2GHZ].n_bitrates = spec->num_rates; |
915 | sbands[IEEE80211_BAND_2GHZ].channels = channels; | 915 | sbands[IEEE80211_BAND_2GHZ].channels = channels; |
@@ -922,7 +922,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, | |||
922 | * Rates: OFDM. | 922 | * Rates: OFDM. |
923 | * Channels: OFDM, UNII, HiperLAN2. | 923 | * Channels: OFDM, UNII, HiperLAN2. |
924 | */ | 924 | */ |
925 | if (spec->num_modes > HWMODE_A) { | 925 | if (spec->num_modes > 2) { |
926 | sbands[IEEE80211_BAND_5GHZ].n_channels = spec->num_channels - 14; | 926 | sbands[IEEE80211_BAND_5GHZ].n_channels = spec->num_channels - 14; |
927 | sbands[IEEE80211_BAND_5GHZ].n_bitrates = spec->num_rates - 4; | 927 | sbands[IEEE80211_BAND_5GHZ].n_bitrates = spec->num_rates - 4; |
928 | sbands[IEEE80211_BAND_5GHZ].channels = &channels[14]; | 928 | sbands[IEEE80211_BAND_5GHZ].channels = &channels[14]; |