1 | /* $Id: ATAPIPassthrough.h 62506 2016-07-22 19:09:44Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox storage devices: ATAPI passthrough helpers (common code for DevATA and DevAHCI).
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012-2016 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 | #ifndef __ATAPIPassthrough_h
|
---|
18 | #define __ATAPIPassthrough_h
|
---|
19 |
|
---|
20 | #include <VBox/cdefs.h>
|
---|
21 |
|
---|
22 | RT_C_DECLS_BEGIN
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * Opaque media track list.
|
---|
26 | */
|
---|
27 | typedef struct TRACKLIST *PTRACKLIST;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Creates an empty track list handle.
|
---|
31 | *
|
---|
32 | * @returns VBox status code.
|
---|
33 | * @param ppTrackList Where to store the track list handle on success.
|
---|
34 | */
|
---|
35 | DECLHIDDEN(int) ATAPIPassthroughTrackListCreateEmpty(PTRACKLIST *ppTrackList);
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * Destroys the allocated task list handle.
|
---|
39 | *
|
---|
40 | * @returns nothing.
|
---|
41 | * @param pTrackList The track list handle to destroy.
|
---|
42 | */
|
---|
43 | DECLHIDDEN(void) ATAPIPassthroughTrackListDestroy(PTRACKLIST pTrackList);
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * Clears all tracks from the given task list.
|
---|
47 | *
|
---|
48 | * @returns nothing.
|
---|
49 | * @param pTrackList The track list to clear.
|
---|
50 | */
|
---|
51 | DECLHIDDEN(void) ATAPIPassthroughTrackListClear(PTRACKLIST pTrackList);
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * Updates the track list from the given CDB and data buffer.
|
---|
55 | *
|
---|
56 | * @returns VBox status code.
|
---|
57 | * @param pTrackList The track list to update.
|
---|
58 | * @param pCDB The CDB buffer.
|
---|
59 | * @param pvBuf The data buffer.
|
---|
60 | */
|
---|
61 | DECLHIDDEN(int) ATAPIPassthroughTrackListUpdate(PTRACKLIST pTrackList, const uint8_t *pCDB, const void *pvBuf);
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * Return the sector size from the track matching the LBA in the given track list.
|
---|
65 | *
|
---|
66 | * @returns Sector size.
|
---|
67 | * @param pTrackList The track list to use.
|
---|
68 | * @param iAtapiLba The start LBA to get the sector size for.
|
---|
69 | */
|
---|
70 | DECLHIDDEN(uint32_t) ATAPIPassthroughTrackListGetSectorSizeFromLba(PTRACKLIST pTrackList, uint32_t iAtapiLba);
|
---|
71 |
|
---|
72 | RT_C_DECLS_END
|
---|
73 |
|
---|
74 | #endif /* __ATAPIPassthrough_h */
|
---|