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