From owner-freebsd-multimedia@FreeBSD.ORG Fri May 18 15:52:47 2007 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10EA216A402; Fri, 18 May 2007 15:52:47 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.freebsd.org (Postfix) with ESMTP id 46EC013C447; Fri, 18 May 2007 15:52:46 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [193.217.102.48] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe01.swip.net (CommuniGate Pro SMTP 5.1.7) with ESMTPA id 473265847; Fri, 18 May 2007 17:52:44 +0200 From: Hans Petter Selasky To: Luigi Rizzo Date: Fri, 18 May 2007 17:52:32 +0200 User-Agent: KMail/1.9.5 References: <200705181304.17222.hselasky@c2i.net> <20070518045331.A41545@xorpc.icir.org> In-Reply-To: <20070518045331.A41545@xorpc.icir.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705181752.32566.hselasky@c2i.net> Cc: freebsd-multimedia@freebsd.org, freebsd-usb@freebsd.org Subject: Re: Linux USB emulation layer now committed to my new USB stack for FreeBSD X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2007 15:52:47 -0000 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