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>
This commit is contained in:
committed by
John W. Linville
parent
4d30d309a3
commit
bdfa500b8b
@@ -124,8 +124,9 @@ enum antenna rt2x00lib_config_antenna_check(enum antenna current_ant,
|
||||
}
|
||||
|
||||
void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
|
||||
struct antenna_setup ant)
|
||||
struct antenna_setup config)
|
||||
{
|
||||
struct link_ant *ant = &rt2x00dev->link.ant;
|
||||
struct antenna_setup *def = &rt2x00dev->default_ant;
|
||||
struct antenna_setup *active = &rt2x00dev->link.ant.active;
|
||||
|
||||
@@ -134,14 +135,23 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
|
||||
* ANTENNA_SW_DIVERSITY state to the driver.
|
||||
* If that happens, fallback to hardware defaults,
|
||||
* or our own default.
|
||||
* If diversity handling is active for a particular antenna,
|
||||
* we shouldn't overwrite that antenna.
|
||||
* The calls to rt2x00lib_config_antenna_check()
|
||||
* might have caused that we restore back to the already
|
||||
* active setting. If that has happened we can quit.
|
||||
*/
|
||||
ant.rx = rt2x00lib_config_antenna_check(ant.rx, def->rx);
|
||||
ant.tx = rt2x00lib_config_antenna_check(ant.tx, def->tx);
|
||||
if (!(ant->flags & ANTENNA_RX_DIVERSITY))
|
||||
config.rx = rt2x00lib_config_antenna_check(config.rx, def->rx);
|
||||
else
|
||||
config.rx = active->rx;
|
||||
|
||||
if (ant.rx == active->rx && ant.tx == active->tx)
|
||||
if (!(ant->flags & ANTENNA_TX_DIVERSITY))
|
||||
config.tx = rt2x00lib_config_antenna_check(config.tx, def->tx);
|
||||
else
|
||||
config.tx = active->tx;
|
||||
|
||||
if (config.rx == active->rx && config.tx == active->tx)
|
||||
return;
|
||||
|
||||
/*
|
||||
@@ -156,11 +166,11 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
|
||||
* The latter is required since we need to recalibrate the
|
||||
* noise-sensitivity ratio for the new setup.
|
||||
*/
|
||||
rt2x00dev->ops->lib->config_ant(rt2x00dev, &ant);
|
||||
rt2x00dev->ops->lib->config_ant(rt2x00dev, &config);
|
||||
|
||||
rt2x00link_reset_tuner(rt2x00dev, true);
|
||||
|
||||
memcpy(active, &ant, sizeof(ant));
|
||||
memcpy(active, &config, sizeof(config));
|
||||
|
||||
if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK);
|
||||
|
Reference in New Issue
Block a user