linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, rt2400-devel@lists.sourceforge.net
Subject: [PATCH 3/12] rt2x00: Increase rt2x00usb_vendor_request timeout.
Date: Tue, 25 Sep 2007 20:54:20 +0200	[thread overview]
Message-ID: <200709252054.20136.IvDoorn@gmail.com> (raw)
In-Reply-To: <200709252052.34803.IvDoorn@gmail.com>

By increasing the timeout for rt2x00usb_vendor_request,
we should limit the number of loops required to send
a signal to the device succefully.
500ms timeout is specified by the Ralink legacy drivers
for rt2500usb. For rt73usb 1000ms is specified, but that
includes the timeout for the firmware which is already
specified in a different define.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2x00usb.c |   10 ++++------
 drivers/net/wireless/rt2x00/rt2x00usb.h |    8 ++++----
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index a0f05ca..248144f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -42,7 +42,7 @@ int rt2x00usb_vendor_request(const struct rt2x00_dev *rt2x00dev,
 			     const u8 request, const u8 requesttype,
 			     const u16 offset, const u16 value,
 			     void *buffer, const u16 buffer_length,
-			     u16 timeout)
+			     const int timeout)
 {
 	struct usb_device *usb_dev =
 	    interface_to_usbdev(rt2x00dev_usb(rt2x00dev));
@@ -60,12 +60,10 @@ int rt2x00usb_vendor_request(const struct rt2x00_dev *rt2x00dev,
 			return 0;
 
 		/*
-		 * Check for errors,
-		 * -ETIMEDOUT: We need a bit more time to complete.
+		 * Check for errors
 		 * -ENODEV: Device has disappeared, no point continuing.
+		 * All other errors: Try again.
 		 */
-		if (status == -ETIMEDOUT)
-			timeout *= 2;
 		else if (status == -ENODEV)
 			break;
 	}
@@ -81,7 +79,7 @@ EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request);
 int rt2x00usb_vendor_request_buff(const struct rt2x00_dev *rt2x00dev,
 				  const u8 request, const u8 requesttype,
 				  const u16 offset, void *buffer,
-				  const u16 buffer_length, u16 timeout)
+				  const u16 buffer_length, const int timeout)
 {
 	int status;
 
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.h b/drivers/net/wireless/rt2x00/rt2x00usb.h
index d4113e5..2681abe 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.h
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.h
@@ -44,7 +44,7 @@
  */
 #define REGISTER_BUSY_COUNT		5
 #define REGISTER_BUSY_DELAY		100
-#define REGISTER_TIMEOUT		20
+#define REGISTER_TIMEOUT		500
 #define REGISTER_TIMEOUT_FIRMWARE	1000
 
 /*
@@ -95,7 +95,7 @@ int rt2x00usb_vendor_request(const struct rt2x00_dev *rt2x00dev,
 			     const u8 request, const u8 requesttype,
 			     const u16 offset, const u16 value,
 			     void *buffer, const u16 buffer_length,
-			     u16 timeout);
+			     const int timeout);
 
 /*
  * Used to read/write from/to the device.
@@ -110,7 +110,7 @@ int rt2x00usb_vendor_request(const struct rt2x00_dev *rt2x00dev,
 int rt2x00usb_vendor_request_buff(const struct rt2x00_dev *rt2x00dev,
 				  const u8 request, const u8 requesttype,
 				  const u16 offset, void *buffer,
-				  const u16 buffer_length, u16 timeout);
+				  const u16 buffer_length, const int timeout);
 
 /*
  * Simple wrapper around rt2x00usb_vendor_request to write a single
@@ -122,7 +122,7 @@ static inline int rt2x00usb_vendor_request_sw(const struct rt2x00_dev
 					      const u8 request,
 					      const u16 offset,
 					      const u16 value,
-					      int timeout)
+					      const int timeout)
 {
 	return rt2x00usb_vendor_request(rt2x00dev, request,
 					USB_VENDOR_REQUEST_OUT, offset,
-- 
1.5.3.2


  parent reply	other threads:[~2007-09-25 18:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-25 18:52 Please pull 'upstream' branch of rt2x00 Ivo van Doorn
2007-09-25 18:53 ` [PATCH 1/12] rt2x00: Correct error in calculating rssi for link tuner Ivo van Doorn
2007-09-25 18:53 ` [PATCH 2/12] rt2x00: Make *_beacon_update static Ivo van Doorn
2007-09-25 18:54 ` Ivo van Doorn [this message]
2007-09-25 18:54 ` [PATCH 4/12] rt2x00: Correctly identify rt2561turbo Ivo van Doorn
2007-09-25 18:55 ` [PATCH 5/12] rt2x00: adapt to filter configuration API Ivo van Doorn
2007-09-25 18:55 ` [PATCH 6/12] rt2x00: Reorganize rt2x00dev->flags Ivo van Doorn
2007-09-25 18:56 ` [PATCH 7/12] rt2x00: Add rt2x00dev->flags to debugfs Ivo van Doorn
2007-09-25 18:56 ` [PATCH 8/12] rt2x00: make rt2x00lib_stop_link_tuner() reentrant with link_tuner work Ivo van Doorn
2007-09-25 18:57 ` [PATCH 9/12] rt2x00: Stop link tuning when radio is down Ivo van Doorn
2007-09-25 18:57 ` [PATCH 10/12] rt2x00: Fix obvious typo in comment Ivo van Doorn
2007-09-25 18:57 ` [PATCH 11/12] rt2x00: Fix panic on rmmod with rfkill enabled Ivo van Doorn
2007-09-25 18:58 ` [PATCH 12/12] rt2x00: Release rt2x00 2.0.9 Ivo van Doorn

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=200709252054.20136.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rt2400-devel@lists.sourceforge.net \
    /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).