summaryrefslogtreecommitdiff
path: root/include/linux/sed-opal.h
diff options
context:
space:
mode:
authordougmill@linux.vnet.ibm.com <dougmill@linux.vnet.ibm.com>2022-08-16 15:07:13 +0100
committerJens Axboe <axboe@kernel.dk>2022-08-22 07:52:51 -0600
commitc6ea70604249bc357ce09e9f8e16c29df0fb2fa2 (patch)
tree8d8556108b2bb25aec62b08c17f1fd5a125ff11e /include/linux/sed-opal.h
parent1c23f9e627a7b412978b4e852793c5e3c3efc555 (diff)
block: sed-opal: Add ioctl to return device status
Provide a mechanism to retrieve basic status information about the device, including the "supported" flag indicating whether SED-OPAL is supported. The information returned is from the various feature descriptors received during the discovery0 step, and so this ioctl does nothing more than perform the discovery0 step and then save the information received. See "struct opal_status" and OPAL_FL_* bits for the status information currently returned. This is necessary to be able to check whether a device is OPAL enabled, set up, locked or unlocked from userspace programs like systemd-cryptsetup and libcryptsetup. Right now we just have to assume the user 'knows' or blindly attempt setup/lock/unlock operations. Signed-off-by: Douglas Miller <dougmill@linux.vnet.ibm.com> Tested-by: Luca Boccassi <bluca@debian.org> Reviewed-by: Scott Bauer <sbauer@plzdonthack.me> Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org> Link: https://lore.kernel.org/r/20220816140713.84893-1-luca.boccassi@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/sed-opal.h')
-rw-r--r--include/linux/sed-opal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sed-opal.h b/include/linux/sed-opal.h
index 1ac0d712a9c3..6f837bb6c715 100644
--- a/include/linux/sed-opal.h
+++ b/include/linux/sed-opal.h
@@ -43,6 +43,7 @@ static inline bool is_sed_ioctl(unsigned int cmd)
case IOC_OPAL_MBR_DONE:
case IOC_OPAL_WRITE_SHADOW_MBR:
case IOC_OPAL_GENERIC_TABLE_RW:
+ case IOC_OPAL_GET_STATUS:
return true;
}
return false;