Changeset 564 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Feb 2, 2007 5:06:00 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r550 r564 67 67 #include <iprt/string.h> 68 68 #include <iprt/time.h> 69 #ifdef IN_RING3 70 #include <iprt/mem.h> 71 #endif 69 72 70 73 #include "Builtins.h" … … 1778 1781 { 1779 1782 PCNetState *pData = PDMINS2DATA(pDevIns, PCNetState *); 1780 unsigned i;1781 1783 int rc; 1782 1784 … … 1788 1790 1789 1791 pData->fTransmitting = true; 1790 for (i = 0; i < pData->iFrame; i++) 1792 1793 #ifdef PCNET_SEND_MULTIPLE_PACKETS 1794 if (pData->iFrame) 1795 { 1796 if (pData->iFrame > 1) 1797 { 1798 PPDMINETWORKPACKET paPacket = (PPDMINETWORKPACKET)RTMemTmpAlloc(sizeof(PDMINETWORKPACKET)*pData->iFrame); 1799 unsigned i; 1800 1801 Assert(paPacket); 1802 if (paPacket) 1803 { 1804 for (i = 0; i < pData->iFrame; i++) 1805 { 1806 paPacket[i].pvBuf = pData->aFrames[i].pvR3 != NIL_RTR3PTR 1807 ? pData->aFrames[i].pvR3 1808 : &pData->abFrameBuf[pData->aFrames[i].off]; 1809 paPacket[i].cb = pData->aFrames[i].cb; 1810 1811 if (pData->aFrames[i].cb > 70) /* unqualified guess */ 1812 pData->Led.Asserted.s.fWriting = pData->Led.Actual.s.fWriting = 1; 1813 } 1814 1815 if (pcnetIsLinkUp(pData)) 1816 pData->pDrv->pfnSendEx(pData->pDrv, pData->iFrame, paPacket); 1817 1818 RTMemTmpFree(paPacket); 1819 } 1820 } 1821 else 1822 { 1823 RTR3PTR pv = pData->aFrames[0].pvR3 != NIL_RTR3PTR 1824 ? pData->aFrames[0].pvR3 1825 : &pData->abFrameBuf[pData->aFrames[0].off]; 1826 if (pData->aFrames[0].cb > 70) /* unqualified guess */ 1827 pData->Led.Asserted.s.fWriting = pData->Led.Actual.s.fWriting = 1; 1828 if (pcnetIsLinkUp(pData)) 1829 { 1830 pData->pDrv->pfnSend(pData->pDrv, pv, pData->aFrames[0].cb); 1831 LOG_PACKET("xmit", pv, pData->aFrames[0].cb); 1832 } 1833 } 1834 1835 #ifdef PCNET_DELAY_INT 1836 /* Update TXSTRT and TINT. */ 1837 pData->aCSR[4] |= 0x0004; /* set TXSTRT */ 1838 pData->aCSR[0] |= 0x0200; /* set TINT */ 1839 pcnetUpdateIrq(pData); 1840 #endif 1841 } 1842 1843 #else /* PCNET_SEND_MULTIPLE_PACKETS */ 1844 1845 for (unsigned i = 0; i < pData->iFrame; i++) 1791 1846 { 1792 1847 RTR3PTR pv = pData->aFrames[i].pvR3 != NIL_RTR3PTR … … 1803 1858 1804 1859 #ifdef PCNET_DELAY_INT 1805 /* Update TXSTRT and TINT. */ 1806 pData->aCSR[4] |= 0x0004; /* set TXSTRT */ 1807 pData->aCSR[0] |= 0x0200; /* set TINT */ 1808 pcnetUpdateIrq(pData); 1809 #endif 1860 if (pData->iFrame) 1861 { 1862 /* Update TXSTRT and TINT. */ 1863 pData->aCSR[4] |= 0x0004; /* set TXSTRT */ 1864 pData->aCSR[0] |= 0x0200; /* set TINT */ 1865 pcnetUpdateIrq(pData); 1866 } 1867 #endif 1868 1869 #endif /* PCNET_SEND_MULTIPLE_PACKETS */ 1810 1870 1811 1871 pData->fTransmitting = false;
Note:
See TracChangeset
for help on using the changeset viewer.