linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: shawn wilson <ag4ve.us@gmail.com>
To: linux-hotplug@vger.kernel.org
Subject: multi-port usb-serial hub rules
Date: Sun, 06 Jul 2014 02:18:31 +0000	[thread overview]
Message-ID: <CAH_OBifAqr0H+u4j77WGDHLA03jFrTAEjSKfbTvzQiakd5ZAvw@mail.gmail.com> (raw)

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?

             reply	other threads:[~2014-07-06  2:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-06  2:18 shawn wilson [this message]
2014-07-06  3:31 ` multi-port usb-serial hub rules Greg KH
2014-07-06  5:11 ` shawn wilson
2014-07-06 16:07 ` Andrey Borzenkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH_OBifAqr0H+u4j77WGDHLA03jFrTAEjSKfbTvzQiakd5ZAvw@mail.gmail.com \
    --to=ag4ve.us@gmail.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).