diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-02-17 11:35:05 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:37:23 -0500 |
commit | 31562e802a72caf0757f351fff563d558d48d087 (patch) | |
tree | ac2875b80508ab156dd3ef0302673530ca058bf8 /drivers/net/wireless/rt2x00/rt73usb.c | |
parent | de99ff82cdc2e5b596d01000eed9e0d05566f2d7 (diff) |
rt2x00: Cleanup mode registration
Don't wildly pass any number for num_rates to rt2x00lib,
instead pass which type of rates are supported (CCK, OFDM).
Same for num_modes but then for the 2GHZ and 5GHZ band.
This makes the interface look much nicer and makes
extending it later easier.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index c56540602ad6..bf2391b89571 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1791,8 +1791,8 @@ static void rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1791 | /* | 1791 | /* |
1792 | * Initialize hw_mode information. | 1792 | * Initialize hw_mode information. |
1793 | */ | 1793 | */ |
1794 | spec->num_modes = 2; | 1794 | spec->supported_bands = SUPPORT_BAND_2GHZ; |
1795 | spec->num_rates = 12; | 1795 | spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM; |
1796 | spec->tx_power_a = NULL; | 1796 | spec->tx_power_a = NULL; |
1797 | spec->tx_power_bg = txpower; | 1797 | spec->tx_power_bg = txpower; |
1798 | spec->tx_power_default = DEFAULT_TXPOWER; | 1798 | spec->tx_power_default = DEFAULT_TXPOWER; |
@@ -1801,20 +1801,20 @@ static void rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1801 | spec->num_channels = ARRAY_SIZE(rf_vals_bg_2528); | 1801 | spec->num_channels = ARRAY_SIZE(rf_vals_bg_2528); |
1802 | spec->channels = rf_vals_bg_2528; | 1802 | spec->channels = rf_vals_bg_2528; |
1803 | } else if (rt2x00_rf(&rt2x00dev->chip, RF5226)) { | 1803 | } else if (rt2x00_rf(&rt2x00dev->chip, RF5226)) { |
1804 | spec->supported_bands |= SUPPORT_BAND_5GHZ; | ||
1804 | spec->num_channels = ARRAY_SIZE(rf_vals_5226); | 1805 | spec->num_channels = ARRAY_SIZE(rf_vals_5226); |
1805 | spec->channels = rf_vals_5226; | 1806 | spec->channels = rf_vals_5226; |
1806 | } else if (rt2x00_rf(&rt2x00dev->chip, RF2527)) { | 1807 | } else if (rt2x00_rf(&rt2x00dev->chip, RF2527)) { |
1807 | spec->num_channels = 14; | 1808 | spec->num_channels = 14; |
1808 | spec->channels = rf_vals_5225_2527; | 1809 | spec->channels = rf_vals_5225_2527; |
1809 | } else if (rt2x00_rf(&rt2x00dev->chip, RF5225)) { | 1810 | } else if (rt2x00_rf(&rt2x00dev->chip, RF5225)) { |
1811 | spec->supported_bands |= SUPPORT_BAND_5GHZ; | ||
1810 | spec->num_channels = ARRAY_SIZE(rf_vals_5225_2527); | 1812 | spec->num_channels = ARRAY_SIZE(rf_vals_5225_2527); |
1811 | spec->channels = rf_vals_5225_2527; | 1813 | spec->channels = rf_vals_5225_2527; |
1812 | } | 1814 | } |
1813 | 1815 | ||
1814 | if (rt2x00_rf(&rt2x00dev->chip, RF5225) || | 1816 | if (rt2x00_rf(&rt2x00dev->chip, RF5225) || |
1815 | rt2x00_rf(&rt2x00dev->chip, RF5226)) { | 1817 | rt2x00_rf(&rt2x00dev->chip, RF5226)) { |
1816 | spec->num_modes = 3; | ||
1817 | |||
1818 | txpower = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START); | 1818 | txpower = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START); |
1819 | for (i = 0; i < 14; i++) | 1819 | for (i = 0; i < 14; i++) |
1820 | txpower[i] = TXPOWER_FROM_DEV(txpower[i]); | 1820 | txpower[i] = TXPOWER_FROM_DEV(txpower[i]); |