Add support to unmarshall a CDB into a structure and update iscsi-dd

Add two new helper functions scsi_get_uint32() and scsi_get_uint16()
This commit is contained in:
Ronnie Sahlberg
2012-11-20 19:00:55 -08:00
parent e691f9cc2b
commit 890471c8cc
5 changed files with 69 additions and 3 deletions

View File

@@ -85,6 +85,7 @@ void read10_cb(struct iscsi_context *iscsi _U_, int status, void *command_data,
struct client *client = (struct client *)private_data;
struct scsi_task *task = command_data;
struct write_task *wt;
struct scsi_read10_cdb *read10_cdb;
if (status == SCSI_STATUS_CHECK_CONDITION) {
printf("Read10 failed with sense key:%d ascq:%04x\n", task->sense.key, task->sense.ascq);
@@ -95,9 +96,14 @@ void read10_cb(struct iscsi_context *iscsi _U_, int status, void *command_data,
wt->rt = task;
wt->client = client;
read10_cdb = scsi_cdb_unmarshall(task);
if (read10_cdb == NULL) {
printf("Failed to unmarshall READ10 CDB.\n");
exit(10);
}
if (iscsi_write10_task(client->dst_iscsi,
client->dst_lun,
task->params.read10.lba,
read10_cdb->lba,
task->datain.data,
task->datain.size,
client->dst_blocksize,