aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-01-06 17:41:28 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:27 -0500
commit7e56d38d5d0bda89228821902af297a46b5fdb80 (patch)
treefadf90d9fdb96f00c1780e3dceed824435e51abf
parentdd3193e1c25ffbc66b684edb52273ae10695909d (diff)
rt2x00: Determine MY_BSS from descriptor
Use the MY_BSS descriptor field to determine if the received frame belongs to the same BSS as the interface. This can be used by rxdone to determine if the frame should be updated or not. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c3
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c18
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00ring.h1
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c3
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c3
7 files changed, 11 insertions, 19 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index ffc7e208f9b2..95db2ccbc9a6 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1117,6 +1117,7 @@ static void rt2400pci_fill_rxdone(struct data_entry *entry,
1117 entry->ring->rt2x00dev->rssi_offset; 1117 entry->ring->rt2x00dev->rssi_offset;
1118 desc->ofdm = 0; 1118 desc->ofdm = 0;
1119 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); 1119 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
1120 desc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
1120} 1121}
1121 1122
1122/* 1123/*
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 81a48e88f2a0..133967e81f6f 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1264,6 +1264,7 @@ static void rt2500pci_fill_rxdone(struct data_entry *entry,
1264 entry->ring->rt2x00dev->rssi_offset; 1264 entry->ring->rt2x00dev->rssi_offset;
1265 desc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); 1265 desc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
1266 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); 1266 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
1267 desc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
1267} 1268}
1268 1269
1269/* 1270/*
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 86eefb453606..86549d5b64b3 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1138,8 +1138,7 @@ static void rt2500usb_fill_rxdone(struct data_entry *entry,
1138 entry->ring->rt2x00dev->rssi_offset; 1138 entry->ring->rt2x00dev->rssi_offset;
1139 desc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); 1139 desc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
1140 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); 1140 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
1141 1141 desc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
1142 return;
1143} 1142}
1144 1143
1145/* 1144/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index a95cf531f083..a11421274f79 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -526,7 +526,6 @@ void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb,
526 struct rxdata_entry_desc *desc) 526 struct rxdata_entry_desc *desc)
527{ 527{
528 struct rt2x00_dev *rt2x00dev = entry->ring->rt2x00dev; 528 struct rt2x00_dev *rt2x00dev = entry->ring->rt2x00dev;
529 struct interface *intf = &rt2x00dev->interface;
530 struct ieee80211_rx_status *rx_status = &rt2x00dev->rx_status; 529 struct ieee80211_rx_status *rx_status = &rt2x00dev->rx_status;
531 struct ieee80211_hw_mode *mode; 530 struct ieee80211_hw_mode *mode;
532 struct ieee80211_rate *rate; 531 struct ieee80211_rate *rate;
@@ -559,19 +558,12 @@ void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb,
559 } 558 }
560 559
561 /* 560 /*
562 * Only update link status if this is a beacon frame carrying our 561 * Only update link status if this is a beacon frame carrying our bssid.
563 * bssid.
564 */ 562 */
565 hdr = (struct ieee80211_hdr *) skb->data; 563 hdr = (struct ieee80211_hdr*)skb->data;
566 if (skb->len >= sizeof(struct ieee80211_hdr *)) { 564 fc = le16_to_cpu(hdr->frame_control);
567 fc = le16_to_cpu(hdr->frame_control); 565 if (is_beacon(fc) && desc->my_bss)
568 if ((intf->type == IEEE80211_IF_TYPE_STA 566 rt2x00lib_update_link_stats(&rt2x00dev->link, desc->rssi);
569 || intf->type == IEEE80211_IF_TYPE_IBSS)
570 && is_beacon(fc)
571 && compare_ether_addr(hdr->addr3, intf->bssid) == 0)
572 rt2x00lib_update_link_stats(&rt2x00dev->link,
573 desc->rssi);
574 }
575 567
576 rt2x00dev->link.qual.rx_success++; 568 rt2x00dev->link.qual.rx_success++;
577 569
diff --git a/drivers/net/wireless/rt2x00/rt2x00ring.h b/drivers/net/wireless/rt2x00/rt2x00ring.h
index e9a564863127..1caa6d688c40 100644
--- a/drivers/net/wireless/rt2x00/rt2x00ring.h
+++ b/drivers/net/wireless/rt2x00/rt2x00ring.h
@@ -59,6 +59,7 @@ struct rxdata_entry_desc {
59 int ofdm; 59 int ofdm;
60 int size; 60 int size;
61 int flags; 61 int flags;
62 int my_bss;
62}; 63};
63 64
64/* 65/*
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 35e7607cf164..eb8102486b5b 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1695,8 +1695,7 @@ static void rt61pci_fill_rxdone(struct data_entry *entry,
1695 desc->rssi = rt61pci_agc_to_rssi(entry->ring->rt2x00dev, word1); 1695 desc->rssi = rt61pci_agc_to_rssi(entry->ring->rt2x00dev, word1);
1696 desc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); 1696 desc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
1697 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); 1697 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
1698 1698 desc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
1699 return;
1700} 1699}
1701 1700
1702/* 1701/*
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 29824701e703..beaa264f6af7 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1396,13 +1396,12 @@ static void rt73usb_fill_rxdone(struct data_entry *entry,
1396 desc->rssi = rt73usb_agc_to_rssi(entry->ring->rt2x00dev, word1); 1396 desc->rssi = rt73usb_agc_to_rssi(entry->ring->rt2x00dev, word1);
1397 desc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); 1397 desc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
1398 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); 1398 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
1399 desc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
1399 1400
1400 /* 1401 /*
1401 * Pull the skb to clear the descriptor area. 1402 * Pull the skb to clear the descriptor area.
1402 */ 1403 */
1403 skb_pull(entry->skb, entry->ring->desc_size); 1404 skb_pull(entry->skb, entry->ring->desc_size);
1404
1405 return;
1406} 1405}
1407 1406
1408/* 1407/*