summaryrefslogtreecommitdiffstats
path: root/lib/network
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-02-22 11:44:35 +0000
committerOlivier Blin <oblin@mandriva.com>2008-02-22 11:44:35 +0000
commit6d534bcf50a61f4329c77bfb2383d40476965c36 (patch)
treef58f9a84df7369f965c2d85cfbc11f4a1654a404 /lib/network
parent79c49c420652e6368c0c26eb177671ab3809f27e (diff)
downloaddrakx-net-6d534bcf50a61f4329c77bfb2383d40476965c36.tar
drakx-net-6d534bcf50a61f4329c77bfb2383d40476965c36.tar.gz
drakx-net-6d534bcf50a61f4329c77bfb2383d40476965c36.tar.bz2
drakx-net-6d534bcf50a61f4329c77bfb2383d40476965c36.tar.xz
drakx-net-6d534bcf50a61f4329c77bfb2383d40476965c36.zip
add support for multiple drivers per interface conflict (will get useful for ssb and b43)
Diffstat (limited to 'lib/network')
-rw-r--r--lib/network/ndiswrapper.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/network/ndiswrapper.pm b/lib/network/ndiswrapper.pm
index e92e31c..6251a35 100644
--- a/lib/network/ndiswrapper.pm
+++ b/lib/network/ndiswrapper.pm
@@ -57,7 +57,7 @@ sub find_matching_devices {
foreach my $interface (all($net_path)) {
if (network::connection::ethernet::device_matches_interface($device, $interface)) {
my $driver = network::connection::ethernet::interface_to_driver($interface);
- push @devices, [ $interface, $driver ] if $driver;
+ push @devices, { interface => $interface, drivers => [ $driver ] } if $driver;
}
}
@@ -66,13 +66,13 @@ sub find_matching_devices {
sub find_conflicting_devices {
my ($device) = @_;
- grep { $_->[1] ne "ndiswrapper" } find_matching_devices($device);
+ grep { !member("ndiswrapper", @{$_->{drivers}}) } find_matching_devices($device);
}
sub find_interface {
my ($device) = @_;
- my $dev = find { $_->[1] eq "ndiswrapper" } find_matching_devices($device);
- $dev->[0];
+ my $dev = find { member("ndiswrapper", @{$_->{drivers}}) } find_matching_devices($device);
+ $dev->{interface};
}
sub setup_device {
@@ -81,9 +81,9 @@ sub setup_device {
my @conflicts = find_conflicting_devices($device);
if (@conflicts) {
$in->ask_yesorno(N("Warning"), N("The selected device has already been configured with the %s driver.
-Do you really want to use a ndiswrapper driver?", $conflicts[0][1])) or return;
+Do you really want to use a ndiswrapper driver?", $conflicts[0]->{drivers}[0])) or return;
#- unload the old module and try immediately to load ndiswrapper
- eval { modules::unload($conflicts[0][1]) };
+ eval { modules::unload($_) } foreach @{$conflicts[0]->{drivers}};
}
#- unload ndiswrapper first so that the newly installed .inf files will be read