summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-01-19 17:45:59 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-01-19 17:45:59 +0000
commit02c2db42de5482f54336be5735dc969178814b0c (patch)
tree20adf0d18596d71724bf4e484ded3ae6ead12758 /perl-install/detect_devices.pm
parent285824f99f43fb3436e692497ac3f0216ac981dc (diff)
downloaddrakx-backup-do-not-use-02c2db42de5482f54336be5735dc969178814b0c.tar
drakx-backup-do-not-use-02c2db42de5482f54336be5735dc969178814b0c.tar.gz
drakx-backup-do-not-use-02c2db42de5482f54336be5735dc969178814b0c.tar.bz2
drakx-backup-do-not-use-02c2db42de5482f54336be5735dc969178814b0c.tar.xz
drakx-backup-do-not-use-02c2db42de5482f54336be5735dc969178814b0c.zip
(getSerialModem)
- drop useless first arg - return all detected serial modems, not only first - return all data we collected on serial modems
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm26
1 files changed, 16 insertions, 10 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index a51a09909..b760a436c 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -391,24 +391,30 @@ sub getTVcards() {
}
sub getSerialModem {
- my ($modem, $o_mouse) = @_;
+ my ($o_mouse) = @_;
my $mouse = $o_mouse || {};
$mouse->{device} = readlink "/dev/mouse";
my $serdev = arch() =~ /ppc/ ? "macserial" : "serial";
eval { modules::load($serdev) };
+ my @modems;
+
probeSerialDevices();
- foreach (map { "ttyS$_" } (0..7)) {
- next if $mouse->{device} =~ /$_/;
- next unless -e "/dev/$_";
- hasModem("/dev/$_") and $modem->{device} = $_, last;
+ foreach my $port (map { "ttyS$_" } (0..7)) {
+ next if $mouse->{device} =~ /$port/;
+ my $device = "/dev/$port";
+ next unless -e $device && hasModem($device);
+ push @modems, $serialprobe{$device};
}
-
- #- add an alias for macserial on PPC
- modules::add_alias('serial', $serdev) if arch() =~ /ppc/ && $modem->{device};
my @devs = pcmcia_probe();
- foreach (@devs) { $_->{type} =~ /serial/ and $modem->{device} = $_->{device} }
- $modem;
+ foreach my $modem (@modems) {
+ $modem->{device} = $modem->{DEVICE};
+ delete $modem->{DEVICE};
+ #- add an alias for macserial on PPC
+ modules::add_alias('serial', $serdev) if arch() =~ /ppc/ && $modem->{device};
+ foreach (@devs) { $_->{type} =~ /serial/ and $modem->{device} = $_->{device} }
+ }
+ @modems;
}
sub getModem() {