Add PREVENTALLOWMEDIUMREMOVAL support

This commit is contained in:
Ronnie Sahlberg
2012-07-17 18:12:03 +10:00
parent 4a3935770d
commit 16da01ed4e
7 changed files with 89 additions and 0 deletions

View File

@@ -1567,6 +1567,33 @@ scsi_cdb_startstopunit(int immed, int pcm, int pc, int no_flush, int loej, int s
return task;
}
/*
* PREVENTALLOWMEDIUMREMOVAL
*/
struct scsi_task *
scsi_cdb_preventallow(int prevent)
{
struct scsi_task *task;
task = malloc(sizeof(struct scsi_task));
if (task == NULL) {
return NULL;
}
memset(task, 0, sizeof(struct scsi_task));
task->cdb[0] = SCSI_OPCODE_PREVENTALLOW;
task->cdb[4] = prevent & 0x03;
task->cdb_size = 6;
task->xfer_dir = SCSI_XFER_NONE;
task->expxferlen = 0;
task->params.preventallow.prevent = prevent;
return task;
}
/*
* SYNCHRONIZECACHE10
*/