summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/rt2x00/rt2x00dev.c
diff options
context:
space:
mode:
authorMattias Nissler <mattias.nissler@gmx.de>2007-11-27 23:50:26 +0300
committerDavid S. Miller <davem@davemloft.net>2008-01-29 02:05:09 +0300
commit61af43c56bef2cfcb8f1d9aab4e766e0f7bdd893 (patch)
treee6f4ab65e7d88fdbd9fa30c6e5c92c48b9fb6d27 /drivers/net/wireless/rt2x00/rt2x00dev.c
parentd28c2561fb09dcc0b47ae0ba12083cf0d988495f (diff)
downloadlinux-61af43c56bef2cfcb8f1d9aab4e766e0f7bdd893.tar.xz
rt2x00: Only update rssi average approximation on receiving beacon frames.
Restrict rssi average updating to beacon frames of the bssid the interface is associated with. Without this restriction, strong signals belonging to other BSS, e.g. beacon frames coming from a nearby AP, would cause incorrectly high rssi approximation values. This would then cause the link tuner to reduce sensitivity, resulting in transmissions from the BSS associated to to be missed. 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>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00dev.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index bd7b73824d0f..a771a092434b 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -526,11 +526,14 @@ void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb,
struct rxdata_entry_desc *desc)
{
struct rt2x00_dev *rt2x00dev = entry->ring->rt2x00dev;
+ struct interface *intf = &rt2x00dev->interface;
struct ieee80211_rx_status *rx_status = &rt2x00dev->rx_status;
struct ieee80211_hw_mode *mode;
struct ieee80211_rate *rate;
+ struct ieee80211_hdr *hdr;
unsigned int i;
int val = 0;
+ u16 fc;
/*
* Update RX statistics.
@@ -555,7 +558,21 @@ void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb,
}
}
- rt2x00lib_update_link_stats(&rt2x00dev->link, desc->rssi);
+ /*
+ * Only update link status if this is a beacon frame carrying our
+ * bssid.
+ */
+ hdr = (struct ieee80211_hdr *) skb->data;
+ if (skb->len >= sizeof(struct ieee80211_hdr *)) {
+ fc = le16_to_cpu(hdr->frame_control);
+ if ((intf->type == IEEE80211_IF_TYPE_STA
+ || intf->type == IEEE80211_IF_TYPE_IBSS)
+ && is_beacon(fc)
+ && compare_ether_addr(hdr->addr3, intf->bssid) == 0)
+ rt2x00lib_update_link_stats(&rt2x00dev->link,
+ desc->rssi);
+ }
+
rt2x00dev->link.qual.rx_success++;
rx_status->rate = val;