diff --git a/sys/dev/pci/files.pci b/sys/dev/pci/files.pci index c2059f7fb246..69044840949f 100644 --- a/sys/dev/pci/files.pci +++ b/sys/dev/pci/files.pci @@ -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_cardbus # 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 diff --git a/sys/dev/pci/xhci_pci.c b/sys/dev/pci/xhci_pci.c index 4c0533c24663..d91bf589fd1b 100644 --- a/sys/dev/pci/xhci_pci.c +++ b/sys/dev/pci/xhci_pci.c @@ -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 -__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 #include @@ -173,8 +177,16 @@ xhci_pci_attach(device_t parent, device_t self, void *aux) 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; }