On Wednesday 15 Jan 2003 10:12 pm, Dan Streetman wrote:
> On Wed, 15 Jan 2003, David Brownell wrote:
> >> Hmm, so should the conversion from bInterval to ms-interval happen in
> >> the driver, or in the core?  It seems to me that it would be better to
> >> handle that conversion in the core...?
> >
> >We had that discussion last summer, and the resolution
> >was that fill_int_urb() does it ... ISO drivers don't
> >have such a utility to call.
>
> mmm, that's too bad, it seems unfortunate to duplicate that conversion in
> all iso drivers (and int drivers that don't use fill_int_urb)...
>
> Wouldn't it make sense to have a conversion function in usb.c,
> something like:
>
> inline int bInterval_to_ms(unsigned char bInterval, int speed, int isoc)
> {
>   if (USB_SPEED_HIGH == speed)
>     return (2^(bInterval-1)) * 125;
>   else if (isoc)
>     return (2^(bInterval-1));
>   else
>     return bInterval;
> }
inline int epint_to_urbint(unsigned char bInterval, int speed, int isoc)
 {
        if(isoc)/*section 5.6.4 Iso transfers*/
        {
                /*Table 9-13 Stadard Endpoint desc.*/
                if(speed == USB_SPEED_HIGH ||speed == USB_SPEED_FULL ){
                        return 1<< (bInterval-1);
                }
                /*shouldn't get here, since low speed ISO's arn't supported by USB*/
        }else /*Section 5.8 interrupt transfers*/
        {               
                /*Table 9-13 Stadard Endpoint desc.*/
                if(speed == USB_SPEED_HIGH ){
                        return 1<< (bInterval-1);
                }
                /* Full or low speed */
                return bInterval;
        }
}




-------------------------------------------------------
This SF.NET email is sponsored by: A Thawte Code Signing Certificate
is essential in establishing user confidence by providing assurance of
authenticity and code integrity. Download our Free Code Signing guide:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to