SecurityPkg: OpalPasswordDxe: Add Opal password dxe driver.

This driver used to enables opal feature in bios.
It adds setup menu and unlock device process in boot phase.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
This commit is contained in:
Eric Dong 2016-03-29 14:48:20 +08:00 committed by Feng Tian
parent 1cf00fbdb3
commit a06875e1f0
12 changed files with 4675 additions and 0 deletions

View File

@ -0,0 +1,398 @@
/** @file
UEFI Component Name(2) protocol implementation for Opal driver.
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
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.
**/
#include "OpalDriver.h"
//
// EFI Component Name Protocol
//
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gOpalComponentName = {
OpalEfiDriverComponentNameGetDriverName,
OpalEfiDriverComponentNameGetControllerName,
"eng"
};
//
// EFI Component Name 2 Protocol
//
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gOpalComponentName2 = {
OpalEfiDriverComponentName2GetDriverName,
OpalEfiDriverComponentName2GetControllerName,
"en"
};
/// The name of the driver in all the languages we support.
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mOpalDriverNameTable[] = {
{ LANGUAGE_RFC_3066_ENGLISH, (CHAR16*)EFI_DRIVER_NAME_UNICODE },
{ LANGUAGE_ISO_639_2_ENGLISH, (CHAR16*)EFI_DRIVER_NAME_UNICODE },
{ 0, 0 }
};
/**
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a
Unicode string. If the driver specified by This has a user readable name in
the language specified by Language, then a pointer to the driver name is
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
by This does not support the language specified by Language,
then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified
in RFC 4646 or ISO 639-2 language code format.
@param DriverName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
driver specified by This in the language
specified by Language.
@retval EFI_SUCCESS The Unicode string for the Driver specified by
This and the language specified by Language was
returned in DriverName.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER DriverName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverComponentNameGetDriverName(
EFI_COMPONENT_NAME_PROTOCOL* This,
CHAR8* Language,
CHAR16** DriverName
)
{
return LookupUnicodeString2(
Language,
This->SupportedLanguages,
mOpalDriverNameTable,
DriverName,
TRUE
);
}
/**
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a
Unicode string. If the driver specified by This has a user readable name in
the language specified by Language, then a pointer to the driver name is
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
by This does not support the language specified by Language,
then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified
in RFC 4646 or ISO 639-2 language code format.
@param DriverName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
driver specified by This in the language
specified by Language.
@retval EFI_SUCCESS The Unicode string for the Driver specified by
This and the language specified by Language was
returned in DriverName.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER DriverName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverComponentName2GetDriverName(
EFI_COMPONENT_NAME2_PROTOCOL* This,
CHAR8* Language,
CHAR16** DriverName
)
{
return LookupUnicodeString2(
Language,
This->SupportedLanguages,
mOpalDriverNameTable,
DriverName,
FALSE
);
}
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
This function retrieves the user readable name of the controller specified by
ControllerHandle and ChildHandle in the form of a Unicode string. If the
driver specified by This has a user readable name in the language specified by
Language, then a pointer to the controller name is returned in ControllerName,
and EFI_SUCCESS is returned. If the driver specified by This is not currently
managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
support the language specified by Language, then EFI_UNSUPPORTED is returned.
@param ControllerHandle[in] The handle of a controller that the driver
specified by This is managing. This handle
specifies the controller whose name is to be
returned.
@param ChildHandle[in] The handle of the child controller to retrieve
the name of. This is an optional parameter that
may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers
that wish to retrieve the name of the bus
controller. It will not be NULL for a bus
driver that wishes to retrieve the name of a
child controller.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified in
RFC 4646 or ISO 639-2 language code format.
@param ControllerName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
controller specified by ControllerHandle and
ChildHandle in the language specified by
Language from the point of view of the driver
specified by This.
@retval EFI_SUCCESS The Unicode string for the user readable name in
the language specified by Language for the
driver specified by This was returned in
DriverName.
@retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
GetControllerName(
EFI_HANDLE ControllerHandle,
EFI_HANDLE ChildHandle,
CHAR8* Language,
CHAR16** ControllerName
)
{
if (Language == NULL || ControllerName == NULL || ControllerHandle == NULL) {
return EFI_INVALID_PARAMETER;
}
// don't support any controller or children names
return EFI_UNSUPPORTED;
}
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
This function retrieves the user readable name of the controller specified by
ControllerHandle and ChildHandle in the form of a Unicode string. If the
driver specified by This has a user readable name in the language specified by
Language, then a pointer to the controller name is returned in ControllerName,
and EFI_SUCCESS is returned. If the driver specified by This is not currently
managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
support the language specified by Language, then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param ControllerHandle[in] The handle of a controller that the driver
specified by This is managing. This handle
specifies the controller whose name is to be
returned.
@param ChildHandle[in] The handle of the child controller to retrieve
the name of. This is an optional parameter that
may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers
that wish to retrieve the name of the bus
controller. It will not be NULL for a bus
driver that wishes to retrieve the name of a
child controller.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified in
RFC 4646 or ISO 639-2 language code format.
@param ControllerName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
controller specified by ControllerHandle and
ChildHandle in the language specified by
Language from the point of view of the driver
specified by This.
@retval EFI_SUCCESS The Unicode string for the user readable name in
the language specified by Language for the
driver specified by This was returned in
DriverName.
@retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverComponentNameGetControllerName(
EFI_COMPONENT_NAME_PROTOCOL* This,
EFI_HANDLE ControllerHandle,
EFI_HANDLE ChildHandle,
CHAR8* Language,
CHAR16** ControllerName
)
{
return (GetControllerName( ControllerHandle, ChildHandle, Language, ControllerName));
}
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
This function retrieves the user readable name of the controller specified by
ControllerHandle and ChildHandle in the form of a Unicode string. If the
driver specified by This has a user readable name in the language specified by
Language, then a pointer to the controller name is returned in ControllerName,
and EFI_SUCCESS is returned. If the driver specified by This is not currently
managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
support the language specified by Language, then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param ControllerHandle[in] The handle of a controller that the driver
specified by This is managing. This handle
specifies the controller whose name is to be
returned.
@param ChildHandle[in] The handle of the child controller to retrieve
the name of. This is an optional parameter that
may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers
that wish to retrieve the name of the bus
controller. It will not be NULL for a bus
driver that wishes to retrieve the name of a
child controller.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified in
RFC 4646 or ISO 639-2 language code format.
@param ControllerName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
controller specified by ControllerHandle and
ChildHandle in the language specified by
Language from the point of view of the driver
specified by This.
@retval EFI_SUCCESS The Unicode string for the user readable name in
the language specified by Language for the
driver specified by This was returned in
DriverName.
@retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverComponentName2GetControllerName(
EFI_COMPONENT_NAME2_PROTOCOL* This,
EFI_HANDLE ControllerHandle,
EFI_HANDLE ChildHandle,
CHAR8* Language,
CHAR16** ControllerName
)
{
return (GetControllerName(ControllerHandle, ChildHandle, Language, ControllerName));
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,413 @@
/** @file
Values defined and used by the Opal UEFI Driver.
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
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.
**/
#ifndef _OPAL_DRIVER_H_
#define _OPAL_DRIVER_H_
#include <PiDxe.h>
#include <Guid/OpalPasswordExtraInfoVariable.h>
#include <Protocol/PciIo.h>
#include <Protocol/SmmCommunication.h>
#include <Protocol/BlockIo.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/DevicePath.h>
#include <Protocol/DevicePathToText.h>
#include <Protocol/StorageSecurityCommand.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseLib.h>
#include <Library/PrintLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/HiiLib.h>
#include <Library/UefiHiiServicesLib.h>
#include <Library/TcgStorageOpalLib.h>
#include <Library/OpalPasswordSupportLib.h>
#define EFI_DRIVER_NAME_UNICODE L"1.0 UEFI Opal Driver"
// UEFI 2.1
#define LANGUAGE_RFC_3066_ENGLISH ((CHAR8*)"en")
// UEFI/EFI < 2.1
#define LANGUAGE_ISO_639_2_ENGLISH ((CHAR8*)"eng")
#define UNLOCK_VAR_NAME (const CHAR16*)L"UNLOCK"
#define OPAL_FILTER_DRIVER_VAR_NAME L"FILTER_DRIVER"
#define CONCAT_(x, y) x ## y
#define CONCAT(x, y) CONCAT_(x, y)
#define UNICODE_STR(x) CONCAT( L, x )
extern EFI_DRIVER_BINDING_PROTOCOL gOpalDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gOpalComponentName;
extern EFI_COMPONENT_NAME2_PROTOCOL gOpalComponentName2;
/**
Unloads UEFI Driver. Very useful for debugging and testing.
@param ImageHandle Image handle this driver.
@retval EFI_SUCCESS This function always complete successfully.
@retval EFI_INVALID_PARAMETER The input ImageHandle is not valid.
**/
EFI_STATUS
EFIAPI
EfiDriverUnload(
EFI_HANDLE ImageHandle
);
/**
Test to see if this driver supports Controller.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to test
@param RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_ALREADY_STARTED This driver is already running on this device.
@retval other This driver does not support this device.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverBindingSupported(
EFI_DRIVER_BINDING_PROTOCOL* This,
EFI_HANDLE Controller,
EFI_DEVICE_PATH_PROTOCOL* RemainingDevicePath
);
/**
Enables Opal Management on a supported device if available.
The start function is designed to be called after the Opal UEFI Driver has confirmed the
"controller", which is a child handle, contains the EF_STORAGE_SECURITY_COMMAND protocols.
This function will complete the other necessary checks, such as verifying the device supports
the correct version of Opal. Upon verification, it will add the device to the
Opal HII list in order to expose Opal managmeent options.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@retval EFI_SUCCESS Opal management was enabled.
@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 failed to start the device.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverBindingStart(
EFI_DRIVER_BINDING_PROTOCOL* This,
EFI_HANDLE Controller,
EFI_DEVICE_PATH_PROTOCOL* RemainingDevicePath
);
/**
Stop this driver on Controller.
@param This Protocol instance pointer.
@param Controller Handle of device to stop driver on
@param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
children is zero stop the entire bus driver.
@param ChildHandleBuffer List of Child Handles to Stop.
@retval EFI_SUCCESS This driver is removed Controller.
@retval other This driver could not be removed from this device.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverBindingStop(
EFI_DRIVER_BINDING_PROTOCOL* This,
EFI_HANDLE Controller,
UINTN NumberOfChildren,
EFI_HANDLE* ChildHandleBuffer
);
/**
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a
Unicode string. If the driver specified by This has a user readable name in
the language specified by Language, then a pointer to the driver name is
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
by This does not support the language specified by Language,
then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified
in RFC 4646 or ISO 639-2 language code format.
@param DriverName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
driver specified by This in the language
specified by Language.
@retval EFI_SUCCESS The Unicode string for the Driver specified by
This and the language specified by Language was
returned in DriverName.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER DriverName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverComponentNameGetDriverName(
EFI_COMPONENT_NAME_PROTOCOL* This,
CHAR8* Language,
CHAR16** DriverName
);
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
This function retrieves the user readable name of the controller specified by
ControllerHandle and ChildHandle in the form of a Unicode string. If the
driver specified by This has a user readable name in the language specified by
Language, then a pointer to the controller name is returned in ControllerName,
and EFI_SUCCESS is returned. If the driver specified by This is not currently
managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
support the language specified by Language, then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param ControllerHandle[in] The handle of a controller that the driver
specified by This is managing. This handle
specifies the controller whose name is to be
returned.
@param ChildHandle[in] The handle of the child controller to retrieve
the name of. This is an optional parameter that
may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers
that wish to retrieve the name of the bus
controller. It will not be NULL for a bus
driver that wishes to retrieve the name of a
child controller.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified in
RFC 4646 or ISO 639-2 language code format.
@param ControllerName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
controller specified by ControllerHandle and
ChildHandle in the language specified by
Language from the point of view of the driver
specified by This.
@retval EFI_SUCCESS The Unicode string for the user readable name in
the language specified by Language for the
driver specified by This was returned in
DriverName.
@retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverComponentNameGetControllerName(
EFI_COMPONENT_NAME_PROTOCOL* This,
EFI_HANDLE ControllerHandle,
EFI_HANDLE ChildHandle,
CHAR8* Language,
CHAR16** ControllerName
);
/**
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a
Unicode string. If the driver specified by This has a user readable name in
the language specified by Language, then a pointer to the driver name is
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
by This does not support the language specified by Language,
then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified
in RFC 4646 or ISO 639-2 language code format.
@param DriverName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
driver specified by This in the language
specified by Language.
@retval EFI_SUCCESS The Unicode string for the Driver specified by
This and the language specified by Language was
returned in DriverName.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER DriverName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverComponentName2GetDriverName(
EFI_COMPONENT_NAME2_PROTOCOL* This,
CHAR8* Language,
CHAR16** DriverName
);
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
This function retrieves the user readable name of the controller specified by
ControllerHandle and ChildHandle in the form of a Unicode string. If the
driver specified by This has a user readable name in the language specified by
Language, then a pointer to the controller name is returned in ControllerName,
and EFI_SUCCESS is returned. If the driver specified by This is not currently
managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
support the language specified by Language, then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param ControllerHandle[in] The handle of a controller that the driver
specified by This is managing. This handle
specifies the controller whose name is to be
returned.
@param ChildHandle[in] The handle of the child controller to retrieve
the name of. This is an optional parameter that
may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers
that wish to retrieve the name of the bus
controller. It will not be NULL for a bus
driver that wishes to retrieve the name of a
child controller.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified in
RFC 4646 or ISO 639-2 language code format.
@param ControllerName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
controller specified by ControllerHandle and
ChildHandle in the language specified by
Language from the point of view of the driver
specified by This.
@retval EFI_SUCCESS The Unicode string for the user readable name in
the language specified by Language for the
driver specified by This was returned in
DriverName.
@retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
OpalEfiDriverComponentName2GetControllerName(
EFI_COMPONENT_NAME2_PROTOCOL* This,
EFI_HANDLE ControllerHandle,
EFI_HANDLE ChildHandle,
CHAR8* Language,
CHAR16** ControllerName
);
#endif //_OPAL_DRIVER_H_

View File

@ -0,0 +1,102 @@
/** @file
Private structures and functions used within OPAL_DRIVER
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
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.
**/
#ifndef _OPAL_DRIVER_PRIVATE_H_
#define _OPAL_DRIVER_PRIVATE_H_
#include "OpalDriver.h"
#define OPAL_MSID_LENGHT 128
#pragma pack(1)
//
// Structure that is used to represent an OPAL_DISK.
//
typedef struct {
UINT32 MsidLength; // Byte length of MSID Pin for device
UINT8 Msid[OPAL_MSID_LENGHT]; // MSID Pin for device
EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *Sscp;
UINT32 MediaId; // MediaId is used by Ssc Protocol.
EFI_DEVICE_PATH_PROTOCOL *OpalDevicePath;
UINT16 OpalBaseComId; // Opal SSC 1 base com id.
OPAL_OWNER_SHIP Owner;
OPAL_DISK_SUPPORT_ATTRIBUTE SupportedAttributes;
TCG_LOCKING_FEATURE_DESCRIPTOR LockingFeature; // Locking Feature Descriptor retrieved from performing a Level 0 Discovery
} OPAL_DISK;
//
// Device with block IO protocol
//
typedef struct _OPAL_DRIVER_DEVICE OPAL_DRIVER_DEVICE;
struct _OPAL_DRIVER_DEVICE {
OPAL_DRIVER_DEVICE *Next; ///< Linked list pointer
EFI_HANDLE Handle; ///< Device handle
OPAL_DISK OpalDisk; ///< User context
CHAR16 *Name16; ///< Allocated/freed by UEFI Filter Driver at device creation/removal
CHAR8 *NameZ; ///< Allocated/freed by UEFI Filter Driver at device creation/removal
UINT32 MediaId; ///< Required parameter for EFI_STORAGE_SECURITY_COMMAND_PROTOCOL, from BLOCK_IO_MEDIA
EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *Sscp; /// Device protocols consumed
EFI_DEVICE_PATH_PROTOCOL *OpalDevicePath;
};
//
// Opal Driver UEFI Driver Model
//
typedef struct {
EFI_HANDLE Handle; ///< Driver image handle
OPAL_DRIVER_DEVICE *DeviceList; ///< Linked list of controllers owned by this Driver
} OPAL_DRIVER;
#pragma pack()
//
// Retrieves a OPAL_DRIVER_DEVICE based on the pointer to its StorageSecurity protocol.
//
#define DRIVER_DEVICE_FROM_OPALDISK(OpalDiskPointer) (OPAL_DRIVER_DEVICE*)(BASE_CR(OpalDiskPointer, OPAL_DRIVER_DEVICE, OpalDisk))
/**
Get devcie list info.
@retval return the device list pointer.
**/
OPAL_DRIVER_DEVICE*
OpalDriverGetDeviceList(
VOID
);
/**
Get devcie name through the component name protocol.
@param[in] Dev The device which need to get name.
@retval TRUE Find the name for this device.
@retval FALSE Not found the name for this device.
**/
BOOLEAN
OpalDriverGetDriverDeviceName(
OPAL_DRIVER_DEVICE *Dev
);
/**
Get current device count.
@retval return the current created device count.
**/
UINT8
GetDeviceCount (
VOID
);
#endif // _OPAL_DRIVER_P_H_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,146 @@
/** @file
Public Header file of HII library used by Opal UEFI Driver.
Defines required callbacks of Opal HII library.
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
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.
**/
#ifndef _OPAL_HII_H_
#define _OPAL_HII_H_
#include <Library/OpalPasswordSupportLib.h>
#include <OpalDriverPrivate.h>
#define DEFAULT_RESPONSE_SIZE 200
/**
Get the driver image handle.
@retval the driver image handle.
**/
EFI_HANDLE
HiiGetDriverImageHandleCB(
VOID
);
/**
Install the HII form and string packages.
@retval EFI_SUCCESS Install all the resources success.
@retval EFI_OUT_OF_RESOURCES Out of resource error.
**/
EFI_STATUS
OpalHiiAddPackages(
VOID
);
/**
Check whether enable feature or not.
@retval Return the disk number.
**/
UINT8
HiiGetNumConfigRequiredOpalDisksCB(
VOID
);
/**
Returns the driver name.
@retval Returns the driver name.
**/
CHAR16*
HiiGetDriverNameCB(
VOID
);
/**
Returns the opaque pointer to a physical disk context.
@param DiskIndex Input the disk index.
@retval The device pointer.
**/
OPAL_DISK*
HiiGetOpalDiskCB(
UINT8 DiskIndex
);
/**
Returns the disk name.
@param DiskIndex Input the disk index.
@retval Returns the disk name.
**/
CHAR8*
HiiDiskGetNameCB(
UINT8 DiskIndex
);
/**
Set a string Value in a form.
@param DestStringId The stringid which need to update.
@param SrcAsciiStr The string nned to update.
@retval EFI_SUCCESS Do the required action success.
@retval Others Other error occur.
**/
EFI_STATUS
HiiSetFormString(
EFI_STRING_ID DestStringId,
CHAR8 *SrcAsciiStr
);
/**
Install the HII related resources.
@retval EFI_SUCCESS Install all the resources success.
@retval other Error occur when install the resources.
**/
EFI_STATUS
HiiInstall(
VOID
);
/**
Uninstall the HII capability.
@retval EFI_SUCCESS Uninstall all the resources success.
@retval others Other errors occur when unistall the hii resource.
**/
EFI_STATUS
HiiUninstall(
VOID
);
/**
Initialize the Opal disk base on the hardware info get from device.
@param Dev The Opal device.
@retval EFI_SUCESS Initialize the device success.
@retval EFI_DEVICE_ERROR Get info from device failed.
**/
EFI_STATUS
OpalDiskInitialize (
IN OPAL_DRIVER_DEVICE *Dev
);
#endif // _HII_H_

