]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blame - drivers/scsi/lpfc/lpfc_nvme.h
scsi: lpfc: NVME Initiator: Merge into FC discovery
[mirror_ubuntu-eoan-kernel.git] / drivers / scsi / lpfc / lpfc_nvme.h
CommitLineData
895427bd
JS
1/*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. *
4 * Copyright (C) 2004-2016 Emulex. All rights reserved. *
5 * EMULEX and SLI are trademarks of Emulex. *
6 * www.emulex.com *
7 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
8 * *
9 * This program is free software; you can redistribute it and/or *
10 * modify it under the terms of version 2 of the GNU General *
11 * Public License as published by the Free Software Foundation. *
12 * This program is distributed in the hope that it will be useful. *
13 * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
14 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
15 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
16 * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
17 * TO BE LEGALLY INVALID. See the GNU General Public License for *
18 * more details, a copy of which can be found in the file COPYING *
19 * included with this package. *
20 ********************************************************************/
21
22#define LPFC_NVME_MIN_SEGS 16
23#define LPFC_NVME_DEFAULT_SEGS 66 /* 256K IOs - 64 + 2 */
24#define LPFC_NVME_MAX_SEGS 510
25#define LPFC_NVMET_MIN_POSTBUF 16
26#define LPFC_NVMET_DEFAULT_POSTBUF 1024
27#define LPFC_NVMET_MAX_POSTBUF 4096
28#define LPFC_NVME_WQSIZE 256
29
30#define LPFC_NVME_ERSP_LEN 0x20
31
32/* Declare nvme-based local and remote port definitions. */
33struct lpfc_nvme_lport {
34 struct lpfc_vport *vport;
35 struct list_head rport_list;
36 struct completion lport_unreg_done;
37 /* Add sttats counters here */
38};
39
40struct lpfc_nvme_rport {
41 struct list_head list;
42 struct lpfc_nvme_lport *lport;
43 struct nvme_fc_remote_port *remoteport;
44 struct lpfc_nodelist *ndlp;
45 struct completion rport_unreg_done;
46};
47
48struct lpfc_nvme_buf {
49 struct list_head list;
50 struct nvmefc_fcp_req *nvmeCmd;
51 struct lpfc_nvme_rport *nrport;
52
53 uint32_t timeout;
54
55 uint16_t flags; /* TBD convert exch_busy to flags */
56#define LPFC_SBUF_XBUSY 0x1 /* SLI4 hba reported XB on WCQE cmpl */
57 uint16_t exch_busy; /* SLI4 hba reported XB on complete WCQE */
58 uint16_t status; /* From IOCB Word 7- ulpStatus */
59 uint16_t cpu;
60 uint16_t qidx;
61 uint16_t sqid;
62 uint32_t result; /* From IOCB Word 4. */
63
64 uint32_t seg_cnt; /* Number of scatter-gather segments returned by
65 * dma_map_sg. The driver needs this for calls
66 * to dma_unmap_sg.
67 */
68 dma_addr_t nonsg_phys; /* Non scatter-gather physical address. */
69
70 /*
71 * data and dma_handle are the kernel virtual and bus address of the
72 * dma-able buffer containing the fcp_cmd, fcp_rsp and a scatter
73 * gather bde list that supports the sg_tablesize value.
74 */
75 void *data;
76 dma_addr_t dma_handle;
77
78 struct sli4_sge *nvme_sgl;
79 dma_addr_t dma_phys_sgl;
80
81 /* cur_iocbq has phys of the dma-able buffer.
82 * Iotag is in here
83 */
84 struct lpfc_iocbq cur_iocbq;
85
86 wait_queue_head_t *waitq;
87 unsigned long start_time;
88};