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