mOS_UnLock((PSCCBcard)pCurrCard); #if defined(DOS) ssel((USHORT)p_Sccb->SccbIOPort,thisCard); #else ssel(p_Sccb->SccbIOPort,thisCard); #endif mOS_Lock((PSCCBcard)pCurrCard); 
FPT_ssel(p_Sccb->SccbIOPort,thisCard); 
void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb)#endif#endif{#if defined(DOS)   USHORT ioport;#else   ULONG ioport;#endif   UCHAR thisCard, lun;	PSCCB pSaveSccb;   CALL_BK_FN callback;#if (FW_TYPE==_UCB_MGR_)   PSCCB p_Sccb;#endif   mOS_Lock((PSCCBcard)pCurrCard);   thisCard = ((PSCCBcard) pCurrCard)->cardIndex;   ioport = ((PSCCBcard) pCurrCard)->ioPort;#if (FW_TYPE==_UCB_MGR_)   p_Sccb = (PSCCB)p_ucb->UCB_MgrPrivatePtr;#endif	if((p_Sccb->TargID > MAX_SCSI_TAR) || (p_Sccb->Lun > MAX_LUN))	{#if (FW_TYPE==_UCB_MGR_)		p_ucb->UCB_hbastat = SCCB_COMPLETE;		p_ucb->UCB_status=SCCB_ERROR;		callback = (CALL_BK_FN)p_ucb->UCB_callback;		if (callback)			callback(p_ucb);#endif#if (FW_TYPE==_SCCB_MGR_)		p_Sccb->HostStatus = SCCB_COMPLETE;		p_Sccb->SccbStatus = SCCB_ERROR;		callback = (CALL_BK_FN)p_Sccb->SccbCallback;		if (callback)			callback(p_Sccb);#endif		mOS_UnLock((PSCCBcard)pCurrCard);		return;	}#if (FW_TYPE==_SCCB_MGR_)   sinits(p_Sccb,thisCard);#endif#if (FW_TYPE==_UCB_MGR_)#ifndef NO_IOCTLS   if (p_ucb->UCB_opcode & OPC_IOCTL)	{		switch (p_ucb->UCB_IOCTLCommand) 		{			case READ_NVRAM:				ReadNVRam((PSCCBcard)pCurrCard,p_ucb);				p_ucb->UCB_status=UCB_SUCCESS;				callback = (CALL_BK_FN)p_ucb->UCB_callback;				if (callback)					callback(p_ucb);				mOS_UnLock((PSCCBcard)pCurrCard);				return;			case WRITE_NVRAM:				WriteNVRam((PSCCBcard)pCurrCard,p_ucb);				p_ucb->UCB_status=UCB_SUCCESS;				callback = (CALL_BK_FN)p_ucb->UCB_callback;				if (callback)					callback(p_ucb);				mOS_UnLock((PSCCBcard)pCurrCard);				return;			case SEND_SCSI_PASSTHRU:#if (FW_TYPE != _SCCB_MGR_)				if( p_ucb->UCB_targid >=				    ((PSCCBcard)pCurrCard)->cardInfo->ai_MaxTarg )				{					p_ucb->UCB_status = UCB_ERROR;					p_ucb->UCB_hbastat = HASTAT_HW_ERROR;					callback = (CALL_BK_FN)p_ucb->UCB_callback;					if (callback)						callback(p_ucb);					mOS_UnLock((PSCCBcard)pCurrCard);					return;				}#endif				break;			case HARD_RESET:				p_ucb->UCB_status = UCB_INVALID;				callback = (CALL_BK_FN)p_ucb->UCB_callback;				if (callback)					callback(p_ucb);				mOS_UnLock((PSCCBcard)pCurrCard);				return;			case GET_DEVICE_SYNCRATE:				if( !GetDevSyncRate((PSCCBcard)pCurrCard,p_ucb) )				{					p_ucb->UCB_status = UCB_SUCCESS;				}				else				{					p_ucb->UCB_status = UCB_ERROR;					p_ucb->UCB_hbastat = HASTAT_HW_ERROR;				}				callback = (CALL_BK_FN)p_ucb->UCB_callback;				if (callback)					callback(p_ucb);				mOS_UnLock((PSCCBcard)pCurrCard);				return;			case SET_DEVICE_SYNCRATE:				if( !SetDevSyncRate((PSCCBcard)pCurrCard,p_ucb) )				{					p_ucb->UCB_status = UCB_SUCCESS;				}				else				{					p_ucb->UCB_status = UCB_ERROR;					p_ucb->UCB_hbastat = HASTAT_HW_ERROR;				}				callback = (CALL_BK_FN)p_ucb->UCB_callback;				if (callback)					callback(p_ucb);				mOS_UnLock((PSCCBcard)pCurrCard);				return;			case GET_WIDE_MODE:				if( !GetDevWideMode((PSCCBcard)pCurrCard,p_ucb) )				{					p_ucb->UCB_status = UCB_SUCCESS;				}				else				{					p_ucb->UCB_status = UCB_ERROR;					p_ucb->UCB_hbastat = HASTAT_HW_ERROR;				}				callback = (CALL_BK_FN)p_ucb->UCB_callback;				if (callback)					callback(p_ucb);				mOS_UnLock((PSCCBcard)pCurrCard);				return;			case SET_WIDE_MODE:				if( !SetDevWideMode((PSCCBcard)pCurrCard,p_ucb) )				{					p_ucb->UCB_status = UCB_SUCCESS;				}				else				{					p_ucb->UCB_status = UCB_ERROR;					p_ucb->UCB_hbastat = HASTAT_HW_ERROR;				}				callback = (CALL_BK_FN)p_ucb->UCB_callback;				if (callback)					callback(p_ucb);				mOS_UnLock((PSCCBcard)pCurrCard);				return;			default:				p_ucb->UCB_status=UCB_INVALID;				callback = (CALL_BK_FN)p_ucb->UCB_callback;				if (callback)					callback(p_ucb);				mOS_UnLock((PSCCBcard)pCurrCard);				return;		}	}#endif /* NO_IOCTLS */#endif /* (FW_TYPE==_UCB_MGR_) */   if (!((PSCCBcard) pCurrCard)->cmdCounter)      {      WR_HARPOON(ioport+hp_semaphore, (RD_HARPOON(ioport+hp_semaphore)         | SCCB_MGR_ACTIVE));      if (((PSCCBcard) pCurrCard)->globalFlags & F_GREEN_PC)         {		 WR_HARPOON(ioport+hp_clkctrl_0, CLKCTRL_DEFAULT);		 WR_HARPOON(ioport+hp_sys_ctrl, 0x00);         }      }   ((PSCCBcard)pCurrCard)->cmdCounter++;   if (RD_HARPOON(ioport+hp_semaphore) & BIOS_IN_USE) {      WR_HARPOON(ioport+hp_semaphore, (RD_HARPOON(ioport+hp_semaphore)         | TICKLE_ME));		if(p_Sccb->OperationCode == RESET_COMMAND)			{				pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB;				((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;				queueSelectFail(&BL_Card[thisCard], thisCard);				((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb;			}		else			{	      queueAddSccb(p_Sccb,thisCard);			}      }   else if ((RD_HARPOON(ioport+hp_page_ctrl) & G_INT_DISABLE)) {			if(p_Sccb->OperationCode == RESET_COMMAND)				{					pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB;					((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;					queueSelectFail(&BL_Card[thisCard], thisCard);					((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb;				}			else				{		      queueAddSccb(p_Sccb,thisCard);				}      }   else {      MDISABLE_INT(ioport);		if((((PSCCBcard) pCurrCard)->globalFlags & F_CONLUN_IO) && 			((sccbMgrTbl[thisCard][p_Sccb->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))			lun = p_Sccb->Lun;		else			lun = 0;      if ((((PSCCBcard) pCurrCard)->currentSCCB == NULL) &&         (sccbMgrTbl[thisCard][p_Sccb->TargID].TarSelQ_Cnt == 0) &&         (sccbMgrTbl[thisCard][p_Sccb->TargID].TarLUNBusy[lun]         == FALSE)) {            ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;			   mOS_UnLock((PSCCBcard)pCurrCard);#if defined(DOS)            ssel((USHORT)p_Sccb->SccbIOPort,thisCard);#else	    ssel(p_Sccb->SccbIOPort,thisCard);#endif			   mOS_Lock((PSCCBcard)pCurrCard);         }      else {			if(p_Sccb->OperationCode == RESET_COMMAND)				{					pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB;					((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;					queueSelectFail(&BL_Card[thisCard], thisCard);					((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb;				}			else				{	         	queueAddSccb(p_Sccb,thisCard);				}         }      MENABLE_INT(ioport);      }   mOS_UnLock((PSCCBcard)pCurrCard);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/47b5d69c4aa753fcfc9b2b8d28c0660a1e25c129/FlashPoint.c/buggy/drivers/scsi/FlashPoint.c