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