View File

@ -0,0 +1,221 @@
/** @file
Callbacks required by the HII of the Opal UEFI Driver to help display
Opal device information and to send password to SMM handler.
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
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.
**/
#include "OpalHii.h"
#include "OpalDriver.h"
#include "OpalDriverPrivate.h"
/**
Get Opal var name.
The return Value must be freed by caller if not NULL
@param OpalDisk The disk.
@param Prefix The prefix string.
@retval The var name string.
**/
CHAR16*
OpalDriverGetOpalVarName(
OPAL_DISK *OpalDisk,
const CHAR16 *Prefix
)
{
OPAL_DRIVER_DEVICE* Dev;
UINTN PrefixLen;
UINTN NameLen;
UINTN VarNameLen;
CHAR16* VarName;
Dev = DRIVER_DEVICE_FROM_OPALDISK(OpalDisk);
if (Dev == NULL) {
return NULL;
}
PrefixLen = StrLen(Prefix);
NameLen = 0;
if (Dev->Name16 != NULL) {
NameLen = StrLen(Dev->Name16);
}
VarNameLen = PrefixLen + NameLen;
VarName = (CHAR16*)AllocateZeroPool((VarNameLen + 1) * sizeof(CHAR16));
if (VarName == NULL) {
return NULL;
}
CopyMem(VarName, Prefix, PrefixLen * sizeof(CHAR16));
if (Dev->Name16 != NULL) {
CopyMem(VarName + PrefixLen, Dev->Name16, NameLen * sizeof(CHAR16));
}
VarName[VarNameLen] = 0;
return VarName;
}
/**
Get the driver image handle.
@retval the driver image handle.
**/
EFI_HANDLE
HiiGetDriverImageHandleCB(
VOID
)
{
return gImageHandle;
}
/**
Check whether enable feature or not.
@retval Return the disk number.
**/
UINT8
HiiGetNumConfigRequiredOpalDisksCB(
VOID
)
{
UINT8 NumDisks;
UINT8 NumLockedOpalDisks;
OPAL_DISK *OpalDisk;
UINT8 Index;
NumLockedOpalDisks = 0;
NumDisks = GetDeviceCount();
for (Index = 0; Index < NumDisks; Index++) {
OpalDisk = HiiGetOpalDiskCB(Index);
if (OpalDisk != NULL) {
if (!OpalFeatureEnabled (&OpalDisk->SupportedAttributes, &OpalDisk->LockingFeature)) {
DEBUG ((DEBUG_INFO, "Ignoring disk %u because feature is disabled or health has already been inspected\n", Index));
} else if (OpalDeviceLocked (&OpalDisk->SupportedAttributes, &OpalDisk->LockingFeature)) {
NumLockedOpalDisks++;
}
}
}
return NumLockedOpalDisks;
}
/**
Returns the opaque pointer to a physical disk context.
@param DiskIndex Input the disk index.
@retval The device pointer.
**/
VOID *
HiiGetDiskContextCB(
UINT8 DiskIndex
)
{
OPAL_DRIVER_DEVICE* Dev;
UINT8 CurrentDisk;
Dev = OpalDriverGetDeviceList();
CurrentDisk = 0;
if (DiskIndex >= GetDeviceCount()) {
return NULL;
}
while (Dev != NULL) {
if (CurrentDisk == DiskIndex) {
return Dev;
} else {
Dev = Dev->Next;
CurrentDisk++;
}
}
return NULL;
}
/**
Returns the opaque pointer to a physical disk context.
@param DiskIndex Input the disk index.
@retval The device pointer.
**/
OPAL_DISK*
HiiGetOpalDiskCB(
UINT8 DiskIndex
)
{
VOID *Ctx;
OPAL_DRIVER_DEVICE *Tmp;
Ctx = HiiGetDiskContextCB (DiskIndex);
if (Ctx == NULL) {
return NULL;
}
Tmp = (OPAL_DRIVER_DEVICE*) Ctx;
return &Tmp->OpalDisk;
}
/**
Returns the disk name.
@param DiskIndex Input the disk index.
@retval Returns the disk name.
**/
CHAR8*
HiiDiskGetNameCB(
UINT8 DiskIndex
)
{
OPAL_DRIVER_DEVICE* Ctx;
Ctx = (OPAL_DRIVER_DEVICE*) HiiGetDiskContextCB (DiskIndex);
if (Ctx != NULL) {
if (Ctx->NameZ == NULL) {
OpalDriverGetDriverDeviceName (Ctx);
}
return Ctx->NameZ;
}
return NULL;
}
/**
Returns the driver name.
@retval Returns the driver name.
**/
CHAR16*
HiiGetDriverNameCB(
VOID
)
{
return (CHAR16*)EFI_DRIVER_NAME_UNICODE;
}

