Lines Matching +full:db0 +full:- +full:db7

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), */
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()
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()
2653 message = FPT_sfm(port, pCurrCard->currentSCCB); in FPT_sres()
2659 if ((currTar_Info-> in FPT_sres()
2662 if (currTar_Info->TarTagQ_Cnt != in FPT_sres()
2666 (currTar_Info-> in FPT_sres()
2673 pCurrCard-> in FPT_sres()
2689 pCurrCard-> in FPT_sres()
2763 if (((pCurrCard->globalFlags & F_CONLUN_IO) && in FPT_sres()
2764 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) { in FPT_sres()
2765 currTar_Info->TarLUNBusy[lun] = 1; in FPT_sres()
2766 pCurrCard->currentSCCB = in FPT_sres()
2767 pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[lun]]; in FPT_sres()
2768 if (pCurrCard->currentSCCB != NULL) { in FPT_sres()
2774 currTar_Info->TarLUNBusy[0] = 1; in FPT_sres()
2777 if (pCurrCard->discQ_Tbl[tag] != NULL) { in FPT_sres()
2778 pCurrCard->currentSCCB = in FPT_sres()
2779 pCurrCard->discQ_Tbl[tag]; in FPT_sres()
2780 currTar_Info->TarTagQ_Cnt--; in FPT_sres()
2786 pCurrCard->currentSCCB = in FPT_sres()
2787 pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[0]]; in FPT_sres()
2788 if (pCurrCard->currentSCCB != NULL) { in FPT_sres()
2796 if (pCurrCard->currentSCCB != NULL) { in FPT_sres()
2797 if (pCurrCard->currentSCCB->Sccb_scsistat == ABORT_ST) { in FPT_sres()
2798 /* During Abort Tag command, the target could have got re-selected in FPT_sres()
2801 FPT_queueFindSccb(pCurrCard->currentSCCB, p_card); in FPT_sres()
2849 /*---------------------------------------------------------------------
2856 *---------------------------------------------------------------------*/
2864 currSCCB = CurrCard->currentSCCB; in FPT_sdecm()
2866 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID]; in FPT_sdecm()
2869 if (!(currSCCB->Sccb_XferState & F_NO_DATA_YET)) { in FPT_sdecm()
2870 currSCCB->Sccb_ATC = currSCCB->Sccb_savedATC; in FPT_sdecm()
2882 if (currSCCB->Sccb_scsistat == SELECT_Q_ST) { in FPT_sdecm()
2883 currTar_Info->TarStatus &= in FPT_sdecm()
2885 currTar_Info->TarStatus |= (unsigned char)TAG_Q_REJECT; in FPT_sdecm()
2903 if ((currSCCB->Sccb_scsistat == SELECT_SN_ST) || in FPT_sdecm()
2904 (currSCCB->Sccb_scsistat == SELECT_WN_ST) || in FPT_sdecm()
2905 ((currTar_Info->TarStatus & TAR_SYNC_MASK) == SYNC_TRYING) in FPT_sdecm()
2906 || ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == in FPT_sdecm()
2918 if (currSCCB->Lun == 0x00) { in FPT_sdecm()
2919 if (currSCCB->Sccb_scsistat == SELECT_SN_ST) { in FPT_sdecm()
2921 currTar_Info->TarStatus |= in FPT_sdecm()
2924 currTar_Info->TarEEValue &= in FPT_sdecm()
2928 else if (currSCCB->Sccb_scsistat == in FPT_sdecm()
2931 currTar_Info->TarStatus = in FPT_sdecm()
2932 (currTar_Info-> in FPT_sdecm()
2936 currTar_Info->TarEEValue &= in FPT_sdecm()
2941 else if ((currTar_Info-> in FPT_sdecm()
2944 currTar_Info->TarStatus = in FPT_sdecm()
2945 (currTar_Info-> in FPT_sdecm()
2949 currSCCB->ControlByte &= ~F_USE_CMD_Q; in FPT_sdecm()
2950 CurrCard->discQCount--; in FPT_sdecm()
2951 CurrCard->discQ_Tbl[currSCCB-> in FPT_sdecm()
2953 currSCCB->Sccb_tag = 0x00; in FPT_sdecm()
2960 if (currSCCB->Lun == 0x00) { in FPT_sdecm()
2963 CurrCard->globalFlags |= F_NEW_SCCB_CMD; in FPT_sdecm()
2969 if ((CurrCard->globalFlags & F_CONLUN_IO) && in FPT_sdecm()
2970 ((currTar_Info-> in FPT_sdecm()
2973 currTar_Info->TarLUNBusy[currSCCB-> in FPT_sdecm()
2976 currTar_Info->TarLUNBusy[0] = 1; in FPT_sdecm()
2978 currSCCB->ControlByte &= in FPT_sdecm()
3014 if (currSCCB->Sccb_scsimsg != MSG_PARITY_ERROR) in FPT_sdecm()
3022 currSCCB->HostStatus = SCCB_PHASE_SEQUENCE_FAIL; in FPT_sdecm()
3023 currSCCB->Sccb_scsimsg = MESSAGE_REJECT; in FPT_sdecm()
3031 /*---------------------------------------------------------------------
3037 *---------------------------------------------------------------------*/
3057 pCurrSCCB->Sccb_scsimsg = MESSAGE_REJECT; in FPT_shandem()
3068 pCurrSCCB->Sccb_scsimsg = MESSAGE_REJECT; in FPT_shandem()
3077 pCurrSCCB->Sccb_scsimsg = MESSAGE_REJECT; in FPT_shandem()
3084 if (pCurrSCCB->Sccb_scsimsg != MSG_PARITY_ERROR) in FPT_shandem()
3090 if (pCurrSCCB->Sccb_scsimsg == MSG_PARITY_ERROR) in FPT_shandem()
3096 /*---------------------------------------------------------------------
3103 *---------------------------------------------------------------------*/
3112 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID]; in FPT_sisyncn()
3114 if (!((currTar_Info->TarStatus & TAR_SYNC_MASK) == SYNC_TRYING)) { in FPT_sisyncn()
3118 (currSCCB-> in FPT_sisyncn()
3129 if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == EE_SYNC_20MB) in FPT_sisyncn()
3134 else if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == in FPT_sisyncn()
3140 else if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == in FPT_sisyncn()
3158 currTar_Info->TarStatus = in FPT_sisyncn()
3159 ((currTar_Info-> in FPT_sisyncn()
3172 currTar_Info->TarStatus |= (unsigned char)SYNC_SUPPORTED; in FPT_sisyncn()
3173 currTar_Info->TarEEValue &= ~EE_SYNC_MASK; in FPT_sisyncn()
3178 /*---------------------------------------------------------------------
3185 *---------------------------------------------------------------------*/
3193 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID]; in FPT_stsyncn()
3197 if ((sync_msg == 0x00) && (currSCCB->Sccb_scsimsg == MSG_PARITY_ERROR)) { in FPT_stsyncn()
3207 if ((offset == 0x00) && (currSCCB->Sccb_scsimsg == MSG_PARITY_ERROR)) { in FPT_stsyncn()
3213 if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == EE_SYNC_20MB) in FPT_stsyncn()
3217 else if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == EE_SYNC_10MB) in FPT_stsyncn()
3221 else if ((currTar_Info->TarEEValue & EE_SYNC_MASK) == EE_SYNC_5MB) in FPT_stsyncn()
3274 if (currTar_Info->TarStatus & WIDE_ENABLED) in FPT_stsyncn()
3282 FPT_sssyncv(port, currSCCB->TargID, sync_reg, currTar_Info); in FPT_stsyncn()
3284 if (currSCCB->Sccb_scsistat == SELECT_SN_ST) { in FPT_stsyncn()
3288 currTar_Info->TarStatus = ((currTar_Info->TarStatus & in FPT_stsyncn()
3302 currTar_Info->TarStatus = ((currTar_Info->TarStatus & in FPT_stsyncn()
3308 /*---------------------------------------------------------------------
3314 *---------------------------------------------------------------------*/
3339 /*---------------------------------------------------------------------
3346 *---------------------------------------------------------------------*/
3354 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID]; in FPT_siwidn()
3356 if (!((currTar_Info->TarStatus & TAR_WIDE_MASK) == WIDE_NEGOCIATED)) { in FPT_siwidn()
3360 (currSCCB-> in FPT_siwidn()
3377 currTar_Info->TarStatus = ((currTar_Info->TarStatus & in FPT_siwidn()
3386 currTar_Info->TarStatus = ((currTar_Info->TarStatus & in FPT_siwidn()
3390 currTar_Info->TarEEValue &= ~EE_WIDE_SCSI; in FPT_siwidn()
3395 /*---------------------------------------------------------------------
3402 *---------------------------------------------------------------------*/
3410 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID]; in FPT_stwidn()
3414 if ((width == 0x00) && (currSCCB->Sccb_scsimsg == MSG_PARITY_ERROR)) { in FPT_stwidn()
3420 if (!(currTar_Info->TarEEValue & EE_WIDE_SCSI)) in FPT_stwidn()
3424 currTar_Info->TarStatus |= WIDE_ENABLED; in FPT_stwidn()
3428 currTar_Info->TarStatus &= ~WIDE_ENABLED; in FPT_stwidn()
3431 FPT_sssyncv(port, currSCCB->TargID, width, currTar_Info); in FPT_stwidn()
3433 if (currSCCB->Sccb_scsistat == SELECT_WN_ST) { in FPT_stwidn()
3435 currTar_Info->TarStatus |= WIDE_NEGOCIATED; in FPT_stwidn()
3438 ((currTar_Info->TarStatus & TAR_SYNC_MASK) == in FPT_stwidn()
3443 currSCCB->Sccb_scsistat = SELECT_SN_ST; in FPT_stwidn()
3456 if (currTar_Info->TarEEValue & EE_WIDE_SCSI) in FPT_stwidn()
3463 currTar_Info->TarStatus |= (WIDE_NEGOCIATED | WIDE_ENABLED); in FPT_stwidn()
3467 /*---------------------------------------------------------------------
3473 *---------------------------------------------------------------------*/
3496 /*---------------------------------------------------------------------
3503 *---------------------------------------------------------------------*/
3566 currTar_Info->TarSyncCtrl = p_sync_value; in FPT_sssyncv()
3569 /*---------------------------------------------------------------------
3575 *---------------------------------------------------------------------*/
3610 if (currTar_Info->TarEEValue & EE_SYNC_MASK) { in FPT_sresb()
3611 currTar_Info->TarSyncCtrl = 0; in FPT_sresb()
3612 currTar_Info->TarStatus &= ~TAR_SYNC_MASK; in FPT_sresb()
3615 if (currTar_Info->TarEEValue & EE_WIDE_SCSI) { in FPT_sresb()
3616 currTar_Info->TarStatus &= ~TAR_WIDE_MASK; in FPT_sresb()
3640 /*---------------------------------------------------------------------
3646 *---------------------------------------------------------------------*/
3652 currSCCB = pCurrCard->currentSCCB; in FPT_ssenss()
3654 currSCCB->Save_CdbLen = currSCCB->CdbLength; in FPT_ssenss()
3658 currSCCB->Save_Cdb[i] = currSCCB->Cdb[i]; in FPT_ssenss()
3661 currSCCB->CdbLength = SIX_BYTE_CMD; in FPT_ssenss()
3662 currSCCB->Cdb[0] = REQUEST_SENSE; in FPT_ssenss()
3663 currSCCB->Cdb[1] = currSCCB->Cdb[1] & (unsigned char)0xE0; /*Keep LUN. */ in FPT_ssenss()
3664 currSCCB->Cdb[2] = 0x00; in FPT_ssenss()
3665 currSCCB->Cdb[3] = 0x00; in FPT_ssenss()
3666 currSCCB->Cdb[4] = currSCCB->RequestSenseLength; in FPT_ssenss()
3667 currSCCB->Cdb[5] = 0x00; in FPT_ssenss()
3669 currSCCB->Sccb_XferCnt = (u32)currSCCB->RequestSenseLength; in FPT_ssenss()
3671 currSCCB->Sccb_ATC = 0x00; in FPT_ssenss()
3673 currSCCB->Sccb_XferState |= F_AUTO_SENSE; in FPT_ssenss()
3675 currSCCB->Sccb_XferState &= ~F_SG_XFER; in FPT_ssenss()
3677 currSCCB->Sccb_idmsg = currSCCB->Sccb_idmsg & ~(unsigned char)DISC_PRIV; in FPT_ssenss()
3679 currSCCB->ControlByte = 0x00; in FPT_ssenss()
3681 currSCCB->Sccb_MGRFlags &= F_STATUSLOADED; in FPT_ssenss()
3684 /*---------------------------------------------------------------------
3691 *---------------------------------------------------------------------*/
3766 /*---------------------------------------------------------------------
3773 *---------------------------------------------------------------------*/
3784 if ((currSCCB->Sccb_scsistat != DATA_OUT_ST) && in FPT_schkdd()
3785 (currSCCB->Sccb_scsistat != DATA_IN_ST)) { in FPT_schkdd()
3789 if (currSCCB->Sccb_XferState & F_ODD_BALL_CNT) { in FPT_schkdd()
3791 currSCCB->Sccb_ATC += (currSCCB->Sccb_XferCnt - 1); in FPT_schkdd()
3793 currSCCB->Sccb_XferCnt = 1; in FPT_schkdd()
3795 currSCCB->Sccb_XferState &= ~F_ODD_BALL_CNT; in FPT_schkdd()
3802 currSCCB->Sccb_ATC += currSCCB->Sccb_XferCnt; in FPT_schkdd()
3804 currSCCB->Sccb_XferCnt = 0; in FPT_schkdd()
3808 (currSCCB->HostStatus == SCCB_COMPLETE)) { in FPT_schkdd()
3810 currSCCB->HostStatus = SCCB_PARITY_ERR; in FPT_schkdd()
3844 if (!(currSCCB->Sccb_XferState & F_ALL_XFERRED)) { in FPT_schkdd()
3845 if (currSCCB->Sccb_XferState & F_HOST_XFER_DIR) { in FPT_schkdd()
3868 /*---------------------------------------------------------------------
3874 *---------------------------------------------------------------------*/
3880 if ((p_sccb->TargID >= MAX_SCSI_TAR) || (p_sccb->Lun >= MAX_LUN)) { in FPT_sinits()
3883 currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID]; in FPT_sinits()
3885 p_sccb->Sccb_XferState = 0x00; in FPT_sinits()
3886 p_sccb->Sccb_XferCnt = p_sccb->DataLength; in FPT_sinits()
3888 if ((p_sccb->OperationCode == SCATTER_GATHER_COMMAND) || in FPT_sinits()
3889 (p_sccb->OperationCode == RESIDUAL_SG_COMMAND)) { in FPT_sinits()
3891 p_sccb->Sccb_SGoffset = 0; in FPT_sinits()
3892 p_sccb->Sccb_XferState = F_SG_XFER; in FPT_sinits()
3893 p_sccb->Sccb_XferCnt = 0x00; in FPT_sinits()
3896 if (p_sccb->DataLength == 0x00) in FPT_sinits()
3898 p_sccb->Sccb_XferState |= F_ALL_XFERRED; in FPT_sinits()
3900 if (p_sccb->ControlByte & F_USE_CMD_Q) { in FPT_sinits()
3901 if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_REJECT) in FPT_sinits()
3902 p_sccb->ControlByte &= ~F_USE_CMD_Q; in FPT_sinits()
3905 currTar_Info->TarStatus |= TAG_Q_TRYING; in FPT_sinits()
3914 (currTar_Info->TarStatus & TAR_ALLOW_DISC)) || in FPT_sinits()
3915 (currTar_Info->TarStatus & TAG_Q_TRYING)) { in FPT_sinits()
3917 if ((currTar_Info->TarStatus & TAR_ALLOW_DISC) || in FPT_sinits()
3918 (currTar_Info->TarStatus & TAG_Q_TRYING)) { in FPT_sinits()
3919 p_sccb->Sccb_idmsg = IDENTIFY(true, p_sccb->Lun); in FPT_sinits()
3921 p_sccb->Sccb_idmsg = IDENTIFY(false, p_sccb->Lun); in FPT_sinits()
3924 p_sccb->HostStatus = 0x00; in FPT_sinits()
3925 p_sccb->TargetStatus = 0x00; in FPT_sinits()
3926 p_sccb->Sccb_tag = 0x00; in FPT_sinits()
3927 p_sccb->Sccb_MGRFlags = 0x00; in FPT_sinits()
3928 p_sccb->Sccb_sgseg = 0x00; in FPT_sinits()
3929 p_sccb->Sccb_ATC = 0x00; in FPT_sinits()
3930 p_sccb->Sccb_savedATC = 0x00; in FPT_sinits()
3932 p_sccb->SccbVirtDataPtr = 0x00; in FPT_sinits()
3933 p_sccb->Sccb_forwardlink = NULL; in FPT_sinits()
3934 p_sccb->Sccb_backlink = NULL; in FPT_sinits()
3936 p_sccb->Sccb_scsistat = BUS_FREE_ST; in FPT_sinits()
3937 p_sccb->SccbStatus = SCCB_IN_PROCESS; in FPT_sinits()
3938 p_sccb->Sccb_scsimsg = NOP; in FPT_sinits()
3942 /*---------------------------------------------------------------------
3948 *---------------------------------------------------------------------*/
3965 /*---------------------------------------------------------------------
3971 *---------------------------------------------------------------------*/
3983 currSCCB->Sccb_scsistat = DATA_OUT_ST; in FPT_phaseDataOut()
3984 currSCCB->Sccb_XferState &= ~(F_HOST_XFER_DIR | F_NO_DATA_YET); in FPT_phaseDataOut()
3994 if (currSCCB->Sccb_XferCnt == 0) { in FPT_phaseDataOut()
3996 if ((currSCCB->ControlByte & SCCB_DATA_XFER_OUT) && in FPT_phaseDataOut()
3997 (currSCCB->HostStatus == SCCB_COMPLETE)) in FPT_phaseDataOut()
3998 currSCCB->HostStatus = SCCB_DATA_OVER_RUN; in FPT_phaseDataOut()
4006 /*---------------------------------------------------------------------
4012 *---------------------------------------------------------------------*/
4025 currSCCB->Sccb_scsistat = DATA_IN_ST; in FPT_phaseDataIn()
4026 currSCCB->Sccb_XferState |= F_HOST_XFER_DIR; in FPT_phaseDataIn()
4027 currSCCB->Sccb_XferState &= ~F_NO_DATA_YET; in FPT_phaseDataIn()
4037 if (currSCCB->Sccb_XferCnt == 0) { in FPT_phaseDataIn()
4039 if ((currSCCB->ControlByte & SCCB_DATA_XFER_IN) && in FPT_phaseDataIn()
4040 (currSCCB->HostStatus == SCCB_COMPLETE)) in FPT_phaseDataIn()
4041 currSCCB->HostStatus = SCCB_DATA_OVER_RUN; in FPT_phaseDataIn()
4050 /*---------------------------------------------------------------------
4056 *---------------------------------------------------------------------*/
4066 if (currSCCB->OperationCode == RESET_COMMAND) { in FPT_phaseCommand()
4068 currSCCB->HostStatus = SCCB_PHASE_SEQUENCE_FAIL; in FPT_phaseCommand()
4069 currSCCB->CdbLength = SIX_BYTE_CMD; in FPT_phaseCommand()
4078 for (i = 0; i < currSCCB->CdbLength; i++) { in FPT_phaseCommand()
4080 if (currSCCB->OperationCode == RESET_COMMAND) in FPT_phaseCommand()
4086 (MPM_OP + ACOMMAND + currSCCB->Cdb[i])); in FPT_phaseCommand()
4090 if (currSCCB->CdbLength != TWELVE_BYTE_CMD) in FPT_phaseCommand()
4095 currSCCB->Sccb_scsistat = COMMAND_ST; in FPT_phaseCommand()
4101 /*---------------------------------------------------------------------
4107 *---------------------------------------------------------------------*/
4111 /* Start-up the automation to finish off this command and let the in FPT_phaseStatus()
4121 /*---------------------------------------------------------------------
4128 *---------------------------------------------------------------------*/
4140 message = currSCCB->Sccb_scsimsg; in FPT_phaseMsgOut()
4141 scsiID = currSCCB->TargID; in FPT_phaseMsgOut()
4146 currTar_Info->TarSyncCtrl = 0; in FPT_phaseMsgOut()
4166 } else if (currSCCB->Sccb_scsistat == ABORT_ST) { in FPT_phaseMsgOut()
4167 currSCCB->HostStatus = SCCB_COMPLETE; in FPT_phaseMsgOut()
4168 if (FPT_BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] != in FPT_phaseMsgOut()
4170 FPT_BL_Card[p_card].discQ_Tbl[currSCCB-> in FPT_phaseMsgOut()
4172 FPT_sccbMgrTbl[p_card][scsiID].TarTagQ_Cnt--; in FPT_phaseMsgOut()
4177 else if (currSCCB->Sccb_scsistat < COMMAND_ST) { in FPT_phaseMsgOut()
4180 currSCCB->Sccb_MGRFlags |= F_DEV_SELECTED; in FPT_phaseMsgOut()
4222 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseMsgOut()
4225 FPT_sccbMgrTbl[p_card][currSCCB-> in FPT_phaseMsgOut()
4227 TarLUNBusy[currSCCB->Lun] = 0; in FPT_phaseMsgOut()
4229 FPT_sccbMgrTbl[p_card][currSCCB-> in FPT_phaseMsgOut()
4252 currSCCB->Sccb_scsimsg = NOP; in FPT_phaseMsgOut()
4261 /*---------------------------------------------------------------------
4267 *---------------------------------------------------------------------*/
4297 if (currSCCB->Sccb_scsimsg != MSG_PARITY_ERROR) in FPT_phaseMsgIn()
4306 /*---------------------------------------------------------------------
4314 *---------------------------------------------------------------------*/
4325 currSCCB->HostStatus = SCCB_PHASE_SEQUENCE_FAIL; in FPT_phaseIllegal()
4326 currSCCB->Sccb_scsistat = ABORT_ST; in FPT_phaseIllegal()
4327 currSCCB->Sccb_scsimsg = ABORT_TASK_SET; in FPT_phaseIllegal()
4333 /*---------------------------------------------------------------------
4340 *---------------------------------------------------------------------*/
4349 if (currSCCB->Sccb_scsistat == DATA_IN_ST) { in FPT_phaseChkFifo()
4356 currSCCB->Sccb_ATC += currSCCB->Sccb_XferCnt; in FPT_phaseChkFifo()
4358 currSCCB->Sccb_XferCnt = 0; in FPT_phaseChkFifo()
4361 (currSCCB->HostStatus == SCCB_COMPLETE)) { in FPT_phaseChkFifo()
4362 currSCCB->HostStatus = SCCB_PARITY_ERR; in FPT_phaseChkFifo()
4385 currSCCB->Sccb_ATC += (currSCCB->Sccb_XferCnt - xfercnt); in FPT_phaseChkFifo()
4387 currSCCB->Sccb_XferCnt = xfercnt; in FPT_phaseChkFifo()
4390 (currSCCB->HostStatus == SCCB_COMPLETE)) { in FPT_phaseChkFifo()
4392 currSCCB->HostStatus = SCCB_PARITY_ERR; in FPT_phaseChkFifo()
4405 /*---------------------------------------------------------------------
4412 *---------------------------------------------------------------------*/
4423 if (currSCCB->OperationCode == RESET_COMMAND) { in FPT_phaseBusFree()
4426 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4428 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4429 TarLUNBusy[currSCCB->Lun] = 0; in FPT_phaseBusFree()
4431 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4441 else if (currSCCB->Sccb_scsistat == SELECT_SN_ST) { in FPT_phaseBusFree()
4442 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |= in FPT_phaseBusFree()
4444 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= in FPT_phaseBusFree()
4448 else if (currSCCB->Sccb_scsistat == SELECT_WN_ST) { in FPT_phaseBusFree()
4449 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus = in FPT_phaseBusFree()
4450 (FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4453 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= in FPT_phaseBusFree()
4457 else if (currSCCB->Sccb_scsistat == SELECT_Q_ST) { in FPT_phaseBusFree()
4464 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4466 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4477 currSCCB->Sccb_scsistat = BUS_FREE_ST; in FPT_phaseBusFree()
4479 if (!currSCCB->HostStatus) { in FPT_phaseBusFree()
4480 currSCCB->HostStatus = SCCB_PHASE_SEQUENCE_FAIL; in FPT_phaseBusFree()
4484 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4486 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4487 TarLUNBusy[currSCCB->Lun] = 0; in FPT_phaseBusFree()
4489 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_phaseBusFree()
4502 /*---------------------------------------------------------------------
4508 *---------------------------------------------------------------------*/
4606 /*---------------------------------------------------------------------
4613 *---------------------------------------------------------------------*/
4624 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUN_CA = 0; in FPT_autoCmdCmplt()
4631 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4633 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4634 TarLUNBusy[currSCCB->Lun] = 1; in FPT_autoCmdCmplt()
4636 FPT_BL_Card[p_card].discQCount--; in FPT_autoCmdCmplt()
4639 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4640 LunDiscQ_Idx[currSCCB->Lun]] = in FPT_autoCmdCmplt()
4643 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4645 if (currSCCB->Sccb_tag) { in FPT_autoCmdCmplt()
4648 discQCount--; in FPT_autoCmdCmplt()
4649 FPT_BL_Card[p_card].discQ_Tbl[currSCCB-> in FPT_autoCmdCmplt()
4655 discQCount--; in FPT_autoCmdCmplt()
4658 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4663 currSCCB->Sccb_MGRFlags |= F_STATUSLOADED; in FPT_autoCmdCmplt()
4670 if (currSCCB->Sccb_scsistat == SELECT_SN_ST) { in FPT_autoCmdCmplt()
4671 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |= in FPT_autoCmdCmplt()
4674 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= in FPT_autoCmdCmplt()
4679 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4681 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4682 TarLUNBusy[currSCCB->Lun] = 1; in FPT_autoCmdCmplt()
4684 FPT_BL_Card[p_card].discQCount--; in FPT_autoCmdCmplt()
4687 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4688 LunDiscQ_Idx[currSCCB->Lun]] = in FPT_autoCmdCmplt()
4691 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4693 if (currSCCB->Sccb_tag) { in FPT_autoCmdCmplt()
4696 discQCount--; in FPT_autoCmdCmplt()
4697 FPT_BL_Card[p_card].discQ_Tbl[currSCCB-> in FPT_autoCmdCmplt()
4703 discQCount--; in FPT_autoCmdCmplt()
4706 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4714 if (currSCCB->Sccb_scsistat == SELECT_WN_ST) { in FPT_autoCmdCmplt()
4716 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus = in FPT_autoCmdCmplt()
4717 (FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4720 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= in FPT_autoCmdCmplt()
4725 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4727 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4728 TarLUNBusy[currSCCB->Lun] = 1; in FPT_autoCmdCmplt()
4730 FPT_BL_Card[p_card].discQCount--; in FPT_autoCmdCmplt()
4733 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4734 LunDiscQ_Idx[currSCCB->Lun]] = in FPT_autoCmdCmplt()
4737 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4739 if (currSCCB->Sccb_tag) { in FPT_autoCmdCmplt()
4742 discQCount--; in FPT_autoCmdCmplt()
4743 FPT_BL_Card[p_card].discQ_Tbl[currSCCB-> in FPT_autoCmdCmplt()
4749 discQCount--; in FPT_autoCmdCmplt()
4752 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4762 if (FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4764 FPT_sccbMgrTbl[p_card][currSCCB-> in FPT_autoCmdCmplt()
4768 if (FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4770 FPT_sccbMgrTbl[p_card][currSCCB-> in FPT_autoCmdCmplt()
4777 if (!(currSCCB->Sccb_XferState & F_AUTO_SENSE)) { in FPT_autoCmdCmplt()
4779 currSCCB->SccbStatus = SCCB_ERROR; in FPT_autoCmdCmplt()
4780 currSCCB->TargetStatus = status_byte; in FPT_autoCmdCmplt()
4784 FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4787 if (currSCCB->RequestSenseLength != in FPT_autoCmdCmplt()
4790 if (currSCCB->RequestSenseLength == 0) in FPT_autoCmdCmplt()
4791 currSCCB->RequestSenseLength = in FPT_autoCmdCmplt()
4802 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4806 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4807 TarLUNBusy[currSCCB->Lun] = in FPT_autoCmdCmplt()
4812 discQCount--; in FPT_autoCmdCmplt()
4816 [currSCCB-> in FPT_autoCmdCmplt()
4819 [currSCCB->Lun]] = in FPT_autoCmdCmplt()
4823 [currSCCB->TargID]. in FPT_autoCmdCmplt()
4825 if (currSCCB->Sccb_tag) { in FPT_autoCmdCmplt()
4830 discQCount--; in FPT_autoCmdCmplt()
4832 discQ_Tbl[currSCCB-> in FPT_autoCmdCmplt()
4840 discQCount--; in FPT_autoCmdCmplt()
4844 [p_card][currSCCB-> in FPT_autoCmdCmplt()
4857 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID]. in FPT_autoCmdCmplt()
4859 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB-> in FPT_autoCmdCmplt()
4862 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = 0; in FPT_autoCmdCmplt()
4870 /*---------------------------------------------------------------------
4886 *---------------------------------------------------------------------*/
4892 currSCCB = pCurrCard->currentSCCB; in FPT_dataXferProcessor()
4894 if (currSCCB->Sccb_XferState & F_SG_XFER) { in FPT_dataXferProcessor()
4895 if (pCurrCard->globalFlags & F_HOST_XFER_ACT) in FPT_dataXferProcessor()
4897 currSCCB->Sccb_sgseg += (unsigned char)SG_BUF_CNT; in FPT_dataXferProcessor()
4898 currSCCB->Sccb_SGoffset = 0x00; in FPT_dataXferProcessor()
4900 pCurrCard->globalFlags |= F_HOST_XFER_ACT; in FPT_dataXferProcessor()
4906 if (!(pCurrCard->globalFlags & F_HOST_XFER_ACT)) { in FPT_dataXferProcessor()
4907 pCurrCard->globalFlags |= F_HOST_XFER_ACT; in FPT_dataXferProcessor()
4914 /*---------------------------------------------------------------------
4920 *---------------------------------------------------------------------*/
4929 if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) in FPT_busMstrSGDataXferStart()
4936 sg_index = pcurrSCCB->Sccb_sgseg; in FPT_busMstrSGDataXferStart()
4946 pcurrSCCB->DataLength)) { in FPT_busMstrSGDataXferStart()
4948 segp = (struct blogic_sg_seg *)(pcurrSCCB->DataPointer) + in FPT_busMstrSGDataXferStart()
4950 tmpSGCnt += segp->segbytes; in FPT_busMstrSGDataXferStart()
4951 count |= segp->segbytes; in FPT_busMstrSGDataXferStart()
4952 addr = segp->segdata; in FPT_busMstrSGDataXferStart()
4954 if ((!sg_count) && (pcurrSCCB->Sccb_SGoffset)) { in FPT_busMstrSGDataXferStart()
4956 ((count & 0x00FFFFFFL) - pcurrSCCB->Sccb_SGoffset); in FPT_busMstrSGDataXferStart()
4958 (count & 0xFF000000L) | pcurrSCCB->Sccb_SGoffset; in FPT_busMstrSGDataXferStart()
4974 pcurrSCCB->Sccb_XferCnt = tmpSGCnt; in FPT_busMstrSGDataXferStart()
4978 if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) { in FPT_busMstrSGDataXferStart()
4992 pcurrSCCB->Sccb_XferState |= F_ODD_BALL_CNT; in FPT_busMstrSGDataXferStart()
4993 tmpSGCnt--; in FPT_busMstrSGDataXferStart()
5007 /*---------------------------------------------------------------------
5013 *---------------------------------------------------------------------*/
5018 if (!(pcurrSCCB->Sccb_XferState & F_AUTO_SENSE)) { in FPT_busMstrDataXferStart()
5020 count = pcurrSCCB->Sccb_XferCnt; in FPT_busMstrDataXferStart()
5022 addr = (u32)(unsigned long)pcurrSCCB->DataPointer + pcurrSCCB->Sccb_ATC; in FPT_busMstrDataXferStart()
5026 addr = pcurrSCCB->SensePointer; in FPT_busMstrDataXferStart()
5027 count = pcurrSCCB->RequestSenseLength; in FPT_busMstrDataXferStart()
5033 if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) { in FPT_busMstrDataXferStart()
5055 /*---------------------------------------------------------------------
5066 *---------------------------------------------------------------------*/
5076 && timeout--) { in FPT_busMstrTimeOut()
5084 && timeout--) { in FPT_busMstrTimeOut()
5099 /*---------------------------------------------------------------------
5105 *---------------------------------------------------------------------*/
5117 if (pCurrSCCB->Sccb_XferState & F_AUTO_SENSE) { in FPT_hostDataXferAbort()
5127 && timeout--) { in FPT_hostDataXferAbort()
5138 if (pCurrSCCB->HostStatus == 0x00) in FPT_hostDataXferAbort()
5140 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5151 if (pCurrSCCB->HostStatus == in FPT_hostDataXferAbort()
5154 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5161 else if (pCurrSCCB->Sccb_XferCnt) { in FPT_hostDataXferAbort()
5163 if (pCurrSCCB->Sccb_XferState & F_SG_XFER) { in FPT_hostDataXferAbort()
5171 sg_ptr = pCurrSCCB->Sccb_sgseg + SG_BUF_CNT; in FPT_hostDataXferAbort()
5174 (unsigned int)(pCurrSCCB->DataLength / in FPT_hostDataXferAbort()
5177 sg_ptr = (u32)(pCurrSCCB->DataLength / in FPT_hostDataXferAbort()
5181 remain_cnt = pCurrSCCB->Sccb_XferCnt; in FPT_hostDataXferAbort()
5185 sg_ptr--; in FPT_hostDataXferAbort()
5186 segp = (struct blogic_sg_seg *)(pCurrSCCB-> in FPT_hostDataXferAbort()
5188 if (remain_cnt > (unsigned long)segp->segbytes) in FPT_hostDataXferAbort()
5189 remain_cnt -= in FPT_hostDataXferAbort()
5190 (unsigned long)segp->segbytes; in FPT_hostDataXferAbort()
5197 pCurrSCCB->Sccb_SGoffset = remain_cnt; in FPT_hostDataXferAbort()
5199 pCurrSCCB->Sccb_sgseg = (unsigned short)sg_ptr; in FPT_hostDataXferAbort()
5202 pCurrSCCB->DataLength && (remain_cnt == 0)) in FPT_hostDataXferAbort()
5204 pCurrSCCB->Sccb_XferState |= in FPT_hostDataXferAbort()
5210 if (pCurrSCCB->HostStatus == 0x00) { in FPT_hostDataXferAbort()
5212 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5218 if (!(pCurrSCCB->Sccb_XferState & F_HOST_XFER_DIR)) { in FPT_hostDataXferAbort()
5233 if (pCurrSCCB->HostStatus == in FPT_hostDataXferAbort()
5236 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5254 BM_THRESHOLD) && timeout--) { in FPT_hostDataXferAbort()
5267 BM_CMD_BUSY) && timeout--) { in FPT_hostDataXferAbort()
5277 if (pCurrSCCB->HostStatus == 0x00) { in FPT_hostDataXferAbort()
5279 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5292 if (pCurrSCCB->HostStatus == 0x00) { in FPT_hostDataXferAbort()
5294 pCurrSCCB->HostStatus = in FPT_hostDataXferAbort()
5310 && timeout--) { in FPT_hostDataXferAbort()
5315 if (pCurrSCCB->HostStatus == 0x00) { in FPT_hostDataXferAbort()
5317 pCurrSCCB->HostStatus = SCCB_BM_ERR; in FPT_hostDataXferAbort()
5328 if (pCurrSCCB->HostStatus == 0x00) { in FPT_hostDataXferAbort()
5330 pCurrSCCB->HostStatus = SCCB_BM_ERR; in FPT_hostDataXferAbort()
5336 if (pCurrSCCB->Sccb_XferState & F_SG_XFER) { in FPT_hostDataXferAbort()
5344 pCurrSCCB->Sccb_sgseg += SG_BUF_CNT; in FPT_hostDataXferAbort()
5346 pCurrSCCB->Sccb_SGoffset = 0x00; in FPT_hostDataXferAbort()
5348 if ((u32)(pCurrSCCB->Sccb_sgseg * SG_ELEMENT_SIZE) >= in FPT_hostDataXferAbort()
5349 pCurrSCCB->DataLength) { in FPT_hostDataXferAbort()
5351 pCurrSCCB->Sccb_XferState |= F_ALL_XFERRED; in FPT_hostDataXferAbort()
5352 pCurrSCCB->Sccb_sgseg = in FPT_hostDataXferAbort()
5353 (unsigned short)(pCurrSCCB->DataLength / in FPT_hostDataXferAbort()
5359 if (!(pCurrSCCB->Sccb_XferState & F_AUTO_SENSE)) in FPT_hostDataXferAbort()
5360 pCurrSCCB->Sccb_XferState |= F_ALL_XFERRED; in FPT_hostDataXferAbort()
5367 /*---------------------------------------------------------------------
5374 *---------------------------------------------------------------------*/
5381 if (currSCCB->Sccb_XferState & F_SG_XFER) { in FPT_hostDataXferRestart()
5383 currSCCB->Sccb_XferCnt = 0; in FPT_hostDataXferRestart()
5389 while (data_count < currSCCB->Sccb_ATC) { in FPT_hostDataXferRestart()
5392 segp = (struct blogic_sg_seg *)(currSCCB->DataPointer) + in FPT_hostDataXferRestart()
5394 data_count += segp->segbytes; in FPT_hostDataXferRestart()
5397 if (data_count == currSCCB->Sccb_ATC) { in FPT_hostDataXferRestart()
5399 currSCCB->Sccb_SGoffset = 0; in FPT_hostDataXferRestart()
5404 currSCCB->Sccb_SGoffset = in FPT_hostDataXferRestart()
5405 data_count - currSCCB->Sccb_ATC; in FPT_hostDataXferRestart()
5408 currSCCB->Sccb_sgseg = (unsigned short)sg_index; in FPT_hostDataXferRestart()
5412 currSCCB->Sccb_XferCnt = in FPT_hostDataXferRestart()
5413 currSCCB->DataLength - currSCCB->Sccb_ATC; in FPT_hostDataXferRestart()
5417 /*---------------------------------------------------------------------
5423 *---------------------------------------------------------------------*/
5437 p_port = currCard->ioPort; in FPT_scini()
5438 pCurrNvRam = currCard->pNvRamInfo; in FPT_scini()
5441 ScamFlg = pCurrNvRam->niScamConf; in FPT_scini()
5442 i = pCurrNvRam->niSysConf; in FPT_scini()
5527 currCard-> in FPT_scini()
5566 currCard->ourId = in FPT_scini()
5578 FPT_scamInfo[currCard-> in FPT_scini()
5581 FPT_scamInfo[currCard-> in FPT_scini()
5606 if (currCard->globalFlags & F_UPDATE_EEPROM) { in FPT_scini()
5608 currCard->globalFlags &= ~F_UPDATE_EEPROM; in FPT_scini()
5621 currCard->globalFlags |= F_SINGLE_DEVICE; in FPT_scini()
5623 currCard->globalFlags &= ~F_SINGLE_DEVICE; in FPT_scini()
5627 /*---------------------------------------------------------------------
5633 *---------------------------------------------------------------------*/
5689 /*---------------------------------------------------------------------
5695 *---------------------------------------------------------------------*/
5721 /*---------------------------------------------------------------------
5727 *---------------------------------------------------------------------*/
5780 scam_id += 0x08; /*Count number of zeros in DB0-3. */ in FPT_scasid()
5798 /*---------------------------------------------------------------------
5804 *---------------------------------------------------------------------*/
5832 /*---------------------------------------------------------------------
5836 * Description: Handshake the p_data (DB4-0) across the bus.
5838 *---------------------------------------------------------------------*/
5844 curr_data = p_data | BIT(7) | BIT(5); /*Start with DB7 & DB5 asserted. */ in FPT_scxferc()
5852 FPT_scwirod(p_port, BIT(7)); /*Wait for DB7 to be released. */ in FPT_scxferc()
5881 /*---------------------------------------------------------------------
5888 *---------------------------------------------------------------------*/
5933 /*---------------------------------------------------------------------
5939 *---------------------------------------------------------------------*/
5990 /*---------------------------------------------------------------------
5997 *---------------------------------------------------------------------*/
6017 /*---------------------------------------------------------------------
6024 *---------------------------------------------------------------------*/
6044 /*---------------------------------------------------------------------
6050 *---------------------------------------------------------------------*/
6058 p_quintet -= 0x80; in FPT_scvalq()
6068 /*---------------------------------------------------------------------
6076 *---------------------------------------------------------------------*/
6152 /*---------------------------------------------------------------------
6158 *---------------------------------------------------------------------*/
6166 /*---------------------------------------------------------------------
6172 *---------------------------------------------------------------------*/
6193 pCurrNvRam->niScamTbl[i][k]; in FPT_inisci()
6235 /*---------------------------------------------------------------------
6242 *---------------------------------------------------------------------*/
6278 i--; in FPT_scmachid()
6295 match--; in FPT_scmachid()
6301 match = MAX_SCSI_TAR - 1; in FPT_scmachid()
6322 i--; in FPT_scmachid()
6339 match--; in FPT_scmachid()
6345 match = MAX_SCSI_TAR - 1; in FPT_scmachid()
6352 /*---------------------------------------------------------------------
6358 *---------------------------------------------------------------------*/
6397 /*---------------------------------------------------------------------
6403 *---------------------------------------------------------------------*/
6446 /*---------------------------------------------------------------------
6452 *---------------------------------------------------------------------*/
6472 /*---------------------------------------------------------------------
6479 *---------------------------------------------------------------------*/
6590 temp += 0x5442; /* BT- 930 */ in FPT_DiagEEPROM()
6628 /*---------------------------------------------------------------------
6634 *---------------------------------------------------------------------*/
6643 scan_ptr = pCurrCard->scanIndex; in FPT_queueSearchSelect()
6646 if ((pCurrCard->globalFlags & F_CONLUN_IO) && in FPT_queueSearchSelect()
6647 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != in FPT_queueSearchSelect()
6649 if (currTar_Info->TarSelQ_Cnt != 0) { in FPT_queueSearchSelect()
6656 if (currTar_Info->TarLUNBusy[lun] == 0) { in FPT_queueSearchSelect()
6658 pCurrCard->currentSCCB = in FPT_queueSearchSelect()
6659 currTar_Info->TarSelQ_Head; in FPT_queueSearchSelect()
6662 while ((pCurrCard-> in FPT_queueSearchSelect()
6665 pCurrCard-> in FPT_queueSearchSelect()
6666 currentSCCB->Lun)) { in FPT_queueSearchSelect()
6668 pCurrCard-> in FPT_queueSearchSelect()
6670 pCurrCard->currentSCCB = in FPT_queueSearchSelect()
6672 *)(pCurrCard-> in FPT_queueSearchSelect()
6673 currentSCCB)-> in FPT_queueSearchSelect()
6676 if (pCurrCard->currentSCCB == in FPT_queueSearchSelect()
6680 pOldSccb-> in FPT_queueSearchSelect()
6683 *)(pCurrCard-> in FPT_queueSearchSelect()
6684 currentSCCB)-> in FPT_queueSearchSelect()
6686 pOldSccb-> in FPT_queueSearchSelect()
6689 *)(pCurrCard-> in FPT_queueSearchSelect()
6690 currentSCCB)-> in FPT_queueSearchSelect()
6692 currTar_Info-> in FPT_queueSearchSelect()
6693 TarSelQ_Cnt--; in FPT_queueSearchSelect()
6695 currTar_Info-> in FPT_queueSearchSelect()
6698 *)(pCurrCard-> in FPT_queueSearchSelect()
6699 currentSCCB)-> in FPT_queueSearchSelect()
6702 if (currTar_Info-> in FPT_queueSearchSelect()
6705 currTar_Info-> in FPT_queueSearchSelect()
6708 currTar_Info-> in FPT_queueSearchSelect()
6712 currTar_Info-> in FPT_queueSearchSelect()
6713 TarSelQ_Cnt--; in FPT_queueSearchSelect()
6714 currTar_Info-> in FPT_queueSearchSelect()
6715 TarSelQ_Head-> in FPT_queueSearchSelect()
6722 pCurrCard->scanIndex = scan_ptr; in FPT_queueSearchSelect()
6724 pCurrCard->globalFlags |= in FPT_queueSearchSelect()
6740 if ((currTar_Info->TarSelQ_Cnt != 0) && in FPT_queueSearchSelect()
6741 (currTar_Info->TarLUNBusy[0] == 0)) { in FPT_queueSearchSelect()
6743 pCurrCard->currentSCCB = in FPT_queueSearchSelect()
6744 currTar_Info->TarSelQ_Head; in FPT_queueSearchSelect()
6746 currTar_Info->TarSelQ_Head = in FPT_queueSearchSelect()
6747 (struct sccb *)(pCurrCard->currentSCCB)-> in FPT_queueSearchSelect()
6750 if (currTar_Info->TarSelQ_Head == NULL) { in FPT_queueSearchSelect()
6751 currTar_Info->TarSelQ_Tail = NULL; in FPT_queueSearchSelect()
6752 currTar_Info->TarSelQ_Cnt = 0; in FPT_queueSearchSelect()
6754 currTar_Info->TarSelQ_Cnt--; in FPT_queueSearchSelect()
6755 currTar_Info->TarSelQ_Head-> in FPT_queueSearchSelect()
6763 pCurrCard->scanIndex = scan_ptr; in FPT_queueSearchSelect()
6765 pCurrCard->globalFlags |= F_NEW_SCCB_CMD; in FPT_queueSearchSelect()
6777 } while (scan_ptr != pCurrCard->scanIndex); in FPT_queueSearchSelect()
6780 /*---------------------------------------------------------------------
6786 *---------------------------------------------------------------------*/
6794 if (pCurrCard->currentSCCB != NULL) { in FPT_queueSelectFail()
6796 (unsigned char)(((struct sccb *)(pCurrCard->currentSCCB))-> in FPT_queueSelectFail()
6800 pCurrCard->currentSCCB->Sccb_backlink = (struct sccb *)NULL; in FPT_queueSelectFail()
6802 pCurrCard->currentSCCB->Sccb_forwardlink = in FPT_queueSelectFail()
6803 currTar_Info->TarSelQ_Head; in FPT_queueSelectFail()
6805 if (currTar_Info->TarSelQ_Cnt == 0) { in FPT_queueSelectFail()
6806 currTar_Info->TarSelQ_Tail = pCurrCard->currentSCCB; in FPT_queueSelectFail()
6810 currTar_Info->TarSelQ_Head->Sccb_backlink = in FPT_queueSelectFail()
6811 pCurrCard->currentSCCB; in FPT_queueSelectFail()
6814 currTar_Info->TarSelQ_Head = pCurrCard->currentSCCB; in FPT_queueSelectFail()
6816 pCurrCard->currentSCCB = NULL; in FPT_queueSelectFail()
6817 currTar_Info->TarSelQ_Cnt++; in FPT_queueSelectFail()
6821 /*---------------------------------------------------------------------
6827 *---------------------------------------------------------------------*/
6837 SCSIcmd = p_sccb->Cdb[0]; in FPT_queueCmdComplete()
6839 if (!(p_sccb->Sccb_XferState & F_ALL_XFERRED)) { in FPT_queueCmdComplete()
6841 if ((p_sccb-> in FPT_queueCmdComplete()
6843 && (p_sccb->HostStatus == SCCB_COMPLETE) in FPT_queueCmdComplete()
6844 && (p_sccb->TargetStatus != SAM_STAT_CHECK_CONDITION)) in FPT_queueCmdComplete()
6852 (pCurrCard->globalFlags & F_NO_FILTER) in FPT_queueCmdComplete()
6854 p_sccb->HostStatus = SCCB_DATA_UNDER_RUN; in FPT_queueCmdComplete()
6857 if (p_sccb->SccbStatus == SCCB_IN_PROCESS) { in FPT_queueCmdComplete()
6858 if (p_sccb->HostStatus || p_sccb->TargetStatus) in FPT_queueCmdComplete()
6859 p_sccb->SccbStatus = SCCB_ERROR; in FPT_queueCmdComplete()
6861 p_sccb->SccbStatus = SCCB_SUCCESS; in FPT_queueCmdComplete()
6864 if (p_sccb->Sccb_XferState & F_AUTO_SENSE) { in FPT_queueCmdComplete()
6866 p_sccb->CdbLength = p_sccb->Save_CdbLen; in FPT_queueCmdComplete()
6868 p_sccb->Cdb[i] = p_sccb->Save_Cdb[i]; in FPT_queueCmdComplete()
6872 if ((p_sccb->OperationCode == RESIDUAL_SG_COMMAND) || in FPT_queueCmdComplete()
6873 (p_sccb->OperationCode == RESIDUAL_COMMAND)) { in FPT_queueCmdComplete()
6878 pCurrCard->cmdCounter--; in FPT_queueCmdComplete()
6879 if (!pCurrCard->cmdCounter) { in FPT_queueCmdComplete()
6881 if (pCurrCard->globalFlags & F_GREEN_PC) { in FPT_queueCmdComplete()
6882 WR_HARPOON(pCurrCard->ioPort + hp_clkctrl_0, in FPT_queueCmdComplete()
6884 WR_HARPOON(pCurrCard->ioPort + hp_sys_ctrl, STOP_CLK); in FPT_queueCmdComplete()
6887 WR_HARPOON(pCurrCard->ioPort + hp_semaphore, in FPT_queueCmdComplete()
6888 (RD_HARPOON(pCurrCard->ioPort + hp_semaphore) & in FPT_queueCmdComplete()
6893 if (pCurrCard->discQCount != 0) { in FPT_queueCmdComplete()
6894 currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID]; in FPT_queueCmdComplete()
6895 if (((pCurrCard->globalFlags & F_CONLUN_IO) && in FPT_queueCmdComplete()
6896 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != in FPT_queueCmdComplete()
6898 pCurrCard->discQCount--; in FPT_queueCmdComplete()
6899 pCurrCard->discQ_Tbl[currTar_Info-> in FPT_queueCmdComplete()
6900 LunDiscQ_Idx[p_sccb->Lun]] = NULL; in FPT_queueCmdComplete()
6902 if (p_sccb->Sccb_tag) { in FPT_queueCmdComplete()
6903 pCurrCard->discQCount--; in FPT_queueCmdComplete()
6904 pCurrCard->discQ_Tbl[p_sccb->Sccb_tag] = NULL; in FPT_queueCmdComplete()
6906 pCurrCard->discQCount--; in FPT_queueCmdComplete()
6907 pCurrCard->discQ_Tbl[currTar_Info-> in FPT_queueCmdComplete()
6914 callback = (CALL_BK_FN) p_sccb->SccbCallback; in FPT_queueCmdComplete()
6916 pCurrCard->globalFlags |= F_NEW_SCCB_CMD; in FPT_queueCmdComplete()
6917 pCurrCard->currentSCCB = NULL; in FPT_queueCmdComplete()
6920 /*---------------------------------------------------------------------
6926 *---------------------------------------------------------------------*/
6931 currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID]; in FPT_queueDisconnect()
6934 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) { in FPT_queueDisconnect()
6935 FPT_BL_Card[p_card].discQ_Tbl[currTar_Info-> in FPT_queueDisconnect()
6936 LunDiscQ_Idx[p_sccb->Lun]] = in FPT_queueDisconnect()
6939 if (p_sccb->Sccb_tag) { in FPT_queueDisconnect()
6940 FPT_BL_Card[p_card].discQ_Tbl[p_sccb->Sccb_tag] = in FPT_queueDisconnect()
6942 FPT_sccbMgrTbl[p_card][p_sccb->TargID].TarLUNBusy[0] = in FPT_queueDisconnect()
6944 FPT_sccbMgrTbl[p_card][p_sccb->TargID].TarTagQ_Cnt++; in FPT_queueDisconnect()
6946 FPT_BL_Card[p_card].discQ_Tbl[currTar_Info-> in FPT_queueDisconnect()
6953 /*---------------------------------------------------------------------
6959 *---------------------------------------------------------------------*/
6969 thisTarg = (unsigned char)currSCCB->TargID; in FPT_queueFlushSccb()
6975 (FPT_BL_Card[p_card].discQ_Tbl[qtag]->TargID == in FPT_queueFlushSccb()
6978 FPT_BL_Card[p_card].discQ_Tbl[qtag]-> in FPT_queueFlushSccb()
6986 currTar_Info->TarTagQ_Cnt--; in FPT_queueFlushSccb()
6994 /*---------------------------------------------------------------------
7000 *---------------------------------------------------------------------*/
7013 (FPT_BL_Card[p_card].discQ_Tbl[qtag]->TargID == thisTarg)) { in FPT_queueFlushTargSccb()
7015 FPT_BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = in FPT_queueFlushTargSccb()
7023 currTar_Info->TarTagQ_Cnt--; in FPT_queueFlushTargSccb()
7033 currTar_Info = &FPT_sccbMgrTbl[p_card][p_SCCB->TargID]; in FPT_queueAddSccb()
7035 p_SCCB->Sccb_forwardlink = NULL; in FPT_queueAddSccb()
7037 p_SCCB->Sccb_backlink = currTar_Info->TarSelQ_Tail; in FPT_queueAddSccb()
7039 if (currTar_Info->TarSelQ_Cnt == 0) { in FPT_queueAddSccb()
7041 currTar_Info->TarSelQ_Head = p_SCCB; in FPT_queueAddSccb()
7046 currTar_Info->TarSelQ_Tail->Sccb_forwardlink = p_SCCB; in FPT_queueAddSccb()
7049 currTar_Info->TarSelQ_Tail = p_SCCB; in FPT_queueAddSccb()
7050 currTar_Info->TarSelQ_Cnt++; in FPT_queueAddSccb()
7053 /*---------------------------------------------------------------------
7060 *---------------------------------------------------------------------*/
7068 currTar_Info = &FPT_sccbMgrTbl[p_card][p_SCCB->TargID]; in FPT_queueFindSccb()
7070 q_ptr = currTar_Info->TarSelQ_Head; in FPT_queueFindSccb()
7076 if (currTar_Info->TarSelQ_Head == q_ptr) { in FPT_queueFindSccb()
7078 currTar_Info->TarSelQ_Head = in FPT_queueFindSccb()
7079 q_ptr->Sccb_forwardlink; in FPT_queueFindSccb()
7082 if (currTar_Info->TarSelQ_Tail == q_ptr) { in FPT_queueFindSccb()
7084 currTar_Info->TarSelQ_Tail = in FPT_queueFindSccb()
7085 q_ptr->Sccb_backlink; in FPT_queueFindSccb()
7088 if (q_ptr->Sccb_forwardlink != NULL) { in FPT_queueFindSccb()
7089 q_ptr->Sccb_forwardlink->Sccb_backlink = in FPT_queueFindSccb()
7090 q_ptr->Sccb_backlink; in FPT_queueFindSccb()
7093 if (q_ptr->Sccb_backlink != NULL) { in FPT_queueFindSccb()
7094 q_ptr->Sccb_backlink->Sccb_forwardlink = in FPT_queueFindSccb()
7095 q_ptr->Sccb_forwardlink; in FPT_queueFindSccb()
7098 currTar_Info->TarSelQ_Cnt--; in FPT_queueFindSccb()
7104 q_ptr = q_ptr->Sccb_forwardlink; in FPT_queueFindSccb()
7112 /*---------------------------------------------------------------------
7118 * If Non-SG transfer then report Total Cnt - Actual Transfer
7123 *---------------------------------------------------------------------*/
7131 if (p_SCCB->Sccb_XferState & F_ALL_XFERRED) { in FPT_utilUpdateResidual()
7133 p_SCCB->DataLength = 0x0000; in FPT_utilUpdateResidual()
7136 else if (p_SCCB->Sccb_XferState & F_SG_XFER) { in FPT_utilUpdateResidual()
7140 sg_index = p_SCCB->Sccb_sgseg; in FPT_utilUpdateResidual()
7143 if (p_SCCB->Sccb_SGoffset) { in FPT_utilUpdateResidual()
7145 partial_cnt = p_SCCB->Sccb_SGoffset; in FPT_utilUpdateResidual()
7150 (unsigned long)SG_ELEMENT_SIZE) < p_SCCB->DataLength) { in FPT_utilUpdateResidual()
7151 segp = (struct blogic_sg_seg *)(p_SCCB->DataPointer) + in FPT_utilUpdateResidual()
7153 partial_cnt += segp->segbytes; in FPT_utilUpdateResidual()
7157 p_SCCB->DataLength = partial_cnt; in FPT_utilUpdateResidual()
7162 p_SCCB->DataLength -= p_SCCB->Sccb_ATC; in FPT_utilUpdateResidual()
7166 /*---------------------------------------------------------------------
7172 *---------------------------------------------------------------------*/
7190 /*---------------------------------------------------------------------
7196 *---------------------------------------------------------------------*/
7235 /*---------------------------------------------------------------------
7242 *---------------------------------------------------------------------*/
7264 /*---------------------------------------------------------------------
7271 *---------------------------------------------------------------------*/
7315 /*---------------------------------------------------------------------
7322 *---------------------------------------------------------------------*/
7345 /*---------------------------------------------------------------------
7352 *---------------------------------------------------------------------*/
7392 /*---------------------------------------------------------------------
7399 *---------------------------------------------------------------------*/