Commit 7f777bf385211e98cb7f274fe57302d061d89c9c
1 parent
56bf1d37
fixed atapi error codes (initial patch by Jens Axboe)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@593 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
3 deletions
hw/ide.c
| @@ -299,6 +299,7 @@ | @@ -299,6 +299,7 @@ | ||
| 299 | #define ATAPI_INT_REASON_TAG 0xf8 | 299 | #define ATAPI_INT_REASON_TAG 0xf8 |
| 300 | 300 | ||
| 301 | /* same constants as bochs */ | 301 | /* same constants as bochs */ |
| 302 | +#define ASC_ILLEGAL_OPCODE 0x20 | ||
| 302 | #define ASC_LOGICAL_BLOCK_OOR 0x21 | 303 | #define ASC_LOGICAL_BLOCK_OOR 0x21 |
| 303 | #define ASC_INV_FIELD_IN_CMD_PACKET 0x24 | 304 | #define ASC_INV_FIELD_IN_CMD_PACKET 0x24 |
| 304 | #define ASC_MEDIUM_NOT_PRESENT 0x3a | 305 | #define ASC_MEDIUM_NOT_PRESENT 0x3a |
| @@ -1009,7 +1010,10 @@ static void ide_atapi_cmd(IDEState *s) | @@ -1009,7 +1010,10 @@ static void ide_atapi_cmd(IDEState *s) | ||
| 1009 | ide_atapi_cmd_reply(s, 12, max_len); | 1010 | ide_atapi_cmd_reply(s, 12, max_len); |
| 1010 | break; | 1011 | break; |
| 1011 | default: | 1012 | default: |
| 1012 | - goto error_cmd; | 1013 | + error_cmd: |
| 1014 | + ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, | ||
| 1015 | + ASC_INV_FIELD_IN_CMD_PACKET); | ||
| 1016 | + break; | ||
| 1013 | } | 1017 | } |
| 1014 | } | 1018 | } |
| 1015 | break; | 1019 | break; |
| @@ -1040,9 +1044,8 @@ static void ide_atapi_cmd(IDEState *s) | @@ -1040,9 +1044,8 @@ static void ide_atapi_cmd(IDEState *s) | ||
| 1040 | ide_atapi_cmd_reply(s, 36, max_len); | 1044 | ide_atapi_cmd_reply(s, 36, max_len); |
| 1041 | break; | 1045 | break; |
| 1042 | default: | 1046 | default: |
| 1043 | - error_cmd: | ||
| 1044 | ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, | 1047 | ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, |
| 1045 | - ASC_INV_FIELD_IN_CMD_PACKET); | 1048 | + ASC_ILLEGAL_OPCODE); |
| 1046 | break; | 1049 | break; |
| 1047 | } | 1050 | } |
| 1048 | } | 1051 | } |