usb_f_fs (ffs) setup?

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

 



Hello.

I am trying to use configfs I/F of compsite gadget to add my additional EPs.
The EPs (multiple) are simple IN and OUT pipes which I intend to write/read on peripheral (gadget) side user-mode application.  I intend to use file read/write.

As I look into the memos and driver source code, I think the below steps might work.
(This is the first time I try configfs based gadget setting, and still looking into what it can do.)

i) Add my function to my gadget definition

mkdir functions/ffs.usb1
ln -s functions/ffs.usb1 configs/c.1

ii) Mount it as functionfs

mkdir /dev/myffs1
mount usb1 /dev/myffs1

iii) Set descriptors, etc.

Write necessary info into /dev/myffs1/ep0
(So that ffs thinks descriptors are ready.)

iv) Bind

echo controller-path > usb_gadget/g1/UDC

Just as the step described as:

https://wiki.tizen.org/USB/Linux_USB_Layers/Configfs_Composite_Gadget/Usage_eq._to_g_ffs.ko

Now I have a fiew quetions.
If you have immediate answers to these it may save my time and I greately appreciate.

1) Is this the proper way to do it?

(The ffs function is designed so that it can add additional file i/o EPs to existing gadget?)

2) The step ii) and iii) are still needed?

i.e. Even if I use configfs, this part is using functionfs and also I need to make myself data that can be understood by ffs ep0.

3) The /ev/myffs1/ep0 is shared with EP0 that the gadtet device defines?

I think the device will define EP0 and the host will ready/write data from/to it, after it is available on USB.

What is the relationship beteen the data read/write on /dev/myffs1/ep0 (by user-mode applciation) and data read/write on USB EP0?

4) At step iii), I need to encode descriptor, etc. info and write to /dev/myffs/ep0.

Any convenient tool to do it (encoding), or I just should write tiny util for that?

Thank you for your cooperation.






[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux