]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | EFI_TAPE_IO_PROTOCOL as defined in the UEFI 2.0.\r | |
3 | Provide services to control and access a tape device.\r | |
4 | \r | |
5 | Copyright (c) 2006 - 2008, Intel Corporation \r | |
6 | All rights reserved. This program and the accompanying materials \r | |
7 | are licensed and made available under the terms and conditions of the BSD License \r | |
8 | which accompanies this distribution. The full text of the license may be found at \r | |
9 | http://opensource.org/licenses/bsd-license.php \r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __EFI_TAPE_IO_PROTOCOL_H__\r | |
17 | #define __EFI_TAPE_IO_PROTOCOL_H__\r | |
18 | \r | |
19 | #define EFI_TAPE_IO_PROTOCOL_GUID \\r | |
20 | { \\r | |
21 | 0x1e93e633, 0xd65a, 0x459e, {0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \\r | |
22 | }\r | |
23 | \r | |
24 | typedef struct _EFI_TAPE_IO_PROTOCOL EFI_TAPE_IO_PROTOCOL;\r | |
25 | \r | |
26 | typedef struct {\r | |
27 | UINT64 Signature;\r | |
28 | UINT32 Revision;\r | |
29 | UINT32 BootDescSize;\r | |
30 | UINT32 BootDescCRC;\r | |
31 | EFI_GUID TapeGUID;\r | |
32 | EFI_GUID TapeType;\r | |
33 | EFI_GUID TapeUnique;\r | |
34 | UINT32 BLLocation;\r | |
35 | UINT32 BLBlocksize;\r | |
36 | UINT32 BLFilesize;\r | |
37 | CHAR8 OSVersion[40];\r | |
38 | CHAR8 AppVersion[40];\r | |
39 | CHAR8 CreationDate[10];\r | |
40 | CHAR8 CreationTime[10];\r | |
41 | CHAR8 SystemName[256]; // UTF-8\r | |
42 | CHAR8 TapeTitle[120]; // UTF-8\r | |
43 | CHAR8 pad[468]; // pad to 1024\r | |
44 | } TAPE_HEADER;\r | |
45 | \r | |
46 | /**\r | |
47 | Reads from the tape.\r | |
48 | \r | |
49 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
50 | @param BufferSize Size of the buffer in bytes pointed to by Buffer.\r | |
51 | @param Buffer Pointer to the buffer for data to be read into.\r | |
52 | \r | |
53 | @retval EFI_SUCCESS Data was successfully transferred from the media.\r | |
54 | @retval EFI_END_OF_FILE A filemark was encountered which limited the data\r | |
55 | transferred by the read operation or the head is positioned\r | |
56 | just after a filemark.\r | |
57 | @retval EFI_NO_MEDIA No media is loaded in the device.\r | |
58 | @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not\r | |
59 | online). The transfer may be retried at a later time.\r | |
60 | @retval EFI_UNSUPPORTED The device does not support this type of transfer.\r | |
61 | @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.\r | |
62 | @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.\r | |
63 | The transfer was aborted since the current position of the\r | |
64 | media may be incorrect.\r | |
65 | @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero\r | |
66 | BufferSize or the device is operating in fixed block\r | |
67 | size mode and the BufferSize was not a multiple of\r | |
68 | device's fixed block size\r | |
69 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data\r | |
70 | from the media.\r | |
71 | \r | |
72 | **/\r | |
73 | typedef \r | |
74 | EFI_STATUS\r | |
75 | (EFIAPI *EFI_TAPE_READ)(\r | |
76 | IN EFI_TAPE_IO_PROTOCOL *This,\r | |
77 | IN OUT UINTN *BufferSize,\r | |
78 | OUT VOID *Buffer\r | |
79 | ); \r | |
80 | \r | |
81 | /**\r | |
82 | Writes to the tape.\r | |
83 | \r | |
84 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
85 | @param BufferSize Size of the buffer in bytes pointed to by Buffer.\r | |
86 | @param Buffer Pointer to the buffer for data to be written from.\r | |
87 | \r | |
88 | @retval EFI_SUCCESS Data was successfully transferred to the media.\r | |
89 | @retval EFI_END_OF_MEDIA The logical end of media has been reached. Data may have\r | |
90 | been successfully transferred to the media.\r | |
91 | @retval EFI_NO_MEDIA No media is loaded in the device.\r | |
92 | @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not\r | |
93 | online). The transfer may be retried at a later time.\r | |
94 | @retval EFI_UNSUPPORTED The device does not support this type of transfer.\r | |
95 | @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.\r | |
96 | @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.\r | |
97 | The transfer was aborted since the current position of the\r | |
98 | media may be incorrect.\r | |
99 | @retval EFI_WRITE_PROTECTED The media in the device is write-protected. The transfer\r | |
100 | was aborted since a write cannot be completed.\r | |
101 | @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero\r | |
102 | BufferSize or the device is operating in fixed block\r | |
103 | size mode and the BufferSize was not a multiple of\r | |
104 | device's fixed block size\r | |
105 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data\r | |
106 | from the media.\r | |
107 | \r | |
108 | **/\r | |
109 | typedef \r | |
110 | EFI_STATUS\r | |
111 | (EFIAPI *EFI_TAPE_WRITE)(\r | |
112 | IN EFI_TAPE_IO_PROTOCOL *This,\r | |
113 | IN UINTN *BufferSize,\r | |
114 | IN VOID *Buffer\r | |
115 | ); \r | |
116 | \r | |
117 | \r | |
118 | /**\r | |
119 | Rewinds the tape.\r | |
120 | \r | |
121 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
122 | \r | |
123 | @retval EFI_SUCCESS The media was successfully repositioned.\r | |
124 | @retval EFI_NO_MEDIA No media is loaded in the device.\r | |
125 | @retval EFI_NOT_READY Repositioning the media failed since the device was not\r | |
126 | ready (e.g. not online). The transfer may be retried at a later time.\r | |
127 | @retval EFI_UNSUPPORTED The device does not support this type of media repositioning.\r | |
128 | @retval EFI_TIMEOUT Repositioning of the media did not complete within the timeout specified.\r | |
129 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.\r | |
130 | \r | |
131 | **/\r | |
132 | typedef \r | |
133 | EFI_STATUS\r | |
134 | (EFIAPI *EFI_TAPE_REWIND)(\r | |
135 | IN EFI_TAPE_IO_PROTOCOL *This\r | |
136 | ); \r | |
137 | \r | |
138 | \r | |
139 | /**\r | |
140 | Positions the tape.\r | |
141 | \r | |
142 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
143 | @param Direction Direction and number of data blocks or filemarks to space over on media.\r | |
144 | @param Type Type of mark to space over on media.\r | |
145 | The following Type marks are mandatory:\r | |
146 | BLOCK type : 0 \r | |
147 | FILEMARK type : 1\r | |
148 | \r | |
149 | @retval EFI_SUCCESS The media was successfully repositioned.\r | |
150 | @retval EFI_END_OF_MEDIA Beginning or end of media was reached before the\r | |
151 | indicated number of data blocks or filemarks were found.\r | |
152 | @retval EFI_NO_MEDIA No media is loaded in the device.\r | |
153 | @retval EFI_NOT_READY The reposition failed since the device was not ready (e.g. not\r | |
154 | online). The reposition may be retried at a later time.\r | |
155 | @retval EFI_UNSUPPORTED The device does not support this type of repositioning.\r | |
156 | @retval EFI_TIMEOUT The repositioning failed to complete within the timeout specified.\r | |
157 | @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.\r | |
158 | Repositioning the media was aborted since the current\r | |
159 | position of the media may be incorrect.\r | |
160 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.\r | |
161 | \r | |
162 | **/\r | |
163 | typedef\r | |
164 | EFI_STATUS\r | |
165 | (EFIAPI *EFI_TAPE_SPACE)(\r | |
166 | IN EFI_TAPE_IO_PROTOCOL *This,\r | |
167 | INTN Direction,\r | |
168 | UINTN Type\r | |
169 | ); \r | |
170 | \r | |
171 | \r | |
172 | /**\r | |
173 | Writes filemarks to the media.\r | |
174 | \r | |
175 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
176 | @param Count Number of filemarks to write to the media.\r | |
177 | \r | |
178 | @retval EFI_SUCCESS Data was successfully transferred from the media.\r | |
179 | @retval EFI_NO_MEDIA No media is loaded in the device.\r | |
180 | @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not\r | |
181 | online). The transfer may be retried at a later time.\r | |
182 | @retval EFI_UNSUPPORTED The device does not support this type of repositioning.\r | |
183 | @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.\r | |
184 | @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.\r | |
185 | The transfer was aborted since the current position of the\r | |
186 | media may be incorrect.\r | |
187 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data from the media.\r | |
188 | \r | |
189 | **/\r | |
190 | typedef \r | |
191 | EFI_STATUS\r | |
192 | (EFIAPI *EFI_TAPE_WRITEFM)(\r | |
193 | IN EFI_TAPE_IO_PROTOCOL *This,\r | |
194 | IN UINTN Count\r | |
195 | ); \r | |
196 | \r | |
197 | \r | |
198 | /**\r | |
199 | Resets the tape device.\r | |
200 | \r | |
201 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
202 | @param ExtendedVerification Indicates whether the parent bus should also be reset.\r | |
203 | \r | |
204 | @retval EFI_SUCCESS The bus and/or device were successfully reset.\r | |
205 | @retval EFI_NO_MEDIA No media is loaded in the device.\r | |
206 | @retval EFI_NOT_READY The reset failed since the device and/or bus was not ready.\r | |
207 | The reset may be retried at a later time.\r | |
208 | @retval EFI_UNSUPPORTED The device does not support this type of reset.\r | |
209 | @retval EFI_TIMEOUT The reset did not complete within the timeout allowed.\r | |
210 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the bus and/or device.\r | |
211 | \r | |
212 | **/\r | |
213 | typedef \r | |
214 | EFI_STATUS\r | |
215 | (EFIAPI *EFI_TAPE_RESET)(\r | |
216 | IN EFI_TAPE_IO_PROTOCOL *This,\r | |
217 | IN BOOLEAN ExtendedVerification\r | |
218 | ); \r | |
219 | \r | |
220 | ///\r | |
221 | /// The EFI_TAPE_IO_PROTOCOL provides basic sequential operations for tape devices. \r | |
222 | /// These include read, write, rewind, space, write filemarks and reset functions. \r | |
223 | /// Per this specification, a boot application uses the services of this protocol \r | |
224 | /// to load the bootloader image from tape.\r | |
225 | ///\r | |
226 | struct _EFI_TAPE_IO_PROTOCOL {\r | |
227 | EFI_TAPE_READ TapeRead;\r | |
228 | EFI_TAPE_WRITE TapeWrite;\r | |
229 | EFI_TAPE_REWIND TapeRewind;\r | |
230 | EFI_TAPE_SPACE TapeSpace;\r | |
231 | EFI_TAPE_WRITEFM TapeWriteFM;\r | |
232 | EFI_TAPE_RESET TapeReset;\r | |
233 | };\r | |
234 | \r | |
235 | extern EFI_GUID gEfiTapeIoProtocolGuid;\r | |
236 | \r | |
237 | #endif\r |