Do not forget to include <stdio.h>

Suggested by John Spencer.
<asm/io.h> does not exist any more

Thanks to John Spencer for bringing this to attention.
Avoid C99 constructions

This fixes building pciutils on Haiku.

Signed-off-by: François Revol <revol@free.fr>
lspci: Show device name as exported by BIOS (sysfs label attribute) (V2)

The Device name of a PCI or PCI Express device under OS may be exported via
ACPI _DSM function with function index 7.
This allows to connect a described PCI device in the platform documentation
or as labeled on the chassis with PCI devices shown via lspci.
The kernel already exports this string through sysfs under a PCI device through
the "label" sysfs attribute.

This patch reads the device name if available and shows it to the user.
Real world examples:
  Device Name: "USB HS EHCI Controller #2 #3"
  Device Name: "USB HS EHCI Controller #1"
  Device Name: "SATA Controller #1"
  Device Name: "Onboard LAN #1"
  Device Name: "Onboard LAN #2"
  Device Name: "Onboard Video (PILOT-3)"

Compare with PCI Firmware Spec v3.1 chapter 4.6.7 and
ACPI spec v5.0 chapter 9.14.1

The DeviceName is not shown by default, but starting from first verbose
parameter (-v).

V2: - Free label string if allocated
    - Enhance changelog

Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: linux-pci@vger.kernel.org
Clean up reading of device labels
lspci: Decode Interrupt Pin and Interrupt Line for PCI-PCI bridges

Bridges can implement interrupt pins, so decode this information.  See
PCI-to-PCI Bridge spec r1.2, sec 3.2.5.17.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
lspci: Correct Root Capabilities "CRS Software Visibility" bit

lspci incorrectly tests bit 4, not bit 0, for "CRS Software Visibility" in
the Root Capabilities register, so it shows "RootCap: CRSVisible-" even for
devices that do support Software Visibility.

Use the correct definition for PCI_EXP_RTCAP_CRSVIS.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Fix endianity detection on Solaris

Patch by Philip Brown.
Import initial Darwin Support from Apple

Apple published a patch that adds Darwin support to pciutils. It is not
complete, but it does not appear to cause a build failure on other
platforms. For the sake of attribution purposes, it is being kept
separate from additional changes to make pciutils build properly on
Darwin.

https://www.opensource.apple.com/source/IOPCIFamily/IOPCIFamily-224.92.1/tools/pciutils3.2.0.patch.c

This patch differs slightly from Apple's original patch by omitting the
Makefile.rej that Apple had incorrectly included in the patch that it
placed on its server.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Fix whitespace errors
Fix building shared libraries on Darwin

The original patch by Apple did not support building shared libraries on
Darwin. This corrects that oversight. It also fixes a few other
miscellaneous issues like incorrect platform detection and the lack of
an entry in the README file.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Better work-around for missing symbol versioning on Darwin
Darwin: Re-indent to match the rest of libpci and update file header

I hope that I got the attribution right.
Darwin: Renamed to darwin.c
Darwin: More renames
Darwin: Yet more renaming
Manual: Mention Darwin in the list of access methods
Device labels must be requested via PCI_FILL_LABELS

The previous implementation handled labels differently from all
other device properties, which was illogical.
Work around problems with symbol versioning in globally optimizing GCC
Updated pci.ids to today's snapshot