Lines Matching +full:revision +full:- +full:id2
3 FlashPoint.c -- FlashPoint SCCB Manager for Linux
11 Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
14 and a BSD-style copyright; see LICENSE.FlashPoint for details.
229 unsigned char niSysConf; /* Adapter Configuration byte -
231 unsigned char niScsiConf; /* SCSI Configuration byte -
233 unsigned char niScamConf; /* SCAM Configuration byte -
235 unsigned char niAdapId; /* Host Adapter ID -
276 #define TYPE_CODE0 0x63 /*Level2 Mstr (bits 7-6), */
278 #define SLV_TYPE_CODE0 0xA3 /*Priority Bit set (bits 7-6), */
294 enum scam_id_st { ID0, ID1, ID2, ID3, ID4, ID5, ID6, ID7, ID8, ID9, ID10, ID11, enumerator
409 #define XFER_HOST_DMA 0x00 /* 0 0 0 Transfer Host -> DMA */
410 #define XFER_DMA_HOST 0x01 /* 0 0 1 Transfer DMA -> Host */
705 #define NTCMD 0x02 /*Non- Tagged Command start */
892 ' ', 'B', 'T', '-', '9', '3', '0',
902 /*---------------------------------------------------------------------
908 *---------------------------------------------------------------------*/
919 ioport = pCardInfo->si_baseaddr; in FlashPoint_ProbeHostAdapter()
936 the bits(0-3) must be all ZERO for compatible with in FlashPoint_ProbeHostAdapter()
960 pCurrNvRam->niBaseAddr = ioport; in FlashPoint_ProbeHostAdapter()
972 pCardInfo->si_id = pCurrNvRam->niAdapId; in FlashPoint_ProbeHostAdapter()
974 pCardInfo->si_id = in FlashPoint_ProbeHostAdapter()
980 pCardInfo->si_lun = 0x00; in FlashPoint_ProbeHostAdapter()
981 pCardInfo->si_fw_revision = ORION_FW_REV; in FlashPoint_ProbeHostAdapter()
991 temp = (unsigned short)pCurrNvRam->niSyncTbl[id]; in FlashPoint_ProbeHostAdapter()
1008 case AUTO_RATE_20: /* Synchronous, 20 mega-transfers/second */ in FlashPoint_ProbeHostAdapter()
1011 case AUTO_RATE_10: /* Synchronous, 10 mega-transfers/second */ in FlashPoint_ProbeHostAdapter()
1014 case AUTO_RATE_05: /* Synchronous, 5 mega-transfers/second */ in FlashPoint_ProbeHostAdapter()
1030 pCardInfo->si_per_targ_init_sync = temp2; in FlashPoint_ProbeHostAdapter()
1031 pCardInfo->si_per_targ_no_disc = temp3; in FlashPoint_ProbeHostAdapter()
1032 pCardInfo->si_per_targ_wide_nego = temp4; in FlashPoint_ProbeHostAdapter()
1033 pCardInfo->si_per_targ_fast_nego = temp5; in FlashPoint_ProbeHostAdapter()
1034 pCardInfo->si_per_targ_ultra_nego = temp6; in FlashPoint_ProbeHostAdapter()
1037 i = pCurrNvRam->niSysConf; in FlashPoint_ProbeHostAdapter()
1043 ScamFlg = pCurrNvRam->niScamConf; in FlashPoint_ProbeHostAdapter()
1048 pCardInfo->si_mflags = 0x0000; in FlashPoint_ProbeHostAdapter()
1051 pCardInfo->si_mflags |= SCSI_PARITY_ENA; in FlashPoint_ProbeHostAdapter()
1054 pCardInfo->si_mflags |= SOFT_RESET; in FlashPoint_ProbeHostAdapter()
1057 pCardInfo->si_mflags |= EXTENDED_TRANSLATION; in FlashPoint_ProbeHostAdapter()
1060 pCardInfo->si_mflags |= FLAG_SCAM_ENABLED; in FlashPoint_ProbeHostAdapter()
1063 pCardInfo->si_mflags |= FLAG_SCAM_LEVEL2; in FlashPoint_ProbeHostAdapter()
1079 pCardInfo->si_mflags |= SUPPORT_16TAR_32LUN; in FlashPoint_ProbeHostAdapter()
1081 pCardInfo->si_card_family = HARPOON_FAMILY; in FlashPoint_ProbeHostAdapter()
1082 pCardInfo->si_bustype = BUSTYPE_PCI; in FlashPoint_ProbeHostAdapter()
1085 pCardInfo->si_card_model[0] = '9'; in FlashPoint_ProbeHostAdapter()
1086 switch (pCurrNvRam->niModel & 0x0f) { in FlashPoint_ProbeHostAdapter()
1088 pCardInfo->si_card_model[1] = '3'; in FlashPoint_ProbeHostAdapter()
1089 pCardInfo->si_card_model[2] = '0'; in FlashPoint_ProbeHostAdapter()
1092 pCardInfo->si_card_model[1] = '5'; in FlashPoint_ProbeHostAdapter()
1093 pCardInfo->si_card_model[2] = '0'; in FlashPoint_ProbeHostAdapter()
1096 pCardInfo->si_card_model[1] = '3'; in FlashPoint_ProbeHostAdapter()
1097 pCardInfo->si_card_model[2] = '2'; in FlashPoint_ProbeHostAdapter()
1100 pCardInfo->si_card_model[1] = '5'; in FlashPoint_ProbeHostAdapter()
1101 pCardInfo->si_card_model[2] = '2'; in FlashPoint_ProbeHostAdapter()
1106 pCardInfo->si_card_model[0] = (unsigned char)(temp >> 8); in FlashPoint_ProbeHostAdapter()
1109 pCardInfo->si_card_model[1] = (unsigned char)(temp & 0x00FF); in FlashPoint_ProbeHostAdapter()
1110 pCardInfo->si_card_model[2] = (unsigned char)(temp >> 8); in FlashPoint_ProbeHostAdapter()
1113 if (pCardInfo->si_card_model[1] == '3') { in FlashPoint_ProbeHostAdapter()
1115 pCardInfo->si_mflags |= LOW_BYTE_TERM; in FlashPoint_ProbeHostAdapter()
1116 } else if (pCardInfo->si_card_model[2] == '0') { in FlashPoint_ProbeHostAdapter()
1120 pCardInfo->si_mflags |= LOW_BYTE_TERM; in FlashPoint_ProbeHostAdapter()
1123 pCardInfo->si_mflags |= HIGH_BYTE_TERM; in FlashPoint_ProbeHostAdapter()
1141 pCardInfo->si_mflags |= LOW_BYTE_TERM; in FlashPoint_ProbeHostAdapter()
1143 pCardInfo->si_mflags |= HIGH_BYTE_TERM; in FlashPoint_ProbeHostAdapter()
1150 pCardInfo->si_XlatInfo[i] = in FlashPoint_ProbeHostAdapter()
1154 /* return with -1 if no sort, else return with in FlashPoint_ProbeHostAdapter()
1155 logical card number sorted by BIOS (zero-based) */ in FlashPoint_ProbeHostAdapter()
1157 pCardInfo->si_relative_cardnum = in FlashPoint_ProbeHostAdapter()
1159 char)(RD_HARPOON(ioport + hp_aramBase + BIOS_RELATIVE_CARD) - 1); in FlashPoint_ProbeHostAdapter()
1172 pCardInfo->si_present = 0x01; in FlashPoint_ProbeHostAdapter()
1177 /*---------------------------------------------------------------------
1183 *---------------------------------------------------------------------*/
1194 ioport = pCardInfo->si_baseaddr; in FlashPoint_HardwareResetHostAdapter()
1215 if (CurrCard->ioPort == in FlashPoint_HardwareResetHostAdapter()
1217 CurrCard->pNvRamInfo = in FlashPoint_HardwareResetHostAdapter()
1221 CurrCard->cardIndex = thisCard; in FlashPoint_HardwareResetHostAdapter()
1222 CurrCard->cardInfo = pCardInfo; in FlashPoint_HardwareResetHostAdapter()
1228 pCurrNvRam = CurrCard->pNvRamInfo; in FlashPoint_HardwareResetHostAdapter()
1231 ScamFlg = pCurrNvRam->niScamConf; in FlashPoint_HardwareResetHostAdapter()
1242 for (i = 0, id = 0x01; i != pCardInfo->si_id; i++, id <<= 1) { in FlashPoint_HardwareResetHostAdapter()
1247 WR_HARPOON(ioport + hp_arb_id, pCardInfo->si_id); in FlashPoint_HardwareResetHostAdapter()
1248 CurrCard->ourId = pCardInfo->si_id; in FlashPoint_HardwareResetHostAdapter()
1250 i = (unsigned char)pCardInfo->si_mflags; in FlashPoint_HardwareResetHostAdapter()
1264 if (!(pCardInfo->si_mflags & SOFT_RESET)) { in FlashPoint_HardwareResetHostAdapter()
1268 FPT_scini(thisCard, pCardInfo->si_id, 0); in FlashPoint_HardwareResetHostAdapter()
1271 if (pCardInfo->si_mflags & POST_ALL_UNDERRRUNS) in FlashPoint_HardwareResetHostAdapter()
1272 CurrCard->globalFlags |= F_NO_FILTER; in FlashPoint_HardwareResetHostAdapter()
1275 if (pCurrNvRam->niSysConf & 0x10) in FlashPoint_HardwareResetHostAdapter()
1276 CurrCard->globalFlags |= F_GREEN_PC; in FlashPoint_HardwareResetHostAdapter()
1279 CurrCard->globalFlags |= F_GREEN_PC; in FlashPoint_HardwareResetHostAdapter()
1282 /* Set global flag to indicate Re-Negotiation to be done on all in FlashPoint_HardwareResetHostAdapter()
1285 if (pCurrNvRam->niScsiConf & 0x04) in FlashPoint_HardwareResetHostAdapter()
1286 CurrCard->globalFlags |= F_DO_RENEGO; in FlashPoint_HardwareResetHostAdapter()
1289 CurrCard->globalFlags |= F_DO_RENEGO; in FlashPoint_HardwareResetHostAdapter()
1293 if (pCurrNvRam->niScsiConf & 0x08) in FlashPoint_HardwareResetHostAdapter()
1294 CurrCard->globalFlags |= F_CONLUN_IO; in FlashPoint_HardwareResetHostAdapter()
1297 CurrCard->globalFlags |= F_CONLUN_IO; in FlashPoint_HardwareResetHostAdapter()
1300 temp = pCardInfo->si_per_targ_no_disc; in FlashPoint_HardwareResetHostAdapter()
1313 temp = (unsigned short)pCurrNvRam->niSyncTbl[id]; in FlashPoint_HardwareResetHostAdapter()
1324 if (pCardInfo->si_per_targ_init_sync & sync_bit_map) { in FlashPoint_HardwareResetHostAdapter()
1340 /* if ((pCardInfo->si_per_targ_wide_nego & sync_bit_map) || in FlashPoint_HardwareResetHostAdapter()
1343 if (pCardInfo->si_per_targ_wide_nego & sync_bit_map) { in FlashPoint_HardwareResetHostAdapter()
1378 pCurrNvRam = ((struct sccb_card *)pCurrCard)->pNvRamInfo; in FlashPoint_ReleaseHostAdapter()
1381 FPT_WrStack(pCurrNvRam->niBaseAddr, 0, pCurrNvRam->niModel); in FlashPoint_ReleaseHostAdapter()
1382 FPT_WrStack(pCurrNvRam->niBaseAddr, 1, pCurrNvRam->niSysConf); in FlashPoint_ReleaseHostAdapter()
1383 FPT_WrStack(pCurrNvRam->niBaseAddr, 2, pCurrNvRam->niScsiConf); in FlashPoint_ReleaseHostAdapter()
1384 FPT_WrStack(pCurrNvRam->niBaseAddr, 3, pCurrNvRam->niScamConf); in FlashPoint_ReleaseHostAdapter()
1385 FPT_WrStack(pCurrNvRam->niBaseAddr, 4, pCurrNvRam->niAdapId); in FlashPoint_ReleaseHostAdapter()
1388 FPT_WrStack(pCurrNvRam->niBaseAddr, in FlashPoint_ReleaseHostAdapter()
1390 pCurrNvRam->niSyncTbl[i]); in FlashPoint_ReleaseHostAdapter()
1392 portBase = pCurrNvRam->niBaseAddr; in FlashPoint_ReleaseHostAdapter()
1396 pScamTbl = (u32 *)&pCurrNvRam->niScamTbl[i]; in FlashPoint_ReleaseHostAdapter()
1402 FPT_WrStack(((struct sccb_card *)pCurrCard)->ioPort, 0, 0); in FlashPoint_ReleaseHostAdapter()
1414 pNvRamInfo->niModel = FPT_RdStack(pNvRamInfo->niBaseAddr, 0); in FPT_RNVRamData()
1415 pNvRamInfo->niSysConf = FPT_RdStack(pNvRamInfo->niBaseAddr, 1); in FPT_RNVRamData()
1416 pNvRamInfo->niScsiConf = FPT_RdStack(pNvRamInfo->niBaseAddr, 2); in FPT_RNVRamData()
1417 pNvRamInfo->niScamConf = FPT_RdStack(pNvRamInfo->niBaseAddr, 3); in FPT_RNVRamData()
1418 pNvRamInfo->niAdapId = FPT_RdStack(pNvRamInfo->niBaseAddr, 4); in FPT_RNVRamData()
1421 pNvRamInfo->niSyncTbl[i] = in FPT_RNVRamData()
1422 FPT_RdStack(pNvRamInfo->niBaseAddr, (unsigned char)(i + 5)); in FPT_RNVRamData()
1424 portBase = pNvRamInfo->niBaseAddr; in FPT_RNVRamData()
1429 pScamTbl = (u32 *)&pNvRamInfo->niScamTbl[i]; in FPT_RNVRamData()
1461 /*---------------------------------------------------------------------
1469 *---------------------------------------------------------------------*/
1478 thisCard = pCurrCard->cardIndex; in FlashPoint_StartCCB()
1479 ioport = pCurrCard->ioPort; in FlashPoint_StartCCB()
1481 if ((p_Sccb->TargID >= MAX_SCSI_TAR) || (p_Sccb->Lun >= MAX_LUN)) { in FlashPoint_StartCCB()
1483 p_Sccb->HostStatus = SCCB_COMPLETE; in FlashPoint_StartCCB()
1484 p_Sccb->SccbStatus = SCCB_ERROR; in FlashPoint_StartCCB()
1485 callback = (CALL_BK_FN) p_Sccb->SccbCallback; in FlashPoint_StartCCB()
1494 if (!pCurrCard->cmdCounter) { in FlashPoint_StartCCB()
1499 if (pCurrCard->globalFlags & F_GREEN_PC) { in FlashPoint_StartCCB()
1505 pCurrCard->cmdCounter++; in FlashPoint_StartCCB()
1512 if (p_Sccb->OperationCode == RESET_COMMAND) { in FlashPoint_StartCCB()
1514 pCurrCard->currentSCCB; in FlashPoint_StartCCB()
1515 pCurrCard->currentSCCB = p_Sccb; in FlashPoint_StartCCB()
1517 pCurrCard->currentSCCB = in FlashPoint_StartCCB()
1526 if (p_Sccb->OperationCode == RESET_COMMAND) { in FlashPoint_StartCCB()
1528 pCurrCard->currentSCCB; in FlashPoint_StartCCB()
1529 pCurrCard->currentSCCB = p_Sccb; in FlashPoint_StartCCB()
1531 pCurrCard->currentSCCB = in FlashPoint_StartCCB()
1542 if ((pCurrCard->globalFlags & F_CONLUN_IO) && in FlashPoint_StartCCB()
1543 ((FPT_sccbMgrTbl[thisCard][p_Sccb->TargID]. in FlashPoint_StartCCB()
1545 lun = p_Sccb->Lun; in FlashPoint_StartCCB()
1548 if ((pCurrCard->currentSCCB == NULL) && in FlashPoint_StartCCB()
1549 (FPT_sccbMgrTbl[thisCard][p_Sccb->TargID].TarSelQ_Cnt == 0) in FlashPoint_StartCCB()
1550 && (FPT_sccbMgrTbl[thisCard][p_Sccb->TargID].TarLUNBusy[lun] in FlashPoint_StartCCB()
1553 pCurrCard->currentSCCB = p_Sccb; in FlashPoint_StartCCB()
1554 FPT_ssel(p_Sccb->SccbIOPort, thisCard); in FlashPoint_StartCCB()
1559 if (p_Sccb->OperationCode == RESET_COMMAND) { in FlashPoint_StartCCB()
1560 pSaveSccb = pCurrCard->currentSCCB; in FlashPoint_StartCCB()
1561 pCurrCard->currentSCCB = p_Sccb; in FlashPoint_StartCCB()
1564 pCurrCard->currentSCCB = pSaveSccb; in FlashPoint_StartCCB()
1575 /*---------------------------------------------------------------------
1583 *---------------------------------------------------------------------*/
1593 ioport = ((struct sccb_card *)pCurrCard)->ioPort; in FlashPoint_AbortCCB()
1595 thisCard = ((struct sccb_card *)pCurrCard)->cardIndex; in FlashPoint_AbortCCB()
1601 ((struct sccb_card *)pCurrCard)->cmdCounter--; in FlashPoint_AbortCCB()
1603 if (!((struct sccb_card *)pCurrCard)->cmdCounter) in FlashPoint_AbortCCB()
1610 p_Sccb->SccbStatus = SCCB_ABORT; in FlashPoint_AbortCCB()
1611 callback = p_Sccb->SccbCallback; in FlashPoint_AbortCCB()
1618 if (((struct sccb_card *)pCurrCard)->currentSCCB == in FlashPoint_AbortCCB()
1620 p_Sccb->SccbStatus = SCCB_ABORT; in FlashPoint_AbortCCB()
1626 if (p_Sccb->Sccb_tag) { in FlashPoint_AbortCCB()
1628 if (((struct sccb_card *)pCurrCard)-> in FlashPoint_AbortCCB()
1629 discQ_Tbl[p_Sccb->Sccb_tag] == in FlashPoint_AbortCCB()
1631 p_Sccb->SccbStatus = SCCB_ABORT; in FlashPoint_AbortCCB()
1632 p_Sccb->Sccb_scsistat = in FlashPoint_AbortCCB()
1634 p_Sccb->Sccb_scsimsg = in FlashPoint_AbortCCB()
1638 pCurrCard)->currentSCCB == in FlashPoint_AbortCCB()
1641 pCurrCard)-> in FlashPoint_AbortCCB()
1648 *)pCurrCard)-> in FlashPoint_AbortCCB()
1651 pCurrCard)-> in FlashPoint_AbortCCB()
1655 pCurrCard)-> in FlashPoint_AbortCCB()
1663 &FPT_sccbMgrTbl[thisCard][p_Sccb-> in FlashPoint_AbortCCB()
1667 discQ_Tbl[currTar_Info-> in FlashPoint_AbortCCB()
1668 LunDiscQ_Idx[p_Sccb->Lun]] in FlashPoint_AbortCCB()
1670 p_Sccb->SccbStatus = SCCB_ABORT; in FlashPoint_AbortCCB()
1677 return -1; in FlashPoint_AbortCCB()
1680 /*---------------------------------------------------------------------
1687 *---------------------------------------------------------------------*/
1692 ioport = ((struct sccb_card *)pCurrCard)->ioPort; in FlashPoint_InterruptPending()
1703 /*---------------------------------------------------------------------
1711 *---------------------------------------------------------------------*/
1721 thisCard = pCurrCard->cardIndex; in FlashPoint_HandleInterrupt()
1722 ioport = pCurrCard->ioPort; in FlashPoint_HandleInterrupt()
1737 currSCCB = pCurrCard->currentSCCB; in FlashPoint_HandleInterrupt()
1767 if (pCurrCard->globalFlags & F_HOST_XFER_ACT) in FlashPoint_HandleInterrupt()
1783 if (pCurrCard->globalFlags & F_HOST_XFER_ACT) in FlashPoint_HandleInterrupt()
1790 currSCCB->Sccb_XferState |= F_NO_DATA_YET; in FlashPoint_HandleInterrupt()
1792 currSCCB->Sccb_savedATC = currSCCB->Sccb_ATC; in FlashPoint_HandleInterrupt()
1795 currSCCB->Sccb_scsistat = DISCONNECT_ST; in FlashPoint_HandleInterrupt()
1813 with the revision D/E harpoon chips. The caller should reset the in FlashPoint_HandleInterrupt()
1826 pCurrCard->globalFlags |= F_NEW_SCCB_CMD; in FlashPoint_HandleInterrupt()
1836 if (pCurrCard->globalFlags & F_HOST_XFER_ACT) in FlashPoint_HandleInterrupt()
1842 currSCCB->Sccb_XferState |= in FlashPoint_HandleInterrupt()
1844 currSCCB->Sccb_savedATC = in FlashPoint_HandleInterrupt()
1845 currSCCB->Sccb_ATC; in FlashPoint_HandleInterrupt()
1850 currSCCB->Sccb_scsistat = DISCONNECT_ST; in FlashPoint_HandleInterrupt()
1911 if (pCurrCard->globalFlags & F_HOST_XFER_ACT) { in FlashPoint_HandleInterrupt()
1923 pCurrCard->globalFlags |= F_NEW_SCCB_CMD; in FlashPoint_HandleInterrupt()
1926 if (((struct sccb_card *)pCurrCard)-> in FlashPoint_HandleInterrupt()
1929 pCurrCard->globalFlags &= ~F_NEW_SCCB_CMD; in FlashPoint_HandleInterrupt()
1931 if (pCurrCard->currentSCCB == NULL) in FlashPoint_HandleInterrupt()
1934 if (pCurrCard->currentSCCB != NULL) { in FlashPoint_HandleInterrupt()
1935 pCurrCard->globalFlags &= ~F_NEW_SCCB_CMD; in FlashPoint_HandleInterrupt()
1950 /*---------------------------------------------------------------------
1959 *---------------------------------------------------------------------*/
1971 if (pCurrCard->globalFlags & F_HOST_XFER_ACT) { in FPT_SccbMgr_bad_isr()
1974 pCurrCard->currentSCCB); in FPT_SccbMgr_bad_isr()
1987 if (pCurrCard->currentSCCB != NULL) { in FPT_SccbMgr_bad_isr()
1989 if (!pCurrCard->currentSCCB->HostStatus) in FPT_SccbMgr_bad_isr()
1990 pCurrCard->currentSCCB->HostStatus = in FPT_SccbMgr_bad_isr()
2013 if (pCurrCard->currentSCCB != NULL) { in FPT_SccbMgr_bad_isr()
2015 if (pCurrCard->globalFlags & F_HOST_XFER_ACT) in FPT_SccbMgr_bad_isr()
2018 pCurrCard->currentSCCB); in FPT_SccbMgr_bad_isr()
2028 pCurrNvRam = pCurrCard->pNvRamInfo; in FPT_SccbMgr_bad_isr()
2030 ScamFlg = pCurrNvRam->niScamConf; in FPT_SccbMgr_bad_isr()
2039 FPT_scini(p_card, pCurrCard->ourId, 0); in FPT_SccbMgr_bad_isr()
2048 if (pCurrCard->currentSCCB != NULL) in FPT_SccbMgr_bad_isr()
2060 pCurrCard->currentSCCB->HostStatus = SCCB_SELECTION_TIMEOUT; in FPT_SccbMgr_bad_isr()
2063 &FPT_sccbMgrTbl[p_card][pCurrCard->currentSCCB->TargID]; in FPT_SccbMgr_bad_isr()
2064 if ((pCurrCard->globalFlags & F_CONLUN_IO) in FPT_SccbMgr_bad_isr()
2065 && ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != in FPT_SccbMgr_bad_isr()
2067 currTar_Info->TarLUNBusy[pCurrCard->currentSCCB->Lun] = in FPT_SccbMgr_bad_isr()
2070 currTar_Info->TarLUNBusy[0] = 0; in FPT_SccbMgr_bad_isr()
2072 if (currTar_Info->TarEEValue & EE_SYNC_MASK) { in FPT_SccbMgr_bad_isr()
2073 currTar_Info->TarSyncCtrl = 0; in FPT_SccbMgr_bad_isr()
2074 currTar_Info->TarStatus &= ~TAR_SYNC_MASK; in FPT_SccbMgr_bad_isr()
2077 if (currTar_Info->TarEEValue & EE_WIDE_SCSI) { in FPT_SccbMgr_bad_isr()
2078 currTar_Info->TarStatus &= ~TAR_WIDE_MASK; in FPT_SccbMgr_bad_isr()
2081 FPT_sssyncv(p_port, pCurrCard->currentSCCB->TargID, NARROW_SCSI, in FPT_SccbMgr_bad_isr()
2084 FPT_queueCmdComplete(pCurrCard, pCurrCard->currentSCCB, p_card); in FPT_SccbMgr_bad_isr()
2102 /*---------------------------------------------------------------------
2108 *---------------------------------------------------------------------*/
2125 /*---------------------------------------------------------------------
2131 *---------------------------------------------------------------------*/
2148 pCurrCard->scanIndex = 0x00; in FPT_SccbMgrTableInitCard()
2149 pCurrCard->currentSCCB = NULL; in FPT_SccbMgrTableInitCard()
2150 pCurrCard->globalFlags = 0x00; in FPT_SccbMgrTableInitCard()
2151 pCurrCard->cmdCounter = 0x00; in FPT_SccbMgrTableInitCard()
2152 pCurrCard->tagQ_Lst = 0x01; in FPT_SccbMgrTableInitCard()
2153 pCurrCard->discQCount = 0; in FPT_SccbMgrTableInitCard()
2157 /*---------------------------------------------------------------------
2163 *---------------------------------------------------------------------*/
2174 currTar_Info->TarSelQ_Cnt = 0; in FPT_SccbMgrTableInitTarget()
2175 currTar_Info->TarSyncCtrl = 0; in FPT_SccbMgrTableInitTarget()
2177 currTar_Info->TarSelQ_Head = NULL; in FPT_SccbMgrTableInitTarget()
2178 currTar_Info->TarSelQ_Tail = NULL; in FPT_SccbMgrTableInitTarget()
2179 currTar_Info->TarTagQ_Cnt = 0; in FPT_SccbMgrTableInitTarget()
2180 currTar_Info->TarLUN_CA = 0; in FPT_SccbMgrTableInitTarget()
2183 currTar_Info->TarLUNBusy[lun] = 0; in FPT_SccbMgrTableInitTarget()
2184 currTar_Info->LunDiscQ_Idx[lun] = 0; in FPT_SccbMgrTableInitTarget()
2189 if (FPT_BL_Card[p_card].discQ_Tbl[qtag]->TargID == in FPT_SccbMgrTableInitTarget()
2192 FPT_BL_Card[p_card].discQCount--; in FPT_SccbMgrTableInitTarget()
2198 /*---------------------------------------------------------------------
2205 *---------------------------------------------------------------------*/
2233 pCurrSCCB->Sccb_scsimsg = MSG_PARITY_ERROR; in FPT_sfm()
2267 /*---------------------------------------------------------------------
2273 *---------------------------------------------------------------------*/
2287 currSCCB = CurrCard->currentSCCB; in FPT_ssel()
2288 target = currSCCB->TargID; in FPT_ssel()
2290 lastTag = CurrCard->tagQ_Lst; in FPT_ssel()
2294 if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_REJECT) in FPT_ssel()
2295 currSCCB->ControlByte &= ~F_USE_CMD_Q; in FPT_ssel()
2297 if (((CurrCard->globalFlags & F_CONLUN_IO) && in FPT_ssel()
2298 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) in FPT_ssel()
2300 lun = currSCCB->Lun; in FPT_ssel()
2304 if (CurrCard->globalFlags & F_TAG_STARTED) { in FPT_ssel()
2305 if (!(currSCCB->ControlByte & F_USE_CMD_Q)) { in FPT_ssel()
2306 if ((currTar_Info->TarLUN_CA == 0) in FPT_ssel()
2307 && ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) in FPT_ssel()
2310 if (currTar_Info->TarTagQ_Cnt != 0) { in FPT_ssel()
2311 currTar_Info->TarLUNBusy[lun] = 1; in FPT_ssel()
2318 currTar_Info->TarLUNBusy[lun] = 1; in FPT_ssel()
2322 /*End non-tagged */ in FPT_ssel()
2324 currTar_Info->TarLUNBusy[lun] = 1; in FPT_ssel()
2330 if (currTar_Info->TarLUN_CA == 1) { in FPT_ssel()
2336 currTar_Info->TarLUNBusy[lun] = 1; in FPT_ssel()
2343 currTar_Info->TarLUNBusy[lun] = 1; in FPT_ssel()
2346 if ((((CurrCard->globalFlags & F_CONLUN_IO) && in FPT_ssel()
2347 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)) in FPT_ssel()
2348 || (!(currSCCB->ControlByte & F_USE_CMD_Q)))) { in FPT_ssel()
2349 if (CurrCard->discQCount >= QUEUE_DEPTH) { in FPT_ssel()
2350 currTar_Info->TarLUNBusy[lun] = 1; in FPT_ssel()
2358 if (CurrCard->discQ_Tbl[lastTag] == NULL) { in FPT_ssel()
2359 CurrCard->tagQ_Lst = lastTag; in FPT_ssel()
2360 currTar_Info->LunDiscQ_Idx[lun] = lastTag; in FPT_ssel()
2361 CurrCard->discQ_Tbl[lastTag] = currSCCB; in FPT_ssel()
2362 CurrCard->discQCount++; in FPT_ssel()
2367 currTar_Info->TarLUNBusy[lun] = 1; in FPT_ssel()
2379 if (currSCCB->OperationCode == RESET_COMMAND) { in FPT_ssel()
2381 (currSCCB-> in FPT_ssel()
2386 currSCCB->Sccb_scsimsg = TARGET_RESET; in FPT_ssel()
2390 currSCCB->Sccb_scsistat = SELECT_BDR_ST; in FPT_ssel()
2392 if (currTar_Info->TarEEValue & EE_SYNC_MASK) { in FPT_ssel()
2393 currTar_Info->TarSyncCtrl = 0; in FPT_ssel()
2394 currTar_Info->TarStatus &= ~TAR_SYNC_MASK; in FPT_ssel()
2397 if (currTar_Info->TarEEValue & EE_WIDE_SCSI) { in FPT_ssel()
2398 currTar_Info->TarStatus &= ~TAR_WIDE_MASK; in FPT_ssel()
2406 else if (currSCCB->Sccb_scsistat == ABORT_ST) { in FPT_ssel()
2408 (currSCCB-> in FPT_ssel()
2415 char)(currSCCB-> in FPT_ssel()
2421 (MPM_OP + AMSG_OUT + currSCCB->Sccb_tag)); in FPT_ssel()
2429 else if (!(currTar_Info->TarStatus & WIDE_NEGOCIATED)) { in FPT_ssel()
2431 currSCCB->Sccb_scsistat = SELECT_WN_ST; in FPT_ssel()
2434 else if (!((currTar_Info->TarStatus & TAR_SYNC_MASK) in FPT_ssel()
2437 currSCCB->Sccb_scsistat = SELECT_SN_ST; in FPT_ssel()
2442 if (currSCCB->ControlByte & F_USE_CMD_Q) { in FPT_ssel()
2444 CurrCard->globalFlags |= F_TAG_STARTED; in FPT_ssel()
2446 if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) in FPT_ssel()
2448 currSCCB->ControlByte &= ~F_USE_CMD_Q; in FPT_ssel()
2451 Non-Tag-CMD handling */ in FPT_ssel()
2457 currSCCB->Sccb_idmsg)); in FPT_ssel()
2464 currSCCB->Sccb_scsistat = SELECT_ST; in FPT_ssel()
2466 currTar_Info->TarLUNBusy[lun] = 1; in FPT_ssel()
2472 currSCCB->Sccb_idmsg)); in FPT_ssel()
2476 (((unsigned char)(currSCCB-> in FPT_ssel()
2484 if (CurrCard->discQ_Tbl[lastTag] == in FPT_ssel()
2490 CurrCard->tagQ_Lst = lastTag; in FPT_ssel()
2491 currSCCB->Sccb_tag = lastTag; in FPT_ssel()
2492 CurrCard->discQ_Tbl[lastTag] = in FPT_ssel()
2494 CurrCard->discQCount++; in FPT_ssel()
2500 currTar_Info->TarLUNBusy[lun] = 1; in FPT_ssel()
2506 currSCCB->Sccb_scsistat = SELECT_Q_ST; in FPT_ssel()
2519 (MPM_OP + AMSG_OUT + currSCCB->Sccb_idmsg)); in FPT_ssel()
2521 currSCCB->Sccb_scsistat = SELECT_ST; in FPT_ssel()
2527 theCCB = (unsigned char *)&currSCCB->Cdb[0]; in FPT_ssel()
2531 for (i = 0; i < currSCCB->CdbLength; i++) { in FPT_ssel()
2537 if (currSCCB->CdbLength != TWELVE_BYTE_CMD) in FPT_ssel()
2549 if (!(currSCCB->Sccb_MGRFlags & F_DEV_SELECTED)) { in FPT_ssel()
2566 /*---------------------------------------------------------------------
2572 *---------------------------------------------------------------------*/
2583 if (pCurrCard->currentSCCB != NULL) { in FPT_sres()
2585 &FPT_sccbMgrTbl[p_card][pCurrCard->currentSCCB->TargID]; in FPT_sres()
2590 currSCCB = pCurrCard->currentSCCB; in FPT_sres()
2591 if (currSCCB->Sccb_scsistat == SELECT_WN_ST) { in FPT_sres()
2592 currTar_Info->TarStatus &= ~TAR_WIDE_MASK; in FPT_sres()
2593 currSCCB->Sccb_scsistat = BUS_FREE_ST; in FPT_sres()
2595 if (currSCCB->Sccb_scsistat == SELECT_SN_ST) { in FPT_sres()
2596 currTar_Info->TarStatus &= ~TAR_SYNC_MASK; in FPT_sres()
2597 currSCCB->Sccb_scsistat = BUS_FREE_ST; in FPT_sres()
2599 if (((pCurrCard->globalFlags & F_CONLUN_IO) && in FPT_sres()
2600 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != in FPT_sres()
2602 currTar_Info->TarLUNBusy[currSCCB->Lun] = 0; in FPT_sres()
2603 if (currSCCB->Sccb_scsistat != ABORT_ST) { in FPT_sres()
2604 pCurrCard->discQCount--; in FPT_sres()
2605 pCurrCard->discQ_Tbl[currTar_Info-> in FPT_sres()
2606 LunDiscQ_Idx[currSCCB-> in FPT_sres()
2611 currTar_Info->TarLUNBusy[0] = 0; in FPT_sres()
2612 if (currSCCB->Sccb_tag) { in FPT_sres()
2613 if (currSCCB->Sccb_scsistat != ABORT_ST) { in FPT_sres()
2614 pCurrCard->discQCount--; in FPT_sres()
2615 pCurrCard->discQ_Tbl[currSCCB-> in FPT_sres()
2619 if (currSCCB->Sccb_scsistat != ABORT_ST) { in FPT_sres()
2620 pCurrCard->discQCount--; in FPT_sres()
2621 pCurrCard->discQ_Tbl[currTar_Info-> in FPT_sres()
2652 message = FPT_sfm(port, pCurrCard->currentSCCB); in FPT_sres()
2658 if ((currTar_Info-> in FPT_sres()
2661 if (currTar_Info->TarTagQ_Cnt != in FPT_sres()
2665 (currTar_Info-> in FPT_sres()
2672 pCurrCard-> in FPT_sres()
2688 pCurrCard-> in FPT_sres()
2762 if (((pCurrCard->globalFlags & F_CONLUN_IO) && in FPT_sres()
2763 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) { in FPT_sres()
2764 currTar_Info->TarLUNBusy[lun] = 1; in FPT_sres()
2765 pCurrCard->currentSCCB = in FPT_sres()
2766 pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[lun]]; in FPT_sres()
2767 if (pCurrCard->currentSCCB != NULL) { in FPT_sres()
2773 currTar_Info->TarLUNBusy[0] = 1; in FPT_sres()
2776 if (pCurrCard->discQ_Tbl[tag] != NULL) { in FPT_sres()
2777 pCurrCard->currentSCCB = in FPT_sres()
2778 pCurrCard->discQ_Tbl[tag]; in FPT_sres()
2779 currTar_Info->TarTagQ_Cnt--; in FPT_sres()
2785 pCurrCard->currentSCCB = in FPT_sres()
2786 pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[0]]; in FPT_sres()
2787 if (pCurrCard->currentSCCB != NULL) { in FPT_sres()
2795 if (pCurrCard->currentSCCB != NULL) { in FPT_sres()
2796 if (pCurrCard->currentSCCB->Sccb_scsistat == ABORT_ST) { in FPT_sres()
2797 /* During Abort Tag command, the target could have got re-selected in FPT_sres()
2800 FPT_queueFindSccb(pCurrCard->currentSCCB, p_card); in FPT_sres()
2848 /*---------------------------------------------------------------------
2855 *---------------------------------------------------------------------*/
2863 currSCCB = CurrCard->currentSCCB; in FPT_sdecm()
2865 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID]; in FPT_sdecm()
2868 if (!(currSCCB->Sccb_XferState & F_NO_DATA_YET)) { in FPT_sdecm()
2869 currSCCB->Sccb_ATC = currSCCB->Sccb_savedATC; in FPT_sdecm()
2881 if (currSCCB->Sccb_scsistat == SELECT_Q_ST) { in FPT_sdecm()
2882 currTar_Info->TarStatus &= in FPT_sdecm()
2884 currTar_Info->TarStatus |= (unsigned char)TAG_Q_REJECT; in FPT_sdecm()
2902 if ((currSCCB->Sccb_scsistat == SELECT_SN_ST) || in FPT_sdecm()
2903 (currSCCB->Sccb_scsistat == SELECT_WN_ST) || in FPT_sdecm()
2904 ((currTar_Info->TarStatus & TAR_SYNC_MASK) == SYNC_TRYING) in FPT_sdecm()
2905 || ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == in FPT_sdecm()
2917 if (currSCCB->Lun == 0x00) { in FPT_sdecm()
2918 if (currSCCB->Sccb_scsistat == SELECT_SN_ST) { in FPT_sdecm()
2920 currTar_Info->TarStatus |= in FPT_sdecm()
2923 currTar_Info->TarEEValue &= in FPT_sdecm()
2927 else if (currSCCB->Sccb_scsistat == in FPT_sdecm()
2930 currTar_Info->TarStatus = in FPT_sdecm()
2931 (currTar_Info-> in FPT_sdecm()
2935 currTar_Info->TarEEValue &= in FPT_sdecm()
2940 else if ((currTar_Info-> in FPT_sdecm()
2943 currTar_Info->TarStatus = in FPT_sdecm()
2944 (currTar_Info-> in FPT_sdecm()
2948 currSCCB->ControlByte &= ~F_USE_CMD_Q; in FPT_sdecm()
2949 CurrCard->discQCount--; in FPT_sdecm()
2950 CurrCard->discQ_Tbl[currSCCB-> in FPT_sdecm()
2952 currSCCB->Sccb_tag = 0x00; in FPT_sdecm()
2959 if (currSCCB->Lun == 0x00) { in FPT_sdecm()
2962 CurrCard->globalFlags |= F_NEW_SCCB_CMD; in FPT_sdecm()
2968 if ((CurrCard->globalFlags & F_CONLUN_IO) && in FPT_sdecm()
2969 ((currTar_Info-> in FPT_sdecm()
2972 currTar_Info->TarLUNBusy[currSCCB-> in FPT_sdecm()
2975 currTar_Info->TarLUNBusy[0] = 1; in FPT_sdecm()
2977 currSCCB->ControlByte &= in FPT_sdecm()
3013 if (currSCCB->Sccb_scsimsg != MSG_PARITY_ERROR) in FPT_sdecm()
3021 currSCCB->HostStatus = SCCB_PHASE_SEQUENCE_FAIL; in FPT_sdecm()
3022 currSCCB->Sccb_scsimsg = MESSAGE_REJECT; in FPT_sdecm()
3030 /*---------------------------------------------------------------------
3036 *---------------------------------------------------------------------*/
3056 pCurrSCCB->Sccb_scsimsg = MESSAGE_REJECT; in FPT_shandem()
3067 pCurrSCCB->Sccb_scsimsg = MESSAGE_REJECT; in FPT_shandem()
3076 pCurrSCCB->Sccb_scsimsg = MESSAGE_REJECT; in FPT_shandem()
3083 if (pCurrSCCB->Sccb_scsimsg != MSG_PARITY_ERROR) in FPT_shandem()
3089 if (pCurrSCCB->Sccb_scsimsg == MSG_PARITY_ERROR) in FPT_shandem()
3095 /*---------------------------------------------------------------------
3102 *---------------------------------------------------------------------*/
3111 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID]; in FPT_sisyncn()
3113 if (!((currTar_Info->TarStatus & TAR_SYNC_MASK) == SYNC_TRYING)) { in FPT_sisyncn()
3117 (currSCCB-> in FPT_sisyncn()
3128 if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == EE_SYNC_20MB) in FPT_sisyncn()
3133 else if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == in FPT_sisyncn()
3139 else if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == in FPT_sisyncn()
3157 currTar_Info->TarStatus = in FPT_sisyncn()
3158 ((currTar_Info-> in FPT_sisyncn()
3171 currTar_Info->TarStatus |= (unsigned char)SYNC_SUPPORTED; in FPT_sisyncn()
3172 currTar_Info->TarEEValue &= ~EE_SYNC_MASK; in FPT_sisyncn()
3177 /*---------------------------------------------------------------------
3184 *---------------------------------------------------------------------*/
3192 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID]; in FPT_stsyncn()
3196 if ((sync_msg == 0x00) && (currSCCB->Sccb_scsimsg == MSG_PARITY_ERROR)) { in FPT_stsyncn()
3206 if ((offset == 0x00) && (currSCCB->Sccb_scsimsg == MSG_PARITY_ERROR)) { in FPT_stsyncn()
3212 if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == EE_SYNC_20MB) in FPT_stsyncn()
3216 else if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == EE_SYNC_10MB) in FPT_stsyncn()
3220 else if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == EE_SYNC_5MB) in FPT_stsyncn()
3273 if (currTar_Info->TarStatus & WIDE_ENABLED) in FPT_stsyncn()
3281 FPT_sssyncv(port, currSCCB->TargID, sync_reg, currTar_Info); in FPT_stsyncn()
3283 if (currSCCB->Sccb_scsistat == SELECT_SN_ST) { in FPT_stsyncn()
3287 currTar_Info->TarStatus = ((currTar_Info->TarStatus & in FPT_stsyncn()
3301 currTar_Info->TarStatus = ((currTar_Info->TarStatus & in FPT_stsyncn()
3307 /*---------------------------------------------------------------------
3313 *---------------------------------------------------------------------*/
3338 /*---------------------------------------------------------------------
3345 *---------------------------------------------------------------------*/
3353 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID]; in FPT_siwidn()
3355 if (!((currTar_Info->TarStatus & TAR_WIDE_MASK) == WIDE_NEGOCIATED)) { in FPT_siwidn()
3359 (currSCCB-> in FPT_siwidn()
3376 currTar_Info->TarStatus = ((currTar_Info->TarStatus & in FPT_siwidn()
3385 currTar_Info->TarStatus = ((currTar_Info->TarStatus & in FPT_siwidn()
3389 currTar_Info->TarEEValue &= ~EE_WIDE_SCSI; in FPT_siwidn()
3394 /*---------------------------------------------------------------------
3401 *---------------------------------------------------------------------*/
3409 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID]; in FPT_stwidn()
3413 if ((width == 0x00) && (currSCCB->Sccb_scsimsg == MSG_PARITY_ERROR)) { in FPT_stwidn()
3419 if (!(currTar_Info->TarEEValue & EE_WIDE_SCSI)) in FPT_stwidn()
3423 currTar_Info->TarStatus |= WIDE_ENABLED; in FPT_stwidn()
3427 currTar_Info->TarStatus &= ~WIDE_ENABLED; in FPT_stwidn()
3430 FPT_sssyncv(port, currSCCB->TargID, width, currTar_Info); in FPT_stwidn()
3432 if (currSCCB->Sccb_scsistat == SELECT_WN_ST) { in FPT_stwidn()
3434 currTar_Info->TarStatus |= WIDE_NEGOCIATED; in FPT_stwidn()
3437 ((currTar_Info->TarStatus & TAR_SYNC_MASK) == in FPT_stwidn()
3442 currSCCB->Sccb_scsistat = SELECT_SN_ST; in FPT_stwidn()
3455 if (currTar_Info->TarEEValue & EE_WIDE_SCSI) in FPT_stwidn()
3462 currTar_Info->TarStatus |= (WIDE_NEGOCIATED | WIDE_ENABLED); in FPT_stwidn()
3466 /*---------------------------------------------------------------------
3472 *---------------------------------------------------------------------*/
3495 /*---------------------------------------------------------------------
3502 *---------------------------------------------------------------------*/
3565 currTar_Info->TarSyncCtrl = p_sync_value; in FPT_sssyncv()
3568 /*---------------------------------------------------------------------
3574 *---------------------------------------------------------------------*/
3609 if (currTar_Info->TarEEValue & EE_SYNC_MASK) { in FPT_sresb()
3610 currTar_Info->TarSyncCtrl = 0; in FPT_sresb()
3611 currTar_Info->TarStatus &= ~TAR_SYNC_MASK; in FPT_sresb()
3614 if (currTar_Info->TarEEValue & EE_WIDE_SCSI) { in FPT_sresb()
3615 currTar_Info->TarStatus &= ~TAR_WIDE_MASK; in FPT_sresb()
3639 /*---------------------------------------------------------------------
3645 *---------------------------------------------------------------------*/
3651 currSCCB = pCurrCard->currentSCCB; in FPT_ssenss()
3653 currSCCB->Save_CdbLen = currSCCB->CdbLength; in FPT_ssenss()
3657 currSCCB->Save_Cdb[i] = currSCCB->Cdb[i]; in FPT_ssenss()
3660 currSCCB->CdbLength = SIX_BYTE_CMD; in FPT_ssenss()
3661 currSCCB->Cdb[0] = REQUEST_SENSE; in FPT_ssenss()
3662 currSCCB->Cdb[1] = currSCCB->Cdb[1] & (unsigned char)0xE0; /*Keep LUN. */ in FPT_ssenss()
3663 currSCCB->Cdb[2] = 0x00; in FPT_ssenss()
3664 currSCCB->Cdb[3] = 0x00; in FPT_ssenss()
3665 currSCCB->Cdb[4] = currSCCB->RequestSenseLength; in FPT_ssenss()
3666 currSCCB->Cdb[5] = 0x00; in FPT_ssenss()
3668 currSCCB->Sccb_XferCnt = (u32)currSCCB->RequestSenseLength; in FPT_ssenss()
3670 currSCCB->Sccb_ATC = 0x00; in FPT_ssenss()
3672 currSCCB->Sccb_XferState |= F_AUTO_SENSE; in FPT_ssenss()
3674 currSCCB->Sccb_XferState &= ~F_SG_XFER; in FPT_ssenss()
3676 currSCCB->Sccb_idmsg = currSCCB->Sccb_idmsg & ~(unsigned char)DISC_PRIV; in FPT_ssenss()
3678 currSCCB->ControlByte = 0x00; in FPT_ssenss()
3680 currSCCB->Sccb_MGRFlags &= F_STATUSLOADED; in FPT_ssenss()
3683 /*---------------------------------------------------------------------
3690 *---------------------------------------------------------------------*/
3765 /*---------------------------------------------------------------------
3772 *---------------------------------------------------------------------*/
3783 if ((currSCCB->Sccb_scsistat != DATA_OUT_ST) && in FPT_schkdd()
3784 (currSCCB->Sccb_scsistat != DATA_IN_ST)) { in FPT_schkdd()
3788 if (currSCCB->Sccb_XferState & F_ODD_BALL_CNT) { in FPT_schkdd()
3790 currSCCB->Sccb_ATC += (currSCCB->Sccb_XferCnt - 1); in FPT_schkdd()
3792 currSCCB->Sccb_XferCnt = 1; in FPT_schkdd()
3794 currSCCB->Sccb_XferState &= ~F_ODD_BALL_CNT; in FPT_schkdd()
3801 currSCCB->Sccb_ATC += currSCCB->Sccb_XferCnt; in FPT_schkdd()
3803 currSCCB->Sccb_XferCnt = 0; in FPT_schkdd()
3807 (currSCCB->HostStatus == SCCB_COMPLETE)) { in FPT_schkdd()
3809 currSCCB->HostStatus = SCCB_PARITY_ERR; in FPT_schkdd()
3843 if (!(currSCCB->Sccb_XferState & F_ALL_XFERRED)) { in FPT_schkdd()
3844 if (currSCCB->Sccb_XferState & F_HOST_XFER_DIR) { in FPT_schkdd()
3867 /*---------------------------------------------------------------------
3873 *---------------------------------------------------------------------*/
3879 if ((p_sccb->TargID >= MAX_SCSI_TAR) || (p_sccb->Lun >= MAX_LUN)) { in FPT_sinits()
3882 currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID]; in FPT_sinits()
3884 p_sccb->Sccb_XferState = 0x00; in FPT_sinits()
3885 p_sccb->Sccb_XferCnt = p_sccb->DataLength; in FPT_sinits()
3887 if ((p_sccb->OperationCode == SCATTER_GATHER_COMMAND) || in FPT_sinits()
3888 (p_sccb->OperationCode == RESIDUAL_SG_COMMAND)) { in FPT_sinits()
3890 p_sccb->Sccb_SGoffset = 0; in FPT_sinits()
3891 p_sccb->Sccb_XferState = F_SG_XFER; in FPT_sinits()
3892 p_sccb->Sccb_XferCnt = 0x00; in FPT_sinits()
3895 if (p_sccb->DataLength == 0x00) in FPT_sinits()
3897 p_sccb->Sccb_XferState |= F_ALL_XFERRED; in FPT_sinits()
3899 if (p_sccb->ControlByte & F_USE_CMD_Q) { in FPT_sinits()
3900 if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_REJECT) in FPT_sinits()
3901 p_sccb->ControlByte &= ~F_USE_CMD_Q; in FPT_sinits()
3904 currTar_Info->TarStatus |= TAG_Q_TRYING; in FPT_sinits()
3913 (currTar_Info->TarStatus & TAR_ALLOW_DISC)) || in FPT_sinits()
3914 (currTar_Info->TarStatus & TAG_Q_TRYING)) { in FPT_sinits()
3916 if ((currTar_Info->TarStatus & TAR_ALLOW_DISC) || in FPT_sinits()
3917 (currTar_Info->TarStatus & TAG_Q_TRYING)) { in FPT_sinits()
3918 p_sccb->Sccb_idmsg = IDENTIFY(true, p_sccb->Lun); in FPT_sinits()
3920 p_sccb->Sccb_idmsg = IDENTIFY(false, p_sccb->Lun); in FPT_sinits()
3923 p_sccb->HostStatus = 0x00; in FPT_sinits()
3924 p_sccb->TargetStatus = 0x00; in FPT_sinits()
3925 p_sccb->Sccb_tag = 0x00; in FPT_sinits()
3926 p_sccb->Sccb_MGRFlags = 0x00; in FPT_sinits()
3927 p_sccb->Sccb_sgseg = 0x00; in FPT_sinits()
3928 p_sccb->Sccb_ATC = 0x00; in FPT_sinits()
3929 p_sccb->Sccb_savedATC = 0x00; in FPT_sinits()
3931 p_sccb->SccbVirtDataPtr = 0x00; in FPT_sinits()
3932 p_sccb->Sccb_forwardlink = NULL; in FPT_sinits()
3933 p_sccb->Sccb_backlink = NULL; in FPT_sinits()
3935 p_sccb->Sccb_scsistat = BUS_FREE_ST; in FPT_sinits()
3936 p_sccb->SccbStatus = SCCB_IN_PROCESS; in FPT_sinits()
3937 p_sccb->Sccb_scsimsg = NOP; in FPT_sinits()
3941 /*---------------------------------------------------------------------
3947 *---------------------------------------------------------------------*/
3964 /*---------------------------------------------------------------------
3970 *---------------------------------------------------------------------*/
3982 currSCCB->Sccb_scsistat = DATA_OUT_ST; in FPT_phaseDataOut()
3983 currSCCB->Sccb_XferState &= ~(F_HOST_XFER_DIR | F_NO_DATA_YET); in FPT_phaseDataOut()
3993 if (currSCCB->Sccb_XferCnt == 0) { in FPT_phaseDataOut()
3995 if ((currSCCB->ControlByte & SCCB_DATA_XFER_OUT) && in FPT_phaseDataOut()
3996 (currSCCB->HostStatus == SCCB_COMPLETE)) in FPT_phaseDataOut()
3997 currSCCB->HostStatus = SCCB_DATA_OVER_RUN; in FPT_phaseDataOut()
4005 /*---------------------------------------------------------------------
4011 *---------------------------------------------------------------------*/
4024 currSCCB->Sccb_scsistat = DATA_IN_ST; in FPT_phaseDataIn()
4025 currSCCB->Sccb_XferState |= F_HOST_XFER_DIR; in FPT_phaseDataIn()
4026 currSCCB->Sccb_XferState &= ~F_NO_DATA_YET; in FPT_phaseDataIn()
4036 if (currSCCB->Sccb_XferCnt == 0) { in FPT_phaseDataIn()
4038 if ((currSCCB->ControlByte & SCCB_DATA_XFER_IN) && in FPT_phaseDataIn()
4039 (currSCCB->HostStatus == SCCB_COMPLETE)) in FPT_phaseDataIn()
4040 currSCCB->HostStatus = SCCB_DATA_OVER_RUN; in FPT_phaseDataIn()
4049 /*---------------------------------------------------------------------
4055 *---------------------------------------------------------------------*/
4065 if (currSCCB->OperationCode == RESET_COMMAND) { in FPT_phaseCommand()
4067 currSCCB->HostStatus = SCCB_PHASE_SEQUENCE_FAIL; in FPT_phaseCommand()
4068 currSCCB->CdbLength = SIX_BYTE_CMD; in FPT_phaseCommand()
4077 for (i = 0; i < currSCCB->CdbLength; i++) { in FPT_phaseCommand()
4079 if (currSCCB->OperationCode == RESET_COMMAND) in FPT_phaseCommand()
4085 (MPM_OP + ACOMMAND + currSCCB->Cdb[i])); in FPT_phaseCommand()
4089 if (currSCCB->CdbLength != TWELVE_BYTE_CMD) in FPT_phaseCommand()
4094 currSCCB->Sccb_scsistat = COMMAND_ST; in FPT_phaseCommand()
4100 /*---------------------------------------------------------------------
4106 *---------------------------------------------------------------------*/
4110 /* Start-up the automation to finish off this command and let the in FPT_phaseStatus()
4120 /*---------------------------------------------------------------------
4127 *---------------------------------------------------------------------*/
4139 message = currSCCB->Sccb_scsimsg; in FPT_phaseMsgOut()
4140 scsiID = currSCCB->TargID; in FPT_phaseMsgOut()
4145 currTar_Info->TarSyncCtrl = 0; in FPT_phaseMsgOut()
4165 } else if (currSCCB->Sccb_scsistat == ABORT_ST) { in FPT_phaseMsgOut()
4166 currSCCB->HostStatus = SCCB_COMPLETE; in FPT_phaseMsgOut()
4167 if (FPT_BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] != in FPT_phaseMsgOut()
4169 FPT_BL_Card[p_card].discQ_Tbl[currSCCB-> in FPT_phaseMsgOut()
4171 FPT_sccbMgrTbl[p_card][scsiID].TarTagQ_Cnt--; in FPT_phaseMsgOut()
4176 else if (currSCCB->Sccb_scsistat < COMMAND_ST) { in FPT_phaseMsgOut()
4179 currSCCB->Sccb_MGRFlags |= F_DEV_SELECTED; in FPT_phaseMsgOut()
4221 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseMsgOut()
4224 FPT_sccbMgrTbl[p_card][currSCCB-> in FPT_phaseMsgOut()
4226 TarLUNBusy[currSCCB->Lun] = 0; in FPT_phaseMsgOut()
4228 FPT_sccbMgrTbl[p_card][currSCCB-> in FPT_phaseMsgOut()
4251 currSCCB->Sccb_scsimsg = NOP; in FPT_phaseMsgOut()
4260 /*---------------------------------------------------------------------
4266 *---------------------------------------------------------------------*/
4296 if (currSCCB->Sccb_scsimsg != MSG_PARITY_ERROR) in FPT_phaseMsgIn()
4305 /*---------------------------------------------------------------------
4313 *---------------------------------------------------------------------*/
4324 currSCCB->HostStatus = SCCB_PHASE_SEQUENCE_FAIL; in FPT_phaseIllegal()
4325 currSCCB->Sccb_scsistat = ABORT_ST; in FPT_phaseIllegal()
4326 currSCCB->Sccb_scsimsg = ABORT_TASK_SET; in FPT_phaseIllegal()
4332 /*---------------------------------------------------------------------
4339 *---------------------------------------------------------------------*/
4348 if (currSCCB->Sccb_scsistat == DATA_IN_ST) { in FPT_phaseChkFifo()
4355 currSCCB->Sccb_ATC += currSCCB->Sccb_XferCnt; in FPT_phaseChkFifo()
4357 currSCCB->Sccb_XferCnt = 0; in FPT_phaseChkFifo()
4360 (currSCCB->HostStatus == SCCB_COMPLETE)) { in FPT_phaseChkFifo()
4361 currSCCB->HostStatus = SCCB_PARITY_ERR; in FPT_phaseChkFifo()
4384 currSCCB->Sccb_ATC += (currSCCB->Sccb_XferCnt - xfercnt); in FPT_phaseChkFifo()
4386 currSCCB->Sccb_XferCnt = xfercnt; in FPT_phaseChkFifo()
4389 (currSCCB->HostStatus == SCCB_COMPLETE)) { in FPT_phaseChkFifo()
4391 currSCCB->HostStatus = SCCB_PARITY_ERR; in FPT_phaseChkFifo()
4404 /*---------------------------------------------------------------------
4411 *---------------------------------------------------------------------*/
4422 if (currSCCB->OperationCode == RESET_COMMAND) { in FPT_phaseBusFree()
4425 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4427 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4428 TarLUNBusy[currSCCB->Lun] = 0; in FPT_phaseBusFree()
4430 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4440 else if (currSCCB->Sccb_scsistat == SELECT_SN_ST) { in FPT_phaseBusFree()
4441 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |= in FPT_phaseBusFree()
4443 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= in FPT_phaseBusFree()
4447 else if (currSCCB->Sccb_scsistat == SELECT_WN_ST) { in FPT_phaseBusFree()
4448 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus = in FPT_phaseBusFree()
4449 (FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4452 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= in FPT_phaseBusFree()
4456 else if (currSCCB->Sccb_scsistat == SELECT_Q_ST) { in FPT_phaseBusFree()
4463 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4465 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4476 currSCCB->Sccb_scsistat = BUS_FREE_ST; in FPT_phaseBusFree()
4478 if (!currSCCB->HostStatus) { in FPT_phaseBusFree()
4479 currSCCB->HostStatus = SCCB_PHASE_SEQUENCE_FAIL; in FPT_phaseBusFree()
4483 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4485 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4486 TarLUNBusy[currSCCB->Lun] = 0; in FPT_phaseBusFree()
4488 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4501 /*---------------------------------------------------------------------
4507 *---------------------------------------------------------------------*/
4605 /*---------------------------------------------------------------------
4612 *---------------------------------------------------------------------*/
4623 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUN_CA = 0; in FPT_autoCmdCmplt()
4630 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4632 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4633 TarLUNBusy[currSCCB->Lun] = 1; in FPT_autoCmdCmplt()
4635 FPT_BL_Card[p_card].discQCount--; in FPT_autoCmdCmplt()
4638 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4639 LunDiscQ_Idx[currSCCB->Lun]] = in FPT_autoCmdCmplt()
4642 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4644 if (currSCCB->Sccb_tag) { in FPT_autoCmdCmplt()
4647 discQCount--; in FPT_autoCmdCmplt()
4648 FPT_BL_Card[p_card].discQ_Tbl[currSCCB-> in FPT_autoCmdCmplt()
4654 discQCount--; in FPT_autoCmdCmplt()
4657 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4662 currSCCB->Sccb_MGRFlags |= F_STATUSLOADED; in FPT_autoCmdCmplt()
4669 if (currSCCB->Sccb_scsistat == SELECT_SN_ST) { in FPT_autoCmdCmplt()
4670 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |= in FPT_autoCmdCmplt()
4673 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= in FPT_autoCmdCmplt()
4678 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4680 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4681 TarLUNBusy[currSCCB->Lun] = 1; in FPT_autoCmdCmplt()
4683 FPT_BL_Card[p_card].discQCount--; in FPT_autoCmdCmplt()
4686 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4687 LunDiscQ_Idx[currSCCB->Lun]] = in FPT_autoCmdCmplt()
4690 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4692 if (currSCCB->Sccb_tag) { in FPT_autoCmdCmplt()
4695 discQCount--; in FPT_autoCmdCmplt()
4696 FPT_BL_Card[p_card].discQ_Tbl[currSCCB-> in FPT_autoCmdCmplt()
4702 discQCount--; in FPT_autoCmdCmplt()
4705 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4713 if (currSCCB->Sccb_scsistat == SELECT_WN_ST) { in FPT_autoCmdCmplt()
4715 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus = in FPT_autoCmdCmplt()
4716 (FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4719 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= in FPT_autoCmdCmplt()
4724 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4726 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4727 TarLUNBusy[currSCCB->Lun] = 1; in FPT_autoCmdCmplt()
4729 FPT_BL_Card[p_card].discQCount--; in FPT_autoCmdCmplt()
4732 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4733 LunDiscQ_Idx[currSCCB->Lun]] = in FPT_autoCmdCmplt()
4736 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4738 if (currSCCB->Sccb_tag) { in FPT_autoCmdCmplt()
4741 discQCount--; in FPT_autoCmdCmplt()
4742 FPT_BL_Card[p_card].discQ_Tbl[currSCCB-> in FPT_autoCmdCmplt()
4748 discQCount--; in FPT_autoCmdCmplt()
4751 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4761 if (FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4763 FPT_sccbMgrTbl[p_card][currSCCB-> in FPT_autoCmdCmplt()
4767 if (FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4769 FPT_sccbMgrTbl[p_card][currSCCB-> in FPT_autoCmdCmplt()
4776 if (!(currSCCB->Sccb_XferState & F_AUTO_SENSE)) { in FPT_autoCmdCmplt()
4778 currSCCB->SccbStatus = SCCB_ERROR; in FPT_autoCmdCmplt()
4779 currSCCB->TargetStatus = status_byte; in FPT_autoCmdCmplt()
4783 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4786 if (currSCCB->RequestSenseLength != in FPT_autoCmdCmplt()
4789 if (currSCCB->RequestSenseLength == 0) in FPT_autoCmdCmplt()
4790 currSCCB->RequestSenseLength = in FPT_autoCmdCmplt()
4801 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4805 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4806 TarLUNBusy[currSCCB->Lun] = in FPT_autoCmdCmplt()
4811 discQCount--; in FPT_autoCmdCmplt()
4815 [currSCCB-> in FPT_autoCmdCmplt()
4818 [currSCCB->Lun]] = in FPT_autoCmdCmplt()
4822 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4824 if (currSCCB->Sccb_tag) { in FPT_autoCmdCmplt()
4829 discQCount--; in FPT_autoCmdCmplt()
4831 discQ_Tbl[currSCCB-> in FPT_autoCmdCmplt()
4839 discQCount--; in FPT_autoCmdCmplt()
4843 [p_card][currSCCB-> in FPT_autoCmdCmplt()
4856 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4858 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB-> in FPT_autoCmdCmplt()
4861 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = 0; in FPT_autoCmdCmplt()
4869 /*---------------------------------------------------------------------
4885 *---------------------------------------------------------------------*/
4891 currSCCB = pCurrCard->currentSCCB; in FPT_dataXferProcessor()
4893 if (currSCCB->Sccb_XferState & F_SG_XFER) { in FPT_dataXferProcessor()
4894 if (pCurrCard->globalFlags & F_HOST_XFER_ACT) in FPT_dataXferProcessor()
4896 currSCCB->Sccb_sgseg += (unsigned char)SG_BUF_CNT; in FPT_dataXferProcessor()
4897 currSCCB->Sccb_SGoffset = 0x00; in FPT_dataXferProcessor()
4899 pCurrCard->globalFlags |= F_HOST_XFER_ACT; in FPT_dataXferProcessor()
4905 if (!(pCurrCard->globalFlags & F_HOST_XFER_ACT)) { in FPT_dataXferProcessor()
4906 pCurrCard->globalFlags |= F_HOST_XFER_ACT; in FPT_dataXferProcessor()
4913 /*---------------------------------------------------------------------
4919 *---------------------------------------------------------------------*/
4928 if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) in FPT_busMstrSGDataXferStart()
4935 sg_index = pcurrSCCB->Sccb_sgseg; in FPT_busMstrSGDataXferStart()
4945 pcurrSCCB->DataLength)) { in FPT_busMstrSGDataXferStart()
4947 segp = (struct blogic_sg_seg *)(pcurrSCCB->DataPointer) + in FPT_busMstrSGDataXferStart()
4949 tmpSGCnt += segp->segbytes; in FPT_busMstrSGDataXferStart()
4950 count |= segp->segbytes; in FPT_busMstrSGDataXferStart()
4951 addr = segp->segdata; in FPT_busMstrSGDataXferStart()
4953 if ((!sg_count) && (pcurrSCCB->Sccb_SGoffset)) { in FPT_busMstrSGDataXferStart()
4955 ((count & 0x00FFFFFFL) - pcurrSCCB->Sccb_SGoffset); in FPT_busMstrSGDataXferStart()
4957 (count & 0xFF000000L) | pcurrSCCB->Sccb_SGoffset; in FPT_busMstrSGDataXferStart()
4973 pcurrSCCB->Sccb_XferCnt = tmpSGCnt; in FPT_busMstrSGDataXferStart()
4977 if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) { in FPT_busMstrSGDataXferStart()
4991 pcurrSCCB->Sccb_XferState |= F_ODD_BALL_CNT; in FPT_busMstrSGDataXferStart()
4992 tmpSGCnt--; in FPT_busMstrSGDataXferStart()
5006 /*---------------------------------------------------------------------
5012 *---------------------------------------------------------------------*/
5017 if (!(pcurrSCCB->Sccb_XferState & F_AUTO_SENSE)) { in FPT_busMstrDataXferStart()
5019 count = pcurrSCCB->Sccb_XferCnt; in FPT_busMstrDataXferStart()
5021 addr = (u32)(unsigned long)pcurrSCCB->DataPointer + pcurrSCCB->Sccb_ATC; in FPT_busMstrDataXferStart()
5025 addr = pcurrSCCB->SensePointer; in FPT_busMstrDataXferStart()
5026 count = pcurrSCCB->RequestSenseLength; in FPT_busMstrDataXferStart()
5032 if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) { in FPT_busMstrDataXferStart()
5054 /*---------------------------------------------------------------------
5065 *---------------------------------------------------------------------*/
5075 && timeout--) { in FPT_busMstrTimeOut()
5083 && timeout--) { in FPT_busMstrTimeOut()
5098 /*---------------------------------------------------------------------
5104 *---------------------------------------------------------------------*/
5116 if (pCurrSCCB->Sccb_XferState & F_AUTO_SENSE) { in FPT_hostDataXferAbort()
5126 && timeout--) { in FPT_hostDataXferAbort()
5137 if (pCurrSCCB->HostStatus == 0x00) in FPT_hostDataXferAbort()
5139 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5150 if (pCurrSCCB->HostStatus == in FPT_hostDataXferAbort()
5153 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5160 else if (pCurrSCCB->Sccb_XferCnt) { in FPT_hostDataXferAbort()
5162 if (pCurrSCCB->Sccb_XferState & F_SG_XFER) { in FPT_hostDataXferAbort()
5170 sg_ptr = pCurrSCCB->Sccb_sgseg + SG_BUF_CNT; in FPT_hostDataXferAbort()
5173 (unsigned int)(pCurrSCCB->DataLength / in FPT_hostDataXferAbort()
5176 sg_ptr = (u32)(pCurrSCCB->DataLength / in FPT_hostDataXferAbort()
5180 remain_cnt = pCurrSCCB->Sccb_XferCnt; in FPT_hostDataXferAbort()
5184 sg_ptr--; in FPT_hostDataXferAbort()
5185 segp = (struct blogic_sg_seg *)(pCurrSCCB-> in FPT_hostDataXferAbort()
5187 if (remain_cnt > (unsigned long)segp->segbytes) in FPT_hostDataXferAbort()
5188 remain_cnt -= in FPT_hostDataXferAbort()
5189 (unsigned long)segp->segbytes; in FPT_hostDataXferAbort()
5196 pCurrSCCB->Sccb_SGoffset = remain_cnt; in FPT_hostDataXferAbort()
5198 pCurrSCCB->Sccb_sgseg = (unsigned short)sg_ptr; in FPT_hostDataXferAbort()
5201 pCurrSCCB->DataLength && (remain_cnt == 0)) in FPT_hostDataXferAbort()
5203 pCurrSCCB->Sccb_XferState |= in FPT_hostDataXferAbort()
5209 if (pCurrSCCB->HostStatus == 0x00) { in FPT_hostDataXferAbort()
5211 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5217 if (!(pCurrSCCB->Sccb_XferState & F_HOST_XFER_DIR)) { in FPT_hostDataXferAbort()
5232 if (pCurrSCCB->HostStatus == in FPT_hostDataXferAbort()
5235 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5253 BM_THRESHOLD) && timeout--) { in FPT_hostDataXferAbort()
5266 BM_CMD_BUSY) && timeout--) { in FPT_hostDataXferAbort()
5276 if (pCurrSCCB->HostStatus == 0x00) { in FPT_hostDataXferAbort()
5278 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5291 if (pCurrSCCB->HostStatus == 0x00) { in FPT_hostDataXferAbort()
5293 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5309 && timeout--) { in FPT_hostDataXferAbort()
5314 if (pCurrSCCB->HostStatus == 0x00) { in FPT_hostDataXferAbort()
5316 pCurrSCCB->HostStatus = SCCB_BM_ERR; in FPT_hostDataXferAbort()
5327 if (pCurrSCCB->HostStatus == 0x00) { in FPT_hostDataXferAbort()
5329 pCurrSCCB->HostStatus = SCCB_BM_ERR; in FPT_hostDataXferAbort()
5335 if (pCurrSCCB->Sccb_XferState & F_SG_XFER) { in FPT_hostDataXferAbort()
5343 pCurrSCCB->Sccb_sgseg += SG_BUF_CNT; in FPT_hostDataXferAbort()
5345 pCurrSCCB->Sccb_SGoffset = 0x00; in FPT_hostDataXferAbort()
5347 if ((u32)(pCurrSCCB->Sccb_sgseg * SG_ELEMENT_SIZE) >= in FPT_hostDataXferAbort()
5348 pCurrSCCB->DataLength) { in FPT_hostDataXferAbort()
5350 pCurrSCCB->Sccb_XferState |= F_ALL_XFERRED; in FPT_hostDataXferAbort()
5351 pCurrSCCB->Sccb_sgseg = in FPT_hostDataXferAbort()
5352 (unsigned short)(pCurrSCCB->DataLength / in FPT_hostDataXferAbort()
5358 if (!(pCurrSCCB->Sccb_XferState & F_AUTO_SENSE)) in FPT_hostDataXferAbort()
5359 pCurrSCCB->Sccb_XferState |= F_ALL_XFERRED; in FPT_hostDataXferAbort()
5366 /*---------------------------------------------------------------------
5373 *---------------------------------------------------------------------*/
5380 if (currSCCB->Sccb_XferState & F_SG_XFER) { in FPT_hostDataXferRestart()
5382 currSCCB->Sccb_XferCnt = 0; in FPT_hostDataXferRestart()
5388 while (data_count < currSCCB->Sccb_ATC) { in FPT_hostDataXferRestart()
5391 segp = (struct blogic_sg_seg *)(currSCCB->DataPointer) + in FPT_hostDataXferRestart()
5393 data_count += segp->segbytes; in FPT_hostDataXferRestart()
5396 if (data_count == currSCCB->Sccb_ATC) { in FPT_hostDataXferRestart()
5398 currSCCB->Sccb_SGoffset = 0; in FPT_hostDataXferRestart()
5403 currSCCB->Sccb_SGoffset = in FPT_hostDataXferRestart()
5404 data_count - currSCCB->Sccb_ATC; in FPT_hostDataXferRestart()
5407 currSCCB->Sccb_sgseg = (unsigned short)sg_index; in FPT_hostDataXferRestart()
5411 currSCCB->Sccb_XferCnt = in FPT_hostDataXferRestart()
5412 currSCCB->DataLength - currSCCB->Sccb_ATC; in FPT_hostDataXferRestart()
5416 /*---------------------------------------------------------------------
5422 *---------------------------------------------------------------------*/
5436 p_port = currCard->ioPort; in FPT_scini()
5437 pCurrNvRam = currCard->pNvRamInfo; in FPT_scini()
5440 ScamFlg = pCurrNvRam->niScamConf; in FPT_scini()
5441 i = pCurrNvRam->niSysConf; in FPT_scini()
5526 currCard-> in FPT_scini()
5565 currCard->ourId = in FPT_scini()
5577 FPT_scamInfo[currCard-> in FPT_scini()
5580 FPT_scamInfo[currCard-> in FPT_scini()
5605 if (currCard->globalFlags & F_UPDATE_EEPROM) { in FPT_scini()
5607 currCard->globalFlags &= ~F_UPDATE_EEPROM; in FPT_scini()
5620 currCard->globalFlags |= F_SINGLE_DEVICE; in FPT_scini()
5622 currCard->globalFlags &= ~F_SINGLE_DEVICE; in FPT_scini()
5626 /*---------------------------------------------------------------------
5632 *---------------------------------------------------------------------*/
5688 /*---------------------------------------------------------------------
5694 *---------------------------------------------------------------------*/
5720 /*---------------------------------------------------------------------
5726 *---------------------------------------------------------------------*/
5779 scam_id += 0x08; /*Count number of zeros in DB0-3. */ in FPT_scasid()
5797 /*---------------------------------------------------------------------
5803 *---------------------------------------------------------------------*/
5831 /*---------------------------------------------------------------------
5835 * Description: Handshake the p_data (DB4-0) across the bus.
5837 *---------------------------------------------------------------------*/
5880 /*---------------------------------------------------------------------
5887 *---------------------------------------------------------------------*/
5932 /*---------------------------------------------------------------------
5938 *---------------------------------------------------------------------*/
5989 /*---------------------------------------------------------------------
5996 *---------------------------------------------------------------------*/
6016 /*---------------------------------------------------------------------
6023 *---------------------------------------------------------------------*/
6043 /*---------------------------------------------------------------------
6049 *---------------------------------------------------------------------*/
6057 p_quintet -= 0x80; in FPT_scvalq()
6067 /*---------------------------------------------------------------------
6075 *---------------------------------------------------------------------*/
6151 /*---------------------------------------------------------------------
6157 *---------------------------------------------------------------------*/
6165 /*---------------------------------------------------------------------
6171 *---------------------------------------------------------------------*/
6192 pCurrNvRam->niScamTbl[i][k]; in FPT_inisci()
6234 /*---------------------------------------------------------------------
6241 *---------------------------------------------------------------------*/
6277 i--; in FPT_scmachid()
6294 match--; in FPT_scmachid()
6300 match = MAX_SCSI_TAR - 1; in FPT_scmachid()
6321 i--; in FPT_scmachid()
6338 match--; in FPT_scmachid()
6344 match = MAX_SCSI_TAR - 1; in FPT_scmachid()
6351 /*---------------------------------------------------------------------
6357 *---------------------------------------------------------------------*/
6396 /*---------------------------------------------------------------------
6402 *---------------------------------------------------------------------*/
6445 /*---------------------------------------------------------------------
6451 *---------------------------------------------------------------------*/
6471 /*---------------------------------------------------------------------
6478 *---------------------------------------------------------------------*/
6589 temp += 0x5442; /* BT- 930 */ in FPT_DiagEEPROM()
6627 /*---------------------------------------------------------------------
6633 *---------------------------------------------------------------------*/
6642 scan_ptr = pCurrCard->scanIndex; in FPT_queueSearchSelect()
6645 if ((pCurrCard->globalFlags & F_CONLUN_IO) && in FPT_queueSearchSelect()
6646 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != in FPT_queueSearchSelect()
6648 if (currTar_Info->TarSelQ_Cnt != 0) { in FPT_queueSearchSelect()
6655 if (currTar_Info->TarLUNBusy[lun] == 0) { in FPT_queueSearchSelect()
6657 pCurrCard->currentSCCB = in FPT_queueSearchSelect()
6658 currTar_Info->TarSelQ_Head; in FPT_queueSearchSelect()
6661 while ((pCurrCard-> in FPT_queueSearchSelect()
6664 pCurrCard-> in FPT_queueSearchSelect()
6665 currentSCCB->Lun)) { in FPT_queueSearchSelect()
6667 pCurrCard-> in FPT_queueSearchSelect()
6669 pCurrCard->currentSCCB = in FPT_queueSearchSelect()
6671 *)(pCurrCard-> in FPT_queueSearchSelect()
6672 currentSCCB)-> in FPT_queueSearchSelect()
6675 if (pCurrCard->currentSCCB == in FPT_queueSearchSelect()
6679 pOldSccb-> in FPT_queueSearchSelect()
6682 *)(pCurrCard-> in FPT_queueSearchSelect()
6683 currentSCCB)-> in FPT_queueSearchSelect()
6685 pOldSccb-> in FPT_queueSearchSelect()
6688 *)(pCurrCard-> in FPT_queueSearchSelect()
6689 currentSCCB)-> in FPT_queueSearchSelect()
6691 currTar_Info-> in FPT_queueSearchSelect()
6692 TarSelQ_Cnt--; in FPT_queueSearchSelect()
6694 currTar_Info-> in FPT_queueSearchSelect()
6697 *)(pCurrCard-> in FPT_queueSearchSelect()
6698 currentSCCB)-> in FPT_queueSearchSelect()
6701 if (currTar_Info-> in FPT_queueSearchSelect()
6704 currTar_Info-> in FPT_queueSearchSelect()
6707 currTar_Info-> in FPT_queueSearchSelect()
6711 currTar_Info-> in FPT_queueSearchSelect()
6712 TarSelQ_Cnt--; in FPT_queueSearchSelect()
6713 currTar_Info-> in FPT_queueSearchSelect()
6714 TarSelQ_Head-> in FPT_queueSearchSelect()
6721 pCurrCard->scanIndex = scan_ptr; in FPT_queueSearchSelect()
6723 pCurrCard->globalFlags |= in FPT_queueSearchSelect()
6739 if ((currTar_Info->TarSelQ_Cnt != 0) && in FPT_queueSearchSelect()
6740 (currTar_Info->TarLUNBusy[0] == 0)) { in FPT_queueSearchSelect()
6742 pCurrCard->currentSCCB = in FPT_queueSearchSelect()
6743 currTar_Info->TarSelQ_Head; in FPT_queueSearchSelect()
6745 currTar_Info->TarSelQ_Head = in FPT_queueSearchSelect()
6746 (struct sccb *)(pCurrCard->currentSCCB)-> in FPT_queueSearchSelect()
6749 if (currTar_Info->TarSelQ_Head == NULL) { in FPT_queueSearchSelect()
6750 currTar_Info->TarSelQ_Tail = NULL; in FPT_queueSearchSelect()
6751 currTar_Info->TarSelQ_Cnt = 0; in FPT_queueSearchSelect()
6753 currTar_Info->TarSelQ_Cnt--; in FPT_queueSearchSelect()
6754 currTar_Info->TarSelQ_Head-> in FPT_queueSearchSelect()
6762 pCurrCard->scanIndex = scan_ptr; in FPT_queueSearchSelect()
6764 pCurrCard->globalFlags |= F_NEW_SCCB_CMD; in FPT_queueSearchSelect()
6776 } while (scan_ptr != pCurrCard->scanIndex); in FPT_queueSearchSelect()
6779 /*---------------------------------------------------------------------
6785 *---------------------------------------------------------------------*/
6793 if (pCurrCard->currentSCCB != NULL) { in FPT_queueSelectFail()
6795 (unsigned char)(((struct sccb *)(pCurrCard->currentSCCB))-> in FPT_queueSelectFail()
6799 pCurrCard->currentSCCB->Sccb_backlink = (struct sccb *)NULL; in FPT_queueSelectFail()
6801 pCurrCard->currentSCCB->Sccb_forwardlink = in FPT_queueSelectFail()
6802 currTar_Info->TarSelQ_Head; in FPT_queueSelectFail()
6804 if (currTar_Info->TarSelQ_Cnt == 0) { in FPT_queueSelectFail()
6805 currTar_Info->TarSelQ_Tail = pCurrCard->currentSCCB; in FPT_queueSelectFail()
6809 currTar_Info->TarSelQ_Head->Sccb_backlink = in FPT_queueSelectFail()
6810 pCurrCard->currentSCCB; in FPT_queueSelectFail()
6813 currTar_Info->TarSelQ_Head = pCurrCard->currentSCCB; in FPT_queueSelectFail()
6815 pCurrCard->currentSCCB = NULL; in FPT_queueSelectFail()
6816 currTar_Info->TarSelQ_Cnt++; in FPT_queueSelectFail()
6820 /*---------------------------------------------------------------------
6826 *---------------------------------------------------------------------*/
6836 SCSIcmd = p_sccb->Cdb[0]; in FPT_queueCmdComplete()
6838 if (!(p_sccb->Sccb_XferState & F_ALL_XFERRED)) { in FPT_queueCmdComplete()
6840 if ((p_sccb-> in FPT_queueCmdComplete()
6842 && (p_sccb->HostStatus == SCCB_COMPLETE) in FPT_queueCmdComplete()
6843 && (p_sccb->TargetStatus != SAM_STAT_CHECK_CONDITION)) in FPT_queueCmdComplete()
6851 (pCurrCard->globalFlags & F_NO_FILTER) in FPT_queueCmdComplete()
6853 p_sccb->HostStatus = SCCB_DATA_UNDER_RUN; in FPT_queueCmdComplete()
6856 if (p_sccb->SccbStatus == SCCB_IN_PROCESS) { in FPT_queueCmdComplete()
6857 if (p_sccb->HostStatus || p_sccb->TargetStatus) in FPT_queueCmdComplete()
6858 p_sccb->SccbStatus = SCCB_ERROR; in FPT_queueCmdComplete()
6860 p_sccb->SccbStatus = SCCB_SUCCESS; in FPT_queueCmdComplete()
6863 if (p_sccb->Sccb_XferState & F_AUTO_SENSE) { in FPT_queueCmdComplete()
6865 p_sccb->CdbLength = p_sccb->Save_CdbLen; in FPT_queueCmdComplete()
6867 p_sccb->Cdb[i] = p_sccb->Save_Cdb[i]; in FPT_queueCmdComplete()
6871 if ((p_sccb->OperationCode == RESIDUAL_SG_COMMAND) || in FPT_queueCmdComplete()
6872 (p_sccb->OperationCode == RESIDUAL_COMMAND)) { in FPT_queueCmdComplete()
6877 pCurrCard->cmdCounter--; in FPT_queueCmdComplete()
6878 if (!pCurrCard->cmdCounter) { in FPT_queueCmdComplete()
6880 if (pCurrCard->globalFlags & F_GREEN_PC) { in FPT_queueCmdComplete()
6881 WR_HARPOON(pCurrCard->ioPort + hp_clkctrl_0, in FPT_queueCmdComplete()
6883 WR_HARPOON(pCurrCard->ioPort + hp_sys_ctrl, STOP_CLK); in FPT_queueCmdComplete()
6886 WR_HARPOON(pCurrCard->ioPort + hp_semaphore, in FPT_queueCmdComplete()
6887 (RD_HARPOON(pCurrCard->ioPort + hp_semaphore) & in FPT_queueCmdComplete()
6892 if (pCurrCard->discQCount != 0) { in FPT_queueCmdComplete()
6893 currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID]; in FPT_queueCmdComplete()
6894 if (((pCurrCard->globalFlags & F_CONLUN_IO) && in FPT_queueCmdComplete()
6895 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != in FPT_queueCmdComplete()
6897 pCurrCard->discQCount--; in FPT_queueCmdComplete()
6898 pCurrCard->discQ_Tbl[currTar_Info-> in FPT_queueCmdComplete()
6899 LunDiscQ_Idx[p_sccb->Lun]] = NULL; in FPT_queueCmdComplete()
6901 if (p_sccb->Sccb_tag) { in FPT_queueCmdComplete()
6902 pCurrCard->discQCount--; in FPT_queueCmdComplete()
6903 pCurrCard->discQ_Tbl[p_sccb->Sccb_tag] = NULL; in FPT_queueCmdComplete()
6905 pCurrCard->discQCount--; in FPT_queueCmdComplete()
6906 pCurrCard->discQ_Tbl[currTar_Info-> in FPT_queueCmdComplete()
6913 callback = (CALL_BK_FN) p_sccb->SccbCallback; in FPT_queueCmdComplete()
6915 pCurrCard->globalFlags |= F_NEW_SCCB_CMD; in FPT_queueCmdComplete()
6916 pCurrCard->currentSCCB = NULL; in FPT_queueCmdComplete()
6919 /*---------------------------------------------------------------------
6925 *---------------------------------------------------------------------*/
6930 currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID]; in FPT_queueDisconnect()
6933 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) { in FPT_queueDisconnect()
6934 FPT_BL_Card[p_card].discQ_Tbl[currTar_Info-> in FPT_queueDisconnect()
6935 LunDiscQ_Idx[p_sccb->Lun]] = in FPT_queueDisconnect()
6938 if (p_sccb->Sccb_tag) { in FPT_queueDisconnect()
6939 FPT_BL_Card[p_card].discQ_Tbl[p_sccb->Sccb_tag] = in FPT_queueDisconnect()
6941 FPT_sccbMgrTbl[p_card][p_sccb->TargID].TarLUNBusy[0] = in FPT_queueDisconnect()
6943 FPT_sccbMgrTbl[p_card][p_sccb->TargID].TarTagQ_Cnt++; in FPT_queueDisconnect()
6945 FPT_BL_Card[p_card].discQ_Tbl[currTar_Info-> in FPT_queueDisconnect()
6952 /*---------------------------------------------------------------------
6958 *---------------------------------------------------------------------*/
6968 thisTarg = (unsigned char)currSCCB->TargID; in FPT_queueFlushSccb()
6974 (FPT_BL_Card[p_card].discQ_Tbl[qtag]->TargID == in FPT_queueFlushSccb()
6977 FPT_BL_Card[p_card].discQ_Tbl[qtag]-> in FPT_queueFlushSccb()
6985 currTar_Info->TarTagQ_Cnt--; in FPT_queueFlushSccb()
6993 /*---------------------------------------------------------------------
6999 *---------------------------------------------------------------------*/
7012 (FPT_BL_Card[p_card].discQ_Tbl[qtag]->TargID == thisTarg)) { in FPT_queueFlushTargSccb()
7014 FPT_BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = in FPT_queueFlushTargSccb()
7022 currTar_Info->TarTagQ_Cnt--; in FPT_queueFlushTargSccb()
7032 currTar_Info = &FPT_sccbMgrTbl[p_card][p_SCCB->TargID]; in FPT_queueAddSccb()
7034 p_SCCB->Sccb_forwardlink = NULL; in FPT_queueAddSccb()
7036 p_SCCB->Sccb_backlink = currTar_Info->TarSelQ_Tail; in FPT_queueAddSccb()
7038 if (currTar_Info->TarSelQ_Cnt == 0) { in FPT_queueAddSccb()
7040 currTar_Info->TarSelQ_Head = p_SCCB; in FPT_queueAddSccb()
7045 currTar_Info->TarSelQ_Tail->Sccb_forwardlink = p_SCCB; in FPT_queueAddSccb()
7048 currTar_Info->TarSelQ_Tail = p_SCCB; in FPT_queueAddSccb()
7049 currTar_Info->TarSelQ_Cnt++; in FPT_queueAddSccb()
7052 /*---------------------------------------------------------------------
7059 *---------------------------------------------------------------------*/
7067 currTar_Info = &FPT_sccbMgrTbl[p_card][p_SCCB->TargID]; in FPT_queueFindSccb()
7069 q_ptr = currTar_Info->TarSelQ_Head; in FPT_queueFindSccb()
7075 if (currTar_Info->TarSelQ_Head == q_ptr) { in FPT_queueFindSccb()
7077 currTar_Info->TarSelQ_Head = in FPT_queueFindSccb()
7078 q_ptr->Sccb_forwardlink; in FPT_queueFindSccb()
7081 if (currTar_Info->TarSelQ_Tail == q_ptr) { in FPT_queueFindSccb()
7083 currTar_Info->TarSelQ_Tail = in FPT_queueFindSccb()
7084 q_ptr->Sccb_backlink; in FPT_queueFindSccb()
7087 if (q_ptr->Sccb_forwardlink != NULL) { in FPT_queueFindSccb()
7088 q_ptr->Sccb_forwardlink->Sccb_backlink = in FPT_queueFindSccb()
7089 q_ptr->Sccb_backlink; in FPT_queueFindSccb()
7092 if (q_ptr->Sccb_backlink != NULL) { in FPT_queueFindSccb()
7093 q_ptr->Sccb_backlink->Sccb_forwardlink = in FPT_queueFindSccb()
7094 q_ptr->Sccb_forwardlink; in FPT_queueFindSccb()
7097 currTar_Info->TarSelQ_Cnt--; in FPT_queueFindSccb()
7103 q_ptr = q_ptr->Sccb_forwardlink; in FPT_queueFindSccb()
7111 /*---------------------------------------------------------------------
7117 * If Non-SG transfer then report Total Cnt - Actual Transfer
7122 *---------------------------------------------------------------------*/
7130 if (p_SCCB->Sccb_XferState & F_ALL_XFERRED) { in FPT_utilUpdateResidual()
7132 p_SCCB->DataLength = 0x0000; in FPT_utilUpdateResidual()
7135 else if (p_SCCB->Sccb_XferState & F_SG_XFER) { in FPT_utilUpdateResidual()
7139 sg_index = p_SCCB->Sccb_sgseg; in FPT_utilUpdateResidual()
7142 if (p_SCCB->Sccb_SGoffset) { in FPT_utilUpdateResidual()
7144 partial_cnt = p_SCCB->Sccb_SGoffset; in FPT_utilUpdateResidual()
7149 (unsigned long)SG_ELEMENT_SIZE) < p_SCCB->DataLength) { in FPT_utilUpdateResidual()
7150 segp = (struct blogic_sg_seg *)(p_SCCB->DataPointer) + in FPT_utilUpdateResidual()
7152 partial_cnt += segp->segbytes; in FPT_utilUpdateResidual()
7156 p_SCCB->DataLength = partial_cnt; in FPT_utilUpdateResidual()
7161 p_SCCB->DataLength -= p_SCCB->Sccb_ATC; in FPT_utilUpdateResidual()
7165 /*---------------------------------------------------------------------
7171 *---------------------------------------------------------------------*/
7189 /*---------------------------------------------------------------------
7195 *---------------------------------------------------------------------*/
7234 /*---------------------------------------------------------------------
7241 *---------------------------------------------------------------------*/
7263 /*---------------------------------------------------------------------
7270 *---------------------------------------------------------------------*/
7314 /*---------------------------------------------------------------------
7321 *---------------------------------------------------------------------*/
7344 /*---------------------------------------------------------------------
7351 *---------------------------------------------------------------------*/
7391 /*---------------------------------------------------------------------
7398 *---------------------------------------------------------------------*/