void queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card) 
static void FPT_queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card) 
void queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card){   UCHAR scan_ptr, lun;   PSCCBMgr_tar_info currTar_Info;	PSCCB pOldSccb;   scan_ptr = pCurrCard->scanIndex;	do 	{		currTar_Info = &sccbMgrTbl[p_card][scan_ptr];		if((pCurrCard->globalFlags & F_CONLUN_IO) && 			((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))		{			if (currTar_Info->TarSelQ_Cnt != 0)			{				scan_ptr++;				if (scan_ptr == MAX_SCSI_TAR)					scan_ptr = 0;								for(lun=0; lun < MAX_LUN; lun++)				{					if(currTar_Info->TarLUNBusy[lun] == FALSE)					{						pCurrCard->currentSCCB = currTar_Info->TarSelQ_Head;						pOldSccb = NULL;						while((pCurrCard->currentSCCB != NULL) &&								 (lun != pCurrCard->currentSCCB->Lun))						{							pOldSccb = pCurrCard->currentSCCB;							pCurrCard->currentSCCB = (PSCCB)(pCurrCard->currentSCCB)->																	Sccb_forwardlink;						}						if(pCurrCard->currentSCCB == NULL)							continue;						if(pOldSccb != NULL)						{							pOldSccb->Sccb_forwardlink = (PSCCB)(pCurrCard->currentSCCB)->																	Sccb_forwardlink;							pOldSccb->Sccb_backlink = (PSCCB)(pCurrCard->currentSCCB)->																	Sccb_backlink;							currTar_Info->TarSelQ_Cnt--;						}						else						{							currTar_Info->TarSelQ_Head = (PSCCB)(pCurrCard->currentSCCB)->Sccb_forwardlink;												if (currTar_Info->TarSelQ_Head == NULL)							{								currTar_Info->TarSelQ_Tail = NULL;								currTar_Info->TarSelQ_Cnt = 0;							}							else							{								currTar_Info->TarSelQ_Cnt--;								currTar_Info->TarSelQ_Head->Sccb_backlink = (PSCCB)NULL;							}						}					pCurrCard->scanIndex = scan_ptr;					pCurrCard->globalFlags |= F_NEW_SCCB_CMD;					break;					}				}			}			else 			{				scan_ptr++;				if (scan_ptr == MAX_SCSI_TAR) {					scan_ptr = 0;				}			}		}		else		{			if ((currTar_Info->TarSelQ_Cnt != 0) &&				(currTar_Info->TarLUNBusy[0] == FALSE))			{				pCurrCard->currentSCCB = currTar_Info->TarSelQ_Head;				currTar_Info->TarSelQ_Head = (PSCCB)(pCurrCard->currentSCCB)->Sccb_forwardlink;				if (currTar_Info->TarSelQ_Head == NULL)				{					currTar_Info->TarSelQ_Tail = NULL;					currTar_Info->TarSelQ_Cnt = 0;				}				else				{					currTar_Info->TarSelQ_Cnt--;					currTar_Info->TarSelQ_Head->Sccb_backlink = (PSCCB)NULL;				}				scan_ptr++;				if (scan_ptr == MAX_SCSI_TAR)					scan_ptr = 0;				pCurrCard->scanIndex = scan_ptr;				pCurrCard->globalFlags |= F_NEW_SCCB_CMD;				break;			}			else 			{				scan_ptr++;				if (scan_ptr == MAX_SCSI_TAR) 				{					scan_ptr = 0;				}			}		}	} while (scan_ptr != pCurrCard->scanIndex);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/47b5d69c4aa753fcfc9b2b8d28c0660a1e25c129/FlashPoint.c/buggy/drivers/scsi/FlashPoint.c