From f73e42ec26207774225782e413b3dca740b3375f Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Tue, 15 Feb 2011 20:57:03 +1100 Subject: [PATCH] TaskManagement: Store the ITT and CMDSN in the scsi_task structure These are required for some of the task management functions --- include/scsi-lowlevel.h | 3 +++ lib/scsi-command.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/scsi-lowlevel.h b/include/scsi-lowlevel.h index 88ad385..286d615 100644 --- a/include/scsi-lowlevel.h +++ b/include/scsi-lowlevel.h @@ -126,6 +126,9 @@ struct scsi_task { struct scsi_allocated_memory *mem; void *ptr; + + uint32_t itt; + uint32_t cmdsn; }; void scsi_free_scsi_task(struct scsi_task *task); diff --git a/lib/scsi-command.c b/lib/scsi-command.c index 4a42115..4679f95 100644 --- a/lib/scsi-command.c +++ b/lib/scsi-command.c @@ -323,6 +323,10 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun, iscsi_send_data_out(iscsi, pdu, 0xffffffff, offset, len); } + /* remember cmdsn and itt so we can use task management */ + task->cmdsn = pdu->cmdsn; + task->itt = pdu->itt; + return 0; }