diff options
author | Adam Baker <linux@baker-net.org.uk> | 2007-10-27 07:43:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:03:03 -0500 |
commit | 3d82346c5d0ff0a413c387c6edaadc0ca29a0971 (patch) | |
tree | 790b3fcc6ccee693d9ac343626d1296c736a7851 /drivers/net/wireless/rt2x00/rt2x00usb.h | |
parent | 4bd7c452a468af30bb3c4d9c3adcdaf3f3c6048c (diff) |
rt2x00: Place mutex around USB register access
There is a buffer, csr_cache which is used to hold copies of data being passed
to the USB stack which can get corrupted if multiple threads attempt to access
CSR registers simultaneously. There is also the possibility if multiple
threads try to access BBP or RF registers for the multiple USB operations
needed to get interleaved leading to incorrect results. This patch introduces
a mutex to prevent such simultaneous access. The interleaved access problem
may also affect the PCI devices but if so that will be handled in a follow-up
patch.
Signed-off-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.h b/drivers/net/wireless/rt2x00/rt2x00usb.h index 53282b036927..2fa45c57a73f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.h +++ b/drivers/net/wireless/rt2x00/rt2x00usb.h | |||
@@ -113,6 +113,14 @@ int rt2x00usb_vendor_request_buff(struct rt2x00_dev *rt2x00dev, | |||
113 | const u16 buffer_length, const int timeout); | 113 | const u16 buffer_length, const int timeout); |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * A version of rt2x00usb_vendor_request_buff which must be called | ||
117 | * if the usb_cache_mutex is already held. */ | ||
118 | int rt2x00usb_vendor_req_buff_lock(struct rt2x00_dev *rt2x00dev, | ||
119 | const u8 request, const u8 requesttype, | ||
120 | const u16 offset, void *buffer, | ||
121 | const u16 buffer_length, const int timeout); | ||
122 | |||
123 | /* | ||
116 | * Simple wrapper around rt2x00usb_vendor_request to write a single | 124 | * Simple wrapper around rt2x00usb_vendor_request to write a single |
117 | * command to the device. Since we don't use the buffer argument we | 125 | * command to the device. Since we don't use the buffer argument we |
118 | * don't have to worry about kmalloc here. | 126 | * don't have to worry about kmalloc here. |