2
* PDM - Pluggable Device Manager, Interfaces.
6
* Copyright (C) 2006-2007 innotek GmbH
8
* This file is part of VirtualBox Open Source Edition (OSE), as
9
* available from http://www.virtualbox.org. This file is free software;
10
* you can redistribute it and/or modify it under the terms of the GNU
11
* General Public License as published by the Free Software Foundation,
12
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13
* distribution. VirtualBox OSE is distributed in the hope that it will
14
* be useful, but WITHOUT ANY WARRANTY of any kind.
17
#ifndef ___VBox_pdmifs_h
18
#define ___VBox_pdmifs_h
20
#include <VBox/types.h>
21
#include <VBox/hgcmsvc.h>
25
/** @defgroup grp_pdm_interfaces Interfaces
31
* Driver interface identficators.
33
* @remark All interfaces have to be declared here. There is no such thing as
34
* private interface identifiers since they must be unique.
36
* That said, interface structures and other stuff can be put elsewhere,
37
* actually, it is best if this file is not flooded with structures that
38
* could be put closer to home.
40
typedef enum PDMINTERFACE
42
/** PDMIBASE - The interface everyone supports. */
43
PDMINTERFACE_BASE = 1,
44
/** PDMIMOUSEPORT - The mouse port interface. (Down) Coupled with PDMINTERFACE_MOUSE_CONNECTOR. */
45
PDMINTERFACE_MOUSE_PORT,
46
/** PDMIMOUSECONNECTOR - The mouse connector interface. (Up) Coupled with PDMINTERFACE_MOUSE_PORT. */
47
PDMINTERFACE_MOUSE_CONNECTOR,
48
/** PDMIKEYBOARDPORT - The keyboard port interface. (Down) Coupled with PDMINTERFACE_KEYBOARD_CONNECTOR. */
49
PDMINTERFACE_KEYBOARD_PORT,
50
/** PDMIKEYBOARDCONNECTOR - The keyboard connector interface. (Up) Coupled with PDMINTERFACE_KEYBOARD_PORT. */
51
PDMINTERFACE_KEYBOARD_CONNECTOR,
52
/** PDMIDISPLAYPORT - The display port interface. (Down) Coupled with PDMINTERFACE_DISPLAY_CONNECTOR. */
53
PDMINTERFACE_DISPLAY_PORT,
54
/** PDMIDISPLAYCONNECTOR - The display connector interface. (Up) Coupled with PDMINTERFACE_DISPLAY_PORT. */
55
PDMINTERFACE_DISPLAY_CONNECTOR,
56
/** PDMICHARPORT - The char notify interface. (Down) Coupled with PDMINTERFACE_CHAR. */
57
PDMINTERFACE_CHAR_PORT,
58
/** PDMICHAR - The char driver interface. (Up) Coupled with PDMINTERFACE_CHAR_PORT. */
60
/** PDMISTREAM - The stream driver interface (Up) No coupling.
61
* Used by a char driver to implement PDMINTERFACE_CHAR. */
63
/** PDMIBLOCKPORT - The block notify interface (Down) Coupled with PDMINTERFACE_BLOCK. */
64
PDMINTERFACE_BLOCK_PORT,
65
/** PDMIBLOCK - The block driver interface (Up) Coupled with PDMINTERFACE_BLOCK_PORT. */
67
/** PDMIBLOCKBIOS - The block bios interface. (External) */
68
PDMINTERFACE_BLOCK_BIOS,
69
/** PDMIMOUNTNOTIFY - The mountable notification interface. (Down) Coupled with PDMINTERFACE_MOUNT. */
70
PDMINTERFACE_MOUNT_NOTIFY,
71
/** PDMIMOUNT - The mountable interface. (Up) Coupled with PDMINTERFACE_MOUNT_NOTIFY. */
73
/** PDMIMEDIA - The media interface. (Up) No coupling.
74
* Used by a block unit driver to implement PDMINTERFACE_BLOCK and PDMINTERFACE_BLOCK_BIOS. */
76
/** PDMIISCSITRANSPORT - The iSCSI transport interface (Up) No coupling.
77
* used by the iSCSI media driver. */
78
PDMINTERFACE_ISCSITRANSPORT,
80
/** PDMINETWORKPORT - The network port interface. (Down) Coupled with PDMINTERFACE_NETWORK_CONNECTOR. */
81
PDMINTERFACE_NETWORK_PORT,
82
/** PDMINETWORKPORT - The network connector interface. (Up) Coupled with PDMINTERFACE_NETWORK_PORT. */
83
PDMINTERFACE_NETWORK_CONNECTOR,
84
/** PDMINETWORKCONFIG - The network configuartion interface. (Main) Used by the managment api. */
85
PDMINTERFACE_NETWORK_CONFIG,
87
/** PDMIAUDIOCONNECTOR - The audio driver interface. (Up) No coupling. */
88
PDMINTERFACE_AUDIO_CONNECTOR,
90
/** PDMIAUDIOSNIFFERPORT - The Audio Sniffer Device port interface. */
91
PDMINTERFACE_AUDIO_SNIFFER_PORT,
92
/** PDMIAUDIOSNIFFERCONNECTOR - The Audio Sniffer Driver connector interface. */
93
PDMINTERFACE_AUDIO_SNIFFER_CONNECTOR,
95
/** PDMIVMMDEVPORT - The VMM Device port interface. */
96
PDMINTERFACE_VMMDEV_PORT,
97
/** PDMIVMMDEVCONNECTOR - The VMM Device connector interface. */
98
PDMINTERFACE_VMMDEV_CONNECTOR,
100
/** PDMILEDPORTS - The generic LED port interface. (Down) Coupled with PDMINTERFACE_LED_CONNECTORS. */
101
PDMINTERFACE_LED_PORTS,
102
/** PDMILEDCONNECTORS - The generic LED connector interface. (Up) Coupled with PDMINTERFACE_LED_PORTS. */
103
PDMINTERFACE_LED_CONNECTORS,
105
/** PDMIACPIPORT - ACPI port interface. (Down) Coupled with PDMINTERFACE_ACPI_CONNECTOR. */
106
PDMINTERFACE_ACPI_PORT,
107
/** PDMIACPICONNECTOR - ACPI connector interface. (Up) Coupled with PDMINTERFACE_ACPI_PORT. */
108
PDMINTERFACE_ACPI_CONNECTOR,
110
/** PDMIHGCMPORT - The Host-Guest communication manager port interface. Normally implemented by VMMDev. */
111
PDMINTERFACE_HGCM_PORT,
112
/** PDMIHGCMCONNECTOR - The Host-Guest communication manager connector interface. Normally implemented by Main::VMMDevInterface. */
113
PDMINTERFACE_HGCM_CONNECTOR,
115
/** VUSBIROOTHUBPORT - VUSB RootHub port interface. (Down) Coupled with PDMINTERFACE_USB_RH_CONNECTOR. */
116
PDMINTERFACE_VUSB_RH_PORT,
117
/** VUSBIROOTHUBCONNECTOR - VUSB RootHub connector interface. (Up) Coupled with PDMINTERFACE_USB_RH_PORT. */
118
PDMINTERFACE_VUSB_RH_CONNECTOR,
119
/** VUSBIRHCONFIG - VUSB RootHub configuration interface. (Main) Used by the managment api. */
120
PDMINTERFACE_VUSB_RH_CONFIG,
122
/** VUSBROOTHUBCONNECTOR - VUSB Device interface. (Up) No coupling. */
123
PDMINTERFACE_VUSB_DEVICE,
125
/** PDMIHOSTDEVICEPORT - The Host Device port interface. (Down) Coupled with PDMINTERFACE_HOST_DEVICE_CONNECTOR. */
126
PDMINTERFACE_HOST_DEVICE_PORT,
127
/** PDMIHOSTDEVICECONNECTOR - The Host device connector interface (Up) Coupled with PDMINTERFACE_HOST_DEVICE_PORT. */
128
PDMINTERFACE_HOST_DEVICE_CONNECTOR,
130
/** Maximum interface number. */
136
* PDM Driver Base Interface.
138
typedef struct PDMIBASE
141
* Queries an interface to the driver.
143
* @returns Pointer to interface.
144
* @returns NULL if the interface was not supported by the driver.
145
* @param pInterface Pointer to this interface structure.
146
* @param enmInterface The requested interface identification.
147
* @thread Any thread.
149
DECLR3CALLBACKMEMBER(void *, pfnQueryInterface,(struct PDMIBASE *pInterface, PDMINTERFACE enmInterface));
156
* This is used to typedef other dummy interfaces. The purpose of a dummy
157
* interface is to validate the logical function of a driver/device and
158
* full a natural interface pair.
160
typedef struct PDMIDUMMY
166
/** Pointer to a mouse port interface. */
167
typedef struct PDMIMOUSEPORT *PPDMIMOUSEPORT;
169
* Mouse port interface.
170
* Pair with PDMIMOUSECONNECTOR.
172
typedef struct PDMIMOUSEPORT
175
* Puts a mouse event.
176
* This is called by the source of mouse events. The event will be passed up until the
177
* topmost driver, which then calls the registered event handler.
179
* @returns VBox status code.
180
* @param pInterface Pointer to this interface structure.
181
* @param i32DeltaX The X delta.
182
* @param i32DeltaY The Y delta.
183
* @param i32DeltaZ The Z delta.
184
* @param fButtonStates The button states, see the PDMIMOUSEPORT_BUTTON_* \#defines.
185
* @thread The emulation thread.
187
DECLR3CALLBACKMEMBER(int, pfnPutEvent,(PPDMIMOUSEPORT pInterface, int32_t i32DeltaX, int32_t i32DeltaY, int32_t i32DeltaZ, uint32_t fButtonStates));
190
/** Mouse button defines for PDMIMOUSEPORT::pfnPutEvent.
192
#define PDMIMOUSEPORT_BUTTON_LEFT BIT(0)
193
#define PDMIMOUSEPORT_BUTTON_RIGHT BIT(1)
194
#define PDMIMOUSEPORT_BUTTON_MIDDLE BIT(2)
199
* Mouse connector interface.
200
* Pair with PDMIMOUSEPORT.
202
typedef PDMIDUMMY PDMIMOUSECONNECTOR;
203
/** Pointer to a mouse connector interface. */
204
typedef PDMIMOUSECONNECTOR *PPDMIMOUSECONNECTOR;
207
/** Pointer to a keyboard port interface. */
208
typedef struct PDMIKEYBOARDPORT *PPDMIKEYBOARDPORT;
210
* Keyboard port interface.
211
* Pair with PDMIKEYBOARDCONNECTOR.
213
typedef struct PDMIKEYBOARDPORT
216
* Puts a keyboard event.
217
* This is called by the source of keyboard events. The event will be passed up until the
218
* topmost driver, which then calls the registered event handler.
220
* @returns VBox status code.
221
* @param pInterface Pointer to this interface structure.
222
* @param u8KeyCode The keycode to queue.
223
* @thread The emulation thread.
225
DECLR3CALLBACKMEMBER(int, pfnPutEvent,(PPDMIKEYBOARDPORT pInterface, uint8_t u8KeyCode));
231
typedef enum PDMKEYBLEDS
234
PDMKEYBLEDS_NONE = 0x0000,
236
PDMKEYBLEDS_NUMLOCK = 0x0001,
238
PDMKEYBLEDS_CAPSLOCK = 0x0002,
240
PDMKEYBLEDS_SCROLLLOCK = 0x0004
243
/** Pointer to keyboard connector interface. */
244
typedef struct PDMIKEYBOARDCONNECTOR *PPDMIKEYBOARDCONNECTOR;
248
* Keyboard connector interface.
249
* Pair with PDMIKEYBOARDPORT
251
typedef struct PDMIKEYBOARDCONNECTOR
254
* Notifies the the downstream driver about an LED change initiated by the guest.
256
* @param pInterface Pointer to the this interface.
257
* @param enmLeds The new led mask.
259
DECLR3CALLBACKMEMBER(void, pfnLedStatusChange,(PPDMIKEYBOARDCONNECTOR pInterface, PDMKEYBLEDS enmLeds));
261
} PDMIKEYBOARDCONNECTOR;
265
/** Pointer to a display port interface. */
266
typedef struct PDMIDISPLAYPORT *PPDMIDISPLAYPORT;
268
* Display port interface.
269
* Pair with PDMIDISPLAYCONNECTOR.
271
typedef struct PDMIDISPLAYPORT
274
* Update the display with any changed regions.
276
* Flushes any display changes to the memory pointed to by the
277
* PDMIDISPLAYCONNECTOR interface and calles PDMIDISPLAYCONNECTOR::pfnUpdateRect()
280
* @returns VBox status code.
281
* @param pInterface Pointer to this interface.
282
* @thread The emulation thread.
284
DECLR3CALLBACKMEMBER(int, pfnUpdateDisplay,(PPDMIDISPLAYPORT pInterface));
287
* Update the entire display.
289
* Flushes the entire display content to the memory pointed to by the
290
* PDMIDISPLAYCONNECTOR interface and calles PDMIDISPLAYCONNECTOR::pfnUpdateRect().
292
* @returns VBox status code.
293
* @param pInterface Pointer to this interface.
294
* @thread The emulation thread.
296
DECLR3CALLBACKMEMBER(int, pfnUpdateDisplayAll,(PPDMIDISPLAYPORT pInterface));
299
* Return the current guest color depth in bits per pixel (bpp).
301
* As the graphics card is able to provide display updates with the bpp
302
* requested by the host, this method can be used to query the actual
305
* @returns VBox status code.
306
* @param pInterface Pointer to this interface.
307
* @param pcBits Where to store the current guest color depth.
308
* @thread Any thread.
310
DECLR3CALLBACKMEMBER(int, pfnQueryColorDepth,(PPDMIDISPLAYPORT pInterface, uint32_t *pcBits));
313
* Sets the refresh rate and restart the timer.
314
* The rate is defined as the minimum interval between the return of
315
* one PDMIDISPLAYPORT::pfnRefresh() call to the next one.
317
* The interval timer will be restarted by this call. So at VM startup
318
* this function must be called to start the refresh cycle. The refresh
319
* rate is not saved, but have to be when resuming a loaded VM state.
321
* @returns VBox status code.
322
* @param pInterface Pointer to this interface.
323
* @param cMilliesInterval Number of millies between two refreshes.
324
* @thread Any thread.
326
DECLR3CALLBACKMEMBER(int, pfnSetRefreshRate,(PPDMIDISPLAYPORT pInterface, uint32_t cMilliesInterval));
329
* Create a 32-bbp snapshot of the display.
331
* This will create a 32-bbp bitmap with dword aligned scanline length. Because
332
* of a wish for no locks in the graphics device, this must be called from the
335
* @param pInterface Pointer to this interface.
336
* @param pvData Pointer the buffer to copy the bits to.
337
* @param cbData Size of the buffer.
338
* @param pcx Where to store the width of the bitmap. (optional)
339
* @param pcy Where to store the height of the bitmap. (optional)
340
* @param pcbData Where to store the actual size of the bitmap. (optional)
341
* @thread The emulation thread.
343
DECLR3CALLBACKMEMBER(int, pfnSnapshot,(PPDMIDISPLAYPORT pInterface, void *pvData, size_t cbData, uint32_t *pcx, uint32_t *pcy, size_t *pcbData));
346
* Copy bitmap to the display.
348
* This will convert and copy a 32-bbp bitmap (with dword aligned scanline length) to
349
* the memory pointed to by the PDMIDISPLAYCONNECTOR interface.
351
* @param pInterface Pointer to this interface.
352
* @param pvData Pointer to the bitmap bits.
353
* @param x The upper left corner x coordinate of the destination rectangle.
354
* @param y The upper left corner y coordinate of the destination rectangle.
355
* @param cx The width of the source and destination rectangles.
356
* @param cy The height of the source and destination rectangles.
357
* @thread The emulation thread.
358
* @remark This is just a convenience for using the bitmap conversions of the
361
DECLR3CALLBACKMEMBER(int, pfnDisplayBlt,(PPDMIDISPLAYPORT pInterface, const void *pvData, uint32_t x, uint32_t y, uint32_t cx, uint32_t cy));
364
* Render a rectangle from guest VRAM to Framebuffer.
366
* @param pInterface Pointer to this interface.
367
* @param x The upper left corner x coordinate of the rectangle to be updated.
368
* @param y The upper left corner y coordinate of the rectangle to be updated.
369
* @param cx The width of the rectangle to be updated.
370
* @param cy The height of the rectangle to be updated.
371
* @thread The emulation thread.
373
DECLR3CALLBACKMEMBER(void, pfnUpdateDisplayRect,(PPDMIDISPLAYPORT pInterface, int32_t x, int32_t y, uint32_t cx, uint32_t cy));
376
* Inform the VGA device whether the Display is directly using the guest VRAM and there is no need
377
* to render the VRAM to the framebuffer memory.
379
* @param pInterface Pointer to this interface.
380
* @param fRender Whether the VRAM content must be rendered to the framebuffer.
381
* @thread The emulation thread.
383
DECLR3CALLBACKMEMBER(void, pfnSetRenderVRAM,(PPDMIDISPLAYPORT pInterface, bool fRender));
388
/** Pointer to a display connector interface. */
389
typedef struct PDMIDISPLAYCONNECTOR *PPDMIDISPLAYCONNECTOR;
391
* Display connector interface.
392
* Pair with PDMIDISPLAYPORT.
394
typedef struct PDMIDISPLAYCONNECTOR
397
* Resize the display.
398
* This is called when the resolution changes. This usually happens on
399
* request from the guest os, but may also happen as the result of a reset.
400
* If the callback returns VINF_VGA_RESIZE_IN_PROGRESS, the caller (VGA device)
401
* must not access the connector and return.
403
* @returns VINF_SUCCESS if the framebuffer resize was completed,
404
* VINF_VGA_RESIZE_IN_PROGRESS if resize takes time and not yet finished.
405
* @param pInterface Pointer to this interface.
406
* @param cBits Color depth (bits per pixel) of the new video mode.
407
* @param pvVRAM Address of the guest VRAM.
408
* @param cbLine Size in bytes of a single scan line.
409
* @param cx New display width.
410
* @param cy New display height.
411
* @thread The emulation thread.
413
DECLR3CALLBACKMEMBER(int, pfnResize,(PPDMIDISPLAYCONNECTOR pInterface, uint32_t cBits, void *pvVRAM, uint32_t cbLine, uint32_t cx, uint32_t cy));
416
* Update a rectangle of the display.
417
* PDMIDISPLAYPORT::pfnUpdateDisplay is the caller.
419
* @param pInterface Pointer to this interface.
420
* @param x The upper left corner x coordinate of the rectangle.
421
* @param y The upper left corner y coordinate of the rectangle.
422
* @param cx The width of the rectangle.
423
* @param cy The height of the rectangle.
424
* @thread The emulation thread.
426
DECLR3CALLBACKMEMBER(void, pfnUpdateRect,(PPDMIDISPLAYCONNECTOR pInterface, uint32_t x, uint32_t y, uint32_t cx, uint32_t cy));
429
* Refresh the display.
431
* The interval between these calls is set by
432
* PDMIDISPLAYPORT::pfnSetRefreshRate(). The driver should call
433
* PDMIDISPLAYPORT::pfnUpdateDisplay() if it wishes to refresh the
434
* display. PDMIDISPLAYPORT::pfnUpdateDisplay calls pfnUpdateRect with
435
* the changed rectangles.
437
* @param pInterface Pointer to this interface.
438
* @thread The emulation thread.
440
DECLR3CALLBACKMEMBER(void, pfnRefresh,(PPDMIDISPLAYCONNECTOR pInterface));
445
* Notification message when the graphics card has been reset.
447
* @param pInterface Pointer to this interface.
448
* @thread The emulation thread.
450
DECLR3CALLBACKMEMBER(void, pfnReset,(PPDMIDISPLAYCONNECTOR pInterface));
453
* LFB video mode enter/exit.
455
* Notification message when LinearFrameBuffer video mode is enabled/disabled.
457
* @param pInterface Pointer to this interface.
458
* @param fEnabled false - LFB mode was disabled,
459
* true - an LFB mode was disabled
460
* @thread The emulation thread.
462
DECLR3CALLBACKMEMBER(void, pfnLFBModeChange, (PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled));
465
* Process the guest graphics adapter information.
467
* Direct notification from guest to the display connector.
469
* @param pInterface Pointer to this interface.
470
* @param pvVRAM Address of the guest VRAM.
471
* @param u32VRAMSize Size of the guest VRAM.
472
* @thread The emulation thread.
474
DECLR3CALLBACKMEMBER(void, pfnProcessAdapterData, (PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, uint32_t u32VRAMSize));
477
* Process the guest display information.
479
* Direct notification from guest to the display connector.
481
* @param pInterface Pointer to this interface.
482
* @param pvVRAM Address of the guest VRAM.
483
* @param uScreenId The index of the guest display to be processed.
484
* @thread The emulation thread.
486
DECLR3CALLBACKMEMBER(void, pfnProcessDisplayData, (PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, unsigned uScreenId));
489
/** Read-only attributes.
490
* For preformance reasons some readonly attributes are kept in the interface.
491
* We trust the interface users to respect the readonlyness of these.
494
/** Pointer to the display data buffer. */
496
/** Size of a scanline in the data buffer. */
498
/** The color depth (in bits) the graphics card is supposed to provide. */
500
/** The display width. */
502
/** The display height. */
505
} PDMIDISPLAYCONNECTOR;
512
typedef enum PDMBLOCKTYPE
514
/** Error (for the query function). */
515
PDMBLOCKTYPE_ERROR = 1,
516
/** 360KB 5 1/4" floppy drive. */
517
PDMBLOCKTYPE_FLOPPY_360,
518
/** 720KB 3 1/2" floppy drive. */
519
PDMBLOCKTYPE_FLOPPY_720,
520
/** 1.2MB 5 1/4" floppy drive. */
521
PDMBLOCKTYPE_FLOPPY_1_20,
522
/** 1.44MB 3 1/2" floppy drive. */
523
PDMBLOCKTYPE_FLOPPY_1_44,
524
/** 2.88MB 3 1/2" floppy drive. */
525
PDMBLOCKTYPE_FLOPPY_2_88,
530
/** Hard disk drive. */
531
PDMBLOCKTYPE_HARD_DISK
536
* Block raw command data transfer direction.
538
typedef enum PDMBLOCKTXDIR
540
PDMBLOCKTXDIR_NONE = 0,
541
PDMBLOCKTXDIR_FROM_DEVICE,
542
PDMBLOCKTXDIR_TO_DEVICE
546
* Block notify interface.
547
* Pair with PDMIBLOCK.
549
typedef PDMIDUMMY PDMIBLOCKPORT;
550
/** Pointer to a block notify interface (dummy). */
551
typedef PDMIBLOCKPORT *PPDMIBLOCKPORT;
553
/** Pointer to a block interface. */
554
typedef struct PDMIBLOCK *PPDMIBLOCK;
557
* Pair with PDMIBLOCKPORT.
559
typedef struct PDMIBLOCK
564
* @returns VBox status code.
565
* @param pInterface Pointer to the interface structure containing the called function pointer.
566
* @param off Offset to start reading from.
567
* @param pvBuf Where to store the read bits.
568
* @param cbRead Number of bytes to read.
569
* @thread Any thread.
571
DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMIBLOCK pInterface, uint64_t off, void *pvBuf, size_t cbRead));
576
* @returns VBox status code.
577
* @param pInterface Pointer to the interface structure containing the called function pointer.
578
* @param off Offset to start writing at.
579
* @param pvBuf Where to store the write bits.
580
* @param cbWrite Number of bytes to write.
581
* @thread Any thread.
583
DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMIBLOCK pInterface, uint64_t off, const void *pvBuf, size_t cbWrite));
586
* Make sure that the bits written are actually on the storage medium.
588
* @returns VBox status code.
589
* @param pInterface Pointer to the interface structure containing the called function pointer.
590
* @thread Any thread.
592
DECLR3CALLBACKMEMBER(int, pfnFlush,(PPDMIBLOCK pInterface));
595
* Send a raw command to the underlying device (CDROM).
596
* This method is optional (i.e. the function pointer may be NULL).
598
* @returns VBox status code.
599
* @param pInterface Pointer to the interface structure containing the called function pointer.
600
* @param pbCmd Offset to start reading from.
601
* @param enmTxDir Direction of transfer.
602
* @param pvBuf Pointer tp the transfer buffer.
603
* @param cbBuf Size of the transfer buffer.
604
* @param pbSenseKey Status of the command (when return value is VERR_DEV_IO_ERROR).
605
* @param cTimeoutMillies Command timeout in milliseconds.
606
* @thread Any thread.
608
DECLR3CALLBACKMEMBER(int, pfnSendCmd,(PPDMIBLOCK pInterface, const uint8_t *pbCmd, PDMBLOCKTXDIR enmTxDir, void *pvBuf, size_t *pcbBuf, uint8_t *pbSenseKey, uint32_t cTimeoutMillies));
611
* Check if the media is readonly or not.
613
* @returns true if readonly.
614
* @returns false if read/write.
615
* @param pInterface Pointer to the interface structure containing the called function pointer.
616
* @thread Any thread.
618
DECLR3CALLBACKMEMBER(bool, pfnIsReadOnly,(PPDMIBLOCK pInterface));
621
* Gets the media size in bytes.
623
* @returns Media size in bytes.
624
* @param pInterface Pointer to the interface structure containing the called function pointer.
625
* @thread Any thread.
627
DECLR3CALLBACKMEMBER(uint64_t, pfnGetSize,(PPDMIBLOCK pInterface));
630
* Gets the block drive type.
632
* @returns block drive type.
633
* @param pInterface Pointer to the interface structure containing the called function pointer.
634
* @thread Any thread.
636
DECLR3CALLBACKMEMBER(PDMBLOCKTYPE, pfnGetType,(PPDMIBLOCK pInterface));
639
* Gets the UUID of the block drive.
640
* Don't return the media UUID if it's removable.
642
* @returns VBox status code.
643
* @param pInterface Pointer to the interface structure containing the called function pointer.
644
* @param pUuid Where to store the UUID on success.
645
* @thread Any thread.
647
DECLR3CALLBACKMEMBER(int, pfnGetUuid,(PPDMIBLOCK pInterface, PRTUUID pUuid));
651
/** Pointer to a mount interface. */
652
typedef struct PDMIMOUNTNOTIFY *PPDMIMOUNTNOTIFY;
655
* Pair with PDMIMOUNT.
657
typedef struct PDMIMOUNTNOTIFY
660
* Called when a media is mounted.
662
* @param pInterface Pointer to the interface structure containing the called function pointer.
663
* @thread The emulation thread.
665
DECLR3CALLBACKMEMBER(void, pfnMountNotify,(PPDMIMOUNTNOTIFY pInterface));
668
* Called when a media is unmounted
669
* @param pInterface Pointer to the interface structure containing the called function pointer.
670
* @thread The emulation thread.
672
DECLR3CALLBACKMEMBER(void, pfnUnmountNotify,(PPDMIMOUNTNOTIFY pInterface));
676
/* Pointer to mount interface. */
677
typedef struct PDMIMOUNT *PPDMIMOUNT;
680
* Pair with PDMIMOUNTNOTIFY.
682
typedef struct PDMIMOUNT
687
* This will not unmount any currently mounted media!
689
* @returns VBox status code.
690
* @param pInterface Pointer to the interface structure containing the called function pointer.
691
* @param pszFilename Pointer to filename. If this is NULL it assumed that the caller have
692
* constructed a configuration which can be attached to the bottom driver.
693
* @param pszCoreDriver Core driver name. NULL will cause autodetection. Ignored if pszFilanem is NULL.
694
* @thread The emulation thread.
696
DECLR3CALLBACKMEMBER(int, pfnMount,(PPDMIMOUNT pInterface, const char *pszFilename, const char *pszCoreDriver));
701
* The driver will validate and pass it on. On the rebounce it will decide whether or not to detach it self.
703
* @returns VBox status code.
704
* @param pInterface Pointer to the interface structure containing the called function pointer.
705
* @thread The emulation thread.
706
* @param fForce Force the unmount, even for locked media.
707
* @thread The emulation thread.
709
DECLR3CALLBACKMEMBER(int, pfnUnmount,(PPDMIMOUNT pInterface, bool fForce));
712
* Checks if a media is mounted.
714
* @returns true if mounted.
715
* @returns false if not mounted.
716
* @param pInterface Pointer to the interface structure containing the called function pointer.
717
* @thread Any thread.
719
DECLR3CALLBACKMEMBER(bool, pfnIsMounted,(PPDMIMOUNT pInterface));
722
* Locks the media, preventing any unmounting of it.
724
* @returns VBox status code.
725
* @param pInterface Pointer to the interface structure containing the called function pointer.
726
* @thread The emulation thread.
728
DECLR3CALLBACKMEMBER(int, pfnLock,(PPDMIMOUNT pInterface));
731
* Unlocks the media, canceling previous calls to pfnLock().
733
* @returns VBox status code.
734
* @param pInterface Pointer to the interface structure containing the called function pointer.
735
* @thread The emulation thread.
737
DECLR3CALLBACKMEMBER(int, pfnUnlock,(PPDMIMOUNT pInterface));
740
* Checks if a media is locked.
742
* @returns true if locked.
743
* @returns false if not locked.
744
* @param pInterface Pointer to the interface structure containing the called function pointer.
745
* @thread Any thread.
747
DECLR3CALLBACKMEMBER(bool, pfnIsLocked,(PPDMIMOUNT pInterface));
751
* BIOS translation mode.
753
typedef enum PDMBIOSTRANSLATION
755
/** No translation. */
756
PDMBIOSTRANSLATION_NONE = 1,
757
/** LBA translation. */
758
PDMBIOSTRANSLATION_LBA,
759
/** Automatic select mode. */
760
PDMBIOSTRANSLATION_AUTO
761
} PDMBIOSTRANSLATION;
763
/** Pointer to BIOS translation mode. */
764
typedef PDMBIOSTRANSLATION *PPDMBIOSTRANSLATION;
766
/** Pointer to a media interface. */
767
typedef struct PDMIMEDIA *PPDMIMEDIA;
770
* Makes up the fundation for PDMIBLOCK and PDMIBLOCKBIOS.
772
typedef struct PDMIMEDIA
777
* @returns VBox status code.
778
* @param pInterface Pointer to the interface structure containing the called function pointer.
779
* @param off Offset to start reading from.
780
* @param pvBuf Where to store the read bits.
781
* @param cbRead Number of bytes to read.
782
* @thread Any thread.
784
DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMIMEDIA pInterface, uint64_t off, void *pvBuf, size_t cbRead));
789
* @returns VBox status code.
790
* @param pInterface Pointer to the interface structure containing the called function pointer.
791
* @param off Offset to start writing at.
792
* @param pvBuf Where to store the write bits.
793
* @param cbWrite Number of bytes to write.
794
* @thread Any thread.
796
DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMIMEDIA pInterface, uint64_t off, const void *pvBuf, size_t cbWrite));
799
* Make sure that the bits written are actually on the storage medium.
801
* @returns VBox status code.
802
* @param pInterface Pointer to the interface structure containing the called function pointer.
803
* @thread Any thread.
805
DECLR3CALLBACKMEMBER(int, pfnFlush,(PPDMIMEDIA pInterface));
808
* Get the media size in bytes.
810
* @returns Media size in bytes.
811
* @param pInterface Pointer to the interface structure containing the called function pointer.
812
* @thread Any thread.
814
DECLR3CALLBACKMEMBER(uint64_t, pfnGetSize,(PPDMIMEDIA pInterface));
817
* Check if the media is readonly or not.
819
* @returns true if readonly.
820
* @returns false if read/write.
821
* @param pInterface Pointer to the interface structure containing the called function pointer.
822
* @thread Any thread.
824
DECLR3CALLBACKMEMBER(bool, pfnIsReadOnly,(PPDMIMEDIA pInterface));
827
* Get stored media geometry - BIOS property.
828
* This is an optional feature of a media.
830
* @returns VBox status code.
831
* @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
832
* @returns VERR_PDM_GEOMETRY_NOT_SET if the geometry hasn't been set using pfnBiosSetGeometry() yet.
833
* @param pInterface Pointer to the interface structure containing the called function pointer.
834
* @param pcCylinders Number of cylinders.
835
* @param pcHeads Number of heads.
836
* @param pcSectors Number of sectors. This number is 1-based.
837
* @remark This have no influence on the read/write operations.
838
* @thread Any thread.
840
DECLR3CALLBACKMEMBER(int, pfnBiosGetGeometry,(PPDMIMEDIA pInterface, uint32_t *pcCylinders, uint32_t *pcHeads, uint32_t *pcSectors));
843
* Store the media geometry - BIOS property.
844
* This is an optional feature of a media.
846
* @returns VBox status code.
847
* @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
848
* @param pInterface Pointer to the interface structure containing the called function pointer.
849
* @param cCylinders Number of cylinders.
850
* @param cHeads Number of heads.
851
* @param cSectors Number of sectors. This number is 1-based.
852
* @remark This have no influence on the read/write operations.
853
* @thread The emulation thread.
855
DECLR3CALLBACKMEMBER(int, pfnBiosSetGeometry,(PPDMIMEDIA pInterface, uint32_t cCylinders, uint32_t cHeads, uint32_t cSectors));
858
* Get stored geometry translation mode - BIOS property.
859
* This is an optional feature of a media.
861
* @returns VBox status code.
862
* @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry translation mode.
863
* @returns VERR_PDM_TRANSLATION_NOT_SET if the translation hasn't been set using pfnBiosSetTranslation() yet.
864
* @param pInterface Pointer to the interface structure containing the called function pointer.
865
* @param penmTranslation Where to store the translation type.
866
* @remark This have no influence on the read/write operations.
867
* @thread Any thread.
869
DECLR3CALLBACKMEMBER(int, pfnBiosGetTranslation,(PPDMIMEDIA pInterface, PPDMBIOSTRANSLATION penmTranslation));
872
* Store media geometry - BIOS property.
873
* This is an optional feature of a media.
875
* @returns VBox status code.
876
* @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
877
* @param pInterface Pointer to the interface structure containing the called function pointer.
878
* @param enmTranslation The translation type.
879
* @remark This have no influence on the read/write operations.
880
* @thread The emulation thread.
882
DECLR3CALLBACKMEMBER(int, pfnBiosSetTranslation,(PPDMIMEDIA pInterface, PDMBIOSTRANSLATION enmTranslation));
885
* Gets the UUID of the media drive.
887
* @returns VBox status code.
888
* @param pInterface Pointer to the interface structure containing the called function pointer.
889
* @param pUuid Where to store the UUID on success.
890
* @thread Any thread.
892
DECLR3CALLBACKMEMBER(int, pfnGetUuid,(PPDMIMEDIA pInterface, PRTUUID pUuid));
897
/** Pointer to a block BIOS interface. */
898
typedef struct PDMIBLOCKBIOS *PPDMIBLOCKBIOS;
900
* Media BIOS interface.
901
* The interface the getting and setting properties which the BIOS/CMOS care about.
903
typedef struct PDMIBLOCKBIOS
906
* Get stored media geometry - BIOS property.
907
* This is an optional feature of a media.
909
* @returns VBox status code.
910
* @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
911
* @param pInterface Pointer to the interface structure containing the called function pointer.
912
* @param pcCylinders Number of cylinders.
913
* @param pcHeads Number of heads.
914
* @param pcSectors Number of sectors. This number is 1-based.
915
* @remark This have no influence on the read/write operations.
916
* @thread Any thread.
918
DECLR3CALLBACKMEMBER(int, pfnGetGeometry,(PPDMIBLOCKBIOS pInterface, uint32_t *pcCylinders, uint32_t *pcHeads, uint32_t *pcSectors));
921
* Store the media geometry - BIOS property.
922
* This is an optional feature of a media.
924
* @returns VBox status code.
925
* @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
926
* @param pInterface Pointer to the interface structure containing the called function pointer.
927
* @param cCylinders Number of cylinders.
928
* @param cHeads Number of heads.
929
* @param cSectors Number of sectors. This number is 1-based.
930
* @remark This have no influence on the read/write operations.
931
* @thread The emulation thread.
933
DECLR3CALLBACKMEMBER(int, pfnSetGeometry,(PPDMIBLOCKBIOS pInterface, uint32_t cCylinders, uint32_t cHeads, uint32_t cSectors));
936
* Get stored geometry translation mode - BIOS property.
937
* This is an optional feature of a media.
939
* @returns VBox status code.
940
* @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry translation mode.
941
* @param pInterface Pointer to the interface structure containing the called function pointer.
942
* @param penmTranslation Where to store the translation type.
943
* @remark This have no influence on the read/write operations.
944
* @thread Any thread.
946
DECLR3CALLBACKMEMBER(int, pfnGetTranslation,(PPDMIBLOCKBIOS pInterface, PPDMBIOSTRANSLATION penmTranslation));
949
* Store media geometry - BIOS property.
950
* This is an optional feature of a media.
952
* @returns VBox status code.
953
* @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
954
* @param pInterface Pointer to the interface structure containing the called function pointer.
955
* @param enmTranslation The translation type.
956
* @remark This have no influence on the read/write operations.
957
* @thread The emulation thread.
959
DECLR3CALLBACKMEMBER(int, pfnSetTranslation,(PPDMIBLOCKBIOS pInterface, PDMBIOSTRANSLATION enmTranslation));
962
* Checks if the device should be visible to the BIOS or not.
964
* @returns true if the device is visible to the BIOS.
965
* @returns false if the device is not visible to the BIOS.
966
* @param pInterface Pointer to the interface structure containing the called function pointer.
967
* @thread Any thread.
969
DECLR3CALLBACKMEMBER(bool, pfnIsVisible,(PPDMIBLOCKBIOS pInterface));
972
* Gets the block drive type.
974
* @returns block drive type.
975
* @param pInterface Pointer to the interface structure containing the called function pointer.
976
* @thread Any thread.
978
DECLR3CALLBACKMEMBER(PDMBLOCKTYPE, pfnGetType,(PPDMIBLOCKBIOS pInterface));
983
/** Pointer to a static block core driver interface. */
984
typedef struct PDMIMEDIASTATIC *PPDMIMEDIASTATIC;
986
* Static block core driver interface.
988
typedef struct PDMIMEDIASTATIC
991
* Check if the specified file is a format which the core driver can handle.
993
* @returns true / false accordingly.
994
* @param pInterface Pointer to the interface structure containing the called function pointer.
995
* @param pszFilename Name of the file to probe.
997
DECLR3CALLBACKMEMBER(bool, pfnCanHandle,(PPDMIMEDIASTATIC pInterface, const char *pszFilename));
1001
/** Pointer to an iSCSI Request PDU buffer. */
1002
typedef struct ISCSIREQ *PISCSIREQ;
1004
* iSCSI Request PDU buffer (gather).
1006
typedef struct ISCSIREQ
1008
/** Length of PDU segment in bytes. */
1010
/** Pointer to PDU segment. */
1014
/** Pointer to an iSCSI Response PDU buffer. */
1015
typedef struct ISCSIRES *PISCSIRES;
1017
* iSCSI Response PDU buffer (scatter).
1019
typedef struct ISCSIRES
1021
/** Length of PDU segment. */
1023
/** Pointer to PDU segment. */
1027
/** Pointer to an iSCSI transport driver interface. */
1028
typedef struct PDMIISCSITRANSPORT *PPDMIISCSITRANSPORT;
1030
* iSCSI transport driver interface.
1032
typedef struct PDMIISCSITRANSPORT
1035
* Read bytes from an iSCSI transport stream. If the connection fails, it is automatically
1036
* reopened on the next call after the error is signalled. Error recovery in this case is
1037
* the duty of the caller.
1039
* @returns VBox status code.
1040
* @param pTransport Pointer to the interface structure containing the called function pointer.
1041
* @param pvBuf Where to store the read bits.
1042
* @param cbBuf Number of bytes to read.
1043
* @param pcbRead Actual number of bytes read.
1044
* @thread Any thread.
1045
* @todo Correct the docs.
1047
DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMIISCSITRANSPORT pTransport, PISCSIRES prgResponse, unsigned int cnResponse));
1050
* Write bytes to an iSCSI transport stream. Padding is performed when necessary. If the connection
1051
* fails, it is automatically reopened on the next call after the error is signalled. Error recovery
1052
* in this case is the duty of the caller.
1054
* @returns VBox status code.
1055
* @param pTransport Pointer to the interface structure containing the called function pointer.
1056
* @param pvBuf Where the write bits are stored.
1057
* @param cbWrite Number of bytes to write.
1058
* @thread Any thread.
1059
* @todo Correct the docs.
1061
DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMIISCSITRANSPORT pTransport, PISCSIREQ prgRequest, unsigned int cnRequest));
1064
* Open the iSCSI transport stream.
1066
* @returns VBox status code.
1067
* @param pTransport Pointer to the interface structure containing the called function pointer.
1068
* @param pszTargetAddress Pointer to string of the format address:port.
1069
* @thread Any thread.
1071
DECLR3CALLBACKMEMBER(int, pfnOpen,(PPDMIISCSITRANSPORT pTransport, const char *pszTargetAddress));
1074
* Close the iSCSI transport stream.
1076
* @returns VBox status code.
1077
* @param pTransport Pointer to the interface structure containing the called function pointer.
1078
* @thread Any thread.
1080
DECLR3CALLBACKMEMBER(int, pfnClose,(PPDMIISCSITRANSPORT pTransport));
1081
} PDMIISCSITRANSPORT;
1084
/** Pointer to a char port interface. */
1085
typedef struct PDMICHARPORT *PPDMICHARPORT;
1087
* Char port interface.
1088
* Pair with PDMICHAR.
1090
typedef struct PDMICHARPORT
1093
* Deliver data read to the device/driver.
1095
* @returns VBox status code.
1096
* @param pInterface Pointer to the interface structure containing the called function pointer.
1097
* @param pvBuf Where the read bits are stored.
1098
* @param pcbRead Number of bytes available for reading/having been read.
1099
* @thread Any thread.
1101
DECLR3CALLBACKMEMBER(int, pfnNotifyRead,(PPDMICHARPORT pInterface, const void *pvBuf, size_t *pcbRead));
1104
/** Pointer to a char interface. */
1105
typedef struct PDMICHAR *PPDMICHAR;
1108
* Pair with PDMICHARPORT.
1110
typedef struct PDMICHAR
1115
* @returns VBox status code.
1116
* @param pInterface Pointer to the interface structure containing the called function pointer.
1117
* @param pvBuf Where to store the write bits.
1118
* @param cbWrite Number of bytes to write.
1119
* @thread Any thread.
1121
DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMICHAR pInterface, const void *pvBuf, size_t cbWrite));
1124
* Set device parameters.
1126
* @returns VBox status code.
1127
* @param pInterface Pointer to the interface structure containing the called function pointer.
1128
* @param Bps Speed of the serial connection. (bits per second)
1129
* @param chParity Parity method: 'E' - even, 'O' - odd, 'N' - none.
1130
* @param cDataBits Number of data bits.
1131
* @param cStopBits Number of stop bits.
1132
* @thread Any thread.
1134
DECLR3CALLBACKMEMBER(int, pfnSetParameters,(PPDMICHAR pInterface, unsigned Bps, char chParity, unsigned cDataBits, unsigned cStopBits));
1139
/** Pointer to a stream interface. */
1140
typedef struct PDMISTREAM *PPDMISTREAM;
1143
* Makes up the fundation for PDMICHAR.
1145
typedef struct PDMISTREAM
1150
* @returns VBox status code.
1151
* @param pInterface Pointer to the interface structure containing the called function pointer.
1152
* @param pvBuf Where to store the read bits.
1153
* @param cbRead Number of bytes to read/bytes actually read.
1154
* @thread Any thread.
1156
DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMISTREAM pInterface, void *pvBuf, size_t *cbRead));
1161
* @returns VBox status code.
1162
* @param pInterface Pointer to the interface structure containing the called function pointer.
1163
* @param pvBuf Where to store the write bits.
1164
* @param cbWrite Number of bytes to write/bytes actually written.
1165
* @thread Any thread.
1167
DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMISTREAM pInterface, const void *pvBuf, size_t *cbWrite));
1171
/** Pointer to a host device port interface. */
1172
typedef struct PDMIHOSTDEVICEPORT *PPDMIHOSTDEVICEPORT;
1175
* Char port interface.
1176
* Pair with PDMIHOSTDEVICECONNECTOR.
1178
typedef struct PDMIHOSTDEVICEPORT
1181
* Deliver data read to the device/driver.
1183
* @returns VBox status code.
1184
* @param pInterface Pointer to the interface structure containing the called function pointer.
1185
* @param pvBuf Where the read bits are stored.
1186
* @param pcbRead Number of bytes available for reading/having been read.
1187
* @thread Any thread.
1189
DECLR3CALLBACKMEMBER(int, pfnNotifyRead,(PPDMIHOSTDEVICEPORT pInterface, const void *pvBuf, size_t *pcbRead));
1190
} PDMIHOSTDEVICEPORT;
1192
/** Pointer to a Host Device connector interface. */
1193
typedef struct PDMIHOSTDEVICECONNECTOR *PPDMIHOSTDEVICECONNECTOR;
1196
* Host device connector interface
1197
* Pair with PDMIHOSTDEVICEPORT.
1199
typedef struct PDMIHOSTDEVICECONNECTOR
1204
* @returns VBox status code.
1205
* @param pInterface Pointer to the interface structure containing the called function pointer.
1206
* @param pvBuf Where to store the write bits.
1207
* @param pcbWrite Number of bytes to write/bytes actually written.
1208
* @thread Any thread.
1210
DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMIHOSTDEVICECONNECTOR pInterface, const void *pvBuf, size_t *pcbWrite));
1215
* @returns VBox status code.
1216
* @param pInterface Pointer to the interface structure containing the called function pointer.
1217
* @param pvBuf Where to store the read bits.
1218
* @param pcbRead Number of bytes to read/bytes actually read.
1219
* @thread Any thread.
1221
DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMIHOSTDEVICECONNECTOR pInterface, void *pvBuf, size_t *pcbRead));
1224
* Perform IO control on the host device.
1226
* @returns VBox status code.
1227
* @param pInterface Pointer to the interface structure containing the called function pointer.
1228
* @param uCommand The number of the command to set or get data
1229
* @param pvData Where to store the command data.
1230
* @thread Any thread.
1232
DECLR3CALLBACKMEMBER(int, pfnIOCtl,(PPDMIHOSTDEVICECONNECTOR pInterface, RTUINT uCommand, void *pvData));
1233
} PDMIHOSTDEVICECONNECTOR;
1236
/** ACPI power source identifier */
1237
typedef enum PDMACPIPOWERSOURCE
1239
PDM_ACPI_POWER_SOURCE_UNKNOWN = 0,
1240
PDM_ACPI_POWER_SOURCE_OUTLET,
1241
PDM_ACPI_POWER_SOURCE_BATTERY
1242
} PDMACPIPOWERSOURCE;
1243
/** Pointer to ACPI battery state. */
1244
typedef PDMACPIPOWERSOURCE *PPDMACPIPOWERSOURCE;
1246
/** ACPI battey capacity */
1247
typedef enum PDMACPIBATCAPACITY
1249
PDM_ACPI_BAT_CAPACITY_MIN = 0,
1250
PDM_ACPI_BAT_CAPACITY_MAX = 100,
1251
PDM_ACPI_BAT_CAPACITY_UNKNOWN = 255
1252
} PDMACPIBATCAPACITY;
1253
/** Pointer to ACPI battery capacity. */
1254
typedef PDMACPIBATCAPACITY *PPDMACPIBATCAPACITY;
1256
/** ACPI battery state. See ACPI 3.0 spec '_BST (Battery Status)' */
1257
typedef enum PDMACPIBATSTATE
1259
PDM_ACPI_BAT_STATE_CHARGED = 0x00,
1260
PDM_ACPI_BAT_STATE_CHARGING = 0x01,
1261
PDM_ACPI_BAT_STATE_DISCHARGING = 0x02,
1262
PDM_ACPI_BAT_STATE_CRITICAL = 0x04
1264
/** Pointer to ACPI battery state. */
1265
typedef PDMACPIBATSTATE *PPDMACPIBATSTATE;
1267
/** Pointer to an ACPI port interface. */
1268
typedef struct PDMIACPIPORT *PPDMIACPIPORT;
1270
* ACPI port interface.
1272
typedef struct PDMIACPIPORT
1275
* Send an ACPI power off event.
1277
* @returns VBox status code
1278
* @param pInterface Pointer to the interface structure containing the called function pointer.
1280
DECLR3CALLBACKMEMBER(int, pfnPowerButtonPress,(PPDMIACPIPORT pInterface));
1283
/** Pointer to an ACPI connector interface. */
1284
typedef struct PDMIACPICONNECTOR *PPDMIACPICONNECTOR;
1286
* ACPI connector interface.
1288
typedef struct PDMIACPICONNECTOR
1291
* Get the current power source of the host system.
1293
* @returns VBox status code
1294
* @param pInterface Pointer to the interface structure containing the called function pointer.
1295
* @param penmPowerSource Pointer to the power source result variable.
1297
DECLR3CALLBACKMEMBER(int, pfnQueryPowerSource,(PPDMIACPICONNECTOR, PPDMACPIPOWERSOURCE penmPowerSource));
1300
* Query the current battery status of the host system.
1302
* @returns VBox status code?
1303
* @param pInterface Pointer to the interface structure containing the called function pointer.
1304
* @param pfPresent Is set to true if battery is present, false otherwise.
1305
* @param penmRemainingCapacity Pointer to the battery remaining capacity (0 - 100 or 255 for unknown).
1306
* @param penmBatteryState Pointer to the battery status.
1307
* @param pu32PresentRate Pointer to the present rate (0..1000 of the total capacity).
1309
DECLR3CALLBACKMEMBER(int, pfnQueryBatteryStatus,(PPDMIACPICONNECTOR, bool *pfPresent, PPDMACPIBATCAPACITY penmRemainingCapacity,
1310
PPDMACPIBATSTATE penmBatteryState, uint32_t *pu32PresentRate));
1311
} PDMIACPICONNECTOR;
1314
/** Pointer to a VMMDevice port interface. */
1315
typedef struct PDMIVMMDEVPORT *PPDMIVMMDEVPORT;
1317
* VMMDevice port interface.
1319
typedef struct PDMIVMMDEVPORT
1322
* Return the current absolute mouse position in pixels
1324
* @returns VBox status code
1325
* @param pAbsX Pointer of result value, can be NULL
1326
* @param pAbsY Pointer of result value, can be NULL
1328
DECLR3CALLBACKMEMBER(int, pfnQueryAbsoluteMouse,(PPDMIVMMDEVPORT pInterface, uint32_t *pAbsX, uint32_t *pAbsY));
1331
* Set the new absolute mouse position in pixels
1333
* @returns VBox status code
1334
* @param absX New absolute X position
1335
* @param absY New absolute Y position
1337
DECLR3CALLBACKMEMBER(int, pfnSetAbsoluteMouse,(PPDMIVMMDEVPORT pInterface, uint32_t absX, uint32_t absY));
1340
* Return the current mouse capability flags
1342
* @returns VBox status code
1343
* @param pCapabilities Pointer of result value
1345
DECLR3CALLBACKMEMBER(int, pfnQueryMouseCapabilities,(PPDMIVMMDEVPORT pInterface, uint32_t *pCapabilities));
1348
* Set the current mouse capability flag (host side)
1350
* @returns VBox status code
1351
* @param capabilities Capability mask
1353
DECLR3CALLBACKMEMBER(int, pfnSetMouseCapabilities,(PPDMIVMMDEVPORT pInterface, uint32_t capabilities));
1356
* Issue a display resolution change request.
1358
* Note that there can only one request in the queue and that in case the guest does
1359
* not process it, issuing another request will overwrite the previous.
1361
* @returns VBox status code
1362
* @param cx Horizontal pixel resolution (0 = do not change).
1363
* @param cy Vertical pixel resolution (0 = do not change).
1364
* @param cBits Bits per pixel (0 = do not change).
1365
* @param display The display index.
1367
DECLR3CALLBACKMEMBER(int, pfnRequestDisplayChange,(PPDMIVMMDEVPORT pInterface, uint32_t cx, uint32_t cy, uint32_t cBits, uint32_t display));
1370
* Pass credentials to guest.
1372
* Note that there can only be one set of credentials and the guest may or may not
1373
* query them and may do whatever it wants with them.
1375
* @returns VBox status code
1376
* @param pszUsername User name, may be empty (UTF-8)
1377
* @param pszPassword Password, may be empty (UTF-8)
1378
* @param pszDomain Domain name, may be empty (UTF-8)
1379
* @param fFlags Bitflags
1381
DECLR3CALLBACKMEMBER(int, pfnSetCredentials,(PPDMIVMMDEVPORT pInterface, const char *pszUsername,
1382
const char *pszPassword, const char *pszDomain,
1386
* Notify the driver about a VBVA status change.
1388
* @returns Nothing. Because it is informational callback.
1389
* @param fEnabled Current VBVA status.
1391
DECLR3CALLBACKMEMBER(void, pfnVBVAChange, (PPDMIVMMDEVPORT pInterface, bool fEnabled));
1394
* Issue a seamless mode change request.
1396
* Note that there can only one request in the queue and that in case the guest does
1397
* not process it, issuing another request will overwrite the previous.
1399
* @returns VBox status code
1400
* @param fEnabled Seamless mode enabled or not
1402
DECLR3CALLBACKMEMBER(int, pfnRequestSeamlessChange,(PPDMIVMMDEVPORT pInterface, bool fEnabled));
1406
/** Forward declaration of the video accelerator command memory. */
1408
/** Forward declaration of the guest information structure. */
1409
struct VBoxGuestInfo;
1410
/** Pointer to video accelerator command memory. */
1411
typedef struct _VBVAMEMORY *PVBVAMEMORY;
1413
/** Pointer to a VMMDev connector interface. */
1414
typedef struct PDMIVMMDEVCONNECTOR *PPDMIVMMDEVCONNECTOR;
1416
* VMMDev connector interface.
1417
* Pair with PDMIVMMDEVPORT.
1419
typedef struct PDMIVMMDEVCONNECTOR
1422
* Report guest OS version.
1423
* Called whenever the Additions issue a guest version report request.
1425
* @param pInterface Pointer to this interface.
1426
* @param pGuestInfo Pointer to guest information structure
1427
* @thread The emulation thread.
1429
DECLR3CALLBACKMEMBER(void, pfnUpdateGuestVersion,(PPDMIVMMDEVCONNECTOR pInterface, struct VBoxGuestInfo *pGuestInfo));
1432
* Update the guest additions capabilities.
1433
* This is called when the guest additions capabilities change. The new capabilities
1434
* are given and the connector should update its internal state.
1436
* @param pInterface Pointer to this interface.
1437
* @param newCapabilities New capabilities.
1438
* @thread The emulation thread.
1440
DECLR3CALLBACKMEMBER(void, pfnUpdateGuestCapabilities,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities));
1443
* Update the mouse capabilities.
1444
* This is called when the mouse capabilities change. The new capabilities
1445
* are given and the connector should update its internal state.
1447
* @param pInterface Pointer to this interface.
1448
* @param newCapabilities New capabilities.
1449
* @thread The emulation thread.
1451
DECLR3CALLBACKMEMBER(void, pfnUpdateMouseCapabilities,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities));
1454
* Update the pointer shape.
1455
* This is called when the mouse pointer shape changes. The new shape
1456
* is passed as a caller allocated buffer that will be freed after returning
1458
* @param pInterface Pointer to this interface.
1459
* @param fVisible Visibility indicator (if false, the other parameters are undefined).
1460
* @param fAlpha Flag whether alpha channel is being passed.
1461
* @param xHot Pointer hot spot x coordinate.
1462
* @param yHot Pointer hot spot y coordinate.
1463
* @param x Pointer new x coordinate on screen.
1464
* @param y Pointer new y coordinate on screen.
1465
* @param cx Pointer width in pixels.
1466
* @param cy Pointer height in pixels.
1467
* @param cbScanline Size of one scanline in bytes.
1468
* @param pvShape New shape buffer.
1469
* @thread The emulation thread.
1471
DECLR3CALLBACKMEMBER(void, pfnUpdatePointerShape,(PPDMIVMMDEVCONNECTOR pInterface, bool fVisible, bool fAlpha,
1472
uint32_t xHot, uint32_t yHot,
1473
uint32_t cx, uint32_t cy,
1477
* Enable or disable video acceleration on behalf of guest.
1479
* @param pInterface Pointer to this interface.
1480
* @param fEnable Whether to enable acceleration.
1481
* @param pVbvaMemory Video accelerator memory.
1483
* @return VBox rc. VINF_SUCCESS if VBVA was enabled.
1484
* @thread The emulation thread.
1486
DECLR3CALLBACKMEMBER(int, pfnVideoAccelEnable,(PPDMIVMMDEVCONNECTOR pInterface, bool fEnable, PVBVAMEMORY pVbvaMemory));
1489
* Force video queue processing.
1491
* @param pInterface Pointer to this interface.
1492
* @thread The emulation thread.
1494
DECLR3CALLBACKMEMBER(void, pfnVideoAccelFlush,(PPDMIVMMDEVCONNECTOR pInterface));
1497
* Return whether the given video mode is supported/wanted by the host.
1499
* @returns VBox status code
1500
* @param pInterface Pointer to this interface.
1501
* @param cy Video mode horizontal resolution in pixels.
1502
* @param cx Video mode vertical resolution in pixels.
1503
* @param cBits Video mode bits per pixel.
1504
* @param pfSupported Where to put the indicator for whether this mode is supported. (output)
1505
* @thread The emulation thread.
1507
DECLR3CALLBACKMEMBER(int, pfnVideoModeSupported,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t cx, uint32_t cy, uint32_t cBits, bool *pfSupported));
1510
* Queries by how many pixels the height should be reduced when calculating video modes
1512
* @returns VBox status code
1513
* @param pInterface Pointer to this interface.
1514
* @param pcyReduction Pointer to the result value.
1515
* @thread The emulation thread.
1517
DECLR3CALLBACKMEMBER(int, pfnGetHeightReduction,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcyReduction));
1520
* Informs about a credentials judgement result from the guest.
1522
* @returns VBox status code
1523
* @param pInterface Pointer to this interface.
1524
* @param fFlags Judgement result flags.
1525
* @thread The emulation thread.
1527
DECLR3CALLBACKMEMBER(int, pfnSetCredentialsJudgementResult,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t fFlags));
1530
* Set the visible region of the display
1532
* @returns VBox status code.
1533
* @param pInterface Pointer to this interface.
1534
* @param cRect Number of rectangles in pRect
1535
* @param pRect Rectangle array
1536
* @thread The emulation thread.
1538
DECLR3CALLBACKMEMBER(int, pfnSetVisibleRegion,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t cRect, PRTRECT pRect));
1541
* Query the visible region of the display
1543
* @returns VBox status code.
1544
* @param pInterface Pointer to this interface.
1545
* @param pcRect Number of rectangles in pRect
1546
* @param pRect Rectangle array (set to NULL to query the number of rectangles)
1547
* @thread The emulation thread.
1549
DECLR3CALLBACKMEMBER(int, pfnQueryVisibleRegion,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcRect, PRTRECT pRect));
1551
} PDMIVMMDEVCONNECTOR;
1556
* (The first 24 bits are the 'company id', where the first bit seems to have a special meaning if set.)
1558
typedef union PDMMAC
1565
/** Pointer to a MAC address. */
1566
typedef PDMMAC *PPDMMAC;
1567
/** Pointer to a const MAC address. */
1568
typedef const PDMMAC *PCPDMMAC;
1571
/** Pointer to a network port interface */
1572
typedef struct PDMINETWORKPORT *PPDMINETWORKPORT;
1574
* Network port interface.
1576
typedef struct PDMINETWORKPORT
1579
* Check how much data the device/driver can receive data now.
1580
* This must be called before the pfnRecieve() method is called.
1582
* @returns Number of bytes the device can receive now.
1583
* @param pInterface Pointer to the interface structure containing the called function pointer.
1586
DECLR3CALLBACKMEMBER(size_t, pfnCanReceive,(PPDMINETWORKPORT pInterface));
1589
* Receive data from the network.
1591
* @returns VBox status code.
1592
* @param pInterface Pointer to the interface structure containing the called function pointer.
1593
* @param pvBuf The available data.
1594
* @param cb Number of bytes available in the buffer.
1597
DECLR3CALLBACKMEMBER(int, pfnReceive,(PPDMINETWORKPORT pInterface, const void *pvBuf, size_t cb));
1603
* Network link state.
1605
typedef enum PDMNETWORKLINKSTATE
1607
/** Invalid state. */
1608
PDMNETWORKLINKSTATE_INVALID = 0,
1609
/** The link is up. */
1610
PDMNETWORKLINKSTATE_UP,
1611
/** The link is down. */
1612
PDMNETWORKLINKSTATE_DOWN,
1613
/** The link is temporarily down while resuming. */
1614
PDMNETWORKLINKSTATE_DOWN_RESUME
1615
} PDMNETWORKLINKSTATE;
1618
/** Pointer to a network connector interface */
1619
typedef struct PDMINETWORKCONNECTOR *PPDMINETWORKCONNECTOR;
1621
* Network connector interface.
1623
typedef struct PDMINETWORKCONNECTOR
1626
* Send data to the network.
1628
* @returns VBox status code.
1629
* @param pInterface Pointer to the interface structure containing the called function pointer.
1630
* @param pvBuf Data to send.
1631
* @param cb Number of bytes to send.
1634
DECLR3CALLBACKMEMBER(int, pfnSend,(PPDMINETWORKCONNECTOR pInterface, const void *pvBuf, size_t cb));
1637
* Set promiscuous mode.
1639
* This is called when the promiscuous mode is set. This means that there doesn't have
1640
* to be a mode change when it's called.
1642
* @param pInterface Pointer to the interface structure containing the called function pointer.
1643
* @param fPromiscuous Set if the adaptor is now in promiscuous mode. Clear if it is not.
1646
DECLR3CALLBACKMEMBER(void, pfnSetPromiscuousMode,(PPDMINETWORKCONNECTOR pInterface, bool fPromiscuous));
1649
* Notification on link status changes.
1651
* @param pInterface Pointer to the interface structure containing the called function pointer.
1652
* @param enmLinkState The new link state.
1655
DECLR3CALLBACKMEMBER(void, pfnNotifyLinkChanged,(PPDMINETWORKCONNECTOR pInterface, PDMNETWORKLINKSTATE enmLinkState));
1658
* More receive buffer has become available.
1660
* This is called when the NIC frees up receive buffers.
1662
* @param pInterface Pointer to the interface structure containing the called function pointer.
1665
DECLR3CALLBACKMEMBER(void, pfnNotifyCanReceive,(PPDMINETWORKCONNECTOR pInterface));
1667
} PDMINETWORKCONNECTOR;
1670
/** Pointer to a network config port interface */
1671
typedef struct PDMINETWORKCONFIG *PPDMINETWORKCONFIG;
1673
* Network config port interface.
1675
typedef struct PDMINETWORKCONFIG
1678
* Gets the current Media Access Control (MAC) address.
1680
* @returns VBox status code.
1681
* @param pInterface Pointer to the interface structure containing the called function pointer.
1682
* @param pMac Where to store the MAC address.
1685
DECLR3CALLBACKMEMBER(int, pfnGetMac,(PPDMINETWORKCONFIG pInterface, PPDMMAC *pMac));
1688
* Gets the new link state.
1690
* @returns The current link state.
1691
* @param pInterface Pointer to the interface structure containing the called function pointer.
1694
DECLR3CALLBACKMEMBER(PDMNETWORKLINKSTATE, pfnGetLinkState,(PPDMINETWORKCONFIG pInterface));
1697
* Sets the new link state.
1699
* @returns VBox status code.
1700
* @param pInterface Pointer to the interface structure containing the called function pointer.
1701
* @param enmState The new link state
1704
DECLR3CALLBACKMEMBER(int, pfnSetLinkState,(PPDMINETWORKCONFIG pInterface, PDMNETWORKLINKSTATE enmState));
1706
} PDMINETWORKCONFIG;
1709
/** Pointer to a network connector interface */
1710
typedef struct PDMIAUDIOCONNECTOR *PPDMIAUDIOCONNECTOR;
1712
* Audio connector interface.
1714
typedef struct PDMIAUDIOCONNECTOR
1716
DECLR3CALLBACKMEMBER(void, pfnRun,(PPDMIAUDIOCONNECTOR pInterface));
1718
/* DECLR3CALLBACKMEMBER(int, pfnSetRecordSource,(PPDMIAUDIOINCONNECTOR pInterface, AUDIORECSOURCE)); */
1720
} PDMIAUDIOCONNECTOR;
1723
/** @todo r=bird: the two following interfaces are hacks to work around the missing audio driver
1724
* interface. This should be addressed rather than making more temporary hacks. */
1726
/** Pointer to a Audio Sniffer Device port interface. */
1727
typedef struct PDMIAUDIOSNIFFERPORT *PPDMIAUDIOSNIFFERPORT;
1730
* Audio Sniffer port interface.
1732
typedef struct PDMIAUDIOSNIFFERPORT
1735
* Enables or disables sniffing. If sniffing is being enabled also sets a flag
1736
* whether the audio must be also left on the host.
1738
* @returns VBox status code
1739
* @param pInterface Pointer to this interface.
1740
* @param fEnable 'true' for enable sniffing, 'false' to disable.
1741
* @param fKeepHostAudio Indicates whether host audio should also present
1742
* 'true' means that sound should not be played
1743
* by the audio device.
1745
DECLR3CALLBACKMEMBER(int, pfnSetup,(PPDMIAUDIOSNIFFERPORT pInterface, bool fEnable, bool fKeepHostAudio));
1747
} PDMIAUDIOSNIFFERPORT;
1749
/** Pointer to a Audio Sniffer connector interface. */
1750
typedef struct PDMIAUDIOSNIFFERCONNECTOR *PPDMIAUDIOSNIFFERCONNECTOR;
1753
* Audio Sniffer connector interface.
1754
* Pair with PDMIAUDIOSNIFFERPORT.
1756
typedef struct PDMIAUDIOSNIFFERCONNECTOR
1759
* AudioSniffer device calls this method when audio samples
1760
* are about to be played and sniffing is enabled.
1762
* @param pInterface Pointer to this interface.
1763
* @param pvSamples Audio samples buffer.
1764
* @param cSamples How many complete samples are in the buffer.
1765
* @param iSampleHz The sample frequency in Hz.
1766
* @param cChannels Number of channels. 1 for mono, 2 for stereo.
1767
* @param cBits How many bits a sample for a single channel has. Normally 8 or 16.
1768
* @param fUnsigned Whether samples are unsigned values.
1769
* @thread The emulation thread.
1771
DECLR3CALLBACKMEMBER(void, pfnAudioSamplesOut,(PPDMIAUDIOSNIFFERCONNECTOR pInterface, void *pvSamples, uint32_t cSamples,
1772
int iSampleHz, int cChannels, int cBits, bool fUnsigned));
1775
* AudioSniffer device calls this method when output volume is changed.
1777
* @param pInterface Pointer to this interface.
1778
* @param u16LeftVolume 0..0xFFFF volume level for left channel.
1779
* @param u16RightVolume 0..0xFFFF volume level for right channel.
1780
* @thread The emulation thread.
1782
DECLR3CALLBACKMEMBER(void, pfnAudioVolumeOut,(PPDMIAUDIOSNIFFERCONNECTOR pInterface, uint16_t u16LeftVolume, uint16_t u16RightVolume));
1784
} PDMIAUDIOSNIFFERCONNECTOR;
1788
* Generic status LED core.
1789
* Note that a unit doesn't have to support all the indicators.
1791
typedef union PDMLEDCORE
1794
uint32_t volatile u32;
1798
/** Reading/Receiving indicator. */
1799
uint32_t fReading : 1;
1800
/** Writing/Sending indicator. */
1801
uint32_t fWriting : 1;
1802
/** Busy indicator. */
1804
/** Error indicator. */
1805
uint32_t fError : 1;
1809
/** LED bit masks for the u32 view.
1811
/** Reading/Receiving indicator. */
1812
#define PDMLED_READING BIT(0)
1813
/** Writing/Sending indicator. */
1814
#define PDMLED_WRITING BIT(1)
1815
/** Busy indicator. */
1816
#define PDMLED_BUSY BIT(2)
1817
/** Error indicator. */
1818
#define PDMLED_ERROR BIT(3)
1823
* Generic status LED.
1824
* Note that a unit doesn't have to support all the indicators.
1826
typedef struct PDMLED
1828
/** Just a magic for sanity checking. */
1830
uint32_t u32Alignment; /**< structure size alignment. */
1831
/** The actual LED status.
1832
* Only the device is allowed to change this. */
1834
/** The asserted LED status which is cleared by the reader.
1835
* The device will assert the bits but never clear them.
1836
* The driver clears them as it sees fit. */
1837
PDMLEDCORE Asserted;
1840
/** Pointer to an LED. */
1841
typedef PDMLED *PPDMLED;
1842
/** Pointer to a const LED. */
1843
typedef const PDMLED *PCPDMLED;
1845
#define PDMLED_MAGIC ( 0x11335577 )
1847
/** Pointer to an LED ports interface. */
1848
typedef struct PDMILEDPORTS *PPDMILEDPORTS;
1850
* Interface for exporting LEDs.
1852
typedef struct PDMILEDPORTS
1855
* Gets the pointer to the status LED of a unit.
1857
* @returns VBox status code.
1858
* @param pInterface Pointer to the interface structure containing the called function pointer.
1859
* @param iLUN The unit which status LED we desire.
1860
* @param ppLed Where to store the LED pointer.
1862
DECLR3CALLBACKMEMBER(int, pfnQueryStatusLed,(PPDMILEDPORTS pInterface, unsigned iLUN, PPDMLED *ppLed));
1867
/** Pointer to an LED connectors interface. */
1868
typedef struct PDMILEDCONNECTORS *PPDMILEDCONNECTORS;
1870
* Interface for reading LEDs.
1872
typedef struct PDMILEDCONNECTORS
1875
* Notification about a unit which have been changed.
1877
* The driver must discard any pointers to data owned by
1878
* the unit and requery it.
1880
* @param pInterface Pointer to the interface structure containing the called function pointer.
1881
* @param iLUN The unit number.
1883
DECLR3CALLBACKMEMBER(void, pfnUnitChanged,(PPDMILEDCONNECTORS pInterface, unsigned iLUN));
1884
} PDMILEDCONNECTORS;
1887
/** The special status unit number */
1888
#define PDM_STATUS_LUN 999
1893
/** Abstract HGCM command structure. Used only to define a typed pointer. */
1896
/** Pointer to HGCM command structure. This pointer is unique and identifies
1897
* the command being processed. The pointer is passed to HGCM connector methods,
1898
* and must be passed back to HGCM port when command is completed.
1900
typedef struct VBOXHGCMCMD *PVBOXHGCMCMD;
1902
/** Pointer to a HGCM port interface. */
1903
typedef struct PDMIHGCMPORT *PPDMIHGCMPORT;
1906
* HGCM port interface. Normally implemented by VMMDev.
1908
typedef struct PDMIHGCMPORT
1911
* Notify the guest on a command completion.
1913
* @param pInterface Pointer to this interface.
1914
* @param rc The return code (VBox error code).
1915
* @param pCmd A pointer that identifies the completed command.
1917
* @returns VBox status code
1919
DECLR3CALLBACKMEMBER(void, pfnCompleted,(PPDMIHGCMPORT pInterface, int32_t rc, PVBOXHGCMCMD pCmd));
1924
/** Pointer to a HGCM connector interface. */
1925
typedef struct PDMIHGCMCONNECTOR *PPDMIHGCMCONNECTOR;
1927
/** Pointer to a HGCM service location structure. */
1928
typedef struct HGCMSERVICELOCATION *PHGCMSERVICELOCATION;
1931
* HGCM connector interface.
1932
* Pair with PDMIHGCMPORT.
1934
typedef struct PDMIHGCMCONNECTOR
1937
* Locate a service and inform it about a client connection.
1939
* @param pInterface Pointer to this interface.
1940
* @param pCmd A pointer that identifies the command.
1941
* @param pServiceLocation Pointer to the service location structure.
1942
* @param pu32ClientID Where to store the client id for the connection.
1943
* @return VBox status code.
1944
* @thread The emulation thread.
1946
DECLR3CALLBACKMEMBER(int, pfnConnect,(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, PHGCMSERVICELOCATION pServiceLocation, uint32_t *pu32ClientID));
1949
* Disconnect from service.
1951
* @param pInterface Pointer to this interface.
1952
* @param pCmd A pointer that identifies the command.
1953
* @param u32ClientID The client id returned by the pfnConnect call.
1954
* @return VBox status code.
1955
* @thread The emulation thread.
1957
DECLR3CALLBACKMEMBER(int, pfnDisconnect,(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID));
1960
* Process a guest issued command.
1962
* @param pInterface Pointer to this interface.
1963
* @param pCmd A pointer that identifies the command.
1964
* @param u32ClientID The client id returned by the pfnConnect call.
1965
* @param u32Function Function to be performed by the service.
1966
* @param cParms Number of parameters in the array pointed to by paParams.
1967
* @param paParms Pointer to an array of parameters.
1968
* @return VBox status code.
1969
* @thread The emulation thread.
1971
DECLR3CALLBACKMEMBER(int, pfnCall,(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID, uint32_t u32Function,
1972
uint32_t cParms, PVBOXHGCMSVCPARM paParms));
1974
} PDMIHGCMCONNECTOR;