VirtualBox

Changeset 81031 in vbox for trunk/src/VBox/Devices/USB


Ignore:
Timestamp:
Sep 26, 2019 7:26:33 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133634
Message:

PDM,Devices: Moving the PDMPCIDEV structures into the PDMDEVINS allocation. Preps for extending the config space to 4KB. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/DevOHCI.cpp

    r80704 r81031  
    255255typedef struct OHCI
    256256{
    257     /** The PCI device. */
    258     PDMPCIDEV           PciDev;
    259 
    260257    /** Pointer to the device instance - R3 ptr. */
    261258    PPDMDEVINSR3        pDevInsR3;
     
    42564253    pThis->dqic = 0x7;
    42574254
    4258     Log(("ohci: %s: Bus started\n", pThis->PciDev.pszNameR3));
     4255    Log(("ohci: Bus started\n"));
    42594256
    42604257    pThis->SofTime = PDMDevHlpTMTimeVirtGet(pThis->CTX_SUFF(pDevIns));
     
    49944991    if ((val & (OHCI_RHA_NDP | OHCI_RHA_DT)) != OHCI_NDP_CFG(pThis))
    49954992    {
    4996         Log(("ohci: %s: invalid write to NDP or DT in roothub descriptor A!!! val=0x%.8x\n",
    4997              pThis->PciDev.pszNameR3, val));
     4993        Log(("ohci: invalid write to NDP or DT in roothub descriptor A!!! val=0x%.8x\n", val));
    49984994        val &= ~(OHCI_RHA_NDP | OHCI_RHA_DT);
    49994995        val |= OHCI_NDP_CFG(pThis);
     
    50305026
    50315027    if ( pThis->RootHub.desc_b != val )
    5032         Log(("ohci: %s: unsupported write to root descriptor B!!! 0x%.8x -> 0x%.8x\n",
    5033              pThis->PciDev.pszNameR3, pThis->RootHub.desc_b, val));
     5028        Log(("ohci: unsupported write to root descriptor B!!! 0x%.8x -> 0x%.8x\n", pThis->RootHub.desc_b, val));
    50345029    pThis->RootHub.desc_b = val;
    50355030    return VINF_SUCCESS;
     
    50755070    {
    50765071        unsigned i;
    5077         Log2(("ohci: %s: global power up\n", pThis->PciDev.pszNameR3));
     5072        Log2(("ohci: global power up\n"));
    50785073        for (i = 0; i < OHCI_NDP_CFG(pThis); i++)
    50795074            ohciR3RhPortPower(&pThis->RootHub, i, true /* power up */);
     
    50845079    {
    50855080        unsigned i;
    5086         Log2(("ohci: %s: global power down\n", pThis->PciDev.pszNameR3));
     5081        Log2(("ohci: global power down\n"));
    50875082        for (i = 0; i < OHCI_NDP_CFG(pThis); i++)
    50885083            ohciR3RhPortPower(&pThis->RootHub, i, false /* power down */);
     
    54685463                                   RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)
    54695464{
    5470     RT_NOREF(iRegion, enmType);
    5471     POHCI pThis = (POHCI)pPciDev;
     5465    POHCI pThis = PDMINS_2_DATA(pDevIns, POHCI);
     5466    RT_NOREF(pPciDev, iRegion, enmType);
     5467    Assert(pPciDev == pDevIns->apPciDevs[0]);
     5468
    54725469    int rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/,
    54735470                                   IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_ZEROED
     
    59615958    pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    59625959
    5963     PCIDevSetVendorId     (&pThis->PciDev, 0x106b);
    5964     PCIDevSetDeviceId     (&pThis->PciDev, 0x003f);
    5965     PCIDevSetClassProg    (&pThis->PciDev, 0x10); /* OHCI */
    5966     PCIDevSetClassSub     (&pThis->PciDev, 0x03);
    5967     PCIDevSetClassBase    (&pThis->PciDev, 0x0c);
    5968     PCIDevSetInterruptPin (&pThis->PciDev, 0x01);
     5960    PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];
     5961    PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev);
     5962
     5963    PDMPciDevSetVendorId(pPciDev,       0x106b);
     5964    PDMPciDevSetDeviceId(pPciDev,       0x003f);
     5965    PDMPciDevSetClassProg(pPciDev,      0x10); /* OHCI */
     5966    PDMPciDevSetClassSub(pPciDev,       0x03);
     5967    PDMPciDevSetClassBase(pPciDev,      0x0c);
     5968    PDMPciDevSetInterruptPin(pPciDev,   0x01);
    59695969#ifdef VBOX_WITH_MSI_DEVICES
    5970     PCIDevSetStatus       (&pThis->PciDev, VBOX_PCI_STATUS_CAP_LIST);
    5971     PCIDevSetCapabilityList(&pThis->PciDev, 0x80);
     5970    PDMPciDevSetStatus(pPciDev,        VBOX_PCI_STATUS_CAP_LIST);
     5971    PDMPciDevSetCapabilityList(pPciDev, 0x80);
    59725972#endif
    59735973
     
    60136013     * Register PCI device and I/O region.
    60146014     */
    6015     rc = PDMDevHlpPCIRegister(pDevIns, &pThis->PciDev);
     6015    rc = PDMDevHlpPCIRegister(pDevIns, pPciDev);
    60166016    if (RT_FAILURE(rc))
    60176017        return rc;
     
    60266026    if (RT_FAILURE(rc))
    60276027    {
    6028         PCIDevSetCapabilityList(&pThis->PciDev, 0x0);
     6028        PDMPciDevSetCapabilityList(pPciDev, 0x0);
    60296029        /* That's OK, we can work without MSI */
    60306030    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette