I have been trying to write a Solaris USB driver for USB200M Linksys
The driver uses GLD for all DLPI related stuff.
The driver seems to work - but there are two problems that are related
to Solaris USB kernel framework and that affect the driver's
1. USB200M has for endpoints (control, interrupt, bulk out and bulk
in). Both bulk endpoints have MaxPacketSize of 64. If request is made
to receive 64 bytes (or less - SHORT_XFER) from the bulk in pipe, the
driver works fine, albeit very slow, because it has to wait for an
interrupt for each 64 byte message. If you attempt to set Max Packet
Size to ETHERMAX (1514) and try to get a longer message, USB framework
returns only the LAST message block of the message - basically, if you
are supposed to get 257 bytes, you'd get only 1 byte message (257 % 64
= 1). This looks like a defect to me... Looking at the mblk_t and the
linked struct datab does not point to any other mblk_t...
At the same time, sending of 1514 byte messages works just fine. The
end result - data transfer FROM Solaris machine is ~350k/sec, TO
Solaris machine is ~30k/sec.
2. When trying to unload the driver, it calls usb_pipe_close for all
data pipes (bulk in and bulk out). There is almost always a read
request active for the bulk in pipe, to make sure that we do not miss
the incoming data. What happens is that sometimes usb_pipe_close
deadlocks on a condition variable. Using usb_pipe_reset before
usb_pipe_close does not help. Also, attempting to use usb_pipe_abort
before usb_pipe_close also deadlocks the driver, even in the same
stack. All other kernel threads are just waiting for something else,
there are no other threads in the driver's context.
Does anyone have any idea what is going on in the Solaris USB kernel
side? I have tried to get the source code, but to no avail. Sun's SCSL
does not list Solaris anymore.
Comments and suggestions are much appreciated.