diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-08-04 10:38:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-22 16:29:58 -0400 |
commit | 8c5e7a5f59f9d11597bd47de28334da318ea0e80 (patch) | |
tree | 46dc69607e8a196fd68b3b040b312bc1e7fc0559 /drivers/net/wireless/rt2x00/rt2x00dev.c | |
parent | 906c110fcc24bdd5bf0fa22d89ac75d99c747e53 (diff) |
rt2x00: Gather channel information in structure
Channel information which is read from EEPROM should
be read into an array containing per-channel information.
This removes the requirement of multiple arrays and makes
the channel handling a bit cleaner and easier to expand.
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/rt2x00dev.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 182952249a19..328ff8bc4c16 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -818,7 +818,6 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, | |||
818 | struct ieee80211_rate *rates; | 818 | struct ieee80211_rate *rates; |
819 | unsigned int num_rates; | 819 | unsigned int num_rates; |
820 | unsigned int i; | 820 | unsigned int i; |
821 | unsigned char tx_power; | ||
822 | 821 | ||
823 | num_rates = 0; | 822 | num_rates = 0; |
824 | if (spec->supported_rates & SUPPORT_RATE_CCK) | 823 | if (spec->supported_rates & SUPPORT_RATE_CCK) |
@@ -844,20 +843,9 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, | |||
844 | * Initialize Channel list. | 843 | * Initialize Channel list. |
845 | */ | 844 | */ |
846 | for (i = 0; i < spec->num_channels; i++) { | 845 | for (i = 0; i < spec->num_channels; i++) { |
847 | if (spec->channels[i].channel <= 14) { | ||
848 | if (spec->tx_power_bg) | ||
849 | tx_power = spec->tx_power_bg[i]; | ||
850 | else | ||
851 | tx_power = spec->tx_power_default; | ||
852 | } else { | ||
853 | if (spec->tx_power_a) | ||
854 | tx_power = spec->tx_power_a[i]; | ||
855 | else | ||
856 | tx_power = spec->tx_power_default; | ||
857 | } | ||
858 | |||
859 | rt2x00lib_channel(&channels[i], | 846 | rt2x00lib_channel(&channels[i], |
860 | spec->channels[i].channel, tx_power, i); | 847 | spec->channels[i].channel, |
848 | spec->channels_info[i].tx_power1, i); | ||
861 | } | 849 | } |
862 | 850 | ||
863 | /* | 851 | /* |
@@ -909,6 +897,8 @@ static void rt2x00lib_remove_hw(struct rt2x00_dev *rt2x00dev) | |||
909 | rt2x00dev->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = NULL; | 897 | rt2x00dev->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = NULL; |
910 | rt2x00dev->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL; | 898 | rt2x00dev->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL; |
911 | } | 899 | } |
900 | |||
901 | kfree(rt2x00dev->spec.channels_info); | ||
912 | } | 902 | } |
913 | 903 | ||
914 | static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) | 904 | static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) |