diff options
author | gavin <gavin@FreeBSD.org> | 2012-09-18 22:04:59 +0000 |
---|---|---|
committer | gavin <gavin@FreeBSD.org> | 2012-09-18 22:04:59 +0000 |
commit | 5005c75c5d4c3cea0b6150e4a8c7a1d2f928c052 (patch) | |
tree | 7ed0c63fa2cebe3a1c0f0d218ef7d4208fbecfc4 /usr.sbin/pciconf | |
parent | 2f179bd308efd2cd4801f4373a8ac9fb8d37d848 (diff) | |
download | FreeBSD-src-5005c75c5d4c3cea0b6150e4a8c7a1d2f928c052.zip FreeBSD-src-5005c75c5d4c3cea0b6150e4a8c7a1d2f928c052.tar.gz |
Align the PCI Express #defines with the style used for the PCI-X
#defines. This also has the advantage that it makes the names more
compact, iand also allows us to correct the non-uniform naming of
the PCIM_LINK_* defines, making them all consistent amongst themselves.
This is a mostly mechanical rename:
s/PCIR_EXPRESS_/PCIER_/g
s/PCIM_EXP_/PCIEM_/g
s/PCIM_LINK_/PCIEM_LINK_/g
When this is MFC'd, #defines will be added for the old names to assist
out-of-tree drivers.
Discussed with: jhb
MFC after: 1 week
Diffstat (limited to 'usr.sbin/pciconf')
-rw-r--r-- | usr.sbin/pciconf/cap.c | 50 | ||||
-rw-r--r-- | usr.sbin/pciconf/err.c | 18 |
2 files changed, 34 insertions, 34 deletions
diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index 77f116c..0dff0b2 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -369,55 +369,55 @@ 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); - printf("PCI-Express %d ", flags & PCIM_EXP_FLAGS_VERSION); - switch (flags & PCIM_EXP_FLAGS_TYPE) { - case PCIM_EXP_TYPE_ENDPOINT: + flags = read_config(fd, &p->pc_sel, ptr + PCIER_FLAGS, 2); + printf("PCI-Express %d ", flags & PCIEM_FLAGS_VERSION); + switch (flags & PCIEM_FLAGS_TYPE) { + case PCIEM_TYPE_ENDPOINT: printf("endpoint"); break; - case PCIM_EXP_TYPE_LEGACY_ENDPOINT: + case PCIEM_TYPE_LEGACY_ENDPOINT: printf("legacy endpoint"); break; - case PCIM_EXP_TYPE_ROOT_PORT: + case PCIEM_TYPE_ROOT_PORT: printf("root port"); break; - case PCIM_EXP_TYPE_UPSTREAM_PORT: + case PCIEM_TYPE_UPSTREAM_PORT: printf("upstream port"); break; - case PCIM_EXP_TYPE_DOWNSTREAM_PORT: + case PCIEM_TYPE_DOWNSTREAM_PORT: printf("downstream port"); break; - case PCIM_EXP_TYPE_PCI_BRIDGE: + case PCIEM_TYPE_PCI_BRIDGE: printf("PCI bridge"); break; - case PCIM_EXP_TYPE_PCIE_BRIDGE: + case PCIEM_TYPE_PCIE_BRIDGE: printf("PCI to PCIe bridge"); break; - case PCIM_EXP_TYPE_ROOT_INT_EP: + case PCIEM_TYPE_ROOT_INT_EP: printf("root endpoint"); break; - case PCIM_EXP_TYPE_ROOT_EC: + case PCIEM_TYPE_ROOT_EC: printf("event collector"); break; default: - printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 4); + printf("type %d", (flags & PCIEM_FLAGS_TYPE) >> 4); break; } - if (flags & PCIM_EXP_FLAGS_SLOT) + if (flags & PCIEM_FLAGS_SLOT) printf(" slot"); - if (flags & PCIM_EXP_FLAGS_IRQ) - printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 9); - 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); + if (flags & PCIEM_FLAGS_IRQ) + printf(" IRQ %d", (flags & PCIEM_FLAGS_IRQ) >> 9); + val = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr + PCIER_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)); - if (val & PCIM_EXP_CAP_FLR) + MAX_PAYLOAD((flags & PCIEM_CTL_MAX_PAYLOAD) >> 5), + MAX_PAYLOAD(val & PCIEM_CAP_MAX_PAYLOAD)); + if (val & PCIEM_CAP_FLR) printf(" FLR"); - 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); + val = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr+ PCIER_LINK_STA, 2); + printf(" link x%d(x%d)", (flags & PCIEM_LINK_STA_WIDTH) >> 4, + (val & PCIEM_LINK_CAP_MAX_WIDTH) >> 4); } static void diff --git a/usr.sbin/pciconf/err.c b/usr.sbin/pciconf/err.c index 6b364f6..b67d1f5 100644 --- a/usr.sbin/pciconf/err.c +++ b/usr.sbin/pciconf/err.c @@ -63,18 +63,18 @@ static struct bit_table pci_status[] = { /* Error indicators in the PCI-Express device status register. */ static struct bit_table pcie_device_status[] = { - { PCIM_EXP_STA_CORRECTABLE_ERROR, "Correctable Error Detected" }, - { PCIM_EXP_STA_NON_FATAL_ERROR, "Non-Fatal Error Detected" }, - { PCIM_EXP_STA_FATAL_ERROR, "Fatal Error Detected" }, - { PCIM_EXP_STA_UNSUPPORTED_REQ, "Unsupported Request Detected" }, + { PCIEM_STA_CORRECTABLE_ERROR, "Correctable Error Detected" }, + { PCIEM_STA_NON_FATAL_ERROR, "Non-Fatal Error Detected" }, + { PCIEM_STA_FATAL_ERROR, "Fatal Error Detected" }, + { PCIEM_STA_UNSUPPORTED_REQ, "Unsupported Request Detected" }, { 0, NULL }, }; /* Valid error indicator bits in the PCI-Express device status register. */ -#define PCIE_ERRORS (PCIM_EXP_STA_CORRECTABLE_ERROR | \ - PCIM_EXP_STA_NON_FATAL_ERROR | \ - PCIM_EXP_STA_FATAL_ERROR | \ - PCIM_EXP_STA_UNSUPPORTED_REQ) +#define PCIE_ERRORS (PCIEM_STA_CORRECTABLE_ERROR | \ + PCIEM_STA_NON_FATAL_ERROR | \ + PCIEM_STA_FATAL_ERROR | \ + PCIEM_STA_UNSUPPORTED_REQ) /* AER Uncorrected errors. */ static struct bit_table aer_uc[] = { @@ -153,7 +153,7 @@ list_errors(int fd, struct pci_conf *p) return; /* Check for PCI-e errors. */ - sta = read_config(fd, &p->pc_sel, pcie + PCIR_EXPRESS_DEVICE_STA, 2); + sta = read_config(fd, &p->pc_sel, pcie + PCIER_DEVICE_STA, 2); print_bits("PCI-e errors", pcie_device_status, sta & PCIE_ERRORS); /* See if this device supports AER. */ |