Search Linux Wireless

Re: [PATCH] rt2x00: synchronize transmission routines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A new version of this patch to synchronize transmission and receipt for each 
device, 

Jordi Pujol

Live never ending Tale
GNU/Linux Live forever!
http://livenet.selfip.com
 rt2x00: synchonize transmission_done routines by device

Signed-off-by: Jordi Pujol <jordipujolp AT gmail DOT com>

--- linux-2.6.37-old/drivers/net/wireless/rt2x00/rt2x00dev.c	2011-01-05 01:50:19.000000000 +0100
+++ linux-2.6.37/drivers/net/wireless/rt2x00/rt2x00dev.c	2011-02-13 18:03:30.324761189 +0100
@@ -271,6 +271,8 @@ void rt2x00lib_txdone(struct queue_entry
 	unsigned int i;
 	bool success;
 
+	mutex_lock(&rt2x00dev->txdone_mutex);
+
 	/*
 	 * Unmap the skb.
 	 */
@@ -415,6 +417,8 @@ void rt2x00lib_txdone(struct queue_entry
 	 */
 	if (!rt2x00queue_threshold(entry->queue))
 		ieee80211_wake_queue(rt2x00dev->hw, qid);
+
+	mutex_unlock(&rt2x00dev->txdone_mutex);
 }
 EXPORT_SYMBOL_GPL(rt2x00lib_txdone);
 
@@ -486,6 +490,8 @@ void rt2x00lib_rxdone(struct queue_entry
 	unsigned int header_length;
 	int rate_idx;
 
+	mutex_lock(&rt2x00dev->rxdone_mutex);
+
 	if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags))
 		goto submit_entry;
 
@@ -573,6 +579,8 @@ submit_entry:
 	rt2x00dev->ops->lib->clear_entry(entry);
 	rt2x00queue_index_inc(entry->queue, Q_INDEX);
 	rt2x00queue_index_inc(entry->queue, Q_INDEX_DONE);
+
+	mutex_unlock(&rt2x00dev->rxdone_mutex);
 }
 EXPORT_SYMBOL_GPL(rt2x00lib_rxdone);
 
@@ -972,6 +980,9 @@ int rt2x00lib_probe_dev(struct rt2x00_de
 
 	mutex_init(&rt2x00dev->csr_mutex);
 
+	mutex_init(&rt2x00dev->txdone_mutex);
+	mutex_init(&rt2x00dev->rxdone_mutex);
+
 	set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
 
 	/*
--- linux-2.6.37-old/drivers/net/wireless/rt2x00/rt2x00.h	2011-01-05 01:50:19.000000000 +0100
+++ linux-2.6.37/drivers/net/wireless/rt2x00/rt2x00.h	2011-02-13 18:02:02.480116433 +0100
@@ -908,6 +908,13 @@ struct rt2x00_dev {
 	 * Tasklet for processing tx status reports (rt2800pci).
 	 */
 	struct tasklet_struct txstatus_tasklet;
+
+	/*
+	 * Mutex to synchronize transmission.
+	 */
+	struct mutex txdone_mutex;
+	struct mutex rxdone_mutex;
+
 };
 
 /*

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux