X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FAta%2FAtaBusDxe%2FAtaBus.c;fp=MdeModulePkg%2FBus%2FAta%2FAtaBusDxe%2FAtaBus.c;h=625ba1b5b18b4527e6fb7ba24765b8541b8fe076;hp=17e2614b87d288d3ed2e0648fef96f1f0c036877;hb=2ca8548911013db4211172e8546fcff3db27f302;hpb=0357efe3f564bed2e20e4dfad6496bf6db179747 diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c index 17e2614b87..625ba1b5b1 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c @@ -19,7 +19,6 @@ #include "AtaBus.h" UINT8 mMorControl; -BOOLEAN mHasMor; // // ATA Bus Driver Binding Protocol Instance @@ -370,16 +369,15 @@ RegisterAtaDevice ( DEBUG ((EFI_D_INFO, "Successfully Install Storage Security Protocol on the ATA device\n")); } - if (mHasMor) { - if (((mMorControl & 0x01) == 0x01) && ((AtaDevice->IdentifyData->trusted_computing_support & BIT0) != 0)) { - DEBUG ((EFI_D_INFO, - "mMorControl = %x, AtaDevice->IdentifyData->trusted_computing_support & BIT0 = %x\n", - mMorControl, - (AtaDevice->IdentifyData->trusted_computing_support & BIT0) - )); - DEBUG ((EFI_D_INFO, "Try to lock device by sending TPer Reset command...\n")); - InitiateTPerReset(AtaDevice); - } + + if (((mMorControl & 0x01) == 0x01) && ((AtaDevice->IdentifyData->trusted_computing_support & BIT0) != 0)) { + DEBUG ((EFI_D_INFO, + "mMorControl = %x, AtaDevice->IdentifyData->trusted_computing_support & BIT0 = %x\n", + mMorControl, + (AtaDevice->IdentifyData->trusted_computing_support & BIT0) + )); + DEBUG ((EFI_D_INFO, "Try to lock device by sending TPer Reset command...\n")); + InitiateTPerReset(AtaDevice); } gBS->OpenProtocol ( @@ -1683,12 +1681,10 @@ InitializeAtaBus( if (EFI_ERROR (Status)) { DEBUG ((EFI_D_INFO, "AtaBus:gEfiMemoryOverwriteControlDataGuid doesn't exist!!***\n")); - mHasMor = FALSE; mMorControl = 0; Status = EFI_SUCCESS; } else { DEBUG ((EFI_D_INFO, "AtaBus:Get the gEfiMemoryOverwriteControlDataGuid = %x!!***\n", mMorControl)); - mHasMor = TRUE; } return Status;