On Tuesday 26 September 2006 7:57 am, Dmitry Antipov wrote:
> Hello,
>
> I'm working with PXA27x hardware and going to check USB ethernet gadget
> (RNDIS mode)
> with 2.6.18 on PC host. After a short investigation, I was stucked because:
Yes, there are bugs there ... I thought they'd been fixed, evidently not.
Minimally, as you noted, the test needs to accomodate a modular driver!
This particular patch won't work for 2.6.19-rc1, that code has moved into
the new "usb/core/generic.c" file ... could you update it?
>
> 1) help on CONFIG_USB_ETH_RNDIS (taken from drivers/usb/gadget/Kconfig)
> says that
> RNDIS-aware configuration will be second (behind CDC);
I can't read it that way; helptext wouldn't have such details anyway.
> 2) gadget code (taken from drivers/usb/gadget/ether.c) says "list the RNDIS
> config
> first, to make Microsoft's drivers happy";
That's what it does, yes.
> 3) choose_configuration() from drivers/usb/core/hub.c will choose 2nd
> configuration
> even if CONFIG_USB_NET_RNDIS_HOST is enabled.
I don't read the code that way at all. It _skips_ RNDIS unless
that symbol is defined. (It should also care about the modular
version). Linux doesn't care about sequencing (first, second, etc).
> I believe that the valid configuration order (if RNDIS is enabled) is RNDIS
> 1st, CDC
> 2nd (mostly to be compatible with Microsoft stuff, as comment from 2) says).
> But,
> if this is true, then choose_configuration() works wrong - if RNDIS support
> is enabled,
> it should choose 1st configuration and relax about others.
Forget about sequencing. Linux doesn't care.
> Moreover, since RNDIS host
> support may be modular, CONFIG_USB_NET_RNDIS_HOST_MODULE should also be taken
> into
> account. So, here is a tiny patch.
>
>
> --- 2.6.18/drivers/usb/core/hub.c 2006-09-22 14:49:57.000000000 +0400
> +++ 2.6.18.devel/drivers/usb/core/hub.c 2006-09-26 18:32:25.000000000
> +0400
> @@ -1244,10 +1244,11 @@
> && desc->bInterfaceClass == USB_CLASS_COMM
> && desc->bInterfaceSubClass == 2
> && desc->bInterfaceProtocol == 0xff) {
> -#ifndef CONFIG_USB_NET_RNDIS_HOST
> - continue;
> -#else
> +#if defined(CONFIG_USB_NET_RNDIS_HOST) ||
> defined(CONFIG_USB_NET_RNDIS_HOST_MODULE)
Having use positive logic (#ifdef) is better than negative (#ifndef), yes.
> best = c;
> + break;
The "break" isn't appropriate though. We still want to avoid RNDIS
(and other proprietary protocols) when possible ...
- Dave
> +#else
> + continue;
> #endif
> }
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel