linux-usb-gadgets / libusbgx

C library encapsulating the Linux kernel USB gadget configfs userspace API functionality
GNU General Public License v2.0
216 stars 72 forks source link

FR: Available function list #88

Open NekoCWD opened 8 months ago

NekoCWD commented 8 months ago

I think it would be great if library could provide full list of functions, that can be used in gadget. Maybe something like: int *usbg_get_available_function_types() Which will return null-terminated array of functions or error(f.e if modules directory doesn't contain modules.{order/builtin})

We can search in modules.order and modules.builtin for kernel/drivers/usb/gadget/function/usb_f_{function_name}.ko and then recognize it with usbg_lookup_function_type(function_name) Are there better ways to do this? If no, i can make a PR with it

pabs3 commented 8 months ago

I think this potential feature requires input from the Linux kernel USB community, they might have some ideas about how it should be done.

Could you send a mail to the linux-usb mailing list about this?

@.*** http://www.linux-usb.org/mailing.html https://lore.kernel.org/linux-usb/

Please post the link to the lore thread back here too.

-- bye, pabs

https://bonedaddy.net/pabs3/