Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci xhci_pci.c: reimplement XHCI_DISABLE_MSI and XHC...
details: https://anonhg.NetBSD.org/src/rev/ca69cba2d8fb
branches: trunk
changeset: 951591:ca69cba2d8fb
user: dbj <dbj%NetBSD.org@localhost>
date: Sun Feb 07 04:58:17 2021 +0000
description:
xhci_pci.c: reimplement XHCI_DISABLE_MSI and XHCI_DISABLE_MSIX
diffstat:
sys/dev/pci/xhci_pci.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diffs (46 lines):
diff -r 272de1855610 -r ca69cba2d8fb sys/dev/pci/xhci_pci.c
--- a/sys/dev/pci/xhci_pci.c Sun Feb 07 01:53:54 2021 +0000
+++ b/sys/dev/pci/xhci_pci.c Sun Feb 07 04:58:17 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xhci_pci.c,v 1.26 2020/12/09 14:21:09 jakllsch Exp $ */
+/* $NetBSD: xhci_pci.c,v 1.27 2021/02/07 04:58:17 dbj Exp $ */
/* OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.26 2020/12/09 14:21:09 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.27 2021/02/07 04:58:17 dbj Exp $");
#ifdef _KERNEL_OPT
#include "opt_xhci_pci.h"
@@ -126,6 +126,7 @@
char const *intrstr;
pcireg_t csr, memtype, usbrev;
uint32_t hccparams;
+ int counts[PCI_INTR_TYPE_SIZE];
char intrbuf[PCI_INTRSTR_LEN];
bus_addr_t memaddr;
int flags, msixoff;
@@ -211,8 +212,18 @@
pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
csr | PCI_COMMAND_MASTER_ENABLE);
+ for (int i = 0; i < PCI_INTR_TYPE_SIZE; i++) {
+ counts[i] = 1;
+ }
+#ifdef XHCI_DISABLE_MSI
+ counts[PCI_INTR_TYPE_MSI] = 0;
+#endif
+#ifdef XHCI_DISABLE_MSIX
+ counts[PCI_INTR_TYPE_MSIX] = 0;
+#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, 0)) {
aprint_error_dev(self, "can't allocate handler\n");
goto fail;
}
Home |
Main Index |
Thread Index |
Old Index