Discussion:
usb: gadget: How to get the list of available usb functions?
Krzysztof Opasiak
2014-10-17 12:30:37 UTC
Permalink
Dear all,

While using USB gadgets I have found below issues. I would like you
to share your opinion about this and maybe suggest how we can solve it.

When user is composing a gadget using configfs he needs to know exactly
the names of usb functions. For example user needs to know that
functionfs
module has been registered as ffs and mass storage has been registered
as mass_storage.

Second issue is that it is impossible to discover the list of available
usb functions modules in currently running kernel. When functions are
build as modules and depmod has been used we can check modules.alias:

$ cat /lib/modules/`uname -r`/modules.alias | grep "usbfunc:" | awk
-F':' '{print $2}'

This gives us name of module and name registered in libcomposite.

But if we build some function into kernel or write a custom function
and just insmod it there is no way to ask our kernel what functions
are currently available.

There was even a proposition how to solve this issue [1] but it
has not been accepted. That's why I would like you to share your
opinion about this issue. I'm also looking forward for some suggestions
how we can solve this.

Footnotes:
1 - http://article.gmane.org/gmane.linux.usb.general/111068

--
Best regards,
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
k.opasiak-***@public.gmane.org



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Marek Szyprowski
2014-10-17 12:45:39 UTC
Permalink
Hello,
Post by Krzysztof Opasiak
While using USB gadgets I have found below issues. I would like you
to share your opinion about this and maybe suggest how we can solve it.
When user is composing a gadget using configfs he needs to know exactly
the names of usb functions. For example user needs to know that
functionfs
module has been registered as ffs and mass storage has been registered
as mass_storage.
Second issue is that it is impossible to discover the list of available
usb functions modules in currently running kernel. When functions are
$ cat /lib/modules/`uname -r`/modules.alias | grep "usbfunc:" | awk
-F':' '{print $2}'
This gives us name of module and name registered in libcomposite.
But if we build some function into kernel or write a custom function
and just insmod it there is no way to ask our kernel what functions
are currently available.
There was even a proposition how to solve this issue [1] but it
has not been accepted. That's why I would like you to share your
opinion about this issue. I'm also looking forward for some suggestions
how we can solve this.
1 - http://article.gmane.org/gmane.linux.usb.general/111068
This is a bit more appropriate reference for this:
http://thread.gmane.org/gmane.linux.usb.general/111130/

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Sebastian Andrzej Siewior
2014-10-17 13:05:57 UTC
Permalink
Post by Marek Szyprowski
http://thread.gmane.org/gmane.linux.usb.general/111130/
I just replied to this thread.

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