aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/rndis_host.c
diff options
context:
space:
mode:
authorThomas Sailer <t.sailer@alumni.ethz.ch>2007-10-23 18:47:19 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-25 03:34:59 -0400
commit500d2c2f7b8c1cf6194dc9e8f47c6e2295fc5be5 (patch)
treeb35d2b2243f78e944848d5853d51d8530b6e6fad /drivers/net/usb/rndis_host.c
parentb88219f8a2028a1ca2dd17aa7c9d9b643615646e (diff)
rndis_host: reduce MTU instead of refusing to talk to devices with low max packet size
This patch makes the host RNDIS driver talk to RNDIS devices with an MTU less than 1.5k, instead of refusing to talk to such a device. Signed-Off-by: Thomas Sailer <t.sailer@alumni.ethz.ch> Acked-by: David Brownell <dbrownell@users.sourceforge.net> -- Hi Jeff, are you the right person to send this to? Nobody else seems to be wanting to forward this to Linus... Thanks, Tom Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/usb/rndis_host.c')
-rw-r--r--drivers/net/usb/rndis_host.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index cd991a0f75bb..1ebe3259be0d 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -512,11 +512,19 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
512 } 512 }
513 tmp = le32_to_cpu(u.init_c->max_transfer_size); 513 tmp = le32_to_cpu(u.init_c->max_transfer_size);
514 if (tmp < dev->hard_mtu) { 514 if (tmp < dev->hard_mtu) {
515 dev_err(&intf->dev, 515 if (tmp <= net->hard_header_len) {
516 "dev can't take %u byte packets (max %u)\n", 516 dev_err(&intf->dev,
517 dev->hard_mtu, tmp); 517 "dev can't take %u byte packets (max %u)\n",
518 retval = -EINVAL; 518 dev->hard_mtu, tmp);
519 goto fail_and_release; 519 retval = -EINVAL;
520 goto fail_and_release;
521 }
522 dev->hard_mtu = tmp;
523 net->mtu = dev->hard_mtu - net->hard_header_len;
524 dev_warn(&intf->dev,
525 "dev can't take %u byte packets (max %u), "
526 "adjusting MTU to %u\n",
527 dev->hard_mtu, tmp, net->mtu);
520 } 528 }
521 529
522 /* REVISIT: peripheral "alignment" request is ignored ... */ 530 /* REVISIT: peripheral "alignment" request is ignored ... */