multi-port usb-serial hub rules

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

 



I've got a few usb to 4 serial port hubs. The problem is that
sometimes the ttyUSB* devs get resorted. I'm trying to write rules to
handle them (and maybe name the devices after the machines they're
connected to) however, I'm stuck because they only show up as one usb
device (and not another usb hub with a serial device on each port):

  looking at device
'/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.0/ttyUSB11/tty/ttyUSB11':
    KERNEL=="ttyUSB11"
    SUBSYSTEM=="tty"
    DRIVER==""

  looking at parent device
'/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.0/ttyUSB11':
    KERNELS=="ttyUSB11"
    SUBSYSTEMS=="usb-serial"
    DRIVERS=="keyspan_4"
    ATTRS{port_number}=="3"

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.0':
    KERNELS=="2-5:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="keyspan"
    ATTRS{bInterfaceClass}=="ff"
    ATTRS{bInterfaceSubClass}=="00"
    ATTRS{bInterfaceProtocol}=="00"
    ATTRS{bNumEndpoints}=="06"
    ATTRS{supports_autosuspend}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceNumber}=="00"

and another port on the same device:
  looking at device
'/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.0/ttyUSB8/tty/ttyUSB8':
    KERNEL=="ttyUSB8"
    SUBSYSTEM=="tty"
    DRIVER==""

  looking at parent device
'/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.0/ttyUSB8':
    KERNELS=="ttyUSB8"
    SUBSYSTEMS=="usb-serial"
    DRIVERS=="keyspan_4"
    ATTRS{port_number}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.0':
    KERNELS=="2-5:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="keyspan"
    ATTRS{bInterfaceClass}=="ff"
    ATTRS{bInterfaceSubClass}=="00"
    ATTRS{bInterfaceProtocol}=="00"
    ATTRS{bNumEndpoints}=="06"
    ATTRS{supports_autosuspend}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceNumber}=="00"

So, if I just want to create a symlink, I could match on
KERNELS=="ttyUSB*", ATTRS{port_number}=="blah" and be good, however
since things sometimes become resorted, I'd like to match on both the
usb port (in the below stanza's KERNELS) and the 'port_number' in the
one above. How do I do that?
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux