Re: [RESEND]: RNDIS host: adjust MTU instead of refusing to talk to devices with MTU < 1.5k
David Brownell <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <20071009151832.9B5FF1ACD0D@adsl-69-226-248-13.dsl.pltn13.pacbell.net> |
> From [email protected] Tue Oct 9 05:26:54 2007 > From: Thomas Sailer <[email protected]> > To: [email protected] > Date: Tue, 09 Oct 2007 14:23:29 +0200 > Cc: David Brownell <[email protected]>, Greg KH <[email protected]> > Subject: [linux-usb-devel] [RESEND]: RNDIS host: adjust MTU instead of > refusing to talk to devices with MTU < 1.5k > > 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. > Please apply. > > Signed-Off-by: Thomas Sailer <[email protected]> Acked-by: David Brownell <[email protected]> ... but patches in drivers/net go to netdev, not linux-usb-devel. And it'd be nice if the patch comment mentioned some particular device that's been observed to act this way. > --- 1/drivers/net/usb/rndis_host.c.orig 2007-09-04 17:51:11.000000000 +0200 > +++ 2/drivers/net/usb/rndis_host.c 2007-09-04 17:54:26.000000000 +0200 > @@ -512,11 +512,18 @@ > } > tmp = le32_to_cpu(u.init_c->max_transfer_size); > if (tmp < dev->hard_mtu) { > - dev_err(&intf->dev, > - "dev can't take %u byte packets (max %u)\n", > - dev->hard_mtu, tmp); > - retval = -EINVAL; > - goto fail_and_release; > + if (tmp <= net->hard_header_len) { > + dev_warn(&intf->dev, > + "dev can't take %u byte packets (max %u)\n", > + net->hard_header_len+1, tmp); > + retval = -EINVAL; > + goto fail_and_release; > + } > + dev->hard_mtu = tmp; > + net->mtu = dev->hard_mtu - net->hard_header_len; > + dev_warn(&intf->dev, > + "dev can't take %u byte packets (max %u), adjusting MTU to %u\n", > + dev->hard_mtu, tmp, net->mtu); > } > > /* REVISIT: peripheral "alignment" request is ignored ... */ > > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel