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