Changeset 25966 in vbox for trunk/src/VBox/Devices/Parallel
- Timestamp:
- Jan 22, 2010 11:15:43 AM (15 years ago)
- Location:
- trunk/src/VBox/Devices/Parallel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Parallel/DevParallel.cpp
r25732 r25966 93 93 * Structures and Typedefs * 94 94 *******************************************************************************/ 95 /** 96 * Parallel device state. 97 * 98 * @implements PDMIBASE 99 * @implements PDMIHOSTPARALLELPORT 100 */ 95 101 typedef struct ParallelState 96 102 { … … 105 111 PPDMDEVINSRC pDevInsRC; 106 112 RTRCPTR Alignment0; /**< Alignment. */ 107 /** The base interface. */113 /** LUN\#0: The base interface. */ 108 114 PDMIBASE IBase; 109 /** The host device port interface. */115 /** LUN\#0: The host device port interface. */ 110 116 PDMIHOSTPARALLELPORT IHostParallelPort; 111 117 /** Pointer to the attached base driver. */ … … 644 650 } 645 651 646 /** @copydoc PIBASE::pfnqueryInterface */ 647 static DECLCALLBACK(void *) parallelQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface) 652 /** 653 * @interface_method_impl{PDMIBASE,pfnQueryInterface} 654 */ 655 static DECLCALLBACK(void *) parallelQueryInterface(PPDMIBASE pInterface, const char *pszIID) 648 656 { 649 657 ParallelState *pThis = PDMIBASE_2_PARALLELSTATE(pInterface); 650 switch (enmInterface) 651 { 652 case PDMINTERFACE_BASE: 653 return &pThis->IBase; 654 case PDMINTERFACE_HOST_PARALLEL_PORT: 655 return &pThis->IHostParallelPort; 656 default: 657 return NULL; 658 } 658 if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0) 659 return &pThis->IBase; 660 if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_HOST_PARALLEL_PORT) == 0) 661 return &pThis->IHostParallelPort; 662 return NULL; 659 663 } 660 664 -
trunk/src/VBox/Devices/Parallel/DrvHostParallel.cpp
r25893 r25966 7 7 8 8 /* 9 * Copyright (C) 2006-20 07Sun Microsystems, Inc.9 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 30 30 #include <iprt/asm.h> 31 31 #include <iprt/assert.h> 32 #include <iprt/file.h> 33 #include <iprt/semaphore.h> 32 34 #include <iprt/stream.h> 33 #include <iprt/semaphore.h> 34 #include <iprt/file.h> 35 #include <iprt/uuid.h> 35 36 36 37 #ifdef RT_OS_LINUX … … 48 49 #include "Builtins.h" 49 50 51 50 52 /******************************************************************************* 51 53 * Structures and Typedefs * … … 53 55 /** 54 56 * Host parallel port driver instance data. 57 * @implements PDMIHOSTPARALLELCONNECTOR 55 58 */ 56 59 typedef struct DRVHOSTPARALLEL … … 62 65 /** Our host device interface. */ 63 66 PDMIHOSTPARALLELCONNECTOR IHostParallelConnector; 64 /** Our host device port interface. */65 PDMIHOSTPARALLELPORT IHostParallelPort;66 67 /** Device Path */ 67 char 68 char *pszDevicePath; 68 69 /** Device Handle */ 69 70 RTFILE FileDevice; … … 78 79 /** Converts a pointer to DRVHOSTPARALLEL::IHostDeviceConnector to a PDRHOSTPARALLEL. */ 79 80 #define PDMIHOSTPARALLELCONNECTOR_2_DRVHOSTPARALLEL(pInterface) ( (PDRVHOSTPARALLEL)((uintptr_t)pInterface - RT_OFFSETOF(DRVHOSTPARALLEL, IHostParallelConnector)) ) 80 /** Converts a pointer to DRVHOSTPARALLEL::IHostDevicePort to a PDRHOSTPARALLEL. */ 81 #define PDMIHOSTPARALLELPORT_2_DRVHOSTPARALLEL(pInterface) ( (PDRVHOSTPARALLEL)((uintptr_t)pInterface - RT_OFFSETOF(DRVHOSTPARALLEL, IHostParallelPort)) ) 81 82 82 83 83 /* -=-=-=-=- IBase -=-=-=-=- */ 84 84 85 85 /** 86 * Queries an interface to the driver. 87 * 88 * @returns Pointer to interface. 89 * @returns NULL if the interface was not supported by the driver. 90 * @param pInterface Pointer to this interface structure. 91 * @param enmInterface The requested interface identification. 92 */ 93 static DECLCALLBACK(void *) drvHostParallelQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface) 94 { 95 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 96 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL); 97 switch (enmInterface) 98 { 99 case PDMINTERFACE_BASE: 100 return &pDrvIns->IBase; 101 case PDMINTERFACE_HOST_PARALLEL_CONNECTOR: 102 return &pThis->IHostParallelConnector; 103 default: 104 return NULL; 105 } 86 * @interface_method_impl{PDMIBASE,pfnQueryInterface} 87 */ 88 static DECLCALLBACK(void *) drvHostParallelQueryInterface(PPDMIBASE pInterface, const char *pszIID) 89 { 90 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 91 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL); 92 93 if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0) 94 return &pDrvIns->IBase; 95 if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_HOST_PARALLEL_CONNECTOR) == 0) 96 return &pThis->IHostParallelConnector; 97 return NULL; 106 98 } 107 99
Note:
See TracChangeset
for help on using the changeset viewer.