History log of /freebsd-10.0-release/usr.sbin/pciconf/pciconf.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 246632 10-Feb-2013 neel

Use the entire 64 bits of 'bar.pbi_length' when printing the bar size.

This allows bar sizes greater than or equal to 4GB to be displayed correctly.


# 240739 20-Sep-2012 gavin

The correct generic term for PCIS_STORAGE_NVM is "NVM" not "NVM Express".

Submitted by: jimharris
MFC after: 6 days


# 240699 19-Sep-2012 gavin

Recognise NVM Express devices and pretty-print their name.

MFC after: 1 week


# 236415 01-Jun-2012 jhb

Add a new -e flag to pciconf(8)'s list mode to display PCI error details.
Currently this dumps the status of any error bits in the PCI status register
and PCI-express device status register. It also lists any errors indicated
by version 1 of PCI-express Advanced Error Reporting (AER).

MFC after: 1 week


# 228990 30-Dec-2011 uqs

Spelling fixes for usr.sbin/


# 212329 08-Sep-2010 jhb

Simplify chkattached(). The PCIOCATTACHED ioctl only needs the pi_sel
field populated, it ignores the rest of the 'pci_sel' structure.

MFC after: 1 week


# 188018 02-Feb-2009 jhb

- Add a new ioctl to /dev/pci to fetch details on an individual BAR of a
device. The details include the current value of the BAR (including all
the flag bits and the current base address), its length, and whether or not
it is enabled. Since this operation is not invasive, non-root users are
allowed to use it (unlike manual config register access which requires
root). The intention is that userland apps (such as Xorg) will use this
interface rather than dangerously frobbing the BARs from userland to
obtain this information.
- Add a new sub-mode to the 'list' mode of pciconf. The -b flag when used
with -l will now list all the active BARs for each device.

MFC after: 1 month


# 184936 13-Nov-2008 mav

Add ADMA, SATA and SAS mass storage subclasses.


# 184142 21-Oct-2008 mav

Add HDA multimedia subclass.


# 184140 21-Oct-2008 mav

Add "SD host controller" subclass name.


# 182708 03-Sep-2008 imp

style nit: indent continuation lines correctly, use style(9) style
if() statement.


# 182707 03-Sep-2008 imp

minor style(9) police: sort getopt options alphabetically. The
semi-logical segregation of 'b' and 'h' doesn't seem to make sense and
makes it harder to read.


# 172448 04-Oct-2007 se

Make selector parsing accept the dot "." as an alternative selector
with identical meaning as the colon ":". This is to support a syntax
that is more similar to a PCI device specification in the device hints
file. The selector is not fully compatible with the specification in
the hints file, since entries in that file use a different prefix,
which needs to be added to the getsel() routine, if full support of
that syntax is found to be desirable.

Approved by: re (Ken Smith)


# 172447 04-Oct-2007 se

Restore compatibility with version before introduction of PCI domains.
PCI selectors with 2 or 3 elements behave exactly as before (i.e. the
domain is 0 and in the 2 element case, the function is also 0).
The form with 4 selector elements works as in the previous revision
and provides the PCI domain number as the left-most selector element.

This change allows old scripts (which used the 2 or 3 selector element
formats) to be kept. Without this patch, the 3 element form was parsed
as starting with a domain number (and the function was assumed to be 0),
with this patch, the domain is assumed to be 0 (and the last value is
used as the function number).

The man page is updated to describe the new selector semantics.

Approved by: re (Ken Smith)


# 172394 30-Sep-2007 marius

Make the PCI code aware of PCI domains (aka PCI segments) so we can
support machines having multiple independently numbered PCI domains
and don't support reenumeration without ambiguity amongst the
devices as seen by the OS and represented by PCI location strings.
This includes introducing a function pci_find_dbsf(9) which works
like pci_find_bsf(9) but additionally takes a domain number argument
and limiting pci_find_bsf(9) to only search devices in domain 0 (the
only domain in single-domain systems). Bge(4) and ofw_pcibus(4) are
changed to use pci_find_dbsf(9) instead of pci_find_bsf(9) in order
to no longer report false positives when searching for siblings and
dupe devices in the same domain respectively.
Along with this change the sole host-PCI bridge driver converted to
actually make use of PCI domain support is uninorth(4), the others
continue to use domain 0 only for now and need to be converted as
appropriate later on.
Note that this means that the format of the location strings as used
by pciconf(8) has been changed and that consumers of <sys/pciio.h>
potentially need to be recompiled.

Suggested by: jhb
Reviewed by: grehan, jhb, marcel
Approved by: re (kensmith), jhb (PCI maintainer hat)


# 166435 02-Feb-2007 jhb

- Teach pciconf(8) to list the PCI capabilities supported by each device
via a new -c flag to be used with -l. Some simple parsing code is
present for the following capabilities: Power Management, AGP, VPD,
MSI, PCI-X, HyperTransport, Vendor-specific, EHCI Debug Port, PCI-PCI
bridge subvendor ID, PCI-express, and MSI-X.
- Fix a few warnings in pciconf.c.
- Update some cruft in pciconf(8):
- PCI 2.1 is no longer a revolutionary standard, and subvendor ID's are
fairly common at this point, so reflect that.
- Header type 2 is used for PCI-CardBus bridges.
- Describe the -v option for -l after completing the basic -l description
instead of disrupting the flow in the middle.

Reviewed by: imp (partially)
MFC after: 1 week


# 149225 18-Aug-2005 des

