aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2013-03-04 20:40:58 -0500
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-03-28 14:50:49 -0400
commit5d0f6131a79adfa1fb51309c5f81a2a4ef879dd4 (patch)
tree746ea0e412541fc7c0cd5212cdd903f46e02c4c3 /include
parentf8ebf8409abfdaeeb8c847381629a2a8b8e3d816 (diff)
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')
-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 {
546 546
547 int ns_id; 547 int ns_id;
548 int lba_shift; 548 int lba_shift;
549 u64 mode_select_num_blocks;
550 u32 mode_select_block_len;
549}; 551};
550 552
551/* 553/*
@@ -563,6 +565,39 @@ struct nvme_iod {
563 dma_addr_t first_dma; 565 dma_addr_t first_dma;
564 struct scatterlist sg[0]; 566 struct scatterlist sg[0];
565}; 567};
568
569/**
570 * nvme_free_iod - frees an nvme_iod
571 * @dev: The device that the I/O was submitted to
572 * @iod: The memory to free
573 */
574void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod);
575
576int nvme_setup_prps(struct nvme_dev *dev, struct nvme_common_command *cmd,
577 struct nvme_iod *iod, int total_len, gfp_t gfp);
578struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write,
579 unsigned long addr, unsigned length);
580void nvme_unmap_user_pages(struct nvme_dev *dev, int write,
581 struct nvme_iod *iod);
582struct nvme_queue *get_nvmeq(struct nvme_dev *dev);
583void put_nvmeq(struct nvme_queue *nvmeq);
584int nvme_submit_sync_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd,
585 u32 *result, unsigned timeout);
586int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns);
587int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *,
588 u32 *result);
589int nvme_identify(struct nvme_dev *, unsigned nsid, unsigned cns,
590 dma_addr_t dma_addr);
591int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
592 dma_addr_t dma_addr, u32 *result);
593int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
594 dma_addr_t dma_addr, u32 *result);
595
596struct sg_io_hdr;
597
598int nvme_sg_io(struct nvme_ns *ns, struct sg_io_hdr __user *u_hdr);
599int nvme_sg_get_version_num(int __user *ip);
600
566#endif 601#endif
567 602
568#endif /* _LINUX_NVME_H */ 603#endif /* _LINUX_NVME_H */