aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pciconf
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2013-02-08 16:10:16 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2013-02-08 16:10:16 +0000
commitd9a447559bc04121f7c6682e64abe67efa154864 (patch)
treeb2f038222ff8a70f687652441df00d2b564c8abe /usr.sbin/pciconf
parent3cbf5f97aafc2b249c509ee1162c47c9b28e591e (diff)
parentfbda3d5daeeb730a49d025b614b35a32f0319718 (diff)
Notes
Diffstat (limited to 'usr.sbin/pciconf')
-rw-r--r--usr.sbin/pciconf/Makefile2
-rw-r--r--usr.sbin/pciconf/cap.c26
2 files changed, 15 insertions, 13 deletions
diff --git a/usr.sbin/pciconf/Makefile b/usr.sbin/pciconf/Makefile
index 32e984871166..a83973354523 100644
--- a/usr.sbin/pciconf/Makefile
+++ b/usr.sbin/pciconf/Makefile
@@ -5,8 +5,6 @@ PROG= pciconf
SRCS= pciconf.c cap.c err.c
MAN= pciconf.8
-CFLAGS+= -I${.CURDIR}/../../sys
-
WARNS?= 3
.include <bsd.prog.mk>
diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c
index ce184dd29453..1c2ab4a88777 100644
--- a/usr.sbin/pciconf/cap.c
+++ b/usr.sbin/pciconf/cap.c
@@ -449,24 +449,28 @@ cap_express(int fd, struct pci_conf *p, uint8_t ptr)
static void
cap_msix(int fd, struct pci_conf *p, uint8_t ptr)
{
- uint32_t val;
+ uint32_t pba_offset, table_offset, val;
+ int msgnum, pba_bar, table_bar;
uint16_t ctrl;
- int msgnum, table_bar, pba_bar;
ctrl = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_CTRL, 2);
msgnum = (ctrl & PCIM_MSIXCTRL_TABLE_SIZE) + 1;
+
val = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_TABLE, 4);
table_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK);
+ table_offset = val & ~PCIM_MSIX_BIR_MASK;
+
val = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_PBA, 4);
- pba_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK);
- printf("MSI-X supports %d message%s ", msgnum,
- (msgnum == 1) ? "" : "s");
- if (table_bar == pba_bar)
- printf("in map 0x%x", table_bar);
- else
- printf("in maps 0x%x and 0x%x", table_bar, pba_bar);
- if (ctrl & PCIM_MSIXCTRL_MSIX_ENABLE)
- printf(" enabled");
+ pba_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK);
+ pba_offset = val & ~PCIM_MSIX_BIR_MASK;
+
+ printf("MSI-X supports %d message%s%s\n", msgnum,
+ (msgnum == 1) ? "" : "s",
+ (ctrl & PCIM_MSIXCTRL_MSIX_ENABLE) ? ", enabled" : "");
+
+ printf(" ");
+ printf("Table in map 0x%x[0x%x], PBA in map 0x%x[0x%x]",
+ table_bar, table_offset, pba_bar, pba_offset);
}
static void