Commit f06a0f48 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville

rt2x00: Reset antenna RSSI after switch

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: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2088d417
...@@ -328,6 +328,11 @@ static inline int rt2x00_get_link_ant_rssi(struct link *link) ...@@ -328,6 +328,11 @@ static inline int rt2x00_get_link_ant_rssi(struct link *link)
return DEFAULT_RSSI; 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, static inline int rt2x00_get_link_ant_rssi_history(struct link *link,
enum antenna ant) enum antenna ant)
{ {
......
...@@ -129,6 +129,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, ...@@ -129,6 +129,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
*/ */
rt2x00dev->ops->lib->config(rt2x00dev, &libconf, CONFIG_UPDATE_ANTENNA); rt2x00dev->ops->lib->config(rt2x00dev, &libconf, CONFIG_UPDATE_ANTENNA);
rt2x00lib_reset_link_tuner(rt2x00dev); rt2x00lib_reset_link_tuner(rt2x00dev);
rt2x00_reset_link_ant_rssi(&rt2x00dev->link);
rt2x00dev->link.ant.active.rx = libconf.ant.rx; rt2x00dev->link.ant.active.rx = libconf.ant.rx;
rt2x00dev->link.ant.active.tx = libconf.ant.tx; rt2x00dev->link.ant.active.tx = libconf.ant.tx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment