TianoCore EDK2 master
Loading...
Searching...
No Matches
HddPasswordPei.c File Reference
#include "HddPasswordPei.h"

Go to the source code of this file.

Functions

EFI_STATUS UnlockDevice (IN EDKII_PEI_ATA_PASS_THRU_PPI *AtaPassThru, IN UINT16 Port, IN UINT16 PortMultiplierPort, IN CHAR8 Identifier, IN CHAR8 *Password)
 
EFI_STATUS FreezeLockDevice (IN EDKII_PEI_ATA_PASS_THRU_PPI *AtaPassThru, IN UINT16 Port, IN UINT16 PortMultiplierPort)
 
VOID UnlockHddPassword (IN EDKII_PEI_ATA_PASS_THRU_PPI *AtaPassThruPpi)
 
EFI_STATUS EFIAPI HddPasswordAtaPassThruNotify (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc, IN VOID *Ppi)
 
EFI_STATUS EFIAPI HddPasswordPeiInit (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
 

Variables

EFI_GUID mHddPasswordDeviceInfoGuid = HDD_PASSWORD_DEVICE_INFO_GUID
 
EFI_PEI_NOTIFY_DESCRIPTOR mHddPasswordAtaPassThruPpiNotifyDesc
 

Detailed Description

HddPassword PEI module which is used to unlock HDD password for S3.

Copyright (c) 2019, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HddPasswordPei.c.

Function Documentation

◆ FreezeLockDevice()

EFI_STATUS FreezeLockDevice ( IN EDKII_PEI_ATA_PASS_THRU_PPI AtaPassThru,
IN UINT16  Port,
IN UINT16  PortMultiplierPort 
)

Send security freeze lock cmd through ATA PassThru PPI.

Parameters
[in]AtaPassThruThe pointer to the ATA PassThru PPI.
[in]PortThe port number of the ATA device.
[in]PortMultiplierPortThe port multiplier port number of the ATA device.
Return values
EFI_SUCCESSSuccessful to send security freeze lock cmd.
EFI_INVALID_PARAMETERThe parameter passed-in is invalid.
EFI_OUT_OF_RESOURCESNot enough memory to send unlock hdd password cmd.
EFI_DEVICE_ERRORCan not send security freeze lock cmd.

Definition at line 124 of file HddPasswordPei.c.

◆ HddPasswordAtaPassThruNotify()

EFI_STATUS EFIAPI HddPasswordAtaPassThruNotify ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR NotifyDesc,
IN VOID *  Ppi 
)

Entry point of the notification callback function itself within the PEIM. It is to unlock HDD password for S3.

Parameters
PeiServicesIndirect reference to the PEI Services Table.
NotifyDescriptorAddress of the notification descriptor data structure.
PpiAddress of the PPI that was installed.
Returns
Status of the notification. The status code returned from this function is ignored.

Definition at line 318 of file HddPasswordPei.c.

◆ HddPasswordPeiInit()

EFI_STATUS EFIAPI HddPasswordPeiInit ( IN EFI_PEI_FILE_HANDLE  FileHandle,
IN CONST EFI_PEI_SERVICES **  PeiServices 
)

Main entry for this module.

Parameters
FileHandleHandle of the file being invoked.
PeiServicesPointer to PEI Services table.
Returns
Status from PeiServicesNotifyPpi.

Definition at line 350 of file HddPasswordPei.c.

◆ UnlockDevice()

EFI_STATUS UnlockDevice ( IN EDKII_PEI_ATA_PASS_THRU_PPI AtaPassThru,
IN UINT16  Port,
IN UINT16  PortMultiplierPort,
IN CHAR8  Identifier,
IN CHAR8 *  Password 
)

Send unlock hdd password cmd through ATA PassThru PPI.

Parameters
[in]AtaPassThruThe pointer to the ATA PassThru PPI.
[in]PortThe port number of the ATA device.
[in]PortMultiplierPortThe port multiplier port number of the ATA device.
[in]IdentifierThe identifier to set user or master password.
[in]PasswordThe hdd password of attached ATA device.
Return values
EFI_SUCCESSSuccessful to send unlock hdd password cmd.
EFI_INVALID_PARAMETERThe parameter passed-in is invalid.
EFI_OUT_OF_RESOURCESNot enough memory to send unlock hdd password cmd.
EFI_DEVICE_ERRORCan not send unlock hdd password cmd.

Definition at line 30 of file HddPasswordPei.c.

◆ UnlockHddPassword()

VOID UnlockHddPassword ( IN EDKII_PEI_ATA_PASS_THRU_PPI AtaPassThruPpi)

Unlock HDD password for S3.

Parameters
[in]AtaPassThruPpiPointer to the EDKII_PEI_ATA_PASS_THRU_PPI instance.

Definition at line 200 of file HddPasswordPei.c.

Variable Documentation

◆ mHddPasswordAtaPassThruPpiNotifyDesc

EFI_PEI_NOTIFY_DESCRIPTOR mHddPasswordAtaPassThruPpiNotifyDesc
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiPeiAtaPassThruPpiGuid,
}
EFI_STATUS EFIAPI HddPasswordAtaPassThruNotify(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc, IN VOID *Ppi)

Definition at line 333 of file HddPasswordPei.c.

◆ mHddPasswordDeviceInfoGuid

EFI_GUID mHddPasswordDeviceInfoGuid = HDD_PASSWORD_DEVICE_INFO_GUID

Definition at line 12 of file HddPasswordPei.c.