2 EFI_TAPE_IO_PROTOCOL as defined in the UEFI 2.0.
3 Provide services to control and access a tape device.
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __EFI_TAPE_IO_PROTOCOL_H__
17 #define __EFI_TAPE_IO_PROTOCOL_H__
19 #define EFI_TAPE_IO_PROTOCOL_GUID \
21 0x1e93e633, 0xd65a, 0x459e, {0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \
24 typedef struct _EFI_TAPE_IO_PROTOCOL EFI_TAPE_IO_PROTOCOL
;
39 CHAR8 CreationDate
[10];
40 CHAR8 CreationTime
[10];
41 CHAR8 SystemName
[256]; // UTF-8
42 CHAR8 TapeTitle
[120]; // UTF-8
43 CHAR8 pad
[468]; // pad to 1024
49 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
50 @param BufferSize Size of the buffer in bytes pointed to by Buffer.
51 @param Buffer Pointer to the buffer for data to be read into.
53 @retval EFI_SUCCESS Data was successfully transferred from the media.
54 @retval EFI_END_OF_FILE A filemark was encountered which limited the data
55 transferred by the read operation or the head is positioned
56 just after a filemark.
57 @retval EFI_NO_MEDIA No media is loaded in the device.
58 @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
59 online). The transfer may be retried at a later time.
60 @retval EFI_UNSUPPORTED The device does not support this type of transfer.
61 @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
62 @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
63 The transfer was aborted since the current position of the
64 media may be incorrect.
65 @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero
66 BufferSize or the device is operating in fixed block
67 size mode and the BufferSize was not a multiple of
68 device's fixed block size
69 @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data
75 (EFIAPI
*EFI_TAPE_READ
)(
76 IN EFI_TAPE_IO_PROTOCOL
*This
,
77 IN OUT UINTN
*BufferSize
,
84 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
85 @param BufferSize Size of the buffer in bytes pointed to by Buffer.
86 @param Buffer Pointer to the buffer for data to be written from.
88 @retval EFI_SUCCESS Data was successfully transferred to the media.
89 @retval EFI_END_OF_MEDIA The logical end of media has been reached. Data may have
90 been successfully transferred to the media.
91 @retval EFI_NO_MEDIA No media is loaded in the device.
92 @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
93 online). The transfer may be retried at a later time.
94 @retval EFI_UNSUPPORTED The device does not support this type of transfer.
95 @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
96 @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
97 The transfer was aborted since the current position of the
98 media may be incorrect.
99 @retval EFI_WRITE_PROTECTED The media in the device is write-protected. The transfer
100 was aborted since a write cannot be completed.
101 @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero
102 BufferSize or the device is operating in fixed block
103 size mode and the BufferSize was not a multiple of
104 device's fixed block size
105 @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data
111 (EFIAPI
*EFI_TAPE_WRITE
)(
112 IN EFI_TAPE_IO_PROTOCOL
*This
,
113 IN UINTN
*BufferSize
,
121 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
123 @retval EFI_SUCCESS The media was successfully repositioned.
124 @retval EFI_NO_MEDIA No media is loaded in the device.
125 @retval EFI_NOT_READY Repositioning the media failed since the device was not
126 ready (e.g. not online). The transfer may be retried at a later time.
127 @retval EFI_UNSUPPORTED The device does not support this type of media repositioning.
128 @retval EFI_TIMEOUT Repositioning of the media did not complete within the timeout specified.
129 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.
134 (EFIAPI
*EFI_TAPE_REWIND
)(
135 IN EFI_TAPE_IO_PROTOCOL
*This
142 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
143 @param Direction Direction and number of data blocks or filemarks to space over on media.
144 @param Type Type of mark to space over on media.
146 @retval EFI_SUCCESS The media was successfully repositioned.
147 @retval EFI_END_OF_MEDIA Beginning or end of media was reached before the
148 indicated number of data blocks or filemarks were found.
149 @retval EFI_NO_MEDIA No media is loaded in the device.
150 @retval EFI_NOT_READY The reposition failed since the device was not ready (e.g. not
151 online). The reposition may be retried at a later time.
152 @retval EFI_UNSUPPORTED The device does not support this type of repositioning.
153 @retval EFI_TIMEOUT The repositioning failed to complete within the timeout specified.
154 @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
155 Repositioning the media was aborted since the current
156 position of the media may be incorrect.
157 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.
162 (EFIAPI
*EFI_TAPE_SPACE
)(
163 IN EFI_TAPE_IO_PROTOCOL
*This
,
170 Writes filemarks to the media.
172 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
173 @param Count Number of filemarks to write to the media.
175 @retval EFI_SUCCESS Data was successfully transferred from the media.
176 @retval EFI_NO_MEDIA No media is loaded in the device.
177 @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
178 online). The transfer may be retried at a later time.
179 @retval EFI_UNSUPPORTED The device does not support this type of repositioning.
180 @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
181 @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
182 The transfer was aborted since the current position of the
183 media may be incorrect.
184 @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data from the media.
189 (EFIAPI
*EFI_TAPE_WRITEFM
)(
190 IN EFI_TAPE_IO_PROTOCOL
*This
,
196 Resets the tape device.
198 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
199 @param ExtendedVerification Indicates whether the parent bus should also be reset.
201 @retval EFI_SUCCESS The bus and/or device were successfully reset.
202 @retval EFI_NO_MEDIA No media is loaded in the device.
203 @retval EFI_NOT_READY The reset failed since the device and/or bus was not ready.
204 The reset may be retried at a later time.
205 @retval EFI_UNSUPPORTED The device does not support this type of reset.
206 @retval EFI_TIMEOUT The reset did not complete within the timeout allowed.
207 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the bus and/or device.
212 (EFIAPI
*EFI_TAPE_RESET
)(
213 IN EFI_TAPE_IO_PROTOCOL
*This
,
214 IN BOOLEAN ExtendedVerification
218 @par Protocol Description:
219 The EFI_TAPE_IO_PROTOCOL provides basic sequential operations for tape devices.
220 These include read, write, rewind, space, write filemarks and reset functions.
221 Per this specification, a boot application uses the services of this protocol
222 to load the bootloader image from tape.
225 Read a block of data from the tape.
228 Write a block of data to the tape.
237 Write filemarks to the tape.
240 Reset the tape device or its parent bus.
242 struct _EFI_TAPE_IO_PROTOCOL
{
243 EFI_TAPE_READ TapeRead
;
244 EFI_TAPE_WRITE TapeWrite
;
245 EFI_TAPE_REWIND TapeRewind
;
246 EFI_TAPE_SPACE TapeSpace
;
247 EFI_TAPE_WRITEFM TapeWriteFM
;
248 EFI_TAPE_RESET TapeReset
;
251 extern EFI_GUID gEfiTapeIoProtocolGuid
;