Re: uac2 configfs function seems to load incorrectly if loaded other particular functions

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

 



Chris McClimans <chris@xxxxxxxxxxxxxxxx> writes:

> It looks like the ordering may be important.
> Configuring uac2 as your first function seems to resolve the issue.
> Must be a requirement documented somewhere, or an interesting bug. :)

It's a bug in uac2.  It statically sets the IAD bFirstInterface to 0
regardless of actual interface numbers being allocated to the function:

static struct usb_interface_assoc_descriptor iad_desc = {
        .bLength = sizeof iad_desc,
        .bDescriptorType = USB_DT_INTERFACE_ASSOCIATION,

        .bFirstInterface = 0,
        .bInterfaceCount = 3,
        .bFunctionClass = USB_CLASS_AUDIO,
        .bFunctionSubClass = UAC2_FUNCTION_SUBCLASS_UNDEFINED,
        .bFunctionProtocol = UAC_VERSION_2,
};

Compare this to other functions with an IAD.  They assign the IAD
bFirstInterface based on actual interface numbers allocated to the
function.  Example from f_ecm.c:

static struct usb_interface_assoc_descriptor
ecm_iad_descriptor = {
        .bLength =              sizeof ecm_iad_descriptor,
        .bDescriptorType =      USB_DT_INTERFACE_ASSOCIATION,

        /* .bFirstInterface =   DYNAMIC, */
        .bInterfaceCount =      2,      /* control + data */
        .bFunctionClass =       USB_CLASS_COMM,
        .bFunctionSubClass =    USB_CDC_SUBCLASS_ETHERNET,
        .bFunctionProtocol =    USB_CDC_PROTO_NONE,
        /* .iFunction =         DYNAMIC */
};

..
static int
ecm_bind(struct usb_configuration *c, struct usb_function *f)
{
..

        /* allocate instance-specific interface IDs */
        status = usb_interface_id(c, f);
        if (status < 0)
                goto fail;
        ecm->ctrl_id = status;
        ecm_iad_descriptor.bFirstInterface = status;

        ecm_control_intf.bInterfaceNumber = status;
        ecm_union_desc.bMasterInterface0 = status;



Bjørn
--
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