]>
Commit | Line | Data |
---|---|---|
54f594e4 | 1 | /** @file\r |
2 | The EFI_ATA_PASS_THRU_PROTOCOL provides information about an ATA controller and the ability\r | |
3 | to send ATA Command Blocks to any ATA device attached to that ATA controller. The information\r | |
4 | includes the attributes of the ATA controller.\r | |
5 | \r | |
9095d37b LG |
6 | Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r |
7 | This program and the accompanying materials\r | |
8 | are licensed and made available under the terms and conditions of the BSD License\r | |
9 | which accompanies this distribution. The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php\r | |
54f594e4 | 11 | \r |
9095d37b LG |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
54f594e4 | 14 | \r |
497a5fb1 SZ |
15 | @par Revision Reference:\r |
16 | This Protocol was introduced in UEFI Specification 2.3.\r | |
17 | \r | |
54f594e4 | 18 | **/\r |
19 | \r | |
20 | #ifndef __ATA_PASS_THROUGH_H__\r | |
21 | #define __ATA_PASS_THROUGH_H__\r | |
22 | \r | |
23 | #define EFI_ATA_PASS_THRU_PROTOCOL_GUID \\r | |
24 | { \\r | |
25 | 0x1d3de7f0, 0x807, 0x424f, {0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } \\r | |
26 | }\r | |
27 | \r | |
28 | typedef struct _EFI_ATA_PASS_THRU_PROTOCOL EFI_ATA_PASS_THRU_PROTOCOL;\r | |
29 | \r | |
30 | typedef struct {\r | |
31 | UINT32 Attributes;\r | |
32 | UINT32 IoAlign;\r | |
33 | } EFI_ATA_PASS_THRU_MODE;\r | |
34 | \r | |
35 | ///\r | |
36 | /// If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface is for physical\r | |
37 | /// devices on the ATA controller.\r | |
38 | ///\r | |
39 | #define EFI_ATA_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001\r | |
40 | ///\r | |
41 | /// If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface is for logical\r | |
42 | /// devices on the ATA controller.\r | |
43 | ///\r | |
44 | #define EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002\r | |
45 | ///\r | |
46 | /// If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface supports non blocking\r | |
47 | /// I/O. Every EFI_ATA_PASS_THRU_PROTOCOL must support blocking I/O. The support of non-blocking\r | |
48 | /// I/O is optional.\r | |
49 | ///\r | |
50 | #define EFI_ATA_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004\r | |
51 | \r | |
52 | typedef struct _EFI_ATA_COMMAND_BLOCK {\r | |
53 | UINT8 Reserved1[2];\r | |
54 | UINT8 AtaCommand;\r | |
55 | UINT8 AtaFeatures;\r | |
56 | UINT8 AtaSectorNumber;\r | |
57 | UINT8 AtaCylinderLow;\r | |
58 | UINT8 AtaCylinderHigh;\r | |
59 | UINT8 AtaDeviceHead;\r | |
60 | UINT8 AtaSectorNumberExp;\r | |
61 | UINT8 AtaCylinderLowExp;\r | |
9095d37b | 62 | UINT8 AtaCylinderHighExp;\r |
54f594e4 | 63 | UINT8 AtaFeaturesExp;\r |
64 | UINT8 AtaSectorCount;\r | |
65 | UINT8 AtaSectorCountExp;\r | |
66 | UINT8 Reserved2[6];\r | |
67 | } EFI_ATA_COMMAND_BLOCK;\r | |
68 | \r | |
69 | typedef struct _EFI_ATA_STATUS_BLOCK {\r | |
70 | UINT8 Reserved1[2];\r | |
71 | UINT8 AtaStatus;\r | |
72 | UINT8 AtaError;\r | |
73 | UINT8 AtaSectorNumber;\r | |
74 | UINT8 AtaCylinderLow;\r | |
75 | UINT8 AtaCylinderHigh;\r | |
76 | UINT8 AtaDeviceHead;\r | |
77 | UINT8 AtaSectorNumberExp;\r | |
78 | UINT8 AtaCylinderLowExp;\r | |
9095d37b | 79 | UINT8 AtaCylinderHighExp;\r |
ea6898b9 | 80 | UINT8 Reserved2;\r |
54f594e4 | 81 | UINT8 AtaSectorCount;\r |
82 | UINT8 AtaSectorCountExp;\r | |
ea6898b9 | 83 | UINT8 Reserved3[6];\r |
54f594e4 | 84 | } EFI_ATA_STATUS_BLOCK;\r |
85 | \r | |
86 | typedef UINT8 EFI_ATA_PASS_THRU_CMD_PROTOCOL;\r | |
87 | \r | |
88 | #define EFI_ATA_PASS_THRU_PROTOCOL_ATA_HARDWARE_RESET 0x00\r | |
89 | #define EFI_ATA_PASS_THRU_PROTOCOL_ATA_SOFTWARE_RESET 0x01\r | |
90 | #define EFI_ATA_PASS_THRU_PROTOCOL_ATA_NON_DATA 0x02\r | |
91 | #define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_IN 0x04\r | |
92 | #define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_OUT 0x05\r | |
93 | #define EFI_ATA_PASS_THRU_PROTOCOL_DMA 0x06\r | |
94 | #define EFI_ATA_PASS_THRU_PROTOCOL_DMA_QUEUED 0x07\r | |
95 | #define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_DIAGNOSTIC 0x08\r | |
96 | #define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_RESET 0x09\r | |
97 | #define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_IN 0x0A\r | |
98 | #define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_OUT 0x0B\r | |
99 | #define EFI_ATA_PASS_THRU_PROTOCOL_FPDMA 0x0C\r | |
100 | #define EFI_ATA_PASS_THRU_PROTOCOL_RETURN_RESPONSE 0xFF\r | |
101 | \r | |
102 | typedef UINT8 EFI_ATA_PASS_THRU_LENGTH;\r | |
103 | \r | |
104 | #define EFI_ATA_PASS_THRU_LENGTH_BYTES 0x80\r | |
105 | \r | |
106 | \r | |
107 | #define EFI_ATA_PASS_THRU_LENGTH_MASK 0x70\r | |
108 | #define EFI_ATA_PASS_THRU_LENGTH_NO_DATA_TRANSFER 0x00\r | |
109 | #define EFI_ATA_PASS_THRU_LENGTH_FEATURES 0x10\r | |
110 | #define EFI_ATA_PASS_THRU_LENGTH_SECTOR_COUNT 0x20\r | |
111 | #define EFI_ATA_PASS_THRU_LENGTH_TPSIU 0x30\r | |
112 | \r | |
113 | #define EFI_ATA_PASS_THRU_LENGTH_COUNT 0x0F\r | |
114 | \r | |
115 | typedef struct {\r | |
116 | ///\r | |
117 | /// A pointer to the sense data that was generated by the execution of the ATA\r | |
118 | /// command. It must be aligned to the boundary specified in the IoAlign field\r | |
119 | /// in the EFI_ATA_PASS_THRU_MODE structure.\r | |
120 | ///\r | |
121 | EFI_ATA_STATUS_BLOCK *Asb;\r | |
122 | ///\r | |
123 | /// A pointer to buffer that contains the Command Data Block to send to the ATA\r | |
124 | /// device specified by Port and PortMultiplierPort.\r | |
125 | ///\r | |
126 | EFI_ATA_COMMAND_BLOCK *Acb;\r | |
127 | ///\r | |
128 | /// The timeout, in 100 ns units, to use for the execution of this ATA command.\r | |
129 | /// A Timeout value of 0 means that this function will wait indefinitely for the\r | |
130 | /// ATA command to execute. If Timeout is greater than zero, then this function\r | |
131 | /// will return EFI_TIMEOUT if the time required to execute the ATA command is\r | |
132 | /// greater than Timeout.\r | |
133 | ///\r | |
134 | UINT64 Timeout;\r | |
135 | ///\r | |
136 | /// A pointer to the data buffer to transfer between the ATA controller and the\r | |
137 | /// ATA device for read and bidirectional commands. For all write and non data\r | |
138 | /// commands where InTransferLength is 0 this field is optional and may be NULL.\r | |
139 | /// If this field is not NULL, then it must be aligned on the boundary specified\r | |
140 | /// by the IoAlign field in the EFI_ATA_PASS_THRU_MODE structure.\r | |
141 | ///\r | |
142 | VOID *InDataBuffer;\r | |
143 | ///\r | |
144 | /// A pointer to the data buffer to transfer between the ATA controller and the\r | |
145 | /// ATA device for write or bidirectional commands. For all read and non data\r | |
146 | /// commands where OutTransferLength is 0 this field is optional and may be NULL.\r | |
147 | /// If this field is not NULL, then it must be aligned on the boundary specified\r | |
148 | /// by the IoAlign field in the EFI_ATA_PASS_THRU_MODE structure.\r | |
149 | ///\r | |
150 | VOID *OutDataBuffer;\r | |
151 | ///\r | |
152 | /// On input, the size, in bytes, of InDataBuffer. On output, the number of bytes\r | |
153 | /// transferred between the ATA controller and the ATA device. If InTransferLength\r | |
154 | /// is larger than the ATA controller can handle, no data will be transferred,\r | |
155 | /// InTransferLength will be updated to contain the number of bytes that the ATA\r | |
156 | /// controller is able to transfer, and EFI_BAD_BUFFER_SIZE will be returned.\r | |
157 | ///\r | |
158 | UINT32 InTransferLength;\r | |
159 | ///\r | |
160 | /// On Input, the size, in bytes of OutDataBuffer. On Output, the Number of bytes\r | |
161 | /// transferred between ATA Controller and the ATA device. If OutTransferLength is\r | |
9095d37b | 162 | /// larger than the ATA controller can handle, no data will be transferred,\r |
54f594e4 | 163 | /// OutTransferLength will be updated to contain the number of bytes that the ATA\r |
164 | /// controller is able to transfer, and EFI_BAD_BUFFER_SIZE will be returned.\r | |
165 | ///\r | |
166 | UINT32 OutTransferLength;\r | |
167 | ///\r | |
168 | /// Specifies the protocol used when the ATA device executes the command.\r | |
169 | ///\r | |
170 | EFI_ATA_PASS_THRU_CMD_PROTOCOL Protocol;\r | |
171 | ///\r | |
172 | /// Specifies the way in which the ATA command length is encoded.\r | |
173 | ///\r | |
174 | EFI_ATA_PASS_THRU_LENGTH Length;\r | |
175 | } EFI_ATA_PASS_THRU_COMMAND_PACKET;\r | |
176 | \r | |
177 | \r | |
178 | /**\r | |
179 | Sends an ATA command to an ATA device that is attached to the ATA controller. This function\r | |
180 | supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required,\r | |
181 | and the non-blocking I/O functionality is optional.\r | |
182 | \r | |
9095d37b LG |
183 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r |
184 | @param[in] Port The port number of the ATA device to send the command.\r | |
54f594e4 | 185 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.\r |
cc403650 | 186 | If there is no port multiplier, then specify 0xFFFF.\r |
54f594e4 | 187 | @param[in,out] Packet A pointer to the ATA command to send to the ATA device specified by Port\r |
188 | and PortMultiplierPort.\r | |
189 | @param[in] Event If non-blocking I/O is not supported then Event is ignored, and blocking\r | |
190 | I/O is performed. If Event is NULL, then blocking I/O is performed. If\r | |
191 | Event is not NULL and non blocking I/O is supported, then non-blocking\r | |
192 | I/O is performed, and Event will be signaled when the ATA command completes.\r | |
193 | \r | |
9095d37b | 194 | @retval EFI_SUCCESS The ATA command was sent by the host. For bi-directional commands,\r |
54f594e4 | 195 | InTransferLength bytes were transferred from InDataBuffer. For write and\r |
196 | bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer.\r | |
197 | @retval EFI_BAD_BUFFER_SIZE The ATA command was not executed. The number of bytes that could be transferred\r | |
9095d37b | 198 | is returned in InTransferLength. For write and bi-directional commands,\r |
54f594e4 | 199 | OutTransferLength bytes were transferred by OutDataBuffer.\r |
200 | @retval EFI_NOT_READY The ATA command could not be sent because there are too many ATA commands\r | |
201 | already queued. The caller may retry again later.\r | |
202 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the ATA command.\r | |
203 | @retval EFI_INVALID_PARAMETER Port, PortMultiplierPort, or the contents of Acb are invalid. The ATA\r | |
204 | command was not sent, so no additional status information is available.\r | |
205 | \r | |
206 | **/\r | |
207 | typedef\r | |
208 | EFI_STATUS\r | |
209 | (EFIAPI *EFI_ATA_PASS_THRU_PASSTHRU)(\r | |
210 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
211 | IN UINT16 Port,\r | |
212 | IN UINT16 PortMultiplierPort,\r | |
213 | IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet,\r | |
214 | IN EFI_EVENT Event OPTIONAL\r | |
215 | );\r | |
216 | \r | |
217 | /**\r | |
93e8d03c | 218 | Used to retrieve the list of legal port numbers for ATA devices on an ATA controller.\r |
54f594e4 | 219 | These can either be the list of ports where ATA devices are actually present or the\r |
220 | list of legal port numbers for the ATA controller. Regardless, the caller of this\r | |
221 | function must probe the port number returned to see if an ATA device is actually\r | |
222 | present at that location on the ATA controller.\r | |
223 | \r | |
224 | The GetNextPort() function retrieves the port number on an ATA controller. If on input\r | |
225 | Port is 0xFFFF, then the port number of the first port on the ATA controller is returned\r | |
226 | in Port and EFI_SUCCESS is returned.\r | |
227 | \r | |
228 | If Port is a port number that was returned on a previous call to GetNextPort(), then the\r | |
229 | port number of the next port on the ATA controller is returned in Port, and EFI_SUCCESS\r | |
230 | is returned. If Port is not 0xFFFF and Port was not returned on a previous call to\r | |
231 | GetNextPort(), then EFI_INVALID_PARAMETER is returned.\r | |
232 | \r | |
233 | If Port is the port number of the last port on the ATA controller, then EFI_NOT_FOUND is\r | |
234 | returned.\r | |
235 | \r | |
9095d37b | 236 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r |
54f594e4 | 237 | @param[in,out] Port On input, a pointer to the port number on the ATA controller.\r |
238 | On output, a pointer to the next port number on the ATA\r | |
239 | controller. An input value of 0xFFFF retrieves the first port\r | |
240 | number on the ATA controller.\r | |
241 | \r | |
242 | @retval EFI_SUCCESS The next port number on the ATA controller was returned in Port.\r | |
243 | @retval EFI_NOT_FOUND There are no more ports on this ATA controller.\r | |
244 | @retval EFI_INVALID_PARAMETER Port is not 0xFFFF and Port was not returned on a previous call\r | |
245 | to GetNextPort().\r | |
246 | \r | |
247 | **/\r | |
248 | typedef\r | |
249 | EFI_STATUS\r | |
250 | (EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_PORT)(\r | |
251 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
252 | IN OUT UINT16 *Port\r | |
253 | );\r | |
254 | \r | |
255 | /**\r | |
9095d37b LG |
256 | Used to retrieve the list of legal port multiplier port numbers for ATA devices on a port of an ATA\r |
257 | controller. These can either be the list of port multiplier ports where ATA devices are actually\r | |
258 | present on port or the list of legal port multiplier ports on that port. Regardless, the caller of this\r | |
259 | function must probe the port number and port multiplier port number returned to see if an ATA\r | |
54f594e4 | 260 | device is actually present.\r |
261 | \r | |
9095d37b | 262 | The GetNextDevice() function retrieves the port multiplier port number of an ATA device\r |
54f594e4 | 263 | present on a port of an ATA controller.\r |
9095d37b LG |
264 | \r |
265 | If PortMultiplierPort points to a port multiplier port number value that was returned on a\r | |
54f594e4 | 266 | previous call to GetNextDevice(), then the port multiplier port number of the next ATA device\r |
267 | on the port of the ATA controller is returned in PortMultiplierPort, and EFI_SUCCESS is\r | |
268 | returned.\r | |
9095d37b LG |
269 | \r |
270 | If PortMultiplierPort points to 0xFFFF, then the port multiplier port number of the first\r | |
271 | ATA device on port of the ATA controller is returned in PortMultiplierPort and\r | |
54f594e4 | 272 | EFI_SUCCESS is returned.\r |
9095d37b | 273 | \r |
54f594e4 | 274 | If PortMultiplierPort is not 0xFFFF and the value pointed to by PortMultiplierPort\r |
275 | was not returned on a previous call to GetNextDevice(), then EFI_INVALID_PARAMETER\r | |
276 | is returned.\r | |
9095d37b LG |
277 | \r |
278 | If PortMultiplierPort is the port multiplier port number of the last ATA device on the port of\r | |
54f594e4 | 279 | the ATA controller, then EFI_NOT_FOUND is returned.\r |
280 | \r | |
281 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
282 | @param[in] Port The port number present on the ATA controller.\r | |
283 | @param[in,out] PortMultiplierPort On input, a pointer to the port multiplier port number of an\r | |
9095d37b LG |
284 | ATA device present on the ATA controller.\r |
285 | If on input a PortMultiplierPort of 0xFFFF is specified,\r | |
54f594e4 | 286 | then the port multiplier port number of the first ATA device\r |
287 | is returned. On output, a pointer to the port multiplier port\r | |
288 | number of the next ATA device present on an ATA controller.\r | |
289 | \r | |
290 | @retval EFI_SUCCESS The port multiplier port number of the next ATA device on the port\r | |
291 | of the ATA controller was returned in PortMultiplierPort.\r | |
292 | @retval EFI_NOT_FOUND There are no more ATA devices on this port of the ATA controller.\r | |
293 | @retval EFI_INVALID_PARAMETER PortMultiplierPort is not 0xFFFF, and PortMultiplierPort was not\r | |
294 | returned on a previous call to GetNextDevice().\r | |
295 | \r | |
296 | **/\r | |
297 | typedef\r | |
298 | EFI_STATUS\r | |
299 | (EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_DEVICE)(\r | |
300 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
301 | IN UINT16 Port,\r | |
302 | IN OUT UINT16 *PortMultiplierPort\r | |
303 | );\r | |
304 | \r | |
305 | /**\r | |
306 | Used to allocate and build a device path node for an ATA device on an ATA controller.\r | |
307 | \r | |
308 | The BuildDevicePath() function allocates and builds a single device node for the ATA\r | |
309 | device specified by Port and PortMultiplierPort. If the ATA device specified by Port and\r | |
310 | PortMultiplierPort is not present on the ATA controller, then EFI_NOT_FOUND is returned.\r | |
311 | If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned. If there are not enough\r | |
312 | resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.\r | |
313 | \r | |
314 | Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of\r | |
315 | DevicePath are initialized to describe the ATA device specified by Port and PortMultiplierPort,\r | |
316 | and EFI_SUCCESS is returned.\r | |
317 | \r | |
318 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
319 | @param[in] Port Port specifies the port number of the ATA device for which a\r | |
320 | device path node is to be allocated and built.\r | |
321 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device for which a\r | |
322 | device path node is to be allocated and built. If there is no\r | |
cc403650 | 323 | port multiplier, then specify 0xFFFF.\r |
54f594e4 | 324 | @param[in,out] DevicePath A pointer to a single device path node that describes the ATA\r |
325 | device specified by Port and PortMultiplierPort. This function\r | |
326 | is responsible for allocating the buffer DevicePath with the\r | |
fa3e7746 | 327 | boot service AllocatePool(). It is the caller's responsibility\r |
54f594e4 | 328 | to free DevicePath when the caller is finished with DevicePath.\r |
329 | @retval EFI_SUCCESS The device path node that describes the ATA device specified by\r | |
330 | Port and PortMultiplierPort was allocated and returned in DevicePath.\r | |
331 | @retval EFI_NOT_FOUND The ATA device specified by Port and PortMultiplierPort does not\r | |
332 | exist on the ATA controller.\r | |
333 | @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r | |
334 | @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.\r | |
335 | \r | |
336 | **/\r | |
337 | typedef\r | |
338 | EFI_STATUS\r | |
339 | (EFIAPI *EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH)(\r | |
340 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
341 | IN UINT16 Port,\r | |
342 | IN UINT16 PortMultiplierPort,\r | |
343 | IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r | |
344 | );\r | |
345 | \r | |
346 | /**\r | |
347 | Used to translate a device path node to a port number and port multiplier port number.\r | |
348 | \r | |
349 | The GetDevice() function determines the port and port multiplier port number associated with\r | |
350 | the ATA device described by DevicePath. If DevicePath is a device path node type that the\r | |
9095d37b | 351 | ATA Pass Thru driver supports, then the ATA Pass Thru driver will attempt to translate the contents\r |
54f594e4 | 352 | DevicePath into a port number and port multiplier port number.\r |
353 | \r | |
354 | If this translation is successful, then that port number and port multiplier port number are returned\r | |
355 | in Port and PortMultiplierPort, and EFI_SUCCESS is returned.\r | |
356 | \r | |
357 | If DevicePath, Port, or PortMultiplierPort are NULL, then EFI_INVALID_PARAMETER is returned.\r | |
358 | \r | |
9095d37b | 359 | If DevicePath is not a device path node type that the ATA Pass Thru driver supports, then\r |
54f594e4 | 360 | EFI_UNSUPPORTED is returned.\r |
361 | \r | |
9095d37b LG |
362 | If DevicePath is a device path node type that the ATA Pass Thru driver supports, but there is not\r |
363 | a valid translation from DevicePath to a port number and port multiplier port number, then\r | |
54f594e4 | 364 | EFI_NOT_FOUND is returned.\r |
365 | \r | |
366 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
367 | @param[in] DevicePath A pointer to the device path node that describes an ATA device on the\r | |
368 | ATA controller.\r | |
369 | @param[out] Port On return, points to the port number of an ATA device on the ATA controller.\r | |
370 | @param[out] PortMultiplierPort On return, points to the port multiplier port number of an ATA device\r | |
371 | on the ATA controller.\r | |
372 | \r | |
373 | @retval EFI_SUCCESS DevicePath was successfully translated to a port number and port multiplier\r | |
374 | port number, and they were returned in Port and PortMultiplierPort.\r | |
375 | @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r | |
376 | @retval EFI_INVALID_PARAMETER Port is NULL.\r | |
377 | @retval EFI_INVALID_PARAMETER PortMultiplierPort is NULL.\r | |
378 | @retval EFI_UNSUPPORTED This driver does not support the device path node type in DevicePath.\r | |
379 | @retval EFI_NOT_FOUND A valid translation from DevicePath to a port number and port multiplier\r | |
380 | port number does not exist.\r | |
381 | **/\r | |
382 | typedef\r | |
383 | EFI_STATUS\r | |
384 | (EFIAPI *EFI_ATA_PASS_THRU_GET_DEVICE)(\r | |
385 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
386 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r | |
387 | OUT UINT16 *Port,\r | |
388 | OUT UINT16 *PortMultiplierPort\r | |
389 | );\r | |
390 | \r | |
391 | /**\r | |
392 | Resets a specific port on the ATA controller. This operation also resets all the ATA devices\r | |
393 | connected to the port.\r | |
394 | \r | |
395 | The ResetChannel() function resets an a specific port on an ATA controller. This operation\r | |
396 | resets all the ATA devices connected to that port. If this ATA controller does not support\r | |
397 | a reset port operation, then EFI_UNSUPPORTED is returned.\r | |
398 | \r | |
399 | If a device error occurs while executing that port reset operation, then EFI_DEVICE_ERROR is\r | |
400 | returned.\r | |
401 | \r | |
402 | If a timeout occurs during the execution of the port reset operation, then EFI_TIMEOUT is returned.\r | |
403 | \r | |
404 | If the port reset operation is completed, then EFI_SUCCESS is returned.\r | |
405 | \r | |
406 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
407 | @param[in] Port The port number on the ATA controller.\r | |
408 | \r | |
409 | @retval EFI_SUCCESS The ATA controller port was reset.\r | |
410 | @retval EFI_UNSUPPORTED The ATA controller does not support a port reset operation.\r | |
411 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA port.\r | |
412 | @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA port.\r | |
413 | \r | |
414 | **/\r | |
415 | typedef\r | |
416 | EFI_STATUS\r | |
417 | (EFIAPI *EFI_ATA_PASS_THRU_RESET_PORT)(\r | |
418 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
419 | IN UINT16 Port\r | |
420 | );\r | |
421 | \r | |
422 | /**\r | |
423 | Resets an ATA device that is connected to an ATA controller.\r | |
424 | \r | |
425 | The ResetDevice() function resets the ATA device specified by Port and PortMultiplierPort.\r | |
426 | If this ATA controller does not support a device reset operation, then EFI_UNSUPPORTED is\r | |
427 | returned.\r | |
428 | \r | |
9095d37b | 429 | If Port or PortMultiplierPort are not in a valid range for this ATA controller, then\r |
54f594e4 | 430 | EFI_INVALID_PARAMETER is returned.\r |
431 | \r | |
432 | If a device error occurs while executing that device reset operation, then EFI_DEVICE_ERROR\r | |
433 | is returned.\r | |
434 | \r | |
435 | If a timeout occurs during the execution of the device reset operation, then EFI_TIMEOUT is\r | |
436 | returned.\r | |
437 | \r | |
438 | If the device reset operation is completed, then EFI_SUCCESS is returned.\r | |
439 | \r | |
440 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
441 | @param[in] Port Port represents the port number of the ATA device to be reset.\r | |
442 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device to reset.\r | |
cc403650 | 443 | If there is no port multiplier, then specify 0xFFFF.\r |
54f594e4 | 444 | @retval EFI_SUCCESS The ATA device specified by Port and PortMultiplierPort was reset.\r |
445 | @retval EFI_UNSUPPORTED The ATA controller does not support a device reset operation.\r | |
446 | @retval EFI_INVALID_PARAMETER Port or PortMultiplierPort are invalid.\r | |
447 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA device\r | |
448 | specified by Port and PortMultiplierPort.\r | |
449 | @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA device\r | |
450 | specified by Port and PortMultiplierPort.\r | |
451 | \r | |
452 | **/\r | |
453 | typedef\r | |
454 | EFI_STATUS\r | |
455 | (EFIAPI *EFI_ATA_PASS_THRU_RESET_DEVICE)(\r | |
456 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
457 | IN UINT16 Port,\r | |
458 | IN UINT16 PortMultiplierPort\r | |
459 | );\r | |
460 | \r | |
461 | struct _EFI_ATA_PASS_THRU_PROTOCOL {\r | |
462 | EFI_ATA_PASS_THRU_MODE *Mode;\r | |
463 | EFI_ATA_PASS_THRU_PASSTHRU PassThru;\r | |
464 | EFI_ATA_PASS_THRU_GET_NEXT_PORT GetNextPort;\r | |
465 | EFI_ATA_PASS_THRU_GET_NEXT_DEVICE GetNextDevice;\r | |
466 | EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;\r | |
467 | EFI_ATA_PASS_THRU_GET_DEVICE GetDevice;\r | |
468 | EFI_ATA_PASS_THRU_RESET_PORT ResetPort;\r | |
469 | EFI_ATA_PASS_THRU_RESET_DEVICE ResetDevice;\r | |
470 | };\r | |
471 | \r | |
472 | extern EFI_GUID gEfiAtaPassThruProtocolGuid;\r | |
473 | \r | |
474 | #endif\r |