SCSI: READTOC change alloclen to a uint32 and encode it in the CDB
This commit is contained in:
@@ -110,7 +110,7 @@ enum scsi_xfer_dir {
|
|||||||
/*
|
/*
|
||||||
* READTOC
|
* READTOC
|
||||||
*/
|
*/
|
||||||
EXTERN struct scsi_task *scsi_cdb_readtoc(int msf, int format, int track_session, uint32_t xferlen);
|
EXTERN struct scsi_task *scsi_cdb_readtoc(int msf, int format, int track_session, uint16_t alloc_len);
|
||||||
|
|
||||||
enum scsi_readtoc_fmt {
|
enum scsi_readtoc_fmt {
|
||||||
SCSI_READ_TOC = 0,
|
SCSI_READ_TOC = 0,
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ scsi_cdb_readcapacity10(int lba, int pmi)
|
|||||||
* READTOC
|
* READTOC
|
||||||
*/
|
*/
|
||||||
struct scsi_task *
|
struct scsi_task *
|
||||||
scsi_cdb_readtoc(int msf, int format, int track_session, uint32_t xferlen)
|
scsi_cdb_readtoc(int msf, int format, int track_session, uint16_t alloc_len)
|
||||||
{
|
{
|
||||||
struct scsi_task *task;
|
struct scsi_task *task;
|
||||||
|
|
||||||
@@ -335,13 +335,15 @@ scsi_cdb_readtoc(int msf, int format, int track_session, uint32_t xferlen)
|
|||||||
task->cdb[6] = 0xff & track_session;
|
task->cdb[6] = 0xff & track_session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*(uint16_t *)&task->cdb[7] = htons(alloc_len);
|
||||||
|
|
||||||
task->cdb_size = 10;
|
task->cdb_size = 10;
|
||||||
if (xferlen != 0) {
|
if (alloc_len != 0) {
|
||||||
task->xfer_dir = SCSI_XFER_READ;
|
task->xfer_dir = SCSI_XFER_READ;
|
||||||
} else {
|
} else {
|
||||||
task->xfer_dir = SCSI_XFER_NONE;
|
task->xfer_dir = SCSI_XFER_NONE;
|
||||||
}
|
}
|
||||||
task->expxferlen = xferlen;
|
task->expxferlen = alloc_len;
|
||||||
|
|
||||||
task->params.readtoc.msf = msf;
|
task->params.readtoc.msf = msf;
|
||||||
task->params.readtoc.format = format;
|
task->params.readtoc.format = format;
|
||||||
|
|||||||
Reference in New Issue
Block a user