Changeset 47499 in vbox for trunk/src/VBox/Devices/Network/DrvIntNet.cpp
- Timestamp:
- Jul 31, 2013 5:36:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r46904 r47499 1035 1035 LogFlow(("drvR3IntNetPowerResume\n")); 1036 1036 PDRVINTNET pThis = PDMINS_2_DATA(pDrvIns, PDRVINTNET); 1037 VMRESUMEREASON enmReason = PDMDrvHlpVMGetResumeReason(pDrvIns); 1038 1037 1039 if (!pThis->fActivateEarlyDeactivateLate) 1038 1040 { … … 1042 1044 drvR3IntNetSetActive(pThis, true /* fActive */); 1043 1045 } 1044 if ( PDMDrvHlpVMTeleportedAndNotFullyResumedYet(pDrvIns) 1045 && pThis->pIAboveConfigR3) 1046 { 1047 /* 1048 * We've just been teleported and need to drop a hint to the switch 1049 * since we're likely to have changed to a different port. We just 1050 * push out some ethernet frame that doesn't mean anything to anyone. 1051 * For this purpose ethertype 0x801e was chosen since it was registered 1052 * to Sun (dunno what it is/was used for though). 1053 */ 1054 union 1046 1047 switch (enmReason) 1048 { 1049 case VMRESUMEREASON_HOST_RESUME: 1055 1050 { 1056 RTNETETHERHDR Hdr; 1057 uint8_t ab[128]; 1058 } Frame; 1059 RT_ZERO(Frame); 1060 Frame.Hdr.DstMac.au16[0] = 0xffff; 1061 Frame.Hdr.DstMac.au16[1] = 0xffff; 1062 Frame.Hdr.DstMac.au16[2] = 0xffff; 1063 Frame.Hdr.EtherType = RT_H2BE_U16_C(0x801e); 1064 int rc = pThis->pIAboveConfigR3->pfnGetMac(pThis->pIAboveConfigR3, &Frame.Hdr.SrcMac); 1065 if (RT_SUCCESS(rc)) 1066 rc = drvR3IntNetResumeSend(pThis, &Frame, sizeof(Frame)); 1067 if (RT_FAILURE(rc)) 1068 LogRel(("IntNet#%u: Sending dummy frame failed: %Rrc\n", pDrvIns->iInstance, rc)); 1069 } 1051 uint32_t u32TrunkType; 1052 int rc = CFGMR3QueryU32(pDrvIns->pCfg, "TrunkType", &u32TrunkType); 1053 AssertRC(rc); 1054 1055 /* 1056 * Only do the disconnect for bridged networking. Host-only and 1057 * internal networks are not affected by a host resume. 1058 */ 1059 if ( RT_SUCCESS(rc) 1060 && u32TrunkType == kIntNetTrunkType_NetFlt) 1061 { 1062 rc = pThis->pIAboveConfigR3->pfnSetLinkState(pThis->pIAboveConfigR3, 1063 PDMNETWORKLINKSTATE_DOWN_RESUME); 1064 AssertRC(rc); 1065 } 1066 break; 1067 } 1068 case VMRESUMEREASON_TELEPORTED: 1069 case VMRESUMEREASON_TELEPORT_FAILED: 1070 { 1071 if ( PDMDrvHlpVMTeleportedAndNotFullyResumedYet(pDrvIns) 1072 && pThis->pIAboveConfigR3) 1073 { 1074 /* 1075 * We've just been teleported and need to drop a hint to the switch 1076 * since we're likely to have changed to a different port. We just 1077 * push out some ethernet frame that doesn't mean anything to anyone. 1078 * For this purpose ethertype 0x801e was chosen since it was registered 1079 * to Sun (dunno what it is/was used for though). 1080 */ 1081 union 1082 { 1083 RTNETETHERHDR Hdr; 1084 uint8_t ab[128]; 1085 } Frame; 1086 RT_ZERO(Frame); 1087 Frame.Hdr.DstMac.au16[0] = 0xffff; 1088 Frame.Hdr.DstMac.au16[1] = 0xffff; 1089 Frame.Hdr.DstMac.au16[2] = 0xffff; 1090 Frame.Hdr.EtherType = RT_H2BE_U16_C(0x801e); 1091 int rc = pThis->pIAboveConfigR3->pfnGetMac(pThis->pIAboveConfigR3, 1092 &Frame.Hdr.SrcMac); 1093 if (RT_SUCCESS(rc)) 1094 rc = drvR3IntNetResumeSend(pThis, &Frame, sizeof(Frame)); 1095 if (RT_FAILURE(rc)) 1096 LogRel(("IntNet#%u: Sending dummy frame failed: %Rrc\n", 1097 pDrvIns->iInstance, rc)); 1098 } 1099 break; 1100 } 1101 default: /* ignore every other resume reason else */ 1102 break; 1103 } /* end of switch(enmReason) */ 1070 1104 } 1071 1105
Note:
See TracChangeset
for help on using the changeset viewer.