diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 03:11:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 03:11:03 +0000 |
commit | 34c394519b9c898db784b09e3503ed21a7d3dbe9 (patch) | |
tree | 215fdd019f8ce6f7a919cf37fae0b98163f93787 /drive_encryption.h | |
parent | Adding upstream version 4.3. (diff) | |
download | mdadm-34c394519b9c898db784b09e3503ed21a7d3dbe9.tar.xz mdadm-34c394519b9c898db784b09e3503ed21a7d3dbe9.zip |
Adding upstream version 4.3+20240412.upstream/4.3+20240412
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | drive_encryption.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drive_encryption.h b/drive_encryption.h new file mode 100644 index 0000000..0cb8ff1 --- /dev/null +++ b/drive_encryption.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Read encryption information for Opal and ATA devices. + * + * Copyright (C) 2024 Intel Corporation + * Author: Blazej Kucman <blazej.kucman@intel.com> + */ + +typedef enum encryption_status { + /* The drive is not currently encrypted. */ + ENC_STATUS_UNENCRYPTED = 0, + /* The drive is encrypted and the data is not accessible. */ + ENC_STATUS_LOCKED, + /* The drive is encrypted but the data is accessible in unencrypted form. */ + ENC_STATUS_UNLOCKED +} encryption_status_t; + +typedef enum encryption_ability { + ENC_ABILITY_NONE = 0, + ENC_ABILITY_OTHER, + /* Self encrypted drive */ + ENC_ABILITY_SED +} encryption_ability_t; + +typedef struct encryption_information { + encryption_ability_t ability; + encryption_status_t status; +} encryption_information_t; + +mdadm_status_t +get_nvme_opal_encryption_information(int disk_fd, struct encryption_information *information, + const int verbose); +mdadm_status_t +get_ata_encryption_information(int disk_fd, struct encryption_information *information, + const int verbose); +const char *get_encryption_ability_string(enum encryption_ability ability); +const char *get_encryption_status_string(enum encryption_status status); |