Changeset 82347 in vbox
- Timestamp:
- Dec 3, 2019 4:32:17 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 4 edited
-
DevE1000.cpp (modified) (13 diffs)
-
DevE1000Phy.cpp (modified) (4 diffs)
-
DevE1000Phy.h (modified) (1 diff)
-
DevEEPROM.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r82129 r82347 1780 1780 while (csum >> 16) 1781 1781 csum = (csum >> 16) + (csum & 0xFFFF); 1782 return ~csum; 1782 Assert(csum < 65536); 1783 return (uint16_t)~csum; 1783 1784 } 1784 1785 … … 2917 2918 { 2918 2919 #ifdef IN_RING3 2919 uint32_t value ;2920 uint32_t value = 0; /* Get rid of false positive in parfait. */ 2920 2921 int rc = e1kRegReadDefault(pDevIns, pThis, offset, index, &value); 2921 2922 if (RT_SUCCESS(rc)) … … 3243 3244 E1kLog2(("%s e1kRegWriteRCTL: Setting receive buffer size to %d (old %d)\n", 3244 3245 pThis->szPrf, cbRxBuf, pThis->u16RxBSize)); 3245 pThis->u16RxBSize = cbRxBuf; 3246 Assert(cbRxBuf < 65536); 3247 pThis->u16RxBSize = (uint16_t)cbRxBuf; 3246 3248 3247 3249 /* Update the register */ … … 4041 4043 { 4042 4044 E1kLog3(("%s Inserting VLAN tag %08x\n", 4043 pThis->szPrf, RT_BE2H_U16( VET) | (RT_BE2H_U16(pThis->u16VTagTCI) << 16)));4045 pThis->szPrf, RT_BE2H_U16((uint16_t)VET) | (RT_BE2H_U16(pThis->u16VTagTCI) << 16))); 4044 4046 memmove((uint8_t*)pSg->aSegs[0].pvSeg + 16, (uint8_t*)pSg->aSegs[0].pvSeg + 12, cbFrame - 12); 4045 *((uint32_t*)pSg->aSegs[0].pvSeg + 3) = RT_BE2H_U16( VET) | (RT_BE2H_U16(pThis->u16VTagTCI) << 16);4047 *((uint32_t*)pSg->aSegs[0].pvSeg + 3) = RT_BE2H_U16((uint16_t)VET) | (RT_BE2H_U16(pThis->u16VTagTCI) << 16); 4046 4048 pSg->cbUsed += 4; 4047 4049 cbFrame += 4; … … 4378 4380 while (csum >> 16) 4379 4381 csum = (csum >> 16) + (csum & 0xFFFF); 4380 pTcpHdr->chksum = csum; 4382 Assert(csum < 65536); 4383 pTcpHdr->chksum = (uint16_t)csum; 4381 4384 /* Compute final checksum */ 4382 4385 e1kInsertChecksum(pThis, pThis->aTxPacketFallback, pThis->u16TxPktLen, … … 5954 5957 for (unsigned i = E1K_NUM_OF_BINARY_SEARCHABLE; i < RT_ELEMENTS(g_aE1kRegMap); i++) 5955 5958 if (offReg - g_aE1kRegMap[i].offset < g_aE1kRegMap[i].size) 5956 return i;5959 return (int)i; 5957 5960 5958 5961 # ifdef VBOX_STRICT … … 6012 6015 return PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "unsupported op size: offset=%#10x cb=%#10x\n", offReg, cb); 6013 6016 } 6014 if (index != -1)6017 if (index > 0) 6015 6018 { 6016 6019 RT_UNTRUSTED_VALIDATED_FENCE(); /* paranoia because of port I/O. */ … … 6032 6035 //pThis->iStatIntLost += pThis->iStatIntLostOne; 6033 6036 //pThis->iStatIntLostOne = 0; 6034 rc = g_aE1kRegMap[index].pfnRead(pDevIns, pThis, offReg & 0xFFFFFFFC, index, &u32);6037 rc = g_aE1kRegMap[index].pfnRead(pDevIns, pThis, offReg & 0xFFFFFFFC, (uint32_t)index, &u32); 6035 6038 u32 &= mask; 6036 6039 //e1kCsLeave(pThis); … … 6078 6081 VBOXSTRICTRC rc = VINF_SUCCESS; 6079 6082 int idxReg = e1kRegLookup(offReg); 6080 if (RT_LIKELY(idxReg != -1))6083 if (RT_LIKELY(idxReg > 0)) 6081 6084 { 6082 6085 RT_UNTRUSTED_VALIDATED_FENCE(); /* paranoia because of port I/O. */ … … 6093 6096 //pThis->iStatIntLost += pThis->iStatIntLostOne; 6094 6097 //pThis->iStatIntLostOne = 0; 6095 rc = g_aE1kRegMap[idxReg].pfnRead(pDevIns, pThis, offReg & 0xFFFFFFFC, idxReg, pu32);6098 rc = g_aE1kRegMap[idxReg].pfnRead(pDevIns, pThis, offReg & 0xFFFFFFFC, (uint32_t)idxReg, pu32); 6096 6099 //e1kCsLeave(pThis); 6097 6100 Log6(("%s At %08X read %08X from %s (%s)\n", … … 6126 6129 VBOXSTRICTRC rc = VINF_SUCCESS; 6127 6130 int index = e1kRegLookup(offReg); 6128 if (RT_LIKELY(index != -1))6131 if (RT_LIKELY(index > 0)) 6129 6132 { 6130 6133 RT_UNTRUSTED_VALIDATED_FENCE(); /* paranoia because of port I/O. */ … … 6143 6146 //pThis->iStatIntLost += pThis->iStatIntLostOne; 6144 6147 //pThis->iStatIntLostOne = 0; 6145 rc = g_aE1kRegMap[index].pfnWrite(pDevIns, pThis, offReg, index, u32Value);6148 rc = g_aE1kRegMap[index].pfnWrite(pDevIns, pThis, offReg, (uint32_t)index, u32Value); 6146 6149 //e1kCsLeave(pThis); 6147 6150 } … … 7790 7793 LogRel(("%s: WARNING! Link up delay is disabled!\n", pThis->szPrf)); 7791 7794 7792 uint32_t uStatNo = iInstance;7793 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "StatNo", &uStatNo, iInstance);7795 uint32_t uStatNo = (uint32_t)iInstance; 7796 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "StatNo", &uStatNo, (uint32_t)iInstance); 7794 7797 if (RT_FAILURE(rc)) 7795 7798 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to get the \"StatNo\" value")); -
trunk/src/VBox/Devices/Network/DevE1000Phy.cpp
r81465 r82347 50 50 51 51 #define REG(x) pPhy->au16Regs[x##_IDX] 52 53 54 /* External callback declaration */55 void e1kPhyLinkResetCallback(PPDMDEVINS pDevIns);56 52 57 53 … … 244 240 if (s_regMap[index].u32Address == u32Address) 245 241 { 246 return index;242 return (int)index; 247 243 } 248 244 } … … 263 259 uint16_t u16 = 0; 264 260 265 if (index != -1)266 { 267 u16 = s_regMap[index].pfnRead(pPhy, index, pDevIns);261 if (index > 0) 262 { 263 u16 = s_regMap[index].pfnRead(pPhy, (uint32_t)index, pDevIns); 268 264 PhyLog(("PHY#%d At %02d read %04X from %s (%s)\n", 269 265 pPhy->iInstance, s_regMap[index].u32Address, u16, … … 288 284 int index = Phy::lookupRegister(u32Address); 289 285 290 if (index != -1)286 if (index > 0) 291 287 { 292 288 PhyLog(("PHY#%d At %02d write %04X to %s (%s)\n", 293 289 pPhy->iInstance, s_regMap[index].u32Address, u16Value, 294 290 s_regMap[index].pszAbbrev, s_regMap[index].pszName)); 295 s_regMap[index].pfnWrite(pPhy, index, u16Value, pDevIns);291 s_regMap[index].pfnWrite(pPhy, (uint32_t)index, u16Value, pDevIns); 296 292 } 297 293 else -
trunk/src/VBox/Devices/Network/DevE1000Phy.h
r81465 r82347 108 108 #define MDIO_WRITE_OP 1 109 109 110 /* External callback declaration */ 111 void e1kPhyLinkResetCallback(PPDMDEVINS pDevIns); 112 113 110 114 typedef struct Phy::Phy_st PHY; 111 115 typedef PHY *PPHY; -
trunk/src/VBox/Devices/Network/DevEEPROM.cpp
r81765 r82347 115 115 EEPROM93C46::State EEPROM93C46::opWriteAll() 116 116 { 117 for ( inti = 0; i < SIZE; i++)117 for (unsigned i = 0; i < SIZE; i++) 118 118 storeWord(i, m_u16Word); 119 119 return WAITING_CS_FALL; … … 264 264 pHlp->pfnSSMPutU8( pSSM, EEPROM93C46_SAVEDSTATE_VERSION); 265 265 Assert((uint32_t)m_eState < UINT32_C(256)); 266 pHlp->pfnSSMPutU8( pSSM, m_eState);266 pHlp->pfnSSMPutU8( pSSM, (uint8_t)m_eState); 267 267 Assert((uint32_t)m_eOp < UINT32_C(256)); 268 pHlp->pfnSSMPutU8( pSSM, m_eOp);268 pHlp->pfnSSMPutU8( pSSM, (uint8_t)m_eOp); 269 269 pHlp->pfnSSMPutBool(pSSM, m_fWriteEnabled); 270 270 pHlp->pfnSSMPutU32( pSSM, m_u32InternalWires);
Note:
See TracChangeset
for help on using the changeset viewer.

