/*
* fill in request structure
*/
+ rq->cmd_len = hdr.cmd_len;
copy_from_user(rq->cmd, hdr.cmdp, hdr.cmd_len);
if (sizeof(rq->cmd) != hdr.cmd_len)
memset(rq->cmd + hdr.cmd_len, 0, sizeof(rq->cmd) - hdr.cmd_len);
* get command and data to send to device, if any
*/
err = -EFAULT;
+ rq->cmd_len = cmdlen;
if (copy_from_user(rq->cmd, sic->data, cmdlen))
goto error;
struct request *rq,
ide_handler_t *handler)
{
+ /*
+ * FIXME! This should be 'rq->cmd_len' when that is reliable.
+ *
+ * This breaks for real 16-byte commands. however, lots of drives
+ * currently break if we just send 16-bytes for 10/12 byte commands.
+ */
+#define MAX_CDB_BYTES 12
+ int cmd_len = MAX_CDB_BYTES;
+
struct cdrom_info *info = drive->driver_data;
ide_startstop_t startstop;
ide_set_handler(drive, handler, rq->timeout, cdrom_timer_expiry);
/* Send the command to the device. */
- HWIF(drive)->atapi_output_bytes(drive, rq->cmd, sizeof(rq->cmd));
+ HWIF(drive)->atapi_output_bytes(drive, rq->cmd, cmd_len);
/* Start the DMA if need be */
if (info->dma)
*/
rq->cmd[7] = (blocks >> 8) & 0xff;
rq->cmd[8] = blocks & 0xff;
+ rq->cmd_len = 10;
return BLKPREP_OK;
}
c[2] = 0;
c[1] &= 0xe0;
c[0] += (READ_10 - READ_6);
+ rq->cmd_len = 10;
return BLKPREP_OK;
}