diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-05-28 10:09:12 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-05-28 10:09:12 +0000 |
commit | 1d445950582373c6240ce59f70f63837121131aa (patch) | |
tree | b3ce898c9be92bd2f1763e4471b0c3a427457b24 /perl-install/network/ethernet.pm | |
parent | e9c2fd6362eca835dbaffb59477a10f8e3e244f0 (diff) | |
download | drakx-1d445950582373c6240ce59f70f63837121131aa.tar drakx-1d445950582373c6240ce59f70f63837121131aa.tar.gz drakx-1d445950582373c6240ce59f70f63837121131aa.tar.bz2 drakx-1d445950582373c6240ce59f70f63837121131aa.tar.xz drakx-1d445950582373c6240ce59f70f63837121131aa.zip |
(get_eth_cards) fallback on sysfs in order to get driver and card
description when ethtool is not supported (eg: ipw2100 driver for
intel centrino)
Diffstat (limited to 'perl-install/network/ethernet.pm')
-rw-r--r-- | perl-install/network/ethernet.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm index 193bbf539..a6e58df1b 100644 --- a/perl-install/network/ethernet.pm +++ b/perl-install/network/ethernet.pm @@ -63,6 +63,17 @@ sub get_eth_cards() { ($description) = (mapIntfToDevice($interface))[0]->{description}; } if (!$description) { + my $drv = readlink("/sys/class/net/$interface/driver"); + if ($drv and $drv =~ s!.*/!!) { + $a = $drv; + my %l; + my %sysfs_fields = (id => "device", subid => "subsystem_device", vendor => "vendor", subvendor => "subsystem_vendor"); + $l{$_} = hex(chomp_(cat_("/sys/class/net/$interface/device/" . $sysfs_fields{$_}))) foreach keys %sysfs_fields; + my @cards = grep { my $dev = $_; every { $dev->{$_} eq $l{$_} } keys %l } detect_devices::probeall(); + $description = $cards[0]{description} if $#cards == 0; + } + } + if (!$description) { my @cards = grep { $_->{driver} eq ($a || $saved_driver) } detect_devices::probeall(); $description = $cards[0]->{description} if $#cards == 0; } |