Module Name: src Committed By: skrll Date: Tue Sep 5 08:01:43 UTC 2017
Modified Files: src/sys/dev/pci: files.pci xhci_pci.c Log Message: Add an XHCI_DISABLE_MSI option To generate a diff of this commit: cvs rdiff -u -r1.390 -r1.391 src/sys/dev/pci/files.pci cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/xhci_pci.c 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/files.pci diff -u src/sys/dev/pci/files.pci:1.390 src/sys/dev/pci/files.pci:1.391 --- src/sys/dev/pci/files.pci:1.390 Wed Aug 30 08:49:18 2017 +++ src/sys/dev/pci/files.pci Tue Sep 5 08:01:43 2017 @@ -1,4 +1,4 @@ -# $NetBSD: files.pci,v 1.390 2017/08/30 08:49:18 msaitoh Exp $ +# $NetBSD: files.pci,v 1.391 2017/09/05 08:01:43 skrll Exp $ # # Config file and device description for machine-independent PCI code. # Included by ports that need it. Requires that the SCSI files be @@ -635,6 +635,7 @@ file dev/pci/usb_pci.c ehci_pci | ehci_ # xHCI USB controller attach xhci at pci with xhci_pci file dev/pci/xhci_pci.c xhci_pci +defflag opt_xhci_pci.h XHCI_DISABLE_MSI # OHCI IEEE 1394 controller attach fwohci at pci with fwohci_pci Index: src/sys/dev/pci/xhci_pci.c diff -u src/sys/dev/pci/xhci_pci.c:1.8 src/sys/dev/pci/xhci_pci.c:1.9 --- src/sys/dev/pci/xhci_pci.c:1.8 Thu Jan 19 16:05:00 2017 +++ src/sys/dev/pci/xhci_pci.c Tue Sep 5 08:01:43 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci_pci.c,v 1.8 2017/01/19 16:05:00 skrll Exp $ */ +/* $NetBSD: xhci_pci.c,v 1.9 2017/09/05 08:01:43 skrll Exp $ */ /* OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp */ /* @@ -32,7 +32,11 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.8 2017/01/19 16:05:00 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.9 2017/09/05 08:01:43 skrll Exp $"); + +#ifdef _KERNEL_OPT +#include "opt_xhci_pci.h" +#endif #include <sys/param.h> #include <sys/systm.h> @@ -173,8 +177,16 @@ xhci_pci_attach(device_t parent, device_ pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr | PCI_COMMAND_MASTER_ENABLE); + /* Allocation settings */ + int counts[PCI_INTR_TYPE_SIZE] = { + [PCI_INTR_TYPE_INTX] = 1, +#ifndef XHCI_DISABLE_MSI + [PCI_INTR_TYPE_MSI] = 1, +#endif + }; + /* Allocate and establish the interrupt. */ - if (pci_intr_alloc(pa, &psc->sc_pihp, NULL, 0)) { + if (pci_intr_alloc(pa, &psc->sc_pihp, counts, PCI_INTR_TYPE_MSIX)) { aprint_error_dev(self, "can't allocate handler\n"); goto fail; }