Re: usb_f_fs (ffs) setup?

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

 



Sorry for excess message:

>7) Where additional EPs appear?

I tried, and they appear in /dev/myffs1 mountpoint alongside with ep0, and they are there only while I keep opening ep0.

________________________________________
From: linux-usb-owner@xxxxxxxxxxxxxxx <linux-usb-owner@xxxxxxxxxxxxxxx> on behalf of Takashi Matsuzawa <tmatsuzawa@xxxxxxxx>
Sent: Tuesday, November 27, 2018 5:56:10 PM
To: linux-usb@xxxxxxxxxxxxxxx
Subject: Re: usb_f_fs (ffs) setup?

Hello.
I further debugged, and may I an a couple of questions to my list.

5) In the following steps, must I keep ep0 open until I successfully write controller name to UDC file?

>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

As I tried, ffs is getting ready if I write descriptors and strings (two writes in one open).
But if I close ep0, and tried to write to UDC, it erros that it is not ready (no descriptors are set.).

7) Where additional EPs appear?

Are they going to apper in /dev/myffs1 where ep0 already is?
(And they are availabe only while I keep open ep0?)

________________________________________
From: linux-usb-owner@xxxxxxxxxxxxxxx <linux-usb-owner@xxxxxxxxxxxxxxx> on behalf of Takashi Matsuzawa <tmatsuzawa@xxxxxxxx>
Sent: Tuesday, November 27, 2018 11:16 AM
To: linux-usb@xxxxxxxxxxxxxxx
Subject: usb_f_fs (ffs) setup?

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