| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright © 2016 Intel Corporation |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Authors: |
|---|
| 5 | 6 | * Rafael Antognolli <rafael.antognolli@intel.com> |
|---|
| 6 | 7 | * Scott Bauer <scott.bauer@intel.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 9 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 10 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 13 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 14 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 15 | | - * more details. |
|---|
| 16 | 8 | */ |
|---|
| 17 | 9 | #include <linux/types.h> |
|---|
| 18 | 10 | |
|---|
| .. | .. |
|---|
| 44 | 36 | |
|---|
| 45 | 37 | #define DTAERROR_NO_METHOD_STATUS 0x89 |
|---|
| 46 | 38 | #define GENERIC_HOST_SESSION_NUM 0x41 |
|---|
| 39 | +#define FIRST_TPER_SESSION_NUM 4096 |
|---|
| 47 | 40 | |
|---|
| 48 | 41 | #define TPER_SYNC_SUPPORTED 0x01 |
|---|
| 49 | 42 | #define MBR_ENABLED_MASK 0x10 |
|---|
| .. | .. |
|---|
| 84 | 77 | * Derived from: TCG_Storage_Architecture_Core_Spec_v2.01_r1.00 |
|---|
| 85 | 78 | * Section: 6.3 Assigned UIDs |
|---|
| 86 | 79 | */ |
|---|
| 87 | | -#define OPAL_UID_LENGTH 8 |
|---|
| 88 | 80 | #define OPAL_METHOD_LENGTH 8 |
|---|
| 89 | 81 | #define OPAL_MSID_KEYLEN 15 |
|---|
| 90 | 82 | #define OPAL_UID_LENGTH_HALF 4 |
|---|
| .. | .. |
|---|
| 106 | 98 | OPAL_ENTERPRISE_BANDMASTER0_UID, |
|---|
| 107 | 99 | OPAL_ENTERPRISE_ERASEMASTER_UID, |
|---|
| 108 | 100 | /* tables */ |
|---|
| 101 | + OPAL_TABLE_TABLE, |
|---|
| 109 | 102 | OPAL_LOCKINGRANGE_GLOBAL, |
|---|
| 110 | 103 | OPAL_LOCKINGRANGE_ACE_RDLOCKED, |
|---|
| 111 | 104 | OPAL_LOCKINGRANGE_ACE_WRLOCKED, |
|---|
| .. | .. |
|---|
| 115 | 108 | OPAL_C_PIN_TABLE, |
|---|
| 116 | 109 | OPAL_LOCKING_INFO_TABLE, |
|---|
| 117 | 110 | OPAL_ENTERPRISE_LOCKING_INFO_TABLE, |
|---|
| 111 | + OPAL_DATASTORE, |
|---|
| 118 | 112 | /* C_PIN_TABLE object ID's */ |
|---|
| 119 | 113 | OPAL_C_PIN_MSID, |
|---|
| 120 | 114 | OPAL_C_PIN_SID, |
|---|
| .. | .. |
|---|
| 125 | 119 | /* omitted optional parameter */ |
|---|
| 126 | 120 | OPAL_UID_HEXFF, |
|---|
| 127 | 121 | }; |
|---|
| 128 | | - |
|---|
| 129 | | -#define OPAL_METHOD_LENGTH 8 |
|---|
| 130 | 122 | |
|---|
| 131 | 123 | /* Enum for indexing the OPALMETHOD array */ |
|---|
| 132 | 124 | enum opal_method { |
|---|
| .. | .. |
|---|
| 160 | 152 | OPAL_STARTCOLUMN = 0x03, |
|---|
| 161 | 153 | OPAL_ENDCOLUMN = 0x04, |
|---|
| 162 | 154 | OPAL_VALUES = 0x01, |
|---|
| 155 | + /* table table */ |
|---|
| 156 | + OPAL_TABLE_UID = 0x00, |
|---|
| 157 | + OPAL_TABLE_NAME = 0x01, |
|---|
| 158 | + OPAL_TABLE_COMMON = 0x02, |
|---|
| 159 | + OPAL_TABLE_TEMPLATE = 0x03, |
|---|
| 160 | + OPAL_TABLE_KIND = 0x04, |
|---|
| 161 | + OPAL_TABLE_COLUMN = 0x05, |
|---|
| 162 | + OPAL_TABLE_COLUMNS = 0x06, |
|---|
| 163 | + OPAL_TABLE_ROWS = 0x07, |
|---|
| 164 | + OPAL_TABLE_ROWS_FREE = 0x08, |
|---|
| 165 | + OPAL_TABLE_ROW_BYTES = 0x09, |
|---|
| 166 | + OPAL_TABLE_LASTID = 0x0A, |
|---|
| 167 | + OPAL_TABLE_MIN = 0x0B, |
|---|
| 168 | + OPAL_TABLE_MAX = 0x0C, |
|---|
| 163 | 169 | /* authority table */ |
|---|
| 164 | 170 | OPAL_PIN = 0x03, |
|---|
| 165 | 171 | /* locking tokens */ |
|---|
| .. | .. |
|---|
| 170 | 176 | OPAL_READLOCKED = 0x07, |
|---|
| 171 | 177 | OPAL_WRITELOCKED = 0x08, |
|---|
| 172 | 178 | OPAL_ACTIVEKEY = 0x0A, |
|---|
| 179 | + /* lockingsp table */ |
|---|
| 180 | + OPAL_LIFECYCLE = 0x06, |
|---|
| 173 | 181 | /* locking info table */ |
|---|
| 174 | 182 | OPAL_MAXRANGES = 0x04, |
|---|
| 175 | | - /* mbr control */ |
|---|
| 183 | + /* mbr control */ |
|---|
| 176 | 184 | OPAL_MBRENABLE = 0x01, |
|---|
| 177 | 185 | OPAL_MBRDONE = 0x02, |
|---|
| 178 | 186 | /* properties */ |
|---|
| .. | .. |
|---|
| 198 | 206 | OPAL_LOCKING_LOCKED = 0x03, |
|---|
| 199 | 207 | }; |
|---|
| 200 | 208 | |
|---|
| 209 | +enum opal_parameter { |
|---|
| 210 | + OPAL_SUM_SET_LIST = 0x060000, |
|---|
| 211 | +}; |
|---|
| 212 | + |
|---|
| 201 | 213 | /* Packets derived from: |
|---|
| 202 | 214 | * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00 |
|---|
| 203 | 215 | * Secion: 3.2.3 ComPackets, Packets & Subpackets |
|---|