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