diff options
author | marius <marius@FreeBSD.org> | 2007-06-16 23:27:59 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2007-06-16 23:27:59 +0000 |
commit | eebf6babac37e47351416eac1f6d0d20200a9ae1 (patch) | |
tree | cad4b670e184e4b84c24b37022585c7150a3e4bd /sys/dev/gem/if_gem.c | |
parent | ee65d962e2483e12564cb3ba0924c08b21d961c7 (diff) | |
download | FreeBSD-src-eebf6babac37e47351416eac1f6d0d20200a9ae1.zip FreeBSD-src-eebf6babac37e47351416eac1f6d0d20200a9ae1.tar.gz |
- 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)
Diffstat (limited to 'sys/dev/gem/if_gem.c')
-rw-r--r-- | sys/dev/gem/if_gem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c index 749762f..60b7a17 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); } |