Re: [RFC/PATCH] make usbnet work with rndis_host

2008-02-14 Thread Jean-Christophe Dubois
Just for my information, is this patch accepted or are you expecting some 
other changes?

Thanks

JC

On Monday 11 February 2008 17:52:13 Jean-Christophe Dubois wrote:
 On Saturday 09 February 2008 10:51:06 David Brownell wrote:
  So I'd rather see a one-line fix to the RNDIS host code, instead of
  this more elaborate approach.  Could you give that a try?

 So here is the new proposal.

 Signed-off-by: Jean-Christophe Dubois [EMAIL PROTECTED]
 ---

 diff -ruN linux-source-2.6.24/drivers/net/usb/rndis_host.c
 linux-source-2.6.24.new/drivers/net/usb/rndis_host.c ---
 linux-source-2.6.24/drivers/net/usb/rndis_host.c  2008-01-24
 11:52:31.0 +0100 +++
 linux-source-2.6.24.new/drivers/net/usb/rndis_host.c  2008-02-11
 17:43:48.0 +0100 @@ -499,8 +499,18 @@
   net-hard_header_len += sizeof (struct rndis_data_hdr);
   dev-hard_mtu = net-mtu + net-hard_header_len;

 + /* now we need to compute dev-maxpacket */
 + dev-maxpacket = usb_maxpacket (dev-udev, dev-out, 1);
 +
 + if (dev-maxpacket == 0) {
 + dev_err(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);

   net-change_mtu = NULL;
 -
 To unsubscribe from this list: send the line unsubscribe linux-usb in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


-
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/PATCH] make usbnet work with rndis_host

2008-02-12 Thread Alan Stern
On Tue, 12 Feb 2008, Jean-Christophe Dubois wrote:

 Let's ask the question: if usbcore was detecting an endpoint with a 0 
 dev-maxpacket would it reject it right away or would it pass it anyway 
 trusting that the specific driver would know about this problem (buggy 
 hardware is everywhere) and work around it in software.

As far as I know, there's nothing illegal about an Interrupt or
Isochronous endpoint having maxpacket size 0.  It might even be useful,
for example, in Boolean polling.  Bulk and control endpoints are
different; the spec limits their possible maxpacket sizes to only a few
power-of-2 values.  I don't see how a bulk endpoint with 0 maxpacket 
could be useful for anything.

At any rate, until Dave posted his patch usbcore did not check for
illegal maxpacket values (other than on ep0).

Alan Stern

-
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/PATCH] make usbnet work with rndis_host

2008-02-11 Thread Jean-Christophe Dubois
On Saturday 09 February 2008 13:44:22 David Brownell wrote:

 snip

  In the end it seems to me that dev-in, dev-out and dev-maxpacket are
  generic enough values to be computed in one place whatever driver (bind()
  or not) attach to usbnet.

 snip

 Plus, as I noted, in the case of CDC-derived devices it *can't* compute
 those values before bind().

For my education, could you please elaborate a bit on why the CDC-derived 
devices *can't* compute those values before bind().

Thanks

JC

-
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html