Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright © 2016 Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Authors:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *    Rafael Antognolli <rafael.antognolli@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *    Scott  Bauer      <scott.bauer@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #ifndef _OPAL_PROTO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #define _OPAL_PROTO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  * These constant values come from:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  * SPC-4 section
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  * 6.30 SECURITY PROTOCOL IN command / table 265.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	TCG_SECP_00 = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	TCG_SECP_01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  * Token defs derived from:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  * 3.2.2 Data Stream Encoding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) enum opal_response_token {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	OPAL_DTA_TOKENID_BYTESTRING = 0xe0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	OPAL_DTA_TOKENID_SINT = 0xe1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	OPAL_DTA_TOKENID_UINT = 0xe2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	OPAL_DTA_TOKENID_TOKEN = 0xe3, /* actual token is returned */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	OPAL_DTA_TOKENID_INVALID = 0X0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #define DTAERROR_NO_METHOD_STATUS 0x89
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #define GENERIC_HOST_SESSION_NUM 0x41
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #define FIRST_TPER_SESSION_NUM	4096
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) #define TPER_SYNC_SUPPORTED 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #define MBR_ENABLED_MASK 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #define TINY_ATOM_DATA_MASK 0x3F
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) #define TINY_ATOM_SIGNED 0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #define SHORT_ATOM_ID 0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #define SHORT_ATOM_BYTESTRING 0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) #define SHORT_ATOM_SIGNED 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) #define SHORT_ATOM_LEN_MASK 0xF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #define MEDIUM_ATOM_ID 0xC0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) #define MEDIUM_ATOM_BYTESTRING 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) #define MEDIUM_ATOM_SIGNED 0x8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) #define MEDIUM_ATOM_LEN_MASK 0x7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) #define LONG_ATOM_ID 0xe0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) #define LONG_ATOM_BYTESTRING 0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) #define LONG_ATOM_SIGNED 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) /* Derived from TCG Core spec 2.01 Section:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)  * 3.2.2.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)  * Data Type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) #define TINY_ATOM_BYTE   0x7F
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) #define SHORT_ATOM_BYTE  0xBF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) #define MEDIUM_ATOM_BYTE 0xDF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #define LONG_ATOM_BYTE   0xE3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) #define OPAL_INVAL_PARAM 12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #define OPAL_MANUFACTURED_INACTIVE 0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) #define OPAL_DISCOVERY_COMID 0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) #define LOCKING_RANGE_NON_GLOBAL 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)  * User IDs used in the TCG storage SSCs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)  * Derived from: TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78)  * Section: 6.3 Assigned UIDs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) #define OPAL_METHOD_LENGTH 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) #define OPAL_MSID_KEYLEN 15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) #define OPAL_UID_LENGTH_HALF 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) /* Enum to index OPALUID array */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) enum opal_uid {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	/* users */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	OPAL_SMUID_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	OPAL_THISSP_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	OPAL_ADMINSP_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	OPAL_LOCKINGSP_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	OPAL_ENTERPRISE_LOCKINGSP_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	OPAL_ANYBODY_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	OPAL_SID_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	OPAL_ADMIN1_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	OPAL_USER1_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	OPAL_USER2_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	OPAL_PSID_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	OPAL_ENTERPRISE_BANDMASTER0_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	OPAL_ENTERPRISE_ERASEMASTER_UID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	/* tables */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	OPAL_TABLE_TABLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	OPAL_LOCKINGRANGE_GLOBAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	OPAL_LOCKINGRANGE_ACE_RDLOCKED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	OPAL_LOCKINGRANGE_ACE_WRLOCKED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	OPAL_MBRCONTROL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	OPAL_MBR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	OPAL_AUTHORITY_TABLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	OPAL_C_PIN_TABLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	OPAL_LOCKING_INFO_TABLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	OPAL_ENTERPRISE_LOCKING_INFO_TABLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	OPAL_DATASTORE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	/* C_PIN_TABLE object ID's */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	OPAL_C_PIN_MSID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	OPAL_C_PIN_SID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	OPAL_C_PIN_ADMIN1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	/* half UID's (only first 4 bytes used) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	OPAL_HALF_UID_AUTHORITY_OBJ_REF,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	OPAL_HALF_UID_BOOLEAN_ACE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	/* omitted optional parameter */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	OPAL_UID_HEXFF,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) /* Enum for indexing the OPALMETHOD array */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) enum opal_method {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	OPAL_PROPERTIES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	OPAL_STARTSESSION,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	OPAL_REVERT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	OPAL_ACTIVATE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	OPAL_EGET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	OPAL_ESET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	OPAL_NEXT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	OPAL_EAUTHENTICATE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	OPAL_GETACL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	OPAL_GENKEY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	OPAL_REVERTSP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	OPAL_GET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	OPAL_SET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	OPAL_AUTHENTICATE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	OPAL_RANDOM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	OPAL_ERASE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) enum opal_token {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	/* Boolean */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	OPAL_TRUE = 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	OPAL_FALSE = 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	OPAL_BOOLEAN_EXPR = 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	/* cellblocks */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	OPAL_TABLE = 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	OPAL_STARTROW = 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	OPAL_ENDROW = 0x02,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	OPAL_STARTCOLUMN = 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	OPAL_ENDCOLUMN = 0x04,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	OPAL_VALUES = 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	/* table table */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	OPAL_TABLE_UID = 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	OPAL_TABLE_NAME = 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	OPAL_TABLE_COMMON = 0x02,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	OPAL_TABLE_TEMPLATE = 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	OPAL_TABLE_KIND = 0x04,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	OPAL_TABLE_COLUMN = 0x05,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	OPAL_TABLE_COLUMNS = 0x06,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	OPAL_TABLE_ROWS = 0x07,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	OPAL_TABLE_ROWS_FREE = 0x08,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	OPAL_TABLE_ROW_BYTES = 0x09,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	OPAL_TABLE_LASTID = 0x0A,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	OPAL_TABLE_MIN = 0x0B,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	OPAL_TABLE_MAX = 0x0C,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	/* authority table */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	OPAL_PIN = 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	/* locking tokens */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	OPAL_RANGESTART = 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	OPAL_RANGELENGTH = 0x04,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	OPAL_READLOCKENABLED = 0x05,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	OPAL_WRITELOCKENABLED = 0x06,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	OPAL_READLOCKED = 0x07,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	OPAL_WRITELOCKED = 0x08,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	OPAL_ACTIVEKEY = 0x0A,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	/* lockingsp table */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	OPAL_LIFECYCLE = 0x06,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	/* locking info table */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	OPAL_MAXRANGES = 0x04,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	/* mbr control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	OPAL_MBRENABLE = 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	OPAL_MBRDONE = 0x02,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	/* properties */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	OPAL_HOSTPROPERTIES = 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	/* atoms */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	OPAL_STARTLIST = 0xf0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	OPAL_ENDLIST = 0xf1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	OPAL_STARTNAME = 0xf2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	OPAL_ENDNAME = 0xf3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	OPAL_CALL = 0xf8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	OPAL_ENDOFDATA = 0xf9,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	OPAL_ENDOFSESSION = 0xfa,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	OPAL_STARTTRANSACTON = 0xfb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	OPAL_ENDTRANSACTON = 0xfC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	OPAL_EMPTYATOM = 0xff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	OPAL_WHERE = 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) /* Locking state for a locking range */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) enum opal_lockingstate {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	OPAL_LOCKING_READWRITE = 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	OPAL_LOCKING_READONLY = 0x02,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	OPAL_LOCKING_LOCKED = 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) enum opal_parameter {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	OPAL_SUM_SET_LIST = 0x060000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) /* Packets derived from:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)  * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)  * Secion: 3.2.3 ComPackets, Packets & Subpackets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) /* Comm Packet (header) for transmissions. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) struct opal_compacket {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	__be32 reserved0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	u8 extendedComID[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	__be32 outstandingData;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	__be32 minTransfer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	__be32 length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) /* Packet structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) struct opal_packet {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	__be32 tsn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	__be32 hsn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	__be32 seq_number;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	__be16 reserved0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	__be16 ack_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	__be32 acknowledgment;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	__be32 length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) /* Data sub packet header */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) struct opal_data_subpacket {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	u8 reserved0[6];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	__be16 kind;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	__be32 length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) /* header of a response */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) struct opal_header {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 	struct opal_compacket cp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 	struct opal_packet pkt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	struct opal_data_subpacket subpkt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) #define FC_TPER       0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) #define FC_LOCKING    0x0002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) #define FC_GEOMETRY   0x0003
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) #define FC_ENTERPRISE 0x0100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) #define FC_DATASTORE  0x0202
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) #define FC_SINGLEUSER 0x0201
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) #define FC_OPALV100   0x0200
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) #define FC_OPALV200   0x0203
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)  * The Discovery 0 Header. As defined in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)  * Opal SSC Documentation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)  * Section: 3.3.5 Capability Discovery
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) struct d0_header {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	__be32 length; /* the length of the header 48 in 2.00.100 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	__be32 revision; /**< revision of the header 1 in 2.00.100 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 	__be32 reserved01;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	__be32 reserved02;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 	 * the remainder of the structure is vendor specific and will not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	 * addressed now
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	u8 ignored[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)  * TPer Feature Descriptor. Contains flags indicating support for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)  * TPer features described in the OPAL specification. The names match the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281)  * OPAL terminology
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283)  * code == 0x001 in 2.00.100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) struct d0_tper_features {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 	 * supported_features bits:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	 * bit 7: reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 	 * bit 6: com ID management
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 	 * bit 5: reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 	 * bit 4: streaming support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	 * bit 3: buffer management
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 	 * bit 2: ACK/NACK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	 * bit 1: async
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 	 * bit 0: sync
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 	u8 supported_features;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 	 * bytes 5 through 15 are reserved, but we represent the first 3 as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 	 * u8 to keep the other two 32bits integers aligned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 	u8 reserved01[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 	__be32 reserved02;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 	__be32 reserved03;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)  * Locking Feature Descriptor. Contains flags indicating support for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)  * locking features described in the OPAL specification. The names match the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)  * OPAL terminology
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)  * code == 0x0002 in 2.00.100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) struct d0_locking_features {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	 * supported_features bits:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 	 * bits 6-7: reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	 * bit 5: MBR done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 	 * bit 4: MBR enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 	 * bit 3: media encryption
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 	 * bit 2: locked
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 	 * bit 1: locking enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 	 * bit 0: locking supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	u8 supported_features;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 	 * bytes 5 through 15 are reserved, but we represent the first 3 as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 	 * u8 to keep the other two 32bits integers aligned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 	u8 reserved01[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 	__be32 reserved02;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 	__be32 reserved03;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)  * Geometry Feature Descriptor. Contains flags indicating support for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337)  * geometry features described in the OPAL specification. The names match the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338)  * OPAL terminology
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340)  * code == 0x0003 in 2.00.100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) struct d0_geometry_features {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 	 * skip 32 bits from header, needed to align the struct to 64 bits.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 	u8 header[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 	 * reserved01:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 	 * bits 1-6: reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 	 * bit 0: align
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 	u8 reserved01;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 	u8 reserved02[7];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 	__be32 logical_block_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 	__be64 alignment_granularity;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 	__be64 lowest_aligned_lba;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360)  * Enterprise SSC Feature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362)  * code == 0x0100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) struct d0_enterprise_ssc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 	__be16 baseComID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 	__be16 numComIDs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 	/* range_crossing:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 	 * bits 1-6: reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 	 * bit 0: range crossing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 	u8 range_crossing;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 	u8 reserved01;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 	__be16 reserved02;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 	__be32 reserved03;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 	__be32 reserved04;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)  * Opal V1 feature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)  * code == 0x0200
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) struct d0_opal_v100 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 	__be16 baseComID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 	__be16 numComIDs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389)  * Single User Mode feature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)  * code == 0x0201
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) struct d0_single_user_mode {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 	__be32 num_locking_objects;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 	/* reserved01:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 	 * bit 0: any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 	 * bit 1: all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 	 * bit 2: policy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 	 * bits 3-7: reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 	u8 reserved01;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 	u8 reserved02;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 	__be16 reserved03;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 	__be32 reserved04;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408)  * Additonal Datastores feature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410)  * code == 0x0202
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) struct d0_datastore_table {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 	__be16 reserved01;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 	__be16 max_tables;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 	__be32 max_size_tables;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 	__be32 table_size_alignment;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420)  * OPAL 2.0 feature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422)  * code == 0x0203
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) struct d0_opal_v200 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 	__be16 baseComID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 	__be16 numComIDs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 	/* range_crossing:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 	 * bits 1-6: reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 	 * bit 0: range crossing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 	u8 range_crossing;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 	/* num_locking_admin_auth:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 	 * not aligned to 16 bits, so use two u8.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 	 * stored in big endian:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 	 * 0: MSB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 	 * 1: LSB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 	u8 num_locking_admin_auth[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 	/* num_locking_user_auth:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 	 * not aligned to 16 bits, so use two u8.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 	 * stored in big endian:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 	 * 0: MSB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 	 * 1: LSB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 	u8 num_locking_user_auth[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 	u8 initialPIN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 	u8 revertedPIN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 	u8 reserved01;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 	__be32 reserved02;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) /* Union of features used to parse the discovery 0 response */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) struct d0_features {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 	__be16 code;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 	 * r_version bits:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 	 * bits 4-7: version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 	 * bits 0-3: reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 	u8 r_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 	u8 length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 	u8 features[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) #endif /* _OPAL_PROTO_H */