Lines Matching refs:cmd

366 					 struct scsi_cmnd *cmd);
369 static int ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag);
462 struct scsi_cmnd *cmd; in ahc_linux_unmap_scb() local
464 cmd = scb->io_ctx; in ahc_linux_unmap_scb()
467 scsi_dma_unmap(cmd); in ahc_linux_unmap_scb()
521 static int ahc_linux_queue_lck(struct scsi_cmnd *cmd) in ahc_linux_queue_lck() argument
524 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); in ahc_linux_queue_lck()
528 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; in ahc_linux_queue_lck()
532 cmd->result = CAM_REQ_INPROG << 16; in ahc_linux_queue_lck()
533 rtn = ahc_linux_run_command(ahc, dev, cmd); in ahc_linux_queue_lck()
727 ahc_linux_abort(struct scsi_cmnd *cmd) in ahc_linux_abort() argument
731 error = ahc_linux_queue_recovery_cmd(cmd, SCB_ABORT); in ahc_linux_abort()
741 ahc_linux_dev_reset(struct scsi_cmnd *cmd) in ahc_linux_dev_reset() argument
745 error = ahc_linux_queue_recovery_cmd(cmd, SCB_DEVICE_RESET); in ahc_linux_dev_reset()
755 ahc_linux_bus_reset(struct scsi_cmnd *cmd) in ahc_linux_bus_reset() argument
761 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; in ahc_linux_bus_reset()
764 found = ahc_reset_channel(ahc, scmd_channel(cmd) + 'A', in ahc_linux_bus_reset()
802 #define BUILD_SCSIID(ahc, cmd) \ argument
803 ((((cmd)->device->id << TID_SHIFT) & TID) \
804 | (((cmd)->device->channel == 0) ? (ahc)->our_id : (ahc)->our_id_b) \
805 | (((cmd)->device->channel == 0) ? 0 : TWIN_CHNLB))
1403 struct scsi_cmnd *cmd) in ahc_linux_run_command() argument
1426 if (!(cmd->flags & SCMD_TAGGED) in ahc_linux_run_command()
1430 target_offset = cmd->device->id + cmd->device->channel * 8; in ahc_linux_run_command()
1438 nseg = scsi_dma_map(cmd); in ahc_linux_run_command()
1447 scsi_dma_unmap(cmd); in ahc_linux_run_command()
1451 scb->io_ctx = cmd; in ahc_linux_run_command()
1454 cmd->host_scribble = (char *)scb; in ahc_linux_run_command()
1460 hscb->scsiid = BUILD_SCSIID(ahc, cmd); in ahc_linux_run_command()
1461 hscb->lun = cmd->device->lun; in ahc_linux_run_command()
1489 hscb->cdb_len = cmd->cmd_len; in ahc_linux_run_command()
1491 memcpy(hscb->shared_data.cdb, cmd->cmnd, hscb->cdb_len); in ahc_linux_run_command()
1493 memcpy(hscb->cdb32, cmd->cmnd, hscb->cdb_len); in ahc_linux_run_command()
1513 scsi_for_each_sg(cmd, cur_seg, nseg, i) { in ahc_linux_run_command()
1673 struct scsi_cmnd *cmd; in ahc_done() local
1695 cmd = scb->io_ctx; in ahc_done()
1699 if ((cmd->result & (CAM_DEV_QFRZN << 16)) != 0) { in ahc_done()
1700 cmd->result &= ~(CAM_DEV_QFRZN << 16); in ahc_done()
1711 cmd->sense_buffer[0] = 0; in ahc_done()
1756 ahc_linux_handle_scsi_status(ahc, cmd->device, scb); in ahc_done()
1789 ahc_linux_queue_cmd_complete(ahc, cmd); in ahc_done()
1821 struct scsi_cmnd *cmd; in ahc_linux_handle_scsi_status() local
1827 cmd = scb->io_ctx; in ahc_linux_handle_scsi_status()
1834 memcpy(cmd->sense_buffer, in ahc_linux_handle_scsi_status()
1837 memset(&cmd->sense_buffer[sense_size], 0, in ahc_linux_handle_scsi_status()
1848 printk("0x%x ", cmd->sense_buffer[i]); in ahc_linux_handle_scsi_status()
1921 ahc_linux_queue_cmd_complete(struct ahc_softc *ahc, struct scsi_cmnd *cmd) in ahc_linux_queue_cmd_complete() argument
1932 switch (ahc_cmd_get_transaction_status(cmd)) { in ahc_linux_queue_cmd_complete()
1984 ahc_cmd_set_transaction_status(cmd, new_status); in ahc_linux_queue_cmd_complete()
1987 scsi_done(cmd); in ahc_linux_queue_cmd_complete()
2032 ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) in ahc_linux_queue_recovery_cmd() argument
2052 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; in ahc_linux_queue_recovery_cmd()
2054 scmd_printk(KERN_INFO, cmd, "Attempting to queue a%s message\n", in ahc_linux_queue_recovery_cmd()
2058 for (cdb_byte = 0; cdb_byte < cmd->cmd_len; cdb_byte++) in ahc_linux_queue_recovery_cmd()
2059 printk(" 0x%x", cmd->cmnd[cdb_byte]); in ahc_linux_queue_recovery_cmd()
2071 dev = scsi_transport_device_data(cmd->device); in ahc_linux_queue_recovery_cmd()
2079 ahc_name(ahc), cmd->device->channel, cmd->device->id, in ahc_linux_queue_recovery_cmd()
2080 (u8)cmd->device->lun); in ahc_linux_queue_recovery_cmd()
2086 && ahc_search_untagged_queues(ahc, cmd, cmd->device->id, in ahc_linux_queue_recovery_cmd()
2087 cmd->device->channel + 'A', in ahc_linux_queue_recovery_cmd()
2088 (u8)cmd->device->lun, in ahc_linux_queue_recovery_cmd()
2091 ahc_name(ahc), cmd->device->channel, cmd->device->id, in ahc_linux_queue_recovery_cmd()
2092 (u8)cmd->device->lun); in ahc_linux_queue_recovery_cmd()
2101 if (pending_scb->io_ctx == cmd) in ahc_linux_queue_recovery_cmd()
2109 if (ahc_match_scb(ahc, pending_scb, scmd_id(cmd), in ahc_linux_queue_recovery_cmd()
2110 scmd_channel(cmd) + 'A', in ahc_linux_queue_recovery_cmd()
2118 scmd_printk(KERN_INFO, cmd, "Command not found\n"); in ahc_linux_queue_recovery_cmd()
2140 scmd_printk(KERN_INFO, cmd, "Command already completed\n"); in ahc_linux_queue_recovery_cmd()
2150 if (ahc_search_qinfifo(ahc, cmd->device->id, in ahc_linux_queue_recovery_cmd()
2151 cmd->device->channel + 'A', in ahc_linux_queue_recovery_cmd()
2152 cmd->device->lun, in ahc_linux_queue_recovery_cmd()
2157 ahc_name(ahc), cmd->device->channel, in ahc_linux_queue_recovery_cmd()
2158 cmd->device->id, (u8)cmd->device->lun); in ahc_linux_queue_recovery_cmd()
2162 } else if (ahc_search_qinfifo(ahc, cmd->device->id, in ahc_linux_queue_recovery_cmd()
2163 cmd->device->channel + 'A', in ahc_linux_queue_recovery_cmd()
2164 cmd->device->lun, in ahc_linux_queue_recovery_cmd()
2198 && SCSIID_TARGET(ahc, saved_scsiid) == scmd_id(cmd)))) { in ahc_linux_queue_recovery_cmd()
2208 scmd_printk(KERN_INFO, cmd, "Device is active, asserting ATN\n"); in ahc_linux_queue_recovery_cmd()
2238 ahc_search_disc_list(ahc, cmd->device->id, in ahc_linux_queue_recovery_cmd()
2239 cmd->device->channel + 'A', in ahc_linux_queue_recovery_cmd()
2240 cmd->device->lun, pending_scb->hscb->tag, in ahc_linux_queue_recovery_cmd()
2263 ahc_search_qinfifo(ahc, cmd->device->id, in ahc_linux_queue_recovery_cmd()
2264 cmd->device->channel + 'A', in ahc_linux_queue_recovery_cmd()
2265 cmd->device->lun, SCB_LIST_NULL, in ahc_linux_queue_recovery_cmd()
2274 scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n"); in ahc_linux_queue_recovery_cmd()