diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-03-09 17:48:08 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-13 19:31:42 -0400 |
commit | aa776721b472e343a8db7f3c0673b1fa24e6c7f7 (patch) | |
tree | b3bb79f05cdd729696877783bb25da7c3a7dd3c0 /drivers/net/wireless/rt2x00/rt2x00config.c | |
parent | fd3c91c5e57eef8db71cf52e2473832c330bf5db (diff) |
rt2x00: Fix basic rate initialization
The basic rate which is configured in the register
should not match all supported rates, but only the _basic_ rates.
Fix this by adding a new flag to the rt2x00_rate structure
and whenever the mode is changed, loop over all available rates
for that band to get the basic rate mask.
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/rt2x00config.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00config.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c index 72111694154e..5e2d81a9e438 100644 --- a/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/drivers/net/wireless/rt2x00/rt2x00config.c | |||
@@ -145,12 +145,26 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, | |||
145 | rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK); | 145 | rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK); |
146 | } | 146 | } |
147 | 147 | ||
148 | static u32 rt2x00lib_get_basic_rates(struct ieee80211_supported_band *band) | ||
149 | { | ||
150 | const struct rt2x00_rate *rate; | ||
151 | unsigned int i; | ||
152 | u32 mask = 0; | ||
153 | |||
154 | for (i = 0; i < band->n_bitrates; i++) { | ||
155 | rate = rt2x00_get_rate(band->bitrates[i].hw_value); | ||
156 | if (rate->flags & DEV_RATE_BASIC) | ||
157 | mask |= rate->ratemask; | ||
158 | } | ||
159 | |||
160 | return mask; | ||
161 | } | ||
162 | |||
148 | void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, | 163 | void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, |
149 | struct ieee80211_conf *conf, const int force_config) | 164 | struct ieee80211_conf *conf, const int force_config) |
150 | { | 165 | { |
151 | struct rt2x00lib_conf libconf; | 166 | struct rt2x00lib_conf libconf; |
152 | struct ieee80211_supported_band *band; | 167 | struct ieee80211_supported_band *band; |
153 | struct ieee80211_rate *rate; | ||
154 | struct antenna_setup *default_ant = &rt2x00dev->default_ant; | 168 | struct antenna_setup *default_ant = &rt2x00dev->default_ant; |
155 | struct antenna_setup *active_ant = &rt2x00dev->link.ant.active; | 169 | struct antenna_setup *active_ant = &rt2x00dev->link.ant.active; |
156 | int flags = 0; | 170 | int flags = 0; |
@@ -227,10 +241,9 @@ config: | |||
227 | 241 | ||
228 | if (flags & CONFIG_UPDATE_PHYMODE) { | 242 | if (flags & CONFIG_UPDATE_PHYMODE) { |
229 | band = &rt2x00dev->bands[conf->channel->band]; | 243 | band = &rt2x00dev->bands[conf->channel->band]; |
230 | rate = &band->bitrates[band->n_bitrates - 1]; | ||
231 | 244 | ||
232 | libconf.band = conf->channel->band; | 245 | libconf.band = conf->channel->band; |
233 | libconf.basic_rates = rt2x00_get_rate(rate->hw_value)->ratemask; | 246 | libconf.basic_rates = rt2x00lib_get_basic_rates(band); |
234 | } | 247 | } |
235 | 248 | ||
236 | if (flags & CONFIG_UPDATE_CHANNEL) { | 249 | if (flags & CONFIG_UPDATE_CHANNEL) { |