diff options
author | Jean-Christophe Dubois <jcd@tribudubois.net> | 2008-03-13 18:56:36 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-17 08:06:37 -0400 |
commit | 10d0f27c1baa4a094b4965708a15f2b0c4d65f5e (patch) | |
tree | 7ebabe73326eba396345d843f1d778bf84d0dc17 /drivers/net/usb | |
parent | 4373c9327f10c362f13d5b78557f93a471211a42 (diff) |
rndis_host: fix transfer size negotiation
This patch should resolve a problem that's troubled support for
some RNDIS peripherals. It seems to have boiled down to using a
variable to establish transfer size limits before it was assigned,
which caused those devices to fallback to a default "jumbogram"
mode we don't support. Fix by assigning it earlier for RNDIS.
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
[ cleanups ]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/rndis_host.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index a61324757b17..727547a28992 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -16,10 +16,6 @@ | |||
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | |||
20 | // #define DEBUG // error path messages, extra info | ||
21 | // #define VERBOSE // more; success messages | ||
22 | |||
23 | #include <linux/module.h> | 19 | #include <linux/module.h> |
24 | #include <linux/init.h> | 20 | #include <linux/init.h> |
25 | #include <linux/netdevice.h> | 21 | #include <linux/netdevice.h> |
@@ -318,6 +314,14 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
318 | net->hard_header_len += sizeof (struct rndis_data_hdr); | 314 | net->hard_header_len += sizeof (struct rndis_data_hdr); |
319 | dev->hard_mtu = net->mtu + net->hard_header_len; | 315 | dev->hard_mtu = net->mtu + net->hard_header_len; |
320 | 316 | ||
317 | dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1); | ||
318 | if (dev->maxpacket == 0) { | ||
319 | if (netif_msg_probe(dev)) | ||
320 | dev_dbg(&intf->dev, "dev->maxpacket can't be 0\n"); | ||
321 | retval = -EINVAL; | ||
322 | goto fail_and_release; | ||
323 | } | ||
324 | |||
321 | dev->rx_urb_size = dev->hard_mtu + (dev->maxpacket + 1); | 325 | dev->rx_urb_size = dev->hard_mtu + (dev->maxpacket + 1); |
322 | dev->rx_urb_size &= ~(dev->maxpacket - 1); | 326 | dev->rx_urb_size &= ~(dev->maxpacket - 1); |
323 | u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size); | 327 | u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size); |