diff options
author | rstone <rstone@FreeBSD.org> | 2014-04-01 16:03:52 +0000 |
---|---|---|
committer | rstone <rstone@FreeBSD.org> | 2014-04-01 16:03:52 +0000 |
commit | 3c8f124628900a8ef394b0ad22a3daba828e8553 (patch) | |
tree | 103894033add03ec4a7b80ce51c70ff471f78cbb /usr.sbin/pciconf | |
parent | c8c0939762dd75c8135748ac5182421a240904b5 (diff) | |
download | FreeBSD-src-3c8f124628900a8ef394b0ad22a3daba828e8553.zip FreeBSD-src-3c8f124628900a8ef394b0ad22a3daba828e8553.tar.gz |
Print status of ARI capability in pciconf -c
Teach pciconf how to print out the status (enabled/disabled) of the ARI
capability on PCI Root Complexes and Downstream Ports.
MFC after: 2 months
Sponsored by: Sandvine Inc.
Diffstat (limited to 'usr.sbin/pciconf')
-rw-r--r-- | usr.sbin/pciconf/cap.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index d7296a3..bdcbe1d 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -410,7 +410,7 @@ aspm_string(uint8_t aspm) static void cap_express(int fd, struct pci_conf *p, uint8_t ptr) { - uint32_t cap; + uint32_t cap, cap2; uint16_t ctl, flags, sta; flags = read_config(fd, &p->pc_sel, ptr + PCIER_FLAGS, 2); @@ -452,6 +452,7 @@ cap_express(int fd, struct pci_conf *p, uint8_t ptr) if (flags & PCIEM_FLAGS_IRQ) printf(" IRQ %d", (flags & PCIEM_FLAGS_IRQ) >> 9); cap = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4); + cap2 = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP2, 4); ctl = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CTL, 2); printf(" max data %d(%d)", MAX_PAYLOAD((ctl & PCIEM_CTL_MAX_PAYLOAD) >> 5), @@ -474,6 +475,11 @@ cap_express(int fd, struct pci_conf *p, uint8_t ptr) printf(" ASPM %s(%s)", aspm_string(ctl & PCIEM_LINK_CTL_ASPMC), aspm_string((cap & PCIEM_LINK_CAP_ASPM) >> 10)); } + if ((cap2 & PCIEM_CAP2_ARI) != 0) { + ctl = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CTL2, 4); + printf(" ARI %s", + (ctl & PCIEM_CTL2_ARI) ? "enabled" : "disabled"); + } } static void |