scsi-lowlevel: remove scsi_maintenancein_params and finally scsi_task->params too

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
This commit is contained in:
Arne Redlich
2012-11-18 23:28:32 +01:00
parent 8baa843d73
commit 5194d13e73
2 changed files with 14 additions and 18 deletions
-10
View File
@@ -180,13 +180,6 @@ struct scsi_report_supported_params {
int return_timeouts; int return_timeouts;
}; };
struct scsi_maintenancein_params {
enum scsi_maintenance_in sa;
union {
struct scsi_report_supported_params reportsupported;
} params;
};
struct scsi_sense { struct scsi_sense {
unsigned char error_type; unsigned char error_type;
enum scsi_sense_key key; enum scsi_sense_key key;
@@ -211,9 +204,6 @@ struct scsi_task {
int xfer_dir; int xfer_dir;
int expxferlen; int expxferlen;
unsigned char cdb[SCSI_CDB_MAX_SIZE]; unsigned char cdb[SCSI_CDB_MAX_SIZE];
union {
struct scsi_maintenancein_params maintenancein;
} params;
enum scsi_residual residual_status; enum scsi_residual residual_status;
int residual; int residual;
+14 -8
View File
@@ -566,6 +566,17 @@ scsi_serviceactionin_datain_unmarshall(struct scsi_task *task)
} }
} }
static inline int
scsi_maintenancein_return_timeouts(const struct scsi_task *task)
{
return task->cdb[2] & 0x80;
}
static inline uint8_t
scsi_maintenancein_sa(const struct scsi_task *task)
{
return task->cdb[1];
}
/* /*
* parse the data in blob and calculate the size of a full maintenancein * parse the data in blob and calculate the size of a full maintenancein
@@ -575,16 +586,14 @@ static int
scsi_maintenancein_datain_getfullsize(struct scsi_task *task) scsi_maintenancein_datain_getfullsize(struct scsi_task *task)
{ {
switch (task->params.maintenancein.sa) { switch (scsi_maintenancein_sa(task)) {
case SCSI_REPORT_SUPPORTED_OP_CODES: case SCSI_REPORT_SUPPORTED_OP_CODES:
return ntohl(*(uint32_t *)&(task->datain.data[0])) + 4; return ntohl(*(uint32_t *)&(task->datain.data[0])) + 4;
default: default:
return -1; return -1;
} }
} }
/* /*
* maintenance_in unmarshall * maintenance_in unmarshall
*/ */
@@ -596,7 +605,7 @@ scsi_maintenancein_datain_unmarshall(struct scsi_task *task)
uint32_t len, i; uint32_t len, i;
int return_timeouts, desc_size; int return_timeouts, desc_size;
switch (task->params.maintenancein.sa) { switch (scsi_maintenancein_sa(task)) {
case SCSI_REPORT_SUPPORTED_OP_CODES: case SCSI_REPORT_SUPPORTED_OP_CODES:
if (task->datain.size < 4) { if (task->datain.size < 4) {
return NULL; return NULL;
@@ -608,7 +617,7 @@ scsi_maintenancein_datain_unmarshall(struct scsi_task *task)
return NULL; return NULL;
} }
/* Does the descriptor include command timeout info? */ /* Does the descriptor include command timeout info? */
return_timeouts = task->params.maintenancein.params.reportsupported.return_timeouts; return_timeouts = scsi_maintenancein_return_timeouts(task);
/* Size of descriptor depends on whether timeout included. */ /* Size of descriptor depends on whether timeout included. */
desc_size = sizeof (struct scsi_command_descriptor); desc_size = sizeof (struct scsi_command_descriptor);
@@ -674,9 +683,6 @@ scsi_cdb_report_supported_opcodes(int return_timeouts, uint32_t alloc_len)
} }
task->expxferlen = alloc_len; task->expxferlen = alloc_len;
task->params.maintenancein.sa = SCSI_REPORT_SUPPORTED_OP_CODES;
task->params.maintenancein.params.reportsupported.return_timeouts = return_timeouts;
return task; return task;
} }