- Timestamp:
- Apr 1, 2008 4:04:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r7683 r7688 610 610 uint8_t *pv = (uint8_t*)pData->CTXSUFF(pSharedMMIO) 611 611 + (addr - pData->GCTDRA) 612 + pData->CTXSUFF(pSharedMMIO)->V.V1. u32OffTxDescriptors;612 + pData->CTXSUFF(pSharedMMIO)->V.V1.offTxDescriptors; 613 613 if (!(pv[7] & 0x80) && fRetIfNotOwn) 614 614 return false; … … 672 672 uint8_t *pv = (uint8_t*)pData->CTXSUFF(pSharedMMIO) 673 673 + (addr - pData->GCTDRA) 674 + pData->CTXSUFF(pSharedMMIO)->V.V1. u32OffTxDescriptors;674 + pData->CTXSUFF(pSharedMMIO)->V.V1.offTxDescriptors; 675 675 memcpy(pv, tmd, 16); 676 676 pv[7] &= ~0x80; … … 729 729 uint8_t *pb = (uint8_t*)pData->CTXSUFF(pSharedMMIO) 730 730 + (addr - pData->GCRDRA) 731 + pData->CTXSUFF(pSharedMMIO)->V.V1. u32OffRxDescriptors;731 + pData->CTXSUFF(pSharedMMIO)->V.V1.offRxDescriptors; 732 732 if (!(pb[7] & 0x80) && fRetIfNotOwn) 733 733 return false; … … 789 789 uint8_t *pv = (uint8_t*)pData->CTXSUFF(pSharedMMIO) 790 790 + (addr - pData->GCRDRA) 791 + pData->CTXSUFF(pSharedMMIO)->V.V1. u32OffRxDescriptors;791 + pData->CTXSUFF(pSharedMMIO)->V.V1.offRxDescriptors; 792 792 memcpy(pv, rmd, 16); 793 793 pv[7] &= ~0x80; … … 873 873 uint32_t u32Off = 0; 874 874 memset(pData->pSharedMMIOHC, 0, sizeof(PCNETGUESTSHAREDMEMORY)); 875 pData->pSharedMMIOHC->u32Size = sizeof(PCNETGUESTSHAREDMEMORY);876 875 pData->pSharedMMIOHC->u32Version = PCNET_GUEST_INTERFACE_VERSION; 877 876 u32Off = 2048; /* Leave some space for more fields within the header */ 878 pData->pSharedMMIOHC->V.V1. u32OffTxDescriptors = u32Off;877 pData->pSharedMMIOHC->V.V1.offTxDescriptors = u32Off; 879 878 u32Off = RT_ALIGN(u32Off + PCNET_GUEST_TX_DESCRIPTOR_SIZE * PCNET_GUEST_MAX_TX_DESCRIPTORS, 32); 880 pData->pSharedMMIOHC->V.V1. u32OffRxDescriptors = u32Off;879 pData->pSharedMMIOHC->V.V1.offRxDescriptors = u32Off; 881 880 u32Off = RT_ALIGN(u32Off + PCNET_GUEST_RX_DESCRIPTOR_SIZE * PCNET_GUEST_MAX_RX_DESCRIPTORS, 32); 882 881 /* Map the RX/TX descriptors into the hypervisor. Make sure we don't need too much space. */ 883 882 AssertRelease(u32Off <= 8192); 884 pData->pSharedMMIOHC->V.V1.u32OffTxBuffers = u32Off; 883 #if 0 884 /* Don't allocate TX buffers since Windows guests cannot use it */ 885 pData->pSharedMMIOHC->V.V1.offTxBuffers = u32Off; 885 886 u32Off = RT_ALIGN(u32Off + PCNET_GUEST_NIC_BUFFER_SIZE * PCNET_GUEST_MAX_TX_DESCRIPTORS, 32); 886 pData->pSharedMMIOHC->V.V1.u32OffRxBuffers = u32Off; 887 #endif 888 pData->pSharedMMIOHC->V.V1.offRxBuffers = u32Off; 887 889 pData->pSharedMMIOHC->fFlags = PCNET_GUEST_FLAGS_ADMIT_HOST; 888 890 u32Off = RT_ALIGN(u32Off + PCNET_GUEST_NIC_BUFFER_SIZE * PCNET_GUEST_MAX_RX_DESCRIPTORS, 32); 889 891 AssertRelease(u32Off <= PCNET_GUEST_SHARED_MEMORY_SIZE); 892 pData->pSharedMMIOHC->cbSize = u32Off; 890 893 } 891 894 … … 1805 1808 int count = RT_MIN(4096 - (int)rmd.rmd1.bcnt, size); 1806 1809 RTGCPHYS32 rbadr = PHYSADDR(pData, rmd.rmd0.rbadr); 1807 PDMDevHlpPhysWrite(pDevIns, rbadr, src, count); 1810 #if 0 1811 if (pData->fPrivIfEnabled) 1812 { 1813 uint8_t *pb = (uint8_t*)pData->CTXSUFF(pSharedMMIO) 1814 + rbadr - pData->GCRDRA + pData->CTXSUFF(pSharedMMIO)->V.V1.offRxDescriptors; 1815 memcpy(pb, src, count); 1816 } 1817 else 1818 #endif 1819 PDMDevHlpPhysWrite(pDevIns, rbadr, src, count); 1808 1820 src += count; 1809 1821 size -= count; … … 1834 1846 1835 1847 count = RT_MIN(4096 - (int)rmd.rmd1.bcnt, size); 1836 rbadr = PHYSADDR(pData, rmd.rmd0.rbadr); 1837 PDMDevHlpPhysWrite(pDevIns, rbadr, src, count); 1848 RTGCPHYS32 rbadr = PHYSADDR(pData, rmd.rmd0.rbadr); 1849 #if 0 1850 if (pData->fPrivIfEnabled) 1851 { 1852 uint8_t *pb = (uint8_t*)pData->CTXSUFF(pSharedMMIO) 1853 + rbadr - pData->GCRDRA + pData->CTXSUFF(pSharedMMIO)->V.V1.offRxDescriptors; 1854 memcpy(pb, src, count); 1855 } 1856 else 1857 #endif 1858 PDMDevHlpPhysWrite(pDevIns, rbadr, src, count); 1838 1859 src += count; 1839 1860 size -= count; … … 2387 2408 static DECLCALLBACK(int) pcnetAsyncSendThread(PPDMDEVINS pDevIns, PPDMTHREAD pThread) 2388 2409 { 2389 PCNetState *p This= PDMINS2DATA(pDevIns, PCNetState *);2410 PCNetState *pData = PDMINS2DATA(pDevIns, PCNetState *); 2390 2411 2391 2412 /* … … 2412 2433 * to leave the running state. 2413 2434 */ 2414 int rc = RTSemEventWait(p This->hSendEventSem, RT_INDEFINITE_WAIT);2435 int rc = RTSemEventWait(pData->hSendEventSem, RT_INDEFINITE_WAIT); 2415 2436 AssertRCReturn(rc, rc); 2416 2437 if (RT_UNLIKELY(pThread->enmState != PDMTHREADSTATE_RUNNING)) … … 2421 2442 * suspended while waiting for the critical section. 2422 2443 */ 2423 rc = PDMCritSectEnter(&p This->CritSect, VERR_SEM_BUSY);2444 rc = PDMCritSectEnter(&pData->CritSect, VERR_SEM_BUSY); 2424 2445 AssertReleaseRCReturn(rc, rc); 2425 2446 2426 2447 if (pThread->enmState == PDMTHREADSTATE_RUNNING) 2427 2448 { 2428 rc = pcnetAsyncTransmit(p This);2449 rc = pcnetAsyncTransmit(pData); 2429 2450 AssertReleaseRC(rc); 2430 2451 } 2431 2452 2432 PDMCritSectLeave(&p This->CritSect);2453 PDMCritSectLeave(&pData->CritSect); 2433 2454 } 2434 2455 … … 2447 2468 static DECLCALLBACK(int) pcnetAsyncSendThreadWakeUp(PPDMDEVINS pDevIns, PPDMTHREAD pThread) 2448 2469 { 2449 PCNetState *p This= PDMINS2DATA(pDevIns, PCNetState *);2450 return RTSemEventSignal(p This->hSendEventSem);2470 PCNetState *pData = PDMINS2DATA(pDevIns, PCNetState *); 2471 return RTSemEventSignal(pData->hSendEventSem); 2451 2472 } 2452 2473
Note:
See TracChangeset
for help on using the changeset viewer.