Lines Matching refs:cmd

365 					 struct scsi_cmnd *cmd);
368 static int ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag);
461 struct scsi_cmnd *cmd;
463 cmd = scb->io_ctx;
466 scsi_dma_unmap(cmd);
521 ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
524 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device);
528 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
532 cmd->scsi_done = scsi_done;
533 cmd->result = CAM_REQ_INPROG << 16;
534 rtn = ahc_linux_run_command(ahc, dev, cmd);
744 ahc_linux_abort(struct scsi_cmnd *cmd)
748 error = ahc_linux_queue_recovery_cmd(cmd, SCB_ABORT);
758 ahc_linux_dev_reset(struct scsi_cmnd *cmd)
762 error = ahc_linux_queue_recovery_cmd(cmd, SCB_DEVICE_RESET);
772 ahc_linux_bus_reset(struct scsi_cmnd *cmd)
778 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
781 found = ahc_reset_channel(ahc, scmd_channel(cmd) + 'A',
820 #define BUILD_SCSIID(ahc, cmd) \
821 ((((cmd)->device->id << TID_SHIFT) & TID) \
822 | (((cmd)->device->channel == 0) ? (ahc)->our_id : (ahc)->our_id_b) \
823 | (((cmd)->device->channel == 0) ? 0 : TWIN_CHNLB))
1427 struct scsi_cmnd *cmd)
1450 if (!blk_rq_tagged(cmd->request)
1454 target_offset = cmd->device->id + cmd->device->channel * 8;
1462 nseg = scsi_dma_map(cmd);
1471 scsi_dma_unmap(cmd);
1475 scb->io_ctx = cmd;
1478 cmd->host_scribble = (char *)scb;
1484 hscb->scsiid = BUILD_SCSIID(ahc, cmd);
1485 hscb->lun = cmd->device->lun;
1507 msg_bytes = scsi_populate_tag_msg(cmd, tag_msgs);
1521 hscb->cdb_len = cmd->cmd_len;
1523 memcpy(hscb->shared_data.cdb, cmd->cmnd, hscb->cdb_len);
1525 memcpy(hscb->cdb32, cmd->cmnd, hscb->cdb_len);
1545 scsi_for_each_sg(cmd, cur_seg, nseg, i) {
1707 struct scsi_cmnd *cmd;
1729 cmd = scb->io_ctx;
1733 if ((cmd->result & (CAM_DEV_QFRZN << 16)) != 0) {
1734 cmd->result &= ~(CAM_DEV_QFRZN << 16);
1745 cmd->sense_buffer[0] = 0;
1788 ahc_linux_handle_scsi_status(ahc, cmd->device, scb);
1821 ahc_linux_queue_cmd_complete(ahc, cmd);
1853 struct scsi_cmnd *cmd;
1856 * Copy sense information to the OS's cmd
1859 cmd = scb->io_ctx;
1866 memcpy(cmd->sense_buffer,
1869 memset(&cmd->sense_buffer[sense_size], 0,
1871 cmd->result |= (DRIVER_SENSE << 24);
1881 printk("0x%x ", cmd->sense_buffer[i]);
1954 ahc_linux_queue_cmd_complete(struct ahc_softc *ahc, struct scsi_cmnd *cmd)
1965 switch (ahc_cmd_get_transaction_status(cmd)) {
2017 ahc_cmd_set_transaction_status(cmd, new_status);
2020 cmd->scsi_done(cmd);
2065 ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2085 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
2087 scmd_printk(KERN_INFO, cmd, "Attempting to queue a%s message\n",
2091 for (cdb_byte = 0; cdb_byte < cmd->cmd_len; cdb_byte++)
2092 printk(" 0x%x", cmd->cmnd[cdb_byte]);
2104 dev = scsi_transport_device_data(cmd->device);
2112 ahc_name(ahc), cmd->device->channel, cmd->device->id,
2113 (u8)cmd->device->lun);
2119 && ahc_search_untagged_queues(ahc, cmd, cmd->device->id,
2120 cmd->device->channel + 'A',
2121 (u8)cmd->device->lun,
2124 ahc_name(ahc), cmd->device->channel, cmd->device->id,
2125 (u8)cmd->device->lun);
2131 * See if we can find a matching cmd in the pending list.
2134 if (pending_scb->io_ctx == cmd)
2142 if (ahc_match_scb(ahc, pending_scb, scmd_id(cmd),
2143 scmd_channel(cmd) + 'A',
2151 scmd_printk(KERN_INFO, cmd, "Command not found\n");
2166 * an interrupt that would affect this cmd.
2173 scmd_printk(KERN_INFO, cmd, "Command already completed\n");
2183 if (ahc_search_qinfifo(ahc, cmd->device->id,
2184 cmd->device->channel + 'A',
2185 cmd->device->lun,
2190 ahc_name(ahc), cmd->device->channel,
2191 cmd->device->id, (u8)cmd->device->lun);
2195 } else if (ahc_search_qinfifo(ahc, cmd->device->id,
2196 cmd->device->channel + 'A',
2197 cmd->device->lun,
2231 && SCSIID_TARGET(ahc, saved_scsiid) == scmd_id(cmd)))) {
2241 scmd_printk(KERN_INFO, cmd, "Device is active, asserting ATN\n");
2271 ahc_search_disc_list(ahc, cmd->device->id,
2272 cmd->device->channel + 'A',
2273 cmd->device->lun, pending_scb->hscb->tag,
2296 ahc_search_qinfifo(ahc, cmd->device->id,
2297 cmd->device->channel + 'A',
2298 cmd->device->lun, SCB_LIST_NULL,
2307 scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n");