Accessing USB Mass Storage Device

Daniel Rudy dr2867 at pacbell.net
Tue Oct 18 11:07:36 PDT 2005


When the umass driver is compiled into the kernel, and one inserts a USB
mass storage device, how does one access the device descriptors (serial
number) while the device is listed as a da device?  I would perfer to
have the OS do all the work of accessing the hardware.  But if it cannot
be done, then I have the following questions:

How does one read and write data to the device using /dev/ugen?

I have a reasonable idea as to how something like that would work as the
following steps illustrate:

1. open bulk descriptor in for read.
2. open bulk descriptor out for write.
3. send CBW read data to device via write.
4. read result from device via read.
5. read CSW from device.
etc..

I have the standards documents on the SCSI commands, the USB data
structures, and other information, but at this point, I'm kinda stuck.
Will the above method work?  Or is there something else that needs to be
done to program data access against /dev/ugen?  Or am I entirely wrong.

I have tried using google, but I just keep getting back junk which is of
little value.

-- 
Daniel Rudy



More information about the freebsd-hackers mailing list