aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-10-09 06:18:04 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:06 -0400
commit0f4ac38b5999c3d51adad52d61c56c1b99c247ec (patch)
tree0376bd4904597495ce788883d371d794e8c85f69 /drivers/net/wireless
parentd9fe60dea7779d412b34679f1177c5ca1940ea8d (diff)
mac80211: kill hw.conf.antenna_sel_{rx,tx}
Never actually used. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/b43/main.c25
-rw-r--r--drivers/net/wireless/b43legacy/main.c18
-rw-r--r--drivers/net/wireless/p54/p54common.c3
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c20
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c6
5 files changed, 12 insertions, 60 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 6e773018cba0..6b85428b0e1d 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -1339,25 +1339,6 @@ u8 b43_ieee80211_antenna_sanitize(struct b43_wldev *dev,
1339 return antenna_nr; 1339 return antenna_nr;
1340} 1340}
1341 1341
1342static int b43_antenna_from_ieee80211(struct b43_wldev *dev, u8 antenna)
1343{
1344 antenna = b43_ieee80211_antenna_sanitize(dev, antenna);
1345 switch (antenna) {
1346 case 0: /* default/diversity */
1347 return B43_ANTENNA_DEFAULT;
1348 case 1: /* Antenna 0 */
1349 return B43_ANTENNA0;
1350 case 2: /* Antenna 1 */
1351 return B43_ANTENNA1;
1352 case 3: /* Antenna 2 */
1353 return B43_ANTENNA2;
1354 case 4: /* Antenna 3 */
1355 return B43_ANTENNA3;
1356 default:
1357 return B43_ANTENNA_DEFAULT;
1358 }
1359}
1360
1361/* Convert a b43 antenna number value to the PHY TX control value. */ 1342/* Convert a b43 antenna number value to the PHY TX control value. */
1362static u16 b43_antenna_to_phyctl(int antenna) 1343static u16 b43_antenna_to_phyctl(int antenna)
1363{ 1344{
@@ -1399,7 +1380,7 @@ static void b43_write_beacon_template(struct b43_wldev *dev,
1399 len, ram_offset, shm_size_offset, rate); 1380 len, ram_offset, shm_size_offset, rate);
1400 1381
1401 /* Write the PHY TX control parameters. */ 1382 /* Write the PHY TX control parameters. */
1402 antenna = b43_antenna_from_ieee80211(dev, info->antenna_sel_tx); 1383 antenna = B43_ANTENNA_DEFAULT;
1403 antenna = b43_antenna_to_phyctl(antenna); 1384 antenna = b43_antenna_to_phyctl(antenna);
1404 ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL); 1385 ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL);
1405 /* We can't send beacons with short preamble. Would get PHY errors. */ 1386 /* We can't send beacons with short preamble. Would get PHY errors. */
@@ -3399,9 +3380,9 @@ static int b43_op_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
3399 } 3380 }
3400 3381
3401 /* Antennas for RX and management frame TX. */ 3382 /* Antennas for RX and management frame TX. */
3402 antenna = b43_antenna_from_ieee80211(dev, conf->antenna_sel_tx); 3383 antenna = B43_ANTENNA_DEFAULT;
3403 b43_mgmtframe_txantenna(dev, antenna); 3384 b43_mgmtframe_txantenna(dev, antenna);
3404 antenna = b43_antenna_from_ieee80211(dev, conf->antenna_sel_rx); 3385 antenna = B43_ANTENNA_DEFAULT;
3405 if (phy->ops->set_rx_antenna) 3386 if (phy->ops->set_rx_antenna)
3406 phy->ops->set_rx_antenna(dev, antenna); 3387 phy->ops->set_rx_antenna(dev, antenna);
3407 3388
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index c66d57560e7c..867f01ce45c7 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2556,20 +2556,6 @@ init_failure:
2556 return err; 2556 return err;
2557} 2557}
2558 2558
2559static int b43legacy_antenna_from_ieee80211(u8 antenna)
2560{
2561 switch (antenna) {
2562 case 0: /* default/diversity */
2563 return B43legacy_ANTENNA_DEFAULT;
2564 case 1: /* Antenna 0 */
2565 return B43legacy_ANTENNA0;
2566 case 2: /* Antenna 1 */
2567 return B43legacy_ANTENNA1;
2568 default:
2569 return B43legacy_ANTENNA_DEFAULT;
2570 }
2571}
2572
2573static int b43legacy_op_dev_config(struct ieee80211_hw *hw, 2559static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
2574 struct ieee80211_conf *conf) 2560 struct ieee80211_conf *conf)
2575{ 2561{
@@ -2583,8 +2569,8 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
2583 int err = 0; 2569 int err = 0;
2584 u32 savedirqs; 2570 u32 savedirqs;
2585 2571
2586 antenna_tx = b43legacy_antenna_from_ieee80211(conf->antenna_sel_tx); 2572 antenna_tx = B43legacy_ANTENNA_DEFAULT;
2587 antenna_rx = b43legacy_antenna_from_ieee80211(conf->antenna_sel_rx); 2573 antenna_rx = B43legacy_ANTENNA_DEFAULT;
2588 2574
2589 mutex_lock(&wl->mutex); 2575 mutex_lock(&wl->mutex);
2590 dev = wl->current_dev; 2576 dev = wl->current_dev;
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index b1dc10ccd32c..b3e75eb4d5ba 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -1198,8 +1198,7 @@ static int p54_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
1198 struct p54_common *priv = dev->priv; 1198 struct p54_common *priv = dev->priv;
1199 1199
1200 mutex_lock(&priv->conf_mutex); 1200 mutex_lock(&priv->conf_mutex);
1201 priv->rx_antenna = (conf->antenna_sel_rx == 0) ? 1201 priv->rx_antenna = 2; /* automatic */
1202 2 : conf->antenna_sel_tx - 1;
1203 priv->output_power = conf->power_level << 2; 1202 priv->output_power = conf->power_level << 2;
1204 ret = p54_set_freq(dev, cpu_to_le16(conf->channel->center_freq)); 1203 ret = p54_set_freq(dev, cpu_to_le16(conf->channel->center_freq));
1205 p54_set_vdcf(dev); 1204 p54_set_vdcf(dev);
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 4d5e87b015a0..7910147157b5 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -199,23 +199,15 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
199 * to work with untill the link tuner decides that an antenna 199 * to work with untill the link tuner decides that an antenna
200 * switch should be performed. 200 * switch should be performed.
201 */ 201 */
202 if (!conf->antenna_sel_rx && 202 if (default_ant->rx != ANTENNA_SW_DIVERSITY &&
203 default_ant->rx != ANTENNA_SW_DIVERSITY &&
204 default_ant->rx != active_ant->rx) 203 default_ant->rx != active_ant->rx)
205 flags |= CONFIG_UPDATE_ANTENNA; 204 flags |= CONFIG_UPDATE_ANTENNA;
206 else if (conf->antenna_sel_rx &&
207 conf->antenna_sel_rx != active_ant->rx)
208 flags |= CONFIG_UPDATE_ANTENNA;
209 else if (active_ant->rx == ANTENNA_SW_DIVERSITY) 205 else if (active_ant->rx == ANTENNA_SW_DIVERSITY)
210 flags |= CONFIG_UPDATE_ANTENNA; 206 flags |= CONFIG_UPDATE_ANTENNA;
211 207
212 if (!conf->antenna_sel_tx && 208 if (default_ant->tx != ANTENNA_SW_DIVERSITY &&
213 default_ant->tx != ANTENNA_SW_DIVERSITY &&
214 default_ant->tx != active_ant->tx) 209 default_ant->tx != active_ant->tx)
215 flags |= CONFIG_UPDATE_ANTENNA; 210 flags |= CONFIG_UPDATE_ANTENNA;
216 else if (conf->antenna_sel_tx &&
217 conf->antenna_sel_tx != active_ant->tx)
218 flags |= CONFIG_UPDATE_ANTENNA;
219 else if (active_ant->tx == ANTENNA_SW_DIVERSITY) 211 else if (active_ant->tx == ANTENNA_SW_DIVERSITY)
220 flags |= CONFIG_UPDATE_ANTENNA; 212 flags |= CONFIG_UPDATE_ANTENNA;
221 213
@@ -252,18 +244,14 @@ config:
252 } 244 }
253 245
254 if (flags & CONFIG_UPDATE_ANTENNA) { 246 if (flags & CONFIG_UPDATE_ANTENNA) {
255 if (conf->antenna_sel_rx) 247 if (default_ant->rx != ANTENNA_SW_DIVERSITY)
256 libconf.ant.rx = conf->antenna_sel_rx;
257 else if (default_ant->rx != ANTENNA_SW_DIVERSITY)
258 libconf.ant.rx = default_ant->rx; 248 libconf.ant.rx = default_ant->rx;
259 else if (active_ant->rx == ANTENNA_SW_DIVERSITY) 249 else if (active_ant->rx == ANTENNA_SW_DIVERSITY)
260 libconf.ant.rx = ANTENNA_B; 250 libconf.ant.rx = ANTENNA_B;
261 else 251 else
262 libconf.ant.rx = active_ant->rx; 252 libconf.ant.rx = active_ant->rx;
263 253
264 if (conf->antenna_sel_tx) 254 if (default_ant->tx != ANTENNA_SW_DIVERSITY)
265 libconf.ant.tx = conf->antenna_sel_tx;
266 else if (default_ant->tx != ANTENNA_SW_DIVERSITY)
267 libconf.ant.tx = default_ant->tx; 255 libconf.ant.tx = default_ant->tx;
268 else if (active_ant->tx == ANTENNA_SW_DIVERSITY) 256 else if (active_ant->tx == ANTENNA_SW_DIVERSITY)
269 libconf.ant.tx = ANTENNA_B; 257 libconf.ant.tx = ANTENNA_B;
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 86840e3585e8..9e0472bd1edf 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -249,11 +249,9 @@ static void rt2x00lib_evaluate_antenna(struct rt2x00_dev *rt2x00dev)
249 rt2x00dev->link.ant.flags &= ~ANTENNA_RX_DIVERSITY; 249 rt2x00dev->link.ant.flags &= ~ANTENNA_RX_DIVERSITY;
250 rt2x00dev->link.ant.flags &= ~ANTENNA_TX_DIVERSITY; 250 rt2x00dev->link.ant.flags &= ~ANTENNA_TX_DIVERSITY;
251 251
252 if (rt2x00dev->hw->conf.antenna_sel_rx == 0 && 252 if (rt2x00dev->default_ant.rx == ANTENNA_SW_DIVERSITY)
253 rt2x00dev->default_ant.rx == ANTENNA_SW_DIVERSITY)
254 rt2x00dev->link.ant.flags |= ANTENNA_RX_DIVERSITY; 253 rt2x00dev->link.ant.flags |= ANTENNA_RX_DIVERSITY;
255 if (rt2x00dev->hw->conf.antenna_sel_tx == 0 && 254 if (rt2x00dev->default_ant.tx == ANTENNA_SW_DIVERSITY)
256 rt2x00dev->default_ant.tx == ANTENNA_SW_DIVERSITY)
257 rt2x00dev->link.ant.flags |= ANTENNA_TX_DIVERSITY; 255 rt2x00dev->link.ant.flags |= ANTENNA_TX_DIVERSITY;
258 256
259 if (!(rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) && 257 if (!(rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) &&