This file implements protocol interfaces: Driver Binding protocol,\r
Block IO protocol and DiskInfo protocol.\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
\r
**/\r
NULL, // ControllerNameTable\r
{L'\0', }, // ModelName\r
{NULL, NULL}, // AtaTaskList\r
- {NULL, NULL} // AtaSubTaskList\r
+ {NULL, NULL}, // AtaSubTaskList\r
+ FALSE // Abort\r
};\r
\r
/**\r
) {\r
DelEntry = Entry;\r
Entry = Entry->ForwardLink;\r
- SubTask = ATA_AYNS_SUB_TASK_FROM_ENTRY (DelEntry);\r
+ SubTask = ATA_ASYN_SUB_TASK_FROM_ENTRY (DelEntry);\r
\r
RemoveEntryList (DelEntry);\r
FreeAtaSubTask (SubTask);\r
) {\r
DelEntry = Entry;\r
Entry = Entry->ForwardLink;\r
- AtaTask = ATA_AYNS_TASK_FROM_ENTRY (DelEntry);\r
+ AtaTask = ATA_ASYN_TASK_FROM_ENTRY (DelEntry);\r
\r
RemoveEntryList (DelEntry);\r
FreePool (AtaTask);\r
InitializeListHead (&AtaDevice->AtaTaskList);\r
InitializeListHead (&AtaDevice->AtaSubTaskList);\r
\r
+ //\r
+ // Report Status Code to indicate the ATA device will be enabled\r
+ //\r
+ REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+ EFI_PROGRESS_CODE,\r
+ (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_ENABLE),\r
+ AtaBusDriverData->ParentDevicePath\r
+ );\r
+\r
//\r
// Try to identify the ATA device via the ATA pass through command.\r
//\r
if (EFI_ERROR (Status)) {\r
goto Done;\r
}\r
+ DEBUG ((EFI_D_INFO, "Successfully Install Storage Security Protocol on the ATA device\n"));\r
}\r
\r
gBS->OpenProtocol (\r
if (BlockIo != NULL) {\r
AtaDevice = ATA_DEVICE_FROM_BLOCK_IO (BlockIo);\r
} else {\r
+ ASSERT (BlockIo2 != NULL);\r
AtaDevice = ATA_DEVICE_FROM_BLOCK_IO2 (BlockIo2);\r
}\r
\r
return Status;\r
}\r
\r
+ //\r
+ // Test to see if this ATA Pass Thru Protocol is for a LOGICAL channel\r
+ //\r
+ if ((AtaPassThru->Mode->Attributes & EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL) == 0) {\r
+ //\r
+ // Close the I/O Abstraction(s) used to perform the supported test\r
+ //\r
+ gBS->CloseProtocol (\r
+ Controller,\r
+ &gEfiAtaPassThruProtocolGuid,\r
+ This->DriverBindingHandle,\r
+ Controller\r
+ );\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
//\r
// Test RemainingDevicePath is valid or not.\r
//\r
if ((RemainingDevicePath != NULL) && !IsDevicePathEnd (RemainingDevicePath)) {\r
Status = AtaPassThru->GetDevice (AtaPassThru, RemainingDevicePath, &Port, &PortMultiplierPort);\r
if (EFI_ERROR (Status)) {\r
+ //\r
+ // Close the I/O Abstraction(s) used to perform the supported test\r
+ //\r
+ gBS->CloseProtocol (\r
+ Controller,\r
+ &gEfiAtaPassThruProtocolGuid,\r
+ This->DriverBindingHandle,\r
+ Controller\r
+ );\r
return Status;\r
}\r
}\r
return Status;\r
}\r
\r
+ //\r
+ // Report Status Code to indicate ATA bus starts\r
+ //\r
+ REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+ EFI_PROGRESS_CODE,\r
+ (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_INIT),\r
+ ParentDevicePath\r
+ );\r
+\r
Status = gBS->OpenProtocol (\r
Controller,\r
&gEfiAtaPassThruProtocolGuid,\r
}\r
}\r
\r
+ //\r
+ // Report Status Code to indicate detecting devices on bus\r
+ //\r
+ REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+ EFI_PROGRESS_CODE,\r
+ (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_DETECT),\r
+ ParentDevicePath\r
+ );\r
+\r
if (RemainingDevicePath == NULL) {\r
Port = 0xFFFF;\r
while (TRUE) {\r
@param[in, out] Token A pointer to the token associated with the transaction.\r
@param[in] BufferSize Size of Buffer, must be a multiple of device block size.\r
@param[out] Buffer A pointer to the destination/source buffer for the data.\r
- @param[in] IsBlockIo2 Indicate the calling is from BlockIO or BlockIO2. TURE is\r
+ @param[in] IsBlockIo2 Indicate the calling is from BlockIO or BlockIO2. TRUE is\r
from BlockIO2, FALSE is for BlockIO.\r
@param[in] IsWrite Indicates whether it is a write operation.\r
\r
}\r
\r
if (BufferSize == 0) {\r
+ if ((Token != NULL) && (Token->Event != NULL)) {\r
+ Token->TransactionStatus = EFI_SUCCESS;\r
+ gBS->SignalEvent (Token->Event);\r
+ }\r
return EFI_SUCCESS;\r
}\r
\r
\r
AtaDevice = ATA_DEVICE_FROM_BLOCK_IO2 (This);\r
\r
+ AtaTerminateNonBlockingTask (AtaDevice);\r
+\r
Status = ResetAtaDevice (AtaDevice);\r
\r
if (EFI_ERROR (Status)) {\r
ATA_DEVICE *Private;\r
EFI_TPL OldTpl;\r
\r
- DEBUG ((EFI_D_INFO, "EFI Storage Security Protocol - Read"));\r
+ DEBUG ((EFI_D_INFO, "EFI Storage Security Protocol - Read\n"));\r
if ((PayloadBuffer == NULL || PayloadTransferSize == NULL) && PayloadBufferSize != 0) {\r
return EFI_INVALID_PARAMETER;\r
}\r
ATA_DEVICE *Private;\r
EFI_TPL OldTpl;\r
\r
- DEBUG ((EFI_D_INFO, "EFI Storage Security Protocol - Send"));\r
+ DEBUG ((EFI_D_INFO, "EFI Storage Security Protocol - Send\n"));\r
if ((PayloadBuffer == NULL) && (PayloadBufferSize != 0)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
return Status;\r
}\r
+\r