RE: [PATCH] FunctionFS based PTP-Gadget driver

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

 



On Fri, 28 Jan 2011, Marek Szyprowski wrote:

> Hello,
> 
> On Friday, January 28, 2011 10:41 AM Guennadi Liakhovetski wrote:
> 
> > On Fri, 28 Jan 2011, Marek Szyprowski wrote:
> > 
> > > Hello!
> > >
> > > I've ported PTP usb gadget driver created once by Guennadi Liakhovetski
> > > from gadgetfs interface to the new functionfs interface introduced a few
> > > months ago. I've based my work on the sources that are available on
> > > http://git.denx.de/?p=ptp-gadget.git;a=summary
> > >
> > > With functionfs interface one can create usb multifunction composite
> > > gadget with some functions implemented in kernel space (like USB
> > > Ethernet) and other (like the PTP) in userspace.
> > 
> > Nice! Thanks a lot for the patch! However, you might appreciate, that
> > reviewing and testing this 1k-line patch wouldn't be very easy for me. It
> > is a huge change. Do I understand it right, that functionfs is replacing
> > the gadgetfs in the kernel? But we still have the "old" kernels around.
> > Would it be difficult to support both interfaces? Best with an automatic
> > detection of what's available on the system - shouldn't be too hard to
> > implement that - you've got both now. What do you think?
> 
> Well, imho functionfs is not meant to replace gadgetfs. It is designed for
> a bit different use case, although one can just use g_ffs module with single
> interface configuration to replace gadgetfs module.
> 
> Here are some mode details on functionfs interface: http://lwn.net/Articles/382480/

Yes, I've looked at one of them, and this:

<quote>
Patches that follow implement the FunctionFS composite function that
is a conversion of GadgetFS to use the composite framework.
</quote>

has confused me into thinking, that gadgetfs gets replaced by the 
functionfs. If both of them are stayingm then it makes even more sense to 
support both! Since functionfs is superior, we could make it the default 
choice, if both are available on the system (is it possible to have 
both?). Otherwise fall back to gadgetfs. Maybe also provide a parameter to 
force the use of gadgetfs even if both are available.

> The patch is huge, but it mainly removes all dead code that is not needed with
> functionfs interface, because functionfs moves handling of all common usb
> requrests into kernel space, to composite gadget framework. Also all the code
> that did controller/endpoint auto detection has been removed, because functionfs
> handles this inside the kernel (and does it much better btw). 
> 
> I think that it should be possible to create a version that supports both
> interfaces. Everything besides registration and ep0 handling is the same in
> functionfs and gadgetfs. 

That would be great!

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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