linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
@ 2010-08-05  1:45 Philip Tait
  2010-08-05  2:17 ` Greg KH
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Philip Tait @ 2010-08-05  1:45 UTC (permalink / raw)
  To: linux-hotplug

I have been trying to overcome the loss of the '%e' enumeration
variable to make a version of the Edgeport rules that will work with
the current version of Udev.

Old version:

BUS="usb" SYSFS{idVendor}="1608" SYSFS{idProduct}="0244"
SYSFS{serial}="*-0" NAME="%k" SYMLINK="ttyEDGE8_0_%e"
BUS="usb" SYSFS{idVendor}="1608" SYSFS{idProduct}="0244"
SYSFS{serial}="*-1" NAME="%k" SYMLINK="ttyEDGE8_1_%e"

Replacing it with '%m" doesn't work, because then the numbering is
dependent on the presence of other USB-serial devices.

I tried this:

ENV{portnum}=ATTRS{port_number}
BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-0",
NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-1",
NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-2",
NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-3",
NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`

but this didn't work, I think because the 'port_number' attribute is
defined at a different hierarchical level than the 'serial' attribute:

  looking at parent device
'/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2.4/7-2.4:1.0/ttyUSB0':
    KERNELS="ttyUSB0"
    SUBSYSTEMS="usb-serial"
    DRIVERS="edgeport_ti_2"
    ATTRS{uart_mode}="0"
    ATTRS{port_number}="0"

  looking at parent device
'/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2.4/7-2.4:1.0':
[....]

looking at parent device '/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2.4':
    KERNELS="7-2.4"
    SUBSYSTEMS="usb"
    DRIVERS="usb"
    ATTRS{configuration}=""
    ATTRS{bNumInterfaces}=" 1"
    ATTRS{bConfigurationValue}="1"
    ATTRS{bmAttributes}="e0"
    ATTRS{bMaxPower}="  0mA"
    ATTRS{urbnum}="38"
    ATTRS{idVendor}="1608"
    ATTRS{idProduct}="0244"
    ATTRS{bcdDevice}="0001"
    ATTRS{bDeviceClass}="ff"
    ATTRS{bDeviceSubClass}="00"
    ATTRS{bDeviceProtocol}="ff"
    ATTRS{bNumConfigurations}="1"
    ATTRS{bMaxPacketSize0}="8"
    ATTRS{speed}="12"
    ATTRS{busnum}="7"
    ATTRS{devnum}="18"
    ATTRS{version}=" 1.10"
    ATTRS{maxchild}="0"
    ATTRS{quirks}="0x0"
    ATTRS{authorized}="1"
    ATTRS{manufacturer}="Digi International"
    ATTRS{product}="Edgeport/8"
    ATTRS{serial}="I01846004-0"


Any clues or ideas would be welcome!

-- 
Philip J. Tait
Software Engineer, FMOS
http://subarutelescope.org

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
  2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
@ 2010-08-05  2:17 ` Greg KH
  2010-08-05  2:18 ` Greg KH
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2010-08-05  2:17 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Aug 04, 2010 at 03:45:29PM -1000, Philip Tait wrote:
> I have been trying to overcome the loss of the '%e' enumeration
> variable to make a version of the Edgeport rules that will work with
> the current version of Udev.

