aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-11-13 17:07:33 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-11-25 16:41:34 -0500
commitf1ca2167d89d991eed519c789d3902f9682c06b8 (patch)
treee170d7fe637f7a9ff552e694af6f409529865daa /drivers/net/wireless/rt2x00/rt2500usb.c
parentc8f96974eebbc8f078ad64f2d8041e6dce741d67 (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/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 40eb64358821..0447e93306ad 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1108,7 +1108,7 @@ static void rt2500usb_write_beacon(struct queue_entry *entry)
1108 struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); 1108 struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev);
1109 struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data; 1109 struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data;
1110 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); 1110 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
1111 int pipe = usb_sndbulkpipe(usb_dev, 1); 1111 int pipe = usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint);
1112 int length; 1112 int length;
1113 u16 reg; 1113 u16 reg;
1114 1114
@@ -1134,7 +1134,7 @@ static void rt2500usb_write_beacon(struct queue_entry *entry)
1134 * length of the data to usb_fill_bulk_urb. Pass the skb 1134 * length of the data to usb_fill_bulk_urb. Pass the skb
1135 * to the driver to determine what the length should be. 1135 * to the driver to determine what the length should be.
1136 */ 1136 */
1137 length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev, entry->skb); 1137 length = rt2x00dev->ops->lib->get_tx_data_len(entry);
1138 1138
1139 usb_fill_bulk_urb(bcn_priv->urb, usb_dev, pipe, 1139 usb_fill_bulk_urb(bcn_priv->urb, usb_dev, pipe,
1140 entry->skb->data, length, rt2500usb_beacondone, 1140 entry->skb->data, length, rt2500usb_beacondone,
@@ -1156,8 +1156,7 @@ static void rt2500usb_write_beacon(struct queue_entry *entry)
1156 usb_submit_urb(bcn_priv->guardian_urb, GFP_ATOMIC); 1156 usb_submit_urb(bcn_priv->guardian_urb, GFP_ATOMIC);
1157} 1157}
1158 1158
1159static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev, 1159static int rt2500usb_get_tx_data_len(struct queue_entry *entry)
1160 struct sk_buff *skb)
1161{ 1160{
1162 int length; 1161 int length;
1163 1162
@@ -1165,8 +1164,8 @@ static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
1165 * The length _must_ be a multiple of 2, 1164 * The length _must_ be a multiple of 2,
1166 * but it must _not_ be a multiple of the USB packet size. 1165 * but it must _not_ be a multiple of the USB packet size.
1167 */ 1166 */
1168 length = roundup(skb->len, 2); 1167 length = roundup(entry->skb->len, 2);
1169 length += (2 * !(length % rt2x00dev->usb_maxpacket)); 1168 length += (2 * !(length % entry->queue->usb_maxpacket));
1170 1169
1171 return length; 1170 return length;
1172} 1171}