aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2013-03-04 20:40:57 -0500
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-03-27 07:05:42 -0400
commit13c3b0fcc8e33ba49f252378f6e7290b146042af (patch)
tree8f9e649baaa3d33c2788a46e1cd6f8ae43942315 /drivers/block
parent729dd1bd802acb973eec9c73ccb87d3143c13937 (diff)
NVMe: Move structures & definitions to header file
nvme-scsi.c uses several data structures and definitions that were previously private to nvme-core.c. Move the definitions to nvme.h, protected by __KERNEL__. Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nvme-core.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 26e266072079..1f98040cf677 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -46,7 +46,6 @@
46#define SQ_SIZE(depth) (depth * sizeof(struct nvme_command)) 46#define SQ_SIZE(depth) (depth * sizeof(struct nvme_command))
47#define CQ_SIZE(depth) (depth * sizeof(struct nvme_completion)) 47#define CQ_SIZE(depth) (depth * sizeof(struct nvme_completion))
48#define NVME_MINORS 64 48#define NVME_MINORS 64
49#define NVME_IO_TIMEOUT (5 * HZ)
50#define ADMIN_TIMEOUT (60 * HZ) 49#define ADMIN_TIMEOUT (60 * HZ)
51 50
52static int nvme_major; 51static int nvme_major;
@@ -60,44 +59,6 @@ static LIST_HEAD(dev_list);
60static struct task_struct *nvme_thread; 59static struct task_struct *nvme_thread;
61 60
62/* 61/*
63 * Represents an NVM Express device. Each nvme_dev is a PCI function.
64 */
65struct nvme_dev {
66 struct list_head node;
67 struct nvme_queue **queues;
68 u32 __iomem *dbs;
69 struct pci_dev *pci_dev;
70 struct dma_pool *prp_page_pool;
71 struct dma_pool *prp_small_pool;
72 int instance;
73 int queue_count;
74 int db_stride;
75 u32 ctrl_config;
76 struct msix_entry *entry;
77 struct nvme_bar __iomem *bar;
78 struct list_head namespaces;
79 char serial[20];
80 char model[40];
81 char firmware_rev[8];
82 u32 max_hw_sectors;
83 u16 oncs;
84};
85
86/*
87 * An NVM Express namespace is equivalent to a SCSI LUN
88 */
89struct nvme_ns {
90 struct list_head list;
91
92 struct nvme_dev *dev;
93 struct request_queue *queue;
94 struct gendisk *disk;
95
96 int ns_id;
97 int lba_shift;
98};
99
100/*
101 * An NVM Express queue. Each device has at least two (one for admin 62 * An NVM Express queue. Each device has at least two (one for admin
102 * commands and one for I/O commands). 63 * commands and one for I/O commands).
103 */ 64 */
@@ -295,22 +256,6 @@ static int nvme_submit_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd)
295 return 0; 256 return 0;
296} 257}
297 258
298/*
299 * The nvme_iod describes the data in an I/O, including the list of PRP
300 * entries. You can't see it in this data structure because C doesn't let
301 * me express that. Use nvme_alloc_iod to ensure there's enough space
302 * allocated to store the PRP list.
303 */
304struct nvme_iod {
305 void *private; /* For the use of the submitter of the I/O */
306 int npages; /* In the PRP list. 0 means small pool in use */
307 int offset; /* Of PRP list */
308 int nents; /* Used in scatterlist */
309 int length; /* Of data, in bytes */
310 dma_addr_t first_dma;
311 struct scatterlist sg[0];
312};
313
314static __le64 **iod_list(struct nvme_iod *iod) 259static __le64 **iod_list(struct nvme_iod *iod)
315{ 260{
316 return ((void *)iod) + iod->offset; 261 return ((void *)iod) + iod->offset;