Lines Matching refs:scsi
144 unsigned int off = reg << info->scsi.io_shift; in fas216_readb()
145 return readb(info->scsi.io_base + off); in fas216_readb()
150 unsigned int off = reg << info->scsi.io_shift; in fas216_writeb()
151 writeb(val, info->scsi.io_base + off); in fas216_writeb()
196 info->scsi.io_shift, info->scsi.irq, in fas216_dumpinfo()
197 info->scsi.cfg[0], info->scsi.cfg[1], info->scsi.cfg[2], in fas216_dumpinfo()
198 info->scsi.cfg[3]); in fas216_dumpinfo()
200 info->scsi.type, info->scsi.phase); in fas216_dumpinfo()
201 print_SCp(&info->scsi.SCp, " SCp={ ", " }\n"); in fas216_dumpinfo()
203 info->scsi.async_stp, in fas216_dumpinfo()
204 info->scsi.disconnectable, info->scsi.aborting); in fas216_dumpinfo()
276 if (info->scsi.phase < ARRAY_SIZE(phases) && in fas216_drv_phase()
277 phases[info->scsi.phase]) in fas216_drv_phase()
278 return phases[info->scsi.phase]; in fas216_drv_phase()
420 while ((msg = msgqueue_getmsg(&info->scsi.msgs, msgnr++)) != NULL) { in fas216_get_last_msg()
477 cntl3 = info->scsi.cfg[2]; in fas216_set_sync()
562 msgqueue_flush(&info->scsi.msgs); in fas216_handlesync()
563 msgqueue_addmsg(&info->scsi.msgs, 5, in fas216_handlesync()
566 info->scsi.phase = PHASE_MSGOUT_EXPECT; in fas216_handlesync()
605 msgqueue_flush(&info->scsi.msgs); in fas216_handlesync()
606 msgqueue_addmsg(&info->scsi.msgs, 1, MESSAGE_REJECT); in fas216_handlesync()
607 info->scsi.phase = PHASE_MSGOUT_EXPECT; in fas216_handlesync()
612 dev->stp = info->scsi.async_stp; in fas216_handlesync()
630 struct scsi_pointer *SCp = &info->scsi.SCp; in fas216_updateptrs()
670 struct scsi_pointer *SCp = &info->scsi.SCp; in fas216_pio()
718 total = info->scsi.SCp.phase; in fas216_cleanuptransfer()
720 total = info->scsi.SCp.this_residual; in fas216_cleanuptransfer()
736 if (info->scsi.phase == PHASE_DATAOUT) in fas216_cleanuptransfer()
755 info->scsi.SCp.ptr, info->scsi.SCp.this_residual, in fas216_transfer()
756 info->scsi.SCp.phase); in fas216_transfer()
758 if (!info->scsi.SCp.ptr) { in fas216_transfer()
761 print_SCp(&info->scsi.SCp, "SCp: ", "\n"); in fas216_transfer()
776 if (info->scsi.phase == PHASE_DATAOUT) in fas216_transfer()
782 dmatype = info->dma.setup(info->host, &info->scsi.SCp, in fas216_transfer()
787 fas216_set_stc(info, info->scsi.SCp.phase); in fas216_transfer()
789 fas216_set_stc(info, info->scsi.SCp.this_residual); in fas216_transfer()
795 fas216_writeb(info, REG_STP, info->scsi.async_stp); in fas216_transfer()
803 info->dma.pseudo(info->host, &info->scsi.SCp, in fas216_transfer()
836 info->dma.stop(info->host, &info->scsi.SCp); in fas216_stoptransfer()
840 if (info->scsi.phase == PHASE_DATAIN) { in fas216_stoptransfer()
849 while (fifo && info->scsi.SCp.ptr) { in fas216_stoptransfer()
850 *info->scsi.SCp.ptr = fas216_readb(info, REG_FF); in fas216_stoptransfer()
869 info->dma.stop(info->host, &info->scsi.SCp); in fas216_aborttransfer()
890 info->scsi.phase); in fas216_disconnect_intr()
892 msgqueue_flush(&info->scsi.msgs); in fas216_disconnect_intr()
894 switch (info->scsi.phase) { in fas216_disconnect_intr()
901 info->scsi.disconnectable = 1; in fas216_disconnect_intr()
902 info->scsi.phase = PHASE_IDLE; in fas216_disconnect_intr()
905 if (info->scsi.phase == PHASE_IDLE) in fas216_disconnect_intr()
915 if (fas216_get_last_msg(info, info->scsi.msgin_fifo) == ABORT) { in fas216_disconnect_intr()
916 info->scsi.aborting = 0; in fas216_disconnect_intr()
946 WARN_ON(info->scsi.phase == PHASE_SELECTION || in fas216_reselected_intr()
947 info->scsi.phase == PHASE_SELSTEPS); in fas216_reselected_intr()
952 info->scsi.phase, cfis); in fas216_reselected_intr()
984 msgqueue_flush(&info->scsi.msgs); in fas216_reselected_intr()
989 if (info->scsi.disconnectable && info->SCpnt) { in fas216_reselected_intr()
990 info->scsi.disconnectable = 0; in fas216_reselected_intr()
1011 info->scsi.SCp = info->SCpnt->SCp; in fas216_reselected_intr()
1014 info->scsi.SCp.ptr, info->scsi.SCp.this_residual); in fas216_reselected_intr()
1015 info->scsi.phase = PHASE_MSGIN; in fas216_reselected_intr()
1027 msgqueue_addmsg(&info->scsi.msgs, 2, ABORT_TAG, tag); in fas216_reselected_intr()
1030 msgqueue_addmsg(&info->scsi.msgs, 1, ABORT); in fas216_reselected_intr()
1031 info->scsi.phase = PHASE_MSGOUT_EXPECT; in fas216_reselected_intr()
1032 info->scsi.aborting = 1; in fas216_reselected_intr()
1046 msgqueue_flush(&info->scsi.msgs); in fas216_reselected_intr()
1047 msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR); in fas216_reselected_intr()
1048 info->scsi.phase = PHASE_MSGOUT_EXPECT; in fas216_reselected_intr()
1078 info->SCpnt->SCp = info->scsi.SCp; in fas216_parse_message()
1082 info->scsi.SCp.ptr, info->scsi.SCp.this_residual); in fas216_parse_message()
1092 info->scsi.SCp = info->SCpnt->SCp; in fas216_parse_message()
1095 info->scsi.SCp.ptr, info->scsi.SCp.this_residual); in fas216_parse_message()
1102 info->scsi.phase = PHASE_MSGIN_DISCONNECT; in fas216_parse_message()
1109 switch (fas216_get_last_msg(info, info->scsi.msgin_fifo)) { in fas216_parse_message()
1116 fas216_get_last_msg(info, info->scsi.msgin_fifo)); in fas216_parse_message()
1157 msgqueue_flush(&info->scsi.msgs); in fas216_parse_message()
1158 msgqueue_addmsg(&info->scsi.msgs, 1, MESSAGE_REJECT); in fas216_parse_message()
1159 info->scsi.phase = PHASE_MSGOUT_EXPECT; in fas216_parse_message()
1228 unsigned char *message = info->scsi.message; in fas216_message()
1274 msgqueue_flush(&info->scsi.msgs); in fas216_message()
1275 msgqueue_addmsg(&info->scsi.msgs, 1, MSG_PARITY_ERROR); in fas216_message()
1276 info->scsi.phase = PHASE_MSGOUT_EXPECT; in fas216_message()
1297 for (i = info->scsi.SCp.sent_command; i < info->SCpnt->cmd_len; i++) in fas216_send_command()
1302 info->scsi.phase = PHASE_COMMAND; in fas216_send_command()
1314 unsigned int tot_msglen = msgqueue_msglength(&info->scsi.msgs); in fas216_send_messageout()
1324 while ((msg = msgqueue_getmsg(&info->scsi.msgs, msgnr++)) != NULL) { in fas216_send_messageout()
1338 info->scsi.phase = PHASE_MSGOUT; in fas216_send_messageout()
1355 stat, is, info->scsi.phase); in fas216_busservice_intr()
1357 switch (info->scsi.phase) { in fas216_busservice_intr()
1389 switch (STATE(stat & STAT_BUSMASK, info->scsi.phase)) { in fas216_busservice_intr()
1394 info->scsi.phase = PHASE_DATAIN; in fas216_busservice_intr()
1409 info->scsi.phase = PHASE_DATAOUT; in fas216_busservice_intr()
1421 info->scsi.phase = PHASE_STATUS; in fas216_busservice_intr()
1430 info->scsi.msgin_fifo = fas216_readb(info, REG_CFIS) & CFIS_CF; in fas216_busservice_intr()
1433 info->scsi.phase = PHASE_MSGIN; in fas216_busservice_intr()
1437 info->scsi.msgin_fifo = fas216_readb(info, REG_CFIS) & CFIS_CF; in fas216_busservice_intr()
1444 info->scsi.phase = PHASE_COMMAND; in fas216_busservice_intr()
1473 fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]); in fas216_busservice_intr()
1476 if (msgqueue_msglength(&info->scsi.msgs) > 1) in fas216_busservice_intr()
1504 msgqueue_flush(&info->scsi.msgs); in fas216_busservice_intr()
1505 msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR); in fas216_busservice_intr()
1506 info->scsi.phase = PHASE_MSGOUT_EXPECT; in fas216_busservice_intr()
1510 if (info->scsi.phase == PHASE_MSGIN_DISCONNECT) { in fas216_busservice_intr()
1514 msgqueue_flush(&info->scsi.msgs); in fas216_busservice_intr()
1516 msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR); in fas216_busservice_intr()
1517 info->scsi.phase = PHASE_MSGOUT_EXPECT; in fas216_busservice_intr()
1518 info->scsi.aborting = 1; in fas216_busservice_intr()
1553 stat, is, info->scsi.phase); in fas216_funcdone_intr()
1555 switch (info->scsi.phase) { in fas216_funcdone_intr()
1563 info->scsi.SCp.Status = fas216_readb(info, REG_FF); in fas216_funcdone_intr()
1564 info->scsi.SCp.Message = fas216_readb(info, REG_FF); in fas216_funcdone_intr()
1565 info->scsi.phase = PHASE_DONE; in fas216_funcdone_intr()
1576 info->scsi.msgin_fifo = fifo_len; in fas216_funcdone_intr()
1593 msgqueue_flush(&info->scsi.msgs); in fas216_bus_reset()
1602 info->scsi.phase = PHASE_IDLE; in fas216_bus_reset()
1604 memset(&info->scsi.SCp, 0, sizeof(info->scsi.SCp)); in fas216_bus_reset()
1610 info->device[i].stp = info->scsi.async_stp; in fas216_bus_reset()
1636 add_debug_list(stat, is, inst, info->scsi.phase); in fas216_intr()
1682 tot_msglen = msgqueue_msglength(&info->scsi.msgs); in __fas216_start_command()
1691 while ((msg = msgqueue_getmsg(&info->scsi.msgs, msgnr++)) != NULL) { in __fas216_start_command()
1708 info->scsi.phase = PHASE_SELSTEPS; in __fas216_start_command()
1711 while ((msg = msgqueue_getmsg(&info->scsi.msgs, msgnr++)) != NULL) { in __fas216_start_command()
1731 struct message *msg = msgqueue_getmsg(&info->scsi.msgs, 0); in __fas216_start_command()
1763 info->scsi.phase = PHASE_SELECTION; in fas216_start_command()
1764 info->scsi.SCp = SCpnt->SCp; in fas216_start_command()
1769 fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0] | CNTL1_PTE); in fas216_start_command()
1771 fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]); in fas216_start_command()
1782 msgqueue_flush(&info->scsi.msgs); in fas216_start_command()
1783 msgqueue_addmsg(&info->scsi.msgs, 1, IDENTIFY(disconnect_ok, SCpnt->device->lun)); in fas216_start_command()
1789 msgqueue_addmsg(&info->scsi.msgs, 2, SIMPLE_QUEUE_TAG, SCpnt->tag); in fas216_start_command()
1798 msgqueue_addmsg(&info->scsi.msgs, 5, in fas216_start_command()
1852 info->scsi.phase = PHASE_SELECTION; in fas216_do_bus_device_reset()
1853 info->scsi.SCp = SCpnt->SCp; in fas216_do_bus_device_reset()
1859 msgqueue_flush(&info->scsi.msgs); in fas216_do_bus_device_reset()
1860 msgqueue_addmsg(&info->scsi.msgs, 1, BUS_DEVICE_RESET); in fas216_do_bus_device_reset()
1876 msg = msgqueue_getmsg(&info->scsi.msgs, 0); in fas216_do_bus_device_reset()
1946 if (info->scsi.disconnectable && info->SCpnt) { in fas216_kick()
1951 info->scsi.disconnectable = 0; in fas216_kick()
1970 info->scsi.SCp.ptr, info->scsi.SCp.this_residual); in fas216_kick()
2038 SCpnt->result = result << 16 | info->scsi.SCp.Message << 8 | in fas216_std_done()
2039 info->scsi.SCp.Status; in fas216_std_done()
2073 if (info->scsi.SCp.ptr) { in fas216_std_done()
2084 SCpnt->result, info->scsi.SCp.ptr, in fas216_std_done()
2085 info->scsi.SCp.this_residual); in fas216_std_done()
2147 info->scsi.phase = PHASE_IDLE; in fas216_done()
2149 if (info->scsi.aborting) { in fas216_done()
2152 info->scsi.aborting = 0; in fas216_done()
2159 if (info->scsi.SCp.ptr && info->scsi.SCp.this_residual == 0) { in fas216_done()
2163 info->scsi.SCp.ptr, info->scsi.SCp.this_residual); in fas216_done()
2164 info->scsi.SCp.ptr = NULL; in fas216_done()
2179 if (info->scsi.irq) { in fas216_done()
2181 if (info->scsi.phase == PHASE_IDLE) in fas216_done()
2233 if (result == 0 && info->scsi.phase == PHASE_IDLE) in fas216_queue_command_lck()
2279 BUG_ON(info->scsi.irq); in fas216_noqueue_command_lck()
2377 switch (info->scsi.phase) { in fas216_find_command()
2383 if (info->scsi.disconnectable) { in fas216_find_command()
2384 info->scsi.disconnectable = 0; in fas216_find_command()
2492 if (info->SCpnt && !info->scsi.disconnectable && in fas216_eh_device_reset()
2520 if (info->scsi.phase == PHASE_IDLE) in fas216_eh_device_reset()
2573 fas216_writeb(info, REG_CNTL3, info->scsi.cfg[2]); in fas216_eh_bus_reset()
2606 info->scsi.phase = PHASE_IDLE; in fas216_eh_bus_reset()
2639 fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]); in fas216_init_chip()
2640 fas216_writeb(info, REG_CNTL2, info->scsi.cfg[1]); in fas216_init_chip()
2641 fas216_writeb(info, REG_CNTL3, info->scsi.cfg[2]); in fas216_init_chip()
2644 fas216_writeb(info, REG_STP, info->scsi.async_stp); in fas216_init_chip()
2645 fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]); in fas216_init_chip()
2811 info->scsi.disconnectable = 0; in fas216_reset_state()
2812 info->scsi.aborting = 0; in fas216_reset_state()
2847 info->scsi.cfg[0] = host->this_id | CNTL1_PERE; in fas216_init()
2848 info->scsi.cfg[1] = CNTL2_ENF | CNTL2_S2FE; in fas216_init()
2849 info->scsi.cfg[2] = info->ifcfg.cntl3 | in fas216_init()
2851 info->scsi.async_stp = fas216_syncperiod(info, info->ifcfg.asyncperiod); in fas216_init()
2864 msgqueue_initialise(&info->scsi.msgs); in fas216_init()
2898 info->scsi.type = chip_types[type]; in fas216_add()
2912 fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0] | CNTL1_DISR); in fas216_add()
2922 fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]); in fas216_add()
2969 info->scsi.type, info->scsi.io_base, in fas216_print_host()
2970 info->scsi.irq, info->scsi.dma); in fas216_print_host()