diff mbox

[3/5] usb: usbnet: Allow drivers using usbnet to specify maximum packet size

Message ID 1329317261-3406-4-git-send-email-toby.gray@realvnc.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Toby Gray Feb. 15, 2012, 2:47 p.m. UTC
The usbnet driver always attempts to set dev->maxpacket from the out
endpoint. For this to function correctly it relies on the alternate
setting containg the bulk out endpoint to be selected. This isn't
necessarily always the case.

This change allows drivers that make use of usbnet to specify the
value for dev->maxpacket themselves.

Signed-off-by: Toby Gray <toby.gray@realvnc.com>
---
 drivers/net/usb/usbnet.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Oliver Neukum Feb. 15, 2012, 7:35 p.m. UTC | #1
Am Mittwoch, 15. Februar 2012, 15:47:39 schrieb Toby Gray:
> The usbnet driver always attempts to set dev->maxpacket from the out
> endpoint. For this to function correctly it relies on the alternate
> setting containg the bulk out endpoint to be selected. This isn't
> necessarily always the case.
> 
> This change allows drivers that make use of usbnet to specify the
> value for dev->maxpacket themselves.
> 
> Signed-off-by: Toby Gray <toby.gray@realvnc.com>
Acked-by: Oliver Neukum <oliver@neukum.org>

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index fae0fbd..4ccd316 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1425,7 +1425,8 @@  usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 
 	if (!dev->rx_urb_size)
 		dev->rx_urb_size = dev->hard_mtu;
-	dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
+	if (!dev->maxpacket)
+		dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1);
 
 	if ((dev->driver_info->flags & FLAG_WLAN) != 0)
 		SET_NETDEV_DEVTYPE(net, &wlan_type);