[RFC v2][PATCH 0/3] USB functions gadget

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

 



Dear All,

This is the second version of RFC for a usb gadget configured through configfs.
It is a follow-up to this thread:

http://www.spinics.net/lists/linux-usb/msg65972.html

It is meant to replace all gadgets with one, configurable through configfs.
By doing so, it will also make ccg obsolete.

It uses libcomposite v4 from Sebastian and is rebased onto
ed9cbda63d45638b69ce62412e3a3c7b00644835.

There are three patches: a small addtion to composite.c, the usb functions
gadget proper, and an example (and quick-and-dirty) port of the mass storage
function to the proposed framework.

I kindly ask for a review and for answering these questions:

1) Is this the right way to go? If yes, should I start porting more
functions to the proposed framework?

2) In order to provide compatibility for older userspace,
a bunch of "adapter" modules would be created, providing the legacy interface.
E.g., for mass storage, inserting the g_mass_storage module would set
everything up programmatically with configfs. Is this a good approach?

3) In the previous discussion

http://www.spinics.net/lists/linux-usb/msg69879.html

handling multiple UDCs has been touched. This patch series as of now does not
change the udc-core interface. And this interface only provides the "first
available" UDC. In order to provide users with ability to choose among
available UDCs, udc-core should be changed. Here is the idea:
Whenever usb_add_gadget_udc is called, a configfs entity is created in
/cfg/usb-gadget/udcs. Binding a gadget to an udc would be done by
creating a symlink in /cfg/usb-gadget/udcs/udcX, pointing to the
/cfg/usb-gadget/gadgets/GadgetX of interest. The framework needs to ensure that
no udc handles more than 1 gadget at a time, and that no gadget is
handled by more than 1 udc - this seems feasible since in configfs we have
control over creating the symlinks.
And here is the question: does it sound reasonable?


Andrzej Pietrasiewicz (3):
  usb: gadget: composite: export usb_remove_config
  usb: gadget: Add USB functions gadget
  usb: gadget: port f_mass_storage to USB functions gadget

 drivers/usb/gadget/Kconfig          |   12 +
 drivers/usb/gadget/Makefile         |    2 +
 drivers/usb/gadget/composite.c      |    1 +
 drivers/usb/gadget/f_mass_storage.c |  658 ++++++++++++++++--------------
 drivers/usb/gadget/storage_common.c |  343 +++++++++-------
 drivers/usb/gadget/usb_functions.c  |  788 +++++++++++++++++++++++++++++++++++
 6 files changed, 1361 insertions(+), 443 deletions(-)
 create mode 100644 drivers/usb/gadget/usb_functions.c

--
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