diff options
-rw-r--r-- | drivers/firewire/fw-sbp2.c | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.c | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 2 | ||||
-rw-r--r-- | drivers/scsi/53c700.c | 6 | ||||
-rw-r--r-- | drivers/scsi/a100u2w.c | 2 | ||||
-rw-r--r-- | drivers/scsi/gdth.c | 2 | ||||
-rw-r--r-- | drivers/scsi/hptiop.c | 6 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 2 | ||||
-rw-r--r-- | drivers/scsi/initio.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla1280.c | 4 | ||||
-rw-r--r-- | drivers/scsi/scsi_error.c | 15 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 5 | ||||
-rw-r--r-- | drivers/scsi/scsi_tgt_lib.c | 2 | ||||
-rw-r--r-- | drivers/usb/storage/cypress_atacb.c | 2 | ||||
-rw-r--r-- | drivers/usb/storage/isd200.c | 2 | ||||
-rw-r--r-- | include/scsi/scsi_cmnd.h | 21 | ||||
-rw-r--r-- | include/scsi/scsi_eh.h | 4 |
17 files changed, 52 insertions, 29 deletions
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index 2a999373863e..dda82f37cab3 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c | |||
@@ -1487,7 +1487,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done) | |||
1487 | if (scsi_sg_count(cmd) && sbp2_map_scatterlist(orb, device, lu) < 0) | 1487 | if (scsi_sg_count(cmd) && sbp2_map_scatterlist(orb, device, lu) < 0) |
1488 | goto out; | 1488 | goto out; |
1489 | 1489 | ||
1490 | memcpy(orb->request.command_block, cmd->cmnd, COMMAND_SIZE(*cmd->cmnd)); | 1490 | memcpy(orb->request.command_block, cmd->cmnd, cmd->cmd_len); |
1491 | 1491 | ||
1492 | orb->base.callback = complete_command_orb; | 1492 | orb->base.callback = complete_command_orb; |
1493 | orb->base.request_bus = | 1493 | orb->base.request_bus = |
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 37b85c67b11d..c8bad675dbd1 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c | |||
@@ -1055,7 +1055,7 @@ static void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level, | |||
1055 | rec->scsi_result = scsi_cmnd->result; | 1055 | rec->scsi_result = scsi_cmnd->result; |
1056 | rec->scsi_cmnd = (unsigned long)scsi_cmnd; | 1056 | rec->scsi_cmnd = (unsigned long)scsi_cmnd; |
1057 | rec->scsi_serial = scsi_cmnd->serial_number; | 1057 | rec->scsi_serial = scsi_cmnd->serial_number; |
1058 | memcpy(rec->scsi_opcode, &scsi_cmnd->cmnd, | 1058 | memcpy(rec->scsi_opcode, scsi_cmnd->cmnd, |
1059 | min((int)scsi_cmnd->cmd_len, | 1059 | min((int)scsi_cmnd->cmd_len, |
1060 | ZFCP_DBF_SCSI_OPCODE)); | 1060 | ZFCP_DBF_SCSI_OPCODE)); |
1061 | rec->scsi_retries = scsi_cmnd->retries; | 1061 | rec->scsi_retries = scsi_cmnd->retries; |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 9af2330f07a2..b2ea4ea051f5 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -4014,7 +4014,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) | |||
4014 | ZFCP_LOG_TRACE("scpnt->result =0x%x, command was:\n", | 4014 | ZFCP_LOG_TRACE("scpnt->result =0x%x, command was:\n", |
4015 | scpnt->result); | 4015 | scpnt->result); |
4016 | ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, | 4016 | ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, |
4017 | (void *) &scpnt->cmnd, scpnt->cmd_len); | 4017 | scpnt->cmnd, scpnt->cmd_len); |
4018 | 4018 | ||
4019 | ZFCP_LOG_TRACE("%i bytes sense data provided by FCP\n", | 4019 | ZFCP_LOG_TRACE("%i bytes sense data provided by FCP\n", |
4020 | fcp_rsp_iu->fcp_sns_len); | 4020 | fcp_rsp_iu->fcp_sns_len); |
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index f4c4fe90240a..f5a9addb7050 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c | |||
@@ -599,7 +599,7 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata, | |||
599 | (struct NCR_700_command_slot *)SCp->host_scribble; | 599 | (struct NCR_700_command_slot *)SCp->host_scribble; |
600 | 600 | ||
601 | dma_unmap_single(hostdata->dev, slot->pCmd, | 601 | dma_unmap_single(hostdata->dev, slot->pCmd, |
602 | sizeof(SCp->cmnd), DMA_TO_DEVICE); | 602 | MAX_COMMAND_SIZE, DMA_TO_DEVICE); |
603 | if (slot->flags == NCR_700_FLAG_AUTOSENSE) { | 603 | if (slot->flags == NCR_700_FLAG_AUTOSENSE) { |
604 | char *cmnd = NCR_700_get_sense_cmnd(SCp->device); | 604 | char *cmnd = NCR_700_get_sense_cmnd(SCp->device); |
605 | #ifdef NCR_700_DEBUG | 605 | #ifdef NCR_700_DEBUG |
@@ -1004,7 +1004,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, | |||
1004 | * here */ | 1004 | * here */ |
1005 | NCR_700_unmap(hostdata, SCp, slot); | 1005 | NCR_700_unmap(hostdata, SCp, slot); |
1006 | dma_unmap_single(hostdata->dev, slot->pCmd, | 1006 | dma_unmap_single(hostdata->dev, slot->pCmd, |
1007 | sizeof(SCp->cmnd), | 1007 | MAX_COMMAND_SIZE, |
1008 | DMA_TO_DEVICE); | 1008 | DMA_TO_DEVICE); |
1009 | 1009 | ||
1010 | cmnd[0] = REQUEST_SENSE; | 1010 | cmnd[0] = REQUEST_SENSE; |
@@ -1901,7 +1901,7 @@ NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) | |||
1901 | } | 1901 | } |
1902 | slot->resume_offset = 0; | 1902 | slot->resume_offset = 0; |
1903 | slot->pCmd = dma_map_single(hostdata->dev, SCp->cmnd, | 1903 | slot->pCmd = dma_map_single(hostdata->dev, SCp->cmnd, |
1904 | sizeof(SCp->cmnd), DMA_TO_DEVICE); | 1904 | MAX_COMMAND_SIZE, DMA_TO_DEVICE); |
1905 | NCR_700_start_command(SCp); | 1905 | NCR_700_start_command(SCp); |
1906 | return 0; | 1906 | return 0; |
1907 | } | 1907 | } |
diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index 792b2e807bf3..ced3eebe252c 100644 --- a/drivers/scsi/a100u2w.c +++ b/drivers/scsi/a100u2w.c | |||
@@ -895,7 +895,7 @@ static void inia100_build_scb(struct orc_host * host, struct orc_scb * scb, stru | |||
895 | } else { | 895 | } else { |
896 | scb->tag_msg = 0; /* No tag support */ | 896 | scb->tag_msg = 0; /* No tag support */ |
897 | } | 897 | } |
898 | memcpy(&scb->cdb[0], &cmd->cmnd, scb->cdb_len); | 898 | memcpy(scb->cdb, cmd->cmnd, scb->cdb_len); |
899 | } | 899 | } |
900 | 900 | ||
901 | /** | 901 | /** |
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index c6d6e7c6559a..8e2e964af668 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
@@ -465,7 +465,7 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd, | |||
465 | scp->request = (struct request *)&wait; | 465 | scp->request = (struct request *)&wait; |
466 | scp->timeout_per_command = timeout*HZ; | 466 | scp->timeout_per_command = timeout*HZ; |
467 | scp->cmd_len = 12; | 467 | scp->cmd_len = 12; |
468 | memcpy(scp->cmnd, cmnd, 12); | 468 | scp->cmnd = cmnd; |
469 | cmndinfo.priority = IOCTL_PRI; | 469 | cmndinfo.priority = IOCTL_PRI; |
470 | cmndinfo.internal_cmd_str = gdtcmd; | 470 | cmndinfo.internal_cmd_str = gdtcmd; |
471 | cmndinfo.internal_command = 1; | 471 | cmndinfo.internal_command = 1; |
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index 5b7be1e9841c..aaa48e0c8ed0 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c | |||
@@ -763,9 +763,9 @@ static int hptiop_queuecommand(struct scsi_cmnd *scp, | |||
763 | scp, | 763 | scp, |
764 | host->host_no, scp->device->channel, | 764 | host->host_no, scp->device->channel, |
765 | scp->device->id, scp->device->lun, | 765 | scp->device->id, scp->device->lun, |
766 | *((u32 *)&scp->cmnd), | 766 | ((u32 *)scp->cmnd)[0], |
767 | *((u32 *)&scp->cmnd + 1), | 767 | ((u32 *)scp->cmnd)[1], |
768 | *((u32 *)&scp->cmnd + 2), | 768 | ((u32 *)scp->cmnd)[2], |
769 | _req->index, _req->req_virt); | 769 | _req->index, _req->req_virt); |
770 | 770 | ||
771 | scp->result = 0; | 771 | scp->result = 0; |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 9c77015b7a80..ccfd8aca3765 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -739,7 +739,7 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd, | |||
739 | srp_cmd = &evt_struct->iu.srp.cmd; | 739 | srp_cmd = &evt_struct->iu.srp.cmd; |
740 | memset(srp_cmd, 0x00, SRP_MAX_IU_LEN); | 740 | memset(srp_cmd, 0x00, SRP_MAX_IU_LEN); |
741 | srp_cmd->opcode = SRP_CMD; | 741 | srp_cmd->opcode = SRP_CMD; |
742 | memcpy(srp_cmd->cdb, cmnd->cmnd, sizeof(cmnd->cmnd)); | 742 | memcpy(srp_cmd->cdb, cmnd->cmnd, sizeof(srp_cmd->cdb)); |
743 | srp_cmd->lun = ((u64) lun) << 48; | 743 | srp_cmd->lun = ((u64) lun) << 48; |
744 | 744 | ||
745 | if (!map_data_for_srp_cmd(cmnd, evt_struct, srp_cmd, hostdata->dev)) { | 745 | if (!map_data_for_srp_cmd(cmnd, evt_struct, srp_cmd, hostdata->dev)) { |
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index dbae3fdb8506..e3f739776bad 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c | |||
@@ -2590,7 +2590,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c | |||
2590 | cblk->hastat = 0; | 2590 | cblk->hastat = 0; |
2591 | cblk->tastat = 0; | 2591 | cblk->tastat = 0; |
2592 | /* Command the command */ | 2592 | /* Command the command */ |
2593 | memcpy(&cblk->cdb[0], &cmnd->cmnd, cmnd->cmd_len); | 2593 | memcpy(cblk->cdb, cmnd->cmnd, cmnd->cmd_len); |
2594 | 2594 | ||
2595 | /* Set up tags */ | 2595 | /* Set up tags */ |
2596 | if (cmnd->device->tagged_supported) { /* Tag Support */ | 2596 | if (cmnd->device->tagged_supported) { /* Tag Support */ |
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 09ab3eac1c1a..fa060932d2b4 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c | |||
@@ -2858,7 +2858,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) | |||
2858 | 2858 | ||
2859 | /* Load SCSI command packet. */ | 2859 | /* Load SCSI command packet. */ |
2860 | pkt->cdb_len = cpu_to_le16(CMD_CDBLEN(cmd)); | 2860 | pkt->cdb_len = cpu_to_le16(CMD_CDBLEN(cmd)); |
2861 | memcpy(pkt->scsi_cdb, &(CMD_CDBP(cmd)), CMD_CDBLEN(cmd)); | 2861 | memcpy(pkt->scsi_cdb, CMD_CDBP(cmd), CMD_CDBLEN(cmd)); |
2862 | /* dprintk(1, "Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0]); */ | 2862 | /* dprintk(1, "Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0]); */ |
2863 | 2863 | ||
2864 | /* Set transfer direction. */ | 2864 | /* Set transfer direction. */ |
@@ -3127,7 +3127,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) | |||
3127 | 3127 | ||
3128 | /* Load SCSI command packet. */ | 3128 | /* Load SCSI command packet. */ |
3129 | pkt->cdb_len = cpu_to_le16(CMD_CDBLEN(cmd)); | 3129 | pkt->cdb_len = cpu_to_le16(CMD_CDBLEN(cmd)); |
3130 | memcpy(pkt->scsi_cdb, &(CMD_CDBP(cmd)), CMD_CDBLEN(cmd)); | 3130 | memcpy(pkt->scsi_cdb, CMD_CDBP(cmd), CMD_CDBLEN(cmd)); |
3131 | 3131 | ||
3132 | /*dprintk(1, "Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0]); */ | 3132 | /*dprintk(1, "Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0]); */ |
3133 | /* Set transfer direction. */ | 3133 | /* Set transfer direction. */ |
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 221f31e36d26..334244c73955 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -626,7 +626,7 @@ static void scsi_abort_eh_cmnd(struct scsi_cmnd *scmd) | |||
626 | * @scmd: SCSI command structure to hijack | 626 | * @scmd: SCSI command structure to hijack |
627 | * @ses: structure to save restore information | 627 | * @ses: structure to save restore information |
628 | * @cmnd: CDB to send. Can be NULL if no new cmnd is needed | 628 | * @cmnd: CDB to send. Can be NULL if no new cmnd is needed |
629 | * @cmnd_size: size in bytes of @cmnd | 629 | * @cmnd_size: size in bytes of @cmnd (must be <= BLK_MAX_CDB) |
630 | * @sense_bytes: size of sense data to copy. or 0 (if != 0 @cmnd is ignored) | 630 | * @sense_bytes: size of sense data to copy. or 0 (if != 0 @cmnd is ignored) |
631 | * | 631 | * |
632 | * This function is used to save a scsi command information before re-execution | 632 | * This function is used to save a scsi command information before re-execution |
@@ -648,12 +648,14 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, struct scsi_eh_save *ses, | |||
648 | * command. | 648 | * command. |
649 | */ | 649 | */ |
650 | ses->cmd_len = scmd->cmd_len; | 650 | ses->cmd_len = scmd->cmd_len; |
651 | memcpy(ses->cmnd, scmd->cmnd, sizeof(scmd->cmnd)); | 651 | ses->cmnd = scmd->cmnd; |
652 | ses->data_direction = scmd->sc_data_direction; | 652 | ses->data_direction = scmd->sc_data_direction; |
653 | ses->sdb = scmd->sdb; | 653 | ses->sdb = scmd->sdb; |
654 | ses->next_rq = scmd->request->next_rq; | 654 | ses->next_rq = scmd->request->next_rq; |
655 | ses->result = scmd->result; | 655 | ses->result = scmd->result; |
656 | 656 | ||
657 | scmd->cmnd = ses->eh_cmnd; | ||
658 | memset(scmd->cmnd, 0, BLK_MAX_CDB); | ||
657 | memset(&scmd->sdb, 0, sizeof(scmd->sdb)); | 659 | memset(&scmd->sdb, 0, sizeof(scmd->sdb)); |
658 | scmd->request->next_rq = NULL; | 660 | scmd->request->next_rq = NULL; |
659 | 661 | ||
@@ -665,14 +667,13 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, struct scsi_eh_save *ses, | |||
665 | scmd->sdb.table.sgl = &ses->sense_sgl; | 667 | scmd->sdb.table.sgl = &ses->sense_sgl; |
666 | scmd->sc_data_direction = DMA_FROM_DEVICE; | 668 | scmd->sc_data_direction = DMA_FROM_DEVICE; |
667 | scmd->sdb.table.nents = 1; | 669 | scmd->sdb.table.nents = 1; |
668 | memset(scmd->cmnd, 0, sizeof(scmd->cmnd)); | ||
669 | scmd->cmnd[0] = REQUEST_SENSE; | 670 | scmd->cmnd[0] = REQUEST_SENSE; |
670 | scmd->cmnd[4] = scmd->sdb.length; | 671 | scmd->cmnd[4] = scmd->sdb.length; |
671 | scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]); | 672 | scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]); |
672 | } else { | 673 | } else { |
673 | scmd->sc_data_direction = DMA_NONE; | 674 | scmd->sc_data_direction = DMA_NONE; |
674 | if (cmnd) { | 675 | if (cmnd) { |
675 | memset(scmd->cmnd, 0, sizeof(scmd->cmnd)); | 676 | BUG_ON(cmnd_size > BLK_MAX_CDB); |
676 | memcpy(scmd->cmnd, cmnd, cmnd_size); | 677 | memcpy(scmd->cmnd, cmnd, cmnd_size); |
677 | scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]); | 678 | scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]); |
678 | } | 679 | } |
@@ -705,7 +706,7 @@ void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd, struct scsi_eh_save *ses) | |||
705 | * Restore original data | 706 | * Restore original data |
706 | */ | 707 | */ |
707 | scmd->cmd_len = ses->cmd_len; | 708 | scmd->cmd_len = ses->cmd_len; |
708 | memcpy(scmd->cmnd, ses->cmnd, sizeof(scmd->cmnd)); | 709 | scmd->cmnd = ses->cmnd; |
709 | scmd->sc_data_direction = ses->data_direction; | 710 | scmd->sc_data_direction = ses->data_direction; |
710 | scmd->sdb = ses->sdb; | 711 | scmd->sdb = ses->sdb; |
711 | scmd->request->next_rq = ses->next_rq; | 712 | scmd->request->next_rq = ses->next_rq; |
@@ -1774,8 +1775,8 @@ scsi_reset_provider(struct scsi_device *dev, int flag) | |||
1774 | scmd->request = &req; | 1775 | scmd->request = &req; |
1775 | memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout)); | 1776 | memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout)); |
1776 | 1777 | ||
1777 | memset(&scmd->cmnd, '\0', sizeof(scmd->cmnd)); | 1778 | scmd->cmnd = req.cmd; |
1778 | 1779 | ||
1779 | scmd->scsi_done = scsi_reset_provider_done_command; | 1780 | scmd->scsi_done = scsi_reset_provider_done_command; |
1780 | memset(&scmd->sdb, 0, sizeof(scmd->sdb)); | 1781 | memset(&scmd->sdb, 0, sizeof(scmd->sdb)); |
1781 | 1782 | ||
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 67f412bb4974..325270b520e1 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1090,6 +1090,8 @@ static struct scsi_cmnd *scsi_get_cmd_from_req(struct scsi_device *sdev, | |||
1090 | cmd->tag = req->tag; | 1090 | cmd->tag = req->tag; |
1091 | cmd->request = req; | 1091 | cmd->request = req; |
1092 | 1092 | ||
1093 | cmd->cmnd = req->cmd; | ||
1094 | |||
1093 | return cmd; | 1095 | return cmd; |
1094 | } | 1096 | } |
1095 | 1097 | ||
@@ -1127,8 +1129,6 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req) | |||
1127 | req->buffer = NULL; | 1129 | req->buffer = NULL; |
1128 | } | 1130 | } |
1129 | 1131 | ||
1130 | BUILD_BUG_ON(sizeof(req->cmd) > sizeof(cmd->cmnd)); | ||
1131 | memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); | ||
1132 | cmd->cmd_len = req->cmd_len; | 1132 | cmd->cmd_len = req->cmd_len; |
1133 | if (!req->data_len) | 1133 | if (!req->data_len) |
1134 | cmd->sc_data_direction = DMA_NONE; | 1134 | cmd->sc_data_direction = DMA_NONE; |
@@ -1165,6 +1165,7 @@ int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req) | |||
1165 | if (unlikely(!cmd)) | 1165 | if (unlikely(!cmd)) |
1166 | return BLKPREP_DEFER; | 1166 | return BLKPREP_DEFER; |
1167 | 1167 | ||
1168 | memset(cmd->cmnd, 0, BLK_MAX_CDB); | ||
1168 | return scsi_init_io(cmd, GFP_ATOMIC); | 1169 | return scsi_init_io(cmd, GFP_ATOMIC); |
1169 | } | 1170 | } |
1170 | EXPORT_SYMBOL(scsi_setup_fs_cmnd); | 1171 | EXPORT_SYMBOL(scsi_setup_fs_cmnd); |
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c index ee8496aa0336..257e097c39af 100644 --- a/drivers/scsi/scsi_tgt_lib.c +++ b/drivers/scsi/scsi_tgt_lib.c | |||
@@ -107,6 +107,8 @@ struct scsi_cmnd *scsi_host_get_command(struct Scsi_Host *shost, | |||
107 | cmd->jiffies_at_alloc = jiffies; | 107 | cmd->jiffies_at_alloc = jiffies; |
108 | cmd->request = rq; | 108 | cmd->request = rq; |
109 | 109 | ||
110 | cmd->cmnd = rq->cmd; | ||
111 | |||
110 | rq->special = cmd; | 112 | rq->special = cmd; |
111 | rq->cmd_type = REQ_TYPE_SPECIAL; | 113 | rq->cmd_type = REQ_TYPE_SPECIAL; |
112 | rq->cmd_flags |= REQ_TYPE_BLOCK_PC; | 114 | rq->cmd_flags |= REQ_TYPE_BLOCK_PC; |
diff --git a/drivers/usb/storage/cypress_atacb.c b/drivers/usb/storage/cypress_atacb.c index d88824b3511c..898e67d30e56 100644 --- a/drivers/usb/storage/cypress_atacb.c +++ b/drivers/usb/storage/cypress_atacb.c | |||
@@ -46,7 +46,7 @@ void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us) | |||
46 | } | 46 | } |
47 | 47 | ||
48 | memcpy(save_cmnd, srb->cmnd, sizeof(save_cmnd)); | 48 | memcpy(save_cmnd, srb->cmnd, sizeof(save_cmnd)); |
49 | memset(srb->cmnd, 0, sizeof(srb->cmnd)); | 49 | memset(srb->cmnd, 0, MAX_COMMAND_SIZE); |
50 | 50 | ||
51 | /* check if we support the command */ | 51 | /* check if we support the command */ |
52 | if (save_cmnd[1] >> 5) /* MULTIPLE_COUNT */ | 52 | if (save_cmnd[1] >> 5) /* MULTIPLE_COUNT */ |
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c index 971d13dd5e65..3addcd8f827b 100644 --- a/drivers/usb/storage/isd200.c +++ b/drivers/usb/storage/isd200.c | |||
@@ -292,6 +292,7 @@ struct isd200_info { | |||
292 | 292 | ||
293 | /* maximum number of LUNs supported */ | 293 | /* maximum number of LUNs supported */ |
294 | unsigned char MaxLUNs; | 294 | unsigned char MaxLUNs; |
295 | unsigned char cmnd[BLK_MAX_CDB]; | ||
295 | struct scsi_cmnd srb; | 296 | struct scsi_cmnd srb; |
296 | struct scatterlist sg; | 297 | struct scatterlist sg; |
297 | }; | 298 | }; |
@@ -450,6 +451,7 @@ static int isd200_action( struct us_data *us, int action, | |||
450 | 451 | ||
451 | memset(&ata, 0, sizeof(ata)); | 452 | memset(&ata, 0, sizeof(ata)); |
452 | memset(&srb_dev, 0, sizeof(srb_dev)); | 453 | memset(&srb_dev, 0, sizeof(srb_dev)); |
454 | srb->cmnd = info->cmnd; | ||
453 | srb->device = &srb_dev; | 455 | srb->device = &srb_dev; |
454 | ++srb->serial_number; | 456 | ++srb->serial_number; |
455 | 457 | ||
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 8d20e60a94b7..7ed883c8e48a 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -7,10 +7,28 @@ | |||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/timer.h> | 8 | #include <linux/timer.h> |
9 | #include <linux/scatterlist.h> | 9 | #include <linux/scatterlist.h> |
10 | #include <linux/blkdev.h> | ||
10 | 11 | ||
11 | struct Scsi_Host; | 12 | struct Scsi_Host; |
12 | struct scsi_device; | 13 | struct scsi_device; |
13 | 14 | ||
15 | /* | ||
16 | * MAX_COMMAND_SIZE is: | ||
17 | * The longest fixed-length SCSI CDB as per the SCSI standard. | ||
18 | * fixed-length means: commands that their size can be determined | ||
19 | * by their opcode and the CDB does not carry a length specifier, (unlike | ||
20 | * the VARIABLE_LENGTH_CMD(0x7f) command). This is actually not exactly | ||
21 | * true and the SCSI standard also defines extended commands and | ||
22 | * vendor specific commands that can be bigger than 16 bytes. The kernel | ||
23 | * will support these using the same infrastructure used for VARLEN CDB's. | ||
24 | * So in effect MAX_COMMAND_SIZE means the maximum size command scsi-ml | ||
25 | * supports without specifying a cmd_len by ULD's | ||
26 | */ | ||
27 | #define MAX_COMMAND_SIZE 16 | ||
28 | #if (MAX_COMMAND_SIZE > BLK_MAX_CDB) | ||
29 | # error MAX_COMMAND_SIZE can not be bigger than BLK_MAX_CDB | ||
30 | #endif | ||
31 | |||
14 | struct scsi_data_buffer { | 32 | struct scsi_data_buffer { |
15 | struct sg_table table; | 33 | struct sg_table table; |
16 | unsigned length; | 34 | unsigned length; |
@@ -64,8 +82,7 @@ struct scsi_cmnd { | |||
64 | enum dma_data_direction sc_data_direction; | 82 | enum dma_data_direction sc_data_direction; |
65 | 83 | ||
66 | /* These elements define the operation we are about to perform */ | 84 | /* These elements define the operation we are about to perform */ |
67 | #define MAX_COMMAND_SIZE 16 | 85 | unsigned char *cmnd; |
68 | unsigned char cmnd[MAX_COMMAND_SIZE]; | ||
69 | 86 | ||
70 | struct timer_list eh_timeout; /* Used to time out the command. */ | 87 | struct timer_list eh_timeout; /* Used to time out the command. */ |
71 | 88 | ||
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h index d3a133b4a072..2a9add21267d 100644 --- a/include/scsi/scsi_eh.h +++ b/include/scsi/scsi_eh.h | |||
@@ -75,11 +75,11 @@ struct scsi_eh_save { | |||
75 | int result; | 75 | int result; |
76 | enum dma_data_direction data_direction; | 76 | enum dma_data_direction data_direction; |
77 | unsigned char cmd_len; | 77 | unsigned char cmd_len; |
78 | unsigned char cmnd[MAX_COMMAND_SIZE]; | 78 | unsigned char *cmnd; |
79 | struct scsi_data_buffer sdb; | 79 | struct scsi_data_buffer sdb; |
80 | struct request *next_rq; | 80 | struct request *next_rq; |
81 | |||
82 | /* new command support */ | 81 | /* new command support */ |
82 | unsigned char eh_cmnd[BLK_MAX_CDB]; | ||
83 | struct scatterlist sense_sgl; | 83 | struct scatterlist sense_sgl; |
84 | }; | 84 | }; |
85 | 85 | ||