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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit d8c5617849c15d54c0ebd2efbc9f16161a6f2e56
Author: Mark Harvey <markh794@xxxxxxxxx>
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@xxxxxxxxx>
    Signed-off-by: Mark Harvey <markh794@xxxxxxxxx>

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,},

Attachment: 0002-Implement-smc-INITIALIZE-ELEMENT-STATUS-WITH-RANGE-o.patch
Description: Binary data


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux