]>
Commit | Line | Data |
---|---|---|
d1f95000 | 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 | |
d1f95000 | 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 | /**\r | |
83 | Writes to the tape.\r | |
84 | \r | |
85 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
86 | @param BufferSize Size of the buffer in bytes pointed to by Buffer.\r | |
87 | @param Buffer Pointer to the buffer for data to be written from.\r | |
88 | \r | |
89 | @retval EFI_SUCCESS Data was successfully transferred to the media.\r | |
90 | @retval EFI_END_OF_MEDIA The logical end of media has been reached. Data may have\r | |
91 | been successfully transferred to the media.\r | |
92 | @retval EFI_NO_MEDIA No media is loaded in the device.\r | |
93 | @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not\r | |
94 | online). The transfer may be retried at a later time.\r | |
95 | @retval EFI_UNSUPPORTED The device does not support this type of transfer.\r | |
96 | @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.\r | |
97 | @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.\r | |
98 | The transfer was aborted since the current position of the\r | |
99 | media may be incorrect.\r | |
100 | @retval EFI_WRITE_PROTECTED The media in the device is write-protected. The transfer\r | |
101 | was aborted since a write cannot be completed.\r | |
102 | @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero\r | |
103 | BufferSize or the device is operating in fixed block\r | |
104 | size mode and the BufferSize was not a multiple of\r | |
105 | device's fixed block size\r | |
106 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data\r | |
107 | from the media.\r | |
108 | \r | |
109 | **/\r | |
110 | typedef \r | |
111 | EFI_STATUS\r | |
112 | (EFIAPI *EFI_TAPE_WRITE) (\r | |
113 | IN EFI_TAPE_IO_PROTOCOL *This,\r | |
114 | IN UINTN *BufferSize,\r | |
115 | IN VOID *Buffer\r | |
116 | )\r | |
117 | ; \r | |
118 | \r | |
119 | \r | |
120 | /**\r | |
121 | Rewinds the tape.\r | |
122 | \r | |
123 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
124 | \r | |
125 | @retval EFI_SUCCESS The media was successfully repositioned.\r | |
126 | @retval EFI_NO_MEDIA No media is loaded in the device.\r | |
127 | @retval EFI_NOT_READY Repositioning the media failed since the device was not\r | |
128 | ready (e.g. not online). The transfer may be retried at a later time.\r | |
129 | @retval EFI_UNSUPPORTED The device does not support this type of media repositioning.\r | |
130 | @retval EFI_TIMEOUT Repositioning of the media did not complete within the timeout specified.\r | |
131 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.\r | |
132 | \r | |
133 | **/\r | |
134 | typedef \r | |
135 | EFI_STATUS\r | |
136 | (EFIAPI *EFI_TAPE_REWIND) (\r | |
137 | IN EFI_TAPE_IO_PROTOCOL *This\r | |
138 | )\r | |
139 | ; \r | |
140 | \r | |
141 | \r | |
142 | /**\r | |
143 | Positions the tape.\r | |
144 | \r | |
145 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
146 | @param Direction Direction and number of data blocks or filemarks to space over on media.\r | |
147 | @param Type Type of mark to space over on media.\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 | /**\r | |
174 | Writes filemarks to the media.\r | |
175 | \r | |
176 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
177 | @param Count Number of filemarks to write to the media.\r | |
178 | \r | |
179 | @retval EFI_SUCCESS Data was successfully transferred from the media.\r | |
180 | @retval EFI_NO_MEDIA No media is loaded in the device.\r | |
181 | @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not\r | |
182 | online). The transfer may be retried at a later time.\r | |
183 | @retval EFI_UNSUPPORTED The device does not support this type of repositioning.\r | |
184 | @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.\r | |
185 | @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.\r | |
186 | The transfer was aborted since the current position of the\r | |
187 | media may be incorrect.\r | |
188 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data from the media.\r | |
189 | \r | |
190 | **/\r | |
191 | typedef \r | |
192 | EFI_STATUS\r | |
193 | (EFIAPI *EFI_TAPE_WRITEFM) (\r | |
194 | IN EFI_TAPE_IO_PROTOCOL *This,\r | |
195 | IN UINTN Count\r | |
196 | )\r | |
197 | ; \r | |
198 | \r | |
199 | \r | |
200 | /**\r | |
201 | Resets the tape device.\r | |
202 | \r | |
203 | @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r | |
204 | @param ExtendedVerification Indicates whether the parent bus should also be reset.\r | |
205 | \r | |
206 | @retval EFI_SUCCESS The bus and/or device were successfully reset.\r | |
207 | @retval EFI_NO_MEDIA No media is loaded in the device.\r | |
208 | @retval EFI_NOT_READY The reset failed since the device and/or bus was not ready.\r | |
209 | The reset may be retried at a later time.\r | |
210 | @retval EFI_UNSUPPORTED The device does not support this type of reset.\r | |
211 | @retval EFI_TIMEOUT The reset did not complete within the timeout allowed.\r | |
212 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the bus and/or device.\r | |
213 | \r | |
214 | **/\r | |
215 | typedef \r | |
216 | EFI_STATUS\r | |
217 | (EFIAPI *EFI_TAPE_RESET) (\r | |
218 | IN EFI_TAPE_IO_PROTOCOL *This,\r | |
219 | IN BOOLEAN ExtendedVerification\r | |
220 | )\r | |
221 | ; \r | |
222 | \r | |
223 | struct _EFI_TAPE_IO_PROTOCOL {\r | |
224 | EFI_TAPE_READ TapeRead;\r | |
225 | EFI_TAPE_WRITE TapeWrite;\r | |
226 | EFI_TAPE_REWIND TapeRewind;\r | |
227 | EFI_TAPE_SPACE TapeSpace;\r | |
228 | EFI_TAPE_WRITEFM TapeWriteFM;\r | |
229 | EFI_TAPE_RESET TapeReset;\r | |
230 | };\r | |
231 | \r | |
232 | extern EFI_GUID gEfiTapeIoProtocolGuid;\r | |
233 | \r | |
234 | #endif\r |