[stgt] [PATCH 2/2] Take 2: Implement smc INITIALIZE ELEMENT STATUS WITH RANGE

Mark Harvey markh794 at gmail.com
Wed Aug 20 03:38:27 CEST 2008


commit d8c5617849c15d54c0ebd2efbc9f16161a6f2e56
Author: Mark Harvey <markh794 at gmail.com>
Date:   Wed Aug 20 10:58:02 2008 +1000

    Implement smc INITIALIZE ELEMENT STATUS WITH RANGE op code as NO-OP

    - Implemented INITIALIZE ELEMENT STATUS WITH RANGE as a No Operation.

    Reported-by: Richard Sharpe <realrichardsharpe at gmail.com>
    Signed-off-by: Mark Harvey <markh794 at gmail.com>

diff --git a/usr/smc.c b/usr/smc.c
index e735deb..ab36e9c 100644
--- a/usr/smc.c
+++ b/usr/smc.c
@@ -225,6 +225,23 @@ static int build_element_descriptors(uint8_t *data, struct
list_head *head,
 }

 /**
+ * smc_initialize_element_status with range
+ *                      - INITIALIZE ELEMENT STATUS WITH RANGE op code
+ *
+ * Support the SCSI op code INITIALIZE_ELEMENT_STATUS_WITH_RANGE
+ * Ref: smc3r11, 6.5
+ */
+static int smc_initialize_element_status_range(int host_no, struct scsi_cmd *cm
d)
+{
+       scsi_set_in_resid_by_actual(cmd, 0);
+
+       if (device_reserved(cmd))
+               return SAM_STAT_RESERVATION_CONFLICT;
+       else
+               return SAM_STAT_GOOD;
+}
+
+/**
  * smc_initialize_element_status - INITIALIZE ELEMENT STATUS op code
  *
  * Some backup libraries seem to require this.
@@ -796,7 +813,28 @@ struct device_type_template smc_template = {
                {spc_illegal_op,},
                {spc_illegal_op,},

-               [0x20 ... 0x4f] = {spc_illegal_op,},
+               [0x20 ... 0x2f] = {spc_illegal_op,},
+
+               /* 0x30 */
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {smc_initialize_element_status_range,},
+
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+               {spc_illegal_op,},
+
+               [0x40 ... 0x4f] = {spc_illegal_op,},

                /* 0x50 */
                {spc_illegal_op,},
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Implement-smc-INITIALIZE-ELEMENT-STATUS-WITH-RANGE-o.patch
Type: application/octet-stream
Size: 1969 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/stgt/attachments/20080820/35f51473/attachment.obj>


More information about the stgt mailing list