From 380feaffb0fcc8e5f615ed8e86d2e93717a6f2c6 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 10 Jul 2012 15:02:55 +0200 Subject: scsi-disk: parse MODE SELECT commands and parameters This adds the bulk of the parsing code for MODE SELECT, including breaking out changes to different mode pages, and checking that only changeable values are modified. In order to report errors correctly two passes are made through the parameters; the first only looks for errors, the second actually applies the changes to the mode page. Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'hw/scsi-bus.c') diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index dc7406389d..efbda6f877 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -1112,6 +1112,16 @@ const struct SCSISense sense_code_INVALID_FIELD = { .key = ILLEGAL_REQUEST, .asc = 0x24, .ascq = 0x00 }; +/* Illegal request, Invalid field in parameter list */ +const struct SCSISense sense_code_INVALID_PARAM = { + .key = ILLEGAL_REQUEST, .asc = 0x26, .ascq = 0x00 +}; + +/* Illegal request, Parameter list length error */ +const struct SCSISense sense_code_INVALID_PARAM_LEN = { + .key = ILLEGAL_REQUEST, .asc = 0x1a, .ascq = 0x00 +}; + /* Illegal request, LUN not supported */ const struct SCSISense sense_code_LUN_NOT_SUPPORTED = { .key = ILLEGAL_REQUEST, .asc = 0x25, .ascq = 0x00 -- cgit 1.4.1