1 | /* $Id: UsbCardReader.h 69498 2017-10-28 15:07:25Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VirtualBox Driver interface to the virtual Usb Card Reader.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2011-2016 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef ____H_USBCARDREADER
|
---|
20 | #define ____H_USBCARDREADER
|
---|
21 |
|
---|
22 | #include <VBox/vmm/pdmcardreaderinfs.h>
|
---|
23 | #include <VBox/vmm/pdmdrv.h>
|
---|
24 |
|
---|
25 | class Console;
|
---|
26 | typedef struct USBCARDREADER USBCARDREADER;
|
---|
27 | typedef struct UCRREMOTE UCRREMOTE;
|
---|
28 |
|
---|
29 | class UsbCardReader
|
---|
30 | {
|
---|
31 | public:
|
---|
32 | UsbCardReader(Console *console);
|
---|
33 | virtual ~UsbCardReader();
|
---|
34 |
|
---|
35 | static const PDMDRVREG DrvReg;
|
---|
36 | USBCARDREADER *mpDrv;
|
---|
37 |
|
---|
38 | Console *getParent(void) { return mParent; }
|
---|
39 |
|
---|
40 | int VRDENotify(uint32_t u32Id, void *pvData, uint32_t cbData);
|
---|
41 | int VRDEResponse(int rcRequest, void *pvUser, uint32_t u32Function, void *pvData, uint32_t cbData);
|
---|
42 |
|
---|
43 | int EstablishContext(USBCARDREADER *pDrv);
|
---|
44 | int ReleaseContext(USBCARDREADER *pDrv);
|
---|
45 | int GetStatusChange(USBCARDREADER *pDrv, void *pvUser, uint32_t u32Timeout,
|
---|
46 | PDMICARDREADER_READERSTATE *paReaderStats, uint32_t cReaderStats);
|
---|
47 | int Connect(USBCARDREADER *pDrv, void *pvUser, const char *pszReaderName,
|
---|
48 | uint32_t u32ShareMode, uint32_t u32PreferredProtocols);
|
---|
49 | int Disconnect(USBCARDREADER *pDrv, void *pvUser, uint32_t u32Mode);
|
---|
50 | int Status(USBCARDREADER *pDrv, void *pvUser);
|
---|
51 | int Transmit(USBCARDREADER *pDrv, void *pvUser, PDMICARDREADER_IO_REQUEST *pioSendRequest,
|
---|
52 | uint8_t *pu8SendBuffer, uint32_t cbSendBuffer, uint32_t cbRecvBuffer);
|
---|
53 | int Control(USBCARDREADER *pDrv, void *pvUser, uint32_t u32ControlCode,
|
---|
54 | uint8_t *pu8InBuffer, uint32_t cbInBuffer, uint32_t cbOutBuffer);
|
---|
55 | int GetAttrib(USBCARDREADER *pDrv, void *pvUser, uint32_t u32AttrId, uint32_t cbAttrib);
|
---|
56 | int SetAttrib(USBCARDREADER *pDrv, void *pvUser, uint32_t u32AttrId,
|
---|
57 | uint8_t *pu8Attrib, uint32_t cbAttrib);
|
---|
58 |
|
---|
59 | private:
|
---|
60 | static DECLCALLBACK(void *) drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
|
---|
61 | static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
|
---|
62 | static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns);
|
---|
63 |
|
---|
64 | int vrdeSCardRequest(void *pvUser, uint32_t u32Function, const void *pvData, uint32_t cbData);
|
---|
65 |
|
---|
66 | Console * const mParent;
|
---|
67 |
|
---|
68 | UCRREMOTE *m_pRemote;
|
---|
69 | };
|
---|
70 |
|
---|
71 | #endif /* !____H_USBCARDREADER */
|
---|
72 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|