void queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, UCHAR p_card) 
static void FPT_queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, UCHAR p_card) 
void queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, UCHAR p_card){#if (FW_TYPE==_UCB_MGR_)   u08bits SCSIcmd;   CALL_BK_FN callback;   PSCCBMgr_tar_info currTar_Info;   PUCB p_ucb;   p_ucb=p_sccb->Sccb_ucb_ptr;   SCSIcmd = p_sccb->Cdb[0];   if (!(p_sccb->Sccb_XferState & F_ALL_XFERRED))   {      if ((p_ucb->UCB_opcode & OPC_CHK_UNDER_OVER_RUN)                     &&         (p_sccb->HostStatus == SCCB_COMPLETE)                             &&         (p_sccb->TargetStatus != SSCHECK))         if ((SCSIcmd == SCSI_READ)             ||             (SCSIcmd == SCSI_WRITE)            ||             (SCSIcmd == SCSI_READ_EXTENDED)    ||             (SCSIcmd == SCSI_WRITE_EXTENDED)   ||             (SCSIcmd == SCSI_WRITE_AND_VERIFY) ||             (SCSIcmd == SCSI_START_STOP_UNIT)  ||             (pCurrCard->globalFlags & F_NO_FILTER)            )               p_sccb->HostStatus = SCCB_DATA_UNDER_RUN;   }   p_ucb->UCB_status=SCCB_SUCCESS;   if ((p_ucb->UCB_hbastat=p_sccb->HostStatus) || (p_ucb->UCB_scsistat=p_sccb->TargetStatus))   {      p_ucb->UCB_status=SCCB_ERROR;   }   if ((p_sccb->OperationCode == RESIDUAL_SG_COMMAND) ||      (p_sccb->OperationCode == RESIDUAL_COMMAND))   {         utilUpdateResidual(p_sccb);         p_ucb->UCB_datalen=p_sccb->DataLength;   }   pCurrCard->cmdCounter--;   if (!pCurrCard->cmdCounter)   {      if (pCurrCard->globalFlags & F_GREEN_PC)      {         WR_HARPOON(pCurrCard->ioPort+hp_clkctrl_0,(PWR_DWN | CLKCTRL_DEFAULT));         WR_HARPOON(pCurrCard->ioPort+hp_sys_ctrl, STOP_CLK);      }      WR_HARPOON(pCurrCard->ioPort+hp_semaphore,      (RD_HARPOON(pCurrCard->ioPort+hp_semaphore) & ~SCCB_MGR_ACTIVE));   }	if(pCurrCard->discQCount != 0)	{      currTar_Info = &sccbMgrTbl[p_card][p_sccb->TargID];		if(((pCurrCard->globalFlags & F_CONLUN_IO) &&			((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))		{			pCurrCard->discQCount--;			pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[p_sccb->Lun]] = NULL;		}		else		{			if(p_sccb->Sccb_tag)			{				pCurrCard->discQCount--;				pCurrCard->discQ_Tbl[p_sccb->Sccb_tag] = NULL;			}else			{				pCurrCard->discQCount--;				pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[0]] = NULL;			}		}	}   callback = (CALL_BK_FN)p_ucb->UCB_callback;   callback(p_ucb);   pCurrCard->globalFlags |= F_NEW_SCCB_CMD;   pCurrCard->currentSCCB = NULL;}#else   UCHAR i, SCSIcmd;   CALL_BK_FN callback;   PSCCBMgr_tar_info currTar_Info;   SCSIcmd = p_sccb->Cdb[0];   if (!(p_sccb->Sccb_XferState & F_ALL_XFERRED)) {	  if ((p_sccb->ControlByte & (SCCB_DATA_XFER_OUT | SCCB_DATA_XFER_IN)) &&		 (p_sccb->HostStatus == SCCB_COMPLETE)                             &&		 (p_sccb->TargetStatus != SSCHECK))		 if ((SCSIcmd == SCSI_READ)             ||			 (SCSIcmd == SCSI_WRITE)            ||			 (SCSIcmd == SCSI_READ_EXTENDED)    ||			 (SCSIcmd == SCSI_WRITE_EXTENDED)   ||			 (SCSIcmd == SCSI_WRITE_AND_VERIFY) ||			 (SCSIcmd == SCSI_START_STOP_UNIT)  ||			 (pCurrCard->globalFlags & F_NO_FILTER)			)			   p_sccb->HostStatus = SCCB_DATA_UNDER_RUN;	  }	if(p_sccb->SccbStatus == SCCB_IN_PROCESS)	{	   if (p_sccb->HostStatus || p_sccb->TargetStatus)		  p_sccb->SccbStatus = SCCB_ERROR;	   else		  p_sccb->SccbStatus = SCCB_SUCCESS;	}   if (p_sccb->Sccb_XferState & F_AUTO_SENSE) {	  p_sccb->CdbLength = p_sccb->Save_CdbLen;	  for (i=0; i < 6; i++) {		 p_sccb->Cdb[i] = p_sccb->Save_Cdb[i];		 }	  }   if ((p_sccb->OperationCode == RESIDUAL_SG_COMMAND) ||	  (p_sccb->OperationCode == RESIDUAL_COMMAND)) {		 utilUpdateResidual(p_sccb);		 }   pCurrCard->cmdCounter--;   if (!pCurrCard->cmdCounter) {	  if (pCurrCard->globalFlags & F_GREEN_PC) {		 WR_HARPOON(pCurrCard->ioPort+hp_clkctrl_0,(PWR_DWN | CLKCTRL_DEFAULT));		 WR_HARPOON(pCurrCard->ioPort+hp_sys_ctrl, STOP_CLK);		 }	  WR_HARPOON(pCurrCard->ioPort+hp_semaphore,	  (RD_HARPOON(pCurrCard->ioPort+hp_semaphore) & ~SCCB_MGR_ACTIVE));	  }	if(pCurrCard->discQCount != 0)	{      currTar_Info = &sccbMgrTbl[p_card][p_sccb->TargID];		if(((pCurrCard->globalFlags & F_CONLUN_IO) &&			((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))		{			pCurrCard->discQCount--;			pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[p_sccb->Lun]] = NULL;		}		else		{			if(p_sccb->Sccb_tag)			{				pCurrCard->discQCount--;				pCurrCard->discQ_Tbl[p_sccb->Sccb_tag] = NULL;			}else			{				pCurrCard->discQCount--;				pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[0]] = NULL;			}		}	}	callback = (CALL_BK_FN)p_sccb->SccbCallback;   callback(p_sccb);   pCurrCard->globalFlags |= F_NEW_SCCB_CMD;   pCurrCard->currentSCCB = NULL;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/47b5d69c4aa753fcfc9b2b8d28c0660a1e25c129/FlashPoint.c/buggy/drivers/scsi/FlashPoint.c