int tul_abort_srb(HCS * pCurHcb, struct scsi_cmnd *srbp) 
static int tul_abort_srb(HCS * pCurHcb, struct scsi_cmnd *srbp) 
int tul_abort_srb(HCS * pCurHcb, struct scsi_cmnd *srbp){	ULONG flags;	SCB *pTmpScb, *pPrevScb;	spin_lock_irqsave(&(pCurHcb->HCS_SemaphLock), flags);	if ((pCurHcb->HCS_Semaph == 0) && (pCurHcb->HCS_ActScb == NULL)) {		TUL_WR(pCurHcb->HCS_Base + TUL_Mask, 0x1F);		/* disable Jasmin SCSI Int        */                spin_unlock_irqrestore(&(pCurHcb->HCS_SemaphLock), flags);		tulip_main(pCurHcb);        	spin_lock_irqsave(&(pCurHcb->HCS_SemaphLock), flags);		pCurHcb->HCS_Semaph = 1;		TUL_WR(pCurHcb->HCS_Base + TUL_Mask, 0x0F);		spin_unlock_irqrestore(&(pCurHcb->HCS_SemaphLock), flags);		return SCSI_ABORT_SNOOZE;	}	pPrevScb = pTmpScb = pCurHcb->HCS_FirstPend;	/* Check Pend queue */	while (pTmpScb != NULL) {		/* 07/27/98 */		if (pTmpScb->SCB_Srb == srbp) {			if (pTmpScb == pCurHcb->HCS_ActScb) {				spin_unlock_irqrestore(&(pCurHcb->HCS_SemaphLock), flags);				return SCSI_ABORT_BUSY;			} else if (pTmpScb == pCurHcb->HCS_FirstPend) {				if ((pCurHcb->HCS_FirstPend = pTmpScb->SCB_NxtScb) == NULL)					pCurHcb->HCS_LastPend = NULL;			} else {				pPrevScb->SCB_NxtScb = pTmpScb->SCB_NxtScb;				if (pTmpScb == pCurHcb->HCS_LastPend)					pCurHcb->HCS_LastPend = pPrevScb;			}			pTmpScb->SCB_HaStat = HOST_ABORTED;			pTmpScb->SCB_Flags |= SCF_DONE;			if (pTmpScb->SCB_Flags & SCF_POST)				(*pTmpScb->SCB_Post) ((BYTE *) pCurHcb, (BYTE *) pTmpScb);			spin_unlock_irqrestore(&(pCurHcb->HCS_SemaphLock), flags);			return SCSI_ABORT_SUCCESS;		}		pPrevScb = pTmpScb;		pTmpScb = pTmpScb->SCB_NxtScb;	}	pPrevScb = pTmpScb = pCurHcb->HCS_FirstBusy;	/* Check Busy queue */	while (pTmpScb != NULL) {		if (pTmpScb->SCB_Srb == srbp) {			if (pTmpScb == pCurHcb->HCS_ActScb) {				spin_unlock_irqrestore(&(pCurHcb->HCS_SemaphLock), flags);				return SCSI_ABORT_BUSY;			} else if (pTmpScb->SCB_TagMsg == 0) {				spin_unlock_irqrestore(&(pCurHcb->HCS_SemaphLock), flags);				return SCSI_ABORT_BUSY;			} else {				pCurHcb->HCS_ActTags[pTmpScb->SCB_Target]--;				if (pTmpScb == pCurHcb->HCS_FirstBusy) {					if ((pCurHcb->HCS_FirstBusy = pTmpScb->SCB_NxtScb) == NULL)						pCurHcb->HCS_LastBusy = NULL;				} else {					pPrevScb->SCB_NxtScb = pTmpScb->SCB_NxtScb;					if (pTmpScb == pCurHcb->HCS_LastBusy)						pCurHcb->HCS_LastBusy = pPrevScb;				}				pTmpScb->SCB_NxtScb = NULL;				pTmpScb->SCB_HaStat = HOST_ABORTED;				pTmpScb->SCB_Flags |= SCF_DONE;				if (pTmpScb->SCB_Flags & SCF_POST)					(*pTmpScb->SCB_Post) ((BYTE *) pCurHcb, (BYTE *) pTmpScb);				spin_unlock_irqrestore(&(pCurHcb->HCS_SemaphLock), flags);				return SCSI_ABORT_SUCCESS;			}		}		pPrevScb = pTmpScb;		pTmpScb = pTmpScb->SCB_NxtScb;	}	spin_unlock_irqrestore(&(pCurHcb->HCS_SemaphLock), flags);	return (SCSI_ABORT_NOT_RUNNING);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a2ba192c96d12447472e105890a9cd1b97952747/initio.c/clean/drivers/scsi/initio.c