From: Kevin O'Connor Date: Thu, 3 Dec 2009 02:19:30 +0000 (-0500) Subject: Fail PS2 port commands when receiving a NAK. X-Git-Tag: rel-0.5.0~24 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6080fe0687436991314a09fe05dbe4d69212cd26;p=seabios.git Fail PS2 port commands when receiving a NAK. Fail the command on a nak - don't ignore it. --- diff --git a/src/ps2port.c b/src/ps2port.c index 87aa02e..39ec65f 100644 --- a/src/ps2port.c +++ b/src/ps2port.c @@ -151,7 +151,7 @@ ps2_recvbyte(int aux, int needack, int timeout) if (data == PS2_RET_ACK) return data; if (data == PS2_RET_NAK) { - dprintf(1, "Got ps2 nak (status=%x); continuing\n", status); + dprintf(1, "Got ps2 nak (status=%x)\n", status); return data; } } @@ -184,6 +184,8 @@ ps2_sendbyte(int aux, u8 command, int timeout) ret = ps2_recvbyte(aux, 1, timeout); if (ret < 0) return ret; + if (ret != PS2_RET_ACK) + return -1; return 0; }