}
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,
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, ®);
rt2x00_set_field16(®, TXRX_CSR18_INTERVAL,
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);
* 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.
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
struct antenna_setup ant;
- int phymode;
+ enum ieee80211_band band;
int basic_rates;
int slot_time;
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;
}
* 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;
* 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;
* 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];