Lines Matching refs:cmd

301 	struct scsi_cmnd *cmd;  member
402 static void stex_invalid_field(struct scsi_cmnd *cmd, in stex_invalid_field() argument
406 scsi_build_sense(cmd, 0, ILLEGAL_REQUEST, 0x24, 0x0); in stex_invalid_field()
407 done(cmd); in stex_invalid_field()
429 struct scsi_cmnd *cmd; in stex_map_sg() local
435 cmd = ccb->cmd; in stex_map_sg()
436 nseg = scsi_dma_map(cmd); in stex_map_sg()
444 dst->sz_in_byte = cpu_to_le32(scsi_bufflen(cmd)); in stex_map_sg()
447 scsi_for_each_sg(cmd, sg, nseg, i) { in stex_map_sg()
461 struct scsi_cmnd *cmd; in stex_ss_map_sg() local
467 cmd = ccb->cmd; in stex_ss_map_sg()
468 nseg = scsi_dma_map(cmd); in stex_ss_map_sg()
476 dst->sz_in_byte = cpu_to_le32(scsi_bufflen(cmd)); in stex_ss_map_sg()
479 scsi_for_each_sg(cmd, sg, nseg, i) { in stex_ss_map_sg()
497 scsi_sg_copy_to_buffer(ccb->cmd, p, count); in stex_controller_info()
515 scsi_sg_copy_from_buffer(ccb->cmd, p, count); in stex_controller_info()
534 struct scsi_cmnd *cmd; in stex_ss_send_cmd() local
543 cmd = hba->ccb[tag].cmd; in stex_ss_send_cmd()
545 if (likely(cmd)) { in stex_ss_send_cmd()
546 msg_h->channel = (u8)cmd->device->channel; in stex_ss_send_cmd()
547 msg_h->timeout = cpu_to_le16(scsi_cmd_to_rq(cmd)->timeout / HZ); in stex_ss_send_cmd()
578 if (ccb->cmd) { in return_abnormal_state()
579 scsi_dma_unmap(ccb->cmd); in return_abnormal_state()
580 ccb->cmd->result = status << 16; in return_abnormal_state()
581 scsi_done(ccb->cmd); in return_abnormal_state()
582 ccb->cmd = NULL; in return_abnormal_state()
597 static int stex_queuecommand_lck(struct scsi_cmnd *cmd) in stex_queuecommand_lck() argument
606 host = cmd->device->host; in stex_queuecommand_lck()
607 id = cmd->device->id; in stex_queuecommand_lck()
608 lun = cmd->device->lun; in stex_queuecommand_lck()
611 cmd->result = DID_NO_CONNECT; in stex_queuecommand_lck()
612 done(cmd); in stex_queuecommand_lck()
618 switch (cmd->cmnd[0]) { in stex_queuecommand_lck()
625 page = cmd->cmnd[2] & 0x3f; in stex_queuecommand_lck()
627 scsi_sg_copy_from_buffer(cmd, ms10_caching_page, in stex_queuecommand_lck()
629 cmd->result = DID_OK << 16; in stex_queuecommand_lck()
630 done(cmd); in stex_queuecommand_lck()
632 stex_invalid_field(cmd, done); in stex_queuecommand_lck()
642 stex_invalid_field(cmd, done); in stex_queuecommand_lck()
648 cmd->result = DID_OK << 16; in stex_queuecommand_lck()
649 done(cmd); in stex_queuecommand_lck()
655 cmd->result = DID_NO_CONNECT << 16; in stex_queuecommand_lck()
656 done(cmd); in stex_queuecommand_lck()
661 if (!lun && !cmd->device->channel && in stex_queuecommand_lck()
662 (cmd->cmnd[1] & INQUIRY_EVPD) == 0) { in stex_queuecommand_lck()
663 scsi_sg_copy_from_buffer(cmd, (void *)console_inq_page, in stex_queuecommand_lck()
665 cmd->result = DID_OK << 16; in stex_queuecommand_lck()
666 done(cmd); in stex_queuecommand_lck()
668 stex_invalid_field(cmd, done); in stex_queuecommand_lck()
671 if (cmd->cmnd[1] == PASSTHRU_GET_DRVVER) { in stex_queuecommand_lck()
683 cp_len = scsi_sg_copy_from_buffer(cmd, &ver, cp_len); in stex_queuecommand_lck()
685 cmd->result = DID_OK << 16; in stex_queuecommand_lck()
687 cmd->result = DID_ERROR << 16; in stex_queuecommand_lck()
688 done(cmd); in stex_queuecommand_lck()
696 tag = scsi_cmd_to_rq(cmd)->tag; in stex_queuecommand_lck()
707 memcpy(req->cdb, cmd->cmnd, STEX_CDB_LENGTH); in stex_queuecommand_lck()
709 if (cmd->sc_data_direction == DMA_FROM_DEVICE) in stex_queuecommand_lck()
711 else if (cmd->sc_data_direction == DMA_TO_DEVICE) in stex_queuecommand_lck()
716 hba->ccb[tag].cmd = cmd; in stex_queuecommand_lck()
718 hba->ccb[tag].sense_buffer = cmd->sense_buffer; in stex_queuecommand_lck()
733 struct scsi_cmnd *cmd = ccb->cmd; in DEF_SCSI_QCMD() local
769 cmd->result = result; in DEF_SCSI_QCMD()
770 scsi_done(cmd); in DEF_SCSI_QCMD()
783 if (ccb->cmd == NULL) in stex_copy_data()
785 scsi_sg_copy_from_buffer(ccb->cmd, resp->variable, variable); in stex_copy_data()
791 if (ccb->cmd->cmnd[0] == MGT_CMD && in stex_check_cmd()
793 scsi_set_resid(ccb->cmd, scsi_bufflen(ccb->cmd) - in stex_check_cmd()
865 if (likely(ccb->cmd != NULL)) { in stex_mu_intr()
869 if (unlikely(ccb->cmd->cmnd[0] == PASSTHRU_CMD && in stex_mu_intr()
870 ccb->cmd->cmnd[1] == PASSTHRU_GET_ADAPTER)) in stex_mu_intr()
873 scsi_dma_unmap(ccb->cmd); in stex_mu_intr()
973 if (likely(ccb->cmd != NULL)) in stex_ss_mu_intr()
977 if (likely(ccb->cmd != NULL)) { in stex_ss_mu_intr()
978 scsi_dma_unmap(ccb->cmd); in stex_ss_mu_intr()
1248 static int stex_abort(struct scsi_cmnd *cmd) in stex_abort() argument
1250 struct Scsi_Host *host = cmd->device->host; in stex_abort()
1252 u16 tag = scsi_cmd_to_rq(cmd)->tag; in stex_abort()
1258 scmd_printk(KERN_INFO, cmd, "aborting command\n"); in stex_abort()
1263 hba->ccb[tag].req && hba->ccb[tag].cmd == cmd) in stex_abort()
1300 scsi_dma_unmap(cmd); in stex_abort()
1441 static int stex_reset(struct scsi_cmnd *cmd) in stex_reset() argument
1445 hba = (struct st_hba *) &cmd->device->host->hostdata[0]; in stex_reset()
1447 shost_printk(KERN_INFO, cmd->device->host, in stex_reset()
1897 hba->ccb[tag].cmd = NULL; in stex_hba_stop()