hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/uapi/linux/sed-opal.h
....@@ -5,15 +5,6 @@
55 * Authors:
66 * Rafael Antognolli <rafael.antognolli@intel.com>
77 * Scott Bauer <scott.bauer@intel.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify it
10
- * under the terms and conditions of the GNU General Public License,
11
- * version 2, as published by the Free Software Foundation.
12
- *
13
- * This program is distributed in the hope it will be useful, but WITHOUT
14
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16
- * more details.
178 */
189
1910 #ifndef _UAPI_SED_OPAL_H
....@@ -27,6 +18,11 @@
2718 enum opal_mbr {
2819 OPAL_MBR_ENABLE = 0x0,
2920 OPAL_MBR_DISABLE = 0x01,
21
+};
22
+
23
+enum opal_mbr_done_flag {
24
+ OPAL_MBR_NOT_DONE = 0x0,
25
+ OPAL_MBR_DONE = 0x01
3026 };
3127
3228 enum opal_user {
....@@ -58,7 +54,7 @@
5854 struct opal_lr_act {
5955 struct opal_key key;
6056 __u32 sum;
61
- __u8 num_lrs;
57
+ __u8 num_lrs;
6258 __u8 lr[OPAL_MAX_LRS];
6359 __u8 align[2]; /* Align to 8 byte boundary */
6460 };
....@@ -104,6 +100,38 @@
104100 __u8 __align[7];
105101 };
106102
103
+struct opal_mbr_done {
104
+ struct opal_key key;
105
+ __u8 done_flag;
106
+ __u8 __align[7];
107
+};
108
+
109
+struct opal_shadow_mbr {
110
+ struct opal_key key;
111
+ const __u64 data;
112
+ __u64 offset;
113
+ __u64 size;
114
+};
115
+
116
+/* Opal table operations */
117
+enum opal_table_ops {
118
+ OPAL_READ_TABLE,
119
+ OPAL_WRITE_TABLE,
120
+};
121
+
122
+#define OPAL_UID_LENGTH 8
123
+struct opal_read_write_table {
124
+ struct opal_key key;
125
+ const __u64 data;
126
+ const __u8 table_uid[OPAL_UID_LENGTH];
127
+ __u64 offset;
128
+ __u64 size;
129
+#define OPAL_TABLE_READ (1 << OPAL_READ_TABLE)
130
+#define OPAL_TABLE_WRITE (1 << OPAL_WRITE_TABLE)
131
+ __u64 flags;
132
+ __u64 priv;
133
+};
134
+
107135 #define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)
108136 #define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)
109137 #define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)
....@@ -116,5 +144,9 @@
116144 #define IOC_OPAL_ENABLE_DISABLE_MBR _IOW('p', 229, struct opal_mbr_data)
117145 #define IOC_OPAL_ERASE_LR _IOW('p', 230, struct opal_session_info)
118146 #define IOC_OPAL_SECURE_ERASE_LR _IOW('p', 231, struct opal_session_info)
147
+#define IOC_OPAL_PSID_REVERT_TPR _IOW('p', 232, struct opal_key)
148
+#define IOC_OPAL_MBR_DONE _IOW('p', 233, struct opal_mbr_done)
149
+#define IOC_OPAL_WRITE_SHADOW_MBR _IOW('p', 234, struct opal_shadow_mbr)
150
+#define IOC_OPAL_GENERIC_TABLE_RW _IOW('p', 235, struct opal_read_write_table)
119151
120152 #endif /* _UAPI_SED_OPAL_H */