mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-28 03:46:42 +00:00
Merge of r864:
Fixes issues cased by recent change of cdb_len to unsigned. Reported by Krzysztof Błaszkowski <kb@sysmikro.com.pl>. Also it adds INIT ELEMENT STATUS WRANGE to the list of known commands. git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/1.0.1.x@865 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -336,7 +336,7 @@ struct scst_user_scsi_cmd_parse
|
||||
uint64_t sess_h;
|
||||
|
||||
uint8_t cdb[SCST_MAX_CDB_SIZE];
|
||||
uint16_t cdb_len;
|
||||
int16_t cdb_len;
|
||||
uint16_t ext_cdb_len;
|
||||
|
||||
uint32_t timeout;
|
||||
@@ -415,7 +415,7 @@ struct scst_user_scsi_cmd_alloc_mem
|
||||
uint64_t sess_h;
|
||||
|
||||
uint8_t cdb[SCST_MAX_CDB_SIZE];
|
||||
uint16_t cdb_len;
|
||||
int16_t cdb_len;
|
||||
uint16_t ext_cdb_len;
|
||||
|
||||
int32_t alloc_len;
|
||||
@@ -524,7 +524,7 @@ struct scst_user_scsi_cmd_exec
|
||||
uint64_t sess_h;
|
||||
|
||||
uint8_t cdb[SCST_MAX_CDB_SIZE];
|
||||
uint16_t cdb_len;
|
||||
int16_t cdb_len;
|
||||
uint16_t ext_cdb_len;
|
||||
|
||||
int32_t data_len;
|
||||
|
||||
+1
-1
@@ -1235,7 +1235,7 @@ struct scst_cmd {
|
||||
|
||||
/* CDB and its len */
|
||||
uint8_t cdb[SCST_MAX_CDB_SIZE];
|
||||
unsigned short cdb_len;
|
||||
short cdb_len; /* it might be -1 */
|
||||
unsigned short ext_cdb_len;
|
||||
uint8_t *ext_cdb;
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ struct scst_user_scsi_cmd_parse {
|
||||
aligned_u64 sess_h;
|
||||
|
||||
uint8_t cdb[SCST_MAX_CDB_SIZE];
|
||||
uint16_t cdb_len;
|
||||
int16_t cdb_len;
|
||||
uint16_t ext_cdb_len;
|
||||
|
||||
int32_t timeout;
|
||||
@@ -128,7 +128,7 @@ struct scst_user_scsi_cmd_alloc_mem {
|
||||
aligned_u64 sess_h;
|
||||
|
||||
uint8_t cdb[SCST_MAX_CDB_SIZE];
|
||||
uint16_t cdb_len;
|
||||
int16_t cdb_len;
|
||||
uint16_t ext_cdb_len;
|
||||
|
||||
int32_t alloc_len;
|
||||
@@ -143,7 +143,7 @@ struct scst_user_scsi_cmd_exec {
|
||||
aligned_u64 sess_h;
|
||||
|
||||
uint8_t cdb[SCST_MAX_CDB_SIZE];
|
||||
uint16_t cdb_len;
|
||||
int16_t cdb_len;
|
||||
uint16_t ext_cdb_len;
|
||||
|
||||
int32_t data_len;
|
||||
|
||||
@@ -34,6 +34,7 @@ static int get_trans_len_read_capacity(struct scst_cmd *cmd, uint8_t off);
|
||||
static int get_trans_len_single(struct scst_cmd *cmd, uint8_t off);
|
||||
static int get_trans_len_none(struct scst_cmd *cmd, uint8_t off);
|
||||
static int get_trans_len_read_pos(struct scst_cmd *cmd, uint8_t off);
|
||||
static int get_trans_cdb_len_10(struct scst_cmd *cmd, uint8_t off);
|
||||
|
||||
/*
|
||||
+=====================================-============-======-
|
||||
@@ -271,6 +272,8 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
|
||||
SCST_DATA_NONE, FLAG_NONE, 0, get_trans_len_none},
|
||||
{0x37, "O O ", "READ DEFECT DATA(10)",
|
||||
SCST_DATA_READ, FLAG_NONE, 8, get_trans_len_1},
|
||||
{0x37, " O ", "INIT ELEMENT STATUS WRANGE",
|
||||
SCST_DATA_NONE, SCST_LONG_TIMEOUT, 0, get_trans_len_none},
|
||||
{0x38, " O O ", "MEDIUM SCAN",
|
||||
SCST_DATA_READ, FLAG_NONE, 8, get_trans_len_1},
|
||||
{0x39, "OOOOOOOO ", "COMPARE",
|
||||
@@ -502,7 +505,7 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
|
||||
{0xBF, " O ", "VOLUME SET(OUT)",
|
||||
SCST_DATA_WRITE, FLAG_NONE, 6, get_trans_len_4},
|
||||
{0xE7, " V ", "INIT ELEMENT STATUS WRANGE",
|
||||
SCST_DATA_NONE, SCST_LONG_TIMEOUT, 0, get_trans_len_none}
|
||||
SCST_DATA_NONE, SCST_LONG_TIMEOUT, 0, get_trans_cdb_len_10}
|
||||
};
|
||||
|
||||
/* Notes:
|
||||
|
||||
+7
-1
@@ -2432,7 +2432,13 @@ int scst_get_cdb_len(const uint8_t *cdb)
|
||||
|
||||
/* get_trans_len_x extract x bytes from cdb as length starting from off */
|
||||
|
||||
/* for special commands */
|
||||
static int get_trans_cdb_len_10(struct scst_cmd *cmd, uint8_t off)
|
||||
{
|
||||
cmd->cdb_len = 10;
|
||||
cmd->bufflen = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_trans_len_block_limit(struct scst_cmd *cmd, uint8_t off)
|
||||
{
|
||||
cmd->bufflen = 6;
|
||||
|
||||
Reference in New Issue
Block a user