]>
Commit | Line | Data |
---|---|---|
48555339 FT |
1 | /** @file\r |
2 | Header file for EmmcDxe Driver.\r | |
3 | \r | |
4 | This file defines common data structures, macro definitions and some module\r | |
5 | internal function header files.\r | |
6 | \r | |
275d5136 | 7 | Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r |
48555339 FT |
8 | This program and the accompanying materials\r |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef _EMMC_BLOCK_IO_H_\r | |
19 | #define _EMMC_BLOCK_IO_H_\r | |
20 | \r | |
21 | /**\r | |
22 | Reset the Block Device.\r | |
23 | \r | |
24 | @param This Indicates a pointer to the calling context.\r | |
25 | @param ExtendedVerification Driver may perform diagnostics on reset.\r | |
26 | \r | |
27 | @retval EFI_SUCCESS The device was reset.\r | |
28 | @retval EFI_DEVICE_ERROR The device is not functioning properly and could\r | |
29 | not be reset.\r | |
30 | \r | |
31 | **/\r | |
32 | EFI_STATUS\r | |
33 | EFIAPI\r | |
34 | EmmcReset (\r | |
35 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
36 | IN BOOLEAN ExtendedVerification\r | |
37 | );\r | |
38 | \r | |
39 | /**\r | |
40 | Read BufferSize bytes from Lba into Buffer.\r | |
41 | \r | |
42 | @param This Indicates a pointer to the calling context.\r | |
43 | @param MediaId Id of the media, changes every time the media is replaced.\r | |
44 | @param Lba The starting Logical Block Address to read from\r | |
45 | @param BufferSize Size of Buffer, must be a multiple of device block size.\r | |
46 | @param Buffer A pointer to the destination buffer for the data. The caller is\r | |
47 | responsible for either having implicit or explicit ownership of the buffer.\r | |
48 | \r | |
49 | @retval EFI_SUCCESS The data was read correctly from the device.\r | |
50 | @retval EFI_DEVICE_ERROR The device reported an error while performing the read.\r | |
51 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
52 | @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device.\r | |
53 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r | |
54 | @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,\r | |
55 | or the buffer is not on proper alignment.\r | |
56 | \r | |
57 | **/\r | |
58 | EFI_STATUS\r | |
59 | EFIAPI\r | |
60 | EmmcReadBlocks (\r | |
61 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
62 | IN UINT32 MediaId,\r | |
63 | IN EFI_LBA Lba,\r | |
64 | IN UINTN BufferSize,\r | |
65 | OUT VOID *Buffer\r | |
66 | );\r | |
67 | \r | |
68 | /**\r | |
69 | Write BufferSize bytes from Lba into Buffer.\r | |
70 | \r | |
71 | @param This Indicates a pointer to the calling context.\r | |
72 | @param MediaId The media ID that the write request is for.\r | |
73 | @param Lba The starting logical block address to be written. The caller is\r | |
74 | responsible for writing to only legitimate locations.\r | |
75 | @param BufferSize Size of Buffer, must be a multiple of device block size.\r | |
76 | @param Buffer A pointer to the source buffer for the data.\r | |
77 | \r | |
78 | @retval EFI_SUCCESS The data was written correctly to the device.\r | |
79 | @retval EFI_WRITE_PROTECTED The device can not be written to.\r | |
80 | @retval EFI_DEVICE_ERROR The device reported an error while performing the write.\r | |
81 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
82 | @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r | |
83 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r | |
84 | @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,\r | |
85 | or the buffer is not on proper alignment.\r | |
86 | \r | |
87 | **/\r | |
88 | EFI_STATUS\r | |
89 | EFIAPI\r | |
90 | EmmcWriteBlocks (\r | |
91 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
92 | IN UINT32 MediaId,\r | |
93 | IN EFI_LBA Lba,\r | |
94 | IN UINTN BufferSize,\r | |
95 | IN VOID *Buffer\r | |
96 | );\r | |
97 | \r | |
98 | /**\r | |
99 | Flush the Block Device.\r | |
100 | \r | |
101 | @param This Indicates a pointer to the calling context.\r | |
102 | \r | |
103 | @retval EFI_SUCCESS All outstanding data was written to the device\r | |
104 | @retval EFI_DEVICE_ERROR The device reported an error while writing back the data\r | |
105 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
106 | \r | |
107 | **/\r | |
108 | EFI_STATUS\r | |
109 | EFIAPI\r | |
110 | EmmcFlushBlocks (\r | |
111 | IN EFI_BLOCK_IO_PROTOCOL *This\r | |
112 | );\r | |
113 | \r | |
114 | /**\r | |
115 | Reset the Block Device.\r | |
116 | \r | |
117 | @param[in] This Indicates a pointer to the calling context.\r | |
118 | @param[in] ExtendedVerification Driver may perform diagnostics on reset.\r | |
119 | \r | |
120 | @retval EFI_SUCCESS The device was reset.\r | |
121 | @retval EFI_DEVICE_ERROR The device is not functioning properly and could\r | |
122 | not be reset.\r | |
123 | \r | |
124 | **/\r | |
125 | EFI_STATUS\r | |
126 | EFIAPI\r | |
127 | EmmcResetEx (\r | |
128 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r | |
129 | IN BOOLEAN ExtendedVerification\r | |
130 | );\r | |
131 | \r | |
132 | /**\r | |
133 | Read BufferSize bytes from Lba into Buffer.\r | |
134 | \r | |
135 | @param[in] This Indicates a pointer to the calling context.\r | |
136 | @param[in] MediaId Id of the media, changes every time the media is replaced.\r | |
137 | @param[in] Lba The starting Logical Block Address to read from.\r | |
138 | @param[in, out] Token A pointer to the token associated with the transaction.\r | |
139 | @param[in] BufferSize Size of Buffer, must be a multiple of device block size.\r | |
140 | @param[out] Buffer A pointer to the destination buffer for the data. The caller is\r | |
141 | responsible for either having implicit or explicit ownership of the buffer.\r | |
142 | \r | |
143 | @retval EFI_SUCCESS The read request was queued if Event is not NULL.\r | |
144 | The data was read correctly from the device if\r | |
145 | the Event is NULL.\r | |
146 | @retval EFI_DEVICE_ERROR The device reported an error while performing\r | |
147 | the read.\r | |
148 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
149 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
150 | @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of the\r | |
151 | intrinsic block size of the device.\r | |
152 | @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,\r | |
153 | or the buffer is not on proper alignment.\r | |
154 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack\r | |
155 | of resources.\r | |
156 | \r | |
157 | **/\r | |
158 | EFI_STATUS\r | |
159 | EFIAPI\r | |
160 | EmmcReadBlocksEx (\r | |
161 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r | |
162 | IN UINT32 MediaId,\r | |
163 | IN EFI_LBA Lba,\r | |
164 | IN OUT EFI_BLOCK_IO2_TOKEN *Token,\r | |
165 | IN UINTN BufferSize,\r | |
166 | OUT VOID *Buffer\r | |
167 | );\r | |
168 | \r | |
169 | /**\r | |
170 | Write BufferSize bytes from Lba into Buffer.\r | |
171 | \r | |
172 | @param[in] This Indicates a pointer to the calling context.\r | |
173 | @param[in] MediaId The media ID that the write request is for.\r | |
174 | @param[in] Lba The starting logical block address to be written. The\r | |
175 | caller is responsible for writing to only legitimate\r | |
176 | locations.\r | |
177 | @param[in, out] Token A pointer to the token associated with the transaction.\r | |
178 | @param[in] BufferSize Size of Buffer, must be a multiple of device block size.\r | |
179 | @param[in] Buffer A pointer to the source buffer for the data.\r | |
180 | \r | |
181 | @retval EFI_SUCCESS The data was written correctly to the device.\r | |
182 | @retval EFI_WRITE_PROTECTED The device can not be written to.\r | |
183 | @retval EFI_DEVICE_ERROR The device reported an error while performing the write.\r | |
184 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
185 | @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r | |
186 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r | |
187 | @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,\r | |
188 | or the buffer is not on proper alignment.\r | |
189 | \r | |
190 | **/\r | |
191 | EFI_STATUS\r | |
192 | EFIAPI\r | |
193 | EmmcWriteBlocksEx (\r | |
194 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r | |
195 | IN UINT32 MediaId,\r | |
196 | IN EFI_LBA Lba,\r | |
197 | IN OUT EFI_BLOCK_IO2_TOKEN *Token,\r | |
198 | IN UINTN BufferSize,\r | |
199 | IN VOID *Buffer\r | |
200 | );\r | |
201 | \r | |
202 | /**\r | |
203 | Flush the Block Device.\r | |
204 | \r | |
205 | @param[in] This Indicates a pointer to the calling context.\r | |
206 | @param[in, out] Token A pointer to the token associated with the transaction.\r | |
207 | \r | |
208 | @retval EFI_SUCCESS All outstanding data was written to the device\r | |
209 | @retval EFI_DEVICE_ERROR The device reported an error while writing back the data\r | |
210 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
211 | \r | |
212 | **/\r | |
213 | EFI_STATUS\r | |
214 | EFIAPI\r | |
215 | EmmcFlushBlocksEx (\r | |
216 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r | |
217 | IN OUT EFI_BLOCK_IO2_TOKEN *Token\r | |
218 | );\r | |
219 | \r | |
220 | /**\r | |
221 | Send a security protocol command to a device that receives data and/or the result\r | |
222 | of one or more commands sent by SendData.\r | |
223 | \r | |
224 | The ReceiveData function sends a security protocol command to the given MediaId.\r | |
225 | The security protocol command sent is defined by SecurityProtocolId and contains\r | |
226 | the security protocol specific data SecurityProtocolSpecificData. The function\r | |
227 | returns the data from the security protocol command in PayloadBuffer.\r | |
228 | \r | |
229 | For devices supporting the SCSI command set, the security protocol command is sent\r | |
230 | using the SECURITY PROTOCOL IN command defined in SPC-4.\r | |
231 | \r | |
232 | For devices supporting the ATA command set, the security protocol command is sent\r | |
233 | using one of the TRUSTED RECEIVE commands defined in ATA8-ACS if PayloadBufferSize\r | |
234 | is non-zero.\r | |
235 | \r | |
236 | If the PayloadBufferSize is zero, the security protocol command is sent using the\r | |
237 | Trusted Non-Data command defined in ATA8-ACS.\r | |
238 | \r | |
239 | If PayloadBufferSize is too small to store the available data from the security\r | |
240 | protocol command, the function shall copy PayloadBufferSize bytes into the\r | |
241 | PayloadBuffer and return EFI_WARN_BUFFER_TOO_SMALL.\r | |
242 | \r | |
243 | If PayloadBuffer or PayloadTransferSize is NULL and PayloadBufferSize is non-zero,\r | |
244 | the function shall return EFI_INVALID_PARAMETER.\r | |
245 | \r | |
246 | If the given MediaId does not support security protocol commands, the function shall\r | |
247 | return EFI_UNSUPPORTED. If there is no media in the device, the function returns\r | |
248 | EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the device,\r | |
249 | the function returns EFI_MEDIA_CHANGED.\r | |
250 | \r | |
251 | If the security protocol fails to complete within the Timeout period, the function\r | |
252 | shall return EFI_TIMEOUT.\r | |
253 | \r | |
254 | If the security protocol command completes without an error, the function shall\r | |
255 | return EFI_SUCCESS. If the security protocol command completes with an error, the\r | |
256 | function shall return EFI_DEVICE_ERROR.\r | |
257 | \r | |
258 | @param[in] This Indicates a pointer to the calling context.\r | |
259 | @param[in] MediaId ID of the medium to receive data from.\r | |
260 | @param[in] Timeout The timeout, in 100ns units, to use for the execution\r | |
261 | of the security protocol command. A Timeout value of 0\r | |
262 | means that this function will wait indefinitely for the\r | |
263 | security protocol command to execute. If Timeout is greater\r | |
264 | than zero, then this function will return EFI_TIMEOUT\r | |
265 | if the time required to execute the receive data command\r | |
266 | is greater than Timeout.\r | |
267 | @param[in] SecurityProtocolId The value of the "Security Protocol" parameter of\r | |
268 | the security protocol command to be sent.\r | |
269 | @param[in] SecurityProtocolSpecificData The value of the "Security Protocol Specific" parameter\r | |
270 | of the security protocol command to be sent.\r | |
271 | @param[in] PayloadBufferSize Size in bytes of the payload data buffer.\r | |
272 | @param[out] PayloadBuffer A pointer to a destination buffer to store the security\r | |
273 | protocol command specific payload data for the security\r | |
274 | protocol command. The caller is responsible for having\r | |
275 | either implicit or explicit ownership of the buffer.\r | |
276 | @param[out] PayloadTransferSize A pointer to a buffer to store the size in bytes of the\r | |
277 | data written to the payload data buffer.\r | |
278 | @param[in] IsRead Indicates it is a read or write operation.\r | |
279 | \r | |
280 | @retval EFI_SUCCESS The security protocol command completed successfully.\r | |
281 | @retval EFI_WARN_BUFFER_TOO_SMALL The PayloadBufferSize was too small to store the available\r | |
282 | data from the device. The PayloadBuffer contains the truncated data.\r | |
283 | @retval EFI_UNSUPPORTED The given MediaId does not support security protocol commands.\r | |
284 | @retval EFI_DEVICE_ERROR The security protocol command completed with an error.\r | |
285 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
286 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
287 | @retval EFI_INVALID_PARAMETER The PayloadBuffer or PayloadTransferSize is NULL and\r | |
288 | PayloadBufferSize is non-zero.\r | |
289 | @retval EFI_TIMEOUT A timeout occurred while waiting for the security\r | |
290 | protocol command to execute.\r | |
291 | \r | |
292 | **/\r | |
293 | EFI_STATUS\r | |
294 | EFIAPI\r | |
295 | EmmcSecurityProtocolInOut (\r | |
296 | IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This,\r | |
297 | IN UINT32 MediaId,\r | |
298 | IN UINT64 Timeout,\r | |
299 | IN UINT8 SecurityProtocolId,\r | |
300 | IN UINT16 SecurityProtocolSpecificData,\r | |
301 | IN UINTN PayloadBufferSize,\r | |
302 | OUT VOID *PayloadBuffer,\r | |
303 | OUT UINTN *PayloadTransferSize,\r | |
304 | IN BOOLEAN IsRead\r | |
305 | );\r | |
306 | \r | |
307 | /**\r | |
308 | Send a security protocol command to a device that receives data and/or the result\r | |
309 | of one or more commands sent by SendData.\r | |
310 | \r | |
311 | The ReceiveData function sends a security protocol command to the given MediaId.\r | |
312 | The security protocol command sent is defined by SecurityProtocolId and contains\r | |
313 | the security protocol specific data SecurityProtocolSpecificData. The function\r | |
314 | returns the data from the security protocol command in PayloadBuffer.\r | |
315 | \r | |
316 | For devices supporting the SCSI command set, the security protocol command is sent\r | |
317 | using the SECURITY PROTOCOL IN command defined in SPC-4.\r | |
318 | \r | |
319 | For devices supporting the ATA command set, the security protocol command is sent\r | |
320 | using one of the TRUSTED RECEIVE commands defined in ATA8-ACS if PayloadBufferSize\r | |
321 | is non-zero.\r | |
322 | \r | |
323 | If the PayloadBufferSize is zero, the security protocol command is sent using the\r | |
324 | Trusted Non-Data command defined in ATA8-ACS.\r | |
325 | \r | |
326 | If PayloadBufferSize is too small to store the available data from the security\r | |
327 | protocol command, the function shall copy PayloadBufferSize bytes into the\r | |
328 | PayloadBuffer and return EFI_WARN_BUFFER_TOO_SMALL.\r | |
329 | \r | |
330 | If PayloadBuffer or PayloadTransferSize is NULL and PayloadBufferSize is non-zero,\r | |
331 | the function shall return EFI_INVALID_PARAMETER.\r | |
332 | \r | |
333 | If the given MediaId does not support security protocol commands, the function shall\r | |
334 | return EFI_UNSUPPORTED. If there is no media in the device, the function returns\r | |
335 | EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the device,\r | |
336 | the function returns EFI_MEDIA_CHANGED.\r | |
337 | \r | |
338 | If the security protocol fails to complete within the Timeout period, the function\r | |
339 | shall return EFI_TIMEOUT.\r | |
340 | \r | |
341 | If the security protocol command completes without an error, the function shall\r | |
342 | return EFI_SUCCESS. If the security protocol command completes with an error, the\r | |
343 | function shall return EFI_DEVICE_ERROR.\r | |
344 | \r | |
345 | @param This Indicates a pointer to the calling context.\r | |
346 | @param MediaId ID of the medium to receive data from.\r | |
347 | @param Timeout The timeout, in 100ns units, to use for the execution\r | |
348 | of the security protocol command. A Timeout value of 0\r | |
349 | means that this function will wait indefinitely for the\r | |
350 | security protocol command to execute. If Timeout is greater\r | |
351 | than zero, then this function will return EFI_TIMEOUT\r | |
352 | if the time required to execute the receive data command\r | |
353 | is greater than Timeout.\r | |
354 | @param SecurityProtocolId The value of the "Security Protocol" parameter of\r | |
355 | the security protocol command to be sent.\r | |
356 | @param SecurityProtocolSpecificData The value of the "Security Protocol Specific" parameter\r | |
357 | of the security protocol command to be sent.\r | |
358 | @param PayloadBufferSize Size in bytes of the payload data buffer.\r | |
359 | @param PayloadBuffer A pointer to a destination buffer to store the security\r | |
360 | protocol command specific payload data for the security\r | |
361 | protocol command. The caller is responsible for having\r | |
362 | either implicit or explicit ownership of the buffer.\r | |
363 | @param PayloadTransferSize A pointer to a buffer to store the size in bytes of the\r | |
364 | data written to the payload data buffer.\r | |
365 | \r | |
366 | @retval EFI_SUCCESS The security protocol command completed successfully.\r | |
367 | @retval EFI_WARN_BUFFER_TOO_SMALL The PayloadBufferSize was too small to store the available\r | |
368 | data from the device. The PayloadBuffer contains the truncated data.\r | |
369 | @retval EFI_UNSUPPORTED The given MediaId does not support security protocol commands.\r | |
370 | @retval EFI_DEVICE_ERROR The security protocol command completed with an error.\r | |
371 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
372 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
373 | @retval EFI_INVALID_PARAMETER The PayloadBuffer or PayloadTransferSize is NULL and\r | |
374 | PayloadBufferSize is non-zero.\r | |
375 | @retval EFI_TIMEOUT A timeout occurred while waiting for the security\r | |
376 | protocol command to execute.\r | |
377 | \r | |
378 | **/\r | |
379 | EFI_STATUS\r | |
380 | EFIAPI\r | |
381 | EmmcSecurityProtocolIn (\r | |
382 | IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This,\r | |
383 | IN UINT32 MediaId,\r | |
384 | IN UINT64 Timeout,\r | |
385 | IN UINT8 SecurityProtocolId,\r | |
386 | IN UINT16 SecurityProtocolSpecificData,\r | |
387 | IN UINTN PayloadBufferSize,\r | |
388 | OUT VOID *PayloadBuffer,\r | |
389 | OUT UINTN *PayloadTransferSize\r | |
390 | );\r | |
391 | \r | |
392 | /**\r | |
393 | Send a security protocol command to a device.\r | |
394 | \r | |
395 | The SendData function sends a security protocol command containing the payload\r | |
396 | PayloadBuffer to the given MediaId. The security protocol command sent is\r | |
397 | defined by SecurityProtocolId and contains the security protocol specific data\r | |
398 | SecurityProtocolSpecificData. If the underlying protocol command requires a\r | |
399 | specific padding for the command payload, the SendData function shall add padding\r | |
400 | bytes to the command payload to satisfy the padding requirements.\r | |
401 | \r | |
402 | For devices supporting the SCSI command set, the security protocol command is sent\r | |
403 | using the SECURITY PROTOCOL OUT command defined in SPC-4.\r | |
404 | \r | |
405 | For devices supporting the ATA command set, the security protocol command is sent\r | |
406 | using one of the TRUSTED SEND commands defined in ATA8-ACS if PayloadBufferSize\r | |
407 | is non-zero. If the PayloadBufferSize is zero, the security protocol command is\r | |
408 | sent using the Trusted Non-Data command defined in ATA8-ACS.\r | |
409 | \r | |
410 | If PayloadBuffer is NULL and PayloadBufferSize is non-zero, the function shall\r | |
411 | return EFI_INVALID_PARAMETER.\r | |
412 | \r | |
413 | If the given MediaId does not support security protocol commands, the function\r | |
414 | shall return EFI_UNSUPPORTED. If there is no media in the device, the function\r | |
415 | returns EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the\r | |
416 | device, the function returns EFI_MEDIA_CHANGED.\r | |
417 | \r | |
418 | If the security protocol fails to complete within the Timeout period, the function\r | |
419 | shall return EFI_TIMEOUT.\r | |
420 | \r | |
421 | If the security protocol command completes without an error, the function shall return\r | |
422 | EFI_SUCCESS. If the security protocol command completes with an error, the function\r | |
423 | shall return EFI_DEVICE_ERROR.\r | |
424 | \r | |
425 | @param This Indicates a pointer to the calling context.\r | |
426 | @param MediaId ID of the medium to receive data from.\r | |
427 | @param Timeout The timeout, in 100ns units, to use for the execution\r | |
428 | of the security protocol command. A Timeout value of 0\r | |
429 | means that this function will wait indefinitely for the\r | |
430 | security protocol command to execute. If Timeout is greater\r | |
431 | than zero, then this function will return EFI_TIMEOUT\r | |
432 | if the time required to execute the receive data command\r | |
433 | is greater than Timeout.\r | |
434 | @param SecurityProtocolId The value of the "Security Protocol" parameter of\r | |
435 | the security protocol command to be sent.\r | |
436 | @param SecurityProtocolSpecificData The value of the "Security Protocol Specific" parameter\r | |
437 | of the security protocol command to be sent.\r | |
438 | @param PayloadBufferSize Size in bytes of the payload data buffer.\r | |
439 | @param PayloadBuffer A pointer to a destination buffer to store the security\r | |
440 | protocol command specific payload data for the security\r | |
441 | protocol command.\r | |
442 | \r | |
443 | @retval EFI_SUCCESS The security protocol command completed successfully.\r | |
444 | @retval EFI_UNSUPPORTED The given MediaId does not support security protocol commands.\r | |
445 | @retval EFI_DEVICE_ERROR The security protocol command completed with an error.\r | |
446 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
447 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
448 | @retval EFI_INVALID_PARAMETER The PayloadBuffer is NULL and PayloadBufferSize is non-zero.\r | |
449 | @retval EFI_TIMEOUT A timeout occurred while waiting for the security\r | |
450 | protocol command to execute.\r | |
451 | \r | |
452 | **/\r | |
453 | EFI_STATUS\r | |
454 | EFIAPI\r | |
455 | EmmcSecurityProtocolOut (\r | |
456 | IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This,\r | |
457 | IN UINT32 MediaId,\r | |
458 | IN UINT64 Timeout,\r | |
459 | IN UINT8 SecurityProtocolId,\r | |
460 | IN UINT16 SecurityProtocolSpecificData,\r | |
461 | IN UINTN PayloadBufferSize,\r | |
462 | IN VOID *PayloadBuffer\r | |
463 | );\r | |
464 | \r | |
275d5136 FT |
465 | /**\r |
466 | Erase a specified number of device blocks.\r | |
467 | \r | |
468 | @param[in] This Indicates a pointer to the calling context.\r | |
469 | @param[in] MediaId The media ID that the erase request is for.\r | |
470 | @param[in] Lba The starting logical block address to be\r | |
471 | erased. The caller is responsible for erasing\r | |
472 | only legitimate locations.\r | |
473 | @param[in, out] Token A pointer to the token associated with the\r | |
474 | transaction.\r | |
475 | @param[in] Size The size in bytes to be erased. This must be\r | |
476 | a multiple of the physical block size of the\r | |
477 | device.\r | |
478 | \r | |
479 | @retval EFI_SUCCESS The erase request was queued if Event is not\r | |
480 | NULL. The data was erased correctly to the\r | |
481 | device if the Event is NULL.to the device.\r | |
482 | @retval EFI_WRITE_PROTECTED The device cannot be erased due to write\r | |
483 | protection.\r | |
484 | @retval EFI_DEVICE_ERROR The device reported an error while attempting\r | |
485 | to perform the erase operation.\r | |
486 | @retval EFI_INVALID_PARAMETER The erase request contains LBAs that are not\r | |
487 | valid.\r | |
488 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
489 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
490 | \r | |
491 | **/\r | |
492 | EFI_STATUS\r | |
493 | EFIAPI\r | |
494 | EmmcEraseBlocks (\r | |
495 | IN EFI_ERASE_BLOCK_PROTOCOL *This,\r | |
496 | IN UINT32 MediaId,\r | |
497 | IN EFI_LBA Lba,\r | |
498 | IN OUT EFI_ERASE_BLOCK_TOKEN *Token,\r | |
499 | IN UINTN Size\r | |
500 | );\r | |
501 | \r | |
48555339 FT |
502 | #endif\r |
503 | \r |