Lines Matching refs:scmd
775 struct scsi_cmnd *scmd = qc->scsicmd; in ata_qc_set_pc_nbytes() local
777 qc->extrabytes = scmd->request->extra_len; in ata_qc_set_pc_nbytes()
778 qc->nbytes = scsi_bufflen(scmd) + qc->extrabytes; in ata_qc_set_pc_nbytes()
1343 struct scsi_cmnd *scmd = qc->scsicmd; in ata_scsi_start_stop_xlat() local
1345 const u8 *cdb = scmd->cmnd; in ata_scsi_start_stop_xlat()
1347 if (scmd->cmd_len < 5) in ata_scsi_start_stop_xlat()
1404 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x0); in ata_scsi_start_stop_xlat()
1408 scmd->result = SAM_STAT_GOOD; in ata_scsi_start_stop_xlat()
1549 struct scsi_cmnd *scmd = qc->scsicmd; in ata_scsi_verify_xlat() local
1553 const u8 *cdb = scmd->cmnd; in ata_scsi_verify_xlat()
1561 if (scmd->cmd_len < 10) in ata_scsi_verify_xlat()
1565 if (scmd->cmd_len < 16) in ata_scsi_verify_xlat()
1643 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x0); in ata_scsi_verify_xlat()
1648 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x21, 0x0); in ata_scsi_verify_xlat()
1653 scmd->result = SAM_STAT_GOOD; in ata_scsi_verify_xlat()
1677 struct scsi_cmnd *scmd = qc->scsicmd; in ata_scsi_rw_xlat() local
1678 const u8 *cdb = scmd->cmnd; in ata_scsi_rw_xlat()
1691 if (unlikely(scmd->cmd_len < 10)) in ata_scsi_rw_xlat()
1699 if (unlikely(scmd->cmd_len < 6)) in ata_scsi_rw_xlat()
1711 if (unlikely(scmd->cmd_len < 16)) in ata_scsi_rw_xlat()
1734 qc->nbytes = n_block * scmd->device->sector_size; in ata_scsi_rw_xlat()
1745 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x0); in ata_scsi_rw_xlat()
1750 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x21, 0x0); in ata_scsi_rw_xlat()
1755 scmd->result = SAM_STAT_GOOD; in ata_scsi_rw_xlat()
2752 struct scsi_cmnd *scmd = qc->scsicmd; in atapi_xlat() local
2754 int nodata = (scmd->sc_data_direction == DMA_NONE); in atapi_xlat()
2759 memcpy(qc->cdb, scmd->cmnd, scmd->cmd_len); in atapi_xlat()
2764 if (scmd->sc_data_direction == DMA_TO_DEVICE) { in atapi_xlat()
2823 (scmd->sc_data_direction != DMA_TO_DEVICE)) in atapi_xlat()
2942 struct scsi_cmnd *scmd = qc->scsicmd; in ata_scsi_pass_thru() local
2944 const u8 *cdb = scmd->cmnd; in ata_scsi_pass_thru()
3006 qc->sect_size = scsi_bufflen(scmd); in ata_scsi_pass_thru()
3040 qc->sect_size = scmd->device->sector_size; in ata_scsi_pass_thru()
3054 if (scmd->sc_data_direction == DMA_TO_DEVICE) in ata_scsi_pass_thru()
3118 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x00); in ata_scsi_pass_thru()
3126 struct scsi_cmnd *scmd = qc->scsicmd; in ata_scsi_write_same_xlat() local
3128 const u8 *cdb = scmd->cmnd; in ata_scsi_write_same_xlat()
3138 if (unlikely(scmd->cmd_len < 16)) in ata_scsi_write_same_xlat()
3150 if (!scsi_sg_count(scmd)) in ata_scsi_write_same_xlat()
3153 buf = page_address(sg_page(scsi_sglist(scmd))); in ata_scsi_write_same_xlat()
3183 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x00); in ata_scsi_write_same_xlat()
3247 struct scsi_cmnd *scmd = qc->scsicmd; in ata_scsi_mode_select_xlat() local
3248 const u8 *cdb = scmd->cmnd; in ata_scsi_mode_select_xlat()
3258 if (scmd->cmd_len < 5) in ata_scsi_mode_select_xlat()
3264 if (scmd->cmd_len < 9) in ata_scsi_mode_select_xlat()
3276 if (!scsi_sg_count(scmd) || scsi_sglist(scmd)->length < len) in ata_scsi_mode_select_xlat()
3279 p = page_address(sg_page(scsi_sglist(scmd))); in ata_scsi_mode_select_xlat()
3352 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x0); in ata_scsi_mode_select_xlat()
3357 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x26, 0x0); in ata_scsi_mode_select_xlat()
3362 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x1a, 0x0); in ata_scsi_mode_select_xlat()
3366 scmd->result = SAM_STAT_GOOD; in ata_scsi_mode_select_xlat()
3446 static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, in __ata_scsi_queuecmd() argument
3449 u8 scsi_op = scmd->cmnd[0]; in __ata_scsi_queuecmd()
3454 if (unlikely(!scmd->cmd_len || scmd->cmd_len > dev->cdb_len)) in __ata_scsi_queuecmd()
3459 if (unlikely(!scmd->cmd_len)) in __ata_scsi_queuecmd()
3466 if (unlikely(len > scmd->cmd_len || len > dev->cdb_len)) in __ata_scsi_queuecmd()
3472 if (unlikely(scmd->cmd_len > 16)) in __ata_scsi_queuecmd()
3480 rc = ata_scsi_translate(dev, scmd, xlat_func); in __ata_scsi_queuecmd()
3482 ata_scsi_simulate(dev, scmd); in __ata_scsi_queuecmd()
3488 scmd->cmd_len, scsi_op, dev->cdb_len); in __ata_scsi_queuecmd()
3489 scmd->result = DID_ERROR << 16; in __ata_scsi_queuecmd()
3490 scmd->scsi_done(scmd); in __ata_scsi_queuecmd()