Skip to contentSkip to conversation

hotplug problems

DISCUSSION Lawrence MacIntyre 1 participant 1 message May 8, 2007

lore
Share & tools
lore
#0 lore raw

Hi:

I'm trying to write some code to use a SecureID 800 USB smart card. I can't seem to get the udev rules to work. I have two rules that I think should trigger when I plug the card in, but neither of them appears to work. The rules are in /etc/udev/rules.d/86-pcscd_ccid.rules and here are the rules:

# If not USB, go away.
BUS!="usb*", GOTO="pcscd_ccid_rules_end"

# If not adding the device, go away.
ACTION!="add", GOTO="pcscd_ccid_rules_end"

# generic CCID device
SYSFS{bInterfaceClass}="0b", RUN+="/usr/sbin/pcscd --hotplug"
# sid800.txt
SYSFS{idVendor}="15e1", SYSFS{idProduct}="2007", RUN+="/usr/sbin/pcscd
--hotplug"

# All done
LABEL="pcscd_ccid_rules_end"

From running udevmonitor, here's what happens when I plug the device in and remove it.

UEVENT[1178631737.409199] remove@/devices/pci0000:00/0000:00:02.0/usb1/1-4/1-4:1.0 UEVENT[1178631737.409244] remove@/class/usb_device/usbdev1.10 UEVENT[1178631737.409261] remove@/devices/pci0000:00/0000:00:02.0/usb1/1-4 UDEV [1178631737.416418] remove@/devices/pci0000:00/0000:00:02.0/usb1/1-4/1-4:1.0
UDEV [1178631737.429513] remove@/devices/pci0000:00/0000:00:02.0/usb1/1-4 UDEV [1178631737.454342] remove@/class/usb_device/usbdev1.10 UEVENT[1178631745.838999] add@/devices/pci0000:00/0000:00:02.0/usb1/1-4 UEVENT[1178631745.847725] add@/devices/pci0000:00/0000:00:02.0/usb1/1-4/1-4:1.0 UEVENT[1178631745.847771] add@/class/usb_device/usbdev1.12 UDEV [1178631745.925107] add@/devices/pci0000:00/0000:00:02.0/usb1/1-4 UDEV [1178631746.157954] add@/devices/pci0000:00/0000:00:02.0/usb1/1-4/1-4:1.0
UDEV [1178631746.270250] add@/class/usb_device/usbdev1.12

If I dig through sysfs, I can find the device, but it's not always in the same directory.

root@gekko:/sys/class/usb_device/usbdev2.5/device# find . -name '*'
-type f -exec cat {} \; -print
in
./2-4:1.0/ep_81/direction
24ms
./2-4:1.0/ep_81/interval
Interrupt
./2-4:1.0/ep_81/type
0008
./2-4:1.0/ep_81/wMaxPacketSize
18
./2-4:1.0/ep_81/bInterval
03
./2-4:1.0/ep_81/bmAttributes
81
./2-4:1.0/ep_81/bEndpointAddress
07
./2-4:1.0/ep_81/bLength
in
./2-4:1.0/ep_85/direction
0ms
./2-4:1.0/ep_85/interval
Bulk
./2-4:1.0/ep_85/type
0040
./2-4:1.0/ep_85/wMaxPacketSize
00
./2-4:1.0/ep_85/bInterval
02
./2-4:1.0/ep_85/bmAttributes
85
./2-4:1.0/ep_85/bEndpointAddress
07
./2-4:1.0/ep_85/bLength
out
./2-4:1.0/ep_04/direction
0ms
./2-4:1.0/ep_04/interval
Bulk
./2-4:1.0/ep_04/type
0040
./2-4:1.0/ep_04/wMaxPacketSize
00
./2-4:1.0/ep_04/bInterval
02
./2-4:1.0/ep_04/bmAttributes
04
./2-4:1.0/ep_04/bEndpointAddress
07
./2-4:1.0/ep_04/bLength
usb:v15E1p2007d0100dc00dsc00dp00ic0Bisc00ip00
./2-4:1.0/modalias
00
./2-4:1.0/bInterfaceProtocol
00
./2-4:1.0/bInterfaceSubClass
0b
./2-4:1.0/bInterfaceClass
03
./2-4:1.0/bNumEndpoints
 0
./2-4:1.0/bAlternateSetting
00
./2-4:1.0/bInterfaceNumber

./2-4:1.0/power/wakeup
2
./2-4:1.0/power/state
cat: ./2-4:1.0/uevent: Permission denied
both
./ep_00/direction
0ms
./ep_00/interval
Control
./ep_00/type
0020
./ep_00/wMaxPacketSize
00
./ep_00/bInterval
00
./ep_00/bmAttributes
00
./ep_00/bEndpointAddress
07
./ep_00/bLength
./configuration
RSA SecurID (R) Authenticator
./product
RSA
./manufacturer
0
./maxchild
2.00
./version
5
./devnum
12
./speed
32
./bMaxPacketSize0
1
./bNumConfigurations
00
./bDeviceProtocol
00
./bDeviceSubClass
00
./bDeviceClass
0100
./bcdDevice
2007
./idProduct
15e1
./idVendor
100mA
./bMaxPower
80
./bmAttributes
1
./bConfigurationValue
1
./bNumInterfaces

./power/wakeup
0
./power/state
cat: ./uevent: Permission denied

So I see that the idProduct, idVendor, and bInterfaceClass match the rules, but they don't run the pcscd --hotplug command. I have a program listening for the pcscd --hotplug command, so I know that the command isn't run. Does anyone have any suggestions?

Signature · 14 lines
Lawrence MacIntyre  [email protected]  Oak Ridge National Laboratory
 865.574.8696  Cyber Space and Information Intelligence Research Group
   SIPRNet: [email protected]  ICMail: [email protected]


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel