diff options
author | jhb <jhb@FreeBSD.org> | 2009-04-17 19:07:44 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2009-04-17 19:07:44 +0000 |
commit | a48e119d8403c1c779a2ffa5b30a249de791399a (patch) | |
tree | b1e17c902be58a2a140ec05c5545d12adad3c0a9 /usr.sbin | |
parent | 3c53becddfacc240d13a708595866002ce361a1d (diff) | |
download | FreeBSD-src-a48e119d8403c1c779a2ffa5b30a249de791399a.zip FreeBSD-src-a48e119d8403c1c779a2ffa5b30a249de791399a.tar.gz |
- Add a few more register defintions for the PCI express capability
registers.
- Cleanup PCI-X capability printf to not leave a dangling "supports" for
some PCI-X bridges.
- Display additional PCI express details including the negotiated and max
link width and the actual and maximum supported max payload.
MFC after: 1 month
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pciconf/cap.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index 29ec6af..473ed01 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -151,7 +151,9 @@ cap_pcix(int fd, struct pci_conf *p, uint8_t ptr) printf("64-bit "); if ((p->pc_hdr & PCIM_HDRTYPE) == 1) printf("bridge "); - printf("supports"); + if ((p->pc_hdr & PCIM_HDRTYPE) != 1 || (status & (PCIXM_STATUS_133CAP | + PCIXM_STATUS_266CAP | PCIXM_STATUS_533CAP)) != 0) + printf("supports"); comma = 0; if (status & PCIXM_STATUS_133CAP) { printf("%s 133MHz", comma ? "," : ""); @@ -357,9 +359,12 @@ cap_subvendor(int fd, struct pci_conf *p, uint8_t ptr) printf("PCI Bridge card=0x%08x", id); } +#define MAX_PAYLOAD(field) (128 << (field)) + static void cap_express(int fd, struct pci_conf *p, uint8_t ptr) { + uint32_t val; uint16_t flags; flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_FLAGS, 2); @@ -383,12 +388,30 @@ cap_express(int fd, struct pci_conf *p, uint8_t ptr) case PCIM_EXP_TYPE_PCI_BRIDGE: printf("PCI bridge"); break; + case PCIM_EXP_TYPE_PCIE_BRIDGE: + printf("PCI to PCIe bridge"); + break; + case PCIM_EXP_TYPE_ROOT_INT_EP: + printf("root endpoint"); + break; + case PCIM_EXP_TYPE_ROOT_EC: + printf("event collector"); + break; default: - printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 8); + printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 4); break; } if (flags & PCIM_EXP_FLAGS_IRQ) - printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 17); + printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 8); + val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CTL, 2); + printf(" max data %d(%d)", + MAX_PAYLOAD((flags & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5), + MAX_PAYLOAD(val & PCIM_EXP_CAP_MAX_PAYLOAD)); + val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_LINK_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr+ PCIR_EXPRESS_LINK_STA, 2); + printf(" link x%d(x%d)", (flags & PCIM_LINK_STA_WIDTH) >> 4, + (val & PCIM_LINK_CAP_MAX_WIDTH) >> 4); } static void |