What version is that?  Why not upgrade to a working one?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
  2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
  2010-08-05  2:17 ` Greg KH
@ 2010-08-05  2:18 ` Greg KH
  2010-08-05  2:21 ` Philip Tait
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2010-08-05  2:18 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Aug 04, 2010 at 07:17:41PM -0700, Greg KH wrote:
> On Wed, Aug 04, 2010 at 03:45:29PM -1000, Philip Tait wrote:
> > I have been trying to overcome the loss of the '%e' enumeration
> > variable to make a version of the Edgeport rules that will work with
> > the current version of Udev.
> 
> What version is that?  Why not upgrade to a working one?

Or, better yet, just call out to a shell script or executable that
provides the needed functionality instead, if you can't upgrade udev.

hope this helps,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
  2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
  2010-08-05  2:17 ` Greg KH
  2010-08-05  2:18 ` Greg KH
@ 2010-08-05  2:21 ` Philip Tait
  2010-08-05  4:32 ` Kay Sievers
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Philip Tait @ 2010-08-05  2:21 UTC (permalink / raw)
  To: linux-hotplug

I'm using 2.6.31 - that's pretty recent, right?

Do you know why '%e' was eliminated?

I've been doing some more reading, and wondered if I need to do an
IMPORT{parent} somewhere, so that my rule sees the 'port-num' and
'serial' attributes at the same time. Not sure how to find out what
value to use for 'parent', though...

On Wed, Aug 4, 2010 at 16:17, Greg KH <greg@kroah.com> wrote:
> On Wed, Aug 04, 2010 at 03:45:29PM -1000, Philip Tait wrote:
>> I have been trying to overcome the loss of the '%e' enumeration
>> variable to make a version of the Edgeport rules that will work with
>> the current version of Udev.
>
> What version is that?  Why not upgrade to a working one?
>
> thanks,
>
> greg k-h
>



-- 
Philip J. Tait
Software Engineer, FMOS
http://subarutelescope.org

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
  2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
                   ` (2 preceding siblings ...)
  2010-08-05  2:21 ` Philip Tait
@ 2010-08-05  4:32 ` Kay Sievers
  2010-08-05 14:50 ` Greg KH
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Kay Sievers @ 2010-08-05  4:32 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Aug 5, 2010 at 03:45, Philip Tait <philip@naoj.org> wrote:
> I have been trying to overcome the loss of the '%e' enumeration
> variable to make a version of the Edgeport rules that will work with
> the current version of Udev.
>
> Old version:
>
> BUS="usb" SYSFS{idVendor}="1608" SYSFS{idProduct}="0244"
> SYSFS{serial}="*-0" NAME="%k" SYMLINK="ttyEDGE8_0_%e"
> BUS="usb" SYSFS{idVendor}="1608" SYSFS{idProduct}="0244"
> SYSFS{serial}="*-1" NAME="%k" SYMLINK="ttyEDGE8_1_%e"
>
> Replacing it with '%m" doesn't work, because then the numbering is
> dependent on the presence of other USB-serial devices.
>
> I tried this:
>
> ENV{portnum}=ATTRS{port_number}
> BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-0",
> NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
> BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-1",
> NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
> BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-2",
> NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
> BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-3",
> NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
>
> but this didn't work, I think because the 'port_number' attribute is
> defined at a different hierarchical level than the 'serial' attribute:

I guess that's all covered by the standard: /dev/serial/by-*/.

Kay

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
  2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
                   ` (3 preceding siblings ...)
  2010-08-05  4:32 ` Kay Sievers
@ 2010-08-05 14:50 ` Greg KH
  2010-08-05 19:05 ` Philip Tait
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2010-08-05 14:50 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Aug 04, 2010 at 04:21:35PM -1000, Philip Tait wrote:
> I'm using 2.6.31 - that's pretty recent, right?

That's a kernel version, not a udev version :)

And even then, no, it's almost a year old, pretty old for a kernel
release.

> Do you know why '%e' was eliminated?

What does the changelog say?

> I've been doing some more reading, and wondered if I need to do an
> IMPORT{parent} somewhere, so that my rule sees the 'port-num' and
> 'serial' attributes at the same time. Not sure how to find out what
> value to use for 'parent', though...

As Kay points out, what's wrong with /dev/serial/ ?  That should provide
you with a persistant link for serial devices like this.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
  2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
                   ` (4 preceding siblings ...)
  2010-08-05 14:50 ` Greg KH
@ 2010-08-05 19:05 ` Philip Tait
  2010-08-05 19:18 ` Philip Tait
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Philip Tait @ 2010-08-05 19:05 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Aug 4, 2010 at 18:32, Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Thu, Aug 5, 2010 at 03:45, Philip Tait <philip@naoj.org> wrote:
>> I have been trying to overcome the loss of the '%e' enumeration
>> variable to make a version of the Edgeport rules that will work with
>> the current version of Udev.
>>
>> Old version:
>>
>> BUS="usb" SYSFS{idVendor}="1608" SYSFS{idProduct}="0244"
>> SYSFS{serial}="*-0" NAME="%k" SYMLINK="ttyEDGE8_0_%e"
>> BUS="usb" SYSFS{idVendor}="1608" SYSFS{idProduct}="0244"
>> SYSFS{serial}="*-1" NAME="%k" SYMLINK="ttyEDGE8_1_%e"
>>
>> Replacing it with '%m" doesn't work, because then the numbering is
>> dependent on the presence of other USB-serial devices.
>>
>> I tried this:
>>
>> ENV{portnum}=ATTRS{port_number}
>> BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-0",
>> NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
>> BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-1",
>> NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
>> BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-2",
>> NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
>> BUS="usb",SYSFS{idVendor}="1608",SYSFS{idProduct}="0244",SYSFS{serial}="I01846004-3",
>> NAME="%k",SYMLINK="ttyEDGE8_%E{portnum}"`
>>
>> but this didn't work, I think because the 'port_number' attribute is
>> defined at a different hierarchical level than the 'serial' attribute:
>
> I guess that's all covered by the standard: /dev/serial/by-*/.

It certainly is!  Thanks for the pointer, I had no idea that
capability had been added.

I need to have this functionality on a system running Udev version
125, kernel version 2.6.26

Is it safe to update Udev to a newer version that has this capability
(say 146), (I have to keep the same kernel version), or is it better
to try to update the rules to implement this feature with version 125?

-- 
Philip J. Tait
Software Engineer, FMOS
http://subarutelescope.org

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
  2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
                   ` (5 preceding siblings ...)
  2010-08-05 19:05 ` Philip Tait
@ 2010-08-05 19:18 ` Philip Tait
  2010-08-05 19:20 ` Kay Sievers
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Philip Tait @ 2010-08-05 19:18 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Aug 5, 2010 at 04:50, Greg KH <greg@kroah.com> wrote:
> On Wed, Aug 04, 2010 at 04:21:35PM -1000, Philip Tait wrote:
>> I'm using 2.6.31 - that's pretty recent, right?
>
> That's a kernel version, not a udev version :)
>
> And even then, no, it's almost a year old, pretty old for a kernel
> release.
>
>> Do you know why '%e' was eliminated?
>
> What does the changelog say?

