Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src pci_intr_type() is required pci_chipset_tag_t argument by ot...
details: https://anonhg.NetBSD.org/src/rev/d6d2c45c1b5f
branches: trunk
changeset: 346368:d6d2c45c1b5f
user: knakahara <knakahara%NetBSD.org@localhost>
date: Mon Jul 11 06:14:51 2016 +0000
description:
pci_intr_type() is required pci_chipset_tag_t argument by other than x86.
pointed out by nonaka@n.o.
diffstat:
share/man/man9/pci_msi.9 | 5 +++--
sys/arch/x86/include/pci_machdep_common.h | 4 ++--
sys/arch/x86/pci/pci_intr_machdep.c | 6 +++---
sys/dev/pci/if_bge.c | 6 +++---
sys/dev/pci/if_wm.c | 10 +++++-----
sys/dev/pci/ismt.c | 6 +++---
sys/dev/pci/ixgbe/ixgbe.c | 5 +++--
sys/dev/pci/nvme_pci.c | 9 +++++----
sys/dev/pci/pci_stub.c | 6 +++---
sys/dev/pci/pcivar.h | 4 ++--
sys/dev/pci/virtio.c | 8 ++++----
11 files changed, 36 insertions(+), 33 deletions(-)
diffs (truncated from 304 to 300 lines):
diff -r 8fe6586ab966 -r d6d2c45c1b5f share/man/man9/pci_msi.9
--- a/share/man/man9/pci_msi.9 Mon Jul 11 03:45:59 2016 +0000
+++ b/share/man/man9/pci_msi.9 Mon Jul 11 06:14:51 2016 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pci_msi.9,v 1.7 2015/08/13 05:01:04 msaitoh Exp $
+.\" $NetBSD: pci_msi.9,v 1.8 2016/07/11 06:14:51 knakahara Exp $
.\"
.\" Copyright (c) 2015 Internet Initiative Japan Inc.
.\" All rights reserved.
@@ -75,7 +75,8 @@
.Fn pci_intr_release "pci_chipset_tag_t pc" \
"pci_intr_handle_t *pih" "int count"
.Ft pci_intr_type_t
-.Fn pci_intr_type "pci_intr_handle_t ih"
+.Fn pci_intr_type "pci_chipset_tag_t pc" \
+"pci_intr_handle_t ih"
.Sh DESCRIPTION
The
.Nm
diff -r 8fe6586ab966 -r d6d2c45c1b5f sys/arch/x86/include/pci_machdep_common.h
--- a/sys/arch/x86/include/pci_machdep_common.h Mon Jul 11 03:45:59 2016 +0000
+++ b/sys/arch/x86/include/pci_machdep_common.h Mon Jul 11 06:14:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep_common.h,v 1.22 2015/10/22 09:45:32 knakahara Exp $ */
+/* $NetBSD: pci_machdep_common.h,v 1.23 2016/07/11 06:14:51 knakahara Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -127,7 +127,7 @@
PCI_INTR_TYPE_SIZE,
} pci_intr_type_t;
-pci_intr_type_t pci_intr_type(pci_intr_handle_t);
+pci_intr_type_t pci_intr_type(pci_chipset_tag_t, pci_intr_handle_t);
/*
* Wrapper function for generally unitied allocation to fallback MSI-X/MSI/INTx
* automatically.
diff -r 8fe6586ab966 -r d6d2c45c1b5f sys/arch/x86/pci/pci_intr_machdep.c
--- a/sys/arch/x86/pci/pci_intr_machdep.c Mon Jul 11 03:45:59 2016 +0000
+++ b/sys/arch/x86/pci/pci_intr_machdep.c Mon Jul 11 06:14:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_intr_machdep.c,v 1.37 2015/08/17 06:16:03 knakahara Exp $ */
+/* $NetBSD: pci_intr_machdep.c,v 1.38 2016/07/11 06:14:51 knakahara Exp $ */
/*-
* Copyright (c) 1997, 1998, 2009 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.37 2015/08/17 06:16:03 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.38 2016/07/11 06:14:51 knakahara Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -352,7 +352,7 @@
#if NIOAPIC > 0
pci_intr_type_t
-pci_intr_type(pci_intr_handle_t ih)
+pci_intr_type(pci_chipset_tag_t pc, pci_intr_handle_t ih)
{
if (INT_VIA_MSI(ih)) {
diff -r 8fe6586ab966 -r d6d2c45c1b5f sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c Mon Jul 11 03:45:59 2016 +0000
+++ b/sys/dev/pci/if_bge.c Mon Jul 11 06:14:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bge.c,v 1.297 2016/06/10 13:27:14 ozaki-r Exp $ */
+/* $NetBSD: if_bge.c,v 1.298 2016/07/11 06:14:51 knakahara Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.297 2016/06/10 13:27:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.298 2016/07/11 06:14:51 knakahara Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -3744,7 +3744,7 @@
sc->bge_intrhand = pci_intr_establish(pc, sc->bge_pihp[0], IPL_NET,
bge_intr, sc);
if (sc->bge_intrhand == NULL) {
- intr_type = pci_intr_type(sc->bge_pihp[0]);
+ intr_type = pci_intr_type(pc, sc->bge_pihp[0]);
aprint_error_dev(sc->bge_dev,"unable to establish %s\n",
(intr_type == PCI_INTR_TYPE_MSI) ? "MSI" : "INTx");
pci_intr_release(pc, sc->bge_pihp, 1);
diff -r 8fe6586ab966 -r d6d2c45c1b5f sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c Mon Jul 11 03:45:59 2016 +0000
+++ b/sys/dev/pci/if_wm.c Mon Jul 11 06:14:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.415 2016/06/20 08:34:59 knakahara Exp $ */
+/* $NetBSD: if_wm.c,v 1.416 2016/07/11 06:14:51 knakahara Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -85,7 +85,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.415 2016/06/20 08:34:59 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.416 2016/07/11 06:14:51 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -1681,7 +1681,7 @@
return;
}
- if (pci_intr_type(sc->sc_intrs[0]) == PCI_INTR_TYPE_MSIX) {
+ if (pci_intr_type(pc, sc->sc_intrs[0]) == PCI_INTR_TYPE_MSIX) {
error = wm_setup_msix(sc);
if (error) {
pci_intr_release(pc, sc->sc_intrs,
@@ -1693,7 +1693,7 @@
counts[PCI_INTR_TYPE_INTX] = 1;
goto alloc_retry;
}
- } else if (pci_intr_type(sc->sc_intrs[0]) == PCI_INTR_TYPE_MSI) {
+ } else if (pci_intr_type(pc, sc->sc_intrs[0]) == PCI_INTR_TYPE_MSI) {
wm_adjust_qnum(sc, 0); /* must not use multiqueue */
error = wm_setup_legacy(sc);
if (error) {
@@ -4334,7 +4334,7 @@
IPL_NET, wm_intr_legacy, sc, device_xname(sc->sc_dev));
if (sc->sc_ihs[0] == NULL) {
aprint_error_dev(sc->sc_dev,"unable to establish %s\n",
- (pci_intr_type(sc->sc_intrs[0])
+ (pci_intr_type(pc, sc->sc_intrs[0])
== PCI_INTR_TYPE_MSI) ? "MSI" : "INTx");
return ENOMEM;
}
diff -r 8fe6586ab966 -r d6d2c45c1b5f sys/dev/pci/ismt.c
--- a/sys/dev/pci/ismt.c Mon Jul 11 03:45:59 2016 +0000
+++ b/sys/dev/pci/ismt.c Mon Jul 11 06:14:51 2016 +0000
@@ -60,7 +60,7 @@
#if 0
__FBSDID("$FreeBSD: head/sys/dev/ismt/ismt.c 266474 2014-05-20 19:55:06Z jimharris $");
#endif
-__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.3 2016/02/01 08:53:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.4 2016/07/11 06:14:51 knakahara Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -765,12 +765,12 @@
ismt_intr, sc);
if (sc->sc_ih == NULL) {
aprint_error_dev(sc->pcidev, "unable to establish %s\n",
- (pci_intr_type(sc->sc_pihp[0])
+ (pci_intr_type(pa->pa_pc, sc->sc_pihp[0])
== PCI_INTR_TYPE_MSI) ? "MSI" : "INTx");
/* Polling */
}
- if (pci_intr_type(sc->sc_pihp[0]) == PCI_INTR_TYPE_MSI)
+ if (pci_intr_type(pa->pa_pc, sc->sc_pihp[0]) == PCI_INTR_TYPE_MSI)
sc->using_msi = 1;
aprint_normal_dev(sc->pcidev, "interrupting at %s\n", intrstr);
diff -r 8fe6586ab966 -r d6d2c45c1b5f sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Mon Jul 11 03:45:59 2016 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Mon Jul 11 06:14:51 2016 +0000
@@ -59,7 +59,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 279805 2015-03-09 10:29:15Z araujo $*/
-/*$NetBSD: ixgbe.c,v 1.38 2016/06/10 13:27:14 ozaki-r Exp $*/
+/*$NetBSD: ixgbe.c,v 1.39 2016/07/11 06:14:51 knakahara Exp $*/
#include "opt_inet.h"
#include "opt_inet6.h"
@@ -2536,7 +2536,8 @@
adapter->osdep.ihs[0] = pci_intr_establish(adapter->osdep.pc,
adapter->osdep.intrs[0], IPL_NET, ixgbe_legacy_irq, que);
if (adapter->osdep.ihs[0] == NULL) {
- intr_type = pci_intr_type(adapter->osdep.intrs[0]);
+ intr_type = pci_intr_type(adapter->osdep.pc,
+ adapter->osdep.intrs[0]);
aprint_error_dev(dev,"unable to establish %s\n",
(intr_type == PCI_INTR_TYPE_MSI) ? "MSI" : "INTx");
pci_intr_release(adapter->osdep.pc, adapter->osdep.intrs, 1);
diff -r 8fe6586ab966 -r d6d2c45c1b5f sys/dev/pci/nvme_pci.c
--- a/sys/dev/pci/nvme_pci.c Mon Jul 11 03:45:59 2016 +0000
+++ b/sys/dev/pci/nvme_pci.c Mon Jul 11 06:14:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nvme_pci.c,v 1.3 2016/06/24 15:25:43 nonaka Exp $ */
+/* $NetBSD: nvme_pci.c,v 1.4 2016/07/11 06:14:51 knakahara Exp $ */
/* $OpenBSD: nvme_pci.c,v 1.3 2016/04/14 11:18:32 dlg Exp $ */
/*
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvme_pci.c,v 1.3 2016/06/24 15:25:43 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme_pci.c,v 1.4 2016/07/11 06:14:51 knakahara Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -257,7 +257,8 @@
device_xname(sc->sc_dev), qid);
}
ih_arg = q;
- if (pci_intr_type(psc->psc_intrs[qid]) == PCI_INTR_TYPE_MSIX)
+ if (pci_intr_type(psc->psc_pc, psc->psc_intrs[qid])
+ == PCI_INTR_TYPE_MSIX)
ih_func = nvme_mq_msix_intr;
else
ih_func = nvme_mq_msi_intr;
@@ -399,7 +400,7 @@
return error;
}
- intr_type = pci_intr_type(ihps[0]);
+ intr_type = pci_intr_type(pa->pa_pc, ihps[0]);
if (alloced_counts[intr_type] < counts[intr_type]) {
if (intr_type != PCI_INTR_TYPE_INTX) {
pci_intr_release(pa->pa_pc, ihps,
diff -r 8fe6586ab966 -r d6d2c45c1b5f sys/dev/pci/pci_stub.c
--- a/sys/dev/pci/pci_stub.c Mon Jul 11 03:45:59 2016 +0000
+++ b/sys/dev/pci/pci_stub.c Mon Jul 11 06:14:51 2016 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_stub.c,v 1.4 2015/10/22 09:45:32 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_stub.c,v 1.5 2016/07/11 06:14:51 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_pci.h"
@@ -17,7 +17,7 @@
int default_pci_chipset_tag_create(pci_chipset_tag_t, uint64_t,
const struct pci_overrides *, void *, pci_chipset_tag_t *);
void default_pci_chipset_tag_destroy(pci_chipset_tag_t);
-pci_intr_type_t default_pci_intr_type(pci_intr_handle_t);
+pci_intr_type_t default_pci_intr_type(pci_chipset_tag_t, pci_intr_handle_t);
int default_pci_intr_alloc(const struct pci_attach_args *,
pci_intr_handle_t **, int *, pci_intr_type_t);
void default_pci_intr_release(pci_chipset_tag_t, pci_intr_handle_t *, int);
@@ -59,7 +59,7 @@
}
pci_intr_type_t
-default_pci_intr_type(pci_intr_handle_t ih)
+default_pci_intr_type(pci_chipset_tag_t pc, pci_intr_handle_t ih)
{
return PCI_INTR_TYPE_INTX;
diff -r 8fe6586ab966 -r d6d2c45c1b5f sys/dev/pci/pcivar.h
--- a/sys/dev/pci/pcivar.h Mon Jul 11 03:45:59 2016 +0000
+++ b/sys/dev/pci/pcivar.h Mon Jul 11 06:14:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcivar.h,v 1.107 2015/10/30 20:03:45 msaitoh Exp $ */
+/* $NetBSD: pcivar.h,v 1.108 2016/07/11 06:14:51 knakahara Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -359,7 +359,7 @@
} pci_intr_type_t;
pci_intr_type_t
- pci_intr_type(pci_intr_handle_t);
+ pci_intr_type(pci_chipset_tag_t, pci_intr_handle_t);
int pci_intr_alloc(const struct pci_attach_args *, pci_intr_handle_t **,
int *, pci_intr_type_t);
void pci_intr_release(pci_chipset_tag_t, pci_intr_handle_t *, int);
diff -r 8fe6586ab966 -r d6d2c45c1b5f sys/dev/pci/virtio.c
--- a/sys/dev/pci/virtio.c Mon Jul 11 03:45:59 2016 +0000
+++ b/sys/dev/pci/virtio.c Mon Jul 11 06:14:51 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio.c,v 1.15 2016/07/07 06:55:41 msaitoh Exp $ */
+/* $NetBSD: virtio.c,v 1.16 2016/07/11 06:14:51 knakahara Exp $ */
/*
* Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.15 2016/07/07 06:55:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.16 2016/07/11 06:14:51 knakahara Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -265,7 +265,7 @@
return -1;
}
- if (pci_intr_type(sc->sc_ihp[0]) == PCI_INTR_TYPE_MSIX) {
+ if (pci_intr_type(pc, sc->sc_ihp[0]) == PCI_INTR_TYPE_MSIX) {
sc->sc_ihs = kmem_alloc(sizeof(*sc->sc_ihs) * 2,
KM_SLEEP);
if (sc->sc_ihs == NULL) {
@@ -290,7 +290,7 @@
sc->sc_ihs_num = 2;
sc->sc_config_offset = VIRTIO_CONFIG_DEVICE_CONFIG_MSI;
- } else if (pci_intr_type(sc->sc_ihp[0]) == PCI_INTR_TYPE_INTX) {
Home |
Main Index |
Thread Index |
Old Index