RE: FunctionFS: Provide device and configdescriptor from user mode application?

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

 



Hi,

> -----Original Message-----
> From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Marco Zamponi
> 
> Hi!
> Sorry, I posted before but forgot the subject.
> I am running the test application "ffs-test.c" in user space and I
> want to
> write the descriptors to ep0.
> However, it seems that I can only write interface descriptors
> and enpoint descriptors.
> What about device and configdescriptors? When I put those in the
> "descriptor" struct I get an EINVAL (22, invalid parameter) error:
> 
> "ffs-test: info: ep0: writing descriptors"
> "ffs-test: crit: ep0: write: descriptors: (-22) Invalid argument"

This is intended behavior. FunctionFS is kernel-userspace interface
which allow to provide implementation of *single* usb function
(interface). Each usb device consist of several functions which are
placed in configuration. FunctionFS allow you only to provide
descriptors for this *one particular* function which is implemented by
you. Information related to whole usb device may be set using two ways:

1) Using ConfigFS to create your own gadget [1]
2) Using modprobe g_ffs and provide arguments which are suitable for
you.

ConfigFS is more flexible and will allow you to set all values from usb
device/configuration descriptors using file system.

Footnotes:
[1]
https://wiki.tizen.org/wiki/USB/Linux_USB_Layers/Configfs_Composite_Gadg
et

--
BR's

Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics





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