Add Read TOC (0x43) Command Support (and basic testcase).

This commit is contained in:
Jon Grimm
2012-09-24 10:15:00 -05:00
parent 4b250c0abb
commit e55ec72f36
11 changed files with 458 additions and 0 deletions

View File

@@ -821,6 +821,25 @@ iscsi_unmap_sync(struct iscsi_context *iscsi, int lun, int anchor, int group,
return state.task;
}
struct scsi_task *
iscsi_readtoc_sync(struct iscsi_context *iscsi, int lun, int msf, int format,
int track_session, int maxsize)
{
struct iscsi_sync_state state;
memset(&state, 0, sizeof(state));
if (iscsi_readtoc_task(iscsi, lun, msf, format, track_session,
maxsize, scsi_sync_cb, &state) == NULL) {
iscsi_set_error(iscsi, "Failed to send Read TOC command");
return NULL;
}
event_loop(iscsi, &state);
return state.task;
}
struct scsi_task *
iscsi_scsi_command_sync(struct iscsi_context *iscsi, int lun,
struct scsi_task *task, struct iscsi_data *data)