Module Name:    src
Committed By:   msaitoh
Date:           Tue Apr 16 09:13:05 UTC 2013

Modified Files:
        src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
 Fix a bug that IRQ(MSI) bits in PCIe capability register is incorrectly
decoded. The bit field is not 0x4e000000 but 0x3e000000.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.78 -r1.79 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.96 src/sys/dev/pci/pci_subr.c:1.97
--- src/sys/dev/pci/pci_subr.c:1.96	Mon Apr 15 18:51:29 2013
+++ src/sys/dev/pci/pci_subr.c	Tue Apr 16 09:13:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.96 2013/04/15 18:51:29 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.97 2013/04/16 09:13:04 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.96 2013/04/15 18:51:29 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.97 2013/04/16 09:13:04 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -855,7 +855,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	if (check_slot && (regs[o2i(capoff)] & 0x01000000) != 0)
 		printf("    Slot implemented\n");
 	printf("    Interrupt Message Number: %x\n",
-	    (unsigned int)((regs[o2i(capoff)] & 0x4e000000) >> 27));
+	    (unsigned int)((regs[o2i(capoff)] & PCI_PCIE_XCAP_IRQ) >> 27));
 	printf("    Link Capabilities Register: 0x%08x\n",
 	    regs[o2i(capoff + 0x0c)]);
 	printf("      Maximum Link Speed: ");

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.78 src/sys/dev/pci/pcireg.h:1.79
--- src/sys/dev/pci/pcireg.h:1.78	Mon Apr 15 18:48:36 2013
+++ src/sys/dev/pci/pcireg.h	Tue Apr 16 09:13:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.78 2013/04/15 18:48:36 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.79 2013/04/16 09:13:04 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -647,6 +647,7 @@ struct pci_msix_table_entry {
 #define	 PCI_PCIE_XCAP_TYPE_ROOT_INTEP	__SHIFTIN(0x9, PCI_PCIE_XCAP_TYPE_MASK)
 #define	 PCI_PCIE_XCAP_TYPE_ROOT_EVNTC	__SHIFTIN(0xa, PCI_PCIE_XCAP_TYPE_MASK)
 #define PCI_PCIE_XCAP_SI	__SHIFTIN(__BIT(8), PCI_PCIE_XCAP_MASK)		/* Slot Implemented */
+#define PCI_PCIE_XCAP_IRQ	__SHIFTIN(__BITS(13, 9), PCI_PCIE_XCAP_MASK)
 #define PCI_PCIE_DCAP		0x04	/* Device Capabilities Register */
 #define PCI_PCIE_DCAP_MAX_PAYLOAD	__BITS(2, 0)
 #define PCI_PCIE_DCAP_PHANTHOM_FUNCS	__BITS(4, 3)

Reply via email to