Module Name: src Committed By: msaitoh Date: Thu Sep 27 07:09:29 UTC 2018
Modified Files: src/sys/dev/pci: pci_subr.c pcireg.h Log Message: Root Complex Event Collector Bus Number Association ECN. - If capability version is 2 (or greater), decode RCEC Associated Bus Numbers register. To generate a diff of this commit: cvs rdiff -u -r1.203 -r1.204 src/sys/dev/pci/pci_subr.c cvs rdiff -u -r1.140 -r1.141 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.203 src/sys/dev/pci/pci_subr.c:1.204 --- src/sys/dev/pci/pci_subr.c:1.203 Wed Sep 12 07:42:22 2018 +++ src/sys/dev/pci/pci_subr.c Thu Sep 27 07:09:29 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_subr.c,v 1.203 2018/09/12 07:42:22 msaitoh Exp $ */ +/* $NetBSD: pci_subr.c,v 1.204 2018/09/27 07:09:29 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.203 2018/09/12 07:42:22 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.204 2018/09/27 07:09:29 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_pci.h" @@ -3061,6 +3061,18 @@ pci_conf_print_rcec_assoc_cap(const pcir reg = regs[o2i(extcapoff + PCI_RCEC_ASSOC_ASSOCBITMAP)]; printf(" Association Bitmap for Root Complex Integrated Devices:" " 0x%08x\n", reg); + + if (PCI_EXTCAPLIST_VERSION(regs[o2i(extcapoff)]) >= 2) { + reg = regs[o2i(extcapoff + PCI_RCEC_ASSOC_ASSOCBUSNUM)]; + printf(" RCEC Associated Bus Numbers register: 0x%08x\n", + reg); + printf(" RCEC Next Bus: %u\n", + (unsigned int)__SHIFTOUT(reg, + PCI_RCEC_ASSOCBUSNUM_RCECNEXT)); + printf(" RCEC Last Bus: %u\n", + (unsigned int)__SHIFTOUT(reg, + PCI_RCEC_ASSOCBUSNUM_RCECLAST)); + } } /* XXX pci_conf_print_mfvc_cap */ Index: src/sys/dev/pci/pcireg.h diff -u src/sys/dev/pci/pcireg.h:1.140 src/sys/dev/pci/pcireg.h:1.141 --- src/sys/dev/pci/pcireg.h:1.140 Wed Sep 12 07:42:21 2018 +++ src/sys/dev/pci/pcireg.h Thu Sep 27 07:09:29 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pcireg.h,v 1.140 2018/09/12 07:42:21 msaitoh Exp $ */ +/* $NetBSD: pcireg.h,v 1.141 2018/09/27 07:09:29 msaitoh Exp $ */ /* * Copyright (c) 1995, 1996, 1999, 2000 @@ -1699,7 +1699,10 @@ struct pci_rom { * Extended capability ID: 0x0007 * Root Complex Event Collector Association */ -#define PCI_RCEC_ASSOC_ASSOCBITMAP 0x04 +#define PCI_RCEC_ASSOC_ASSOCBITMAP 0x04 /* Association Bitmap */ +#define PCI_RCEC_ASSOC_ASSOCBUSNUM 0x08 /* Associcated Bus Number */ +#define PCI_RCEC_ASSOCBUSNUM_RCECNEXT __BITS(15, 8) /* RCEC Next Bus */ +#define PCI_RCEC_ASSOCBUSNUM_RCECLAST __BITS(23, 16) /* RCEC Last Bus */ /* * Extended capability ID: 0x0008