diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2009-08-08 17:53:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:13:51 -0400 |
commit | bdfa500b8b8ca87dfe7a311f569fe8b39746c299 (patch) | |
tree | 4b49d31360d0a335154c30165efc422d1e856459 /drivers/net/wireless/rt2x00/rt2x00mac.c | |
parent | 4d30d309a3be84dfb01743ceb4652405204a80a0 (diff) |
rt2x00: Remove usage of deprecated radio_enabled & IEEE80211_CONF_CHANGE_RADIO_ENABLED
In the config() callback function the fields radio_enabled and
the change flag IEEE80211_CONF_CHANGE_RADIO_ENABLED have been
deprecated. This removes the usage of those fields by improving
antenna change detection in the antenna configuration function.
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/rt2x00mac.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 54 |
1 files changed, 19 insertions, 35 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 81febdfd6639..4164fce05987 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -338,7 +338,6 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed) | |||
338 | { | 338 | { |
339 | struct rt2x00_dev *rt2x00dev = hw->priv; | 339 | struct rt2x00_dev *rt2x00dev = hw->priv; |
340 | struct ieee80211_conf *conf = &hw->conf; | 340 | struct ieee80211_conf *conf = &hw->conf; |
341 | int status; | ||
342 | 341 | ||
343 | /* | 342 | /* |
344 | * mac80211 might be calling this function while we are trying | 343 | * mac80211 might be calling this function while we are trying |
@@ -348,44 +347,29 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed) | |||
348 | return 0; | 347 | return 0; |
349 | 348 | ||
350 | /* | 349 | /* |
351 | * Only change device state when the radio is enabled. It does not | 350 | * Some configuration parameters (e.g. channel and antenna values) can |
352 | * matter what parameters we have configured when the radio is disabled | 351 | * only be set when the radio is enabled, but do require the RX to |
353 | * because we won't be able to send or receive anyway. Also note that | 352 | * be off. |
354 | * some configuration parameters (e.g. channel and antenna values) can | ||
355 | * only be set when the radio is enabled. | ||
356 | */ | 353 | */ |
357 | if (conf->radio_enabled) { | 354 | rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF); |
358 | /* For programming the values, we have to turn RX off */ | ||
359 | rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF); | ||
360 | 355 | ||
361 | /* Enable the radio */ | 356 | /* |
362 | status = rt2x00lib_enable_radio(rt2x00dev); | 357 | * When we've just turned on the radio, we want to reprogram |
363 | if (unlikely(status)) | 358 | * everything to ensure a consistent state |
364 | return status; | 359 | */ |
360 | rt2x00lib_config(rt2x00dev, conf, changed); | ||
365 | 361 | ||
366 | /* | 362 | /* |
367 | * When we've just turned on the radio, we want to reprogram | 363 | * After the radio has been enabled we need to configure |
368 | * everything to ensure a consistent state | 364 | * the antenna to the default settings. rt2x00lib_config_antenna() |
369 | */ | 365 | * should determine if any action should be taken based on |
370 | rt2x00lib_config(rt2x00dev, conf, changed); | 366 | * checking if diversity has been enabled or no antenna changes |
367 | * have been made since the last configuration change. | ||
368 | */ | ||
369 | rt2x00lib_config_antenna(rt2x00dev, rt2x00dev->default_ant); | ||
371 | 370 | ||
372 | /* | 371 | /* Turn RX back on */ |
373 | * The radio was enabled, configure the antenna to the | 372 | rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON); |
374 | * default settings, the link tuner will later start | ||
375 | * continue configuring the antenna based on the software | ||
376 | * diversity. But for non-diversity configurations, we need | ||
377 | * to have configured the correct state now. | ||
378 | */ | ||
379 | if (changed & IEEE80211_CONF_CHANGE_RADIO_ENABLED) | ||
380 | rt2x00lib_config_antenna(rt2x00dev, | ||
381 | rt2x00dev->default_ant); | ||
382 | |||
383 | /* Turn RX back on */ | ||
384 | rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON); | ||
385 | } else { | ||
386 | /* Disable the radio */ | ||
387 | rt2x00lib_disable_radio(rt2x00dev); | ||
388 | } | ||
389 | 373 | ||
390 | return 0; | 374 | return 0; |
391 | } | 375 | } |