summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2019-10-13 05:11:53 +0000
committerScott Long <scottl@FreeBSD.org>2019-10-13 05:11:53 +0000
commitfe1c3596032574d05f9912275d62fea5ffbfd481 (patch)
treed3df014f488056eca7aa9500fa3b467f617b8c8d /usr.sbin
parentef2e580e561a89579acefc3b83fc905425ffbd9e (diff)
downloadsrc-test2-fe1c3596032574d05f9912275d62fea5ffbfd481.tar.gz
src-test2-fe1c3596032574d05f9912275d62fea5ffbfd481.zip
Notes
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pciconf/cap.c5
-rw-r--r--usr.sbin/pciconf/pciconf.839
-rw-r--r--usr.sbin/pciconf/pciconf.c12
3 files changed, 29 insertions, 27 deletions
diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c
index e2a533c45cbf..3e9dd1aeaadb 100644
--- a/usr.sbin/pciconf/cap.c
+++ b/usr.sbin/pciconf/cap.c
@@ -371,9 +371,12 @@ static void
cap_subvendor(int fd, struct pci_conf *p, uint8_t ptr)
{
uint32_t id;
+ uint16_t ssid, ssvid;
id = read_config(fd, &p->pc_sel, ptr + PCIR_SUBVENDCAP_ID, 4);
- printf("PCI Bridge card=0x%08x", id);
+ ssid = id >> 16;
+ ssvid = id & 0xffff;
+ printf("PCI Bridge subvendor=0x%04x subdevice=0x%04x", ssvid, ssid);
}
#define MAX_PAYLOAD(field) (128 << (field))
diff --git a/usr.sbin/pciconf/pciconf.8 b/usr.sbin/pciconf/pciconf.8
index eb2e038d7e82..14a9beb3a5da 100644
--- a/usr.sbin/pciconf/pciconf.8
+++ b/usr.sbin/pciconf/pciconf.8
@@ -60,16 +60,16 @@ option,
.Nm
lists PCI devices in the following format:
.Bd -literal
-foo0@pci0:0:4:0: class=0x010000 card=0x00000000 chip=0x000f1000 rev=0x01 \
-hdr=0x00
-bar0@pci0:0:5:0: class=0x000100 card=0x00000000 chip=0x88c15333 rev=0x00 \
-hdr=0x00
-none0@pci0:0:6:0: class=0x020000 card=0x00000000 chip=0x802910ec rev=0x00 \
-hdr=0x00
+foo0@pci0:0:4:0: class=0x010000 rev=0x01 hdr=0x00 vendor=0x1000 device=0x000f \
+subvendor=0x0000 subdevice=0x0000
+bar0@pci0:0:5:0: class=0x000100 rev=0x00 hdr=0x00 vendor=0x88c1 device=0x5333 \
+subvendor=0x0000 subdevice=0x0000
+none0@pci0:0:6:0: class=0x020000 rev=0x00 hdr=0x00 vendor=0x10ec device=0x8029 \
+subvendor=0x0000 subdevice=0x0000
.Ed
.Pp
The first column gives the
-driver name, unit number, and selector .
+driver name, unit number, and selector.
If there is no driver attached to the
.Tn PCI
device in question, the driver name will be
@@ -80,21 +80,10 @@ The selector
is in a form which may directly be used for the other forms of the command.
The second column is the class code, with the class byte printed as two
hex digits, followed by the sub-class and the interface bytes.
-The third column gives the contents of the subvendorid register, introduced
-in revision 2.1 of the
-.Tn PCI
-standard.
-Note that it will be 0 for older cards.
-The field consists of the card ID in the upper
-half and the card vendor ID in the lower half of the value.
+The third column prints the device's revision.
+The fourth column describes the header type.
.Pp
-The fourth column contains the chip device ID, which identifies the chip
-this card is based on.
-It consists of two fields, identifying the chip and
-its vendor, as above.
-The fifth column prints the chip's revision.
-The sixth column describes the header type.
-Currently assigned header types include 0 for most devices,
+Currently assigned header types include 0 for standard devices,
1 for
.Tn PCI
to
@@ -113,6 +102,14 @@ device, it is a
device, which contains several (similar or independent) functions on
one chip.
.Pp
+The sixth and seventh columns contain the vendor ID and the device ID of the
+device.
+The eigth and ninth columns contain subvendor and subdevice IDs, introduced
+in revision 2.1 of the
+.Tn PCI
+standard.
+Note that they will be 0 for older cards.
+.Pp
If the
.Fl B
option is supplied,
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index 878b8d17b7e2..4c136c6ac02c 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -261,8 +261,10 @@ list_devs(const char *name, int verbose, int bars, int bridge, int caps,
return;
}
for (p = conf; p < &conf[pc.num_matches]; p++) {
- printf("%s%d@pci%d:%d:%d:%d:\tclass=0x%06x subvendor=0x%04x subdevice=0x%04x "
- "vendor=0x%04x device=0x%04x rev=0x%02x hdr=0x%02x\n",
+ printf("%s%d@pci%d:%d:%d:%d:"
+ "\tclass=0x%06x rev=0x%02x hdr=0x%02x "
+ "vendor=0x%04x device=0x%04x "
+ "subvendor=0x%04x subdevice=0x%04x\n",
*p->pd_name ? p->pd_name :
"none",
*p->pd_name ? (int)p->pd_unit :
@@ -270,9 +272,9 @@ list_devs(const char *name, int verbose, int bars, int bridge, int caps,
p->pc_sel.pc_bus, p->pc_sel.pc_dev,
p->pc_sel.pc_func, (p->pc_class << 16) |
(p->pc_subclass << 8) | p->pc_progif,
- p->pc_subdevice, p->pc_subvendor,
- p->pc_device, p->pc_vendor,
- p->pc_revid, p->pc_hdr);
+ p->pc_revid, p->pc_hdr,
+ p->pc_vendor, p->pc_device,
+ p->pc_subvendor, p->pc_subdevice);
if (verbose)
list_verbose(p);
if (bars)