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

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

 



Thanks for your reply!
I am passing kernel arguments now to set the desired info.

Another question though: I noticed, when I run the USB Chapter 9 tests
on my host, there is not one "FUNCTIONFS_SETUP" event sent.
I am trying to move from gadgetfs to functionfs with my device,
and with gadgetfs my device received setup events all the time.
How come? Are they handled by the kernel? If so, why is there
setup handling in ffs-test.c ?
Thanks in advance!


On Tue, Jan 21, 2014 at 10:48 AM, Krzysztof Opasiak
<k.opasiak@xxxxxxxxxxx> wrote:
> 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