Linux USB emulation layer now committed to my new USB stack for FreeBSD

Hans Petter Selasky hselasky at c2i.net
Fri May 18 15:52:47 UTC 2007


On Friday 18 May 2007 13:53, Luigi Rizzo wrote:
> On Fri, May 18, 2007 at 01:04:17PM +0200, Hans Petter Selasky wrote:
> > Hi,
> >
> > If you are interested, the files are:
> >
> > http://www.turbocat.net/~hselasky/isdn4bsd/sources/src/sys/dev/usb/usb_co
> >mpat_linux.c
> > http://www.turbocat.net/~hselasky/isdn4bsd/sources/src/sys/dev/usb/usb_co
> >mpat_linux.h
> >
> > It is almost finished now.
> >
> > And it is not very much code.
> >
> > Also I have a preliminary patch for Luigi's webcam driver! But it does
> > not compile yet.
> >
> > NOTE: Before you use a Linux USB endpoint you have to call:
> >
> > usb_setup_endpoint() with the buffer size you want. For isoc transfers
> > the buffer size is ignored. Just set a dummy value.
> >
> > Do you have time to fix the rest Luigi?
>
> not now, sorry.
>
> But seeing the patch that you attach, let me kindly comment once
> again (i have already told you multiple time) that this approach
> of ignoring compatibility with existing code (usb stack/api/emulation
> layer, linux device drivers) and not commenting code at all is really a
> showstopper for getting your code tested and/or accepted.

That documentation you want has been moved to the README and to 
usb_compat_linux.{c,h}. The rest has been stripped off. It simply not needed! 
And it describes stuff that is no longer valid.

Feel free to add documentation to my _new_ driver, and spend some time on that 
instead. The old USB stack will be supported when I have time to make an 
emulation for that also.

>
> E.g. see usb_compat_linux.c in the url above - basically the only
> comment is the copyright - way too little for anyone to understand
> what is done there.

It is so simple that comments are just in the way. When I started out reading 
your Linux USB compatibility layer, I didn't understand anything until most 
of the comments where stripped away.

>
> usb_compat_linux.h is just a copy of stuff in the existing linux
> usb emulation, _but_ without any comments at all (and there was a
> lot of them in the existing code).

Way too many comments.

>
> Undocumented code is almost useless for us, and nobody has the
> time to reverse engineer your code and document its architecture.

It is around 1000 lines of code read.

Again, send me a patch with the comments you feel are missing, and I will add 
it to my driver. And make sure that your comments are up to date.

--HPS


More information about the freebsd-multimedia mailing list