Add a RUN rule to the udev rules to automatically disable USB suspend for all known scanners.

This effectively works around the hardware bugs exposed by CONFIG_USB_SUSPEND.

Works only with kernels >= 2.6.22 where /sys/bus/usb/devices/*/power/level exists.
merge-requests/1/head
Julien BLACHE 2007-07-29 18:39:54 +00:00
rodzic 734c0c1800
commit 08f6df7b48
2 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -1,3 +1,9 @@
2007-07-29 Julien Blache <jb@jblache.org>
* tools/sane-desc.c: Add a RUN rule to the udev rules to
automatically disable USB suspend for all known scanners.
Works only with kernels >= 2.6.22 where
/sys/bus/usb/devices/*/power/level exists.
2007-07-26 m. allan noah <kitno455 a t gmail d o t com>
* backend/fujitsu.c: update to version 1.0.51, fix bug in jpeg code

Wyświetl plik

@ -3226,10 +3226,14 @@ print_udev (void)
}
}
printf ("\n");
printf ("SYSFS{idVendor}==\"%s\", SYSFS{idProduct}==\"%s\", MODE=\"0664\", GROUP=\"scanner\"\n",
printf ("SYSFS{idVendor}==\"%s\", SYSFS{idProduct}==\"%s\", MODE=\"0664\", GROUP=\"scanner\", ENV{libsane_matched}=\"yes\"\n",
usbid->usb_vendor_id + 2, usbid->usb_product_id + 2);
usbid = usbid->next;
}
printf("\n# The following rule will disable USB autosuspend for the device\n");
printf("ENV{libsane_matched}==\"yes\", RUN+=\"/bin/sh -c 'test -e /sys/$env{DEVPATH}/power/level && echo on > /sys/$env{DEVPATH}/power/level'\"\n");
printf ("\nLABEL=\"libsane_rules_end\"\n");
}