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/0494e6b9d669
branches: trunk
changeset: 1018541:0494e6b9d669
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 8b875dbb81dc -r 0494e6b9d669 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