Changeset 2867 in vbox
- Timestamp:
- May 25, 2007 11:51:53 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r2777 r2867 1629 1629 PPDMDEVINS pDevIns = PCNETSTATE_2_DEVINS(pData); 1630 1630 int is_padr = 0, is_bcast = 0, is_ladr = 0; 1631 unsigned i; 1632 int pkt_size; 1631 1633 1632 1634 if (RT_UNLIKELY(CSR_DRX(pData) || CSR_STOP(pData) || CSR_SPND(pData) || !size)) … … 1656 1658 const unsigned cb = 1 << pData->iLog2DescSize; 1657 1659 RTGCPHYS GCPhys = pData->GCRDRA; 1658 unsignedi = CSR_RCVRL(pData);1660 i = CSR_RCVRL(pData); 1659 1661 while (i-- > 0) 1660 1662 { … … 1688 1690 } 1689 1691 size += 4; 1692 pkt_size = size; 1690 1693 1691 1694 #ifdef PCNET_DEBUG_MATCH … … 1702 1705 src += count; 1703 1706 size -= count; 1704 rmd.rmd2.mcnt = count;1705 1707 pktcount++; 1706 if (size > 0) 1708 1709 /* Read current receive descriptor index */ 1710 i = CSR_RCVRC(pData); 1711 1712 while (size > 0) 1707 1713 { 1708 if (HOST_IS_OWNER(CSR_NRST(pData))) 1709 { 1710 /* From the manual: ``Regardless of ownership of the second receive 1711 * descriptor, the Am79C972 controller will continue to perform receive 1712 * data DMA transfers to the first buffer. If the frame length exceeds 1713 * the length of the first buffer, and the Am79C972 controller does not 1714 * own the second buffer, ownership of the current descriptor will be 1715 * passed back to the system by writing a 0 to the OWN bit of RMD1. 1716 * Status will be written indicating buffer (BUFF = 1) and possibly 1717 * overflow (OFLO = 1) errors. 1718 * If the frame length exceeds the length of the first (current) buffer, 1719 * and the Am79C972 controller does own the second (next) buffer, 1720 * ownership will be passed back to the system by writing a 0 to the OWN 1721 * bit of RMD1 when the first buffer is full. The OWN bit is the only bit 1722 * modified in the descriptor. Receive data transfers to the second buffer 1723 * may occur before the Am79C972 controller proceeds to look ahead to the 1724 * ownership of the third buffer. Such action will depend upon the state 1725 * of the FIFO when the OWN bit has been updated in the first descriptor. 1726 * In any case, lookahead will be performed to the third buffer and the 1727 * information gathered will be stored in the chip, regardless of the state 1728 * of the ownership bit.'' */ 1729 pcnetRdtePoll(pData, true); 1730 } 1731 if (CARD_IS_OWNER(CSR_NRST(pData))) 1732 { 1733 /* write back, clear the own bit */ 1734 pcnetRmdStorePassHost(pData, &rmd, PHYSADDR(pData, crda)); 1735 crda = CSR_NRDA(pData); 1736 pcnetRmdLoad(pData, &rmd, PHYSADDR(pData, crda)); 1737 count = RT_MIN(4096 - (int)rmd.rmd1.bcnt, size); 1738 rbadr = PHYSADDR(pData, rmd.rmd0.rbadr); 1739 PDMDevHlpPhysWrite(pDevIns, rbadr, src, count); 1740 src += count; 1741 size -= count; 1742 rmd.rmd2.mcnt = count; 1743 pktcount++; 1744 } 1714 /* write back, clear the own bit */ 1715 pcnetRmdStorePassHost(pData, &rmd, PHYSADDR(pData, crda)); 1716 1717 /* Read the entire next descriptor as we're likely to need it. */ 1718 if (--i < 1) 1719 i = CSR_RCVRL(pData); 1720 crda = pcnetRdraAddr(pData, i); 1721 pcnetRmdLoad(pData, &rmd, PHYSADDR(pData, crda)); 1722 1723 if (!rmd.rmd1.own) 1724 break; /* Error - not enough buffer space available. */ 1725 1726 count = RT_MIN(4096 - (int)rmd.rmd1.bcnt, size); 1727 rbadr = PHYSADDR(pData, rmd.rmd0.rbadr); 1728 PDMDevHlpPhysWrite(pDevIns, rbadr, src, count); 1729 src += count; 1730 size -= count; 1731 pktcount++; 1745 1732 } 1746 1733 … … 1751 1738 rmd.rmd1.lafm = !CSR_PROM(pData) && is_ladr; 1752 1739 rmd.rmd1.bam = !CSR_PROM(pData) && is_bcast; 1740 rmd.rmd2.mcnt = pkt_size; 1753 1741 } 1754 1742 else
Note:
See TracChangeset
for help on using the changeset viewer.

