Unused stuff in ether.c and why?

[email protected]
Newsgroups gmane.linux.usb.devel
Message-ID <OFD0D792CA.4C7D8D31-ON88257306.000B7B88-88257307.005F35C5@etas.de>
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 initialization of mdlm_desc appears to have come in with the 2.6.21 
kernel to support MDLM SAFE mode. The mdlm_desc struct only gets used to 
initialize poitners in the array fs_eth_function[] and hs_eth_function[] 
which both do not get used. So how was the addition of mdlm_desc necessary 
for MDLM SAFE support?

Various descriptors get initialized into fs_eth_function[] and 
hs_eth_function[]. Only 3 of those descriptors (all of type 
usb_endpoint_descriptor) really get used and they get used by getting 
passed to usb_ep_autoconfig: 
    fs_source_desc
    fs_sink_desc
    fs_status_desc

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.

Their high speed equivalents (the only other structs in ether.c of type 
usb_endpoint_descriptor)  are effectively unused:
    hs_source_desc
    hs_sink_desc
    hs_status_desc

Among the other effectively unused descriptor structs (they are only put 
in the unused  fs_eth_function[] and hs_eth_function[] arrays):
   subset_data_intf
   header_desc
   mdlm_desc
   mdlm_detail_desc
   ether_desc

Those mdlm_desc and mdlm_detail_desc fields were added for 2.6.21 to 
support MDLM/SAFE. But they are NOT used.

Similarly, the fs_subset_descriptors() and hs_subset_descriptors() 
functions seem worthless because they set entries in the unused 
fs_eth_function[] and hs_eth_function[] arrays.

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?


Randall Parker
Vetronix 
Santa Barbara CA, USA
805-966-2000 x3141

-------------------------------------------------------------------------
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/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.