public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Sailer <sailer@ife.ee.ethz.ch>
To: netdev@vger.kernel.org
Cc: David Brownell <david-b@pacbell.net>,
	greg@kroah.com, linux-usb-devel@lists.sourceforge.net
Subject: Re: [RESEND]: RNDIS host: adjust MTU instead of refusing to talk	to devices with MTU < 1.5k
Date: Tue, 09 Oct 2007 17:39:44 +0200	[thread overview]
Message-ID: <1191944384.10858.89.camel@xbox360> (raw)
In-Reply-To: <20071009151832.9B5FF1ACD0D@adsl-69-226-248-13.dsl.pltn13.pacbell.net>

On Tue, 2007-10-09 at 08:18 -0700, David Brownell wrote:

> > 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 <t.sailer@alumni.ethz.ch>
> 
> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
> 
> ... 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.

Ok, next try.

The device in question is a low power radio device that speaks the
bpqether protocol over ethernet. bpqether frames are never longer than
320 bytes, so there is no need to support 1.5kbyte MTU in the device
firmware.

Tom

Signed-Off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>

--- 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/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

           reply	other threads:[~2007-10-09 15:39 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20071009151832.9B5FF1ACD0D@adsl-69-226-248-13.dsl.pltn13.pacbell.net>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1191944384.10858.89.camel@xbox360 \
    --to=sailer@ife.ee.ethz.ch \
    --cc=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox