Re: cosmetic udev glitches

2010-03-03 Thread Simon Thum
Julien Cristau wrote:
 This is also expected at the moment.  The enumeration of devices gives
 us /dev/input/event* (which evdev can handle), and
 /dev/input/{mouse,kbd}* (which it doesn't).  This results in a couple
 error messages for the latter.  It should be possible to tone those down
 so users don't get scared…
Thanks for the clarification! I applied Peter's MatchDevicePath
/dev/input/event* which is probably better than making polite drivers.

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: cosmetic udev glitches

2010-03-03 Thread Julien Cristau
On Tue, Mar  2, 2010 at 14:47:22 -0800, Dan Nicholson wrote:

 From: Dan Nicholson dbn.li...@gmail.com
 Date: Tue, 2 Mar 2010 14:42:22 -0800
 Subject: [PATCH] config/udev: Get product name from attribute instead of 
 uevent
 
 The input device product name in the kernel uevent has embedded quotes
 that aren't expected here. Use the sysfs name attribute instead, which
 does not suffer this problem.
 
 Signed-off-by: Dan Nicholson dbn.li...@gmail.com

Acked-by: Julien Cristau jcris...@debian.org

Thanks, Dan.

Cheers,
Julien
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: cosmetic udev glitches

2010-03-03 Thread Thomas Jaeger
The attribute 'name' might not exist (as in the case of serial wacom
devices) and it's impossible to set it in an udev rule, I believe, so we
should at least fall back to the NAME property if the attribute is not
available.

Tom

On 03/02/2010 05:47 PM, Dan Nicholson wrote:
 On Tue, Mar 02, 2010 at 05:57:04PM +0100, Simon Thum wrote:
 
 Can you try the patch below that uses the name attribute instead of the
 value from the uevent? I ran it through a little test app, but not in X.
 
 Dan
 
 From c01a4e6dce7196a60b5247dde78054b27e004494 Mon Sep 17 00:00:00 2001
 From: Dan Nicholson dbn.li...@gmail.com
 Date: Tue, 2 Mar 2010 14:42:22 -0800
 Subject: [PATCH] config/udev: Get product name from attribute instead of 
 uevent
 
 The input device product name in the kernel uevent has embedded quotes
 that aren't expected here. Use the sysfs name attribute instead, which
 does not suffer this problem.
 
 Signed-off-by: Dan Nicholson dbn.li...@gmail.com
 ---
  config/udev.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/config/udev.c b/config/udev.c
 index 69257e9..54306ef 100644
 --- a/config/udev.c
 +++ b/config/udev.c
 @@ -74,7 +74,7 @@ device_added(struct udev_device *udev_device)
  
  parent = udev_device_get_parent(udev_device);
  if (parent)
 -name = udev_device_get_property_value(parent, NAME);
 +name = udev_device_get_sysattr_value(parent, name);
  if (!name)
  name = (unnamed);
  else

From 8e791dbd4ad96c64802e864ff100f6342734a40c Mon Sep 17 00:00:00 2001
From: Dan Nicholson dbn.li...@gmail.com
Date: Tue, 2 Mar 2010 14:42:22 -0800
Subject: [PATCH] config/udev: Get product name from attribute instead of uevent

The input device product name in the kernel uevent has embedded quotes
that aren't expected here. Use the sysfs name attribute instead, which
does not suffer this problem. Fall back to the NAME property if the
attribute is not available.

Signed-off-by: Thomas Jaeger thjae...@gmail.com
---
 config/udev.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/config/udev.c b/config/udev.c
index 69257e9..452fb5a 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -73,8 +73,11 @@ device_added(struct udev_device *udev_device)
 goto unwind;
 
 parent = udev_device_get_parent(udev_device);
-if (parent)
-name = udev_device_get_property_value(parent, NAME);
+if (parent) {
+name = udev_device_get_sysattr_value(parent, name);
+if (!name)
+name = udev_device_get_property_value(parent, NAME);
+}
 if (!name)
 name = (unnamed);
 else
-- 
1.7.0

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: cosmetic udev glitches

2010-03-03 Thread Dan Nicholson
On Wed, Mar 3, 2010 at 4:00 PM, Thomas Jaeger thjae...@gmail.com wrote:
 The attribute 'name' might not exist (as in the case of serial wacom
 devices) and it's impossible to set it in an udev rule, I believe, so we
 should at least fall back to the NAME property if the attribute is not
 available.

Not for the parent, either? Does hal give you anything for
info.product/input.product?

--
Dan
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: cosmetic udev glitches

2010-03-03 Thread Thomas Jaeger
On 03/03/2010 07:48 PM, Dan Nicholson wrote:
 On Wed, Mar 3, 2010 at 4:00 PM, Thomas Jaeger thjae...@gmail.com wrote:
 The attribute 'name' might not exist (as in the case of serial wacom
 devices) and it's impossible to set it in an udev rule, I believe, so we
 should at least fall back to the NAME property if the attribute is not
 available.
 
 Not for the parent, either? Does hal give you anything for
 info.product/input.product?

Sorry, I don't know, I don't have a working hal installation anymore.
Here's what udev knows about the device, though:

udevadm info --path=/sys/class/tty/ttyS0/ --attribute-walk

...

  looking at device '/devices/pnp0/00:0a/tty/ttyS0':
KERNEL==ttyS0
SUBSYSTEM==tty
DRIVER==

  looking at parent device '/devices/pnp0/00:0a':
KERNELS==00:0a
SUBSYSTEMS==pnp
DRIVERS==serial
ATTRS{id}==WACf004

  looking at parent device '/devices/pnp0':
KERNELS==pnp0
SUBSYSTEMS==
DRIVERS==

Tom
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: cosmetic udev glitches

2010-03-03 Thread Thomas Jaeger
On 03/03/2010 08:25 PM, Dan Nicholson wrote:
 On Wed, Mar 3, 2010 at 4:59 PM, Thomas Jaeger thjae...@gmail.com wrote:
 On 03/03/2010 07:48 PM, Dan Nicholson wrote:
 On Wed, Mar 3, 2010 at 4:00 PM, Thomas Jaeger thjae...@gmail.com wrote:
 The attribute 'name' might not exist (as in the case of serial wacom
 devices) and it's impossible to set it in an udev rule, I believe, so we
 should at least fall back to the NAME property if the attribute is not
 available.

 Not for the parent, either? Does hal give you anything for
 info.product/input.product?

 Sorry, I don't know, I don't have a working hal installation anymore.
 Here's what udev knows about the device, though:

 udevadm info --path=/sys/class/tty/ttyS0/ --attribute-walk

 ...
 
 But you do get NAME in the uevent? You can find this from udevadm
 info --export-db.

Well, sort of. I set NAME in my own udev rule where I filter by pnp id.

 Seems reasonable, though. I guess we need an additional:
 
 if (!name)
 name = udev_device_get_property_value(parent, NAME);
 

Yup, that's what I thought, too.

Tom
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


cosmetic udev glitches

2010-03-02 Thread Simon Thum
Hi all,

I just upgraded my X to use udev. It generally went fine, but  I noticed
two minor issues:

At first, the device names have quotation marks. As in

xinput list
...
⎜ ImExPS/2 Logitech Wheel Mouse   id=7[slave  pointer
 (2)]

I looked up the source, but found nothing obvious. Is this expected
behavior?

Second, udev seems to add my mouse (and others) twice, resulting in some
log spam. Excerpt:

[  5571.537] (II) config/udev: Adding input device ImExPS/2 Logitech
Wheel Mouse (/dev/input/event3)
(...)
[  5571.538] (II) XINPUT: Adding extended input device ImExPS/2
Logitech Wheel Mouse (type: MOUSE)
[  5571.538] (II) ImExPS/2 Logitech Wheel Mouse: initialized for
relative axes.
[  5571.538] (II) config/udev: Adding input device ImExPS/2 Logitech
Wheel Mouse (/dev/input/mouse0)
[  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: Applying InputClass
evdev catchall
[  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: always reports core
events
[  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: Device:
/dev/input/mouse0
[  5571.539] (EE) ioctl EVIOCGNAME failed: Inappropriate ioctl for device
[  5571.539] (II) UnloadModule: evdev
[  5571.539] (EE) PreInit returned NULL for ImExPS/2 Logitech Wheel
Mouse


Things work fine here, I just wanted to make sure whether my
configuration is broken or these are known issues.

In case it helps, I did:
udevadm info --attribute-walk --name /dev/input/mouse0

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/i8042/serio1/input/input3/mouse0':
KERNEL==mouse0
SUBSYSTEM==input
DRIVER==

  looking at parent device '/devices/platform/i8042/serio1/input/input3':
KERNELS==input3
SUBSYSTEMS==input
DRIVERS==
ATTRS{name}==ImExPS/2 Logitech Wheel Mouse
ATTRS{phys}==isa0060/serio1/input0
ATTRS{uniq}==

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: cosmetic udev glitches

2010-03-02 Thread Julien Cristau
On Tue, Mar  2, 2010 at 17:57:04 +0100, Simon Thum wrote:

 Hi all,
 
 I just upgraded my X to use udev. It generally went fine, but  I noticed
 two minor issues:
 
 At first, the device names have quotation marks. As in
 
 xinput list
 ...
 ⎜ ImExPS/2 Logitech Wheel Mouse   id=7[slave  pointer
  (2)]
 
 I looked up the source, but found nothing obvious. Is this expected
 behavior?
 
Yes, the device names we get from udev have quotations marks.  I don't
know why, and I didn't feel like mangling them.

 Second, udev seems to add my mouse (and others) twice, resulting in some
 log spam. Excerpt:
 
 [  5571.537] (II) config/udev: Adding input device ImExPS/2 Logitech
 Wheel Mouse (/dev/input/event3)
 (...)
 [  5571.538] (II) XINPUT: Adding extended input device ImExPS/2
 Logitech Wheel Mouse (type: MOUSE)
 [  5571.538] (II) ImExPS/2 Logitech Wheel Mouse: initialized for
 relative axes.
 [  5571.538] (II) config/udev: Adding input device ImExPS/2 Logitech
 Wheel Mouse (/dev/input/mouse0)
 [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: Applying InputClass
 evdev catchall
 [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: always reports core
 events
 [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: Device:
 /dev/input/mouse0
 [  5571.539] (EE) ioctl EVIOCGNAME failed: Inappropriate ioctl for device
 [  5571.539] (II) UnloadModule: evdev
 [  5571.539] (EE) PreInit returned NULL for ImExPS/2 Logitech Wheel
 Mouse
 
 
 Things work fine here, I just wanted to make sure whether my
 configuration is broken or these are known issues.
 
This is also expected at the moment.  The enumeration of devices gives
us /dev/input/event* (which evdev can handle), and
/dev/input/{mouse,kbd}* (which it doesn't).  This results in a couple
error messages for the latter.  It should be possible to tone those down
so users don't get scared…

Cheers,
Julien
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: cosmetic udev glitches

2010-03-02 Thread Dan Nicholson
On Tue, Mar 2, 2010 at 9:28 AM, Julien Cristau jcris...@debian.org wrote:
 On Tue, Mar  2, 2010 at 17:57:04 +0100, Simon Thum wrote:

 Hi all,

 I just upgraded my X to use udev. It generally went fine, but  I noticed
 two minor issues:

 At first, the device names have quotation marks. As in

 xinput list
 ...
 ⎜     ImExPS/2 Logitech Wheel Mouse           id=7    [slave  pointer
  (2)]

 I looked up the source, but found nothing obvious. Is this expected
 behavior?

 Yes, the device names we get from udev have quotations marks.  I don't
 know why, and I didn't feel like mangling them.

It seems to come straight from the kernel (drivers/input/input.c),
which adds the quotes around the value in NAME to the uevent. Maybe we
should ask them not to do that. Looks like this was changed back in
2005, commit a7fadbe10ccf430e7a8add8b45c561d864087343.

However, I think we should try to be compatible with info.product from
hal. This would require some amount of mangling. What hal does is:

1. Get the name directly from the sysfs name file (no quotes there)
2. Strip trailing whitespace

 Second, udev seems to add my mouse (and others) twice, resulting in some
 log spam. Excerpt:

 [  5571.537] (II) config/udev: Adding input device ImExPS/2 Logitech
 Wheel Mouse (/dev/input/event3)
 (...)
 [  5571.538] (II) XINPUT: Adding extended input device ImExPS/2
 Logitech Wheel Mouse (type: MOUSE)
 [  5571.538] (II) ImExPS/2 Logitech Wheel Mouse: initialized for
 relative axes.
 [  5571.538] (II) config/udev: Adding input device ImExPS/2 Logitech
 Wheel Mouse (/dev/input/mouse0)
 [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: Applying InputClass
 evdev catchall
 [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: always reports core
 events
 [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: Device:
 /dev/input/mouse0
 [  5571.539] (EE) ioctl EVIOCGNAME failed: Inappropriate ioctl for device
 [  5571.539] (II) UnloadModule: evdev
 [  5571.539] (EE) PreInit returned NULL for ImExPS/2 Logitech Wheel
 Mouse


 Things work fine here, I just wanted to make sure whether my
 configuration is broken or these are known issues.

 This is also expected at the moment.  The enumeration of devices gives
 us /dev/input/event* (which evdev can handle), and
 /dev/input/{mouse,kbd}* (which it doesn't).  This results in a couple
 error messages for the latter.  It should be possible to tone those down
 so users don't get scared…

The other thing hal does here is ignore all devices except those where
the sysfs path ends in event%d. Maybe we should do the same.

--
Dan
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: cosmetic udev glitches

2010-03-02 Thread Peter Hutterer
On Tue, Mar 02, 2010 at 01:01:53PM -0800, Dan Nicholson wrote:
 On Tue, Mar 2, 2010 at 9:28 AM, Julien Cristau jcris...@debian.org wrote:
  On Tue, Mar  2, 2010 at 17:57:04 +0100, Simon Thum wrote:
 
  Hi all,
 
  I just upgraded my X to use udev. It generally went fine, but  I noticed
  two minor issues:
 
  At first, the device names have quotation marks. As in
 
  xinput list
  ...
  ⎜     ImExPS/2 Logitech Wheel Mouse           id=7    [slave  pointer
   (2)]
 
  I looked up the source, but found nothing obvious. Is this expected
  behavior?
 
  Yes, the device names we get from udev have quotations marks.  I don't
  know why, and I didn't feel like mangling them.
 
 It seems to come straight from the kernel (drivers/input/input.c),
 which adds the quotes around the value in NAME to the uevent. Maybe we
 should ask them not to do that. Looks like this was changed back in
 2005, commit a7fadbe10ccf430e7a8add8b45c561d864087343.
 
 However, I think we should try to be compatible with info.product from
 hal. This would require some amount of mangling. What hal does is:
 
 1. Get the name directly from the sysfs name file (no quotes there)
 2. Strip trailing whitespace
 
  Second, udev seems to add my mouse (and others) twice, resulting in some
  log spam. Excerpt:
 
  [  5571.537] (II) config/udev: Adding input device ImExPS/2 Logitech
  Wheel Mouse (/dev/input/event3)
  (...)
  [  5571.538] (II) XINPUT: Adding extended input device ImExPS/2
  Logitech Wheel Mouse (type: MOUSE)
  [  5571.538] (II) ImExPS/2 Logitech Wheel Mouse: initialized for
  relative axes.
  [  5571.538] (II) config/udev: Adding input device ImExPS/2 Logitech
  Wheel Mouse (/dev/input/mouse0)
  [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: Applying InputClass
  evdev catchall
  [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: always reports core
  events
  [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: Device:
  /dev/input/mouse0
  [  5571.539] (EE) ioctl EVIOCGNAME failed: Inappropriate ioctl for device
  [  5571.539] (II) UnloadModule: evdev
  [  5571.539] (EE) PreInit returned NULL for ImExPS/2 Logitech Wheel
  Mouse
 
 
  Things work fine here, I just wanted to make sure whether my
  configuration is broken or these are known issues.
 
  This is also expected at the moment.  The enumeration of devices gives
  us /dev/input/event* (which evdev can handle), and
  /dev/input/{mouse,kbd}* (which it doesn't).  This results in a couple
  error messages for the latter.  It should be possible to tone those down
  so users don't get scared…
 
 The other thing hal does here is ignore all devices except those where
 the sysfs path ends in event%d. Maybe we should do the same.

not really, this is a configration issue. by default the server doesn't do
anything unless an input class is specified. In this case, the evdev driver
shouldn't be assigned to the mouse0 device.
In Fedora we ship the evdev catchall rule with MatchDevicePatch
/dev/input/event* to avoid the above error messages.

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: cosmetic udev glitches

2010-03-02 Thread Dan Nicholson
On Tue, Mar 02, 2010 at 05:57:04PM +0100, Simon Thum wrote:
 Hi all,
 
 I just upgraded my X to use udev. It generally went fine, but  I noticed
 two minor issues:
 
 At first, the device names have quotation marks. As in
 
 xinput list
 ...
 ⎜ ImExPS/2 Logitech Wheel Mouse   id=7[slave  pointer
  (2)]
 
 I looked up the source, but found nothing obvious. Is this expected
 behavior?
 
 Second, udev seems to add my mouse (and others) twice, resulting in some
 log spam. Excerpt:
 
 [  5571.537] (II) config/udev: Adding input device ImExPS/2 Logitech
 Wheel Mouse (/dev/input/event3)
 (...)
 [  5571.538] (II) XINPUT: Adding extended input device ImExPS/2
 Logitech Wheel Mouse (type: MOUSE)
 [  5571.538] (II) ImExPS/2 Logitech Wheel Mouse: initialized for
 relative axes.
 [  5571.538] (II) config/udev: Adding input device ImExPS/2 Logitech
 Wheel Mouse (/dev/input/mouse0)
 [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: Applying InputClass
 evdev catchall
 [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: always reports core
 events
 [  5571.538] (**) ImExPS/2 Logitech Wheel Mouse: Device:
 /dev/input/mouse0
 [  5571.539] (EE) ioctl EVIOCGNAME failed: Inappropriate ioctl for device
 [  5571.539] (II) UnloadModule: evdev
 [  5571.539] (EE) PreInit returned NULL for ImExPS/2 Logitech Wheel
 Mouse
 
 
 Things work fine here, I just wanted to make sure whether my
 configuration is broken or these are known issues.
 
 In case it helps, I did:
 udevadm info --attribute-walk --name /dev/input/mouse0
 
 Udevadm info starts with the device specified by the devpath and then
 walks up the chain of parent devices. It prints for every device
 found, all possible attributes in the udev rules key format.
 A rule to match, can be composed by the attributes of the device
 and the attributes from one single parent device.
 
   looking at device '/devices/platform/i8042/serio1/input/input3/mouse0':
 KERNEL==mouse0
 SUBSYSTEM==input
 DRIVER==
 
   looking at parent device '/devices/platform/i8042/serio1/input/input3':
 KERNELS==input3
 SUBSYSTEMS==input
 DRIVERS==
 ATTRS{name}==ImExPS/2 Logitech Wheel Mouse
 ATTRS{phys}==isa0060/serio1/input0
 ATTRS{uniq}==

Can you try the patch below that uses the name attribute instead of the
value from the uevent? I ran it through a little test app, but not in X.

Dan

From c01a4e6dce7196a60b5247dde78054b27e004494 Mon Sep 17 00:00:00 2001
From: Dan Nicholson dbn.li...@gmail.com
Date: Tue, 2 Mar 2010 14:42:22 -0800
Subject: [PATCH] config/udev: Get product name from attribute instead of uevent

The input device product name in the kernel uevent has embedded quotes
that aren't expected here. Use the sysfs name attribute instead, which
does not suffer this problem.

Signed-off-by: Dan Nicholson dbn.li...@gmail.com
---
 config/udev.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/config/udev.c b/config/udev.c
index 69257e9..54306ef 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -74,7 +74,7 @@ device_added(struct udev_device *udev_device)
 
 parent = udev_device_get_parent(udev_device);
 if (parent)
-name = udev_device_get_property_value(parent, NAME);
+name = udev_device_get_sysattr_value(parent, name);
 if (!name)
 name = (unnamed);
 else
-- 
1.6.6.1
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: cosmetic udev glitches

2010-03-02 Thread Peter Hutterer
On Tue, Mar 02, 2010 at 02:47:22PM -0800, Dan Nicholson wrote:
 Can you try the patch below that uses the name attribute instead of the
 value from the uevent? I ran it through a little test app, but not in X.
 
 From c01a4e6dce7196a60b5247dde78054b27e004494 Mon Sep 17 00:00:00 2001
 From: Dan Nicholson dbn.li...@gmail.com
 Date: Tue, 2 Mar 2010 14:42:22 -0800
 Subject: [PATCH] config/udev: Get product name from attribute instead of 
 uevent
 
 The input device product name in the kernel uevent has embedded quotes
 that aren't expected here. Use the sysfs name attribute instead, which
 does not suffer this problem.
 
 Signed-off-by: Dan Nicholson dbn.li...@gmail.com
 ---
  config/udev.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/config/udev.c b/config/udev.c
 index 69257e9..54306ef 100644
 --- a/config/udev.c
 +++ b/config/udev.c
 @@ -74,7 +74,7 @@ device_added(struct udev_device *udev_device)
  
  parent = udev_device_get_parent(udev_device);
  if (parent)
 -name = udev_device_get_property_value(parent, NAME);
 +name = udev_device_get_sysattr_value(parent, name);
  if (!name)
  name = (unnamed);
  else
 -- 
 1.6.6.1

Reviewed-by: Peter Hutterer peter.hutte...@who-t.net

tested too.

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: cosmetic udev glitches

2010-03-02 Thread Dan Nicholson
On Tue, Mar 2, 2010 at 4:16 PM, Peter Hutterer peter.hutte...@who-t.net wrote:
 On Tue, Mar 02, 2010 at 02:47:22PM -0800, Dan Nicholson wrote:
 Can you try the patch below that uses the name attribute instead of the
 value from the uevent? I ran it through a little test app, but not in X.

 From c01a4e6dce7196a60b5247dde78054b27e004494 Mon Sep 17 00:00:00 2001
 From: Dan Nicholson dbn.li...@gmail.com
 Date: Tue, 2 Mar 2010 14:42:22 -0800
 Subject: [PATCH] config/udev: Get product name from attribute instead of 
 uevent

 The input device product name in the kernel uevent has embedded quotes
 that aren't expected here. Use the sysfs name attribute instead, which
 does not suffer this problem.

 Signed-off-by: Dan Nicholson dbn.li...@gmail.com
 ---
  config/udev.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

 diff --git a/config/udev.c b/config/udev.c
 index 69257e9..54306ef 100644
 --- a/config/udev.c
 +++ b/config/udev.c
 @@ -74,7 +74,7 @@ device_added(struct udev_device *udev_device)

      parent = udev_device_get_parent(udev_device);
      if (parent)
 -        name = udev_device_get_property_value(parent, NAME);
 +        name = udev_device_get_sysattr_value(parent, name);
      if (!name)
          name = (unnamed);
      else
 --
 1.6.6.1

 Reviewed-by: Peter Hutterer peter.hutte...@who-t.net

 tested too.

Is this on rawhide with udev-151? When I tried it against the udev on
f12, it was replacing the spaces in the name with underscores. I can't
figure out why, but when I ran it against a vanilla udev 145 or git,
it worked fine.

--
Dan
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: cosmetic udev glitches

2010-03-02 Thread Peter Hutterer
On Tue, Mar 02, 2010 at 04:29:41PM -0800, Dan Nicholson wrote:
 On Tue, Mar 2, 2010 at 4:16 PM, Peter Hutterer peter.hutte...@who-t.net 
 wrote:
  On Tue, Mar 02, 2010 at 02:47:22PM -0800, Dan Nicholson wrote:
  Can you try the patch below that uses the name attribute instead of the
  value from the uevent? I ran it through a little test app, but not in X.
 
  From c01a4e6dce7196a60b5247dde78054b27e004494 Mon Sep 17 00:00:00 2001
  From: Dan Nicholson dbn.li...@gmail.com
  Date: Tue, 2 Mar 2010 14:42:22 -0800
  Subject: [PATCH] config/udev: Get product name from attribute instead of 
  uevent
 
  The input device product name in the kernel uevent has embedded quotes
  that aren't expected here. Use the sysfs name attribute instead, which
  does not suffer this problem.
 
  Signed-off-by: Dan Nicholson dbn.li...@gmail.com
  ---
   config/udev.c |    2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)
 
  diff --git a/config/udev.c b/config/udev.c
  index 69257e9..54306ef 100644
  --- a/config/udev.c
  +++ b/config/udev.c
  @@ -74,7 +74,7 @@ device_added(struct udev_device *udev_device)
 
       parent = udev_device_get_parent(udev_device);
       if (parent)
  -        name = udev_device_get_property_value(parent, NAME);
  +        name = udev_device_get_sysattr_value(parent, name);
       if (!name)
           name = (unnamed);
       else
  --
  1.6.6.1
 
  Reviewed-by: Peter Hutterer peter.hutte...@who-t.net
 
  tested too.
 
 Is this on rawhide with udev-151? When I tried it against the udev on
 f12, it was replacing the spaces in the name with underscores. I can't
 figure out why, but when I ran it against a vanilla udev 145 or git,
 it worked fine.

This was on F12 (X server from git) and I don't see the underscore issue you
mentioned. Updates-testing from yesterday.
Not quite sure where that comes from tbh.

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: cosmetic udev glitches

2010-03-02 Thread Dan Nicholson
On Wed, Mar 03, 2010 at 10:40:16AM +1000, Peter Hutterer wrote:
 On Tue, Mar 02, 2010 at 04:29:41PM -0800, Dan Nicholson wrote:
  On Tue, Mar 2, 2010 at 4:16 PM, Peter Hutterer peter.hutte...@who-t.net 
  wrote:
   On Tue, Mar 02, 2010 at 02:47:22PM -0800, Dan Nicholson wrote:
   Can you try the patch below that uses the name attribute instead of the
   value from the uevent? I ran it through a little test app, but not in X.
  
   From c01a4e6dce7196a60b5247dde78054b27e004494 Mon Sep 17 00:00:00 2001
   From: Dan Nicholson dbn.li...@gmail.com
   Date: Tue, 2 Mar 2010 14:42:22 -0800
   Subject: [PATCH] config/udev: Get product name from attribute instead of 
   uevent
  
   The input device product name in the kernel uevent has embedded quotes
   that aren't expected here. Use the sysfs name attribute instead, which
   does not suffer this problem.
  
   Signed-off-by: Dan Nicholson dbn.li...@gmail.com
   ---
    config/udev.c |    2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)
  
   diff --git a/config/udev.c b/config/udev.c
   index 69257e9..54306ef 100644
   --- a/config/udev.c
   +++ b/config/udev.c
   @@ -74,7 +74,7 @@ device_added(struct udev_device *udev_device)
  
        parent = udev_device_get_parent(udev_device);
        if (parent)
   -        name = udev_device_get_property_value(parent, NAME);
   +        name = udev_device_get_sysattr_value(parent, name);
        if (!name)
            name = (unnamed);
        else
   --
   1.6.6.1
  
   Reviewed-by: Peter Hutterer peter.hutte...@who-t.net
  
   tested too.
  
  Is this on rawhide with udev-151? When I tried it against the udev on
  f12, it was replacing the spaces in the name with underscores. I can't
  figure out why, but when I ran it against a vanilla udev 145 or git,
  it worked fine.
 
 This was on F12 (X server from git) and I don't see the underscore issue you
 mentioned. Updates-testing from yesterday.
 Not quite sure where that comes from tbh.

Never mind. I don't know what I doing, but it's working now. Here's my
little test app for reference. You have to pass it the sysfs device path.

--
Dan

#include stdlib.h
#include stdio.h
#include string.h

#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE 1
#include libudev.h

int main(int argc, char *argv[])
{
struct udev *udev;
struct udev_device *device, *parent;
const char *path, *name;

if (argc  2) {
fprintf(stderr, No device path specified\n);
exit(EXIT_FAILURE);
}
path = argv[1];

udev = udev_new();
device = udev_device_new_from_syspath(udev, path);
if (!device) {
fprintf(stderr, Device not found from path \%s\\n, path);
exit(EXIT_FAILURE);
}
parent = udev_device_get_parent(device);
if (!parent)
parent = device;
name = udev_device_get_sysattr_value(parent, name);
printf(%s: \%s\\n, path, name);

udev_device_unref(device);
udev_unref(udev);

return 0;
}
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg