aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/gem
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2007-06-16 23:27:59 +0000
committerMarius Strobl <marius@FreeBSD.org>2007-06-16 23:27:59 +0000
commite87137e1337501e1858be85f3c4b9bdb8cdd9fa4 (patch)
treecad4b670e184e4b84c24b37022585c7150a3e4bd /sys/dev/gem
parentc6d76cdb21a3545572fadd6be18dd20fe968aac6 (diff)
downloadsrc-e87137e1337501e1858be85f3c4b9bdb8cdd9fa4.tar.gz
src-e87137e1337501e1858be85f3c4b9bdb8cdd9fa4.zip
- In gem_bitwait() check that the bit clears/was set in the content
of the register rather than in the offset describing the register. - In gem_reset_rx() let gem_bitwait() check for the Rx reset bit rather than the Tx reset bit to clear. Obtained from: OpenBSD (same/similar bugs being fixed)
Notes
Notes: svn path=/head/; revision=170847
Diffstat (limited to 'sys/dev/gem')
-rw-r--r--sys/dev/gem/if_gem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c
index 749762ff475a..60b7a172015f 100644
--- a/sys/dev/gem/if_gem.c
+++ b/sys/dev/gem/if_gem.c
@@ -632,7 +632,7 @@ gem_bitwait(sc, r, clr, set)
for (i = TRIES; i--; DELAY(100)) {
reg = bus_read_4(sc->sc_res[0], r);
- if ((r & clr) == 0 && (r & set) == set)
+ if ((reg & clr) == 0 && (reg & set) == set)
return (1);
}
return (0);
@@ -755,7 +755,7 @@ gem_reset_rx(sc)
/* Finally, reset the ERX */
bus_write_4(sc->sc_res[0], GEM_RESET, GEM_RESET_RX);
/* Wait till it finishes */
- if (!gem_bitwait(sc, GEM_RESET, GEM_RESET_TX, 0)) {
+ if (!gem_bitwait(sc, GEM_RESET, GEM_RESET_RX, 0)) {
device_printf(sc->sc_dev, "cannot reset receiver\n");
return (1);
}