Subject: Please review new slhci driver...
To: None <tech-kern@netbsd.org>
From: Matthew Orgass <darkstar@city-net.com>
List: tech-kern
Date: 06/26/2007 01:32:01
  I rewrote most of the slhci driver to support bulk transfers and the
Ratoc CFU1U Compact Flash Host Controller.

http://www.city-net.com/~darkstar/netbsd/sl/

  The slhci.diff file contains the full diff. Several files are also
available directly, including sl811hs.c.

  There are a few changes to other USB code:
* splsoftusb, IPL_SOFTUSB, and IPL_HARDUSB defines in usbdi.h
-> the current names are confusing (didn't change other drivers)
* fix invalid memory access in usbd_transfer (kern/24636)
-> needed for this driver
* fix USB HC detach race condition (kern/32011)
-> main patch needed for this driver, sc_dying changes in other drivers
not necessary but seem right to me

  The slhci driver itself uses simple locks for locking.  I had stared the
driver before the new mutex api.  New transfers are placed on a wait queue
if the main lock cannot be acquired.  Once the main lock is acquired, the
driver will do any needed work except callbacks, which are always done
from the soft interrupt.  The driver will poll if a transfer is expected
to be completed soon.

  SLHCI_DEBUG (not defined by default) uses UVMHIST for logging, which
requires modifying a few uvm files as mentioned in the comment.  Making
the logging interface more generic would be my next project, but may not
happen soon.  The main feature I want (besides not needing to modify uvm
files) is the ability to log the flag bits for later selection.

  Any comments, questions, or flames would be appreciated.  As mentioned
in a previous post, I wrote a "generic circular queue" for this driver;
any comments on that would be appreciated as well.

Matthew Orgass
darkstar@city-net.com