From c784a7330f730fc7e74d5dba4708588d5de5696a Mon Sep 17 00:00:00 2001 From: damien Date: Tue, 20 Jul 2010 19:24:31 +0000 Subject: [PATCH] do not timeout when stopping DMA channels. from a similar fix to iwlwifi --- sys/dev/pci/if_iwn.c | 6 ++---- sys/dev/pci/if_iwnreg.h | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 744700e7691..f575400d320 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.97 2010/06/05 18:52:47 damien Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.98 2010/07/20 19:24:31 damien Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini @@ -5676,7 +5676,6 @@ iwn_hw_stop(struct iwn_softc *sc) { const struct iwn_hal *hal = sc->sc_hal; int chnl, qid, ntries; - uint32_t tmp; IWN_WRITE(sc, IWN_RESET, IWN_RESET_NEVO); @@ -5697,8 +5696,7 @@ iwn_hw_stop(struct iwn_softc *sc) for (chnl = 0; chnl < hal->ndmachnls; chnl++) { IWN_WRITE(sc, IWN_FH_TX_CONFIG(chnl), 0); for (ntries = 0; ntries < 200; ntries++) { - tmp = IWN_READ(sc, IWN_FH_TX_STATUS); - if ((tmp & IWN_FH_TX_STATUS_IDLE(chnl)) == + if (IWN_READ(sc, IWN_FH_TX_STATUS) & IWN_FH_TX_STATUS_IDLE(chnl)) break; DELAY(10); diff --git a/sys/dev/pci/if_iwnreg.h b/sys/dev/pci/if_iwnreg.h index ca9e1aaf131..d941e62c286 100644 --- a/sys/dev/pci/if_iwnreg.h +++ b/sys/dev/pci/if_iwnreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwnreg.h,v 1.40 2010/05/05 19:41:57 damien Exp $ */ +/* $OpenBSD: if_iwnreg.h,v 1.41 2010/07/20 19:24:31 damien Exp $ */ /*- * Copyright (c) 2007, 2008 @@ -285,8 +285,7 @@ #define IWN_FH_TX_CHICKEN_SCHED_RETRY (1 << 1) /* Possible flags for register IWN_FH_TX_STATUS. */ -#define IWN_FH_TX_STATUS_IDLE(chnl) \ - (1 << ((chnl) + 24) | 1 << ((chnl) + 16)) +#define IWN_FH_TX_STATUS_IDLE(chnl) (1 << ((chnl) + 16)) /* Possible flags for register IWN_FH_RX_CONFIG. */ #define IWN_FH_RX_CONFIG_ENA (1 << 31) -- 2.20.1