diff --git a/scst/include/scst_const.h b/scst/include/scst_const.h index b028e826c..a2546d9b4 100644 --- a/scst/include/scst_const.h +++ b/scst/include/scst_const.h @@ -395,9 +395,6 @@ static inline int scst_sense_response_code(const uint8_t *sense) #define MI_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0d #endif #endif -#ifndef SERVICE_ACTION_IN -#define SERVICE_ACTION_IN 0x9e -#endif #ifndef SAI_READ_CAPACITY_16 /* values for service action in */ #define SAI_READ_CAPACITY_16 0x10 @@ -447,6 +444,16 @@ static inline int scst_sense_response_code(const uint8_t *sense) #endif #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) +/* + * See also patch "scsi: rename SERVICE_ACTION_IN_16 to SERVICE_ACTION_IN_16" + * (commit eb846d9f147455e4e5e1863bfb5e31974bb69b7c). + */ +#ifndef SERVICE_ACTION_IN_16 +#define SERVICE_ACTION_IN_16 0x9e +#endif +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) /* * From . See also commit diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 12a66a783..b2ea17676 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -1829,7 +1829,7 @@ static enum compl_status_e vdisk_nop(struct vdisk_cmd_params *p) return CMD_SUCCEEDED; } -static enum compl_status_e vdisk_exec_srv_action_in(struct vdisk_cmd_params *p) +static enum compl_status_e vdisk_exec_sai_16(struct vdisk_cmd_params *p) { switch (p->cmd->cdb[1] & 0x1f) { case SAI_READ_CAPACITY_16: @@ -2188,14 +2188,14 @@ static const struct scst_opcode_descriptor scst_op_descr_format_unit = { }; static const struct scst_opcode_descriptor scst_op_descr_get_lba_status = { - .od_opcode = SERVICE_ACTION_IN, + .od_opcode = SERVICE_ACTION_IN_16, .od_serv_action = SAI_GET_LBA_STATUS, .od_serv_action_valid = 1, .od_support = 3, /* supported as in the standard */ .od_cdb_size = 16, .od_nominal_timeout = SCST_DEFAULT_NOMINAL_TIMEOUT_SEC, .od_recommended_timeout = SCST_GENERIC_DISK_SMALL_TIMEOUT/HZ, - .od_cdb_usage_bits = { SERVICE_ACTION_IN, SAI_GET_LBA_STATUS, + .od_cdb_usage_bits = { SERVICE_ACTION_IN_16, SAI_GET_LBA_STATUS, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, SCST_OD_DEFAULT_CONTROL_BYTE }, @@ -2281,14 +2281,14 @@ static const struct scst_opcode_descriptor scst_op_descr_read_capacity = { }; static const struct scst_opcode_descriptor scst_op_descr_read_capacity16 = { - .od_opcode = SERVICE_ACTION_IN, + .od_opcode = SERVICE_ACTION_IN_16, .od_serv_action = SAI_READ_CAPACITY_16, .od_serv_action_valid = 1, .od_support = 3, /* supported as in the standard */ .od_cdb_size = 16, .od_nominal_timeout = SCST_DEFAULT_NOMINAL_TIMEOUT_SEC, .od_recommended_timeout = SCST_GENERIC_DISK_SMALL_TIMEOUT/HZ, - .od_cdb_usage_bits = { SERVICE_ACTION_IN, SAI_READ_CAPACITY_16, + .od_cdb_usage_bits = { SERVICE_ACTION_IN_16, SAI_READ_CAPACITY_16, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0, SCST_OD_DEFAULT_CONTROL_BYTE }, @@ -2565,7 +2565,7 @@ static const struct scst_opcode_descriptor scst_op_descr_read_toc = { [INQUIRY] = vdisk_exec_inquiry, \ [REQUEST_SENSE] = vdisk_exec_request_sense, \ [READ_CAPACITY] = vdisk_exec_read_capacity, \ - [SERVICE_ACTION_IN] = vdisk_exec_srv_action_in, \ + [SERVICE_ACTION_IN_16] = vdisk_exec_sai_16, \ [UNMAP] = vdisk_exec_unmap, \ [WRITE_SAME] = vdisk_exec_write_same, \ [WRITE_SAME_16] = vdisk_exec_write_same, \ diff --git a/scst/src/scst_tg.c b/scst/src/scst_tg.c index d48af7c6d..6a714014c 100644 --- a/scst/src/scst_tg.c +++ b/scst/src/scst_tg.c @@ -263,7 +263,7 @@ static bool scst_tg_accept(struct scst_cmd *cmd) case REPORT_LUNS: case REQUEST_SENSE: return true; - case SERVICE_ACTION_IN: + case SERVICE_ACTION_IN_16: switch (cmd->cdb[1] & 0x1f) { case SAI_READ_CAPACITY_16: return true; diff --git a/usr/fileio/common.c b/usr/fileio/common.c index feb4e8b3c..475704810 100644 --- a/usr/fileio/common.c +++ b/usr/fileio/common.c @@ -390,7 +390,7 @@ static int do_exec(struct vdisk_cmd *vcmd) case READ_CAPACITY: exec_read_capacity(vcmd); break; - case SERVICE_ACTION_IN: + case SERVICE_ACTION_IN_16: if ((cmd->cdb[1] & 0x1f) == SAI_READ_CAPACITY_16) exec_read_capacity16(vcmd); else {