Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Add an XHCI_DISABLE_MSI option
details: https://anonhg.NetBSD.org/src/rev/82251fe2c3cb
branches: trunk
changeset: 826441:82251fe2c3cb
user: skrll <skrll%NetBSD.org@localhost>
date: Tue Sep 05 08:01:43 2017 +0000
description:
Add an XHCI_DISABLE_MSI option
diffstat:
sys/dev/pci/files.pci | 3 ++-
sys/dev/pci/xhci_pci.c | 18 +++++++++++++++---
2 files changed, 17 insertions(+), 4 deletions(-)
diffs (57 lines):
diff -r cba3705d163f -r 82251fe2c3cb sys/dev/pci/files.pci
--- a/sys/dev/pci/files.pci Tue Sep 05 05:03:02 2017 +0000
+++ b/sys/dev/pci/files.pci Tue Sep 05 08:01:43 2017 +0000
@@ -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 @@
# 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 -r cba3705d163f -r 82251fe2c3cb sys/dev/pci/xhci_pci.c
--- a/sys/dev/pci/xhci_pci.c Tue Sep 05 05:03:02 2017 +0000
+++ b/sys/dev/pci/xhci_pci.c Tue Sep 05 08:01:43 2017 +0000
@@ -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 @@
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;
}
Home |
Main Index |
Thread Index |
Old Index