diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-02-28 21:33:54 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-02-28 21:33:54 +0000 |
commit | 41f43865793ad6ad283f74d92cf7af3a1fb87b20 (patch) | |
tree | cbf1fc2eb5146c8c54216f5be3db235e0bc9f0f4 | |
parent | 90cff733222528cdab66ff839aae7b66312b71cb (diff) | |
download | drakx-net-41f43865793ad6ad283f74d92cf7af3a1fb87b20.tar drakx-net-41f43865793ad6ad283f74d92cf7af3a1fb87b20.tar.gz drakx-net-41f43865793ad6ad283f74d92cf7af3a1fb87b20.tar.bz2 drakx-net-41f43865793ad6ad283f74d92cf7af3a1fb87b20.tar.xz drakx-net-41f43865793ad6ad283f74d92cf7af3a1fb87b20.zip |
use cached result for detected devices, update it when needed only
-rw-r--r-- | lib/network/connection/ethernet.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/network/connection/ethernet.pm b/lib/network/connection/ethernet.pm index 0fc5f58..d1523cd 100644 --- a/lib/network/connection/ethernet.pm +++ b/lib/network/connection/ethernet.pm @@ -322,7 +322,7 @@ sub mapIntfToDevice { my $hw_addr = c::getHwIDs($interface); return {} if $hw_addr =~ /^usb/; my $device = parse_hwaddr($hw_addr); - $device ? grep { are_same_HwIDs($_, $device) } detect_devices::probeall__real() : {}; + $device ? grep { are_same_HwIDs($_, $device) } detect_devices::probeall() : {}; } sub device_matches_interface_HwIDs { @@ -367,7 +367,7 @@ sub device_to_interface { sub interface_to_device { my ($interface) = @_; my $sysfs_ids = get_interface_ids($interface); - find { detect_devices::device_matches_sysfs_ids($_, $sysfs_ids) } detect_devices::probeall__real(); + find { detect_devices::device_matches_sysfs_ids($_, $sysfs_ids) } detect_devices::probeall(); } sub interface_to_driver { @@ -387,6 +387,8 @@ sub interface_to_driver { # - special interfaces (IP aliasing, VLAN) sub get_eth_cards { my ($modules_conf) = @_; + + detect_devices::probeall_update_cache(); my @all_cards = detect_devices::get_lan_interfaces(); my @devs = detect_devices::pcmcia_probe(); @@ -440,7 +442,7 @@ sub get_eth_cards { # 6) try to match a device by driver for device description: # (eg: madwifi, ndiswrapper, ...) if (!$description) { - my @cards = grep { $_->{driver} eq ($a || $saved_driver) } detect_devices::probeall__real(); + my @cards = grep { $_->{driver} eq ($a || $saved_driver) } detect_devices::probeall(); $description = $cards[0]{description} if @cards == 1; } $a and $saved_driver = $a; # handle multiple cards managed by the same driver |