Class-specific interfaces in FunctionFS gadget
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: linux-usb@xxxxxxxxxxxxxxx
- Subject: Class-specific interfaces in FunctionFS gadget
- From: Marian <n@xxxxxx>
- Date: Thu, 23 Feb 2023 01:50:00 +0100
Hello,
I am currently trying to implement a more complex USB UAC2 audio device
than the one provided by `f_uac2` using the FunctionFS gadget `f_fs`.
However, as far as I can tell, this currently won't work because
FunctionFS parses the supplied descriptors in `ffs_do_single_desc`,
which does not handle any class-specific interfaces. Adding support
there is also non-trivial because of the relatively large number of
descriptor (sub)types that would need to be parsed and handled just for
UAC1 and 2 alone. As I understand it (correct me if I'm wrong),
FunctionFS needs to parse them to make the descriptors "relocatable",
i.e. support offsetting interface, endpoint and string references once
the USB gadget is actually initialized in case there are other functions
in the configuration, making this parsing essential for the gadget to work.
I was wondering what the best option to support more/any descriptors in
FunctionFS would be or if I'm missing something. Would it not be better
to have the user of `f_fs` (optionally) supply a sort of "relocation
table" containing (byte_offset, entity_type) entries alongside the
already supplied descriptor and string blobs? This could be used as an
alternative to
Unrelated to that, it does currently support interface association
descriptors, but ignores `bFirstInterface`. Is this correct? If an
`f_fs` instance would e.g. start at interface number 3,
`bFirstInterface` should be offset by 3, no?
Best regards,
Marian
[Index of Archives]
[Linux Media]
[Linux Input]
[Linux Audio Users]
[Yosemite News]
[Linux Kernel]
[Linux SCSI]
[Old Linux USB Devel Archive]