[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/10] hw/sd.c: Handle CRC and locked-card errors in
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH 06/10] hw/sd.c: Handle CRC and locked-card errors in normal code path |
Date: |
Sun, 18 Dec 2011 20:37:56 +0000 |
Handle returning CRC and locked-card errors in the same code path
we use for other responses. This makes no difference in behaviour
but means that these error responses will be printed by the debug
logging code.
Signed-off-by: Peter Maydell <address@hidden>
---
hw/sd.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/sd.c b/hw/sd.c
index 57925af..9116f67 100644
--- a/hw/sd.c
+++ b/hw/sd.c
@@ -1296,7 +1296,8 @@ int sd_do_command(SDState *sd, SDRequest *req,
if (sd_req_crc_validate(req)) {
sd->card_status |= COM_CRC_ERROR;
- return 0;
+ rtype = sd_illegal;
+ goto send_response;
}
sd->card_status &= ~CARD_STATUS_B;
@@ -1306,7 +1307,8 @@ int sd_do_command(SDState *sd, SDRequest *req,
if (!cmd_valid_while_locked(sd, req)) {
sd->card_status |= ILLEGAL_COMMAND;
fprintf(stderr, "SD: Card is locked\n");
- return 0;
+ rtype = sd_illegal;
+ goto send_response;
}
}
@@ -1322,6 +1324,7 @@ int sd_do_command(SDState *sd, SDRequest *req,
sd->current_cmd = req->cmd;
+send_response:
switch (rtype) {
case sd_r1:
case sd_r1b:
--
1.7.5.4
- [Qemu-devel] [PATCH 00/10] hw/sd.c: Fix various status related bugs, Peter Maydell, 2011/12/18
- [Qemu-devel] [PATCH 10/10] hw/sd.c: Clear status bits when read via response r6, Peter Maydell, 2011/12/18
- [Qemu-devel] [PATCH 08/10] hw/sd.c: Correct handling of type B SD status bits, Peter Maydell, 2011/12/18
- [Qemu-devel] [PATCH 01/10] hw/sd.c: Fix the set of commands which are failed when card is locked, Peter Maydell, 2011/12/18
- [Qemu-devel] [PATCH 07/10] hw/sd.c: Set ILLEGAL_COMMAND for ACMDs in invalid state, Peter Maydell, 2011/12/18
- [Qemu-devel] [PATCH 04/10] hw/sd.c: When setting ADDRESS_ERROR bit, don't clear everything else, Peter Maydell, 2011/12/18
- [Qemu-devel] [PATCH 03/10] hw/sd.c: On CRC error, set CRC error status bit rather than clearing it, Peter Maydell, 2011/12/18
- [Qemu-devel] [PATCH 05/10] hw/sd.c: Handle illegal commands in sd_do_command, Peter Maydell, 2011/12/18
- [Qemu-devel] [PATCH 06/10] hw/sd.c: Handle CRC and locked-card errors in normal code path,
Peter Maydell <=
- [Qemu-devel] [PATCH 02/10] hw/sd.c: Add comment regarding CARD_STATUS_* defines, Peter Maydell, 2011/12/18
- [Qemu-devel] [PATCH 09/10] hw/sd.c: Correct handling of APP_CMD status bit, Peter Maydell, 2011/12/18
- Re: [Qemu-devel] [PATCH 00/10] hw/sd.c: Fix various status related bugs, andrzej zaborowski, 2011/12/20