X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FBus%2FAta%2FAtaBusDxe%2FAtaBus.h;h=a5a8652099426fb7d0cd617a7a9728558213e279;hb=8c39253dff7b0f5722f44cf42bf1e440a38f95bb;hp=b64a3d39281efa1c2efe76a90a0886c60bd7dbdc;hpb=58727f29ea4da2618e18a0c0d5c819f29badaf26;p=mirror_edk2.git
diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
index b64a3d3928..a5a8652099 100644
--- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
+++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
@@ -4,14 +4,8 @@
This file defines common data structures, macro definitions and some module
internal function header files.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -35,7 +29,9 @@
#include
#include
#include
+#include
#include
+#include
#include
@@ -130,6 +126,7 @@ typedef struct {
LIST_ENTRY AtaTaskList;
LIST_ENTRY AtaSubTaskList;
+ BOOLEAN Abort;
} ATA_DEVICE;
//
@@ -163,8 +160,8 @@ typedef struct {
#define ATA_DEVICE_FROM_BLOCK_IO2(a) CR (a, ATA_DEVICE, BlockIo2, ATA_DEVICE_SIGNATURE)
#define ATA_DEVICE_FROM_DISK_INFO(a) CR (a, ATA_DEVICE, DiskInfo, ATA_DEVICE_SIGNATURE)
#define ATA_DEVICE_FROM_STORAGE_SECURITY(a) CR (a, ATA_DEVICE, StorageSecurity, ATA_DEVICE_SIGNATURE)
-#define ATA_AYNS_SUB_TASK_FROM_ENTRY(a) CR (a, ATA_BUS_ASYN_SUB_TASK, TaskEntry, ATA_SUB_TASK_SIGNATURE)
-#define ATA_AYNS_TASK_FROM_ENTRY(a) CR (a, ATA_BUS_ASYN_TASK, TaskEntry, ATA_TASK_SIGNATURE)
+#define ATA_ASYN_SUB_TASK_FROM_ENTRY(a) CR (a, ATA_BUS_ASYN_SUB_TASK, TaskEntry, ATA_SUB_TASK_SIGNATURE)
+#define ATA_ASYN_TASK_FROM_ENTRY(a) CR (a, ATA_BUS_ASYN_TASK, TaskEntry, ATA_TASK_SIGNATURE)
//
// Global Variables
@@ -283,6 +280,7 @@ AccessAtaDevice(
IN BOOLEAN IsWrite,
IN OUT EFI_BLOCK_IO2_TOKEN *Token
);
+
/**
Trust transfer data from/to ATA device.
@@ -410,7 +408,7 @@ AtaBusDriverBindingSupported (
@retval EFI_SUCCESS The device was started.
@retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
- @retval Others The driver failded to start the device.
+ @retval Others The driver failed to start the device.
**/
EFI_STATUS
@@ -616,7 +614,7 @@ AtaBlockIoReset (
@retval EFI_SUCCESS The data was read correctly from the device.
@retval EFI_DEVICE_ERROR The device reported an error while performing the read.
@retval EFI_NO_MEDIA There is no media in the device.
- @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device.
+ @retval EFI_MEDIA_CHANGED The MediaId does not match the current device.
@retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,
or the buffer is not on proper alignment.
@@ -647,7 +645,7 @@ AtaBlockIoReadBlocks (
@retval EFI_WRITE_PROTECTED The device can not be written to.
@retval EFI_DEVICE_ERROR The device reported an error while performing the write.
@retval EFI_NO_MEDIA There is no media in the device.
- @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
+ @retval EFI_MEDIA_CHANGED The MediaId does not match the current device.
@retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
@retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
or the buffer is not on proper alignment.
@@ -681,7 +679,7 @@ AtaBlockIoFlushBlocks (
);
/**
- Reset the Block Device throught Block I/O2 protocol.
+ Reset the Block Device through Block I/O2 protocol.
@param[in] This Indicates a pointer to the calling context.
@param[in] ExtendedVerification Driver may perform diagnostics on reset.
@@ -751,7 +749,7 @@ AtaBlockIoReadBlocksEx (
@retval EFI_WRITE_PROTECTED The device can not be written to.
@retval EFI_DEVICE_ERROR The device reported an error while performing the write.
@retval EFI_NO_MEDIA There is no media in the device.
- @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
+ @retval EFI_MEDIA_CHANGED The MediaId does not match the current device.
@retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
@retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
or the buffer is not on proper alignment.
@@ -786,6 +784,22 @@ AtaBlockIoFlushBlocksEx (
IN OUT EFI_BLOCK_IO2_TOKEN *Token
);
+/**
+ Terminate any in-flight non-blocking I/O requests by signaling an EFI_ABORTED
+ in the TransactionStatus member of the EFI_BLOCK_IO2_TOKEN for the non-blocking
+ I/O. After that it is safe to free any Token or Buffer data structures that
+ were allocated to initiate the non-blockingI/O requests that were in-flight for
+ this device.
+
+ @param[in] AtaDevice The ATA child device involved for the operation.
+
+**/
+VOID
+EFIAPI
+AtaTerminateNonBlockingTask (
+ IN ATA_DEVICE *AtaDevice
+ );
+
/**
Provides inquiry information for the controller type.
@@ -922,20 +936,20 @@ AtaDiskInfoWhichIde (
return EFI_SUCCESS. If the security protocol command completes with an error, the
function shall return EFI_DEVICE_ERROR.
- @param This Indicates a pointer to the calling context.
- @param MediaId ID of the medium to receive data from.
- @param Timeout The timeout, in 100ns units, to use for the execution
+ @param This Indicates a pointer to the calling context.
+ @param MediaId ID of the medium to receive data from.
+ @param Timeout The timeout, in 100ns units, to use for the execution
of the security protocol command. A Timeout value of 0
means that this function will wait indefinitely for the
security protocol command to execute. If Timeout is greater
than zero, then this function will return EFI_TIMEOUT
- if the time required to execute the receive data command
- is greater than Timeout.
+ if the time required to execute the receive data command
+ is greater than Timeout.
@param SecurityProtocolId The value of the "Security Protocol" parameter of
the security protocol command to be sent.
@param SecurityProtocolSpecificData The value of the "Security Protocol Specific" parameter
of the security protocol command to be sent.
- @param PayloadBufferSize Size in bytes of the payload data buffer.
+ @param PayloadBufferSize Size in bytes of the payload data buffer.
@param PayloadBuffer A pointer to a destination buffer to store the security
protocol command specific payload data for the security
protocol command. The caller is responsible for having
@@ -1002,20 +1016,20 @@ AtaStorageSecurityReceiveData (
EFI_SUCCESS. If the security protocol command completes with an error, the function
shall return EFI_DEVICE_ERROR.
- @param This Indicates a pointer to the calling context.
- @param MediaId ID of the medium to receive data from.
- @param Timeout The timeout, in 100ns units, to use for the execution
+ @param This Indicates a pointer to the calling context.
+ @param MediaId ID of the medium to receive data from.
+ @param Timeout The timeout, in 100ns units, to use for the execution
of the security protocol command. A Timeout value of 0
means that this function will wait indefinitely for the
security protocol command to execute. If Timeout is greater
than zero, then this function will return EFI_TIMEOUT
- if the time required to execute the receive data command
- is greater than Timeout.
+ if the time required to execute the receive data command
+ is greater than Timeout.
@param SecurityProtocolId The value of the "Security Protocol" parameter of
the security protocol command to be sent.
@param SecurityProtocolSpecificData The value of the "Security Protocol Specific" parameter
of the security protocol command to be sent.
- @param PayloadBufferSize Size in bytes of the payload data buffer.
+ @param PayloadBufferSize Size in bytes of the payload data buffer.
@param PayloadBuffer A pointer to a destination buffer to store the security
protocol command specific payload data for the security
protocol command.
@@ -1042,4 +1056,20 @@ AtaStorageSecuritySendData (
IN VOID *PayloadBuffer
);
+/**
+ Send TPer Reset command to reset eDrive to lock all protected bands.
+ Typically, there are 2 mechanism for resetting eDrive. They are:
+ 1. TPer Reset through IEEE 1667 protocol.
+ 2. TPer Reset through native TCG protocol.
+ This routine will detect what protocol the attached eDrive conform to, TCG or
+ IEEE 1667 protocol. Then send out TPer Reset command separately.
+
+ @param[in] AtaDevice ATA_DEVICE pointer.
+
+**/
+VOID
+InitiateTPerReset (
+ IN ATA_DEVICE *AtaDevice
+ );
+
#endif