summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-08-20 02:06:22 +0000
committerOlivier Blin <oblin@mandriva.org>2004-08-20 02:06:22 +0000
commit61741c26ce220cbb435b526ea8fd16ff05588c43 (patch)
treef5641d7f8b8d8b519284a6aef32fba283feb664c /perl-install/detect_devices.pm
parent10a0808768b9fea056a00042957039e941837a83 (diff)
downloaddrakx-61741c26ce220cbb435b526ea8fd16ff05588c43.tar
drakx-61741c26ce220cbb435b526ea8fd16ff05588c43.tar.gz
drakx-61741c26ce220cbb435b526ea8fd16ff05588c43.tar.bz2
drakx-61741c26ce220cbb435b526ea8fd16ff05588c43.tar.xz
drakx-61741c26ce220cbb435b526ea8fd16ff05588c43.zip
(firewire_probe) use sysfs to detect firewire devices (eth1394 should be detected now)
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm17
1 files changed, 16 insertions, 1 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 46c8739a0..950a11462 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -624,7 +624,19 @@ sub usb_probe() {
}
sub firewire_probe() {
- my ($e, @l);
+ my $dev_dir = '/sys/bus/ieee1394/devices';
+ my @l = map {
+ my $dir = "$dev_dir/$_";
+ my $get = sub { chomp_(cat_($_[0])) };
+ {
+ version => hex($get->("$dir/../vendor_id")),
+ specifier_id => hex($get->("$dir/specifier_id")),
+ specifier_version => hex($get->("$dir/version")),
+ bus => 'Firewire',
+ }
+ } grep { -f "$dev_dir/$_/specifier_id" } all($dev_dir);
+
+ my $e;
foreach (cat_('/proc/bus/ieee1394/devices')) {
if (m!Vendor/Model ID: (.*) \[(\w+)\] / (.*) \[(\w+)\]!) {
push @l, $e = {
@@ -638,9 +650,12 @@ sub firewire_probe() {
$e->{specifier_version} = hex $1;
}
}
+
foreach (@l) {
if ($_->{specifier_id} == 0x00609e && $_->{specifier_version} == 0x010483) {
add2hash($_, { driver => 'sbp2', description => "Generic Firewire Storage Controller" });
+ } elsif ($_->{specifier_id} == 0x00005e && $_->{specifier_version} == 0x000001) {
+ add2hash($_, { driver => 'eth1394', description => "IEEE 1394 IPv4 Driver (IPv4-over-1394 as per RFC 2734)" });
}
}
@l;