/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright © 2016 Intel Corporation * * Authors: * Rafael Antognolli <[email protected]> * Scott Bauer <[email protected]> */ #include <linux/types.h> #ifndef _OPAL_PROTO_H #define _OPAL_PROTO_H /* * These constant values come from: * SPC-4 section * 6.30 SECURITY PROTOCOL IN command / table 265. */ enum { … }; /* * Token defs derived from: * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00 * 3.2.2 Data Stream Encoding */ enum opal_response_token { … }; #define DTAERROR_NO_METHOD_STATUS … #define GENERIC_HOST_SESSION_NUM … #define FIRST_TPER_SESSION_NUM … #define TPER_SYNC_SUPPORTED … /* FC_LOCKING features */ #define LOCKING_SUPPORTED_MASK … #define LOCKING_ENABLED_MASK … #define LOCKED_MASK … #define MBR_ENABLED_MASK … #define MBR_DONE_MASK … #define TINY_ATOM_DATA_MASK … #define TINY_ATOM_SIGNED … #define SHORT_ATOM_ID … #define SHORT_ATOM_BYTESTRING … #define SHORT_ATOM_SIGNED … #define SHORT_ATOM_LEN_MASK … #define MEDIUM_ATOM_ID … #define MEDIUM_ATOM_BYTESTRING … #define MEDIUM_ATOM_SIGNED … #define MEDIUM_ATOM_LEN_MASK … #define LONG_ATOM_ID … #define LONG_ATOM_BYTESTRING … #define LONG_ATOM_SIGNED … /* Derived from TCG Core spec 2.01 Section: * 3.2.2.1 * Data Type */ #define TINY_ATOM_BYTE … #define SHORT_ATOM_BYTE … #define MEDIUM_ATOM_BYTE … #define LONG_ATOM_BYTE … #define EMPTY_ATOM_BYTE … #define OPAL_INVAL_PARAM … #define OPAL_MANUFACTURED_INACTIVE … #define OPAL_DISCOVERY_COMID … #define LOCKING_RANGE_NON_GLOBAL … /* * User IDs used in the TCG storage SSCs * Derived from: TCG_Storage_Architecture_Core_Spec_v2.01_r1.00 * Section: 6.3 Assigned UIDs */ #define OPAL_METHOD_LENGTH … #define OPAL_MSID_KEYLEN … #define OPAL_UID_LENGTH_HALF … /* * Boolean operators from TCG Core spec 2.01 Section: * 5.1.3.11 * Table 61 */ #define OPAL_BOOLEAN_AND … #define OPAL_BOOLEAN_OR … #define OPAL_BOOLEAN_NOT … /* Enum to index OPALUID array */ enum opal_uid { … }; /* Enum for indexing the OPALMETHOD array */ enum opal_method { … }; enum opal_token { … }; /* Locking state for a locking range */ enum opal_lockingstate { … }; enum opal_parameter { … }; enum opal_revertlsp { … }; /* Packets derived from: * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00 * Secion: 3.2.3 ComPackets, Packets & Subpackets */ /* Comm Packet (header) for transmissions. */ struct opal_compacket { … }; /* Packet structure. */ struct opal_packet { … }; /* Data sub packet header */ struct opal_data_subpacket { … }; /* header of a response */ struct opal_header { … }; #define FC_TPER … #define FC_LOCKING … #define FC_GEOMETRY … #define FC_ENTERPRISE … #define FC_DATASTORE … #define FC_SINGLEUSER … #define FC_OPALV100 … #define FC_OPALV200 … /* * The Discovery 0 Header. As defined in * Opal SSC Documentation * Section: 3.3.5 Capability Discovery */ struct d0_header { … }; /* * TPer Feature Descriptor. Contains flags indicating support for the * TPer features described in the OPAL specification. The names match the * OPAL terminology * * code == 0x001 in 2.00.100 */ struct d0_tper_features { … }; /* * Locking Feature Descriptor. Contains flags indicating support for the * locking features described in the OPAL specification. The names match the * OPAL terminology * * code == 0x0002 in 2.00.100 */ struct d0_locking_features { … }; /* * Geometry Feature Descriptor. Contains flags indicating support for the * geometry features described in the OPAL specification. The names match the * OPAL terminology * * code == 0x0003 in 2.00.100 */ struct d0_geometry_features { … }; /* * Enterprise SSC Feature * * code == 0x0100 */ struct d0_enterprise_ssc { … }; /* * Opal V1 feature * * code == 0x0200 */ struct d0_opal_v100 { … }; /* * Single User Mode feature * * code == 0x0201 */ struct d0_single_user_mode { … }; /* * Additonal Datastores feature * * code == 0x0202 */ struct d0_datastore_table { … }; /* * OPAL 2.0 feature * * code == 0x0203 */ struct d0_opal_v200 { … }; /* Union of features used to parse the discovery 0 response */ struct d0_features { … }; #endif /* _OPAL_PROTO_H */