Martin Mares [Sat, 16 Jan 2010 11:10:09 +0000 (12:10 +0100)]
Avoid unaligned accesses to extended capabilities.
The PCIe spec tells that all capabilities must be DWORD aligned and the bottom
2 bits of all capability pointers are reserved for future use and must be
ignored when read.
Matthew Wilcox [Fri, 20 Nov 2009 21:30:50 +0000 (14:30 -0700)]
Improve large BAR display
lspci currently displays anything larger than 2GB as a raw number.
I have a device with a larger BAR and wanted to see that reported as
a multiple of a GB.
I took the opportunity to rewrite this routine to make it easier to add
higher powers in the future. It's also slightly shorter, which is nice.
I also changed it to use the binary prefixes, much as I dislike them
personally.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Matthew Wilcox [Fri, 14 Aug 2009 12:55:09 +0000 (14:55 +0200)]
Make Physical Slot work for multifunction cards
I have some multifunction cards in a machine which supports physical
slots. Currently, lspci only displays the Physical Slot for the last
function in the slot. I believe it should display it for all of them.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Chris Wright [Sat, 11 Jul 2009 00:55:26 +0000 (17:55 -0700)]
lspci: Show SR-IOV VF BARs
When decoding the PCIe SR-IOV capability, cap_sriov() doesn't show the
VF BARs. This patch shows basic information about the VF BARs (doesn't
include size, for example).
Gilles Espinasse [Fri, 26 Jun 2009 09:37:47 +0000 (11:37 +0200)]
file timestamp not needed in pci.ids.gz
File timestamp (and file name) have no use for pci.ids.gz
This allow to produce the exact same file even when compiled at different times.
That make paranoid happy.
Even gzip-1.2.4 from 1993 support -n option
Concerning the fact that -n did not include file name, that does not matter
unless the compressed file is moved under a different name and later -N option
is used to open the file.
Matthew Wilcox [Wed, 13 May 2009 21:44:46 +0000 (15:44 -0600)]
Stop early if the VPD is corrupt
I have several cards which report more-or-less garbage in their VPD.
It can take an extraordinarily long time to read all their VPD and none
of it is of interest. Instead, if we find an unknown resource type,
just stop trying to read any more.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Matthew Wilcox [Wed, 13 May 2009 21:43:53 +0000 (15:43 -0600)]
Improve MSI and MSI-X display
There are several ways I think the MSI and MSI-X capabilities could be
reported better in lspci.
Enable is at the beginning of the MSI-X report, but the end of the
MSI report. Because Enabled is perhaps the most important thing,
I moved it to the start.
The TabSize reported for MSI-X is perhaps a little obscure. I feel
'Count' works better (and is then the same as MSI). We can't readily
tell which of the MSI-X capabilities have been programmed, so we can't
report how many have been enabled.
Both capabilities report 'Mask'. Unfortunately, in MSI, it indicates
whether the device supports per-vector masking, and in MSI-X it indicates
whether all the vectors are masked. This patch changes both; MSI reports
'Maskable' and MSI-X reports 'Masked'.
All these changes combine to turn the report from this:
Martin Mares [Mon, 29 Jun 2009 17:55:24 +0000 (19:55 +0200)]
proc: Work around broken /proc/bus/pci/ on some architectures.
Several architectures (e.g., sparc64) use domains in proc directory
names, which is inconsistent, because /proc/bus/pci/devices is still
unable to represent domains.
Work around it, so that the proc back-end works at least on single-domain
machines.
Vendor- and system-specific VPD items are matched only by their first
character, so we cannot read the item id from the matching structure.
There is a similar issue with unknown VPD items, which is handled by
creating a matching structure dynamically.
We can handle both cases using the static matching structure and the
actual item id, so do that.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Matthew Wilcox [Fri, 27 Feb 2009 13:20:04 +0000 (06:20 -0700)]
Correct Device Serial Number output
We are currently printing the Device Serial Number backwards. Ben
Hutchings noticed that the DSN was an EUI-64 (derived from a MAC
address), but printed backwards. Before:
Capabilities: [140] Device Serial Number 97-62-84-ff-ff-3b-1f-00
After:
Capabilities: [140] Device Serial Number 00-1f-3b-ff-ff-84-62-97
The MAC address is:
wlan0 Link encap:Ethernet HWaddr 00:1f:3b:84:62:97
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Yu Zhao [Sun, 4 Jan 2009 08:10:39 +0000 (16:10 +0800)]
Don't display 'disabled' for a virtual base address
Don't display 'disabled' for the virtual base address since the resource
is reported by the OS not the hardware, which means the IO/MEM enable bits
in the command register may be invalid.
Yu Zhao [Sun, 4 Jan 2009 08:03:45 +0000 (16:03 +0800)]
Fix inconsistent bus centric view between the sysfs and proc methods
The vendor and device IDs may be different when using sysfs and proc
methods with bus centric view enabled. The sysfs method reads the IDs
from the configuration space rather than uses the values from sysfs
entries. But the proc method always uses values from the proc files.
This fix makes the proc method use the values from the configuration
space too for bus centric view.
Yu Zhao [Fri, 26 Dec 2008 01:59:28 +0000 (09:59 +0800)]
Fix base address flags when using sysfs method
The base address flags are ignored when using sysfs method, while
the proc and generic methods combined the flags into 'base_addr'.
This inconsistency may fail some applications using libpci.
Alex Chiang [Wed, 3 Dec 2008 19:30:21 +0000 (12:30 -0700)]
Display physical slot information in lspci -v
We've been exposing slot information in /sys/bus/pci/slots for a
long time now (as long as a hotplug driver or slot detection
driver like pci_slot is loaded).
Let's make life better for our users and display that information
in lspci. If slot entries appear in /sys/bus/pci/slots/,
correlate them to PCI devices, and display the information when
lspci -v is issued.
If no slot entries appear in sysfs (due to no modules loaded), do
nothing.
Now you'll see sample output like the following:
23:01.1 Class 0c04: Device 10df:fd00 (rev 01)
Subsystem: Device 10df:fd00
Physical Slot: 3
Flags: bus master, 66MHz, medium devsel, latency 248, IRQ 60
...