summaryrefslogtreecommitdiffstats
path: root/perl-install
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
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')
-rw-r--r--perl-install/NEWS1
-rw-r--r--perl-install/c/stuff.xs.pl4
-rw-r--r--perl-install/detect_devices.pm13
3 files changed, 6 insertions, 12 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 1d81844ff..a4b4dd29e 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,4 +1,5 @@
- harddrake:
+ o better check for PCI Express capability
o nicer display of PCI Express name
Version 12.55 - 23 September 2009
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl
index 16fdaef80..0f4908d9b 100644
--- a/perl-install/c/stuff.xs.pl
+++ b/perl-install/c/stuff.xs.pl
@@ -263,8 +263,8 @@ pci_probe()
EXTEND(SP, entries.nb);
for (i = 0; i < entries.nb; i++) {
struct pciusb_entry *e = &entries.entries[i];
- snprintf(buf, sizeof(buf), "%04x\t%04x\t%04x\t%04x\t%d\t%d\t%d\t%d\t%d\t%s\t%s\t%s\t%s",
- e->vendor, e->device, e->subvendor, e->subdevice, e->pci_domain, e->pci_bus, e->pci_device, e->pci_function, e->pci_revision,
+ snprintf(buf, sizeof(buf), "%04x\t%04x\t%04x\t%04x\t%d\t%d\t%d\t%d\t%d\t%d\t%s\t%s\t%s\t%s",
+ e->vendor, e->device, e->subvendor, e->subdevice, e->pci_domain, e->pci_bus, e->pci_device, e->pci_function, e->pci_revision, e->is_pciexpress,
pci_class2text(e->class_id), e->class, e->module ? e->module : "unknown", e->text);
PUSHs(sv_2mortal(newSVpv(buf, 0)));
}
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;