* multi-port usb-serial hub rules
@ 2014-07-06 2:18 shawn wilson
2014-07-06 3:31 ` Greg KH
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: shawn wilson @ 2014-07-06 2:18 UTC (permalink / raw)
To: linux-hotplug
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?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: multi-port usb-serial hub rules
2014-07-06 2:18 multi-port usb-serial hub rules shawn wilson
@ 2014-07-06 3:31 ` Greg KH
2014-07-06 5:11 ` shawn wilson
2014-07-06 16:07 ` Andrey Borzenkov
2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2014-07-06 3:31 UTC (permalink / raw)
To: linux-hotplug
On Sat, Jul 05, 2014 at 10:18:31PM -0400, shawn wilson wrote:
> 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):
What's wrong with the symlinks that show up in /dev/serial/ that should
be "persistent"?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: multi-port usb-serial hub rules
2014-07-06 2:18 multi-port usb-serial hub rules shawn wilson
2014-07-06 3:31 ` Greg KH
@ 2014-07-06 5:11 ` shawn wilson
2014-07-06 16:07 ` Andrey Borzenkov
2 siblings, 0 replies; 4+ messages in thread
From: shawn wilson @ 2014-07-06 5:11 UTC (permalink / raw)
To: linux-hotplug
On Sat, Jul 5, 2014 at 11:31 PM, Greg KH <greg@kroah.com> wrote:
> On Sat, Jul 05, 2014 at 10:18:31PM -0400, shawn wilson wrote:
>> 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):
>
> What's wrong with the symlinks that show up in /dev/serial/ that should
> be "persistent"?
>
Yes, I think that'll work (though if it's possible, it would be cool
to figure out how to write the udev rule for it).
This is weird too (I think probably a bug?):
# ls /dev/serial/by-path/ -l
total 0
lrwxrwxrwx 1 root root 13 Jun 19 12:55
pci-0000:00:1d.7-usb-0:3:1.0-port0 -> ../../ttyUSB0
lrwxrwxrwx 1 root root 13 Jun 19 12:55
pci-0000:00:1d.7-usb-0:3:1.0-port1 -> ../../ttyUSB1
lrwxrwxrwx 1 root root 13 Jun 19 12:55
pci-0000:00:1d.7-usb-0:3:1.0-port2 -> ../../ttyUSB2
lrwxrwxrwx 1 root root 13 Jun 19 12:55
pci-0000:00:1d.7-usb-0:3:1.0-port3 -> ../../ttyUSB3
lrwxrwxrwx 1 root root 13 Jun 19 12:55
pci-0000:00:1d.7-usb-0:4:1.0-port0 -> ../../ttyUSB4
lrwxrwxrwx 1 root root 13 Jun 19 12:55
pci-0000:00:1d.7-usb-0:4:1.0-port1 -> ../../ttyUSB5
lrwxrwxrwx 1 root root 13 Jun 19 12:55
pci-0000:00:1d.7-usb-0:4:1.0-port2 -> ../../ttyUSB6
lrwxrwxrwx 1 root root 13 Jun 19 12:55
pci-0000:00:1d.7-usb-0:4:1.0-port3 -> ../../ttyUSB7
lrwxrwxrwx 1 root root 13 Jun 19 12:55
pci-0000:00:1d.7-usb-0:5:1.0-port0 -> ../../ttyUSB8
lrwxrwxrwx 1 root root 13 Jun 19 12:55
pci-0000:00:1d.7-usb-0:5:1.0-port1 -> ../../ttyUSB9
lrwxrwxrwx 1 root root 14 Jun 19 12:55
pci-0000:00:1d.7-usb-0:5:1.0-port2 -> ../../ttyUSB10
lrwxrwxrwx 1 root root 14 Jun 19 12:55
pci-0000:00:1d.7-usb-0:5:1.0-port3 -> ../../ttyUSB11
lrwxrwxrwx 1 root root 14 Jun 19 12:55
pci-0000:00:1d.7-usb-0:6:1.0-port0 -> ../../ttyUSB12
lrwxrwxrwx 1 root root 14 Jun 19 12:55
pci-0000:00:1d.7-usb-0:6:1.0-port1 -> ../../ttyUSB13
lrwxrwxrwx 1 root root 14 Jun 19 12:55
pci-0000:00:1d.7-usb-0:6:1.0-port2 -> ../../ttyUSB14
lrwxrwxrwx 1 root root 14 Jun 19 12:55
pci-0000:00:1d.7-usb-0:6:1.0-port3 -> ../../ttyUSB15
# ls /dev/serial/by-id/ -l
total 0
lrwxrwxrwx 1 root root 14 Jun 19 12:55
usb-Keyspan__a_division_of_InnoSys_Inc._Keyspan_USA-49WG-if00-port0 ->
../../ttyUSB12
lrwxrwxrwx 1 root root 13 Jun 19 12:55
usb-Keyspan__a_division_of_InnoSys_Inc._Keyspan_USA-49WG-if00-port1 ->
../../ttyUSB9
lrwxrwxrwx 1 root root 14 Jun 19 12:55
usb-Keyspan__a_division_of_InnoSys_Inc._Keyspan_USA-49WG-if00-port2 ->
../../ttyUSB14
lrwxrwxrwx 1 root root 13 Jun 19 12:55
usb-Keyspan__a_division_of_InnoSys_Inc._Keyspan_USA-49WG-if00-port3 ->
../../ttyUSB7
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: multi-port usb-serial hub rules
2014-07-06 2:18 multi-port usb-serial hub rules shawn wilson
2014-07-06 3:31 ` Greg KH
2014-07-06 5:11 ` shawn wilson
@ 2014-07-06 16:07 ` Andrey Borzenkov
2 siblings, 0 replies; 4+ messages in thread
From: Andrey Borzenkov @ 2014-07-06 16:07 UTC (permalink / raw)
To: linux-hotplug
В Sun, 6 Jul 2014 01:11:54 -0400
shawn wilson <ag4ve.us@gmail.com> пишет:
> On Sat, Jul 5, 2014 at 11:31 PM, Greg KH <greg@kroah.com> wrote:
> > On Sat, Jul 05, 2014 at 10:18:31PM -0400, shawn wilson wrote:
> >> 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):
> >
> > What's wrong with the symlinks that show up in /dev/serial/ that should
> > be "persistent"?
> >
>
> Yes, I think that'll work (though if it's possible, it would be cool
> to figure out how to write the udev rule for it).
>
> This is weird too (I think probably a bug?):
More likely that your device does not provide serial number, so
basically last link in serial/by-id wins in random order.
> # ls /dev/serial/by-path/ -l
> total 0
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:3:1.0-port0 -> ../../ttyUSB0
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:3:1.0-port1 -> ../../ttyUSB1
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:3:1.0-port2 -> ../../ttyUSB2
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:3:1.0-port3 -> ../../ttyUSB3
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:4:1.0-port0 -> ../../ttyUSB4
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:4:1.0-port1 -> ../../ttyUSB5
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:4:1.0-port2 -> ../../ttyUSB6
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:4:1.0-port3 -> ../../ttyUSB7
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:5:1.0-port0 -> ../../ttyUSB8
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:5:1.0-port1 -> ../../ttyUSB9
> lrwxrwxrwx 1 root root 14 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:5:1.0-port2 -> ../../ttyUSB10
> lrwxrwxrwx 1 root root 14 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:5:1.0-port3 -> ../../ttyUSB11
> lrwxrwxrwx 1 root root 14 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:6:1.0-port0 -> ../../ttyUSB12
> lrwxrwxrwx 1 root root 14 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:6:1.0-port1 -> ../../ttyUSB13
> lrwxrwxrwx 1 root root 14 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:6:1.0-port2 -> ../../ttyUSB14
> lrwxrwxrwx 1 root root 14 Jun 19 12:55
> pci-0000:00:1d.7-usb-0:6:1.0-port3 -> ../../ttyUSB15
> # ls /dev/serial/by-id/ -l
> total 0
> lrwxrwxrwx 1 root root 14 Jun 19 12:55
> usb-Keyspan__a_division_of_InnoSys_Inc._Keyspan_USA-49WG-if00-port0 ->
> ../../ttyUSB12
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> usb-Keyspan__a_division_of_InnoSys_Inc._Keyspan_USA-49WG-if00-port1 ->
> ../../ttyUSB9
> lrwxrwxrwx 1 root root 14 Jun 19 12:55
> usb-Keyspan__a_division_of_InnoSys_Inc._Keyspan_USA-49WG-if00-port2 ->
> ../../ttyUSB14
> lrwxrwxrwx 1 root root 13 Jun 19 12:55
> usb-Keyspan__a_division_of_InnoSys_Inc._Keyspan_USA-49WG-if00-port3 ->
> ../../ttyUSB7
> --
> To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-06 16:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-06 2:18 multi-port usb-serial hub rules shawn wilson
2014-07-06 3:31 ` Greg KH
2014-07-06 5:11 ` shawn wilson
2014-07-06 16:07 ` Andrey Borzenkov
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 NNTP newsgroup(s).