On Tue, 15 Jan 2003, oliverthered wrote:

>checkintf claims the interface if it's not claimed, I'm not sure this is
>the 'best' thing to do,

that's a completely different discussion.

> since you get into the problems of picking the
>first interface where bEndpointAddress matches the request, which may
>not be the interface you want. 

an endpoint can only be present on one interface.  It can exist on 
multiple settings of that one interface, but it can't exist on any other 
interfaces.

>Which is also the reason I didn't use  usb_epnum_to_ep_desc, It doesn't
>check act_altsetting and doesn't know about what interface to look at.
>so you get the first enpoint that matches.. e.g.

it should check the active alternate setting of every interface; as I 
said, it does have that bug (checking inactive settings).

>
>
>I have a USB device that looks like this
>D:  Ver= 1.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs=  1
>P:  Vendor=0915 ProdID=8000 Rev= 1.00
>S:  Manufacturer=GlobeSpan Inc.
>S:  Product=USB-ADSL Modem
>S:  SerialNumber=FFFFFF
>C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
>I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbdevfs
>E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>E:  Ad=86(I) Atr=03(Int.) MxPS=  64 Ivl=3ms
>I:  If#= 0 Alt= 1 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbdevfs
>E:  Ad=88(I) Atr=01(Isoc) MxPS=1008 Ivl=1ms
>E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>E:  Ad=86(I) Atr=03(Int.) MxPS=  64 Ivl=3ms
>....
>I:  If#= 0 Alt= 4 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbdevfs
>E:  Ad=88(I) Atr=01(Isoc) MxPS= 448 Ivl=1ms
>E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>E:  Ad=86(I) Atr=03(Int.) MxPS=  64 Ivl=3ms
>
>
>If I ask for AD 02  usb_epnum_to_ep_desc will return the endpoint on alt
>01 (which may not be active)
>
>But then if I also want 88 I'll get the endpoint on alt 02
>
>but because I really want the one on alt=4 because I don't want or need
>the amount of bandwidth on alt=1.

all those are the same interface.  It is clear now that all 3 functions 
should only check active settings, so assuming the setting you care about 
is active you will get the correct endpoint (after the funcs are fixed).

>
>
>The patch I sent brakes as little as possible,  I believe devicefs_urb
>should have a member for the interface being requested, but this will
>break lots of things, and is probably for someone more godly to
>implement.
>
>The patch will cause using usvfs to submit a URB without first claiming
>the interface to return an error, instead of claiming the first
>interface it finds, which IMHO is better than picking any old
>interface/alternate to throw data at.

-3 functions have bug.
-proc_submiturb doesn't set interval for isoc.

those are the only problems, the issue of checkintf() auto-claiming the 
interface is a completely different discussion.  I'm not saying I 
disagree, but it's not a bug per se, it's the way it's indended to work.
If you think it should change you should (IMHO) raise that as a separate 
discussion...


-- 
Dan Streetman
[EMAIL PROTECTED]
---------------------
186,272 miles per second:
It isn't just a good idea, it's the law!


-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving 
your online business a competitive advantage. Test-drive a Thawte SSL 
certificate - our easy online guide will show you how. Click here to get 
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to