Skip to contentSkip to conversation

rt2x00: Shortcut link state updates when not operating as STA

PATCH New Ivo van Doorn 1 participant 6 messages Oct 9, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 rt2x00: Shortcut link state updates when not operating as STA

From: Helmut Schaa <[email protected]>

---
 drivers/net/wireless/rt2x00/rt2x00link.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/net/wireless/rt2x00/rt2x00link.c +6 -0
index 4d534e9..46836f8 100644
@@ -236,6 +236,12 @@ void rt2x00link_update_stats(struct rt2x00_dev *rt2x00dev,
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 
 	/*
+	 * No need to update the stats for !=STA interfaces
+	 */
+	if (!rt2x00dev->intf_sta_count)
+		return;
+
+	/*
 	 * Frame was received successfully since non-succesfull
 	 * frames would have been dropped by the hardware.
 	 */
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 2/6 rt2x00: Optimize unmapping of skbs

From: Helmut Schaa <[email protected]>

Since no skb will be mapped for RX and TX at the same time we can simply shortcut the check for SKBDESC_DMA_MAPPED_TX.

---
 drivers/net/wireless/rt2x00/rt2x00queue.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2x00queue.c +1 -3
index 6d41599..4436ff7 100644
@@ -115,9 +115,7 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
 		dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, skb->len,
 				 DMA_FROM_DEVICE);
 		skbdesc->flags &= ~SKBDESC_DMA_MAPPED_RX;
-	}
-
-	if (skbdesc->flags & SKBDESC_DMA_MAPPED_TX) {
+	} else if (skbdesc->flags & SKBDESC_DMA_MAPPED_TX) {
 		dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, skb->len,
 				 DMA_TO_DEVICE);
 		skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX;
Signature · 1 line
1.7.2.3
#2 lore raw

PATCH 3/6 rt2x00: Use proper type for rxwi_w2 in rt2800_agc_to_rssi

From: Helmut Schaa <[email protected]>

---
 drivers/net/wireless/rt2x00/rt2800lib.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +1 -1
index 7f040b0..b9433fe 100644
@@ -499,7 +499,7 @@ void rt2800_write_tx_data(struct queue_entry *entry,
 }
 EXPORT_SYMBOL_GPL(rt2800_write_tx_data);
 
-static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxwi_w2)
+static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, u32 rxwi_w2)
 {
 	int rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0);
 	int rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1);
Signature · 1 line
1.7.2.3
#3 lore raw

PATCH 4/6 rt2x00: Use unlikely for error case in rt2x00queue_write_tx_frame

From: Helmut Schaa <[email protected]>

This is an error condition that is not supposed to happen. Hence, it is safe to add unlikely to this check.

---
 drivers/net/wireless/rt2x00/rt2x00queue.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00queue.c +2 -1
index 4436ff7..83630f1 100644
@@ -489,7 +489,8 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
 	if (unlikely(rt2x00queue_full(queue)))
 		return -ENOBUFS;
 
-	if (test_and_set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags)) {
+	if (unlikely(test_and_set_bit(ENTRY_OWNER_DEVICE_DATA,
+				      &entry->flags))) {
 		ERROR(queue->rt2x00dev,
 		      "Arrived at non-free entry in the non-full queue %d.\n"
 		      "Please file bug report to %s.\n",
Signature · 1 line
1.7.2.3
#4 lore raw

PATCH 5/6 rt2x00: Remove superfluous initialization of qidx

From: Helmut Schaa <[email protected]>

There is no need to initialize qidx to zero as it will ever be overwritten by the correct value.

---
 drivers/net/wireless/rt2x00/rt2800pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800pci.c +1 -1
index 85a134c..cc4e17c 100644
@@ -573,7 +573,7 @@ static void rt2800pci_kick_tx_queue(struct data_queue *queue)
 {
 	struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
 	struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX);
-	unsigned int qidx = 0;
+	unsigned int qidx;
 
 	if (queue->qid == QID_MGMT)
 		qidx = 5;
Signature · 1 line
1.7.2.3
#5 lore raw

PATCH 6/6 rt2x00: Fix tx status handling in rt2800pci

From: Helmut Schaa <[email protected]>

The patches "rt2x00: Improve TX status entry validation" and "rt2x00: rework tx status handling in rt2800pci" together were causing problems with tx status processing in rt2800pci:

phy1 -> rt2800pci_txdone: Warning - Got TX status for an empty queue 3, dropping phy1 -> rt2800pci_txdone: Warning - Got TX status for an unavailable queue 7, dropping

Fix this by using the correct field definition for getting the QID out of the tx status report.

---
 drivers/net/wireless/rt2x00/rt2800pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800pci.c +1 -1
index cc4e17c..b267395 100644
@@ -676,7 +676,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
 			break;
 		}
 
-		qid = rt2x00_get_field32(status, TX_STA_FIFO_PID_TYPE) - 1;
+		qid = rt2x00_get_field32(status, TX_STA_FIFO_PID_QUEUE);
 		if (qid >= QID_RX) {
 			/*
 			 * Unknown queue, this shouldn't happen. Just drop
Signature · 1 line
1.7.2.3