View File

@ -0,0 +1,91 @@
// /** @file
//
// String definitions for Setup formset.
//
// Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
//
// 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.
//
// **/
/=#
///////////////////////////////// GENERIC DEFINITIONS /////////////////////////////////
#langdef en-US "English"
#string STR_NULL #language en-US " "
///////////////////////////////// FORM SET /////////////////////////////////
#string STR_FORM_SET_HELP #language en-US "Manage Opal disks"
///////////////////////////////// MULTIPLE FORMS /////////////////////////////////
#string STR_OPAL #language en-US "Opal"
#string STR_MAIN_OPAL_VERSION #language en-US "Version 00.0.0.0000"
///////////////////////////////// MAIN MENU FORM /////////////////////////////////
#string STR_MAIN_PHY_DISKS_LBL #language en-US "Physical Disks:"
#string STR_MAIN_LOCKED_DISKS_LBL #language en-US "Locked Disks:"
#string STR_MAIN_GOTO_DISK_INFO_0 #language en-US " "
#string STR_MAIN_GOTO_DISK_INFO_1 #language en-US " "
#string STR_MAIN_GOTO_DISK_INFO_2 #language en-US " "
#string STR_MAIN_GOTO_DISK_INFO_3 #language en-US " "
#string STR_MAIN_GOTO_DISK_INFO_4 #language en-US " "
#string STR_MAIN_GOTO_DISK_INFO_5 #language en-US " "
#string STR_MAIN_GOTO_DISK_INFO_HELP #language en-US "Select to see Opal disk actions"
#string STR_MAIN_GOTO_DISK_HEALTH_HELP #language en-US "Select disk to unlock"
#string STR_MAIN_NO_DISKS_PRESENT_LBL #language en-US "No disks connected to system"
///////////////////////////////// DISK INFO MENU FORM /////////////////////////////////
#string STR_DISK_INFO_SELECTED_DISK_NAME #language en-US " "
#string STR_DISK_INFO_LOCK #language en-US "Lock"
#string STR_DISK_INFO_UNLOCK #language en-US "Unlock"
#string STR_DISK_INFO_SET_ADMIN_PSWD #language en-US "Update Drive Admin Password"
#string STR_DISK_INFO_SET_USER_PSWD #language en-US "Set Drive User Password"
#string STR_DISK_INFO_SECURE_ERASE #language en-US "Secure Erase User Data"
#string STR_DISK_INFO_PSID_REVERT #language en-US "PSID Revert to factory default"
#string STR_DISK_INFO_REVERT #language en-US "Admin Revert to factory default and Disable"
#string STR_DISK_INFO_DISABLE_USER #language en-US "Disable User"
#string STR_DISK_INFO_ENABLE_FEATURE #language en-US "Enable Feature"
#string STR_DISK_INFO_ENABLE_BLOCKSID #language en-US "Enable BlockSID"
#string STR_ENABLED #language en-US "Enabled"
#string STR_DISABLED #language en-US "Disabled"
#string STR_DISK_INFO_GOTO_LOCK_HELP #language en-US "Lock the disk"
#string STR_DISK_INFO_GOTO_UNLOCK_HELP #language en-US "Unlock the disk"
#string STR_DISK_INFO_GOTO_SET_ADMIN_PSWD_HELP #language en-US "Set password for the administrator"
#string STR_DISK_INFO_GOTO_SET_USER_PSWD_HELP #language en-US "Set password for User 1"
#string STR_DISK_INFO_GOTO_SECURE_ERASE_HELP #language en-US "Securely erase the disk"
#string STR_DISK_INFO_GOTO_PSID_REVERT_HELP #language en-US "Revert the disk to factory defaults"
#string STR_DISK_INFO_GOTO_DISABLE_USER_HELP #language en-US "Disable User"
#string STR_DISK_INFO_GOTO_ENABLE_FEATURE_HELP #language en-US "Enable Feature"
#string STR_DISK_INFO_GOTO_ENABLE_BLOCKSID_HELP #language en-US "Enable to send BlockSID command"
///////////////////////////////// DISK ACTION MENU FORM /////////////////////////////////
#string STR_DISK_ACTION_LBL #language en-US " "
#string STR_PASSWORD_PROMPT #language en-US "Enter Password"
#string STR_PASSWORD_HELP #language en-US "Password must be between 6 and 20 characters"
#string STR_REVERT_PROMPT #language en-US "Enter PSID"
#string STR_REVERT_HELP #language en-US "PSID is a 32 character case sensitive value"
#string STR_ACTION_STATUS #language en-US " "
#string STR_PASSWORD_SUBMIT #language en-US "Submit Password Changes"
#string STR_PASSWORD_SUBMIT_HELP #language en-US "Submits Password Changes (new and update) after passwords have been entered"
#string STR_GOTO_HOME #language en-US "Main Menu"
#string STR_GOTO_HOME_HELP #language en-US "Return to the main menu"
#string STR_KEEP_USER_DATA_PROMPT #language en-US "Keep User Data"
#string STR_KEEP_USER_DATA_HELP #language en-US "Checkmark to keep user data, otherwise data will be lost"
#string STR_OK #language en-US "OK"

