From 2eed5d6e946b871405317c654c5b82e658751cf6 Mon Sep 17 00:00:00 2001 From: hselasky Date: Mon, 24 Sep 2012 17:13:33 +0000 Subject: Make sure moused is exiting as quick as possible after that the umsX character device returns a read error. Update devd.conf rules to use "DEVFS" events which are generated after that the umsX character device node has been created/destroyed, and then there should be no need for moused to wait up to 10 seconds for umsX to be ready. Opening umsX should not fail except if the kernel is low on memory. In that case the user can replug the USB mouse or use "usbconfig" to reset the device. In case of USB mouse devices, moused should neither retry to open its character device, once the first read error has happened. This is an indication of device detach. MFC after: 1 week --- etc/devd.conf | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'etc/devd.conf') diff --git a/etc/devd.conf b/etc/devd.conf index fa9ed98..d379ab0 100644 --- a/etc/devd.conf +++ b/etc/devd.conf @@ -115,14 +115,22 @@ detach 100 { action "/etc/rc.d/syscons setkeyboard /dev/kbd0"; }; -attach 100 { - device-name "ums[0-9]+"; - action "/etc/rc.d/moused quietstart $device-name"; +notify 100 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "CREATE"; + match "cdev" "ums[0-9]+"; + + action "/etc/rc.d/moused quietstart $cdev"; }; -detach 100 { - device-name "ums[0-9]+"; - action "/etc/rc.d/moused stop $device-name"; +notify 100 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "DESTROY"; + match "cdev" "ums[0-9]+"; + + action "/etc/rc.d/moused stop $cdev"; }; # Firmware download into the ActiveWire board. After the firmware download is -- cgit v1.1