Lines Matching refs:pAC

195 static int	SkGeBoardInit(struct SK_NET_DEVICE *dev, SK_AC *pAC);
196 static SK_BOOL BoardAllocMem(SK_AC *pAC);
197 static void BoardFreeMem(SK_AC *pAC);
198 static void BoardInitMem(SK_AC *pAC);
212 static void FreeTxDescriptors(SK_AC*pAC, TX_PORT*);
223 static int SkGeInitPCI(SK_AC *pAC);
224 static void StartDrvCleanupTimer(SK_AC *pAC);
225 static void StopDrvCleanupTimer(SK_AC *pAC);
230 static int SkDrvInitAdapter(SK_AC *pAC, int devNbr);
231 static int SkDrvDeInitAdapter(SK_AC *pAC, int devNbr);
251 extern void SkDimEnableModerationIfNeeded(SK_AC *pAC);
252 extern void SkDimDisplayModerationSettings(SK_AC *pAC);
253 extern void SkDimStartModerationTimer(SK_AC *pAC);
254 extern void SkDimModerate(SK_AC *pAC);
296 SK_AC *pAC; in skge_probe() local
339 pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL); in skge_probe()
340 if (pNet->pAC == NULL){ in skge_probe()
357 memset(pNet->pAC, 0, sizeof(SK_AC)); in skge_probe()
358 pAC = pNet->pAC; in skge_probe()
359 pAC->PciDev = pdev; in skge_probe()
360 pAC->PciDevId = pdev->device; in skge_probe()
361 pAC->dev[0] = dev; in skge_probe()
362 pAC->dev[1] = dev; in skge_probe()
363 sprintf(pAC->Name, "SysKonnect SK-98xx"); in skge_probe()
364 pAC->CheckQueue = SK_FALSE; in skge_probe()
369 retval = SkGeInitPCI(pAC); in skge_probe()
391 if (pAC->ChipsetType) { in skge_probe()
399 pAC->Index = boards_found; in skge_probe()
401 if (SkGeBoardInit(dev, pAC)) { in skge_probe()
409 ProductStr(pAC); in skge_probe()
410 printk("%s: %s\n", dev->name, pAC->DeviceStr); in skge_probe()
414 'A' + pAC->Rlmt.Net[0].Port[pAC->Rlmt.Net[0].PrefPort]->PortNumber, in skge_probe()
415 (pAC->RlmtMode==0) ? "Check Link State" : in skge_probe()
416 ((pAC->RlmtMode==1) ? "Check Link State" : in skge_probe()
417 ((pAC->RlmtMode==3) ? "Check Local Port" : in skge_probe()
418 ((pAC->RlmtMode==7) ? "Check Segmentation" : in skge_probe()
419 ((pAC->RlmtMode==17) ? "Dual Check Link State" :"Error"))))); in skge_probe()
421 SkGeYellowLED(pAC, pAC->IoBase, 1); in skge_probe()
425 (caddr_t) &pAC->Addr.Net[0].CurrentMacAddress, 6); in skge_probe()
462 if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) { in skge_probe()
469 pAC->dev[1] = dev; in skge_probe()
473 pNet->pAC = pAC; in skge_probe()
489 if (pAC->ChipsetType) { in skge_probe()
509 (caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6); in skge_probe()
511 printk("%s: %s\n", dev->name, pAC->DeviceStr); in skge_probe()
516 pAC->HWRevision = (((pAC->GIni.GIPciHwRev >> 4) & 0x0F)*10) + in skge_probe()
517 (pAC->GIni.GIPciHwRev & 0x0F); in skge_probe()
520 pAC->Pnmi.pDriverFileName = DRIVER_FILE_NAME; in skge_probe()
521 pAC->Pnmi.pDriverReleaseDate = DRIVER_REL_DATE; in skge_probe()
523 SK_MEMSET(&(pAC->PnmiBackup), 0, sizeof(SK_PNMI_STRUCT_DATA)); in skge_probe()
524 SK_MEMCPY(&(pAC->PnmiBackup), &(pAC->PnmiStruct), in skge_probe()
556 int SkGeInitPCI(SK_AC *pAC) in SkGeInitPCI() argument
558 struct SK_NET_DEVICE *dev = pAC->dev[0]; in SkGeInitPCI()
559 struct pci_dev *pdev = pAC->PciDev; in SkGeInitPCI()
569 if (pci_request_regions(pdev, pAC->Name) != 0) { in SkGeInitPCI()
581 SkPciReadCfgDWord(pAC, PCI_OUR_REG_2, &our2); in SkGeInitPCI()
583 SkPciWriteCfgDWord(pAC, PCI_OUR_REG_2, our2); in SkGeInitPCI()
590 pAC->IoBase = (char*)ioremap_nocache(dev->mem_start, 0x4000); in SkGeInitPCI()
592 if (!pAC->IoBase){ in SkGeInitPCI()
622 SK_AC *pAC; in FreeResources() local
626 pAC = pNet->pAC; in FreeResources()
627 AllocFlag = pAC->AllocFlag; in FreeResources()
628 if (pAC->PciDev) { in FreeResources()
629 pci_release_regions(pAC->PciDev); in FreeResources()
634 if (pAC->IoBase) { in FreeResources()
635 iounmap(pAC->IoBase); in FreeResources()
637 if (pAC->pDescrMem) { in FreeResources()
638 BoardFreeMem(pAC); in FreeResources()
800 SK_AC *pAC; in skge_cleanup_module() local
807 pAC = pNet->pAC; in skge_cleanup_module()
808 next = pAC->Next; in skge_cleanup_module()
811 SkGeYellowLED(pAC, pAC->IoBase, 0); in skge_cleanup_module()
813 if(pAC->BoardLevel == SK_INIT_RUN) { in skge_cleanup_module()
815 spin_lock_irqsave(&pAC->SlowPathLock, Flags); in skge_cleanup_module()
818 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); in skge_cleanup_module()
821 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); in skge_cleanup_module()
822 SkEventDispatcher(pAC, pAC->IoBase); in skge_cleanup_module()
824 SK_OUT32(pAC->IoBase, B0_IMSK, 0); in skge_cleanup_module()
825 SkGeDeInit(pAC, pAC->IoBase); in skge_cleanup_module()
826 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); in skge_cleanup_module()
827 pAC->BoardLevel = SK_INIT_DATA; in skge_cleanup_module()
831 if(pAC->BoardLevel == SK_INIT_IO) { in skge_cleanup_module()
833 SkGeDeInit(pAC, pAC->IoBase); in skge_cleanup_module()
834 pAC->BoardLevel = SK_INIT_DATA; in skge_cleanup_module()
837 if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 2){ in skge_cleanup_module()
838 unregister_netdev(pAC->dev[1]); in skge_cleanup_module()
839 kfree(pAC->dev[1]); in skge_cleanup_module()
851 kfree(pAC); in skge_cleanup_module()
879 static int __init SkGeBoardInit(struct SK_NET_DEVICE *dev, SK_AC *pAC) in SkGeBoardInit() argument
889 ("IoBase: %08lX\n", (unsigned long)pAC->IoBase)); in SkGeBoardInit()
891 pAC->TxPort[i][0].HwAddr = pAC->IoBase + TxQueueAddr[i][0]; in SkGeBoardInit()
892 pAC->TxPort[i][0].PortIndex = i; in SkGeBoardInit()
893 pAC->RxPort[i].HwAddr = pAC->IoBase + RxQueueAddr[i]; in SkGeBoardInit()
894 pAC->RxPort[i].PortIndex = i; in SkGeBoardInit()
899 spin_lock_init(&pAC->TxPort[i][0].TxDesRingLock); in SkGeBoardInit()
900 spin_lock_init(&pAC->RxPort[i].RxDesRingLock); in SkGeBoardInit()
902 spin_lock_init(&pAC->SlowPathLock); in SkGeBoardInit()
906 spin_lock_irqsave(&pAC->SlowPathLock, Flags); in SkGeBoardInit()
908 if (SkGeInit(pAC, pAC->IoBase, SK_INIT_DATA) != 0) { in SkGeBoardInit()
910 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); in SkGeBoardInit()
913 SkI2cInit( pAC, pAC->IoBase, SK_INIT_DATA); in SkGeBoardInit()
914 SkEventInit(pAC, pAC->IoBase, SK_INIT_DATA); in SkGeBoardInit()
915 SkPnmiInit( pAC, pAC->IoBase, SK_INIT_DATA); in SkGeBoardInit()
916 SkAddrInit( pAC, pAC->IoBase, SK_INIT_DATA); in SkGeBoardInit()
917 SkRlmtInit( pAC, pAC->IoBase, SK_INIT_DATA); in SkGeBoardInit()
918 SkTimerInit(pAC, pAC->IoBase, SK_INIT_DATA); in SkGeBoardInit()
920 pAC->BoardLevel = SK_INIT_DATA; in SkGeBoardInit()
921 pAC->RxBufSize = ETH_BUF_SIZE; in SkGeBoardInit()
923 SK_PNMI_SET_DRIVER_DESCR(pAC, DescrString); in SkGeBoardInit()
924 SK_PNMI_SET_DRIVER_VER(pAC, VerStr); in SkGeBoardInit()
926 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); in SkGeBoardInit()
929 spin_lock_irqsave(&pAC->SlowPathLock, Flags); in SkGeBoardInit()
930 if (SkGeInit(pAC, pAC->IoBase, SK_INIT_IO) != 0) { in SkGeBoardInit()
932 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); in SkGeBoardInit()
935 SkI2cInit( pAC, pAC->IoBase, SK_INIT_IO); in SkGeBoardInit()
936 SkEventInit(pAC, pAC->IoBase, SK_INIT_IO); in SkGeBoardInit()
937 SkPnmiInit( pAC, pAC->IoBase, SK_INIT_IO); in SkGeBoardInit()
938 SkAddrInit( pAC, pAC->IoBase, SK_INIT_IO); in SkGeBoardInit()
939 SkRlmtInit( pAC, pAC->IoBase, SK_INIT_IO); in SkGeBoardInit()
940 SkTimerInit(pAC, pAC->IoBase, SK_INIT_IO); in SkGeBoardInit()
943 pAC->ChipsetType = 0; in SkGeBoardInit()
944 if ((pAC->GIni.GIChipId == CHIP_ID_YUKON) || in SkGeBoardInit()
945 (pAC->GIni.GIChipId == CHIP_ID_YUKON_LITE)) { in SkGeBoardInit()
946 pAC->ChipsetType = 1; in SkGeBoardInit()
949 GetConfiguration(pAC); in SkGeBoardInit()
950 if (pAC->RlmtNets == 2) { in SkGeBoardInit()
951 pAC->GIni.GIPortUsage = SK_MUL_LINK; in SkGeBoardInit()
954 pAC->BoardLevel = SK_INIT_IO; in SkGeBoardInit()
955 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); in SkGeBoardInit()
957 if (pAC->GIni.GIMacsFound == 2) { in SkGeBoardInit()
958 Ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev); in SkGeBoardInit()
959 } else if (pAC->GIni.GIMacsFound == 1) { in SkGeBoardInit()
961 pAC->Name, dev); in SkGeBoardInit()
964 pAC->GIni.GIMacsFound); in SkGeBoardInit()
973 pAC->AllocFlag |= SK_ALLOC_IRQ; in SkGeBoardInit()
976 if(!BoardAllocMem(pAC)) { in SkGeBoardInit()
981 SkCsSetReceiveFlags(pAC, in SkGeBoardInit()
983 &pAC->CsOfs1, &pAC->CsOfs2, 0); in SkGeBoardInit()
984 pAC->CsOfs = (pAC->CsOfs2 << 16) | pAC->CsOfs1; in SkGeBoardInit()
986 BoardInitMem(pAC); in SkGeBoardInit()
989 if (pAC->RlmtNets == 2) { in SkGeBoardInit()
994 pAC, in SkGeBoardInit()
995 pAC->ActivePort, in SkGeBoardInit()
997 BoardFreeMem(pAC); in SkGeBoardInit()
1005 pAC->Next = SkGeRootDev; in SkGeBoardInit()
1027 SK_AC *pAC) in BoardAllocMem() argument
1038 AllocLength = (RX_RING_SIZE + TX_RING_SIZE) * pAC->GIni.GIMacsFound + 8; in BoardAllocMem()
1040 AllocLength = (RX_RING_SIZE + TX_RING_SIZE) * pAC->GIni.GIMacsFound in BoardAllocMem()
1044 pDescrMem = pci_alloc_consistent(pAC->PciDev, AllocLength, in BoardAllocMem()
1045 &pAC->pDescrMemDMA); in BoardAllocMem()
1050 pAC->pDescrMem = pDescrMem; in BoardAllocMem()
1051 BusAddr = (unsigned long) pAC->pDescrMemDMA; in BoardAllocMem()
1056 for (i=0; i<pAC->GIni.GIMacsFound; i++) { in BoardAllocMem()
1061 pAC->TxPort[i][0].pTxDescrRing = pDescrMem; in BoardAllocMem()
1062 pAC->TxPort[i][0].VTxDescrRing = BusAddr; in BoardAllocMem()
1070 pAC->RxPort[i].pRxDescrRing = pDescrMem; in BoardAllocMem()
1071 pAC->RxPort[i].VRxDescrRing = BusAddr; in BoardAllocMem()
1091 SK_AC *pAC) in BoardFreeMem() argument
1098 AllocLength = (RX_RING_SIZE + TX_RING_SIZE) * pAC->GIni.GIMacsFound + 8; in BoardFreeMem()
1100 AllocLength = (RX_RING_SIZE + TX_RING_SIZE) * pAC->GIni.GIMacsFound in BoardFreeMem()
1104 pci_free_consistent(pAC->PciDev, AllocLength, in BoardFreeMem()
1105 pAC->pDescrMem, pAC->pDescrMemDMA); in BoardFreeMem()
1106 pAC->pDescrMem = NULL; in BoardFreeMem()
1121 SK_AC *pAC) /* pointer to adapter context */ in BoardInitMem() argument
1131 pAC->RxDescrPerRing = RX_RING_SIZE / RxDescrSize; in BoardInitMem()
1133 pAC->TxDescrPerRing = TX_RING_SIZE / RxDescrSize; in BoardInitMem()
1135 for (i=0; i<pAC->GIni.GIMacsFound; i++) { in BoardInitMem()
1137 pAC, in BoardInitMem()
1138 pAC->TxPort[i][0].pTxDescrRing, in BoardInitMem()
1139 pAC->TxPort[i][0].VTxDescrRing, in BoardInitMem()
1140 (RXD**)&pAC->TxPort[i][0].pTxdRingHead, in BoardInitMem()
1141 (RXD**)&pAC->TxPort[i][0].pTxdRingTail, in BoardInitMem()
1142 (RXD**)&pAC->TxPort[i][0].pTxdRingPrev, in BoardInitMem()
1143 &pAC->TxPort[i][0].TxdRingFree, in BoardInitMem()
1146 pAC, in BoardInitMem()
1147 pAC->RxPort[i].pRxDescrRing, in BoardInitMem()
1148 pAC->RxPort[i].VRxDescrRing, in BoardInitMem()
1149 &pAC->RxPort[i].pRxdRingHead, in BoardInitMem()
1150 &pAC->RxPort[i].pRxdRingTail, in BoardInitMem()
1151 &pAC->RxPort[i].pRxdRingPrev, in BoardInitMem()
1152 &pAC->RxPort[i].RxdRingFree, in BoardInitMem()
1170 SK_AC *pAC, in SetupRing() argument
1209 pDescr->TcpSumStarts = pAC->CsOfs; in SetupRing()
1240 SK_AC *pAC, /* pointer to adapter context */ in PortReInitBmu() argument
1247 SK_OUT32(pAC->IoBase, TxQueueAddr[PortIndex][TX_PRIO_LOW]+ Q_DA_L, in PortReInitBmu()
1249 (pAC->TxPort[PortIndex][TX_PRIO_LOW].pTxdRingHead) - in PortReInitBmu()
1250 pAC->TxPort[PortIndex][TX_PRIO_LOW].pTxDescrRing + in PortReInitBmu()
1251 pAC->TxPort[PortIndex][TX_PRIO_LOW].VTxDescrRing) & in PortReInitBmu()
1253 SK_OUT32(pAC->IoBase, TxQueueAddr[PortIndex][TX_PRIO_LOW]+ Q_DA_H, in PortReInitBmu()
1255 (pAC->TxPort[PortIndex][TX_PRIO_LOW].pTxdRingHead) - in PortReInitBmu()
1256 pAC->TxPort[PortIndex][TX_PRIO_LOW].pTxDescrRing + in PortReInitBmu()
1257 pAC->TxPort[PortIndex][TX_PRIO_LOW].VTxDescrRing) >> 32)); in PortReInitBmu()
1258 SK_OUT32(pAC->IoBase, RxQueueAddr[PortIndex]+Q_DA_L, in PortReInitBmu()
1259 (uint32_t)(((caddr_t)(pAC->RxPort[PortIndex].pRxdRingHead) - in PortReInitBmu()
1260 pAC->RxPort[PortIndex].pRxDescrRing + in PortReInitBmu()
1261 pAC->RxPort[PortIndex].VRxDescrRing) & 0xFFFFFFFF)); in PortReInitBmu()
1262 SK_OUT32(pAC->IoBase, RxQueueAddr[PortIndex]+Q_DA_H, in PortReInitBmu()
1263 (uint32_t)(((caddr_t)(pAC->RxPort[PortIndex].pRxdRingHead) - in PortReInitBmu()
1264 pAC->RxPort[PortIndex].pRxDescrRing + in PortReInitBmu()
1265 pAC->RxPort[PortIndex].VRxDescrRing) >> 32)); in PortReInitBmu()
1285 SK_AC *pAC; in SkGeIsr() local
1289 pAC = pNet->pAC; in SkGeIsr()
1294 SK_IN32(pAC->IoBase, B0_SP_ISRC, &IntSrc); in SkGeIsr()
1311 ReceiveIrq(pAC, &pAC->RxPort[0], SK_TRUE); in SkGeIsr()
1312 SK_PNMI_CNT_RX_INTR(pAC, 0); in SkGeIsr()
1318 ReceiveIrq(pAC, &pAC->RxPort[1], SK_TRUE); in SkGeIsr()
1319 SK_PNMI_CNT_RX_INTR(pAC, 1); in SkGeIsr()
1326 SK_PNMI_CNT_TX_INTR(pAC, 0); in SkGeIsr()
1327 spin_lock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); in SkGeIsr()
1328 FreeTxDescriptors(pAC, &pAC->TxPort[0][TX_PRIO_LOW]); in SkGeIsr()
1329 spin_unlock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); in SkGeIsr()
1335 SK_PNMI_CNT_TX_INTR(pAC, 1); in SkGeIsr()
1336 spin_lock(&pAC->TxPort[1][TX_PRIO_LOW].TxDesRingLock); in SkGeIsr()
1337 FreeTxDescriptors(pAC, &pAC->TxPort[1][TX_PRIO_LOW]); in SkGeIsr()
1338 spin_unlock(&pAC->TxPort[1][TX_PRIO_LOW].TxDesRingLock); in SkGeIsr()
1345 SK_PNMI_CNT_TX_INTR(pAC, 1); in SkGeIsr()
1346 spin_lock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); in SkGeIsr()
1347 FreeTxDescriptors(pAC, 0, TX_PRIO_HIGH); in SkGeIsr()
1348 spin_unlock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); in SkGeIsr()
1349 ClearTxIrq(pAC, 0, TX_PRIO_HIGH); in SkGeIsr()
1355 SK_PNMI_CNT_TX_INTR(pAC, 1); in SkGeIsr()
1356 spin_lock(&pAC->TxPort[1][TX_PRIO_HIGH].TxDesRingLock); in SkGeIsr()
1357 FreeTxDescriptors(pAC, 1, TX_PRIO_HIGH); in SkGeIsr()
1358 spin_unlock(&pAC->TxPort[1][TX_PRIO_HIGH].TxDesRingLock); in SkGeIsr()
1359 ClearTxIrq(pAC, 1, TX_PRIO_HIGH); in SkGeIsr()
1366 ClearAndStartRx(pAC, 0); in SkGeIsr()
1368 ClearAndStartRx(pAC, 1); in SkGeIsr()
1371 ClearTxIrq(pAC, 0, TX_PRIO_LOW); in SkGeIsr()
1373 ClearTxIrq(pAC, 1, TX_PRIO_LOW); in SkGeIsr()
1375 SK_IN32(pAC->IoBase, B0_ISRC, &IntSrc); in SkGeIsr()
1378 IntSrc &= pAC->GIni.GIValIrqMask; in SkGeIsr()
1379 if ((IntSrc & SPECIAL_IRQS) || pAC->CheckQueue) { in SkGeIsr()
1382 pAC->CheckQueue = SK_FALSE; in SkGeIsr()
1383 spin_lock(&pAC->SlowPathLock); in SkGeIsr()
1385 SkGeSirqIsr(pAC, pAC->IoBase, IntSrc); in SkGeIsr()
1387 SkEventDispatcher(pAC, pAC->IoBase); in SkGeIsr()
1388 spin_unlock(&pAC->SlowPathLock); in SkGeIsr()
1403 if (pAC->CheckQueue) { in SkGeIsr()
1404 pAC->CheckQueue = SK_FALSE; in SkGeIsr()
1405 spin_lock(&pAC->SlowPathLock); in SkGeIsr()
1406 SkEventDispatcher(pAC, pAC->IoBase); in SkGeIsr()
1407 spin_unlock(&pAC->SlowPathLock); in SkGeIsr()
1411 SK_OUT32(pAC->IoBase, B0_IMSK, pAC->GIni.GIValIrqMask); in SkGeIsr()
1434 SK_AC *pAC; in SkGeIsrOnePort() local
1438 pAC = pNet->pAC; in SkGeIsrOnePort()
1443 SK_IN32(pAC->IoBase, B0_SP_ISRC, &IntSrc); in SkGeIsrOnePort()
1460 ReceiveIrq(pAC, &pAC->RxPort[0], SK_TRUE); in SkGeIsrOnePort()
1461 SK_PNMI_CNT_RX_INTR(pAC, 0); in SkGeIsrOnePort()
1468 SK_PNMI_CNT_TX_INTR(pAC, 0); in SkGeIsrOnePort()
1469 spin_lock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); in SkGeIsrOnePort()
1470 FreeTxDescriptors(pAC, &pAC->TxPort[0][TX_PRIO_LOW]); in SkGeIsrOnePort()
1471 spin_unlock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock); in SkGeIsrOnePort()
1478 SK_PNMI_CNT_TX_INTR(pAC, 0); in SkGeIsrOnePort()
1479 spin_lock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); in SkGeIsrOnePort()
1480 FreeTxDescriptors(pAC, 0, TX_PRIO_HIGH); in SkGeIsrOnePort()
1481 spin_unlock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock); in SkGeIsrOnePort()
1482 ClearTxIrq(pAC, 0, TX_PRIO_HIGH); in SkGeIsrOnePort()
1489 ClearAndStartRx(pAC, 0); in SkGeIsrOnePort()
1492 ClearTxIrq(pAC, 0, TX_PRIO_LOW); in SkGeIsrOnePort()
1494 SK_IN32(pAC->IoBase, B0_ISRC, &IntSrc); in SkGeIsrOnePort()
1497 IntSrc &= pAC->GIni.GIValIrqMask; in SkGeIsrOnePort()
1498 if ((IntSrc & SPECIAL_IRQS) || pAC->CheckQueue) { in SkGeIsrOnePort()
1501 pAC->CheckQueue = SK_FALSE; in SkGeIsrOnePort()
1502 spin_lock(&pAC->SlowPathLock); in SkGeIsrOnePort()
1504 SkGeSirqIsr(pAC, pAC->IoBase, IntSrc); in SkGeIsrOnePort()
1506 SkEventDispatcher(pAC, pAC->IoBase); in SkGeIsrOnePort()
1507 spin_unlock(&pAC->SlowPathLock); in SkGeIsrOnePort()
1522 SK_OUT32(pAC->IoBase, B0_IMSK, pAC->GIni.GIValIrqMask); in SkGeIsrOnePort()
1548 SK_AC *pAC; in SkGeOpen() local
1554 pAC = pNet->pAC; in SkGeOpen()
1557 ("SkGeOpen: pAC=0x%lX:\n", (unsigned long)pAC)); in SkGeOpen()
1560 if (pAC->DiagModeActive == DIAG_ACTIVE) { in SkGeOpen()
1561 if (pAC->Pnmi.DiagAttached == SK_DIAG_RUNNING) { in SkGeOpen()
1569 if ((pAC->PciDev->vendor == 0x1186) || (pAC->PciDev->vendor == 0x11ab )) in SkGeOpen()
1570 pAC->GIni.GILedBlinkCtrl = OEM_CONFIG_VALUE; in SkGeOpen()
1572 if (pAC->BoardLevel == SK_INIT_DATA) { in SkGeOpen()
1574 if (SkGeInit(pAC, pAC->IoBase, SK_INIT_IO) != 0) { in SkGeOpen()
1575 printk("%s: HWInit (1) failed.\n", pAC->dev[pNet->PortNr]->name); in SkGeOpen()
1578 SkI2cInit (pAC, pAC->IoBase, SK_INIT_IO); in SkGeOpen()
1579 SkEventInit (pAC, pAC->IoBase, SK_INIT_IO); in SkGeOpen()
1580 SkPnmiInit (pAC, pAC->IoBase, SK_INIT_IO); in SkGeOpen()
1581 SkAddrInit (pAC, pAC->IoBase, SK_INIT_IO); in SkGeOpen()
1582 SkRlmtInit (pAC, pAC->IoBase, SK_INIT_IO); in SkGeOpen()
1583 SkTimerInit (pAC, pAC->IoBase, SK_INIT_IO); in SkGeOpen()
1584 pAC->BoardLevel = SK_INIT_IO; in SkGeOpen()
1587 if (pAC->BoardLevel != SK_INIT_RUN) { in SkGeOpen()
1589 if (SkGeInit(pAC, pAC->IoBase, SK_INIT_RUN) != 0) { in SkGeOpen()
1590 printk("%s: HWInit (2) failed.\n", pAC->dev[pNet->PortNr]->name); in SkGeOpen()
1593 SkI2cInit (pAC, pAC->IoBase, SK_INIT_RUN); in SkGeOpen()
1594 SkEventInit (pAC, pAC->IoBase, SK_INIT_RUN); in SkGeOpen()
1595 SkPnmiInit (pAC, pAC->IoBase, SK_INIT_RUN); in SkGeOpen()
1596 SkAddrInit (pAC, pAC->IoBase, SK_INIT_RUN); in SkGeOpen()
1597 SkRlmtInit (pAC, pAC->IoBase, SK_INIT_RUN); in SkGeOpen()
1598 SkTimerInit (pAC, pAC->IoBase, SK_INIT_RUN); in SkGeOpen()
1599 pAC->BoardLevel = SK_INIT_RUN; in SkGeOpen()
1602 for (i=0; i<pAC->GIni.GIMacsFound; i++) { in SkGeOpen()
1604 SkGePollTxD(pAC, pAC->IoBase, i, SK_TRUE); in SkGeOpen()
1605 FillRxRing(pAC, &pAC->RxPort[i]); in SkGeOpen()
1607 SkGeYellowLED(pAC, pAC->IoBase, 1); in SkGeOpen()
1609 StartDrvCleanupTimer(pAC); in SkGeOpen()
1610 SkDimEnableModerationIfNeeded(pAC); in SkGeOpen()
1611 SkDimDisplayModerationSettings(pAC); in SkGeOpen()
1613 pAC->GIni.GIValIrqMask &= IRQ_MASK; in SkGeOpen()
1616 SK_OUT32(pAC->IoBase, B0_IMSK, pAC->GIni.GIValIrqMask); in SkGeOpen()
1617 SK_OUT32(pAC->IoBase, B0_HWE_IMSK, IRQ_HWE_MASK); in SkGeOpen()
1619 spin_lock_irqsave(&pAC->SlowPathLock, Flags); in SkGeOpen()
1621 if ((pAC->RlmtMode != 0) && (pAC->MaxPorts == 0)) { in SkGeOpen()
1622 EvPara.Para32[0] = pAC->RlmtNets; in SkGeOpen()
1624 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_SET_NETS, in SkGeOpen()
1626 EvPara.Para32[0] = pAC->RlmtMode; in SkGeOpen()
1628 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_MODE_CHANGE, in SkGeOpen()
1634 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara); in SkGeOpen()
1635 SkEventDispatcher(pAC, pAC->IoBase); in SkGeOpen()
1636 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); in SkGeOpen()
1638 pAC->MaxPorts++; in SkGeOpen()
1666 SK_AC *pAC; in SkGeClose() local
1674 ("SkGeClose: pAC=0x%lX ", (unsigned long)pAC)); in SkGeClose()
1677 pAC = pNet->pAC; in SkGeClose()
1680 if (pAC->DiagModeActive == DIAG_ACTIVE) { in SkGeClose()
1681 if (pAC->DiagFlowCtrl == SK_FALSE) { in SkGeClose()
1688 newPtrNet = (DEV_NET *) pAC->dev[0]->priv; in SkGeClose()
1690 pAC->WasIfUp[0] = SK_FALSE; in SkGeClose()
1692 pAC->WasIfUp[1] = SK_FALSE; in SkGeClose()
1696 pAC->DiagFlowCtrl = SK_FALSE; in SkGeClose()
1703 if (pAC->RlmtNets == 1) in SkGeClose()
1704 PortIdx = pAC->ActivePort; in SkGeClose()
1708 StopDrvCleanupTimer(pAC); in SkGeClose()
1713 SkAddrMcClear(pAC, pAC->IoBase, PortIdx, 0); in SkGeClose()
1714 SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx, in SkGeClose()
1717 if (pAC->MaxPorts == 1) { in SkGeClose()
1718 spin_lock_irqsave(&pAC->SlowPathLock, Flags); in SkGeClose()
1720 SK_OUT32(pAC->IoBase, B0_IMSK, 0); in SkGeClose()
1723 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); in SkGeClose()
1724 SkEventDispatcher(pAC, pAC->IoBase); in SkGeClose()
1725 SK_OUT32(pAC->IoBase, B0_IMSK, 0); in SkGeClose()
1727 SkGeDeInit(pAC, pAC->IoBase); in SkGeClose()
1728 pAC->BoardLevel = SK_INIT_DATA; in SkGeClose()
1729 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); in SkGeClose()
1732 spin_lock_irqsave(&pAC->SlowPathLock, Flags); in SkGeClose()
1735 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara); in SkGeClose()
1736 SkPnmiEvent(pAC, pAC->IoBase, SK_PNMI_EVT_XMAC_RESET, EvPara); in SkGeClose()
1737 SkEventDispatcher(pAC, pAC->IoBase); in SkGeClose()
1738 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); in SkGeClose()
1741 spin_lock_irqsave(&pAC->TxPort[pNet->PortNr] in SkGeClose()
1743 SkGeStopPort(pAC, pAC->IoBase, pNet->PortNr, in SkGeClose()
1745 spin_unlock_irqrestore(&pAC->TxPort[pNet->PortNr] in SkGeClose()
1749 if (pAC->RlmtNets == 1) { in SkGeClose()
1751 for (i=0; i<pAC->GIni.GIMacsFound; i++) { in SkGeClose()
1752 ReceiveIrq(pAC, &pAC->RxPort[i], SK_TRUE); in SkGeClose()
1753 ClearRxRing(pAC, &pAC->RxPort[i]); in SkGeClose()
1754 ClearTxRing(pAC, &pAC->TxPort[i][TX_PRIO_LOW]); in SkGeClose()
1758 ReceiveIrq(pAC, &pAC->RxPort[pNet->PortNr], SK_TRUE); in SkGeClose()
1759 ClearRxRing(pAC, &pAC->RxPort[pNet->PortNr]); in SkGeClose()
1760 ClearTxRing(pAC, &pAC->TxPort[pNet->PortNr][TX_PRIO_LOW]); in SkGeClose()
1766 SK_MEMSET(&(pAC->PnmiBackup), 0, sizeof(SK_PNMI_STRUCT_DATA)); in SkGeClose()
1767 SK_MEMCPY(&(pAC->PnmiBackup), &(pAC->PnmiStruct), in SkGeClose()
1770 pAC->MaxPorts--; in SkGeClose()
1796 SK_AC *pAC; in SkGeXmit() local
1800 pAC = pNet->pAC; in SkGeXmit()
1803 (pAC->GIni.GIChipId == CHIP_ID_GENESIS)) { in SkGeXmit()
1806 if (pAC->RlmtNets == 2) in SkGeXmit()
1808 pAC, in SkGeXmit()
1809 &pAC->TxPort[pNet->PortNr][TX_PRIO_LOW], in SkGeXmit()
1813 pAC, in SkGeXmit()
1814 &pAC->TxPort[pAC->ActivePort][TX_PRIO_LOW], in SkGeXmit()
1818 if (pAC->RlmtNets == 2) in SkGeXmit()
1820 pAC, in SkGeXmit()
1821 &pAC->TxPort[pNet->PortNr][TX_PRIO_LOW], in SkGeXmit()
1825 pAC, in SkGeXmit()
1826 &pAC->TxPort[pAC->ActivePort][TX_PRIO_LOW], in SkGeXmit()
1869 SK_AC *pAC, /* pointer to adapter context */ in XmitFrame() argument
1885 FreeTxDescriptors(pAC, pTxPort); in XmitFrame()
1892 FreeTxDescriptors(pAC, pTxPort); in XmitFrame()
1895 SK_PNMI_CNT_NO_TX_BUF(pAC, pTxPort->PortIndex); in XmitFrame()
1940 PhysAddr = (SK_U64) pci_map_page(pAC->PciDev, in XmitFrame()
1952 (pAC->GIni.GIChipRev == 0) && in XmitFrame()
1953 (pAC->GIni.GIChipId == CHIP_ID_YUKON)) { in XmitFrame()
2019 SK_AC *pAC, /* pointer to adapter context */ in XmitFrameSG() argument
2037 FreeTxDescriptors(pAC, pTxPort); in XmitFrameSG()
2040 FreeTxDescriptors(pAC, pTxPort); in XmitFrameSG()
2043 SK_PNMI_CNT_NO_TX_BUF(pAC, pTxPort->PortIndex); in XmitFrameSG()
2061 PhysAddr = (SK_U64) pci_map_page(pAC->PciDev, in XmitFrameSG()
2082 (pAC->GIni.GIChipRev == 0) && in XmitFrameSG()
2083 (pAC->GIni.GIChipId == CHIP_ID_YUKON)) { in XmitFrameSG()
2113 PhysAddr = (SK_U64) pci_map_page(pAC->PciDev, in XmitFrameSG()
2134 (pAC->GIni.GIChipRev == 0) && in XmitFrameSG()
2135 (pAC->GIni.GIChipId == CHIP_ID_YUKON)) { in XmitFrameSG()
2202 SK_AC *pAC, /* pointer to the adapter context */ in FreeTxDescriptors() argument
2226 netif_wake_queue(pAC->dev[pTxPort->PortIndex]); in FreeTxDescriptors()
2232 netif_wake_queue(pAC->dev[pTxPort->PortIndex]); in FreeTxDescriptors()
2244 pci_unmap_page(pAC->PciDev, PhysAddr, in FreeTxDescriptors()
2274 SK_AC *pAC, /* pointer to the adapter context */ in FillRxRing() argument
2282 if(!FillRxDescriptor(pAC, pRxPort)) in FillRxRing()
2302 SK_AC *pAC, /* pointer to the adapter context struct */ in FillRxDescriptor() argument
2310 pMsgBlock = alloc_skb(pAC->RxBufSize, GFP_ATOMIC); in FillRxDescriptor()
2315 pAC->dev[pRxPort->PortIndex]->name)); in FillRxDescriptor()
2316 SK_PNMI_CNT_NO_RX_BUF(pAC, pRxPort->PortIndex); in FillRxDescriptor()
2324 Length = pAC->RxBufSize; in FillRxDescriptor()
2325 PhysAddr = (SK_U64) pci_map_page(pAC->PciDev, in FillRxDescriptor()
2329 pAC->RxBufSize - 2, in FillRxDescriptor()
2357 SK_AC *pAC, /* pointer to the adapter context struct */ in ReQueueRxBuffer() argument
2369 Length = pAC->RxBufSize; in ReQueueRxBuffer()
2394 SK_AC *pAC, /* pointer to adapter context */ argument
2425 pRxPort->RxdRingFree < pAC->RxDescrPerRing ;
2447 FillRxRing(pAC, pRxPort);
2450 pAC->DynIrqModInfo.NbrProcessedDescr++;
2454 if (FrameLength > pAC->RxBufSize) {
2471 if (pAC->GIni.GIChipId == CHIP_ID_GENESIS) {
2493 if (pAC->GIni.GIChipId == CHIP_ID_GENESIS) {
2526 pci_dma_sync_single(pAC->PciDev,
2530 ReQueueRxBuffer(pAC, pRxPort, pMsg,
2550 pci_dma_sync_single(pAC->PciDev,
2556 ReQueueRxBuffer(pAC, pRxPort, pMsg,
2572 pci_unmap_single(pAC->PciDev,
2574 pAC->RxBufSize - 2,
2599 (pAC->GIni.GIChipId == CHIP_ID_GENESIS)) ||
2600 (pAC->ChipsetType)) {
2601 Result = SkCsGetReceiveInfo(pAC,
2647 SK_RLMT_PRE_LOOKAHEAD(pAC, PortIndex, FrameLength,
2653 SK_RLMT_LOOKAHEAD(pAC, PortIndex,
2660 if ((PortIndex == pAC->ActivePort) ||
2661 (pAC->RlmtNets == 2)) {
2667 SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,
2670 pMsg->dev = pAC->dev[pRxPort->PortIndex];
2672 pAC->dev[pRxPort->PortIndex]);
2674 pAC->dev[pRxPort->PortIndex]->last_rx = jiffies;
2689 pRlmtMbuf = SkDrvAllocRlmtMbuf(pAC,
2690 pAC->IoBase, FrameLength);
2702 spin_lock_irqsave(&pAC->SlowPathLock, Flags);
2703 SkEventQueue(pAC, SKGE_RLMT,
2706 pAC->CheckQueue = SK_TRUE;
2707 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
2709 SkEventQueue(pAC, SKGE_RLMT,
2712 pAC->CheckQueue = SK_TRUE;
2719 if ((pAC->dev[pRxPort->PortIndex]->flags &
2723 pMsg->dev = pAC->dev[pRxPort->PortIndex];
2725 pAC->dev[pRxPort->PortIndex]);
2727 pAC->dev[pRxPort->PortIndex]->last_rx = jiffies;
2737 FillRxRing(pAC, pRxPort);
2739 if (pAC->BoardLevel > SK_INIT_DATA) {
2740 ClearAndStartRx(pAC, PortIndex);
2753 pci_unmap_page(pAC->PciDev,
2755 pAC->RxBufSize - 2,
2778 SK_AC *pAC, /* pointer to the adapter context */ argument
2781 SK_OUT8(pAC->IoBase,
2798 SK_AC *pAC, /* pointer to the adapter context */ argument
2802 SK_OUT8(pAC->IoBase,
2819 SK_AC *pAC, /* pointer to adapter context */ argument
2826 if (pRxPort->RxdRingFree == pAC->RxDescrPerRing) {
2836 pci_unmap_page(pAC->PciDev,
2838 pAC->RxBufSize - 2,
2865 SK_AC *pAC, /* pointer to adapter context */ argument
2874 for (i=0; i<pAC->TxDescrPerRing; i++) {
2878 FreeTxDescriptors(pAC, pTxPort);
2897 SK_AC *pAC = pNet->pAC; local
2909 spin_lock_irqsave(&pAC->SlowPathLock, Flags);
2911 if (pAC->RlmtNets == 2)
2912 SkAddrOverride(pAC, pAC->IoBase, pNet->NetNr,
2915 SkAddrOverride(pAC, pAC->IoBase, pAC->ActivePort,
2920 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
2943 SK_AC *pAC; local
2954 pAC = pNet->pAC;
2955 if (pAC->RlmtNets == 1)
2956 PortIdx = pAC->ActivePort;
2960 spin_lock_irqsave(&pAC->SlowPathLock, Flags);
2964 SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx,
2969 SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx,
2972 SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx,
2974 SkAddrMcClear(pAC, pAC->IoBase, PortIdx, 0);
2981 SkAddrMcAdd(pAC, pAC->IoBase, PortIdx,
2992 SkAddrMcUpdate(pAC, pAC->IoBase, PortIdx);
2994 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
3017 SK_AC *pAC; local
3026 pAC = pNet->pAC;
3032 if(pAC->BoardLevel != SK_INIT_RUN) {
3037 if (pAC->DiagModeActive == DIAG_ACTIVE) {
3038 if (pAC->DiagFlowCtrl == SK_FALSE) {
3041 pAC->DiagFlowCtrl = SK_FALSE;
3047 pOtherNet = (DEV_NET*)pAC->dev[1 - pNet->NetNr]->priv;
3052 pAC->RxBufSize = NewMtu + 32;
3062 SK_OUT32(pAC->IoBase, B0_IMSK, 0);
3063 spin_lock_irqsave(&pAC->SlowPathLock, Flags);
3070 if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) {
3071 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
3073 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
3075 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
3082 SkEventDispatcher(pAC, pAC->IoBase);
3084 for (i=0; i<pAC->GIni.GIMacsFound; i++) {
3086 &pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock, Flags);
3087 netif_stop_queue(pAC->dev[i]);
3099 for (i=0; i<pAC->GIni.GIMacsFound; i++) {
3100 if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) {
3101 pAC->RxPort[i].RxFillLimit = pAC->RxDescrPerRing -
3102 (pAC->RxDescrPerRing / 4);
3104 if (i == pAC->ActivePort) {
3105 pAC->RxPort[i].RxFillLimit = pAC->RxDescrPerRing -
3106 (pAC->RxDescrPerRing / 4);
3108 pAC->RxPort[i].RxFillLimit = pAC->RxDescrPerRing -
3109 (pAC->RxDescrPerRing / 10);
3117 for (i=0; i<pAC->GIni.GIMacsFound; i++) {
3118 if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) {
3119 pAC->RxPort[i].RxFillLimit = 1;
3121 if (i == pAC->ActivePort) {
3122 pAC->RxPort[i].RxFillLimit = 1;
3124 pAC->RxPort[i].RxFillLimit = pAC->RxDescrPerRing -
3125 (pAC->RxDescrPerRing / 4);
3131 SkGeDeInit(pAC, pAC->IoBase);
3138 pAC->GIni.GIPortUsage = SK_JUMBO_LINK;
3140 if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) {
3141 pAC->GIni.GIPortUsage = SK_MUL_LINK;
3143 pAC->GIni.GIPortUsage = SK_RED_LINK;
3147 SkGeInit( pAC, pAC->IoBase, SK_INIT_IO);
3148 SkI2cInit( pAC, pAC->IoBase, SK_INIT_IO);
3149 SkEventInit(pAC, pAC->IoBase, SK_INIT_IO);
3150 SkPnmiInit( pAC, pAC->IoBase, SK_INIT_IO);
3151 SkAddrInit( pAC, pAC->IoBase, SK_INIT_IO);
3152 SkRlmtInit( pAC, pAC->IoBase, SK_INIT_IO);
3153 SkTimerInit(pAC, pAC->IoBase, SK_INIT_IO);
3159 GetConfiguration(pAC);
3161 SkGeInit( pAC, pAC->IoBase, SK_INIT_RUN);
3162 SkI2cInit( pAC, pAC->IoBase, SK_INIT_RUN);
3163 SkEventInit(pAC, pAC->IoBase, SK_INIT_RUN);
3164 SkPnmiInit( pAC, pAC->IoBase, SK_INIT_RUN);
3165 SkAddrInit( pAC, pAC->IoBase, SK_INIT_RUN);
3166 SkRlmtInit( pAC, pAC->IoBase, SK_INIT_RUN);
3167 SkTimerInit(pAC, pAC->IoBase, SK_INIT_RUN);
3172 for (i=0; i<pAC->GIni.GIMacsFound; i++) {
3173 ReceiveIrq(pAC, &pAC->RxPort[i], SK_TRUE);
3174 ClearRxRing(pAC, &pAC->RxPort[i]);
3175 FillRxRing(pAC, &pAC->RxPort[i]);
3180 SkGePollTxD(pAC, pAC->IoBase, i, SK_TRUE);
3181 FillRxRing(pAC, &pAC->RxPort[i]);
3184 SkGeYellowLED(pAC, pAC->IoBase, 1);
3185 SkDimEnableModerationIfNeeded(pAC);
3186 SkDimDisplayModerationSettings(pAC);
3188 netif_start_queue(pAC->dev[pNet->PortNr]);
3189 for (i=pAC->GIni.GIMacsFound-1; i>=0; i--) {
3190 spin_unlock(&pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock);
3196 SK_OUT32(pAC->IoBase, B0_IMSK, pAC->GIni.GIValIrqMask);
3197 SK_OUT32(pAC->IoBase, B0_HWE_IMSK, IRQ_HWE_MASK);
3199 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
3200 SkEventDispatcher(pAC, pAC->IoBase);
3205 if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) {
3206 EvPara.Para32[0] = pAC->RlmtNets;
3208 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_SET_NETS, EvPara);
3211 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
3215 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
3218 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
3221 SkEventDispatcher(pAC, pAC->IoBase);
3222 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
3255 SK_AC *pAC = pNet->pAC; local
3264 pPnmiStruct = &pAC->PnmiStruct;
3267 if ((pAC->DiagModeActive == DIAG_NOTACTIVE) &&
3268 (pAC->BoardLevel == SK_INIT_RUN)) {
3271 spin_lock_irqsave(&pAC->SlowPathLock, Flags);
3273 SkPnmiGetStruct(pAC, pAC->IoBase, pPnmiStruct, &Size, pNet->NetNr);
3274 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
3282 pAC->stats.rx_packets = (SK_U32) pPnmiStruct->RxDeliveredCts & 0xFFFFFFFF;
3283 pAC->stats.tx_packets = (SK_U32) pPnmiStat->StatTxOkCts & 0xFFFFFFFF;
3284 pAC->stats.rx_bytes = (SK_U32) pPnmiStruct->RxOctetsDeliveredCts;
3285 pAC->stats.tx_bytes = (SK_U32) pPnmiStat->StatTxOctetsOkCts;
3288 pAC->stats.rx_errors = (SK_U32) pPnmiStruct->InErrorsCts & 0xFFFFFFFF;
3290 pAC->stats.rx_errors = (SK_U32) ((pPnmiStruct->InErrorsCts -
3295 if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC && pAC->HWRevision < 12)
3296 pAC->stats.rx_errors = pAC->stats.rx_errors - pPnmiStat->StatRxShortsCts;
3298 pAC->stats.tx_errors = (SK_U32) pPnmiStat->StatTxSingleCollisionCts & 0xFFFFFFFF;
3299 pAC->stats.rx_dropped = (SK_U32) pPnmiStruct->RxNoBufCts & 0xFFFFFFFF;
3300 pAC->stats.tx_dropped = (SK_U32) pPnmiStruct->TxNoBufCts & 0xFFFFFFFF;
3301 pAC->stats.multicast = (SK_U32) pPnmiStat->StatRxMulticastOkCts & 0xFFFFFFFF;
3302 pAC->stats.collisions = (SK_U32) pPnmiStat->StatTxSingleCollisionCts & 0xFFFFFFFF;
3305 pAC->stats.rx_length_errors = (SK_U32) pPnmiStat->StatRxRuntCts & 0xFFFFFFFF;
3306 pAC->stats.rx_over_errors = (SK_U32) pPnmiStat->StatRxFifoOverflowCts & 0xFFFFFFFF;
3307 pAC->stats.rx_crc_errors = (SK_U32) pPnmiStat->StatRxFcsCts & 0xFFFFFFFF;
3308 pAC->stats.rx_frame_errors = (SK_U32) pPnmiStat->StatRxFramingCts & 0xFFFFFFFF;
3309 pAC->stats.rx_fifo_errors = (SK_U32) pPnmiStat->StatRxFifoOverflowCts & 0xFFFFFFFF;
3310 pAC->stats.rx_missed_errors = (SK_U32) pPnmiStat->StatRxMissedCts & 0xFFFFFFFF;
3313 pAC->stats.tx_aborted_errors = (SK_U32) 0;
3314 pAC->stats.tx_carrier_errors = (SK_U32) pPnmiStat->StatTxCarrierCts & 0xFFFFFFFF;
3315 pAC->stats.tx_fifo_errors = (SK_U32) pPnmiStat->StatTxFifoUnderrunCts & 0xFFFFFFFF;
3316 pAC->stats.tx_heartbeat_errors = (SK_U32) pPnmiStat->StatTxCarrierCts & 0xFFFFFFFF;
3317 pAC->stats.tx_window_errors = (SK_U32) 0;
3319 return(&pAC->stats);
3339 SK_AC *pAC; local
3353 pAC = pNet->pAC;
3364 if(copy_from_user(&pAC->PnmiStruct, Ioctl.pData,
3365 Ioctl.Len<sizeof(pAC->PnmiStruct)?
3366 Ioctl.Len : sizeof(pAC->PnmiStruct))) {
3370 if(copy_to_user(Ioctl.pData, &pAC->PnmiStruct,
3380 if (Ioctl.Len < (sizeof(pAC->PnmiStruct) + HeaderLength)) {
3383 Length = sizeof(pAC->PnmiStruct) + HeaderLength;
3392 if ((Ret = SkPnmiGenIoctl(pAC, pAC->IoBase, pMemBuf, &Length, 0)) < 0) {
3411 if (Ioctl.Len < (sizeof(pAC->PnmiStruct) + HeaderLength)) {
3414 Length = sizeof(pAC->PnmiStruct) + HeaderLength;
3423 pdev = pAC->PciDev;
3479 SK_AC *pAC; local
3483 pAC = pNet->pAC;
3485 spin_lock_irqsave(&pAC->SlowPathLock, Flags);
3488 SkPnmiGetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size,
3492 SkPnmiPreSetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size,
3496 SkPnmiSetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size,
3502 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
3521 SK_AC *pAC) /* pointer to the adapter context structure */ argument
3560 #define M_CurrPort pAC->GIni.GP[Port]
3594 (pAC->Index < SK_MAX_CARD_PARAM) &&
3595 (ConType[pAC->Index] != NULL) ) {
3598 if ((!pAC->ChipsetType) &&
3599 (strcmp(ConType[pAC->Index],"Auto")!=0) &&
3600 (strcmp(ConType[pAC->Index],"")!=0)) {
3605 ConType[pAC->Index]);
3607 sprintf(ConType[pAC->Index], "Auto");
3610 if (strcmp(ConType[pAC->Index],"")==0) {
3612 } else if (strcmp(ConType[pAC->Index],"Auto")==0) {
3619 } else if (strcmp(ConType[pAC->Index],"100FD")==0) {
3626 } else if (strcmp(ConType[pAC->Index],"100HD")==0) {
3633 } else if (strcmp(ConType[pAC->Index],"10FD")==0) {
3640 } else if (strcmp(ConType[pAC->Index],"10HD")==0) {
3649 ConType[pAC->Index]);
3660 if (Speed_A != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
3661 Speed_A[pAC->Index] != NULL) {
3662 if (strcmp(Speed_A[pAC->Index],"")==0) {
3664 } else if (strcmp(Speed_A[pAC->Index],"Auto")==0) {
3666 } else if (strcmp(Speed_A[pAC->Index],"10")==0) {
3668 } else if (strcmp(Speed_A[pAC->Index],"100")==0) {
3670 } else if (strcmp(Speed_A[pAC->Index],"1000")==0) {
3674 Speed_A[pAC->Index]);
3685 if (((!pAC->ChipsetType) || (pAC->GIni.GICopperType != SK_TRUE)) &&
3699 pAC->GIni.GP[0].PLinkSpeed = LinkSpeed;
3708 if (AutoNeg_A != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
3709 AutoNeg_A[pAC->Index] != NULL) {
3711 if (strcmp(AutoNeg_A[pAC->Index],"")==0) {
3713 } else if (strcmp(AutoNeg_A[pAC->Index],"On")==0) {
3715 } else if (strcmp(AutoNeg_A[pAC->Index],"Off")==0) {
3717 } else if (strcmp(AutoNeg_A[pAC->Index],"Sense")==0) {
3721 AutoNeg_A[pAC->Index]);
3727 if (DupCap_A != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
3728 DupCap_A[pAC->Index] != NULL) {
3730 if (strcmp(DupCap_A[pAC->Index],"")==0) {
3732 } else if (strcmp(DupCap_A[pAC->Index],"Both")==0) {
3734 } else if (strcmp(DupCap_A[pAC->Index],"Full")==0) {
3736 } else if (strcmp(DupCap_A[pAC->Index],"Half")==0) {
3740 DupCap_A[pAC->Index]);
3750 (pAC->ChipsetType)) {
3783 pAC->GIni.GP[0].PLinkModeConf = Capabilities[AutoNeg][DuplexCap];
3789 if (FlowCtrl_A != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
3790 FlowCtrl_A[pAC->Index] != NULL) {
3791 if (strcmp(FlowCtrl_A[pAC->Index],"") == 0) {
3793 } else if (strcmp(FlowCtrl_A[pAC->Index],"SymOrRem") == 0) {
3795 } else if (strcmp(FlowCtrl_A[pAC->Index],"Sym")==0) {
3797 } else if (strcmp(FlowCtrl_A[pAC->Index],"LocSend")==0) {
3799 } else if (strcmp(FlowCtrl_A[pAC->Index],"None")==0) {
3803 FlowCtrl_A[pAC->Index]);
3817 pAC->GIni.GP[0].PFlowCtrlMode = FlowCtrl;
3823 if (Role_A != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
3824 Role_A[pAC->Index] != NULL) {
3825 if (strcmp(Role_A[pAC->Index],"")==0) {
3827 } else if (strcmp(Role_A[pAC->Index],"Auto")==0) {
3829 } else if (strcmp(Role_A[pAC->Index],"Master")==0) {
3831 } else if (strcmp(Role_A[pAC->Index],"Slave")==0) {
3835 Role_A[pAC->Index]);
3843 pAC->GIni.GP[0].PMSMode = MSMode;
3857 if (Speed_B != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
3858 Speed_B[pAC->Index] != NULL) {
3859 if (strcmp(Speed_B[pAC->Index],"")==0) {
3861 } else if (strcmp(Speed_B[pAC->Index],"Auto")==0) {
3863 } else if (strcmp(Speed_B[pAC->Index],"10")==0) {
3865 } else if (strcmp(Speed_B[pAC->Index],"100")==0) {
3867 } else if (strcmp(Speed_B[pAC->Index],"1000")==0) {
3871 Speed_B[pAC->Index]);
3882 if (((!pAC->ChipsetType) || (pAC->GIni.GICopperType != SK_TRUE)) &&
3896 pAC->GIni.GP[1].PLinkSpeed = LinkSpeed;
3905 if (AutoNeg_B != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
3906 AutoNeg_B[pAC->Index] != NULL) {
3908 if (strcmp(AutoNeg_B[pAC->Index],"")==0) {
3910 } else if (strcmp(AutoNeg_B[pAC->Index],"On")==0) {
3912 } else if (strcmp(AutoNeg_B[pAC->Index],"Off")==0) {
3914 } else if (strcmp(AutoNeg_B[pAC->Index],"Sense")==0) {
3918 AutoNeg_B[pAC->Index]);
3924 if (DupCap_B != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
3925 DupCap_B[pAC->Index] != NULL) {
3927 if (strcmp(DupCap_B[pAC->Index],"")==0) {
3929 } else if (strcmp(DupCap_B[pAC->Index],"Both")==0) {
3931 } else if (strcmp(DupCap_B[pAC->Index],"Full")==0) {
3933 } else if (strcmp(DupCap_B[pAC->Index],"Half")==0) {
3937 DupCap_B[pAC->Index]);
3948 (pAC->ChipsetType)) {
3981 pAC->GIni.GP[1].PLinkModeConf = Capabilities[AutoNeg][DuplexCap];
3987 if (FlowCtrl_B != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
3988 FlowCtrl_B[pAC->Index] != NULL) {
3989 if (strcmp(FlowCtrl_B[pAC->Index],"") == 0) {
3991 } else if (strcmp(FlowCtrl_B[pAC->Index],"SymOrRem") == 0) {
3993 } else if (strcmp(FlowCtrl_B[pAC->Index],"Sym")==0) {
3995 } else if (strcmp(FlowCtrl_B[pAC->Index],"LocSend")==0) {
3997 } else if (strcmp(FlowCtrl_B[pAC->Index],"None")==0) {
4001 FlowCtrl_B[pAC->Index]);
4015 pAC->GIni.GP[1].PFlowCtrlMode = FlowCtrl;
4021 if (Role_B != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
4022 Role_B[pAC->Index] != NULL) {
4023 if (strcmp(Role_B[pAC->Index],"")==0) {
4025 } else if (strcmp(Role_B[pAC->Index],"Auto")==0) {
4027 } else if (strcmp(Role_B[pAC->Index],"Master")==0) {
4029 } else if (strcmp(Role_B[pAC->Index],"Slave")==0) {
4033 Role_B[pAC->Index]);
4041 pAC->GIni.GP[1].PMSMode = MSMode;
4047 pAC->ActivePort = 0;
4048 if (PrefPort != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
4049 PrefPort[pAC->Index] != NULL) {
4050 if (strcmp(PrefPort[pAC->Index],"") == 0) { /* Auto */
4051 pAC->ActivePort = 0;
4052 pAC->Rlmt.Net[0].Preference = -1; /* auto */
4053 pAC->Rlmt.Net[0].PrefPort = 0;
4054 } else if (strcmp(PrefPort[pAC->Index],"A") == 0) {
4060 pAC->Rlmt.Net[0].Preference = Port;
4061 pAC->Rlmt.Net[0].PrefPort = Port;
4062 } else if (strcmp(PrefPort[pAC->Index],"B") == 0) {
4067 if (pAC->GIni.GIMacsFound == 1) {
4071 pAC->ActivePort = 0;
4072 pAC->Rlmt.Net[0].Preference = -1; /* auto */
4073 pAC->Rlmt.Net[0].PrefPort = 0;
4076 pAC->Rlmt.Net[0].Preference = Port;
4077 pAC->Rlmt.Net[0].PrefPort = Port;
4081 PrefPort[pAC->Index]);
4085 pAC->RlmtNets = 1;
4087 if (RlmtMode != NULL && pAC->Index<SK_MAX_CARD_PARAM &&
4088 RlmtMode[pAC->Index] != NULL) {
4089 if (strcmp(RlmtMode[pAC->Index], "") == 0) {
4090 pAC->RlmtMode = 0;
4091 } else if (strcmp(RlmtMode[pAC->Index], "CheckLinkState") == 0) {
4092 pAC->RlmtMode = SK_RLMT_CHECK_LINK;
4093 } else if (strcmp(RlmtMode[pAC->Index], "CheckLocalPort") == 0) {
4094 pAC->RlmtMode = SK_RLMT_CHECK_LINK |
4096 } else if (strcmp(RlmtMode[pAC->Index], "CheckSeg") == 0) {
4097 pAC->RlmtMode = SK_RLMT_CHECK_LINK |
4100 } else if ((strcmp(RlmtMode[pAC->Index], "DualNet") == 0) &&
4101 (pAC->GIni.GIMacsFound == 2)) {
4102 pAC->RlmtMode = SK_RLMT_CHECK_LINK;
4103 pAC->RlmtNets = 2;
4107 RlmtMode[pAC->Index]);
4108 pAC->RlmtMode = 0;
4111 pAC->RlmtMode = 0;
4117 if (Moderation[pAC->Index] != NULL) {
4118 if (strcmp(Moderation[pAC->Index], "") == 0) {
4119 pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_NONE;
4120 } else if (strcmp(Moderation[pAC->Index], "Static") == 0) {
4121 pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_STATIC;
4122 } else if (strcmp(Moderation[pAC->Index], "Dynamic") == 0) {
4123 pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_DYNAMIC;
4124 } else if (strcmp(Moderation[pAC->Index], "None") == 0) {
4125 pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_NONE;
4129 Moderation[pAC->Index]);
4130 pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_NONE;
4133 pAC->DynIrqModInfo.IntModTypeSelect = C_INT_MOD_NONE;
4136 if (Stats[pAC->Index] != NULL) {
4137 if (strcmp(Stats[pAC->Index], "Yes") == 0) {
4138 pAC->DynIrqModInfo.DisplayStats = SK_TRUE;
4140 pAC->DynIrqModInfo.DisplayStats = SK_FALSE;
4143 pAC->DynIrqModInfo.DisplayStats = SK_FALSE;
4146 if (ModerationMask[pAC->Index] != NULL) {
4147 if (strcmp(ModerationMask[pAC->Index], "Rx") == 0) {
4148 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_ONLY;
4149 } else if (strcmp(ModerationMask[pAC->Index], "Tx") == 0) {
4150 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_ONLY;
4151 } else if (strcmp(ModerationMask[pAC->Index], "Sp") == 0) {
4152 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_ONLY;
4153 } else if (strcmp(ModerationMask[pAC->Index], "RxSp") == 0) {
4154 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_RX;
4155 } else if (strcmp(ModerationMask[pAC->Index], "SpRx") == 0) {
4156 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_RX;
4157 } else if (strcmp(ModerationMask[pAC->Index], "RxTx") == 0) {
4158 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_RX;
4159 } else if (strcmp(ModerationMask[pAC->Index], "TxRx") == 0) {
4160 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_RX;
4161 } else if (strcmp(ModerationMask[pAC->Index], "TxSp") == 0) {
4162 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_TX;
4163 } else if (strcmp(ModerationMask[pAC->Index], "SpTx") == 0) {
4164 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_SP_TX;
4165 } else if (strcmp(ModerationMask[pAC->Index], "RxTxSp") == 0) {
4166 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
4167 } else if (strcmp(ModerationMask[pAC->Index], "RxSpTx") == 0) {
4168 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
4169 } else if (strcmp(ModerationMask[pAC->Index], "TxRxSp") == 0) {
4170 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
4171 } else if (strcmp(ModerationMask[pAC->Index], "TxSpRx") == 0) {
4172 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
4173 } else if (strcmp(ModerationMask[pAC->Index], "SpTxRx") == 0) {
4174 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
4175 } else if (strcmp(ModerationMask[pAC->Index], "SpRxTx") == 0) {
4176 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_TX_SP;
4178 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_RX_ONLY;
4181 pAC->DynIrqModInfo.MaskIrqModeration = IRQ_MASK_TX_RX;
4184 if (AutoSizing[pAC->Index] != NULL) {
4185 if (strcmp(AutoSizing[pAC->Index], "On") == 0) {
4186 pAC->DynIrqModInfo.AutoSizing = SK_FALSE;
4188 pAC->DynIrqModInfo.AutoSizing = SK_FALSE;
4191 pAC->DynIrqModInfo.AutoSizing = SK_FALSE;
4194 if (IntsPerSec[pAC->Index] != 0) {
4195 if ((IntsPerSec[pAC->Index]< C_INT_MOD_IPS_LOWER_RANGE) ||
4196 (IntsPerSec[pAC->Index] > C_INT_MOD_IPS_UPPER_RANGE)) {
4199 IntsPerSec[pAC->Index],
4203 pAC->DynIrqModInfo.MaxModIntsPerSec = C_INTS_PER_SEC_DEFAULT;
4205 pAC->DynIrqModInfo.MaxModIntsPerSec = IntsPerSec[pAC->Index];
4208 pAC->DynIrqModInfo.MaxModIntsPerSec = C_INTS_PER_SEC_DEFAULT;
4214 pAC->DynIrqModInfo.MaxModIntsPerSecUpperLimit =
4215 pAC->DynIrqModInfo.MaxModIntsPerSec +
4216 (pAC->DynIrqModInfo.MaxModIntsPerSec / 2);
4218 pAC->DynIrqModInfo.MaxModIntsPerSecLowerLimit =
4219 pAC->DynIrqModInfo.MaxModIntsPerSec -
4220 (pAC->DynIrqModInfo.MaxModIntsPerSec / 2);
4222 pAC->DynIrqModInfo.PrevTimeVal = jiffies; /* initial value */
4239 SK_AC *pAC /* pointer to adapter context */ argument
4247 spin_lock_irqsave(&pAC->SlowPathLock, Flags);
4248 ReturnCode = VpdRead(pAC, pAC->IoBase, Keyword, pAC->DeviceStr,
4250 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
4255 pAC->DeviceStr[0] = '\0';
4272 StartDrvCleanupTimer(SK_AC *pAC) { argument
4277 SkTimerStart(pAC, pAC->IoBase, &pAC->DrvCleanupTimer,
4293 StopDrvCleanupTimer(SK_AC *pAC) { argument
4294 SkTimerStop(pAC, pAC->IoBase, &pAC->DrvCleanupTimer);
4295 SK_MEMSET((char *) &pAC->DrvCleanupTimer, 0, sizeof(SK_TIMER));
4318 SK_AC *pAC, /* pointer to adapter context */ argument
4355 SK_AC *pAC, /* pointer to adapter context */ argument
4383 SK_U64 SkOsGetTime(SK_AC *pAC) argument
4386 SkOsGetTimeCurrent(pAC, &PrivateJiffies);
4404 SK_AC *pAC, /* Adapter Control structure pointer */ argument
4408 pci_read_config_dword(pAC->PciDev, PciAddr, pVal);
4426 SK_AC *pAC, /* Adapter Control structure pointer */ argument
4430 pci_read_config_word(pAC->PciDev, PciAddr, pVal);
4448 SK_AC *pAC, /* Adapter Control structure pointer */ argument
4452 pci_read_config_byte(pAC->PciDev, PciAddr, pVal);
4470 SK_AC *pAC, /* Adapter Control structure pointer */ argument
4474 pci_write_config_dword(pAC->PciDev, PciAddr, Val);
4493 SK_AC *pAC, /* Adapter Control structure pointer */ argument
4497 pci_write_config_word(pAC->PciDev, PciAddr, Val);
4516 SK_AC *pAC, /* Adapter Control structure pointer */ argument
4520 pci_write_config_byte(pAC->PciDev, PciAddr, Val);
4541 SK_AC *pAC, /* pointer to adapter context */ argument
4559 printk("%s: Adapter failed.\n", pAC->dev[0]->name);
4561 SK_OUT32(pAC->IoBase, B0_IMSK, 0);
4569 printk("%s: Port A failed.\n", pAC->dev[0]->name);
4571 printk("%s: Port B failed.\n", pAC->dev[1]->name);
4581 SkPnmiEvent(pAC, IoC, SK_PNMI_EVT_XMAC_RESET, NewPara);
4583 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
4586 SkGeStopPort(pAC, IoC, FromPort, SK_STOP_ALL, SK_HARD_RST);
4587 pAC->dev[Param.Para32[0]]->flags &= ~IFF_RUNNING;
4589 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
4593 ReceiveIrq(pAC, &pAC->RxPort[FromPort], SK_FALSE);
4595 ClearTxRing(pAC, &pAC->TxPort[FromPort][TX_PRIO_LOW]);
4597 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
4601 if (SkGeInitPort(pAC, IoC, FromPort)) {
4603 printk("%s: SkGeInitPort A failed.\n", pAC->dev[0]->name);
4605 printk("%s: SkGeInitPort B failed.\n", pAC->dev[1]->name);
4608 SkAddrMcUpdate(pAC,IoC, FromPort);
4609 PortReInitBmu(pAC, FromPort);
4610 SkGePollTxD(pAC, IoC, FromPort, SK_TRUE);
4611 ClearAndStartRx(pAC, FromPort);
4613 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
4622 SkAddrMcUpdate(pAC,IoC, FromPort);
4626 " port %c\n", pAC->dev[Param.Para32[0]]->name, 'A'+Param.Para32[0]);
4629 Stat = pAC->GIni.GP[FromPort].PLinkSpeedUsed;
4641 Stat = pAC->GIni.GP[FromPort].PLinkModeStatus;
4656 Stat = pAC->GIni.GP[FromPort].PFlowCtrlStatus;
4671 if ((pAC->GIni.GICopperType == SK_TRUE) &&
4672 (pAC->GIni.GP[FromPort].PLinkSpeedUsed ==
4674 Stat = pAC->GIni.GP[FromPort].PMSStatus;
4690 if (pAC->DynIrqModInfo.IntModTypeSelect == C_INT_MOD_STATIC)
4692 pAC->DynIrqModInfo.MaxModIntsPerSec);
4693 else if (pAC->DynIrqModInfo.IntModTypeSelect == C_INT_MOD_DYNAMIC)
4695 pAC->DynIrqModInfo.MaxModIntsPerSec);
4701 if (pAC->ChipsetType)
4721 if ((Param.Para32[0] != pAC->ActivePort) &&
4722 (pAC->RlmtNets == 1)) {
4723 NewPara.Para32[0] = pAC->ActivePort;
4725 SkEventQueue(pAC, SKGE_DRV, SK_DRV_SWITCH_INTERN,
4730 pAC->dev[Param.Para32[0]]->flags |= IFF_RUNNING;
4739 pAC->dev[Param.Para32[1]]->name);
4743 pAC->dev[Param.Para32[1]]->flags &= ~IFF_RUNNING;
4750 printk("%s: switching to port %c\n", pAC->dev[0]->name,
4757 FromPort, ToPort, pAC->Rlmt.Net[0].PrefPort));
4759 SkPnmiEvent(pAC, IoC, SK_PNMI_EVT_XMAC_RESET, NewPara);
4761 SkPnmiEvent(pAC, IoC, SK_PNMI_EVT_XMAC_RESET, NewPara);
4763 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
4766 &pAC->TxPort[ToPort][TX_PRIO_LOW].TxDesRingLock, Flags);
4767 SkGeStopPort(pAC, IoC, FromPort, SK_STOP_ALL, SK_SOFT_RST);
4768 SkGeStopPort(pAC, IoC, ToPort, SK_STOP_ALL, SK_SOFT_RST);
4770 &pAC->TxPort[ToPort][TX_PRIO_LOW].TxDesRingLock, Flags);
4772 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
4775 ReceiveIrq(pAC, &pAC->RxPort[FromPort], SK_FALSE); /* clears rx ring */
4776 ReceiveIrq(pAC, &pAC->RxPort[ToPort], SK_FALSE); /* clears rx ring */
4778 ClearTxRing(pAC, &pAC->TxPort[FromPort][TX_PRIO_LOW]);
4779 ClearTxRing(pAC, &pAC->TxPort[ToPort][TX_PRIO_LOW]);
4781 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
4784 &pAC->TxPort[ToPort][TX_PRIO_LOW].TxDesRingLock, Flags);
4785 pAC->ActivePort = ToPort;
4787 SetQueueSizes(pAC);
4791 if (pAC->RlmtNets == 2) {
4796 pAC,
4797 pAC->ActivePort,
4800 &pAC->TxPort[ToPort][TX_PRIO_LOW].TxDesRingLock, Flags);
4802 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
4809 if (SkGeInitPort(pAC, IoC, FromPort) ||
4810 SkGeInitPort(pAC, IoC, ToPort)) {
4811 printk("%s: SkGeInitPort failed.\n", pAC->dev[0]->name);
4814 SkMacRxTxEnable(pAC, IoC, FromPort);
4816 SkMacRxTxEnable(pAC, IoC, ToPort);
4817 SkAddrSwap(pAC, IoC, FromPort, ToPort);
4818 SkAddrMcUpdate(pAC, IoC, FromPort);
4819 SkAddrMcUpdate(pAC, IoC, ToPort);
4820 PortReInitBmu(pAC, FromPort);
4821 PortReInitBmu(pAC, ToPort);
4822 SkGePollTxD(pAC, IoC, FromPort, SK_TRUE);
4823 SkGePollTxD(pAC, IoC, ToPort, SK_TRUE);
4824 ClearAndStartRx(pAC, FromPort);
4825 ClearAndStartRx(pAC, ToPort);
4827 &pAC->TxPort[ToPort][TX_PRIO_LOW].TxDesRingLock, Flags);
4829 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
4838 if (XmitFrame(pAC, &pAC->TxPort[pRlmtMbuf->PortIdx][TX_PRIO_LOW],
4849 SkDimStartModerationTimer(pAC);
4850 SkDimModerate(pAC);
4851 if (pAC->DynIrqModInfo.DisplayStats) {
4852 SkDimDisplayModerationSettings(pAC);
4859 StartDrvCleanupTimer(pAC);
4860 if (pAC->GIni.GIMacsFound == 2) {
4861 ReceiveIrq(pAC, &pAC->RxPort[1], SK_FALSE);
4863 ReceiveIrq(pAC, &pAC->RxPort[0], SK_FALSE);
4891 SK_AC *pAC, argument
4922 " Nr: 0x%x\n Msg: %s\n", pAC->dev[0]->name,
4943 SK_AC *pAC = NULL; local
4947 pAC = pNet->pAC;
4952 pAC->DiagModeActive = DIAG_ACTIVE;
4953 if (pAC->BoardLevel > SK_INIT_DATA) {
4955 pAC->WasIfUp[0] = SK_TRUE;
4956 pAC->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */
4958 SkDrvDeInitAdapter(pAC, 0); /* performs SkGeClose */
4960 pAC->WasIfUp[0] = SK_FALSE;
4965 pAC->WasIfUp[1] = SK_TRUE;
4966 pAC->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */
4968 SkDrvDeInitAdapter(pAC, 1); /* do SkGeClose */
4970 pAC->WasIfUp[1] = SK_FALSE;
4973 pAC->BoardLevel = SK_INIT_DATA;
5078 SK_AC *pAC, /* pointer to adapter context */ argument
5083 dev = pAC->dev[devNbr];
5116 SK_AC *pAC, /* pointer to adapter context */ argument
5121 dev = pAC->dev[devNbr];