View File

@ -0,0 +1,120 @@
/** @file
Defines Opal HII form ids, structures and values.
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
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.
**/
#ifndef _OPAL_HII_FORM_VALUES_H_
#define _OPAL_HII_FORM_VALUES_H_
// Maximum Opal password Length
#define MAX_PASSWORD_CHARACTER_LENGTH 0x14
// PSID Length
#define PSID_CHARACTER_LENGTH 0x20
// ID's for various forms that will be used by HII
#define FORMID_VALUE_MAIN_MENU 0x01
#define FORMID_VALUE_DISK_INFO_FORM_MAIN 0x02
#define FORMID_VALUE_DISK_ACTION_FORM 0x03
// Structure defining the OPAL_HII_CONFIGURATION
#pragma pack(1)
typedef struct {
UINT8 NumDisks;
UINT8 SelectedDiskIndex;
UINT8 SelectedAction;
UINT16 SelectedDiskAvailableActions;
UINT16 SupportedDisks;
UINT8 KeepUserData;
UINT16 AvailableFields;
UINT16 Password[MAX_PASSWORD_CHARACTER_LENGTH];
UINT16 Psid[PSID_CHARACTER_LENGTH];
UINT8 EnableBlockSid;
} OPAL_HII_CONFIGURATION;
#pragma pack()
/* Action Flags */
#define HII_ACTION_NONE 0x0000
#define HII_ACTION_LOCK 0x0001
#define HII_ACTION_UNLOCK 0x0002
#define HII_ACTION_SET_ADMIN_PWD 0x0004
#define HII_ACTION_SET_USER_PWD 0x0008
#define HII_ACTION_SECURE_ERASE 0x0010
#define HII_ACTION_PSID_REVERT 0x0020
#define HII_ACTION_DISABLE_USER 0x0040
#define HII_ACTION_REVERT 0x0080
#define HII_ACTION_DISABLE_FEATURE 0x0100
#define HII_ACTION_ENABLE_FEATURE 0x0200
#define HII_ACTION_ENABLE_BLOCKSID 0x0400
/* Flags for diskActionAvailableFields */
#define HII_FIELD_PASSWORD 0x0001
#define HII_FIELD_PSID 0x0002
#define HII_FIELD_KEEP_USER_DATA 0x0004
#define HII_FIELD_KEEP_USER_DATA_FORCED 0x0008
/* Number of bits allocated for each part of a unique key for an HII_ITEM
* all bits together must be <= 16 (EFI_QUESTION_ID is UINT16)
* 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
* | |-----------------------| |---------------------------|
* FLG INDEX ID
*/
#define HII_KEY_ID_BITS 8
#define HII_KEY_INDEX_BITS 7
#define HII_KEY_FLAG_BITS 1
#define HII_KEY_FLAG 0x8000 // bit 15 (zero based)
/***********/
/* Key IDs */
/***********/
#define HII_KEY_ID_GOTO_MAIN_MENU 0
#define HII_KEY_ID_GOTO_DISK_INFO 1
#define HII_KEY_ID_GOTO_LOCK 2
#define HII_KEY_ID_GOTO_UNLOCK 3
#define HII_KEY_ID_GOTO_SET_ADMIN_PWD 4
#define HII_KEY_ID_GOTO_SET_USER_PWD 5
#define HII_KEY_ID_GOTO_SECURE_ERASE 6
#define HII_KEY_ID_GOTO_PSID_REVERT 7
#define HII_KEY_ID_GOTO_REVERT 8
#define HII_KEY_ID_GOTO_DISABLE_USER 9
#define HII_KEY_ID_GOTO_ENABLE_FEATURE 0xA //10
#define HII_KEY_ID_GOTO_CONFIRM_TO_MAIN_MENU 0xB //11
#define HII_KEY_ID_ENTER_PASSWORD 0xC //12
#define HII_KEY_ID_ENTER_PSID 0xD //13
#define HII_KEY_ID_VAR_SUPPORTED_DISKS 0xE //14
#define HII_KEY_ID_VAR_SELECTED_DISK_AVAILABLE_ACTIONS 0xF //15
#define HII_KEY_ID_BLOCKSID 0x17 //23
#define HII_KEY_ID_MAX 0x17 //23 // !!Update each time a new ID is added!!
#define HII_KEY_WITH_INDEX(id, index) \
( \
HII_KEY_FLAG | \
(id) | \
((index) << HII_KEY_ID_BITS) \
)
#define HII_KEY(id) HII_KEY_WITH_INDEX(id, 0)
#define PACKAGE_LIST_GUID { 0xf0308176, 0x9058, 0x4153, { 0x93, 0x3d, 0xda, 0x2f, 0xdc, 0xc8, 0x3e, 0x44 } }
/* {410483CF-F4F9-4ece-848A-1958FD31CEB7} */
#define SETUP_FORMSET_GUID { 0x410483cf, 0xf4f9, 0x4ece, { 0x84, 0x8a, 0x19, 0x58, 0xfd, 0x31, 0xce, 0xb7 } }
// {BBF1ACD2-28D8-44ea-A291-58A237FEDF1A}
#define SETUP_VARIABLE_GUID { 0xbbf1acd2, 0x28d8, 0x44ea, { 0xa2, 0x91, 0x58, 0xa2, 0x37, 0xfe, 0xdf, 0x1a } }
#endif //_HII_FORM_VALUES_H_

