aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00config.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2009-08-08 17:53:04 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:51 -0400
commitbdfa500b8b8ca87dfe7a311f569fe8b39746c299 (patch)
tree4b49d31360d0a335154c30165efc422d1e856459 /drivers/net/wireless/rt2x00/rt2x00config.c
parent4d30d309a3be84dfb01743ceb4652405204a80a0 (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/rt2x00config.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 3845316ccd39..3501788ab498 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -124,8 +124,9 @@ enum antenna rt2x00lib_config_antenna_check(enum antenna current_ant,
124} 124}
125 125
126void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, 126void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
127 struct antenna_setup ant) 127 struct antenna_setup config)
128{ 128{
129 struct link_ant *ant = &rt2x00dev->link.ant;
129 struct antenna_setup *def = &rt2x00dev->default_ant; 130 struct antenna_setup *def = &rt2x00dev->default_ant;
130 struct antenna_setup *active = &rt2x00dev->link.ant.active; 131 struct antenna_setup *active = &rt2x00dev->link.ant.active;
131 132
@@ -134,14 +135,23 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
134 * ANTENNA_SW_DIVERSITY state to the driver. 135 * ANTENNA_SW_DIVERSITY state to the driver.
135 * If that happens, fallback to hardware defaults, 136 * If that happens, fallback to hardware defaults,
136 * or our own default. 137 * or our own default.
138 * If diversity handling is active for a particular antenna,
139 * we shouldn't overwrite that antenna.
137 * The calls to rt2x00lib_config_antenna_check() 140 * The calls to rt2x00lib_config_antenna_check()
138 * might have caused that we restore back to the already 141 * might have caused that we restore back to the already
139 * active setting. If that has happened we can quit. 142 * active setting. If that has happened we can quit.
140 */ 143 */
141 ant.rx = rt2x00lib_config_antenna_check(ant.rx, def->rx); 144 if (!(ant->flags & ANTENNA_RX_DIVERSITY))
142 ant.tx = rt2x00lib_config_antenna_check(ant.tx, def->tx); 145 config.rx = rt2x00lib_config_antenna_check(config.rx, def->rx);
146 else
147 config.rx = active->rx;
143 148
144 if (ant.rx == active->rx && ant.tx == active->tx) 149 if (!(ant->flags & ANTENNA_TX_DIVERSITY))
150 config.tx = rt2x00lib_config_antenna_check(config.tx, def->tx);
151 else
152 config.tx = active->tx;
153
154 if (config.rx == active->rx && config.tx == active->tx)
145 return; 155 return;
146 156
147 /* 157 /*
@@ -156,11 +166,11 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
156 * The latter is required since we need to recalibrate the 166 * The latter is required since we need to recalibrate the
157 * noise-sensitivity ratio for the new setup. 167 * noise-sensitivity ratio for the new setup.
158 */ 168 */
159 rt2x00dev->ops->lib->config_ant(rt2x00dev, &ant); 169 rt2x00dev->ops->lib->config_ant(rt2x00dev, &config);
160 170
161 rt2x00link_reset_tuner(rt2x00dev, true); 171 rt2x00link_reset_tuner(rt2x00dev, true);
162 172
163 memcpy(active, &ant, sizeof(ant)); 173 memcpy(active, &config, sizeof(config));
164 174
165 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) 175 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
166 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK); 176 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK);