From 04ff6503a6913923896c17eec5af905fbced51a6 Mon Sep 17 00:00:00 2001 From: Damien Bergamini Date: Sun, 16 Nov 2008 09:52:32 +0000 Subject: clear pending interrupts in the driver attach routine. otherwise the chip comes up with the RF_TOGGLED bit set which triggers an if_stop() call if a shared interrupt occurs. --- sys/dev/pci/if_iwn.c | 8 +++++--- sys/dev/pci/if_wpi.c | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index e208aa9f469..47f1f333188 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.33 2008/11/16 09:50:02 damien Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.34 2008/11/16 09:52:31 damien Exp $ */ /*- * Copyright (c) 2007, 2008 @@ -421,6 +421,8 @@ iwn_attach(struct device *parent, struct device *self, void *aux) /* Power OFF adapter. */ iwn_apm_stop(sc); + /* Clear pending interrupts. */ + IWN_WRITE(sc, IWN_INT, 0xffffffff); printf(", MIMO %dT%dR, %.4s, address %s\n", sc->ntxchains, sc->nrxchains, sc->eeprom_domain, ether_sprintf(ic->ic_myaddr)); @@ -4820,7 +4822,7 @@ iwn_hw_init(struct iwn_softc *sc) const struct iwn_hal *hal = sc->sc_hal; int error, qid; - /* Clear any pending interrupts. */ + /* Clear pending interrupts. */ IWN_WRITE(sc, IWN_INT, 0xffffffff); if ((error = hal->apm_init(sc)) != 0) { @@ -4886,7 +4888,7 @@ iwn_hw_init(struct iwn_softc *sc) IWN_WRITE(sc, IWN_UCODE_GP1_CLR, IWN_UCODE_GP1_RFKILL); IWN_WRITE(sc, IWN_UCODE_GP1_CLR, IWN_UCODE_GP1_CMD_BLOCKED); - /* Clear any pending interrupts. */ + /* Clear pending interrupts. */ IWN_WRITE(sc, IWN_INT, 0xffffffff); /* Enable interrupt coalescing. */ IWN_WRITE(sc, IWN_INT_COALESCING, 512 / 8); diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index 7129ca1f9d3..f678b662359 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.71 2008/11/09 10:00:17 damien Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.72 2008/11/16 09:52:31 damien Exp $ */ /*- * Copyright (c) 2006-2008 @@ -282,6 +282,8 @@ wpi_attach(struct device *parent, struct device *self, void *aux) /* Power OFF adapter. */ wpi_apm_stop(sc); + /* Clear pending interrupts. */ + WPI_WRITE(sc, WPI_INT, 0xffffffff); ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */ @@ -1040,7 +1042,7 @@ wpi_media_change(struct ifnet *ifp) wpi_stop(ifp, 0); error = wpi_init(ifp); } - return 0; + return error; } int @@ -3079,7 +3081,7 @@ wpi_hw_init(struct wpi_softc *sc) { int qid, ntries, error; - /* Clear any pending interrupts. */ + /* Clear pending interrupts. */ WPI_WRITE(sc, WPI_INT, 0xffffffff); if ((error = wpi_apm_init(sc)) != 0) { @@ -3158,7 +3160,7 @@ wpi_hw_init(struct wpi_softc *sc) WPI_WRITE(sc, WPI_UCODE_GP1_CLR, WPI_UCODE_GP1_RFKILL); WPI_WRITE(sc, WPI_UCODE_GP1_CLR, WPI_UCODE_GP1_CMD_BLOCKED); - /* Clear any pending interrupts. */ + /* Clear pending interrupts. */ WPI_WRITE(sc, WPI_INT, 0xffffffff); /* Enable interrupts. */ WPI_WRITE(sc, WPI_MASK, WPI_INT_MASK); -- cgit v1.2.3