[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: udev - easy setup ?

On Tuesday 02 August 2005 18:07, Uwe Dippel <udippel@uniten.edu.my>
(<pan.2005.>) wrote:

> On Tue, 02 Aug 2005 09:37:36 -0600, Jules Dubois wrote
>>   BUS="usb", SYSFS{product}="NEC USB UF000x", NAME="%k",
>>        SYMLINK="usb-floppy"
>>   BUS="usb", SYSFS{manufacturer}="KINGSTON     ",
>>        SYSFS{product}="DATA TRAVELER", NAME="%k", SYMLINK="usbhd%n"
> Though, as you pointed out (and I had pointed out in the first post): I am
> not interested to recognise this particular NEC floppy or a Kingston
> thumb drive.

I read and/or skimmed parts of the USB mass storage class (MSC)
specification [1], and my interpretation is that MSC specs do not directly
distinguish between device "types" (i.e., HDD, FDD, thumb drive, etc.).
rather, they specify things like interfaces, the sort of thing a driver
needs to know; they're all mass-storage devices.

>> Since it looks like an interesting problem, I'll look into it further,
>> if you like.
> Yes, please, for sure !

Here is a set of rules, based on "bInterfaceProtocol" and "CBI", which may
work with the two devices above.  If I understand correctly, it will name
all USB "hard" drives (thumb drives and mechanical drives) as 'usb-hd?'.

    BUS="usb", DRIVER="usb-storage", SYSFS{bInterfaceProtocol}="0[01]",
         KERNEL="sd*", NAME="%k", SYMLINK="usb-floppy%n"
    BUS="usb", DRIVER="usb-storage", SYSFS{bInterfaceProtocol}="50",
         KERNEL="sd*", NAME="%k", SYMLINK="usb-hd%n"

However, the MSC [1] (p. 7) says

  The USB Mass Storage Class Control/Bulk/Interrupt (CBI) Transport
  specification (Protocol codes 0x00 and 0x01) is approved for use
  only with full-speed floppy disk drives.  CBI shall not be used in
  high-speed capable devices, or in devices other than floppy disk
  drives.  Use of CBI for /any/ new design is discouraged.

Floppy disks which do not use CBI will be improperly named with the rules

While I haven't exhausted udev's features, including RUN and RESULT, I don't
know how I'd use them.  If it were me and I didn't have a large number of
devices to support, I think I'd use rules with keys like "manufacturer" and
"product", adding new rules as I encountered new devices.  It would be
tedious, but it will work.

[1] "Universal Serial Bus Mass Storage Class Specification Overview".
    USB Implmentors Forum.
    [Note that the vermin at USB-IF have copy protected their documentation
    and that I have been reduced to retyping quotations.]

Reply to: