From owner-freebsd-multimedia@FreeBSD.ORG Sun Sep 18 17:32:54 2005 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4EAB116A41F; Sun, 18 Sep 2005 17:32:54 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.swip.net [212.247.154.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 997DB43D45; Sun, 18 Sep 2005 17:32:52 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-216-87-133.daxnet.no ([193.216.87.133] verified) by mailfe07.swip.net (CommuniGate Pro SMTP 4.3.4) with ESMTP id 260678742; Sun, 18 Sep 2005 19:32:50 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org, freebsd-multimedia@freebsd.org Date: Sun, 18 Sep 2005 19:33:45 +0200 User-Agent: KMail/1.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509181933.47262.hselasky@c2i.net> Cc: Subject: New USB driver & API (updated) X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hselasky@c2i.net List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2005 17:32:54 -0000 Hi, I have just updated my USB driver for FreeBSD 5/6/7. Download the three files below into a new directory and type "make install" (to uninstall type "make deinstall") http://home.c2i.net/hselasky/isdn4bsd/privat/usb/Makefile http://home.c2i.net/hselasky/isdn4bsd/privat/usb/new_usb_1_5_4.diff.bz2 http://home.c2i.net/hselasky/isdn4bsd/privat/usb/new_usb_1_5_4.tar.bz2 Type "make help" to get more help. I have included a patch for "uaudio.c" that will allow "full duplex" to work. This time I have added two refcounts to each "struct usbd_xfer". The one refcount keeps track of the number of threads that are holding a reference to it, and is decremented when memory is freed. The other refcount keeps track of the number of re-starts, and is incremented when a USB transfer is stopped. For example see "ehci_pcd_enable()" in "/sys/dev/usb2/_ehci.c" and "usbd_do_callback()" in "/sys/dev/usb2/_usb.c". This is almost like in Objective C. Stopping and starting a transfer does not block or sleep, which means one can hold a lock while doing this. I have added a callback, search for "priv_func", that will be called just before the USB transfer memory is freed. This can be used for mutex destruction purposes, and alike. I want to use "callout_init_mtx()", but I am not sure when this was introduced, and to not break this driver on older versions of FreeBSD, I still use "callout_init()". But this is just a matter of a few one-liners. I have done an great deal of work on "ugen" and it should now support BULK-, INTERRUPT- and ISOCHRONOUS- transfers in read and write direction. If you are interested, you can have a look at: "/sys/dev/usb2/_ugen.c" --HPS