diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2011-06-20 07:42:44 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-22 16:09:46 -0400 |
commit | c900eff30a14ecf209ee7a17a7c3c54890694ce6 (patch) | |
tree | a408e64682e04326bcb334409e0f1130f8222cde /drivers/net/wireless/zd1211rw/zd_usb.h | |
parent | f762d8c3f8b502b93d20bd755fc30ce99d3d0abd (diff) |
zd1211rw: handle lost read-reg interrupts
Device losses read-reg interrupts. By looking at usbmon it appears that
USB_INT_ID_RETRY_FAILED can override USB_INT_ID_REGS. This causes read
command to timeout, usually under heavy TX.
Fix by retrying read registers again if USB_INT_ID_RETRY_FAILED is received
while waiting for USB_INT_ID_REGS.
However USB_INT_ID_REGS is not always lost but is received after
USB_INT_ID_RETRY_FAILED and is usually received by the retried read
command. USB_INT_ID_REGS of the retry is then left unhandled and might
be received by next read command. Handle this by ignoring previous
USB_INT_ID_REGS that doesn't match current read command request.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_usb.h')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h index bf942843b73..99193b456a7 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.h +++ b/drivers/net/wireless/zd1211rw/zd_usb.h | |||
@@ -144,6 +144,8 @@ struct usb_int_retry_fail { | |||
144 | 144 | ||
145 | struct read_regs_int { | 145 | struct read_regs_int { |
146 | struct completion completion; | 146 | struct completion completion; |
147 | struct usb_req_read_regs *req; | ||
148 | unsigned int req_count; | ||
147 | /* Stores the USB int structure and contains the USB address of the | 149 | /* Stores the USB int structure and contains the USB address of the |
148 | * first requested register before request. | 150 | * first requested register before request. |
149 | */ | 151 | */ |
@@ -169,7 +171,8 @@ struct zd_usb_interrupt { | |||
169 | void *buffer; | 171 | void *buffer; |
170 | dma_addr_t buffer_dma; | 172 | dma_addr_t buffer_dma; |
171 | int interval; | 173 | int interval; |
172 | u8 read_regs_enabled:1; | 174 | atomic_t read_regs_enabled; |
175 | u8 read_regs_int_overridden:1; | ||
173 | }; | 176 | }; |
174 | 177 | ||
175 | static inline struct usb_int_regs *get_read_regs(struct zd_usb_interrupt *intr) | 178 | static inline struct usb_int_regs *get_read_regs(struct zd_usb_interrupt *intr) |