Changeset 813 in vbox
- Timestamp:
- Feb 9, 2007 3:53:12 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r812 r813 1922 1922 } 1923 1923 1924 /** 1925 * Fails a TMD with a generic error. 1926 */ 1927 static void pcnetXmitFailTMDGeneric(PCNetState *pData, TMD *pTmd) 1928 { 1929 /* make carrier error - hope this is correct. */ 1930 pTmd->tmd2.lcar = pTmd->tmd1.err = 1; 1931 pData->aCSR[0] |= BIT(15) | BIT(13); /* ERR | CERR */ 1932 pData->Led.Asserted.s.fError = pData->Led.Actual.s.fError = 1; 1933 Log(("#%d pcnetTransmit: Signaling send error. swstyle=%#x\n", 1934 PCNETSTATE_2_DEVINS(pData)->iInstance, pData->aBCR[BCR_SWS])); 1935 } 1936 1924 1937 1925 1938 /** … … 2045 2058 const unsigned cb = 4096 - tmd.tmd1.bcnt; 2046 2059 Log(("#%d pcnetTransmit: stp&enp: cb=%d xmtrc=%#x\n", PCNETSTATE_2_DEVINS(pData)->iInstance, cb, CSR_XMTRC(pData))); 2060 2047 2061 if (RT_LIKELY(pcnetIsLinkUp(pData) || CSR_LOOP(pData))) 2048 2062 { 2049 2063 RTR3PTR pv; 2050 2064 2051 int rc = PDMDevHlpPhys2HCVirt(pData->pDevInsHC, 2052 PHYSADDR(pData, tmd.tmd0.tbadr), cb, &pv); 2053 if (RT_SUCCESS(rc)) 2054 pcnetXmitZeroCopyFrame(pData, pv, cb); 2065 if (RT_LIKELY(cb < 4096)) 2066 { 2067 int rc = PDMDevHlpPhys2HCVirt(pData->pDevInsHC, 2068 PHYSADDR(pData, tmd.tmd0.tbadr), cb, &pv); 2069 if (RT_SUCCESS(rc)) 2070 pcnetXmitZeroCopyFrame(pData, pv, cb); 2071 else 2072 { 2073 pcnetXmitRead1st(pData, PHYSADDR(pData, tmd.tmd0.tbadr), cb); 2074 } 2075 if (CSR_LOOP(pData)) 2076 pcnetXmitLoopbackFrame(pData); 2077 else 2078 { 2079 int rc = pcnetXmitCompleteFrame(pData); 2080 if (VBOX_FAILURE(rc)) 2081 return rc; /* can happen during termination */ 2082 } 2083 } 2055 2084 else 2056 2085 { 2057 pcnetXmitRead1st(pData, PHYSADDR(pData, tmd.tmd0.tbadr), cb); 2058 } 2059 if (CSR_LOOP(pData)) 2060 pcnetXmitLoopbackFrame(pData); 2061 else 2062 { 2063 int rc = pcnetXmitCompleteFrame(pData); 2064 if (VBOX_FAILURE(rc)) 2065 return rc; /* can happen during termination */ 2086 /* This is only acceptable if it's not the last buffer in the chain (stp=1, enp=0) */ 2087 LogRel(("PCNET: pcnetAsyncTransmit: illegal 4kb frame -> signalling error\n")); 2088 2089 pcnetXmitFailTMDGeneric(pData, &tmd); 2066 2090 } 2067 2091 } … … 2173 2197 * Simply stop the transmitting for now. 2174 2198 */ 2199 /** @todo according to the specs we're supposed to clear the own bit and move on to the next one. */ 2175 2200 Log(("#%d pcnetTransmit: guest is giving us shit!\n", PCNETSTATE_2_DEVINS(pData)->iInstance)); 2176 2201 break; … … 2187 2212 pData->aCSR[0] |= 0x0200; /* set TINT */ 2188 2213 } 2214 2215 /** @todo should we continue after an error (tmd.tmd1.err) or not? */ 2189 2216 2190 2217 STAM_COUNTER_INC(&pData->aStatXmitChainCounts[RT_MIN(cBuffers,
Note:
See TracChangeset
for help on using the changeset viewer.