View File

@ -0,0 +1,266 @@
/** @file
Private functions and sturctures used by the Opal UEFI Driver.
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
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.
**/
#ifndef _OPAL_HII_PRIVATE_H_
#define _OPAL_HII_PRIVATE_H_
#include <Library/OpalPasswordSupportLib.h>
#include <Protocol/HiiConfigAccess.h>
#include "OpalHii.h"
#include "OpalHiiFormValues.h"
#define OPAL_PASSWORD_CONFIG_GUID \
{ \
0x0d510a4f, 0xa81b, 0x473f, { 0x87, 0x07, 0xb7, 0xfd, 0xfb, 0xc0, 0x45, 0xba } \
}
#pragma pack(1)
typedef struct {
UINT16 Id: HII_KEY_ID_BITS;
UINT16 Index: HII_KEY_INDEX_BITS;
UINT16 Flag: HII_KEY_FLAG_BITS;
} KEY_BITS;
typedef union {
UINT16 Raw;
KEY_BITS KeyBits;
} HII_KEY;
typedef struct {
VENDOR_DEVICE_PATH VendorDevicePath;
EFI_DEVICE_PATH_PROTOCOL End;
} HII_VENDOR_DEVICE_PATH;
/**
* Opal PSID Authority utilized for PSID revert
*
* The type indicates the structure of the PSID authority
*/
typedef struct {
UINT8 Psid[32];
} TCG_PSID;
/**
This function processes the results of changes in configuration.
@param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
@param Configuration A null-terminated Unicode string in <ConfigResp>
format.
@param Progress A pointer to a string filled in with the offset of
the most recent '&' before the first failing
name/value pair (or the beginning of the string if
the failure is in the first name/value pair) or
the terminating NULL if all was successful.
@retval EFI_SUCCESS The Results is processed successfully.
@retval EFI_INVALID_PARAMETER Configuration is NULL.
@retval EFI_NOT_FOUND Routing data doesn't match any storage in this
driver.
**/
EFI_STATUS
EFIAPI
RouteConfig(
CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
CONST EFI_STRING Configuration,
EFI_STRING *Progress
);
/**
This function allows a caller to extract the current configuration for one
or more named elements from the target driver.
@param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
@param Request A null-terminated Unicode string in
<ConfigRequest> format.
@param Progress On return, points to a character in the Request
string. Points to the string's null terminator if
request was successful. Points to the most recent
'&' before the first failing name/value pair (or
the beginning of the string if the failure is in
the first name/value pair) if the request was not
successful.
@param Results A null-terminated Unicode string in
<ConfigAltResp> format which has all values filled
in for the names in the Request string. String to
be allocated by the called function.
@retval EFI_SUCCESS The Results is filled with the requested values.
@retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
@retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
@retval EFI_NOT_FOUND Routing data doesn't match any storage in this
driver.
**/
EFI_STATUS
EFIAPI
ExtractConfig(
CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
CONST EFI_STRING Request,
EFI_STRING *Progress,
EFI_STRING *Results
);
/**
This function processes the results of changes in configuration.
@param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
@param Action Specifies the type of action taken by the browser.
@param QuestionId A unique value which is sent to the original
exporting driver so that it can identify the type
of data to expect.
@param Type The type of value for the question.
@param Value A pointer to the data being sent to the original
exporting driver.
@param ActionRequest On return, points to the action requested by the
callback function.
@retval EFI_SUCCESS The callback successfully handled the action.
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
variable and its data.
@retval EFI_DEVICE_ERROR The variable could not be saved.
@retval EFI_UNSUPPORTED The specified Action is not supported by the
callback.
**/
EFI_STATUS
EFIAPI
DriverCallback(
CONST EFI_HII_CONFIG_ACCESS_PROTOCOL* This,
EFI_BROWSER_ACTION Action,
EFI_QUESTION_ID QuestionId,
UINT8 Type,
EFI_IFR_TYPE_VALUE* Value,
EFI_BROWSER_ACTION_REQUEST* ActionRequest
);
/**
Pass the current system state to the bios via the hii_G_Configuration.
**/
VOID
OpalHiiSetBrowserData (
VOID
);
/**
Populate the hii_g_Configuraton with the browser Data.
**/
VOID
OpalHiiGetBrowserData (
VOID
);
/**
Draws the disk info form.
@retval EFI_SUCCESS Draw the disk info success.
**/
EFI_STATUS
HiiPopulateDiskInfoForm(
VOID
);
/**
Update the global Disk index info.
@param Index The input disk index info.
@retval EFI_SUCCESS Update the disk index info success.
**/
EFI_STATUS
HiiSelectDisk(
UINT8 Index
);
/**
Use the input password to do the specified action.
@param Str The input password saved in.
@retval EFI_SUCCESS Do the required action success.
@retval Others Other error occur.
**/
EFI_STATUS
HiiPasswordEntered(
EFI_STRING_ID Str
);
/**
Update block sid info.
@param Enable Enable/disable BlockSid.
@retval EFI_SUCCESS Do the required action success.
@retval Others Other error occur.
**/
EFI_STATUS
HiiSetBlockSid (
BOOLEAN Enable
);
/**
Reverts the Opal disk to factory default.
@retval EFI_SUCCESS Do the required action success.
**/
EFI_STATUS
HiiPsidRevert(
VOID
);
/**
Get disk name string id.
@param DiskIndex The input disk index info.
@retval The disk name string id.
**/
EFI_STRING_ID
GetDiskNameStringId(
UINT8 DiskIndex
);
/**
Update the device info.
@param OpalDisk The Opal device.
@retval EFI_SUCESS Initialize the device success.
@retval EFI_DEVICE_ERROR Get info from device failed.
@retval EFI_INVALID_PARAMETER Not get Msid info before get ownership info.
**/
EFI_STATUS
OpalDiskUpdateStatus (
OPAL_DISK *OpalDisk
);
#pragma pack()
#endif // _HII_P_H_

