summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/nvme.h
diff options
context:
space:
mode:
authorScott Bauer2017-02-03 20:50:32 +0100
committerJens Axboe2017-02-06 17:44:21 +0100
commita98e58e54fbd0c80b6a46a7cac6e231eed3b3efa (patch)
treefa346839016a9667d47cf28d0744828d9db93006 /drivers/nvme/host/nvme.h
parentblock: Add Sed-opal library (diff)
downloadkernel-qcow2-linux-a98e58e54fbd0c80b6a46a7cac6e231eed3b3efa.tar.gz
kernel-qcow2-linux-a98e58e54fbd0c80b6a46a7cac6e231eed3b3efa.tar.xz
kernel-qcow2-linux-a98e58e54fbd0c80b6a46a7cac6e231eed3b3efa.zip
nvme: Add Support for Opal: Unlock from S3 & Opal Allocation/Ioctls
This patch implements the necessary logic to unlock an Opal enabled device coming back from an S3. The patch also implements the SED/Opal allocation necessary to support the opal ioctls. Signed-off-by: Scott Bauer <scott.bauer@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r--drivers/nvme/host/nvme.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 330713c4abdb..1aa353a848e3 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -19,6 +19,7 @@
#include <linux/kref.h>
#include <linux/blk-mq.h>
#include <linux/lightnvm.h>
+#include <linux/sed-opal.h>
enum {
/*
@@ -125,6 +126,8 @@ struct nvme_ctrl {
struct list_head node;
struct ida ns_ida;
+ struct opal_dev opal_dev;
+
char name[12];
char serial[20];
char model[40];
@@ -275,6 +278,17 @@ int nvme_init_identify(struct nvme_ctrl *ctrl);
void nvme_queue_scan(struct nvme_ctrl *ctrl);
void nvme_remove_namespaces(struct nvme_ctrl *ctrl);
+#ifdef CONFIG_BLK_SED_OPAL
+int nvme_sec_submit(struct opal_dev *dev, u16 spsp, u8 secp,
+ void *buffer, size_t len, bool send);
+#else
+static inline int nvme_sec_submit(struct opal_dev *dev, u16 spsp, u8 secp,
+ void *buffer, size_t len, bool send)
+{
+ return 0;
+}
+#endif /* CONFIG_BLK_DEV_SED_OPAL */
+
#define NVME_NR_AERS 1
void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
union nvme_result *res);