diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-11-13 23:07:33 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-25 16:41:34 -0500 |
commit | f1ca2167d89d991eed519c789d3902f9682c06b8 (patch) | |
tree | e170d7fe637f7a9ff552e694af6f409529865daa /drivers/net/wireless/rt2x00/rt2x00queue.h | |
parent | c8f96974eebbc8f078ad64f2d8041e6dce741d67 (diff) |
rt2x00: Detect USB BULK in/out endpoints
Instead of hardcoding the used in/out endpoints
we should detect them by walking through all
available endpoints.
rt2800usb will gain the most out of this, because
the legacy drivers indicate that there are multiple
endpoints available.
However this code might benefit at least rt73usb as
well for the MIMO queues, and if we are really lucky
rt2500usb will benefit because for the TX and PRIO
queues.
Even if rt2500usb and rt73usb do not get better performance
after this patch, the endpoint detection still belongs to
rt2x00usb, and it shouldn't hurt to always try to detect
the available endpoints.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index 4d3c7246f9ae..2e99ab53ec65 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h @@ -380,6 +380,8 @@ enum queue_index { * @cw_max: The cw max value for outgoing frames (field ignored in RX queue). * @data_size: Maximum data size for the frames in this queue. * @desc_size: Hardware descriptor size for the data in this queue. + * @usb_endpoint: Device endpoint used for communication (USB only) + * @usb_maxpacket: Max packet size for given endpoint (USB only) */ struct data_queue { struct rt2x00_dev *rt2x00dev; @@ -401,6 +403,9 @@ struct data_queue { unsigned short data_size; unsigned short desc_size; + + unsigned short usb_endpoint; + unsigned short usb_maxpacket; }; /** @@ -444,6 +449,19 @@ struct data_queue_desc { &(__dev)->tx[(__dev)->ops->tx_queues] /** + * queue_next - Return pointer to next queue in list (HELPER MACRO). + * @__queue: Current queue for which we need the next queue + * + * Using the current queue address we take the address directly + * after the queue to take the next queue. Note that this macro + * should be used carefully since it does not protect against + * moving past the end of the list. (See macros &queue_end and + * &tx_queue_end for determining the end of the queue). + */ +#define queue_next(__queue) \ + &(__queue)[1] + +/** * queue_loop - Loop through the queues within a specific range (HELPER MACRO). * @__entry: Pointer where the current queue entry will be stored in. * @__start: Start queue pointer. @@ -453,8 +471,8 @@ struct data_queue_desc { */ #define queue_loop(__entry, __start, __end) \ for ((__entry) = (__start); \ - prefetch(&(__entry)[1]), (__entry) != (__end); \ - (__entry) = &(__entry)[1]) + prefetch(queue_next(__entry)), (__entry) != (__end);\ + (__entry) = queue_next(__entry)) /** * queue_for_each - Loop through all queues |