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