The changelog in the openSUSE udev 146-3.3.1 package goes back to
2006-07-04 - I could see no mention of %e being removed. However,
thanks to Kay's suggestion, seems like it is a moot point.

>> I've been doing some more reading, and wondered if I need to do an
>> IMPORT{parent} somewhere, so that my rule sees the 'port-num' and
>> 'serial' attributes at the same time. Not sure how to find out what
>> value to use for 'parent', though...
>
> As Kay points out, what's wrong with /dev/serial/ ?  That should provide
> you with a persistant link for serial devices like this.

/dev/serial/by-id/* is perfect for my needs - I had no idea it was
there!  I just need to figure out the safest way to update a Debian
Lenny configuration to get that working.

Thanks,

-- 
Philip J. Tait
Software Engineer, FMOS
http://subarutelescope.org

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
  2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
                   ` (6 preceding siblings ...)
  2010-08-05 19:18 ` Philip Tait
@ 2010-08-05 19:20 ` Kay Sievers
  2010-08-05 19:24 ` Kay Sievers
  2010-08-05 22:10 ` Philip Tait
  9 siblings, 0 replies; 11+ messages in thread
From: Kay Sievers @ 2010-08-05 19:20 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Aug 5, 2010 at 21:05, Philip Tait <philip@naoj.org> wrote:
> Is it safe to update Udev to a newer version that has this capability
> (say 146), (I have to keep the same kernel version), or is it better
> to try to update the rules to implement this feature with version 125?

It's entirely distro specific what will happen if you replace the
stock version, nobody will really be able to tell for sure what would
happen, I guess.

Maybe the rules can be backported to the old version. Here is the change:
  http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h¼4c751802147f1ff21bf52a57a2976754949453

Kay

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
  2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
                   ` (7 preceding siblings ...)
  2010-08-05 19:20 ` Kay Sievers
@ 2010-08-05 19:24 ` Kay Sievers
  2010-08-05 22:10 ` Philip Tait
  9 siblings, 0 replies; 11+ messages in thread
From: Kay Sievers @ 2010-08-05 19:24 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Aug 5, 2010 at 21:18, Philip Tait <philip@naoj.org> wrote:
> On Thu, Aug 5, 2010 at 04:50, Greg KH <greg@kroah.com> wrote:
>> On Wed, Aug 04, 2010 at 04:21:35PM -1000, Philip Tait wrote:
>>> I'm using 2.6.31 - that's pretty recent, right?
>>
>> That's a kernel version, not a udev version :)
>>
>> And even then, no, it's almost a year old, pretty old for a kernel
>> release.
>>
>>> Do you know why '%e' was eliminated?
>>
>> What does the changelog say?
>
> The changelog in the openSUSE udev 146-3.3.1 package goes back to
> 2006-07-04 - I could see no mention of %e being removed. However,
> thanks to Kay's suggestion, seems like it is a moot point.

http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h¿82b99acbc4b25fd133a88bfabf68eee23d7b0b

It's just that it produced completely unpredictable results if you
have multiple devices. There was no defined ordering.

It's basically the same problem as the uselessness of the kernel
device number, just all done again in userspace.

Kay
--
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] 11+ messages in thread

* Re: Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter)
  2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
                   ` (8 preceding siblings ...)
  2010-08-05 19:24 ` Kay Sievers
@ 2010-08-05 22:10 ` Philip Tait
  9 siblings, 0 replies; 11+ messages in thread
From: Philip Tait @ 2010-08-05 22:10 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Aug 5, 2010 at 09:20, Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Thu, Aug 5, 2010 at 21:05, Philip Tait <philip@naoj.org> wrote:
>> Is it safe to update Udev to a newer version that has this capability
>> (say 146), (I have to keep the same kernel version), or is it better
>> to try to update the rules to implement this feature with version 125?
>
> It's entirely distro specific what will happen if you replace the
> stock version, nobody will really be able to tell for sure what would
> happen, I guess.
>
> Maybe the rules can be backported to the old version. Here is the change:
>  http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h¼4c751802147f1ff21bf52a57a2976754949453

Yes, they did back-port successfully! Problem solved - many thanks.

-- 
Philip J. Tait
Software Engineer, FMOS
http://subarutelescope.org

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-08-05 22:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-05  1:45 Udev rule for Digi Edgeport 8 (multi-port USB-serial adapter) Philip Tait
2010-08-05  2:17 ` Greg KH
2010-08-05  2:18 ` Greg KH
2010-08-05  2:21 ` Philip Tait
2010-08-05  4:32 ` Kay Sievers
2010-08-05 14:50 ` Greg KH
2010-08-05 19:05 ` Philip Tait
2010-08-05 19:18 ` Philip Tait
2010-08-05 19:20 ` Kay Sievers
2010-08-05 19:24 ` Kay Sievers
2010-08-05 22:10 ` Philip Tait

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).