Lines Matching refs:cmd

462 static void __qla1280_print_scsi_cmd(struct scsi_cmnd * cmd);
555 #define qla1280_print_scsi_cmd(level, cmd) \ argument
556 if (ql_debug_level >= level) __qla1280_print_scsi_cmd(cmd)
685 static int qla1280_queuecommand_lck(struct scsi_cmnd *cmd) in qla1280_queuecommand_lck() argument
687 struct Scsi_Host *host = cmd->device->host; in qla1280_queuecommand_lck()
689 struct srb *sp = scsi_cmd_priv(cmd); in qla1280_queuecommand_lck()
692 sp->cmd = cmd; in qla1280_queuecommand_lck()
695 CMD_HANDLE(cmd) = (unsigned char *)NULL; in qla1280_queuecommand_lck()
697 qla1280_print_scsi_cmd(5, cmd); in qla1280_queuecommand_lck()
741 struct scsi_cmnd *cmd = sp->cmd; in _qla1280_wait_for_single_command() local
747 if(CMD_HANDLE(cmd) == COMPLETED_HANDLE) { in _qla1280_wait_for_single_command()
749 scsi_done(cmd); in _qla1280_wait_for_single_command()
769 struct scsi_cmnd *cmd; in qla1280_wait_for_pending_commands() local
780 cmd = sp->cmd; in qla1280_wait_for_pending_commands()
782 if (bus >= 0 && SCSI_BUS_32(cmd) != bus) in qla1280_wait_for_pending_commands()
784 if (target >= 0 && SCSI_TCN_32(cmd) != target) in qla1280_wait_for_pending_commands()
810 qla1280_error_action(struct scsi_cmnd *cmd, enum action action) in qla1280_error_action() argument
823 ha = (struct scsi_qla_host *)(CMD_HOST(cmd)->hostdata); in qla1280_error_action()
824 sp = scsi_cmd_priv(cmd); in qla1280_error_action()
825 bus = SCSI_BUS_32(cmd); in qla1280_error_action()
826 target = SCSI_TCN_32(cmd); in qla1280_error_action()
827 lun = SCSI_LUN_32(cmd); in qla1280_error_action()
839 ha->host_no, cmd, CMD_HANDLE(cmd), action); in qla1280_error_action()
964 qla1280_eh_abort(struct scsi_cmnd * cmd) in qla1280_eh_abort() argument
968 spin_lock_irq(cmd->device->host->host_lock); in qla1280_eh_abort()
969 rc = qla1280_error_action(cmd, ABORT_COMMAND); in qla1280_eh_abort()
970 spin_unlock_irq(cmd->device->host->host_lock); in qla1280_eh_abort()
980 qla1280_eh_device_reset(struct scsi_cmnd *cmd) in qla1280_eh_device_reset() argument
984 spin_lock_irq(cmd->device->host->host_lock); in qla1280_eh_device_reset()
985 rc = qla1280_error_action(cmd, DEVICE_RESET); in qla1280_eh_device_reset()
986 spin_unlock_irq(cmd->device->host->host_lock); in qla1280_eh_device_reset()
996 qla1280_eh_bus_reset(struct scsi_cmnd *cmd) in qla1280_eh_bus_reset() argument
1000 spin_lock_irq(cmd->device->host->host_lock); in qla1280_eh_bus_reset()
1001 rc = qla1280_error_action(cmd, BUS_RESET); in qla1280_eh_bus_reset()
1002 spin_unlock_irq(cmd->device->host->host_lock); in qla1280_eh_bus_reset()
1012 qla1280_eh_adapter_reset(struct scsi_cmnd *cmd) in qla1280_eh_adapter_reset() argument
1016 spin_lock_irq(cmd->device->host->host_lock); in qla1280_eh_adapter_reset()
1017 rc = qla1280_error_action(cmd, ADAPTER_RESET); in qla1280_eh_adapter_reset()
1018 spin_unlock_irq(cmd->device->host->host_lock); in qla1280_eh_adapter_reset()
1235 struct scsi_cmnd *cmd; in qla1280_done() local
1246 cmd = sp->cmd; in qla1280_done()
1247 bus = SCSI_BUS_32(cmd); in qla1280_done()
1248 target = SCSI_TCN_32(cmd); in qla1280_done()
1250 switch ((CMD_RESULT(cmd) >> 16)) { in qla1280_done()
1265 scsi_dma_unmap(cmd); in qla1280_done()
1271 scsi_done(cmd); in qla1280_done()
2639 bus = SCSI_BUS_32(sp->cmd); in qla1280_abort_command()
2640 target = SCSI_TCN_32(sp->cmd); in qla1280_abort_command()
2641 lun = SCSI_LUN_32(sp->cmd); in qla1280_abort_command()
2736 struct scsi_cmnd *cmd = sp->cmd; in qla1280_64bit_start_scsi() local
2750 seg_cnt = scsi_dma_map(cmd); in qla1280_64bit_start_scsi()
2797 CMD_HANDLE(sp->cmd) = (unsigned char *)(unsigned long)(cnt + 1); in qla1280_64bit_start_scsi()
2799 dprintk(2, "start: cmd=%p sp=%p CDB=%xm, handle %lx\n", cmd, sp, in qla1280_64bit_start_scsi()
2800 cmd->cmnd[0], (long)CMD_HANDLE(sp->cmd)); in qla1280_64bit_start_scsi()
2802 SCSI_BUS_32(cmd), SCSI_TCN_32(cmd), SCSI_LUN_32(cmd)); in qla1280_64bit_start_scsi()
2803 qla1280_dump_buffer(2, cmd->cmnd, MAX_COMMAND_SIZE); in qla1280_64bit_start_scsi()
2820 pkt->timeout = cpu_to_le16(scsi_cmd_to_rq(cmd)->timeout / HZ); in qla1280_64bit_start_scsi()
2823 pkt->lun = SCSI_LUN_32(cmd); in qla1280_64bit_start_scsi()
2824 pkt->target = SCSI_BUS_32(cmd) ? in qla1280_64bit_start_scsi()
2825 (SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd); in qla1280_64bit_start_scsi()
2828 if (cmd->device->simple_tags) in qla1280_64bit_start_scsi()
2832 pkt->cdb_len = cpu_to_le16(CMD_CDBLEN(cmd)); in qla1280_64bit_start_scsi()
2833 memcpy(pkt->scsi_cdb, CMD_CDBP(cmd), CMD_CDBLEN(cmd)); in qla1280_64bit_start_scsi()
2837 dir = qla1280_data_direction(cmd); in qla1280_64bit_start_scsi()
2850 sg = scsi_sglist(cmd); in qla1280_64bit_start_scsi()
2874 SCSI_BUS_32(cmd), SCSI_TCN_32(cmd), in qla1280_64bit_start_scsi()
2875 SCSI_LUN_32(cmd)); in qla1280_64bit_start_scsi()
2931 "%i, l %i \n", SCSI_BUS_32(cmd), in qla1280_64bit_start_scsi()
2932 SCSI_TCN_32(cmd), SCSI_LUN_32(cmd)); in qla1280_64bit_start_scsi()
2939 SCSI_BUS_32(cmd), SCSI_TCN_32(cmd), SCSI_LUN_32(cmd)); in qla1280_64bit_start_scsi()
2990 struct scsi_cmnd *cmd = sp->cmd; in qla1280_32bit_start_scsi() local
3001 dprintk(1, "32bit_start: cmd=%p sp=%p CDB=%x\n", cmd, sp, in qla1280_32bit_start_scsi()
3002 cmd->cmnd[0]); in qla1280_32bit_start_scsi()
3006 seg_cnt = scsi_dma_map(cmd); in qla1280_32bit_start_scsi()
3018 cmd, seg_cnt, req_cnt); in qla1280_32bit_start_scsi()
3056 CMD_HANDLE(sp->cmd) = (unsigned char *) (unsigned long)(cnt + 1); in qla1280_32bit_start_scsi()
3075 pkt->timeout = cpu_to_le16(scsi_cmd_to_rq(cmd)->timeout / HZ); in qla1280_32bit_start_scsi()
3078 pkt->lun = SCSI_LUN_32(cmd); in qla1280_32bit_start_scsi()
3079 pkt->target = SCSI_BUS_32(cmd) ? in qla1280_32bit_start_scsi()
3080 (SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd); in qla1280_32bit_start_scsi()
3083 if (cmd->device->simple_tags) in qla1280_32bit_start_scsi()
3087 pkt->cdb_len = cpu_to_le16(CMD_CDBLEN(cmd)); in qla1280_32bit_start_scsi()
3088 memcpy(pkt->scsi_cdb, CMD_CDBP(cmd), CMD_CDBLEN(cmd)); in qla1280_32bit_start_scsi()
3092 dir = qla1280_data_direction(cmd); in qla1280_32bit_start_scsi()
3105 sg = scsi_sglist(cmd); in qla1280_32bit_start_scsi()
3176 "scsi(%i:%i:%i)\n", SCSI_BUS_32(cmd), in qla1280_32bit_start_scsi()
3177 SCSI_TCN_32(cmd), SCSI_LUN_32(cmd)); in qla1280_32bit_start_scsi()
3403 CMD_RESULT(sp->cmd) = 0; in qla1280_isr()
3404 CMD_HANDLE(sp->cmd) = COMPLETED_HANDLE; in qla1280_isr()
3525 ha->outstanding_cmds[pkt->handle]->cmd, in qla1280_isr()
3596 struct scsi_cmnd *cmd; in qla1280_status_entry() local
3617 cmd = sp->cmd; in qla1280_status_entry()
3628 CMD_RESULT(cmd) = scsi_status & 0xff; in qla1280_status_entry()
3632 CMD_RESULT(cmd) = qla1280_return_status(pkt, cmd); in qla1280_status_entry()
3638 if (req_sense_length < CMD_SNSLEN(cmd)) in qla1280_status_entry()
3646 sense_sz = CMD_SNSLEN(cmd) - 1; in qla1280_status_entry()
3648 memcpy(cmd->sense_buffer, in qla1280_status_entry()
3652 memset(cmd->sense_buffer + sense_sz, 0, in qla1280_status_entry()
3657 "l %i\n", SCSI_BUS_32(cmd), SCSI_TCN_32(cmd), in qla1280_status_entry()
3658 SCSI_LUN_32(cmd)); in qla1280_status_entry()
3661 (char *)cmd->sense_buffer, in qla1280_status_entry()
3666 CMD_HANDLE(sp->cmd) = COMPLETED_HANDLE; in qla1280_status_entry()
3715 CMD_RESULT(sp->cmd) = DID_ERROR << 16; in qla1280_error_entry()
3717 CMD_RESULT(sp->cmd) = DID_BUS_BUSY << 16; in qla1280_error_entry()
3720 CMD_RESULT(sp->cmd) = DID_ERROR << 16; in qla1280_error_entry()
3723 CMD_HANDLE(sp->cmd) = COMPLETED_HANDLE; in qla1280_error_entry()
3772 struct scsi_cmnd *cmd; in qla1280_abort_isp() local
3775 cmd = sp->cmd; in qla1280_abort_isp()
3776 CMD_RESULT(cmd) = DID_RESET << 16; in qla1280_abort_isp()
3777 CMD_HANDLE(cmd) = COMPLETED_HANDLE; in qla1280_abort_isp()
3945 __qla1280_print_scsi_cmd(struct scsi_cmnd *cmd) in __qla1280_print_scsi_cmd() argument
3948 struct Scsi_Host *host = CMD_HOST(cmd); in __qla1280_print_scsi_cmd()
3955 sp = scsi_cmd_priv(cmd); in __qla1280_print_scsi_cmd()
3956 printk("SCSI Command @= 0x%p, Handle=0x%p\n", cmd, CMD_HANDLE(cmd)); in __qla1280_print_scsi_cmd()
3958 SCSI_BUS_32(cmd), SCSI_TCN_32(cmd), SCSI_LUN_32(cmd), in __qla1280_print_scsi_cmd()
3959 CMD_CDBLEN(cmd)); in __qla1280_print_scsi_cmd()
3961 for (i = 0; i < cmd->cmd_len; i++) { in __qla1280_print_scsi_cmd()
3962 printk("0x%02x ", cmd->cmnd[i]); in __qla1280_print_scsi_cmd()
3964 printk(" seg_cnt =%d\n", scsi_sg_count(cmd)); in __qla1280_print_scsi_cmd()
3966 scsi_sglist(cmd), scsi_bufflen(cmd)); in __qla1280_print_scsi_cmd()
3974 scsi_cmd_to_rq(cmd)->tag, cmd->transfersize); in __qla1280_print_scsi_cmd()
3976 cmd->underflow, cmd->sc_data_direction); in __qla1280_print_scsi_cmd()
3996 if ((cp = sp->cmd) == NULL) in ql1280_dump_device()