Lines Matching defs:tmd

657 DECLINLINE(bool) pcnetTmdLoad(PPCNETSTATE pThis, TMD *tmd, RTGCPHYS32 addr, bool fRetIfNotOwn)
670 ((uint32_t *)tmd)[0] = (uint32_t)xda[0] | ((uint32_t)(xda[1] & 0x00ff) << 16);
671 ((uint32_t *)tmd)[1] = (uint32_t)xda[2] | ((uint32_t)(xda[1] & 0xff00) << 16);
672 ((uint32_t *)tmd)[2] = (uint32_t)xda[3] << 16;
673 ((uint32_t *)tmd)[3] = 0;
680 PDMDevHlpPhysRead(pDevIns, addr, (void*)tmd, 16);
689 ((uint32_t *)tmd)[0] = xda[2];
690 ((uint32_t *)tmd)[1] = xda[1];
691 ((uint32_t *)tmd)[2] = xda[0];
692 ((uint32_t *)tmd)[3] = xda[3];
696 if (tmd->tmd1.own == 1 && !(ownbyte & 0x80))
700 tmd->tmd1.own = 0;
702 return !!tmd->tmd1.own;
709 DECLINLINE(void) pcnetTmdStorePassHost(PPCNETSTATE pThis, TMD *tmd, RTGCPHYS32 addr)
716 xda[0] = ((uint32_t *)tmd)[0] & 0xffff;
717 xda[1] = ((((uint32_t *)tmd)[0] >> 16) & 0xff) | ((((uint32_t *)tmd)[1]>>16) & 0xff00);
718 xda[2] = ((uint32_t *)tmd)[1] & 0xffff;
719 xda[3] = ((uint32_t *)tmd)[2] >> 16;
727 ((uint32_t*)tmd)[1] |= 0x80000000;
728 PDMDevHlpPCIPhysWrite(pDevIns, addr, (void*)tmd, 16);
729 ((uint32_t*)tmd)[1] &= ~0x80000000;
730 PDMDevHlpPCIPhysWrite(pDevIns, addr+7, (uint8_t*)tmd + 7, 1);
735 xda[0] = ((uint32_t *)tmd)[2];
736 xda[1] = ((uint32_t *)tmd)[1];
737 xda[2] = ((uint32_t *)tmd)[0];
738 xda[3] = ((uint32_t *)tmd)[3];
1689 static int pcnetTdtePoll(PPCNETSTATE pThis, TMD *tmd)
1696 if (!pcnetTmdLoad(pThis, tmd, PHYSADDR(pThis, cxda), true))
1702 if (RT_UNLIKELY(tmd->tmd1.ones != 15))
1717 CSR_CXBC(pThis) = tmd->tmd1.bcnt;
1718 CSR_CXST(pThis) = ((uint32_t *)tmd)[1] >> 16;
1739 TMD tmd;
1754 if (!pcnetTmdLoad(pThis, &tmd, PHYSADDR(pThis, addrDesc), true))
1764 if (RT_UNLIKELY(tmd.tmd1.ones != 15))
1772 Log3(("#%d pcnetCalcPacketLen: got valid TMD, cb=%u\n", PCNET_INST_NR, 4096 - tmd.tmd1.bcnt));
1773 cbPacket += 4096 - tmd.tmd1.bcnt;
1774 } while (!tmd.tmd1.enp);
2305 TMD tmd;
2306 if (!pcnetTdtePoll(pThis, &tmd))
2365 TMD tmd;
2366 if (!pcnetTdtePoll(pThis, &tmd))
2377 PRINT_TMD(&tmd);
2386 if (tmd.tmd1.stp && tmd.tmd1.enp)
2388 const unsigned cb = 4096 - tmd.tmd1.bcnt;
2403 pcnetXmitRead1st(pThis, PHYSADDR(pThis, tmd.tmd0.tbadr), cb, pSgBuf);
2412 pcnetXmitFailTMDLinkDown(pThis, &tmd);
2428 pcnetTmdStorePassHost(pThis, &tmd, PHYSADDR(pThis, CSR_CXDA(pThis)));
2437 pcnetXmitFailTMDGeneric(pThis, &tmd);
2441 pcnetXmitFailTMDLinkDown(pThis, &tmd);
2444 pcnetTmdStorePassHost(pThis, &tmd, PHYSADDR(pThis, CSR_CXDA(pThis)));
2452 else if (tmd.tmd1.stp)
2463 unsigned cb = 4096 - tmd.tmd1.bcnt;
2473 pcnetXmitRead1st(pThis, PHYSADDR(pThis, tmd.tmd0.tbadr), cb, pSgBuf);
2478 * Advance the ring counter register and check the next tmd.
2495 tmd.tmd2.buff = tmd.tmd2.uflo = tmd.tmd1.err = 1;
2501 pcnetTmdStorePassHost(pThis, &tmd, GCPhysPrevTmd);
2507 /* release & save the previous tmd, pass it to the host */
2508 pcnetTmdStorePassHost(pThis, &tmd, GCPhysPrevTmd);
2511 * The next tmd.
2516 pcnetTmdLoad(pThis, &tmd, PHYSADDR(pThis, CSR_CXDA(pThis)), false);
2517 cb = 4096 - tmd.tmd1.bcnt;
2520 pcnetXmitReadMore(pThis, PHYSADDR(pThis, tmd.tmd0.tbadr), cb, pSgBuf);
2530 if (tmd.tmd1.enp)
2542 pcnetXmitFailTMDLinkDown(pThis, &tmd);
2545 pcnetTmdStorePassHost(pThis, &tmd, PHYSADDR(pThis, CSR_CXDA(pThis)));
2571 || (CSR_LTINTEN(pThis) && tmd.tmd1.ltint)
2572 || tmd.tmd1.err)
2577 /** @todo should we continue after an error (tmd.tmd1.err) or not? */
2705 TMD tmd;
2706 pcnetTmdLoad(pThis, &tmd, PHYSADDR(pThis, CSR_CXDA(pThis)), false);
2708 PRINT_TMD(&tmd);
4103 TMD tmd;
4104 pcnetTmdLoad(pThis, &tmd, PHYSADDR(pThis, GCPhys), false);
4111 tmd.tmd0.tbadr, 4096 - tmd.tmd1.bcnt,
4112 tmd.tmd2.tdr,
4113 tmd.tmd2.trc,
4114 tmd.tmd1.own,
4115 tmd.tmd1.err,
4116 tmd.tmd1.nofcs,
4117 tmd.tmd1.ltint,
4118 tmd.tmd1.one,
4119 tmd.tmd1.def,
4120 tmd.tmd1.stp,
4121 tmd.tmd1.enp,
4122 tmd.tmd1.bpe,
4123 tmd.tmd2.buff,
4124 tmd.tmd2.uflo,
4125 tmd.tmd2.exdef,
4126 tmd.tmd2.lcol,
4127 tmd.tmd2.lcar,
4128 tmd.tmd2.rtry,
4129 tmd.tmd2.tdr,
4130 tmd.tmd2.trc,
4131 tmd.tmd1.ones);