Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79036
b: refs/heads/master
c: 61af43c
h: refs/heads/master
v: v3
  • Loading branch information
Mattias Nissler authored and David S. Miller committed Jan 28, 2008
1 parent 4185f3c commit 3e83f7f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d28c2561fb09dcc0b47ae0ba12083cf0d988495f
refs/heads/master: 61af43c56bef2cfcb8f1d9aab4e766e0f7bdd893
7 changes: 7 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/workqueue.h>
#include <linux/firmware.h>
#include <linux/mutex.h>
#include <linux/etherdevice.h>

#include <net/mac80211.h>

Expand Down Expand Up @@ -149,6 +150,12 @@ static inline int is_probe_resp(u16 fc)
((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP));
}

static inline int is_beacon(u16 fc)
{
return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON));
}

/*
* Chipset identification
* The chipset on the device is composed of a RT and RF chip.
Expand Down
19 changes: 18 additions & 1 deletion trunk/drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down

0 comments on commit 3e83f7f

Please sign in to comment.