-/* $OpenBSD: if_bnxt.c,v 1.32 2021/04/24 09:37:46 jmatthew Exp $ */
+/* $OpenBSD: if_bnxt.c,v 1.33 2021/07/23 00:29:14 jmatthew Exp $ */
/*-
* Broadcom NetXtreme-C/E network driver.
*
sc->sc_flags |= BNXT_FLAG_MSIX;
intrstr = pci_intr_string(sc->sc_pc, ih);
- nmsix = pci_intr_msix_count(pa->pa_pc, pa->pa_tag);
+ nmsix = pci_intr_msix_count(pa);
if (nmsix > 1) {
sc->sc_ih = pci_intr_establish(sc->sc_pc, ih,
IPL_NET | IPL_MPSAFE, bnxt_admin_intr, sc, DEVNAME(sc));
-/* $OpenBSD: if_ix.c,v 1.178 2020/12/22 23:25:37 dlg Exp $ */
+/* $OpenBSD: if_ix.c,v 1.179 2021/07/23 00:29:14 jmatthew Exp $ */
/******************************************************************************
if (!ixgbe_enable_msix)
return;
- nmsix = pci_intr_msix_count(pa->pa_pc, pa->pa_tag);
+ nmsix = pci_intr_msix_count(pa);
if (nmsix <= 1)
return;
-/* $OpenBSD: if_ixl.c,v 1.74 2021/03/26 08:02:34 jan Exp $ */
+/* $OpenBSD: if_ixl.c,v 1.75 2021/07/23 00:29:14 jmatthew Exp $ */
/*
* Copyright (c) 2013-2015, Intel Corporation
}
if (pci_intr_map_msix(pa, 0, &sc->sc_ih) == 0) {
- int nmsix = pci_intr_msix_count(pa->pa_pc, pa->pa_tag);
+ int nmsix = pci_intr_msix_count(pa);
if (nmsix > 1) { /* we used 1 (the 0th) for the adminq */
nmsix--;
-/* $OpenBSD: if_mcx.c,v 1.101 2021/06/02 19:16:11 patrick Exp $ */
+/* $OpenBSD: if_mcx.c,v 1.102 2021/07/23 00:29:14 jmatthew Exp $ */
/*
* Copyright (c) 2017 David Gwynne <dlg@openbsd.org>
goto teardown;
}
- msix = pci_intr_msix_count(pa->pa_pc, pa->pa_tag);
+ msix = pci_intr_msix_count(pa);
if (msix < 2) {
printf(": not enough msi-x vectors\n");
goto teardown;
-/* $OpenBSD: if_vmx.c,v 1.65 2020/12/12 11:48:53 jan Exp $ */
+/* $OpenBSD: if_vmx.c,v 1.66 2021/07/23 00:29:14 jmatthew Exp $ */
/*
* Copyright (c) 2013 Tsubai Masanari
switch (intrcfg & VMXNET3_INTRCFG_TYPE_MASK) {
case VMXNET3_INTRCFG_TYPE_AUTO:
case VMXNET3_INTRCFG_TYPE_MSIX:
- msix = pci_intr_msix_count(pa->pa_pc, pa->pa_tag);
+ msix = pci_intr_msix_count(pa);
if (msix > 0) {
if (pci_intr_map_msix(pa, 0, &ih) == 0) {
msix--; /* are there spares for tx/rx qs? */
-/* $OpenBSD: pci.c,v 1.119 2020/09/08 20:13:52 kettenis Exp $ */
+/* $OpenBSD: pci.c,v 1.120 2021/07/23 00:29:14 jmatthew Exp $ */
/* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */
/*
}
int
-pci_intr_msix_count(pci_chipset_tag_t pc, pcitag_t tag)
+pci_intr_msix_count(struct pci_attach_args *pa)
{
pcireg_t reg;
- if (pci_get_capability(pc, tag, PCI_CAP_MSIX, NULL, ®) == 0)
+ if ((pa->pa_flags & PCI_FLAGS_MSI_ENABLED) == 0)
+ return (0);
+
+ if (pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_MSIX, NULL,
+ ®) == 0)
return (0);
return (PCI_MSIX_MC_TBLSZ(reg) + 1);
}
int
-pci_intr_msix_count(pci_chipset_tag_t pc, pcitag_t tag)
+pci_intr_msix_count(struct pci_attach_args *pa)
{
return (0);
}
-/* $OpenBSD: pcivar.h,v 1.75 2021/05/01 16:11:16 visa Exp $ */
+/* $OpenBSD: pcivar.h,v 1.76 2021/07/23 00:29:14 jmatthew Exp $ */
/* $NetBSD: pcivar.h,v 1.23 1997/06/06 23:48:05 thorpej Exp $ */
/*
void pci_resume_msix(pci_chipset_tag_t, pcitag_t, bus_space_tag_t,
pcireg_t, struct msix_vector *);
-int pci_intr_msix_count(pci_chipset_tag_t, pcitag_t);
+int pci_intr_msix_count(struct pci_attach_args *);
uint16_t pci_requester_id(pci_chipset_tag_t, pcitag_t);