rt2x00: Reset antenna RSSI after switch
authorIvo van Doorn <ivdoorn@gmail.com>
Fri, 23 May 2008 16:13:56 +0000 (18:13 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 28 May 2008 20:43:45 +0000 (16:43 -0400)
When the antenna configuration has changed we should reset
the antenna RSSI value. Otherwise the value will be influenced
by the previous configuration quality which in turn will affect
the antenna diversity.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00config.c

index 57bdc153952f6709493a4eff14d20802db79066f..611d98320593869dc9c26faf2c64218c8c32e3ec 100644 (file)
@@ -328,6 +328,11 @@ static inline int rt2x00_get_link_ant_rssi(struct link *link)
        return DEFAULT_RSSI;
 }
 
+static inline void rt2x00_reset_link_ant_rssi(struct link *link)
+{
+       link->ant.rssi_ant = 0;
+}
+
 static inline int rt2x00_get_link_ant_rssi_history(struct link *link,
                                                   enum antenna ant)
 {
index a9930a03f450636e0cdc47e9098313fc171819ea..48608e8cc8b4a50ef01a559314e4375e7214c946 100644 (file)
@@ -129,6 +129,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
         */
        rt2x00dev->ops->lib->config(rt2x00dev, &libconf, CONFIG_UPDATE_ANTENNA);
        rt2x00lib_reset_link_tuner(rt2x00dev);
+       rt2x00_reset_link_ant_rssi(&rt2x00dev->link);
 
        rt2x00dev->link.ant.active.rx = libconf.ant.rx;
        rt2x00dev->link.ant.active.tx = libconf.ant.tx;