aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00config.c
diff options
context:
space:
mode:
authorMattias Nissler <mattias.nissler@gmx.de>2007-10-13 10:26:57 -0400
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:02:54 -0500
commit16b1951f53c6097d7355e76ed9ca64b056f88f31 (patch)
tree5f951e0d828a45d101b36c8bf0b2a57708de2ff9 /drivers/net/wireless/rt2x00/rt2x00config.c
parentddc827f93a2f2a7dcfda5b691d046af4dfe76427 (diff)
[PATCH] rt2x00: Fix antenna selection.
In the config() handler, make sure that we do configure an antenna if the current active antenna is uninitialized. Furthermore, don't overwrite the active antenna with bogus values if we didn't touch the antenna setup. Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00config.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 2b0edd20eea5..b4fad744503e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -166,6 +166,8 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
166 else if (conf->antenna_sel_rx && 166 else if (conf->antenna_sel_rx &&
167 conf->antenna_sel_rx != active_ant->rx) 167 conf->antenna_sel_rx != active_ant->rx)
168 flags |= CONFIG_UPDATE_ANTENNA; 168 flags |= CONFIG_UPDATE_ANTENNA;
169 else if (active_ant->rx == ANTENNA_SW_DIVERSITY)
170 flags |= CONFIG_UPDATE_ANTENNA;
169 171
170 if (!conf->antenna_sel_tx && 172 if (!conf->antenna_sel_tx &&
171 default_ant->tx != ANTENNA_SW_DIVERSITY && 173 default_ant->tx != ANTENNA_SW_DIVERSITY &&
@@ -174,6 +176,8 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
174 else if (conf->antenna_sel_tx && 176 else if (conf->antenna_sel_tx &&
175 conf->antenna_sel_tx != active_ant->tx) 177 conf->antenna_sel_tx != active_ant->tx)
176 flags |= CONFIG_UPDATE_ANTENNA; 178 flags |= CONFIG_UPDATE_ANTENNA;
179 else if (active_ant->tx == ANTENNA_SW_DIVERSITY)
180 flags |= CONFIG_UPDATE_ANTENNA;
177 181
178 /* 182 /*
179 * The following configuration options are never 183 * The following configuration options are never
@@ -262,11 +266,17 @@ config:
262 if (flags & (CONFIG_UPDATE_CHANNEL | CONFIG_UPDATE_ANTENNA)) 266 if (flags & (CONFIG_UPDATE_CHANNEL | CONFIG_UPDATE_ANTENNA))
263 rt2x00lib_reset_link_tuner(rt2x00dev); 267 rt2x00lib_reset_link_tuner(rt2x00dev);
264 268
265 rt2x00dev->curr_hwmode = libconf.phymode; 269 if (flags & CONFIG_UPDATE_PHYMODE) {
266 rt2x00dev->rx_status.phymode = conf->phymode; 270 rt2x00dev->curr_hwmode = libconf.phymode;
271 rt2x00dev->rx_status.phymode = conf->phymode;
272 }
273
267 rt2x00dev->rx_status.freq = conf->freq; 274 rt2x00dev->rx_status.freq = conf->freq;
268 rt2x00dev->rx_status.channel = conf->channel; 275 rt2x00dev->rx_status.channel = conf->channel;
269 rt2x00dev->tx_power = conf->power_level; 276 rt2x00dev->tx_power = conf->power_level;
270 rt2x00dev->link.ant.active.rx = libconf.ant.rx; 277
271 rt2x00dev->link.ant.active.tx = libconf.ant.tx; 278 if (flags & CONFIG_UPDATE_ANTENNA) {
279 rt2x00dev->link.ant.active.rx = libconf.ant.rx;
280 rt2x00dev->link.ant.active.tx = libconf.ant.tx;
281 }
272} 282}