summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-10-03 14:53:37 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-10-03 14:53:37 +0000
commit7ce5892b7a79e9653739c564e81034f535aa56c6 (patch)
tree10ee30388650f5352f163b93fcd59bf20e78a8d7 /perl-install/network
parent4a9eda8b12787d6d414ea4ea0d756ea7ddfc3292 (diff)
downloaddrakx-7ce5892b7a79e9653739c564e81034f535aa56c6.tar
drakx-7ce5892b7a79e9653739c564e81034f535aa56c6.tar.gz
drakx-7ce5892b7a79e9653739c564e81034f535aa56c6.tar.bz2
drakx-7ce5892b7a79e9653739c564e81034f535aa56c6.tar.xz
drakx-7ce5892b7a79e9653739c564e81034f535aa56c6.zip
factorize wireless card detection into network::tools:is_wireless_intf()
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/network.pm9
-rw-r--r--perl-install/network/tools.pm11
2 files changed, 13 insertions, 7 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index c1f433ec7..12c0a0ba7 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -10,6 +10,7 @@ use Socket;
use common;
use detect_devices;
use run_program;
+use network::tools;
use any;
use vars qw(@ISA @EXPORT);
use log;
@@ -313,12 +314,8 @@ sub gateway {
sub configureNetworkIntf {
my ($netc, $in, $intf, $net_device, $skip, $module) = @_;
my $text;
- my @wireless_modules = qw(aironet_cs aironet4500_cs hermes airo orinoco_cs orinoco airo_cs netwave_cs ray_cs wavelan_cs wvlan_cs airport);
- my $flag = 0;
- foreach (@wireless_modules) {
- $module =~ /$_/ and $flag = 1;
- }
- if ($flag) {
+ my @wireless_modules = qw(aironet_cs aironet4500_cs hermes airo orinoco_cs orinoco airo_cs netwave_cs ray_cs wavelan_cs wvlan_cs airport 3c59x);
+ if (is_wireless_intf($intf, $module)) {
$intf->{wireless_eth} = 1;
$netc->{wireless_eth} = 1;
$intf->{WIRELESS_MODE} = "Managed";
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index 62b9a0fb5..f8c0cc2d8 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -9,7 +9,7 @@ use MDK::Common::Globals "network", qw($in $prefix $disconnect_file $connect_pro
use MDK::Common::System qw(getVarsFromSh);
@ISA = qw(Exporter);
-@EXPORT = qw(write_cnx_script write_secret_backend read_secret_backend passwd_by_login write_initscript ask_connect_now connect_backend disconnect_backend read_providers_backend ask_info2 type2interface connected connected_bg test_connected connected2 disconnected);
+@EXPORT = qw(ask_connect_now ask_info2 connect_backend connected connected2 connected_bg disconnect_backend disconnected is_wireless_intf passwd_by_login read_providers_backend read_secret_backend test_connected type2interface write_cnx_script write_initscript write_secret_backend);
@EXPORT_OK = qw($in);
sub write_cnx_script {
@@ -345,4 +345,13 @@ sub use_floppy {
}
+sub is_wireless_intf {
+ my ($intf, $module) = @_;
+ my @wireless_modules = qw(aironet_cs aironet4500_cs hermes airo orinoco_cs orinoco airo_cs netwave_cs ray_cs wavelan_cs wvlan_cs airport 3c59x);
+ foreach (@wireless_modules) {
+ return 1 if $module =~ /$_/;
+ }
+ return 0;
+}
+
1;