Changeset 4032 in vbox
- Timestamp:
- Aug 4, 2007 11:21:11 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/shflsvc.h
r3944 r4032 103 103 /** Remove shared folder mapping. */ 104 104 #define SHFL_FN_REMOVE_MAPPING (2) 105 /** Set the led status light address */ 106 #define SHFL_FN_SET_STATUS_LED (3) 105 107 106 108 /** @} */ … … 959 961 #define SHFL_CPARMS_REMOVE_MAPPING (1) 960 962 963 964 /** 965 * SHFL_FN_SET_STATUS_LED 966 */ 967 968 /** Parameters structure. */ 969 typedef struct _VBoxSFSetStatusLed 970 { 971 VBoxGuestHGCMCallInfo callInfo; 972 973 /** pointer, in: LED address 974 * Points to PPDMLED buffer. 975 */ 976 HGCMFunctionParameter led; 977 978 } VBoxSFSetStatusLed; 979 980 #define SHFL_CPARMS_SET_STATUS_LED (1) 981 961 982 /** @} */ 962 983 -
trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp
r3871 r4032 1461 1461 return &pData->HGCMPort; 1462 1462 #endif 1463 case PDMINTERFACE_LED_PORTS: 1464 /* Currently only for shared folders */ 1465 return &pData->SharedFolders.ILeds; 1463 1466 default: 1464 1467 return NULL; … … 1661 1664 1662 1665 return; 1666 } 1667 1668 /** 1669 * Gets the pointer to the status LED of a unit. 1670 * 1671 * @returns VBox status code. 1672 * @param pInterface Pointer to the interface structure containing the called function pointer. 1673 * @param iLUN The unit which status LED we desire. 1674 * @param ppLed Where to store the LED pointer. 1675 */ 1676 static DECLCALLBACK(int) vmmdevQueryStatusLed(PPDMILEDPORTS pInterface, unsigned iLUN, PPDMLED *ppLed) 1677 { 1678 VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1679 if (iLUN == 0) /* LUN 0 is shared folders */ 1680 { 1681 *ppLed = &pData->SharedFolders.Led; 1682 return VINF_SUCCESS; 1683 } 1684 return VERR_PDM_LUN_NOT_FOUND; 1663 1685 } 1664 1686 … … 1896 1918 pData->Port.pfnRequestSeamlessChange = vmmdevRequestSeamlessChange; 1897 1919 1920 /* Shared folder LED */ 1921 pData->SharedFolders.Led.u32Magic = PDMLED_MAGIC; 1922 pData->SharedFolders.ILeds.pfnQueryStatusLed = vmmdevQueryStatusLed; 1898 1923 1899 1924 #ifdef VBOX_HGCM … … 1927 1952 else 1928 1953 AssertMsgFailedReturn(("Failed to attach LUN #0! rc=%Vrc\n", rc), rc); 1954 1955 /* 1956 * Attach status driver for shared folders (optional). 1957 */ 1958 PPDMIBASE pBase; 1959 rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pData->Base, &pBase, "Status Port"); 1960 if (VBOX_SUCCESS(rc)) 1961 pData->SharedFolders.pLedsConnector = (PPDMILEDCONNECTORS) 1962 pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS); 1963 else if (rc != VERR_PDM_NO_ATTACHED_DRIVER) 1964 { 1965 AssertMsgFailed(("Failed to attach to status driver. rc=%Vrc\n", rc)); 1966 return rc; 1967 } 1929 1968 1930 1969 /* -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r3793 r4032 159 159 #endif /* VBOX_HGCM */ 160 160 161 /* Shared folders LED */ 162 struct 163 { 164 /** The LED. */ 165 PDMLED Led; 166 /** The LED ports. */ 167 PDMILEDPORTS ILeds; 168 /** Partner of ILeds. */ 169 HCPTRTYPE(PPDMILEDCONNECTORS) pLedsConnector; 170 } SharedFolders; 171 161 172 } VMMDevState; 162 173 -
trunk/src/VBox/HostServices/SharedFolders/service.cpp
r3954 r4032 30 30 #include <iprt/assert.h> 31 31 #include <VBox/ssm.h> 32 #include <VBox/pdm.h> 32 33 33 34 #define SHFL_SSM_VERSION 2 … … 73 74 74 75 PVBOXHGCMSVCHELPERS g_pHelpers; 75 76 static PPDMLED pStatusLed = NULL; 76 77 77 78 static DECLCALLBACK(int) svcUnload (void) … … 536 537 { 537 538 /* Execute the function. */ 539 if (pStatusLed) 540 { 541 Assert(pStatusLed->u32Magic == PDMLED_MAGIC); 542 pStatusLed->Asserted.s.fReading = pStatusLed->Actual.s.fReading = 1; 543 } 538 544 539 545 rc = vbsfRead (pClient, root, Handle, offset, &count, pBuffer); 546 if (pStatusLed) 547 pStatusLed->Actual.s.fReading = 0; 540 548 541 549 if (VBOX_SUCCESS(rc)) … … 593 601 { 594 602 /* Execute the function. */ 595 603 if (pStatusLed) 604 { 605 Assert(pStatusLed->u32Magic == PDMLED_MAGIC); 606 pStatusLed->Asserted.s.fWriting = pStatusLed->Actual.s.fWriting = 1; 607 } 608 596 609 rc = vbsfWrite (pClient, root, Handle, offset, &count, pBuffer); 610 if (pStatusLed) 611 pStatusLed->Actual.s.fWriting = 0; 597 612 598 613 if (VBOX_SUCCESS(rc)) … … 1153 1168 break; 1154 1169 } 1170 1171 case SHFL_FN_SET_STATUS_LED: 1172 { 1173 Log(("svcCall: SHFL_FN_SET_STATUS_LED\n")); 1174 1175 /* Verify parameter count and types. */ 1176 if (cParms != SHFL_CPARMS_SET_STATUS_LED) 1177 { 1178 rc = VERR_INVALID_PARAMETER; 1179 } 1180 else if ( paParms[0].type != VBOX_HGCM_SVC_PARM_PTR /* folder name */ 1181 ) 1182 { 1183 rc = VERR_INVALID_PARAMETER; 1184 } 1185 else 1186 { 1187 /* Fetch parameters. */ 1188 PPDMLED pLed = (PPDMLED)paParms[0].u.pointer.addr; 1189 uint32_t cbLed = paParms[0].u.pointer.size; 1190 1191 /* Verify parameters values. */ 1192 if ( (cbLed != sizeof (PDMLED)) 1193 ) 1194 { 1195 rc = VERR_INVALID_PARAMETER; 1196 } 1197 else 1198 { 1199 /* Execute the function. */ 1200 pStatusLed = pLed; 1201 rc = VINF_SUCCESS; 1202 } 1203 } 1204 break; 1205 } 1206 1155 1207 default: 1156 1208 rc = VERR_NOT_IMPLEMENTED; -
trunk/src/VBox/HostServices/SharedFolders/shfl.h
r3338 r4032 57 57 58 58 59 60 59 #endif /* __SHFL__H */ -
trunk/src/VBox/Main/VMMDevInterface.cpp
r4031 r4032 30 30 #include <VBox/VBoxDev.h> 31 31 #include <VBox/VBoxGuest.h> 32 #include <VBox/shflsvc.h> 32 33 #include <iprt/asm.h> 33 34 … … 591 592 if (VBOX_SUCCESS(rc)) 592 593 { 594 PPDMLED pLed; 595 PPDMILEDPORTS pLedPort; 596 593 597 LogRel(("Shared Folders service loaded.\n")); 598 pLedPort = (PPDMILEDPORTS)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_LED_PORTS); 599 if (!pLedPort) 600 { 601 AssertMsgFailed(("Configuration error: No LED port interface above!\n")); 602 return VERR_PDM_MISSING_INTERFACE_ABOVE; 603 } 604 rc = pLedPort->pfnQueryStatusLed(pLedPort, 0, &pLed); 605 if (VBOX_SUCCESS(rc) && pLed) 606 { 607 VBOXHGCMSVCPARM parm; 608 609 parm.type = VBOX_HGCM_SVC_PARM_PTR; 610 parm.u.pointer.addr = pLed; 611 parm.u.pointer.size = sizeof(*pLed); 612 613 rc = HGCMHostCall("VBoxSharedFolders", SHFL_FN_SET_STATUS_LED, 1, &parm); 614 } 615 else 616 AssertMsgFailed(("pfnQueryStatusLed failed with %Vrc (pLed=%x)\n", rc, pLed)); 594 617 } 595 618 else
Note:
See TracChangeset
for help on using the changeset viewer.