summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-09-30 15:33:07 +0000
committerThierry Vignaud <tv@mandriva.org>2009-09-30 15:33:07 +0000
commit96356fb9e2880ee1e5436ef87e9ddd1ced323b06 (patch)
treed9915283b4f87dd6068a68d47c147c3dd347f62d /perl-install/detect_devices.pm
parentab0343e9b91320bc20ccfde0196b6e60012ba64d (diff)
downloaddrakx-96356fb9e2880ee1e5436ef87e9ddd1ced323b06.tar
drakx-96356fb9e2880ee1e5436ef87e9ddd1ced323b06.tar.gz
drakx-96356fb9e2880ee1e5436ef87e9ddd1ced323b06.tar.bz2
drakx-96356fb9e2880ee1e5436ef87e9ddd1ced323b06.tar.xz
drakx-96356fb9e2880ee1e5436ef87e9ddd1ced323b06.zip
(pci_probe) better check for PCI Express capability
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm13
1 files changed, 3 insertions, 10 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index b9fe3ea5e..a8c9d311c 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -806,18 +806,12 @@ sub get_pci_sysfs_path {
}
-my (@pci, @pcie_bridges, @usb);
-
-sub is_child_of_a_pcie_bridge {
- my ($l) = @_;
- my $sysfs_device = get_pci_sysfs_path($l);
- return 1 if grep { -e "$_->{sysfs_device}/$sysfs_device" } @pcie_bridges;
-}
+my (@pci, @usb);
sub pci_probe__real() {
add_addons($pcitable_addons, map {
my %l;
- @l{qw(vendor id subvendor subid pci_domain pci_bus pci_device pci_function pci_revision media_type nice_media_type driver description)} = split "\t";
+ @l{qw(vendor id subvendor subid pci_domain pci_bus pci_device pci_function pci_revision is_pciexpress media_type nice_media_type driver description)} = split "\t";
$l{$_} = hex $l{$_} foreach qw(vendor id subvendor subid);
$l{bus} = 'PCI';
$l{sysfs_device} = '/sys/bus/pci/devices/' . get_pci_sysfs_path(\%l);
@@ -828,9 +822,8 @@ sub pci_probe() {
state $done;
if (!$done) {
@pci = pci_probe__real() if !@pci;
- @pcie_bridges = grep { readlink("$_->{sysfs_device}/driver") =~ /pcieport/ } @pci;
foreach (@pci) {
- $_->{nice_bus} = is_child_of_a_pcie_bridge($_) ? "PCI Express" : "PCI";
+ $_->{nice_bus} = $_->{is_pciexpress} ? "PCI Express" : "PCI";
}
}
@pci;