netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2.6.25-rc2-git] rndis_host:  fix transfer size negotiation
@ 2008-02-23  1:31 David Brownell
  2008-02-25 18:29 ` John W. Linville
  0 siblings, 1 reply; 5+ messages in thread
From: David Brownell @ 2008-02-23  1:31 UTC (permalink / raw)
  To: Network development list; +Cc: Jean-Christophe Dubois

From: Jean-Christophe Dubois <jcd@tribudubois.net>

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>
---
This bugfix should be merged before 2.6.25-final.

 drivers/net/usb/rndis_host.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

--- g26.orig/drivers/net/usb/rndis_host.c	2008-02-01 22:24:38.000000000 -0800
+++ g26/drivers/net/usb/rndis_host.c	2008-02-16 12:55:35.000000000 -0800
@@ -16,10 +16,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-
-// #define	DEBUG			// error path messages, extra info
-// #define	VERBOSE			// more; success messages
-
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/netdevice.h>
@@ -318,6 +314,14 @@ generic_rndis_bind(struct usbnet *dev, s
 	net->hard_header_len += sizeof (struct rndis_data_hdr);
 	dev->hard_mtu = net->mtu + net->hard_header_len;
 
+	dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1);
+	if (dev->maxpacket == 0) {
+		if (netif_msg_probe(dev))
+			dev_dbg(&intf->dev, "dev->maxpacket can't be 0\n");
+		retval = -EINVAL;
+		goto fail_and_release;
+	}
+
 	dev->rx_urb_size = dev->hard_mtu + (dev->maxpacket + 1);
 	dev->rx_urb_size &= ~(dev->maxpacket - 1);
 	u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 2.6.25-rc2-git] rndis_host:  fix transfer size negotiation
  2008-02-23  1:31 [patch 2.6.25-rc2-git] rndis_host: fix transfer size negotiation David Brownell
@ 2008-02-25 18:29 ` John W. Linville
  2008-02-25 18:37   ` Johannes Berg
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: John W. Linville @ 2008-02-25 18:29 UTC (permalink / raw)
  To: David Brownell
  Cc: Network development list, Jean-Christophe Dubois, jussi.kivilinna

On Fri, Feb 22, 2008 at 05:31:16PM -0800, David Brownell wrote:
> From: Jean-Christophe Dubois <jcd@tribudubois.net>
> 
> 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.

Any chance that something like this is appropriate for rndis_wlan?

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 2.6.25-rc2-git] rndis_host:  fix transfer size negotiation
  2008-02-25 18:29 ` John W. Linville
@ 2008-02-25 18:37   ` Johannes Berg
  2008-02-25 21:11   ` David Brownell
  2008-02-26  6:51   ` Jussi Kivilinna
  2 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2008-02-25 18:37 UTC (permalink / raw)
  To: John W. Linville
  Cc: David Brownell, Network development list, Jean-Christophe Dubois,
	jussi.kivilinna

[-- Attachment #1: Type: text/plain, Size: 687 bytes --]


On Mon, 2008-02-25 at 13:29 -0500, John W. Linville wrote:
> On Fri, Feb 22, 2008 at 05:31:16PM -0800, David Brownell wrote:
> > From: Jean-Christophe Dubois <jcd@tribudubois.net>
> > 
> > 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.
> 
> Any chance that something like this is appropriate for rndis_wlan?

rndis_wlan uses this code so it already "got" this change.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 2.6.25-rc2-git] rndis_host:  fix transfer size negotiation
  2008-02-25 18:29 ` John W. Linville
  2008-02-25 18:37   ` Johannes Berg
@ 2008-02-25 21:11   ` David Brownell
  2008-02-26  6:51   ` Jussi Kivilinna
  2 siblings, 0 replies; 5+ messages in thread
From: David Brownell @ 2008-02-25 21:11 UTC (permalink / raw)
  To: linville; +Cc: netdev, jussi.kivilinna, jcd

> > 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.
>
> Any chance that something like this is appropriate for rndis_wlan?

I'd expect so; but, isn't it already getting that benefit?

- Dave


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 2.6.25-rc2-git] rndis_host:  fix transfer size negotiation
  2008-02-25 18:29 ` John W. Linville
  2008-02-25 18:37   ` Johannes Berg
  2008-02-25 21:11   ` David Brownell
@ 2008-02-26  6:51   ` Jussi Kivilinna
  2 siblings, 0 replies; 5+ messages in thread
From: Jussi Kivilinna @ 2008-02-26  6:51 UTC (permalink / raw)
  To: John W. Linville
  Cc: David Brownell, Network development list, Jean-Christophe Dubois

On Mon, 2008-02-25 at 13:29 -0500, John W. Linville wrote:
> On Fri, Feb 22, 2008 at 05:31:16PM -0800, David Brownell wrote:
> > From: Jean-Christophe Dubois <jcd@tribudubois.net>
> > 
> > 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.
> 
> Any chance that something like this is appropriate for rndis_wlan?
> 

This fix is automatically reflected to rndis_wlan since rndis_wlan
reuses that functions of that rndis_host module.

 - Jussi


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-02-26  6:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-23  1:31 [patch 2.6.25-rc2-git] rndis_host: fix transfer size negotiation David Brownell
2008-02-25 18:29 ` John W. Linville
2008-02-25 18:37   ` Johannes Berg
2008-02-25 21:11   ` David Brownell
2008-02-26  6:51   ` Jussi Kivilinna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).