diff options
author | jhb <jhb@FreeBSD.org> | 2000-12-18 23:49:56 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2000-12-18 23:49:56 +0000 |
commit | 4423d75eace68c7348f9a8630453cd39703a962c (patch) | |
tree | 3f6d3d8aeb5f334e73bd6bebe2bc87460101d57d /sys/i386 | |
parent | 4ad554b9bb57a25f053c6f0636a0c79f7e05b0f8 (diff) | |
download | FreeBSD-src-4423d75eace68c7348f9a8630453cd39703a962c.zip FreeBSD-src-4423d75eace68c7348f9a8630453cd39703a962c.tar.gz |
Attempt to read and verify the card's status in wi_stop() before sending it
the disable command. On some systems, writing to the card after it has
been ejected causes the machine to hang.
Reviewed by: wpaul
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/isa/if_wi.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/i386/isa/if_wi.c b/sys/i386/isa/if_wi.c index 0c99883..3b07877 100644 --- a/sys/i386/isa/if_wi.c +++ b/sys/i386/isa/if_wi.c @@ -1471,8 +1471,15 @@ static void wi_stop(sc) ifp = &sc->arpcom.ac_if; - CSR_WRITE_2(sc, WI_INT_EN, 0); - wi_cmd(sc, WI_CMD_DISABLE|sc->wi_portnum, 0); + /* + * If the card is gone and the memory port isn't mapped, we will + * (hopefully) get 0xffff back from the status read, which is not + * a valid status value. + */ + if (CSR_READ_2(sc, WI_STATUS) != 0xffff) { + CSR_WRITE_2(sc, WI_INT_EN, 0); + wi_cmd(sc, WI_CMD_DISABLE|sc->wi_portnum, 0); + } untimeout(wi_inquire, sc, sc->wi_stat_ch); |