diff --git a/itlwm/hal_iwm/mac80211.cpp b/itlwm/hal_iwm/mac80211.cpp index f9311f44..68d190d3 100644 --- a/itlwm/hal_iwm/mac80211.cpp +++ b/itlwm/hal_iwm/mac80211.cpp @@ -4452,7 +4452,6 @@ iwm_attach(struct iwm_softc *sc, struct pci_attach_args *pa) pcireg_t reg, memtype; struct ieee80211com *ic = &sc->sc_ic; struct _ifnet *ifp = &ic->ic_if; - const char *intrstr = {0}; int err; int txq_i, i, j; @@ -4509,7 +4508,7 @@ iwm_attach(struct iwm_softc *sc, struct pci_attach_args *pa) PCI_COMMAND_STATUS_REG, reg); } - int msiIntrIndex = 0; + int msiIntrIndex = -1; for (int index = 0; ; index++) { int interruptType; @@ -4522,6 +4521,11 @@ iwm_attach(struct iwm_softc *sc, struct pci_attach_args *pa) break; } } + if (msiIntrIndex == -1) { + XYLog("%s: can't find MSI interrupt controller\n", DEVNAME(sc)); + return false; + } + if (sc->sc_msix) sc->sc_ih = IOFilterInterruptEventSource::filterInterruptEventSource(this, @@ -4533,15 +4537,10 @@ iwm_attach(struct iwm_softc *sc, struct pci_attach_args *pa) (IOInterruptEventSource::Action)&ItlIwm::iwm_intr, &ItlIwm::intrFilter , pa->pa_tag, msiIntrIndex); if (sc->sc_ih == NULL || pa->workloop->addEventSource(sc->sc_ih) != kIOReturnSuccess) { - XYLog("\n"); - XYLog("%s: can't establish interrupt", DEVNAME(sc)); - if (intrstr != NULL) - XYLog(" at %s", intrstr); - XYLog("\n"); + XYLog("%s: can't establish interrupt\n", DEVNAME(sc)); return false; } sc->sc_ih->enable(); - XYLog(", %s\n", intrstr); sc->sc_hw_rev = IWM_READ(sc, IWM_CSR_HW_REV); int pa_id = pa->pa_tag->configRead16(kIOPCIConfigDeviceID); diff --git a/itlwm/hal_iwn/ItlIwn.cpp b/itlwm/hal_iwn/ItlIwn.cpp index 8b505ad5..a52d34af 100644 --- a/itlwm/hal_iwn/ItlIwn.cpp +++ b/itlwm/hal_iwn/ItlIwn.cpp @@ -347,8 +347,6 @@ iwn_attach(struct iwn_softc *sc, struct pci_attach_args *pa) { struct ieee80211com *ic = &sc->sc_ic; struct _ifnet *ifp = &ic->ic_if; - const char *intrstr; - pci_intr_handle_t ih; pcireg_t memtype, reg; int i, error; @@ -395,7 +393,7 @@ iwn_attach(struct iwn_softc *sc, struct pci_attach_args *pa) return false; } - int msiIntrIndex = 0; + int msiIntrIndex = -1; for (int index = 0; ; index++) { int interruptType; @@ -408,12 +406,16 @@ iwn_attach(struct iwn_softc *sc, struct pci_attach_args *pa) break; } } + if (msiIntrIndex == -1) { + XYLog("%s: can't find MSI interrupt controller\n", DEVNAME(sc)); + return false; + } sc->sc_ih = IOFilterInterruptEventSource::filterInterruptEventSource(this, (IOInterruptEventSource::Action)&ItlIwn::iwn_intr, &ItlIwn::intrFilter ,pa->pa_tag, msiIntrIndex); if (sc->sc_ih == NULL || pa->workloop->addEventSource(sc->sc_ih) != kIOReturnSuccess) { - XYLog("%s: can't establish interrupt", DEVNAME(sc)); + XYLog("%s: can't establish interrupt\n", DEVNAME(sc)); return false; } sc->sc_ih->enable(); diff --git a/itlwm/hal_iwx/ItlIwx.cpp b/itlwm/hal_iwx/ItlIwx.cpp index 91922f33..094352b0 100644 --- a/itlwm/hal_iwx/ItlIwx.cpp +++ b/itlwm/hal_iwx/ItlIwx.cpp @@ -12786,7 +12786,6 @@ intrFilter(OSObject *object, IOFilterInterruptEventSource *src) bool ItlIwx:: iwx_attach(struct iwx_softc *sc, struct pci_attach_args *pa) { - pci_intr_handle_t ih; pcireg_t reg, memtype; struct ieee80211com *ic = &sc->sc_ic; struct _ifnet *ifp = &ic->ic_if; @@ -12845,7 +12844,7 @@ iwx_attach(struct iwx_softc *sc, struct pci_attach_args *pa) PCI_COMMAND_STATUS_REG, reg); } - int msiIntrIndex = 0; + int msiIntrIndex = -1; for (int index = 0; ; index++) { int interruptType; @@ -12858,6 +12857,11 @@ iwx_attach(struct iwx_softc *sc, struct pci_attach_args *pa) break; } } + if (msiIntrIndex == -1) { + XYLog("%s: can't find MSI interrupt controller\n", DEVNAME(sc)); + return false; + } + if (sc->sc_msix) sc->sc_ih = IOFilterInterruptEventSource::filterInterruptEventSource(this, @@ -12869,7 +12873,7 @@ iwx_attach(struct iwx_softc *sc, struct pci_attach_args *pa) (IOInterruptEventSource::Action)&ItlIwx::iwx_intr, &ItlIwx::intrFilter ,pa->pa_tag, msiIntrIndex); if (sc->sc_ih == NULL || pa->workloop->addEventSource(sc->sc_ih) != kIOReturnSuccess) { - XYLog("%s: can't establish interrupt", DEVNAME(sc)); + XYLog("%s: can't establish interrupt\n", DEVNAME(sc)); return false; } sc->sc_ih->enable();