linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jordi Pujol <jordipujolp@gmail.com>
To: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] rt2x00: synchronize transmission routines
Date: Mon, 14 Feb 2011 09:43:13 +0100	[thread overview]
Message-ID: <201102140943.13801.jordipujolp@gmail.com> (raw)
In-Reply-To: <201102131531.29984.jordipujolp@gmail.com>

[-- Attachment #1: Type: Text/Plain, Size: 174 bytes --]

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

[-- Attachment #2: rt2x00_dev_transmission_done_synchronize.patch --]
[-- Type: text/x-patch, Size: 1911 bytes --]

 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;
+
 };
 
 /*

  reply	other threads:[~2011-02-14  8:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13 14:31 [PATCH] rt2x00: synchronize transmission routines Jordi Pujol
2011-02-14  8:43 ` Jordi Pujol [this message]
2011-02-14  8:51   ` Ivo Van Doorn
2011-02-14  9:47     ` Jordi Pujol
2011-02-14  9:54       ` Ivo Van Doorn
2011-02-14 10:57         ` Jordi Pujol
2011-02-14 11:44           ` Ivo Van Doorn
2011-02-14 13:20           ` Jordi Pujol

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102140943.13801.jordipujolp@gmail.com \
    --to=jordipujolp@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).