Gentoo Archives: gentoo-user

From: Mike Diehl <mdiehl@××××××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Need to identify USB device by port
Date: Wed, 04 Apr 2007 23:45:34
Message-Id: 200704041739.48281.mdiehl@diehlnet.com
1 Hi all.
2
3 I need to identify a device using udev by looking at which USB port it is
4 plugged into. The device doesn't have a serial number and I've got two of
5 the same type of device which I need to discriminage against.
6
7 My first try was a udev rule like: (each on one line.)
8
9 BUS=="usb" SYMLINK="mouse_1" SYSFS{manufacturer}=="Logitech"
10 PHYSDEVPATH=="*:00:02.0/usb2/2-9" OPTIONS+="last_rule"
11
12 BUS=="usb" SYMLINK="mouse_2" SYSFS{manufacturer}=="Logitech"
13 PHYSDEVPATH=="*:00:02.0/usb2/2-10" OPTIONS+="last_rule"
14
15 When I plug them in, I get:
16
17 ===========================================
18 Apr 4 17:34:58 localhost kernel: usb 2-9: new low speed USB device using
19 ohci_hcd and address 37
20 Apr 4 17:34:58 localhost kernel: usb 2-9: configuration #1 chosen from 1
21 choice
22 Apr 4 17:34:58 localhost kernel: input: Logitech USB-PS/2 Optical Mouse
23 as /class/input/input35
24 Apr 4 17:34:58 localhost kernel: input: USB HID v1.10 Mouse [Logitech
25 USB-PS/2 Optical Mouse] on usb-0000:00:02.0-9
26 ===========================================
27
28 and
29
30 ===========================================
31 Apr 4 17:39:10 localhost kernel: usb 2-10: new low speed USB device using
32 ohci_hcd and address 38
33 Apr 4 17:39:11 localhost kernel: usb 2-10: configuration #1 chosen from 1
34 choice
35 Apr 4 17:39:11 localhost kernel: input: Logitech USB-PS/2 Optical Mouse
36 as /class/input/input36
37 Apr 4 17:39:11 localhost kernel: input: USB HID v1.10 Mouse [Logitech
38 USB-PS/2 Optical Mouse] on usb-0000:00:02.0-10
39 ===========================================
40
41 Any ideas about what I'm doing wrong?
42
43 TIA,
44
45 --
46 Mike Diehl
47 --
48 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Need to identify USB device by port ds <dsitsolutions@×××××.com>