Changeset 101515 in vbox for trunk/src/VBox/Main/src-client/ConsoleImplConfigCommon.cpp
- Timestamp:
- Oct 20, 2023 10:47:48 AM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImplConfigCommon.cpp
r101477 r101515 4719 4719 InsertConfigNode(pDev, Utf8StrFmt("%u", uInstance).c_str(), &pInst); 4720 4720 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 4721 /* the first network card gets the PCI ID 3, the next 3 gets 8..10, 4722 * next 4 get 16..19. */ 4721 4723 4722 int iPCIDeviceNo; 4724 switch (uInstance) 4725 { 4726 case 0: 4723 if (enmChipset == ChipsetType_ICH9 || enmChipset == ChipsetType_PIIX3) 4724 { 4725 /* the first network card gets the PCI ID 3, the next 3 gets 8..10, 4726 * next 4 get 16..19. */ 4727 switch (uInstance) 4728 { 4729 case 0: 4730 iPCIDeviceNo = 3; 4731 break; 4732 case 1: case 2: case 3: 4733 iPCIDeviceNo = uInstance - 1 + 8; 4734 break; 4735 case 4: case 5: case 6: case 7: 4736 iPCIDeviceNo = uInstance - 4 + 16; 4737 break; 4738 default: 4739 /* auto assignment */ 4740 iPCIDeviceNo = -1; 4741 break; 4742 } 4743 #ifdef VMWARE_NET_IN_SLOT_11 4744 /* 4745 * Dirty hack for PCI slot compatibility with VMWare, 4746 * it assigns slot 0x11 to the first network controller. 4747 */ 4748 if (iPCIDeviceNo == 3 && adapterType == NetworkAdapterType_I82545EM) 4749 { 4750 iPCIDeviceNo = 0x11; 4751 fSwapSlots3and11 = true; 4752 } 4753 else if (iPCIDeviceNo == 0x11 && fSwapSlots3and11) 4727 4754 iPCIDeviceNo = 3; 4728 break;4729 case 1: case 2: case 3:4730 iPCIDeviceNo = uInstance - 1 + 8;4731 break;4732 case 4: case 5: case 6: case 7:4733 iPCIDeviceNo = uInstance - 4 + 16;4734 break;4735 default:4736 /* auto assignment */4737 iPCIDeviceNo = -1;4738 break;4739 }4740 #ifdef VMWARE_NET_IN_SLOT_114741 /*4742 * Dirty hack for PCI slot compatibility with VMWare,4743 * it assigns slot 0x11 to the first network controller.4744 */4745 if (iPCIDeviceNo == 3 && adapterType == NetworkAdapterType_I82545EM)4746 {4747 iPCIDeviceNo = 0x11;4748 fSwapSlots3and11 = true;4749 }4750 else if (iPCIDeviceNo == 0x11 && fSwapSlots3and11)4751 iPCIDeviceNo = 3;4752 4755 #endif 4756 } 4757 else /* Platforms other than x86 just use the auto assignment, no slot swap hack there. */ 4758 iPCIDeviceNo = -1; 4759 4753 4760 PCIBusAddress PCIAddr = PCIBusAddress(0, iPCIDeviceNo, 0); 4754 4761 hrc = pBusMgr->assignPCIDevice(pszAdapterName, pInst, PCIAddr); H();
Note:
See TracChangeset
for help on using the changeset viewer.