Changeset 68090 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 24, 2017 10:47:15 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r67709 r68090 3182 3182 } 3183 3183 3184 /** 3185 * Returns the PCI express encoding for the given PCI Express Device/Port type string. 3186 * 3187 * @returns PCI express encoding. 3188 * @param pszExpressPortType The string identifier for the port/device type. 3189 */ 3190 static uint8_t ich9pcibridgeR3GetExpressPortTypeFromString(const char *pszExpressPortType) 3191 { 3192 if (!RTStrCmp(pszExpressPortType, "EndPtDev")) 3193 return VBOX_PCI_EXP_TYPE_ENDPOINT; 3194 else if (!RTStrCmp(pszExpressPortType, "LegEndPtDev")) 3195 return VBOX_PCI_EXP_TYPE_LEG_END; 3196 else if (!RTStrCmp(pszExpressPortType, "RootCmplxRootPort")) 3197 return VBOX_PCI_EXP_TYPE_ROOT_PORT; 3198 else if (!RTStrCmp(pszExpressPortType, "ExpressSwUpstream")) 3199 return VBOX_PCI_EXP_TYPE_UPSTREAM; 3200 else if (!RTStrCmp(pszExpressPortType, "ExpressSwDownstream")) 3201 return VBOX_PCI_EXP_TYPE_DOWNSTREAM; 3202 else if (!RTStrCmp(pszExpressPortType, "Express2PciBridge")) 3203 return VBOX_PCI_EXP_TYPE_PCI_BRIDGE; 3204 else if (!RTStrCmp(pszExpressPortType, "Pci2ExpressBridge")) 3205 return VBOX_PCI_EXP_TYPE_PCIE_BRIDGE; 3206 else if (!RTStrCmp(pszExpressPortType, "RootCmplxIntEp")) 3207 return VBOX_PCI_EXP_TYPE_ROOT_INT_EP; 3208 else if (!RTStrCmp(pszExpressPortType, "RootCmplxEc")) 3209 return VBOX_PCI_EXP_TYPE_ROOT_EC; 3210 3211 AssertLogRelMsgFailedReturn(("Unknown express port type specified"), VBOX_PCI_EXP_TYPE_ROOT_INT_EP); 3212 } 3184 3213 3185 3214 /** … … 3291 3320 * Validate and read configuration. 3292 3321 */ 3293 if (!CFGMR3AreValuesValid(pCfg, "GCEnabled\0" "R0Enabled\0" "ExpressEnabled\0" ))3322 if (!CFGMR3AreValuesValid(pCfg, "GCEnabled\0" "R0Enabled\0" "ExpressEnabled\0" "ExpressPortType\0")) 3294 3323 return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES; 3295 3324 … … 3315 3344 return PDMDEV_SET_ERROR(pDevIns, rc, 3316 3345 N_("Configuration error: Failed to query boolean value \"ExpressEnabled\"")); 3346 3347 char *pszExpressPortType; 3348 rc = CFGMR3QueryStringAllocDef(pCfg, "ExpressPortType", 3349 &pszExpressPortType, "RootCmplxIntEp"); 3350 if (RT_FAILURE(rc)) 3351 return PDMDEV_SET_ERROR(pDevIns, rc, 3352 N_("LsiLogic configuration error: failed to read \"ExpressPortType\" as string")); 3353 3354 uint8_t uExpressPortType = ich9pcibridgeR3GetExpressPortTypeFromString(pszExpressPortType); 3355 MMR3HeapFree(pszExpressPortType); 3317 3356 3318 3357 pDevIns->IBase.pfnQueryInterface = ich9pcibridgeQueryInterface; … … 3397 3436 PDMPciDevSetWord(&pBus->PciDev, 0xa0 + 2, 3398 3437 /* version */ 0x2 3399 | /* Root Complex Integrated Endpoint */ (VBOX_PCI_EXP_TYPE_ROOT_INT_EP<< 4));3438 | (uExpressPortType << 4)); 3400 3439 PDMPciDevSetDWord(&pBus->PciDev, 0xa0 + 4, VBOX_PCI_EXP_DEVCAP_RBE); /* Device capabilities. */ 3401 3440 PDMPciDevSetWord(&pBus->PciDev, 0xa0 + 8, 0x0000); /* Device control. */
Note:
See TracChangeset
for help on using the changeset viewer.