Author: bschmidt Date: Sat Jun 18 11:25:33 2011 New Revision: 223233 URL: http://svn.freebsd.org/changeset/base/223233
Log: MFC r220659: Don't timeout when stopping DMA channels. Obtained from: OpenBSD Modified: stable/8/sys/dev/iwn/if_iwn.c stable/8/sys/dev/iwn/if_iwnreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Sat Jun 18 11:23:42 2011 (r223232) +++ stable/8/sys/dev/iwn/if_iwn.c Sat Jun 18 11:25:33 2011 (r223233) @@ -4003,7 +4003,7 @@ iwn4965_get_temperature(struct iwn_softc return 0; /* Sign-extend 23-bit R4 value to 32-bit. */ - r4 = (r4 << 8) >> 8; + r4 = ((r4 & 0xffffff) ^ 0x800000) - 0x800000; /* Compute temperature in Kelvin. */ temp = (259 * (r4 - r2)) / (r3 - r1); temp = (temp * 97) / 100 + 8; @@ -6283,7 +6283,6 @@ static void iwn_hw_stop(struct iwn_softc *sc) { const struct iwn_hal *hal = sc->sc_hal; - uint32_t tmp; int chnl, qid, ntries; IWN_WRITE(sc, IWN_RESET, IWN_RESET_NEVO); @@ -6305,8 +6304,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); Modified: stable/8/sys/dev/iwn/if_iwnreg.h ============================================================================== --- stable/8/sys/dev/iwn/if_iwnreg.h Sat Jun 18 11:23:42 2011 (r223232) +++ stable/8/sys/dev/iwn/if_iwnreg.h Sat Jun 18 11:25:33 2011 (r223233) @@ -283,8 +283,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) _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"