From patchwork Wed Jun 16 13:43:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 106490 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5GDgsUW013770 for ; Wed, 16 Jun 2010 13:42:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758725Ab0FPNmt (ORCPT ); Wed, 16 Jun 2010 09:42:49 -0400 Received: from smtp127.sbc.mail.sp1.yahoo.com ([69.147.65.186]:34358 "HELO smtp127.sbc.mail.sp1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1758668Ab0FPNms (ORCPT ); Wed, 16 Jun 2010 09:42:48 -0400 Received: (qmail 30937 invoked from network); 16 Jun 2010 13:42:48 -0000 Received: from adsl-70-231-239-201.dsl.snfc21.sbcglobal.net (nab@70.231.239.201 with login) by smtp127.sbc.mail.sp1.yahoo.com with SMTP; 16 Jun 2010 06:42:47 -0700 PDT X-Yahoo-SMTP: fzDSGlOswBCWnIOrNw7KwwK1j9PqyNbe5PtLKiS4dDU.UNl_t6bdEZu9tTLW X-YMail-OSG: 92LEEi4VM1kVI9b6n..7WifBkXHR5eviZA6Ti5bp5YarLcW.rD91pbsVu4j55.b9lTD5kDGdlr7rwQie0Oo6VEjg7zCLEvVRkQP160wBgvI2e0tI1De8Z69Ms_slPaQEIPX02ejvYL_no5UCbgfr1BzQOaAU5ZbResBMgpjBiX0pYMPkskSd5xwFXBnRUut28CVaCy8AI_kIycguM1T1PPWf26uXzq_qW5ADBKCZsuObnUhAu6gK6d8wKk2pjMxZjCeSj0FwWC417axhEOIYqD1SEneCyeNBA_0MFeqCoXsx17dinvgyQZblKUIH9peljnLNOIG6AAbDEVfywlgU5z58t7NctC_dSaGfMCeLsNof3A-- X-Yahoo-Newman-Property: ymail-3 From: "Nicholas A. Bellinger" To: Kevin Wolf Cc: Gerd Hoffmann , Hannes Reinecke , Paul Brook , Christoph Hellwig , FUJITA Tomonori , kvm-devel , qemu-devel , Nicholas Bellinger Subject: [PATCH 2/2] [scsi-bus]: Add MAINTENANCE_IN and MAINTENANCE_OUT SCSIRequest xfer and mode assignments Date: Wed, 16 Jun 2010 06:43:06 -0700 Message-Id: <1276695786-16626-1-git-send-email-nab@linux-iscsi.org> X-Mailer: git-send-email 1.5.6.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 16 Jun 2010 13:42:58 +0000 (UTC) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index 7a5fa48..ed3554c 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -325,6 +325,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; } @@ -390,6 +397,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: @@ -535,6 +543,8 @@ 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", diff --git a/hw/scsi-defs.h b/hw/scsi-defs.h index 5890094..a4a3518 100644 --- a/hw/scsi-defs.h +++ b/hw/scsi-defs.h @@ -84,6 +84,8 @@ #define MODE_SENSE_10 0x5a #define PERSISTENT_RESERVE_IN 0x5e #define PERSISTENT_RESERVE_OUT 0x5f +#define MAINTENANCE_IN 0xa3 +#define MAINTENANCE_OUT 0xa4 #define MOVE_MEDIUM 0xa5 #define READ_12 0xa8 #define WRITE_12 0xaa