2 Private structures and functions used within OPAL_DRIVER
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _OPAL_DRIVER_PRIVATE_H_
16 #define _OPAL_DRIVER_PRIVATE_H_
17 #include "OpalDriver.h"
19 #define OPAL_MSID_LENGHT 128
23 // Structure that is used to represent an OPAL_DISK.
26 UINT32 MsidLength
; // Byte length of MSID Pin for device
27 UINT8 Msid
[OPAL_MSID_LENGHT
]; // MSID Pin for device
28 EFI_STORAGE_SECURITY_COMMAND_PROTOCOL
*Sscp
;
29 UINT32 MediaId
; // MediaId is used by Ssc Protocol.
30 EFI_DEVICE_PATH_PROTOCOL
*OpalDevicePath
;
31 UINT16 OpalBaseComId
; // Opal SSC 1 base com id.
32 OPAL_OWNER_SHIP Owner
;
33 OPAL_DISK_SUPPORT_ATTRIBUTE SupportedAttributes
;
34 TCG_LOCKING_FEATURE_DESCRIPTOR LockingFeature
; // Locking Feature Descriptor retrieved from performing a Level 0 Discovery
38 // Device with block IO protocol
40 typedef struct _OPAL_DRIVER_DEVICE OPAL_DRIVER_DEVICE
;
42 struct _OPAL_DRIVER_DEVICE
{
43 OPAL_DRIVER_DEVICE
*Next
; ///< Linked list pointer
44 EFI_HANDLE Handle
; ///< Device handle
45 OPAL_DISK OpalDisk
; ///< User context
46 CHAR16
*Name16
; ///< Allocated/freed by UEFI Filter Driver at device creation/removal
47 CHAR8
*NameZ
; ///< Allocated/freed by UEFI Filter Driver at device creation/removal
48 UINT32 MediaId
; ///< Required parameter for EFI_STORAGE_SECURITY_COMMAND_PROTOCOL, from BLOCK_IO_MEDIA
50 EFI_STORAGE_SECURITY_COMMAND_PROTOCOL
*Sscp
; /// Device protocols consumed
51 EFI_DEVICE_PATH_PROTOCOL
*OpalDevicePath
;
55 // Opal Driver UEFI Driver Model
58 EFI_HANDLE Handle
; ///< Driver image handle
59 OPAL_DRIVER_DEVICE
*DeviceList
; ///< Linked list of controllers owned by this Driver
64 // Retrieves a OPAL_DRIVER_DEVICE based on the pointer to its StorageSecurity protocol.
66 #define DRIVER_DEVICE_FROM_OPALDISK(OpalDiskPointer) (OPAL_DRIVER_DEVICE*)(BASE_CR(OpalDiskPointer, OPAL_DRIVER_DEVICE, OpalDisk))
71 @retval return the device list pointer.
74 OpalDriverGetDeviceList(
79 Get devcie name through the component name protocol.
81 @param[in] Dev The device which need to get name.
83 @retval TRUE Find the name for this device.
84 @retval FALSE Not found the name for this device.
87 OpalDriverGetDriverDeviceName(
88 OPAL_DRIVER_DEVICE
*Dev
92 Get current device count.
94 @retval return the current created device count.
102 #endif // _OPAL_DRIVER_P_H_