Changeset 18591 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Apr 1, 2009 10:11:51 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r18439 r18591 129 129 /*****************************************************************************/ 130 130 131 typedef uint32_t E1KCHIP;132 #define E1K_CHIP_82540EM 0133 #define E1K_CHIP_82543GC 1134 135 131 /* Intel */ 136 132 #define E1K_VENDOR_ID 0x8086 137 133 /* 82540EM-A (Desktop) */ 138 134 #define E1K_DEVICE_ID_82540EM 0x100E 135 /* 82545EM-A (Server) */ 136 #define E1K_DEVICE_ID_82545EM 0x100F 139 137 /* 82543GC (Server) */ 140 138 #define E1K_DEVICE_ID_82543GC 0x1004 … … 143 141 /* PRO/1000 MT Desktop Ethernet */ 144 142 #define E1K_SUBSYSTEM_ID_82540EM 0x001E 143 /* PRO/1000 MT Server Ethernet */ 144 #define E1K_SUBSYSTEM_ID_82545EM 0x1001 145 145 /* PRO/1000 T Server Ethernet */ 146 146 #define E1K_SUBSYSTEM_ID_82543GC 0x1004 147 148 typedef uint32_t E1KCHIP; 149 #define E1K_CHIP_82540EM 0 150 #define E1K_CHIP_82543GC 1 151 #define E1K_CHIP_82545EM 2 152 153 struct E1kChips 154 { 155 uint16_t uPCIDeviceId; 156 uint16_t uPCISubsystemId; 157 const char *pcszName; 158 } g_Chips[] = 159 { 160 { E1K_DEVICE_ID_82540EM, E1K_SUBSYSTEM_ID_82540EM, "82540EM" }, 161 { E1K_DEVICE_ID_82543GC, E1K_SUBSYSTEM_ID_82543GC, "82543GC" }, 162 { E1K_DEVICE_ID_82545EM, E1K_SUBSYSTEM_ID_82545EM, "82545EM" } 163 }; 164 147 165 148 166 /* The size of register area mapped to I/O space */ … … 4558 4576 static DECLCALLBACK(void) e1kConfigurePCI(PCIDEVICE& pci, E1KCHIP eChip) 4559 4577 { 4578 Assert(eChip < RT_ELEMENTS(g_Chips)); 4560 4579 /* Configure PCI Device, assume 32-bit mode ******************************/ 4561 4580 PCIDevSetVendorId(&pci, E1K_VENDOR_ID); 4562 PCIDevSetDeviceId(&pci, eChip == E1K_CHIP_82540EM ? 4563 E1K_DEVICE_ID_82540EM: 4564 E1K_DEVICE_ID_82543GC); 4581 PCIDevSetDeviceId(&pci, g_Chips[eChip].uPCIDeviceId); 4565 4582 e1kPCICfgSetU16(pci, VBOX_PCI_SUBSYSTEM_VENDOR_ID, E1K_SUBSYSTEM_VENDOR_ID); 4566 e1kPCICfgSetU16(pci, VBOX_PCI_SUBSYSTEM_ID, eChip == E1K_CHIP_82540EM ? 4567 E1K_SUBSYSTEM_ID_82540EM: 4568 E1K_SUBSYSTEM_ID_82543GC); 4583 e1kPCICfgSetU16(pci, VBOX_PCI_SUBSYSTEM_ID, g_Chips[eChip].uPCISubsystemId); 4569 4584 4570 4585 e1kPCICfgSetU16(pci, VBOX_PCI_COMMAND, 0x0000); … … 4667 4682 return PDMDEV_SET_ERROR(pDevIns, rc, 4668 4683 N_("Configuration error: Failed to get the value of 'AdapterType'")); 4669 Assert(pState->eChip == E1K_CHIP_82540EM || 4670 pState->eChip == E1K_CHIP_82543GC); 4671 4672 E1kLog(("%s Chip=%s\n", INSTANCE(pState), pState->eChip == E1K_CHIP_82540EM ? "82540EM" : "82543GC")); 4684 Assert(pState->eChip <= E1K_CHIP_82545EM); 4685 4686 E1kLog(("%s Chip=%s\n", INSTANCE(pState), g_Chips[pState->eChip].pcszName)); 4673 4687 4674 4688 /* Initialize state structure */
Note:
See TracChangeset
for help on using the changeset viewer.