diff options
author | Francois Pons <fpons@mandriva.com> | 2000-05-05 18:45:23 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2000-05-05 18:45:23 +0000 |
commit | 969bc065596476bce5cfed0bb7ffd263f48eb1d5 (patch) | |
tree | 8f890d39f7b1ccfa6dbeb8f7cc3281748ee30f46 /perl-install/detect_devices.pm | |
parent | 8255a2010a0698471fb35f42b1ebcad3462f153a (diff) | |
download | drakx-backup-do-not-use-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar drakx-backup-do-not-use-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.gz drakx-backup-do-not-use-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.bz2 drakx-backup-do-not-use-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.xz drakx-backup-do-not-use-969bc065596476bce5cfed0bb7ffd263f48eb1d5.zip |
*** empty log message ***
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r-- | perl-install/detect_devices.pm | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 79fd47345..8e8415b35 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -16,6 +16,7 @@ use c; #-##################################################################################### my @netdevices = map { my $l = $_; map { "$l$_" } (0..3) } qw(eth tr plip fddi); my %serialprobe = (); +my $usb_interface = undef; #-###################################################################################### #- Functions @@ -243,7 +244,25 @@ sub whatPrinter() { } sub whatPrinterPort() { - grep { tryWrite($_)} qw(/dev/lp0 /dev/lp1 /dev/lp2); + grep { tryWrite($_)} qw(/dev/lp0 /dev/lp1 /dev/lp2 /dev/usb/usblp0); +} + +sub probeUSB { + require pci_probing::main; + require modules; + defined($usb_interface) and return $usb_interface; + if (($usb_interface) = grep { /usb-/ } map { $_->[1] } pci_probing::main::probe('')) { + eval { modules::load($usb_interface, "SERIAL_USB") }; + if ($@) { + $usb_interface = ''; + } else { + modules::load("usbkbd"); + modules::load("keybdev"); + } + } else { + $usb_interface = ''; + } + $usb_interface; } sub probeSerialDevices { @@ -268,6 +287,7 @@ sub probeSerialDevices { close F; foreach (values %serialprobe) { + $_->{DESCRIPTION} =~ /modem/i and $_->{CLASS} = 'MODEM'; #- hack to make sure a modem is detected. log::l("probed $_->{DESCRIPTION} of class $_->{CLASS} on device $_->{DEVICE}"); } } |