sccbMgrTbl[thisCard][id*2+i].TarStatus |= WIDE_NEGOCIATED; 
FPT_sccbMgrTbl[thisCard][id*2+i].TarStatus |= WIDE_NEGOCIATED; 
ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)#endif{   PSCCBcard CurrCard = NULL;	PNVRamInfo pCurrNvRam;   UCHAR i,j,thisCard, ScamFlg;   USHORT temp,sync_bit_map,id;#if defined(DOS)   USHORT ioport;#else   ULONG ioport;#endif#if defined(DOS)   ioport = (USHORT)pCardInfo->si_baseaddr;#else   ioport = pCardInfo->si_baseaddr;#endif   for(thisCard =0; thisCard <= MAX_CARDS; thisCard++) {      if (thisCard == MAX_CARDS) {	 return(FAILURE);         }      if (BL_Card[thisCard].ioPort == ioport) {         CurrCard = &BL_Card[thisCard];         SccbMgrTableInitCard(CurrCard,thisCard);         break;         }      else if (BL_Card[thisCard].ioPort == 0x00) {         BL_Card[thisCard].ioPort = ioport;         CurrCard = &BL_Card[thisCard];			if(mbCards)				for(i = 0; i < mbCards; i++){					if(CurrCard->ioPort == nvRamInfo[i].niBaseAddr)						CurrCard->pNvRamInfo = &nvRamInfo[i];				}         SccbMgrTableInitCard(CurrCard,thisCard);         CurrCard->cardIndex = thisCard;         CurrCard->cardInfo = pCardInfo;	 break;         }      }	pCurrNvRam = CurrCard->pNvRamInfo;	if(pCurrNvRam){		ScamFlg = pCurrNvRam->niScamConf;	}	else{	   ScamFlg = (UCHAR) utilEERead(ioport, SCAM_CONFIG/2);	}   BusMasterInit(ioport);   XbowInit(ioport, ScamFlg);#if defined (NO_BIOS_OPTION)   if (DiagXbow(ioport)) return(FAILURE);   if (DiagBusMaster(ioport)) return(FAILURE);#endif  /* No BIOS Option */   autoLoadDefaultMap(ioport);   for (i = 0,id = 0x01; i != pCardInfo->si_id; i++,id <<= 1){}   WR_HARPOON(ioport+hp_selfid_0, id);   WR_HARPOON(ioport+hp_selfid_1, 0x00);   WR_HARPOON(ioport+hp_arb_id, pCardInfo->si_id);   CurrCard->ourId = pCardInfo->si_id;   i = (UCHAR) pCardInfo->si_flags;   if (i & SCSI_PARITY_ENA)       WR_HARPOON(ioport+hp_portctrl_1,(HOST_MODE8 | CHK_SCSI_P));   j = (RD_HARPOON(ioport+hp_bm_ctrl) & ~SCSI_TERM_ENA_L);   if (i & LOW_BYTE_TERM)      j |= SCSI_TERM_ENA_L;   WR_HARPOON(ioport+hp_bm_ctrl, j);   j = (RD_HARPOON(ioport+hp_ee_ctrl) & ~SCSI_TERM_ENA_H);   if (i & HIGH_BYTE_TERM)      j |= SCSI_TERM_ENA_H;   WR_HARPOON(ioport+hp_ee_ctrl, j );   if (!(pCardInfo->si_flags & SOFT_RESET)) {      sresb(ioport,thisCard);         scini(thisCard, pCardInfo->si_id, 0);      }   if (pCardInfo->si_flags & POST_ALL_UNDERRRUNS)      CurrCard->globalFlags |= F_NO_FILTER;	if(pCurrNvRam){		if(pCurrNvRam->niSysConf & 0x10)			CurrCard->globalFlags |= F_GREEN_PC;	}	else{	   if (utilEERead(ioport, (SYSTEM_CONFIG/2)) & GREEN_PC_ENA)   	   CurrCard->globalFlags |= F_GREEN_PC;	}	/* Set global flag to indicate Re-Negotiation to be done on all		ckeck condition */	if(pCurrNvRam){		if(pCurrNvRam->niScsiConf & 0x04)			CurrCard->globalFlags |= F_DO_RENEGO;	}	else{	   if (utilEERead(ioport, (SCSI_CONFIG/2)) & RENEGO_ENA)   	   CurrCard->globalFlags |= F_DO_RENEGO;	}	if(pCurrNvRam){		if(pCurrNvRam->niScsiConf & 0x08)			CurrCard->globalFlags |= F_CONLUN_IO;	}	else{	   if (utilEERead(ioport, (SCSI_CONFIG/2)) & CONNIO_ENA)   	   CurrCard->globalFlags |= F_CONLUN_IO;	}   temp = pCardInfo->si_per_targ_no_disc;   for (i = 0,id = 1; i < MAX_SCSI_TAR; i++, id <<= 1) {      if (temp & id)	 sccbMgrTbl[thisCard][i].TarStatus |= TAR_ALLOW_DISC;      }   sync_bit_map = 0x0001;   for (id = 0; id < (MAX_SCSI_TAR/2); id++) {		if(pCurrNvRam){			temp = (USHORT) pCurrNvRam->niSyncTbl[id];			temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) +					 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000));		}else	      temp = utilEERead(ioport, (USHORT)((SYNC_RATE_TBL/2)+id));      for (i = 0; i < 2; temp >>=8,i++) {         if (pCardInfo->si_per_targ_init_sync & sync_bit_map) {            sccbMgrTbl[thisCard][id*2+i].TarEEValue = (UCHAR)temp;            }         else {	    sccbMgrTbl[thisCard][id*2+i].TarStatus |= SYNC_SUPPORTED;            sccbMgrTbl[thisCard][id*2+i].TarEEValue =               (UCHAR)(temp & ~EE_SYNC_MASK);            }#if defined(WIDE_SCSI)/*         if ((pCardInfo->si_per_targ_wide_nego & sync_bit_map) ||            (id*2+i >= 8)){*/         if (pCardInfo->si_per_targ_wide_nego & sync_bit_map){            sccbMgrTbl[thisCard][id*2+i].TarEEValue |= EE_WIDE_SCSI;            }         else { /* NARROW SCSI */            sccbMgrTbl[thisCard][id*2+i].TarStatus |= WIDE_NEGOCIATED;            }#else         sccbMgrTbl[thisCard][id*2+i].TarStatus |= WIDE_NEGOCIATED;#endif	 sync_bit_map <<= 1;         }      }   WR_HARPOON((ioport+hp_semaphore),      (UCHAR)(RD_HARPOON((ioport+hp_semaphore)) | SCCB_MGR_PRESENT));#if defined(DOS)   return((USHORT)CurrCard);#else   return((ULONG)CurrCard);#endif}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/47b5d69c4aa753fcfc9b2b8d28c0660a1e25c129/FlashPoint.c/buggy/drivers/scsi/FlashPoint.c