18c16567dSChristoph Hellwig /* SPDX-License-Identifier: GPL-2.0 */ 2455a7b23SScott Bauer /* 3455a7b23SScott Bauer * Copyright © 2016 Intel Corporation 4455a7b23SScott Bauer * 5455a7b23SScott Bauer * Authors: 6455a7b23SScott Bauer * Rafael Antognolli <rafael.antognolli@intel.com> 7455a7b23SScott Bauer * Scott Bauer <scott.bauer@intel.com> 8455a7b23SScott Bauer */ 9455a7b23SScott Bauer #include <linux/types.h> 10455a7b23SScott Bauer 11455a7b23SScott Bauer #ifndef _OPAL_PROTO_H 12455a7b23SScott Bauer #define _OPAL_PROTO_H 13455a7b23SScott Bauer 144f1244c8SChristoph Hellwig /* 154f1244c8SChristoph Hellwig * These constant values come from: 164f1244c8SChristoph Hellwig * SPC-4 section 174f1244c8SChristoph Hellwig * 6.30 SECURITY PROTOCOL IN command / table 265. 184f1244c8SChristoph Hellwig */ 194f1244c8SChristoph Hellwig enum { 204f1244c8SChristoph Hellwig TCG_SECP_00 = 0, 214f1244c8SChristoph Hellwig TCG_SECP_01, 224f1244c8SChristoph Hellwig }; 234f1244c8SChristoph Hellwig 244f1244c8SChristoph Hellwig /* 254f1244c8SChristoph Hellwig * Token defs derived from: 264f1244c8SChristoph Hellwig * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00 274f1244c8SChristoph Hellwig * 3.2.2 Data Stream Encoding 284f1244c8SChristoph Hellwig */ 294f1244c8SChristoph Hellwig enum opal_response_token { 304f1244c8SChristoph Hellwig OPAL_DTA_TOKENID_BYTESTRING = 0xe0, 314f1244c8SChristoph Hellwig OPAL_DTA_TOKENID_SINT = 0xe1, 324f1244c8SChristoph Hellwig OPAL_DTA_TOKENID_UINT = 0xe2, 334f1244c8SChristoph Hellwig OPAL_DTA_TOKENID_TOKEN = 0xe3, /* actual token is returned */ 344f1244c8SChristoph Hellwig OPAL_DTA_TOKENID_INVALID = 0X0 354f1244c8SChristoph Hellwig }; 364f1244c8SChristoph Hellwig 37455a7b23SScott Bauer #define DTAERROR_NO_METHOD_STATUS 0x89 38455a7b23SScott Bauer #define GENERIC_HOST_SESSION_NUM 0x41 39455a7b23SScott Bauer 40455a7b23SScott Bauer #define TPER_SYNC_SUPPORTED 0x01 41dbec491bSScott Bauer #define MBR_ENABLED_MASK 0x10 42455a7b23SScott Bauer 43455a7b23SScott Bauer #define TINY_ATOM_DATA_MASK 0x3F 44455a7b23SScott Bauer #define TINY_ATOM_SIGNED 0x40 45455a7b23SScott Bauer 46455a7b23SScott Bauer #define SHORT_ATOM_ID 0x80 47455a7b23SScott Bauer #define SHORT_ATOM_BYTESTRING 0x20 48455a7b23SScott Bauer #define SHORT_ATOM_SIGNED 0x10 49455a7b23SScott Bauer #define SHORT_ATOM_LEN_MASK 0xF 50455a7b23SScott Bauer 51455a7b23SScott Bauer #define MEDIUM_ATOM_ID 0xC0 52455a7b23SScott Bauer #define MEDIUM_ATOM_BYTESTRING 0x10 53455a7b23SScott Bauer #define MEDIUM_ATOM_SIGNED 0x8 54455a7b23SScott Bauer #define MEDIUM_ATOM_LEN_MASK 0x7 55455a7b23SScott Bauer 56455a7b23SScott Bauer #define LONG_ATOM_ID 0xe0 57455a7b23SScott Bauer #define LONG_ATOM_BYTESTRING 0x2 58455a7b23SScott Bauer #define LONG_ATOM_SIGNED 0x1 59455a7b23SScott Bauer 60455a7b23SScott Bauer /* Derived from TCG Core spec 2.01 Section: 61455a7b23SScott Bauer * 3.2.2.1 62455a7b23SScott Bauer * Data Type 63455a7b23SScott Bauer */ 64455a7b23SScott Bauer #define TINY_ATOM_BYTE 0x7F 65455a7b23SScott Bauer #define SHORT_ATOM_BYTE 0xBF 66455a7b23SScott Bauer #define MEDIUM_ATOM_BYTE 0xDF 67455a7b23SScott Bauer #define LONG_ATOM_BYTE 0xE3 68455a7b23SScott Bauer 69455a7b23SScott Bauer #define OPAL_INVAL_PARAM 12 70455a7b23SScott Bauer #define OPAL_MANUFACTURED_INACTIVE 0x08 71455a7b23SScott Bauer #define OPAL_DISCOVERY_COMID 0x0001 72455a7b23SScott Bauer 73455a7b23SScott Bauer #define LOCKING_RANGE_NON_GLOBAL 0x03 74455a7b23SScott Bauer /* 75455a7b23SScott Bauer * User IDs used in the TCG storage SSCs 76455a7b23SScott Bauer * Derived from: TCG_Storage_Architecture_Core_Spec_v2.01_r1.00 77455a7b23SScott Bauer * Section: 6.3 Assigned UIDs 78455a7b23SScott Bauer */ 79455a7b23SScott Bauer #define OPAL_UID_LENGTH 8 80455a7b23SScott Bauer #define OPAL_METHOD_LENGTH 8 81455a7b23SScott Bauer #define OPAL_MSID_KEYLEN 15 82455a7b23SScott Bauer #define OPAL_UID_LENGTH_HALF 4 83455a7b23SScott Bauer 84455a7b23SScott Bauer /* Enum to index OPALUID array */ 85455a7b23SScott Bauer enum opal_uid { 86455a7b23SScott Bauer /* users */ 87455a7b23SScott Bauer OPAL_SMUID_UID, 88455a7b23SScott Bauer OPAL_THISSP_UID, 89455a7b23SScott Bauer OPAL_ADMINSP_UID, 90455a7b23SScott Bauer OPAL_LOCKINGSP_UID, 91455a7b23SScott Bauer OPAL_ENTERPRISE_LOCKINGSP_UID, 92455a7b23SScott Bauer OPAL_ANYBODY_UID, 93455a7b23SScott Bauer OPAL_SID_UID, 94455a7b23SScott Bauer OPAL_ADMIN1_UID, 95455a7b23SScott Bauer OPAL_USER1_UID, 96455a7b23SScott Bauer OPAL_USER2_UID, 97455a7b23SScott Bauer OPAL_PSID_UID, 98455a7b23SScott Bauer OPAL_ENTERPRISE_BANDMASTER0_UID, 99455a7b23SScott Bauer OPAL_ENTERPRISE_ERASEMASTER_UID, 100455a7b23SScott Bauer /* tables */ 101*ff91064eSJonas Rabenstein OPAL_TABLE_TABLE, 102455a7b23SScott Bauer OPAL_LOCKINGRANGE_GLOBAL, 103455a7b23SScott Bauer OPAL_LOCKINGRANGE_ACE_RDLOCKED, 104455a7b23SScott Bauer OPAL_LOCKINGRANGE_ACE_WRLOCKED, 105455a7b23SScott Bauer OPAL_MBRCONTROL, 106455a7b23SScott Bauer OPAL_MBR, 107455a7b23SScott Bauer OPAL_AUTHORITY_TABLE, 108455a7b23SScott Bauer OPAL_C_PIN_TABLE, 109455a7b23SScott Bauer OPAL_LOCKING_INFO_TABLE, 110455a7b23SScott Bauer OPAL_ENTERPRISE_LOCKING_INFO_TABLE, 111455a7b23SScott Bauer /* C_PIN_TABLE object ID's */ 112455a7b23SScott Bauer OPAL_C_PIN_MSID, 113455a7b23SScott Bauer OPAL_C_PIN_SID, 114455a7b23SScott Bauer OPAL_C_PIN_ADMIN1, 115455a7b23SScott Bauer /* half UID's (only first 4 bytes used) */ 116455a7b23SScott Bauer OPAL_HALF_UID_AUTHORITY_OBJ_REF, 117455a7b23SScott Bauer OPAL_HALF_UID_BOOLEAN_ACE, 118455a7b23SScott Bauer /* omitted optional parameter */ 119455a7b23SScott Bauer OPAL_UID_HEXFF, 120455a7b23SScott Bauer }; 121455a7b23SScott Bauer 122455a7b23SScott Bauer #define OPAL_METHOD_LENGTH 8 123455a7b23SScott Bauer 124455a7b23SScott Bauer /* Enum for indexing the OPALMETHOD array */ 125455a7b23SScott Bauer enum opal_method { 126455a7b23SScott Bauer OPAL_PROPERTIES, 127455a7b23SScott Bauer OPAL_STARTSESSION, 128455a7b23SScott Bauer OPAL_REVERT, 129455a7b23SScott Bauer OPAL_ACTIVATE, 130455a7b23SScott Bauer OPAL_EGET, 131455a7b23SScott Bauer OPAL_ESET, 132455a7b23SScott Bauer OPAL_NEXT, 133455a7b23SScott Bauer OPAL_EAUTHENTICATE, 134455a7b23SScott Bauer OPAL_GETACL, 135455a7b23SScott Bauer OPAL_GENKEY, 136455a7b23SScott Bauer OPAL_REVERTSP, 137455a7b23SScott Bauer OPAL_GET, 138455a7b23SScott Bauer OPAL_SET, 139455a7b23SScott Bauer OPAL_AUTHENTICATE, 140455a7b23SScott Bauer OPAL_RANDOM, 141455a7b23SScott Bauer OPAL_ERASE, 142455a7b23SScott Bauer }; 143455a7b23SScott Bauer 144455a7b23SScott Bauer enum opal_token { 145455a7b23SScott Bauer /* Boolean */ 146455a7b23SScott Bauer OPAL_TRUE = 0x01, 147455a7b23SScott Bauer OPAL_FALSE = 0x00, 148455a7b23SScott Bauer OPAL_BOOLEAN_EXPR = 0x03, 149455a7b23SScott Bauer /* cellblocks */ 150455a7b23SScott Bauer OPAL_TABLE = 0x00, 151455a7b23SScott Bauer OPAL_STARTROW = 0x01, 152455a7b23SScott Bauer OPAL_ENDROW = 0x02, 153455a7b23SScott Bauer OPAL_STARTCOLUMN = 0x03, 154455a7b23SScott Bauer OPAL_ENDCOLUMN = 0x04, 155455a7b23SScott Bauer OPAL_VALUES = 0x01, 156*ff91064eSJonas Rabenstein /* table table */ 157*ff91064eSJonas Rabenstein OPAL_TABLE_UID = 0x00, 158*ff91064eSJonas Rabenstein OPAL_TABLE_NAME = 0x01, 159*ff91064eSJonas Rabenstein OPAL_TABLE_COMMON = 0x02, 160*ff91064eSJonas Rabenstein OPAL_TABLE_TEMPLATE = 0x03, 161*ff91064eSJonas Rabenstein OPAL_TABLE_KIND = 0x04, 162*ff91064eSJonas Rabenstein OPAL_TABLE_COLUMN = 0x05, 163*ff91064eSJonas Rabenstein OPAL_TABLE_COLUMNS = 0x06, 164*ff91064eSJonas Rabenstein OPAL_TABLE_ROWS = 0x07, 165*ff91064eSJonas Rabenstein OPAL_TABLE_ROWS_FREE = 0x08, 166*ff91064eSJonas Rabenstein OPAL_TABLE_ROW_BYTES = 0x09, 167*ff91064eSJonas Rabenstein OPAL_TABLE_LASTID = 0x0A, 168*ff91064eSJonas Rabenstein OPAL_TABLE_MIN = 0x0B, 169*ff91064eSJonas Rabenstein OPAL_TABLE_MAX = 0x0C, 170*ff91064eSJonas Rabenstein 171455a7b23SScott Bauer /* authority table */ 172455a7b23SScott Bauer OPAL_PIN = 0x03, 173455a7b23SScott Bauer /* locking tokens */ 174455a7b23SScott Bauer OPAL_RANGESTART = 0x03, 175455a7b23SScott Bauer OPAL_RANGELENGTH = 0x04, 176455a7b23SScott Bauer OPAL_READLOCKENABLED = 0x05, 177455a7b23SScott Bauer OPAL_WRITELOCKENABLED = 0x06, 178455a7b23SScott Bauer OPAL_READLOCKED = 0x07, 179455a7b23SScott Bauer OPAL_WRITELOCKED = 0x08, 180455a7b23SScott Bauer OPAL_ACTIVEKEY = 0x0A, 181a4ddbd1bSDavid Kozub /* lockingsp table */ 182a4ddbd1bSDavid Kozub OPAL_LIFECYCLE = 0x06, 183455a7b23SScott Bauer /* locking info table */ 184455a7b23SScott Bauer OPAL_MAXRANGES = 0x04, 185455a7b23SScott Bauer /* mbr control */ 186455a7b23SScott Bauer OPAL_MBRENABLE = 0x01, 187455a7b23SScott Bauer OPAL_MBRDONE = 0x02, 188455a7b23SScott Bauer /* properties */ 189455a7b23SScott Bauer OPAL_HOSTPROPERTIES = 0x00, 190455a7b23SScott Bauer /* atoms */ 191455a7b23SScott Bauer OPAL_STARTLIST = 0xf0, 192455a7b23SScott Bauer OPAL_ENDLIST = 0xf1, 193455a7b23SScott Bauer OPAL_STARTNAME = 0xf2, 194455a7b23SScott Bauer OPAL_ENDNAME = 0xf3, 195455a7b23SScott Bauer OPAL_CALL = 0xf8, 196455a7b23SScott Bauer OPAL_ENDOFDATA = 0xf9, 197455a7b23SScott Bauer OPAL_ENDOFSESSION = 0xfa, 198455a7b23SScott Bauer OPAL_STARTTRANSACTON = 0xfb, 199455a7b23SScott Bauer OPAL_ENDTRANSACTON = 0xfC, 200455a7b23SScott Bauer OPAL_EMPTYATOM = 0xff, 201455a7b23SScott Bauer OPAL_WHERE = 0x00, 202455a7b23SScott Bauer }; 203455a7b23SScott Bauer 204455a7b23SScott Bauer /* Locking state for a locking range */ 205455a7b23SScott Bauer enum opal_lockingstate { 206455a7b23SScott Bauer OPAL_LOCKING_READWRITE = 0x01, 207455a7b23SScott Bauer OPAL_LOCKING_READONLY = 0x02, 208455a7b23SScott Bauer OPAL_LOCKING_LOCKED = 0x03, 209455a7b23SScott Bauer }; 210455a7b23SScott Bauer 211455a7b23SScott Bauer /* Packets derived from: 212455a7b23SScott Bauer * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00 213455a7b23SScott Bauer * Secion: 3.2.3 ComPackets, Packets & Subpackets 214455a7b23SScott Bauer */ 215455a7b23SScott Bauer 216455a7b23SScott Bauer /* Comm Packet (header) for transmissions. */ 217455a7b23SScott Bauer struct opal_compacket { 218455a7b23SScott Bauer __be32 reserved0; 219455a7b23SScott Bauer u8 extendedComID[4]; 220455a7b23SScott Bauer __be32 outstandingData; 221455a7b23SScott Bauer __be32 minTransfer; 222455a7b23SScott Bauer __be32 length; 223455a7b23SScott Bauer }; 224455a7b23SScott Bauer 225455a7b23SScott Bauer /* Packet structure. */ 226455a7b23SScott Bauer struct opal_packet { 227455a7b23SScott Bauer __be32 tsn; 228455a7b23SScott Bauer __be32 hsn; 229455a7b23SScott Bauer __be32 seq_number; 230455a7b23SScott Bauer __be16 reserved0; 231455a7b23SScott Bauer __be16 ack_type; 232455a7b23SScott Bauer __be32 acknowledgment; 233455a7b23SScott Bauer __be32 length; 234455a7b23SScott Bauer }; 235455a7b23SScott Bauer 236455a7b23SScott Bauer /* Data sub packet header */ 237455a7b23SScott Bauer struct opal_data_subpacket { 238455a7b23SScott Bauer u8 reserved0[6]; 239455a7b23SScott Bauer __be16 kind; 240455a7b23SScott Bauer __be32 length; 241455a7b23SScott Bauer }; 242455a7b23SScott Bauer 243455a7b23SScott Bauer /* header of a response */ 244455a7b23SScott Bauer struct opal_header { 245455a7b23SScott Bauer struct opal_compacket cp; 246455a7b23SScott Bauer struct opal_packet pkt; 247455a7b23SScott Bauer struct opal_data_subpacket subpkt; 248455a7b23SScott Bauer }; 249455a7b23SScott Bauer 250455a7b23SScott Bauer #define FC_TPER 0x0001 251455a7b23SScott Bauer #define FC_LOCKING 0x0002 252455a7b23SScott Bauer #define FC_GEOMETRY 0x0003 253455a7b23SScott Bauer #define FC_ENTERPRISE 0x0100 254455a7b23SScott Bauer #define FC_DATASTORE 0x0202 255455a7b23SScott Bauer #define FC_SINGLEUSER 0x0201 256455a7b23SScott Bauer #define FC_OPALV100 0x0200 257455a7b23SScott Bauer #define FC_OPALV200 0x0203 258455a7b23SScott Bauer 259455a7b23SScott Bauer /* 260455a7b23SScott Bauer * The Discovery 0 Header. As defined in 261455a7b23SScott Bauer * Opal SSC Documentation 262455a7b23SScott Bauer * Section: 3.3.5 Capability Discovery 263455a7b23SScott Bauer */ 264455a7b23SScott Bauer struct d0_header { 265455a7b23SScott Bauer __be32 length; /* the length of the header 48 in 2.00.100 */ 266455a7b23SScott Bauer __be32 revision; /**< revision of the header 1 in 2.00.100 */ 267455a7b23SScott Bauer __be32 reserved01; 268455a7b23SScott Bauer __be32 reserved02; 269455a7b23SScott Bauer /* 270455a7b23SScott Bauer * the remainder of the structure is vendor specific and will not be 271455a7b23SScott Bauer * addressed now 272455a7b23SScott Bauer */ 273455a7b23SScott Bauer u8 ignored[32]; 274455a7b23SScott Bauer }; 275455a7b23SScott Bauer 276455a7b23SScott Bauer /* 277455a7b23SScott Bauer * TPer Feature Descriptor. Contains flags indicating support for the 278455a7b23SScott Bauer * TPer features described in the OPAL specification. The names match the 279455a7b23SScott Bauer * OPAL terminology 280455a7b23SScott Bauer * 281455a7b23SScott Bauer * code == 0x001 in 2.00.100 282455a7b23SScott Bauer */ 283455a7b23SScott Bauer struct d0_tper_features { 284455a7b23SScott Bauer /* 285455a7b23SScott Bauer * supported_features bits: 286455a7b23SScott Bauer * bit 7: reserved 287455a7b23SScott Bauer * bit 6: com ID management 288455a7b23SScott Bauer * bit 5: reserved 289455a7b23SScott Bauer * bit 4: streaming support 290455a7b23SScott Bauer * bit 3: buffer management 291455a7b23SScott Bauer * bit 2: ACK/NACK 292455a7b23SScott Bauer * bit 1: async 293455a7b23SScott Bauer * bit 0: sync 294455a7b23SScott Bauer */ 295455a7b23SScott Bauer u8 supported_features; 296455a7b23SScott Bauer /* 297455a7b23SScott Bauer * bytes 5 through 15 are reserved, but we represent the first 3 as 298455a7b23SScott Bauer * u8 to keep the other two 32bits integers aligned. 299455a7b23SScott Bauer */ 300455a7b23SScott Bauer u8 reserved01[3]; 301455a7b23SScott Bauer __be32 reserved02; 302455a7b23SScott Bauer __be32 reserved03; 303455a7b23SScott Bauer }; 304455a7b23SScott Bauer 305455a7b23SScott Bauer /* 306455a7b23SScott Bauer * Locking Feature Descriptor. Contains flags indicating support for the 307455a7b23SScott Bauer * locking features described in the OPAL specification. The names match the 308455a7b23SScott Bauer * OPAL terminology 309455a7b23SScott Bauer * 310455a7b23SScott Bauer * code == 0x0002 in 2.00.100 311455a7b23SScott Bauer */ 312455a7b23SScott Bauer struct d0_locking_features { 313455a7b23SScott Bauer /* 314455a7b23SScott Bauer * supported_features bits: 315455a7b23SScott Bauer * bits 6-7: reserved 316455a7b23SScott Bauer * bit 5: MBR done 317455a7b23SScott Bauer * bit 4: MBR enabled 318455a7b23SScott Bauer * bit 3: media encryption 319455a7b23SScott Bauer * bit 2: locked 320455a7b23SScott Bauer * bit 1: locking enabled 321455a7b23SScott Bauer * bit 0: locking supported 322455a7b23SScott Bauer */ 323455a7b23SScott Bauer u8 supported_features; 324455a7b23SScott Bauer /* 325455a7b23SScott Bauer * bytes 5 through 15 are reserved, but we represent the first 3 as 326455a7b23SScott Bauer * u8 to keep the other two 32bits integers aligned. 327455a7b23SScott Bauer */ 328455a7b23SScott Bauer u8 reserved01[3]; 329455a7b23SScott Bauer __be32 reserved02; 330455a7b23SScott Bauer __be32 reserved03; 331455a7b23SScott Bauer }; 332455a7b23SScott Bauer 333455a7b23SScott Bauer /* 334455a7b23SScott Bauer * Geometry Feature Descriptor. Contains flags indicating support for the 335455a7b23SScott Bauer * geometry features described in the OPAL specification. The names match the 336455a7b23SScott Bauer * OPAL terminology 337455a7b23SScott Bauer * 338455a7b23SScott Bauer * code == 0x0003 in 2.00.100 339455a7b23SScott Bauer */ 340455a7b23SScott Bauer struct d0_geometry_features { 341455a7b23SScott Bauer /* 342455a7b23SScott Bauer * skip 32 bits from header, needed to align the struct to 64 bits. 343455a7b23SScott Bauer */ 344455a7b23SScott Bauer u8 header[4]; 345455a7b23SScott Bauer /* 346455a7b23SScott Bauer * reserved01: 347455a7b23SScott Bauer * bits 1-6: reserved 348455a7b23SScott Bauer * bit 0: align 349455a7b23SScott Bauer */ 350455a7b23SScott Bauer u8 reserved01; 351455a7b23SScott Bauer u8 reserved02[7]; 352455a7b23SScott Bauer __be32 logical_block_size; 353455a7b23SScott Bauer __be64 alignment_granularity; 354455a7b23SScott Bauer __be64 lowest_aligned_lba; 355455a7b23SScott Bauer }; 356455a7b23SScott Bauer 357455a7b23SScott Bauer /* 358455a7b23SScott Bauer * Enterprise SSC Feature 359455a7b23SScott Bauer * 360455a7b23SScott Bauer * code == 0x0100 361455a7b23SScott Bauer */ 362455a7b23SScott Bauer struct d0_enterprise_ssc { 363455a7b23SScott Bauer __be16 baseComID; 364455a7b23SScott Bauer __be16 numComIDs; 365455a7b23SScott Bauer /* range_crossing: 366455a7b23SScott Bauer * bits 1-6: reserved 367455a7b23SScott Bauer * bit 0: range crossing 368455a7b23SScott Bauer */ 369455a7b23SScott Bauer u8 range_crossing; 370455a7b23SScott Bauer u8 reserved01; 371455a7b23SScott Bauer __be16 reserved02; 372455a7b23SScott Bauer __be32 reserved03; 373455a7b23SScott Bauer __be32 reserved04; 374455a7b23SScott Bauer }; 375455a7b23SScott Bauer 376455a7b23SScott Bauer /* 377455a7b23SScott Bauer * Opal V1 feature 378455a7b23SScott Bauer * 379455a7b23SScott Bauer * code == 0x0200 380455a7b23SScott Bauer */ 381455a7b23SScott Bauer struct d0_opal_v100 { 382455a7b23SScott Bauer __be16 baseComID; 383455a7b23SScott Bauer __be16 numComIDs; 384455a7b23SScott Bauer }; 385455a7b23SScott Bauer 386455a7b23SScott Bauer /* 387455a7b23SScott Bauer * Single User Mode feature 388455a7b23SScott Bauer * 389455a7b23SScott Bauer * code == 0x0201 390455a7b23SScott Bauer */ 391455a7b23SScott Bauer struct d0_single_user_mode { 392455a7b23SScott Bauer __be32 num_locking_objects; 393455a7b23SScott Bauer /* reserved01: 394455a7b23SScott Bauer * bit 0: any 395455a7b23SScott Bauer * bit 1: all 396455a7b23SScott Bauer * bit 2: policy 397455a7b23SScott Bauer * bits 3-7: reserved 398455a7b23SScott Bauer */ 399455a7b23SScott Bauer u8 reserved01; 400455a7b23SScott Bauer u8 reserved02; 401455a7b23SScott Bauer __be16 reserved03; 402455a7b23SScott Bauer __be32 reserved04; 403455a7b23SScott Bauer }; 404455a7b23SScott Bauer 405455a7b23SScott Bauer /* 406455a7b23SScott Bauer * Additonal Datastores feature 407455a7b23SScott Bauer * 408455a7b23SScott Bauer * code == 0x0202 409455a7b23SScott Bauer */ 410455a7b23SScott Bauer struct d0_datastore_table { 411455a7b23SScott Bauer __be16 reserved01; 412455a7b23SScott Bauer __be16 max_tables; 413455a7b23SScott Bauer __be32 max_size_tables; 414455a7b23SScott Bauer __be32 table_size_alignment; 415455a7b23SScott Bauer }; 416455a7b23SScott Bauer 417455a7b23SScott Bauer /* 418455a7b23SScott Bauer * OPAL 2.0 feature 419455a7b23SScott Bauer * 420455a7b23SScott Bauer * code == 0x0203 421455a7b23SScott Bauer */ 422455a7b23SScott Bauer struct d0_opal_v200 { 423455a7b23SScott Bauer __be16 baseComID; 424455a7b23SScott Bauer __be16 numComIDs; 425455a7b23SScott Bauer /* range_crossing: 426455a7b23SScott Bauer * bits 1-6: reserved 427455a7b23SScott Bauer * bit 0: range crossing 428455a7b23SScott Bauer */ 429455a7b23SScott Bauer u8 range_crossing; 430455a7b23SScott Bauer /* num_locking_admin_auth: 431455a7b23SScott Bauer * not aligned to 16 bits, so use two u8. 432455a7b23SScott Bauer * stored in big endian: 433455a7b23SScott Bauer * 0: MSB 434455a7b23SScott Bauer * 1: LSB 435455a7b23SScott Bauer */ 436455a7b23SScott Bauer u8 num_locking_admin_auth[2]; 437455a7b23SScott Bauer /* num_locking_user_auth: 438455a7b23SScott Bauer * not aligned to 16 bits, so use two u8. 439455a7b23SScott Bauer * stored in big endian: 440455a7b23SScott Bauer * 0: MSB 441455a7b23SScott Bauer * 1: LSB 442455a7b23SScott Bauer */ 443455a7b23SScott Bauer u8 num_locking_user_auth[2]; 444455a7b23SScott Bauer u8 initialPIN; 445455a7b23SScott Bauer u8 revertedPIN; 446455a7b23SScott Bauer u8 reserved01; 447455a7b23SScott Bauer __be32 reserved02; 448455a7b23SScott Bauer }; 449455a7b23SScott Bauer 450455a7b23SScott Bauer /* Union of features used to parse the discovery 0 response */ 451455a7b23SScott Bauer struct d0_features { 452455a7b23SScott Bauer __be16 code; 453455a7b23SScott Bauer /* 454455a7b23SScott Bauer * r_version bits: 455455a7b23SScott Bauer * bits 4-7: version 456455a7b23SScott Bauer * bits 0-3: reserved 457455a7b23SScott Bauer */ 458455a7b23SScott Bauer u8 r_version; 459455a7b23SScott Bauer u8 length; 460455a7b23SScott Bauer u8 features[]; 461455a7b23SScott Bauer }; 462455a7b23SScott Bauer 463455a7b23SScott Bauer #endif /* _OPAL_PROTO_H */ 464