View File

@ -0,0 +1,84 @@
## @file
# This is a OpalPasswordDxe driver.
#
# This module is used to Management the Opal feature
# for Opal supported devices.
#
#
# Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
# 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.
#
##
[Defines]
INF_VERSION = 0x00010007
BASE_NAME = OpalPasswordDxe
FILE_GUID = E3E4048D-6C0C-43E4-AE1C-FFB579D8EF41
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = EfiDriverEntryPoint
UNLOAD_IMAGE = OpalEfiDriverUnload
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
[Sources]
OpalDriver.h
OpalHii.c
OpalHiiCallbacks.c
OpalDriver.c
OpalDriverPrivate.h
OpalHii.h
OpalHiiPrivate.h
OpalHiiFormValues.h
OpalPasswordForm.vfr
OpalHiiFormStrings.uni
ComponentName.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
SecurityPkg/SecurityPkg.dec
[LibraryClasses]
BaseLib
MemoryAllocationLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiHiiServicesLib
UefiRuntimeServicesTableLib
BaseMemoryLib
DebugLib
HiiLib
PrintLib
DevicePathLib
OpalPasswordSupportLib
UefiLib
TcgStorageOpalLib
[Protocols]
gEfiHiiConfigAccessProtocolGuid ## PRODUCES
gEfiStorageSecurityCommandProtocolGuid ## CONSUMES
gEfiComponentNameProtocolGuid ## PRODUCES
gEfiComponentName2ProtocolGuid ## PRODUCES
gEfiBlockIoProtocolGuid ## CONSUMES
gEfiSmmCommunicationProtocolGuid ## PRODUCES
gEfiPciIoProtocolGuid ## CONSUMES
gEfiDevicePathToTextProtocolGuid ## CONSUMES
[Guids]
gEfiEventExitBootServicesGuid ## CONSUMES ## Event
gOpalExtraInfoVariableGuid ## PRODUCES ## GUID
[BuildOptions]
MSFT:*_*_*_CC_FLAGS = /Od /GL-
[Depex]
gEfiSmmCommunicationProtocolGuid

