Date: Sun, 18 Sep 2005 19:33:45 +0200 From: Hans Petter Selasky <hselasky@c2i.net> To: freebsd-usb@freebsd.org, freebsd-multimedia@freebsd.org Subject: New USB driver & API (updated) Message-ID: <200509181933.47262.hselasky@c2i.net>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509181933.47262.hselasky>