]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/nvme/host/nvme.h
nvme: don't pass the full CQE to nvme_complete_async_event
[mirror_ubuntu-zesty-kernel.git] / drivers / nvme / host / nvme.h
index b0a9ec681685c8e91f5262aaca3a95abb3da3e3e..468fc445bf3512dd764cba899fe9dc7790505170 100644 (file)
@@ -79,6 +79,20 @@ enum nvme_quirks {
        NVME_QUIRK_DELAY_BEFORE_CHK_RDY         = (1 << 3),
 };
 
+/*
+ * Common request structure for NVMe passthrough.  All drivers must have
+ * this structure as the first member of their request-private data.
+ */
+struct nvme_request {
+       struct nvme_command     *cmd;
+       union nvme_result       result;
+};
+
+static inline struct nvme_request *nvme_req(struct request *req)
+{
+       return blk_mq_rq_to_pdu(req);
+}
+
 /* The below value is the specific amount of delay needed before checking
  * readiness in case of the PCI_DEVICE(0x1c58, 0x0003), which needs the
  * NVME_QUIRK_DELAY_BEFORE_CHK_RDY quirk enabled. The value (in ms) was
@@ -185,7 +199,6 @@ struct nvme_ctrl_ops {
        int (*reg_read64)(struct nvme_ctrl *ctrl, u32 off, u64 *val);
        int (*reset_ctrl)(struct nvme_ctrl *ctrl);
        void (*free_ctrl)(struct nvme_ctrl *ctrl);
-       void (*post_scan)(struct nvme_ctrl *ctrl);
        void (*submit_async_event)(struct nvme_ctrl *ctrl, int aer_idx);
        int (*delete_ctrl)(struct nvme_ctrl *ctrl);
        const char *(*get_subsysnqn)(struct nvme_ctrl *ctrl);
@@ -262,8 +275,8 @@ void nvme_queue_scan(struct nvme_ctrl *ctrl);
 void nvme_remove_namespaces(struct nvme_ctrl *ctrl);
 
 #define NVME_NR_AERS   1
-void nvme_complete_async_event(struct nvme_ctrl *ctrl,
-               struct nvme_completion *cqe);
+void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
+               union nvme_result *res);
 void nvme_queue_async_events(struct nvme_ctrl *ctrl);
 
 void nvme_stop_queues(struct nvme_ctrl *ctrl);
@@ -279,7 +292,7 @@ int nvme_setup_cmd(struct nvme_ns *ns, struct request *req,
 int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
                void *buf, unsigned bufflen);
 int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
-               struct nvme_completion *cqe, void *buffer, unsigned bufflen,
+               union nvme_result *result, void *buffer, unsigned bufflen,
                unsigned timeout, int qid, int at_head, int flags);
 int nvme_submit_user_cmd(struct request_queue *q, struct nvme_command *cmd,
                void __user *ubuffer, unsigned bufflen, u32 *result,