Re: functionfs gadget with multiple endpoints

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

 



On Thu, 20 Feb 2020, Belisko Marek wrote:

> Hi,
> 
> I'm playing with functionfs and use configfs + functionfs + ffs-test
> from kernel to test connection between my device and host. ffs-test
> example provide 1 configuration with 1 interface and with 2 bulk
> endpoints.
> 
> I'm writing application which will write/read data to usb device but
> can be accessed from other multiple application. I'm planning to write
> kind of gatekeeper which will serialize data to endpoint and notify
> reader about received data.
> 
> I was thinking about other possibility to extend gadget to provide
> more endpoints (like 2). I was able to extend ffs-test and also I can
> send/receive data (using libusb) over original endpoints but not over
> new created one (I've run 2 instances of same application which
> basically create transfers for 2 different endpoints) but when running
> second application I got this error:
> 
> libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=16
> libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=16

Only one program at a time can claim an interface, and submitting an 
URB to an endpoint automatically claims the endpoint's interface.

> I'm not USB expert but multiple endpoint should be possible (maybe I
> need to put them to other interface?-> tried that also but got same
> error as above with errno=2). Thanks for any pointers and advice.

errno=16 and errno=2 are different errors, not the same error.  
Putting the endpoints in different interfaces should work; you probably
have a bug somewhere in your code.

Alan Stern




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

  Powered by Linux