summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-09-23 18:50:15 +0000
committerThierry Vignaud <tv@mandriva.org>2009-09-23 18:50:15 +0000
commit93b17b404f7884ee2006a31acd442043a96409ad (patch)
tree879f080d784035d5f9b34071c52e190ffea77c13
parent1f2f5e8a1e53e59e68aa38dd5205929e238a0eb2 (diff)
downloaddrakx-93b17b404f7884ee2006a31acd442043a96409ad.tar
drakx-93b17b404f7884ee2006a31acd442043a96409ad.tar.gz
drakx-93b17b404f7884ee2006a31acd442043a96409ad.tar.bz2
drakx-93b17b404f7884ee2006a31acd442043a96409ad.tar.xz
drakx-93b17b404f7884ee2006a31acd442043a96409ad.zip
(is_child_of_a_pcie_bridge) introduce it
(pci_probe) introdude 'nice_bus' field in order to report if it's a PCIe device (#28479)
-rw-r--r--perl-install/detect_devices.pm17
1 files changed, 15 insertions, 2 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 974008808..c96b9d1a8 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -805,7 +805,14 @@ sub get_pci_sysfs_path {
}
-my (@pci, @usb);
+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;
+}
+
sub pci_probe__real() {
add_addons($pcitable_addons, map {
my %l;
@@ -817,7 +824,13 @@ sub pci_probe__real() {
} c::pci_probe());
}
sub pci_probe() {
- @pci = pci_probe__real() if !@pci;
+ 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";
+ }
+ }
@pci;
}