Changeset 24020 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Oct 23, 2009 11:03:34 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 53863
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r23969 r24020 576 576 eeprom.write(u32Wires); 577 577 } 578 579 int load(PSSMHANDLE pSSM) 580 { 581 return eeprom.load(pSSM); 582 } 583 584 void save(PSSMHANDLE pSSM) 585 { 586 eeprom.save(pSSM); 587 } 578 588 #endif /* IN_RING3 */ 579 589 }; … … 860 870 RTGCPHYS addrMMReg; 861 871 /** MAC address obtained from the configuration. */ 862 RTMAC mac Address;872 RTMAC macConfigured; 863 873 /** Base port of I/O space region. */ 864 874 RTIOPORT addrIOPort; … … 4413 4423 static void e1kSaveConfig(E1KSTATE *pState, PSSMHANDLE pSSM) 4414 4424 { 4415 SSMR3PutMem(pSSM, &pState->mac Address, sizeof(pState->macAddress));4425 SSMR3PutMem(pSSM, &pState->macConfigured, sizeof(pState->macConfigured)); 4416 4426 SSMR3PutU32(pSSM, pState->eChip); 4417 4427 } … … 4487 4497 #if 0 /** @todo FIXME: enable when bumping the version. */ 4488 4498 e1kSaveConfig(pState, pSSM); 4499 pState->eeprom.save(pSSM); 4489 4500 #endif 4490 4501 e1kDumpState(pState); … … 4576 4587 { 4577 4588 /* config checks */ 4578 RTMAC mac Address;4579 rc = SSMR3GetMem(pSSM, &mac Address, sizeof(macAddress));4589 RTMAC macConfigured; 4590 rc = SSMR3GetMem(pSSM, &macConfigured, sizeof(macConfigured)); 4580 4591 AssertRCReturn(rc, rc); 4581 if ( memcmp(&mac Address, &pState->macAddress, sizeof(macAddress))4592 if ( memcmp(&macConfigured, &pState->macConfigured, sizeof(macConfigured)) 4582 4593 && (uPass == 0 || !PDMDevHlpVMTeleportedAndNotFullyResumedYet(pDevIns)) ) 4583 LogRel(("%s: The mac address differs: config=%RTmac saved=%RTmac\n", INSTANCE(pState), &pState->mac Address, &macAddress));4594 LogRel(("%s: The mac address differs: config=%RTmac saved=%RTmac\n", INSTANCE(pState), &pState->macConfigured, &macConfigured)); 4584 4595 4585 4596 E1KCHIP eChip; … … 4595 4606 if (uPass == SSM_PASS_FINAL) 4596 4607 { 4608 if (uVersion > E1K_SAVEDSTATE_VERSION_VBOX_30) 4609 { 4610 rc = pState->eeprom.load(pSSM); 4611 AssertRCReturn(rc, rc); 4612 } 4597 4613 /* the state */ 4598 4614 SSMR3GetMem(pSSM, &pState->auRegs, sizeof(pState->auRegs)); … … 4794 4810 4795 4811 /* Get config params */ 4796 rc = CFGMR3QueryBytes(pCfgHandle, "MAC", pState->mac Address.au8,4797 sizeof(pState->mac Address.au8));4812 rc = CFGMR3QueryBytes(pCfgHandle, "MAC", pState->macConfigured.au8, 4813 sizeof(pState->macConfigured.au8)); 4798 4814 if (RT_FAILURE(rc)) 4799 4815 return PDMDEV_SET_ERROR(pDevIns, rc, … … 4867 4883 4868 4884 /* Initialize the EEPROM */ 4869 pState->eeprom.init(pState->mac Address);4885 pState->eeprom.init(pState->macConfigured); 4870 4886 4871 4887 /* Initialize internal PHY */ -
trunk/src/VBox/Devices/Network/DevEEPROM.cpp
r15955 r24020 22 22 #define LOG_GROUP LOG_GROUP_DEV_E1000 /// @todo Add a EEPROM logging group. 23 23 #include <VBox/log.h> 24 #include <VBox/pdmdev.h> 24 25 #include <iprt/string.h> 25 26 #include "DevEEPROM.h" … … 243 244 } 244 245 246 void EEPROM93C46::save(PSSMHANDLE pSSM) 247 { 248 SSMR3PutU8( pSSM, EEPROM93C46_SAVEDSTATE_VERSION); 249 SSMR3PutU8( pSSM, m_eState); 250 SSMR3PutU8( pSSM, m_eOp); 251 SSMR3PutBool(pSSM, m_fWriteEnabled); 252 SSMR3PutU32( pSSM, m_u32InternalWires); 253 SSMR3PutU16( pSSM, m_u16Word); 254 SSMR3PutU16( pSSM, m_u16Mask); 255 SSMR3PutU16( pSSM, m_u16Addr); 256 SSMR3PutMem( pSSM, m_au16Data, sizeof(m_au16Data)); 257 } 258 259 int EEPROM93C46::load(PSSMHANDLE pSSM) 260 { 261 int rc = VINF_SUCCESS; 262 uint8_t uVersion = 0; 263 264 rc = SSMR3GetU8(pSSM, &uVersion); 265 AssertRCReturn(rc, rc); 266 if (uVersion != EEPROM93C46_SAVEDSTATE_VERSION) 267 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 268 269 rc = SSMR3GetU8( pSSM, (uint8_t*)&m_eState); 270 AssertRCReturn(rc, rc); 271 rc = SSMR3GetU8( pSSM, (uint8_t*)&m_eOp); 272 AssertRCReturn(rc, rc); 273 rc = SSMR3GetBool(pSSM, &m_fWriteEnabled); 274 AssertRCReturn(rc, rc); 275 rc = SSMR3GetU32( pSSM, &m_u32InternalWires); 276 AssertRCReturn(rc, rc); 277 rc = SSMR3GetU16( pSSM, &m_u16Word); 278 AssertRCReturn(rc, rc); 279 rc = SSMR3GetU16( pSSM, &m_u16Mask); 280 AssertRCReturn(rc, rc); 281 rc = SSMR3GetU16( pSSM, &m_u16Addr); 282 AssertRCReturn(rc, rc); 283 rc = SSMR3GetMem( pSSM, m_au16Data, sizeof(m_au16Data)); 284 285 return rc; 286 } -
trunk/src/VBox/Devices/Network/DevEEPROM.h
r23966 r24020 22 22 /* Interface */ 23 23 #include <iprt/types.h> 24 25 /** The current Saved state version. */ 26 #define EEPROM93C46_SAVEDSTATE_VERSION 1 24 27 25 28 /** … … 70 73 71 74 /** @todo save and load methods */ 75 void save(PSSMHANDLE pSSM); 76 int load(PSSMHANDLE pSSM); 72 77 73 78 /** Actual content of EEPROM */ -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeGC.cpp
r22885 r24020 1278 1278 GEN_CHECK_OFF(E1KSTATE, hTxSem); 1279 1279 GEN_CHECK_OFF(E1KSTATE, addrMMReg); 1280 GEN_CHECK_OFF(E1KSTATE, mac Address);1280 GEN_CHECK_OFF(E1KSTATE, macConfigured); 1281 1281 GEN_CHECK_OFF(E1KSTATE, addrIOPort); 1282 1282 GEN_CHECK_OFF(E1KSTATE, pciDevice);
Note:
See TracChangeset
for help on using the changeset viewer.