umass: should the device specific information be moved from C code to the text file?

Peter Jeremy peterjeremy at
Fri Feb 29 07:42:16 UTC 2008

On Thu, Feb 28, 2008 at 02:14:58PM -0800, Yuri wrote:
>Currently all devices supported by umass driver are listed in
>* sys/dev/usb/usbdevs
> - which has vendor table (vendor-id/name)
> - and product table (ref-to-vendor-id/product-id/name)
>* sys/dev/usb/umass.c
> - which has some per-device flags.

And (for completeness):
* src/sys/cam/scsi/scsi_da.c
 - contains device quirks.

>I suggest device specific information should be moved from 
>sys/dev/usb/usbdevs and sys/dev/usb/umass.c
>to some text file (ex. /etc/umass-devices) which would be read by umass 
>driver when it's loaded.

This sounds like a nice idea - it's also a nuisance having to recompile
the kernel just to support a weird new USB device you've acquired.

Unfortunately, accessing the filesystem from within the kernel is not
that easy.  One problem with your suggestion of accessing the file
when umass is "loaded" is that if imass is compiled into the kernel,
it will go through the probe/attach phase before there's a root
filesystem - which makes reading files somewhat difficult.

What might be more useful is for the USB system to interrogate a file
(or similar) when a USB device is inserted to allow the user to
control which usb driver gains control of the device - as well as the
camera example you use, this would also be useful with multi-function
printer/scanner/... devices.  Again, accessing a file is not trivial
but may be practical.

Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-hackers mailing list