VirtualBox

Changeset 26313 in vbox


Ignore:
Timestamp:
Feb 5, 2010 11:20:10 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57384
Message:

fixed status LEDs for storage devices

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

Legend:

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

    r26300 r26313  
    288288    LogFlowThisFunc(("\n"));
    289289
    290     memset(mapFDLeds, 0, sizeof(mapFDLeds));
    291     memset(mapIDELeds, 0, sizeof(mapIDELeds));
    292     memset(mapSATALeds, 0, sizeof(mapSATALeds));
    293     memset(mapSCSILeds, 0, sizeof(mapSCSILeds));
     290    memset(mapStorageLeds, 0, sizeof(mapStorageLeds));
    294291    memset(mapNetworkLeds, 0, sizeof(mapNetworkLeds));
    295292    memset(&mapUSBLed, 0, sizeof(mapUSBLed));
    296293    memset(&mapSharedFolderLed, 0, sizeof(mapSharedFolderLed));
     294
     295    for (unsigned i = 0; i < RT_ELEMENTS(maStorageDevType); ++ i)
     296        maStorageDevType[i] = DeviceType_Null;
    297297
    298298    return S_OK;
     
    24352435    {
    24362436        case DeviceType_Floppy:
    2437         {
    2438             for (unsigned i = 0; i < RT_ELEMENTS(mapFDLeds); ++i)
    2439                 SumLed.u32 |= readAndClearLed(mapFDLeds[i]);
    2440             break;
    2441         }
    2442 
    24432437        case DeviceType_DVD:
    2444         {
    2445             SumLed.u32 |= readAndClearLed(mapIDELeds[2]);
    2446             break;
    2447         }
    2448 
    24492438        case DeviceType_HardDisk:
    24502439        {
    2451             SumLed.u32 |= readAndClearLed(mapIDELeds[0]);
    2452             SumLed.u32 |= readAndClearLed(mapIDELeds[1]);
    2453             SumLed.u32 |= readAndClearLed(mapIDELeds[3]);
    2454             for (unsigned i = 0; i < RT_ELEMENTS(mapSATALeds); ++i)
    2455                 SumLed.u32 |= readAndClearLed(mapSATALeds[i]);
    2456             for (unsigned i = 0; i < RT_ELEMENTS(mapSCSILeds); ++i)
    2457                 SumLed.u32 |= readAndClearLed(mapSCSILeds[i]);
     2440            for (unsigned i = 0; i < RT_ELEMENTS(mapStorageLeds); ++i)
     2441                if (maStorageDevType[i] == aDeviceType)
     2442                    SumLed.u32 |= readAndClearLed(mapStorageLeds[i]);
    24582443            break;
    24592444        }
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r26207 r26313  
    853853    for (size_t i = 0; i < ctrls.size(); ++ i)
    854854    {
     855        DeviceType_T *paLedDevType = NULL;
     856
    855857        StorageControllerType_T enmCtrlType;
    856858        rc = ctrls[i]->COMGETTER(ControllerType)(&enmCtrlType);                                 H();
     
    896898                rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");          RC_CHECK();
    897899                rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                               RC_CHECK();
    898                 rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapSCSILeds[0]); RC_CHECK();
     900                rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedScsi]); RC_CHECK();
    899901                rc = CFGMR3InsertInteger(pCfg,  "First",    0);                                 RC_CHECK();
     902                Assert(cLedScsi >= 16);
    900903                rc = CFGMR3InsertInteger(pCfg,  "Last",     15);                                RC_CHECK();
     904                paLedDevType = &pConsole->maStorageDevType[iLedScsi];
    901905                break;
    902906            }
     
    913917                rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");          RC_CHECK();
    914918                rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                               RC_CHECK();
    915                 rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapSCSILeds[0]); RC_CHECK();
     919                rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedScsi]); RC_CHECK();
    916920                rc = CFGMR3InsertInteger(pCfg,  "First",    0);                                 RC_CHECK();
     921                Assert(cLedScsi >= 16);
    917922                rc = CFGMR3InsertInteger(pCfg,  "Last",     15);                                RC_CHECK();
     923                paLedDevType = &pConsole->maStorageDevType[iLedScsi];
    918924                break;
    919925            }
     
    956962                rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");          RC_CHECK();
    957963                rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                               RC_CHECK();
    958                 AssertRelease(cPorts <= RT_ELEMENTS(pConsole->mapSATALeds));
    959                 rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapSATALeds[0]); RC_CHECK();
     964                AssertRelease(cPorts <= cLedSata);
     965                rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedSata]); RC_CHECK();
    960966                rc = CFGMR3InsertInteger(pCfg,  "First",    0);                                 RC_CHECK();
    961967                rc = CFGMR3InsertInteger(pCfg,  "Last",     cPorts - 1);                        RC_CHECK();
     968                paLedDevType = &pConsole->maStorageDevType[iLedSata];
    962969                break;
    963970            }
     
    980987                rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");          RC_CHECK();
    981988                rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                               RC_CHECK();
    982                 rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapIDELeds[0]);RC_CHECK();
     989                rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedIde]); RC_CHECK();
    983990                rc = CFGMR3InsertInteger(pCfg,  "First",    0);                                 RC_CHECK();
     991                Assert(cLedIde >= 4);
    984992                rc = CFGMR3InsertInteger(pCfg,  "Last",     3);                                 RC_CHECK();
     993                paLedDevType = &pConsole->maStorageDevType[iLedIde];
    985994
    986995                /* IDE flavors */
     
    10061015                rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");          RC_CHECK();
    10071016                rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                               RC_CHECK();
    1008                 rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapFDLeds[0]); RC_CHECK();
     1017                rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedFloppy]); RC_CHECK();
    10091018                rc = CFGMR3InsertInteger(pCfg,  "First",    0);                                 RC_CHECK();
     1019                Assert(cLedFloppy >= 1);
    10101020                rc = CFGMR3InsertInteger(pCfg,  "Last",     0);                                 RC_CHECK();
     1021                paLedDevType = &pConsole->maStorageDevType[iLedFloppy];
    10111022                break;
    10121023            }
     
    10251036                rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");          RC_CHECK();
    10261037                rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                               RC_CHECK();
    1027                 rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapSCSILeds[0]); RC_CHECK();
     1038                rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedScsi]); RC_CHECK();
    10281039                rc = CFGMR3InsertInteger(pCfg,  "First",    0);                                 RC_CHECK();
    1029                 rc = CFGMR3InsertInteger(pCfg,  "Last",     15);                                RC_CHECK();
     1040                Assert(cLedScsi >= 16);
     1041                rc = CFGMR3InsertInteger(pCfg,  "Last",     15)        ;                        RC_CHECK();
     1042                paLedDevType = &pConsole->maStorageDevType[iLedScsi];
    10301043                break;
    10311044            }
     
    12311244                }
    12321245            }
     1246
     1247            if (paLedDevType)
     1248                paLedDevType[uLUN] = lType;
    12331249        }
    12341250        H();
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r26186 r26313  
    579579    AudioSniffer * const mAudioSniffer;
    580580
    581     PPDMLED     mapFDLeds[2];
    582     PPDMLED     mapIDELeds[4];
    583     PPDMLED     mapSATALeds[30];
    584     PPDMLED     mapSCSILeds[16];
    585     PPDMLED     mapNetworkLeds[SchemaDefs::NetworkAdapterCount];
    586     PPDMLED     mapSharedFolderLed;
    587     PPDMLED     mapUSBLed[2];
     581    enum
     582    {
     583        iLedFloppy = 0,
     584        cLedFloppy = 1,
     585        iLedIde    = iLedFloppy + cLedFloppy,
     586        cLedIde    = 4,
     587        iLedSata   = iLedIde + cLedIde,
     588        cLedSata   = 30,
     589        iLedScsi   = iLedSata + cLedSata,
     590        cLedScsi   = 16
     591    };
     592    DeviceType_T maStorageDevType[cLedFloppy + cLedIde + cLedSata + cLedScsi];
     593    PPDMLED      mapStorageLeds[RT_ELEMENTS(maStorageDevType)];
     594    PPDMLED      mapNetworkLeds[SchemaDefs::NetworkAdapterCount];
     595    PPDMLED      mapSharedFolderLed;
     596    PPDMLED      mapUSBLed[2];
    588597#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
    589     Utf8Str     maTAPDeviceName[8];
    590     RTFILE      maTapFD[8];
     598    Utf8Str      maTAPDeviceName[8];
     599    RTFILE       maTapFD[8];
    591600#endif
    592601
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