diff options
| author | msaitoh <msaitoh@NetBSD.org> | 2018-10-03 06:46:09 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 2018-10-03 06:46:09 +0000 |
| commit | 20fdbec41144a966731a13c7da720a4336daddbd (patch) | |
| tree | 5c84b035a916df32c5a04a2c7afb1c6a0c6d64fb /sys/dev | |
| parent | b8ed10933b54491eac332e8bd430698f01b7abc1 (diff) | |
- Don't print TPH requester's ST Table Size if the ST table location field
is not PCI_TPH_REQ_STTBLLOC_TPHREQ because the size field is only applicaple
for PCI_TPH_REQ_STTBLLOC_TPHREQ case.
- Add comment.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pci/pci_subr.c | 12 | ||||
| -rw-r--r-- | sys/dev/pci/pcireg.h | 6 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c index 6647570afc6..4b855e45458 100644 --- a/sys/dev/pci/pci_subr.c +++ b/sys/dev/pci/pci_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_subr.c,v 1.204 2018/09/27 07:09:29 msaitoh Exp $ */ +/* $NetBSD: pci_subr.c,v 1.205 2018/10/03 06:46:09 msaitoh Exp $ */ /* * Copyright (c) 1997 Zubin D. Dittia. All rights reserved. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.204 2018/09/27 07:09:29 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.205 2018/10/03 06:46:09 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_pci.h" @@ -3538,7 +3538,7 @@ static void pci_conf_print_tph_req_cap(const pcireg_t *regs, int extcapoff) { pcireg_t reg; - int size, i, j; + int size = 0, i, j; uint8_t sttbloc; printf("\n TPH Requester Extended Capability\n"); @@ -3552,8 +3552,10 @@ pci_conf_print_tph_req_cap(const pcireg_t *regs, int extcapoff) sttbloc = __SHIFTOUT(reg, PCI_TPH_REQ_CAP_STTBLLOC); printf(" ST Table Location: %s\n", pci_conf_print_tph_req_cap_sttabloc(sttbloc)); - size = __SHIFTOUT(reg, PCI_TPH_REQ_CAP_STTBLSIZ) + 1; - printf(" ST Table Size: %d\n", size); + if (sttbloc == PCI_TPH_REQ_STTBLLOC_TPHREQ) { + size = __SHIFTOUT(reg, PCI_TPH_REQ_CAP_STTBLSIZ) + 1; + printf(" ST Table Size: %d\n", size); + } reg = regs[o2i(extcapoff + PCI_TPH_REQ_CTL)]; printf(" TPH Requester Control register: 0x%08x\n", reg); diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h index fb73877edc9..06589c01277 100644 --- a/sys/dev/pci/pcireg.h +++ b/sys/dev/pci/pcireg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pcireg.h,v 1.141 2018/09/27 07:09:29 msaitoh Exp $ */ +/* $NetBSD: pcireg.h,v 1.142 2018/10/03 06:46:09 msaitoh Exp $ */ /* * Copyright (c) 1995, 1996, 1999, 2000 @@ -1186,8 +1186,8 @@ struct pci_msix_table_entry { uint32_t pci_msix_vector_control; }; #define PCI_MSIX_VECTCTL_MASK __BIT(0) -#define PCI_MSIX_VECTCTL_STLO __BITS(23, 16) -#define PCI_MSIX_VECTCTL_STUP __BITS(31, 24) +#define PCI_MSIX_VECTCTL_STLO __BITS(23, 16) /* ST lower */ +#define PCI_MSIX_VECTCTL_STUP __BITS(31, 24) /* ST upper */ /* Max number of MSI-X vectors. See PCI-SIG specification. */ #define PCI_MSIX_MAX_VECTORS 2048 |
