diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2010-10-23 14:24:55 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2010-10-23 14:24:55 +0000 |
commit | f48712aa9221e6c7229d920012930ddd5fb7f066 (patch) | |
tree | 00c6032878a842119f9da3e4961b469829ebd222 /sys/dev/ic | |
parent | 81a05d449637d6573ce99e41b3c73756609df300 (diff) |
fix the two extremely retarded bugs that prevented the RT30XX
devices to work.
shame on me.
committed over an RT3071.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/rt2860.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c index ddbe74d7de8..81349e91ad6 100644 --- a/sys/dev/ic/rt2860.c +++ b/sys/dev/ic/rt2860.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2860.c,v 1.64 2010/09/07 16:21:42 deraadt Exp $ */ +/* $OpenBSD: rt2860.c,v 1.65 2010/10/23 14:24:54 damien Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -67,8 +67,6 @@ #include <dev/rndvar.h> -#define RAL_DEBUG - #ifdef RAL_DEBUG #define DPRINTF(x) do { if (rt2860_debug > 0) printf x; } while (0) #define DPRINTFN(n, x) do { if (rt2860_debug >= (n)) printf x; } while (0) @@ -226,11 +224,7 @@ rt2860_attach(void *xsc, int id) } sc->mac_ver = tmp >> 16; sc->mac_rev = tmp & 0xffff; -#ifdef RAL_DEBUG - /* temporarily enable debug for >=RT3071 */ - if (sc->mac_ver >= 0x3071) - rt2860_debug = 10; -#endif + if (sc->mac_ver != 0x2860 && (id == PCI_PRODUCT_RALINK_RT2890 || id == PCI_PRODUCT_RALINK_RT2790 || @@ -1021,7 +1015,8 @@ rt3090_efuse_read_2(struct rt2860_softc *sc, uint16_t addr) tmp |= (addr & ~0xf) << RT3070_EFSROM_AIN_SHIFT | RT3070_EFSROM_KICK; RAL_WRITE(sc, RT3070_EFUSE_CTRL, tmp); for (ntries = 0; ntries < 500; ntries++) { - if (!(RAL_READ(sc, RT3070_EFUSE_CTRL) & RT3070_EFSROM_KICK)) + tmp = RAL_READ(sc, RT3070_EFUSE_CTRL); + if (!(tmp & RT3070_EFSROM_KICK)) break; DELAY(2); } @@ -2008,7 +2003,8 @@ rt3090_rf_read(struct rt2860_softc *sc, uint8_t reg) RAL_WRITE(sc, RT3070_RF_CSR_CFG, tmp); for (ntries = 0; ntries < 100; ntries++) { - if (!(RAL_READ(sc, RT3070_RF_CSR_CFG) & RT3070_RF_KICK)) + tmp = RAL_READ(sc, RT3070_RF_CSR_CFG); + if (!(tmp & RT3070_RF_KICK)) break; DELAY(1); } |