VirtualBox

source: vbox/trunk/include/VBox/vmm/pdmifs.h@ 51752

Last change on this file since 51752 was 51752, checked in by vboxsync, 11 years ago

Storage,DrvVD,Main: Redo the way secret keys are passed from Main to encryption filters in DrvVD. Instead of using the config interface in VD use a distinct interface for retrieving secret keys which directly talks to the entity storing the keys in Console. Avoids copying sensitive data into probably insecure buffers. Key consumers only get a reference to the key which they can use and don't have to worry about allocating secure key memory.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 131.9 KB
Line 
1/** @file
2 * PDM - Pluggable Device Manager, Interfaces.
3 */
4
5/*
6 * Copyright (C) 2006-2012 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.215389.xyz. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef ___VBox_vmm_pdmifs_h
27#define ___VBox_vmm_pdmifs_h
28
29#include <iprt/sg.h>
30#include <VBox/types.h>
31#include <VBox/hgcmsvc.h>
32
33
34RT_C_DECLS_BEGIN
35
36/** @defgroup grp_pdm_interfaces The PDM Interface Definitions
37 * @ingroup grp_pdm
38 *
39 * For historical reasons (the PDMINTERFACE enum) a lot of interface was stuffed
40 * together in this group instead, dragging stuff into global space that didn't
41 * need to be there and making this file huge (>2500 lines). Since we're using
42 * UUIDs as interface identifiers (IIDs) now, no only generic PDM interface will
43 * be added to this file. Component specific interface should be defined in the
44 * header file of that component.
45 *
46 * Interfaces consists of a method table (typedef'ed struct) and an interface
47 * ID. The typename of the method table should have an 'I' in it, be all
48 * capitals and according to the rules, no underscores. The interface ID is a
49 * \#define constructed by appending '_IID' to the typename. The IID value is a
50 * UUID string on the form "a2299c0d-b709-4551-aa5a-73f59ffbed74". If you stick
51 * to these rules, you can make use of the PDMIBASE_QUERY_INTERFACE and
52 * PDMIBASE_RETURN_INTERFACE when querying interface and implementing
53 * PDMIBASE::pfnQueryInterface respectively.
54 *
55 * In most interface descriptions the orientation of the interface is given as
56 * 'down' or 'up'. This refers to a model with the device on the top and the
57 * drivers stacked below it. Sometimes there is mention of 'main' or 'external'
58 * which normally means the same, i.e. the Main or VBoxBFE API. Picture the
59 * orientation of 'main' as horizontal.
60 *
61 * @{
62 */
63
64
65/** @name PDMIBASE
66 * @{
67 */
68
69/**
70 * PDM Base Interface.
71 *
72 * Everyone implements this.
73 */
74typedef struct PDMIBASE
75{
76 /**
77 * Queries an interface to the driver.
78 *
79 * @returns Pointer to interface.
80 * @returns NULL if the interface was not supported by the driver.
81 * @param pInterface Pointer to this interface structure.
82 * @param pszIID The interface ID, a UUID string.
83 * @thread Any thread.
84 */
85 DECLR3CALLBACKMEMBER(void *, pfnQueryInterface,(struct PDMIBASE *pInterface, const char *pszIID));
86} PDMIBASE;
87/** PDMIBASE interface ID. */
88#define PDMIBASE_IID "a2299c0d-b709-4551-aa5a-73f59ffbed74"
89
90/**
91 * Helper macro for querying an interface from PDMIBASE.
92 *
93 * @returns Correctly typed PDMIBASE::pfnQueryInterface return value.
94 *
95 * @param pIBase Pointer to the base interface.
96 * @param InterfaceType The interface type name. The interface ID is
97 * derived from this by appending _IID.
98 */
99#define PDMIBASE_QUERY_INTERFACE(pIBase, InterfaceType) \
100 ( (InterfaceType *)(pIBase)->pfnQueryInterface(pIBase, InterfaceType##_IID ) )
101
102/**
103 * Helper macro for implementing PDMIBASE::pfnQueryInterface.
104 *
105 * Return @a pInterface if @a pszIID matches the @a InterfaceType. This will
106 * perform basic type checking.
107 *
108 * @param pszIID The ID of the interface that is being queried.
109 * @param InterfaceType The interface type name. The interface ID is
110 * derived from this by appending _IID.
111 * @param pInterface The interface address expression.
112 */
113#define PDMIBASE_RETURN_INTERFACE(pszIID, InterfaceType, pInterface) \
114 do { \
115 if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
116 { \
117 P##InterfaceType pReturnInterfaceTypeCheck = (pInterface); \
118 return pReturnInterfaceTypeCheck; \
119 } \
120 } while (0)
121
122/** @} */
123
124
125/** @name PDMIBASERC
126 * @{
127 */
128
129/**
130 * PDM Base Interface for querying ring-mode context interfaces in
131 * ring-3.
132 *
133 * This is mandatory for drivers present in raw-mode context.
134 */
135typedef struct PDMIBASERC
136{
137 /**
138 * Queries an ring-mode context interface to the driver.
139 *
140 * @returns Pointer to interface.
141 * @returns NULL if the interface was not supported by the driver.
142 * @param pInterface Pointer to this interface structure.
143 * @param pszIID The interface ID, a UUID string.
144 * @thread Any thread.
145 */
146 DECLR3CALLBACKMEMBER(RTRCPTR, pfnQueryInterface,(struct PDMIBASERC *pInterface, const char *pszIID));
147} PDMIBASERC;
148/** Pointer to a PDM Base Interface for query ring-mode context interfaces. */
149typedef PDMIBASERC *PPDMIBASERC;
150/** PDMIBASERC interface ID. */
151#define PDMIBASERC_IID "f6a6c649-6cb3-493f-9737-4653f221aeca"
152
153/**
154 * Helper macro for querying an interface from PDMIBASERC.
155 *
156 * @returns PDMIBASERC::pfnQueryInterface return value.
157 *
158 * @param pIBaseRC Pointer to the base raw-mode context interface. Can
159 * be NULL.
160 * @param InterfaceType The interface type base name, no trailing RC. The
161 * interface ID is derived from this by appending _IID.
162 *
163 * @remarks Unlike PDMIBASE_QUERY_INTERFACE, this macro is not able to do any
164 * implicit type checking for you.
165 */
166#define PDMIBASERC_QUERY_INTERFACE(pIBaseRC, InterfaceType) \
167 ( (P##InterfaceType##RC)((pIBaseRC) ? (pIBaseRC)->pfnQueryInterface(pIBaseRC, InterfaceType##_IID) : NIL_RTRCPTR) )
168
169/**
170 * Helper macro for implementing PDMIBASERC::pfnQueryInterface.
171 *
172 * Return @a pInterface if @a pszIID matches the @a InterfaceType. This will
173 * perform basic type checking.
174 *
175 * @param pIns Pointer to the instance data.
176 * @param pszIID The ID of the interface that is being queried.
177 * @param InterfaceType The interface type base name, no trailing RC. The
178 * interface ID is derived from this by appending _IID.
179 * @param pInterface The interface address expression. This must resolve
180 * to some address within the instance data.
181 * @remarks Don't use with PDMIBASE.
182 */
183#define PDMIBASERC_RETURN_INTERFACE(pIns, pszIID, InterfaceType, pInterface) \
184 do { \
185 Assert((uintptr_t)pInterface - PDMINS_2_DATA(pIns, uintptr_t) < _4M); \
186 if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
187 { \
188 InterfaceType##RC *pReturnInterfaceTypeCheck = (pInterface); \
189 return (uintptr_t)pReturnInterfaceTypeCheck \
190 - PDMINS_2_DATA(pIns, uintptr_t) \
191 + PDMINS_2_DATA_RCPTR(pIns); \
192 } \
193 } while (0)
194
195/** @} */
196
197
198/** @name PDMIBASER0
199 * @{
200 */
201
202/**
203 * PDM Base Interface for querying ring-0 interfaces in ring-3.
204 *
205 * This is mandatory for drivers present in ring-0 context.
206 */
207typedef struct PDMIBASER0
208{
209 /**
210 * Queries an ring-0 interface to the driver.
211 *
212 * @returns Pointer to interface.
213 * @returns NULL if the interface was not supported by the driver.
214 * @param pInterface Pointer to this interface structure.
215 * @param pszIID The interface ID, a UUID string.
216 * @thread Any thread.
217 */
218 DECLR3CALLBACKMEMBER(RTR0PTR, pfnQueryInterface,(struct PDMIBASER0 *pInterface, const char *pszIID));
219} PDMIBASER0;
220/** Pointer to a PDM Base Interface for query ring-0 context interfaces. */
221typedef PDMIBASER0 *PPDMIBASER0;
222/** PDMIBASER0 interface ID. */
223#define PDMIBASER0_IID "9c9b99b8-7f53-4f59-a3c2-5bc9659c7944"
224
225/**
226 * Helper macro for querying an interface from PDMIBASER0.
227 *
228 * @returns PDMIBASER0::pfnQueryInterface return value.
229 *
230 * @param pIBaseR0 Pointer to the base ring-0 interface. Can be NULL.
231 * @param InterfaceType The interface type base name, no trailing R0. The
232 * interface ID is derived from this by appending _IID.
233 *
234 * @remarks Unlike PDMIBASE_QUERY_INTERFACE, this macro is not able to do any
235 * implicit type checking for you.
236 */
237#define PDMIBASER0_QUERY_INTERFACE(pIBaseR0, InterfaceType) \
238 ( (P##InterfaceType##R0)((pIBaseR0) ? (pIBaseR0)->pfnQueryInterface(pIBaseR0, InterfaceType##_IID) : NIL_RTR0PTR) )
239
240/**
241 * Helper macro for implementing PDMIBASER0::pfnQueryInterface.
242 *
243 * Return @a pInterface if @a pszIID matches the @a InterfaceType. This will
244 * perform basic type checking.
245 *
246 * @param pIns Pointer to the instance data.
247 * @param pszIID The ID of the interface that is being queried.
248 * @param InterfaceType The interface type base name, no trailing R0. The
249 * interface ID is derived from this by appending _IID.
250 * @param pInterface The interface address expression. This must resolve
251 * to some address within the instance data.
252 * @remarks Don't use with PDMIBASE.
253 */
254#define PDMIBASER0_RETURN_INTERFACE(pIns, pszIID, InterfaceType, pInterface) \
255 do { \
256 Assert((uintptr_t)pInterface - PDMINS_2_DATA(pIns, uintptr_t) < _4M); \
257 if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
258 { \
259 InterfaceType##R0 *pReturnInterfaceTypeCheck = (pInterface); \
260 return (uintptr_t)pReturnInterfaceTypeCheck \
261 - PDMINS_2_DATA(pIns, uintptr_t) \
262 + PDMINS_2_DATA_R0PTR(pIns); \
263 } \
264 } while (0)
265
266/** @} */
267
268
269/**
270 * Dummy interface.
271 *
272 * This is used to typedef other dummy interfaces. The purpose of a dummy
273 * interface is to validate the logical function of a driver/device and
274 * full a natural interface pair.
275 */
276typedef struct PDMIDUMMY
277{
278 RTHCPTR pvDummy;
279} PDMIDUMMY;
280
281
282/** Pointer to a mouse port interface. */
283typedef struct PDMIMOUSEPORT *PPDMIMOUSEPORT;
284/**
285 * Mouse port interface (down).
286 * Pair with PDMIMOUSECONNECTOR.
287 */
288typedef struct PDMIMOUSEPORT
289{
290 /**
291 * Puts a mouse event.
292 *
293 * This is called by the source of mouse events. The event will be passed up
294 * until the topmost driver, which then calls the registered event handler.
295 *
296 * @returns VBox status code. Return VERR_TRY_AGAIN if you cannot process the
297 * event now and want it to be repeated at a later point.
298 *
299 * @param pInterface Pointer to this interface structure.
300 * @param dx The X delta.
301 * @param dy The Y delta.
302 * @param dz The Z delta.
303 * @param dw The W (horizontal scroll button) delta.
304 * @param fButtons The button states, see the PDMIMOUSEPORT_BUTTON_* \#defines.
305 */
306 DECLR3CALLBACKMEMBER(int, pfnPutEvent,(PPDMIMOUSEPORT pInterface,
307 int32_t dx, int32_t dy, int32_t dz,
308 int32_t dw, uint32_t fButtons));
309 /**
310 * Puts an absolute mouse event.
311 *
312 * This is called by the source of mouse events. The event will be passed up
313 * until the topmost driver, which then calls the registered event handler.
314 *
315 * @returns VBox status code. Return VERR_TRY_AGAIN if you cannot process the
316 * event now and want it to be repeated at a later point.
317 *
318 * @param pInterface Pointer to this interface structure.
319 * @param x The X value, in the range 0 to 0xffff.
320 * @param z The Y value, in the range 0 to 0xffff.
321 * @param dz The Z delta.
322 * @param dw The W (horizontal scroll button) delta.
323 * @param fButtons The button states, see the PDMIMOUSEPORT_BUTTON_* \#defines.
324 */
325 DECLR3CALLBACKMEMBER(int, pfnPutEventAbs,(PPDMIMOUSEPORT pInterface,
326 uint32_t x, uint32_t z,
327 int32_t dz, int32_t dw,
328 uint32_t fButtons));
329 /**
330 * Puts a multi-touch event.
331 *
332 * @returns VBox status code. Return VERR_TRY_AGAIN if you cannot process the
333 * event now and want it to be repeated at a later point.
334 *
335 * @param pInterface Pointer to this interface structure.
336 * @param cContacts How many touch contacts in this event.
337 * @param pau64Contacts Pointer to array of packed contact information.
338 * Each 64bit element contains:
339 * Bits 0..15: X coordinate in pixels (signed).
340 * Bits 16..31: Y coordinate in pixels (signed).
341 * Bits 32..39: contact identifier.
342 * Bit 40: "in contact" flag, which indicates that
343 * there is a contact with the touch surface.
344 * Bit 41: "in range" flag, the contact is close enough
345 * to the touch surface.
346 * All other bits are reserved for future use and must be set to 0.
347 * @param u32ScanTime Timestamp of this event in milliseconds. Only relative
348 * time between event is important.
349 */
350 DECLR3CALLBACKMEMBER(int, pfnPutEventMultiTouch,(PPDMIMOUSEPORT pInterface,
351 uint8_t cContacts,
352 const uint64_t *pau64Contacts,
353 uint32_t u32ScanTime));
354} PDMIMOUSEPORT;
355/** PDMIMOUSEPORT interface ID. */
356#define PDMIMOUSEPORT_IID "359364f0-9fa3-4490-a6b4-7ed771901c93"
357
358/** Mouse button defines for PDMIMOUSEPORT::pfnPutEvent.
359 * @{ */
360#define PDMIMOUSEPORT_BUTTON_LEFT RT_BIT(0)
361#define PDMIMOUSEPORT_BUTTON_RIGHT RT_BIT(1)
362#define PDMIMOUSEPORT_BUTTON_MIDDLE RT_BIT(2)
363#define PDMIMOUSEPORT_BUTTON_X1 RT_BIT(3)
364#define PDMIMOUSEPORT_BUTTON_X2 RT_BIT(4)
365/** @} */
366
367
368/** Pointer to a mouse connector interface. */
369typedef struct PDMIMOUSECONNECTOR *PPDMIMOUSECONNECTOR;
370/**
371 * Mouse connector interface (up).
372 * Pair with PDMIMOUSEPORT.
373 */
374typedef struct PDMIMOUSECONNECTOR
375{
376 /**
377 * Notifies the the downstream driver of changes to the reporting modes
378 * supported by the driver
379 *
380 * @param pInterface Pointer to this interface structure.
381 * @param fRelative Whether relative mode is currently supported.
382 * @param fAbsolute Whether absolute mode is currently supported.
383 * @param fAbsolute Whether multi-touch mode is currently supported.
384 */
385 DECLR3CALLBACKMEMBER(void, pfnReportModes,(PPDMIMOUSECONNECTOR pInterface, bool fRelative, bool fAbsolute, bool fMultiTouch));
386
387 /**
388 * Flushes the mouse queue if it contains pending events.
389 *
390 * @param pInterface Pointer to this interface structure.
391 */
392 DECLR3CALLBACKMEMBER(void, pfnFlushQueue,(PPDMIMOUSECONNECTOR pInterface));
393
394} PDMIMOUSECONNECTOR;
395/** PDMIMOUSECONNECTOR interface ID. */
396#define PDMIMOUSECONNECTOR_IID "ce64d7bd-fa8f-41d1-a6fb-d102a2d6bffe"
397
398
399/** Pointer to a keyboard port interface. */
400typedef struct PDMIKEYBOARDPORT *PPDMIKEYBOARDPORT;
401/**
402 * Keyboard port interface (down).
403 * Pair with PDMIKEYBOARDCONNECTOR.
404 */
405typedef struct PDMIKEYBOARDPORT
406{
407 /**
408 * Puts a scan code based keyboard event.
409 *
410 * This is called by the source of keyboard events. The event will be passed up
411 * until the topmost driver, which then calls the registered event handler.
412 *
413 * @returns VBox status code. Return VERR_TRY_AGAIN if you cannot process the
414 * event now and want it to be repeated at a later point.
415 *
416 * @param pInterface Pointer to this interface structure.
417 * @param u8ScanCode The scan code to queue.
418 */
419 DECLR3CALLBACKMEMBER(int, pfnPutEventScan,(PPDMIKEYBOARDPORT pInterface, uint8_t u8KeyCode));
420
421 /**
422 * Puts a USB HID usage ID based keyboard event.
423 *
424 * This is called by the source of keyboard events. The event will be passed up
425 * until the topmost driver, which then calls the registered event handler.
426 *
427 * @returns VBox status code. Return VERR_TRY_AGAIN if you cannot process the
428 * event now and want it to be repeated at a later point.
429 *
430 * @param pInterface Pointer to this interface structure.
431 * @param u32UsageID The HID usage code event to queue.
432 */
433 DECLR3CALLBACKMEMBER(int, pfnPutEventHid,(PPDMIKEYBOARDPORT pInterface, uint32_t u32UsageID));
434} PDMIKEYBOARDPORT;
435/** PDMIKEYBOARDPORT interface ID. */
436#define PDMIKEYBOARDPORT_IID "2a0844f0-410b-40ab-a6ed-6575f3aa3e29"
437
438
439/**
440 * Keyboard LEDs.
441 */
442typedef enum PDMKEYBLEDS
443{
444 /** No leds. */
445 PDMKEYBLEDS_NONE = 0x0000,
446 /** Num Lock */
447 PDMKEYBLEDS_NUMLOCK = 0x0001,
448 /** Caps Lock */
449 PDMKEYBLEDS_CAPSLOCK = 0x0002,
450 /** Scroll Lock */
451 PDMKEYBLEDS_SCROLLLOCK = 0x0004
452} PDMKEYBLEDS;
453
454/** Pointer to keyboard connector interface. */
455typedef struct PDMIKEYBOARDCONNECTOR *PPDMIKEYBOARDCONNECTOR;
456/**
457 * Keyboard connector interface (up).
458 * Pair with PDMIKEYBOARDPORT
459 */
460typedef struct PDMIKEYBOARDCONNECTOR
461{
462 /**
463 * Notifies the the downstream driver about an LED change initiated by the guest.
464 *
465 * @param pInterface Pointer to this interface structure.
466 * @param enmLeds The new led mask.
467 */
468 DECLR3CALLBACKMEMBER(void, pfnLedStatusChange,(PPDMIKEYBOARDCONNECTOR pInterface, PDMKEYBLEDS enmLeds));
469
470 /**
471 * Notifies the the downstream driver of changes in driver state.
472 *
473 * @param pInterface Pointer to this interface structure.
474 * @param fActive Whether interface wishes to get "focus".
475 */
476 DECLR3CALLBACKMEMBER(void, pfnSetActive,(PPDMIKEYBOARDCONNECTOR pInterface, bool fActive));
477
478 /**
479 * Flushes the keyboard queue if it contains pending events.
480 *
481 * @param pInterface Pointer to this interface structure.
482 */
483 DECLR3CALLBACKMEMBER(void, pfnFlushQueue,(PPDMIKEYBOARDCONNECTOR pInterface));
484
485} PDMIKEYBOARDCONNECTOR;
486/** PDMIKEYBOARDCONNECTOR interface ID. */
487#define PDMIKEYBOARDCONNECTOR_IID "db3f7bd5-953e-436f-9f8e-077905a92d82"
488
489
490
491/** Pointer to a display port interface. */
492typedef struct PDMIDISPLAYPORT *PPDMIDISPLAYPORT;
493/**
494 * Display port interface (down).
495 * Pair with PDMIDISPLAYCONNECTOR.
496 */
497typedef struct PDMIDISPLAYPORT
498{
499 /**
500 * Update the display with any changed regions.
501 *
502 * Flushes any display changes to the memory pointed to by the
503 * PDMIDISPLAYCONNECTOR interface and calles PDMIDISPLAYCONNECTOR::pfnUpdateRect()
504 * while doing so.
505 *
506 * @returns VBox status code.
507 * @param pInterface Pointer to this interface.
508 * @thread The emulation thread.
509 */
510 DECLR3CALLBACKMEMBER(int, pfnUpdateDisplay,(PPDMIDISPLAYPORT pInterface));
511
512 /**
513 * Update the entire display.
514 *
515 * Flushes the entire display content to the memory pointed to by the
516 * PDMIDISPLAYCONNECTOR interface and calles PDMIDISPLAYCONNECTOR::pfnUpdateRect().
517 *
518 * @returns VBox status code.
519 * @param pInterface Pointer to this interface.
520 * @thread The emulation thread.
521 */
522 DECLR3CALLBACKMEMBER(int, pfnUpdateDisplayAll,(PPDMIDISPLAYPORT pInterface));
523
524 /**
525 * Return the current guest color depth in bits per pixel (bpp).
526 *
527 * As the graphics card is able to provide display updates with the bpp
528 * requested by the host, this method can be used to query the actual
529 * guest color depth.
530 *
531 * @returns VBox status code.
532 * @param pInterface Pointer to this interface.
533 * @param pcBits Where to store the current guest color depth.
534 * @thread Any thread.
535 */
536 DECLR3CALLBACKMEMBER(int, pfnQueryColorDepth,(PPDMIDISPLAYPORT pInterface, uint32_t *pcBits));
537
538 /**
539 * Sets the refresh rate and restart the timer.
540 * The rate is defined as the minimum interval between the return of
541 * one PDMIDISPLAYPORT::pfnRefresh() call to the next one.
542 *
543 * The interval timer will be restarted by this call. So at VM startup
544 * this function must be called to start the refresh cycle. The refresh
545 * rate is not saved, but have to be when resuming a loaded VM state.
546 *
547 * @returns VBox status code.
548 * @param pInterface Pointer to this interface.
549 * @param cMilliesInterval Number of millis between two refreshes.
550 * @thread Any thread.
551 */
552 DECLR3CALLBACKMEMBER(int, pfnSetRefreshRate,(PPDMIDISPLAYPORT pInterface, uint32_t cMilliesInterval));
553
554 /**
555 * Create a 32-bbp screenshot of the display.
556 *
557 * This will allocate and return a 32-bbp bitmap. Size of the bitmap scanline in bytes is 4*width.
558 *
559 * The allocated bitmap buffer must be freed with pfnFreeScreenshot.
560 *
561 * @param pInterface Pointer to this interface.
562 * @param ppu8Data Where to store the pointer to the allocated buffer.
563 * @param pcbData Where to store the actual size of the bitmap.
564 * @param pcx Where to store the width of the bitmap.
565 * @param pcy Where to store the height of the bitmap.
566 * @thread The emulation thread.
567 */
568 DECLR3CALLBACKMEMBER(int, pfnTakeScreenshot,(PPDMIDISPLAYPORT pInterface, uint8_t **ppu8Data, size_t *pcbData, uint32_t *pcx, uint32_t *pcy));
569
570 /**
571 * Free screenshot buffer.
572 *
573 * This will free the memory buffer allocated by pfnTakeScreenshot.
574 *
575 * @param pInterface Pointer to this interface.
576 * @param ppu8Data Pointer to the buffer returned by pfnTakeScreenshot.
577 * @thread Any.
578 */
579 DECLR3CALLBACKMEMBER(void, pfnFreeScreenshot,(PPDMIDISPLAYPORT pInterface, uint8_t *pu8Data));
580
581 /**
582 * Copy bitmap to the display.
583 *
584 * This will convert and copy a 32-bbp bitmap (with dword aligned scanline length) to
585 * the memory pointed to by the PDMIDISPLAYCONNECTOR interface.
586 *
587 * @param pInterface Pointer to this interface.
588 * @param pvData Pointer to the bitmap bits.
589 * @param x The upper left corner x coordinate of the destination rectangle.
590 * @param y The upper left corner y coordinate of the destination rectangle.
591 * @param cx The width of the source and destination rectangles.
592 * @param cy The height of the source and destination rectangles.
593 * @thread The emulation thread.
594 * @remark This is just a convenience for using the bitmap conversions of the
595 * graphics device.
596 */
597 DECLR3CALLBACKMEMBER(int, pfnDisplayBlt,(PPDMIDISPLAYPORT pInterface, const void *pvData, uint32_t x, uint32_t y, uint32_t cx, uint32_t cy));
598
599 /**
600 * Render a rectangle from guest VRAM to Framebuffer.
601 *
602 * @param pInterface Pointer to this interface.
603 * @param x The upper left corner x coordinate of the rectangle to be updated.
604 * @param y The upper left corner y coordinate of the rectangle to be updated.
605 * @param cx The width of the rectangle to be updated.
606 * @param cy The height of the rectangle to be updated.
607 * @thread The emulation thread.
608 */
609 DECLR3CALLBACKMEMBER(void, pfnUpdateDisplayRect,(PPDMIDISPLAYPORT pInterface, int32_t x, int32_t y, uint32_t cx, uint32_t cy));
610
611 /**
612 * Inform the VGA device whether the Display is directly using the guest VRAM and there is no need
613 * to render the VRAM to the framebuffer memory.
614 *
615 * @param pInterface Pointer to this interface.
616 * @param fRender Whether the VRAM content must be rendered to the framebuffer.
617 * @thread The emulation thread.
618 */
619 DECLR3CALLBACKMEMBER(void, pfnSetRenderVRAM,(PPDMIDISPLAYPORT pInterface, bool fRender));
620
621 /**
622 * Render a bitmap rectangle from source to target buffer.
623 *
624 * @param pInterface Pointer to this interface.
625 * @param cx The width of the rectangle to be copied.
626 * @param cy The height of the rectangle to be copied.
627 * @param pbSrc Source frame buffer 0,0.
628 * @param xSrc The upper left corner x coordinate of the source rectangle.
629 * @param ySrc The upper left corner y coordinate of the source rectangle.
630 * @param cxSrc The width of the source frame buffer.
631 * @param cySrc The height of the source frame buffer.
632 * @param cbSrcLine The line length of the source frame buffer.
633 * @param cSrcBitsPerPixel The pixel depth of the source.
634 * @param pbDst Destination frame buffer 0,0.
635 * @param xDst The upper left corner x coordinate of the destination rectangle.
636 * @param yDst The upper left corner y coordinate of the destination rectangle.
637 * @param cxDst The width of the destination frame buffer.
638 * @param cyDst The height of the destination frame buffer.
639 * @param cbDstLine The line length of the destination frame buffer.
640 * @param cDstBitsPerPixel The pixel depth of the destination.
641 * @thread The emulation thread.
642 */
643 DECLR3CALLBACKMEMBER(int, pfnCopyRect,(PPDMIDISPLAYPORT pInterface, uint32_t cx, uint32_t cy,
644 const uint8_t *pbSrc, int32_t xSrc, int32_t ySrc, uint32_t cxSrc, uint32_t cySrc, uint32_t cbSrcLine, uint32_t cSrcBitsPerPixel,
645 uint8_t *pbDst, int32_t xDst, int32_t yDst, uint32_t cxDst, uint32_t cyDst, uint32_t cbDstLine, uint32_t cDstBitsPerPixel));
646
647} PDMIDISPLAYPORT;
648/** PDMIDISPLAYPORT interface ID. */
649#define PDMIDISPLAYPORT_IID "22d3d93d-3407-487a-8308-85367eae00bb"
650
651
652typedef struct VBOXVHWACMD *PVBOXVHWACMD; /**< @todo r=bird: A line what it is to make doxygen happy. */
653typedef struct VBVACMDHDR *PVBVACMDHDR;
654typedef struct VBVAINFOSCREEN *PVBVAINFOSCREEN;
655typedef struct VBVAINFOVIEW *PVBVAINFOVIEW;
656typedef struct VBVAHOSTFLAGS *PVBVAHOSTFLAGS;
657struct VBOXVDMACMD_CHROMIUM_CMD; /* <- chromium [hgsmi] command */
658struct VBOXVDMACMD_CHROMIUM_CTL; /* <- chromium [hgsmi] command */
659
660
661/** Pointer to a display connector interface. */
662typedef struct PDMIDISPLAYCONNECTOR *PPDMIDISPLAYCONNECTOR;
663struct VBOXCRCMDCTL;
664typedef DECLCALLBACKPTR(void, PFNCRCTLCOMPLETION)(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd, int rc, void *pvCompletion);
665/**
666 * Display connector interface (up).
667 * Pair with PDMIDISPLAYPORT.
668 */
669typedef struct PDMIDISPLAYCONNECTOR
670{
671 /**
672 * Resize the display.
673 * This is called when the resolution changes. This usually happens on
674 * request from the guest os, but may also happen as the result of a reset.
675 * If the callback returns VINF_VGA_RESIZE_IN_PROGRESS, the caller (VGA device)
676 * must not access the connector and return.
677 *
678 * @returns VINF_SUCCESS if the framebuffer resize was completed,
679 * VINF_VGA_RESIZE_IN_PROGRESS if resize takes time and not yet finished.
680 * @param pInterface Pointer to this interface.
681 * @param cBits Color depth (bits per pixel) of the new video mode.
682 * @param pvVRAM Address of the guest VRAM.
683 * @param cbLine Size in bytes of a single scan line.
684 * @param cx New display width.
685 * @param cy New display height.
686 * @thread The emulation thread.
687 */
688 DECLR3CALLBACKMEMBER(int, pfnResize,(PPDMIDISPLAYCONNECTOR pInterface, uint32_t cBits, void *pvVRAM, uint32_t cbLine, uint32_t cx, uint32_t cy));
689
690 /**
691 * Update a rectangle of the display.
692 * PDMIDISPLAYPORT::pfnUpdateDisplay is the caller.
693 *
694 * @param pInterface Pointer to this interface.
695 * @param x The upper left corner x coordinate of the rectangle.
696 * @param y The upper left corner y coordinate of the rectangle.
697 * @param cx The width of the rectangle.
698 * @param cy The height of the rectangle.
699 * @thread The emulation thread.
700 */
701 DECLR3CALLBACKMEMBER(void, pfnUpdateRect,(PPDMIDISPLAYCONNECTOR pInterface, uint32_t x, uint32_t y, uint32_t cx, uint32_t cy));
702
703 /**
704 * Refresh the display.
705 *
706 * The interval between these calls is set by
707 * PDMIDISPLAYPORT::pfnSetRefreshRate(). The driver should call
708 * PDMIDISPLAYPORT::pfnUpdateDisplay() if it wishes to refresh the
709 * display. PDMIDISPLAYPORT::pfnUpdateDisplay calls pfnUpdateRect with
710 * the changed rectangles.
711 *
712 * @param pInterface Pointer to this interface.
713 * @thread The emulation thread.
714 */
715 DECLR3CALLBACKMEMBER(void, pfnRefresh,(PPDMIDISPLAYCONNECTOR pInterface));
716
717 /**
718 * Reset the display.
719 *
720 * Notification message when the graphics card has been reset.
721 *
722 * @param pInterface Pointer to this interface.
723 * @thread The emulation thread.
724 */
725 DECLR3CALLBACKMEMBER(void, pfnReset,(PPDMIDISPLAYCONNECTOR pInterface));
726
727 /**
728 * LFB video mode enter/exit.
729 *
730 * Notification message when LinearFrameBuffer video mode is enabled/disabled.
731 *
732 * @param pInterface Pointer to this interface.
733 * @param fEnabled false - LFB mode was disabled,
734 * true - an LFB mode was disabled
735 * @thread The emulation thread.
736 */
737 DECLR3CALLBACKMEMBER(void, pfnLFBModeChange, (PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled));
738
739 /**
740 * Process the guest graphics adapter information.
741 *
742 * Direct notification from guest to the display connector.
743 *
744 * @param pInterface Pointer to this interface.
745 * @param pvVRAM Address of the guest VRAM.
746 * @param u32VRAMSize Size of the guest VRAM.
747 * @thread The emulation thread.
748 */
749 DECLR3CALLBACKMEMBER(void, pfnProcessAdapterData, (PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, uint32_t u32VRAMSize));
750
751 /**
752 * Process the guest display information.
753 *
754 * Direct notification from guest to the display connector.
755 *
756 * @param pInterface Pointer to this interface.
757 * @param pvVRAM Address of the guest VRAM.
758 * @param uScreenId The index of the guest display to be processed.
759 * @thread The emulation thread.
760 */
761 DECLR3CALLBACKMEMBER(void, pfnProcessDisplayData, (PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, unsigned uScreenId));
762
763 /**
764 * Process the guest Video HW Acceleration command.
765 *
766 * @param pInterface Pointer to this interface.
767 * @param pCmd Video HW Acceleration Command to be processed.
768 * @returns VINF_SUCCESS - command is completed,
769 * VINF_CALLBACK_RETURN - command will by asynchronously completed via complete callback
770 * VERR_INVALID_STATE - the command could not be processed (most likely because the framebuffer was disconnected) - the post should be retried later
771 * @thread The emulation thread.
772 */
773 DECLR3CALLBACKMEMBER(int, pfnVHWACommandProcess, (PPDMIDISPLAYCONNECTOR pInterface, PVBOXVHWACMD pCmd));
774
775 /**
776 * Process the guest chromium command.
777 *
778 * @param pInterface Pointer to this interface.
779 * @param pCmd Video HW Acceleration Command to be processed.
780 * @thread The emulation thread.
781 */
782 DECLR3CALLBACKMEMBER(void, pfnCrHgsmiCommandProcess, (PPDMIDISPLAYCONNECTOR pInterface, struct VBOXVDMACMD_CHROMIUM_CMD* pCmd, uint32_t cbCmd));
783
784 /**
785 * Process the guest chromium control command.
786 *
787 * @param pInterface Pointer to this interface.
788 * @param pCmd Video HW Acceleration Command to be processed.
789 * @thread The emulation thread.
790 */
791 DECLR3CALLBACKMEMBER(void, pfnCrHgsmiControlProcess, (PPDMIDISPLAYCONNECTOR pInterface, struct VBOXVDMACMD_CHROMIUM_CTL* pCtl, uint32_t cbCtl));
792
793 /**
794 * Process the guest chromium control command.
795 *
796 * @param pInterface Pointer to this interface.
797 * @param pCmd Video HW Acceleration Command to be processed.
798 * @thread The emulation thread.
799 */
800 DECLR3CALLBACKMEMBER(int, pfnCrHgcmCtlSubmit, (PPDMIDISPLAYCONNECTOR pInterface,
801 struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd,
802 PFNCRCTLCOMPLETION pfnCompletion,
803 void *pvCompletion));
804
805 /**
806 * The specified screen enters VBVA mode.
807 *
808 * @param pInterface Pointer to this interface.
809 * @param uScreenId The screen updates are for.
810 * @param fRenderThreadMode if true - the graphics device has a separate thread that does all rendering.
811 * This means that:
812 * 1. all pfnVBVAXxx callbacks (including the current pfnVBVAEnable call), except displayVBVAMousePointerShape
813 * will be called in the context of the render thread rather than the emulation thread
814 * 2. PDMIDISPLAYCONNECTOR implementor (i.e. DisplayImpl) must NOT notify crogl backend
815 * about vbva-originated events (e.g. resize), because crogl is working in CrCmd mode,
816 * in the context of the render thread as part of the Graphics device, and gets notified about those events directly
817 * @thread if fRenderThreadMode is TRUE - the render thread, otherwise - the emulation thread.
818 */
819 DECLR3CALLBACKMEMBER(int, pfnVBVAEnable,(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, PVBVAHOSTFLAGS pHostFlags, bool fRenderThreadMode));
820
821 /**
822 * The specified screen leaves VBVA mode.
823 *
824 * @param pInterface Pointer to this interface.
825 * @param uScreenId The screen updates are for.
826 * @thread if render thread mode is on (fRenderThreadMode that was passed to pfnVBVAEnable is TRUE) - the render thread pfnVBVAEnable was called in,
827 * otherwise - the emulation thread.
828 */
829 DECLR3CALLBACKMEMBER(void, pfnVBVADisable,(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId));
830
831 /**
832 * A sequence of pfnVBVAUpdateProcess calls begins.
833 *
834 * @param pInterface Pointer to this interface.
835 * @param uScreenId The screen updates are for.
836 * @thread if render thread mode is on (fRenderThreadMode that was passed to pfnVBVAEnable is TRUE) - the render thread pfnVBVAEnable was called in,
837 * otherwise - the emulation thread.
838 */
839 DECLR3CALLBACKMEMBER(void, pfnVBVAUpdateBegin,(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId));
840
841 /**
842 * Process the guest VBVA command.
843 *
844 * @param pInterface Pointer to this interface.
845 * @param pCmd Video HW Acceleration Command to be processed.
846 * @thread if render thread mode is on (fRenderThreadMode that was passed to pfnVBVAEnable is TRUE) - the render thread pfnVBVAEnable was called in,
847 * otherwise - the emulation thread.
848 */
849 DECLR3CALLBACKMEMBER(void, pfnVBVAUpdateProcess,(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, const PVBVACMDHDR pCmd, size_t cbCmd));
850
851 /**
852 * A sequence of pfnVBVAUpdateProcess calls ends.
853 *
854 * @param pInterface Pointer to this interface.
855 * @param uScreenId The screen updates are for.
856 * @param x The upper left corner x coordinate of the combined rectangle of all VBVA updates.
857 * @param y The upper left corner y coordinate of the rectangle.
858 * @param cx The width of the rectangle.
859 * @param cy The height of the rectangle.
860 * @thread if render thread mode is on (fRenderThreadMode that was passed to pfnVBVAEnable is TRUE) - the render thread pfnVBVAEnable was called in,
861 * otherwise - the emulation thread.
862 */
863 DECLR3CALLBACKMEMBER(void, pfnVBVAUpdateEnd,(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, int32_t x, int32_t y, uint32_t cx, uint32_t cy));
864
865 /**
866 * Resize the display.
867 * This is called when the resolution changes. This usually happens on
868 * request from the guest os, but may also happen as the result of a reset.
869 * If the callback returns VINF_VGA_RESIZE_IN_PROGRESS, the caller (VGA device)
870 * must not access the connector and return.
871 *
872 * @todo Merge with pfnResize.
873 *
874 * @returns VINF_SUCCESS if the framebuffer resize was completed,
875 * VINF_VGA_RESIZE_IN_PROGRESS if resize takes time and not yet finished.
876 * @param pInterface Pointer to this interface.
877 * @param pView The description of VRAM block for this screen.
878 * @param pScreen The data of screen being resized.
879 * @param pvVRAM Address of the guest VRAM.
880 * @thread if render thread mode is on (fRenderThreadMode that was passed to pfnVBVAEnable is TRUE) - the render thread pfnVBVAEnable was called in,
881 * otherwise - the emulation thread.
882 */
883 DECLR3CALLBACKMEMBER(int, pfnVBVAResize,(PPDMIDISPLAYCONNECTOR pInterface, const PVBVAINFOVIEW pView, const PVBVAINFOSCREEN pScreen, void *pvVRAM));
884
885 /**
886 * Update the pointer shape.
887 * This is called when the mouse pointer shape changes. The new shape
888 * is passed as a caller allocated buffer that will be freed after returning
889 *
890 * @param pInterface Pointer to this interface.
891 * @param fVisible Visibility indicator (if false, the other parameters are undefined).
892 * @param fAlpha Flag whether alpha channel is being passed.
893 * @param xHot Pointer hot spot x coordinate.
894 * @param yHot Pointer hot spot y coordinate.
895 * @param x Pointer new x coordinate on screen.
896 * @param y Pointer new y coordinate on screen.
897 * @param cx Pointer width in pixels.
898 * @param cy Pointer height in pixels.
899 * @param cbScanline Size of one scanline in bytes.
900 * @param pvShape New shape buffer.
901 * @thread The emulation thread.
902 */
903 DECLR3CALLBACKMEMBER(int, pfnVBVAMousePointerShape,(PPDMIDISPLAYCONNECTOR pInterface, bool fVisible, bool fAlpha,
904 uint32_t xHot, uint32_t yHot,
905 uint32_t cx, uint32_t cy,
906 const void *pvShape));
907
908 /** Read-only attributes.
909 * For preformance reasons some readonly attributes are kept in the interface.
910 * We trust the interface users to respect the readonlyness of these.
911 * @{
912 */
913 /** Pointer to the display data buffer. */
914 uint8_t *pu8Data;
915 /** Size of a scanline in the data buffer. */
916 uint32_t cbScanline;
917 /** The color depth (in bits) the graphics card is supposed to provide. */
918 uint32_t cBits;
919 /** The display width. */
920 uint32_t cx;
921 /** The display height. */
922 uint32_t cy;
923 /** @} */
924} PDMIDISPLAYCONNECTOR;
925/** PDMIDISPLAYCONNECTOR interface ID. */
926#define PDMIDISPLAYCONNECTOR_IID "906d0c25-091f-497e-908c-1d70cb7e6114"
927
928
929/** Pointer to a block port interface. */
930typedef struct PDMIBLOCKPORT *PPDMIBLOCKPORT;
931/**
932 * Block notify interface (down).
933 * Pair with PDMIBLOCK.
934 */
935typedef struct PDMIBLOCKPORT
936{
937 /**
938 * Returns the storage controller name, instance and LUN of the attached medium.
939 *
940 * @returns VBox status.
941 * @param pInterface Pointer to this interface.
942 * @param ppcszController Where to store the name of the storage controller.
943 * @param piInstance Where to store the instance number of the controller.
944 * @param piLUN Where to store the LUN of the attached device.
945 */
946 DECLR3CALLBACKMEMBER(int, pfnQueryDeviceLocation, (PPDMIBLOCKPORT pInterface, const char **ppcszController,
947 uint32_t *piInstance, uint32_t *piLUN));
948
949} PDMIBLOCKPORT;
950/** PDMIBLOCKPORT interface ID. */
951#define PDMIBLOCKPORT_IID "bbbed4cf-0862-4ffd-b60c-f7a65ef8e8ff"
952
953
954/**
955 * Callback which provides progress information.
956 *
957 * @return VBox status code.
958 * @param pvUser Opaque user data.
959 * @param uPercent Completion percentage.
960 */
961typedef DECLCALLBACK(int) FNSIMPLEPROGRESS(void *pvUser, unsigned uPercentage);
962/** Pointer to FNSIMPLEPROGRESS() */
963typedef FNSIMPLEPROGRESS *PFNSIMPLEPROGRESS;
964
965
966/**
967 * Block drive type.
968 */
969typedef enum PDMBLOCKTYPE
970{
971 /** Error (for the query function). */
972 PDMBLOCKTYPE_ERROR = 1,
973 /** 360KB 5 1/4" floppy drive. */
974 PDMBLOCKTYPE_FLOPPY_360,
975 /** 720KB 3 1/2" floppy drive. */
976 PDMBLOCKTYPE_FLOPPY_720,
977 /** 1.2MB 5 1/4" floppy drive. */
978 PDMBLOCKTYPE_FLOPPY_1_20,
979 /** 1.44MB 3 1/2" floppy drive. */
980 PDMBLOCKTYPE_FLOPPY_1_44,
981 /** 2.88MB 3 1/2" floppy drive. */
982 PDMBLOCKTYPE_FLOPPY_2_88,
983 /** Fake drive that can take up to 15.6 MB images.
984 * C=255, H=2, S=63. */
985 PDMBLOCKTYPE_FLOPPY_FAKE_15_6,
986 /** Fake drive that can take up to 63.5 MB images.
987 * C=255, H=2, S=255. */
988 PDMBLOCKTYPE_FLOPPY_FAKE_63_5,
989 /** CDROM drive. */
990 PDMBLOCKTYPE_CDROM,
991 /** DVD drive. */
992 PDMBLOCKTYPE_DVD,
993 /** Hard disk drive. */
994 PDMBLOCKTYPE_HARD_DISK
995} PDMBLOCKTYPE;
996
997/** Check if the given block type is a floppy. */
998#define PDMBLOCKTYPE_IS_FLOPPY(a_enmType) ( (a_enmType) >= PDMBLOCKTYPE_FLOPPY_360 && (a_enmType) <= PDMBLOCKTYPE_FLOPPY_2_88 )
999
1000/**
1001 * Block raw command data transfer direction.
1002 */
1003typedef enum PDMBLOCKTXDIR
1004{
1005 PDMBLOCKTXDIR_NONE = 0,
1006 PDMBLOCKTXDIR_FROM_DEVICE,
1007 PDMBLOCKTXDIR_TO_DEVICE
1008} PDMBLOCKTXDIR;
1009
1010
1011/** Pointer to a block interface. */
1012typedef struct PDMIBLOCK *PPDMIBLOCK;
1013/**
1014 * Block interface (up).
1015 * Pair with PDMIBLOCKPORT.
1016 */
1017typedef struct PDMIBLOCK
1018{
1019 /**
1020 * Read bits.
1021 *
1022 * @returns VBox status code.
1023 * @param pInterface Pointer to the interface structure containing the called function pointer.
1024 * @param off Offset to start reading from. The offset must be aligned to a sector boundary.
1025 * @param pvBuf Where to store the read bits.
1026 * @param cbRead Number of bytes to read. Must be aligned to a sector boundary.
1027 * @thread Any thread.
1028 */
1029 DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMIBLOCK pInterface, uint64_t off, void *pvBuf, size_t cbRead));
1030
1031 /**
1032 * Write bits.
1033 *
1034 * @returns VBox status code.
1035 * @param pInterface Pointer to the interface structure containing the called function pointer.
1036 * @param off Offset to start writing at. The offset must be aligned to a sector boundary.
1037 * @param pvBuf Where to store the write bits.
1038 * @param cbWrite Number of bytes to write. Must be aligned to a sector boundary.
1039 * @thread Any thread.
1040 */
1041 DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMIBLOCK pInterface, uint64_t off, const void *pvBuf, size_t cbWrite));
1042
1043 /**
1044 * Make sure that the bits written are actually on the storage medium.
1045 *
1046 * @returns VBox status code.
1047 * @param pInterface Pointer to the interface structure containing the called function pointer.
1048 * @thread Any thread.
1049 */
1050 DECLR3CALLBACKMEMBER(int, pfnFlush,(PPDMIBLOCK pInterface));
1051
1052 /**
1053 * Send a raw command to the underlying device (CDROM).
1054 * This method is optional (i.e. the function pointer may be NULL).
1055 *
1056 * @returns VBox status code.
1057 * @param pInterface Pointer to the interface structure containing the called function pointer.
1058 * @param pbCmd Offset to start reading from.
1059 * @param enmTxDir Direction of transfer.
1060 * @param pvBuf Pointer tp the transfer buffer.
1061 * @param cbBuf Size of the transfer buffer.
1062 * @param pbSenseKey Status of the command (when return value is VERR_DEV_IO_ERROR).
1063 * @param cTimeoutMillies Command timeout in milliseconds.
1064 * @thread Any thread.
1065 */
1066 DECLR3CALLBACKMEMBER(int, pfnSendCmd,(PPDMIBLOCK pInterface, const uint8_t *pbCmd, PDMBLOCKTXDIR enmTxDir, void *pvBuf, uint32_t *pcbBuf, uint8_t *pabSense, size_t cbSense, uint32_t cTimeoutMillies));
1067
1068 /**
1069 * Merge medium contents during a live snapshot deletion.
1070 *
1071 * @returns VBox status code.
1072 * @param pInterface Pointer to the interface structure containing the called function pointer.
1073 * @param pfnProgress Function pointer for progress notification.
1074 * @param pvUser Opaque user data for progress notification.
1075 * @thread Any thread.
1076 */
1077 DECLR3CALLBACKMEMBER(int, pfnMerge,(PPDMIBLOCK pInterface, PFNSIMPLEPROGRESS pfnProgress, void *pvUser));
1078
1079 /**
1080 * Check if the media is readonly or not.
1081 *
1082 * @returns true if readonly.
1083 * @returns false if read/write.
1084 * @param pInterface Pointer to the interface structure containing the called function pointer.
1085 * @thread Any thread.
1086 */
1087 DECLR3CALLBACKMEMBER(bool, pfnIsReadOnly,(PPDMIBLOCK pInterface));
1088
1089 /**
1090 * Gets the media size in bytes.
1091 *
1092 * @returns Media size in bytes.
1093 * @param pInterface Pointer to the interface structure containing the called function pointer.
1094 * @thread Any thread.
1095 */
1096 DECLR3CALLBACKMEMBER(uint64_t, pfnGetSize,(PPDMIBLOCK pInterface));
1097
1098 /**
1099 * Gets the media sector size in bytes.
1100 *
1101 * @returns Media sector size in bytes.
1102 * @param pInterface Pointer to the interface structure containing the called function pointer.
1103 * @thread Any thread.
1104 */
1105 DECLR3CALLBACKMEMBER(uint32_t, pfnGetSectorSize,(PPDMIBLOCK pInterface));
1106
1107 /**
1108 * Gets the block drive type.
1109 *
1110 * @returns block drive type.
1111 * @param pInterface Pointer to the interface structure containing the called function pointer.
1112 * @thread Any thread.
1113 */
1114 DECLR3CALLBACKMEMBER(PDMBLOCKTYPE, pfnGetType,(PPDMIBLOCK pInterface));
1115
1116 /**
1117 * Gets the UUID of the block drive.
1118 * Don't return the media UUID if it's removable.
1119 *
1120 * @returns VBox status code.
1121 * @param pInterface Pointer to the interface structure containing the called function pointer.
1122 * @param pUuid Where to store the UUID on success.
1123 * @thread Any thread.
1124 */
1125 DECLR3CALLBACKMEMBER(int, pfnGetUuid,(PPDMIBLOCK pInterface, PRTUUID pUuid));
1126
1127 /**
1128 * Discards the given range.
1129 *
1130 * @returns VBox status code.
1131 * @param pInterface Pointer to the interface structure containing the called function pointer.
1132 * @param paRanges Array of ranges to discard.
1133 * @param cRanges Number of entries in the array.
1134 * @thread Any thread.
1135 */
1136 DECLR3CALLBACKMEMBER(int, pfnDiscard,(PPDMIBLOCK pInterface, PCRTRANGE paRanges, unsigned cRanges));
1137} PDMIBLOCK;
1138/** PDMIBLOCK interface ID. */
1139#define PDMIBLOCK_IID "5e7123dd-8cdf-4a6e-97a5-ab0c68d7e850"
1140
1141
1142/** Pointer to a mount interface. */
1143typedef struct PDMIMOUNTNOTIFY *PPDMIMOUNTNOTIFY;
1144/**
1145 * Block interface (up).
1146 * Pair with PDMIMOUNT.
1147 */
1148typedef struct PDMIMOUNTNOTIFY
1149{
1150 /**
1151 * Called when a media is mounted.
1152 *
1153 * @param pInterface Pointer to the interface structure containing the called function pointer.
1154 * @thread The emulation thread.
1155 */
1156 DECLR3CALLBACKMEMBER(void, pfnMountNotify,(PPDMIMOUNTNOTIFY pInterface));
1157
1158 /**
1159 * Called when a media is unmounted
1160 * @param pInterface Pointer to the interface structure containing the called function pointer.
1161 * @thread The emulation thread.
1162 */
1163 DECLR3CALLBACKMEMBER(void, pfnUnmountNotify,(PPDMIMOUNTNOTIFY pInterface));
1164} PDMIMOUNTNOTIFY;
1165/** PDMIMOUNTNOTIFY interface ID. */
1166#define PDMIMOUNTNOTIFY_IID "fa143ac9-9fc6-498e-997f-945380a558f9"
1167
1168
1169/** Pointer to mount interface. */
1170typedef struct PDMIMOUNT *PPDMIMOUNT;
1171/**
1172 * Mount interface (down).
1173 * Pair with PDMIMOUNTNOTIFY.
1174 */
1175typedef struct PDMIMOUNT
1176{
1177 /**
1178 * Mount a media.
1179 *
1180 * This will not unmount any currently mounted media!
1181 *
1182 * @returns VBox status code.
1183 * @param pInterface Pointer to the interface structure containing the called function pointer.
1184 * @param pszFilename Pointer to filename. If this is NULL it assumed that the caller have
1185 * constructed a configuration which can be attached to the bottom driver.
1186 * @param pszCoreDriver Core driver name. NULL will cause autodetection. Ignored if pszFilanem is NULL.
1187 * @thread The emulation thread.
1188 */
1189 DECLR3CALLBACKMEMBER(int, pfnMount,(PPDMIMOUNT pInterface, const char *pszFilename, const char *pszCoreDriver));
1190
1191 /**
1192 * Unmount the media.
1193 *
1194 * The driver will validate and pass it on. On the rebounce it will decide whether or not to detach it self.
1195 *
1196 * @returns VBox status code.
1197 * @param pInterface Pointer to the interface structure containing the called function pointer.
1198 * @thread The emulation thread.
1199 * @param fForce Force the unmount, even for locked media.
1200 * @param fEject Eject the medium. Only relevant for host drives.
1201 * @thread The emulation thread.
1202 */
1203 DECLR3CALLBACKMEMBER(int, pfnUnmount,(PPDMIMOUNT pInterface, bool fForce, bool fEject));
1204
1205 /**
1206 * Checks if a media is mounted.
1207 *
1208 * @returns true if mounted.
1209 * @returns false if not mounted.
1210 * @param pInterface Pointer to the interface structure containing the called function pointer.
1211 * @thread Any thread.
1212 */
1213 DECLR3CALLBACKMEMBER(bool, pfnIsMounted,(PPDMIMOUNT pInterface));
1214
1215 /**
1216 * Locks the media, preventing any unmounting of it.
1217 *
1218 * @returns VBox status code.
1219 * @param pInterface Pointer to the interface structure containing the called function pointer.
1220 * @thread The emulation thread.
1221 */
1222 DECLR3CALLBACKMEMBER(int, pfnLock,(PPDMIMOUNT pInterface));
1223
1224 /**
1225 * Unlocks the media, canceling previous calls to pfnLock().
1226 *
1227 * @returns VBox status code.
1228 * @param pInterface Pointer to the interface structure containing the called function pointer.
1229 * @thread The emulation thread.
1230 */
1231 DECLR3CALLBACKMEMBER(int, pfnUnlock,(PPDMIMOUNT pInterface));
1232
1233 /**
1234 * Checks if a media is locked.
1235 *
1236 * @returns true if locked.
1237 * @returns false if not locked.
1238 * @param pInterface Pointer to the interface structure containing the called function pointer.
1239 * @thread Any thread.
1240 */
1241 DECLR3CALLBACKMEMBER(bool, pfnIsLocked,(PPDMIMOUNT pInterface));
1242} PDMIMOUNT;
1243/** PDMIMOUNT interface ID. */
1244#define PDMIMOUNT_IID "34fc7a4c-623a-4806-a6bf-5be1be33c99f"
1245
1246/** Pointer to a secret key interface. */
1247typedef struct PDMISECKEY *PPDMISECKEY;
1248
1249/**
1250 * Secret key interface to retrieve secret keys.
1251 */
1252typedef struct PDMISECKEY
1253{
1254 /**
1255 * Retains a key identified by the ID. The caller will only hold a reference
1256 * to the key and must not modify the key buffer in any way.
1257 *
1258 * @returns VBox status code.
1259 * @param pInterface Pointer to this interface.
1260 * @param pszId The alias/id for the key to retrieve.
1261 * @param ppbKey Where to store the pointer to the key buffer on success.
1262 * @param pcbKey Where to store the size of the key in bytes on success.
1263 */
1264 DECLR3CALLBACKMEMBER(int, pfnKeyRetain, (PPDMISECKEY pInterface, const char *pszId,
1265 const uint8_t **pbKey, size_t *pcbKey));
1266
1267 /**
1268 * Releases one reference of the key identified by the given identifier.
1269 * The caller must not access the key buffer after calling this operation.
1270 *
1271 * @returns VBox status code.
1272 * @param pInterface Pointer to this interface.
1273 * @param pszId The alias/id for the key to release.
1274 *
1275 * @note: It is advised to release the key whenever it is not used anymore so the entity
1276 * storing the key can do anything to make retrieving the key from memory more
1277 * difficult like scrambling the memory buffer for instance.
1278 */
1279 DECLR3CALLBACKMEMBER(int, pfnKeyRelease, (PPDMISECKEY pInterface, const char *pszId));
1280} PDMISECKEY;
1281/** PDMISECKEY interface ID. */
1282#define PDMISECKEY_IID "a7336c4a-2ca0-489d-ad2d-f740f215a1e6"
1283
1284/**
1285 * Media geometry structure.
1286 */
1287typedef struct PDMMEDIAGEOMETRY
1288{
1289 /** Number of cylinders. */
1290 uint32_t cCylinders;
1291 /** Number of heads. */
1292 uint32_t cHeads;
1293 /** Number of sectors. */
1294 uint32_t cSectors;
1295} PDMMEDIAGEOMETRY;
1296
1297/** Pointer to media geometry structure. */
1298typedef PDMMEDIAGEOMETRY *PPDMMEDIAGEOMETRY;
1299/** Pointer to constant media geometry structure. */
1300typedef const PDMMEDIAGEOMETRY *PCPDMMEDIAGEOMETRY;
1301
1302/** Pointer to a media port interface. */
1303typedef struct PDMIMEDIAPORT *PPDMIMEDIAPORT;
1304/**
1305 * Media port interface (down).
1306 */
1307typedef struct PDMIMEDIAPORT
1308{
1309 /**
1310 * Returns the storage controller name, instance and LUN of the attached medium.
1311 *
1312 * @returns VBox status.
1313 * @param pInterface Pointer to this interface.
1314 * @param ppcszController Where to store the name of the storage controller.
1315 * @param piInstance Where to store the instance number of the controller.
1316 * @param piLUN Where to store the LUN of the attached device.
1317 */
1318 DECLR3CALLBACKMEMBER(int, pfnQueryDeviceLocation, (PPDMIMEDIAPORT pInterface, const char **ppcszController,
1319 uint32_t *piInstance, uint32_t *piLUN));
1320
1321} PDMIMEDIAPORT;
1322/** PDMIMEDIAPORT interface ID. */
1323#define PDMIMEDIAPORT_IID "9f7e8c9e-6d35-4453-bbef-1f78033174d6"
1324
1325/** Pointer to a media interface. */
1326typedef struct PDMIMEDIA *PPDMIMEDIA;
1327/**
1328 * Media interface (up).
1329 * Makes up the foundation for PDMIBLOCK and PDMIBLOCKBIOS.
1330 * Pairs with PDMIMEDIAPORT.
1331 */
1332typedef struct PDMIMEDIA
1333{
1334 /**
1335 * Read bits.
1336 *
1337 * @returns VBox status code.
1338 * @param pInterface Pointer to the interface structure containing the called function pointer.
1339 * @param off Offset to start reading from. The offset must be aligned to a sector boundary.
1340 * @param pvBuf Where to store the read bits.
1341 * @param cbRead Number of bytes to read. Must be aligned to a sector boundary.
1342 * @thread Any thread.
1343 */
1344 DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMIMEDIA pInterface, uint64_t off, void *pvBuf, size_t cbRead));
1345
1346 /**
1347 * Write bits.
1348 *
1349 * @returns VBox status code.
1350 * @param pInterface Pointer to the interface structure containing the called function pointer.
1351 * @param off Offset to start writing at. The offset must be aligned to a sector boundary.
1352 * @param pvBuf Where to store the write bits.
1353 * @param cbWrite Number of bytes to write. Must be aligned to a sector boundary.
1354 * @thread Any thread.
1355 */
1356 DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMIMEDIA pInterface, uint64_t off, const void *pvBuf, size_t cbWrite));
1357
1358 /**
1359 * Make sure that the bits written are actually on the storage medium.
1360 *
1361 * @returns VBox status code.
1362 * @param pInterface Pointer to the interface structure containing the called function pointer.
1363 * @thread Any thread.
1364 */
1365 DECLR3CALLBACKMEMBER(int, pfnFlush,(PPDMIMEDIA pInterface));
1366
1367 /**
1368 * Merge medium contents during a live snapshot deletion. All details
1369 * must have been configured through CFGM or this will fail.
1370 * This method is optional (i.e. the function pointer may be NULL).
1371 *
1372 * @returns VBox status code.
1373 * @param pInterface Pointer to the interface structure containing the called function pointer.
1374 * @param pfnProgress Function pointer for progress notification.
1375 * @param pvUser Opaque user data for progress notification.
1376 * @thread Any thread.
1377 */
1378 DECLR3CALLBACKMEMBER(int, pfnMerge,(PPDMIMEDIA pInterface, PFNSIMPLEPROGRESS pfnProgress, void *pvUser));
1379
1380 /**
1381 * Sets the secret key retrieval interface to use to get secret keys.
1382 *
1383 * @returns VBox status code.
1384 * @param pInterface Pointer to the interface structure containing the called function pointer.
1385 * @param pIfSecKey The secret key interface to use.
1386 * Use NULL to clear the currently set interface and clear all secret
1387 * keys from the user.
1388 * @thread Any thread.
1389 */
1390 DECLR3CALLBACKMEMBER(int, pfnSetSecKeyIf,(PPDMIMEDIA pInterface, PPDMISECKEY pIfSecKey));
1391
1392 /**
1393 * Get the media size in bytes.
1394 *
1395 * @returns Media size in bytes.
1396 * @param pInterface Pointer to the interface structure containing the called function pointer.
1397 * @thread Any thread.
1398 */
1399 DECLR3CALLBACKMEMBER(uint64_t, pfnGetSize,(PPDMIMEDIA pInterface));
1400
1401 /**
1402 * Gets the media sector size in bytes.
1403 *
1404 * @returns Media sector size in bytes.
1405 * @param pInterface Pointer to the interface structure containing the called function pointer.
1406 * @thread Any thread.
1407 */
1408 DECLR3CALLBACKMEMBER(uint32_t, pfnGetSectorSize,(PPDMIMEDIA pInterface));
1409
1410 /**
1411 * Check if the media is readonly or not.
1412 *
1413 * @returns true if readonly.
1414 * @returns false if read/write.
1415 * @param pInterface Pointer to the interface structure containing the called function pointer.
1416 * @thread Any thread.
1417 */
1418 DECLR3CALLBACKMEMBER(bool, pfnIsReadOnly,(PPDMIMEDIA pInterface));
1419
1420 /**
1421 * Get stored media geometry (physical CHS, PCHS) - BIOS property.
1422 * This is an optional feature of a media.
1423 *
1424 * @returns VBox status code.
1425 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
1426 * @returns VERR_PDM_GEOMETRY_NOT_SET if the geometry hasn't been set using pfnBiosSetPCHSGeometry() yet.
1427 * @param pInterface Pointer to the interface structure containing the called function pointer.
1428 * @param pPCHSGeometry Pointer to PCHS geometry (cylinders/heads/sectors).
1429 * @remark This has no influence on the read/write operations.
1430 * @thread Any thread.
1431 */
1432 DECLR3CALLBACKMEMBER(int, pfnBiosGetPCHSGeometry,(PPDMIMEDIA pInterface, PPDMMEDIAGEOMETRY pPCHSGeometry));
1433
1434 /**
1435 * Store the media geometry (physical CHS, PCHS) - BIOS property.
1436 * This is an optional feature of a media.
1437 *
1438 * @returns VBox status code.
1439 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
1440 * @param pInterface Pointer to the interface structure containing the called function pointer.
1441 * @param pPCHSGeometry Pointer to PCHS geometry (cylinders/heads/sectors).
1442 * @remark This has no influence on the read/write operations.
1443 * @thread The emulation thread.
1444 */
1445 DECLR3CALLBACKMEMBER(int, pfnBiosSetPCHSGeometry,(PPDMIMEDIA pInterface, PCPDMMEDIAGEOMETRY pPCHSGeometry));
1446
1447 /**
1448 * Get stored media geometry (logical CHS, LCHS) - BIOS property.
1449 * This is an optional feature of a media.
1450 *
1451 * @returns VBox status code.
1452 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
1453 * @returns VERR_PDM_GEOMETRY_NOT_SET if the geometry hasn't been set using pfnBiosSetLCHSGeometry() yet.
1454 * @param pInterface Pointer to the interface structure containing the called function pointer.
1455 * @param pLCHSGeometry Pointer to LCHS geometry (cylinders/heads/sectors).
1456 * @remark This has no influence on the read/write operations.
1457 * @thread Any thread.
1458 */
1459 DECLR3CALLBACKMEMBER(int, pfnBiosGetLCHSGeometry,(PPDMIMEDIA pInterface, PPDMMEDIAGEOMETRY pLCHSGeometry));
1460
1461 /**
1462 * Store the media geometry (logical CHS, LCHS) - BIOS property.
1463 * This is an optional feature of a media.
1464 *
1465 * @returns VBox status code.
1466 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
1467 * @param pInterface Pointer to the interface structure containing the called function pointer.
1468 * @param pLCHSGeometry Pointer to LCHS geometry (cylinders/heads/sectors).
1469 * @remark This has no influence on the read/write operations.
1470 * @thread The emulation thread.
1471 */
1472 DECLR3CALLBACKMEMBER(int, pfnBiosSetLCHSGeometry,(PPDMIMEDIA pInterface, PCPDMMEDIAGEOMETRY pLCHSGeometry));
1473
1474 /**
1475 * Gets the UUID of the media drive.
1476 *
1477 * @returns VBox status code.
1478 * @param pInterface Pointer to the interface structure containing the called function pointer.
1479 * @param pUuid Where to store the UUID on success.
1480 * @thread Any thread.
1481 */
1482 DECLR3CALLBACKMEMBER(int, pfnGetUuid,(PPDMIMEDIA pInterface, PRTUUID pUuid));
1483
1484 /**
1485 * Discards the given range.
1486 *
1487 * @returns VBox status code.
1488 * @param pInterface Pointer to the interface structure containing the called function pointer.
1489 * @param paRanges Array of ranges to discard.
1490 * @param cRanges Number of entries in the array.
1491 * @thread Any thread.
1492 */
1493 DECLR3CALLBACKMEMBER(int, pfnDiscard,(PPDMIMEDIA pInterface, PCRTRANGE paRanges, unsigned cRanges));
1494
1495} PDMIMEDIA;
1496/** PDMIMEDIA interface ID. */
1497#define PDMIMEDIA_IID "ec385d21-7aa9-42ca-8cfb-e1388297fa52"
1498
1499
1500/** Pointer to a block BIOS interface. */
1501typedef struct PDMIBLOCKBIOS *PPDMIBLOCKBIOS;
1502/**
1503 * Media BIOS interface (Up / External).
1504 * The interface the getting and setting properties which the BIOS/CMOS care about.
1505 */
1506typedef struct PDMIBLOCKBIOS
1507{
1508 /**
1509 * Get stored media geometry (physical CHS, PCHS) - BIOS property.
1510 * This is an optional feature of a media.
1511 *
1512 * @returns VBox status code.
1513 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
1514 * @returns VERR_PDM_GEOMETRY_NOT_SET if the geometry hasn't been set using pfnSetPCHSGeometry() yet.
1515 * @param pInterface Pointer to the interface structure containing the called function pointer.
1516 * @param pPCHSGeometry Pointer to PCHS geometry (cylinders/heads/sectors).
1517 * @remark This has no influence on the read/write operations.
1518 * @thread Any thread.
1519 */
1520 DECLR3CALLBACKMEMBER(int, pfnGetPCHSGeometry,(PPDMIBLOCKBIOS pInterface, PPDMMEDIAGEOMETRY pPCHSGeometry));
1521
1522 /**
1523 * Store the media geometry (physical CHS, PCHS) - BIOS property.
1524 * This is an optional feature of a media.
1525 *
1526 * @returns VBox status code.
1527 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
1528 * @param pInterface Pointer to the interface structure containing the called function pointer.
1529 * @param pPCHSGeometry Pointer to PCHS geometry (cylinders/heads/sectors).
1530 * @remark This has no influence on the read/write operations.
1531 * @thread The emulation thread.
1532 */
1533 DECLR3CALLBACKMEMBER(int, pfnSetPCHSGeometry,(PPDMIBLOCKBIOS pInterface, PCPDMMEDIAGEOMETRY pPCHSGeometry));
1534
1535 /**
1536 * Get stored media geometry (logical CHS, LCHS) - BIOS property.
1537 * This is an optional feature of a media.
1538 *
1539 * @returns VBox status code.
1540 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
1541 * @returns VERR_PDM_GEOMETRY_NOT_SET if the geometry hasn't been set using pfnSetLCHSGeometry() yet.
1542 * @param pInterface Pointer to the interface structure containing the called function pointer.
1543 * @param pLCHSGeometry Pointer to LCHS geometry (cylinders/heads/sectors).
1544 * @remark This has no influence on the read/write operations.
1545 * @thread Any thread.
1546 */
1547 DECLR3CALLBACKMEMBER(int, pfnGetLCHSGeometry,(PPDMIBLOCKBIOS pInterface, PPDMMEDIAGEOMETRY pLCHSGeometry));
1548
1549 /**
1550 * Store the media geometry (logical CHS, LCHS) - BIOS property.
1551 * This is an optional feature of a media.
1552 *
1553 * @returns VBox status code.
1554 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
1555 * @param pInterface Pointer to the interface structure containing the called function pointer.
1556 * @param pLCHSGeometry Pointer to LCHS geometry (cylinders/heads/sectors).
1557 * @remark This has no influence on the read/write operations.
1558 * @thread The emulation thread.
1559 */
1560 DECLR3CALLBACKMEMBER(int, pfnSetLCHSGeometry,(PPDMIBLOCKBIOS pInterface, PCPDMMEDIAGEOMETRY pLCHSGeometry));
1561
1562 /**
1563 * Checks if the device should be visible to the BIOS or not.
1564 *
1565 * @returns true if the device is visible to the BIOS.
1566 * @returns false if the device is not visible to the BIOS.
1567 * @param pInterface Pointer to the interface structure containing the called function pointer.
1568 * @thread Any thread.
1569 */
1570 DECLR3CALLBACKMEMBER(bool, pfnIsVisible,(PPDMIBLOCKBIOS pInterface));
1571
1572 /**
1573 * Gets the block drive type.
1574 *
1575 * @returns block drive type.
1576 * @param pInterface Pointer to the interface structure containing the called function pointer.
1577 * @thread Any thread.
1578 */
1579 DECLR3CALLBACKMEMBER(PDMBLOCKTYPE, pfnGetType,(PPDMIBLOCKBIOS pInterface));
1580
1581} PDMIBLOCKBIOS;
1582/** PDMIBLOCKBIOS interface ID. */
1583#define PDMIBLOCKBIOS_IID "477c3eee-a48d-48a9-82fd-2a54de16b2e9"
1584
1585
1586/** Pointer to a static block core driver interface. */
1587typedef struct PDMIMEDIASTATIC *PPDMIMEDIASTATIC;
1588/**
1589 * Static block core driver interface.
1590 */
1591typedef struct PDMIMEDIASTATIC
1592{
1593 /**
1594 * Check if the specified file is a format which the core driver can handle.
1595 *
1596 * @returns true / false accordingly.
1597 * @param pInterface Pointer to the interface structure containing the called function pointer.
1598 * @param pszFilename Name of the file to probe.
1599 */
1600 DECLR3CALLBACKMEMBER(bool, pfnCanHandle,(PPDMIMEDIASTATIC pInterface, const char *pszFilename));
1601} PDMIMEDIASTATIC;
1602
1603
1604
1605
1606
1607/** Pointer to an asynchronous block notify interface. */
1608typedef struct PDMIBLOCKASYNCPORT *PPDMIBLOCKASYNCPORT;
1609/**
1610 * Asynchronous block notify interface (up).
1611 * Pair with PDMIBLOCKASYNC.
1612 */
1613typedef struct PDMIBLOCKASYNCPORT
1614{
1615 /**
1616 * Notify completion of an asynchronous transfer.
1617 *
1618 * @returns VBox status code.
1619 * @param pInterface Pointer to the interface structure containing the called function pointer.
1620 * @param pvUser The user argument given in pfnStartWrite/Read.
1621 * @param rcReq IPRT Status code of the completed request.
1622 * @thread Any thread.
1623 */
1624 DECLR3CALLBACKMEMBER(int, pfnTransferCompleteNotify, (PPDMIBLOCKASYNCPORT pInterface, void *pvUser, int rcReq));
1625} PDMIBLOCKASYNCPORT;
1626/** PDMIBLOCKASYNCPORT interface ID. */
1627#define PDMIBLOCKASYNCPORT_IID "e3bdc0cb-9d99-41dd-8eec-0dc8cf5b2a92"
1628
1629
1630
1631/** Pointer to an asynchronous block interface. */
1632typedef struct PDMIBLOCKASYNC *PPDMIBLOCKASYNC;
1633/**
1634 * Asynchronous block interface (down).
1635 * Pair with PDMIBLOCKASYNCPORT.
1636 */
1637typedef struct PDMIBLOCKASYNC
1638{
1639 /**
1640 * Start reading task.
1641 *
1642 * @returns VBox status code.
1643 * @param pInterface Pointer to the interface structure containing the called function pointer.
1644 * @param off Offset to start reading from.c
1645 * @param paSegs Pointer to the S/G segment array.
1646 * @param cSegs Number of entries in the array.
1647 * @param cbRead Number of bytes to read. Must be aligned to a sector boundary.
1648 * @param pvUser User argument which is returned in completion callback.
1649 * @thread Any thread.
1650 */
1651 DECLR3CALLBACKMEMBER(int, pfnStartRead,(PPDMIBLOCKASYNC pInterface, uint64_t off, PCRTSGSEG paSegs, unsigned cSegs, size_t cbRead, void *pvUser));
1652
1653 /**
1654 * Write bits.
1655 *
1656 * @returns VBox status code.
1657 * @param pInterface Pointer to the interface structure containing the called function pointer.
1658 * @param off Offset to start writing at. The offset must be aligned to a sector boundary.
1659 * @param paSegs Pointer to the S/G segment array.
1660 * @param cSegs Number of entries in the array.
1661 * @param cbWrite Number of bytes to write. Must be aligned to a sector boundary.
1662 * @param pvUser User argument which is returned in completion callback.
1663 * @thread Any thread.
1664 */
1665 DECLR3CALLBACKMEMBER(int, pfnStartWrite,(PPDMIBLOCKASYNC pInterface, uint64_t off, PCRTSGSEG paSegs, unsigned cSegs, size_t cbWrite, void *pvUser));
1666
1667 /**
1668 * Flush everything to disk.
1669 *
1670 * @returns VBox status code.
1671 * @param pInterface Pointer to the interface structure containing the called function pointer.
1672 * @param pvUser User argument which is returned in completion callback.
1673 * @thread Any thread.
1674 */
1675 DECLR3CALLBACKMEMBER(int, pfnStartFlush,(PPDMIBLOCKASYNC pInterface, void *pvUser));
1676
1677 /**
1678 * Discards the given range.
1679 *
1680 * @returns VBox status code.
1681 * @param pInterface Pointer to the interface structure containing the called function pointer.
1682 * @param paRanges Array of ranges to discard.
1683 * @param cRanges Number of entries in the array.
1684 * @param pvUser User argument which is returned in completion callback.
1685 * @thread Any thread.
1686 */
1687 DECLR3CALLBACKMEMBER(int, pfnStartDiscard,(PPDMIBLOCKASYNC pInterface, PCRTRANGE paRanges, unsigned cRanges, void *pvUser));
1688
1689} PDMIBLOCKASYNC;
1690/** PDMIBLOCKASYNC interface ID. */
1691#define PDMIBLOCKASYNC_IID "a921dd96-1748-4ecd-941e-d5f3cd4c8fe4"
1692
1693
1694/** Pointer to an asynchronous notification interface. */
1695typedef struct PDMIMEDIAASYNCPORT *PPDMIMEDIAASYNCPORT;
1696/**
1697 * Asynchronous version of the media interface (up).
1698 * Pair with PDMIMEDIAASYNC.
1699 */
1700typedef struct PDMIMEDIAASYNCPORT
1701{
1702 /**
1703 * Notify completion of a task.
1704 *
1705 * @returns VBox status code.
1706 * @param pInterface Pointer to the interface structure containing the called function pointer.
1707 * @param pvUser The user argument given in pfnStartWrite.
1708 * @param rcReq IPRT Status code of the completed request.
1709 * @thread Any thread.
1710 */
1711 DECLR3CALLBACKMEMBER(int, pfnTransferCompleteNotify, (PPDMIMEDIAASYNCPORT pInterface, void *pvUser, int rcReq));
1712} PDMIMEDIAASYNCPORT;
1713/** PDMIMEDIAASYNCPORT interface ID. */
1714#define PDMIMEDIAASYNCPORT_IID "22d38853-901f-4a71-9670-4d9da6e82317"
1715
1716
1717/** Pointer to an asynchronous media interface. */
1718typedef struct PDMIMEDIAASYNC *PPDMIMEDIAASYNC;
1719/**
1720 * Asynchronous version of PDMIMEDIA (down).
1721 * Pair with PDMIMEDIAASYNCPORT.
1722 */
1723typedef struct PDMIMEDIAASYNC
1724{
1725 /**
1726 * Start reading task.
1727 *
1728 * @returns VBox status code.
1729 * @param pInterface Pointer to the interface structure containing the called function pointer.
1730 * @param off Offset to start reading from. Must be aligned to a sector boundary.
1731 * @param paSegs Pointer to the S/G segment array.
1732 * @param cSegs Number of entries in the array.
1733 * @param cbRead Number of bytes to read. Must be aligned to a sector boundary.
1734 * @param pvUser User data.
1735 * @thread Any thread.
1736 */
1737 DECLR3CALLBACKMEMBER(int, pfnStartRead,(PPDMIMEDIAASYNC pInterface, uint64_t off, PCRTSGSEG paSegs, unsigned cSegs, size_t cbRead, void *pvUser));
1738
1739 /**
1740 * Start writing task.
1741 *
1742 * @returns VBox status code.
1743 * @param pInterface Pointer to the interface structure containing the called function pointer.
1744 * @param off Offset to start writing at. Must be aligned to a sector boundary.
1745 * @param paSegs Pointer to the S/G segment array.
1746 * @param cSegs Number of entries in the array.
1747 * @param cbWrite Number of bytes to write. Must be aligned to a sector boundary.
1748 * @param pvUser User data.
1749 * @thread Any thread.
1750 */
1751 DECLR3CALLBACKMEMBER(int, pfnStartWrite,(PPDMIMEDIAASYNC pInterface, uint64_t off, PCRTSGSEG paSegs, unsigned cSegs, size_t cbWrite, void *pvUser));
1752
1753 /**
1754 * Flush everything to disk.
1755 *
1756 * @returns VBox status code.
1757 * @param pInterface Pointer to the interface structure containing the called function pointer.
1758 * @param pvUser User argument which is returned in completion callback.
1759 * @thread Any thread.
1760 */
1761 DECLR3CALLBACKMEMBER(int, pfnStartFlush,(PPDMIMEDIAASYNC pInterface, void *pvUser));
1762
1763 /**
1764 * Discards the given range.
1765 *
1766 * @returns VBox status code.
1767 * @param pInterface Pointer to the interface structure containing the called function pointer.
1768 * @param paRanges Array of ranges to discard.
1769 * @param cRanges Number of entries in the array.
1770 * @param pvUser User argument which is returned in completion callback.
1771 * @thread Any thread.
1772 */
1773 DECLR3CALLBACKMEMBER(int, pfnStartDiscard,(PPDMIMEDIAASYNC pInterface, PCRTRANGE paRanges, unsigned cRanges, void *pvUser));
1774
1775} PDMIMEDIAASYNC;
1776/** PDMIMEDIAASYNC interface ID. */
1777#define PDMIMEDIAASYNC_IID "4be209d3-ccb5-4297-82fe-7d8018bc6ab4"
1778
1779
1780/** Pointer to a char port interface. */
1781typedef struct PDMICHARPORT *PPDMICHARPORT;
1782/**
1783 * Char port interface (down).
1784 * Pair with PDMICHARCONNECTOR.
1785 */
1786typedef struct PDMICHARPORT
1787{
1788 /**
1789 * Deliver data read to the device/driver.
1790 *
1791 * @returns VBox status code.
1792 * @param pInterface Pointer to the interface structure containing the called function pointer.
1793 * @param pvBuf Where the read bits are stored.
1794 * @param pcbRead Number of bytes available for reading/having been read.
1795 * @thread Any thread.
1796 */
1797 DECLR3CALLBACKMEMBER(int, pfnNotifyRead,(PPDMICHARPORT pInterface, const void *pvBuf, size_t *pcbRead));
1798
1799 /**
1800 * Notify the device/driver when the status lines changed.
1801 *
1802 * @returns VBox status code.
1803 * @param pInterface Pointer to the interface structure containing the called function pointer.
1804 * @param fNewStatusLine New state of the status line pins.
1805 * @thread Any thread.
1806 */
1807 DECLR3CALLBACKMEMBER(int, pfnNotifyStatusLinesChanged,(PPDMICHARPORT pInterface, uint32_t fNewStatusLines));
1808
1809 /**
1810 * Notify the device when the driver buffer is full.
1811 *
1812 * @returns VBox status code.
1813 * @param pInterface Pointer to the interface structure containing the called function pointer.
1814 * @param fFull Buffer full.
1815 * @thread Any thread.
1816 */
1817 DECLR3CALLBACKMEMBER(int, pfnNotifyBufferFull,(PPDMICHARPORT pInterface, bool fFull));
1818
1819 /**
1820 * Notify the device/driver that a break occurred.
1821 *
1822 * @returns VBox statsus code.
1823 * @param pInterface Pointer to the interface structure containing the called function pointer.
1824 * @thread Any thread.
1825 */
1826 DECLR3CALLBACKMEMBER(int, pfnNotifyBreak,(PPDMICHARPORT pInterface));
1827} PDMICHARPORT;
1828/** PDMICHARPORT interface ID. */
1829#define PDMICHARPORT_IID "22769834-ea8b-4a6d-ade1-213dcdbd1228"
1830
1831/** @name Bit mask definitions for status line type.
1832 * @{ */
1833#define PDMICHARPORT_STATUS_LINES_DCD RT_BIT(0)
1834#define PDMICHARPORT_STATUS_LINES_RI RT_BIT(1)
1835#define PDMICHARPORT_STATUS_LINES_DSR RT_BIT(2)
1836#define PDMICHARPORT_STATUS_LINES_CTS RT_BIT(3)
1837/** @} */
1838
1839
1840/** Pointer to a char interface. */
1841typedef struct PDMICHARCONNECTOR *PPDMICHARCONNECTOR;
1842/**
1843 * Char connector interface (up).
1844 * Pair with PDMICHARPORT.
1845 */
1846typedef struct PDMICHARCONNECTOR
1847{
1848 /**
1849 * Write bits.
1850 *
1851 * @returns VBox status code.
1852 * @param pInterface Pointer to the interface structure containing the called function pointer.
1853 * @param pvBuf Where to store the write bits.
1854 * @param cbWrite Number of bytes to write.
1855 * @thread Any thread.
1856 */
1857 DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMICHARCONNECTOR pInterface, const void *pvBuf, size_t cbWrite));
1858
1859 /**
1860 * Set device parameters.
1861 *
1862 * @returns VBox status code.
1863 * @param pInterface Pointer to the interface structure containing the called function pointer.
1864 * @param Bps Speed of the serial connection. (bits per second)
1865 * @param chParity Parity method: 'E' - even, 'O' - odd, 'N' - none.
1866 * @param cDataBits Number of data bits.
1867 * @param cStopBits Number of stop bits.
1868 * @thread Any thread.
1869 */
1870 DECLR3CALLBACKMEMBER(int, pfnSetParameters,(PPDMICHARCONNECTOR pInterface, unsigned Bps, char chParity, unsigned cDataBits, unsigned cStopBits));
1871
1872 /**
1873 * Set the state of the modem lines.
1874 *
1875 * @returns VBox status code.
1876 * @param pInterface Pointer to the interface structure containing the called function pointer.
1877 * @param fRequestToSend Set to true to make the Request to Send line active otherwise to 0.
1878 * @param fDataTerminalReady Set to true to make the Data Terminal Ready line active otherwise 0.
1879 * @thread Any thread.
1880 */
1881 DECLR3CALLBACKMEMBER(int, pfnSetModemLines,(PPDMICHARCONNECTOR pInterface, bool fRequestToSend, bool fDataTerminalReady));
1882
1883 /**
1884 * Sets the TD line into break condition.
1885 *
1886 * @returns VBox status code.
1887 * @param pInterface Pointer to the interface structure containing the called function pointer.
1888 * @param fBreak Set to true to let the device send a break false to put into normal operation.
1889 * @thread Any thread.
1890 */
1891 DECLR3CALLBACKMEMBER(int, pfnSetBreak,(PPDMICHARCONNECTOR pInterface, bool fBreak));
1892} PDMICHARCONNECTOR;
1893/** PDMICHARCONNECTOR interface ID. */
1894#define PDMICHARCONNECTOR_IID "4ad5c190-b408-4cef-926f-fbffce0dc5cc"
1895
1896
1897/** Pointer to a stream interface. */
1898typedef struct PDMISTREAM *PPDMISTREAM;
1899/**
1900 * Stream interface (up).
1901 * Makes up the foundation for PDMICHARCONNECTOR. No pair interface.
1902 */
1903typedef struct PDMISTREAM
1904{
1905 /**
1906 * Read bits.
1907 *
1908 * @returns VBox status code.
1909 * @param pInterface Pointer to the interface structure containing the called function pointer.
1910 * @param pvBuf Where to store the read bits.
1911 * @param cbRead Number of bytes to read/bytes actually read.
1912 * @thread Any thread.
1913 */
1914 DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMISTREAM pInterface, void *pvBuf, size_t *cbRead));
1915
1916 /**
1917 * Write bits.
1918 *
1919 * @returns VBox status code.
1920 * @param pInterface Pointer to the interface structure containing the called function pointer.
1921 * @param pvBuf Where to store the write bits.
1922 * @param cbWrite Number of bytes to write/bytes actually written.
1923 * @thread Any thread.
1924 */
1925 DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMISTREAM pInterface, const void *pvBuf, size_t *cbWrite));
1926} PDMISTREAM;
1927/** PDMISTREAM interface ID. */
1928#define PDMISTREAM_IID "d1a5bf5e-3d2c-449a-bde9-addd7920b71f"
1929
1930
1931/** Mode of the parallel port */
1932typedef enum PDMPARALLELPORTMODE
1933{
1934 /** First invalid mode. */
1935 PDM_PARALLEL_PORT_MODE_INVALID = 0,
1936 /** SPP (Compatibility mode). */
1937 PDM_PARALLEL_PORT_MODE_SPP,
1938 /** EPP Data mode. */
1939 PDM_PARALLEL_PORT_MODE_EPP_DATA,
1940 /** EPP Address mode. */
1941 PDM_PARALLEL_PORT_MODE_EPP_ADDR,
1942 /** ECP mode (not implemented yet). */
1943 PDM_PARALLEL_PORT_MODE_ECP,
1944 /** 32bit hack. */
1945 PDM_PARALLEL_PORT_MODE_32BIT_HACK = 0x7fffffff
1946} PDMPARALLELPORTMODE;
1947
1948/** Pointer to a host parallel port interface. */
1949typedef struct PDMIHOSTPARALLELPORT *PPDMIHOSTPARALLELPORT;
1950/**
1951 * Host parallel port interface (down).
1952 * Pair with PDMIHOSTPARALLELCONNECTOR.
1953 */
1954typedef struct PDMIHOSTPARALLELPORT
1955{
1956 /**
1957 * Notify device/driver that an interrupt has occurred.
1958 *
1959 * @returns VBox status code.
1960 * @param pInterface Pointer to the interface structure containing the called function pointer.
1961 * @thread Any thread.
1962 */
1963 DECLR3CALLBACKMEMBER(int, pfnNotifyInterrupt,(PPDMIHOSTPARALLELPORT pInterface));
1964} PDMIHOSTPARALLELPORT;
1965/** PDMIHOSTPARALLELPORT interface ID. */
1966#define PDMIHOSTPARALLELPORT_IID "f24b8668-e7f6-4eaa-a14c-4aa2a5f7048e"
1967
1968
1969
1970/** Pointer to a Host Parallel connector interface. */
1971typedef struct PDMIHOSTPARALLELCONNECTOR *PPDMIHOSTPARALLELCONNECTOR;
1972/**
1973 * Host parallel connector interface (up).
1974 * Pair with PDMIHOSTPARALLELPORT.
1975 */
1976typedef struct PDMIHOSTPARALLELCONNECTOR
1977{
1978 /**
1979 * Write bits.
1980 *
1981 * @returns VBox status code.
1982 * @param pInterface Pointer to the interface structure containing the called function pointer.
1983 * @param pvBuf Where to store the write bits.
1984 * @param cbWrite Number of bytes to write.
1985 * @param enmMode Mode to write the data.
1986 * @thread Any thread.
1987 * @todo r=klaus cbWrite only defines buffer length, method needs a way top return actually written amount of data.
1988 */
1989 DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMIHOSTPARALLELCONNECTOR pInterface, const void *pvBuf,
1990 size_t cbWrite, PDMPARALLELPORTMODE enmMode));
1991
1992 /**
1993 * Read bits.
1994 *
1995 * @returns VBox status code.
1996 * @param pInterface Pointer to the interface structure containing the called function pointer.
1997 * @param pvBuf Where to store the read bits.
1998 * @param cbRead Number of bytes to read.
1999 * @param enmMode Mode to read the data.
2000 * @thread Any thread.
2001 * @todo r=klaus cbRead only defines buffer length, method needs a way top return actually read amount of data.
2002 */
2003 DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMIHOSTPARALLELCONNECTOR pInterface, void *pvBuf,
2004 size_t cbRead, PDMPARALLELPORTMODE enmMode));
2005
2006 /**
2007 * Set data direction of the port (forward/reverse).
2008 *
2009 * @returns VBox status code.
2010 * @param pInterface Pointer to the interface structure containing the called function pointer.
2011 * @param fForward Flag whether to indicate whether the port is operated in forward or reverse mode.
2012 * @thread Any thread.
2013 */
2014 DECLR3CALLBACKMEMBER(int, pfnSetPortDirection,(PPDMIHOSTPARALLELCONNECTOR pInterface, bool fForward));
2015
2016 /**
2017 * Write control register bits.
2018 *
2019 * @returns VBox status code.
2020 * @param pInterface Pointer to the interface structure containing the called function pointer.
2021 * @param fReg The new control register value.
2022 * @thread Any thread.
2023 */
2024 DECLR3CALLBACKMEMBER(int, pfnWriteControl,(PPDMIHOSTPARALLELCONNECTOR pInterface, uint8_t fReg));
2025
2026 /**
2027 * Read control register bits.
2028 *
2029 * @returns VBox status code.
2030 * @param pInterface Pointer to the interface structure containing the called function pointer.
2031 * @param pfReg Where to store the control register bits.
2032 * @thread Any thread.
2033 */
2034 DECLR3CALLBACKMEMBER(int, pfnReadControl,(PPDMIHOSTPARALLELCONNECTOR pInterface, uint8_t *pfReg));
2035
2036 /**
2037 * Read status register bits.
2038 *
2039 * @returns VBox status code.
2040 * @param pInterface Pointer to the interface structure containing the called function pointer.
2041 * @param pfReg Where to store the status register bits.
2042 * @thread Any thread.
2043 */
2044 DECLR3CALLBACKMEMBER(int, pfnReadStatus,(PPDMIHOSTPARALLELCONNECTOR pInterface, uint8_t *pfReg));
2045
2046} PDMIHOSTPARALLELCONNECTOR;
2047/** PDMIHOSTPARALLELCONNECTOR interface ID. */
2048#define PDMIHOSTPARALLELCONNECTOR_IID "7c532602-7438-4fbc-9265-349d9f0415f9"
2049
2050
2051/** ACPI power source identifier */
2052typedef enum PDMACPIPOWERSOURCE
2053{
2054 PDM_ACPI_POWER_SOURCE_UNKNOWN = 0,
2055 PDM_ACPI_POWER_SOURCE_OUTLET,
2056 PDM_ACPI_POWER_SOURCE_BATTERY
2057} PDMACPIPOWERSOURCE;
2058/** Pointer to ACPI battery state. */
2059typedef PDMACPIPOWERSOURCE *PPDMACPIPOWERSOURCE;
2060
2061/** ACPI battey capacity */
2062typedef enum PDMACPIBATCAPACITY
2063{
2064 PDM_ACPI_BAT_CAPACITY_MIN = 0,
2065 PDM_ACPI_BAT_CAPACITY_MAX = 100,
2066 PDM_ACPI_BAT_CAPACITY_UNKNOWN = 255
2067} PDMACPIBATCAPACITY;
2068/** Pointer to ACPI battery capacity. */
2069typedef PDMACPIBATCAPACITY *PPDMACPIBATCAPACITY;
2070
2071/** ACPI battery state. See ACPI 3.0 spec '_BST (Battery Status)' */
2072typedef enum PDMACPIBATSTATE
2073{
2074 PDM_ACPI_BAT_STATE_CHARGED = 0x00,
2075 PDM_ACPI_BAT_STATE_DISCHARGING = 0x01,
2076 PDM_ACPI_BAT_STATE_CHARGING = 0x02,
2077 PDM_ACPI_BAT_STATE_CRITICAL = 0x04
2078} PDMACPIBATSTATE;
2079/** Pointer to ACPI battery state. */
2080typedef PDMACPIBATSTATE *PPDMACPIBATSTATE;
2081
2082/** Pointer to an ACPI port interface. */
2083typedef struct PDMIACPIPORT *PPDMIACPIPORT;
2084/**
2085 * ACPI port interface (down). Used by both the ACPI driver and (grumble) main.
2086 * Pair with PDMIACPICONNECTOR.
2087 */
2088typedef struct PDMIACPIPORT
2089{
2090 /**
2091 * Send an ACPI power off event.
2092 *
2093 * @returns VBox status code
2094 * @param pInterface Pointer to the interface structure containing the called function pointer.
2095 */
2096 DECLR3CALLBACKMEMBER(int, pfnPowerButtonPress,(PPDMIACPIPORT pInterface));
2097
2098 /**
2099 * Send an ACPI sleep button event.
2100 *
2101 * @returns VBox status code
2102 * @param pInterface Pointer to the interface structure containing the called function pointer.
2103 */
2104 DECLR3CALLBACKMEMBER(int, pfnSleepButtonPress,(PPDMIACPIPORT pInterface));
2105
2106 /**
2107 * Check if the last power button event was handled by the guest.
2108 *
2109 * @returns VBox status code
2110 * @param pInterface Pointer to the interface structure containing the called function pointer.
2111 * @param pfHandled Is set to true if the last power button event was handled, false otherwise.
2112 */
2113 DECLR3CALLBACKMEMBER(int, pfnGetPowerButtonHandled,(PPDMIACPIPORT pInterface, bool *pfHandled));
2114
2115 /**
2116 * Check if the guest entered the ACPI mode.
2117 *
2118 * @returns VBox status code
2119 * @param pInterface Pointer to the interface structure containing the called function pointer.
2120 * @param pfEnabled Is set to true if the guest entered the ACPI mode, false otherwise.
2121 */
2122 DECLR3CALLBACKMEMBER(int, pfnGetGuestEnteredACPIMode,(PPDMIACPIPORT pInterface, bool *pfEntered));
2123
2124 /**
2125 * Check if the given CPU is still locked by the guest.
2126 *
2127 * @returns VBox status code
2128 * @param pInterface Pointer to the interface structure containing the called function pointer.
2129 * @param uCpu The CPU to check for.
2130 * @param pfLocked Is set to true if the CPU is still locked by the guest, false otherwise.
2131 */
2132 DECLR3CALLBACKMEMBER(int, pfnGetCpuStatus,(PPDMIACPIPORT pInterface, unsigned uCpu, bool *pfLocked));
2133} PDMIACPIPORT;
2134/** PDMIACPIPORT interface ID. */
2135#define PDMIACPIPORT_IID "30d3dc4c-6a73-40c8-80e9-34309deacbb3"
2136
2137
2138/** Pointer to an ACPI connector interface. */
2139typedef struct PDMIACPICONNECTOR *PPDMIACPICONNECTOR;
2140/**
2141 * ACPI connector interface (up).
2142 * Pair with PDMIACPIPORT.
2143 */
2144typedef struct PDMIACPICONNECTOR
2145{
2146 /**
2147 * Get the current power source of the host system.
2148 *
2149 * @returns VBox status code
2150 * @param pInterface Pointer to the interface structure containing the called function pointer.
2151 * @param penmPowerSource Pointer to the power source result variable.
2152 */
2153 DECLR3CALLBACKMEMBER(int, pfnQueryPowerSource,(PPDMIACPICONNECTOR, PPDMACPIPOWERSOURCE penmPowerSource));
2154
2155 /**
2156 * Query the current battery status of the host system.
2157 *
2158 * @returns VBox status code?
2159 * @param pInterface Pointer to the interface structure containing the called function pointer.
2160 * @param pfPresent Is set to true if battery is present, false otherwise.
2161 * @param penmRemainingCapacity Pointer to the battery remaining capacity (0 - 100 or 255 for unknown).
2162 * @param penmBatteryState Pointer to the battery status.
2163 * @param pu32PresentRate Pointer to the present rate (0..1000 of the total capacity).
2164 */
2165 DECLR3CALLBACKMEMBER(int, pfnQueryBatteryStatus,(PPDMIACPICONNECTOR, bool *pfPresent, PPDMACPIBATCAPACITY penmRemainingCapacity,
2166 PPDMACPIBATSTATE penmBatteryState, uint32_t *pu32PresentRate));
2167} PDMIACPICONNECTOR;
2168/** PDMIACPICONNECTOR interface ID. */
2169#define PDMIACPICONNECTOR_IID "5f14bf8d-1edf-4e3a-a1e1-cca9fd08e359"
2170
2171
2172/** Pointer to a VMMDevice port interface. */
2173typedef struct PDMIVMMDEVPORT *PPDMIVMMDEVPORT;
2174/**
2175 * VMMDevice port interface (down).
2176 * Pair with PDMIVMMDEVCONNECTOR.
2177 */
2178typedef struct PDMIVMMDEVPORT
2179{
2180 /**
2181 * Return the current absolute mouse position in pixels
2182 *
2183 * @returns VBox status code
2184 * @param pInterface Pointer to the interface structure containing the called function pointer.
2185 * @param pxAbs Pointer of result value, can be NULL
2186 * @param pyAbs Pointer of result value, can be NULL
2187 */
2188 DECLR3CALLBACKMEMBER(int, pfnQueryAbsoluteMouse,(PPDMIVMMDEVPORT pInterface, int32_t *pxAbs, int32_t *pyAbs));
2189
2190 /**
2191 * Set the new absolute mouse position in pixels
2192 *
2193 * @returns VBox status code
2194 * @param pInterface Pointer to the interface structure containing the called function pointer.
2195 * @param xabs New absolute X position
2196 * @param yAbs New absolute Y position
2197 */
2198 DECLR3CALLBACKMEMBER(int, pfnSetAbsoluteMouse,(PPDMIVMMDEVPORT pInterface, int32_t xAbs, int32_t yAbs));
2199
2200 /**
2201 * Return the current mouse capability flags
2202 *
2203 * @returns VBox status code
2204 * @param pInterface Pointer to the interface structure containing the called function pointer.
2205 * @param pfCapabilities Pointer of result value
2206 */
2207 DECLR3CALLBACKMEMBER(int, pfnQueryMouseCapabilities,(PPDMIVMMDEVPORT pInterface, uint32_t *pfCapabilities));
2208
2209 /**
2210 * Set the current mouse capability flag (host side)
2211 *
2212 * @returns VBox status code
2213 * @param pInterface Pointer to the interface structure containing the called function pointer.
2214 * @param fCapsAdded Mask of capabilities to add to the flag
2215 * @param fCapsRemoved Mask of capabilities to remove from the flag
2216 */
2217 DECLR3CALLBACKMEMBER(int, pfnUpdateMouseCapabilities,(PPDMIVMMDEVPORT pInterface, uint32_t fCapsAdded, uint32_t fCapsRemoved));
2218
2219 /**
2220 * Issue a display resolution change request.
2221 *
2222 * Note that there can only one request in the queue and that in case the guest does
2223 * not process it, issuing another request will overwrite the previous.
2224 *
2225 * @returns VBox status code
2226 * @param pInterface Pointer to the interface structure containing the called function pointer.
2227 * @param cx Horizontal pixel resolution (0 = do not change).
2228 * @param cy Vertical pixel resolution (0 = do not change).
2229 * @param cBits Bits per pixel (0 = do not change).
2230 * @param idxDisplay The display index.
2231 * @param xOrigin The X coordinate of the lower left
2232 * corner of the secondary display with
2233 * ID = idxDisplay
2234 * @param yOrigin The Y coordinate of the lower left
2235 * corner of the secondary display with
2236 * ID = idxDisplay
2237 * @param fEnabled Whether the display is enabled or not. (Guessing
2238 * again.)
2239 * @param fChangeOrigin Whether the display origin point changed. (Guess)
2240 */
2241 DECLR3CALLBACKMEMBER(int, pfnRequestDisplayChange,(PPDMIVMMDEVPORT pInterface, uint32_t cx,
2242 uint32_t cy, uint32_t cBits, uint32_t idxDisplay,
2243 int32_t xOrigin, int32_t yOrigin, bool fEnabled, bool fChangeOrigin));
2244
2245 /**
2246 * Pass credentials to guest.
2247 *
2248 * Note that there can only be one set of credentials and the guest may or may not
2249 * query them and may do whatever it wants with them.
2250 *
2251 * @returns VBox status code.
2252 * @param pInterface Pointer to the interface structure containing the called function pointer.
2253 * @param pszUsername User name, may be empty (UTF-8).
2254 * @param pszPassword Password, may be empty (UTF-8).
2255 * @param pszDomain Domain name, may be empty (UTF-8).
2256 * @param fFlags VMMDEV_SETCREDENTIALS_*.
2257 */
2258 DECLR3CALLBACKMEMBER(int, pfnSetCredentials,(PPDMIVMMDEVPORT pInterface, const char *pszUsername,
2259 const char *pszPassword, const char *pszDomain,
2260 uint32_t fFlags));
2261
2262 /**
2263 * Notify the driver about a VBVA status change.
2264 *
2265 * @returns Nothing. Because it is informational callback.
2266 * @param pInterface Pointer to the interface structure containing the called function pointer.
2267 * @param fEnabled Current VBVA status.
2268 */
2269 DECLR3CALLBACKMEMBER(void, pfnVBVAChange, (PPDMIVMMDEVPORT pInterface, bool fEnabled));
2270
2271 /**
2272 * Issue a seamless mode change request.
2273 *
2274 * Note that there can only one request in the queue and that in case the guest does
2275 * not process it, issuing another request will overwrite the previous.
2276 *
2277 * @returns VBox status code
2278 * @param pInterface Pointer to the interface structure containing the called function pointer.
2279 * @param fEnabled Seamless mode enabled or not
2280 */
2281 DECLR3CALLBACKMEMBER(int, pfnRequestSeamlessChange,(PPDMIVMMDEVPORT pInterface, bool fEnabled));
2282
2283 /**
2284 * Issue a memory balloon change request.
2285 *
2286 * Note that there can only one request in the queue and that in case the guest does
2287 * not process it, issuing another request will overwrite the previous.
2288 *
2289 * @returns VBox status code
2290 * @param pInterface Pointer to the interface structure containing the called function pointer.
2291 * @param cMbBalloon Balloon size in megabytes
2292 */
2293 DECLR3CALLBACKMEMBER(int, pfnSetMemoryBalloon,(PPDMIVMMDEVPORT pInterface, uint32_t cMbBalloon));
2294
2295 /**
2296 * Issue a statistcs interval change request.
2297 *
2298 * Note that there can only one request in the queue and that in case the guest does
2299 * not process it, issuing another request will overwrite the previous.
2300 *
2301 * @returns VBox status code
2302 * @param pInterface Pointer to the interface structure containing the called function pointer.
2303 * @param cSecsStatInterval Statistics query interval in seconds
2304 * (0=disable).
2305 */
2306 DECLR3CALLBACKMEMBER(int, pfnSetStatisticsInterval,(PPDMIVMMDEVPORT pInterface, uint32_t cSecsStatInterval));
2307
2308 /**
2309 * Notify the guest about a VRDP status change.
2310 *
2311 * @returns VBox status code
2312 * @param pInterface Pointer to the interface structure containing the called function pointer.
2313 * @param fVRDPEnabled Current VRDP status.
2314 * @param uVRDPExperienceLevel Which visual effects to be disabled in
2315 * the guest.
2316 */
2317 DECLR3CALLBACKMEMBER(int, pfnVRDPChange, (PPDMIVMMDEVPORT pInterface, bool fVRDPEnabled, uint32_t uVRDPExperienceLevel));
2318
2319 /**
2320 * Notify the guest of CPU hot-unplug event.
2321 *
2322 * @returns VBox status code
2323 * @param pInterface Pointer to the interface structure containing the called function pointer.
2324 * @param idCpuCore The core id of the CPU to remove.
2325 * @param idCpuPackage The package id of the CPU to remove.
2326 */
2327 DECLR3CALLBACKMEMBER(int, pfnCpuHotUnplug, (PPDMIVMMDEVPORT pInterface, uint32_t idCpuCore, uint32_t idCpuPackage));
2328
2329 /**
2330 * Notify the guest of CPU hot-plug event.
2331 *
2332 * @returns VBox status code
2333 * @param pInterface Pointer to the interface structure containing the called function pointer.
2334 * @param idCpuCore The core id of the CPU to add.
2335 * @param idCpuPackage The package id of the CPU to add.
2336 */
2337 DECLR3CALLBACKMEMBER(int, pfnCpuHotPlug, (PPDMIVMMDEVPORT pInterface, uint32_t idCpuCore, uint32_t idCpuPackage));
2338
2339} PDMIVMMDEVPORT;
2340/** PDMIVMMDEVPORT interface ID. */
2341#define PDMIVMMDEVPORT_IID "d7e52035-3b6c-422e-9215-2a75646a945d"
2342
2343
2344/** Pointer to a HPET legacy notification interface. */
2345typedef struct PDMIHPETLEGACYNOTIFY *PPDMIHPETLEGACYNOTIFY;
2346/**
2347 * HPET legacy notification interface.
2348 */
2349typedef struct PDMIHPETLEGACYNOTIFY
2350{
2351 /**
2352 * Notify about change of HPET legacy mode.
2353 *
2354 * @param pInterface Pointer to the interface structure containing the
2355 * called function pointer.
2356 * @param fActivated If HPET legacy mode is activated (@c true) or
2357 * deactivated (@c false).
2358 */
2359 DECLR3CALLBACKMEMBER(void, pfnModeChanged,(PPDMIHPETLEGACYNOTIFY pInterface, bool fActivated));
2360} PDMIHPETLEGACYNOTIFY;
2361/** PDMIHPETLEGACYNOTIFY interface ID. */
2362#define PDMIHPETLEGACYNOTIFY_IID "c9ada595-4b65-4311-8b21-b10498997774"
2363
2364
2365/** @name Flags for PDMIVMMDEVPORT::pfnSetCredentials.
2366 * @{ */
2367/** The guest should perform a logon with the credentials. */
2368#define VMMDEV_SETCREDENTIALS_GUESTLOGON RT_BIT(0)
2369/** The guest should prevent local logons. */
2370#define VMMDEV_SETCREDENTIALS_NOLOCALLOGON RT_BIT(1)
2371/** The guest should verify the credentials. */
2372#define VMMDEV_SETCREDENTIALS_JUDGE RT_BIT(15)
2373/** @} */
2374
2375/** Forward declaration of the guest information structure. */
2376struct VBoxGuestInfo;
2377/** Forward declaration of the guest information-2 structure. */
2378struct VBoxGuestInfo2;
2379/** Forward declaration of the guest statistics structure */
2380struct VBoxGuestStatistics;
2381/** Forward declaration of the guest status structure */
2382struct VBoxGuestStatus;
2383
2384/** Forward declaration of the video accelerator command memory. */
2385struct VBVAMEMORY;
2386/** Pointer to video accelerator command memory. */
2387typedef struct VBVAMEMORY *PVBVAMEMORY;
2388
2389/** Pointer to a VMMDev connector interface. */
2390typedef struct PDMIVMMDEVCONNECTOR *PPDMIVMMDEVCONNECTOR;
2391/**
2392 * VMMDev connector interface (up).
2393 * Pair with PDMIVMMDEVPORT.
2394 */
2395typedef struct PDMIVMMDEVCONNECTOR
2396{
2397 /**
2398 * Update guest facility status.
2399 *
2400 * Called in response to VMMDevReq_ReportGuestStatus, reset or state restore.
2401 *
2402 * @param pInterface Pointer to this interface.
2403 * @param uFacility The facility.
2404 * @param uStatus The status.
2405 * @param fFlags Flags assoicated with the update. Currently
2406 * reserved and should be ignored.
2407 * @param pTimeSpecTS Pointer to the timestamp of this report.
2408 * @thread The emulation thread.
2409 */
2410 DECLR3CALLBACKMEMBER(void, pfnUpdateGuestStatus,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t uFacility, uint16_t uStatus,
2411 uint32_t fFlags, PCRTTIMESPEC pTimeSpecTS));
2412
2413 /**
2414 * Updates a guest user state.
2415 *
2416 * Called in response to VMMDevReq_ReportGuestUserState.
2417 *
2418 * @param pInterface Pointer to this interface.
2419 * @param pszUser Guest user name to update status for.
2420 * @param pszDomain Domain the guest user is bound to. Optional.
2421 * @param uState New guest user state to notify host about.
2422 * @param puDetails Pointer to optional state data.
2423 * @param cbDetails Size (in bytes) of optional state data.
2424 * @thread The emulation thread.
2425 */
2426 DECLR3CALLBACKMEMBER(void, pfnUpdateGuestUserState,(PPDMIVMMDEVCONNECTOR pInterface, const char *pszUser, const char *pszDomain,
2427 uint32_t uState,
2428 const uint8_t *puDetails, uint32_t cbDetails));
2429
2430 /**
2431 * Reports the guest API and OS version.
2432 * Called whenever the Additions issue a guest info report request.
2433 *
2434 * @param pInterface Pointer to this interface.
2435 * @param pGuestInfo Pointer to guest information structure
2436 * @thread The emulation thread.
2437 */
2438 DECLR3CALLBACKMEMBER(void, pfnUpdateGuestInfo,(PPDMIVMMDEVCONNECTOR pInterface, const struct VBoxGuestInfo *pGuestInfo));
2439
2440 /**
2441 * Reports the detailed Guest Additions version.
2442 *
2443 * @param pInterface Pointer to this interface.
2444 * @param uFullVersion The guest additions version as a full version.
2445 * Use VBOX_FULL_VERSION_GET_MAJOR,
2446 * VBOX_FULL_VERSION_GET_MINOR and
2447 * VBOX_FULL_VERSION_GET_BUILD to access it.
2448 * (This will not be zero, so turn down the
2449 * paranoia level a notch.)
2450 * @param pszName Pointer to the sanitized version name. This can
2451 * be empty, but will not be NULL. If not empty,
2452 * it will contain a build type tag and/or a
2453 * publisher tag. If both, then they are separated
2454 * by an underscore (VBOX_VERSION_STRING fashion).
2455 * @param uRevision The SVN revision. Can be 0.
2456 * @param fFeatures Feature mask, currently none are defined.
2457 *
2458 * @thread The emulation thread.
2459 */
2460 DECLR3CALLBACKMEMBER(void, pfnUpdateGuestInfo2,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t uFullVersion,
2461 const char *pszName, uint32_t uRevision, uint32_t fFeatures));
2462
2463 /**
2464 * Update the guest additions capabilities.
2465 * This is called when the guest additions capabilities change. The new capabilities
2466 * are given and the connector should update its internal state.
2467 *
2468 * @param pInterface Pointer to this interface.
2469 * @param newCapabilities New capabilities.
2470 * @thread The emulation thread.
2471 */
2472 DECLR3CALLBACKMEMBER(void, pfnUpdateGuestCapabilities,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities));
2473
2474 /**
2475 * Update the mouse capabilities.
2476 * This is called when the mouse capabilities change. The new capabilities
2477 * are given and the connector should update its internal state.
2478 *
2479 * @param pInterface Pointer to this interface.
2480 * @param newCapabilities New capabilities.
2481 * @thread The emulation thread.
2482 */
2483 DECLR3CALLBACKMEMBER(void, pfnUpdateMouseCapabilities,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities));
2484
2485 /**
2486 * Update the pointer shape.
2487 * This is called when the mouse pointer shape changes. The new shape
2488 * is passed as a caller allocated buffer that will be freed after returning
2489 *
2490 * @param pInterface Pointer to this interface.
2491 * @param fVisible Visibility indicator (if false, the other parameters are undefined).
2492 * @param fAlpha Flag whether alpha channel is being passed.
2493 * @param xHot Pointer hot spot x coordinate.
2494 * @param yHot Pointer hot spot y coordinate.
2495 * @param x Pointer new x coordinate on screen.
2496 * @param y Pointer new y coordinate on screen.
2497 * @param cx Pointer width in pixels.
2498 * @param cy Pointer height in pixels.
2499 * @param cbScanline Size of one scanline in bytes.
2500 * @param pvShape New shape buffer.
2501 * @thread The emulation thread.
2502 */
2503 DECLR3CALLBACKMEMBER(void, pfnUpdatePointerShape,(PPDMIVMMDEVCONNECTOR pInterface, bool fVisible, bool fAlpha,
2504 uint32_t xHot, uint32_t yHot,
2505 uint32_t cx, uint32_t cy,
2506 void *pvShape));
2507
2508 /**
2509 * Enable or disable video acceleration on behalf of guest.
2510 *
2511 * @param pInterface Pointer to this interface.
2512 * @param fEnable Whether to enable acceleration.
2513 * @param pVbvaMemory Video accelerator memory.
2514
2515 * @return VBox rc. VINF_SUCCESS if VBVA was enabled.
2516 * @thread The emulation thread.
2517 */
2518 DECLR3CALLBACKMEMBER(int, pfnVideoAccelEnable,(PPDMIVMMDEVCONNECTOR pInterface, bool fEnable, PVBVAMEMORY pVbvaMemory));
2519
2520 /**
2521 * Force video queue processing.
2522 *
2523 * @param pInterface Pointer to this interface.
2524 * @thread The emulation thread.
2525 */
2526 DECLR3CALLBACKMEMBER(void, pfnVideoAccelFlush,(PPDMIVMMDEVCONNECTOR pInterface));
2527
2528 /**
2529 * Return whether the given video mode is supported/wanted by the host.
2530 *
2531 * @returns VBox status code
2532 * @param pInterface Pointer to this interface.
2533 * @param display The guest monitor, 0 for primary.
2534 * @param cy Video mode horizontal resolution in pixels.
2535 * @param cx Video mode vertical resolution in pixels.
2536 * @param cBits Video mode bits per pixel.
2537 * @param pfSupported Where to put the indicator for whether this mode is supported. (output)
2538 * @thread The emulation thread.
2539 */
2540 DECLR3CALLBACKMEMBER(int, pfnVideoModeSupported,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t display, uint32_t cx, uint32_t cy, uint32_t cBits, bool *pfSupported));
2541
2542 /**
2543 * Queries by how many pixels the height should be reduced when calculating video modes
2544 *
2545 * @returns VBox status code
2546 * @param pInterface Pointer to this interface.
2547 * @param pcyReduction Pointer to the result value.
2548 * @thread The emulation thread.
2549 */
2550 DECLR3CALLBACKMEMBER(int, pfnGetHeightReduction,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcyReduction));
2551
2552 /**
2553 * Informs about a credentials judgement result from the guest.
2554 *
2555 * @returns VBox status code
2556 * @param pInterface Pointer to this interface.
2557 * @param fFlags Judgement result flags.
2558 * @thread The emulation thread.
2559 */
2560 DECLR3CALLBACKMEMBER(int, pfnSetCredentialsJudgementResult,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t fFlags));
2561
2562 /**
2563 * Set the visible region of the display
2564 *
2565 * @returns VBox status code.
2566 * @param pInterface Pointer to this interface.
2567 * @param cRect Number of rectangles in pRect
2568 * @param pRect Rectangle array
2569 * @thread The emulation thread.
2570 */
2571 DECLR3CALLBACKMEMBER(int, pfnSetVisibleRegion,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t cRect, PRTRECT pRect));
2572
2573 /**
2574 * Query the visible region of the display
2575 *
2576 * @returns VBox status code.
2577 * @param pInterface Pointer to this interface.
2578 * @param pcRect Number of rectangles in pRect
2579 * @param pRect Rectangle array (set to NULL to query the number of rectangles)
2580 * @thread The emulation thread.
2581 */
2582 DECLR3CALLBACKMEMBER(int, pfnQueryVisibleRegion,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcRect, PRTRECT pRect));
2583
2584 /**
2585 * Request the statistics interval
2586 *
2587 * @returns VBox status code.
2588 * @param pInterface Pointer to this interface.
2589 * @param pulInterval Pointer to interval in seconds
2590 * @thread The emulation thread.
2591 */
2592 DECLR3CALLBACKMEMBER(int, pfnQueryStatisticsInterval,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pulInterval));
2593
2594 /**
2595 * Report new guest statistics
2596 *
2597 * @returns VBox status code.
2598 * @param pInterface Pointer to this interface.
2599 * @param pGuestStats Guest statistics
2600 * @thread The emulation thread.
2601 */
2602 DECLR3CALLBACKMEMBER(int, pfnReportStatistics,(PPDMIVMMDEVCONNECTOR pInterface, struct VBoxGuestStatistics *pGuestStats));
2603
2604 /**
2605 * Query the current balloon size
2606 *
2607 * @returns VBox status code.
2608 * @param pInterface Pointer to this interface.
2609 * @param pcbBalloon Balloon size
2610 * @thread The emulation thread.
2611 */
2612 DECLR3CALLBACKMEMBER(int, pfnQueryBalloonSize,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcbBalloon));
2613
2614 /**
2615 * Query the current page fusion setting
2616 *
2617 * @returns VBox status code.
2618 * @param pInterface Pointer to this interface.
2619 * @param pfPageFusionEnabled Pointer to boolean
2620 * @thread The emulation thread.
2621 */
2622 DECLR3CALLBACKMEMBER(int, pfnIsPageFusionEnabled,(PPDMIVMMDEVCONNECTOR pInterface, bool *pfPageFusionEnabled));
2623
2624} PDMIVMMDEVCONNECTOR;
2625/** PDMIVMMDEVCONNECTOR interface ID. */
2626#define PDMIVMMDEVCONNECTOR_IID "aff90240-a443-434e-9132-80c186ab97d4"
2627
2628
2629#ifndef VBOX_WITH_PDM_AUDIO_DRIVER
2630/** Pointer to a network connector interface */
2631typedef struct PDMIAUDIOCONNECTOR *PPDMIAUDIOCONNECTOR;
2632/**
2633 * Audio connector interface (up).
2634 * No interface pair yet.
2635 */
2636typedef struct PDMIAUDIOCONNECTOR
2637{
2638 DECLR3CALLBACKMEMBER(void, pfnRun,(PPDMIAUDIOCONNECTOR pInterface));
2639
2640/* DECLR3CALLBACKMEMBER(int, pfnSetRecordSource,(PPDMIAUDIOINCONNECTOR pInterface, AUDIORECSOURCE)); */
2641
2642} PDMIAUDIOCONNECTOR;
2643/** PDMIAUDIOCONNECTOR interface ID. */
2644#define PDMIAUDIOCONNECTOR_IID "85d52af5-b3aa-4b3e-b176-4b5ebfc52f47"
2645
2646
2647#endif
2648/** @todo r=bird: the two following interfaces are hacks to work around the missing audio driver
2649 * interface. This should be addressed rather than making more temporary hacks. */
2650
2651/** Pointer to a Audio Sniffer Device port interface. */
2652typedef struct PDMIAUDIOSNIFFERPORT *PPDMIAUDIOSNIFFERPORT;
2653/**
2654 * Audio Sniffer port interface (down).
2655 * Pair with PDMIAUDIOSNIFFERCONNECTOR.
2656 */
2657typedef struct PDMIAUDIOSNIFFERPORT
2658{
2659 /**
2660 * Enables or disables sniffing.
2661 *
2662 * If sniffing is being enabled also sets a flag whether the audio must be also
2663 * left on the host.
2664 *
2665 * @returns VBox status code
2666 * @param pInterface Pointer to this interface.
2667 * @param fEnable 'true' for enable sniffing, 'false' to disable.
2668 * @param fKeepHostAudio Indicates whether host audio should also present
2669 * 'true' means that sound should not be played
2670 * by the audio device.
2671 */
2672 DECLR3CALLBACKMEMBER(int, pfnSetup,(PPDMIAUDIOSNIFFERPORT pInterface, bool fEnable, bool fKeepHostAudio));
2673
2674 /**
2675 * Enables or disables audio input.
2676 *
2677 * @returns VBox status code
2678 * @param pInterface Pointer to this interface.
2679 * @param fIntercept 'true' for interception of audio input,
2680 * 'false' to let the host audio backend do audio input.
2681 */
2682 DECLR3CALLBACKMEMBER(int, pfnAudioInputIntercept,(PPDMIAUDIOSNIFFERPORT pInterface, bool fIntercept));
2683
2684 /**
2685 * Audio input is about to start.
2686 *
2687 * @returns VBox status code.
2688 * @param pvContext The callback context, supplied in the
2689 * PDMIAUDIOSNIFFERCONNECTOR::pfnAudioInputBegin as pvContext.
2690 * @param iSampleHz The sample frequency in Hz.
2691 * @param cChannels Number of channels. 1 for mono, 2 for stereo.
2692 * @param cBits How many bits a sample for a single channel has. Normally 8 or 16.
2693 * @param fUnsigned Whether samples are unsigned values.
2694 */
2695 DECLR3CALLBACKMEMBER(int, pfnAudioInputEventBegin,(PPDMIAUDIOSNIFFERPORT pInterface,
2696 void *pvContext,
2697 int iSampleHz,
2698 int cChannels,
2699 int cBits,
2700 bool fUnsigned));
2701
2702 /**
2703 * Callback which delivers audio data to the audio device.
2704 *
2705 * @returns VBox status code.
2706 * @param pvContext The callback context, supplied in the
2707 * PDMIAUDIOSNIFFERCONNECTOR::pfnAudioInputBegin as pvContext.
2708 * @param pvData Event specific data.
2709 * @param cbData Size of the buffer pointed by pvData.
2710 */
2711 DECLR3CALLBACKMEMBER(int, pfnAudioInputEventData,(PPDMIAUDIOSNIFFERPORT pInterface,
2712 void *pvContext,
2713 const void *pvData,
2714 uint32_t cbData));
2715
2716 /**
2717 * Audio input ends.
2718 *
2719 * @param pvContext The callback context, supplied in the
2720 * PDMIAUDIOSNIFFERCONNECTOR::pfnAudioInputBegin as pvContext.
2721 */
2722 DECLR3CALLBACKMEMBER(void, pfnAudioInputEventEnd,(PPDMIAUDIOSNIFFERPORT pInterface,
2723 void *pvContext));
2724} PDMIAUDIOSNIFFERPORT;
2725/** PDMIAUDIOSNIFFERPORT interface ID. */
2726#define PDMIAUDIOSNIFFERPORT_IID "8ad25d78-46e9-479b-a363-bb0bc0fe022f"
2727
2728
2729/** Pointer to a Audio Sniffer connector interface. */
2730typedef struct PDMIAUDIOSNIFFERCONNECTOR *PPDMIAUDIOSNIFFERCONNECTOR;
2731
2732/**
2733 * Audio Sniffer connector interface (up).
2734 * Pair with PDMIAUDIOSNIFFERPORT.
2735 */
2736typedef struct PDMIAUDIOSNIFFERCONNECTOR
2737{
2738 /**
2739 * AudioSniffer device calls this method when audio samples
2740 * are about to be played and sniffing is enabled.
2741 *
2742 * @param pInterface Pointer to this interface.
2743 * @param pvSamples Audio samples buffer.
2744 * @param cSamples How many complete samples are in the buffer.
2745 * @param iSampleHz The sample frequency in Hz.
2746 * @param cChannels Number of channels. 1 for mono, 2 for stereo.
2747 * @param cBits How many bits a sample for a single channel has. Normally 8 or 16.
2748 * @param fUnsigned Whether samples are unsigned values.
2749 * @thread The emulation thread.
2750 */
2751 DECLR3CALLBACKMEMBER(void, pfnAudioSamplesOut,(PPDMIAUDIOSNIFFERCONNECTOR pInterface, void *pvSamples, uint32_t cSamples,
2752 int iSampleHz, int cChannels, int cBits, bool fUnsigned));
2753
2754 /**
2755 * AudioSniffer device calls this method when output volume is changed.
2756 *
2757 * @param pInterface Pointer to this interface.
2758 * @param u16LeftVolume 0..0xFFFF volume level for left channel.
2759 * @param u16RightVolume 0..0xFFFF volume level for right channel.
2760 * @thread The emulation thread.
2761 */
2762 DECLR3CALLBACKMEMBER(void, pfnAudioVolumeOut,(PPDMIAUDIOSNIFFERCONNECTOR pInterface, uint16_t u16LeftVolume, uint16_t u16RightVolume));
2763
2764 /**
2765 * Audio input has been requested by the virtual audio device.
2766 *
2767 * @param pInterface Pointer to this interface.
2768 * @param ppvUserCtx The interface context for this audio input stream,
2769 * it will be used in the pfnAudioInputEnd call.
2770 * @param pvContext The context pointer to be used in PDMIAUDIOSNIFFERPORT::pfnAudioInputEvent.
2771 * @param cSamples How many samples in a block is preferred in
2772 * PDMIAUDIOSNIFFERPORT::pfnAudioInputEvent.
2773 * @param iSampleHz The sample frequency in Hz.
2774 * @param cChannels Number of channels. 1 for mono, 2 for stereo.
2775 * @param cBits How many bits a sample for a single channel has. Normally 8 or 16.
2776 * @thread The emulation thread.
2777 */
2778 DECLR3CALLBACKMEMBER(int, pfnAudioInputBegin,(PPDMIAUDIOSNIFFERCONNECTOR pInterface,
2779 void **ppvUserCtx,
2780 void *pvContext,
2781 uint32_t cSamples,
2782 uint32_t iSampleHz,
2783 uint32_t cChannels,
2784 uint32_t cBits));
2785
2786 /**
2787 * Audio input has been requested by the virtual audio device.
2788 *
2789 * @param pInterface Pointer to this interface.
2790 * @param pvUserCtx The interface context for this audio input stream,
2791 * which was returned by pfnAudioInputBegin call.
2792 * @thread The emulation thread.
2793 */
2794 DECLR3CALLBACKMEMBER(void, pfnAudioInputEnd,(PPDMIAUDIOSNIFFERCONNECTOR pInterface,
2795 void *pvUserCtx));
2796} PDMIAUDIOSNIFFERCONNECTOR;
2797/** PDMIAUDIOSNIFFERCONNECTOR - The Audio Sniffer Driver connector interface. */
2798#define PDMIAUDIOSNIFFERCONNECTOR_IID "9d37f543-27af-45f8-8002-8ef7abac71e4"
2799
2800
2801/**
2802 * Generic status LED core.
2803 * Note that a unit doesn't have to support all the indicators.
2804 */
2805typedef union PDMLEDCORE
2806{
2807 /** 32-bit view. */
2808 uint32_t volatile u32;
2809 /** Bit view. */
2810 struct
2811 {
2812 /** Reading/Receiving indicator. */
2813 uint32_t fReading : 1;
2814 /** Writing/Sending indicator. */
2815 uint32_t fWriting : 1;
2816 /** Busy indicator. */
2817 uint32_t fBusy : 1;
2818 /** Error indicator. */
2819 uint32_t fError : 1;
2820 } s;
2821} PDMLEDCORE;
2822
2823/** LED bit masks for the u32 view.
2824 * @{ */
2825/** Reading/Receiving indicator. */
2826#define PDMLED_READING RT_BIT(0)
2827/** Writing/Sending indicator. */
2828#define PDMLED_WRITING RT_BIT(1)
2829/** Busy indicator. */
2830#define PDMLED_BUSY RT_BIT(2)
2831/** Error indicator. */
2832#define PDMLED_ERROR RT_BIT(3)
2833/** @} */
2834
2835
2836/**
2837 * Generic status LED.
2838 * Note that a unit doesn't have to support all the indicators.
2839 */
2840typedef struct PDMLED
2841{
2842 /** Just a magic for sanity checking. */
2843 uint32_t u32Magic;
2844 uint32_t u32Alignment; /**< structure size alignment. */
2845 /** The actual LED status.
2846 * Only the device is allowed to change this. */
2847 PDMLEDCORE Actual;
2848 /** The asserted LED status which is cleared by the reader.
2849 * The device will assert the bits but never clear them.
2850 * The driver clears them as it sees fit. */
2851 PDMLEDCORE Asserted;
2852} PDMLED;
2853
2854/** Pointer to an LED. */
2855typedef PDMLED *PPDMLED;
2856/** Pointer to a const LED. */
2857typedef const PDMLED *PCPDMLED;
2858
2859/** Magic value for PDMLED::u32Magic. */
2860#define PDMLED_MAGIC UINT32_C(0x11335577)
2861
2862/** Pointer to an LED ports interface. */
2863typedef struct PDMILEDPORTS *PPDMILEDPORTS;
2864/**
2865 * Interface for exporting LEDs (down).
2866 * Pair with PDMILEDCONNECTORS.
2867 */
2868typedef struct PDMILEDPORTS
2869{
2870 /**
2871 * Gets the pointer to the status LED of a unit.
2872 *
2873 * @returns VBox status code.
2874 * @param pInterface Pointer to the interface structure containing the called function pointer.
2875 * @param iLUN The unit which status LED we desire.
2876 * @param ppLed Where to store the LED pointer.
2877 */
2878 DECLR3CALLBACKMEMBER(int, pfnQueryStatusLed,(PPDMILEDPORTS pInterface, unsigned iLUN, PPDMLED *ppLed));
2879
2880} PDMILEDPORTS;
2881/** PDMILEDPORTS interface ID. */
2882#define PDMILEDPORTS_IID "435e0cec-8549-4ca0-8c0d-98e52f1dc038"
2883
2884
2885/** Pointer to an LED connectors interface. */
2886typedef struct PDMILEDCONNECTORS *PPDMILEDCONNECTORS;
2887/**
2888 * Interface for reading LEDs (up).
2889 * Pair with PDMILEDPORTS.
2890 */
2891typedef struct PDMILEDCONNECTORS
2892{
2893 /**
2894 * Notification about a unit which have been changed.
2895 *
2896 * The driver must discard any pointers to data owned by
2897 * the unit and requery it.
2898 *
2899 * @param pInterface Pointer to the interface structure containing the called function pointer.
2900 * @param iLUN The unit number.
2901 */
2902 DECLR3CALLBACKMEMBER(void, pfnUnitChanged,(PPDMILEDCONNECTORS pInterface, unsigned iLUN));
2903} PDMILEDCONNECTORS;
2904/** PDMILEDCONNECTORS interface ID. */
2905#define PDMILEDCONNECTORS_IID "8ed63568-82a7-4193-b57b-db8085ac4495"
2906
2907
2908/** Pointer to a Media Notification interface. */
2909typedef struct PDMIMEDIANOTIFY *PPDMIMEDIANOTIFY;
2910/**
2911 * Interface for exporting Medium eject information (up). No interface pair.
2912 */
2913typedef struct PDMIMEDIANOTIFY
2914{
2915 /**
2916 * Signals that the medium was ejected.
2917 *
2918 * @returns VBox status code.
2919 * @param pInterface Pointer to the interface structure containing the called function pointer.
2920 * @param iLUN The unit which had the medium ejected.
2921 */
2922 DECLR3CALLBACKMEMBER(int, pfnEjected,(PPDMIMEDIANOTIFY pInterface, unsigned iLUN));
2923
2924} PDMIMEDIANOTIFY;
2925/** PDMIMEDIANOTIFY interface ID. */
2926#define PDMIMEDIANOTIFY_IID "fc22d53e-feb1-4a9c-b9fb-0a990a6ab288"
2927
2928
2929/** The special status unit number */
2930#define PDM_STATUS_LUN 999
2931
2932
2933#ifdef VBOX_WITH_HGCM
2934
2935/** Abstract HGCM command structure. Used only to define a typed pointer. */
2936struct VBOXHGCMCMD;
2937
2938/** Pointer to HGCM command structure. This pointer is unique and identifies
2939 * the command being processed. The pointer is passed to HGCM connector methods,
2940 * and must be passed back to HGCM port when command is completed.
2941 */
2942typedef struct VBOXHGCMCMD *PVBOXHGCMCMD;
2943
2944/** Pointer to a HGCM port interface. */
2945typedef struct PDMIHGCMPORT *PPDMIHGCMPORT;
2946/**
2947 * Host-Guest communication manager port interface (down). Normally implemented
2948 * by VMMDev.
2949 * Pair with PDMIHGCMCONNECTOR.
2950 */
2951typedef struct PDMIHGCMPORT
2952{
2953 /**
2954 * Notify the guest on a command completion.
2955 *
2956 * @param pInterface Pointer to this interface.
2957 * @param rc The return code (VBox error code).
2958 * @param pCmd A pointer that identifies the completed command.
2959 *
2960 * @returns VBox status code
2961 */
2962 DECLR3CALLBACKMEMBER(void, pfnCompleted,(PPDMIHGCMPORT pInterface, int32_t rc, PVBOXHGCMCMD pCmd));
2963
2964} PDMIHGCMPORT;
2965/** PDMIHGCMPORT interface ID. */
2966# define PDMIHGCMPORT_IID "e00a0cbf-b75a-45c3-87f4-41cddbc5ae0b"
2967
2968
2969/** Pointer to a HGCM service location structure. */
2970typedef struct HGCMSERVICELOCATION *PHGCMSERVICELOCATION;
2971
2972/** Pointer to a HGCM connector interface. */
2973typedef struct PDMIHGCMCONNECTOR *PPDMIHGCMCONNECTOR;
2974/**
2975 * The Host-Guest communication manager connector interface (up). Normally
2976 * implemented by Main::VMMDevInterface.
2977 * Pair with PDMIHGCMPORT.
2978 */
2979typedef struct PDMIHGCMCONNECTOR
2980{
2981 /**
2982 * Locate a service and inform it about a client connection.
2983 *
2984 * @param pInterface Pointer to this interface.
2985 * @param pCmd A pointer that identifies the command.
2986 * @param pServiceLocation Pointer to the service location structure.
2987 * @param pu32ClientID Where to store the client id for the connection.
2988 * @return VBox status code.
2989 * @thread The emulation thread.
2990 */
2991 DECLR3CALLBACKMEMBER(int, pfnConnect,(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, PHGCMSERVICELOCATION pServiceLocation, uint32_t *pu32ClientID));
2992
2993 /**
2994 * Disconnect from service.
2995 *
2996 * @param pInterface Pointer to this interface.
2997 * @param pCmd A pointer that identifies the command.
2998 * @param u32ClientID The client id returned by the pfnConnect call.
2999 * @return VBox status code.
3000 * @thread The emulation thread.
3001 */
3002 DECLR3CALLBACKMEMBER(int, pfnDisconnect,(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID));
3003
3004 /**
3005 * Process a guest issued command.
3006 *
3007 * @param pInterface Pointer to this interface.
3008 * @param pCmd A pointer that identifies the command.
3009 * @param u32ClientID The client id returned by the pfnConnect call.
3010 * @param u32Function Function to be performed by the service.
3011 * @param cParms Number of parameters in the array pointed to by paParams.
3012 * @param paParms Pointer to an array of parameters.
3013 * @return VBox status code.
3014 * @thread The emulation thread.
3015 */
3016 DECLR3CALLBACKMEMBER(int, pfnCall,(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID, uint32_t u32Function,
3017 uint32_t cParms, PVBOXHGCMSVCPARM paParms));
3018
3019} PDMIHGCMCONNECTOR;
3020/** PDMIHGCMCONNECTOR interface ID. */
3021# define PDMIHGCMCONNECTOR_IID "a1104758-c888-4437-8f2a-7bac17865b5c"
3022
3023#endif /* VBOX_WITH_HGCM */
3024
3025/**
3026 * Data direction.
3027 */
3028typedef enum PDMSCSIREQUESTTXDIR
3029{
3030 PDMSCSIREQUESTTXDIR_UNKNOWN = 0x00,
3031 PDMSCSIREQUESTTXDIR_FROM_DEVICE = 0x01,
3032 PDMSCSIREQUESTTXDIR_TO_DEVICE = 0x02,
3033 PDMSCSIREQUESTTXDIR_NONE = 0x03,
3034 PDMSCSIREQUESTTXDIR_32BIT_HACK = 0x7fffffff
3035} PDMSCSIREQUESTTXDIR;
3036
3037/**
3038 * SCSI request structure.
3039 */
3040typedef struct PDMSCSIREQUEST
3041{
3042 /** The logical unit. */
3043 uint32_t uLogicalUnit;
3044 /** Direction of the data flow. */
3045 PDMSCSIREQUESTTXDIR uDataDirection;
3046 /** Size of the SCSI CDB. */
3047 uint32_t cbCDB;
3048 /** Pointer to the SCSI CDB. */
3049 uint8_t *pbCDB;
3050 /** Overall size of all scatter gather list elements
3051 * for data transfer if any. */
3052 uint32_t cbScatterGather;
3053 /** Number of elements in the scatter gather list. */
3054 uint32_t cScatterGatherEntries;
3055 /** Pointer to the head of the scatter gather list. */
3056 PRTSGSEG paScatterGatherHead;
3057 /** Size of the sense buffer. */
3058 uint32_t cbSenseBuffer;
3059 /** Pointer to the sense buffer. *
3060 * Current assumption that the sense buffer is not scattered. */
3061 uint8_t *pbSenseBuffer;
3062 /** Opaque user data for use by the device. Left untouched by everything else! */
3063 void *pvUser;
3064} PDMSCSIREQUEST, *PPDMSCSIREQUEST;
3065/** Pointer to a const SCSI request structure. */
3066typedef const PDMSCSIREQUEST *PCSCSIREQUEST;
3067
3068/** Pointer to a SCSI port interface. */
3069typedef struct PDMISCSIPORT *PPDMISCSIPORT;
3070/**
3071 * SCSI command execution port interface (down).
3072 * Pair with PDMISCSICONNECTOR.
3073 */
3074typedef struct PDMISCSIPORT
3075{
3076
3077 /**
3078 * Notify the device on request completion.
3079 *
3080 * @returns VBox status code.
3081 * @param pInterface Pointer to this interface.
3082 * @param pSCSIRequest Pointer to the finished SCSI request.
3083 * @param rcCompletion SCSI_STATUS_* code for the completed request.
3084 * @param fRedo Flag whether the request can to be redone
3085 * when it failed.
3086 * @param rcReq The status code the request completed with (VERR_*)
3087 * Should be only used to choose the correct error message
3088 * displayed to the user if the error can be fixed by him
3089 * (fRedo is true).
3090 */
3091 DECLR3CALLBACKMEMBER(int, pfnSCSIRequestCompleted, (PPDMISCSIPORT pInterface, PPDMSCSIREQUEST pSCSIRequest,
3092 int rcCompletion, bool fRedo, int rcReq));
3093
3094 /**
3095 * Returns the storage controller name, instance and LUN of the attached medium.
3096 *
3097 * @returns VBox status.
3098 * @param pInterface Pointer to this interface.
3099 * @param ppcszController Where to store the name of the storage controller.
3100 * @param piInstance Where to store the instance number of the controller.
3101 * @param piLUN Where to store the LUN of the attached device.
3102 */
3103 DECLR3CALLBACKMEMBER(int, pfnQueryDeviceLocation, (PPDMISCSIPORT pInterface, const char **ppcszController,
3104 uint32_t *piInstance, uint32_t *piLUN));
3105
3106} PDMISCSIPORT;
3107/** PDMISCSIPORT interface ID. */
3108#define PDMISCSIPORT_IID "05d9fc3b-e38c-4b30-8344-a323feebcfe5"
3109
3110
3111/** Pointer to a SCSI connector interface. */
3112typedef struct PDMISCSICONNECTOR *PPDMISCSICONNECTOR;
3113/**
3114 * SCSI command execution connector interface (up).
3115 * Pair with PDMISCSIPORT.
3116 */
3117typedef struct PDMISCSICONNECTOR
3118{
3119
3120 /**
3121 * Submits a SCSI request for execution.
3122 *
3123 * @returns VBox status code.
3124 * @param pInterface Pointer to this interface.
3125 * @param pSCSIRequest Pointer to the SCSI request to execute.
3126 */
3127 DECLR3CALLBACKMEMBER(int, pfnSCSIRequestSend, (PPDMISCSICONNECTOR pInterface, PPDMSCSIREQUEST pSCSIRequest));
3128
3129} PDMISCSICONNECTOR;
3130/** PDMISCSICONNECTOR interface ID. */
3131#define PDMISCSICONNECTOR_IID "94465fbd-a2f2-447e-88c9-7366421bfbfe"
3132
3133
3134/** Pointer to a display VBVA callbacks interface. */
3135typedef struct PDMIDISPLAYVBVACALLBACKS *PPDMIDISPLAYVBVACALLBACKS;
3136/**
3137 * Display VBVA callbacks interface (up).
3138 */
3139typedef struct PDMIDISPLAYVBVACALLBACKS
3140{
3141
3142 /**
3143 * Informs guest about completion of processing the given Video HW Acceleration
3144 * command, does not wait for the guest to process the command.
3145 *
3146 * @returns ???
3147 * @param pInterface Pointer to this interface.
3148 * @param pCmd The Video HW Acceleration Command that was
3149 * completed.
3150 */
3151 DECLR3CALLBACKMEMBER(int, pfnVHWACommandCompleteAsync, (PPDMIDISPLAYVBVACALLBACKS pInterface,
3152 PVBOXVHWACMD pCmd));
3153
3154 DECLR3CALLBACKMEMBER(int, pfnCrHgsmiCommandCompleteAsync, (PPDMIDISPLAYVBVACALLBACKS pInterface,
3155 struct VBOXVDMACMD_CHROMIUM_CMD* pCmd, int rc));
3156
3157 DECLR3CALLBACKMEMBER(int, pfnCrHgsmiControlCompleteAsync, (PPDMIDISPLAYVBVACALLBACKS pInterface,
3158 struct VBOXVDMACMD_CHROMIUM_CTL* pCmd, int rc));
3159
3160 DECLR3CALLBACKMEMBER(int, pfnCrCtlSubmit, (PPDMIDISPLAYVBVACALLBACKS pInterface,
3161 struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd,
3162 PFNCRCTLCOMPLETION pfnCompletion,
3163 void *pvCompletion));
3164
3165 DECLR3CALLBACKMEMBER(int, pfnCrCtlSubmitSync, (PPDMIDISPLAYVBVACALLBACKS pInterface,
3166 struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd));
3167} PDMIDISPLAYVBVACALLBACKS;
3168/** PDMIDISPLAYVBVACALLBACKS */
3169#define PDMIDISPLAYVBVACALLBACKS_IID "ddac0bd0-332d-4671-8853-732921a80216"
3170
3171/** Pointer to a PCI raw connector interface. */
3172typedef struct PDMIPCIRAWCONNECTOR *PPDMIPCIRAWCONNECTOR;
3173/**
3174 * PCI raw connector interface (up).
3175 */
3176typedef struct PDMIPCIRAWCONNECTOR
3177{
3178
3179 /**
3180 *
3181 */
3182 DECLR3CALLBACKMEMBER(int, pfnDeviceConstructComplete, (PPDMIPCIRAWCONNECTOR pInterface, const char *pcszName,
3183 uint32_t uHostPciAddress, uint32_t uGuestPciAddress,
3184 int rc));
3185
3186} PDMIPCIRAWCONNECTOR;
3187/** PDMIPCIRAWCONNECTOR interface ID. */
3188#define PDMIPCIRAWCONNECTOR_IID "14aa9c6c-8869-4782-9dfc-910071a6aebf"
3189
3190/** @} */
3191
3192RT_C_DECLS_END
3193
3194#endif
Note: See TracBrowser for help on using the repository browser.

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