VirtualBox

source: vbox/trunk/src/VBox/Devices/Parallel/DrvHostParallel.cpp@ 43454

最後變更 在這個檔案從43454是 43454,由 vboxsync 提交於 12 年 前

Devices/Parallel: Compilation error fix.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 36.9 KB
 
1/* $Id: DrvHostParallel.cpp 43454 2012-09-27 13:01:22Z vboxsync $ */
2/** @file
3 * VirtualBox Host Parallel Port Driver.
4 *
5 * Initial Linux-only code contributed by: Alexander Eichner
6 */
7
8/*
9 * Copyright (C) 2006-2012 Oracle Corporation
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.alldomusa.eu.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 */
19
20/*******************************************************************************
21* Header Files *
22*******************************************************************************/
23#define LOG_GROUP LOG_GROUP_DRV_HOST_PARALLEL
24#include <VBox/vmm/pdmdrv.h>
25#include <VBox/vmm/pdmthread.h>
26#include <iprt/asm.h>
27#include <iprt/assert.h>
28#include <iprt/file.h>
29#include <iprt/pipe.h>
30#include <iprt/semaphore.h>
31#include <iprt/stream.h>
32#include <iprt/uuid.h>
33#include <iprt/cdefs.h>
34#include <iprt/ctype.h>
35
36#ifdef RT_OS_LINUX
37# include <sys/ioctl.h>
38# include <sys/types.h>
39# include <sys/stat.h>
40# include <sys/poll.h>
41# include <fcntl.h>
42# include <unistd.h>
43# include <linux/ppdev.h>
44# include <linux/parport.h>
45# include <errno.h>
46#endif
47
48/** @def VBOX_WITH_WIN_PARPORT_SUP *
49 * Indicates whether to use the generic direct hardware access or host specific
50 * code to access the parallel port.
51 */
52#if defined(RT_OS_LINUX)
53# undef VBOX_WITH_WIN_PARPORT_SUP
54#elif defined(RT_OS_WINDOWS)
55#else
56# error "Not ported"
57#endif
58
59#if defined(VBOX_WITH_WIN_PARPORT_SUP) && defined(IN_RING0)
60# include <iprt/asm-amd64-x86.h>
61#endif
62
63#if defined(VBOX_WITH_WIN_PARPORT_SUP) && defined(IN_RING3)
64# include <Windows.h>
65# include <setupapi.h>
66# include <cfgmgr32.h>
67# include <iprt/mem.h>
68# include <iprt/string.h>
69#endif
70
71#include "VBoxDD.h"
72
73
74/*******************************************************************************
75* Structures and Typedefs *
76*******************************************************************************/
77/**
78 * Host parallel port driver instance data.
79 * @implements PDMIHOSTPARALLELCONNECTOR
80 */
81typedef struct DRVHOSTPARALLEL
82{
83 /** Pointer to the driver instance structure. */
84 PPDMDRVINS pDrvIns;
85 /** Pointer to the driver instance. */
86 PPDMDRVINSR3 pDrvInsR3;
87 PPDMDRVINSR0 pDrvInsR0;
88 /** Pointer to the char port interface of the driver/device above us. */
89 PPDMIHOSTPARALLELPORT pDrvHostParallelPort;
90 /** Our host device interface. */
91 PDMIHOSTPARALLELCONNECTOR IHostParallelConnector;
92 /** Our host device interface. */
93 PDMIHOSTPARALLELCONNECTOR IHostParallelConnectorR3;
94 /** Device Path */
95 char *pszDevicePath;
96 /** Device Handle */
97 RTFILE hFileDevice;
98#ifndef VBOX_WITH_WIN_PARPORT_SUP
99 /** Thread waiting for interrupts. */
100 PPDMTHREAD pMonitorThread;
101 /** Wakeup pipe read end. */
102 RTPIPE hWakeupPipeR;
103 /** Wakeup pipe write end. */
104 RTPIPE hWakeupPipeW;
105 /** Current mode the parallel port is in. */
106 PDMPARALLELPORTMODE enmModeCur;
107#endif
108
109#ifdef VBOX_WITH_WIN_PARPORT_SUP
110 /** Data register. */
111 uint32_t u32LptAddr;
112 /** Status register. */
113 uint32_t u32LptAddrStatus;
114 /** Control register. */
115 uint32_t u32LptAddrControl;
116 /** Data read buffer. */
117 uint8_t u8ReadIn;
118 /** Control read buffer. */
119 uint8_t u8ReadInControl;
120 /** Status read buffer. */
121 uint8_t u8ReadInStatus;
122 /** Parallel port name */
123 char szParportName[6];
124 /** Whether the parallel port is available or not. */
125 bool fParportAvail;
126 /** Device Handle */
127 RTFILE hWinFileDevice;
128#endif /* VBOX_WITH_WIN_PARPORT_SUP */
129} DRVHOSTPARALLEL, *PDRVHOSTPARALLEL;
130
131
132/**
133 * Ring-0 operations.
134 */
135typedef enum DRVHOSTPARALLELR0OP
136{
137 /** Invalid zero value. */
138 DRVHOSTPARALLELR0OP_INVALID = 0,
139 /** Perform R0 initialization. */
140 DRVHOSTPARALLELR0OP_INITR0STUFF,
141 /** Read data. */
142 DRVHOSTPARALLELR0OP_READ,
143 /** Read status register. */
144 DRVHOSTPARALLELR0OP_READSTATUS,
145 /** Read control register. */
146 DRVHOSTPARALLELR0OP_READCONTROL,
147 /** Write data. */
148 DRVHOSTPARALLELR0OP_WRITE,
149 /** Write control register. */
150 DRVHOSTPARALLELR0OP_WRITECONTROL,
151 /** Set port direction. */
152 DRVHOSTPARALLELR0OP_SETPORTDIRECTION
153} DRVHOSTPARALLELR0OP;
154
155/** Converts a pointer to DRVHOSTPARALLEL::IHostDeviceConnector to a PDRHOSTPARALLEL. */
156#define PDMIHOSTPARALLELCONNECTOR_2_DRVHOSTPARALLEL(pInterface) ( (PDRVHOSTPARALLEL)((uintptr_t)pInterface - RT_OFFSETOF(DRVHOSTPARALLEL, CTX_SUFF(IHostParallelConnector))) )
157
158
159/*******************************************************************************
160* Defined Constants And Macros *
161*******************************************************************************/
162#define CTRL_REG_OFFSET 2
163#define STATUS_REG_OFFSET 1
164#define LPT_CONTROL_ENABLE_BIDIRECT 0x20
165
166
167
168#ifdef VBOX_WITH_WIN_PARPORT_SUP
169# ifdef IN_RING0
170
171/**
172 * R0 mode function to write byte value to data port.
173 * @returns VBox status code.
174 * @param pDrvIns Driver instance.
175 * @param u64Arg Data to be written to data register.
176 *
177 */
178static int drvR0HostParallelReqWrite(PPDMDRVINS pDrvIns, uint64_t u64Arg)
179{
180 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
181 LogFlowFunc(("write to data port=%#x val=%#x\n", pThis->u32LptAddr, u64Arg));
182 ASMOutU8(pThis->u32LptAddr, (uint8_t)(u64Arg));
183 return VINF_SUCCESS;
184}
185
186/**
187 * R0 mode function to write byte value to parallel port control
188 * register.
189 * @returns VBox status code.
190 * @param pDrvIns Driver instance.
191 * @param u64Arg Data to be written to control register.
192 */
193static int drvR0HostParallelReqWriteControl(PPDMDRVINS pDrvIns, uint64_t u64Arg)
194{
195 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
196 LogFlowFunc(("write to ctrl port=%#x val=%#x\n", pThis->u32LptAddrControl, u64Arg));
197 ASMOutU8(pThis->u32LptAddrControl, (uint8_t)(u64Arg));
198 return VINF_SUCCESS;
199}
200
201/**
202 * R0 mode function to ready byte value from the parallel port
203 * data register
204 * @returns VBox status code.
205 * @param pDrvIns Driver instance.
206 * @param u64Arg Not used.
207 */
208static int drvR0HostParallelReqRead(PPDMDRVINS pDrvIns, uint64_t u64Arg)
209{
210 uint8_t u8Data;
211 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
212 u8Data = ASMInU8(pThis->u32LptAddr);
213 LogFlowFunc(("read from data port=%#x val=%#x\n", pThis->u32LptAddr, u8Data));
214 pThis->u8ReadIn = u8Data;
215 return VINF_SUCCESS;
216}
217
218/**
219 * R0 mode function to ready byte value from the parallel port
220 * control register.
221 * @returns VBox status code.
222 * @param pDrvIns Driver instance.
223 * @param u64Arg Not used.
224 */
225static int drvR0HostParallelReqReadControl(PPDMDRVINS pDrvIns, uint64_t u64Arg)
226{
227 uint8_t u8Data;
228 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
229 u8Data = ASMInU8(pThis->u32LptAddrControl);
230 LogFlowFunc(("read from ctrl port=%#x val=%#x\n", pThis->u32LptAddr, u8Data));
231 pThis->u8ReadInControl = u8Data;
232 return VINF_SUCCESS;
233}
234
235/**
236 * R0 mode function to ready byte value from the parallel port
237 * status register.
238 * @returns VBox status code.
239 * @param pDrvIns Driver instance.
240 * @param u64Arg Not used.
241 */
242static int drvR0HostParallelReqReadStatus(PPDMDRVINS pDrvIns, uint64_t u64Arg)
243{
244 uint8_t u8Data;
245 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
246 u8Data = ASMInU8(pThis->u32LptAddrStatus);
247 LogFlowFunc(("read from status port=%#x val=%#x\n", pThis->u32LptAddr, u8Data));
248 pThis->u8ReadInStatus = u8Data;
249 return VINF_SUCCESS;
250}
251
252/**
253 * R0 mode function to set the direction of parallel port -
254 * operate in bidirectional mode or single direction.
255 * @returns VBox status code.
256 * @param pDrvIns Driver instance.
257 * @param u64Arg Mode.
258 */
259static int drvR0HostParallelReqSetPortDir(PPDMDRVINS pDrvIns, uint64_t u64Arg)
260{
261 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
262 uint8_t u8ReadControlVal;
263 uint8_t u8WriteControlVal;
264
265 if (u64Arg)
266 {
267 u8ReadControlVal = ASMInU8(pThis->u32LptAddrControl);
268 u8WriteControlVal = u8ReadControlVal | LPT_CONTROL_ENABLE_BIDIRECT; /* enable input direction */
269 ASMOutU8(pThis->u32LptAddrControl, u8WriteControlVal);
270 }
271 else
272 {
273 u8ReadControlVal = ASMInU8(pThis->u32LptAddrControl);
274 u8WriteControlVal = u8ReadControlVal & ~LPT_CONTROL_ENABLE_BIDIRECT; /* disable input direction */
275 ASMOutU8(pThis->u32LptAddrControl, u8WriteControlVal);
276 }
277 return VINF_SUCCESS;
278}
279
280/**
281 * @interface_method_impl{FNPDMDRVREQHANDLERR0}
282 */
283PDMBOTHCBDECL(int) drvR0HostParallelReqHandler(PPDMDRVINS pDrvIns, uint32_t uOperation, uint64_t u64Arg)
284{
285 int rc;
286
287 LogFlowFuncEnter();
288 /* I have included break after each case. Need to work on this. */
289 switch ((DRVHOSTPARALLELR0OP)uOperation)
290 {
291 case DRVHOSTPARALLELR0OP_READ:
292 rc = drvR0HostParallelReqRead(pDrvIns, u64Arg);
293 break;
294 case DRVHOSTPARALLELR0OP_READSTATUS:
295 rc = drvR0HostParallelReqReadStatus(pDrvIns, u64Arg);
296 break;
297 case DRVHOSTPARALLELR0OP_READCONTROL:
298 rc = drvR0HostParallelReqReadControl(pDrvIns, u64Arg);
299 break;
300 case DRVHOSTPARALLELR0OP_WRITE:
301 rc = drvR0HostParallelReqWrite(pDrvIns, u64Arg);
302 break;
303 case DRVHOSTPARALLELR0OP_WRITECONTROL:
304 rc = drvR0HostParallelReqWriteControl(pDrvIns, u64Arg);
305 break;
306 case DRVHOSTPARALLELR0OP_SETPORTDIRECTION:
307 rc = drvR0HostParallelReqSetPortDir(pDrvIns, u64Arg);
308 break;
309 default: /* not supported */
310 rc = VERR_NOT_SUPPORTED;
311 }
312 LogFlowFuncLeave();
313 return rc;
314}
315
316# endif /* IN_RING0 */
317#endif /* VBOX_WITH_WIN_PARPORT_SUP */
318
319#ifdef IN_RING3
320# ifdef VBOX_WITH_WIN_PARPORT_SUP
321
322/**
323 * Find IO port range for the parallel port and return the lower address.
324 *
325 * @returns parallel port IO address.
326 * @param DevInst Device Instance for parallel port.
327 */
328static uint32_t drvHostWinFindIORangeResource(const DEVINST DevInst)
329{
330 uint8_t *pBuf = NULL;
331 short wHeaderSize;
332 uint32_t u32Size;
333 CONFIGRET cmRet;
334 LOG_CONF firstLogConf;
335 LOG_CONF nextLogConf;
336 RES_DES rdPrevResDes;
337 uint32_t u32ParportAddr = 0;
338
339 wHeaderSize = sizeof(IO_DES);
340 cmRet = CM_Get_First_Log_Conf(&firstLogConf, DevInst, ALLOC_LOG_CONF);
341 if (cmRet != CR_SUCCESS)
342 {
343 cmRet = CM_Get_First_Log_Conf(&firstLogConf, DevInst, BOOT_LOG_CONF);
344 if (cmRet != CR_SUCCESS)
345 return 0;
346 }
347 cmRet = CM_Get_Next_Res_Des(&nextLogConf, firstLogConf, 2, 0L, 0L);
348 if (cmRet != CR_SUCCESS)
349 {
350 CM_Free_Res_Des_Handle(firstLogConf);
351 return 0;
352 }
353
354 for (;;)
355 {
356 u32Size = 0;
357 cmRet = CM_Get_Res_Des_Data_Size((PULONG)(&u32Size), nextLogConf, 0L);
358 if (cmRet != CR_SUCCESS)
359 {
360 LogFlowFunc(("Failed to get Size \n"));
361 CM_Free_Res_Des_Handle(nextLogConf);
362 break;
363 }
364
365 pBuf = (uint8_t *)RTMemAlloc(u32Size + 1);
366 if (!pBuf)
367 {
368 LogFlowFunc(("Failed to get Buf %d\n", u32Size));
369 CM_Free_Res_Des_Handle(nextLogConf);
370 break;
371 }
372 cmRet = CM_Get_Res_Des_Data(nextLogConf, pBuf, u32Size, 0L);
373 if (cmRet != CR_SUCCESS)
374 {
375 LogFlowFunc(("Failed to get Des Data \n"));
376 CM_Free_Res_Des_Handle(nextLogConf);
377 if (pBuf)
378 RTMemFree(pBuf);
379 break;
380 }
381
382 LogFlowFunc(("call GetIOResource\n"));
383 if (pBuf)
384 u32ParportAddr = ((IO_DES *)pBuf)->IOD_Alloc_Base;
385 else
386 LogFlowFunc(("pBuf Not Available \n"));
387 LogFlowFunc(("called GetIOResource, ret=%#x\n", u32ParportAddr));
388 rdPrevResDes = 0;
389 cmRet = CM_Get_Next_Res_Des(&rdPrevResDes,
390 nextLogConf,
391 2,
392 0L,
393 0L);
394 if (pBuf)
395 RTMemFree(pBuf);
396 if (cmRet != CR_SUCCESS)
397 break;
398
399 CM_Free_Res_Des_Handle(nextLogConf);
400 nextLogConf = rdPrevResDes;
401 }
402 CM_Free_Res_Des_Handle(nextLogConf);
403 LogFlowFunc(("return u32ParportAddr=%#x", u32ParportAddr));
404 return u32ParportAddr;
405}
406
407/**
408 * Get Parallel port address and update the shared data
409 * structure.
410 * @returns VBox status code.
411 * @param pThis The host parallel port instance data.
412 */
413static int drvWinHostGetparportAddr(PDRVHOSTPARALLEL pThis)
414{
415 HDEVINFO hDevInfo;
416 SP_DEVINFO_DATA DeviceInfoData;
417 uint32_t u32Idx;
418 uint32_t u32ParportAddr;
419 int rc = VINF_SUCCESS;
420
421 hDevInfo = SetupDiGetClassDevs(NULL, 0, 0, DIGCF_PRESENT | DIGCF_ALLCLASSES);
422 if (hDevInfo == INVALID_HANDLE_VALUE)
423 {
424 LogFlowFunc(("Invalid Handle \n"));
425 return VERR_INVALID_HANDLE;
426 }
427
428 /* Enumerate through all devices in Set. */
429 DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
430 for (u32Idx = 0; SetupDiEnumDeviceInfo(hDevInfo, u32Idx, &DeviceInfoData); u32Idx++)
431 {
432 DWORD dwDataType;
433 uint8_t *pBuf = NULL;
434 DWORD dwBufSize = 0;
435
436 while (!SetupDiGetDeviceRegistryProperty(hDevInfo, &DeviceInfoData, SPDRP_FRIENDLYNAME,
437 (PDWORD)&dwDataType, (uint8_t *)pBuf,
438 dwBufSize, (PDWORD)&dwBufSize))
439 {
440 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
441 {
442 LogFlow(("ERROR_INSUFF_BUFF = %d. dwBufSz = %d\n", GetLastError(), dwBufSize));
443 if (pBuf)
444 RTMemFree(pBuf);
445 /* Max size will never be more than 2048 bytes */
446 if (dwBufSize > 1024 || dwBufSize < 0)
447 dwBufSize = 1024;
448 pBuf = (uint8_t *)RTMemAlloc(dwBufSize * 2);
449 }
450 else
451 {
452 LogFlow(("GetDevProp Error = %d & dwBufSz = %d\n", GetLastError(), dwBufSize));
453 break;
454 }
455 }
456 if(pBuf)
457 LogFlowFunc(("Got Device Entity %s\n", pBuf));
458 if (RTStrStr((char*)pBuf, "LPT"))
459 {
460 u32ParportAddr = drvHostWinFindIORangeResource(DeviceInfoData.DevInst);
461 if (u32ParportAddr)
462 {
463 /* Find parallel port name and update the shared data struncture */
464 char *pCh = RTStrStr((char*)pBuf, "(");
465 char *pTmpCh = RTStrStr((char *)pBuf, ")");
466 /* check for the confirmation for the availability of parallel port */
467 if (!(pCh && pTmpCh))
468 {
469 LogFlowFunc(("Parallel port Not Found. \n"));
470 return VERR_NOT_FOUND;
471
472 }
473 if (((pTmpCh - (char *)pBuf) - (pCh - (char *)pBuf)) < 0) {
474 LogFlowFunc(("Parallel port string not properly formatted.\n"));
475 return VERR_NOT_FOUND;
476 }
477 /* check for the confirmation for the availability of parallel port */
478 if (RTStrCopyEx((char *)(pThis->szParportName), sizeof(pThis->szParportName),
479 pCh+1, ((pTmpCh - (char *)pBuf) - (pCh - (char *)pBuf)) - 1))
480 {
481 LogFlowFunc(("Parallel Port Not Found.\n"));
482 return VERR_NOT_FOUND;
483 }
484 *((char *)pThis->szParportName + (pTmpCh - (char *)pBuf) - (pCh - (char *)pBuf) + 1 ) = '\0';
485
486 /* checking again to make sure that we have got a valid name and in valid format too. */
487 if (RTStrNCmp((char *)pThis->szParportName, "LPT", 3)) {
488 LogFlowFunc(("Parallel Port name \"LPT\" Not Found.\n"));
489 return VERR_NOT_FOUND;
490 }
491 if (!RTStrStr((char *)pThis->szParportName, "LPT")
492 || !(pThis->szParportName[3] >= '0'
493 && pThis->szParportName[3] <= '9'))
494 {
495 RT_BZERO(pThis->szParportName, sizeof(pThis->szParportName));
496 LogFlowFunc(("Printer Port Name Not Found.\n"));
497 return VERR_NOT_FOUND;
498 }
499 pThis->fParportAvail = true;
500 pThis->u32LptAddr = u32ParportAddr;
501 pThis->u32LptAddrControl = pThis->u32LptAddr + CTRL_REG_OFFSET;
502 pThis->u32LptAddrStatus = pThis->u32LptAddr + STATUS_REG_OFFSET;
503 }
504 else
505 LogFlowFunc(("u32Parport Addr No Available \n"));
506 if (pThis->fParportAvail)
507 {
508 LogFlow(("Parport found . Break from inner loop \n"));
509 break;
510 }
511 }
512 else
513 {
514 LogFlow(("LPT: Parallel Port not available \n"));
515 }
516 if (pBuf)
517 RTMemFree(pBuf);
518 if (pThis->fParportAvail)
519 {
520 LogFlow(("Parport Available. Break from outer loop \n"));
521 /* Parallel port address has been found. No need to iterate further. */
522 break;
523 }
524 }
525
526 if (GetLastError() != NO_ERROR && GetLastError() != ERROR_NO_MORE_ITEMS)
527 rc = VERR_GENERAL_FAILURE;
528
529 SetupDiDestroyDeviceInfoList(hDevInfo);
530 return rc;
531
532}
533# endif /* VBOX_WITH_WIN_PARPORT_SUP */
534
535/**
536 * Changes the current mode of the host parallel port.
537 *
538 * @returns VBox status code.
539 * @param pThis The host parallel port instance data.
540 * @param enmMode The mode to change the port to.
541 */
542static int drvHostParallelSetMode(PDRVHOSTPARALLEL pThis, PDMPARALLELPORTMODE enmMode)
543{
544 int iMode = 0;
545 int rc = VINF_SUCCESS;
546 LogFlowFunc(("mode=%d\n", enmMode));
547
548# ifndef VBOX_WITH_WIN_PARPORT_SUP
549 int rcLnx;
550 if (pThis->enmModeCur != enmMode)
551 {
552 switch (enmMode)
553 {
554 case PDM_PARALLEL_PORT_MODE_SPP:
555 iMode = IEEE1284_MODE_COMPAT;
556 break;
557 case PDM_PARALLEL_PORT_MODE_EPP_DATA:
558 iMode = IEEE1284_MODE_EPP | IEEE1284_DATA;
559 break;
560 case PDM_PARALLEL_PORT_MODE_EPP_ADDR:
561 iMode = IEEE1284_MODE_EPP | IEEE1284_ADDR;
562 break;
563 case PDM_PARALLEL_PORT_MODE_ECP:
564 case PDM_PARALLEL_PORT_MODE_INVALID:
565 default:
566 return VERR_NOT_SUPPORTED;
567 }
568
569 rcLnx = ioctl(RTFileToNative(pThis->hFileDevice), PPSETMODE, &iMode);
570 if (RT_UNLIKELY(rcLnx < 0))
571 rc = RTErrConvertFromErrno(errno);
572 else
573 pThis->enmModeCur = enmMode;
574 }
575
576 return rc;
577# else /* VBOX_WITH_WIN_PARPORT_SUP */
578 return VINF_SUCCESS;
579# endif /* VBOX_WITH_WIN_PARPORT_SUP */
580}
581
582/* -=-=-=-=- IBase -=-=-=-=- */
583
584/**
585 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
586 */
587static DECLCALLBACK(void *) drvHostParallelQueryInterface(PPDMIBASE pInterface, const char *pszIID)
588{
589 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
590 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
591
592 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
593 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHOSTPARALLELCONNECTOR, &pThis->CTX_SUFF(IHostParallelConnector));
594 return NULL;
595}
596
597
598/* -=-=-=-=- IHostDeviceConnector -=-=-=-=- */
599
600/** @copydoc PDMICHARCONNECTOR::pfnWrite */
601static DECLCALLBACK(int) drvHostParallelWrite(PPDMIHOSTPARALLELCONNECTOR pInterface, const void *pvBuf, size_t cbWrite, PDMPARALLELPORTMODE enmMode)
602{
603 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
604 //PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
605 PDRVHOSTPARALLEL pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPARALLEL, CTX_SUFF(IHostParallelConnector));
606 int rc = VINF_SUCCESS;
607 int rcLnx = 0;
608
609 LogFlowFunc(("pvBuf=%#p cbWrite=%d\n", pvBuf, cbWrite));
610
611 rc = drvHostParallelSetMode(pThis, enmMode);
612 if (RT_FAILURE(rc))
613 return rc;
614# ifndef VBOX_WITH_WIN_PARPORT_SUP
615 if (enmMode == PDM_PARALLEL_PORT_MODE_SPP)
616 {
617 /* Set the data lines directly. */
618 rcLnx = ioctl(RTFileToNative(pThis->hFileDevice), PPWDATA, pvBuf);
619 }
620 else
621 {
622 /* Use write interface. */
623 rcLnx = write(RTFileToNative(pThis->hFileDevice), pvBuf, cbWrite);
624 }
625 if (RT_UNLIKELY(rcLnx < 0))
626 rc = RTErrConvertFromErrno(errno);
627# else /* VBOX_WITH_WIN_PARPORT_SUP */
628 if (!pThis->fParportAvail)
629 LogFlowFunc(("Parport Not Available\n"));
630 //if (pThis->fParportAvail)
631 {
632 for (size_t i = 0; i < cbWrite; i++)
633 {
634 uint64_t u64Data = (uint8_t) *((uint8_t *)(pvBuf) + i);
635 LogFlowFunc(("calling R0 to write to parallel port, data=%#x\n", u64Data));
636 rc = PDMDrvHlpCallR0(pThis->CTX_SUFF(pDrvIns), DRVHOSTPARALLELR0OP_WRITE, u64Data);
637 AssertRC(rc);
638 }
639 }
640# endif /* VBOX_WITH_WIN_PARPORT_SUP */
641 return rc;
642}
643
644/**
645 * @interface_method_impl{PDMIBASE,pfnRead}
646 */
647static DECLCALLBACK(int) drvHostParallelRead(PPDMIHOSTPARALLELCONNECTOR pInterface, void *pvBuf, size_t cbRead, PDMPARALLELPORTMODE enmMode)
648{
649 PDRVHOSTPARALLEL pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPARALLEL, CTX_SUFF(IHostParallelConnector));
650 int rc = VINF_SUCCESS;
651
652# ifndef VBOX_WITH_WIN_PARPORT_SUP
653 int rcLnx = 0;
654 LogFlowFunc(("pvBuf=%#p cbRead=%d\n", pvBuf, cbRead));
655
656 rc = drvHostParallelSetMode(pThis, enmMode);
657 if (RT_FAILURE(rc))
658 return rc;
659
660 if (enmMode == PDM_PARALLEL_PORT_MODE_SPP)
661 {
662 /* Set the data lines directly. */
663 rcLnx = ioctl(RTFileToNative(pThis->hFileDevice), PPWDATA, pvBuf);
664 }
665 else
666 {
667 /* Use write interface. */
668 rcLnx = read(RTFileToNative(pThis->hFileDevice), pvBuf, cbRead);
669 }
670 if (RT_UNLIKELY(rcLnx < 0))
671 rc = RTErrConvertFromErrno(errno);
672# else /* VBOX_WITH_WIN_PARPORT_SUP */
673 if (!pThis->fParportAvail)
674 LogFlowFunc(("Parport Not Available\n"));
675 //if (pThis->fParportAvail)
676 {
677 *((uint8_t*)(pvBuf)) = 0; /* Initialize the buffer. */
678 for (size_t i = 0; i < cbRead; i++)
679 {
680 LogFlowFunc(("calling R0 to read from parallel port\n"));
681 int rc = PDMDrvHlpCallR0(pThis->CTX_SUFF(pDrvIns), DRVHOSTPARALLELR0OP_READ, 0);
682 AssertRC(rc);
683 *((uint8_t *)pvBuf + i) = (uint8_t)pThis->u8ReadIn;
684 }
685 }
686# endif /* VBOX_WITH_WIN_PARPORT_SUP */
687 return rc;
688}
689
690static DECLCALLBACK(int) drvHostParallelSetPortDirection(PPDMIHOSTPARALLELCONNECTOR pInterface, bool fForward)
691{
692 PDRVHOSTPARALLEL pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPARALLEL, CTX_SUFF(IHostParallelConnector));
693 int rc = VINF_SUCCESS;
694 int iMode = 0;
695 if (!fForward)
696 iMode = 1;
697# ifndef VBOX_WITH_WIN_PARPORT_SUP
698 int rcLnx = ioctl(RTFileToNative(pThis->hFileDevice), PPDATADIR, &iMode);
699 if (RT_UNLIKELY(rcLnx < 0))
700 rc = RTErrConvertFromErrno(errno);
701
702# else /* VBOX_WITH_WIN_PARPORT_SUP */
703 uint64_t u64Data;
704 u64Data = (uint8_t)iMode;
705 if (!pThis->fParportAvail)
706 LogFlowFunc(("Parport Not available\n"));
707 //if (pThis->fParportAvail)
708 {
709 LogFlowFunc(("calling R0 to SetPortDirection, data=%#x\n", u64Data));
710 rc = PDMDrvHlpCallR0(pThis->CTX_SUFF(pDrvIns), DRVHOSTPARALLELR0OP_SETPORTDIRECTION, u64Data);
711 AssertRC(rc);
712 }
713# endif /* VBOX_WITH_WIN_PARPORT_SUP */
714 return rc;
715}
716
717/**
718 * @interface_method_impl{PDMIBASE,pfnWriteControl}
719 */
720static DECLCALLBACK(int) drvHostParallelWriteControl(PPDMIHOSTPARALLELCONNECTOR pInterface, uint8_t fReg)
721{
722 PDRVHOSTPARALLEL pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPARALLEL, CTX_SUFF(IHostParallelConnector));
723 int rc = VINF_SUCCESS;
724 int rcLnx = 0;
725
726 LogFlowFunc(("fReg=%#x\n", fReg));
727# ifndef VBOX_WITH_WIN_PARPORT_SUP
728 rcLnx = ioctl(RTFileToNative(pThis->hFileDevice), PPWCONTROL, &fReg);
729 if (RT_UNLIKELY(rcLnx < 0))
730 rc = RTErrConvertFromErrno(errno);
731# else /* VBOX_WITH_WIN_PARPORT_SUP */
732 uint64_t u64Data;
733 u64Data = (uint8_t)fReg;
734 if (!pThis->fParportAvail)
735 LogFlowFunc(("Parport Not Available\n"));
736 //if (pThis->fParportAvail)
737 {
738 LogFlowFunc(("calling R0 to write CTRL, data=%#x\n", u64Data));
739 rc = PDMDrvHlpCallR0(pThis->CTX_SUFF(pDrvIns), DRVHOSTPARALLELR0OP_WRITECONTROL, u64Data);
740 AssertRC(rc);
741 }
742# endif /* VBOX_WITH_WIN_PARPORT_SUP */
743 return rc;
744}
745
746
747/**
748 * @interface_method_impl{PDMIBASE,pfnReadControl}
749 */
750static DECLCALLBACK(int) drvHostParallelReadControl(PPDMIHOSTPARALLELCONNECTOR pInterface, uint8_t *pfReg)
751{
752 PDRVHOSTPARALLEL pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPARALLEL, CTX_SUFF(IHostParallelConnector));
753 int rc = VINF_SUCCESS;
754 int rcLnx = 0;
755 uint8_t fReg = 0;
756
757# ifndef VBOX_WITH_WIN_PARPORT_SUP
758 rcLnx = ioctl(RTFileToNative(pThis->hFileDevice), PPRCONTROL, &fReg);
759 if (RT_UNLIKELY(rcLnx < 0))
760 rc = RTErrConvertFromErrno(errno);
761 else
762 {
763 LogFlowFunc(("fReg=%#x\n", fReg));
764 *pfReg = fReg;
765 }
766# else /* VBOX_WITH_WIN_PARPORT_SUP */
767 *pfReg = 0; /* Initialize the buffer*/
768 if (!pThis->fParportAvail)
769 LogFlowFunc(("Parport Not Available\n"));
770 //if (pThis->fParportAvail)
771 {
772 LogFlowFunc(("calling R0 to read control from parallel port\n"));
773 rc = PDMDrvHlpCallR0(pThis-> CTX_SUFF(pDrvIns), DRVHOSTPARALLELR0OP_READCONTROL, 0);
774 AssertRC(rc);
775 *pfReg = pThis->u8ReadInControl;
776 }
777# endif /* VBOX_WITH_WIN_PARPORT_SUP */
778 return rc;
779}
780
781/**
782 * @interface_method_impl{PDMIBASE,pfnReadStatus}
783 */
784static DECLCALLBACK(int) drvHostParallelReadStatus(PPDMIHOSTPARALLELCONNECTOR pInterface, uint8_t *pfReg)
785{
786 PDRVHOSTPARALLEL pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPARALLEL, CTX_SUFF(IHostParallelConnector));
787 int rc = VINF_SUCCESS;
788 int rcLnx = 0;
789 uint8_t fReg = 0;
790 LogFlowFunc(("%d Status Reg\n", *pfReg));
791# ifndef VBOX_WITH_WIN_PARPORT_SUP
792 rcLnx = ioctl(RTFileToNative(pThis->hFileDevice), PPRSTATUS, &fReg);
793 if (RT_UNLIKELY(rcLnx < 0))
794 rc = RTErrConvertFromErrno(errno);
795 else
796 {
797 LogFlowFunc(("fReg=%#x\n", fReg));
798 *pfReg = fReg;
799 }
800# else /* VBOX_WITH_WIN_PARPORT_SUP */
801 *pfReg = 0; /* Intialize the buffer. */
802 if (!pThis->fParportAvail)
803 LogFlowFunc(("fParport Not Available.. Error!!!!!!!!!! \n"));
804 //if (pThis->fParportAvail)
805 {
806 LogFlowFunc(("calling R0 to read status from parallel port. fParport should be available\n"));
807 rc = PDMDrvHlpCallR0(pThis->CTX_SUFF(pDrvIns), DRVHOSTPARALLELR0OP_READSTATUS, 0);
808 AssertRC(rc);
809 LogFlow(("value read from status = %d\n", *pfReg));
810 *pfReg = pThis->u8ReadInStatus;
811 }
812
813# endif /* VBOX_WITH_WIN_PARPORT_SUP */
814 return rc;
815}
816
817# ifndef VBOX_WITH_WIN_PARPORT_SUP
818
819static DECLCALLBACK(int) drvHostParallelMonitorThread(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
820{
821 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
822 struct pollfd aFDs[2];
823
824 /*
825 * We can wait for interrupts using poll on linux hosts.
826 */
827 while (pThread->enmState == PDMTHREADSTATE_RUNNING)
828 {
829 int rc;
830
831 aFDs[0].fd = RTFileToNative(pThis->hFileDevice);
832 aFDs[0].events = POLLIN;
833 aFDs[0].revents = 0;
834 aFDs[1].fd = RTPipeToNative(pThis->hWakeupPipeR);
835 aFDs[1].events = POLLIN | POLLERR | POLLHUP;
836 aFDs[1].revents = 0;
837 rc = poll(aFDs, RT_ELEMENTS(aFDs), -1);
838 if (rc < 0)
839 {
840 AssertMsgFailed(("poll failed with rc=%d\n", RTErrConvertFromErrno(errno)));
841 return RTErrConvertFromErrno(errno);
842 }
843
844 if (pThread->enmState != PDMTHREADSTATE_RUNNING)
845 break;
846 if (rc > 0 && aFDs[1].revents)
847 {
848 if (aFDs[1].revents & (POLLHUP | POLLERR | POLLNVAL))
849 break;
850 /* notification to terminate -- drain the pipe */
851 char ch;
852 size_t cbRead;
853 RTPipeRead(pThis->hWakeupPipeR, &ch, 1, &cbRead);
854 continue;
855 }
856
857 /* Interrupt occurred. */
858 rc = pThis->pDrvHostParallelPort->pfnNotifyInterrupt(pThis->pDrvHostParallelPort);
859 AssertRC(rc);
860 }
861
862 return VINF_SUCCESS;
863}
864
865/**
866 * Unblock the monitor thread so it can respond to a state change.
867 *
868 * @returns a VBox status code.
869 * @param pDrvIns The driver instance.
870 * @param pThread The send thread.
871 */
872static DECLCALLBACK(int) drvHostParallelWakeupMonitorThread(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
873{
874 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
875 size_t cbIgnored;
876 return RTPipeWrite(pThis->hWakeupPipeW, "", 1, &cbIgnored);
877}
878
879# endif /* VBOX_WITH_WIN_PARPORT_SUP */
880
881/**
882 * Destruct a host parallel driver instance.
883 *
884 * Most VM resources are freed by the VM. This callback is provided so that
885 * any non-VM resources can be freed correctly.
886 *
887 * @param pDrvIns The driver instance data.
888 */
889static DECLCALLBACK(void) drvHostParallelDestruct(PPDMDRVINS pDrvIns)
890{
891 int rc;
892 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
893 LogFlowFunc(("iInstance=%d\n", pDrvIns->iInstance));
894 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
895
896#ifndef VBOX_WITH_WIN_PARPORT_SUP
897 if (pThis->hFileDevice != NIL_RTFILE)
898 ioctl(RTFileToNative(pThis->hFileDevice), PPRELEASE);
899
900 rc = RTPipeClose(pThis->hWakeupPipeW); AssertRC(rc);
901 pThis->hWakeupPipeW = NIL_RTPIPE;
902
903 rc = RTPipeClose(pThis->hWakeupPipeR); AssertRC(rc);
904 pThis->hWakeupPipeR = NIL_RTPIPE;
905
906 rc = RTFileClose(pThis->hFileDevice); AssertRC(rc);
907 pThis->hFileDevice = NIL_RTFILE;
908
909 if (pThis->pszDevicePath)
910 {
911 MMR3HeapFree(pThis->pszDevicePath);
912 pThis->pszDevicePath = NULL;
913 }
914#else /* VBOX_WITH_WIN_PARPORT_SUP */
915 if (pThis->hWinFileDevice != NIL_RTFILE)
916 rc = RTFileClose(pThis->hWinFileDevice); AssertRC(rc);
917#endif /* VBOX_WITH_WIN_PARPORT_SUP */
918}
919
920/**
921 * Construct a host parallel driver instance.
922 *
923 * @copydoc FNPDMDRVCONSTRUCT
924 */
925static DECLCALLBACK(int) drvHostParallelConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
926{
927 PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
928 LogFlowFunc(("iInstance=%d\n", pDrvIns->iInstance));
929
930 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
931
932 /*
933 * Init basic data members and interfaces.
934 *
935 * Must be done before returning any failure because we've got a destructor.
936 */
937 pThis->hFileDevice = NIL_RTFILE;
938#ifndef VBOX_WITH_WIN_PARPORT_SUP
939 pThis->hWakeupPipeR = NIL_RTPIPE;
940 pThis->hWakeupPipeW = NIL_RTPIPE;
941#else /* VBOX_WITH_WIN_PARPORT_SUP */
942 pThis->hWinFileDevice = NIL_RTFILE;
943#endif
944
945 pThis->pDrvInsR3 = pDrvIns;
946#ifdef VBOX_WITH_DRVINTNET_IN_R0
947 pThis->pDrvInsR0 = PDMDRVINS_2_R0PTR(pDrvIns);
948#endif
949
950 /* IBase. */
951 pDrvIns->IBase.pfnQueryInterface = drvHostParallelQueryInterface;
952 /* IHostParallelConnector. */
953 pThis->IHostParallelConnectorR3.pfnWrite = drvHostParallelWrite;
954 pThis->IHostParallelConnectorR3.pfnRead = drvHostParallelRead;
955 pThis->IHostParallelConnectorR3.pfnSetPortDirection = drvHostParallelSetPortDirection;
956 pThis->IHostParallelConnectorR3.pfnWriteControl = drvHostParallelWriteControl;
957 pThis->IHostParallelConnectorR3.pfnReadControl = drvHostParallelReadControl;
958 pThis->IHostParallelConnectorR3.pfnReadStatus = drvHostParallelReadStatus;
959
960 /*
961 * Validate the config.
962 */
963 if (!CFGMR3AreValuesValid(pCfg, "DevicePath\0"))
964 return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES,
965 N_("Unknown host parallel configuration option, only supports DevicePath"));
966
967 /*
968 * Query configuration.
969 */
970 /* Device */
971 int rc = CFGMR3QueryStringAlloc(pCfg, "DevicePath", &pThis->pszDevicePath);
972 if (RT_FAILURE(rc))
973 {
974 AssertMsgFailed(("Configuration error: query for \"DevicePath\" string returned %Rra.\n", rc));
975 return rc;
976 }
977
978 /*
979 * Open the device
980 */
981 rc = RTFileOpen(&pThis->hFileDevice, pThis->pszDevicePath, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
982 if (RT_FAILURE(rc))
983 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("Parallel#%d could not open '%s'"),
984 pDrvIns->iInstance, pThis->pszDevicePath);
985
986#ifndef VBOX_WITH_WIN_PARPORT_SUP
987 /*
988 * Try to get exclusive access to parallel port
989 */
990 rc = ioctl(RTFileToNative(pThis->hFileDevice), PPEXCL);
991 if (rc < 0)
992 return PDMDrvHlpVMSetError(pDrvIns, RTErrConvertFromErrno(errno), RT_SRC_POS,
993 N_("Parallel#%d could not get exclusive access for parallel port '%s'"
994 "Be sure that no other process or driver accesses this port"),
995 pDrvIns->iInstance, pThis->pszDevicePath);
996
997 /*
998 * Claim the parallel port
999 */
1000 rc = ioctl(RTFileToNative(pThis->hFileDevice), PPCLAIM);
1001 if (rc < 0)
1002 return PDMDrvHlpVMSetError(pDrvIns, RTErrConvertFromErrno(errno), RT_SRC_POS,
1003 N_("Parallel#%d could not claim parallel port '%s'"
1004 "Be sure that no other process or driver accesses this port"),
1005 pDrvIns->iInstance, pThis->pszDevicePath);
1006
1007 /*
1008 * Get the IHostParallelPort interface of the above driver/device.
1009 */
1010 pThis->pDrvHostParallelPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIHOSTPARALLELPORT);
1011 if (!pThis->pDrvHostParallelPort)
1012 return PDMDrvHlpVMSetError(pDrvIns, VERR_PDM_MISSING_INTERFACE_ABOVE, RT_SRC_POS, N_("Parallel#%d has no parallel port interface above"),
1013 pDrvIns->iInstance);
1014
1015 /*
1016 * Create wakeup pipe.
1017 */
1018 rc = RTPipeCreate(&pThis->hWakeupPipeR, &pThis->hWakeupPipeW, 0 /*fFlags*/);
1019 AssertRCReturn(rc, rc);
1020
1021 /*
1022 * Start in SPP mode.
1023 */
1024 pThis->enmModeCur = PDM_PARALLEL_PORT_MODE_INVALID;
1025 rc = drvHostParallelSetMode(pThis, PDM_PARALLEL_PORT_MODE_SPP);
1026 if (RT_FAILURE(rc))
1027 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostParallel#%d cannot change mode of parallel mode to SPP"), pDrvIns->iInstance);
1028
1029 /*
1030 * Start waiting for interrupts.
1031 */
1032 rc = PDMDrvHlpThreadCreate(pDrvIns, &pThis->pMonitorThread, pThis, drvHostParallelMonitorThread, drvHostParallelWakeupMonitorThread, 0,
1033 RTTHREADTYPE_IO, "ParMon");
1034 if (RT_FAILURE(rc))
1035 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostParallel#%d cannot create monitor thread"), pDrvIns->iInstance);
1036
1037#else /* VBOX_WITH_WIN_PARPORT_SUP */
1038 HANDLE hPort;
1039 pThis->fParportAvail = false;
1040 pThis->u32LptAddr = 0;
1041 pThis->u32LptAddrControl = 0;
1042 pThis->u32LptAddrStatus = 0;
1043 rc = drvWinHostGetparportAddr(pThis);
1044
1045 /* If we have the char port availabe use it , else I am not getting exclusive access to parallel port.
1046 Read and write will be done only if addresses are available
1047 */
1048 if (pThis->szParportName)
1049 {
1050 rc = RTFileOpen(&pThis->hWinFileDevice, (char *)pThis->szParportName,
1051 RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
1052 LogFlowFunc(("RTFileOpen Return = %d\n", rc));
1053 }
1054#endif
1055 return VINF_SUCCESS;
1056}
1057
1058
1059/**
1060 * Char driver registration record.
1061 */
1062const PDMDRVREG g_DrvHostParallel =
1063{
1064 /* u32Version */
1065 PDM_DRVREG_VERSION,
1066 /* szName */
1067 "HostParallel",
1068 /* szRCMod */
1069 "",
1070 /* szR0Mod */
1071 "VBoxDDR0.r0",
1072 /* pszDescription */
1073 "Parallel host driver.",
1074 /* fFlags */
1075# if defined(VBOX_WITH_WIN_PARPORT_SUP)
1076 PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT | PDM_DRVREG_FLAGS_R0,
1077# else
1078 PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT,
1079# endif
1080 /* fClass. */
1081 PDM_DRVREG_CLASS_CHAR,
1082 /* cMaxInstances */
1083 ~0U,
1084 /* cbInstance */
1085 sizeof(DRVHOSTPARALLEL),
1086 /* pfnConstruct */
1087 drvHostParallelConstruct,
1088 /* pfnDestruct */
1089 drvHostParallelDestruct,
1090 /* pfnRelocate */
1091 NULL,
1092 /* pfnIOCtl */
1093 NULL,
1094 /* pfnPowerOn */
1095 NULL,
1096 /* pfnReset */
1097 NULL,
1098 /* pfnSuspend */
1099 NULL,
1100 /* pfnResume */
1101 NULL,
1102 /* pfnAttach */
1103 NULL,
1104 /* pfnDetach */
1105 NULL,
1106 /* pfnPowerOff */
1107 NULL,
1108 /* pfnSoftReset */
1109 NULL,
1110 /* u32EndVersion */
1111 PDM_DRVREG_VERSION
1112};
1113#endif /*IN_RING3*/
1114
1115
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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