2 Copyright (c) 2006, Intel Corporation
3 All rights reserved. This program and the accompanying materials
4 are licensed and made available under the terms and conditions of the BSD License
5 which accompanies this distribution. The full text of the license may be found at
6 http://opensource.org/licenses/bsd-license.php
8 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 EFI_TAPE_IO_PROTOCOL as defined in the UEFI 2.0.
17 Provide services to control and access a tape device.
23 #ifndef __EFI_TAPE_IO_PROTOCOL_H__
24 #define __EFI_TAPE_IO_PROTOCOL_H__
26 #define EFI_TAPE_IO_PROTOCOL_GUID \
28 0x1e93e633, 0xd65a, 0x459e, {0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \
31 typedef struct _EFI_TAPE_IO_PROTOCOL EFI_TAPE_IO_PROTOCOL
;
46 CHAR8 CreationDate
[10];
47 CHAR8 CreationTime
[10];
48 CHAR8 SystemName
[256]; // UTF-8
49 CHAR8 TapeTitle
[120]; // UTF-8
50 CHAR8 pad
[468]; // pad to 1024
55 (EFIAPI
*EFI_TAPE_READ
) (
56 IN EFI_TAPE_IO_PROTOCOL
*This
,
57 IN OUT UINTN
*BufferSize
,
66 This - A pointer to the EFI_TAPE_IO_PROTOCOL instance.
67 BufferSize - Size of the buffer in bytes pointed to by Buffer.
68 Buffer - Pointer to the buffer for data to be read into.
71 EFI_SUCCESS - Data was successfully transferred from the media.
72 EFI_END_OF_FILE - A filemark was encountered which limited the data
73 transferred by the read operation or the head is positioned
74 just after a filemark.
75 EFI_NO_MEDIA - No media is loaded in the device.
76 EFI_NOT_READY - The transfer failed since the device was not ready (e.g. not
77 online). The transfer may be retried at a later time.
78 EFI_UNSUPPORTED - The device does not support this type of transfer.
79 EFI_TIMEOUT - The transfer failed to complete within the timeout specified.
80 EFI_MEDIA_CHANGED - The media in the device was changed since the last access.
81 The transfer was aborted since the current position of the
82 media may be incorrect.
83 EFI_INVALID_PARAMETER - A NULL Buffer was specified with a non-zero
84 BufferSize or the device is operating in fixed block
85 size mode and the BufferSize was not a multiple of
86 device¡¯s fixed block size
87 EFI_DEVICE_ERROR - A device error occurred while attempting to transfer data
95 (EFIAPI
*EFI_TAPE_WRITE
) (
96 IN EFI_TAPE_IO_PROTOCOL
*This
,
106 This - A pointer to the EFI_TAPE_IO_PROTOCOL instance.
107 BufferSize - Size of the buffer in bytes pointed to by Buffer.
108 Buffer - Pointer to the buffer for data to be written from.
111 EFI_SUCCESS - Data was successfully transferred to the media.
112 EFI_END_OF_MEDIA - The logical end of media has been reached. Data may have
113 been successfully transferred to the media.
114 EFI_NO_MEDIA - No media is loaded in the device.
115 EFI_NOT_READY - The transfer failed since the device was not ready (e.g. not
116 online). The transfer may be retried at a later time.
117 EFI_UNSUPPORTED - The device does not support this type of transfer.
118 EFI_TIMEOUT - The transfer failed to complete within the timeout specified.
119 EFI_MEDIA_CHANGED - The media in the device was changed since the last access.
120 The transfer was aborted since the current position of the
121 media may be incorrect.
122 EFI_WRITE_PROTECTED - The media in the device is write-protected. The transfer
123 was aborted since a write cannot be completed.
124 EFI_INVALID_PARAMETER - A NULL Buffer was specified with a non-zero
125 BufferSize or the device is operating in fixed block
126 size mode and the BufferSize was not a multiple of
127 device¡¯s fixed block size
128 EFI_DEVICE_ERROR A device error occurred while attempting to transfer data
137 (EFIAPI
*EFI_TAPE_REWIND
) (
138 IN EFI_TAPE_IO_PROTOCOL
*This
146 This - A pointer to the EFI_TAPE_IO_PROTOCOL instance.
149 EFI_SUCCESS - The media was successfully repositioned.
150 EFI_NO_MEDIA - No media is loaded in the device.
151 EFI_NOT_READY - Repositioning the media failed since the device was not
152 ready (e.g. not online). The transfer may be retried at a later time.
153 EFI_UNSUPPORTED - The device does not support this type of media repositioning.
154 EFI_TIMEOUT - Repositioning of the media did not complete within the timeout specified.
155 EFI_DEVICE_ERROR - A device error occurred while attempting to reposition the media.
163 (EFIAPI
*EFI_TAPE_SPACE
) (
164 IN EFI_TAPE_IO_PROTOCOL
*This
,
174 This - A pointer to the EFI_TAPE_IO_PROTOCOL instance.
175 Direction - Direction and number of data blocks or filemarks to space over on media.
176 Type - Type of mark to space over on media.
179 EFI_SUCCESS - The media was successfully repositioned.
180 EFI_END_OF_MEDIA - Beginning or end of media was reached before the
181 indicated number of data blocks or filemarks were found.
182 EFI_NO_MEDIA - No media is loaded in the device.
183 EFI_NOT_READY - The reposition failed since the device was not ready (e.g. not
184 online). The reposition may be retried at a later time.
185 EFI_UNSUPPORTED - The device does not support this type of repositioning.
186 EFI_TIMEOUT - The repositioning failed to complete within the timeout specified.
187 EFI_MEDIA_CHANGED - The media in the device was changed since the last access.
188 Repositioning the media was aborted since the current
189 position of the media may be incorrect.
190 EFI_DEVICE_ERROR - A device error occurred while attempting to reposition the media.
197 (EFIAPI
*EFI_TAPE_WRITEFM
) (
198 IN EFI_TAPE_IO_PROTOCOL
*This
,
204 Writes filemarks to the media.
207 This - A pointer to the EFI_TAPE_IO_PROTOCOL instance.
208 Count - Number of filemarks to write to the media.
211 EFI_SUCCESS - Data was successfully transferred from the media.
212 EFI_NO_MEDIA - No media is loaded in the device.
213 EFI_NOT_READY - The transfer failed since the device was not ready (e.g. not
214 online). The transfer may be retried at a later time.
215 EFI_UNSUPPORTED - The device does not support this type of repositioning.
216 EFI_TIMEOUT - The transfer failed to complete within the timeout specified.
217 EFI_MEDIA_CHANGED - The media in the device was changed since the last access.
218 The transfer was aborted since the current position of the
219 media may be incorrect.
220 EFI_DEVICE_ERROR - A device error occurred while attempting to transfer data from the media.
227 (EFIAPI
*EFI_TAPE_RESET
) (
228 IN EFI_TAPE_IO_PROTOCOL
*This
,
229 IN BOOLEAN ExtendedVerification
234 Resets the tape device.
237 This - A pointer to the EFI_TAPE_IO_PROTOCOL instance.
238 ExtendedVerification - Indicates whether the parent bus should also be reset.
241 EFI_SUCCESS - The bus and/or device were successfully reset.
242 EFI_NO_MEDIA - No media is loaded in the device.
243 EFI_NOT_READY - The reset failed since the device and/or bus was not ready.
244 The reset may be retried at a later time.
245 EFI_UNSUPPORTED - The device does not support this type of reset.
246 EFI_TIMEOUT - The reset did not complete within the timeout allowed.
247 EFI_DEVICE_ERROR - A device error occurred while attempting to reset the bus and/or device.
252 struct _EFI_TAPE_IO_PROTOCOL
{
253 EFI_TAPE_READ TapeRead
;
254 EFI_TAPE_WRITE TapeWrite
;
255 EFI_TAPE_REWIND TapeRewind
;
256 EFI_TAPE_SPACE TapeSpace
;
257 EFI_TAPE_WRITEFM TapeWriteFM
;
258 EFI_TAPE_RESET TapeReset
;
261 extern EFI_GUID gEfiTapeIoProtocolGuid
;