summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-04-12 19:01:19 +0000
committerOlivier Blin <oblin@mandriva.org>2005-04-12 19:01:19 +0000
commit1505cb9a13be9acb25847858726792821dbb2f81 (patch)
treee14b80dcbca800562af6ac23524c09f8ecc3c5ff /perl-install/detect_devices.pm
parent4117d95d37b1be87c4f0b78555fca4e7d5e4b542 (diff)
downloaddrakx-backup-do-not-use-1505cb9a13be9acb25847858726792821dbb2f81.tar
drakx-backup-do-not-use-1505cb9a13be9acb25847858726792821dbb2f81.tar.gz
drakx-backup-do-not-use-1505cb9a13be9acb25847858726792821dbb2f81.tar.bz2
drakx-backup-do-not-use-1505cb9a13be9acb25847858726792821dbb2f81.tar.xz
drakx-backup-do-not-use-1505cb9a13be9acb25847858726792821dbb2f81.zip
use sysfs as fallback to detect wireless interfaces (rt2x00/prism2_*)
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm18
1 files changed, 12 insertions, 6 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();
}
}