1
0
Fork 0
forked from len0rd/rockbox

Fix error handling in multiple block read and multiple block write state. When an error occurs, the host still needs to send CMD_STOP_TRANSMISSION resp. the STOP_TRAN token.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18524 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2008-09-15 21:10:08 +00:00
parent 1a904eb1eb
commit e42a7373f6

View file

@ -665,6 +665,9 @@ int ata_read_sectors(IF_MV2(int drive,)
rc = receive_block(inbuf, card->read_timeout);
if (rc)
{
/* If an error occurs during multiple block reading, the
* host still needs to send CMD_STOP_TRANSMISSION */
send_cmd(CMD_STOP_TRANSMISSION, 0, &response);
rc = rc * 10 - 4;
goto error;
}
@ -755,15 +758,17 @@ int ata_write_sectors(IF_MV2(int drive,)
if (rc)
{
rc = rc * 10 - 3;
goto error;
break;
}
}
if (rc == 0)
{
rc = send_block_send(start_token, card->write_timeout, false);
if (rc)
{
rc = rc * 10 - 4;
goto error;
}
/* If an error occurs during multiple block writing, the STOP_TRAN token
* still needs to be sent, hence the special error handling above. */
if (write_cmd == CMD_WRITE_MULTIPLE_BLOCK)
{