VirtualBox

Changeset 6050 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Dec 11, 2007 2:18:07 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
26687
Message:

getinfo EP and conf file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c

    r6043 r6050  
    6363static int VBoxAddSolarisIOCtl(dev_t Dev, int Cmd, intptr_t pArg, int mode, cred_t *pCred, int *pVal);
    6464
     65static int VBoxAddSolarisGetInfo(dev_info_t *pDip, ddi_info_cmd_t enmCmd, void *pArg, void **ppResult);
    6566static int VBoxAddSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd);
    6667static int VBoxAddSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t enmCmd);
     
    108109    DEVO_REV,               /* driver build revision */
    109110    0,                      /* ref count */
    110     nulldev,                /* get info */
     111    VBoxAddSolarisGetInfo,
    111112    nulldev,                /* identify */
    112113    nulldev,                /* probe */
     
    146147    /** PCI handle of VMMDev. */
    147148    ddi_acc_handle_t        PciHandle;
     149    /** IO port handle. */
     150    ddi_acc_handle_t        PciIOHandle;
     151    /** MMIO handle. */
     152    ddi_acc_handle_t        PciMMIOHandle;
    148153    /** Interrupt block cookie. */
    149154    ddi_iblock_cookie_t     BlockCookie;
     
    303308                                deviceAttr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
    304309                                deviceAttr.devacc_attr_access = DDI_DEFAULT_ACC;
    305                                 rc = ddi_regs_map_setup(pDip, 0, &baseAddr, 0, cbIOSize, &deviceAttr, &pState->PciHandle);
     310                                rc = ddi_regs_map_setup(pDip, 0, &baseAddr, 0, cbIOSize, &deviceAttr, &pState->PciIOHandle);
    306311                                if (rc == DDI_SUCCESS)
    307312                                {
    308313                                    pState->uIOPortBase = (uint16_t)*baseAddr;
    309                                     rc = ddi_regs_map_setup(pDip, 1, &baseAddr, 0, pState->cbMMIO, &deviceAttr, &pState->PciHandle);
     314                                    rc = ddi_regs_map_setup(pDip, 1, &baseAddr, 0, pState->cbMMIO, &deviceAttr, &pState->PciMMIOHandle);
    310315                                    if (rc == DDI_SUCCESS)
    311316                                    {
     
    341346                                        else
    342347                                            VBA_LOGNOTE("VBoxGuestSolarisAddIRQ failed.\n");
     348                                        ddi_regs_map_free(&pState->PciMMIOHandle);
    343349                                    }
    344350                                    else
    345351                                        VBA_LOGNOTE("ddi_regs_map_setup for MMIO region failed.\n");
    346                                     ddi_regs_map_free(&pState->PciHandle);
     352                                    ddi_regs_map_free(&pState->PciIOHandle);
    347353                                }
    348354                                else
     
    360366                }
    361367                else
    362                     VBA_LOGNOTE("pci_config_setup failed.\n");
     368                    VBA_LOGNOTE("pci_config_setup failed rc=%d.\n", rc);
    363369                RTSpinlockDestroy(g_Spinlock);
    364370                g_Spinlock = NIL_RTSPINLOCK;
     
    424430            return DDI_FAILURE;
    425431    }
     432}
     433
     434
     435/**
     436 * Info entry point, called by solaris kernel for obtaining driver info.
     437 *
     438 * @param   pDip            The module structure instance (do not use).
     439 * @param   enmCmd          Information request type.
     440 * @param   pArg            Type specific argument.
     441 * @param   ppResult        Where to store the requested info.
     442 *
     443 * @return  corresponding solaris error code.
     444 */
     445static int VBoxAddSolarisGetInfo(dev_info_t *pDip, ddi_info_cmd_t enmCmd, void *pArg, void **ppResult)
     446{
     447    VBA_LOGCONT("VBoxAddSolarisGetInfo\n");
     448
     449    int rc = DDI_SUCCESS;
     450    switch (enmCmd)
     451    {
     452        case DDI_INFO_DEVT2DEVINFO:
     453            *ppResult = (void *)g_pDip;
     454            break;
     455
     456        case DDI_INFO_DEVT2INSTANCE:
     457            *ppResult = (void *)ddi_get_instance(g_pDip);
     458            break;
     459
     460        default:
     461            rc = DDI_FAILURE;
     462            break;
     463    }
     464    return rc;
    426465}
    427466
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