On Wednesday 27 June 2007, [EMAIL PROTECTED] wrote:
> I'm reading Linux 2.6.21.5 ether.c very carefully trying to understand how 
> it works (I want to integrate it with the PXA270 StrongARM XScale 
> processor). I find many puzzling things about it.
> 
> In ether.c are the arrays fs_eth_function[] and hs_eth_function[] just 
> there for testing purposes? Their presence continues to make no sense to 
> me. See, for example, the lines which refer to fs_eth_function: 
> http://lxr.linux.no/ident?i=fs_eth_function where it only ever gets set 
> and never gets read.

The references are in the config_buf() routine ... see what
the which_fn() macro evaluates to.

All those descriptors make up the guts of the config descriptor
for the device.  And the config descriptor is the primary data
used by the host to sort out any device.


> So then does the Ethernet Gadget uses only 3 endpoints regardless of 
> whether it is doing full CDC Ethernet, CDC Subset, CDC Subset/MDLM/SAFE, 
> or RNDIS? That's the way it looks to me.

ISTR that if configured for an sa1100 it won't use an interrupt endpoint.
(Note that you're not counting ep0, which is always used...)

Also note that the pxa270 has a deeply bizarre notion of "endpoint".

Specifically, unlike sane hardware, it wants to handle configuration
management in hardware ... by coupling endpoint, altsetting, config,
and endpoint descriptor into a tuple.  The usual solution is to let
the driver do whatever coupling is required:  only enabling endpoints
that are valid in the current config and altsetting, after manually
setting up the characteristics (type, maxpacket, etc) to match the
relevant descriptor.  That's a lot simpler, and also minimizes the
chance for hardware errata to make trouble for drivers.


> Hey, I want to use this to do MDLM/SAFE with a Windows PC host. But for 
> MDLM/SAFE is this ether.c a partial implementation or a working 
> implementation that has pieces that aren't used?

Everything there should be used.  "make drivers/usb/gadget/ether.i" and
you'll see that it is.

- Dave


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to