View File

@ -0,0 +1,327 @@
/** @file
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
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.
**/
#include "OpalHiiFormValues.h"
#define EFI_HII_PLATFORM_SETUP_FORMSET_GUID \
{ 0x93039971, 0x8545, 0x4b04, { 0xb4, 0x5e, 0x32, 0xeb, 0x83, 0x26, 0x4, 0xe } }
formset
guid = SETUP_FORMSET_GUID,
title = STRING_TOKEN(STR_OPAL),
help = STRING_TOKEN(STR_FORM_SET_HELP),
classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID,
// Define a Buffer Storage (EFI_IFR_VARSTORE) that will be filled
// out initially through extractConfig call
varstore OPAL_HII_CONFIGURATION, // This is the Data structure type
name = OpalHiiConfig, // Define referenced name in vfr
guid = SETUP_VARIABLE_GUID; // GUID of this Buffer storage
form formid = FORMID_VALUE_MAIN_MENU,
title = STRING_TOKEN(STR_OPAL);
//CONFIG_VARIABLE(HII_KEY(HII_KEY_ID_VAR_SUPPORTED_DISKS), SupportedDisks, 0x0, 0xFFFF);
suppressif TRUE;
numeric
name = SupportedDisks,
varid = OpalHiiConfig.SupportedDisks,
prompt = STRING_TOKEN(STR_NULL),
help = STRING_TOKEN(STR_NULL),
flags = INTERACTIVE,
key = 0x800E, //32782,
minimum = 0x0,
maximum = 0xFFFF,
endnumeric;
endif;
subtitle text = STRING_TOKEN(STR_MAIN_OPAL_VERSION);
subtitle text = STRING_TOKEN(STR_NULL);
text
help = STRING_TOKEN(STR_NULL),
text = STRING_TOKEN(STR_MAIN_PHY_DISKS_LBL);
subtitle text = STRING_TOKEN(STR_NULL);
//DISK( 0 );
suppressif ( questionref(SupportedDisks) & ( 0x1 ) ) == 0;
goto FORMID_VALUE_DISK_INFO_FORM_MAIN,
prompt = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_0 ),
help = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_HELP),
flags = INTERACTIVE, \
key = 0x8001; //32769
endif;
//DISK( 1 );
suppressif ( questionref(SupportedDisks) & ( 0x2 ) ) == 0;
goto FORMID_VALUE_DISK_INFO_FORM_MAIN,
prompt = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_1 ),
help = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_HELP),
flags = INTERACTIVE, \
key = 0x8101; //33025
endif;
//DISK( 2 );
suppressif ( questionref(SupportedDisks) & ( 0x4 ) ) == 0;
goto FORMID_VALUE_DISK_INFO_FORM_MAIN,
prompt = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_2 ),
help = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_HELP),
flags = INTERACTIVE, \
key = 0x8201; //33281
endif;
//DISK( 3 );
suppressif ( questionref(SupportedDisks) & ( 0x8 ) ) == 0;
goto FORMID_VALUE_DISK_INFO_FORM_MAIN,
prompt = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_3 ),
help = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_HELP),
flags = INTERACTIVE, \
key = 0x8301; // 33537
endif;
//DISK( 4 );
suppressif ( questionref(SupportedDisks) & ( 0x10 ) ) == 0;
goto FORMID_VALUE_DISK_INFO_FORM_MAIN,
prompt = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_4 ),
help = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_HELP),
flags = INTERACTIVE, \
key = 0x8401; // 33793
endif;
//DISK( 5 );
suppressif ( questionref(SupportedDisks) & ( 0x20 ) ) == 0;
goto FORMID_VALUE_DISK_INFO_FORM_MAIN,
prompt = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_5 ),
help = STRING_TOKEN(STR_MAIN_GOTO_DISK_INFO_HELP),
flags = INTERACTIVE, \
key = 0x8501; // 34049
endif;
//No disks on system
suppressif ideqval OpalHiiConfig.NumDisks > 0;
text
help = STRING_TOKEN(STR_NULL),
text = STRING_TOKEN(STR_MAIN_NO_DISKS_PRESENT_LBL);
endif;
endform; // MAIN MENU FORM
//
///////////////// DISK INFO FORM /////////////////
//
form formid = FORMID_VALUE_DISK_INFO_FORM_MAIN,
title = STRING_TOKEN(STR_OPAL);
suppressif TRUE;
numeric
name = SelectedDiskAvailableActions,
varid = OpalHiiConfig.SelectedDiskAvailableActions,
prompt = STRING_TOKEN(STR_NULL),
help = STRING_TOKEN(STR_NULL),
flags = INTERACTIVE,
key = 0x800F, // 32783
minimum = 0x0,
maximum = 0xFFFF,
endnumeric;
endif;
subtitle text = STRING_TOKEN(STR_MAIN_OPAL_VERSION);
subtitle text = STRING_TOKEN(STR_NULL);
text
help = STRING_TOKEN(STR_NULL),
text = STRING_TOKEN(STR_DISK_INFO_SELECTED_DISK_NAME);
subtitle text = STRING_TOKEN(STR_NULL);
suppressif ( questionref(SelectedDiskAvailableActions) & HII_ACTION_LOCK ) == 0;
goto FORMID_VALUE_DISK_ACTION_FORM,
prompt = STRING_TOKEN(STR_DISK_INFO_LOCK),
help = STRING_TOKEN(STR_DISK_INFO_GOTO_LOCK_HELP),
flags = INTERACTIVE,
key = 0x8002; // 32770
endif;
suppressif ( questionref(SelectedDiskAvailableActions) & HII_ACTION_UNLOCK ) == 0;
goto FORMID_VALUE_DISK_ACTION_FORM,
prompt = STRING_TOKEN(STR_DISK_INFO_UNLOCK),
help = STRING_TOKEN(STR_DISK_INFO_GOTO_UNLOCK_HELP),
flags = INTERACTIVE,
key = 0x8003; //32771;
endif;
suppressif ( questionref(SelectedDiskAvailableActions) & HII_ACTION_SET_ADMIN_PWD ) == 0;
goto FORMID_VALUE_DISK_ACTION_FORM,
prompt = STRING_TOKEN(STR_DISK_INFO_SET_ADMIN_PSWD),
help = STRING_TOKEN(STR_DISK_INFO_GOTO_SET_ADMIN_PSWD_HELP),
flags = INTERACTIVE,
key = 0x8004; //32772;
endif;
suppressif ( questionref(SelectedDiskAvailableActions) & HII_ACTION_SET_USER_PWD ) == 0;
goto FORMID_VALUE_DISK_ACTION_FORM,
prompt = STRING_TOKEN(STR_DISK_INFO_SET_USER_PSWD),
help = STRING_TOKEN(STR_DISK_INFO_GOTO_SET_USER_PSWD_HELP),
flags = INTERACTIVE,
key = 0x8005; //32773;
endif;
suppressif ( questionref(SelectedDiskAvailableActions) & HII_ACTION_SECURE_ERASE ) == 0;
goto FORMID_VALUE_DISK_ACTION_FORM,
prompt = STRING_TOKEN(STR_DISK_INFO_SECURE_ERASE),
help = STRING_TOKEN(STR_DISK_INFO_GOTO_SECURE_ERASE_HELP),
flags = INTERACTIVE,
key = 0x8006; //32774;
endif;
suppressif ( questionref(SelectedDiskAvailableActions) & HII_ACTION_REVERT ) == 0;
goto FORMID_VALUE_DISK_ACTION_FORM,
prompt = STRING_TOKEN(STR_DISK_INFO_REVERT),
help = STRING_TOKEN(STR_DISK_INFO_GOTO_PSID_REVERT_HELP),
flags = INTERACTIVE,
key = 0x8008; //32776;
endif;
suppressif ( questionref(SelectedDiskAvailableActions) & HII_ACTION_PSID_REVERT ) == 0;
goto FORMID_VALUE_DISK_ACTION_FORM,
prompt = STRING_TOKEN(STR_DISK_INFO_PSID_REVERT),
help = STRING_TOKEN(STR_DISK_INFO_GOTO_PSID_REVERT_HELP),
flags = INTERACTIVE,
key = 0x8007; //32775;
endif;
suppressif ( questionref(SelectedDiskAvailableActions) & HII_ACTION_DISABLE_USER ) == 0;
goto FORMID_VALUE_DISK_ACTION_FORM,
prompt = STRING_TOKEN(STR_DISK_INFO_DISABLE_USER),
help = STRING_TOKEN(STR_DISK_INFO_GOTO_DISABLE_USER_HELP),
flags = INTERACTIVE,
key = 0x8009; //32777;
endif;
suppressif ( questionref(SelectedDiskAvailableActions) & HII_ACTION_ENABLE_FEATURE ) == 0;
goto FORMID_VALUE_DISK_ACTION_FORM,
prompt = STRING_TOKEN(STR_DISK_INFO_ENABLE_FEATURE),
help = STRING_TOKEN(STR_DISK_INFO_GOTO_ENABLE_FEATURE_HELP),
flags = INTERACTIVE,
key = 0x800A; //32778;
endif;
suppressif ( questionref(SelectedDiskAvailableActions) & HII_ACTION_ENABLE_BLOCKSID ) == 0;
oneof varid = OpalHiiConfig.EnableBlockSid,
questionid = 0x8017, // 32791,
prompt = STRING_TOKEN(STR_DISK_INFO_ENABLE_BLOCKSID),
help = STRING_TOKEN(STR_DISK_INFO_GOTO_ENABLE_BLOCKSID_HELP),
flags = INTERACTIVE,
option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;
option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED;
endoneof;
endif;
endform; // DISK INFO FORM
//
///////////////// DISK ACTION FORM /////////////////
//
form formid = FORMID_VALUE_DISK_ACTION_FORM,
title = STRING_TOKEN(STR_OPAL);
suppressif TRUE;
numeric
name = AvailableFields,
varid = OpalHiiConfig.AvailableFields,
prompt = STRING_TOKEN(STR_NULL),
help = STRING_TOKEN(STR_NULL),
flags = INTERACTIVE,
key = 0x8012, //32786,
minimum = 0x0,
maximum = 0xFFFF,
endnumeric;
endif;
subtitle text = STRING_TOKEN(STR_MAIN_OPAL_VERSION);
subtitle text = STRING_TOKEN(STR_NULL);
text
help = STRING_TOKEN(STR_NULL),
text = STRING_TOKEN(STR_DISK_INFO_SELECTED_DISK_NAME);
subtitle text = STRING_TOKEN(STR_NULL);
text
help = STRING_TOKEN(STR_NULL),
text = STRING_TOKEN(STR_DISK_ACTION_LBL);
subtitle text = STRING_TOKEN(STR_NULL);
suppressif (questionref(AvailableFields) & HII_FIELD_KEEP_USER_DATA) == 0;
grayoutif (questionref(AvailableFields) & HII_FIELD_KEEP_USER_DATA_FORCED) != 0;
checkbox
name = MyCheckbox,
varid = OpalHiiConfig.KeepUserData,
prompt = STRING_TOKEN(STR_KEEP_USER_DATA_PROMPT),
help = STRING_TOKEN(STR_KEEP_USER_DATA_HELP),
key = 0x8011, //32785,
endcheckbox;
//EMPTY_LINE;
text
help = STRING_TOKEN(STR_NULL),
text = STRING_TOKEN(STR_NULL);
endif;
endif;
suppressif (questionref(AvailableFields) & HII_FIELD_PASSWORD) == 0;
password
varid = OpalHiiConfig.Password,
prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
help = STRING_TOKEN(STR_PASSWORD_HELP),
flags = INTERACTIVE,
key = 0x800C, //32780,
minsize = 6,
maxsize = 20,
endpassword;
endif;
suppressif (questionref(AvailableFields) & HII_FIELD_PSID) == 0;
string
varid = OpalHiiConfig.Psid,
prompt = STRING_TOKEN(STR_REVERT_PROMPT),
help = STRING_TOKEN(STR_REVERT_HELP),
flags = INTERACTIVE,
key = 0x800D, //32781,
minsize = PSID_CHARACTER_LENGTH,
maxsize = PSID_CHARACTER_LENGTH,
endstring;
endif;
subtitle text = STRING_TOKEN(STR_NULL);
text
help = STRING_TOKEN(STR_NULL),
text = STRING_TOKEN(STR_ACTION_STATUS);
subtitle text = STRING_TOKEN(STR_NULL);
goto FORMID_VALUE_MAIN_MENU,
prompt = STRING_TOKEN(STR_GOTO_HOME),
help = STRING_TOKEN(STR_GOTO_HOME_HELP),
flags = INTERACTIVE,
key = 0x8000; //32768;
endform; // DISK ACTION FORM
endformset;