diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2006-07-18 20:37:45 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2006-07-18 20:37:45 +0000 |
commit | e03b66b7d217ac8791eae7d6d5464be80941f808 (patch) | |
tree | 155ee93a90fd042ef494e43ace9304d7b7ca5c14 | |
parent | f8ebfcf92258fbe7830b0554bfd264cf6bf0d75c (diff) |
fix polling for busy bit in rum_bbp_{read,write}
-rw-r--r-- | sys/dev/usb/if_rum.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index d721e57c6f2..984cbd930dd 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rum.c,v 1.10 2006/07/18 20:29:16 damien Exp $ */ +/* $OpenBSD: if_rum.c,v 1.11 2006/07/18 20:37:44 damien Exp $ */ /*- * Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr> * Copyright (c) 2006 Niall O'Higgins <niallo@openbsd.org> @@ -1500,7 +1500,7 @@ rum_bbp_write(struct rum_softc *sc, uint8_t reg, uint8_t val) int ntries; for (ntries = 0; ntries < 5; ntries++) { - if (!((rum_read(sc, RT2573_PHY_CSR3_RT71) >> 16) & RT2573_BBP_BUSY)) + if (!(rum_read(sc, RT2573_PHY_CSR3_RT71) & RT2573_BBP_BUSY)) break; } if (ntries == 5) { @@ -1519,7 +1519,7 @@ rum_bbp_read(struct rum_softc *sc, uint8_t reg) int ntries; for (ntries = 0; ntries < 5; ntries++) { - if (!((rum_read(sc, RT2573_PHY_CSR3) >> 16) & RT2573_BBP_BUSY)) + if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) break; } if (ntries == 5) { @@ -1533,7 +1533,7 @@ rum_bbp_read(struct rum_softc *sc, uint8_t reg) for (ntries = 0; ntries < 100; ntries++) { val = rum_read(sc, RT2573_PHY_CSR3); if (!(val & RT2573_BBP_BUSY)) - return (val & 0xff); + return val & 0xff; DELAY(1); } @@ -1558,12 +1558,12 @@ rum_rf_write(struct rum_softc *sc, uint8_t reg, uint32_t val) tmp = RT2573_RF_BUSY | RT2573_RF_20BIT | (val & 0xfffff) << 2 | (reg & 3); - rum_write(sc, RT2573_PHY_CSR4, tmp); + rum_write(sc, RT2573_PHY_CSR4, tmp); /* remember last written value in sc */ sc->rf_regs[reg] = val; - //DPRINTFN(15, ("RF R[%u] <- 0x%05x\n", reg & 3, val & 0xfffff)); + /*DPRINTFN(15, ("RF R[%u] <- 0x%05x\n", reg & 3, val & 0xfffff));*/ } void |