]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/nvme/host/nvme.h
Merge branch 'for-4.11/block' into for-4.11/linus-merge
[karo-tx-linux.git] / drivers / nvme / host / nvme.h
index 6377e14586dc5c837749049cf3dafc7b210a3026..14cfc6f7facb240a96630a637ccc60bd45911302 100644 (file)
@@ -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];
@@ -137,6 +140,7 @@ struct nvme_ctrl {
        u32 max_hw_sectors;
        u16 oncs;
        u16 vid;
+       u16 oacs;
        atomic_t abort_limit;
        u8 event_limit;
        u8 vwc;
@@ -225,14 +229,6 @@ static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector)
        return (sector >> (ns->lba_shift - 9));
 }
 
-static inline unsigned nvme_map_len(struct request *rq)
-{
-       if (req_op(rq) == REQ_OP_DISCARD)
-               return sizeof(struct nvme_dsm_range);
-       else
-               return blk_rq_bytes(rq);
-}
-
 static inline void nvme_cleanup_cmd(struct request *req)
 {
        if (req->rq_flags & RQF_SPECIAL_PAYLOAD) {
@@ -275,6 +271,9 @@ int nvme_init_identify(struct nvme_ctrl *ctrl);
 void nvme_queue_scan(struct nvme_ctrl *ctrl);
 void nvme_remove_namespaces(struct nvme_ctrl *ctrl);
 
+int nvme_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, size_t len,
+               bool send);
+
 #define NVME_NR_AERS   1
 void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
                union nvme_result *res);
@@ -326,6 +325,7 @@ int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node);
 void nvme_nvm_unregister(struct nvme_ns *ns);
 int nvme_nvm_register_sysfs(struct nvme_ns *ns);
 void nvme_nvm_unregister_sysfs(struct nvme_ns *ns);
+int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd, unsigned long arg);
 #else
 static inline int nvme_nvm_register(struct nvme_ns *ns, char *disk_name,
                                    int node)
@@ -343,6 +343,11 @@ static inline int nvme_nvm_ns_supported(struct nvme_ns *ns, struct nvme_id_ns *i
 {
        return 0;
 }
+static inline int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd,
+                                                       unsigned long arg)
+{
+       return -ENOTTY;
+}
 #endif /* CONFIG_NVM */
 
 static inline struct nvme_ns *nvme_get_ns_from_dev(struct device *dev)