Basic USB driver for Solaris

This driver is meant to be an initial starting point for anyone interesting in writing a USB driver for solaris.

Unfortunately, it is somewhat limited in its coverage, since USB drivers and devices can be vastly different. The most trivial example of this is that many USB drivers may be STREAMS based drivers. This framework is NOT a STREAMS-based driver.

The very useful thing that this WILL do for you, however, is tell you the number and type of endpoints, for any device that you attach it to.

For more full examples of how to handle various USB devices, look at the other USB driver source I have made available on my Drivers page, and also my USB Primer document.


The only NDA I have signed with Sun is the "Foundation Source License Agreement". I do not believe that releasing my USB driver code puts me in violation of that agreement, since:
  1. I am not publicising any "Reference code". At no time did I cut-n-paste anything from Sun's foundation code into my own code. Additionally, at virtually no point is my code the same as Sun code, save where the USB interface requires identical syntax to function.

  2. All the USB-related Solaris interfaces I use, have already been made public in Solaris 8 include files: /usr/include/sys/usb/usba.h and /usr/include/sys/usb/usbai.h. Therefore, I am not disclosing any private information; merely organizing existing public information into a more easily comprehensible form.

  3. There are no warnings in usba.h and usbai.h that they are temporary, internal-only, or "uncommitted" interfaces. Therefore it is reasonable to assume, per standard Sun proceedure, that anyone is free to use them (if they can only figure out how!)

  4. All other (non-USB) Solaris interfaces that I use, are long-standing public Solaris driver interfaces.

Now that's out of the way, you can download usbbase.tar.gz, last updated Oct. 10, 2003

Do note that someone from the USB team has publically posted on comp.unix.solaris, that the API will change in future solaris releases! The code here is simply based around the public header files that ship with Solaris 8, and thus is "what works now". So if you want to play with USB hardware now, this is what you can base it around, with the realization that you'll have to recode in a year or something.

Written by:Philip Brown
Visit the Solaris driver pages at Or Search