On 23/10/06, Ludovic Rousseau <[EMAIL PROTECTED]> wrote:
Hello
I am trying replace the active polling of the USB bus in pcscd by a
udev event. I see that OpenCT has a udev rule file etc/openct.udev
that starts the script etc/openct_usb.
This etc/openct_usb script does:
[...]
# race condition in the kernel, $DEVICE might not exist now
sleep 1
[...]
I also have the same problem with udev. The event is sent before the
device is really present in /sys/ and then pcscd do not see it :-(
After trying different configurations and hacks I found what is wrong.
For a not yet known reason the devices are visible in /proc/bus/usb
before they are visible in /dev/bus/usb. And libusb (used by pcscd)
scans /dev/bus/usb to find new devices. Using /proc/bus/usb instead of
/dev/bus/usb fixes the problem. It can be easily done using:
$ USB_DEVFS_PATH=/proc/bus/usb pcscd
I submitted a bug to libusb at (1).
I see that OpenCT also uses libusb. Maybe it has the same problem and
the same solution would work. And then removing the now useless "sleep
1" in the script called by udev.
Bye,
(1)
https://sourceforge.net/tracker/index.php?func=detail&aid=1586778&group_id=1674&atid=101674
--
Dr. Ludovic Rousseau
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel