diff options
| author | Vishal Verma <vishal.l.verma@intel.com> | 2013-03-04 20:40:58 -0500 |
|---|---|---|
| committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2013-03-28 14:50:49 -0400 |
| commit | 5d0f6131a79adfa1fb51309c5f81a2a4ef879dd4 (patch) | |
| tree | 746ea0e412541fc7c0cd5212cdd903f46e02c4c3 /include/linux | |
| parent | f8ebf8409abfdaeeb8c847381629a2a8b8e3d816 (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/linux')
| -rw-r--r-- | include/linux/nvme.h | 35 |
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 | */ | ||
| 574 | void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod); | ||
| 575 | |||
| 576 | int nvme_setup_prps(struct nvme_dev *dev, struct nvme_common_command *cmd, | ||
| 577 | struct nvme_iod *iod, int total_len, gfp_t gfp); | ||
| 578 | struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write, | ||
| 579 | unsigned long addr, unsigned length); | ||
| 580 | void nvme_unmap_user_pages(struct nvme_dev *dev, int write, | ||
| 581 | struct nvme_iod *iod); | ||
| 582 | struct nvme_queue *get_nvmeq(struct nvme_dev *dev); | ||
| 583 | void put_nvmeq(struct nvme_queue *nvmeq); | ||
| 584 | int nvme_submit_sync_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd, | ||
| 585 | u32 *result, unsigned timeout); | ||
| 586 | int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns); | ||
| 587 | int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *, | ||
| 588 | u32 *result); | ||
| 589 | int nvme_identify(struct nvme_dev *, unsigned nsid, unsigned cns, | ||
| 590 | dma_addr_t dma_addr); | ||
| 591 | int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, | ||
| 592 | dma_addr_t dma_addr, u32 *result); | ||
| 593 | int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, | ||
| 594 | dma_addr_t dma_addr, u32 *result); | ||
| 595 | |||
| 596 | struct sg_io_hdr; | ||
| 597 | |||
| 598 | int nvme_sg_io(struct nvme_ns *ns, struct sg_io_hdr __user *u_hdr); | ||
| 599 | int 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 */ |
