VirtualBox

Changeset 4021 in vbox for trunk


Ignore:
Timestamp:
Aug 3, 2007 1:17:25 PM (18 years ago)
Author:
vboxsync
Message:

Preparations for shared folders status led.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r3891 r4021  
    219219    memset(mapIDELeds, 0, sizeof(mapIDELeds));
    220220    memset(mapNetworkLeds, 0, sizeof(mapNetworkLeds));
     221    memset(&mapSharedFolderLed, 0, sizeof(mapSharedFolderLed));
    221222
    222223#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
     
    18711872            /// @todo (r=dmik)
    18721873            //  USB_DEVICE_ACTIVITY
     1874            break;
     1875        }
     1876
     1877        case DeviceType_SharedFolderDevice:
     1878        {
     1879            SumLed.u32 |= readAndClearLed(mapSharedFolderLed);
    18731880            break;
    18741881        }
     
    56445651
    56455652    /*
     5653     * Attach the status driver.
     5654     */
     5655    rc = CFGMR3InsertNode(pInst,    "LUN#999", &pLunL0);                        RC_CHECK();
     5656    rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");      RC_CHECK();
     5657    rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
     5658    rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapSharedFolderLed); RC_CHECK();
     5659    rc = CFGMR3InsertInteger(pCfg,  "First",    0);                                 RC_CHECK();
     5660    rc = CFGMR3InsertInteger(pCfg,  "Last",     0);                                 RC_CHECK();
     5661
     5662    /*
    56465663     * Audio Sniffer Device
    56475664     */
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r4015 r4021  
    6060    /** Our VMM device connector interface. */
    6161    PDMIVMMDEVCONNECTOR         Connector;
     62
    6263#ifdef VBOX_HGCM
    6364    /** Pointer to the HGCM port interface of the driver/device above us. */
     
    6566    /** Our HGCM connector interface. */
    6667    PDMIHGCMCONNECTOR           HGCMConnector;
     68
     69    struct
     70    {
     71        /** The LED. */
     72        PDMLED                              Led;
     73        /** The LED ports. */
     74        PDMILEDPORTS                        ILeds;
     75        /** Partner of ILeds. */
     76        HCPTRTYPE(PPDMILEDCONNECTORS)       pLedsConnector;
     77    } SharedFolders;
     78
    6779#endif
    6880} DRVMAINVMMDEV, *PDRVMAINVMMDEV;
     
    463475            return &pDrv->HGCMConnector;
    464476#endif
     477        case PDMINTERFACE_LED_PORTS:
     478            /* Currently only for shared folders */
     479            return &pDrv->SharedFolders.ILeds;
    465480        default:
    466481            return NULL;
     
    468483}
    469484
     485/**
     486 * Gets the pointer to the status LED of a unit.
     487 *
     488 * @returns VBox status code.
     489 * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     490 * @param   iLUN            The unit which status LED we desire.
     491 * @param   ppLed           Where to store the LED pointer.
     492 */
     493static DECLCALLBACK(int) vmmdevQueryStatusLed(PPDMILEDPORTS pInterface, unsigned iLUN, PPDMLED *ppLed)
     494{
     495    PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);
     496    if (iLUN == 0)
     497    {
     498        *ppLed = &pDrv->SharedFolders.Led;
     499        return VINF_SUCCESS;
     500    }
     501    return VERR_PDM_LUN_NOT_FOUND;
     502}
    470503
    471504/**
     
    547580    pData->Connector.pfnQueryVisibleRegion            = vmmdevQueryVisibleRegion;
    548581
     582    pData->SharedFolders.Led.u32Magic                 = PDMLED_MAGIC;
     583    /* ILeds */
     584    pData->SharedFolders.ILeds.pfnQueryStatusLed      = vmmdevQueryStatusLed;
     585
    549586
    550587#ifdef VBOX_HGCM
     
    592629    if (VBOX_SUCCESS(rc))
    593630    {
     631        PPDMIBASE pBase;
     632
    594633        LogRel(("Shared Folders service loaded.\n"));
     634#if 0
     635        /*
     636         * Attach status driver (optional).
     637         */
     638        rc = PDMDrvHlpDriverAttach(pDrvIns, PDM_STATUS_LUN, &pDrvIns->IBase, &pBase, "Status Port");
     639        if (VBOX_SUCCESS(rc))
     640            pData->SharedFolders.pLedsConnector = (PPDMILEDCONNECTORS)
     641                pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
     642        else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
     643        {
     644            AssertMsgFailed(("Failed to attach to status driver. rc=%Vrc\n", rc));
     645            return rc;
     646        }
     647#endif
    595648    }
    596649    else
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r4015 r4021  
    494494    PPDMLED     mapIDELeds[4];
    495495    PPDMLED     mapNetworkLeds[8];
     496    PPDMLED     mapSharedFolderLed;
    496497#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    497498    Utf8Str     maTAPDeviceName[8];
Note: See TracChangeset for help on using the changeset viewer.

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