Use larger buffers to read lines from the vendor list.
Trim trailing whitespace and comments before parsing, and skip empty lines.
Skip subvendor / subdevice entries (which start with two tab characters).
Change the scanf() format string to match any amount and type of whitespace
between the device ID and the description text.

MFC after: 3 weeks


# 149223 18-Aug-2005 des

Whitespace cleanup.


# 144156 26-Mar-2005 jmg

add some additional pci classes and sub-classes..

Reviewed by: imp (almost 6 months ago)


# 133271 07-Aug-2004 imp

Revert unintended commit that came in with 3rd clause removal


# 133268 07-Aug-2004 le

Fix syntax error introduced in the last commit.

Additionally, since this file is written in C and not in Perl,
we need 'continue' instead of 'next'.


# 133249 07-Aug-2004 imp

Per letter dated July 22, 1999 remove 3rd clause of Berkeley derived software
(with permission of addtional copyright holders where appropriate)


# 124031 31-Dec-2003 rwatson

Only a read-only file descriptor is required to implement list_devs()
and list_verbose(), so don't open /dev/pci read-write. This allows
pciconf -l[v] to work for non-root users, assuming the securelevel is
0 or -1.

Problem experienced by: William Michael Grim <wgrim@siue.edu>


# 116640 20-Jun-2003 jmg

make pciconf understand it's own output as stated in the manpage.

pciconf -r none8@pci1:12:2: 0x0
now works.

PR: bin/10312
Submitted by: Castor Fu


# 103499 17-Sep-2002 jdp

Use consistent terminology in the usage message, the man page
synopsis, and the man page description ("selector" vs. "sel" and
"addr" vs. "reg").

Fix the usage message and man page synopsis to show that the "value"
argument is not optional.


# 91299 26-Feb-2002 sos

When asked to print bytes (-b option) do that and put 16 on a line.


# 77533 31-May-2001 imp

Support a range of registers to read.
eg pciconf -r pci0:10:0 0:0xff
and keep the output of the old singleton the same.

Reviewed by: audit@, dd

MFC after: 10 days


# 77513 31-May-2001 imp

Minor style(9) tweak: if ( instead of if(.


# 69785 08-Dec-2000 msmith

Update for new location of pcireg.h.


# 69700 07-Dec-2000 msmith

Update to improve handling of verbose PCI vendor/device information.

- Read the database from /usr/share/misc (or wherever else we're pointed)
rather than compiling it in.
- Decode the class/subclass fields if requested.
- Print things in a slightly longer but more readable format.


# 68677 13-Nov-2000 msmith

Add support for decoding the PCI vendor and device ID registers. Add a
database of about 1400 vendors and 2700 devices courtesy of
www.yourvote.com/pci. We still need to add some more, but this is a good
start.


# 54322 08-Dec-1999 ken

[ repository copy of sys/pci/pci_ioctl.h to sys/sys/pciio.h happened in the
background ]

Rename sys/pci/pci_ioctl.h to sys/sys/pciio.h to make it easier for
userland programs to use this interface. Reformat the file, and add a
BSD-style copyright to it.

Add a new man page for pci(4). The PCIOCGETCONF, PCIOCREAD, and PCIOCWRITE
ioctls are documented, but the PCIOCATTACHED ioctl is not documented
because it is not implemented.

Change includes of <pci/pci_ioctl.h> to <sys/pciio.h> or remove them
altogether. In many cases, pci_ioctl.h was unused.

Reviewed by: steve


# 53761 27-Nov-1999 charnier

.Fn -> .Xr
Do not start warn() message with uppercase.


# 50479 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 50225 23-Aug-1999 peter

Fix a few problems on the Alpha, and fix -Wall while here.
Before:
isab0@pci0:8:0: class=0x060100 card=0x00000000 chip=0xffffffffc6931080 ...
After:
isab0@pci0:8:0: class=0x060100 card=0x00000000 chip=0xc6931080 ...


# 41103 11-Nov-1998 ken

Modify pciconf(8) so that it will print out PCI devices that have no driver
configured in the kernel. It gives them a device name of "none" and
monotonically incrementing unit numbers. (starting at 0) Before, pciconf
would just skip over unconfigured devices. (unconfigured devices can be
detected because they have a null string for a device name)

Update the man page to reflect the new pciconf output. Unfortunately, this
causes the sample 'pciconf -l' output lines to wrap, but I'm not sure what
to do about that really.

If anyone presents a reasonable case for printing out something other than
"none1" for unconfigured devices, I'm willing to listen.


# 39231 15-Sep-1998 gibbs

Revive PCIConf.

Submitted by: "Kenneth D. Merry" <ken@plutotech.com>


# 30172 06-Oct-1997 charnier

Sync usage string with man page.


# 24428 31-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# 21935 21-Jan-1997 se

Add PCI LKM support:New -a option checks whether a driver has been assigned to a device.


# 19817 16-Nov-1996 se

Fix core dump after printing usage message (pointed out by BDE).
Add printing of PCI header type register. (This makes the output
80 columns wide. Ughh. I'm looking for a better way to put the
information on one line ...)


# 19103 22-Oct-1996 se

This commit was generated by cvs2svn to compensate for changes in r19102,
which included commits to RCS files with non-trunk default branches.


# 19102 22-Oct-1996 se

Initial version of the user land code for the PCI config register
access functions. Written by Garrett Wollman and modified by me to
better match my view of the (PCI) world.

Submitted by: wollman