提交 ecebecff 编写于 作者: S Stefan Hajnoczi 提交者: Aurelien Jarno

lsi53c895a: Update dnad when skipping MSGOUT bytes

Update not only dbc but also dnad when skipping bytes during the MSGOUT
phase.  Previously only dbc was updated which is probably wrong and
could lead to bogus message codes being read.

Tested on Linux and Windows Server 2003.
Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 444dd39b)
上级 6f9cace1
......@@ -842,6 +842,13 @@ static uint8_t lsi_get_msgbyte(LSIState *s)
return data;
}
/* Skip the next n bytes during a MSGOUT phase. */
static void lsi_skip_msgbytes(LSIState *s, unsigned int n)
{
s->dnad += n;
s->dbc -= n;
}
static void lsi_do_msgout(LSIState *s)
{
uint8_t msg;
......@@ -869,11 +876,11 @@ static void lsi_do_msgout(LSIState *s)
switch (msg) {
case 1:
DPRINTF("SDTR (ignored)\n");
s->dbc -= 2;
lsi_skip_msgbytes(s, 2);
break;
case 3:
DPRINTF("WDTR (ignored)\n");
s->dbc -= 1;
lsi_skip_msgbytes(s, 1);
break;
default:
goto bad;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册