Ben Hutchings [Thu, 17 May 2012 14:14:16 +0000 (15:14 +0100)]
Only decode defined fields of PCI Express Link Control 2
On a PCI Express multi-function device associated with an upstream
port, all bits of the Link Control 2 register are currently reserved
on functions > 0.
The Selectable De-emphasis field is reserved on all but downstream
ports.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Aaron Sierra [Fri, 25 May 2012 19:11:39 +0000 (14:11 -0500)]
lspci: zero address in IO isn't always unassigned
Zero is a valid address in I/O space, so display it and it's associated
size when IO is enabled in the PCI command register.
From arch/powerpc/kernel/pci-common.c:
/* Here, we are a bit different than memory as typically IO space
* starting at low addresses -is- valid. What we do instead [is] that
* we consider as unassigned anything that doesn't have IO enabled
* in the PCI command register, and that's it.
*/
Bjorn Helgaas [Wed, 11 Jan 2012 21:16:19 +0000 (14:16 -0700)]
Correct the end of CardBus memory windows
The low twelve bits of memory base/limit are assumed to be all zeros
and all ones, respectively. Therefore, a window with base == limit
is a valid 4K window, which we should display by default, and the
true end of the window is ...fff, not ...000. For example,
Martin Mares [Sun, 2 Oct 2011 10:41:07 +0000 (12:41 +0200)]
Truncate names which are too long
When any name turned out too long, we returned "<pci_lookup_name: buffer too small>",
which wasn't very useful. Instead of that, we truncate the name and
we add "..." at the end.
Please note that for simplicity, the truncation happens only on systems with proper
C99 snprintf(). Ancient systems where snprintf() returns a negative number and
promises nothing about the state of the buffer still use the error message.
François Revol [Tue, 30 Nov 2010 21:44:50 +0000 (21:44 +0000)]
BeOS and Haiku ports
The BeOS port uses private syscalls exported by libroot.so to implement the intel access methods.
The Haiku port uses ioctls to the /dev/misc/poke device driver (use originally for debugging with
/bin/poke) to implement the intel access methods. BeOS has non-standard arch names, so we map them
to i386 and powerpc in the configure. Updated README and pcilib.man accordingly.
Martin Mares [Thu, 28 Jan 2010 10:14:40 +0000 (11:14 +0100)]
Improved formatting of PCIe port/slot capabilities
The power limit is now limited to 3 decimal places and it always
includes units (watts), Port# and Slot# are both printed in decimal.
(Previously, the behavior was inconsistent between ports and slots.)
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>