VirtualBox

source: vbox/trunk/include/VBox/vmm/pdmstorageifs.h@ 64002

Last change on this file since 64002 was 64002, checked in by vboxsync, 9 years ago

Devices/Storage: Throw out PDMIMEDIAASYNC which is superseded by PDMIMEDIAEX now

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 44.6 KB
Line 
1/** @file
2 * PDM - Pluggable Device Manager, Storage related interfaces.
3 */
4
5/*
6 * Copyright (C) 2006-2016 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (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_pdmstorageifs_h
27#define ___VBox_vmm_pdmstorageifs_h
28
29#include <iprt/sg.h>
30#include <VBox/types.h>
31
32RT_C_DECLS_BEGIN
33
34/** @defgroup grp_pdm_ifs_storage PDM Storage Interfaces
35 * @ingroup grp_pdm_interfaces
36 * @{
37 */
38
39
40/** Pointer to a mount interface. */
41typedef struct PDMIMOUNTNOTIFY *PPDMIMOUNTNOTIFY;
42/**
43 * Block interface (up).
44 * Pair with PDMIMOUNT.
45 */
46typedef struct PDMIMOUNTNOTIFY
47{
48 /**
49 * Called when a media is mounted.
50 *
51 * @param pInterface Pointer to the interface structure containing the called function pointer.
52 * @thread The emulation thread.
53 */
54 DECLR3CALLBACKMEMBER(void, pfnMountNotify,(PPDMIMOUNTNOTIFY pInterface));
55
56 /**
57 * Called when a media is unmounted
58 * @param pInterface Pointer to the interface structure containing the called function pointer.
59 * @thread The emulation thread.
60 */
61 DECLR3CALLBACKMEMBER(void, pfnUnmountNotify,(PPDMIMOUNTNOTIFY pInterface));
62} PDMIMOUNTNOTIFY;
63/** PDMIMOUNTNOTIFY interface ID. */
64#define PDMIMOUNTNOTIFY_IID "fa143ac9-9fc6-498e-997f-945380a558f9"
65
66
67/** Pointer to mount interface. */
68typedef struct PDMIMOUNT *PPDMIMOUNT;
69/**
70 * Mount interface (down).
71 * Pair with PDMIMOUNTNOTIFY.
72 */
73typedef struct PDMIMOUNT
74{
75 /**
76 * Unmount the media.
77 *
78 * The driver will validate and pass it on. On the rebounce it will decide whether or not to detach it self.
79 *
80 * @returns VBox status code.
81 * @param pInterface Pointer to the interface structure containing the called function pointer.
82 * @thread The emulation thread.
83 * @param fForce Force the unmount, even for locked media.
84 * @param fEject Eject the medium. Only relevant for host drives.
85 * @thread The emulation thread.
86 */
87 DECLR3CALLBACKMEMBER(int, pfnUnmount,(PPDMIMOUNT pInterface, bool fForce, bool fEject));
88
89 /**
90 * Checks if a media is mounted.
91 *
92 * @returns true if mounted.
93 * @returns false if not mounted.
94 * @param pInterface Pointer to the interface structure containing the called function pointer.
95 * @thread Any thread.
96 */
97 DECLR3CALLBACKMEMBER(bool, pfnIsMounted,(PPDMIMOUNT pInterface));
98
99 /**
100 * Locks the media, preventing any unmounting of it.
101 *
102 * @returns VBox status code.
103 * @param pInterface Pointer to the interface structure containing the called function pointer.
104 * @thread The emulation thread.
105 */
106 DECLR3CALLBACKMEMBER(int, pfnLock,(PPDMIMOUNT pInterface));
107
108 /**
109 * Unlocks the media, canceling previous calls to pfnLock().
110 *
111 * @returns VBox status code.
112 * @param pInterface Pointer to the interface structure containing the called function pointer.
113 * @thread The emulation thread.
114 */
115 DECLR3CALLBACKMEMBER(int, pfnUnlock,(PPDMIMOUNT pInterface));
116
117 /**
118 * Checks if a media is locked.
119 *
120 * @returns true if locked.
121 * @returns false if not locked.
122 * @param pInterface Pointer to the interface structure containing the called function pointer.
123 * @thread Any thread.
124 */
125 DECLR3CALLBACKMEMBER(bool, pfnIsLocked,(PPDMIMOUNT pInterface));
126} PDMIMOUNT;
127/** PDMIMOUNT interface ID. */
128#define PDMIMOUNT_IID "34fc7a4c-623a-4806-a6bf-5be1be33c99f"
129
130
131/**
132 * Callback which provides progress information.
133 *
134 * @return VBox status code.
135 * @param pvUser Opaque user data.
136 * @param uPercent Completion percentage.
137 */
138typedef DECLCALLBACK(int) FNSIMPLEPROGRESS(void *pvUser, unsigned uPercentage);
139/** Pointer to FNSIMPLEPROGRESS() */
140typedef FNSIMPLEPROGRESS *PFNSIMPLEPROGRESS;
141
142
143/**
144 * Media type.
145 */
146typedef enum PDMMEDIATYPE
147{
148 /** Error (for the query function). */
149 PDMMEDIATYPE_ERROR = 1,
150 /** 360KB 5 1/4" floppy drive. */
151 PDMMEDIATYPE_FLOPPY_360,
152 /** 720KB 3 1/2" floppy drive. */
153 PDMMEDIATYPE_FLOPPY_720,
154 /** 1.2MB 5 1/4" floppy drive. */
155 PDMMEDIATYPE_FLOPPY_1_20,
156 /** 1.44MB 3 1/2" floppy drive. */
157 PDMMEDIATYPE_FLOPPY_1_44,
158 /** 2.88MB 3 1/2" floppy drive. */
159 PDMMEDIATYPE_FLOPPY_2_88,
160 /** Fake drive that can take up to 15.6 MB images.
161 * C=255, H=2, S=63. */
162 PDMMEDIATYPE_FLOPPY_FAKE_15_6,
163 /** Fake drive that can take up to 63.5 MB images.
164 * C=255, H=2, S=255. */
165 PDMMEDIATYPE_FLOPPY_FAKE_63_5,
166 /** CDROM drive. */
167 PDMMEDIATYPE_CDROM,
168 /** DVD drive. */
169 PDMMEDIATYPE_DVD,
170 /** Hard disk drive. */
171 PDMMEDIATYPE_HARD_DISK
172} PDMMEDIATYPE;
173
174/** Check if the given block type is a floppy. */
175#define PDMMEDIATYPE_IS_FLOPPY(a_enmType) ( (a_enmType) >= PDMMEDIATYPE_FLOPPY_360 && (a_enmType) <= PDMMEDIATYPE_FLOPPY_2_88 )
176
177/**
178 * Raw command data transfer direction.
179 */
180typedef enum PDMMEDIATXDIR
181{
182 PDMMEDIATXDIR_NONE = 0,
183 PDMMEDIATXDIR_FROM_DEVICE,
184 PDMMEDIATXDIR_TO_DEVICE
185} PDMMEDIATXDIR;
186
187/**
188 * Media geometry structure.
189 */
190typedef struct PDMMEDIAGEOMETRY
191{
192 /** Number of cylinders. */
193 uint32_t cCylinders;
194 /** Number of heads. */
195 uint32_t cHeads;
196 /** Number of sectors. */
197 uint32_t cSectors;
198} PDMMEDIAGEOMETRY;
199
200/** Pointer to media geometry structure. */
201typedef PDMMEDIAGEOMETRY *PPDMMEDIAGEOMETRY;
202/** Pointer to constant media geometry structure. */
203typedef const PDMMEDIAGEOMETRY *PCPDMMEDIAGEOMETRY;
204
205/** Pointer to a media port interface. */
206typedef struct PDMIMEDIAPORT *PPDMIMEDIAPORT;
207/**
208 * Media port interface (down).
209 */
210typedef struct PDMIMEDIAPORT
211{
212 /**
213 * Returns the storage controller name, instance and LUN of the attached medium.
214 *
215 * @returns VBox status.
216 * @param pInterface Pointer to this interface.
217 * @param ppcszController Where to store the name of the storage controller.
218 * @param piInstance Where to store the instance number of the controller.
219 * @param piLUN Where to store the LUN of the attached device.
220 */
221 DECLR3CALLBACKMEMBER(int, pfnQueryDeviceLocation, (PPDMIMEDIAPORT pInterface, const char **ppcszController,
222 uint32_t *piInstance, uint32_t *piLUN));
223
224} PDMIMEDIAPORT;
225/** PDMIMEDIAPORT interface ID. */
226#define PDMIMEDIAPORT_IID "9f7e8c9e-6d35-4453-bbef-1f78033174d6"
227
228/** Pointer to a media interface. */
229typedef struct PDMIMEDIA *PPDMIMEDIA;
230/**
231 * Media interface (up).
232 * Pairs with PDMIMEDIAPORT.
233 */
234typedef struct PDMIMEDIA
235{
236 /**
237 * Read bits.
238 *
239 * @returns VBox status code.
240 * @param pInterface Pointer to the interface structure containing the called function pointer.
241 * @param off Offset to start reading from. The offset must be aligned to a sector boundary.
242 * @param pvBuf Where to store the read bits.
243 * @param cbRead Number of bytes to read. Must be aligned to a sector boundary.
244 * @thread Any thread.
245 */
246 DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMIMEDIA pInterface, uint64_t off, void *pvBuf, size_t cbRead));
247
248 /**
249 * Read bits - version for DevPcBios.
250 *
251 * @returns VBox status code.
252 * @param pInterface Pointer to the interface structure containing the called function pointer.
253 * @param off Offset to start reading from. The offset must be aligned to a sector boundary.
254 * @param pvBuf Where to store the read bits.
255 * @param cbRead Number of bytes to read. Must be aligned to a sector boundary.
256 * @thread Any thread.
257 *
258 * @note: Special version of pfnRead which doesn't try to suspend the VM when the DEKs for encrypted disks
259 * are missing but just returns an error.
260 */
261 DECLR3CALLBACKMEMBER(int, pfnReadPcBios,(PPDMIMEDIA pInterface, uint64_t off, void *pvBuf, size_t cbRead));
262
263 /**
264 * Write bits.
265 *
266 * @returns VBox status code.
267 * @param pInterface Pointer to the interface structure containing the called function pointer.
268 * @param off Offset to start writing at. The offset must be aligned to a sector boundary.
269 * @param pvBuf Where to store the write bits.
270 * @param cbWrite Number of bytes to write. Must be aligned to a sector boundary.
271 * @thread Any thread.
272 */
273 DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMIMEDIA pInterface, uint64_t off, const void *pvBuf, size_t cbWrite));
274
275 /**
276 * Make sure that the bits written are actually on the storage medium.
277 *
278 * @returns VBox status code.
279 * @param pInterface Pointer to the interface structure containing the called function pointer.
280 * @thread Any thread.
281 */
282 DECLR3CALLBACKMEMBER(int, pfnFlush,(PPDMIMEDIA pInterface));
283
284 /**
285 * Send a raw command to the underlying device (CDROM).
286 * This method is optional (i.e. the function pointer may be NULL).
287 *
288 * @returns VBox status code.
289 * @param pInterface Pointer to the interface structure containing the called function pointer.
290 * @param pbCmd Offset to start reading from.
291 * @param enmTxDir Direction of transfer.
292 * @param pvBuf Pointer tp the transfer buffer.
293 * @param cbBuf Size of the transfer buffer.
294 * @param pbSenseKey Status of the command (when return value is VERR_DEV_IO_ERROR).
295 * @param cTimeoutMillies Command timeout in milliseconds.
296 * @thread Any thread.
297 */
298 DECLR3CALLBACKMEMBER(int, pfnSendCmd,(PPDMIMEDIA pInterface, const uint8_t *pbCmd, PDMMEDIATXDIR enmTxDir, void *pvBuf, uint32_t *pcbBuf, uint8_t *pabSense, size_t cbSense, uint32_t cTimeoutMillies));
299
300 /**
301 * Merge medium contents during a live snapshot deletion. All details
302 * must have been configured through CFGM or this will fail.
303 * This method is optional (i.e. the function pointer may be NULL).
304 *
305 * @returns VBox status code.
306 * @param pInterface Pointer to the interface structure containing the called function pointer.
307 * @param pfnProgress Function pointer for progress notification.
308 * @param pvUser Opaque user data for progress notification.
309 * @thread Any thread.
310 */
311 DECLR3CALLBACKMEMBER(int, pfnMerge,(PPDMIMEDIA pInterface, PFNSIMPLEPROGRESS pfnProgress, void *pvUser));
312
313 /**
314 * Sets the secret key retrieval interface to use to get secret keys.
315 *
316 * @returns VBox status code.
317 * @param pInterface Pointer to the interface structure containing the called function pointer.
318 * @param pIfSecKey The secret key interface to use.
319 * Use NULL to clear the currently set interface and clear all secret
320 * keys from the user.
321 * @param pIfSecKeyHlp The secret key helper interface to use.
322 * @thread Any thread.
323 */
324 DECLR3CALLBACKMEMBER(int, pfnSetSecKeyIf,(PPDMIMEDIA pInterface, PPDMISECKEY pIfSecKey,
325 PPDMISECKEYHLP pIfSecKeyHlp));
326
327 /**
328 * Get the media size in bytes.
329 *
330 * @returns Media size in bytes.
331 * @param pInterface Pointer to the interface structure containing the called function pointer.
332 * @thread Any thread.
333 */
334 DECLR3CALLBACKMEMBER(uint64_t, pfnGetSize,(PPDMIMEDIA pInterface));
335
336 /**
337 * Gets the media sector size in bytes.
338 *
339 * @returns Media sector size in bytes.
340 * @param pInterface Pointer to the interface structure containing the called function pointer.
341 * @thread Any thread.
342 */
343 DECLR3CALLBACKMEMBER(uint32_t, pfnGetSectorSize,(PPDMIMEDIA pInterface));
344
345 /**
346 * Check if the media is readonly or not.
347 *
348 * @returns true if readonly.
349 * @returns false if read/write.
350 * @param pInterface Pointer to the interface structure containing the called function pointer.
351 * @thread Any thread.
352 */
353 DECLR3CALLBACKMEMBER(bool, pfnIsReadOnly,(PPDMIMEDIA pInterface));
354
355 /**
356 * Get stored media geometry (physical CHS, PCHS) - BIOS property.
357 * This is an optional feature of a media.
358 *
359 * @returns VBox status code.
360 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
361 * @returns VERR_PDM_GEOMETRY_NOT_SET if the geometry hasn't been set using pfnBiosSetPCHSGeometry() yet.
362 * @param pInterface Pointer to the interface structure containing the called function pointer.
363 * @param pPCHSGeometry Pointer to PCHS geometry (cylinders/heads/sectors).
364 * @remark This has no influence on the read/write operations.
365 * @thread Any thread.
366 */
367 DECLR3CALLBACKMEMBER(int, pfnBiosGetPCHSGeometry,(PPDMIMEDIA pInterface, PPDMMEDIAGEOMETRY pPCHSGeometry));
368
369 /**
370 * Store the media geometry (physical CHS, PCHS) - BIOS property.
371 * This is an optional feature of a media.
372 *
373 * @returns VBox status code.
374 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
375 * @param pInterface Pointer to the interface structure containing the called function pointer.
376 * @param pPCHSGeometry Pointer to PCHS geometry (cylinders/heads/sectors).
377 * @remark This has no influence on the read/write operations.
378 * @thread The emulation thread.
379 */
380 DECLR3CALLBACKMEMBER(int, pfnBiosSetPCHSGeometry,(PPDMIMEDIA pInterface, PCPDMMEDIAGEOMETRY pPCHSGeometry));
381
382 /**
383 * Get stored media geometry (logical CHS, LCHS) - BIOS property.
384 * This is an optional feature of a media.
385 *
386 * @returns VBox status code.
387 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
388 * @returns VERR_PDM_GEOMETRY_NOT_SET if the geometry hasn't been set using pfnBiosSetLCHSGeometry() yet.
389 * @param pInterface Pointer to the interface structure containing the called function pointer.
390 * @param pLCHSGeometry Pointer to LCHS geometry (cylinders/heads/sectors).
391 * @remark This has no influence on the read/write operations.
392 * @thread Any thread.
393 */
394 DECLR3CALLBACKMEMBER(int, pfnBiosGetLCHSGeometry,(PPDMIMEDIA pInterface, PPDMMEDIAGEOMETRY pLCHSGeometry));
395
396 /**
397 * Store the media geometry (logical CHS, LCHS) - BIOS property.
398 * This is an optional feature of a media.
399 *
400 * @returns VBox status code.
401 * @returns VERR_NOT_IMPLEMENTED if the media doesn't support storing the geometry.
402 * @param pInterface Pointer to the interface structure containing the called function pointer.
403 * @param pLCHSGeometry Pointer to LCHS geometry (cylinders/heads/sectors).
404 * @remark This has no influence on the read/write operations.
405 * @thread The emulation thread.
406 */
407 DECLR3CALLBACKMEMBER(int, pfnBiosSetLCHSGeometry,(PPDMIMEDIA pInterface, PCPDMMEDIAGEOMETRY pLCHSGeometry));
408
409 /**
410 * Checks if the device should be visible to the BIOS or not.
411 *
412 * @returns true if the device is visible to the BIOS.
413 * @returns false if the device is not visible to the BIOS.
414 * @param pInterface Pointer to the interface structure containing the called function pointer.
415 * @thread Any thread.
416 */
417 DECLR3CALLBACKMEMBER(bool, pfnBiosIsVisible,(PPDMIMEDIA pInterface));
418
419 /**
420 * Gets the media type.
421 *
422 * @returns media type.
423 * @param pInterface Pointer to the interface structure containing the called function pointer.
424 * @thread Any thread.
425 */
426 DECLR3CALLBACKMEMBER(PDMMEDIATYPE, pfnGetType,(PPDMIMEDIA pInterface));
427
428 /**
429 * Gets the UUID of the media drive.
430 *
431 * @returns VBox status code.
432 * @param pInterface Pointer to the interface structure containing the called function pointer.
433 * @param pUuid Where to store the UUID on success.
434 * @thread Any thread.
435 */
436 DECLR3CALLBACKMEMBER(int, pfnGetUuid,(PPDMIMEDIA pInterface, PRTUUID pUuid));
437
438 /**
439 * Discards the given range.
440 *
441 * @returns VBox status code.
442 * @param pInterface Pointer to the interface structure containing the called function pointer.
443 * @param paRanges Array of ranges to discard.
444 * @param cRanges Number of entries in the array.
445 * @thread Any thread.
446 */
447 DECLR3CALLBACKMEMBER(int, pfnDiscard,(PPDMIMEDIA pInterface, PCRTRANGE paRanges, unsigned cRanges));
448
449 /**
450 * Allocate buffer memory which is suitable for I/O and might have special proerties for secure
451 * environments (non-pageable memory for sensitive data which should not end up on the disk).
452 *
453 * @returns VBox status code.
454 * @param pInterface Pointer to the interface structure containing the called function pointer.
455 * @param cb Amount of memory to allocate.
456 * @param ppvNew Where to store the pointer to the buffer on success.
457 */
458 DECLR3CALLBACKMEMBER(int, pfnIoBufAlloc, (PPDMIMEDIA pInterface, size_t cb, void **ppvNew));
459
460 /**
461 * Free memory allocated with PDMIMEDIA::pfnIoBufAlloc().
462 *
463 * @returns VBox status code.
464 * @param pInterface Pointer to the interface structure containing the called function pointer.
465 * @param pv Pointer to the memory to free.
466 * @param cb Amount of bytes given in PDMIMEDIA::pfnIoBufAlloc().
467 */
468 DECLR3CALLBACKMEMBER(int, pfnIoBufFree, (PPDMIMEDIA pInterface, void *pv, size_t cb));
469
470} PDMIMEDIA;
471/** PDMIMEDIA interface ID. */
472#define PDMIMEDIA_IID "352f2fa2-52c0-4e51-ba3c-9f59b7043218"
473
474
475/**
476 * Opaque I/O request handle.
477 *
478 * The specific content depends on the driver implementing this interface.
479 */
480typedef struct PDMMEDIAEXIOREQINT *PDMMEDIAEXIOREQ;
481/** Pointer to an I/O request handle. */
482typedef PDMMEDIAEXIOREQ *PPDMMEDIAEXIOREQ;
483
484/** A I/O request ID. */
485typedef uint64_t PDMMEDIAEXIOREQID;
486
487/**
488 * I/O Request Type.
489 */
490typedef enum PDMMEDIAEXIOREQTYPE
491{
492 /** Invalid tpe. */
493 PDMMEDIAEXIOREQTYPE_INVALID = 0,
494 /** Flush request. */
495 PDMMEDIAEXIOREQTYPE_FLUSH,
496 /** Write request. */
497 PDMMEDIAEXIOREQTYPE_WRITE,
498 /** Read request. */
499 PDMMEDIAEXIOREQTYPE_READ,
500 /** Discard request. */
501 PDMMEDIAEXIOREQTYPE_DISCARD
502} PDMMEDIAEXIOREQTYPE;
503/** Pointer to a I/O request type. */
504typedef PDMMEDIAEXIOREQTYPE *PPDMMEDIAEXIOREQTYPE;
505
506/**
507 * Data direction for raw SCSI commands.
508 */
509typedef enum PDMMEDIAEXIOREQSCSITXDIR
510{
511 /** Invalid data direction. */
512 PDMMEDIAEXIOREQSCSITXDIR_INVALID = 0,
513 /** Direction is unknown. */
514 PDMMEDIAEXIOREQSCSITXDIR_UNKNOWN,
515 /** Direction is from device to host. */
516 PDMMEDIAEXIOREQSCSITXDIR_FROM_DEVICE,
517 /** Direction is from host to device. */
518 PDMMEDIAEXIOREQSCSITXDIR_TO_DEVICE,
519 /** No data transfer associated with this request. */
520 PDMMEDIAEXIOREQSCSITXDIR_NONE,
521 /** 32bit hack. */
522 PDMMEDIAEXIOREQSCSITXDIR_32BIT_HACK = 0x7fffffff
523} PDMMEDIAEXIOREQSCSITXDIR;
524
525/**
526 * I/O request state.
527 */
528typedef enum PDMMEDIAEXIOREQSTATE
529{
530 /** Invalid state. */
531 PDMMEDIAEXIOREQSTATE_INVALID = 0,
532 /** The request is active and being processed. */
533 PDMMEDIAEXIOREQSTATE_ACTIVE,
534 /** The request is suspended due to an error and no processing will take place. */
535 PDMMEDIAEXIOREQSTATE_SUSPENDED,
536 /** 32bit hack. */
537 PDMMEDIAEXIOREQSTATE_32BIT_HACK = 0x7fffffff
538} PDMMEDIAEXIOREQSTATE;
539/** Pointer to a I/O request state. */
540typedef PDMMEDIAEXIOREQSTATE *PPDMMEDIAEXIOREQSTATE;
541
542/** @name Supported feature flags
543 * @{ */
544/** I/O requests will execute asynchronously by default. */
545#define PDMIMEDIAEX_FEATURE_F_ASYNC RT_BIT_32(0)
546/** The discard request is supported. */
547#define PDMIMEDIAEX_FEATURE_F_DISCARD RT_BIT_32(1)
548/** The send raw SCSI command request is supported. */
549#define PDMIMEDIAEX_FEATURE_F_RAWSCSICMD RT_BIT_32(2)
550/** Mask of valid flags. */
551#define PDMIMEDIAEX_FEATURE_F_VALID (PDMIMEDIAEX_FEATURE_F_ASYNC | PDMIMEDIAEX_FEATURE_F_DISCARD | PDMIMEDIAEX_FEATURE_F_RAWSCSICMD)
552/** @} */
553
554/** @name I/O request specific flags
555 * @{ */
556/** Default behavior (async I/O).*/
557#define PDMIMEDIAEX_F_DEFAULT (0)
558/** The I/O request will be executed synchronously. */
559#define PDMIMEDIAEX_F_SYNC RT_BIT_32(0)
560/** Whether to suspend the VM on a recoverable error with
561 * an appropriate error message (disk full, etc.).
562 * The request will be retried by the driver implementing the interface
563 * when the VM resumes the next time. However before suspending the request
564 * the owner of the request will be notified using the PDMMEDIAEXPORT::pfnIoReqStateChanged.
565 * The same goes for resuming the request after the VM was resumed.
566 */
567#define PDMIMEDIAEX_F_SUSPEND_ON_RECOVERABLE_ERR RT_BIT_32(1)
568 /** Mask of valid flags. */
569#define PDMIMEDIAEX_F_VALID (PDMIMEDIAEX_F_SYNC | PDMIMEDIAEX_F_SUSPEND_ON_RECOVERABLE_ERR)
570/** @} */
571
572/** Pointer to an extended media notification interface. */
573typedef struct PDMIMEDIAEXPORT *PPDMIMEDIAEXPORT;
574
575/**
576 * Asynchronous version of the media interface (up).
577 * Pair with PDMIMEDIAEXPORT.
578 */
579typedef struct PDMIMEDIAEXPORT
580{
581 /**
582 * Notify completion of a I/O request.
583 *
584 * @returns VBox status code.
585 * @param pInterface Pointer to the interface structure containing the called function pointer.
586 * @param hIoReq The I/O request handle.
587 * @param pvIoReqAlloc The allocator specific memory for this request.
588 * @param rcReq IPRT Status code of the completed request.
589 * VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
590 * PDMIMEDIAEX::pfnIoReqCancel.
591 * @thread Any thread.
592 */
593 DECLR3CALLBACKMEMBER(int, pfnIoReqCompleteNotify, (PPDMIMEDIAEXPORT pInterface, PDMMEDIAEXIOREQ hIoReq,
594 void *pvIoReqAlloc, int rcReq));
595
596 /**
597 * Copy data from the memory buffer of the caller to the callees memory buffer for the given request.
598 *
599 * @returns VBox status code.
600 * @retval VERR_PDM_MEDIAEX_IOBUF_OVERFLOW if there is not enough room to store the data.
601 * @param pInterface Pointer to the interface structure containing the called function pointer.
602 * @param hIoReq The I/O request handle.
603 * @param pvIoReqAlloc The allocator specific memory for this request.
604 * @param offDst The destination offset from the start to write the data to.
605 * @param pSgBuf The S/G buffer to read the data from.
606 * @param cbCopy How many bytes to copy.
607 */
608 DECLR3CALLBACKMEMBER(int, pfnIoReqCopyFromBuf, (PPDMIMEDIAEXPORT pInterface, PDMMEDIAEXIOREQ hIoReq,
609 void *pvIoReqAlloc, uint32_t offDst, PRTSGBUF pSgBuf,
610 size_t cbCopy));
611
612 /**
613 * Copy data to the memory buffer of the caller from the callees memory buffer for the given request.
614 *
615 * @returns VBox status code.
616 * @retval VERR_PDM_MEDIAEX_IOBUF_UNDERRUN if there is not enough data to copy from the buffer.
617 * @param pInterface Pointer to the interface structure containing the called function pointer.
618 * @param hIoReq The I/O request handle.
619 * @param pvIoReqAlloc The allocator specific memory for this request.
620 * @param offSrc The offset from the start of the buffer to read the data from.
621 * @param pSgBuf The S/G buffer to write the data to.
622 * @param cbCopy How many bytes to copy.
623 */
624 DECLR3CALLBACKMEMBER(int, pfnIoReqCopyToBuf, (PPDMIMEDIAEXPORT pInterface, PDMMEDIAEXIOREQ hIoReq,
625 void *pvIoReqAlloc, uint32_t offSrc, PRTSGBUF pSgBuf,
626 size_t cbCopy));
627
628 /**
629 * Queries the specified amount of ranges to discard from the callee for the given I/O request.
630 *
631 * @returns VBox status code.
632 * @param pInterface Pointer to the interface structure containing the called function pointer.
633 * @param hIoReq The I/O request handle.
634 * @param pvIoReqAlloc The allocator specific memory for this request.
635 * @param idxRangeStart The range index to start with.
636 * @param cRanges How man ranges can be stored in the provided array.
637 * @param paRanges Where to store the ranges on success.
638 * @param *pcRanges Where to store the number of ranges copied over on success.
639 */
640 DECLR3CALLBACKMEMBER(int, pfnIoReqQueryDiscardRanges, (PPDMIMEDIAEXPORT pInterface, PDMMEDIAEXIOREQ hIoReq,
641 void *pvIoReqAlloc, uint32_t idxRangeStart,
642 uint32_t cRanges, PRTRANGE paRanges,
643 uint32_t *pcRanges));
644
645 /**
646 * Notify the request owner about a state change for the request.
647 *
648 * @returns nothing.
649 * @param pInterface Pointer to the interface structure containing the called function pointer.
650 * @param hIoReq The I/O request handle.
651 * @param pvIoReqAlloc The allocator specific memory for this request.
652 * @param enmState The new state of the request.
653 */
654 DECLR3CALLBACKMEMBER(void, pfnIoReqStateChanged, (PPDMIMEDIAEXPORT pInterface, PDMMEDIAEXIOREQ hIoReq,
655 void *pvIoReqAlloc, PDMMEDIAEXIOREQSTATE enmState));
656
657} PDMIMEDIAEXPORT;
658
659/** PDMIMEDIAAEXPORT interface ID. */
660#define PDMIMEDIAEXPORT_IID "253e3741-9d79-4a8b-9a1d-81f4a16054a7"
661
662
663/** Pointer to an extended media interface. */
664typedef struct PDMIMEDIAEX *PPDMIMEDIAEX;
665
666/**
667 * Extended version of PDMIMEDIA (down).
668 * Pair with PDMIMEDIAEXPORT.
669 */
670typedef struct PDMIMEDIAEX
671{
672 /**
673 * Queries the features supported by the entity implementing this interface.
674 *
675 * @returns VBox status code.
676 * @param pInterface Pointer to the interface structure containing the called function pointer.
677 * @param pfFeatures Where to store the supported feature flags on success.
678 */
679 DECLR3CALLBACKMEMBER(int, pfnQueryFeatures, (PPDMIMEDIAEX pInterface, uint32_t *pfFeatures));
680
681 /**
682 * Sets the size of the allocator specific memory for a I/O request.
683 *
684 * @returns VBox status code.
685 * @param pInterface Pointer to the interface structure containing the called function pointer.
686 * @param cbIoReqAlloc The size of the allocator specific memory in bytes.
687 * @thread EMT.
688 */
689 DECLR3CALLBACKMEMBER(int, pfnIoReqAllocSizeSet, (PPDMIMEDIAEX pInterface, size_t cbIoReqAlloc));
690
691 /**
692 * Allocates a new I/O request.
693 *
694 * @returns VBox status code.
695 * @retval VERR_PDM_MEDIAEX_IOREQID_CONFLICT if the ID belongs to a still active request.
696 * @param pInterface Pointer to the interface structure containing the called function pointer.
697 * @param phIoReq Where to store the handle to the new I/O request on success.
698 * @param ppvIoReqAlloc Where to store the pointer to the allocator specific memory on success.
699 * NULL if the memory size was not set or set to 0.
700 * @param uIoReqId A custom request ID which can be used to cancel the request.
701 * @param fFlags A combination of PDMIMEDIAEX_F_* flags.
702 * @thread Any thread.
703 */
704 DECLR3CALLBACKMEMBER(int, pfnIoReqAlloc, (PPDMIMEDIAEX pInterface, PPDMMEDIAEXIOREQ phIoReq, void **ppvIoReqAlloc,
705 PDMMEDIAEXIOREQID uIoReqId, uint32_t fFlags));
706
707 /**
708 * Frees a given I/O request.
709 *
710 * @returns VBox status code.
711 * @retval VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE if the given request is still active.
712 * @param pInterface Pointer to the interface structure containing the called function pointer.
713 * @param hIoReq The I/O request to free.
714 * @thread Any thread.
715 */
716 DECLR3CALLBACKMEMBER(int, pfnIoReqFree, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq));
717
718 /**
719 * Queries the residual amount of data not transfered when the request completed.
720 *
721 * @returns VBox status code.
722 * @retval VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE has not completed yet.
723 * @param pInterface Pointer to the interface structure containing the called function pointer.
724 * @param hIoReq The I/O request.
725 * @param pcbResidual Where to store the amount of resdiual data in bytes.
726 * @thread Any thread.
727 */
728 DECLR3CALLBACKMEMBER(int, pfnIoReqQueryResidual, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, size_t *pcbResidual));
729
730 /**
731 * Cancels all I/O active requests.
732 *
733 * @returns VBox status code.
734 * @param pInterface Pointer to the interface structure containing the called function pointer.
735 * @thread Any thread.
736 */
737 DECLR3CALLBACKMEMBER(int, pfnIoReqCancelAll, (PPDMIMEDIAEX pInterface));
738
739 /**
740 * Cancels a I/O request identified by the ID.
741 *
742 * @returns VBox status code.
743 * @retval VERR_PDM_MEDIAEX_IOREQID_NOT_FOUND if the given ID could not be found in the active request list.
744 * (The request has either completed already or an invalid ID was given).
745 * @param pInterface Pointer to the interface structure containing the called function pointer.
746 * @param uIoReqId The I/O request ID
747 * @thread Any thread.
748 */
749 DECLR3CALLBACKMEMBER(int, pfnIoReqCancel, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQID uIoReqId));
750
751 /**
752 * Start a reading request.
753 *
754 * @returns VBox status code.
755 * @retval VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
756 * PDMIMEDIAEX::pfnIoReqCancel.
757 * @retval VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS if the request was successfully submitted but is still in progress.
758 * Completion will be notified through PDMIMEDIAEXPORT::pfnIoReqCompleteNotify with the appropriate status code.
759 * @retval VINF_SUCCESS if the request completed successfully.
760 * @param pInterface Pointer to the interface structure containing the called function pointer.
761 * @param hIoReq The I/O request to associate the read with.
762 * @param off Offset to start reading from. Must be aligned to a sector boundary.
763 * @param cbRead Number of bytes to read. Must be aligned to a sector boundary.
764 * @thread Any thread.
765 */
766 DECLR3CALLBACKMEMBER(int, pfnIoReqRead, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, uint64_t off, size_t cbRead));
767
768 /**
769 * Start a writing request.
770 *
771 * @returns VBox status code.
772 * @retval VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
773 * PDMIMEDIAEX::pfnIoReqCancel.
774 * @retval VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS if the request was successfully submitted but is still in progress.
775 * Completion will be notified through PDMIMEDIAEXPORT::pfnIoReqCompleteNotify with the appropriate status code.
776 * @retval VINF_SUCCESS if the request completed successfully.
777 * @param pInterface Pointer to the interface structure containing the called function pointer.
778 * @param hIoReq The I/O request to associate the write with.
779 * @param off Offset to start reading from. Must be aligned to a sector boundary.
780 * @param cbWrite Number of bytes to write. Must be aligned to a sector boundary.
781 * @thread Any thread.
782 */
783 DECLR3CALLBACKMEMBER(int, pfnIoReqWrite, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, uint64_t off, size_t cbWrite));
784
785 /**
786 * Flush everything to disk.
787 *
788 * @returns VBox status code.
789 * @retval VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
790 * PDMIMEDIAEX::pfnIoReqCancel.
791 * @retval VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS if the request was successfully submitted but is still in progress.
792 * Completion will be notified through PDMIMEDIAEXPORT::pfnIoReqCompleteNotify with the appropriate status code.
793 * @retval VINF_SUCCESS if the request completed successfully.
794 * @param pInterface Pointer to the interface structure containing the called function pointer.
795 * @param hIoReq The I/O request to associate the flush with.
796 * @thread Any thread.
797 */
798 DECLR3CALLBACKMEMBER(int, pfnIoReqFlush, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq));
799
800 /**
801 * Discards the given range.
802 *
803 * @returns VBox status code.
804 * @retval VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
805 * PDMIMEDIAEX::pfnIoReqCancel.
806 * @retval VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS if the request was successfully submitted but is still in progress.
807 * Completion will be notified through PDMIMEDIAEXPORT::pfnIoReqCompleteNotify with the appropriate status code.
808 * @retval VINF_SUCCESS if the request completed successfully.
809 * @param pInterface Pointer to the interface structure containing the called function pointer.
810 * @param hIoReq The I/O request to associate the discard with.
811 * @param cRangesMax The maximum number of ranges this request has associated, this must not be accurate
812 * but can actually be bigger than the amount of ranges actually available.
813 * @thread Any thread.
814 */
815 DECLR3CALLBACKMEMBER(int, pfnIoReqDiscard, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, unsigned cRangesMax));
816
817 /**
818 * Send a raw command to the underlying device (CDROM).
819 *
820 * @returns VBox status code.
821 * @retval VERR_PDM_MEDIAEX_IOREQ_CANCELED if the request was canceled by a call to
822 * PDMIMEDIAEX::pfnIoReqCancel.
823 * @retval VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS if the request was successfully submitted but is still in progress.
824 * Completion will be notified through PDMIMEDIAEXPORT::pfnIoReqCompleteNotify with the appropriate status code.
825 * @param pInterface Pointer to the interface structure containing the called function pointer.
826 * @param hIoReq The I/O request to associate the command with.
827 * @param uLun The LUN the command is for.
828 * @param pbCdb The SCSI CDB containing the command.
829 * @param cbCdb Size of the CDB in bytes.
830 * @param enmTxDir Direction of transfer.
831 * @param pvBuf Pointer tp the transfer buffer.
832 * @param cbBuf Size of the transfer buffer.
833 * @param pbSenseKey Status of the command (when return value is VERR_DEV_IO_ERROR).
834 * @param cTimeoutMillies Command timeout in milliseconds.
835 * @thread Any thread.
836 */
837 DECLR3CALLBACKMEMBER(int, pfnIoReqSendScsiCmd,(PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, uint32_t uLun,
838 const uint8_t *pbCdb, size_t cbCdb, PDMMEDIAEXIOREQSCSITXDIR enmTxDir,
839 size_t cbBuf, uint8_t *pabSense, size_t cbSense, uint32_t cTimeoutMillies));
840
841 /**
842 * Returns the number of active I/O requests.
843 *
844 * @returns Number of active I/O requests.
845 * @param pInterface Pointer to the interface structure containing the called function pointer.
846 * @thread Any thread.
847 */
848 DECLR3CALLBACKMEMBER(uint32_t, pfnIoReqGetActiveCount, (PPDMIMEDIAEX pInterface));
849
850 /**
851 * Returns the number of suspended requests.
852 *
853 * @returns Number of suspended I/O requests.
854 * @param pInterface Pointer to the interface structure containing the called function pointer.
855 * @thread Any thread.
856 */
857 DECLR3CALLBACKMEMBER(uint32_t, pfnIoReqGetSuspendedCount, (PPDMIMEDIAEX pInterface));
858
859 /**
860 * Gets the first suspended request handle.
861 *
862 * @returns VBox status code.
863 * @retval VERR_NOT_FOUND if there is no suspended request waiting.
864 * @param pInterface Pointer to the interface structure containing the called function pointer.
865 * @param phIoReq Where to store the request handle on success.
866 * @param ppvIoReqAlloc Where to store the pointer to the allocator specific memory on success.
867 * @thread Any thread.
868 *
869 * @note This should only be called when the VM is suspended to make sure the request doesn't suddenly
870 * changes into the active state again. The only purpose for this method for now is to make saving the state
871 * possible without breaking saved state versions.
872 */
873 DECLR3CALLBACKMEMBER(int, pfnIoReqQuerySuspendedStart, (PPDMIMEDIAEX pInterface, PPDMMEDIAEXIOREQ phIoReq, void **ppvIoReqAlloc));
874
875 /**
876 * Gets the next suspended request handle.
877 *
878 * @returns VBox status code.
879 * @retval VERR_NOT_FOUND if there is no suspended request waiting.
880 * @param pInterface Pointer to the interface structure containing the called function pointer.
881 * @param hIoReq The current request handle.
882 * @param phIoReqNext Where to store the request handle on success.
883 * @param ppvIoReqAllocNext Where to store the pointer to the allocator specific memory on success.
884 * @thread Any thread.
885 *
886 * @note This should only be called when the VM is suspended to make sure the request doesn't suddenly
887 * changes into the active state again. The only purpose for this method for now is to make saving the state
888 * possible without breaking saved state versions.
889 */
890 DECLR3CALLBACKMEMBER(int, pfnIoReqQuerySuspendedNext, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq,
891 PPDMMEDIAEXIOREQ phIoReqNext, void **ppvIoReqAllocNext));
892
893 /**
894 * Saves the given I/O request state in the provided saved state unit.
895 *
896 * @returns VBox status code.
897 * @param pInterface Pointer to the interface structure containing the called function pointer.
898 * @param pSSM The SSM handle.
899 * @param hIoReq The request handle to save.
900 */
901 DECLR3CALLBACKMEMBER(int, pfnIoReqSuspendedSave, (PPDMIMEDIAEX pInterface, PSSMHANDLE pSSM, PDMMEDIAEXIOREQ hIoReq));
902
903 /**
904 * Load a suspended request state from the given saved state unit and link it into the suspended list.
905 *
906 * @returns VBox status code.
907 * @param pInterface Pointer to the interface structure containing the called function pointer.
908 * @param pSSM The SSM handle to read the state from.
909 * @param hIoReq The request handle to load the state into.
910 */
911 DECLR3CALLBACKMEMBER(int, pfnIoReqSuspendedLoad, (PPDMIMEDIAEX pInterface, PSSMHANDLE pSSM, PDMMEDIAEXIOREQ hIoReq));
912
913} PDMIMEDIAEX;
914/** PDMIMEDIAEX interface ID. */
915#define PDMIMEDIAEX_IID "d4c66196-13f0-433d-8e87-e4b957cb0194"
916
917/**
918 * Data direction.
919 */
920typedef enum PDMSCSIREQUESTTXDIR
921{
922 PDMSCSIREQUESTTXDIR_UNKNOWN = 0x00,
923 PDMSCSIREQUESTTXDIR_FROM_DEVICE = 0x01,
924 PDMSCSIREQUESTTXDIR_TO_DEVICE = 0x02,
925 PDMSCSIREQUESTTXDIR_NONE = 0x03,
926 PDMSCSIREQUESTTXDIR_32BIT_HACK = 0x7fffffff
927} PDMSCSIREQUESTTXDIR;
928
929/**
930 * SCSI request structure.
931 */
932typedef struct PDMSCSIREQUEST
933{
934 /** The logical unit. */
935 uint32_t uLogicalUnit;
936 /** Direction of the data flow. */
937 PDMSCSIREQUESTTXDIR uDataDirection;
938 /** Size of the SCSI CDB. */
939 uint32_t cbCDB;
940 /** Pointer to the SCSI CDB. */
941 uint8_t *pbCDB;
942 /** Overall size of all scatter gather list elements
943 * for data transfer if any. */
944 uint32_t cbScatterGather;
945 /** Number of elements in the scatter gather list. */
946 uint32_t cScatterGatherEntries;
947 /** Pointer to the head of the scatter gather list. */
948 PRTSGSEG paScatterGatherHead;
949 /** Size of the sense buffer. */
950 uint32_t cbSenseBuffer;
951 /** Pointer to the sense buffer. *
952 * Current assumption that the sense buffer is not scattered. */
953 uint8_t *pbSenseBuffer;
954 /** Opaque user data for use by the device. Left untouched by everything else! */
955 void *pvUser;
956} PDMSCSIREQUEST, *PPDMSCSIREQUEST;
957/** Pointer to a const SCSI request structure. */
958typedef const PDMSCSIREQUEST *PCSCSIREQUEST;
959
960/** Pointer to a SCSI port interface. */
961typedef struct PDMISCSIPORT *PPDMISCSIPORT;
962/**
963 * SCSI command execution port interface (down).
964 * Pair with PDMISCSICONNECTOR.
965 */
966typedef struct PDMISCSIPORT
967{
968
969 /**
970 * Notify the device on request completion.
971 *
972 * @returns VBox status code.
973 * @param pInterface Pointer to this interface.
974 * @param pSCSIRequest Pointer to the finished SCSI request.
975 * @param rcCompletion SCSI_STATUS_* code for the completed request.
976 * @param fRedo Flag whether the request can to be redone
977 * when it failed.
978 * @param rcReq The status code the request completed with (VERR_*)
979 * Should be only used to choose the correct error message
980 * displayed to the user if the error can be fixed by him
981 * (fRedo is true).
982 */
983 DECLR3CALLBACKMEMBER(int, pfnSCSIRequestCompleted, (PPDMISCSIPORT pInterface, PPDMSCSIREQUEST pSCSIRequest,
984 int rcCompletion, bool fRedo, int rcReq));
985
986 /**
987 * Returns the storage controller name, instance and LUN of the attached medium.
988 *
989 * @returns VBox status.
990 * @param pInterface Pointer to this interface.
991 * @param ppcszController Where to store the name of the storage controller.
992 * @param piInstance Where to store the instance number of the controller.
993 * @param piLUN Where to store the LUN of the attached device.
994 */
995 DECLR3CALLBACKMEMBER(int, pfnQueryDeviceLocation, (PPDMISCSIPORT pInterface, const char **ppcszController,
996 uint32_t *piInstance, uint32_t *piLUN));
997
998} PDMISCSIPORT;
999/** PDMISCSIPORT interface ID. */
1000#define PDMISCSIPORT_IID "05d9fc3b-e38c-4b30-8344-a323feebcfe5"
1001
1002/**
1003 * LUN type.
1004 */
1005typedef enum PDMSCSILUNTYPE
1006{
1007 PDMSCSILUNTYPE_INVALID = 0,
1008 PDMSCSILUNTYPE_SBC, /** Hard disk (SBC) */
1009 PDMSCSILUNTYPE_MMC, /** CD/DVD drive (MMC) */
1010 PDMSCSILUNTYPE_SSC, /** Tape drive (SSC) */
1011 PDMSCSILUNTYPE_32BIT_HACK = 0x7fffffff
1012} PDMSCSILUNTYPE, *PPDMSCSILUNTYPE;
1013
1014
1015/** Pointer to a SCSI connector interface. */
1016typedef struct PDMISCSICONNECTOR *PPDMISCSICONNECTOR;
1017/**
1018 * SCSI command execution connector interface (up).
1019 * Pair with PDMISCSIPORT.
1020 */
1021typedef struct PDMISCSICONNECTOR
1022{
1023
1024 /**
1025 * Submits a SCSI request for execution.
1026 *
1027 * @returns VBox status code.
1028 * @param pInterface Pointer to this interface.
1029 * @param pSCSIRequest Pointer to the SCSI request to execute.
1030 */
1031 DECLR3CALLBACKMEMBER(int, pfnSCSIRequestSend, (PPDMISCSICONNECTOR pInterface, PPDMSCSIREQUEST pSCSIRequest));
1032
1033 /**
1034 * Queries the type of the attached LUN.
1035 *
1036 * @returns VBox status code.
1037 * @param pInterface Pointer to this interface.
1038 * @param iLUN The logical unit number.
1039 * @param pSCSIRequest Pointer to the LUN to be returned.
1040 */
1041 DECLR3CALLBACKMEMBER(int, pfnQueryLUNType, (PPDMISCSICONNECTOR pInterface, uint32_t iLun, PPDMSCSILUNTYPE pLUNType));
1042
1043} PDMISCSICONNECTOR;
1044/** PDMISCSICONNECTOR interface ID. */
1045#define PDMISCSICONNECTOR_IID "94465fbd-a2f2-447e-88c9-7366421bfbfe"
1046
1047/** @} */
1048
1049RT_C_DECLS_END
1050
1051#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