summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index adc701a81..6bcf38ac6 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -228,6 +228,20 @@ sub syslog {
`dmesg`;
}
+sub hasUsb {
+ my ($class, $prot) = @_;
+ foreach (cat_("/proc/bus/usb/devices")) {
+ if (/^P/ .. /^I/) {
+ my ($c, $p) = /Cls=(\d+).*Prot=(\d+)/;
+ $c == $class && ($prot < 0 || $prot == $p) and log::l("found usb $c $p"), return 1;
+ }
+ }
+ 0;
+}
+sub hasUsbKeyboard { hasUsb(3, 1) }
+sub hasUsbMouse { hasUsb(3, 2) }
+sub hasUsbZip { hasUsb(8, -1) }
+
sub hasSMP { c::detectSMP() }
sub hasUltra66 {