Lines Matching refs:pACB

20 dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )  in dc390_StartSCSI()  argument
26 if (pACB->Connected) in dc390_StartSCSI()
32 pACB->SelConn++; in dc390_StartSCSI()
35 if (time_before (jiffies, pACB->pScsiHost->last_reset)) in dc390_StartSCSI()
127 DEBUG0(if (pACB->pActiveDCB) \ in dc390_StartSCSI()
139 pACB->SelLost++; in dc390_StartSCSI()
143 pACB->pActiveDCB = pDCB; pDCB->pActiveSRB = pSRB; in dc390_StartSCSI()
144 pACB->Connected = 1; in dc390_StartSCSI()
155 dc390_dma_intr (PACB pACB) in dc390_dma_intr() argument
169 if (! pACB->pActiveDCB || ! pACB->pActiveDCB->pActiveSRB) return dstate; in dc390_dma_intr()
170 else pSRB = pACB->pActiveDCB->pActiveSRB; in dc390_dma_intr()
215 dc390_InvalidCmd( PACB pACB ) in dc390_InvalidCmd() argument
217 if( pACB->pActiveDCB->pActiveSRB->SRBState & (SRB_START_+SRB_MSGOUT) ) in dc390_InvalidCmd()
225 dc390_EnableMsgOut_Abort ( PACB pACB, PSRB pSRB ) in dc390_EnableMsgOut_Abort() argument
235 PACB pACB, pACB2; in DC390_Interrupt() local
247 pACB = (PACB)dev_id; in DC390_Interrupt() local
248 for (pACB2 = dc390_pACB_start; (pACB2 && pACB2 != pACB); pACB2 = pACB2->pNextACB); in DC390_Interrupt()
251 printk ("DC390: IRQ called with foreign dev_id %p!\n", pACB); in DC390_Interrupt()
266 dstatus = dc390_dma_intr (pACB); in DC390_Interrupt()
297 dc390_dumpinfo (pACB, pACB->pActiveDCB, pACB->pActiveDCB->pActiveSRB); in DC390_Interrupt()
303 dc390_InvalidCmd( pACB ); in DC390_Interrupt()
309 dc390_ScsiRstDetect( pACB ); in DC390_Interrupt()
315 dc390_Disconnect( pACB ); in DC390_Interrupt()
321 dc390_Reselect( pACB ); in DC390_Interrupt()
333 pDCB = pACB->pActiveDCB; in DC390_Interrupt()
341 dc390_EnableMsgOut_Abort (pACB, pSRB); in DC390_Interrupt()
346 ( *stateV )( pACB, pSRB, &sstatus ); in DC390_Interrupt()
352 ( *stateV )( pACB, pSRB, &sstatus ); in DC390_Interrupt()
373 dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_DataOut_0() argument
427 dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_DataIn_0() argument
541 dc390_Command_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_Command_0() argument
546 dc390_Status_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_Status_0() argument
559 dc390_MsgOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_MsgOut_0() argument
568 dc390_reprog (PACB pACB, PDCB pDCB) in dc390_reprog() argument
574 dc390_SetXferRate (pACB, pDCB); in dc390_reprog()
592 dc390_MsgIn_reject (PACB pACB, PSRB pSRB) in dc390_MsgIn_reject() argument
600 dc390_MsgIn_QTag (PACB pACB, PDCB pDCB, UCHAR tag) in dc390_MsgIn_QTag() argument
617 dc390_EnableMsgOut_Abort( pACB, pSRB ); in dc390_MsgIn_QTag()
629 pSRB = pACB->pTmpSRB; in dc390_MsgIn_QTag()
641 dc390_MsgIn_set_async (PACB pACB, PSRB pSRB) in dc390_MsgIn_set_async() argument
653 pDCB->CtrlR4 |= pACB->glitch_cfg; /* glitch eater */ in dc390_MsgIn_set_async()
654 dc390_reprog (pACB, pDCB); in dc390_MsgIn_set_async()
659 dc390_MsgIn_set_sync (PACB pACB, PSRB pSRB) in dc390_MsgIn_set_sync() argument
704 if (pACB->glitch_cfg != NS_TO_GLITCH(0)) in dc390_MsgIn_set_sync()
705 pDCB->CtrlR4 |= NS_TO_GLITCH(((GLITCH_TO_NS(pACB->glitch_cfg)) - 1)); in dc390_MsgIn_set_sync()
714 pDCB->CtrlR4 |= pACB->glitch_cfg; /* glitch eater */ in dc390_MsgIn_set_sync()
727 dc390_reprog (pACB, pDCB); in dc390_MsgIn_set_sync()
733 dc390_restore_ptr (PACB pACB, PSRB pSRB) in dc390_restore_ptr() argument
807 dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_MsgIn_0() argument
809 PDCB pDCB = pACB->pActiveDCB; in dc390_MsgIn_0()
813 pSRB->MsgInBuf[pACB->MsgLen++] = DC390_read8 (ScsiFifo); in dc390_MsgIn_0()
817 if (dc390_MsgIn_complete (pSRB->MsgInBuf, pACB->MsgLen)) in dc390_MsgIn_0()
819 DEBUG0 (printk (KERN_INFO "DC390: MsgIn:"); dc390_printMsg (pSRB->MsgInBuf, pACB->MsgLen);) in dc390_MsgIn_0()
829 pSRB = dc390_MsgIn_QTag (pACB, pDCB, pSRB->MsgInBuf[1]); in dc390_MsgIn_0()
836 dc390_MsgIn_set_async (pACB, pSRB); in dc390_MsgIn_0()
842 dc390_MsgIn_reject (pACB, pSRB); in dc390_MsgIn_0()
846 dc390_MsgIn_set_async (pACB, pSRB); in dc390_MsgIn_0()
848 dc390_MsgIn_set_sync (pACB, pSRB); in dc390_MsgIn_0()
862 dc390_restore_ptr (pACB, pSRB); in dc390_MsgIn_0()
866 default: dc390_MsgIn_reject (pACB, pSRB); in dc390_MsgIn_0()
871 pACB->MsgLen = 0; in dc390_MsgIn_0()
881 dc390_DataIO_Comm( PACB pACB, PSRB pSRB, UCHAR ioDir) in dc390_DataIO_Comm() argument
885 PDCB pDCB = pACB->pActiveDCB; in dc390_DataIO_Comm()
887 if (pSRB == pACB->pTmpSRB) in dc390_DataIO_Comm()
892 dc390_EnableMsgOut_Abort (pACB, pSRB); in dc390_DataIO_Comm()
952 dc390_DataOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_DataOutPhase() argument
954 dc390_DataIO_Comm (pACB, pSRB, WRITE_DIRECTION); in dc390_DataOutPhase()
958 dc390_DataInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_DataInPhase() argument
960 dc390_DataIO_Comm (pACB, pSRB, READ_DIRECTION); in dc390_DataInPhase()
964 dc390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_CommandPhase() argument
983 pDCB = pACB->pActiveDCB; in dc390_CommandPhase()
996 dc390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_StatusPhase() argument
1005 dc390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_MsgOutPhase() argument
1012 pDCB = pACB->pActiveDCB; in dc390_MsgOutPhase()
1058 dc390_MsgInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_MsgInPhase() argument
1071 dc390_Nop_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_Nop_0() argument
1076 dc390_Nop_1( PACB pACB, PSRB pSRB, PUCHAR psstatus) in dc390_Nop_1() argument
1082 dc390_SetXferRate( PACB pACB, PDCB pDCB ) in dc390_SetXferRate() argument
1089 if( !pACB->scan_devices ) in dc390_SetXferRate()
1091 ptr = pACB->pLinkDCB; in dc390_SetXferRate()
1092 cnt = pACB->DCBCnt; in dc390_SetXferRate()
1113 dc390_Disconnect( PACB pACB ) in dc390_Disconnect() argument
1121 if (!pACB->Connected) printk(KERN_ERR "DC390: Disconnect not-connected bus?\n"); in dc390_Disconnect()
1122 pACB->Connected = 0; in dc390_Disconnect()
1123 pDCB = pACB->pActiveDCB; in dc390_Disconnect()
1128 pACB, pDCB, pACB->IOPortBase, pACB->IRQLevel);) in dc390_Disconnect()
1136 pACB->pActiveDCB = 0; in dc390_Disconnect()
1141 dc390_Waiting_process ( pACB ); in dc390_Disconnect()
1153 dc390_Free_insert (pACB, pSRB); in dc390_Disconnect()
1157 dc390_Query_to_Waiting (pACB); in dc390_Disconnect()
1158 dc390_Waiting_process (pACB); in dc390_Disconnect()
1170 dc390_waiting_timer (pACB, HZ/5); in dc390_Disconnect()
1180 dc390_Waiting_process ( pACB ); in dc390_Disconnect()
1188 dc390_SRBdone( pACB, pDCB, pSRB); in dc390_Disconnect()
1191 pACB->MsgLen = 0; in dc390_Disconnect()
1196 dc390_Reselect( PACB pACB ) in dc390_Reselect() argument
1203 pACB->Connected = 1; in dc390_Reselect()
1204 pDCB = pACB->pActiveDCB; in dc390_Reselect()
1209 if( !( pACB->scan_devices ) ) in dc390_Reselect()
1214 dc390_waiting_timer (pACB, HZ/5); in dc390_Reselect()
1220 if (!(lun & (1 << pACB->pScsiHost->this_id))) in dc390_Reselect()
1223 lun ^= 1 << pACB->pScsiHost->this_id; /* Mask AdapterID */ in dc390_Reselect()
1230 pDCB = dc390_findDCB (pACB, id, lun); in dc390_Reselect()
1237 pACB->pActiveDCB = pDCB; in dc390_Reselect()
1241 pSRB = pACB->pTmpSRB; in dc390_Reselect()
1249 pSRB= pACB->pTmpSRB; in dc390_Reselect()
1254 dc390_EnableMsgOut_Abort ( pACB, pSRB ); in dc390_Reselect()
1263 dc390_EnableMsgOut_Abort( pACB, pSRB ); in dc390_Reselect()
1283 dc390_remove_dev (PACB pACB, PDCB pDCB) in dc390_remove_dev() argument
1285 PDCB pPrevDCB = pACB->pLinkDCB; in dc390_remove_dev()
1293 pACB->DCBmap[pDCB->TargetID] &= ~(1 << pDCB->TargetLUN); in dc390_remove_dev()
1296 if (pDCB == pACB->pLinkDCB) in dc390_remove_dev()
1299 if (pACB->pLastDCB == pDCB) { in dc390_remove_dev()
1300 pDCB->pNextDCB = 0; pACB->pLastDCB = 0; in dc390_remove_dev()
1302 pACB->pLinkDCB = pDCB->pNextDCB; in dc390_remove_dev()
1308 if (pDCB == pACB->pLastDCB) pACB->pLastDCB = pPrevDCB; in dc390_remove_dev()
1313 if (pDCB == pACB->pActiveDCB) pACB->pActiveDCB = 0; in dc390_remove_dev()
1314 if (pDCB == pACB->pLinkDCB) pACB->pLinkDCB = pDCB->pNextDCB; in dc390_remove_dev()
1315 if (pDCB == pACB->pDCBRunRobin) pACB->pDCBRunRobin = pDCB->pNextDCB; in dc390_remove_dev()
1317 pACB->DCBCnt--; in dc390_remove_dev()
1356 dc390_add_dev (PACB pACB, PDCB pDCB, PSCSI_INQDATA ptr) in dc390_add_dev() argument
1366 dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB ) in dc390_RequestSense() argument
1399 if( dc390_StartSCSI( pACB, pDCB, pSRB ) ) { in dc390_RequestSense()
1401 dc390_waiting_timer (pACB, HZ/5); in dc390_RequestSense()
1407 dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB ) in dc390_SRBdone() argument
1433 status, pACB->scan_devices); break; in dc390_SRBdone()
1436 status, pACB->scan_devices); break; in dc390_SRBdone()
1439 status, pACB->scan_devices); break; in dc390_SRBdone()
1442 status, pACB->scan_devices); break; in dc390_SRBdone()
1445 status, pACB->scan_devices); break; in dc390_SRBdone()
1497 if( dc390_StartSCSI( pACB, pDCB, pSRB ) ) { in dc390_SRBdone()
1499 dc390_waiting_timer (pACB, HZ/5); in dc390_SRBdone()
1523 dc390_RequestSense( pACB, pDCB, pSRB ); in dc390_SRBdone()
1533 dc390_waiting_timer (pACB, HZ/5); in dc390_SRBdone()
1547 pACB->scan_devices) in dc390_SRBdone()
1572 if( dc390_StartSCSI( pACB, pDCB, pSRB ) ) { in dc390_SRBdone()
1574 dc390_waiting_timer (pACB, HZ/5); in dc390_SRBdone()
1618 if( pACB->scan_devices ) in dc390_SRBdone()
1638 dc390_remove_dev (pACB, pDCB); DCB_removed = 1; in dc390_SRBdone()
1640 if( (pcmd->target == pACB->pScsiHost->max_id - 1) && in dc390_SRBdone()
1641 ((pcmd->lun == 0) || (pcmd->lun == pACB->pScsiHost->max_lun - 1)) ) in dc390_SRBdone()
1642 pACB->scan_devices = 0; in dc390_SRBdone()
1647 if( (pcmd->target == pACB->pScsiHost->max_id - 1) && in dc390_SRBdone()
1648 (pcmd->lun == pACB->pScsiHost->max_lun - 1) ) in dc390_SRBdone()
1649 pACB->scan_devices = END_SCAN ; in dc390_SRBdone()
1665 dc390_remove_dev (pACB, pDCB); DCB_removed = 1; in dc390_SRBdone()
1670 dc390_add_dev (pACB, pDCB, ptr); in dc390_SRBdone()
1671 if (pACB->scan_devices) pACB->DeviceCnt++; in dc390_SRBdone()
1673 if( (pcmd->target == pACB->pScsiHost->max_id - 1) && in dc390_SRBdone()
1674 (pcmd->lun == pACB->pScsiHost->max_lun - 1) ) in dc390_SRBdone()
1675 pACB->scan_devices = 0; in dc390_SRBdone()
1684 dc390_Free_insert (pACB, pSRB); in dc390_SRBdone()
1691 dc390_Query_to_Waiting (pACB); in dc390_SRBdone()
1692 dc390_Waiting_process (pACB); in dc390_SRBdone()
1699 dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd ) in dc390_DoingSRB_Done() argument
1706 pDCB = pACB->pLinkDCB; in dc390_DoingSRB_Done()
1716 dc390_Free_insert (pACB, psrb); in dc390_DoingSRB_Done()
1738 dc390_Query_to_Waiting (pACB); in dc390_DoingSRB_Done()
1743 dc390_ResetSCSIBus( PACB pACB ) in dc390_ResetSCSIBus() argument
1752 pACB->Connected = 0; in dc390_ResetSCSIBus()
1758 dc390_ScsiRstDetect( PACB pACB ) in dc390_ScsiRstDetect() argument
1763 if (timer_pending (&pACB->Waiting_Timer)) del_timer (&pACB->Waiting_Timer); in dc390_ScsiRstDetect()
1769 pACB->pScsiHost->last_reset = jiffies + 5*HZ/2 in dc390_ScsiRstDetect()
1770 + HZ * dc390_eepromBuf[pACB->AdapterIndex][EE_DELAY]; in dc390_ScsiRstDetect()
1771 pACB->Connected = 0; in dc390_ScsiRstDetect()
1773 if( pACB->ACBFlag & RESET_DEV ) in dc390_ScsiRstDetect()
1774 pACB->ACBFlag |= RESET_DONE; in dc390_ScsiRstDetect()
1777 pACB->ACBFlag |= RESET_DETECT; in dc390_ScsiRstDetect()
1779 dc390_ResetDevParam( pACB ); in dc390_ScsiRstDetect()
1780 dc390_DoingSRB_Done( pACB, 0 ); in dc390_ScsiRstDetect()
1782 pACB->pActiveDCB = NULL; in dc390_ScsiRstDetect()
1783 pACB->ACBFlag = 0; in dc390_ScsiRstDetect()
1784 dc390_Waiting_process( pACB ); in dc390_ScsiRstDetect()