From 175dc693e89b10f8434510fea521755459e14d13 Mon Sep 17 00:00:00 2001 From: Ryan Stone Date: Fri, 14 Mar 2014 21:51:35 -0400 Subject: [PATCH 5/5] Print status of ARI capability in pciconf -c --- usr.sbin/pciconf/cap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 1.8.5.2