Commit Graph

42 Commits

Author SHA1 Message Date
Konstantin Belousov
109de20b5a Add -D option to pciconf(8) to mmap and dump content of the device BAR.
Discussed with:	imp, jhb
Sponsored by:	The FreeBSD Foundation, Mellanox Technologies
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D15583
2018-08-01 19:02:05 +00:00
Eitan Adler
cef367e6a1 Don't repeat the the word 'the'
(one manual change to fix grammar)

Confirmed With: db
Approved by: secteam (not really, but this is a comment typo fix)
2016-05-17 12:52:31 +00:00
John Baldwin
15d107308f Add a new -B flag for use with list mode (-l) that lists details about
bridges.  Currently this includes information about what resources a
bridge decodes on the upstream side for use by downstream devices including
bus numbers, I/O port resources, and memory resources.  Windows and bus
ranges are enumerated for both PCI-PCI bridges and PCI-CardBus bridges.

To simplify the implementation, all enumeration is done by reading the
appropriate config space registers directly rather than querying the
bridge driver in the kernel via new ioctls.  This does result in a few
limitations.

First, an unimplemented window in a PCI-PCI bridge cannot be accurately
detected as accurate detection requires writing to the window base
register.  That is not safe for pciconf(8).  Instead, this assumes that
any window where both the base and limit read as all zeroes is
unimplemented.

Second, the PCI-PCI bridge driver in a tree has a few quirks for
PCI-PCI bridges that use subtractive decoding but do not indicate that
via the progif config register.  The list of quirks is duplicated in
pciconf's source.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D4171
2015-11-23 23:48:07 +00:00
Baptiste Daroussin
1ed2002089 Prefer pciids database from ports if present
Given the pciids database on ports is updated more often than the one in base
prefer this version if present, otherwise read the one from base.

MFC after:	1 week
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D3391
2015-09-06 20:05:29 +00:00
John Baldwin
84b755dfe5 Add support for displaying VPD for PCI devices via pciconf.
- Store the length of each read-only VPD value since not all values are
  guaranteed to be ASCII values (though most are).
- Add a new pciio ioctl to fetch VPD for a single PCI device.  The values
  are returned as a list of variable length records, one for the device
  name and each keyword.
- Add a new -V flag to pciconf's list mode which displays VPD data for
  each device.

MFC after:	1 week
2014-01-20 20:56:09 +00:00
John Baldwin
c9341dd343 - Allow PCI devices that are attached to a driver to be identified by their
device name instead of just the selector.
- Accept an optional device argument to -l to restrict the output to only
  listing details about a single device.  This is mostly useful in
  conjunction with other flags like -e or -c to allow a user to query
  details about a single device.

MFC after:	1 week
2014-01-20 15:51:02 +00:00
John Baldwin
b6de005505 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
2012-06-01 18:33:40 +00:00
Eitan Adler
50d675f7a9 Remove trailing whitespace per mdoc lint warning
Disussed with:	gavin
No objection from:	doc
Approved by:	joel
MFC after:	3 days
2012-03-29 05:02:12 +00:00
John Baldwin
b4fb1ba027 Document the format of extended capabilities in the '-c' output. 2010-09-09 18:51:20 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
John Baldwin
da1e0915c5 - 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
2009-02-02 19:54:16 +00:00
Dmitry Morozovsky
6429fb5015 devinfo(8) manual page refers to pciconfr(8). Add back reference for
completeness.

MFC After:	2 weeks
2007-11-07 12:55:51 +00:00
Stefan Eßer
d23a84a0a8 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)
2007-10-04 22:18:53 +00:00
Marius Strobl
55aaf894e8 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)
2007-09-30 11:05:18 +00:00
Ruslan Ermilov
6a290a48ca - Bump document date.
- Kill whitespace at EOL.
- Add missing markup bit.
2007-02-06 08:46:20 +00:00
John Baldwin
8866f04eb1 - 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
2007-02-02 19:54:17 +00:00
Robert Watson
9abf1c6ab8 Update pciconf man page to indicate that only some of the functions
in pciconf are limited to the superuser.

Requested by:	ru
2004-01-06 20:23:20 +00:00
Ruslan Ermilov
b4ad5e27f4 Moved $FreeBSD$ tag to where it belongs.
Approved by:	re (blanket)
2003-05-22 11:55:26 +00:00
Tom Rhodes
50c4e962b4 Fix up some grammar.
Noticed by:	sheldonh
2003-01-09 04:35:38 +00:00
Tom Rhodes
e776060494 Markup fixes. Document more correctly.
PR:		43678
Submitted by:	ru
2002-12-14 18:07:13 +00:00
John Polstra
3915eeb59d 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.
2002-09-17 18:10:39 +00:00
Ruslan Ermilov
a654c53e16 mdoc(7) police: Removed redundant .Ns calls. 2002-08-13 16:07:28 +00:00
Philippe Charnier
490d5836b5 The .Nm utility 2002-07-14 14:47:15 +00:00
Ruslan Ermilov
893ca9faea mdoc(7) police: make SYNOPSIS really match usage(). 2002-05-30 08:20:35 +00:00
Tom Rhodes
89408e839c pciconf(8) has an incorrect synopsis which argues the output from the
actual program.
2002-05-15 17:47:58 +00:00
Sheldon Hearn
393daa317e Add missing -v option to the SYNOPSIS. 2001-11-27 12:57:45 +00:00
Ruslan Ermilov
c5e7e03a14 Spell "FreeBSD" with "F" and "BSD" in uppercase. 2001-08-13 16:33:00 +00:00
Dima Dorfman
f247324df7 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
Ruslan Ermilov
a4c37c816b mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 15:12:08 +00:00
Warner Losh
8d0421472a 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
2001-05-31 18:31:43 +00:00
Mike Smith
a54bc9d028 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.
2000-12-07 10:52:59 +00:00
Ruslan Ermilov
f4d874a1db mdoc(7) police: do not split author names in the AUTHORS section. 2000-11-22 09:35:58 +00:00
Ruslan Ermilov
e97407b4f2 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 20:10:44 +00:00
Mike Smith
d8134896e9 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.
2000-11-13 12:08:29 +00:00
Sheldon Hearn
f2e366a105 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 14:09:25 +00:00
Philippe Charnier
541c4ca06d .Fn -> .Xr
Do not start warn() message with uppercase.
1999-11-27 16:59:06 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Guy Helmer
589228bd6a Replace LKM with KLD.
Submitted by:	Nathan Ahlstrom <nrahlstr@winternet.com>
1999-04-06 14:04:37 +00:00
Kenneth D. Merry
7f054c59a5 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.
1998-11-12 00:22:30 +00:00
Philippe Charnier
fbe2a70d6b Sync usage string with man page. 1997-10-06 11:38:30 +00:00
Peter Wemm
476602a9d0 Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
Stefan Eßer
da4e00105e Man page for the pciconf utility. There really should be some
documentation on the ioctl() interface provided by /dev/pci ...

Reviewed by:	wollman
1997-02-11 22:08:22 +00:00