Skip to contentSkip to conversation

rt2x00: Don't count retries as failure

PATCH New Ivo van Doorn 1 participant 4 messages May 23, 2008 4 messages not in the archive Networking drivers (wireless)

lore
Share & tools
lore
#2 lore raw

PATCH 2/4 rt2x00: Don't count retries as failure

In reply to a message not in the archive

Link quality estimation became quite low for all rt2x00 drivers because the number of retries it took to send the frame were counted as failure.
This does not correspond to the legacy driver link quality calculation, by not counting it we will send somewhat more optimistic values to mac80211.

---
 drivers/net/wireless/rt2x00/rt2x00dev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00dev.c +1 -1
index 6553a3d..5645140 100644
@@ -507,7 +507,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,
 	rt2x00dev->link.qual.tx_success +=
 	    test_bit(TXDONE_SUCCESS, &txdesc->flags);
 	rt2x00dev->link.qual.tx_failed +=
-	    txdesc->retry + !!test_bit(TXDONE_FAILURE, &txdesc->flags);
+	    test_bit(TXDONE_FAILURE, &txdesc->flags);
 
 	/*
 	 * Initialize TX status
Signature · 1 line
1.5.5.1
#5 lore raw

PATCH 4/4 rt2x00: Use atomic interface iteration in irq context

In reply to a message not in the archive

rt2x00lib_beacondone() is called from interrupt context, this means we cannot use the mac80211 interface iterator that uses the rtnl lock (since that uses a mutex which can sleep). Instead we should use the atomic mac80211 interface iterator.

---
 drivers/net/wireless/rt2x00/rt2x00dev.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2x00dev.c +3 -3
index 5645140..669d942 100644
@@ -481,9 +481,9 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
 	if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
 		return;
 
-	ieee80211_iterate_active_interfaces(rt2x00dev->hw,
-					    rt2x00lib_beacondone_iter,
-					    rt2x00dev);
+	ieee80211_iterate_active_interfaces_atomic(rt2x00dev->hw,
+						   rt2x00lib_beacondone_iter,
+						   rt2x00dev);
 
 	queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work);
 }
Signature · 1 line
1.5.5.1
#6 lore raw

PATCH 3/4 rt2x00: Reset antenna RSSI after switch

In reply to a message not in the archive

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.

---
 drivers/net/wireless/rt2x00/rt2x00.h       |    5 +++++
 drivers/net/wireless/rt2x00/rt2x00config.c |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)
drivers/net/wireless/rt2x00/rt2x00.h +5 -0
index 41f352e..3b4944d 100644
@@ -328,6 +328,11 @@ static inline int rt2x00_get_link_ant_rssi(struct link *link)
 	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,
 						   enum antenna ant)
 {
drivers/net/wireless/rt2x00/rt2x00config.c +1 -0
index a9930a0..48608e8 100644
@@ -129,6 +129,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
 	 */
 	rt2x00dev->ops->lib->config(rt2x00dev, &libconf, CONFIG_UPDATE_ANTENNA);
 	rt2x00lib_reset_link_tuner(rt2x00dev);
+	rt2x00_reset_link_ant_rssi(&rt2x00dev->link);
 
 	rt2x00dev->link.ant.active.rx = libconf.ant.rx;
 	rt2x00dev->link.ant.active.tx = libconf.ant.tx;
Signature · 1 line
1.5.5.1
#7 lore raw

PATCH 1/4 rt2x00: Fix memleak in tx() path

In reply to a message not in the archive

When the tx() handler runs while the device has disapeared, we did return NETDEV_TX_OK but didn't free the skb.

---
 drivers/net/wireless/rt2x00/rt2x00mac.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/rt2x00/rt2x00mac.c +1 -0
index 2333b53..d068ea9 100644
@@ -114,6 +114,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 	 */
 	if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) {
 		ieee80211_stop_queues(hw);
+		dev_kfree_skb_any(skb);
 		return NETDEV_TX_OK;
 	}
 
Signature · 1 line
1.5.5.1