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