From c7126d5b3216e57b4e388e3fd34faa785b8e4bd0 Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Wed, 16 Jun 2010 06:43:06 -0700 Subject: scsi-bus: Add MAINTENANCE_IN and MAINTENANCE_OUT SCSIRequest xfer and mode assignments This patch updates hw/scsi-bus.c to add MAINTENANCE_IN and MAINTENANCE_OUT case in scsi_req_length() for TYPE_ROM with MMC commands. It also adds the MAINTENANCE_OUT case in scsi_req_xfer_mode() to set SCSI_XFER_TO_DEV for outgoing write data. Signed-off-by: Nicholas A. Bellinger Acked-by: Gerd Hoffmann Signed-off-by: Kevin Wolf --- 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 3575ba30ae..24bd0602ef 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -242,6 +242,13 @@ static int scsi_req_length(SCSIRequest *req, uint8_t *cmd) case INQUIRY: req->cmd.xfer = cmd[4] | (cmd[3] << 8); break; + case MAINTENANCE_OUT: + case MAINTENANCE_IN: + if (req->dev->type == TYPE_ROM) { + /* GPCMD_REPORT_KEY and GPCMD_SEND_KEY from multi media commands */ + req->cmd.xfer = cmd[9] | (cmd[8] << 8); + } + break; } return 0; } @@ -307,6 +314,7 @@ static void scsi_req_xfer_mode(SCSIRequest *req) case SEND_VOLUME_TAG: case WRITE_LONG_2: case PERSISTENT_RESERVE_OUT: + case MAINTENANCE_OUT: req->cmd.mode = SCSI_XFER_TO_DEV; break; default: @@ -387,6 +395,8 @@ static const char *scsi_command_name(uint8_t cmd) [ SPACE ] = "SPACE", [ INQUIRY ] = "INQUIRY", [ RECOVER_BUFFERED_DATA ] = "RECOVER_BUFFERED_DATA", + [ MAINTENANCE_IN ] = "MAINTENANCE_IN", + [ MAINTENANCE_OUT ] = "MAINTENANCE_OUT", [ MODE_SELECT ] = "MODE_SELECT", [ RESERVE ] = "RESERVE", [ RELEASE ] = "RELEASE", -- cgit 1.4.1