/linux-4.4.14/drivers/scsi/arm/ |
H A D | scsi.h | 82 static inline void init_SCp(struct scsi_cmnd *SCpnt) init_SCp() argument 84 memset(&SCpnt->SCp, 0, sizeof(struct scsi_pointer)); init_SCp() 86 if (scsi_bufflen(SCpnt)) { init_SCp() 89 SCpnt->SCp.buffer = scsi_sglist(SCpnt); init_SCp() 90 SCpnt->SCp.buffers_residual = scsi_sg_count(SCpnt) - 1; init_SCp() 91 SCpnt->SCp.ptr = sg_virt(SCpnt->SCp.buffer); init_SCp() 92 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; init_SCp() 93 SCpnt->SCp.phase = scsi_bufflen(SCpnt); init_SCp() 101 unsigned i, sg_count = scsi_sg_count(SCpnt); init_SCp() 103 scsi_for_each_sg(SCpnt, sg, sg_count, i) init_SCp() 106 if (scsi_bufflen(SCpnt) != len) { init_SCp() 110 SCpnt->device->host->host_no, init_SCp() 111 '0' + SCpnt->device->id, init_SCp() 112 scsi_bufflen(SCpnt), len); init_SCp() 117 SCpnt->SCp.phase = init_SCp() 119 scsi_bufflen(SCpnt)); init_SCp() 124 SCpnt->SCp.ptr = NULL; init_SCp() 125 SCpnt->SCp.this_residual = 0; init_SCp() 126 SCpnt->SCp.phase = 0; init_SCp()
|
H A D | queue.c | 32 struct scsi_cmnd *SCpnt; member in struct:queue_entry 68 * If life was easier, then SCpnt would have a queue_initialise() 77 q->SCpnt = NULL; queue_initialise() 99 * Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head) 102 * SCpnt - command to add 106 int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head) __queue_add() argument 124 q->SCpnt = SCpnt; __queue_add() 151 return q->SCpnt; __queue_remove() 165 struct scsi_cmnd *SCpnt = NULL; queue_remove_exclude() local 170 if (!test_bit(q->SCpnt->device->id * 8 + queue_remove_exclude() 171 (u8)(q->SCpnt->device->lun & 0x7), exclude)) { queue_remove_exclude() 172 SCpnt = __queue_remove(queue, l); queue_remove_exclude() 178 return SCpnt; queue_remove_exclude() 190 struct scsi_cmnd *SCpnt = NULL; queue_remove() local 194 SCpnt = __queue_remove(queue, queue->head.next); queue_remove() 197 return SCpnt; queue_remove() 214 struct scsi_cmnd *SCpnt = NULL; queue_remove_tgtluntag() local 219 if (q->SCpnt->device->id == target && q->SCpnt->device->lun == lun && queue_remove_tgtluntag() 220 q->SCpnt->tag == tag) { queue_remove_tgtluntag() 221 SCpnt = __queue_remove(queue, l); queue_remove_tgtluntag() 227 return SCpnt; queue_remove_tgtluntag() 245 if (q->SCpnt->device->id == target) queue_remove_all_target() 269 if (q->SCpnt->device->id == target && q->SCpnt->device->lun == lun) { queue_probetgtlun() 280 * Function: int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt) 283 * SCpnt - command to find 286 int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt) queue_remove_cmd() argument 295 if (q->SCpnt == SCpnt) { queue_remove_cmd()
|
H A D | queue.h | 52 #define queue_add_cmd_ordered(queue,SCpnt) \ 53 __queue_add(queue,SCpnt,(SCpnt)->cmnd[0] == REQUEST_SENSE) 54 #define queue_add_cmd_tail(queue,SCpnt) \ 55 __queue_add(queue,SCpnt,0) 57 * Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head) 60 * SCpnt - command to add 64 extern int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head); 99 * Function: int queue_remove_cmd (Queue_t *queue, struct scsi_cmnd *SCpnt) 102 * SCpnt - command to find 105 int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt);
|
H A D | acornscsi.c | 384 host->SCpnt = NULL; acornscsi_resetcard() 562 if (host->SCpnt) acornscsi_target() 563 return '0' + host->SCpnt->device->id; acornscsi_target() 700 struct scsi_cmnd *SCpnt; acornscsi_kick() local 703 SCpnt = host->origSCpnt; acornscsi_kick() 707 if (!SCpnt) { acornscsi_kick() 708 SCpnt = queue_remove_exclude(&host->queues.issue, host->busyluns); acornscsi_kick() 709 if (!SCpnt) acornscsi_kick() 715 if (host->scsi.disconnectable && host->SCpnt) { acornscsi_kick() 716 queue_add_cmd_tail(&host->queues.disconnected, host->SCpnt); acornscsi_kick() 719 DBG(host->SCpnt, printk("scsi%d.%c: moved command to disconnected queue\n", acornscsi_kick() 722 host->SCpnt = NULL; acornscsi_kick() 730 sbic_arm_write(host, SBIC_DESTID, SCpnt->device->id); acornscsi_kick() 739 host->SCpnt = SCpnt; acornscsi_kick() 740 host->scsi.SCp = SCpnt->SCp; acornscsi_kick() 746 DBG(SCpnt,printk("scsi%d.%c: starting cmd %02X\n", acornscsi_kick() 747 host->host->host_no, '0' + SCpnt->device->id, acornscsi_kick() 748 SCpnt->cmnd[0])); acornscsi_kick() 756 if (SCpnt->device->simple_tags) { acornscsi_kick() 757 SCpnt->device->current_tag += 1; acornscsi_kick() 758 if (SCpnt->device->current_tag == 0) acornscsi_kick() 759 SCpnt->device->current_tag = 1; acornscsi_kick() 760 SCpnt->tag = SCpnt->device->current_tag; acornscsi_kick() 763 set_bit(SCpnt->device->id * 8 + acornscsi_kick() 764 (u8)(SCpnt->device->lun & 0x07), host->busyluns); acornscsi_kick() 768 switch (acornscsi_cmdtype(SCpnt->cmnd[0])) { acornscsi_kick() 793 struct scsi_cmnd *SCpnt = *SCpntp; acornscsi_done() local 800 if (SCpnt) { acornscsi_done() 805 SCpnt->result = result << 16 | host->scsi.SCp.Message << 8 | host->scsi.SCp.Status; acornscsi_done() 811 * data loss will occur. Should we check SCpnt->underflow here? acornscsi_done() 818 if (SCpnt->underflow == 0) { acornscsi_done() 820 acornscsi_cmdtype(SCpnt->cmnd[0]) != CMD_MISC) acornscsi_done() 823 if (host->scsi.SCp.scsi_xferred < SCpnt->underflow || acornscsi_done() 844 switch (status_byte(SCpnt->result)) { acornscsi_done() 853 scmd_printk(KERN_ERR, SCpnt, acornscsi_done() 855 "result=%08X", SCpnt->result); acornscsi_done() 856 scsi_print_command(SCpnt); acornscsi_done() 858 acornscsi_dumplog(host, SCpnt->device->id); acornscsi_done() 859 set_host_byte(SCpnt, DID_ERROR); acornscsi_done() 864 if (!SCpnt->scsi_done) acornscsi_done() 867 clear_bit(SCpnt->device->id * 8 + acornscsi_done() 868 (u8)(SCpnt->device->lun & 0x7), host->busyluns); acornscsi_done() 870 SCpnt->scsi_done(SCpnt); acornscsi_done() 1002 DBG(host->SCpnt, acornscsi_dumpdma(host, "stop")); acornscsi_dma_stop() 1025 if (NO_WRITE & (1 << host->SCpnt->device->id)) { acornscsi_dma_setup() 1061 DBG(host->SCpnt, acornscsi_dumpdma(host, "strt")); acornscsi_dma_setup() 1100 DBG(host->SCpnt, acornscsi_dumpdma(host, "cupi")); acornscsi_dma_cleanup() 1118 DBG(host->SCpnt, acornscsi_dumpdma(host, "cupo")); acornscsi_dma_cleanup() 1139 DBG(host->SCpnt, acornscsi_dumpdma(host, "inti")); acornscsi_dma_intr() 1188 DBG(host->SCpnt, acornscsi_dumpdma(host, "into")); acornscsi_dma_intr() 1200 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_dma_intr() 1240 DBG(host->SCpnt, acornscsi_dumpdma(host, "adji")); acornscsi_dma_adjust() 1265 DBG(host->SCpnt, acornscsi_dumpdma(host, "adjo")); acornscsi_dma_adjust() 1308 struct scsi_cmnd *SCpnt = host->SCpnt; acornscsi_sendcommand() local 1312 sbic_arm_writenext(host, SCpnt->cmd_len - host->scsi.SCp.sent_command); acornscsi_sendcommand() 1316 if (acornscsi_write_pio(host, SCpnt->cmnd, acornscsi_sendcommand() 1317 (int *)&host->scsi.SCp.sent_command, SCpnt->cmd_len, 1000000)) acornscsi_sendcommand() 1501 acornscsi_dumplog(host, host->SCpnt->device->id); acornscsi_message() 1515 host->SCpnt->SCp = host->scsi.SCp; acornscsi_message() 1516 host->SCpnt->SCp.sent_command = 0; acornscsi_message() 1531 host->scsi.SCp = host->SCpnt->SCp; acornscsi_message() 1557 if (host->device[host->SCpnt->device->id].sync_state == SYNC_SENT_REQUEST) acornscsi_message() 1558 host->device[host->SCpnt->device->id].sync_state = SYNC_NEGOCIATE; acornscsi_message() 1580 host->SCpnt->device->simple_tags = 0; acornscsi_message() 1581 set_bit(host->SCpnt->device->id * 8 + acornscsi_message() 1582 (u8)(host->SCpnt->device->lun & 0x7), host->busyluns); acornscsi_message() 1591 host->device[host->SCpnt->device->id].sync_xfer = SYNCHTRANSFER_2DBA; acornscsi_message() 1592 host->device[host->SCpnt->device->id].sync_state = SYNC_ASYNCHRONOUS; acornscsi_message() 1593 sbic_arm_write(host, SBIC_SYNCHTRANSFER, host->device[host->SCpnt->device->id].sync_xfer); acornscsi_message() 1616 if (host->device[host->SCpnt->device->id].sync_state == SYNC_SENT_REQUEST) { acornscsi_message() 1623 host->device[host->SCpnt->device->id].sync_state = SYNC_COMPLETED; acornscsi_message() 1627 host->device[host->SCpnt->device->id].sync_xfer = acornscsi_message() 1640 host->device[host->SCpnt->device->id].sync_xfer = acornscsi_message() 1643 sbic_arm_write(host, SBIC_SYNCHTRANSFER, host->device[host->SCpnt->device->id].sync_xfer); acornscsi_message() 1693 IDENTIFY(host->device[host->SCpnt->device->id].disconnect_ok, acornscsi_buildmessages() 1694 host->SCpnt->device->lun)); acornscsi_buildmessages() 1699 acornscsi_abortcmd(host->SCpnt->tag); acornscsi_buildmessages() 1705 if (host->SCpnt->tag) { acornscsi_buildmessages() 1708 if (host->SCpnt->cmnd[0] == REQUEST_SENSE || acornscsi_buildmessages() 1709 host->SCpnt->cmnd[0] == TEST_UNIT_READY || acornscsi_buildmessages() 1710 host->SCpnt->cmnd[0] == INQUIRY) acornscsi_buildmessages() 1714 msgqueue_addmsg(&host->scsi.msgs, 2, tag_type, host->SCpnt->tag); acornscsi_buildmessages() 1719 if (host->device[host->SCpnt->device->id].sync_state == SYNC_NEGOCIATE) { acornscsi_buildmessages() 1720 host->device[host->SCpnt->device->id].sync_state = SYNC_SENT_REQUEST; acornscsi_buildmessages() 1745 residual = scsi_bufflen(host->SCpnt) - host->scsi.SCp.scsi_xferred; acornscsi_starttransfer() 1747 sbic_arm_write(host, SBIC_SYNCHTRANSFER, host->device[host->SCpnt->device->id].sync_xfer); acornscsi_starttransfer() 1780 if (host->SCpnt && !host->scsi.disconnectable) { acornscsi_reconnect() 1783 host->host->host_no, target, host->SCpnt->device->id); acornscsi_reconnect() 1784 host->SCpnt = NULL; acornscsi_reconnect() 1793 if (host->scsi.disconnectable && host->SCpnt && acornscsi_reconnect() 1794 host->SCpnt->device->id == target && host->SCpnt->device->lun == lun) acornscsi_reconnect() 1811 if (host->SCpnt) { acornscsi_reconnect() 1812 queue_add_cmd_tail(&host->queues.disconnected, host->SCpnt); acornscsi_reconnect() 1813 host->SCpnt = NULL; acornscsi_reconnect() 1829 if (host->scsi.disconnectable && host->SCpnt) { acornscsi_reconnect_finish() 1831 if (host->SCpnt->device->id == host->scsi.reconnected.target && acornscsi_reconnect_finish() 1832 host->SCpnt->device->lun == host->scsi.reconnected.lun && acornscsi_reconnect_finish() 1833 host->SCpnt->tag == host->scsi.reconnected.tag) { acornscsi_reconnect_finish() 1835 DBG(host->SCpnt, printk("scsi%d.%c: reconnected", acornscsi_reconnect_finish() 1839 queue_add_cmd_tail(&host->queues.disconnected, host->SCpnt); acornscsi_reconnect_finish() 1841 DBG(host->SCpnt, printk("scsi%d.%c: had to move command " acornscsi_reconnect_finish() 1845 host->SCpnt = NULL; acornscsi_reconnect_finish() 1848 if (!host->SCpnt) { acornscsi_reconnect_finish() 1849 host->SCpnt = queue_remove_tgtluntag(&host->queues.disconnected, acornscsi_reconnect_finish() 1854 DBG(host->SCpnt, printk("scsi%d.%c: had to get command", acornscsi_reconnect_finish() 1859 if (!host->SCpnt) acornscsi_reconnect_finish() 1865 host->scsi.SCp = host->SCpnt->SCp; acornscsi_reconnect_finish() 1877 return host->SCpnt != NULL; acornscsi_reconnect_finish() 1894 acornscsi_done(host, &host->SCpnt, DID_ERROR); acornscsi_disconnect_unexpected() 1946 if (host->SCpnt && !host->scsi.disconnectable) acornscsi_sbicintr() 1947 ADD_STATUS(host->SCpnt->device->id, ssr, host->scsi.phase, in_irq); acornscsi_sbicintr() 1985 ADD_STATUS(host->SCpnt->device->id, ssr, host->scsi.phase, 1); acornscsi_sbicintr() 1990 acornscsi_done(host, &host->SCpnt, DID_NO_CONNECT); acornscsi_sbicintr() 1995 host->origSCpnt = host->SCpnt; acornscsi_sbicintr() 1996 host->SCpnt = NULL; acornscsi_sbicintr() 2004 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2005 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_sbicintr() 2034 acornscsi_done(host, &host->SCpnt, DID_ERROR); acornscsi_sbicintr() 2040 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2041 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_sbicintr() 2078 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2086 if (host->scsi.SCp.sent_command != host->SCpnt->cmd_len) acornscsi_sbicintr() 2087 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_sbicintr() 2090 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_sbicintr() 2096 if (host->scsi.SCp.sent_command != host->SCpnt->cmd_len) acornscsi_sbicintr() 2097 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_sbicintr() 2100 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_sbicintr() 2123 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2136 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2146 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2161 ADD_STATUS(host->SCpnt->device->id, ssr, host->scsi.phase, in_irq); acornscsi_sbicintr() 2168 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_sbicintr() 2177 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_sbicintr() 2206 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2218 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_sbicintr() 2225 host->scsi.SCp.scsi_xferred = scsi_bufflen(host->SCpnt) - acornscsi_sbicintr() 2236 host->scsi.SCp.scsi_xferred = scsi_bufflen(host->SCpnt) - acornscsi_sbicintr() 2246 host->scsi.SCp.scsi_xferred = scsi_bufflen(host->SCpnt) - acornscsi_sbicintr() 2255 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2267 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_sbicintr() 2274 host->scsi.SCp.scsi_xferred = scsi_bufflen(host->SCpnt) - acornscsi_sbicintr() 2286 host->scsi.SCp.scsi_xferred = scsi_bufflen(host->SCpnt) - acornscsi_sbicintr() 2297 host->scsi.SCp.scsi_xferred = scsi_bufflen(host->SCpnt) - acornscsi_sbicintr() 2307 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2328 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2351 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2352 acornscsi_done(host, &host->SCpnt, DID_ERROR); acornscsi_sbicintr() 2358 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2365 acornscsi_done(host, &host->SCpnt, DID_OK); acornscsi_sbicintr() 2376 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2383 if (host->SCpnt) acornscsi_sbicintr() 2384 acornscsi_done(host, &host->SCpnt, DID_ABORT); acornscsi_sbicintr() 2402 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2409 acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8); acornscsi_sbicintr() 2469 static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, acornscsi_queuecmd_lck() argument 2472 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; acornscsi_queuecmd_lck() 2477 host->host->host_no, SCpnt); acornscsi_queuecmd_lck() 2482 if (acornscsi_cmdtype(SCpnt->cmnd[0]) == CMD_WRITE && (NO_WRITE & (1 << SCpnt->device->id))) { acornscsi_queuecmd_lck() 2484 host->host->host_no, '0' + SCpnt->device->id); acornscsi_queuecmd_lck() 2485 SCpnt->result = DID_NO_CONNECT << 16; acornscsi_queuecmd_lck() 2486 done(SCpnt); acornscsi_queuecmd_lck() 2491 SCpnt->scsi_done = done; acornscsi_queuecmd_lck() 2492 SCpnt->host_scribble = NULL; acornscsi_queuecmd_lck() 2493 SCpnt->result = 0; acornscsi_queuecmd_lck() 2494 SCpnt->tag = 0; acornscsi_queuecmd_lck() 2495 SCpnt->SCp.phase = (int)acornscsi_datadirection(SCpnt->cmnd[0]); acornscsi_queuecmd_lck() 2496 SCpnt->SCp.sent_command = 0; acornscsi_queuecmd_lck() 2497 SCpnt->SCp.scsi_xferred = 0; acornscsi_queuecmd_lck() 2499 init_SCp(SCpnt); acornscsi_queuecmd_lck() 2506 if (!queue_add_cmd_ordered(&host->queues.issue, SCpnt)) { acornscsi_queuecmd_lck() 2507 SCpnt->result = DID_ERROR << 16; acornscsi_queuecmd_lck() 2508 done(SCpnt); acornscsi_queuecmd_lck() 2533 struct scsi_cmnd *SCpnt = *SCpntp1; acornscsi_reportstatus() local 2535 if (SCpnt) { acornscsi_reportstatus() 2538 SCpnt->result = result; acornscsi_reportstatus() 2539 SCpnt->scsi_done(SCpnt); acornscsi_reportstatus() 2542 if (SCpnt == *SCpntp2) acornscsi_reportstatus() 2549 * Prototype: enum res acornscsi_do_abort(struct scsi_cmnd *SCpnt) 2551 * Params : SCpnt - command to abort 2554 static enum res_abort acornscsi_do_abort(AS_Host *host, struct scsi_cmnd *SCpnt) acornscsi_do_abort() argument 2558 if (queue_remove_cmd(&host->queues.issue, SCpnt)) { acornscsi_do_abort() 2569 } else if (queue_remove_cmd(&host->queues.disconnected, SCpnt)) { acornscsi_do_abort() 2581 } else if (host->SCpnt == SCpnt) { acornscsi_do_abort() 2601 host->SCpnt = NULL; acornscsi_do_abort() 2613 host->SCpnt = NULL; acornscsi_do_abort() 2618 acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_do_abort() 2622 } else if (host->origSCpnt == SCpnt) { acornscsi_do_abort() 2641 * Prototype: int acornscsi_abort(struct scsi_cmnd *SCpnt) 2643 * Params : SCpnt - command to abort 2646 int acornscsi_abort(struct scsi_cmnd *SCpnt) acornscsi_abort() argument 2648 AS_Host *host = (AS_Host *) SCpnt->device->host->hostdata; acornscsi_abort() 2661 acornscsi_dumplog(host, SCpnt->device->id); acornscsi_abort() 2667 switch (acornscsi_do_abort(host, SCpnt)) { acornscsi_abort() 2677 clear_bit(SCpnt->device->id * 8 + acornscsi_abort() 2678 (u8)(SCpnt->device->lun & 0x7), host->busyluns); acornscsi_abort() 2710 acornscsi_dumplog(host, SCpnt->device->id); acornscsi_abort() 2722 * Prototype: int acornscsi_reset(struct scsi_cmnd *SCpnt) 2724 * Params : SCpnt - command causing reset 2727 int acornscsi_bus_reset(struct scsi_cmnd *SCpnt) acornscsi_bus_reset() argument 2729 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; acornscsi_bus_reset() 2743 acornscsi_dumplog(host, SCpnt->device->id); acornscsi_bus_reset()
|
H A D | fas216.c | 192 printk(" { magic_start=%lX host=%p SCpnt=%p origSCpnt=%p\n", fas216_dumpinfo() 193 info->magic_start, info->host, info->SCpnt, fas216_dumpinfo() 284 if (info->SCpnt) fas216_target() 285 return '0' + info->SCpnt->device->id; fas216_target() 300 struct scsi_cmnd *SCpnt, char *fmt, ...) fas216_log_command() 308 fas216_do_log(info, '0' + SCpnt->device->id, fmt, args); fas216_log_command() 311 scsi_print_command(SCpnt); fas216_log_command() 516 struct fas216_device *dev = &info->device[info->SCpnt->device->id]; fas216_handlesync() 599 fas216_set_sync(info, info->SCpnt->device->id); fas216_handlesync() 612 fas216_set_sync(info, info->SCpnt->device->id); fas216_handlesync() 647 info->host->host_no, '0' + info->SCpnt->device->id); fas216_updateptrs() 761 print_SCp(&info->SCpnt->SCp, "Cmnd SCp: ", "\n"); fas216_transfer() 770 if (info->device[info->SCpnt->device->id].sof) fas216_transfer() 803 direction, info->SCpnt->transfersize); fas216_transfer() 988 if (info->scsi.disconnectable && info->SCpnt) { fas216_reselected_intr() 990 if (info->SCpnt->device->id == target && fas216_reselected_intr() 991 info->SCpnt->device->lun == lun && fas216_reselected_intr() 992 info->SCpnt->tag == tag) { fas216_reselected_intr() 995 queue_add_cmd_tail(&info->queues.disconnected, info->SCpnt); fas216_reselected_intr() 997 info->SCpnt = NULL; fas216_reselected_intr() 1000 if (!info->SCpnt) { fas216_reselected_intr() 1001 info->SCpnt = queue_remove_tgtluntag(&info->queues.disconnected, fas216_reselected_intr() 1006 if (info->SCpnt) { fas216_reselected_intr() 1010 info->scsi.SCp = info->SCpnt->SCp; fas216_reselected_intr() 1077 info->SCpnt->SCp = info->scsi.SCp; fas216_parse_message() 1078 info->SCpnt->SCp.sent_command = 0; fas216_parse_message() 1091 info->scsi.SCp = info->SCpnt->SCp; fas216_parse_message() 1296 for (i = info->scsi.SCp.sent_command; i < info->SCpnt->cmd_len; i++) fas216_send_command() 1297 fas216_writeb(info, REG_FF, info->SCpnt->cmnd[i]); fas216_send_command() 1465 if (info->device[info->SCpnt->device->id].parity_check) { STATE() 1470 info->device[info->SCpnt->device->id].parity_check = 0; STATE() 1471 info->device[info->SCpnt->device->id].parity_enabled = 1; STATE() 1602 info->SCpnt = NULL; /* bug! */ fas216_bus_reset() 1663 static void __fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt) __fas216_start_command() argument 1675 fas216_writeb(info, REG_SDID, BUSID(SCpnt->device->id)); __fas216_start_command() 1679 fas216_set_sync(info, SCpnt->device->id); __fas216_start_command() 1689 info->host->host_no, '0' + SCpnt->device->id); __fas216_start_command() 1717 for (i = 0; i < SCpnt->cmd_len; i++) __fas216_start_command() 1718 fas216_writeb(info, REG_FF, SCpnt->cmnd[i]); __fas216_start_command() 1755 static void fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt) fas216_start_command() argument 1763 info->scsi.SCp = SCpnt->SCp; fas216_start_command() 1764 info->SCpnt = SCpnt; fas216_start_command() 1767 if (parity_test(info, SCpnt->device->id)) fas216_start_command() 1775 disconnect_ok = SCpnt->cmnd[0] != REQUEST_SENSE && fas216_start_command() 1776 info->device[SCpnt->device->id].disconnect_ok; fas216_start_command() 1782 msgqueue_addmsg(&info->scsi.msgs, 1, IDENTIFY(disconnect_ok, SCpnt->device->lun)); fas216_start_command() 1787 if (SCpnt->tag) fas216_start_command() 1788 msgqueue_addmsg(&info->scsi.msgs, 2, SIMPLE_QUEUE_TAG, SCpnt->tag); fas216_start_command() 1792 if ((info->device[SCpnt->device->id].sync_state == neg_wait || fas216_start_command() 1793 info->device[SCpnt->device->id].sync_state == neg_complete) && fas216_start_command() 1794 (SCpnt->cmnd[0] == REQUEST_SENSE || fas216_start_command() 1795 SCpnt->cmnd[0] == INQUIRY)) { fas216_start_command() 1796 info->device[SCpnt->device->id].sync_state = neg_inprogress; fas216_start_command() 1806 __fas216_start_command(info, SCpnt); fas216_start_command() 1809 static void fas216_allocate_tag(FAS216_Info *info, struct scsi_cmnd *SCpnt) fas216_allocate_tag() argument 1815 if (SCpnt->device->simple_tags && SCpnt->cmnd[0] != REQUEST_SENSE && fas216_allocate_tag() 1816 SCpnt->cmnd[0] != INQUIRY) { fas216_allocate_tag() 1817 SCpnt->device->current_tag += 1; fas216_allocate_tag() 1818 if (SCpnt->device->current_tag == 0) fas216_allocate_tag() 1819 SCpnt->device->current_tag = 1; fas216_allocate_tag() 1820 SCpnt->tag = SCpnt->device->current_tag; fas216_allocate_tag() 1823 set_bit(SCpnt->device->id * 8 + fas216_allocate_tag() 1824 (u8)(SCpnt->device->lun & 0x7), info->busyluns); fas216_allocate_tag() 1827 switch (SCpnt->cmnd[0]) { fas216_allocate_tag() 1845 struct scsi_cmnd *SCpnt) fas216_do_bus_device_reset() 1853 info->scsi.SCp = SCpnt->SCp; fas216_do_bus_device_reset() 1854 info->SCpnt = SCpnt; fas216_do_bus_device_reset() 1870 fas216_writeb(info, REG_SDID, BUSID(SCpnt->device->id)); fas216_do_bus_device_reset() 1874 fas216_set_sync(info, SCpnt->device->id); fas216_do_bus_device_reset() 1893 struct scsi_cmnd *SCpnt = NULL; fas216_kick() local 1906 SCpnt = info->rstSCpnt; fas216_kick() 1913 SCpnt = info->reqSCpnt; fas216_kick() 1919 SCpnt = info->origSCpnt; fas216_kick() 1925 if (!SCpnt) { fas216_kick() 1926 SCpnt = queue_remove_exclude(&info->queues.issue, fas216_kick() 1933 if (!SCpnt) { fas216_kick() 1946 if (info->scsi.disconnectable && info->SCpnt) { fas216_kick() 1949 info->SCpnt->device->id); fas216_kick() 1950 queue_add_cmd_tail(&info->queues.disconnected, info->SCpnt); fas216_kick() 1952 info->SCpnt = NULL; fas216_kick() 1955 fas216_log_command(info, LOG_CONNECT | LOG_MESSAGES, SCpnt, fas216_kick() 1960 fas216_allocate_tag(info, SCpnt); fas216_kick() 1962 fas216_start_command(info, SCpnt); fas216_kick() 1965 fas216_do_bus_device_reset(info, SCpnt); fas216_kick() 1981 static void fas216_devicereset_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, fas216_devicereset_done() argument 1994 * @SCpnt: command that completed 1999 static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, fas216_rq_sns_done() argument 2002 fas216_log_target(info, LOG_CONNECT, SCpnt->device->id, fas216_rq_sns_done() 2004 result, SCpnt->SCp.Message, SCpnt->SCp.Status); fas216_rq_sns_done() 2006 if (result != DID_OK || SCpnt->SCp.Status != GOOD) fas216_rq_sns_done() 2012 memset(SCpnt->sense_buffer, 0, sizeof(SCpnt->sense_buffer)); fas216_rq_sns_done() 2013 //printk("scsi%d.%c: sense buffer: ", info->host->host_no, '0' + SCpnt->device->id); fas216_rq_sns_done() 2014 //{ int i; for (i = 0; i < 32; i++) printk("%02x ", SCpnt->sense_buffer[i]); printk("\n"); } fas216_rq_sns_done() 2016 * Note that we don't set SCpnt->result, since that should fas216_rq_sns_done() 2021 scsi_eh_restore_cmnd(SCpnt, &info->ses); fas216_rq_sns_done() 2022 SCpnt->scsi_done(SCpnt); fas216_rq_sns_done() 2028 * @SCpnt: command that completed 2034 fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result) fas216_std_done() argument 2038 SCpnt->result = result << 16 | info->scsi.SCp.Message << 8 | fas216_std_done() 2041 fas216_log_command(info, LOG_CONNECT, SCpnt, fas216_std_done() 2042 "command complete, result=0x%08x", SCpnt->result); fas216_std_done() 2047 if (host_byte(SCpnt->result) != DID_OK || fas216_std_done() 2048 msg_byte(SCpnt->result) != COMMAND_COMPLETE) fas216_std_done() 2055 if (status_byte(SCpnt->result) == CHECK_CONDITION || fas216_std_done() 2056 status_byte(SCpnt->result) == COMMAND_TERMINATED) fas216_std_done() 2063 if (status_byte(SCpnt->result) != GOOD) fas216_std_done() 2074 switch (SCpnt->cmnd[0]) { fas216_std_done() 2081 scmd_printk(KERN_ERR, SCpnt, fas216_std_done() 2083 SCpnt->result, info->scsi.SCp.ptr, fas216_std_done() 2085 scsi_print_command(SCpnt); fas216_std_done() 2086 set_host_byte(SCpnt, DID_ERROR); fas216_std_done() 2092 if (SCpnt->scsi_done) { fas216_std_done() 2093 SCpnt->scsi_done(SCpnt); fas216_std_done() 2102 if (SCpnt->cmnd[0] == REQUEST_SENSE) fas216_std_done() 2105 scsi_eh_prep_cmnd(SCpnt, &info->ses, NULL, 0, ~0); fas216_std_done() 2106 fas216_log_target(info, LOG_CONNECT, SCpnt->device->id, fas216_std_done() 2108 init_SCp(SCpnt); fas216_std_done() 2109 SCpnt->SCp.Message = 0; fas216_std_done() 2110 SCpnt->SCp.Status = 0; fas216_std_done() 2111 SCpnt->tag = 0; fas216_std_done() 2112 SCpnt->host_scribble = (void *)fas216_rq_sns_done; fas216_std_done() 2121 info->host->host_no, '0' + SCpnt->device->id); fas216_std_done() 2122 info->reqSCpnt = SCpnt; fas216_std_done() 2135 struct scsi_cmnd *SCpnt; fas216_done() local 2140 if (!info->SCpnt) fas216_done() 2143 SCpnt = info->SCpnt; fas216_done() 2144 info->SCpnt = NULL; fas216_done() 2158 scmd_printk(KERN_INFO, SCpnt, fas216_done() 2162 scsi_print_command(SCpnt); fas216_done() 2170 info->device[SCpnt->device->id].parity_check = 0; fas216_done() 2171 clear_bit(SCpnt->device->id * 8 + fas216_done() 2172 (u8)(SCpnt->device->lun & 0x7), info->busyluns); fas216_done() 2174 fn = (void (*)(FAS216_Info *, struct scsi_cmnd *, unsigned int))SCpnt->host_scribble; fas216_done() 2175 fn(info, SCpnt, result); fas216_done() 2192 * @SCpnt: Command to queue 2199 static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, fas216_queue_command_lck() argument 2202 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; fas216_queue_command_lck() 2207 fas216_log_command(info, LOG_CONNECT, SCpnt, fas216_queue_command_lck() 2208 "received command (%p)", SCpnt); fas216_queue_command_lck() 2210 SCpnt->scsi_done = done; fas216_queue_command_lck() 2211 SCpnt->host_scribble = (void *)fas216_std_done; fas216_queue_command_lck() 2212 SCpnt->result = 0; fas216_queue_command_lck() 2214 init_SCp(SCpnt); fas216_queue_command_lck() 2217 SCpnt->tag = 0; fas216_queue_command_lck() 2225 result = !queue_add_cmd_ordered(&info->queues.issue, SCpnt); fas216_queue_command_lck() 2245 * @SCpnt: Command to wake 2249 static void fas216_internal_done(struct scsi_cmnd *SCpnt) fas216_internal_done() argument 2251 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; fas216_internal_done() 2260 * @SCpnt: Command to queue 2266 static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt, fas216_noqueue_command_lck() argument 2269 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; fas216_noqueue_command_lck() 2280 fas216_queue_command_lck(SCpnt, fas216_internal_done); fas216_noqueue_command_lck() 2308 done(SCpnt); fas216_noqueue_command_lck() 2343 * @SCpnt: command to abort 2349 struct scsi_cmnd *SCpnt) fas216_find_command() 2353 if (queue_remove_cmd(&info->queues.issue, SCpnt)) { fas216_find_command() 2363 } else if (queue_remove_cmd(&info->queues.disconnected, SCpnt)) { fas216_find_command() 2372 } else if (info->SCpnt == SCpnt) { fas216_find_command() 2383 info->SCpnt = NULL; fas216_find_command() 2391 } else if (info->origSCpnt == SCpnt) { fas216_find_command() 2399 clear_bit(SCpnt->device->id * 8 + fas216_find_command() 2400 (u8)(SCpnt->device->lun & 0x7), info->busyluns); fas216_find_command() 2411 * @SCpnt: command to abort 2417 int fas216_eh_abort(struct scsi_cmnd *SCpnt) fas216_eh_abort() argument 2419 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; fas216_eh_abort() 2426 scmd_printk(KERN_WARNING, SCpnt, "abort command\n"); fas216_eh_abort() 2431 switch (fas216_find_command(info, SCpnt)) { fas216_eh_abort() 2438 scmd_printk(KERN_WARNING, SCpnt, "abort %p success\n", SCpnt); fas216_eh_abort() 2454 scmd_printk(KERN_WARNING, SCpnt, "abort %p failed\n", SCpnt); fas216_eh_abort() 2463 * @SCpnt: command specifing device to reset 2470 int fas216_eh_device_reset(struct scsi_cmnd *SCpnt) fas216_eh_device_reset() argument 2472 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; fas216_eh_device_reset() 2474 int i, res = FAILED, target = SCpnt->device->id; fas216_eh_device_reset() 2487 if (info->SCpnt && !info->scsi.disconnectable && fas216_eh_device_reset() 2488 info->SCpnt->device->id == SCpnt->device->id) fas216_eh_device_reset() 2510 SCpnt->host_scribble = (void *)fas216_devicereset_done; fas216_eh_device_reset() 2513 info->rstSCpnt = SCpnt; fas216_eh_device_reset() 2534 SCpnt->host_scribble = NULL; fas216_eh_device_reset() 2545 * @SCpnt: command specifing bus to reset 2551 int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt) fas216_eh_bus_reset() argument 2553 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; fas216_eh_bus_reset() 2595 info->SCpnt = NULL; fas216_eh_bus_reset() 2645 * @SCpnt: command specifing host to reset 2651 int fas216_eh_host_reset(struct scsi_cmnd *SCpnt) fas216_eh_host_reset() argument 2653 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; fas216_eh_host_reset() 2821 info->SCpnt = NULL; fas216_reset_state() 299 fas216_log_command(FAS216_Info *info, int level, struct scsi_cmnd *SCpnt, char *fmt, ...) fas216_log_command() argument 1844 fas216_do_bus_device_reset(FAS216_Info *info, struct scsi_cmnd *SCpnt) fas216_do_bus_device_reset() argument 2348 fas216_find_command(FAS216_Info *info, struct scsi_cmnd *SCpnt) fas216_find_command() argument
|
H A D | fas216.h | 219 struct scsi_cmnd *SCpnt; /* currently processing command */ member in struct:__anon9172 330 /* Function: int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) 333 * : SCpnt - Command to queue 336 extern int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); 338 /* Function: int fas216_noqueue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) 341 * : SCpnt - Command to queue 365 /* Function: int fas216_eh_abort(struct scsi_cmnd *SCpnt) 367 * Params : SCpnt - command to abort 370 extern int fas216_eh_abort(struct scsi_cmnd *SCpnt); 372 /* Function: int fas216_eh_device_reset(struct scsi_cmnd *SCpnt) 374 * Params : SCpnt - command specifing device to reset 377 extern int fas216_eh_device_reset(struct scsi_cmnd *SCpnt); 379 /* Function: int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt) 381 * Params : SCpnt - command specifing bus to reset 384 extern int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt); 386 /* Function: int fas216_eh_host_reset(struct scsi_cmnd *SCpnt) 388 * Params : SCpnt - command specifing host to reset 391 extern int fas216_eh_host_reset(struct scsi_cmnd *SCpnt);
|
H A D | arxescsi.c | 57 * Function: int arxescsi_dma_setup(host, SCpnt, direction, min_type) 60 * SCpnt - command 104 * Function: int arxescsi_dma_pseudo(host, SCpnt, direction, transfer) 107 * SCpnt - command 193 * Function: int arxescsi_dma_stop(host, SCpnt) 196 * SCpnt - command
|
H A D | cumana_2.c | 148 /* Prototype: fasdmatype_t cumanascsi_2_dma_setup(host, SCpnt, direction, min_type) 151 * SCpnt - command 201 * Prototype: void cumanascsi_2_dma_pseudo(host, SCpnt, direction, transfer) 204 * SCpnt - command 277 /* Prototype: int cumanascsi_2_dma_stop(host, SCpnt) 280 * SCpnt - command
|
H A D | powertec.c | 122 /* Prototype: fasdmatype_t powertecscsi_dma_setup(host, SCpnt, direction, min_type) 125 * SCpnt - command 167 /* Prototype: int powertecscsi_dma_stop(host, SCpnt) 170 * SCpnt - command
|
H A D | eesox.c | 149 /* Prototype: fasdmatype_t eesoxscsi_dma_setup(host, SCpnt, direction, min_type) 152 * SCpnt - command 364 /* Prototype: int eesoxscsi_dma_stop(host, SCpnt) 367 * SCpnt - command
|
H A D | acornscsi.h | 279 struct scsi_cmnd *SCpnt; /* currently processing command */ member in struct:acornscsi_hostdata
|
/linux-4.4.14/drivers/scsi/pcmcia/ |
H A D | nsp_message.c | 11 static void nsp_message_in(struct scsi_cmnd *SCpnt) nsp_message_in() argument 13 unsigned int base = SCpnt->device->host->io_port; nsp_message_in() 14 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_message_in() 36 nsp_negate_signal(SCpnt, BUSMON_REQ, "msgin<REQ>"); nsp_message_in() 46 ret = nsp_expect_signal(SCpnt, BUSPHASE_MESSAGE_IN, BUSMON_REQ); nsp_message_in() 53 static void nsp_message_out(struct scsi_cmnd *SCpnt) nsp_message_out() argument 55 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_message_out() 68 if (nsp_xfer(SCpnt, BUSPHASE_MESSAGE_OUT)) { nsp_message_out() 73 ret = nsp_expect_signal(SCpnt, BUSPHASE_MESSAGE_OUT, BUSMON_REQ); nsp_message_out()
|
H A D | nsp_cs.c | 134 static inline void nsp_inc_resid(struct scsi_cmnd *SCpnt, int residInc) nsp_inc_resid() argument 136 scsi_set_resid(SCpnt, scsi_get_resid(SCpnt) + residInc); nsp_inc_resid() 175 * You must be set SCpnt->result before call this function. 177 static void nsp_scsi_done(struct scsi_cmnd *SCpnt) nsp_scsi_done() argument 179 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_scsi_done() 183 SCpnt->scsi_done(SCpnt); nsp_scsi_done() 186 static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, nsp_queuecommand_lck() argument 190 /*unsigned int host_id = SCpnt->device->host->this_id;*/ nsp_queuecommand_lck() 191 /*unsigned int base = SCpnt->device->host->io_port;*/ nsp_queuecommand_lck() 192 unsigned char target = scmd_id(SCpnt); nsp_queuecommand_lck() 194 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_queuecommand_lck() 197 "SCpnt=0x%p target=%d lun=%llu sglist=0x%p bufflen=%d sg_count=%d", nsp_queuecommand_lck() 198 SCpnt, target, SCpnt->device->lun, scsi_sglist(SCpnt), nsp_queuecommand_lck() 199 scsi_bufflen(SCpnt), scsi_sg_count(SCpnt)); nsp_queuecommand_lck() 202 SCpnt->scsi_done = done; nsp_queuecommand_lck() 206 SCpnt->result = DID_BAD_TARGET << 16; nsp_queuecommand_lck() 207 nsp_scsi_done(SCpnt); nsp_queuecommand_lck() 216 SCpnt->result = DID_BAD_TARGET << 16; nsp_queuecommand_lck() 217 nsp_scsi_done(SCpnt); nsp_queuecommand_lck() 222 show_command(SCpnt); nsp_queuecommand_lck() 224 data->CurrentSC = SCpnt; nsp_queuecommand_lck() 226 SCpnt->SCp.Status = CHECK_CONDITION; nsp_queuecommand_lck() 227 SCpnt->SCp.Message = 0; nsp_queuecommand_lck() 228 SCpnt->SCp.have_data_in = IO_UNKNOWN; nsp_queuecommand_lck() 229 SCpnt->SCp.sent_command = 0; nsp_queuecommand_lck() 230 SCpnt->SCp.phase = PH_UNDETERMINED; nsp_queuecommand_lck() 231 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt)); nsp_queuecommand_lck() 239 if (scsi_bufflen(SCpnt)) { nsp_queuecommand_lck() 240 SCpnt->SCp.buffer = scsi_sglist(SCpnt); nsp_queuecommand_lck() 241 SCpnt->SCp.ptr = BUFFER_ADDR; nsp_queuecommand_lck() 242 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; nsp_queuecommand_lck() 243 SCpnt->SCp.buffers_residual = scsi_sg_count(SCpnt) - 1; nsp_queuecommand_lck() 245 SCpnt->SCp.ptr = NULL; nsp_queuecommand_lck() 246 SCpnt->SCp.this_residual = 0; nsp_queuecommand_lck() 247 SCpnt->SCp.buffer = NULL; nsp_queuecommand_lck() 248 SCpnt->SCp.buffers_residual = 0; nsp_queuecommand_lck() 251 if (nsphw_start_selection(SCpnt) == FALSE) { nsp_queuecommand_lck() 253 SCpnt->result = DID_BUS_BUSY << 16; nsp_queuecommand_lck() 254 nsp_scsi_done(SCpnt); nsp_queuecommand_lck() 364 static int nsphw_start_selection(struct scsi_cmnd *SCpnt) nsphw_start_selection() argument 366 unsigned int host_id = SCpnt->device->host->this_id; nsphw_start_selection() 367 unsigned int base = SCpnt->device->host->io_port; nsphw_start_selection() 368 unsigned char target = scmd_id(SCpnt); nsphw_start_selection() 369 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsphw_start_selection() 383 SCpnt->SCp.phase = PH_ARBSTART; nsphw_start_selection() 403 SCpnt->SCp.phase = PH_SELSTART; nsphw_start_selection() 414 nsp_start_timer(SCpnt, 1000/51); nsphw_start_selection() 445 static int nsp_analyze_sdtr(struct scsi_cmnd *SCpnt) nsp_analyze_sdtr() argument 447 unsigned char target = scmd_id(SCpnt); nsp_analyze_sdtr() 448 // unsigned char lun = SCpnt->device->lun; nsp_analyze_sdtr() 449 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_analyze_sdtr() 503 static void nsp_start_timer(struct scsi_cmnd *SCpnt, int time) nsp_start_timer() argument 505 unsigned int base = SCpnt->device->host->io_port; nsp_start_timer() 506 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_start_timer() 508 //nsp_dbg(NSP_DEBUG_INTR, "in SCpnt=0x%p, time=%d", SCpnt, time); nsp_start_timer() 516 static int nsp_negate_signal(struct scsi_cmnd *SCpnt, unsigned char mask, nsp_negate_signal() argument 519 unsigned int base = SCpnt->device->host->io_port; nsp_negate_signal() 544 static int nsp_expect_signal(struct scsi_cmnd *SCpnt, nsp_expect_signal() argument 548 unsigned int base = SCpnt->device->host->io_port; nsp_expect_signal() 579 static int nsp_xfer(struct scsi_cmnd *SCpnt, int phase) nsp_xfer() argument 581 unsigned int base = SCpnt->device->host->io_port; nsp_xfer() 582 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_xfer() 591 ret = nsp_expect_signal(SCpnt, phase, BUSMON_REQ); nsp_xfer() 598 if (len == 1 && SCpnt->SCp.phase == PH_MSG_OUT) { nsp_xfer() 610 nsp_negate_signal(SCpnt, BUSMON_ACK, "xfer<ack>"); nsp_xfer() 619 static int nsp_dataphase_bypass(struct scsi_cmnd *SCpnt) nsp_dataphase_bypass() argument 621 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_dataphase_bypass() 626 if (SCpnt->SCp.have_data_in != IO_IN) { nsp_dataphase_bypass() 630 count = nsp_fifo_count(SCpnt); nsp_dataphase_bypass() 641 SCpnt->SCp.phase = PH_DATA; nsp_dataphase_bypass() 642 nsp_pio_read(SCpnt); nsp_dataphase_bypass() 651 static int nsp_reselected(struct scsi_cmnd *SCpnt) nsp_reselected() argument 653 unsigned int base = SCpnt->device->host->io_port; nsp_reselected() 654 unsigned int host_id = SCpnt->device->host->this_id; nsp_reselected() 655 //nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_reselected() 673 if (scmd_id(SCpnt) != target) { nsp_reselected() 677 nsp_negate_signal(SCpnt, BUSMON_SEL, "reselect<SEL>"); nsp_reselected() 679 nsp_nexus(SCpnt); nsp_reselected() 690 static int nsp_fifo_count(struct scsi_cmnd *SCpnt) nsp_fifo_count() argument 692 unsigned int base = SCpnt->device->host->io_port; nsp_fifo_count() 717 static void nsp_pio_read(struct scsi_cmnd *SCpnt) nsp_pio_read() argument 719 unsigned int base = SCpnt->device->host->io_port; nsp_pio_read() 720 unsigned long mmio_base = SCpnt->device->host->base; nsp_pio_read() 721 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_pio_read() 728 nsp_dbg(NSP_DEBUG_DATA_IO, "in SCpnt=0x%p resid=%d ocount=%d ptr=0x%p this_residual=%d buffers=0x%p nbuf=%d", nsp_pio_read() 729 SCpnt, scsi_get_resid(SCpnt), ocount, SCpnt->SCp.ptr, nsp_pio_read() 730 SCpnt->SCp.this_residual, SCpnt->SCp.buffer, nsp_pio_read() 731 SCpnt->SCp.buffers_residual); nsp_pio_read() 736 (SCpnt->SCp.this_residual > 0 || SCpnt->SCp.buffers_residual > 0 ) ) { nsp_pio_read() 742 res = nsp_fifo_count(SCpnt) - ocount; nsp_pio_read() 743 //nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this=0x%x ocount=0x%x res=0x%x", SCpnt->SCp.ptr, SCpnt->SCp.this_residual, ocount, res); nsp_pio_read() 746 //nsp_dbg(NSP_DEBUG_DATA_IO, " wait for data this=%d", SCpnt->SCp.this_residual); nsp_pio_read() 760 res = min(res, SCpnt->SCp.this_residual); nsp_pio_read() 765 nsp_fifo32_read(base, SCpnt->SCp.ptr, res >> 2); nsp_pio_read() 768 nsp_fifo8_read (base, SCpnt->SCp.ptr, res ); nsp_pio_read() 773 nsp_mmio_fifo32_read(mmio_base, SCpnt->SCp.ptr, res >> 2); nsp_pio_read() 781 nsp_inc_resid(SCpnt, -res); nsp_pio_read() 782 SCpnt->SCp.ptr += res; nsp_pio_read() 783 SCpnt->SCp.this_residual -= res; nsp_pio_read() 785 //nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this_residual=0x%x ocount=0x%x", SCpnt->SCp.ptr, SCpnt->SCp.this_residual, ocount); nsp_pio_read() 788 if (SCpnt->SCp.this_residual == 0 && nsp_pio_read() 789 SCpnt->SCp.buffers_residual != 0 ) { nsp_pio_read() 791 SCpnt->SCp.buffers_residual--; nsp_pio_read() 792 SCpnt->SCp.buffer++; nsp_pio_read() 793 SCpnt->SCp.ptr = BUFFER_ADDR; nsp_pio_read() 794 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; nsp_pio_read() 797 //nsp_dbg(NSP_DEBUG_DATA_IO, "page: 0x%p, off: 0x%x", SCpnt->SCp.buffer->page, SCpnt->SCp.buffer->offset); nsp_pio_read() 805 scsi_get_resid(SCpnt), SCpnt->SCp.this_residual, nsp_pio_read() 806 SCpnt->SCp.buffers_residual); nsp_pio_read() 810 scsi_get_resid(SCpnt)); nsp_pio_read() 816 static void nsp_pio_write(struct scsi_cmnd *SCpnt) nsp_pio_write() argument 818 unsigned int base = SCpnt->device->host->io_port; nsp_pio_write() 819 unsigned long mmio_base = SCpnt->device->host->base; nsp_pio_write() 820 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_pio_write() 828 data->FifoCount, SCpnt->SCp.ptr, SCpnt->SCp.this_residual, nsp_pio_write() 829 SCpnt->SCp.buffer, SCpnt->SCp.buffers_residual, nsp_pio_write() 830 scsi_get_resid(SCpnt)); nsp_pio_write() 835 (SCpnt->SCp.this_residual > 0 || SCpnt->SCp.buffers_residual > 0)) { nsp_pio_write() 840 res = ocount - nsp_fifo_count(SCpnt); nsp_pio_write() 844 nsp_inc_resid(SCpnt, res); nsp_pio_write() 845 SCpnt->SCp.ptr -= res; nsp_pio_write() 846 SCpnt->SCp.this_residual += res; nsp_pio_write() 852 res = ocount - nsp_fifo_count(SCpnt); nsp_pio_write() 858 res = min(SCpnt->SCp.this_residual, WFIFO_CRIT); nsp_pio_write() 860 //nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this=0x%x res=0x%x", SCpnt->SCp.ptr, SCpnt->SCp.this_residual, res); nsp_pio_write() 864 nsp_fifo32_write(base, SCpnt->SCp.ptr, res >> 2); nsp_pio_write() 867 nsp_fifo8_write (base, SCpnt->SCp.ptr, res ); nsp_pio_write() 872 nsp_mmio_fifo32_write(mmio_base, SCpnt->SCp.ptr, res >> 2); nsp_pio_write() 880 nsp_inc_resid(SCpnt, -res); nsp_pio_write() 881 SCpnt->SCp.ptr += res; nsp_pio_write() 882 SCpnt->SCp.this_residual -= res; nsp_pio_write() 886 if (SCpnt->SCp.this_residual == 0 && nsp_pio_write() 887 SCpnt->SCp.buffers_residual != 0 ) { nsp_pio_write() 889 SCpnt->SCp.buffers_residual--; nsp_pio_write() 890 SCpnt->SCp.buffer++; nsp_pio_write() 891 SCpnt->SCp.ptr = BUFFER_ADDR; nsp_pio_write() 892 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; nsp_pio_write() 901 scsi_get_resid(SCpnt)); nsp_pio_write() 905 scsi_get_resid(SCpnt)); nsp_pio_write() 913 static int nsp_nexus(struct scsi_cmnd *SCpnt) nsp_nexus() argument 915 unsigned int base = SCpnt->device->host->io_port; nsp_nexus() 916 unsigned char target = scmd_id(SCpnt); nsp_nexus() 917 // unsigned char lun = SCpnt->device->lun; nsp_nexus() 918 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_nexus() 921 //nsp_dbg(NSP_DEBUG_DATA_IO, "in SCpnt=0x%p", SCpnt); nsp_nexus() 927 if (scsi_get_resid(SCpnt) % 4 != 0 || nsp_nexus() 928 scsi_get_resid(SCpnt) <= PAGE_SIZE ) { nsp_nexus() 1451 static int nsp_eh_abort(struct scsi_cmnd *SCpnt) 1453 nsp_dbg(NSP_DEBUG_BUSRESET, "SCpnt=0x%p", SCpnt); 1455 return nsp_eh_bus_reset(SCpnt); 1479 static int nsp_eh_bus_reset(struct scsi_cmnd *SCpnt) nsp_eh_bus_reset() argument 1481 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_eh_bus_reset() 1483 nsp_dbg(NSP_DEBUG_BUSRESET, "SCpnt=0x%p", SCpnt); nsp_eh_bus_reset() 1488 static int nsp_eh_host_reset(struct scsi_cmnd *SCpnt) nsp_eh_host_reset() argument 1490 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; nsp_eh_host_reset()
|
H A D | nsp_cs.h | 297 static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); 300 /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/ 301 /*static int nsp_eh_device_reset(struct scsi_cmnd *SCpnt);*/ 302 static int nsp_eh_bus_reset (struct scsi_cmnd *SCpnt); 303 static int nsp_eh_host_reset (struct scsi_cmnd *SCpnt); 308 static int nsphw_start_selection(struct scsi_cmnd *SCpnt); 309 static void nsp_start_timer (struct scsi_cmnd *SCpnt, int time); 310 static int nsp_fifo_count (struct scsi_cmnd *SCpnt); 311 static void nsp_pio_read (struct scsi_cmnd *SCpnt); 312 static void nsp_pio_write (struct scsi_cmnd *SCpnt); 313 static int nsp_nexus (struct scsi_cmnd *SCpnt); 314 static void nsp_scsi_done (struct scsi_cmnd *SCpnt); 315 static int nsp_analyze_sdtr (struct scsi_cmnd *SCpnt); 316 static int nsp_negate_signal (struct scsi_cmnd *SCpnt, 318 static int nsp_expect_signal (struct scsi_cmnd *SCpnt, 321 static int nsp_xfer (struct scsi_cmnd *SCpnt, int phase); 322 static int nsp_dataphase_bypass (struct scsi_cmnd *SCpnt); 323 static int nsp_reselected (struct scsi_cmnd *SCpnt); 335 static void show_command (struct scsi_cmnd *SCpnt); 336 static void show_phase (struct scsi_cmnd *SCpnt); 341 # define show_phase(SCpnt) /* */ 389 # define BUFFER_ADDR ((char *)((sg_virt(SCpnt->SCp.buffer))))
|
H A D | sym53c500_cs.c | 550 SYM53C500_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) SYM53C500_queue_lck() argument 553 int port_base = SCpnt->device->host->io_port; SYM53C500_queue_lck() 555 (struct sym53c500_data *)SCpnt->device->host->hostdata; SYM53C500_queue_lck() 560 SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->device->id, SYM53C500_queue_lck() 561 (u8)SCpnt->device->lun, scsi_bufflen(SCpnt))); SYM53C500_queue_lck() 563 VDEB(for (i = 0; i < SCpnt->cmd_len; i++) SYM53C500_queue_lck() 564 printk("cmd[%d]=%02x ", i, SCpnt->cmnd[i])); SYM53C500_queue_lck() 567 data->current_SC = SCpnt; SYM53C500_queue_lck() 575 outb(scmd_id(SCpnt), port_base + DEST_ID); /* set destination */ SYM53C500_queue_lck() 578 for (i = 0; i < SCpnt->cmd_len; i++) { SYM53C500_queue_lck() 579 outb(SCpnt->cmnd[i], port_base + SCSI_FIFO); SYM53C500_queue_lck() 589 SYM53C500_host_reset(struct scsi_cmnd *SCpnt) SYM53C500_host_reset() argument 591 int port_base = SCpnt->device->host->io_port; SYM53C500_host_reset() 594 spin_lock_irq(SCpnt->device->host->host_lock); SYM53C500_host_reset() 596 spin_unlock_irq(SCpnt->device->host->host_lock); SYM53C500_host_reset()
|
H A D | nsp_debug.c | 141 static void show_command(struct scsi_cmnd *SCpnt) show_command() argument 143 print_commandk(SCpnt->cmnd); show_command() 146 static void show_phase(struct scsi_cmnd *SCpnt) show_phase() argument 148 int i = SCpnt->SCp.phase; show_phase()
|
/linux-4.4.14/drivers/scsi/ |
H A D | u14-34f.c | 66 * + Use SCpnt->sc_data_direction if set. 579 struct scsi_cmnd *SCpnt; member in struct:mscp 1118 struct scsi_cmnd *SCpnt; map_dma() local 1120 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt; map_dma() 1121 pci_dir = SCpnt->sc_data_direction; map_dma() 1123 if (SCpnt->sense_buffer) map_dma() 1124 cpp->sense_addr = H2DEV(pci_map_single(HD(j)->pdev, SCpnt->sense_buffer, map_dma() 1129 if (scsi_bufflen(SCpnt)) { map_dma() 1130 count = scsi_dma_map(SCpnt); map_dma() 1133 scsi_for_each_sg(SCpnt, sg, count, k) { scsi_for_each_sg() 1140 cpp->use_sg = scsi_sg_count(SCpnt); 1149 cpp->data_len = H2DEV(scsi_bufflen(SCpnt)); 1156 struct scsi_cmnd *SCpnt; unmap_dma() local 1158 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt; unmap_dma() 1159 pci_dir = SCpnt->sc_data_direction; unmap_dma() 1165 scsi_dma_unmap(SCpnt); unmap_dma() 1177 struct scsi_cmnd *SCpnt; sync_dma() local 1179 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt; sync_dma() 1180 pci_dir = SCpnt->sc_data_direction; sync_dma() 1186 if (scsi_sg_count(SCpnt)) sync_dma() 1187 pci_dma_sync_sg_for_cpu(HD(j)->pdev, scsi_sglist(SCpnt), sync_dma() 1188 scsi_sg_count(SCpnt), pci_dir); sync_dma() 1213 struct scsi_cmnd *SCpnt; scsi_to_dev_dir() local 1215 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt; scsi_to_dev_dir() 1217 if (SCpnt->sc_data_direction == DMA_FROM_DEVICE) { scsi_to_dev_dir() 1221 else if (SCpnt->sc_data_direction == DMA_TO_DEVICE) { scsi_to_dev_dir() 1225 else if (SCpnt->sc_data_direction == DMA_NONE) { scsi_to_dev_dir() 1230 if (SCpnt->sc_data_direction != DMA_BIDIRECTIONAL) scsi_to_dev_dir() 1231 panic("%s: qcomm, invalid SCpnt->sc_data_direction.\n", BN(j)); scsi_to_dev_dir() 1236 if (SCpnt->cmnd[0] == data_out_cmds[k]) { scsi_to_dev_dir() 1243 if (SCpnt->cmnd[0] == data_none_cmds[k]) { scsi_to_dev_dir() 1250 static int u14_34f_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { u14_34f_queuecommand_lck() argument 1255 j = ((struct hostdata *) SCpnt->device->host->hostdata)->board_number; u14_34f_queuecommand_lck() 1257 if (SCpnt->host_scribble) u14_34f_queuecommand_lck() 1258 panic("%s: qcomm, SCpnt %p already active.\n", u14_34f_queuecommand_lck() 1259 BN(j), SCpnt); u14_34f_queuecommand_lck() 1284 SCpnt->scsi_done = done; u14_34f_queuecommand_lck() 1286 SCpnt->host_scribble = (unsigned char *) &cpp->cpp_index; u14_34f_queuecommand_lck() 1289 BN(j), i, SCpnt->device->channel, SCpnt->device->id, u14_34f_queuecommand_lck() 1290 (u8)SCpnt->device->lun); u14_34f_queuecommand_lck() 1293 cpp->channel = SCpnt->device->channel; u14_34f_queuecommand_lck() 1294 cpp->target = SCpnt->device->id; u14_34f_queuecommand_lck() 1295 cpp->lun = (u8)SCpnt->device->lun; u14_34f_queuecommand_lck() 1296 cpp->SCpnt = SCpnt; u14_34f_queuecommand_lck() 1297 cpp->cdb_len = SCpnt->cmd_len; u14_34f_queuecommand_lck() 1298 memcpy(cpp->cdb, SCpnt->cmnd, SCpnt->cmd_len); u14_34f_queuecommand_lck() 1300 /* Use data transfer direction SCpnt->sc_data_direction */ u14_34f_queuecommand_lck() 1306 if (linked_comm && SCpnt->device->queue_depth > 2 u14_34f_queuecommand_lck() 1307 && TLDEV(SCpnt->device->type)) { u14_34f_queuecommand_lck() 1309 flush_dev(SCpnt->device, blk_rq_pos(SCpnt->request), j, FALSE); u14_34f_queuecommand_lck() 1315 SCpnt->host_scribble = NULL; u14_34f_queuecommand_lck() 1316 scmd_printk(KERN_INFO, SCpnt, u14_34f_queuecommand_lck() 1362 if (SCarg != HD(j)->cp[i].SCpnt) u14_34f_eh_abort() 1363 panic("%s: abort, mbox %d, SCarg %p, cp SCpnt %p.\n", u14_34f_eh_abort() 1364 BN(j), i, SCarg, HD(j)->cp[i].SCpnt); u14_34f_eh_abort() 1399 struct scsi_cmnd *SCpnt; u14_34f_eh_host_reset() local 1439 if (!(SCpnt = HD(j)->cp[i].SCpnt)) u14_34f_eh_host_reset() 1440 panic("%s: reset, mbox %d, SCpnt == NULL.\n", BN(j), i); u14_34f_eh_host_reset() 1452 if (SCpnt->host_scribble == NULL) u14_34f_eh_host_reset() 1453 panic("%s: reset, mbox %d, garbled SCpnt.\n", BN(j), i); u14_34f_eh_host_reset() 1455 if (*(unsigned int *)SCpnt->host_scribble != i) u14_34f_eh_host_reset() 1458 if (SCpnt->scsi_done == NULL) u14_34f_eh_host_reset() 1459 panic("%s: reset, mbox %d, SCpnt->scsi_done == NULL.\n", BN(j), i); u14_34f_eh_host_reset() 1461 if (SCpnt == SCarg) arg_done = TRUE; u14_34f_eh_host_reset() 1489 SCpnt = HD(j)->cp[i].SCpnt; u14_34f_eh_host_reset() 1491 SCpnt->result = DID_RESET << 16; u14_34f_eh_host_reset() 1492 SCpnt->host_scribble = NULL; u14_34f_eh_host_reset() 1501 SCpnt = HD(j)->cp[i].SCpnt; u14_34f_eh_host_reset() 1503 SCpnt->result = DID_RESET << 16; u14_34f_eh_host_reset() 1504 SCpnt->host_scribble = NULL; u14_34f_eh_host_reset() 1517 SCpnt->scsi_done(SCpnt); u14_34f_eh_host_reset() 1580 struct scsi_cmnd *SCpnt; reorder() local 1604 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; reorder() 1608 if (blk_rq_pos(SCpnt->request) < minsec) reorder() 1609 minsec = blk_rq_pos(SCpnt->request); reorder() 1610 if (blk_rq_pos(SCpnt->request) > maxsec) reorder() 1611 maxsec = blk_rq_pos(SCpnt->request); reorder() 1613 sl[n] = blk_rq_pos(SCpnt->request); reorder() 1614 ioseek += blk_rq_sectors(SCpnt->request); reorder() 1641 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; reorder() 1642 ll[n] = blk_rq_sectors(SCpnt->request); pl[n] = SCpnt->serial_number; reorder() 1665 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; reorder() 1668 (ihdlr ? "ihdlr" : "qcomm"), SCpnt->channel, SCpnt->target, reorder() 1669 (u8)SCpnt->lun, k, flushcount, n_ready, reorder() 1670 blk_rq_pos(SCpnt->request), blk_rq_sectors(SCpnt->request), reorder() 1680 struct scsi_cmnd *SCpnt; flush_dev() local 1688 cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; flush_dev() 1690 if (SCpnt->device != dev) continue; flush_dev() 1700 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; flush_dev() 1703 scmd_printk(KERN_INFO, SCpnt, flush_dev() 1720 struct scsi_cmnd *SCpnt; ihdlr() local 1783 SCpnt = cpp->SCpnt; ihdlr() 1785 if (SCpnt == NULL) panic("%s: ihdlr, mbox %d, SCpnt == NULL.\n", BN(j), i); ihdlr() 1787 if (SCpnt->host_scribble == NULL) ihdlr() 1788 panic("%s: ihdlr, mbox %d, SCpnt %p garbled.\n", BN(j), i, ihdlr() 1789 SCpnt); ihdlr() 1791 if (*(unsigned int *)SCpnt->host_scribble != i) ihdlr() 1793 BN(j), i, *(unsigned int *)SCpnt->host_scribble); ihdlr() 1797 if (linked_comm && SCpnt->device->queue_depth > 2 ihdlr() 1798 && TLDEV(SCpnt->device->type)) ihdlr() 1799 flush_dev(SCpnt->device, blk_rq_pos(SCpnt->request), j, TRUE); ihdlr() 1812 if (tstatus == BUSY && SCpnt->device->type != TYPE_TAPE) ihdlr() 1816 else if (tstatus != GOOD && SCpnt->device->type == TYPE_DISK ihdlr() 1817 && HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)]) ihdlr() 1822 && SCpnt->device->type == TYPE_DISK ihdlr() 1823 && (SCpnt->sense_buffer[2] & 0xf) == RECOVERED_ERROR) ihdlr() 1830 HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)] = FALSE; ihdlr() 1832 if (spp->target_status && SCpnt->device->type == TYPE_DISK && ihdlr() 1834 (SCpnt->sense_buffer[2] & 0xf) == NOT_READY))) ihdlr() 1835 scmd_printk(KERN_INFO, SCpnt, ihdlr() 1838 SCpnt->sense_buffer[2]); ihdlr() 1840 HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] = 0; ihdlr() 1842 if (HD(j)->last_retried_pid == SCpnt->serial_number) HD(j)->retries = 0; ihdlr() 1847 if (HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] > 1) ihdlr() 1851 HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)]++; ihdlr() 1869 if (SCpnt->device->type != TYPE_TAPE ihdlr() 1879 HD(j)->last_retried_pid = SCpnt->serial_number; ihdlr() 1897 SCpnt->result = status | spp->target_status; ihdlr() 1900 if (SCpnt->result || do_trace) ihdlr() 1907 scmd_printk(KERN_INFO, SCpnt, "ihdlr, mbox %2d, err 0x%x:%x,"\ ihdlr() 1915 SCpnt->host_scribble = NULL; ihdlr() 1917 SCpnt->scsi_done(SCpnt); ihdlr()
|
H A D | nsp32.c | 367 static void nsp32_build_identify(struct scsi_cmnd *SCpnt) nsp32_build_identify() argument 369 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_build_identify() 378 data->msgoutbuf[pos] = IDENTIFY(mode, SCpnt->device->lun); pos++; nsp32_build_identify() 386 static void nsp32_build_sdtr(struct scsi_cmnd *SCpnt, nsp32_build_sdtr() argument 390 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_build_sdtr() 405 static void nsp32_build_nop(struct scsi_cmnd *SCpnt) nsp32_build_nop() argument 407 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_build_nop() 423 static void nsp32_build_reject(struct scsi_cmnd *SCpnt) nsp32_build_reject() argument 425 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_build_reject() 436 static void nsp32_start_timer(struct scsi_cmnd *SCpnt, int time) 438 unsigned int base = SCpnt->host->io_port; 454 static int nsp32_selection_autopara(struct scsi_cmnd *SCpnt) nsp32_selection_autopara() argument 456 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_selection_autopara() 457 unsigned int base = SCpnt->device->host->io_port; nsp32_selection_autopara() 458 unsigned int host_id = SCpnt->device->host->this_id; nsp32_selection_autopara() 459 unsigned char target = scmd_id(SCpnt); nsp32_selection_autopara() 475 SCpnt->result = DID_BUS_BUSY << 16; nsp32_selection_autopara() 487 SCpnt->result = DID_ERROR << 16; nsp32_selection_autopara() 517 for (i = 0; i < SCpnt->cmd_len; i++) { nsp32_selection_autopara() 518 param->cdb[4 * i] = SCpnt->cmnd[i]; nsp32_selection_autopara() 576 ret = nsp32_arbitration(SCpnt, base); nsp32_selection_autopara() 585 static int nsp32_selection_autoscsi(struct scsi_cmnd *SCpnt) nsp32_selection_autoscsi() argument 587 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_selection_autoscsi() 588 unsigned int base = SCpnt->device->host->io_port; nsp32_selection_autoscsi() 589 unsigned int host_id = SCpnt->device->host->this_id; nsp32_selection_autoscsi() 590 unsigned char target = scmd_id(SCpnt); nsp32_selection_autoscsi() 611 SCpnt->result = DID_BUS_BUSY << 16; nsp32_selection_autoscsi() 629 for (i = 0; i < SCpnt->cmd_len; i++) { nsp32_selection_autoscsi() 630 nsp32_write1(base, COMMAND_DATA, SCpnt->cmnd[i]); nsp32_selection_autoscsi() 632 nsp32_dbg(NSP32_DEBUG_CDB_CONTENTS, "CDB[0]=[0x%x]", SCpnt->cmnd[0]); nsp32_selection_autoscsi() 647 SCpnt->result = DID_ERROR << 16; nsp32_selection_autoscsi() 717 if (scsi_bufflen(SCpnt) > 0) { nsp32_selection_autoscsi() 740 status = nsp32_arbitration(SCpnt, base); nsp32_selection_autoscsi() 760 static int nsp32_arbitration(struct scsi_cmnd *SCpnt, unsigned int base) nsp32_arbitration() argument 777 SCpnt->result = DID_OK << 16; nsp32_arbitration() 781 SCpnt->result = DID_BUS_BUSY << 16; nsp32_arbitration() 789 SCpnt->result = DID_NO_CONNECT << 16; nsp32_arbitration() 809 static int nsp32_reselection(struct scsi_cmnd *SCpnt, unsigned char newlun) nsp32_reselection() argument 811 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_reselection() 812 unsigned int host_id = SCpnt->device->host->this_id; nsp32_reselection() 813 unsigned int base = SCpnt->device->host->io_port; nsp32_reselection() 840 } else if(data->lunt[newid][newlun].SCpnt == NULL) { nsp32_reselection() 863 static int nsp32_setup_sg_table(struct scsi_cmnd *SCpnt) nsp32_setup_sg_table() argument 865 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_setup_sg_table() 876 num = scsi_dma_map(SCpnt); nsp32_setup_sg_table() 882 scsi_for_each_sg(SCpnt, sg, num, i) { scsi_for_each_sg() 909 static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) nsp32_queuecommand_lck() argument 911 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_queuecommand_lck() 919 SCpnt->device->id, SCpnt->device->lun, SCpnt->cmnd[0], SCpnt->cmd_len, nsp32_queuecommand_lck() 920 scsi_sg_count(SCpnt), scsi_sglist(SCpnt), scsi_bufflen(SCpnt)); nsp32_queuecommand_lck() 925 SCpnt->result = DID_NO_CONNECT << 16; nsp32_queuecommand_lck() 926 done(SCpnt); nsp32_queuecommand_lck() 931 if (scmd_id(SCpnt) == SCpnt->device->host->this_id) { nsp32_queuecommand_lck() 933 SCpnt->result = DID_BAD_TARGET << 16; nsp32_queuecommand_lck() 934 done(SCpnt); nsp32_queuecommand_lck() 939 if (SCpnt->device->lun >= MAX_LUN) { nsp32_queuecommand_lck() 941 SCpnt->result = DID_BAD_TARGET << 16; nsp32_queuecommand_lck() 942 done(SCpnt); nsp32_queuecommand_lck() 946 show_command(SCpnt); nsp32_queuecommand_lck() 948 SCpnt->scsi_done = done; nsp32_queuecommand_lck() 949 data->CurrentSC = SCpnt; nsp32_queuecommand_lck() 950 SCpnt->SCp.Status = CHECK_CONDITION; nsp32_queuecommand_lck() 951 SCpnt->SCp.Message = 0; nsp32_queuecommand_lck() 952 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt)); nsp32_queuecommand_lck() 954 SCpnt->SCp.ptr = (char *)scsi_sglist(SCpnt); nsp32_queuecommand_lck() 955 SCpnt->SCp.this_residual = scsi_bufflen(SCpnt); nsp32_queuecommand_lck() 956 SCpnt->SCp.buffer = NULL; nsp32_queuecommand_lck() 957 SCpnt->SCp.buffers_residual = 0; nsp32_queuecommand_lck() 962 cur_lunt = &(data->lunt[SCpnt->device->id][SCpnt->device->lun]); nsp32_queuecommand_lck() 963 cur_lunt->SCpnt = SCpnt; nsp32_queuecommand_lck() 967 data->cur_id = SCpnt->device->id; nsp32_queuecommand_lck() 968 data->cur_lun = SCpnt->device->lun; nsp32_queuecommand_lck() 970 ret = nsp32_setup_sg_table(SCpnt); nsp32_queuecommand_lck() 973 SCpnt->result = DID_ERROR << 16; nsp32_queuecommand_lck() 974 nsp32_scsi_done(SCpnt); nsp32_queuecommand_lck() 979 nsp32_build_identify(SCpnt); nsp32_queuecommand_lck() 986 target = &data->target[scmd_id(SCpnt)]; nsp32_queuecommand_lck() 994 nsp32_build_sdtr(SCpnt, period, offset); nsp32_queuecommand_lck() 1032 SCpnt->device->id, target->sync_flag, target->syncreg, nsp32_queuecommand_lck() 1037 ret = nsp32_selection_autopara(SCpnt); nsp32_queuecommand_lck() 1039 ret = nsp32_selection_autoscsi(SCpnt); nsp32_queuecommand_lck() 1044 nsp32_scsi_done(SCpnt); nsp32_queuecommand_lck() 1164 struct scsi_cmnd *SCpnt = data->CurrentSC; do_nsp32_isr() local 1196 SCpnt->result = DID_BAD_TARGET << 16; do_nsp32_isr() 1197 nsp32_scsi_done(SCpnt); do_nsp32_isr() 1213 if (SCpnt != NULL) { do_nsp32_isr() 1214 SCpnt->result = DID_RESET << 16; do_nsp32_isr() 1215 nsp32_scsi_done(SCpnt); do_nsp32_isr() 1220 if (SCpnt == NULL) { do_nsp32_isr() 1221 nsp32_msg(KERN_WARNING, "SCpnt==NULL this can't be happened"); do_nsp32_isr() 1242 SCpnt->result = DID_TIME_OUT << 16; do_nsp32_isr() 1243 nsp32_scsi_done(SCpnt); do_nsp32_isr() 1268 (scsi_get_resid(SCpnt) > 0) && do_nsp32_isr() 1271 //nsp32_pio_read(SCpnt); do_nsp32_isr() 1289 scsi_set_resid(SCpnt, 0); /* all data transferred! */ do_nsp32_isr() 1296 nsp32_msgin_occur(SCpnt, irq_stat, auto_stat); do_nsp32_isr() 1303 nsp32_msgout_occur(SCpnt); do_nsp32_isr() 1310 ret = nsp32_busfree_occur(SCpnt, auto_stat); do_nsp32_isr() 1318 * Read CSB and substitute CSB for SCpnt->result do_nsp32_isr() 1324 SCpnt->result = (int)nsp32_read1(base, SCSI_CSB_IN); do_nsp32_isr() 1363 //nsp32_pio_write(SCpnt); do_nsp32_isr() 1370 //nsp32_pio_read(SCpnt); do_nsp32_isr() 1377 SCpnt->SCp.Status = nsp32_read1(base, SCSI_CSB_IN); do_nsp32_isr() 1397 nsp32_msgin_occur(SCpnt, irq_stat, 0); do_nsp32_isr() 1520 * Be careful setting SCpnt->result = DID_* before calling this function. 1522 static void nsp32_scsi_done(struct scsi_cmnd *SCpnt) nsp32_scsi_done() argument 1524 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_scsi_done() 1525 unsigned int base = SCpnt->device->host->io_port; nsp32_scsi_done() 1527 scsi_dma_unmap(SCpnt); nsp32_scsi_done() 1538 (*SCpnt->scsi_done)(SCpnt); nsp32_scsi_done() 1543 data->cur_lunt->SCpnt = NULL; nsp32_scsi_done() 1560 static int nsp32_busfree_occur(struct scsi_cmnd *SCpnt, unsigned short execph) nsp32_busfree_occur() argument 1562 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_busfree_occur() 1563 unsigned int base = SCpnt->device->host->io_port; nsp32_busfree_occur() 1621 nsp32_adjust_busfree(SCpnt, s_sacklen); nsp32_busfree_occur() 1680 SCpnt->SCp.Status = nsp32_read1(base, SCSI_CSB_IN); nsp32_busfree_occur() 1681 SCpnt->SCp.Message = 0; nsp32_busfree_occur() 1684 SCpnt->SCp.Status, scsi_get_resid(SCpnt)); nsp32_busfree_occur() 1685 SCpnt->result = (DID_OK << 16) | nsp32_busfree_occur() 1686 (SCpnt->SCp.Message << 8) | nsp32_busfree_occur() 1687 (SCpnt->SCp.Status << 0); nsp32_busfree_occur() 1688 nsp32_scsi_done(SCpnt); nsp32_busfree_occur() 1693 SCpnt->SCp.Status = nsp32_read1(base, SCSI_CSB_IN); nsp32_busfree_occur() 1694 SCpnt->SCp.Message = 4; nsp32_busfree_occur() 1703 //SCpnt->result = (DID_OK << 16) | (SCpnt->SCp.Message << 8) | (SCpnt->SCp.Status << 0); nsp32_busfree_occur() 1704 SCpnt->result = DID_ERROR << 16; nsp32_busfree_occur() 1705 nsp32_scsi_done(SCpnt); nsp32_busfree_occur() 1718 static void nsp32_adjust_busfree(struct scsi_cmnd *SCpnt, unsigned int s_sacklen) nsp32_adjust_busfree() argument 1720 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_adjust_busfree() 1728 nsp32_dbg(NSP32_DEBUG_SGLIST, "old resid=0x%x", scsi_get_resid(SCpnt)); nsp32_adjust_busfree() 1772 if (scsi_get_resid(SCpnt) < sentlen) { nsp32_adjust_busfree() 1776 scsi_set_resid(SCpnt, scsi_get_resid(SCpnt) - sentlen); nsp32_adjust_busfree() 1777 nsp32_dbg(NSP32_DEBUG_SGLIST, "new resid=0x%x", scsi_get_resid(SCpnt)); nsp32_adjust_busfree() 1791 static void nsp32_msgout_occur(struct scsi_cmnd *SCpnt) nsp32_msgout_occur() argument 1793 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_msgout_occur() 1794 unsigned int base = SCpnt->device->host->io_port; nsp32_msgout_occur() 1807 nsp32_build_nop(SCpnt); nsp32_msgout_occur() 1837 //nsp32_restart_autoscsi(SCpnt, command); nsp32_msgout_occur() 1867 static void nsp32_restart_autoscsi(struct scsi_cmnd *SCpnt, unsigned short command) nsp32_restart_autoscsi() argument 1869 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_restart_autoscsi() 1906 if (scsi_bufflen(SCpnt) > 0) { nsp32_restart_autoscsi() 1933 static void nsp32_msgin_occur(struct scsi_cmnd *SCpnt, nsp32_msgin_occur() argument 1937 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_msgin_occur() 1938 unsigned int base = SCpnt->device->host->io_port; nsp32_msgin_occur() 1978 ret = nsp32_reselection(SCpnt, newlun); nsp32_msgin_occur() 2015 nsp32_adjust_busfree(SCpnt, s_sacklen); nsp32_msgin_occur() 2140 nsp32_analyze_sdtr(SCpnt); nsp32_msgin_occur() 2200 nsp32_restart_autoscsi(SCpnt, command); nsp32_msgin_occur() 2221 nsp32_build_reject(SCpnt); nsp32_msgin_occur() 2230 static void nsp32_analyze_sdtr(struct scsi_cmnd *SCpnt) nsp32_analyze_sdtr() argument 2232 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_analyze_sdtr() 2334 nsp32_build_sdtr(SCpnt, 0, ASYNC_OFFSET); nsp32_analyze_sdtr() 2337 nsp32_build_sdtr(SCpnt, get_period, get_offset); nsp32_analyze_sdtr() 2350 nsp32_build_reject(SCpnt); nsp32_analyze_sdtr() 2671 .SCpnt = NULL, nsp32_detect() 2820 static int nsp32_eh_abort(struct scsi_cmnd *SCpnt) nsp32_eh_abort() argument 2822 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_eh_abort() 2823 unsigned int base = SCpnt->device->host->io_port; nsp32_eh_abort() 2827 if (data->cur_lunt->SCpnt == NULL) { nsp32_eh_abort() 2841 SCpnt->result = DID_ABORT << 16; nsp32_eh_abort() 2842 nsp32_scsi_done(SCpnt); nsp32_eh_abort() 2848 static int nsp32_eh_bus_reset(struct scsi_cmnd *SCpnt) nsp32_eh_bus_reset() argument 2850 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_eh_bus_reset() 2851 unsigned int base = SCpnt->device->host->io_port; nsp32_eh_bus_reset() 2853 spin_lock_irq(SCpnt->device->host->host_lock); nsp32_eh_bus_reset() 2856 nsp32_dbg(NSP32_DEBUG_BUSRESET, "SCpnt=0x%x", SCpnt); nsp32_eh_bus_reset() 2862 spin_unlock_irq(SCpnt->device->host->host_lock); nsp32_eh_bus_reset() 2908 static int nsp32_eh_host_reset(struct scsi_cmnd *SCpnt) nsp32_eh_host_reset() argument 2910 struct Scsi_Host *host = SCpnt->device->host; nsp32_eh_host_reset() 2911 unsigned int base = SCpnt->device->host->io_port; nsp32_eh_host_reset() 2915 nsp32_dbg(NSP32_DEBUG_BUSRESET, "SCpnt=0x%x", SCpnt); nsp32_eh_host_reset() 2917 spin_lock_irq(SCpnt->device->host->host_lock); nsp32_eh_host_reset() 2924 spin_unlock_irq(SCpnt->device->host->host_lock); nsp32_eh_host_reset()
|
H A D | eata.c | 87 * + Use SCpnt->sc_data_direction if set. 806 struct scsi_cmnd *SCpnt; member in struct:mscp 1604 struct scsi_cmnd *SCpnt; map_dma() local 1607 SCpnt = cpp->SCpnt; map_dma() 1608 pci_dir = SCpnt->sc_data_direction; map_dma() 1610 if (SCpnt->sense_buffer) map_dma() 1612 H2DEV(pci_map_single(ha->pdev, SCpnt->sense_buffer, map_dma() 1617 if (!scsi_sg_count(SCpnt)) { map_dma() 1622 count = pci_map_sg(ha->pdev, scsi_sglist(SCpnt), scsi_sg_count(SCpnt), map_dma() 1626 scsi_for_each_sg(SCpnt, sg, count, k) { scsi_for_each_sg() 1633 scsi_sg_count(SCpnt) * 1636 cpp->data_len = H2DEV((scsi_sg_count(SCpnt) * sizeof(struct sg_list))); 1643 struct scsi_cmnd *SCpnt; unmap_dma() local 1646 SCpnt = cpp->SCpnt; unmap_dma() 1647 pci_dir = SCpnt->sc_data_direction; unmap_dma() 1653 if (scsi_sg_count(SCpnt)) unmap_dma() 1654 pci_unmap_sg(ha->pdev, scsi_sglist(SCpnt), scsi_sg_count(SCpnt), unmap_dma() 1669 struct scsi_cmnd *SCpnt; sync_dma() local 1672 SCpnt = cpp->SCpnt; sync_dma() 1673 pci_dir = SCpnt->sc_data_direction; sync_dma() 1680 if (scsi_sg_count(SCpnt)) sync_dma() 1681 pci_dma_sync_sg_for_cpu(ha->pdev, scsi_sglist(SCpnt), sync_dma() 1682 scsi_sg_count(SCpnt), pci_dir); sync_dma() 1710 struct scsi_cmnd *SCpnt; scsi_to_dev_dir() local 1713 SCpnt = cpp->SCpnt; scsi_to_dev_dir() 1715 if (SCpnt->sc_data_direction == DMA_FROM_DEVICE) { scsi_to_dev_dir() 1719 } else if (SCpnt->sc_data_direction == DMA_TO_DEVICE) { scsi_to_dev_dir() 1723 } else if (SCpnt->sc_data_direction == DMA_NONE) { scsi_to_dev_dir() 1729 if (SCpnt->sc_data_direction != DMA_BIDIRECTIONAL) scsi_to_dev_dir() 1730 panic("%s: qcomm, invalid SCpnt->sc_data_direction.\n", scsi_to_dev_dir() 1734 if (SCpnt->cmnd[0] == data_out_cmds[k]) { scsi_to_dev_dir() 1741 if (SCpnt->cmnd[0] == data_none_cmds[k]) { scsi_to_dev_dir() 1748 static int eata2x_queuecommand_lck(struct scsi_cmnd *SCpnt, eata2x_queuecommand_lck() argument 1751 struct Scsi_Host *shost = SCpnt->device->host; eata2x_queuecommand_lck() 1756 if (SCpnt->host_scribble) eata2x_queuecommand_lck() 1757 panic("%s: qcomm, SCpnt %p already active.\n", eata2x_queuecommand_lck() 1758 ha->board_name, SCpnt); eata2x_queuecommand_lck() 1786 SCpnt->scsi_done = done; eata2x_queuecommand_lck() 1788 SCpnt->host_scribble = (unsigned char *)&cpp->cpp_index; eata2x_queuecommand_lck() 1791 scmd_printk(KERN_INFO, SCpnt, eata2x_queuecommand_lck() 1797 if (SCpnt->device->type == TYPE_TAPE) eata2x_queuecommand_lck() 1801 cpp->channel = SCpnt->device->channel; eata2x_queuecommand_lck() 1802 cpp->target = SCpnt->device->id; eata2x_queuecommand_lck() 1803 cpp->lun = SCpnt->device->lun; eata2x_queuecommand_lck() 1804 cpp->SCpnt = SCpnt; eata2x_queuecommand_lck() 1805 memcpy(cpp->cdb, SCpnt->cmnd, SCpnt->cmd_len); eata2x_queuecommand_lck() 1807 /* Use data transfer direction SCpnt->sc_data_direction */ eata2x_queuecommand_lck() 1813 if (linked_comm && SCpnt->device->queue_depth > 2 eata2x_queuecommand_lck() 1814 && TLDEV(SCpnt->device->type)) { eata2x_queuecommand_lck() 1816 flush_dev(SCpnt->device, blk_rq_pos(SCpnt->request), ha, 0); eata2x_queuecommand_lck() 1823 SCpnt->host_scribble = NULL; eata2x_queuecommand_lck() 1824 scmd_printk(KERN_INFO, SCpnt, "qcomm, adapter busy.\n"); eata2x_queuecommand_lck() 1864 if (SCarg != ha->cp[i].SCpnt) eata2x_eh_abort() 1865 panic("%s: abort, mbox %d, SCarg %p, cp SCpnt %p.\n", eata2x_eh_abort() 1866 ha->board_name, i, SCarg, ha->cp[i].SCpnt); eata2x_eh_abort() 1903 struct scsi_cmnd *SCpnt; eata2x_eh_host_reset() local 1946 if (!(SCpnt = ha->cp[i].SCpnt)) eata2x_eh_host_reset() 1947 panic("%s: reset, mbox %d, SCpnt == NULL.\n", ha->board_name, i); eata2x_eh_host_reset() 1961 if (SCpnt->host_scribble == NULL) eata2x_eh_host_reset() 1962 panic("%s: reset, mbox %d, garbled SCpnt.\n", ha->board_name, i); eata2x_eh_host_reset() 1964 if (*(unsigned int *)SCpnt->host_scribble != i) eata2x_eh_host_reset() 1967 if (SCpnt->scsi_done == NULL) eata2x_eh_host_reset() 1968 panic("%s: reset, mbox %d, SCpnt->scsi_done == NULL.\n", eata2x_eh_host_reset() 1971 if (SCpnt == SCarg) eata2x_eh_host_reset() 2003 SCpnt = ha->cp[i].SCpnt; eata2x_eh_host_reset() 2005 SCpnt->result = DID_RESET << 16; eata2x_eh_host_reset() 2006 SCpnt->host_scribble = NULL; eata2x_eh_host_reset() 2017 SCpnt = ha->cp[i].SCpnt; eata2x_eh_host_reset() 2019 SCpnt->result = DID_RESET << 16; eata2x_eh_host_reset() 2020 SCpnt->host_scribble = NULL; eata2x_eh_host_reset() 2034 SCpnt->scsi_done(SCpnt); eata2x_eh_host_reset() 2101 struct scsi_cmnd *SCpnt; reorder() local 2128 SCpnt = cpp->SCpnt; reorder() 2133 if (blk_rq_pos(SCpnt->request) < minsec) reorder() 2134 minsec = blk_rq_pos(SCpnt->request); reorder() 2135 if (blk_rq_pos(SCpnt->request) > maxsec) reorder() 2136 maxsec = blk_rq_pos(SCpnt->request); reorder() 2138 sl[n] = blk_rq_pos(SCpnt->request); reorder() 2139 ioseek += blk_rq_sectors(SCpnt->request); reorder() 2178 SCpnt = cpp->SCpnt; reorder() 2179 ll[n] = blk_rq_sectors(SCpnt->request); reorder() 2180 pl[n] = SCpnt->serial_number; reorder() 2223 SCpnt = cpp->SCpnt; reorder() 2224 scmd_printk(KERN_INFO, SCpnt, reorder() 2229 n_ready, blk_rq_pos(SCpnt->request), reorder() 2230 blk_rq_sectors(SCpnt->request), cursec, YESNO(s), reorder() 2241 struct scsi_cmnd *SCpnt; flush_dev() local 2251 SCpnt = cpp->SCpnt; flush_dev() 2253 if (SCpnt->device != dev) flush_dev() 2268 SCpnt = cpp->SCpnt; flush_dev() 2271 scmd_printk(KERN_INFO, SCpnt, flush_dev() 2286 struct scsi_cmnd *SCpnt; ihdlr() local 2379 SCpnt = cpp->SCpnt; ihdlr() 2381 if (SCpnt == NULL) ihdlr() 2382 panic("%s: ihdlr, mbox %d, SCpnt == NULL.\n", ha->board_name, i); ihdlr() 2384 if (SCpnt->host_scribble == NULL) ihdlr() 2385 panic("%s: ihdlr, mbox %d, SCpnt %p garbled.\n", ha->board_name, ihdlr() 2386 i, SCpnt); ihdlr() 2388 if (*(unsigned int *)SCpnt->host_scribble != i) ihdlr() 2391 *(unsigned int *)SCpnt->host_scribble); ihdlr() 2395 if (linked_comm && SCpnt->device->queue_depth > 2 ihdlr() 2396 && TLDEV(SCpnt->device->type)) ihdlr() 2397 flush_dev(SCpnt->device, blk_rq_pos(SCpnt->request), ha, 1); ihdlr() 2410 if (tstatus == BUSY && SCpnt->device->type != TYPE_TAPE) ihdlr() 2414 else if (tstatus != GOOD && SCpnt->device->type == TYPE_DISK ihdlr() 2415 && ha->target_redo[SCpnt->device->id][SCpnt-> ihdlr() 2422 && SCpnt->device->type == TYPE_DISK ihdlr() 2423 && (SCpnt->sense_buffer[2] & 0xf) == RECOVERED_ERROR) ihdlr() 2430 ha->target_redo[SCpnt->device->id][SCpnt->device-> ihdlr() 2433 if (spp->target_status && SCpnt->device->type == TYPE_DISK && ihdlr() 2435 (SCpnt->sense_buffer[2] & 0xf) == NOT_READY))) ihdlr() 2439 SCpnt->device->channel, SCpnt->device->id, ihdlr() 2440 (u8)SCpnt->device->lun, ihdlr() 2441 spp->target_status, SCpnt->sense_buffer[2]); ihdlr() 2443 ha->target_to[SCpnt->device->id][SCpnt->device->channel] = 0; ihdlr() 2445 if (ha->last_retried_pid == SCpnt->serial_number) ihdlr() 2452 if (ha->target_to[SCpnt->device->id][SCpnt->device->channel] > 1) ihdlr() 2456 ha->target_to[SCpnt->device->id][SCpnt->device-> ihdlr() 2470 if (SCpnt->device->type != TYPE_TAPE ihdlr() 2480 ha->last_retried_pid = SCpnt->serial_number; ihdlr() 2498 SCpnt->result = status | spp->target_status; ihdlr() 2501 if (SCpnt->result || do_trace) ihdlr() 2508 scmd_printk(KERN_INFO, SCpnt, "ihdlr, mbox %2d, err 0x%x:%x," ihdlr() 2516 SCpnt->host_scribble = NULL; ihdlr() 2518 SCpnt->scsi_done(SCpnt); ihdlr()
|
H A D | sr.c | 82 static int sr_init_command(struct scsi_cmnd *SCpnt); 318 static int sr_done(struct scsi_cmnd *SCpnt) sr_done() argument 320 int result = SCpnt->result; sr_done() 321 int this_count = scsi_bufflen(SCpnt); sr_done() 325 struct scsi_cd *cd = scsi_cd(SCpnt->request->rq_disk); sr_done() 328 scmd_printk(KERN_INFO, SCpnt, "done: %x\n", result); sr_done() 338 (SCpnt->sense_buffer[0] & 0x7f) == 0x70) { /* Sense current */ sr_done() 339 switch (SCpnt->sense_buffer[2]) { sr_done() 343 if (!(SCpnt->sense_buffer[0] & 0x90)) sr_done() 345 error_sector = (SCpnt->sense_buffer[3] << 24) | sr_done() 346 (SCpnt->sense_buffer[4] << 16) | sr_done() 347 (SCpnt->sense_buffer[5] << 8) | sr_done() 348 SCpnt->sense_buffer[6]; sr_done() 349 if (SCpnt->request->bio != NULL) sr_done() 351 bio_sectors(SCpnt->request->bio); sr_done() 358 blk_rq_pos(SCpnt->request)) << 9; sr_done() 386 static int sr_init_command(struct scsi_cmnd *SCpnt) sr_init_command() argument 390 struct request *rq = SCpnt->request; sr_init_command() 393 ret = scsi_init_io(SCpnt); sr_init_command() 396 SCpnt = rq->special; sr_init_command() 403 SCSI_LOG_HLQUEUE(1, scmd_printk(KERN_INFO, SCpnt, sr_init_command() 407 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, sr_init_command() 409 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, sr_init_command() 410 "Retry with 0x%p\n", SCpnt)); sr_init_command() 431 scmd_printk(KERN_INFO, SCpnt, sr_init_command() 436 scmd_printk(KERN_ERR, SCpnt, "bad sector size %d\n", s_size); sr_init_command() 443 SCpnt->cmnd[0] = WRITE_10; sr_init_command() 446 SCpnt->cmnd[0] = READ_10; sr_init_command() 454 int i, size = 0, sg_count = scsi_sg_count(SCpnt); sr_init_command() 456 scsi_for_each_sg(SCpnt, sg, sg_count, i) sr_init_command() 459 if (size != scsi_bufflen(SCpnt)) { sr_init_command() 460 scmd_printk(KERN_ERR, SCpnt, sr_init_command() 462 size, scsi_bufflen(SCpnt)); sr_init_command() 463 if (scsi_bufflen(SCpnt) > size) sr_init_command() 464 SCpnt->sdb.length = size; sr_init_command() 472 (scsi_bufflen(SCpnt) % s_size)) { sr_init_command() 473 scmd_printk(KERN_NOTICE, SCpnt, "unaligned transfer\n"); sr_init_command() 477 this_count = (scsi_bufflen(SCpnt) >> 9) / (s_size >> 9); sr_init_command() 480 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, sr_init_command() 486 SCpnt->cmnd[1] = 0; sr_init_command() 491 SCpnt->sdb.length = this_count * s_size; sr_init_command() 494 SCpnt->cmnd[2] = (unsigned char) (block >> 24) & 0xff; sr_init_command() 495 SCpnt->cmnd[3] = (unsigned char) (block >> 16) & 0xff; sr_init_command() 496 SCpnt->cmnd[4] = (unsigned char) (block >> 8) & 0xff; sr_init_command() 497 SCpnt->cmnd[5] = (unsigned char) block & 0xff; sr_init_command() 498 SCpnt->cmnd[6] = SCpnt->cmnd[9] = 0; sr_init_command() 499 SCpnt->cmnd[7] = (unsigned char) (this_count >> 8) & 0xff; sr_init_command() 500 SCpnt->cmnd[8] = (unsigned char) this_count & 0xff; sr_init_command() 507 SCpnt->transfersize = cd->device->sector_size; sr_init_command() 508 SCpnt->underflow = this_count << 9; sr_init_command() 509 SCpnt->allowed = MAX_RETRIES; sr_init_command()
|
H A D | sd.c | 113 static int sd_init_command(struct scsi_cmnd *SCpnt); 114 static void sd_uninit_command(struct scsi_cmnd *SCpnt); 898 static int sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt) sd_setup_read_write_cmnd() argument 900 struct request *rq = SCpnt->request; sd_setup_read_write_cmnd() 901 struct scsi_device *sdp = SCpnt->device; sd_setup_read_write_cmnd() 911 ret = scsi_init_io(SCpnt); sd_setup_read_write_cmnd() 914 SCpnt = rq->special; sd_setup_read_write_cmnd() 922 scmd_printk(KERN_INFO, SCpnt, sd_setup_read_write_cmnd() 928 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, sd_setup_read_write_cmnd() 931 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, sd_setup_read_write_cmnd() 932 "Retry with 0x%p\n", SCpnt)); sd_setup_read_write_cmnd() 962 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, "block=%llu\n", sd_setup_read_write_cmnd() 978 scmd_printk(KERN_ERR, SCpnt, sd_setup_read_write_cmnd() 988 scmd_printk(KERN_ERR, SCpnt, sd_setup_read_write_cmnd() 998 scmd_printk(KERN_ERR, SCpnt, sd_setup_read_write_cmnd() 1007 SCpnt->cmnd[0] = WRITE_6; sd_setup_read_write_cmnd() 1010 sd_dif_prepare(SCpnt); sd_setup_read_write_cmnd() 1013 SCpnt->cmnd[0] = READ_6; sd_setup_read_write_cmnd() 1015 scmd_printk(KERN_ERR, SCpnt, "Unknown command %llx\n", (unsigned long long) rq->cmd_flags); sd_setup_read_write_cmnd() 1019 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, sd_setup_read_write_cmnd() 1025 dix = scsi_prot_sg_count(SCpnt); sd_setup_read_write_cmnd() 1026 dif = scsi_host_dif_capable(SCpnt->device->host, sdkp->protection_type); sd_setup_read_write_cmnd() 1029 protect = sd_setup_protect_cmnd(SCpnt, dix, dif); sd_setup_read_write_cmnd() 1034 SCpnt->cmnd = mempool_alloc(sd_cdb_pool, GFP_ATOMIC); sd_setup_read_write_cmnd() 1036 if (unlikely(SCpnt->cmnd == NULL)) { sd_setup_read_write_cmnd() 1041 SCpnt->cmd_len = SD_EXT_CDB_SIZE; sd_setup_read_write_cmnd() 1042 memset(SCpnt->cmnd, 0, SCpnt->cmd_len); sd_setup_read_write_cmnd() 1043 SCpnt->cmnd[0] = VARIABLE_LENGTH_CMD; sd_setup_read_write_cmnd() 1044 SCpnt->cmnd[7] = 0x18; sd_setup_read_write_cmnd() 1045 SCpnt->cmnd[9] = (rq_data_dir(rq) == READ) ? READ_32 : WRITE_32; sd_setup_read_write_cmnd() 1046 SCpnt->cmnd[10] = protect | ((rq->cmd_flags & REQ_FUA) ? 0x8 : 0); sd_setup_read_write_cmnd() 1049 SCpnt->cmnd[12] = sizeof(block) > 4 ? (unsigned char) (block >> 56) & 0xff : 0; sd_setup_read_write_cmnd() 1050 SCpnt->cmnd[13] = sizeof(block) > 4 ? (unsigned char) (block >> 48) & 0xff : 0; sd_setup_read_write_cmnd() 1051 SCpnt->cmnd[14] = sizeof(block) > 4 ? (unsigned char) (block >> 40) & 0xff : 0; sd_setup_read_write_cmnd() 1052 SCpnt->cmnd[15] = sizeof(block) > 4 ? (unsigned char) (block >> 32) & 0xff : 0; sd_setup_read_write_cmnd() 1053 SCpnt->cmnd[16] = (unsigned char) (block >> 24) & 0xff; sd_setup_read_write_cmnd() 1054 SCpnt->cmnd[17] = (unsigned char) (block >> 16) & 0xff; sd_setup_read_write_cmnd() 1055 SCpnt->cmnd[18] = (unsigned char) (block >> 8) & 0xff; sd_setup_read_write_cmnd() 1056 SCpnt->cmnd[19] = (unsigned char) block & 0xff; sd_setup_read_write_cmnd() 1059 SCpnt->cmnd[20] = (unsigned char) (block >> 24) & 0xff; sd_setup_read_write_cmnd() 1060 SCpnt->cmnd[21] = (unsigned char) (block >> 16) & 0xff; sd_setup_read_write_cmnd() 1061 SCpnt->cmnd[22] = (unsigned char) (block >> 8) & 0xff; sd_setup_read_write_cmnd() 1062 SCpnt->cmnd[23] = (unsigned char) block & 0xff; sd_setup_read_write_cmnd() 1065 SCpnt->cmnd[28] = (unsigned char) (this_count >> 24) & 0xff; sd_setup_read_write_cmnd() 1066 SCpnt->cmnd[29] = (unsigned char) (this_count >> 16) & 0xff; sd_setup_read_write_cmnd() 1067 SCpnt->cmnd[30] = (unsigned char) (this_count >> 8) & 0xff; sd_setup_read_write_cmnd() 1068 SCpnt->cmnd[31] = (unsigned char) this_count & 0xff; sd_setup_read_write_cmnd() 1070 SCpnt->cmnd[0] += READ_16 - READ_6; sd_setup_read_write_cmnd() 1071 SCpnt->cmnd[1] = protect | ((rq->cmd_flags & REQ_FUA) ? 0x8 : 0); sd_setup_read_write_cmnd() 1072 SCpnt->cmnd[2] = sizeof(block) > 4 ? (unsigned char) (block >> 56) & 0xff : 0; sd_setup_read_write_cmnd() 1073 SCpnt->cmnd[3] = sizeof(block) > 4 ? (unsigned char) (block >> 48) & 0xff : 0; sd_setup_read_write_cmnd() 1074 SCpnt->cmnd[4] = sizeof(block) > 4 ? (unsigned char) (block >> 40) & 0xff : 0; sd_setup_read_write_cmnd() 1075 SCpnt->cmnd[5] = sizeof(block) > 4 ? (unsigned char) (block >> 32) & 0xff : 0; sd_setup_read_write_cmnd() 1076 SCpnt->cmnd[6] = (unsigned char) (block >> 24) & 0xff; sd_setup_read_write_cmnd() 1077 SCpnt->cmnd[7] = (unsigned char) (block >> 16) & 0xff; sd_setup_read_write_cmnd() 1078 SCpnt->cmnd[8] = (unsigned char) (block >> 8) & 0xff; sd_setup_read_write_cmnd() 1079 SCpnt->cmnd[9] = (unsigned char) block & 0xff; sd_setup_read_write_cmnd() 1080 SCpnt->cmnd[10] = (unsigned char) (this_count >> 24) & 0xff; sd_setup_read_write_cmnd() 1081 SCpnt->cmnd[11] = (unsigned char) (this_count >> 16) & 0xff; sd_setup_read_write_cmnd() 1082 SCpnt->cmnd[12] = (unsigned char) (this_count >> 8) & 0xff; sd_setup_read_write_cmnd() 1083 SCpnt->cmnd[13] = (unsigned char) this_count & 0xff; sd_setup_read_write_cmnd() 1084 SCpnt->cmnd[14] = SCpnt->cmnd[15] = 0; sd_setup_read_write_cmnd() 1086 scsi_device_protection(SCpnt->device) || sd_setup_read_write_cmnd() 1087 SCpnt->device->use_10_for_rw) { sd_setup_read_write_cmnd() 1088 SCpnt->cmnd[0] += READ_10 - READ_6; sd_setup_read_write_cmnd() 1089 SCpnt->cmnd[1] = protect | ((rq->cmd_flags & REQ_FUA) ? 0x8 : 0); sd_setup_read_write_cmnd() 1090 SCpnt->cmnd[2] = (unsigned char) (block >> 24) & 0xff; sd_setup_read_write_cmnd() 1091 SCpnt->cmnd[3] = (unsigned char) (block >> 16) & 0xff; sd_setup_read_write_cmnd() 1092 SCpnt->cmnd[4] = (unsigned char) (block >> 8) & 0xff; sd_setup_read_write_cmnd() 1093 SCpnt->cmnd[5] = (unsigned char) block & 0xff; sd_setup_read_write_cmnd() 1094 SCpnt->cmnd[6] = SCpnt->cmnd[9] = 0; sd_setup_read_write_cmnd() 1095 SCpnt->cmnd[7] = (unsigned char) (this_count >> 8) & 0xff; sd_setup_read_write_cmnd() 1096 SCpnt->cmnd[8] = (unsigned char) this_count & 0xff; sd_setup_read_write_cmnd() 1105 scmd_printk(KERN_ERR, SCpnt, sd_setup_read_write_cmnd() 1110 SCpnt->cmnd[1] |= (unsigned char) ((block >> 16) & 0x1f); sd_setup_read_write_cmnd() 1111 SCpnt->cmnd[2] = (unsigned char) ((block >> 8) & 0xff); sd_setup_read_write_cmnd() 1112 SCpnt->cmnd[3] = (unsigned char) block & 0xff; sd_setup_read_write_cmnd() 1113 SCpnt->cmnd[4] = (unsigned char) this_count; sd_setup_read_write_cmnd() 1114 SCpnt->cmnd[5] = 0; sd_setup_read_write_cmnd() 1116 SCpnt->sdb.length = this_count * sdp->sector_size; sd_setup_read_write_cmnd() 1123 SCpnt->transfersize = sdp->sector_size; sd_setup_read_write_cmnd() 1124 SCpnt->underflow = this_count << 9; sd_setup_read_write_cmnd() 1125 SCpnt->allowed = SD_MAX_RETRIES; sd_setup_read_write_cmnd() 1150 static void sd_uninit_command(struct scsi_cmnd *SCpnt) sd_uninit_command() argument 1152 struct request *rq = SCpnt->request; sd_uninit_command() 1157 if (SCpnt->cmnd != rq->cmd) { sd_uninit_command() 1158 mempool_free(SCpnt->cmnd, sd_cdb_pool); sd_uninit_command() 1159 SCpnt->cmnd = NULL; sd_uninit_command() 1160 SCpnt->cmd_len = 0; sd_uninit_command() 1756 * @SCpnt: mid-level's per command structure. 1760 static int sd_done(struct scsi_cmnd *SCpnt) sd_done() argument 1762 int result = SCpnt->result; sd_done() 1763 unsigned int good_bytes = result ? 0 : scsi_bufflen(SCpnt); sd_done() 1765 struct scsi_disk *sdkp = scsi_disk(SCpnt->request->rq_disk); sd_done() 1766 struct request *req = SCpnt->request; sd_done() 1769 unsigned char op = SCpnt->cmnd[0]; sd_done() 1770 unsigned char unmap = SCpnt->cmnd[1] & 8; sd_done() 1775 scsi_set_resid(SCpnt, 0); sd_done() 1778 scsi_set_resid(SCpnt, blk_rq_bytes(req)); sd_done() 1783 sense_valid = scsi_command_normalize_sense(SCpnt, &sshdr); sd_done() 1796 good_bytes = sd_completed_bytes(SCpnt); sd_done() 1799 good_bytes = scsi_bufflen(SCpnt); sd_done() 1806 SCpnt->result = 0; sd_done() 1807 memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); sd_done() 1811 good_bytes = sd_completed_bytes(SCpnt); sd_done() 1815 good_bytes = sd_completed_bytes(SCpnt); sd_done() 1841 SCSI_LOG_HLCOMPLETE(1, scmd_printk(KERN_INFO, SCpnt, sd_done() 1843 good_bytes, scsi_bufflen(SCpnt))); sd_done() 1845 if (rq_data_dir(SCpnt->request) == READ && scsi_prot_sg_count(SCpnt)) sd_done() 1846 sd_dif_complete(SCpnt, good_bytes); sd_done()
|
H A D | aha1740.c | 247 SCtmp = ecbptr->SCpnt; aha1740_intr_handle() 314 static int aha1740_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) aha1740_queuecommand_lck() argument 317 unchar *cmd = (unchar *) SCpnt->cmnd; aha1740_queuecommand_lck() 318 unchar target = scmd_id(SCpnt); aha1740_queuecommand_lck() 319 struct aha1740_hostdata *host = HOSTDATA(SCpnt->device->host); aha1740_queuecommand_lck() 327 SCpnt->result = 0; aha1740_queuecommand_lck() 328 done(SCpnt); aha1740_queuecommand_lck() 342 for (i = 0; i < SCpnt->cmd_len; i++) printk("%02x ", cmd[i]); aha1740_queuecommand_lck() 347 spin_lock_irqsave(SCpnt->device->host->host_lock, flags); aha1740_queuecommand_lck() 366 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); aha1740_queuecommand_lck() 372 host->ecb[ecbno].cdblen = SCpnt->cmd_len; /* SCSI Command aha1740_queuecommand_lck() 382 memcpy(host->ecb[ecbno].cdb, cmd, SCpnt->cmd_len); aha1740_queuecommand_lck() 384 SCpnt->host_scribble = dma_alloc_coherent (&host->edev->dev, aha1740_queuecommand_lck() 387 if(SCpnt->host_scribble == NULL) { aha1740_queuecommand_lck() 391 sgptr = (struct aha1740_sg *) SCpnt->host_scribble; aha1740_queuecommand_lck() 394 nseg = scsi_dma_map(SCpnt); aha1740_queuecommand_lck() 405 scsi_for_each_sg(SCpnt, sg, nseg, i) { scsi_for_each_sg() 420 host->ecb[ecbno].lun = SCpnt->device->lun; 425 host->ecb[ecbno].senseptr = ecb_cpu_to_dma (SCpnt->device->host, 427 host->ecb[ecbno].statusptr = ecb_cpu_to_dma (SCpnt->device->host, 430 host->ecb[ecbno].SCpnt = SCpnt; 456 unsigned int base = SCpnt->device->host->io_port; 459 spin_lock_irqsave(SCpnt->device->host->host_lock, flags); 468 outl (ecb_cpu_to_dma (SCpnt->device->host, host->ecb + ecbno), 479 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
|
H A D | ultrastor.c | 292 static inline void build_sg_list(struct mscp *, struct scsi_cmnd *SCpnt); 683 static inline void build_sg_list(struct mscp *mscp, struct scsi_cmnd *SCpnt) 689 max = scsi_sg_count(SCpnt); 690 scsi_for_each_sg(SCpnt, sg, max, i) { 703 static int ultrastor_queuecommand_lck(struct scsi_cmnd *SCpnt, 735 my_mscp->ca = SCpnt->device->type != TYPE_TAPE; 736 my_mscp->target_id = SCpnt->device->id; 738 my_mscp->lun = SCpnt->device->lun; 739 if (scsi_sg_count(SCpnt)) { 742 build_sg_list(my_mscp, SCpnt); 746 my_mscp->transfer_data = isa_virt_to_bus(scsi_sglist(SCpnt)); 747 my_mscp->transfer_data_length = scsi_bufflen(SCpnt); 752 my_mscp->length_of_scsi_cdbs = SCpnt->cmd_len; 753 memcpy(my_mscp->scsi_cdbs, SCpnt->cmnd, my_mscp->length_of_scsi_cdbs); 756 my_mscp->sense_data = isa_virt_to_bus(&SCpnt->sense_buffer); 758 my_mscp->SCint = SCpnt; 759 SCpnt->host_scribble = (unsigned char *)my_mscp; 801 SCpnt->result = status; 802 done(SCpnt); 845 static int ultrastor_abort(struct scsi_cmnd *SCpnt) 856 struct Scsi_Host *host = SCpnt->device->host; 862 if(!SCpnt->host_scribble) 865 mscp_index = ((struct mscp *)SCpnt->host_scribble) - config.mscp; 952 if (config.mscp[mscp_index].SCint != SCpnt) 954 config.mscp[mscp_index].SCint, SCpnt); 959 if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort"); 963 SCpnt->result = DID_ABORT << 16; 966 done(SCpnt); 972 static int ultrastor_host_reset(struct scsi_cmnd * SCpnt) 976 struct Scsi_Host *host = SCpnt->device->host;
|
H A D | aha152x.c | 564 #define SCDATA(SCpnt) ((struct aha152x_scdata *) (SCpnt)->host_scribble) 565 #define SCNEXT(SCpnt) SCDATA(SCpnt)->next 566 #define SCSEM(SCpnt) SCDATA(SCpnt)->done 915 static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete, aha152x_internal_queue() argument 918 struct Scsi_Host *shpnt = SCpnt->device->host; aha152x_internal_queue() 921 SCpnt->scsi_done = done; aha152x_internal_queue() 922 SCpnt->SCp.phase = not_issued | phase; aha152x_internal_queue() 923 SCpnt->SCp.Status = 0x1; /* Ilegal status by SCSI standard */ aha152x_internal_queue() 924 SCpnt->SCp.Message = 0; aha152x_internal_queue() 925 SCpnt->SCp.have_data_in = 0; aha152x_internal_queue() 926 SCpnt->SCp.sent_command = 0; aha152x_internal_queue() 928 if(SCpnt->SCp.phase & (resetting|check_condition)) { aha152x_internal_queue() 929 if (!SCpnt->host_scribble || SCSEM(SCpnt) || SCNEXT(SCpnt)) { aha152x_internal_queue() 930 scmd_printk(KERN_ERR, SCpnt, "cannot reuse command\n"); aha152x_internal_queue() 934 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC); aha152x_internal_queue() 935 if(!SCpnt->host_scribble) { aha152x_internal_queue() 936 scmd_printk(KERN_ERR, SCpnt, "allocation failed\n"); aha152x_internal_queue() 941 SCNEXT(SCpnt) = NULL; aha152x_internal_queue() 942 SCSEM(SCpnt) = complete; aha152x_internal_queue() 951 if ((phase & resetting) || !scsi_sglist(SCpnt)) { aha152x_internal_queue() 952 SCpnt->SCp.ptr = NULL; aha152x_internal_queue() 953 SCpnt->SCp.this_residual = 0; aha152x_internal_queue() 954 scsi_set_resid(SCpnt, 0); aha152x_internal_queue() 955 SCpnt->SCp.buffer = NULL; aha152x_internal_queue() 956 SCpnt->SCp.buffers_residual = 0; aha152x_internal_queue() 958 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt)); aha152x_internal_queue() 959 SCpnt->SCp.buffer = scsi_sglist(SCpnt); aha152x_internal_queue() 960 SCpnt->SCp.ptr = SG_ADDRESS(SCpnt->SCp.buffer); aha152x_internal_queue() 961 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; aha152x_internal_queue() 962 SCpnt->SCp.buffers_residual = scsi_sg_count(SCpnt) - 1; aha152x_internal_queue() 976 append_SC(&ISSUE_SC, SCpnt); aha152x_internal_queue() 990 static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) aha152x_queue_lck() argument 992 return aha152x_internal_queue(SCpnt, NULL, 0, done); aha152x_queue_lck() 1001 static void reset_done(Scsi_Cmnd *SCpnt) reset_done() argument 1003 if(SCSEM(SCpnt)) { reset_done() 1004 complete(SCSEM(SCpnt)); reset_done() 1014 static int aha152x_abort(Scsi_Cmnd *SCpnt) aha152x_abort() argument 1016 struct Scsi_Host *shpnt = SCpnt->device->host; aha152x_abort() 1022 ptr=remove_SC(&ISSUE_SC, SCpnt); aha152x_abort() 1030 kfree(SCpnt->host_scribble); aha152x_abort() 1031 SCpnt->host_scribble=NULL; aha152x_abort() 1045 scmd_printk(KERN_ERR, SCpnt, aha152x_abort() 1055 static int aha152x_device_reset(Scsi_Cmnd * SCpnt) aha152x_device_reset() argument 1057 struct Scsi_Host *shpnt = SCpnt->device->host; aha152x_device_reset() 1060 unsigned char old_cmd_len = SCpnt->cmd_len; aha152x_device_reset() 1064 if(CURRENT_SC==SCpnt) { aha152x_device_reset() 1065 scmd_printk(KERN_ERR, SCpnt, "cannot reset current device\n"); aha152x_device_reset() 1070 issued = remove_SC(&ISSUE_SC, SCpnt) == NULL; aha152x_device_reset() 1071 disconnected = issued && remove_SC(&DISCONNECTED_SC, SCpnt); aha152x_device_reset() 1074 SCpnt->cmd_len = 0; aha152x_device_reset() 1076 aha152x_internal_queue(SCpnt, &done, resetting, reset_done); aha152x_device_reset() 1082 remove_SC(&ISSUE_SC, SCpnt); aha152x_device_reset() 1086 SCpnt->cmd_len = old_cmd_len; aha152x_device_reset() 1090 if(SCpnt->SCp.phase & resetted) { aha152x_device_reset() 1094 kfree(SCpnt->host_scribble); aha152x_device_reset() 1095 SCpnt->host_scribble=NULL; aha152x_device_reset() 1101 append_SC(&ISSUE_SC, SCpnt); aha152x_device_reset() 1103 append_SC(&DISCONNECTED_SC, SCpnt); aha152x_device_reset() 1171 static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) aha152x_bus_reset() argument 1173 return aha152x_bus_reset_host(SCpnt->device->host); aha152x_bus_reset() 1229 static int aha152x_host_reset(Scsi_Cmnd *SCpnt) aha152x_host_reset() argument 1231 return aha152x_host_reset_host(SCpnt->device->host); aha152x_host_reset()
|
H A D | sgiwd93.c | 136 static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, dma_stop() argument 142 if (!SCpnt) dma_stop() 145 if (SCpnt->SCp.ptr == NULL || SCpnt->SCp.this_residual == 0) dma_stop() 148 hregs = (struct hpc3_scsiregs *) SCpnt->device->host->base; dma_stop() 159 dma_unmap_single(hdata->dev, SCpnt->SCp.dma_handle, dma_stop() 160 SCpnt->SCp.this_residual, dma_stop()
|
H A D | a3000.c | 109 static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, dma_stop() argument 150 if (SCpnt) { dma_stop() 151 if (wh->dma_dir && SCpnt) dma_stop() 152 memcpy(SCpnt->SCp.ptr, wh->dma_bounce_buffer, dma_stop() 153 SCpnt->SCp.this_residual); dma_stop()
|
H A D | wd7000.c | 465 struct scsi_cmnd *SCpnt;/* scsi_cmnd using this SCB */ member in struct:scb 888 scbs[i].SCpnt = NULL; init_scbs() 891 scbs[MAX_SCBS - 1].SCpnt = NULL; init_scbs() 1006 struct scsi_cmnd *SCpnt; wd7000_intr() local 1064 SCpnt = scb->SCpnt; wd7000_intr() 1065 if (--(SCpnt->SCp.phase) <= 0) { /* all scbs are done */ wd7000_intr() 1069 SCpnt->result = errstatus; wd7000_intr() 1073 SCpnt->scsi_done(SCpnt); wd7000_intr() 1084 static int wd7000_queuecommand_lck(struct scsi_cmnd *SCpnt, wd7000_queuecommand_lck() argument 1089 unchar *cdb = (unchar *) SCpnt->cmnd; wd7000_queuecommand_lck() 1093 Adapter *host = (Adapter *) SCpnt->device->host->hostdata; wd7000_queuecommand_lck() 1095 cdblen = SCpnt->cmd_len; wd7000_queuecommand_lck() 1096 idlun = ((SCpnt->device->id << 5) & 0xe0) | (SCpnt->device->lun & 7); wd7000_queuecommand_lck() 1097 SCpnt->scsi_done = done; wd7000_queuecommand_lck() 1098 SCpnt->SCp.phase = 1; wd7000_queuecommand_lck() 1099 scb = alloc_scbs(SCpnt->device->host, 1); wd7000_queuecommand_lck() 1104 scb->SCpnt = SCpnt; /* so we can find stuff later */ wd7000_queuecommand_lck() 1105 SCpnt->host_scribble = (unchar *) scb; wd7000_queuecommand_lck() 1108 nseg = scsi_sg_count(SCpnt); wd7000_queuecommand_lck() 1120 scsi_for_each_sg(SCpnt, sg, nseg, i) { scsi_for_each_sg() 1127 struct scatterlist *sg = scsi_sglist(SCpnt); 1130 any2scsi(scb->maxlen, scsi_bufflen(SCpnt)); 1551 static int wd7000_abort(Scsi_Cmnd * SCpnt) 1553 Adapter *host = (Adapter *) SCpnt->device->host->hostdata; 1568 static int wd7000_host_reset(struct scsi_cmnd *SCpnt) wd7000_host_reset() argument 1570 Adapter *host = (Adapter *) SCpnt->device->host->hostdata; wd7000_host_reset() 1572 spin_lock_irq(SCpnt->device->host->host_lock); wd7000_host_reset() 1575 spin_unlock_irq(SCpnt->device->host->host_lock); wd7000_host_reset() 1581 spin_unlock_irq(SCpnt->device->host->host_lock); wd7000_host_reset()
|
H A D | NCR53c406a.c | 696 static int NCR53c406a_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) NCR53c406a_queue_lck() argument 701 DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n", SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->device->target, (u8)SCpnt->device->lun, scsi_bufflen(SCpnt))); NCR53c406a_queue_lck() 704 VDEB(for (i = 0; i < SCpnt->cmd_len; i++) NCR53c406a_queue_lck() 705 printk("cmd[%d]=%02x ", i, SCpnt->cmnd[i])); NCR53c406a_queue_lck() 709 current_SC = SCpnt; NCR53c406a_queue_lck() 717 outb(scmd_id(SCpnt), DEST_ID); /* set destination */ NCR53c406a_queue_lck() 720 for (i = 0; i < SCpnt->cmd_len; i++) { NCR53c406a_queue_lck() 721 outb(SCpnt->cmnd[i], SCSI_FIFO); NCR53c406a_queue_lck() 731 static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) NCR53c406a_host_reset() argument 735 spin_lock_irq(SCpnt->device->host->host_lock); NCR53c406a_host_reset() 745 spin_unlock_irq(SCpnt->device->host->host_lock); NCR53c406a_host_reset()
|
H A D | fdomain.c | 1421 static int fdomain_16x0_queue_lck(struct scsi_cmnd *SCpnt, fdomain_16x0_queue_lck() argument 1429 SCpnt->target, fdomain_16x0_queue_lck() 1430 *(unsigned char *)SCpnt->cmnd, fdomain_16x0_queue_lck() 1431 scsi_sg_count(SCpnt), fdomain_16x0_queue_lck() 1432 scsi_bufflen(SCpnt)); fdomain_16x0_queue_lck() 1437 current_SC = SCpnt; /* Save this for the done function */ fdomain_16x0_queue_lck() 1474 static void print_info(struct scsi_cmnd *SCpnt) print_info() argument 1480 if (!SCpnt || !SCpnt->device || !SCpnt->device->host) { print_info() 1485 printk(KERN_INFO "%s\n", fdomain_16x0_info( SCpnt->device->host ) ); print_info() 1486 print_banner(SCpnt->device->host); print_info() 1487 switch (SCpnt->SCp.phase) { print_info() 1495 SCpnt->SCp.phase, print_info() 1496 SCpnt->device->id, print_info() 1497 *(unsigned char *)SCpnt->cmnd, print_info() 1498 scsi_sg_count(SCpnt), print_info() 1499 scsi_bufflen(SCpnt)); print_info() 1501 SCpnt->SCp.sent_command, print_info() 1502 SCpnt->SCp.have_data_in, print_info() 1503 SCpnt->timeout ); print_info() 1545 static int fdomain_16x0_abort(struct scsi_cmnd *SCpnt) fdomain_16x0_abort() argument 1559 print_info( SCpnt ); fdomain_16x0_abort() 1571 int fdomain_16x0_bus_reset(struct scsi_cmnd *SCpnt) fdomain_16x0_bus_reset() argument
|
H A D | sym53c416.c | 736 static int sym53c416_queuecommand_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) sym53c416_queuecommand_lck() argument 743 base = SCpnt->device->host->io_port; sym53c416_queuecommand_lck() 744 current_command = SCpnt; /* set current command */ sym53c416_queuecommand_lck() 751 outb(scmd_id(SCpnt), base + DEST_BUS_ID); /* Set scsi id target */ sym53c416_queuecommand_lck() 754 for(i = 0; i < SCpnt->cmd_len; i++) sym53c416_queuecommand_lck() 755 outb(SCpnt->cmnd[i], base + SCSI_FIFO); sym53c416_queuecommand_lck() 765 static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) sym53c416_host_reset() argument 775 base = SCpnt->device->host->io_port; sym53c416_host_reset()
|
H A D | gvp11.c | 146 static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, dma_stop() argument 160 if (wh->dma_dir && SCpnt) dma_stop() 161 memcpy(SCpnt->SCp.ptr, wh->dma_bounce_buffer, dma_stop() 162 SCpnt->SCp.this_residual); dma_stop()
|
H A D | a2091.c | 107 static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, dma_stop() argument 142 memcpy(SCpnt->SCp.ptr, wh->dma_bounce_buffer, dma_stop() 143 SCpnt->SCp.this_residual); dma_stop()
|
H A D | scsi_debug.c | 813 static int check_readiness(struct scsi_cmnd *SCpnt, int uas_only, check_readiness() argument 825 mk_sense_buffer(SCpnt, UNIT_ATTENTION, check_readiness() 831 mk_sense_buffer(SCpnt, UNIT_ATTENTION, check_readiness() 837 mk_sense_buffer(SCpnt, UNIT_ATTENTION, check_readiness() 843 mk_sense_buffer(SCpnt, UNIT_ATTENTION, check_readiness() 849 mk_sense_buffer(SCpnt, UNIT_ATTENTION, check_readiness() 855 mk_sense_buffer(SCpnt, UNIT_ATTENTION, check_readiness() 872 mk_sense_buffer(SCpnt, UNIT_ATTENTION, check_readiness() 887 sdev_printk(KERN_INFO, SCpnt->device, check_readiness() 893 mk_sense_buffer(SCpnt, NOT_READY, LOGICAL_UNIT_NOT_READY, check_readiness() 896 sdev_printk(KERN_INFO, SCpnt->device, check_readiness() 2472 static void dif_copy_prot(struct scsi_cmnd *SCpnt, sector_t sector, dif_copy_prot() argument 2483 sg_miter_start(&miter, scsi_prot_sglist(SCpnt), dif_copy_prot() 2484 scsi_prot_sg_count(SCpnt), SG_MITER_ATOMIC | dif_copy_prot() 2515 static int prot_verify_read(struct scsi_cmnd *SCpnt, sector_t start_sec, prot_verify_read() argument 2538 dif_copy_prot(SCpnt, start_sec, sectors, true); prot_verify_read() 2706 static int prot_verify_write(struct scsi_cmnd *SCpnt, sector_t start_sec, prot_verify_write() argument 2718 BUG_ON(scsi_sg_count(SCpnt) == 0); prot_verify_write() 2719 BUG_ON(scsi_prot_sg_count(SCpnt) == 0); prot_verify_write() 2721 sg_miter_start(&piter, scsi_prot_sglist(SCpnt), prot_verify_write() 2722 scsi_prot_sg_count(SCpnt), prot_verify_write() 2724 sg_miter_start(&diter, scsi_sglist(SCpnt), scsi_sg_count(SCpnt), prot_verify_write() 2766 dif_copy_prot(SCpnt, start_sec, sectors, false); prot_verify_write() 3763 static int scsi_debug_abort(struct scsi_cmnd *SCpnt) scsi_debug_abort() argument 3766 if (SCpnt) { scsi_debug_abort() 3767 if (SCpnt->device && scsi_debug_abort() 3769 sdev_printk(KERN_INFO, SCpnt->device, "%s\n", scsi_debug_abort() 3771 stop_queued_cmnd(SCpnt); scsi_debug_abort() 3776 static int scsi_debug_device_reset(struct scsi_cmnd * SCpnt) scsi_debug_device_reset() argument 3781 if (SCpnt && SCpnt->device) { scsi_debug_device_reset() 3782 struct scsi_device *sdp = SCpnt->device; scsi_debug_device_reset() 3793 static int scsi_debug_target_reset(struct scsi_cmnd *SCpnt) scsi_debug_target_reset() argument 3802 if (!SCpnt) scsi_debug_target_reset() 3804 sdp = SCpnt->device; scsi_debug_target_reset() 3829 static int scsi_debug_bus_reset(struct scsi_cmnd * SCpnt) scsi_debug_bus_reset() argument 3838 if (!(SCpnt && SCpnt->device)) scsi_debug_bus_reset() 3840 sdp = SCpnt->device; scsi_debug_bus_reset() 3862 static int scsi_debug_host_reset(struct scsi_cmnd * SCpnt) scsi_debug_host_reset() argument 3869 if ((SCpnt->device) && (SCSI_DEBUG_OPT_ALL_NOISE & scsi_debug_opts)) scsi_debug_host_reset() 3870 sdev_printk(KERN_INFO, SCpnt->device, "%s\n", __func__); scsi_debug_host_reset() 3882 sdev_printk(KERN_INFO, SCpnt->device, scsi_debug_host_reset()
|
H A D | 3w-9xxx.c | 1721 static int twa_scsi_eh_reset(struct scsi_cmnd *SCpnt) twa_scsi_eh_reset() argument 1726 tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; twa_scsi_eh_reset() 1730 sdev_printk(KERN_WARNING, SCpnt->device, twa_scsi_eh_reset() 1732 TW_DRIVER, 0x2c, SCpnt->cmnd[0]); twa_scsi_eh_reset() 1750 static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) twa_scsi_queue_lck() argument 1753 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; twa_scsi_queue_lck() 1762 if ((SCpnt->device->lun != 0) && (tw_dev->tw_compat_info.working_srl < TW_FW_SRL_LUNS_SUPPORTED)) { twa_scsi_queue_lck() 1763 SCpnt->result = (DID_BAD_TARGET << 16); twa_scsi_queue_lck() 1764 done(SCpnt); twa_scsi_queue_lck() 1770 SCpnt->scsi_done = done; twa_scsi_queue_lck() 1776 tw_dev->srb[request_id] = SCpnt; twa_scsi_queue_lck() 1781 if (twa_command_mapped(SCpnt)) twa_scsi_queue_lck() 1782 scsi_dma_unmap(SCpnt); twa_scsi_queue_lck() 1786 SCpnt->result = (DID_ERROR << 16); twa_scsi_queue_lck() 1787 if (twa_command_mapped(SCpnt)) twa_scsi_queue_lck() 1788 scsi_dma_unmap(SCpnt); twa_scsi_queue_lck() 1789 done(SCpnt); twa_scsi_queue_lck()
|
H A D | mvme147.c | 61 static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, dma_stop() argument
|
H A D | nsp32_debug.c | 140 static void show_command(Scsi_Cmnd *SCpnt) show_command() argument 142 print_commandk(SCpnt->cmnd); show_command()
|
H A D | aha1740.h | 137 Scsi_Cmnd *SCpnt; /* Link to the SCSI Command Block */ member in struct:ecb
|
H A D | wd33c93.h | 203 typedef int (*dma_setup_t) (struct scsi_cmnd *SCpnt, int dir_in); 205 struct scsi_cmnd *SCpnt, int status);
|
H A D | 3w-sas.c | 1434 static int twl_scsi_eh_reset(struct scsi_cmnd *SCpnt) twl_scsi_eh_reset() argument 1439 tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; twl_scsi_eh_reset() 1443 sdev_printk(KERN_WARNING, SCpnt->device, twl_scsi_eh_reset() 1445 TW_DRIVER, 0x2c, SCpnt->cmnd[0]); twl_scsi_eh_reset() 1463 static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) twl_scsi_queue_lck() argument 1466 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; twl_scsi_queue_lck() 1475 SCpnt->scsi_done = done; twl_scsi_queue_lck() 1481 tw_dev->srb[request_id] = SCpnt; twl_scsi_queue_lck() 1487 SCpnt->result = (DID_ERROR << 16); twl_scsi_queue_lck() 1488 done(SCpnt); twl_scsi_queue_lck()
|
H A D | 3w-xxxx.c | 1358 static int tw_scsi_eh_reset(struct scsi_cmnd *SCpnt) tw_scsi_eh_reset() argument 1363 tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; tw_scsi_eh_reset() 1367 sdev_printk(KERN_WARNING, SCpnt->device, tw_scsi_eh_reset() 1369 SCpnt->cmnd[0]); tw_scsi_eh_reset() 1912 static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) tw_scsi_queue_lck() argument 1914 unsigned char *command = SCpnt->cmnd; tw_scsi_queue_lck() 1917 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; tw_scsi_queue_lck() 1924 SCpnt->scsi_done = done; tw_scsi_queue_lck() 1930 tw_dev->srb[request_id] = SCpnt; tw_scsi_queue_lck() 1971 SCpnt->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; tw_scsi_queue_lck() 1972 scsi_build_sense_buffer(1, SCpnt->sense_buffer, ILLEGAL_REQUEST, 0x20, 0); tw_scsi_queue_lck() 1973 done(SCpnt); tw_scsi_queue_lck() 1979 SCpnt->result = (DID_ERROR << 16); tw_scsi_queue_lck() 1980 done(SCpnt); tw_scsi_queue_lck()
|
H A D | 53c700.c | 170 STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); 171 STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); 172 STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
|
H A D | nsp32.h | 497 struct scsi_cmnd *SCpnt; /* Current Handling struct scsi_cmnd */ member in struct:_nsp32_lunt
|
H A D | BusLogic.c | 3001 static int blogic_hostreset(struct scsi_cmnd *SCpnt) blogic_hostreset() argument 3004 (struct blogic_adapter *) SCpnt->device->host->hostdata; blogic_hostreset() 3006 unsigned int id = SCpnt->device->id; blogic_hostreset() 3010 spin_lock_irq(SCpnt->device->host->host_lock); blogic_hostreset() 3015 spin_unlock_irq(SCpnt->device->host->host_lock); blogic_hostreset()
|
H A D | wd33c93.c | 1574 wd33c93_host_reset(struct scsi_cmnd * SCpnt) wd33c93_host_reset() argument 1580 instance = SCpnt->device->host; wd33c93_host_reset() 1604 SCpnt->result = DID_RESET << 16; wd33c93_host_reset()
|
H A D | atp870u.c | 3054 static int atp870u_abort(struct scsi_cmnd * SCpnt) atp870u_abort() argument 3061 host = SCpnt->device->host; atp870u_abort() 3064 c = scmd_channel(SCpnt); atp870u_abort()
|
/linux-4.4.14/drivers/message/fusion/ |
H A D | mptfc.c | 100 static int mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt); 104 static int mptfc_abort(struct scsi_cmnd *SCpnt); 105 static int mptfc_dev_reset(struct scsi_cmnd *SCpnt); 106 static int mptfc_bus_reset(struct scsi_cmnd *SCpnt); 107 static int mptfc_host_reset(struct scsi_cmnd *SCpnt); 187 mptfc_block_error_handler(struct scsi_cmnd *SCpnt, mptfc_block_error_handler() argument 188 int (*func)(struct scsi_cmnd *SCpnt), mptfc_block_error_handler() 192 struct scsi_device *sdev = SCpnt->device; mptfc_block_error_handler() 200 hd = shost_priv(SCpnt->device->host); mptfc_block_error_handler() 210 SCpnt->device->id, SCpnt->device->lun, mptfc_block_error_handler() 218 if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata mptfc_block_error_handler() 224 SCpnt->device->id, SCpnt->device->lun, ready, mptfc_block_error_handler() 225 ioc->active, SCpnt->device->hostdata)); mptfc_block_error_handler() 231 SCpnt->device->id, SCpnt->device->lun)); mptfc_block_error_handler() 232 return (*func)(SCpnt); mptfc_block_error_handler() 236 mptfc_abort(struct scsi_cmnd *SCpnt) mptfc_abort() argument 239 mptfc_block_error_handler(SCpnt, mptscsih_abort, __func__); mptfc_abort() 243 mptfc_dev_reset(struct scsi_cmnd *SCpnt) mptfc_dev_reset() argument 246 mptfc_block_error_handler(SCpnt, mptscsih_dev_reset, __func__); mptfc_dev_reset() 250 mptfc_bus_reset(struct scsi_cmnd *SCpnt) mptfc_bus_reset() argument 253 mptfc_block_error_handler(SCpnt, mptscsih_bus_reset, __func__); mptfc_bus_reset() 257 mptfc_host_reset(struct scsi_cmnd *SCpnt) mptfc_host_reset() argument 260 mptfc_block_error_handler(SCpnt, mptscsih_host_reset, __func__); mptfc_host_reset() 651 mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) mptfc_qcmd() argument 654 struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); mptfc_qcmd() 656 VirtDevice *vdevice = SCpnt->device->hostdata; mptfc_qcmd() 659 SCpnt->result = DID_NO_CONNECT << 16; mptfc_qcmd() 660 SCpnt->scsi_done(SCpnt); mptfc_qcmd() 666 SCpnt->result = err; mptfc_qcmd() 667 SCpnt->scsi_done(SCpnt); mptfc_qcmd() 674 SCpnt->result = DID_IMM_RETRY << 16; mptfc_qcmd() 675 SCpnt->scsi_done(SCpnt); mptfc_qcmd() 679 return mptscsih_qcmd(SCpnt); mptfc_qcmd()
|
H A D | mptscsih.c | 92 static int mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt, 173 * @SCpnt: Pointer to scsi_cmnd structure 179 mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt, mptscsih_AddSGE() argument 210 sges_left = scsi_dma_map(SCpnt); mptscsih_AddSGE() 216 sg = scsi_sglist(SCpnt); mptscsih_AddSGE() 350 ioc->name, pReq->CDB[0], SCpnt)); mptscsih_AddSGE() 1304 * @SCpnt: Pointer to scsi_cmnd structure 1313 mptscsih_qcmd(struct scsi_cmnd *SCpnt) mptscsih_qcmd() argument 1318 VirtDevice *vdevice = SCpnt->device->hostdata; mptscsih_qcmd() 1327 hd = shost_priv(SCpnt->device->host); mptscsih_qcmd() 1330 dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "qcmd: SCpnt=%p\n", mptscsih_qcmd() 1331 ioc->name, SCpnt)); mptscsih_qcmd() 1355 if (SCpnt->sc_data_direction == DMA_FROM_DEVICE) { mptscsih_qcmd() 1356 datalen = scsi_bufflen(SCpnt); mptscsih_qcmd() 1358 } else if (SCpnt->sc_data_direction == DMA_TO_DEVICE) { mptscsih_qcmd() 1359 datalen = scsi_bufflen(SCpnt); mptscsih_qcmd() 1370 && (SCpnt->device->tagged_supported)) { mptscsih_qcmd() 1372 if (SCpnt->request && SCpnt->request->ioprio) { mptscsih_qcmd() 1373 if (((SCpnt->request->ioprio & 0x7) == 1) || mptscsih_qcmd() 1374 !(SCpnt->request->ioprio & 0x7)) mptscsih_qcmd() 1390 pScsiReq->CDBLength = SCpnt->cmd_len; mptscsih_qcmd() 1394 int_to_scsilun(SCpnt->device->lun, (struct scsi_lun *)pScsiReq->LUN); mptscsih_qcmd() 1400 cmd_len = SCpnt->cmd_len; mptscsih_qcmd() 1402 pScsiReq->CDB[ii] = SCpnt->cmnd[ii]; mptscsih_qcmd() 1424 if (mptscsih_AddSGE(ioc, SCpnt, pScsiReq, my_idx) != SUCCESS) mptscsih_qcmd() 1428 SCpnt->host_scribble = (unsigned char *)mf; mptscsih_qcmd() 1429 mptscsih_set_scsi_lookup(ioc, my_idx, SCpnt); mptscsih_qcmd() 1433 ioc->name, SCpnt, mf, my_idx)); mptscsih_qcmd() 1680 * @SCpnt: Pointer to scsi_cmnd structure, IO to be aborted 1687 mptscsih_abort(struct scsi_cmnd * SCpnt) mptscsih_abort() argument 1699 if ((hd = shost_priv(SCpnt->device->host)) == NULL) { mptscsih_abort() 1700 SCpnt->result = DID_RESET << 16; mptscsih_abort() 1701 SCpnt->scsi_done(SCpnt); mptscsih_abort() 1703 "can't locate host! (sc=%p)\n", SCpnt); mptscsih_abort() 1709 ioc->name, SCpnt); mptscsih_abort() 1710 scsi_print_command(SCpnt); mptscsih_abort() 1712 vdevice = SCpnt->device->hostdata; mptscsih_abort() 1716 ioc->name, SCpnt)); mptscsih_abort() 1717 SCpnt->result = DID_NO_CONNECT << 16; mptscsih_abort() 1718 SCpnt->scsi_done(SCpnt); mptscsih_abort() 1728 ioc->name, SCpnt)); mptscsih_abort() 1729 SCpnt->result = DID_RESET << 16; mptscsih_abort() 1739 ioc->name, SCpnt)); mptscsih_abort() 1740 SCpnt->result = DID_RESET << 16; mptscsih_abort() 1747 if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(ioc, SCpnt)) < 0) { mptscsih_abort() 1751 SCpnt->result = DID_RESET << 16; mptscsih_abort() 1754 SCpnt)); mptscsih_abort() 1765 /* Most important! Set TaskMsgContext to SCpnt's MsgContext! mptscsih_abort() 1780 if (SCPNT_TO_LOOKUP_IDX(ioc, SCpnt) == scpnt_idx) { mptscsih_abort() 1783 ioc->name, SCpnt)); mptscsih_abort() 1788 ioc->name, SCpnt)); mptscsih_abort() 1795 SCpnt); mptscsih_abort() 1803 * @SCpnt: Pointer to scsi_cmnd structure, IO which reset is due to 1810 mptscsih_dev_reset(struct scsi_cmnd * SCpnt) mptscsih_dev_reset() argument 1819 if ((hd = shost_priv(SCpnt->device->host)) == NULL){ mptscsih_dev_reset() 1821 "Can't locate host! (sc=%p)\n", SCpnt); mptscsih_dev_reset() 1827 ioc->name, SCpnt); mptscsih_dev_reset() 1828 scsi_print_command(SCpnt); mptscsih_dev_reset() 1830 vdevice = SCpnt->device->hostdata; mptscsih_dev_reset() 1851 ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt); mptscsih_dev_reset() 1863 * @SCpnt: Pointer to scsi_cmnd structure, IO which reset is due to 1870 mptscsih_bus_reset(struct scsi_cmnd * SCpnt) mptscsih_bus_reset() argument 1879 if ((hd = shost_priv(SCpnt->device->host)) == NULL){ mptscsih_bus_reset() 1881 "Can't locate host! (sc=%p)\n", SCpnt); mptscsih_bus_reset() 1887 ioc->name, SCpnt); mptscsih_bus_reset() 1888 scsi_print_command(SCpnt); mptscsih_bus_reset() 1893 vdevice = SCpnt->device->hostdata; mptscsih_bus_reset() 1902 ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt); mptscsih_bus_reset() 1913 * @SCpnt: Pointer to scsi_cmnd structure, IO which reset is due to 1920 mptscsih_host_reset(struct scsi_cmnd *SCpnt) mptscsih_host_reset() argument 1928 if ((hd = shost_priv(SCpnt->device->host)) == NULL){ mptscsih_host_reset() 1930 "Can't locate host! (sc=%p)\n", SCpnt); mptscsih_host_reset() 1939 ioc->name, SCpnt); mptscsih_host_reset() 1951 ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt); mptscsih_host_reset()
|
H A D | mptscsih.h | 116 extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt); 121 extern int mptscsih_abort(struct scsi_cmnd * SCpnt); 122 extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt); 123 extern int mptscsih_bus_reset(struct scsi_cmnd * SCpnt); 124 extern int mptscsih_host_reset(struct scsi_cmnd *SCpnt);
|
H A D | mptspi.c | 782 mptspi_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) mptspi_qcmd() argument 785 VirtDevice *vdevice = SCpnt->device->hostdata; mptspi_qcmd() 789 SCpnt->result = DID_NO_CONNECT << 16; mptspi_qcmd() 790 SCpnt->scsi_done(SCpnt); mptspi_qcmd() 794 if (SCpnt->device->channel == 1 && mptspi_qcmd() 795 mptscsih_is_phys_disk(ioc, 0, SCpnt->device->id) == 0) { mptspi_qcmd() 796 SCpnt->result = DID_NO_CONNECT << 16; mptspi_qcmd() 797 SCpnt->scsi_done(SCpnt); mptspi_qcmd() 801 if (spi_dv_pending(scsi_target(SCpnt->device))) mptspi_qcmd() 802 ddvprintk(ioc, scsi_print_command(SCpnt)); mptspi_qcmd() 804 return mptscsih_qcmd(SCpnt); mptspi_qcmd()
|
H A D | mptsas.c | 1897 mptsas_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) mptsas_qcmd() argument 1901 VirtDevice *vdevice = SCpnt->device->hostdata; mptsas_qcmd() 1904 SCpnt->result = DID_NO_CONNECT << 16; mptsas_qcmd() 1905 SCpnt->scsi_done(SCpnt); mptsas_qcmd() 1916 scsi_print_command(SCpnt); mptsas_qcmd() 1918 return mptscsih_qcmd(SCpnt); mptsas_qcmd()
|