summaryrefslogtreecommitdiff
path: root/include/linux/nvme.h
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2013-03-05 05:40:58 +0400
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-03-28 22:50:49 +0400
commit5d0f6131a79adfa1fb51309c5f81a2a4ef879dd4 (patch)
tree746ea0e412541fc7c0cd5212cdd903f46e02c4c3 /include/linux/nvme.h
parentf8ebf8409abfdaeeb8c847381629a2a8b8e3d816 (diff)
downloadlinux-5d0f6131a79adfa1fb51309c5f81a2a4ef879dd4.tar.xz
NVMe: Add nvme-scsi.c
Translates SCSI commands in SG_IO ioctl to NVMe commands. Uses the scsi-nvme translation spec from nvmexpress.org as reference. Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'include/linux/nvme.h')
-rw-r--r--include/linux/nvme.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index f1974cab60cf..aa575033dbe7 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -546,6 +546,8 @@ struct nvme_ns {
int ns_id;
int lba_shift;
+ u64 mode_select_num_blocks;
+ u32 mode_select_block_len;
};
/*
@@ -563,6 +565,39 @@ struct nvme_iod {
dma_addr_t first_dma;
struct scatterlist sg[0];
};
+
+/**
+ * nvme_free_iod - frees an nvme_iod
+ * @dev: The device that the I/O was submitted to
+ * @iod: The memory to free
+ */
+void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod);
+
+int nvme_setup_prps(struct nvme_dev *dev, struct nvme_common_command *cmd,
+ struct nvme_iod *iod, int total_len, gfp_t gfp);
+struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write,
+ unsigned long addr, unsigned length);
+void nvme_unmap_user_pages(struct nvme_dev *dev, int write,
+ struct nvme_iod *iod);
+struct nvme_queue *get_nvmeq(struct nvme_dev *dev);
+void put_nvmeq(struct nvme_queue *nvmeq);
+int nvme_submit_sync_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd,
+ u32 *result, unsigned timeout);
+int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns);
+int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *,
+ u32 *result);
+int nvme_identify(struct nvme_dev *, unsigned nsid, unsigned cns,
+ dma_addr_t dma_addr);
+int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
+ dma_addr_t dma_addr, u32 *result);
+int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
+ dma_addr_t dma_addr, u32 *result);
+
+struct sg_io_hdr;
+
+int nvme_sg_io(struct nvme_ns *ns, struct sg_io_hdr __user *u_hdr);
+int nvme_sg_get_version_num(int __user *ip);
+
#endif
#endif /* _LINUX_NVME_H */