History

block: sed-opal: Add support to read/write opal tables generically

This feature gives the user RW access to any opal table with admin1 authority. The flags described in the new structure determines if the user wants to read/write the data. Flags are checked for valid values in order to allow future features to be added to the ioctl. The user can provide the desired table's UID. Also, the ioctl provides a size and offset field and internally will loop data accesses to return the full data block. Read overrun is prevented by the initiator's sec_send_recv() backend. The ioctl provides a private field with the intention to accommodate any future expansions to the ioctl.

Revanth Rajashekar committed 7 years ago

Commit 51f421c1 parent 3495ea14 files · +193 −1Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/sed-opal.h+20−0
@@ -113,6 +113,25 @@ struct opal_shadow_mbr { · 112 unmodified lines
113113 __u64 size;
114114 };
115115
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+
116135 #define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)
117136 #define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)
118137 #define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)
@@ -128,5 +147,6 @@ struct opal_shadow_mbr { · 9 unmodified lines
128147 #define IOC_OPAL_PSID_REVERT_TPR _IOW('p', 232, struct opal_key)
129148 #define IOC_OPAL_MBR_DONE _IOW('p', 233, struct opal_mbr_done)
130149 #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)
131151
132152 #endif /* _UAPI_SED_OPAL_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t