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