diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2007-09-25 14:54:20 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:02 -0400 |
commit | e9136550eb7d9409292a93e2d2265afa11bee234 (patch) | |
tree | e32841106d7bfefe1dd1d1e345546aa0d712b792 /drivers | |
parent | 2484591049ad1b92f585c1ff1c1d63f41e149faa (diff) |
[PATCH] rt2x00: Increase rt2x00usb_vendor_request timeout.
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 10 | ||||
-rw-r--r-- | 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 8d2081189025..66e47615f2a6 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, | |||
42 | const u8 request, const u8 requesttype, | 42 | const u8 request, const u8 requesttype, |
43 | const u16 offset, const u16 value, | 43 | const u16 offset, const u16 value, |
44 | void *buffer, const u16 buffer_length, | 44 | void *buffer, const u16 buffer_length, |
45 | u16 timeout) | 45 | const int timeout) |
46 | { | 46 | { |
47 | struct usb_device *usb_dev = | 47 | struct usb_device *usb_dev = |
48 | interface_to_usbdev(rt2x00dev_usb(rt2x00dev)); | 48 | interface_to_usbdev(rt2x00dev_usb(rt2x00dev)); |
@@ -60,12 +60,10 @@ int rt2x00usb_vendor_request(const struct rt2x00_dev *rt2x00dev, | |||
60 | return 0; | 60 | return 0; |
61 | 61 | ||
62 | /* | 62 | /* |
63 | * Check for errors, | 63 | * Check for errors |
64 | * -ETIMEDOUT: We need a bit more time to complete. | ||
65 | * -ENODEV: Device has disappeared, no point continuing. | 64 | * -ENODEV: Device has disappeared, no point continuing. |
65 | * All other errors: Try again. | ||
66 | */ | 66 | */ |
67 | if (status == -ETIMEDOUT) | ||
68 | timeout *= 2; | ||
69 | else if (status == -ENODEV) | 67 | else if (status == -ENODEV) |
70 | break; | 68 | break; |
71 | } | 69 | } |
@@ -81,7 +79,7 @@ EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request); | |||
81 | int rt2x00usb_vendor_request_buff(const struct rt2x00_dev *rt2x00dev, | 79 | int rt2x00usb_vendor_request_buff(const struct rt2x00_dev *rt2x00dev, |
82 | const u8 request, const u8 requesttype, | 80 | const u8 request, const u8 requesttype, |
83 | const u16 offset, void *buffer, | 81 | const u16 offset, void *buffer, |
84 | const u16 buffer_length, u16 timeout) | 82 | const u16 buffer_length, const int timeout) |
85 | { | 83 | { |
86 | int status; | 84 | int status; |
87 | 85 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.h b/drivers/net/wireless/rt2x00/rt2x00usb.h index d4113e5158f0..2681abe4d49e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.h +++ b/drivers/net/wireless/rt2x00/rt2x00usb.h | |||
@@ -44,7 +44,7 @@ | |||
44 | */ | 44 | */ |
45 | #define REGISTER_BUSY_COUNT 5 | 45 | #define REGISTER_BUSY_COUNT 5 |
46 | #define REGISTER_BUSY_DELAY 100 | 46 | #define REGISTER_BUSY_DELAY 100 |
47 | #define REGISTER_TIMEOUT 20 | 47 | #define REGISTER_TIMEOUT 500 |
48 | #define REGISTER_TIMEOUT_FIRMWARE 1000 | 48 | #define REGISTER_TIMEOUT_FIRMWARE 1000 |
49 | 49 | ||
50 | /* | 50 | /* |
@@ -95,7 +95,7 @@ int rt2x00usb_vendor_request(const struct rt2x00_dev *rt2x00dev, | |||
95 | const u8 request, const u8 requesttype, | 95 | const u8 request, const u8 requesttype, |
96 | const u16 offset, const u16 value, | 96 | const u16 offset, const u16 value, |
97 | void *buffer, const u16 buffer_length, | 97 | void *buffer, const u16 buffer_length, |
98 | u16 timeout); | 98 | const int timeout); |
99 | 99 | ||
100 | /* | 100 | /* |
101 | * Used to read/write from/to the device. | 101 | * Used to read/write from/to the device. |
@@ -110,7 +110,7 @@ int rt2x00usb_vendor_request(const struct rt2x00_dev *rt2x00dev, | |||
110 | int rt2x00usb_vendor_request_buff(const struct rt2x00_dev *rt2x00dev, | 110 | int rt2x00usb_vendor_request_buff(const struct rt2x00_dev *rt2x00dev, |
111 | const u8 request, const u8 requesttype, | 111 | const u8 request, const u8 requesttype, |
112 | const u16 offset, void *buffer, | 112 | const u16 offset, void *buffer, |
113 | const u16 buffer_length, u16 timeout); | 113 | const u16 buffer_length, const int timeout); |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Simple wrapper around rt2x00usb_vendor_request to write a single | 116 | * 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 | |||
122 | const u8 request, | 122 | const u8 request, |
123 | const u16 offset, | 123 | const u16 offset, |
124 | const u16 value, | 124 | const u16 value, |
125 | int timeout) | 125 | const int timeout) |
126 | { | 126 | { |
127 | return rt2x00usb_vendor_request(rt2x00dev, request, | 127 | return rt2x00usb_vendor_request(rt2x00dev, request, |
128 | USB_VENDOR_REQUEST_OUT, offset, | 128 | USB_VENDOR_REQUEST_OUT, offset, |