diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-04-12 19:01:19 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-04-12 19:01:19 +0000 |
commit | 1505cb9a13be9acb25847858726792821dbb2f81 (patch) | |
tree | e14b80dcbca800562af6ac23524c09f8ecc3c5ff /perl-install | |
parent | 4117d95d37b1be87c4f0b78555fca4e7d5e4b542 (diff) | |
download | drakx-1505cb9a13be9acb25847858726792821dbb2f81.tar drakx-1505cb9a13be9acb25847858726792821dbb2f81.tar.gz drakx-1505cb9a13be9acb25847858726792821dbb2f81.tar.bz2 drakx-1505cb9a13be9acb25847858726792821dbb2f81.tar.xz drakx-1505cb9a13be9acb25847858726792821dbb2f81.zip |
use sysfs as fallback to detect wireless interfaces (rt2x00/prism2_*)
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/detect_devices.pm | 18 | ||||
-rw-r--r-- | perl-install/network/netconnect.pm | 2 | ||||
-rw-r--r-- | perl-install/network/tools.pm | 2 | ||||
-rwxr-xr-x | perl-install/standalone/drakconnect | 2 |
4 files changed, 15 insertions, 9 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index df183ebcb..f2c05bf4f 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -563,16 +563,22 @@ sub is_lan_interface { $_[0] !~ /^(?:lo|ippp|isdn|plip|ppp|sit0|wifi)/; } +sub is_wireless_interface { + my ($interface) = @_; + #- some wireless drivers don't always support the SIOCGIWNAME ioctl + #- ralink devices need to be up to support it + #- wlan-ng (prism2_*) need some special tweaks to support it + #- use sysfs as fallback to detect wireless interfaces, + #- i.e interfaces for which get_wireless_stats() is available + c::isNetDeviceWirelessAware($interface) || -e "/sys/class/net/$interface/wireless"; +} + sub getNet() { - my @net_devices = grep { is_lan_interface($_) } + grep { is_lan_interface($_) } uniq( (map { if_(/^\s*([A-Za-z0-9:\.]*):/, $1) } cat_("/proc/net/dev")), c::get_netdevices(), ); - #- enable interfaces if get_wireless_stats() is available - #- needed for some drivers (Ralink) to be able to detect it is wireless aware - c::enable_net_device($_) foreach grep { -d "/sys/class/net/$_/wireless" } @net_devices; - @net_devices; } #sub getISDN() { @@ -873,7 +879,7 @@ sub matching_type { if ($type =~ /laptop/i) { return isLaptop(); } elsif ($type =~ /wireless/i) { - return any { c::isNetDeviceWirelessAware($_) } getNet(); + return any { is_wireless_interface($_) } getNet(); } } diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 24c848ba1..f12e9e23c 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -133,7 +133,7 @@ sub real_main { %all_eth_intf = network::ethernet::get_eth_cards_names(@all_cards); #- needed not to loose GATEWAYDEV require list_modules; #- FIXME: check if useful %eth_intf = map { $_->[0] => join(': ', $_->[0], $_->[2]) } - grep { to_bool($is_wireless) == c::isNetDeviceWirelessAware($_->[0]) } @all_cards; + grep { to_bool($is_wireless) == detect_devices::is_wireless_interface($_->[0]) } @all_cards; }; my $find_lan_module = sub { diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index d99e0f39e..26e09dd6e 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -282,7 +282,7 @@ sub get_interface_type { member($interface->{TYPE}, "xDSL", "ADSL") && "adsl" || $interface->{DEVICE} =~ /^ippp/ && "isdn" || $interface->{DEVICE} =~ /^ppp/ && "modem" || - c::isNetDeviceWirelessAware($interface->{DEVICE}) && "wifi" || + detect_devices::is_wireless_interface($interface->{DEVICE}) && "wifi" || detect_devices::is_lan_interface($interface->{DEVICE}) && "ethernet" || "unknown"; } diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect index 2408df2e3..42ce559a3 100755 --- a/perl-install/standalone/drakconnect +++ b/perl-install/standalone/drakconnect @@ -292,7 +292,7 @@ sub build_tree { } else { #- ethernet is default - $intf->{pages} = { 'TCP/IP' => 1, 'DHCP' => 1, if_(c::isNetDeviceWirelessAware($intf->{DEVICE}), 'Wireless' => 1), 'Options' => 1, 'Information' => 1 }; + $intf->{pages} = { 'TCP/IP' => 1, 'DHCP' => 1, if_(detect_devices::is_wireless_interface($intf->{DEVICE}), 'Wireless' => 1), 'Options' => 1, 'Information' => 1 }; } } |