Changeset 7762 in vbox for trunk/src/VBox
- Timestamp:
- Apr 7, 2008 7:12:34 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r7756 r7762 1717 1717 1718 1718 /** 1719 * Check if there is at least one free receive buffer available.1720 */1721 static int pcnetCanReceiveNoSync(PCNetState *pData)1722 {1723 if (RT_UNLIKELY(CSR_DRX(pData) || CSR_STOP(pData) || CSR_SPND(pData)))1724 return 0;1725 1726 if (HOST_IS_OWNER(CSR_CRST(pData)) && pData->GCRDRA)1727 pcnetRdtePoll(pData);1728 1729 if (HOST_IS_OWNER(CSR_CRST(pData)))1730 {1731 /** @todo Notify the guest _now_. Will potentially increase the interrupt load */1732 pData->aCSR[0] |= 0x1000; /* Set MISS flag */1733 return 0;1734 }1735 1736 /* byte count stored in two's complement 12 bits wide */1737 Log(("#%d pcnetCanReceiveNoSync %d bytes\n", PCNET_INST_NR,1738 4096 - CSR_CRBC(pData)));1739 return 4096 - CSR_CRBC(pData);1740 }1741 1742 /**1743 1719 * Write data into guest receive buffers. 1744 1720 */ … … 2567 2543 2568 2544 2569 static int pcnetCSRWriteU16(PCNetState *pData, uint32_t u32RAP, uint32_t new_value) 2570 { 2571 uint16_t val = new_value; 2545 static int pcnetCSRWriteU16(PCNetState *pData, uint32_t u32RAP, uint32_t val) 2546 { 2572 2547 int rc = VINF_SUCCESS; 2573 2548 #ifdef PCNET_DEBUG_CSR … … 4251 4226 static DECLCALLBACK(size_t) pcnetCanReceive(PPDMINETWORKPORT pInterface) 4252 4227 { 4253 size_t cb ;4228 size_t cb = 0; 4254 4229 int rc; 4255 4230 PCNetState *pData = INETWORKPORT_2_DATA(pInterface); … … 4258 4233 AssertReleaseRC(rc); 4259 4234 4260 cb = pcnetCanReceiveNoSync(pData); 4235 if (RT_LIKELY(!CSR_DRX(pData) && !CSR_STOP(pData) && !CSR_SPND(pData))) 4236 { 4237 if (HOST_IS_OWNER(CSR_CRST(pData)) && pData->GCRDRA) 4238 pcnetRdtePoll(pData); 4239 4240 if (HOST_IS_OWNER(CSR_CRST(pData))) 4241 { 4242 /** @todo Notify the guest _now_. Will potentially increase the interrupt load */ 4243 pData->aCSR[0] |= 0x1000; /* Set MISS flag */ 4244 } 4245 else 4246 { 4247 /* byte count stored in two's complement 12 bits wide */ 4248 Log(("#%d pcnetCanReceiveNoSync %d bytes\n", PCNET_INST_NR, 4096 - CSR_CRBC(pData))); 4249 cb = 4096 - CSR_CRBC(pData); 4250 } 4251 } 4261 4252 4262 4253 PDMCritSectLeave(&pData->CritSect);
Note:
See TracChangeset
for help on using the changeset viewer.