Re: State of gadget driver gadgetfs and functionfs

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

 



W dniu 18.12.2014 o 09:16, Mario Schuknecht pisze:
Hi,

we use gadget driver gadgetfs and implement a high-level protocol over USB.
Our hardware provides an USB WCID device [1]. But the recent state of gadgetfs
is unclear. There are a couple of problems and gadgetfs does not support USB3
SuperSpeed. I guess the driver will be removed from kernel. Is this correct?

I digged around and found functionfs which has similar functions. And I found
notes [2] that it is not to hard to convert a program from gadgetfs to
functionfs.

I _think_ there are still some users of gadgetfs around, but I guess the
way to go is to use FunctionFS.


I looked at tools/usb/ffs-test.c implementation and in file f_fs.c.
If I correctly understand the driver, then the functionfs driver gets USB
descriptors only at the begining.
But I do not understand how I can add WCID specific descriptors. E.g.

- OS String Descriptor [3]
- ID Feature Descriptor [4]
- Extended Properties Feature Descriptor [5]

Can someone show me an example or give me a hint how I can add this descriptors
to functionfs driver?

This series:
http://www.spinics.net/lists/linux-usb/msg110324.html

adds support for OS descriptors (OS String, Extended Compatibility and
Extended Properties).

Use of OS descriptors is enabled for gadgets composed with configfs.
For general information about composing gadgets with configfs you
can for example look at:
http://events.linuxfoundation.org/sites/events/files/slides/LinuxConNA-Make-your-own-USB-gadget-Andrzej.Pietrasiewicz.pdf

In gadget's root directory there is os_desc subdirectory,
where OS string can be specified and enabled.
In each function's directory there are corresponding subdirectories,
where Extended Properties and Extended Compatibility can be
specified, but FunctionFS is special and does not follow this
rule: all descriptors are passed through the ep0 special file.

In order to pass Extended Properties/Extended Compatibility
descriptors with FunctionFS, you must use FUNCTIONFS_DESCRIPTORS_MAGIC_V2
in the header. You should do it anyway, because since 3.14
FUNCTIONFS_DESCRIPTORS_MAGIC is deprecated.

You can find the layout of the descriptors in
include/uapi/linux/usb/functionfs.h

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