Module Name: src Committed By: msaitoh Date: Wed Oct 3 06:46:09 UTC 2018
Modified Files: src/sys/dev/pci: pci_subr.c pcireg.h Log Message: - 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. To generate a diff of this commit: cvs rdiff -u -r1.204 -r1.205 src/sys/dev/pci/pci_subr.c cvs rdiff -u -r1.141 -r1.142 src/sys/dev/pci/pcireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/pci_subr.c diff -u src/sys/dev/pci/pci_subr.c:1.204 src/sys/dev/pci/pci_subr.c:1.205 --- src/sys/dev/pci/pci_subr.c:1.204 Thu Sep 27 07:09:29 2018 +++ src/sys/dev/pci/pci_subr.c Wed Oct 3 06:46:09 2018 @@ -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_ 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); Index: src/sys/dev/pci/pcireg.h diff -u src/sys/dev/pci/pcireg.h:1.141 src/sys/dev/pci/pcireg.h:1.142 --- src/sys/dev/pci/pcireg.h:1.141 Thu Sep 27 07:09:29 2018 +++ src/sys/dev/pci/pcireg.h Wed Oct 3 06:46:09 2018 @@ -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