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
This commit is contained in:
jhb 2000-12-18 23:49:56 +00:00
parent 4ad554b9bb
commit 4423d75eac
2 changed files with 18 additions and 4 deletions

View File

@ -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);

View File

@ -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);