Lines Matching refs:fcChip

52 static void fcParseLinkStatusCounters(TACHYON * fcChip);
53 static void CpqTsGetSFQEntry(TACHYON * fcChip, u16 pi, u32 * buffr, u8 UpdateChip);
58 PTACHYON fcChip = &cpqfcHBAdata->fcChip; in cpqfc_free_dma_consistent() local
60 if (fcChip->Exchanges != NULL) in cpqfc_free_dma_consistent()
61 …pci_free_consistent(cpqfcHBAdata->PciDev, sizeof(FC_EXCHANGES), fcChip->Exchanges, fcChip->exch_dm… in cpqfc_free_dma_consistent()
62 fcChip->Exchanges = NULL; in cpqfc_free_dma_consistent()
76 PTACHYON fcChip = &cpqfcHBAdata->fcChip; in CpqTsCreateTachLiteQues() local
91 fcChip->Exchanges = NULL; in CpqTsCreateTachLiteQues()
95fcChip->Exchanges = pci_alloc_consistent(cpqfcHBAdata->PciDev, sizeof(FC_EXCHANGES), &fcChip->exch… in CpqTsCreateTachLiteQues()
96 printk("@ %p\n", fcChip->Exchanges); in CpqTsCreateTachLiteQues()
98 if (fcChip->Exchanges == NULL) // fatal error!! in CpqTsCreateTachLiteQues()
104 memset(fcChip->Exchanges, 0, sizeof(FC_EXCHANGES)); in CpqTsCreateTachLiteQues()
122 if (!fcChip->Registers.ReMapMemBase) { in CpqTsCreateTachLiteQues()
135fcChip->ERQ = fcMemManager(cpqfcHBAdata->PciDev, &cpqfcHBAdata->dynamic_mem[0], sizeof(TachLiteERQ… in CpqTsCreateTachLiteQues()
136 if (!fcChip->ERQ) { in CpqTsCreateTachLiteQues()
141 fcChip->ERQ->length = ERQ_LEN - 1; in CpqTsCreateTachLiteQues()
150 fcChip->ERQ->base = (u32) ulAddr; // copy for quick reference in CpqTsCreateTachLiteQues()
155fcChip->IMQ = fcMemManager(cpqfcHBAdata->PciDev, &cpqfcHBAdata->dynamic_mem[0], sizeof(TachyonIMQ)… in CpqTsCreateTachLiteQues()
156 if (!fcChip->IMQ) { in CpqTsCreateTachLiteQues()
161 fcChip->IMQ->length = IMQ_LEN - 1; in CpqTsCreateTachLiteQues()
171 fcChip->IMQ->base = (u32) ulAddr; // copy for quick reference in CpqTsCreateTachLiteQues()
175fcChip->SFQ = fcMemManager(cpqfcHBAdata->PciDev, &cpqfcHBAdata->dynamic_mem[0], sizeof(TachLiteSFQ… in CpqTsCreateTachLiteQues()
176 if (!fcChip->SFQ) { in CpqTsCreateTachLiteQues()
181 fcChip->SFQ->length = SFQ_LEN - 1; // i.e. Que length [# entries - in CpqTsCreateTachLiteQues()
192 fcChip->SFQ->base = (u32) ulAddr; // copy for quick reference in CpqTsCreateTachLiteQues()
200fcChip->SEST = fcMemManager(cpqfcHBAdata->PciDev, &cpqfcHBAdata->dynamic_mem[0], sizeof(TachSEST),… in CpqTsCreateTachLiteQues()
202 if (!fcChip->SEST) { in CpqTsCreateTachLiteQues()
209 fcChip->SEST->sgPages[i] = NULL; in CpqTsCreateTachLiteQues()
211 fcChip->SEST->length = TACH_SEST_LEN; // e.g. DON'T subtract one in CpqTsCreateTachLiteQues()
222 fcChip->SEST->base = (u32) ulAddr; // copy for quick reference in CpqTsCreateTachLiteQues()
230 writel(fcChip->ERQ->base, (fcChip->Registers.ReMapMemBase + TL_MEM_ERQ_BASE)); in CpqTsCreateTachLiteQues()
232 writel(fcChip->ERQ->length, (fcChip->Registers.ReMapMemBase + TL_MEM_ERQ_LENGTH)); in CpqTsCreateTachLiteQues()
235 fcChip->ERQ->producerIndex = 0L; in CpqTsCreateTachLiteQues()
236 writel(fcChip->ERQ->producerIndex, (fcChip->Registers.ReMapMemBase + TL_MEM_ERQ_PRODUCER_INDEX)); in CpqTsCreateTachLiteQues()
242 …ulAddr = ((unsigned long) &fcChip->ERQ->consumerIndex - (unsigned long) fcChip->ERQ) + (unsigned l… in CpqTsCreateTachLiteQues()
246 writel((u32) ulAddr, (fcChip->Registers.ReMapMemBase + TL_MEM_ERQ_CONSUMER_INDEX_ADR)); in CpqTsCreateTachLiteQues()
255 printk(" cpqfcTS: writing IMQ BASE %Xh ", fcChip->IMQ->base); in CpqTsCreateTachLiteQues()
256 writel(fcChip->IMQ->base, (fcChip->Registers.ReMapMemBase + IMQ_BASE)); in CpqTsCreateTachLiteQues()
258 writel(fcChip->IMQ->length, (fcChip->Registers.ReMapMemBase + IMQ_LENGTH)); in CpqTsCreateTachLiteQues()
260 writel(fcChip->IMQ->consumerIndex, (fcChip->Registers.ReMapMemBase + IMQ_CONSUMER_INDEX)); in CpqTsCreateTachLiteQues()
266 …ulAddr = ((unsigned long) &fcChip->IMQ->producerIndex - (unsigned long) fcChip->IMQ) + (unsigned l… in CpqTsCreateTachLiteQues()
278 writel((u32) ulAddr, (fcChip->Registers.ReMapMemBase + IMQ_PRODUCER_INDEX)); in CpqTsCreateTachLiteQues()
285 writel(fcChip->SFQ->base, (fcChip->Registers.ReMapMemBase + TL_MEM_SFQ_BASE)); in CpqTsCreateTachLiteQues()
287 writel(fcChip->SFQ->length, (fcChip->Registers.ReMapMemBase + TL_MEM_SFQ_LENGTH)); in CpqTsCreateTachLiteQues()
291 writel(fcChip->SEST->base, (fcChip->Registers.ReMapMemBase + TL_MEM_SEST_BASE)); in CpqTsCreateTachLiteQues()
293 …printk(" cpqfcTS: SEST %p(virt): Wrote base %Xh @ %p\n", fcChip->SEST, fcChip->SEST->base, fcChip in CpqTsCreateTachLiteQues()
295 writel(fcChip->SEST->length, (fcChip->Registers.ReMapMemBase + TL_MEM_SEST_LENGTH)); in CpqTsCreateTachLiteQues()
297 writel((TL_EXT_SG_PAGE_COUNT - 1), (fcChip->Registers.ReMapMemBase + TL_MEM_SEST_SG_PAGE)); in CpqTsCreateTachLiteQues()
314 PTACHYON fcChip = &cpqfcHBAdata->fcChip; in CpqTsResetTachLite() local
325 writeb(0, (fcChip->Registers.ReMapMemBase + IINTEN)); in CpqTsResetTachLite()
332 PFC_LOGGEDIN_PORT pLoggedInPort = fcChip->fcPorts.pNextPort; in CpqTsResetTachLite()
349 writeb(0, (fcChip->Registers.ReMapMemBase + IINTEN)); in CpqTsResetTachLite()
357 fcChip->LaserControl(fcChip->Registers.ReMapMemBase, 0); in CpqTsResetTachLite()
367 writel(0xff000001L, (fcChip->Registers.ReMapMemBase + TL_MEM_SOFTRST)); in CpqTsResetTachLite()
370 ulBuff = readl(fcChip->Registers.ReMapMemBase + TL_MEM_SOFTRST); in CpqTsResetTachLite()
374 writel(0, (fcChip->Registers.ReMapMemBase + TL_MEM_SOFTRST)); in CpqTsResetTachLite()
382 cpqfcTSClearLinkStatusCounters(fcChip); // clear our s/w accumulators in CpqTsResetTachLite()
384 fcChip->Registers.TYstatus.value = readl(fcChip->Registers.TYstatus.address); in CpqTsResetTachLite()
434 PTACHYON fcChip; in CpqTsInitializeFrameManager() local
439 fcChip = (PTACHYON) pChip; in CpqTsInitializeFrameManager()
440 if (!fcChip->Registers.ReMapMemBase) // undefined controller? in CpqTsInitializeFrameManager()
447 fcChip->Registers.ed_tov.value = 0x006507D1; in CpqTsInitializeFrameManager()
448 writel(fcChip->Registers.ed_tov.value, (fcChip->Registers.ed_tov.address)); in CpqTsInitializeFrameManager()
453 writel(0x07d00010, fcChip->Registers.ReMapMemBase + TL_MEM_FM_TIMEOUT2); in CpqTsInitializeFrameManager()
457 iStatus = CpqTsReadWriteWWN(fcChip, 1); // '1' for READ in CpqTsInitializeFrameManager()
465 fcChip->Registers.wwn_hi = (__u32) jiffies; in CpqTsInitializeFrameManager()
466 fcChip->Registers.wwn_hi |= 0x50000000L; in CpqTsInitializeFrameManager()
467 fcChip->Registers.wwn_lo = 0x44556677L; in CpqTsInitializeFrameManager()
471 writel(fcChip->Registers.wwn_hi, fcChip->Registers.ReMapMemBase + TL_MEM_FM_WWN_HI); in CpqTsInitializeFrameManager()
473 writel(fcChip->Registers.wwn_lo, fcChip->Registers.ReMapMemBase + TL_MEM_FM_WWN_LO); in CpqTsInitializeFrameManager()
477 wwnHi = readl(fcChip->Registers.ReMapMemBase + TL_MEM_FM_WWN_HI); in CpqTsInitializeFrameManager()
479 wwnLo = readl(fcChip->Registers.ReMapMemBase + TL_MEM_FM_WWN_LO); in CpqTsInitializeFrameManager()
481 DEBUG_PCI(printk(" WWN %08X%08X\n", fcChip->Registers.wwn_hi, fcChip->Registers.wwn_lo)); in CpqTsInitializeFrameManager()
483 if (wwnHi != fcChip->Registers.wwn_hi || wwnLo != fcChip->Registers.wwn_lo) { in CpqTsInitializeFrameManager()
490 fcChip->Registers.FMcontrol.value = 0x06; in CpqTsInitializeFrameManager()
495 if (fcChip->Options.intLoopback == 1) // internal loopback in CpqTsInitializeFrameManager()
496 fcChip->Registers.FMconfig.value = 0x0f002080L; in CpqTsInitializeFrameManager()
497 else if (fcChip->Options.extLoopback == 1) // internal loopback in CpqTsInitializeFrameManager()
498 fcChip->Registers.FMconfig.value = 0x0f004080L; in CpqTsInitializeFrameManager()
500 fcChip->Registers.FMconfig.value = 0x55000100L; // hard address (55h start) in CpqTsInitializeFrameManager()
506 if (!fcChip->Options.intLoopback && !fcChip->Options.extLoopback) in CpqTsInitializeFrameManager()
508 fcChip->LaserControl(fcChip->Registers.ReMapMemBase, 1); // turn on LASER in CpqTsInitializeFrameManager()
510 writel(fcChip->Registers.FMconfig.value, fcChip->Registers.FMconfig.address); in CpqTsInitializeFrameManager()
514 writel(fcChip->Registers.FMcontrol.value, fcChip->Registers.FMcontrol.address); in CpqTsInitializeFrameManager()
527 static int PeekIMQEntry(PTACHYON fcChip, u32 type) in PeekIMQEntry() argument
529 u32 CI = fcChip->IMQ->consumerIndex; in PeekIMQEntry()
530 u32 PI = fcChip->IMQ->producerIndex; // snapshot of IMQ indexes in PeekIMQEntry()
542 if ((fcChip->IMQ->QEntry[CI].type & 0x1FF) == 0x104) { in PeekIMQEntry()
545 u16 SFQpi = (u16) (fcChip->IMQ->QEntry[CI].word[0] & 0x0fffL); in PeekIMQEntry()
547 CpqTsGetSFQEntry(fcChip, SFQpi, // SFQ producer ndx in PeekIMQEntry()
562 if ((fcChip->IMQ->QEntry[CI].type & 0x1FF) == 0x00) { in PeekIMQEntry()
565 if (fcChip->IMQ->QEntry[CI].word[2] & 0x7a000000L) in PeekIMQEntry()
582 PTACHYON fcChip = &cpqfcHBAdata->fcChip; in SetTachTOV() local
598 if ((fcChip->Registers.ed_tov.value & 0xFFFF) <= 0x1f5) in SetTachTOV()
599 fcChip->Registers.ed_tov.value = 0x006507D1; in SetTachTOV()
603 else if ((fcChip->Registers.ed_tov.value & 0xFFFF) <= 0x7D1) in SetTachTOV()
604 fcChip->Registers.ed_tov.value = 0x00655DC1; in SetTachTOV()
608 else if ((fcChip->Registers.ed_tov.value & 0xFFFF) <= 0x5DC1) in SetTachTOV()
609 fcChip->Registers.ed_tov.value = 0x0065FFFF; in SetTachTOV()
611 writel(fcChip->Registers.ed_tov.value, (fcChip->Registers.ed_tov.address)); in SetTachTOV()
613 writel(0x07D00010, fcChip->Registers.ReMapMemBase + TL_MEM_FM_TIMEOUT2); in SetTachTOV()
642 PTACHYON fcChip = &cpqfcHBAdata->fcChip; in CpqTsProcessIMQEntry() local
643 FC_EXCHANGES *Exchanges = fcChip->Exchanges; in CpqTsProcessIMQEntry()
659 if (fcChip->IMQ->producerIndex != fcChip->IMQ->consumerIndex) { // need to process message in CpqTsProcessIMQEntry()
663 …printk("PI %X, CI %X type: %X\n", fcChip->IMQ->producerIndex, fcChip->IMQ->consumerIndex, fcChip-… in CpqTsProcessIMQEntry()
667 switch ((u8) (fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].type & 0xffL)) { in CpqTsProcessIMQEntry()
684 ulBuff = fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[1]; in CpqTsProcessIMQEntry()
705 ulBuff = fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[2]; in CpqTsProcessIMQEntry()
758 writel(4, fcChip->Registers.FMcontrol.address); in CpqTsProcessIMQEntry()
795 fcChip->Registers.FMLinkStatus1.value = // get TL's counter in CpqTsProcessIMQEntry()
796 readl(fcChip->Registers.FMLinkStatus1.address); in CpqTsProcessIMQEntry()
798 fcChip->Registers.FMLinkStatus2.value = // get TL's counter in CpqTsProcessIMQEntry()
799 readl(fcChip->Registers.FMLinkStatus2.address); in CpqTsProcessIMQEntry()
802 fcParseLinkStatusCounters(fcChip); // load into 6 s/w accumulators in CpqTsProcessIMQEntry()
818 fcChip->SEST->u[x_ID].IWE.Hdr_Len &= 0x7FFFFFFF; in CpqTsProcessIMQEntry()
821 CpqTsUnFreezeTachlite(fcChip, 2); // unfreeze Tachyon, if Link OK in CpqTsProcessIMQEntry()
839 fcChip->SFQ->producerIndex = (u16) in CpqTsProcessIMQEntry()
840 (fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[0] & 0x0fffL); in CpqTsProcessIMQEntry()
848 if (!(fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[2] in CpqTsProcessIMQEntry()
852 (fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[2] & 0x0fL); in CpqTsProcessIMQEntry()
854 fcChip->fcStats.linkFailRX++; in CpqTsProcessIMQEntry()
859 CpqTsGetSFQEntry(fcChip, // i.e. this Device Object in CpqTsProcessIMQEntry()
860 (u16) fcChip->SFQ->producerIndex, // SFQ producer ndx in CpqTsProcessIMQEntry()
935 fcChip->Registers.FMLinkStatus1.value = // get TL's counter in CpqTsProcessIMQEntry()
936 readl(fcChip->Registers.FMLinkStatus1.address); in CpqTsProcessIMQEntry()
939 fcChip->Registers.FMLinkStatus2.value = // get TL's counter in CpqTsProcessIMQEntry()
940 readl(fcChip->Registers.FMLinkStatus2.address); in CpqTsProcessIMQEntry()
957 fcChip->Registers.TYstatus.value = // read what's frozen in CpqTsProcessIMQEntry()
958 readl(fcChip->Registers.TYstatus.address); in CpqTsProcessIMQEntry()
963 fcChip->Registers.TYstatus.value = // read what's frozen in CpqTsProcessIMQEntry()
964 readl(fcChip->Registers.TYstatus.address); in CpqTsProcessIMQEntry()
990 fcChip->Registers.FMstatus.value = readl(fcChip->Registers.FMstatus.address); in CpqTsProcessIMQEntry()
1014 u32 Lpsm = (fcChip->Registers.FMstatus.value & 0xF0) >> 4; in CpqTsProcessIMQEntry()
1016 if ((fcChip->Registers.FMstatus.value & 0x400) // ElasticStore? in CpqTsProcessIMQEntry()
1017 && !(fcChip->Registers.FMstatus.value & 0x100) // NOT LDn in CpqTsProcessIMQEntry()
1018 && !(fcChip->Registers.FMstatus.value & 0x1000)) // NOT LF in CpqTsProcessIMQEntry()
1029 fcChip->fcStats.FMinits++; in CpqTsProcessIMQEntry()
1030 writel(6, fcChip->Registers.FMcontrol.address); // LIP in CpqTsProcessIMQEntry()
1033 } else if (fcChip->Registers.FMstatus.value & 0x40000) // LST? in CpqTsProcessIMQEntry()
1037 fcChip->fcStats.FMinits++; in CpqTsProcessIMQEntry()
1038 writel(6, fcChip->Registers.FMcontrol.address); // LIP in CpqTsProcessIMQEntry()
1044 writel((fcChip->Registers.FMstatus.value & 0xff3fff00L), fcChip->Registers.FMstatus.address); in CpqTsProcessIMQEntry()
1048fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[0] = fcChip->Registers.FMstatus.value; // (fo… in CpqTsProcessIMQEntry()
1055 fcChip->Registers.FMLinkStatus1.value = // get TL's counter in CpqTsProcessIMQEntry()
1056 readl(fcChip->Registers.FMLinkStatus1.address); in CpqTsProcessIMQEntry()
1058 fcChip->Registers.FMLinkStatus2.value = // get TL's counter in CpqTsProcessIMQEntry()
1059 readl(fcChip->Registers.FMLinkStatus2.address); in CpqTsProcessIMQEntry()
1062 fcChip->Registers.FMBB_CreditZero.value = // get TL's counter in CpqTsProcessIMQEntry()
1063 readl(fcChip->Registers.FMBB_CreditZero.address); in CpqTsProcessIMQEntry()
1067 fcParseLinkStatusCounters(fcChip); // load into 6 s/w accumulators in CpqTsProcessIMQEntry()
1072 if (fcChip->Registers.FMstatus.value & 0x100L) // Link DOWN bit in CpqTsProcessIMQEntry()
1080 fcChip->fcStats.linkDown++; in CpqTsProcessIMQEntry()
1088 if (fcChip->ERQ->producerIndex != fcChip->ERQ->consumerIndex) { in CpqTsProcessIMQEntry()
1090 CpqTsFreezeTachlite(fcChip, 1); // freeze ERQ only in CpqTsProcessIMQEntry()
1091 fcChip->ERQ->producerIndex = fcChip->ERQ->consumerIndex = 0; in CpqTsProcessIMQEntry()
1092 writel(fcChip->ERQ->base, (fcChip->Registers.ReMapMemBase + TL_MEM_ERQ_BASE)); in CpqTsProcessIMQEntry()
1101 pLoggedInPort = &fcChip->fcPorts; in CpqTsProcessIMQEntry()
1125 fcChip->Options.LILPin = 0; // our LILPmap is invalid in CpqTsProcessIMQEntry()
1151 cpqfcTSCompleteExchange(cpqfcHBAdata->PciDev, fcChip, i); // abort on LDn in CpqTsProcessIMQEntry()
1157 if (fcChip->Registers.FMstatus.value & 0x200L) // Link Up bit in CpqTsProcessIMQEntry()
1163 pLoggedInPort = &fcChip->fcPorts; in CpqTsProcessIMQEntry()
1182 fcChip->Registers.rcv_al_pa.value = readl(fcChip->Registers.rcv_al_pa.address); in CpqTsProcessIMQEntry()
1190 … if ((fcChip->Registers.my_al_pa & 0xFF) != ((fcChip->Registers.rcv_al_pa.value >> 16) & 0xFF)) { in CpqTsProcessIMQEntry()
1194 pLoggedInPort = &fcChip->fcPorts; in CpqTsProcessIMQEntry()
1218 fcChip->Registers.my_al_pa = (fcChip->Registers.rcv_al_pa.value >> 16) & 0xFF; in CpqTsProcessIMQEntry()
1222fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[1] = fcChip->Registers.my_al_pa; // (for debu… in CpqTsProcessIMQEntry()
1229 ulBuff = readl(fcChip->Registers.FMconfig.address); in CpqTsProcessIMQEntry()
1231 ulBuff |= (fcChip->Registers.my_al_pa << 24); // or in acq. al_pa in CpqTsProcessIMQEntry()
1232 fcChip->Registers.FMconfig.value = ulBuff; // copy it back in CpqTsProcessIMQEntry()
1233 writel(fcChip->Registers.FMconfig.value, // put in TachLite in CpqTsProcessIMQEntry()
1234 fcChip->Registers.FMconfig.address); in CpqTsProcessIMQEntry()
1238 … printk("#LUp %Xh, FMstat 0x%08X#", fcChip->Registers.my_al_pa, fcChip->Registers.FMstatus.value); in CpqTsProcessIMQEntry()
1243 writel(fcChip->Registers.my_al_pa, fcChip->Registers.ReMapMemBase + TL_MEM_TACH_My_ID); in CpqTsProcessIMQEntry()
1246 fcChip->fcStats.linkUp++; in CpqTsProcessIMQEntry()
1252 readl(fcChip->Registers.FMLinkStatus1.address); in CpqTsProcessIMQEntry()
1255 readl(fcChip->Registers.FMLinkStatus2.address); in CpqTsProcessIMQEntry()
1264 CpqTsUnFreezeTachlite(fcChip, 2); // unfreeze Tachlite, if Link OK in CpqTsProcessIMQEntry()
1277 …if (PeekIMQEntry(fcChip, ELS_LILP_FRAME)) { // found SFQ LILP, which will post LINKACTIVE in CpqTsProcessIMQEntry()
1286 if (fcChip->Registers.FMstatus.value & 0x2000) { in CpqTsProcessIMQEntry()
1288 fcChip->Options.fabric = 1; in CpqTsProcessIMQEntry()
1290 fcChip->Options.fabric = 0; in CpqTsProcessIMQEntry()
1295 if (fcChip->Registers.FMstatus.value & 0x30000L) { in CpqTsProcessIMQEntry()
1297 fcChip->Registers.rcv_al_pa.value = readl(fcChip->Registers.rcv_al_pa.address); in CpqTsProcessIMQEntry()
1300 if (fcChip->Registers.FMstatus.value & 0x10000L) { in CpqTsProcessIMQEntry()
1304fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[1] = (fcChip->Registers.rcv_al_pa.value & 0xf… in CpqTsProcessIMQEntry()
1306 pLoggedInPort = fcFindLoggedInPort(fcChip, NULL, // DON'T search Scsi Nexus in CpqTsProcessIMQEntry()
1307 fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[1], // port id in CpqTsProcessIMQEntry()
1321 printk(" #BAD alpa %Xh# ", fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[1]); in CpqTsProcessIMQEntry()
1326 if (fcChip->Registers.FMstatus.value & 0x20000L) { in CpqTsProcessIMQEntry()
1328fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[2] = (fcChip->Registers.rcv_al_pa.value & 0xf… in CpqTsProcessIMQEntry()
1334 if (fcChip->Registers.FMstatus.value & 0x400L) { in CpqTsProcessIMQEntry()
1336 if (!(u16) (fcChip->Registers.FMstatus.value & 0x80)) in CpqTsProcessIMQEntry()
1337 fcChip->fcStats.e_stores++; in CpqTsProcessIMQEntry()
1363 ulBuff = fcChip->IMQ->QEntry[fcChip->IMQ->consumerIndex].word[0]; in CpqTsProcessIMQEntry()
1404 cpqfcTSCompleteExchange(cpqfcHBAdata->PciDev, fcChip, x_ID); in CpqTsProcessIMQEntry()
1441 fcChip->IMQ->consumerIndex++; // increment OUR consumerIndex in CpqTsProcessIMQEntry()
1442 if (fcChip->IMQ->consumerIndex >= IMQ_LEN) // check for rollover in CpqTsProcessIMQEntry()
1443 fcChip->IMQ->consumerIndex = 0L; // reset it in CpqTsProcessIMQEntry()
1446 if (fcChip->IMQ->producerIndex == fcChip->IMQ->consumerIndex) { // all Messages are processed - in CpqTsProcessIMQEntry()
1458 writel(fcChip->IMQ->consumerIndex, (fcChip->Registers.ReMapMemBase + IMQ_CONSUMER_INDEX)); in CpqTsProcessIMQEntry()
1461 printk("Process IMQ: writing consumer ndx %d\n ", fcChip->IMQ->consumerIndex); in CpqTsProcessIMQEntry()
1462 printk("PI %X, CI %X\n", fcChip->IMQ->producerIndex, fcChip->IMQ->consumerIndex); in CpqTsProcessIMQEntry()
1471 …printk("Process IMQ: no message PI %Xh CI %Xh", fcChip->IMQ->producerIndex, fcChip->IMQ->consumer… in CpqTsProcessIMQEntry()
1502 PTACHYON fcChip = &cpqfcHBAdata->fcChip; in CpqTsInitializeTachLite() local
1511 if (!fcChip->Registers.ReMapMemBase) // NULL address for card? in CpqTsInitializeTachLite()
1520 iStatus = fcChip->ResetTachyon(cpqfcHBAdata, opcode2); // laser off, reset hardware in CpqTsInitializeTachLite()
1539 writel(ulBuff, fcChip->Registers.TYconfig.address); in CpqTsInitializeTachLite()
1548 fcChip->Registers.TYconfig.value = readl(fcChip->Registers.TYconfig.address); in CpqTsInitializeTachLite()
1554 fcChip->Registers.PCIMCTR = bBuff; in CpqTsInitializeTachLite()
1558 fcChip->Registers.TYstatus.value = readl(fcChip->Registers.TYstatus.address); in CpqTsInitializeTachLite()
1565 u32 RevId = (fcChip->Registers.TYstatus.value & 0x3E0) >> 5; in CpqTsInitializeTachLite()
1571 sprintf(cpqfcHBAdata->fcChip.Name, STACHLITE66_TS12); in CpqTsInitializeTachLite()
1574 sprintf(cpqfcHBAdata->fcChip.Name, STACHLITE66_TS13); in CpqTsInitializeTachLite()
1576 sprintf(cpqfcHBAdata->fcChip.Name, SAGILENT_XL2_21); in CpqTsInitializeTachLite()
1578 sprintf(cpqfcHBAdata->fcChip.Name, STACHLITE_UNKNOWN); in CpqTsInitializeTachLite()
1592 writeb(0x1F, fcChip->Registers.ReMapMemBase + IINTEN); in CpqTsInitializeTachLite()
1599 iStatus = CpqTsInitializeFrameManager(fcChip, 0); in CpqTsInitializeTachLite()
1624 PTACHYON fcChip = &cpqfcHBAdata->fcChip; in CpqTsDestroyTachLiteQues() local
1628 FC_EXCHANGES *Exchanges = fcChip->Exchanges; in CpqTsDestroyTachLiteQues()
1633 if (fcChip->SEST) { in CpqTsDestroyTachLiteQues()
1642 …cpqfc_pci_unmap(cpqfcHBAdata->PciDev, Exchanges->fcExchange[i].Cmnd, fcChip, i); // undo DMA mappi… in CpqTsDestroyTachLiteQues()
1644 for (j = fcChip->SEST->sgPages[i]; j != NULL; j = next) { in CpqTsDestroyTachLiteQues()
1648 fcChip->SEST->sgPages[i] = NULL; in CpqTsDestroyTachLiteQues()
1650 ulPtr = (unsigned long) fcChip->SEST; in CpqTsDestroyTachLiteQues()
1652 fcChip->SEST = 0L; // null invalid ptr in CpqTsDestroyTachLiteQues()
1659 if (fcChip->SFQ) { in CpqTsDestroyTachLiteQues()
1661 ulPtr = (unsigned long) fcChip->SFQ; in CpqTsDestroyTachLiteQues()
1663 fcChip->SFQ = 0L; // null invalid ptr in CpqTsDestroyTachLiteQues()
1671 if (fcChip->IMQ) { in CpqTsDestroyTachLiteQues()
1673 fcChip->IMQ->producerIndex = 0; in CpqTsDestroyTachLiteQues()
1674 fcChip->IMQ->consumerIndex = 0; in CpqTsDestroyTachLiteQues()
1676 ulPtr = (unsigned long) fcChip->IMQ; in CpqTsDestroyTachLiteQues()
1678 fcChip->IMQ = 0L; // null invalid ptr in CpqTsDestroyTachLiteQues()
1685 if (fcChip->ERQ) // release memory blocks used by the queues in CpqTsDestroyTachLiteQues()
1687 ulPtr = (unsigned long) fcChip->ERQ; in CpqTsDestroyTachLiteQues()
1689 fcChip->ERQ = 0L; // null invalid ptr in CpqTsDestroyTachLiteQues()
1720 static void CpqTsGetSFQEntry(PTACHYON fcChip, u16 producerNdx, u32 * ulDestPtr, // contiguous desti… in CpqTsGetSFQEntry() argument
1724 u32 consumerIndex = fcChip->SFQ->consumerIndex; in CpqTsGetSFQEntry()
1734 memcpy(ulDestPtr, &fcChip->SFQ->QEntry[consumerIndex], 64); // each SFQ entry is 64 bytes in CpqTsGetSFQEntry()
1746 fcChip->SFQ->consumerIndex = consumerIndex; in CpqTsGetSFQEntry()
1747 writel(fcChip->SFQ->consumerIndex, fcChip->Registers.SFQconsumerIndex.address); in CpqTsGetSFQEntry()
1761 PTACHYON fcChip = (PTACHYON) pChip; in CpqTsUnFreezeTachlite() local
1762 fcChip->Registers.TYcontrol.value = readl(fcChip->Registers.TYcontrol.address); in CpqTsUnFreezeTachlite()
1770 if (!(fcChip->Registers.FMstatus.value & 0x07000000L) && // bits clear? in CpqTsUnFreezeTachlite()
1771 !(fcChip->Registers.FMstatus.value & 0x80)) // Active LPSM? in CpqTsUnFreezeTachlite()
1773 fcChip->Registers.TYcontrol.value &= ~0x300L; // clear FEQ, FFA in CpqTsUnFreezeTachlite()
1777 fcChip->Registers.TYcontrol.value |= 0x10000L; // set REQ in CpqTsUnFreezeTachlite()
1783 fcChip->Registers.TYcontrol.value |= 0x70000L; // set ROF, RIF, REQ in CpqTsUnFreezeTachlite()
1786 writel(fcChip->Registers.TYcontrol.value, fcChip->Registers.TYcontrol.address); in CpqTsUnFreezeTachlite()
1790 fcChip->Registers.TYstatus.value = readl(fcChip->Registers.TYstatus.address); in CpqTsUnFreezeTachlite()
1803 PTACHYON fcChip = (PTACHYON) pChip; in CpqTsFreezeTachlite() local
1804 fcChip->Registers.TYcontrol.value = readl(fcChip->Registers.TYcontrol.address); in CpqTsFreezeTachlite()
1808 fcChip->Registers.TYcontrol.value |= 0x100L; // (bit 4 is laser) in CpqTsFreezeTachlite()
1810 fcChip->Registers.TYcontrol.value |= 0x300L; // (bit 4 is laser) in CpqTsFreezeTachlite()
1812 writel(fcChip->Registers.TYcontrol.value, fcChip->Registers.TYcontrol.address); in CpqTsFreezeTachlite()
1825 void fcParseLinkStatusCounters(PTACHYON fcChip) in fcParseLinkStatusCounters() argument
1837 if (fcChip->fcStats.lastBB0timer == 0L) // TL was reset? (ignore 1st values) in fcParseLinkStatusCounters()
1840 fcChip->fcStats.lastBB0timer = fcChip->Registers.FMBB_CreditZero.value & 0x00ffffffL; in fcParseLinkStatusCounters()
1844 ulBuff = fcChip->Registers.FMBB_CreditZero.value & 0x00ffffffL; in fcParseLinkStatusCounters()
1845 if (fcChip->fcStats.lastBB0timer > ulBuff) // rollover happened in fcParseLinkStatusCounters()
1848 fcChip->fcStats.BB0_Timer += (0x00FFFFFFL - fcChip->fcStats.lastBB0timer); in fcParseLinkStatusCounters()
1849 fcChip->fcStats.BB0_Timer += ulBuff; // plus some more in fcParseLinkStatusCounters()
1854 fcChip->fcStats.BB0_Timer += (ulBuff - fcChip->fcStats.lastBB0timer); in fcParseLinkStatusCounters()
1858 fcChip->fcStats.lastBB0timer = ulBuff; in fcParseLinkStatusCounters()
1863 bBuff = (u8) (fcChip->Registers.FMLinkStatus1.value >> 24); in fcParseLinkStatusCounters()
1864 fcChip->fcStats.LossofSignal += bBuff; in fcParseLinkStatusCounters()
1866 bBuff = (u8) (fcChip->Registers.FMLinkStatus1.value >> 16); in fcParseLinkStatusCounters()
1867 fcChip->fcStats.BadRXChar += bBuff; in fcParseLinkStatusCounters()
1869 bBuff = (u8) (fcChip->Registers.FMLinkStatus1.value >> 8); in fcParseLinkStatusCounters()
1870 fcChip->fcStats.LossofSync += bBuff; in fcParseLinkStatusCounters()
1873 bBuff = (u8) (fcChip->Registers.FMLinkStatus2.value >> 24); in fcParseLinkStatusCounters()
1874 fcChip->fcStats.Rx_EOFa += bBuff; in fcParseLinkStatusCounters()
1876 bBuff = (u8) (fcChip->Registers.FMLinkStatus2.value >> 16); in fcParseLinkStatusCounters()
1877 fcChip->fcStats.Dis_Frm += bBuff; in fcParseLinkStatusCounters()
1879 bBuff = (u8) (fcChip->Registers.FMLinkStatus2.value >> 8); in fcParseLinkStatusCounters()
1880 fcChip->fcStats.Bad_CRC += bBuff; in fcParseLinkStatusCounters()
1884 void cpqfcTSClearLinkStatusCounters(PTACHYON fcChip) in cpqfcTSClearLinkStatusCounters() argument
1887 memset(&fcChip->fcStats, 0, sizeof(FCSTATS)); in cpqfcTSClearLinkStatusCounters()
1918 PTACHYON fcChip = (PTACHYON) pChip; in CpqTsReadWriteWWN() local
1931 …ulBuff = cpqfcTS_ReadNVRAM(fcChip->Registers.TYstatus.address, fcChip->Registers.TYcontrol.address… in CpqTsReadWriteWWN()
1951 fcChip->Registers.wwn_hi = 0L; in CpqTsReadWriteWWN()
1952 fcChip->Registers.wwn_lo = 0L; in CpqTsReadWriteWWN()
1957 fcChip->Registers.wwn_hi |= ulBuff; in CpqTsReadWriteWWN()
1963 fcChip->Registers.wwn_lo |= ulBuff; in CpqTsReadWriteWWN()
1997 PTACHYON fcChip = (PTACHYON) pChip; in CpqTsReadWriteNVRAM() local
2007fcChip->Registers.TYstatus.address, fcChip->Registers.TYcontrol.address, 256, // bytes to write in CpqTsReadWriteNVRAM()