#endif 
int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb)#endif#endif{#if defined(DOS)	USHORT ioport;#else	ULONG ioport;#endif	UCHAR thisCard;	CALL_BK_FN callback;	UCHAR TID;	PSCCB pSaveSCCB;	PSCCBMgr_tar_info currTar_Info;#if (FW_TYPE==_UCB_MGR_)	PSCCB    p_Sccb;	p_Sccb=(PSCCB)p_ucb->UCB_MgrPrivatePtr;#endif	ioport = ((PSCCBcard) pCurrCard)->ioPort;	thisCard = ((PSCCBcard)pCurrCard)->cardIndex;	mOS_Lock((PSCCBcard)pCurrCard);	if (RD_HARPOON(ioport+hp_page_ctrl) & G_INT_DISABLE)	{		mOS_UnLock((PSCCBcard)pCurrCard);	}	else	{		if (queueFindSccb(p_Sccb,thisCard))		{			mOS_UnLock((PSCCBcard)pCurrCard);			((PSCCBcard)pCurrCard)->cmdCounter--;			if (!((PSCCBcard)pCurrCard)->cmdCounter)				WR_HARPOON(ioport+hp_semaphore,(RD_HARPOON(ioport+hp_semaphore)					& (UCHAR)(~(SCCB_MGR_ACTIVE | TICKLE_ME)) ));#if (FW_TYPE==_SCCB_MGR_)			p_Sccb->SccbStatus = SCCB_ABORT;			callback = p_Sccb->SccbCallback;			callback(p_Sccb);#else			p_ucb->UCB_status=SCCB_ABORT;			callback = (CALL_BK_FN)p_ucb->UCB_callback;			callback(p_ucb);#endif			return(0);		}		else		{			mOS_UnLock((PSCCBcard)pCurrCard);			if (((PSCCBcard)pCurrCard)->currentSCCB == p_Sccb)			{				p_Sccb->SccbStatus = SCCB_ABORT;				return(0);			}			else			{				TID = p_Sccb->TargID;				if(p_Sccb->Sccb_tag)				{					MDISABLE_INT(ioport);					if (((PSCCBcard) pCurrCard)->discQ_Tbl[p_Sccb->Sccb_tag]==p_Sccb)					{						p_Sccb->SccbStatus = SCCB_ABORT;						p_Sccb->Sccb_scsistat = ABORT_ST;#if (FW_TYPE==_UCB_MGR_)						p_ucb->UCB_status=SCCB_ABORT;#endif						p_Sccb->Sccb_scsimsg = SMABORT_TAG;						if(((PSCCBcard) pCurrCard)->currentSCCB == NULL)						{							((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;							ssel(ioport, thisCard);						}						else						{							pSaveSCCB = ((PSCCBcard) pCurrCard)->currentSCCB;							((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;							queueSelectFail((PSCCBcard) pCurrCard, thisCard);							((PSCCBcard) pCurrCard)->currentSCCB = pSaveSCCB;						}					}					MENABLE_INT(ioport);					return(0);				}				else				{					currTar_Info = &sccbMgrTbl[thisCard][p_Sccb->TargID];					if(BL_Card[thisCard].discQ_Tbl[currTar_Info->LunDiscQ_Idx[p_Sccb->Lun]] 							== p_Sccb)					{						p_Sccb->SccbStatus = SCCB_ABORT;						return(0);					}				}			}		}	}	return(-1);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/47b5d69c4aa753fcfc9b2b8d28c0660a1e25c129/FlashPoint.c/buggy/drivers/scsi/FlashPoint.c