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 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __EFI_TAPE_IO_PROTOCOL_H__
11 #define __EFI_TAPE_IO_PROTOCOL_H__
13 #define EFI_TAPE_IO_PROTOCOL_GUID \
15 0x1e93e633, 0xd65a, 0x459e, {0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \
18 typedef struct _EFI_TAPE_IO_PROTOCOL EFI_TAPE_IO_PROTOCOL
;
20 typedef struct _EFI_TAPE_HEADER
{
33 CHAR8 CreationDate
[10];
34 CHAR8 CreationTime
[10];
35 CHAR8 SystemName
[256]; // UTF-8
36 CHAR8 TapeTitle
[120]; // UTF-8
37 CHAR8 pad
[468]; // pad to 1024
43 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
44 @param BufferSize The size of the buffer in bytes pointed to by Buffer.
45 @param Buffer The pointer to the buffer for data to be read into.
47 @retval EFI_SUCCESS Data was successfully transferred from the media.
48 @retval EFI_END_OF_FILE A filemark was encountered which limited the data
49 transferred by the read operation or the head is positioned
50 just after a filemark.
51 @retval EFI_NO_MEDIA No media is loaded in the device.
52 @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
53 online). The transfer may be retried at a later time.
54 @retval EFI_UNSUPPORTED The device does not support this type of transfer.
55 @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
56 @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
57 The transfer was aborted since the current position of the
58 media may be incorrect.
59 @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero
60 BufferSize, or the device is operating in fixed block
61 size mode and the BufferSize was not a multiple of
62 device's fixed block size
63 @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data
69 (EFIAPI
*EFI_TAPE_READ
)(
70 IN EFI_TAPE_IO_PROTOCOL
*This
,
71 IN OUT UINTN
*BufferSize
,
78 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
79 @param BufferSize Size of the buffer in bytes pointed to by Buffer.
80 @param Buffer The pointer to the buffer for data to be written from.
82 @retval EFI_SUCCESS Data was successfully transferred to the media.
83 @retval EFI_END_OF_MEDIA The logical end of media has been reached. Data may have
84 been successfully transferred to the media.
85 @retval EFI_NO_MEDIA No media is loaded in the device.
86 @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
87 online). The transfer may be retried at a later time.
88 @retval EFI_UNSUPPORTED The device does not support this type of transfer.
89 @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
90 @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
91 The transfer was aborted since the current position of the
92 media may be incorrect.
93 @retval EFI_WRITE_PROTECTED The media in the device is write-protected. The transfer
94 was aborted since a write cannot be completed.
95 @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero
96 BufferSize, or the device is operating in fixed block
97 size mode and the BufferSize was not a multiple of
98 device's fixed block size
99 @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data
105 (EFIAPI
*EFI_TAPE_WRITE
)(
106 IN EFI_TAPE_IO_PROTOCOL
*This
,
107 IN UINTN
*BufferSize
,
114 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
116 @retval EFI_SUCCESS The media was successfully repositioned.
117 @retval EFI_NO_MEDIA No media is loaded in the device.
118 @retval EFI_NOT_READY Repositioning the media failed since the device was not
119 ready (e.g. not online). The transfer may be retried at a later time.
120 @retval EFI_UNSUPPORTED The device does not support this type of media repositioning.
121 @retval EFI_TIMEOUT Repositioning of the media did not complete within the timeout specified.
122 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.
127 (EFIAPI
*EFI_TAPE_REWIND
)(
128 IN EFI_TAPE_IO_PROTOCOL
*This
134 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
135 @param Direction Direction and number of data blocks or filemarks to space over on media.
136 @param Type Type of mark to space over on media.
137 The following Type marks are mandatory:
141 @retval EFI_SUCCESS The media was successfully repositioned.
142 @retval EFI_END_OF_MEDIA Beginning or end of media was reached before the
143 indicated number of data blocks or filemarks were found.
144 @retval EFI_NO_MEDIA No media is loaded in the device.
145 @retval EFI_NOT_READY The reposition failed since the device was not ready (e.g. not
146 online). The reposition may be retried at a later time.
147 @retval EFI_UNSUPPORTED The device does not support this type of repositioning.
148 @retval EFI_TIMEOUT The repositioning failed to complete within the timeout specified.
149 @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
150 Repositioning the media was aborted since the current
151 position of the media may be incorrect.
152 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.
157 (EFIAPI
*EFI_TAPE_SPACE
)(
158 IN EFI_TAPE_IO_PROTOCOL
*This
,
164 Writes filemarks to the media.
166 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
167 @param Count Number of filemarks to write to the media.
169 @retval EFI_SUCCESS Data was successfully transferred from the media.
170 @retval EFI_NO_MEDIA No media is loaded in the device.
171 @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
172 online). The transfer may be retried at a later time.
173 @retval EFI_UNSUPPORTED The device does not support this type of repositioning.
174 @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
175 @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
176 The transfer was aborted since the current position of the
177 media may be incorrect.
178 @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data from the media.
183 (EFIAPI
*EFI_TAPE_WRITEFM
)(
184 IN EFI_TAPE_IO_PROTOCOL
*This
,
189 Resets the tape device.
191 @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
192 @param ExtendedVerification Indicates whether the parent bus should also be reset.
194 @retval EFI_SUCCESS The bus and/or device were successfully reset.
195 @retval EFI_NO_MEDIA No media is loaded in the device.
196 @retval EFI_NOT_READY The reset failed since the device and/or bus was not ready.
197 The reset may be retried at a later time.
198 @retval EFI_UNSUPPORTED The device does not support this type of reset.
199 @retval EFI_TIMEOUT The reset did not complete within the timeout allowed.
200 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the bus and/or device.
205 (EFIAPI
*EFI_TAPE_RESET
)(
206 IN EFI_TAPE_IO_PROTOCOL
*This
,
207 IN BOOLEAN ExtendedVerification
211 /// The EFI_TAPE_IO_PROTOCOL provides basic sequential operations for tape devices.
212 /// These include read, write, rewind, space, write filemarks and reset functions.
213 /// Per this specification, a boot application uses the services of this protocol
214 /// to load the bootloader image from tape.
216 struct _EFI_TAPE_IO_PROTOCOL
{
217 EFI_TAPE_READ TapeRead
;
218 EFI_TAPE_WRITE TapeWrite
;
219 EFI_TAPE_REWIND TapeRewind
;
220 EFI_TAPE_SPACE TapeSpace
;
221 EFI_TAPE_WRITEFM TapeWriteFM
;
222 EFI_TAPE_RESET TapeReset
;
225 extern EFI_GUID gEfiTapeIoProtocolGuid
;