EFI_TPL OldTpl;\r
\r
FreeUnicodeStringTable (AtaDevice->ControllerNameTable);\r
- FreeAlignedBuffer (AtaDevice->Asb, sizeof (*AtaDevice->Asb));\r
- FreeAlignedBuffer (AtaDevice->IdentifyData, sizeof (*AtaDevice->IdentifyData));\r
+ FreeAlignedBuffer (AtaDevice->Asb, sizeof (EFI_ATA_STATUS_BLOCK));\r
+ FreeAlignedBuffer (AtaDevice->IdentifyData, sizeof (ATA_IDENTIFY_DATA));\r
if (AtaDevice->DevicePath != NULL) {\r
FreePool (AtaDevice->DevicePath);\r
}\r
//\r
// Free the Subtask list.\r
//\r
- for(Entry = (&AtaDevice->AtaTaskList)->ForwardLink; \r
+ for(Entry = AtaDevice->AtaTaskList.ForwardLink; \r
Entry != (&AtaDevice->AtaTaskList);\r
) {\r
DelEntry = Entry;\r
//\r
// Allocate ATA device from the template.\r
//\r
- AtaDevice = AllocateCopyPool (sizeof (gAtaDeviceTemplate), &gAtaDeviceTemplate);\r
+ AtaDevice = AllocateCopyPool (sizeof (ATA_DEVICE), &gAtaDeviceTemplate);\r
if (AtaDevice == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
AtaDevice->DevicePath = DevicePath;\r
AtaDevice->Port = Port;\r
AtaDevice->PortMultiplierPort = PortMultiplierPort;\r
- AtaDevice->Asb = AllocateAlignedBuffer (AtaDevice, sizeof (*AtaDevice->Asb));\r
+ AtaDevice->Asb = AllocateAlignedBuffer (AtaDevice, sizeof (EFI_ATA_STATUS_BLOCK));\r
if (AtaDevice->Asb == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
}\r
- AtaDevice->IdentifyData = AllocateAlignedBuffer (AtaDevice, sizeof (*AtaDevice->IdentifyData));\r
+ AtaDevice->IdentifyData = AllocateAlignedBuffer (AtaDevice, sizeof (ATA_IDENTIFY_DATA));\r
if (AtaDevice->IdentifyData == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
Handle,\r
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
);\r
- return Status;\r
+ return Status;\r
}\r
}\r
\r
)\r
{\r
//\r
- // Signla event and return directly.\r
+ // Signal event and return directly.\r
//\r
if (Token != NULL && Token->Event != NULL) {\r
Token->TransactionStatus = EFI_SUCCESS;\r
AtaDevice = ATA_DEVICE_FROM_DISK_INFO (This);\r
\r
Status = EFI_BUFFER_TOO_SMALL;\r
- if (*IdentifyDataSize >= sizeof (*AtaDevice->IdentifyData)) {\r
+ if (*IdentifyDataSize >= sizeof (ATA_IDENTIFY_DATA)) {\r
Status = EFI_SUCCESS;\r
- CopyMem (IdentifyData, AtaDevice->IdentifyData, sizeof (*AtaDevice->IdentifyData));\r
+ CopyMem (IdentifyData, AtaDevice->IdentifyData, sizeof (ATA_IDENTIFY_DATA));\r
}\r
- *IdentifyDataSize = sizeof (*AtaDevice->IdentifyData);\r
+ *IdentifyDataSize = sizeof (ATA_IDENTIFY_DATA);\r
\r
return Status;\r
}\r
{\r
EFI_STATUS Status;\r
ATA_DEVICE *Private;\r
+ EFI_TPL OldTpl;\r
\r
DEBUG ((EFI_D_INFO, "EFI Storage Security Protocol - Read"));\r
if ((PayloadBuffer == NULL || PayloadTransferSize == NULL) && PayloadBufferSize != 0) {\r
return EFI_NO_MEDIA;\r
}\r
\r
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
+\r
Status = TrustTransferAtaDevice (\r
Private,\r
PayloadBuffer,\r
PayloadTransferSize\r
);\r
\r
+ gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
\r
{\r
EFI_STATUS Status;\r
ATA_DEVICE *Private;\r
+ EFI_TPL OldTpl;\r
\r
DEBUG ((EFI_D_INFO, "EFI Storage Security Protocol - Send"));\r
if ((PayloadBuffer == NULL) && (PayloadBufferSize != 0)) {\r
return EFI_MEDIA_CHANGED;\r
}\r
\r
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
Status = TrustTransferAtaDevice (\r
Private,\r
PayloadBuffer,\r
NULL\r
);\r
\r
+ gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
\r