Re: [RFC/PATCH] usb: gadget: composite: don't call f->set_alt() from USB_REQ_SET_CONFIGURATION

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Felipe Balbi | 2012-08-16 09:30:05 [+0300]:

>I couldn't find anywhere in the USB Specification
>where it requires us to make sure all interfaces start
>on Alternate Setting zero. IMHO, we should consider
>initial state as UNKNOWN and not rely on that being
>zero or anything.

Table 9-1 in USB2.0 spec says once a device is configured (after
USB_REQ_SET_CONFIGURATION) is may use its functions. So the default
function should be activated.

9.6.5 says:
|An interface may include alternate settings that allow the endpoints
|and/or their characteristics to be varied after the device has been
|configured. The default setting for an interface is always alternate
|setting zero.
|The SetInterface() request is used to select an alternate setting or to
|return to the default setting.

That means we have to start at zero. The host may change it, it may not
use SetInterface() at all if the default setting is fine.

9.1.1.5 says:
|Configuring a device or changing an alternate setting causes all of the status
|and configuration values associated with endpoints in the affected
|interfaces to be set to their default values.

I think we can skip ->set_alt() if the old setting is the same as the
new one.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux