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