xref: /linux/drivers/scsi/lpfc/lpfc_hw4.h (revision c31098cef5e091e22a02ff255f911e0ad71cc393) !
1da0436e9SJames Smart /*******************************************************************
2da0436e9SJames Smart  * This file is part of the Emulex Linux Device Driver for         *
3da0436e9SJames Smart  * Fibre Channel Host Bus Adapters.                                *
4da0436e9SJames Smart  * Copyright (C) 2009 Emulex.  All rights reserved.                *
5da0436e9SJames Smart  * EMULEX and SLI are trademarks of Emulex.                        *
6da0436e9SJames Smart  * www.emulex.com                                                  *
7da0436e9SJames Smart  *                                                                 *
8da0436e9SJames Smart  * This program is free software; you can redistribute it and/or   *
9da0436e9SJames Smart  * modify it under the terms of version 2 of the GNU General       *
10da0436e9SJames Smart  * Public License as published by the Free Software Foundation.    *
11da0436e9SJames Smart  * This program is distributed in the hope that it will be useful. *
12da0436e9SJames Smart  * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND          *
13da0436e9SJames Smart  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  *
14da0436e9SJames Smart  * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE      *
15da0436e9SJames Smart  * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
16da0436e9SJames Smart  * TO BE LEGALLY INVALID.  See the GNU General Public License for  *
17da0436e9SJames Smart  * more details, a copy of which can be found in the file COPYING  *
18da0436e9SJames Smart  * included with this package.                                     *
19da0436e9SJames Smart  *******************************************************************/
20da0436e9SJames Smart 
21da0436e9SJames Smart /* Macros to deal with bit fields. Each bit field must have 3 #defines
22da0436e9SJames Smart  * associated with it (_SHIFT, _MASK, and _WORD).
23da0436e9SJames Smart  * EG. For a bit field that is in the 7th bit of the "field4" field of a
24da0436e9SJames Smart  * structure and is 2 bits in size the following #defines must exist:
25da0436e9SJames Smart  *	struct temp {
26da0436e9SJames Smart  *		uint32_t	field1;
27da0436e9SJames Smart  *		uint32_t	field2;
28da0436e9SJames Smart  *		uint32_t	field3;
29da0436e9SJames Smart  *		uint32_t	field4;
30da0436e9SJames Smart  *	#define example_bit_field_SHIFT		7
31da0436e9SJames Smart  *	#define example_bit_field_MASK		0x03
32da0436e9SJames Smart  *	#define example_bit_field_WORD		field4
33da0436e9SJames Smart  *		uint32_t	field5;
34da0436e9SJames Smart  *	};
35da0436e9SJames Smart  * Then the macros below may be used to get or set the value of that field.
36da0436e9SJames Smart  * EG. To get the value of the bit field from the above example:
37da0436e9SJames Smart  *	struct temp t1;
38da0436e9SJames Smart  *	value = bf_get(example_bit_field, &t1);
39da0436e9SJames Smart  * And then to set that bit field:
40da0436e9SJames Smart  *	bf_set(example_bit_field, &t1, 2);
41da0436e9SJames Smart  * Or clear that bit field:
42da0436e9SJames Smart  *	bf_set(example_bit_field, &t1, 0);
43da0436e9SJames Smart  */
44cb5172eaSJames Smart #define bf_get_le32(name, ptr) \
45cb5172eaSJames Smart 	((le32_to_cpu((ptr)->name##_WORD) >> name##_SHIFT) & name##_MASK)
46da0436e9SJames Smart #define bf_get(name, ptr) \
47da0436e9SJames Smart 	(((ptr)->name##_WORD >> name##_SHIFT) & name##_MASK)
48cb5172eaSJames Smart #define bf_set_le32(name, ptr, value) \
49cb5172eaSJames Smart 	((ptr)->name##_WORD = cpu_to_le32(((((value) & \
50cb5172eaSJames Smart 	name##_MASK) << name##_SHIFT) | (le32_to_cpu((ptr)->name##_WORD) & \
51cb5172eaSJames Smart 	~(name##_MASK << name##_SHIFT)))))
52da0436e9SJames Smart #define bf_set(name, ptr, value) \
53da0436e9SJames Smart 	((ptr)->name##_WORD = ((((value) & name##_MASK) << name##_SHIFT) | \
54da0436e9SJames Smart 		 ((ptr)->name##_WORD & ~(name##_MASK << name##_SHIFT))))
55da0436e9SJames Smart 
56da0436e9SJames Smart struct dma_address {
57da0436e9SJames Smart 	uint32_t addr_lo;
58da0436e9SJames Smart 	uint32_t addr_hi;
59da0436e9SJames Smart };
60da0436e9SJames Smart 
618fa38513SJames Smart struct lpfc_sli_intf {
628fa38513SJames Smart 	uint32_t word0;
638fa38513SJames Smart #define lpfc_sli_intf_valid_SHIFT		29
6428baac74SJames Smart #define lpfc_sli_intf_valid_MASK		0x00000007
658fa38513SJames Smart #define lpfc_sli_intf_valid_WORD		word0
668fa38513SJames Smart #define LPFC_SLI_INTF_VALID		6
67085c647cSJames Smart #define lpfc_sli_intf_sli_hint2_SHIFT		24
68085c647cSJames Smart #define lpfc_sli_intf_sli_hint2_MASK		0x0000001F
69085c647cSJames Smart #define lpfc_sli_intf_sli_hint2_WORD		word0
70085c647cSJames Smart #define LPFC_SLI_INTF_SLI_HINT2_NONE	0
71085c647cSJames Smart #define lpfc_sli_intf_sli_hint1_SHIFT		16
72085c647cSJames Smart #define lpfc_sli_intf_sli_hint1_MASK		0x000000FF
73085c647cSJames Smart #define lpfc_sli_intf_sli_hint1_WORD		word0
74085c647cSJames Smart #define LPFC_SLI_INTF_SLI_HINT1_NONE	0
75085c647cSJames Smart #define LPFC_SLI_INTF_SLI_HINT1_1	1
76085c647cSJames Smart #define LPFC_SLI_INTF_SLI_HINT1_2	2
77085c647cSJames Smart #define lpfc_sli_intf_if_type_SHIFT		12
78085c647cSJames Smart #define lpfc_sli_intf_if_type_MASK		0x0000000F
79085c647cSJames Smart #define lpfc_sli_intf_if_type_WORD		word0
80085c647cSJames Smart #define LPFC_SLI_INTF_IF_TYPE_0		0
81085c647cSJames Smart #define LPFC_SLI_INTF_IF_TYPE_1		1
82085c647cSJames Smart #define LPFC_SLI_INTF_IF_TYPE_2		2
8328baac74SJames Smart #define lpfc_sli_intf_sli_family_SHIFT		8
84085c647cSJames Smart #define lpfc_sli_intf_sli_family_MASK		0x0000000F
8528baac74SJames Smart #define lpfc_sli_intf_sli_family_WORD		word0
86085c647cSJames Smart #define LPFC_SLI_INTF_FAMILY_BE2	0x0
87085c647cSJames Smart #define LPFC_SLI_INTF_FAMILY_BE3	0x1
88085c647cSJames Smart #define LPFC_SLI_INTF_FAMILY_LNCR_A0	0xa
89085c647cSJames Smart #define LPFC_SLI_INTF_FAMILY_LNCR_B0	0xb
9028baac74SJames Smart #define lpfc_sli_intf_slirev_SHIFT		4
9128baac74SJames Smart #define lpfc_sli_intf_slirev_MASK		0x0000000F
9228baac74SJames Smart #define lpfc_sli_intf_slirev_WORD		word0
9328baac74SJames Smart #define LPFC_SLI_INTF_REV_SLI3		3
9428baac74SJames Smart #define LPFC_SLI_INTF_REV_SLI4		4
95085c647cSJames Smart #define lpfc_sli_intf_func_type_SHIFT		0
96085c647cSJames Smart #define lpfc_sli_intf_func_type_MASK		0x00000001
97085c647cSJames Smart #define lpfc_sli_intf_func_type_WORD		word0
98085c647cSJames Smart #define LPFC_SLI_INTF_IF_TYPE_PHYS	0
99085c647cSJames Smart #define LPFC_SLI_INTF_IF_TYPE_VIRT	1
1008fa38513SJames Smart };
1018fa38513SJames Smart 
102da0436e9SJames Smart #define LPFC_SLI4_MBX_EMBED	true
103da0436e9SJames Smart #define LPFC_SLI4_MBX_NEMBED	false
104da0436e9SJames Smart 
105da0436e9SJames Smart #define LPFC_SLI4_MB_WORD_COUNT		64
106da0436e9SJames Smart #define LPFC_MAX_MQ_PAGE		8
107da0436e9SJames Smart #define LPFC_MAX_WQ_PAGE		8
108da0436e9SJames Smart #define LPFC_MAX_CQ_PAGE		4
109da0436e9SJames Smart #define LPFC_MAX_EQ_PAGE		8
110da0436e9SJames Smart 
111da0436e9SJames Smart #define LPFC_VIR_FUNC_MAX       32 /* Maximum number of virtual functions */
112da0436e9SJames Smart #define LPFC_PCI_FUNC_MAX        5 /* Maximum number of PCI functions */
113da0436e9SJames Smart #define LPFC_VFR_PAGE_SIZE	0x1000 /* 4KB BAR2 per-VF register page size */
114da0436e9SJames Smart 
115da0436e9SJames Smart /* Define SLI4 Alignment requirements. */
116da0436e9SJames Smart #define LPFC_ALIGN_16_BYTE	16
117da0436e9SJames Smart #define LPFC_ALIGN_64_BYTE	64
118da0436e9SJames Smart 
119da0436e9SJames Smart /* Define SLI4 specific definitions. */
120da0436e9SJames Smart #define LPFC_MQ_CQE_BYTE_OFFSET	256
121da0436e9SJames Smart #define LPFC_MBX_CMD_HDR_LENGTH 16
122da0436e9SJames Smart #define LPFC_MBX_ERROR_RANGE	0x4000
123da0436e9SJames Smart #define LPFC_BMBX_BIT1_ADDR_HI	0x2
124da0436e9SJames Smart #define LPFC_BMBX_BIT1_ADDR_LO	0
125da0436e9SJames Smart #define LPFC_RPI_HDR_COUNT	64
126da0436e9SJames Smart #define LPFC_HDR_TEMPLATE_SIZE	4096
127da0436e9SJames Smart #define LPFC_RPI_ALLOC_ERROR 	0xFFFF
128da0436e9SJames Smart #define LPFC_FCF_RECORD_WD_CNT	132
129da0436e9SJames Smart #define LPFC_ENTIRE_FCF_DATABASE 0
130da0436e9SJames Smart #define LPFC_DFLT_FCF_INDEX	 0
131da0436e9SJames Smart 
132da0436e9SJames Smart /* Virtual function numbers */
133da0436e9SJames Smart #define LPFC_VF0		0
134da0436e9SJames Smart #define LPFC_VF1		1
135da0436e9SJames Smart #define LPFC_VF2		2
136da0436e9SJames Smart #define LPFC_VF3		3
137da0436e9SJames Smart #define LPFC_VF4		4
138da0436e9SJames Smart #define LPFC_VF5		5
139da0436e9SJames Smart #define LPFC_VF6		6
140da0436e9SJames Smart #define LPFC_VF7		7
141da0436e9SJames Smart #define LPFC_VF8		8
142da0436e9SJames Smart #define LPFC_VF9		9
143da0436e9SJames Smart #define LPFC_VF10		10
144da0436e9SJames Smart #define LPFC_VF11		11
145da0436e9SJames Smart #define LPFC_VF12		12
146da0436e9SJames Smart #define LPFC_VF13		13
147da0436e9SJames Smart #define LPFC_VF14		14
148da0436e9SJames Smart #define LPFC_VF15		15
149da0436e9SJames Smart #define LPFC_VF16		16
150da0436e9SJames Smart #define LPFC_VF17		17
151da0436e9SJames Smart #define LPFC_VF18		18
152da0436e9SJames Smart #define LPFC_VF19		19
153da0436e9SJames Smart #define LPFC_VF20		20
154da0436e9SJames Smart #define LPFC_VF21		21
155da0436e9SJames Smart #define LPFC_VF22		22
156da0436e9SJames Smart #define LPFC_VF23		23
157da0436e9SJames Smart #define LPFC_VF24		24
158da0436e9SJames Smart #define LPFC_VF25		25
159da0436e9SJames Smart #define LPFC_VF26		26
160da0436e9SJames Smart #define LPFC_VF27		27
161da0436e9SJames Smart #define LPFC_VF28		28
162da0436e9SJames Smart #define LPFC_VF29		29
163da0436e9SJames Smart #define LPFC_VF30		30
164da0436e9SJames Smart #define LPFC_VF31		31
165da0436e9SJames Smart 
166da0436e9SJames Smart /* PCI function numbers */
167da0436e9SJames Smart #define LPFC_PCI_FUNC0		0
168da0436e9SJames Smart #define LPFC_PCI_FUNC1		1
169da0436e9SJames Smart #define LPFC_PCI_FUNC2		2
170da0436e9SJames Smart #define LPFC_PCI_FUNC3		3
171da0436e9SJames Smart #define LPFC_PCI_FUNC4		4
172da0436e9SJames Smart 
173da0436e9SJames Smart /* Active interrupt test count */
174da0436e9SJames Smart #define LPFC_ACT_INTR_CNT	4
175da0436e9SJames Smart 
176da0436e9SJames Smart /* Delay Multiplier constant */
177da0436e9SJames Smart #define LPFC_DMULT_CONST       651042
178da0436e9SJames Smart #define LPFC_MIM_IMAX          636
179da0436e9SJames Smart #define LPFC_FP_DEF_IMAX       10000
180da0436e9SJames Smart #define LPFC_SP_DEF_IMAX       10000
181da0436e9SJames Smart 
18228baac74SJames Smart /* PORT_CAPABILITIES constants. */
18328baac74SJames Smart #define LPFC_MAX_SUPPORTED_PAGES	8
18428baac74SJames Smart 
185da0436e9SJames Smart struct ulp_bde64 {
186da0436e9SJames Smart 	union ULP_BDE_TUS {
187da0436e9SJames Smart 		uint32_t w;
188da0436e9SJames Smart 		struct {
189da0436e9SJames Smart #ifdef __BIG_ENDIAN_BITFIELD
190da0436e9SJames Smart 			uint32_t bdeFlags:8;	/* BDE Flags 0 IS A SUPPORTED
191da0436e9SJames Smart 						   VALUE !! */
192da0436e9SJames Smart 			uint32_t bdeSize:24;	/* Size of buffer (in bytes) */
193da0436e9SJames Smart #else	/*  __LITTLE_ENDIAN_BITFIELD */
194da0436e9SJames Smart 			uint32_t bdeSize:24;	/* Size of buffer (in bytes) */
195da0436e9SJames Smart 			uint32_t bdeFlags:8;	/* BDE Flags 0 IS A SUPPORTED
196da0436e9SJames Smart 						   VALUE !! */
197da0436e9SJames Smart #endif
198da0436e9SJames Smart #define BUFF_TYPE_BDE_64    0x00	/* BDE (Host_resident) */
199da0436e9SJames Smart #define BUFF_TYPE_BDE_IMMED 0x01	/* Immediate Data BDE */
200da0436e9SJames Smart #define BUFF_TYPE_BDE_64P   0x02	/* BDE (Port-resident) */
201da0436e9SJames Smart #define BUFF_TYPE_BDE_64I   0x08	/* Input BDE (Host-resident) */
202da0436e9SJames Smart #define BUFF_TYPE_BDE_64IP  0x0A	/* Input BDE (Port-resident) */
203da0436e9SJames Smart #define BUFF_TYPE_BLP_64    0x40	/* BLP (Host-resident) */
204da0436e9SJames Smart #define BUFF_TYPE_BLP_64P   0x42	/* BLP (Port-resident) */
205da0436e9SJames Smart 		} f;
206da0436e9SJames Smart 	} tus;
207da0436e9SJames Smart 	uint32_t addrLow;
208da0436e9SJames Smart 	uint32_t addrHigh;
209da0436e9SJames Smart };
210da0436e9SJames Smart 
211da0436e9SJames Smart struct lpfc_sli4_flags {
212da0436e9SJames Smart 	uint32_t word0;
213da0436e9SJames Smart #define lpfc_fip_flag_SHIFT 0
214da0436e9SJames Smart #define lpfc_fip_flag_MASK 0x00000001
215da0436e9SJames Smart #define lpfc_fip_flag_WORD word0
216da0436e9SJames Smart };
217da0436e9SJames Smart 
218546fc854SJames Smart struct sli4_bls_rsp {
2195ffc266eSJames Smart 	uint32_t word0_rsvd;      /* Word0 must be reserved */
2205ffc266eSJames Smart 	uint32_t word1;
2215ffc266eSJames Smart #define lpfc_abts_orig_SHIFT      0
2225ffc266eSJames Smart #define lpfc_abts_orig_MASK       0x00000001
2235ffc266eSJames Smart #define lpfc_abts_orig_WORD       word1
2245ffc266eSJames Smart #define LPFC_ABTS_UNSOL_RSP       1
2255ffc266eSJames Smart #define LPFC_ABTS_UNSOL_INT       0
2265ffc266eSJames Smart 	uint32_t word2;
2275ffc266eSJames Smart #define lpfc_abts_rxid_SHIFT      0
2285ffc266eSJames Smart #define lpfc_abts_rxid_MASK       0x0000FFFF
2295ffc266eSJames Smart #define lpfc_abts_rxid_WORD       word2
2305ffc266eSJames Smart #define lpfc_abts_oxid_SHIFT      16
2315ffc266eSJames Smart #define lpfc_abts_oxid_MASK       0x0000FFFF
2325ffc266eSJames Smart #define lpfc_abts_oxid_WORD       word2
2335ffc266eSJames Smart 	uint32_t word3;
234546fc854SJames Smart #define lpfc_vndr_code_SHIFT	0
235546fc854SJames Smart #define lpfc_vndr_code_MASK	0x000000FF
236546fc854SJames Smart #define lpfc_vndr_code_WORD	word3
237546fc854SJames Smart #define lpfc_rsn_expln_SHIFT	8
238546fc854SJames Smart #define lpfc_rsn_expln_MASK	0x000000FF
239546fc854SJames Smart #define lpfc_rsn_expln_WORD	word3
240546fc854SJames Smart #define lpfc_rsn_code_SHIFT	16
241546fc854SJames Smart #define lpfc_rsn_code_MASK	0x000000FF
242546fc854SJames Smart #define lpfc_rsn_code_WORD	word3
243546fc854SJames Smart 
2445ffc266eSJames Smart 	uint32_t word4;
2455ffc266eSJames Smart 	uint32_t word5_rsvd;	/* Word5 must be reserved */
2465ffc266eSJames Smart };
2475ffc266eSJames Smart 
248da0436e9SJames Smart /* event queue entry structure */
249da0436e9SJames Smart struct lpfc_eqe {
250da0436e9SJames Smart 	uint32_t word0;
251da0436e9SJames Smart #define lpfc_eqe_resource_id_SHIFT	16
252da0436e9SJames Smart #define lpfc_eqe_resource_id_MASK	0x000000FF
253da0436e9SJames Smart #define lpfc_eqe_resource_id_WORD	word0
254da0436e9SJames Smart #define lpfc_eqe_minor_code_SHIFT	4
255da0436e9SJames Smart #define lpfc_eqe_minor_code_MASK	0x00000FFF
256da0436e9SJames Smart #define lpfc_eqe_minor_code_WORD	word0
257da0436e9SJames Smart #define lpfc_eqe_major_code_SHIFT	1
258da0436e9SJames Smart #define lpfc_eqe_major_code_MASK	0x00000007
259da0436e9SJames Smart #define lpfc_eqe_major_code_WORD	word0
260da0436e9SJames Smart #define lpfc_eqe_valid_SHIFT		0
261da0436e9SJames Smart #define lpfc_eqe_valid_MASK		0x00000001
262da0436e9SJames Smart #define lpfc_eqe_valid_WORD		word0
263da0436e9SJames Smart };
264da0436e9SJames Smart 
265da0436e9SJames Smart /* completion queue entry structure (common fields for all cqe types) */
266da0436e9SJames Smart struct lpfc_cqe {
267da0436e9SJames Smart 	uint32_t reserved0;
268da0436e9SJames Smart 	uint32_t reserved1;
269da0436e9SJames Smart 	uint32_t reserved2;
270da0436e9SJames Smart 	uint32_t word3;
271da0436e9SJames Smart #define lpfc_cqe_valid_SHIFT		31
272da0436e9SJames Smart #define lpfc_cqe_valid_MASK		0x00000001
273da0436e9SJames Smart #define lpfc_cqe_valid_WORD		word3
274da0436e9SJames Smart #define lpfc_cqe_code_SHIFT		16
275da0436e9SJames Smart #define lpfc_cqe_code_MASK		0x000000FF
276da0436e9SJames Smart #define lpfc_cqe_code_WORD		word3
277da0436e9SJames Smart };
278da0436e9SJames Smart 
279da0436e9SJames Smart /* Completion Queue Entry Status Codes */
280da0436e9SJames Smart #define CQE_STATUS_SUCCESS		0x0
281da0436e9SJames Smart #define CQE_STATUS_FCP_RSP_FAILURE	0x1
282da0436e9SJames Smart #define CQE_STATUS_REMOTE_STOP		0x2
283da0436e9SJames Smart #define CQE_STATUS_LOCAL_REJECT		0x3
284da0436e9SJames Smart #define CQE_STATUS_NPORT_RJT		0x4
285da0436e9SJames Smart #define CQE_STATUS_FABRIC_RJT		0x5
286da0436e9SJames Smart #define CQE_STATUS_NPORT_BSY		0x6
287da0436e9SJames Smart #define CQE_STATUS_FABRIC_BSY		0x7
288da0436e9SJames Smart #define CQE_STATUS_INTERMED_RSP		0x8
289da0436e9SJames Smart #define CQE_STATUS_LS_RJT		0x9
290da0436e9SJames Smart #define CQE_STATUS_CMD_REJECT		0xb
291da0436e9SJames Smart #define CQE_STATUS_FCP_TGT_LENCHECK	0xc
292da0436e9SJames Smart #define CQE_STATUS_NEED_BUFF_ENTRY	0xf
293da0436e9SJames Smart 
294da0436e9SJames Smart /* Status returned by hardware (valid only if status = CQE_STATUS_SUCCESS). */
295da0436e9SJames Smart #define CQE_HW_STATUS_NO_ERR		0x0
296da0436e9SJames Smart #define CQE_HW_STATUS_UNDERRUN		0x1
297da0436e9SJames Smart #define CQE_HW_STATUS_OVERRUN		0x2
298da0436e9SJames Smart 
299da0436e9SJames Smart /* Completion Queue Entry Codes */
300da0436e9SJames Smart #define CQE_CODE_COMPL_WQE		0x1
301da0436e9SJames Smart #define CQE_CODE_RELEASE_WQE		0x2
302da0436e9SJames Smart #define CQE_CODE_RECEIVE		0x4
303da0436e9SJames Smart #define CQE_CODE_XRI_ABORTED		0x5
304da0436e9SJames Smart 
305da0436e9SJames Smart /* completion queue entry for wqe completions */
306da0436e9SJames Smart struct lpfc_wcqe_complete {
307da0436e9SJames Smart 	uint32_t word0;
308da0436e9SJames Smart #define lpfc_wcqe_c_request_tag_SHIFT	16
309da0436e9SJames Smart #define lpfc_wcqe_c_request_tag_MASK	0x0000FFFF
310da0436e9SJames Smart #define lpfc_wcqe_c_request_tag_WORD	word0
311da0436e9SJames Smart #define lpfc_wcqe_c_status_SHIFT	8
312da0436e9SJames Smart #define lpfc_wcqe_c_status_MASK		0x000000FF
313da0436e9SJames Smart #define lpfc_wcqe_c_status_WORD		word0
314da0436e9SJames Smart #define lpfc_wcqe_c_hw_status_SHIFT	0
315da0436e9SJames Smart #define lpfc_wcqe_c_hw_status_MASK	0x000000FF
316da0436e9SJames Smart #define lpfc_wcqe_c_hw_status_WORD	word0
317da0436e9SJames Smart 	uint32_t total_data_placed;
318da0436e9SJames Smart 	uint32_t parameter;
319da0436e9SJames Smart 	uint32_t word3;
320da0436e9SJames Smart #define lpfc_wcqe_c_valid_SHIFT		lpfc_cqe_valid_SHIFT
321da0436e9SJames Smart #define lpfc_wcqe_c_valid_MASK		lpfc_cqe_valid_MASK
322da0436e9SJames Smart #define lpfc_wcqe_c_valid_WORD		lpfc_cqe_valid_WORD
323da0436e9SJames Smart #define lpfc_wcqe_c_xb_SHIFT		28
324da0436e9SJames Smart #define lpfc_wcqe_c_xb_MASK		0x00000001
325da0436e9SJames Smart #define lpfc_wcqe_c_xb_WORD		word3
326da0436e9SJames Smart #define lpfc_wcqe_c_pv_SHIFT		27
327da0436e9SJames Smart #define lpfc_wcqe_c_pv_MASK		0x00000001
328da0436e9SJames Smart #define lpfc_wcqe_c_pv_WORD		word3
329da0436e9SJames Smart #define lpfc_wcqe_c_priority_SHIFT	24
330da0436e9SJames Smart #define lpfc_wcqe_c_priority_MASK		0x00000007
331da0436e9SJames Smart #define lpfc_wcqe_c_priority_WORD		word3
332da0436e9SJames Smart #define lpfc_wcqe_c_code_SHIFT		lpfc_cqe_code_SHIFT
333da0436e9SJames Smart #define lpfc_wcqe_c_code_MASK		lpfc_cqe_code_MASK
334da0436e9SJames Smart #define lpfc_wcqe_c_code_WORD		lpfc_cqe_code_WORD
335da0436e9SJames Smart };
336da0436e9SJames Smart 
337da0436e9SJames Smart /* completion queue entry for wqe release */
338da0436e9SJames Smart struct lpfc_wcqe_release {
339da0436e9SJames Smart 	uint32_t reserved0;
340da0436e9SJames Smart 	uint32_t reserved1;
341da0436e9SJames Smart 	uint32_t word2;
342da0436e9SJames Smart #define lpfc_wcqe_r_wq_id_SHIFT		16
343da0436e9SJames Smart #define lpfc_wcqe_r_wq_id_MASK		0x0000FFFF
344da0436e9SJames Smart #define lpfc_wcqe_r_wq_id_WORD		word2
345da0436e9SJames Smart #define lpfc_wcqe_r_wqe_index_SHIFT	0
346da0436e9SJames Smart #define lpfc_wcqe_r_wqe_index_MASK	0x0000FFFF
347da0436e9SJames Smart #define lpfc_wcqe_r_wqe_index_WORD	word2
348da0436e9SJames Smart 	uint32_t word3;
349da0436e9SJames Smart #define lpfc_wcqe_r_valid_SHIFT		lpfc_cqe_valid_SHIFT
350da0436e9SJames Smart #define lpfc_wcqe_r_valid_MASK		lpfc_cqe_valid_MASK
351da0436e9SJames Smart #define lpfc_wcqe_r_valid_WORD		lpfc_cqe_valid_WORD
352da0436e9SJames Smart #define lpfc_wcqe_r_code_SHIFT		lpfc_cqe_code_SHIFT
353da0436e9SJames Smart #define lpfc_wcqe_r_code_MASK		lpfc_cqe_code_MASK
354da0436e9SJames Smart #define lpfc_wcqe_r_code_WORD		lpfc_cqe_code_WORD
355da0436e9SJames Smart };
356da0436e9SJames Smart 
357da0436e9SJames Smart struct sli4_wcqe_xri_aborted {
358da0436e9SJames Smart 	uint32_t word0;
359da0436e9SJames Smart #define lpfc_wcqe_xa_status_SHIFT		8
360da0436e9SJames Smart #define lpfc_wcqe_xa_status_MASK		0x000000FF
361da0436e9SJames Smart #define lpfc_wcqe_xa_status_WORD		word0
362da0436e9SJames Smart 	uint32_t parameter;
363da0436e9SJames Smart 	uint32_t word2;
364da0436e9SJames Smart #define lpfc_wcqe_xa_remote_xid_SHIFT	16
365da0436e9SJames Smart #define lpfc_wcqe_xa_remote_xid_MASK	0x0000FFFF
366da0436e9SJames Smart #define lpfc_wcqe_xa_remote_xid_WORD	word2
367da0436e9SJames Smart #define lpfc_wcqe_xa_xri_SHIFT		0
368da0436e9SJames Smart #define lpfc_wcqe_xa_xri_MASK		0x0000FFFF
369da0436e9SJames Smart #define lpfc_wcqe_xa_xri_WORD		word2
370da0436e9SJames Smart 	uint32_t word3;
371da0436e9SJames Smart #define lpfc_wcqe_xa_valid_SHIFT	lpfc_cqe_valid_SHIFT
372da0436e9SJames Smart #define lpfc_wcqe_xa_valid_MASK		lpfc_cqe_valid_MASK
373da0436e9SJames Smart #define lpfc_wcqe_xa_valid_WORD		lpfc_cqe_valid_WORD
374da0436e9SJames Smart #define lpfc_wcqe_xa_ia_SHIFT		30
375da0436e9SJames Smart #define lpfc_wcqe_xa_ia_MASK		0x00000001
376da0436e9SJames Smart #define lpfc_wcqe_xa_ia_WORD		word3
377da0436e9SJames Smart #define CQE_XRI_ABORTED_IA_REMOTE	0
378da0436e9SJames Smart #define CQE_XRI_ABORTED_IA_LOCAL	1
379da0436e9SJames Smart #define lpfc_wcqe_xa_br_SHIFT		29
380da0436e9SJames Smart #define lpfc_wcqe_xa_br_MASK		0x00000001
381da0436e9SJames Smart #define lpfc_wcqe_xa_br_WORD		word3
382da0436e9SJames Smart #define CQE_XRI_ABORTED_BR_BA_ACC	0
383da0436e9SJames Smart #define CQE_XRI_ABORTED_BR_BA_RJT	1
384da0436e9SJames Smart #define lpfc_wcqe_xa_eo_SHIFT		28
385da0436e9SJames Smart #define lpfc_wcqe_xa_eo_MASK		0x00000001
386da0436e9SJames Smart #define lpfc_wcqe_xa_eo_WORD		word3
387da0436e9SJames Smart #define CQE_XRI_ABORTED_EO_REMOTE	0
388da0436e9SJames Smart #define CQE_XRI_ABORTED_EO_LOCAL	1
389da0436e9SJames Smart #define lpfc_wcqe_xa_code_SHIFT		lpfc_cqe_code_SHIFT
390da0436e9SJames Smart #define lpfc_wcqe_xa_code_MASK		lpfc_cqe_code_MASK
391da0436e9SJames Smart #define lpfc_wcqe_xa_code_WORD		lpfc_cqe_code_WORD
392da0436e9SJames Smart };
393da0436e9SJames Smart 
394da0436e9SJames Smart /* completion queue entry structure for rqe completion */
395da0436e9SJames Smart struct lpfc_rcqe {
396da0436e9SJames Smart 	uint32_t word0;
397da0436e9SJames Smart #define lpfc_rcqe_bindex_SHIFT		16
398da0436e9SJames Smart #define lpfc_rcqe_bindex_MASK		0x0000FFF
399da0436e9SJames Smart #define lpfc_rcqe_bindex_WORD		word0
400da0436e9SJames Smart #define lpfc_rcqe_status_SHIFT		8
401da0436e9SJames Smart #define lpfc_rcqe_status_MASK		0x000000FF
402da0436e9SJames Smart #define lpfc_rcqe_status_WORD		word0
403da0436e9SJames Smart #define FC_STATUS_RQ_SUCCESS		0x10 /* Async receive successful */
404da0436e9SJames Smart #define FC_STATUS_RQ_BUF_LEN_EXCEEDED 	0x11 /* payload truncated */
405da0436e9SJames Smart #define FC_STATUS_INSUFF_BUF_NEED_BUF 	0x12 /* Insufficient buffers */
406da0436e9SJames Smart #define FC_STATUS_INSUFF_BUF_FRM_DISC 	0x13 /* Frame Discard */
407da0436e9SJames Smart 	uint32_t reserved1;
408da0436e9SJames Smart 	uint32_t word2;
409da0436e9SJames Smart #define lpfc_rcqe_length_SHIFT		16
410da0436e9SJames Smart #define lpfc_rcqe_length_MASK		0x0000FFFF
411da0436e9SJames Smart #define lpfc_rcqe_length_WORD		word2
412da0436e9SJames Smart #define lpfc_rcqe_rq_id_SHIFT		6
413da0436e9SJames Smart #define lpfc_rcqe_rq_id_MASK		0x000003FF
414da0436e9SJames Smart #define lpfc_rcqe_rq_id_WORD		word2
415da0436e9SJames Smart #define lpfc_rcqe_fcf_id_SHIFT		0
416da0436e9SJames Smart #define lpfc_rcqe_fcf_id_MASK		0x0000003F
417da0436e9SJames Smart #define lpfc_rcqe_fcf_id_WORD		word2
418da0436e9SJames Smart 	uint32_t word3;
419da0436e9SJames Smart #define lpfc_rcqe_valid_SHIFT		lpfc_cqe_valid_SHIFT
420da0436e9SJames Smart #define lpfc_rcqe_valid_MASK		lpfc_cqe_valid_MASK
421da0436e9SJames Smart #define lpfc_rcqe_valid_WORD		lpfc_cqe_valid_WORD
422da0436e9SJames Smart #define lpfc_rcqe_port_SHIFT		30
423da0436e9SJames Smart #define lpfc_rcqe_port_MASK		0x00000001
424da0436e9SJames Smart #define lpfc_rcqe_port_WORD		word3
425da0436e9SJames Smart #define lpfc_rcqe_hdr_length_SHIFT	24
426da0436e9SJames Smart #define lpfc_rcqe_hdr_length_MASK	0x0000001F
427da0436e9SJames Smart #define lpfc_rcqe_hdr_length_WORD	word3
428da0436e9SJames Smart #define lpfc_rcqe_code_SHIFT		lpfc_cqe_code_SHIFT
429da0436e9SJames Smart #define lpfc_rcqe_code_MASK		lpfc_cqe_code_MASK
430da0436e9SJames Smart #define lpfc_rcqe_code_WORD		lpfc_cqe_code_WORD
431da0436e9SJames Smart #define lpfc_rcqe_eof_SHIFT		8
432da0436e9SJames Smart #define lpfc_rcqe_eof_MASK		0x000000FF
433da0436e9SJames Smart #define lpfc_rcqe_eof_WORD		word3
434da0436e9SJames Smart #define FCOE_EOFn	0x41
435da0436e9SJames Smart #define FCOE_EOFt	0x42
436da0436e9SJames Smart #define FCOE_EOFni	0x49
437da0436e9SJames Smart #define FCOE_EOFa	0x50
438da0436e9SJames Smart #define lpfc_rcqe_sof_SHIFT		0
439da0436e9SJames Smart #define lpfc_rcqe_sof_MASK		0x000000FF
440da0436e9SJames Smart #define lpfc_rcqe_sof_WORD		word3
441da0436e9SJames Smart #define FCOE_SOFi2	0x2d
442da0436e9SJames Smart #define FCOE_SOFi3	0x2e
443da0436e9SJames Smart #define FCOE_SOFn2	0x35
444da0436e9SJames Smart #define FCOE_SOFn3	0x36
445da0436e9SJames Smart };
446da0436e9SJames Smart 
447da0436e9SJames Smart struct lpfc_rqe {
448da0436e9SJames Smart 	uint32_t address_hi;
449da0436e9SJames Smart 	uint32_t address_lo;
450da0436e9SJames Smart };
451da0436e9SJames Smart 
452da0436e9SJames Smart /* buffer descriptors */
453da0436e9SJames Smart struct lpfc_bde4 {
454da0436e9SJames Smart 	uint32_t addr_hi;
455da0436e9SJames Smart 	uint32_t addr_lo;
456da0436e9SJames Smart 	uint32_t word2;
457da0436e9SJames Smart #define lpfc_bde4_last_SHIFT		31
458da0436e9SJames Smart #define lpfc_bde4_last_MASK		0x00000001
459da0436e9SJames Smart #define lpfc_bde4_last_WORD		word2
460da0436e9SJames Smart #define lpfc_bde4_sge_offset_SHIFT	0
461da0436e9SJames Smart #define lpfc_bde4_sge_offset_MASK	0x000003FF
462da0436e9SJames Smart #define lpfc_bde4_sge_offset_WORD	word2
463da0436e9SJames Smart 	uint32_t word3;
464da0436e9SJames Smart #define lpfc_bde4_length_SHIFT		0
465da0436e9SJames Smart #define lpfc_bde4_length_MASK		0x000000FF
466da0436e9SJames Smart #define lpfc_bde4_length_WORD		word3
467da0436e9SJames Smart };
468da0436e9SJames Smart 
469da0436e9SJames Smart struct lpfc_register {
470da0436e9SJames Smart 	uint32_t word0;
471da0436e9SJames Smart };
472da0436e9SJames Smart 
473085c647cSJames Smart /* The following BAR0 Registers apply to SLI4 if_type 0 UCNAs. */
474da0436e9SJames Smart #define LPFC_UERR_STATUS_HI		0x00A4
475da0436e9SJames Smart #define LPFC_UERR_STATUS_LO		0x00A0
476a747c9ceSJames Smart #define LPFC_UE_MASK_HI			0x00AC
477a747c9ceSJames Smart #define LPFC_UE_MASK_LO			0x00A8
478da0436e9SJames Smart 
4792fcee4bfSJames Smart /* The following BAR0 register sets are defined for if_type 0 and 2 UCNAs. */
4802fcee4bfSJames Smart #define LPFC_SLI_INTF			0x0058
481da0436e9SJames Smart 
4822fcee4bfSJames Smart #define LPFC_SLIPORT_IF2_SMPHR		0x0400
4832fcee4bfSJames Smart #define lpfc_port_smphr_perr_SHIFT	31
4842fcee4bfSJames Smart #define lpfc_port_smphr_perr_MASK	0x1
4852fcee4bfSJames Smart #define lpfc_port_smphr_perr_WORD	word0
4862fcee4bfSJames Smart #define lpfc_port_smphr_sfi_SHIFT	30
4872fcee4bfSJames Smart #define lpfc_port_smphr_sfi_MASK	0x1
4882fcee4bfSJames Smart #define lpfc_port_smphr_sfi_WORD	word0
4892fcee4bfSJames Smart #define lpfc_port_smphr_nip_SHIFT	29
4902fcee4bfSJames Smart #define lpfc_port_smphr_nip_MASK	0x1
4912fcee4bfSJames Smart #define lpfc_port_smphr_nip_WORD	word0
4922fcee4bfSJames Smart #define lpfc_port_smphr_ipc_SHIFT	28
4932fcee4bfSJames Smart #define lpfc_port_smphr_ipc_MASK	0x1
4942fcee4bfSJames Smart #define lpfc_port_smphr_ipc_WORD	word0
4952fcee4bfSJames Smart #define lpfc_port_smphr_scr1_SHIFT	27
4962fcee4bfSJames Smart #define lpfc_port_smphr_scr1_MASK	0x1
4972fcee4bfSJames Smart #define lpfc_port_smphr_scr1_WORD	word0
4982fcee4bfSJames Smart #define lpfc_port_smphr_scr2_SHIFT	26
4992fcee4bfSJames Smart #define lpfc_port_smphr_scr2_MASK	0x1
5002fcee4bfSJames Smart #define lpfc_port_smphr_scr2_WORD	word0
5012fcee4bfSJames Smart #define lpfc_port_smphr_host_scratch_SHIFT	16
5022fcee4bfSJames Smart #define lpfc_port_smphr_host_scratch_MASK	0xFF
5032fcee4bfSJames Smart #define lpfc_port_smphr_host_scratch_WORD	word0
5042fcee4bfSJames Smart #define lpfc_port_smphr_port_status_SHIFT	0
5052fcee4bfSJames Smart #define lpfc_port_smphr_port_status_MASK	0xFFFF
5062fcee4bfSJames Smart #define lpfc_port_smphr_port_status_WORD	word0
5072fcee4bfSJames Smart 
508da0436e9SJames Smart #define LPFC_POST_STAGE_POWER_ON_RESET			0x0000
509da0436e9SJames Smart #define LPFC_POST_STAGE_AWAITING_HOST_RDY		0x0001
510da0436e9SJames Smart #define LPFC_POST_STAGE_HOST_RDY			0x0002
511da0436e9SJames Smart #define LPFC_POST_STAGE_BE_RESET			0x0003
512da0436e9SJames Smart #define LPFC_POST_STAGE_SEEPROM_CS_START		0x0100
513da0436e9SJames Smart #define LPFC_POST_STAGE_SEEPROM_CS_DONE			0x0101
514da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_CONFIG_START		0x0200
515da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_CONFIG_DONE			0x0201
516da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_CALIBRATE_START		0x0300
517da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_CALIBRATE_DONE		0x0301
518da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_TEST_START			0x0400
519da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_TEST_DONE			0x0401
520da0436e9SJames Smart #define LPFC_POST_STAGE_REDBOOT_INIT_START		0x0600
521da0436e9SJames Smart #define LPFC_POST_STAGE_REDBOOT_INIT_DONE		0x0601
522da0436e9SJames Smart #define LPFC_POST_STAGE_FW_IMAGE_LOAD_START		0x0700
523da0436e9SJames Smart #define LPFC_POST_STAGE_FW_IMAGE_LOAD_DONE		0x0701
524da0436e9SJames Smart #define LPFC_POST_STAGE_ARMFW_START			0x0800
525da0436e9SJames Smart #define LPFC_POST_STAGE_DHCP_QUERY_START		0x0900
526da0436e9SJames Smart #define LPFC_POST_STAGE_DHCP_QUERY_DONE			0x0901
527da0436e9SJames Smart #define LPFC_POST_STAGE_BOOT_TARGET_DISCOVERY_START	0x0A00
528da0436e9SJames Smart #define LPFC_POST_STAGE_BOOT_TARGET_DISCOVERY_DONE	0x0A01
529da0436e9SJames Smart #define LPFC_POST_STAGE_RC_OPTION_SET			0x0B00
530da0436e9SJames Smart #define LPFC_POST_STAGE_SWITCH_LINK			0x0B01
531da0436e9SJames Smart #define LPFC_POST_STAGE_SEND_ICDS_MESSAGE		0x0B02
532da0436e9SJames Smart #define LPFC_POST_STAGE_PERFROM_TFTP			0x0B03
533da0436e9SJames Smart #define LPFC_POST_STAGE_PARSE_XML			0x0B04
534da0436e9SJames Smart #define LPFC_POST_STAGE_DOWNLOAD_IMAGE			0x0B05
535da0436e9SJames Smart #define LPFC_POST_STAGE_FLASH_IMAGE			0x0B06
536da0436e9SJames Smart #define LPFC_POST_STAGE_RC_DONE				0x0B07
537da0436e9SJames Smart #define LPFC_POST_STAGE_REBOOT_SYSTEM			0x0B08
538da0436e9SJames Smart #define LPFC_POST_STAGE_MAC_ADDRESS			0x0C00
5392fcee4bfSJames Smart #define LPFC_POST_STAGE_PORT_READY			0xC000
5402fcee4bfSJames Smart #define LPFC_POST_STAGE_PORT_UE 			0xF000
541085c647cSJames Smart 
542085c647cSJames Smart #define LPFC_SLIPORT_STATUS		0x0404
543085c647cSJames Smart #define lpfc_sliport_status_err_SHIFT	31
544085c647cSJames Smart #define lpfc_sliport_status_err_MASK	0x1
545085c647cSJames Smart #define lpfc_sliport_status_err_WORD	word0
546085c647cSJames Smart #define lpfc_sliport_status_end_SHIFT	30
547085c647cSJames Smart #define lpfc_sliport_status_end_MASK	0x1
548085c647cSJames Smart #define lpfc_sliport_status_end_WORD	word0
549085c647cSJames Smart #define lpfc_sliport_status_oti_SHIFT	29
550085c647cSJames Smart #define lpfc_sliport_status_oti_MASK	0x1
551085c647cSJames Smart #define lpfc_sliport_status_oti_WORD	word0
552085c647cSJames Smart #define lpfc_sliport_status_rn_SHIFT	24
553085c647cSJames Smart #define lpfc_sliport_status_rn_MASK	0x1
554085c647cSJames Smart #define lpfc_sliport_status_rn_WORD	word0
555085c647cSJames Smart #define lpfc_sliport_status_rdy_SHIFT	23
556085c647cSJames Smart #define lpfc_sliport_status_rdy_MASK	0x1
557085c647cSJames Smart #define lpfc_sliport_status_rdy_WORD	word0
5582fcee4bfSJames Smart #define MAX_IF_TYPE_2_RESETS	1000
559085c647cSJames Smart 
5602fcee4bfSJames Smart #define LPFC_SLIPORT_CNTRL		0x0408
561085c647cSJames Smart #define lpfc_sliport_ctrl_end_SHIFT	30
562085c647cSJames Smart #define lpfc_sliport_ctrl_end_MASK	0x1
563085c647cSJames Smart #define lpfc_sliport_ctrl_end_WORD	word0
564085c647cSJames Smart #define LPFC_SLIPORT_LITTLE_ENDIAN 0
565085c647cSJames Smart #define LPFC_SLIPORT_BIG_ENDIAN	   1
566085c647cSJames Smart #define lpfc_sliport_ctrl_ip_SHIFT	27
567085c647cSJames Smart #define lpfc_sliport_ctrl_ip_MASK	0x1
568085c647cSJames Smart #define lpfc_sliport_ctrl_ip_WORD	word0
5692fcee4bfSJames Smart #define LPFC_SLIPORT_INIT_PORT	1
570085c647cSJames Smart 
5712fcee4bfSJames Smart #define LPFC_SLIPORT_ERR_1		0x040C
5722fcee4bfSJames Smart #define LPFC_SLIPORT_ERR_2		0x0410
573085c647cSJames Smart 
5742fcee4bfSJames Smart /* The following Registers apply to SLI4 if_type 0 UCNAs. They typically
5752fcee4bfSJames Smart  * reside in BAR 2.
5762fcee4bfSJames Smart  */
5772fcee4bfSJames Smart #define LPFC_SLIPORT_IF0_SMPHR	0x00AC
5782fcee4bfSJames Smart 
579da0436e9SJames Smart #define LPFC_IMR_MASK_ALL	0xFFFFFFFF
580da0436e9SJames Smart #define LPFC_ISCR_CLEAR_ALL	0xFFFFFFFF
581da0436e9SJames Smart 
582da0436e9SJames Smart #define LPFC_HST_ISR0		0x0C18
583da0436e9SJames Smart #define LPFC_HST_ISR1		0x0C1C
584da0436e9SJames Smart #define LPFC_HST_ISR2		0x0C20
585da0436e9SJames Smart #define LPFC_HST_ISR3		0x0C24
586da0436e9SJames Smart #define LPFC_HST_ISR4		0x0C28
587da0436e9SJames Smart 
588da0436e9SJames Smart #define LPFC_HST_IMR0		0x0C48
589da0436e9SJames Smart #define LPFC_HST_IMR1		0x0C4C
590da0436e9SJames Smart #define LPFC_HST_IMR2		0x0C50
591da0436e9SJames Smart #define LPFC_HST_IMR3		0x0C54
592da0436e9SJames Smart #define LPFC_HST_IMR4		0x0C58
593da0436e9SJames Smart 
594da0436e9SJames Smart #define LPFC_HST_ISCR0		0x0C78
595da0436e9SJames Smart #define LPFC_HST_ISCR1		0x0C7C
596da0436e9SJames Smart #define LPFC_HST_ISCR2		0x0C80
597da0436e9SJames Smart #define LPFC_HST_ISCR3		0x0C84
598da0436e9SJames Smart #define LPFC_HST_ISCR4		0x0C88
599da0436e9SJames Smart 
600da0436e9SJames Smart #define LPFC_SLI4_INTR0			BIT0
601da0436e9SJames Smart #define LPFC_SLI4_INTR1			BIT1
602da0436e9SJames Smart #define LPFC_SLI4_INTR2			BIT2
603da0436e9SJames Smart #define LPFC_SLI4_INTR3			BIT3
604da0436e9SJames Smart #define LPFC_SLI4_INTR4			BIT4
605da0436e9SJames Smart #define LPFC_SLI4_INTR5			BIT5
606da0436e9SJames Smart #define LPFC_SLI4_INTR6			BIT6
607da0436e9SJames Smart #define LPFC_SLI4_INTR7			BIT7
608da0436e9SJames Smart #define LPFC_SLI4_INTR8			BIT8
609da0436e9SJames Smart #define LPFC_SLI4_INTR9			BIT9
610da0436e9SJames Smart #define LPFC_SLI4_INTR10		BIT10
611da0436e9SJames Smart #define LPFC_SLI4_INTR11		BIT11
612da0436e9SJames Smart #define LPFC_SLI4_INTR12		BIT12
613da0436e9SJames Smart #define LPFC_SLI4_INTR13		BIT13
614da0436e9SJames Smart #define LPFC_SLI4_INTR14		BIT14
615da0436e9SJames Smart #define LPFC_SLI4_INTR15		BIT15
616da0436e9SJames Smart #define LPFC_SLI4_INTR16		BIT16
617da0436e9SJames Smart #define LPFC_SLI4_INTR17		BIT17
618da0436e9SJames Smart #define LPFC_SLI4_INTR18		BIT18
619da0436e9SJames Smart #define LPFC_SLI4_INTR19		BIT19
620da0436e9SJames Smart #define LPFC_SLI4_INTR20		BIT20
621da0436e9SJames Smart #define LPFC_SLI4_INTR21		BIT21
622da0436e9SJames Smart #define LPFC_SLI4_INTR22		BIT22
623da0436e9SJames Smart #define LPFC_SLI4_INTR23		BIT23
624da0436e9SJames Smart #define LPFC_SLI4_INTR24		BIT24
625da0436e9SJames Smart #define LPFC_SLI4_INTR25		BIT25
626da0436e9SJames Smart #define LPFC_SLI4_INTR26		BIT26
627da0436e9SJames Smart #define LPFC_SLI4_INTR27		BIT27
628da0436e9SJames Smart #define LPFC_SLI4_INTR28		BIT28
629da0436e9SJames Smart #define LPFC_SLI4_INTR29		BIT29
630da0436e9SJames Smart #define LPFC_SLI4_INTR30		BIT30
631da0436e9SJames Smart #define LPFC_SLI4_INTR31		BIT31
632da0436e9SJames Smart 
633085c647cSJames Smart /*
634085c647cSJames Smart  * The Doorbell registers defined here exist in different BAR
635085c647cSJames Smart  * register sets depending on the UCNA Port's reported if_type
636085c647cSJames Smart  * value.  For UCNA ports running SLI4 and if_type 0, they reside in
6372fcee4bfSJames Smart  * BAR4.  For UCNA ports running SLI4 and if_type 2, they reside in
638085c647cSJames Smart  * BAR0.  The offsets are the same so the driver must account for
639085c647cSJames Smart  * any base address difference.
640085c647cSJames Smart  */
641da0436e9SJames Smart #define LPFC_RQ_DOORBELL		0x00A0
642da0436e9SJames Smart #define lpfc_rq_doorbell_num_posted_SHIFT	16
643da0436e9SJames Smart #define lpfc_rq_doorbell_num_posted_MASK	0x3FFF
644da0436e9SJames Smart #define lpfc_rq_doorbell_num_posted_WORD	word0
645da0436e9SJames Smart #define LPFC_RQ_POST_BATCH		8	/* RQEs to post at one time */
646da0436e9SJames Smart #define lpfc_rq_doorbell_id_SHIFT		0
647085c647cSJames Smart #define lpfc_rq_doorbell_id_MASK		0xFFFF
648da0436e9SJames Smart #define lpfc_rq_doorbell_id_WORD		word0
649da0436e9SJames Smart 
650da0436e9SJames Smart #define LPFC_WQ_DOORBELL		0x0040
651da0436e9SJames Smart #define lpfc_wq_doorbell_num_posted_SHIFT	24
652da0436e9SJames Smart #define lpfc_wq_doorbell_num_posted_MASK	0x00FF
653da0436e9SJames Smart #define lpfc_wq_doorbell_num_posted_WORD	word0
654da0436e9SJames Smart #define lpfc_wq_doorbell_index_SHIFT		16
655da0436e9SJames Smart #define lpfc_wq_doorbell_index_MASK		0x00FF
656da0436e9SJames Smart #define lpfc_wq_doorbell_index_WORD		word0
657da0436e9SJames Smart #define lpfc_wq_doorbell_id_SHIFT		0
658da0436e9SJames Smart #define lpfc_wq_doorbell_id_MASK		0xFFFF
659da0436e9SJames Smart #define lpfc_wq_doorbell_id_WORD		word0
660da0436e9SJames Smart 
661da0436e9SJames Smart #define LPFC_EQCQ_DOORBELL		0x0120
662085c647cSJames Smart #define lpfc_eqcq_doorbell_se_SHIFT		31
663085c647cSJames Smart #define lpfc_eqcq_doorbell_se_MASK		0x0001
664085c647cSJames Smart #define lpfc_eqcq_doorbell_se_WORD		word0
665085c647cSJames Smart #define LPFC_EQCQ_SOLICIT_ENABLE_OFF	0
666085c647cSJames Smart #define LPFC_EQCQ_SOLICIT_ENABLE_ON	1
667da0436e9SJames Smart #define lpfc_eqcq_doorbell_arm_SHIFT		29
668da0436e9SJames Smart #define lpfc_eqcq_doorbell_arm_MASK		0x0001
669da0436e9SJames Smart #define lpfc_eqcq_doorbell_arm_WORD		word0
670da0436e9SJames Smart #define lpfc_eqcq_doorbell_num_released_SHIFT	16
671da0436e9SJames Smart #define lpfc_eqcq_doorbell_num_released_MASK	0x1FFF
672da0436e9SJames Smart #define lpfc_eqcq_doorbell_num_released_WORD	word0
673da0436e9SJames Smart #define lpfc_eqcq_doorbell_qt_SHIFT		10
674da0436e9SJames Smart #define lpfc_eqcq_doorbell_qt_MASK		0x0001
675da0436e9SJames Smart #define lpfc_eqcq_doorbell_qt_WORD		word0
676da0436e9SJames Smart #define LPFC_QUEUE_TYPE_COMPLETION	0
677da0436e9SJames Smart #define LPFC_QUEUE_TYPE_EVENT		1
678da0436e9SJames Smart #define lpfc_eqcq_doorbell_eqci_SHIFT		9
679da0436e9SJames Smart #define lpfc_eqcq_doorbell_eqci_MASK		0x0001
680da0436e9SJames Smart #define lpfc_eqcq_doorbell_eqci_WORD		word0
681da0436e9SJames Smart #define lpfc_eqcq_doorbell_cqid_SHIFT		0
682da0436e9SJames Smart #define lpfc_eqcq_doorbell_cqid_MASK		0x03FF
683da0436e9SJames Smart #define lpfc_eqcq_doorbell_cqid_WORD		word0
684da0436e9SJames Smart #define lpfc_eqcq_doorbell_eqid_SHIFT		0
685da0436e9SJames Smart #define lpfc_eqcq_doorbell_eqid_MASK		0x01FF
686da0436e9SJames Smart #define lpfc_eqcq_doorbell_eqid_WORD		word0
687da0436e9SJames Smart 
688da0436e9SJames Smart #define LPFC_BMBX			0x0160
689da0436e9SJames Smart #define lpfc_bmbx_addr_SHIFT		2
690da0436e9SJames Smart #define lpfc_bmbx_addr_MASK		0x3FFFFFFF
691da0436e9SJames Smart #define lpfc_bmbx_addr_WORD		word0
692da0436e9SJames Smart #define lpfc_bmbx_hi_SHIFT		1
693da0436e9SJames Smart #define lpfc_bmbx_hi_MASK		0x0001
694da0436e9SJames Smart #define lpfc_bmbx_hi_WORD		word0
695da0436e9SJames Smart #define lpfc_bmbx_rdy_SHIFT		0
696da0436e9SJames Smart #define lpfc_bmbx_rdy_MASK		0x0001
697da0436e9SJames Smart #define lpfc_bmbx_rdy_WORD		word0
698da0436e9SJames Smart 
699da0436e9SJames Smart #define LPFC_MQ_DOORBELL			0x0140
700da0436e9SJames Smart #define lpfc_mq_doorbell_num_posted_SHIFT	16
701da0436e9SJames Smart #define lpfc_mq_doorbell_num_posted_MASK	0x3FFF
702da0436e9SJames Smart #define lpfc_mq_doorbell_num_posted_WORD	word0
703da0436e9SJames Smart #define lpfc_mq_doorbell_id_SHIFT		0
704085c647cSJames Smart #define lpfc_mq_doorbell_id_MASK		0xFFFF
705da0436e9SJames Smart #define lpfc_mq_doorbell_id_WORD		word0
706da0436e9SJames Smart 
707da0436e9SJames Smart struct lpfc_sli4_cfg_mhdr {
708da0436e9SJames Smart 	uint32_t word1;
709da0436e9SJames Smart #define lpfc_mbox_hdr_emb_SHIFT		0
710da0436e9SJames Smart #define lpfc_mbox_hdr_emb_MASK		0x00000001
711da0436e9SJames Smart #define lpfc_mbox_hdr_emb_WORD		word1
712da0436e9SJames Smart #define lpfc_mbox_hdr_sge_cnt_SHIFT	3
713da0436e9SJames Smart #define lpfc_mbox_hdr_sge_cnt_MASK	0x0000001F
714da0436e9SJames Smart #define lpfc_mbox_hdr_sge_cnt_WORD	word1
715da0436e9SJames Smart 	uint32_t payload_length;
716da0436e9SJames Smart 	uint32_t tag_lo;
717da0436e9SJames Smart 	uint32_t tag_hi;
718da0436e9SJames Smart 	uint32_t reserved5;
719da0436e9SJames Smart };
720da0436e9SJames Smart 
721da0436e9SJames Smart union lpfc_sli4_cfg_shdr {
722da0436e9SJames Smart 	struct {
723da0436e9SJames Smart 		uint32_t word6;
724da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_SHIFT	0
725da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_MASK	0x000000FF
726da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_WORD	word6
727da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_SHIFT	8
728da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_MASK	0x000000FF
729da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_WORD	word6
730da0436e9SJames Smart #define lpfc_mbox_hdr_port_number_SHIFT	16
731da0436e9SJames Smart #define lpfc_mbox_hdr_port_number_MASK	0x000000FF
732da0436e9SJames Smart #define lpfc_mbox_hdr_port_number_WORD	word6
733da0436e9SJames Smart #define lpfc_mbox_hdr_domain_SHIFT	24
734da0436e9SJames Smart #define lpfc_mbox_hdr_domain_MASK	0x000000FF
735da0436e9SJames Smart #define lpfc_mbox_hdr_domain_WORD	word6
736da0436e9SJames Smart 		uint32_t timeout;
737da0436e9SJames Smart 		uint32_t request_length;
7385a6f133eSJames Smart 		uint32_t word9;
7395a6f133eSJames Smart #define lpfc_mbox_hdr_version_SHIFT	0
7405a6f133eSJames Smart #define lpfc_mbox_hdr_version_MASK	0x000000FF
7415a6f133eSJames Smart #define lpfc_mbox_hdr_version_WORD	word9
7425a6f133eSJames Smart #define LPFC_Q_CREATE_VERSION_2	2
7435a6f133eSJames Smart #define LPFC_Q_CREATE_VERSION_1	1
7445a6f133eSJames Smart #define LPFC_Q_CREATE_VERSION_0	0
745da0436e9SJames Smart 	} request;
746da0436e9SJames Smart 	struct {
747da0436e9SJames Smart 		uint32_t word6;
748da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_SHIFT		0
749da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_MASK		0x000000FF
750da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_WORD		word6
751da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_SHIFT		8
752da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_MASK		0x000000FF
753da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_WORD		word6
754da0436e9SJames Smart #define lpfc_mbox_hdr_domain_SHIFT		24
755da0436e9SJames Smart #define lpfc_mbox_hdr_domain_MASK		0x000000FF
756da0436e9SJames Smart #define lpfc_mbox_hdr_domain_WORD		word6
757da0436e9SJames Smart 		uint32_t word7;
758da0436e9SJames Smart #define lpfc_mbox_hdr_status_SHIFT		0
759da0436e9SJames Smart #define lpfc_mbox_hdr_status_MASK		0x000000FF
760da0436e9SJames Smart #define lpfc_mbox_hdr_status_WORD		word7
761da0436e9SJames Smart #define lpfc_mbox_hdr_add_status_SHIFT		8
762da0436e9SJames Smart #define lpfc_mbox_hdr_add_status_MASK		0x000000FF
763da0436e9SJames Smart #define lpfc_mbox_hdr_add_status_WORD		word7
764da0436e9SJames Smart 		uint32_t response_length;
765da0436e9SJames Smart 		uint32_t actual_response_length;
766da0436e9SJames Smart 	} response;
767da0436e9SJames Smart };
768da0436e9SJames Smart 
769da0436e9SJames Smart /* Mailbox structures */
770da0436e9SJames Smart struct mbox_header {
771da0436e9SJames Smart 	struct lpfc_sli4_cfg_mhdr cfg_mhdr;
772da0436e9SJames Smart 	union  lpfc_sli4_cfg_shdr cfg_shdr;
773da0436e9SJames Smart };
774da0436e9SJames Smart 
775da0436e9SJames Smart /* Subsystem Definitions */
776da0436e9SJames Smart #define LPFC_MBOX_SUBSYSTEM_COMMON	0x1
777da0436e9SJames Smart #define LPFC_MBOX_SUBSYSTEM_FCOE	0xC
778da0436e9SJames Smart 
779da0436e9SJames Smart /* Device Specific Definitions */
780da0436e9SJames Smart 
781da0436e9SJames Smart /* The HOST ENDIAN defines are in Big Endian format. */
782da0436e9SJames Smart #define HOST_ENDIAN_LOW_WORD0   0xFF3412FF
783da0436e9SJames Smart #define HOST_ENDIAN_HIGH_WORD1	0xFF7856FF
784da0436e9SJames Smart 
785da0436e9SJames Smart /* Common Opcodes */
786da0436e9SJames Smart #define LPFC_MBOX_OPCODE_CQ_CREATE		0x0C
787da0436e9SJames Smart #define LPFC_MBOX_OPCODE_EQ_CREATE		0x0D
788da0436e9SJames Smart #define LPFC_MBOX_OPCODE_MQ_CREATE		0x15
789da0436e9SJames Smart #define LPFC_MBOX_OPCODE_GET_CNTL_ATTRIBUTES	0x20
790da0436e9SJames Smart #define LPFC_MBOX_OPCODE_NOP			0x21
791da0436e9SJames Smart #define LPFC_MBOX_OPCODE_MQ_DESTROY		0x35
792da0436e9SJames Smart #define LPFC_MBOX_OPCODE_CQ_DESTROY		0x36
793da0436e9SJames Smart #define LPFC_MBOX_OPCODE_EQ_DESTROY		0x37
7946669f9bbSJames Smart #define LPFC_MBOX_OPCODE_QUERY_FW_CFG		0x3A
795da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FUNCTION_RESET		0x3D
796b19a061aSJames Smart #define LPFC_MBOX_OPCODE_MQ_CREATE_EXT		0x5A
797fedd3b7bSJames Smart #define LPFC_MBOX_OPCODE_GET_SLI4_PARAMETERS	0xB5
798da0436e9SJames Smart 
799da0436e9SJames Smart /* FCoE Opcodes */
800da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_WQ_CREATE			0x01
801da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_WQ_DESTROY		0x02
802da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_POST_SGL_PAGES		0x03
803da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_REMOVE_SGL_PAGES		0x04
804da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_RQ_CREATE			0x05
805da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_RQ_DESTROY		0x06
806da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_READ_FCF_TABLE		0x08
807da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_ADD_FCF			0x09
808da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_DELETE_FCF		0x0A
809da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_POST_HDR_TEMPLATE		0x0B
810ecfd03c6SJames Smart #define LPFC_MBOX_OPCODE_FCOE_REDISCOVER_FCF		0x10
811da0436e9SJames Smart 
812da0436e9SJames Smart /* Mailbox command structures */
813da0436e9SJames Smart struct eq_context {
814da0436e9SJames Smart 	uint32_t word0;
815da0436e9SJames Smart #define lpfc_eq_context_size_SHIFT	31
816da0436e9SJames Smart #define lpfc_eq_context_size_MASK	0x00000001
817da0436e9SJames Smart #define lpfc_eq_context_size_WORD	word0
818da0436e9SJames Smart #define LPFC_EQE_SIZE_4			0x0
819da0436e9SJames Smart #define LPFC_EQE_SIZE_16		0x1
820da0436e9SJames Smart #define lpfc_eq_context_valid_SHIFT	29
821da0436e9SJames Smart #define lpfc_eq_context_valid_MASK	0x00000001
822da0436e9SJames Smart #define lpfc_eq_context_valid_WORD	word0
823da0436e9SJames Smart 	uint32_t word1;
824da0436e9SJames Smart #define lpfc_eq_context_count_SHIFT	26
825da0436e9SJames Smart #define lpfc_eq_context_count_MASK	0x00000003
826da0436e9SJames Smart #define lpfc_eq_context_count_WORD	word1
827da0436e9SJames Smart #define LPFC_EQ_CNT_256		0x0
828da0436e9SJames Smart #define LPFC_EQ_CNT_512		0x1
829da0436e9SJames Smart #define LPFC_EQ_CNT_1024	0x2
830da0436e9SJames Smart #define LPFC_EQ_CNT_2048	0x3
831da0436e9SJames Smart #define LPFC_EQ_CNT_4096	0x4
832da0436e9SJames Smart 	uint32_t word2;
833da0436e9SJames Smart #define lpfc_eq_context_delay_multi_SHIFT	13
834da0436e9SJames Smart #define lpfc_eq_context_delay_multi_MASK	0x000003FF
835da0436e9SJames Smart #define lpfc_eq_context_delay_multi_WORD	word2
836da0436e9SJames Smart 	uint32_t reserved3;
837da0436e9SJames Smart };
838da0436e9SJames Smart 
839da0436e9SJames Smart struct sgl_page_pairs {
840da0436e9SJames Smart 	uint32_t sgl_pg0_addr_lo;
841da0436e9SJames Smart 	uint32_t sgl_pg0_addr_hi;
842da0436e9SJames Smart 	uint32_t sgl_pg1_addr_lo;
843da0436e9SJames Smart 	uint32_t sgl_pg1_addr_hi;
844da0436e9SJames Smart };
845da0436e9SJames Smart 
846da0436e9SJames Smart struct lpfc_mbx_post_sgl_pages {
847da0436e9SJames Smart 	struct mbox_header header;
848da0436e9SJames Smart 	uint32_t word0;
849da0436e9SJames Smart #define lpfc_post_sgl_pages_xri_SHIFT	0
850da0436e9SJames Smart #define lpfc_post_sgl_pages_xri_MASK	0x0000FFFF
851da0436e9SJames Smart #define lpfc_post_sgl_pages_xri_WORD	word0
852da0436e9SJames Smart #define lpfc_post_sgl_pages_xricnt_SHIFT	16
853da0436e9SJames Smart #define lpfc_post_sgl_pages_xricnt_MASK	0x0000FFFF
854da0436e9SJames Smart #define lpfc_post_sgl_pages_xricnt_WORD	word0
855da0436e9SJames Smart 	struct sgl_page_pairs  sgl_pg_pairs[1];
856da0436e9SJames Smart };
857da0436e9SJames Smart 
858da0436e9SJames Smart /* word0 of page-1 struct shares the same SHIFT/MASK/WORD defines as above */
859da0436e9SJames Smart struct lpfc_mbx_post_uembed_sgl_page1 {
860da0436e9SJames Smart 	union  lpfc_sli4_cfg_shdr cfg_shdr;
861da0436e9SJames Smart 	uint32_t word0;
862da0436e9SJames Smart 	struct sgl_page_pairs sgl_pg_pairs;
863da0436e9SJames Smart };
864da0436e9SJames Smart 
865da0436e9SJames Smart struct lpfc_mbx_sge {
866da0436e9SJames Smart 	uint32_t pa_lo;
867da0436e9SJames Smart 	uint32_t pa_hi;
868da0436e9SJames Smart 	uint32_t length;
869da0436e9SJames Smart };
870da0436e9SJames Smart 
871da0436e9SJames Smart struct lpfc_mbx_nembed_cmd {
872da0436e9SJames Smart 	struct lpfc_sli4_cfg_mhdr cfg_mhdr;
873da0436e9SJames Smart #define LPFC_SLI4_MBX_SGE_MAX_PAGES	19
874da0436e9SJames Smart 	struct lpfc_mbx_sge sge[LPFC_SLI4_MBX_SGE_MAX_PAGES];
875da0436e9SJames Smart };
876da0436e9SJames Smart 
877da0436e9SJames Smart struct lpfc_mbx_nembed_sge_virt {
878da0436e9SJames Smart 	void *addr[LPFC_SLI4_MBX_SGE_MAX_PAGES];
879da0436e9SJames Smart };
880da0436e9SJames Smart 
881da0436e9SJames Smart struct lpfc_mbx_eq_create {
882da0436e9SJames Smart 	struct mbox_header header;
883da0436e9SJames Smart 	union {
884da0436e9SJames Smart 		struct {
885da0436e9SJames Smart 			uint32_t word0;
886da0436e9SJames Smart #define lpfc_mbx_eq_create_num_pages_SHIFT	0
887da0436e9SJames Smart #define lpfc_mbx_eq_create_num_pages_MASK	0x0000FFFF
888da0436e9SJames Smart #define lpfc_mbx_eq_create_num_pages_WORD	word0
889da0436e9SJames Smart 			struct eq_context context;
890da0436e9SJames Smart 			struct dma_address page[LPFC_MAX_EQ_PAGE];
891da0436e9SJames Smart 		} request;
892da0436e9SJames Smart 		struct {
893da0436e9SJames Smart 			uint32_t word0;
894da0436e9SJames Smart #define lpfc_mbx_eq_create_q_id_SHIFT	0
895da0436e9SJames Smart #define lpfc_mbx_eq_create_q_id_MASK	0x0000FFFF
896da0436e9SJames Smart #define lpfc_mbx_eq_create_q_id_WORD	word0
897da0436e9SJames Smart 		} response;
898da0436e9SJames Smart 	} u;
899da0436e9SJames Smart };
900da0436e9SJames Smart 
901da0436e9SJames Smart struct lpfc_mbx_eq_destroy {
902da0436e9SJames Smart 	struct mbox_header header;
903da0436e9SJames Smart 	union {
904da0436e9SJames Smart 		struct {
905da0436e9SJames Smart 			uint32_t word0;
906da0436e9SJames Smart #define lpfc_mbx_eq_destroy_q_id_SHIFT	0
907da0436e9SJames Smart #define lpfc_mbx_eq_destroy_q_id_MASK	0x0000FFFF
908da0436e9SJames Smart #define lpfc_mbx_eq_destroy_q_id_WORD	word0
909da0436e9SJames Smart 		} request;
910da0436e9SJames Smart 		struct {
911da0436e9SJames Smart 			uint32_t word0;
912da0436e9SJames Smart 		} response;
913da0436e9SJames Smart 	} u;
914da0436e9SJames Smart };
915da0436e9SJames Smart 
916da0436e9SJames Smart struct lpfc_mbx_nop {
917da0436e9SJames Smart 	struct mbox_header header;
918da0436e9SJames Smart 	uint32_t context[2];
919da0436e9SJames Smart };
920da0436e9SJames Smart 
921da0436e9SJames Smart struct cq_context {
922da0436e9SJames Smart 	uint32_t word0;
923da0436e9SJames Smart #define lpfc_cq_context_event_SHIFT	31
924da0436e9SJames Smart #define lpfc_cq_context_event_MASK	0x00000001
925da0436e9SJames Smart #define lpfc_cq_context_event_WORD	word0
926da0436e9SJames Smart #define lpfc_cq_context_valid_SHIFT	29
927da0436e9SJames Smart #define lpfc_cq_context_valid_MASK	0x00000001
928da0436e9SJames Smart #define lpfc_cq_context_valid_WORD	word0
929da0436e9SJames Smart #define lpfc_cq_context_count_SHIFT	27
930da0436e9SJames Smart #define lpfc_cq_context_count_MASK	0x00000003
931da0436e9SJames Smart #define lpfc_cq_context_count_WORD	word0
932da0436e9SJames Smart #define LPFC_CQ_CNT_256		0x0
933da0436e9SJames Smart #define LPFC_CQ_CNT_512		0x1
934da0436e9SJames Smart #define LPFC_CQ_CNT_1024	0x2
935da0436e9SJames Smart 	uint32_t word1;
9365a6f133eSJames Smart #define lpfc_cq_eq_id_SHIFT		22	/* Version 0 Only */
937da0436e9SJames Smart #define lpfc_cq_eq_id_MASK		0x000000FF
938da0436e9SJames Smart #define lpfc_cq_eq_id_WORD		word1
9395a6f133eSJames Smart #define lpfc_cq_eq_id_2_SHIFT		0 	/* Version 2 Only */
9405a6f133eSJames Smart #define lpfc_cq_eq_id_2_MASK		0x0000FFFF
9415a6f133eSJames Smart #define lpfc_cq_eq_id_2_WORD		word1
942da0436e9SJames Smart 	uint32_t reserved0;
943da0436e9SJames Smart 	uint32_t reserved1;
944da0436e9SJames Smart };
945da0436e9SJames Smart 
946da0436e9SJames Smart struct lpfc_mbx_cq_create {
947da0436e9SJames Smart 	struct mbox_header header;
948da0436e9SJames Smart 	union {
949da0436e9SJames Smart 		struct {
950da0436e9SJames Smart 			uint32_t word0;
9515a6f133eSJames Smart #define lpfc_mbx_cq_create_page_size_SHIFT	16	/* Version 2 Only */
9525a6f133eSJames Smart #define lpfc_mbx_cq_create_page_size_MASK	0x000000FF
9535a6f133eSJames Smart #define lpfc_mbx_cq_create_page_size_WORD	word0
954da0436e9SJames Smart #define lpfc_mbx_cq_create_num_pages_SHIFT	0
955da0436e9SJames Smart #define lpfc_mbx_cq_create_num_pages_MASK	0x0000FFFF
956da0436e9SJames Smart #define lpfc_mbx_cq_create_num_pages_WORD	word0
957da0436e9SJames Smart 			struct cq_context context;
958da0436e9SJames Smart 			struct dma_address page[LPFC_MAX_CQ_PAGE];
959da0436e9SJames Smart 		} request;
960da0436e9SJames Smart 		struct {
961da0436e9SJames Smart 			uint32_t word0;
962da0436e9SJames Smart #define lpfc_mbx_cq_create_q_id_SHIFT	0
963da0436e9SJames Smart #define lpfc_mbx_cq_create_q_id_MASK	0x0000FFFF
964da0436e9SJames Smart #define lpfc_mbx_cq_create_q_id_WORD	word0
965da0436e9SJames Smart 		} response;
966da0436e9SJames Smart 	} u;
967da0436e9SJames Smart };
968da0436e9SJames Smart 
969da0436e9SJames Smart struct lpfc_mbx_cq_destroy {
970da0436e9SJames Smart 	struct mbox_header header;
971da0436e9SJames Smart 	union {
972da0436e9SJames Smart 		struct {
973da0436e9SJames Smart 			uint32_t word0;
974da0436e9SJames Smart #define lpfc_mbx_cq_destroy_q_id_SHIFT	0
975da0436e9SJames Smart #define lpfc_mbx_cq_destroy_q_id_MASK	0x0000FFFF
976da0436e9SJames Smart #define lpfc_mbx_cq_destroy_q_id_WORD	word0
977da0436e9SJames Smart 		} request;
978da0436e9SJames Smart 		struct {
979da0436e9SJames Smart 			uint32_t word0;
980da0436e9SJames Smart 		} response;
981da0436e9SJames Smart 	} u;
982da0436e9SJames Smart };
983da0436e9SJames Smart 
984da0436e9SJames Smart struct wq_context {
985da0436e9SJames Smart 	uint32_t reserved0;
986da0436e9SJames Smart 	uint32_t reserved1;
987da0436e9SJames Smart 	uint32_t reserved2;
988da0436e9SJames Smart 	uint32_t reserved3;
989da0436e9SJames Smart };
990da0436e9SJames Smart 
991da0436e9SJames Smart struct lpfc_mbx_wq_create {
992da0436e9SJames Smart 	struct mbox_header header;
993da0436e9SJames Smart 	union {
9945a6f133eSJames Smart 		struct {	/* Version 0 Request */
995da0436e9SJames Smart 			uint32_t word0;
996da0436e9SJames Smart #define lpfc_mbx_wq_create_num_pages_SHIFT	0
997da0436e9SJames Smart #define lpfc_mbx_wq_create_num_pages_MASK	0x0000FFFF
998da0436e9SJames Smart #define lpfc_mbx_wq_create_num_pages_WORD	word0
999da0436e9SJames Smart #define lpfc_mbx_wq_create_cq_id_SHIFT		16
1000da0436e9SJames Smart #define lpfc_mbx_wq_create_cq_id_MASK		0x0000FFFF
1001da0436e9SJames Smart #define lpfc_mbx_wq_create_cq_id_WORD		word0
1002da0436e9SJames Smart 			struct dma_address page[LPFC_MAX_WQ_PAGE];
1003da0436e9SJames Smart 		} request;
10045a6f133eSJames Smart 		struct {	/* Version 1 Request */
10055a6f133eSJames Smart 			uint32_t word0;	/* Word 0 is the same as in v0 */
10065a6f133eSJames Smart 			uint32_t word1;
10075a6f133eSJames Smart #define lpfc_mbx_wq_create_page_size_SHIFT	0
10085a6f133eSJames Smart #define lpfc_mbx_wq_create_page_size_MASK	0x000000FF
10095a6f133eSJames Smart #define lpfc_mbx_wq_create_page_size_WORD	word1
10105a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_size_SHIFT	8
10115a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_size_MASK	0x0000000F
10125a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_size_WORD	word1
10135a6f133eSJames Smart #define LPFC_WQ_WQE_SIZE_64	0x5
10145a6f133eSJames Smart #define LPFC_WQ_WQE_SIZE_128	0x6
10155a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_count_SHIFT	16
10165a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_count_MASK	0x0000FFFF
10175a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_count_WORD	word1
10185a6f133eSJames Smart 			uint32_t word2;
10195a6f133eSJames Smart 			struct dma_address page[LPFC_MAX_WQ_PAGE-1];
10205a6f133eSJames Smart 		} request_1;
1021da0436e9SJames Smart 		struct {
1022da0436e9SJames Smart 			uint32_t word0;
1023da0436e9SJames Smart #define lpfc_mbx_wq_create_q_id_SHIFT	0
1024da0436e9SJames Smart #define lpfc_mbx_wq_create_q_id_MASK	0x0000FFFF
1025da0436e9SJames Smart #define lpfc_mbx_wq_create_q_id_WORD	word0
1026da0436e9SJames Smart 		} response;
1027da0436e9SJames Smart 	} u;
1028da0436e9SJames Smart };
1029da0436e9SJames Smart 
1030da0436e9SJames Smart struct lpfc_mbx_wq_destroy {
1031da0436e9SJames Smart 	struct mbox_header header;
1032da0436e9SJames Smart 	union {
1033da0436e9SJames Smart 		struct {
1034da0436e9SJames Smart 			uint32_t word0;
1035da0436e9SJames Smart #define lpfc_mbx_wq_destroy_q_id_SHIFT	0
1036da0436e9SJames Smart #define lpfc_mbx_wq_destroy_q_id_MASK	0x0000FFFF
1037da0436e9SJames Smart #define lpfc_mbx_wq_destroy_q_id_WORD	word0
1038da0436e9SJames Smart 		} request;
1039da0436e9SJames Smart 		struct {
1040da0436e9SJames Smart 			uint32_t word0;
1041da0436e9SJames Smart 		} response;
1042da0436e9SJames Smart 	} u;
1043da0436e9SJames Smart };
1044da0436e9SJames Smart 
1045da0436e9SJames Smart #define LPFC_HDR_BUF_SIZE 128
1046eeead811SJames Smart #define LPFC_DATA_BUF_SIZE 2048
1047da0436e9SJames Smart struct rq_context {
1048da0436e9SJames Smart 	uint32_t word0;
10495a6f133eSJames Smart #define lpfc_rq_context_rqe_count_SHIFT	16	/* Version 0 Only */
10505a6f133eSJames Smart #define lpfc_rq_context_rqe_count_MASK	0x0000000F
10515a6f133eSJames Smart #define lpfc_rq_context_rqe_count_WORD	word0
1052da0436e9SJames Smart #define LPFC_RQ_RING_SIZE_512		9	/* 512 entries */
1053da0436e9SJames Smart #define LPFC_RQ_RING_SIZE_1024		10	/* 1024 entries */
1054da0436e9SJames Smart #define LPFC_RQ_RING_SIZE_2048		11	/* 2048 entries */
1055da0436e9SJames Smart #define LPFC_RQ_RING_SIZE_4096		12	/* 4096 entries */
10565a6f133eSJames Smart #define lpfc_rq_context_rqe_count_1_SHIFT	16	/* Version 1 Only */
10575a6f133eSJames Smart #define lpfc_rq_context_rqe_count_1_MASK	0x0000FFFF
10585a6f133eSJames Smart #define lpfc_rq_context_rqe_count_1_WORD	word0
10595a6f133eSJames Smart #define lpfc_rq_context_rqe_size_SHIFT	8		/* Version 1 Only */
10605a6f133eSJames Smart #define lpfc_rq_context_rqe_size_MASK	0x0000000F
10615a6f133eSJames Smart #define lpfc_rq_context_rqe_size_WORD	word0
1062*c31098ceSJames Smart #define LPFC_RQE_SIZE_8		2
1063*c31098ceSJames Smart #define LPFC_RQE_SIZE_16	3
1064*c31098ceSJames Smart #define LPFC_RQE_SIZE_32	4
1065*c31098ceSJames Smart #define LPFC_RQE_SIZE_64	5
1066*c31098ceSJames Smart #define LPFC_RQE_SIZE_128	6
10675a6f133eSJames Smart #define lpfc_rq_context_page_size_SHIFT	0		/* Version 1 Only */
10685a6f133eSJames Smart #define lpfc_rq_context_page_size_MASK	0x000000FF
10695a6f133eSJames Smart #define lpfc_rq_context_page_size_WORD	word0
1070da0436e9SJames Smart 	uint32_t reserved1;
1071da0436e9SJames Smart 	uint32_t word2;
1072da0436e9SJames Smart #define lpfc_rq_context_cq_id_SHIFT	16
1073da0436e9SJames Smart #define lpfc_rq_context_cq_id_MASK	0x000003FF
1074da0436e9SJames Smart #define lpfc_rq_context_cq_id_WORD	word2
1075da0436e9SJames Smart #define lpfc_rq_context_buf_size_SHIFT	0
1076da0436e9SJames Smart #define lpfc_rq_context_buf_size_MASK	0x0000FFFF
1077da0436e9SJames Smart #define lpfc_rq_context_buf_size_WORD	word2
10785a6f133eSJames Smart 	uint32_t buffer_size;				/* Version 1 Only */
1079da0436e9SJames Smart };
1080da0436e9SJames Smart 
1081da0436e9SJames Smart struct lpfc_mbx_rq_create {
1082da0436e9SJames Smart 	struct mbox_header header;
1083da0436e9SJames Smart 	union {
1084da0436e9SJames Smart 		struct {
1085da0436e9SJames Smart 			uint32_t word0;
1086da0436e9SJames Smart #define lpfc_mbx_rq_create_num_pages_SHIFT	0
1087da0436e9SJames Smart #define lpfc_mbx_rq_create_num_pages_MASK	0x0000FFFF
1088da0436e9SJames Smart #define lpfc_mbx_rq_create_num_pages_WORD	word0
1089da0436e9SJames Smart 			struct rq_context context;
1090da0436e9SJames Smart 			struct dma_address page[LPFC_MAX_WQ_PAGE];
1091da0436e9SJames Smart 		} request;
1092da0436e9SJames Smart 		struct {
1093da0436e9SJames Smart 			uint32_t word0;
1094da0436e9SJames Smart #define lpfc_mbx_rq_create_q_id_SHIFT	0
1095da0436e9SJames Smart #define lpfc_mbx_rq_create_q_id_MASK	0x0000FFFF
1096da0436e9SJames Smart #define lpfc_mbx_rq_create_q_id_WORD	word0
1097da0436e9SJames Smart 		} response;
1098da0436e9SJames Smart 	} u;
1099da0436e9SJames Smart };
1100da0436e9SJames Smart 
1101da0436e9SJames Smart struct lpfc_mbx_rq_destroy {
1102da0436e9SJames Smart 	struct mbox_header header;
1103da0436e9SJames Smart 	union {
1104da0436e9SJames Smart 		struct {
1105da0436e9SJames Smart 			uint32_t word0;
1106da0436e9SJames Smart #define lpfc_mbx_rq_destroy_q_id_SHIFT	0
1107da0436e9SJames Smart #define lpfc_mbx_rq_destroy_q_id_MASK	0x0000FFFF
1108da0436e9SJames Smart #define lpfc_mbx_rq_destroy_q_id_WORD	word0
1109da0436e9SJames Smart 		} request;
1110da0436e9SJames Smart 		struct {
1111da0436e9SJames Smart 			uint32_t word0;
1112da0436e9SJames Smart 		} response;
1113da0436e9SJames Smart 	} u;
1114da0436e9SJames Smart };
1115da0436e9SJames Smart 
1116da0436e9SJames Smart struct mq_context {
1117da0436e9SJames Smart 	uint32_t word0;
11185a6f133eSJames Smart #define lpfc_mq_context_cq_id_SHIFT	22 	/* Version 0 Only */
1119da0436e9SJames Smart #define lpfc_mq_context_cq_id_MASK	0x000003FF
1120da0436e9SJames Smart #define lpfc_mq_context_cq_id_WORD	word0
11215a6f133eSJames Smart #define lpfc_mq_context_ring_size_SHIFT	16
11225a6f133eSJames Smart #define lpfc_mq_context_ring_size_MASK	0x0000000F
11235a6f133eSJames Smart #define lpfc_mq_context_ring_size_WORD	word0
11245a6f133eSJames Smart #define LPFC_MQ_RING_SIZE_16		0x5
11255a6f133eSJames Smart #define LPFC_MQ_RING_SIZE_32		0x6
11265a6f133eSJames Smart #define LPFC_MQ_RING_SIZE_64		0x7
11275a6f133eSJames Smart #define LPFC_MQ_RING_SIZE_128		0x8
1128da0436e9SJames Smart 	uint32_t word1;
1129da0436e9SJames Smart #define lpfc_mq_context_valid_SHIFT	31
1130da0436e9SJames Smart #define lpfc_mq_context_valid_MASK	0x00000001
1131da0436e9SJames Smart #define lpfc_mq_context_valid_WORD	word1
1132da0436e9SJames Smart 	uint32_t reserved2;
1133da0436e9SJames Smart 	uint32_t reserved3;
1134da0436e9SJames Smart };
1135da0436e9SJames Smart 
1136da0436e9SJames Smart struct lpfc_mbx_mq_create {
1137da0436e9SJames Smart 	struct mbox_header header;
1138da0436e9SJames Smart 	union {
1139da0436e9SJames Smart 		struct {
1140da0436e9SJames Smart 			uint32_t word0;
1141da0436e9SJames Smart #define lpfc_mbx_mq_create_num_pages_SHIFT	0
1142da0436e9SJames Smart #define lpfc_mbx_mq_create_num_pages_MASK	0x0000FFFF
1143da0436e9SJames Smart #define lpfc_mbx_mq_create_num_pages_WORD	word0
1144da0436e9SJames Smart 			struct mq_context context;
1145da0436e9SJames Smart 			struct dma_address page[LPFC_MAX_MQ_PAGE];
1146da0436e9SJames Smart 		} request;
1147da0436e9SJames Smart 		struct {
1148da0436e9SJames Smart 			uint32_t word0;
1149da0436e9SJames Smart #define lpfc_mbx_mq_create_q_id_SHIFT	0
1150da0436e9SJames Smart #define lpfc_mbx_mq_create_q_id_MASK	0x0000FFFF
1151da0436e9SJames Smart #define lpfc_mbx_mq_create_q_id_WORD	word0
1152da0436e9SJames Smart 		} response;
1153da0436e9SJames Smart 	} u;
1154da0436e9SJames Smart };
1155da0436e9SJames Smart 
1156b19a061aSJames Smart struct lpfc_mbx_mq_create_ext {
1157b19a061aSJames Smart 	struct mbox_header header;
1158b19a061aSJames Smart 	union {
1159b19a061aSJames Smart 		struct {
1160b19a061aSJames Smart 			uint32_t word0;
1161b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_num_pages_SHIFT	0
1162b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_num_pages_MASK	0x0000FFFF
1163b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_num_pages_WORD	word0
11645a6f133eSJames Smart #define lpfc_mbx_mq_create_ext_cq_id_SHIFT	16	/* Version 1 Only */
11655a6f133eSJames Smart #define lpfc_mbx_mq_create_ext_cq_id_MASK	0x0000FFFF
11665a6f133eSJames Smart #define lpfc_mbx_mq_create_ext_cq_id_WORD	word0
1167b19a061aSJames Smart 			uint32_t async_evt_bmap;
1168b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_link_SHIFT	LPFC_TRAILER_CODE_LINK
1169b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_link_MASK	0x00000001
1170b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_link_WORD	async_evt_bmap
117170f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fip_SHIFT	LPFC_TRAILER_CODE_FCOE
117270f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fip_MASK	0x00000001
117370f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fip_WORD	async_evt_bmap
1174b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_group5_SHIFT	LPFC_TRAILER_CODE_GRP5
1175b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_group5_MASK	0x00000001
1176b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_group5_WORD	async_evt_bmap
117770f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fc_SHIFT	LPFC_TRAILER_CODE_FC
117870f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fc_MASK	0x00000001
117970f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fc_WORD	async_evt_bmap
118070f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_sli_SHIFT	LPFC_TRAILER_CODE_SLI
118170f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_sli_MASK	0x00000001
118270f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_sli_WORD	async_evt_bmap
1183b19a061aSJames Smart 			struct mq_context context;
1184b19a061aSJames Smart 			struct dma_address page[LPFC_MAX_MQ_PAGE];
1185b19a061aSJames Smart 		} request;
1186b19a061aSJames Smart 		struct {
1187b19a061aSJames Smart 			uint32_t word0;
1188b19a061aSJames Smart #define lpfc_mbx_mq_create_q_id_SHIFT	0
1189b19a061aSJames Smart #define lpfc_mbx_mq_create_q_id_MASK	0x0000FFFF
1190b19a061aSJames Smart #define lpfc_mbx_mq_create_q_id_WORD	word0
1191b19a061aSJames Smart 		} response;
1192b19a061aSJames Smart 	} u;
1193b19a061aSJames Smart #define LPFC_ASYNC_EVENT_LINK_STATE	0x2
1194b19a061aSJames Smart #define LPFC_ASYNC_EVENT_FCF_STATE	0x4
1195b19a061aSJames Smart #define LPFC_ASYNC_EVENT_GROUP5		0x20
1196b19a061aSJames Smart };
1197b19a061aSJames Smart 
1198da0436e9SJames Smart struct lpfc_mbx_mq_destroy {
1199da0436e9SJames Smart 	struct mbox_header header;
1200da0436e9SJames Smart 	union {
1201da0436e9SJames Smart 		struct {
1202da0436e9SJames Smart 			uint32_t word0;
1203da0436e9SJames Smart #define lpfc_mbx_mq_destroy_q_id_SHIFT	0
1204da0436e9SJames Smart #define lpfc_mbx_mq_destroy_q_id_MASK	0x0000FFFF
1205da0436e9SJames Smart #define lpfc_mbx_mq_destroy_q_id_WORD	word0
1206da0436e9SJames Smart 		} request;
1207da0436e9SJames Smart 		struct {
1208da0436e9SJames Smart 			uint32_t word0;
1209da0436e9SJames Smart 		} response;
1210da0436e9SJames Smart 	} u;
1211da0436e9SJames Smart };
1212da0436e9SJames Smart 
1213da0436e9SJames Smart struct lpfc_mbx_post_hdr_tmpl {
1214da0436e9SJames Smart 	struct mbox_header header;
1215da0436e9SJames Smart 	uint32_t word10;
1216da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_rpi_offset_SHIFT  0
1217da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_rpi_offset_MASK   0x0000FFFF
1218da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_rpi_offset_WORD   word10
1219da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_page_cnt_SHIFT   16
1220da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_page_cnt_MASK    0x0000FFFF
1221da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_page_cnt_WORD    word10
1222da0436e9SJames Smart 	uint32_t rpi_paddr_lo;
1223da0436e9SJames Smart 	uint32_t rpi_paddr_hi;
1224da0436e9SJames Smart };
1225da0436e9SJames Smart 
1226da0436e9SJames Smart struct sli4_sge {	/* SLI-4 */
1227da0436e9SJames Smart 	uint32_t addr_hi;
1228da0436e9SJames Smart 	uint32_t addr_lo;
1229da0436e9SJames Smart 
1230da0436e9SJames Smart 	uint32_t word2;
1231da0436e9SJames Smart #define lpfc_sli4_sge_offset_SHIFT	0 /* Offset of buffer - Not used*/
1232da0436e9SJames Smart #define lpfc_sli4_sge_offset_MASK	0x00FFFFFF
1233da0436e9SJames Smart #define lpfc_sli4_sge_offset_WORD	word2
1234da0436e9SJames Smart #define lpfc_sli4_sge_last_SHIFT	31 /* Last SEG in the SGL sets
1235da0436e9SJames Smart 						this  flag !! */
1236da0436e9SJames Smart #define lpfc_sli4_sge_last_MASK		0x00000001
1237da0436e9SJames Smart #define lpfc_sli4_sge_last_WORD		word2
123828baac74SJames Smart 	uint32_t sge_len;
1239da0436e9SJames Smart };
1240da0436e9SJames Smart 
1241da0436e9SJames Smart struct fcf_record {
1242da0436e9SJames Smart 	uint32_t max_rcv_size;
1243da0436e9SJames Smart 	uint32_t fka_adv_period;
1244da0436e9SJames Smart 	uint32_t fip_priority;
1245da0436e9SJames Smart 	uint32_t word3;
1246da0436e9SJames Smart #define lpfc_fcf_record_mac_0_SHIFT		0
1247da0436e9SJames Smart #define lpfc_fcf_record_mac_0_MASK		0x000000FF
1248da0436e9SJames Smart #define lpfc_fcf_record_mac_0_WORD		word3
1249da0436e9SJames Smart #define lpfc_fcf_record_mac_1_SHIFT		8
1250da0436e9SJames Smart #define lpfc_fcf_record_mac_1_MASK		0x000000FF
1251da0436e9SJames Smart #define lpfc_fcf_record_mac_1_WORD		word3
1252da0436e9SJames Smart #define lpfc_fcf_record_mac_2_SHIFT		16
1253da0436e9SJames Smart #define lpfc_fcf_record_mac_2_MASK		0x000000FF
1254da0436e9SJames Smart #define lpfc_fcf_record_mac_2_WORD		word3
1255da0436e9SJames Smart #define lpfc_fcf_record_mac_3_SHIFT		24
1256da0436e9SJames Smart #define lpfc_fcf_record_mac_3_MASK		0x000000FF
1257da0436e9SJames Smart #define lpfc_fcf_record_mac_3_WORD		word3
1258da0436e9SJames Smart 	uint32_t word4;
1259da0436e9SJames Smart #define lpfc_fcf_record_mac_4_SHIFT		0
1260da0436e9SJames Smart #define lpfc_fcf_record_mac_4_MASK		0x000000FF
1261da0436e9SJames Smart #define lpfc_fcf_record_mac_4_WORD		word4
1262da0436e9SJames Smart #define lpfc_fcf_record_mac_5_SHIFT		8
1263da0436e9SJames Smart #define lpfc_fcf_record_mac_5_MASK		0x000000FF
1264da0436e9SJames Smart #define lpfc_fcf_record_mac_5_WORD		word4
1265da0436e9SJames Smart #define lpfc_fcf_record_fcf_avail_SHIFT		16
1266da0436e9SJames Smart #define lpfc_fcf_record_fcf_avail_MASK		0x000000FF
12670c287589SJames Smart #define lpfc_fcf_record_fcf_avail_WORD		word4
1268da0436e9SJames Smart #define lpfc_fcf_record_mac_addr_prov_SHIFT	24
1269da0436e9SJames Smart #define lpfc_fcf_record_mac_addr_prov_MASK	0x000000FF
1270da0436e9SJames Smart #define lpfc_fcf_record_mac_addr_prov_WORD	word4
1271da0436e9SJames Smart #define LPFC_FCF_FPMA           1 	/* Fabric Provided MAC Address */
1272da0436e9SJames Smart #define LPFC_FCF_SPMA           2       /* Server Provided MAC Address */
1273da0436e9SJames Smart 	uint32_t word5;
1274da0436e9SJames Smart #define lpfc_fcf_record_fab_name_0_SHIFT	0
1275da0436e9SJames Smart #define lpfc_fcf_record_fab_name_0_MASK		0x000000FF
1276da0436e9SJames Smart #define lpfc_fcf_record_fab_name_0_WORD		word5
1277da0436e9SJames Smart #define lpfc_fcf_record_fab_name_1_SHIFT	8
1278da0436e9SJames Smart #define lpfc_fcf_record_fab_name_1_MASK		0x000000FF
1279da0436e9SJames Smart #define lpfc_fcf_record_fab_name_1_WORD		word5
1280da0436e9SJames Smart #define lpfc_fcf_record_fab_name_2_SHIFT	16
1281da0436e9SJames Smart #define lpfc_fcf_record_fab_name_2_MASK		0x000000FF
1282da0436e9SJames Smart #define lpfc_fcf_record_fab_name_2_WORD		word5
1283da0436e9SJames Smart #define lpfc_fcf_record_fab_name_3_SHIFT	24
1284da0436e9SJames Smart #define lpfc_fcf_record_fab_name_3_MASK		0x000000FF
1285da0436e9SJames Smart #define lpfc_fcf_record_fab_name_3_WORD		word5
1286da0436e9SJames Smart 	uint32_t word6;
1287da0436e9SJames Smart #define lpfc_fcf_record_fab_name_4_SHIFT	0
1288da0436e9SJames Smart #define lpfc_fcf_record_fab_name_4_MASK		0x000000FF
1289da0436e9SJames Smart #define lpfc_fcf_record_fab_name_4_WORD		word6
1290da0436e9SJames Smart #define lpfc_fcf_record_fab_name_5_SHIFT	8
1291da0436e9SJames Smart #define lpfc_fcf_record_fab_name_5_MASK		0x000000FF
1292da0436e9SJames Smart #define lpfc_fcf_record_fab_name_5_WORD		word6
1293da0436e9SJames Smart #define lpfc_fcf_record_fab_name_6_SHIFT	16
1294da0436e9SJames Smart #define lpfc_fcf_record_fab_name_6_MASK		0x000000FF
1295da0436e9SJames Smart #define lpfc_fcf_record_fab_name_6_WORD		word6
1296da0436e9SJames Smart #define lpfc_fcf_record_fab_name_7_SHIFT	24
1297da0436e9SJames Smart #define lpfc_fcf_record_fab_name_7_MASK		0x000000FF
1298da0436e9SJames Smart #define lpfc_fcf_record_fab_name_7_WORD		word6
1299da0436e9SJames Smart 	uint32_t word7;
1300da0436e9SJames Smart #define lpfc_fcf_record_fc_map_0_SHIFT		0
1301da0436e9SJames Smart #define lpfc_fcf_record_fc_map_0_MASK		0x000000FF
1302da0436e9SJames Smart #define lpfc_fcf_record_fc_map_0_WORD		word7
1303da0436e9SJames Smart #define lpfc_fcf_record_fc_map_1_SHIFT		8
1304da0436e9SJames Smart #define lpfc_fcf_record_fc_map_1_MASK		0x000000FF
1305da0436e9SJames Smart #define lpfc_fcf_record_fc_map_1_WORD		word7
1306da0436e9SJames Smart #define lpfc_fcf_record_fc_map_2_SHIFT		16
1307da0436e9SJames Smart #define lpfc_fcf_record_fc_map_2_MASK		0x000000FF
1308da0436e9SJames Smart #define lpfc_fcf_record_fc_map_2_WORD		word7
1309da0436e9SJames Smart #define lpfc_fcf_record_fcf_valid_SHIFT		24
1310da0436e9SJames Smart #define lpfc_fcf_record_fcf_valid_MASK		0x000000FF
1311da0436e9SJames Smart #define lpfc_fcf_record_fcf_valid_WORD		word7
1312da0436e9SJames Smart 	uint32_t word8;
1313da0436e9SJames Smart #define lpfc_fcf_record_fcf_index_SHIFT		0
1314da0436e9SJames Smart #define lpfc_fcf_record_fcf_index_MASK		0x0000FFFF
1315da0436e9SJames Smart #define lpfc_fcf_record_fcf_index_WORD		word8
1316da0436e9SJames Smart #define lpfc_fcf_record_fcf_state_SHIFT		16
1317da0436e9SJames Smart #define lpfc_fcf_record_fcf_state_MASK		0x0000FFFF
1318da0436e9SJames Smart #define lpfc_fcf_record_fcf_state_WORD		word8
1319da0436e9SJames Smart 	uint8_t vlan_bitmap[512];
13208fa38513SJames Smart 	uint32_t word137;
13218fa38513SJames Smart #define lpfc_fcf_record_switch_name_0_SHIFT	0
13228fa38513SJames Smart #define lpfc_fcf_record_switch_name_0_MASK	0x000000FF
13238fa38513SJames Smart #define lpfc_fcf_record_switch_name_0_WORD	word137
13248fa38513SJames Smart #define lpfc_fcf_record_switch_name_1_SHIFT	8
13258fa38513SJames Smart #define lpfc_fcf_record_switch_name_1_MASK	0x000000FF
13268fa38513SJames Smart #define lpfc_fcf_record_switch_name_1_WORD	word137
13278fa38513SJames Smart #define lpfc_fcf_record_switch_name_2_SHIFT	16
13288fa38513SJames Smart #define lpfc_fcf_record_switch_name_2_MASK	0x000000FF
13298fa38513SJames Smart #define lpfc_fcf_record_switch_name_2_WORD	word137
13308fa38513SJames Smart #define lpfc_fcf_record_switch_name_3_SHIFT	24
13318fa38513SJames Smart #define lpfc_fcf_record_switch_name_3_MASK	0x000000FF
13328fa38513SJames Smart #define lpfc_fcf_record_switch_name_3_WORD	word137
13338fa38513SJames Smart 	uint32_t word138;
13348fa38513SJames Smart #define lpfc_fcf_record_switch_name_4_SHIFT	0
13358fa38513SJames Smart #define lpfc_fcf_record_switch_name_4_MASK	0x000000FF
13368fa38513SJames Smart #define lpfc_fcf_record_switch_name_4_WORD	word138
13378fa38513SJames Smart #define lpfc_fcf_record_switch_name_5_SHIFT	8
13388fa38513SJames Smart #define lpfc_fcf_record_switch_name_5_MASK	0x000000FF
13398fa38513SJames Smart #define lpfc_fcf_record_switch_name_5_WORD	word138
13408fa38513SJames Smart #define lpfc_fcf_record_switch_name_6_SHIFT	16
13418fa38513SJames Smart #define lpfc_fcf_record_switch_name_6_MASK	0x000000FF
13428fa38513SJames Smart #define lpfc_fcf_record_switch_name_6_WORD	word138
13438fa38513SJames Smart #define lpfc_fcf_record_switch_name_7_SHIFT	24
13448fa38513SJames Smart #define lpfc_fcf_record_switch_name_7_MASK	0x000000FF
13458fa38513SJames Smart #define lpfc_fcf_record_switch_name_7_WORD	word138
1346da0436e9SJames Smart };
1347da0436e9SJames Smart 
1348da0436e9SJames Smart struct lpfc_mbx_read_fcf_tbl {
1349da0436e9SJames Smart 	union lpfc_sli4_cfg_shdr cfg_shdr;
1350da0436e9SJames Smart 	union {
1351da0436e9SJames Smart 		struct {
1352da0436e9SJames Smart 			uint32_t word10;
1353da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_indx_SHIFT	0
1354da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_indx_MASK		0x0000FFFF
1355da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_indx_WORD		word10
1356da0436e9SJames Smart 		} request;
1357da0436e9SJames Smart 		struct {
1358da0436e9SJames Smart 			uint32_t eventag;
1359da0436e9SJames Smart 		} response;
1360da0436e9SJames Smart 	} u;
1361da0436e9SJames Smart 	uint32_t word11;
1362da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_nxt_vindx_SHIFT	0
1363da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_nxt_vindx_MASK	0x0000FFFF
1364da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_nxt_vindx_WORD	word11
1365da0436e9SJames Smart };
1366da0436e9SJames Smart 
1367da0436e9SJames Smart struct lpfc_mbx_add_fcf_tbl_entry {
1368da0436e9SJames Smart 	union lpfc_sli4_cfg_shdr cfg_shdr;
1369da0436e9SJames Smart 	uint32_t word10;
1370da0436e9SJames Smart #define lpfc_mbx_add_fcf_tbl_fcfi_SHIFT        0
1371da0436e9SJames Smart #define lpfc_mbx_add_fcf_tbl_fcfi_MASK         0x0000FFFF
1372da0436e9SJames Smart #define lpfc_mbx_add_fcf_tbl_fcfi_WORD         word10
1373da0436e9SJames Smart 	struct lpfc_mbx_sge fcf_sge;
1374da0436e9SJames Smart };
1375da0436e9SJames Smart 
1376da0436e9SJames Smart struct lpfc_mbx_del_fcf_tbl_entry {
1377da0436e9SJames Smart 	struct mbox_header header;
1378da0436e9SJames Smart 	uint32_t word10;
1379da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_count_SHIFT	0
1380da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_count_MASK		0x0000FFFF
1381da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_count_WORD		word10
1382da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_index_SHIFT	16
1383da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_index_MASK		0x0000FFFF
1384da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_index_WORD		word10
1385da0436e9SJames Smart };
1386da0436e9SJames Smart 
1387ecfd03c6SJames Smart struct lpfc_mbx_redisc_fcf_tbl {
1388ecfd03c6SJames Smart 	struct mbox_header header;
1389ecfd03c6SJames Smart 	uint32_t word10;
1390ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_count_SHIFT		0
1391ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_count_MASK		0x0000FFFF
1392ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_count_WORD		word10
1393ecfd03c6SJames Smart 	uint32_t resvd;
1394ecfd03c6SJames Smart 	uint32_t word12;
1395ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_index_SHIFT		0
1396ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_index_MASK		0x0000FFFF
1397ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_index_WORD		word12
1398ecfd03c6SJames Smart };
1399ecfd03c6SJames Smart 
14006669f9bbSJames Smart struct lpfc_mbx_query_fw_cfg {
14016669f9bbSJames Smart 	struct mbox_header header;
14026669f9bbSJames Smart 	uint32_t config_number;
14036669f9bbSJames Smart 	uint32_t asic_rev;
14046669f9bbSJames Smart 	uint32_t phys_port;
14056669f9bbSJames Smart 	uint32_t function_mode;
14066669f9bbSJames Smart /* firmware Function Mode */
14076669f9bbSJames Smart #define lpfc_function_mode_toe_SHIFT		0
14086669f9bbSJames Smart #define lpfc_function_mode_toe_MASK		0x00000001
14096669f9bbSJames Smart #define lpfc_function_mode_toe_WORD		function_mode
14106669f9bbSJames Smart #define lpfc_function_mode_nic_SHIFT		1
14116669f9bbSJames Smart #define lpfc_function_mode_nic_MASK		0x00000001
14126669f9bbSJames Smart #define lpfc_function_mode_nic_WORD		function_mode
14136669f9bbSJames Smart #define lpfc_function_mode_rdma_SHIFT		2
14146669f9bbSJames Smart #define lpfc_function_mode_rdma_MASK		0x00000001
14156669f9bbSJames Smart #define lpfc_function_mode_rdma_WORD		function_mode
14166669f9bbSJames Smart #define lpfc_function_mode_vm_SHIFT		3
14176669f9bbSJames Smart #define lpfc_function_mode_vm_MASK		0x00000001
14186669f9bbSJames Smart #define lpfc_function_mode_vm_WORD		function_mode
14196669f9bbSJames Smart #define lpfc_function_mode_iscsi_i_SHIFT	4
14206669f9bbSJames Smart #define lpfc_function_mode_iscsi_i_MASK		0x00000001
14216669f9bbSJames Smart #define lpfc_function_mode_iscsi_i_WORD		function_mode
14226669f9bbSJames Smart #define lpfc_function_mode_iscsi_t_SHIFT	5
14236669f9bbSJames Smart #define lpfc_function_mode_iscsi_t_MASK		0x00000001
14246669f9bbSJames Smart #define lpfc_function_mode_iscsi_t_WORD		function_mode
14256669f9bbSJames Smart #define lpfc_function_mode_fcoe_i_SHIFT		6
14266669f9bbSJames Smart #define lpfc_function_mode_fcoe_i_MASK		0x00000001
14276669f9bbSJames Smart #define lpfc_function_mode_fcoe_i_WORD		function_mode
14286669f9bbSJames Smart #define lpfc_function_mode_fcoe_t_SHIFT		7
14296669f9bbSJames Smart #define lpfc_function_mode_fcoe_t_MASK		0x00000001
14306669f9bbSJames Smart #define lpfc_function_mode_fcoe_t_WORD		function_mode
14316669f9bbSJames Smart #define lpfc_function_mode_dal_SHIFT		8
14326669f9bbSJames Smart #define lpfc_function_mode_dal_MASK		0x00000001
14336669f9bbSJames Smart #define lpfc_function_mode_dal_WORD		function_mode
14346669f9bbSJames Smart #define lpfc_function_mode_lro_SHIFT		9
14356669f9bbSJames Smart #define lpfc_function_mode_lro_MASK		0x00000001
143670f3c073SJames Smart #define lpfc_function_mode_lro_WORD		function_mode
14376669f9bbSJames Smart #define lpfc_function_mode_flex10_SHIFT		10
14386669f9bbSJames Smart #define lpfc_function_mode_flex10_MASK		0x00000001
14396669f9bbSJames Smart #define lpfc_function_mode_flex10_WORD		function_mode
14406669f9bbSJames Smart #define lpfc_function_mode_ncsi_SHIFT		11
14416669f9bbSJames Smart #define lpfc_function_mode_ncsi_MASK		0x00000001
14426669f9bbSJames Smart #define lpfc_function_mode_ncsi_WORD		function_mode
14436669f9bbSJames Smart };
14446669f9bbSJames Smart 
1445da0436e9SJames Smart /* Status field for embedded SLI_CONFIG mailbox command */
1446da0436e9SJames Smart #define STATUS_SUCCESS					0x0
1447da0436e9SJames Smart #define STATUS_FAILED 					0x1
1448da0436e9SJames Smart #define STATUS_ILLEGAL_REQUEST				0x2
1449da0436e9SJames Smart #define STATUS_ILLEGAL_FIELD				0x3
1450da0436e9SJames Smart #define STATUS_INSUFFICIENT_BUFFER 			0x4
1451da0436e9SJames Smart #define STATUS_UNAUTHORIZED_REQUEST			0x5
1452da0436e9SJames Smart #define STATUS_FLASHROM_SAVE_FAILED			0x17
1453da0436e9SJames Smart #define STATUS_FLASHROM_RESTORE_FAILED			0x18
1454da0436e9SJames Smart #define STATUS_ICCBINDEX_ALLOC_FAILED			0x1a
1455da0436e9SJames Smart #define STATUS_IOCTLHANDLE_ALLOC_FAILED 		0x1b
1456da0436e9SJames Smart #define STATUS_INVALID_PHY_ADDR_FROM_OSM		0x1c
1457da0436e9SJames Smart #define STATUS_INVALID_PHY_ADDR_LEN_FROM_OSM		0x1d
1458da0436e9SJames Smart #define STATUS_ASSERT_FAILED				0x1e
1459da0436e9SJames Smart #define STATUS_INVALID_SESSION				0x1f
1460da0436e9SJames Smart #define STATUS_INVALID_CONNECTION			0x20
1461da0436e9SJames Smart #define STATUS_BTL_PATH_EXCEEDS_OSM_LIMIT		0x21
1462da0436e9SJames Smart #define STATUS_BTL_NO_FREE_SLOT_PATH			0x24
1463da0436e9SJames Smart #define STATUS_BTL_NO_FREE_SLOT_TGTID			0x25
1464da0436e9SJames Smart #define STATUS_OSM_DEVSLOT_NOT_FOUND			0x26
1465da0436e9SJames Smart #define STATUS_FLASHROM_READ_FAILED			0x27
1466da0436e9SJames Smart #define STATUS_POLL_IOCTL_TIMEOUT			0x28
1467da0436e9SJames Smart #define STATUS_ERROR_ACITMAIN				0x2a
1468da0436e9SJames Smart #define STATUS_REBOOT_REQUIRED				0x2c
1469da0436e9SJames Smart #define STATUS_FCF_IN_USE				0x3a
1470def9c7a9SJames Smart #define STATUS_FCF_TABLE_EMPTY				0x43
1471da0436e9SJames Smart 
1472da0436e9SJames Smart struct lpfc_mbx_sli4_config {
1473da0436e9SJames Smart 	struct mbox_header header;
1474da0436e9SJames Smart };
1475da0436e9SJames Smart 
1476da0436e9SJames Smart struct lpfc_mbx_init_vfi {
1477da0436e9SJames Smart 	uint32_t word1;
1478da0436e9SJames Smart #define lpfc_init_vfi_vr_SHIFT		31
1479da0436e9SJames Smart #define lpfc_init_vfi_vr_MASK		0x00000001
1480da0436e9SJames Smart #define lpfc_init_vfi_vr_WORD		word1
1481da0436e9SJames Smart #define lpfc_init_vfi_vt_SHIFT		30
1482da0436e9SJames Smart #define lpfc_init_vfi_vt_MASK		0x00000001
1483da0436e9SJames Smart #define lpfc_init_vfi_vt_WORD		word1
1484da0436e9SJames Smart #define lpfc_init_vfi_vf_SHIFT		29
1485da0436e9SJames Smart #define lpfc_init_vfi_vf_MASK		0x00000001
1486da0436e9SJames Smart #define lpfc_init_vfi_vf_WORD		word1
148776a95d75SJames Smart #define lpfc_init_vfi_vp_SHIFT		28
148876a95d75SJames Smart #define lpfc_init_vfi_vp_MASK		0x00000001
148976a95d75SJames Smart #define lpfc_init_vfi_vp_WORD		word1
1490da0436e9SJames Smart #define lpfc_init_vfi_vfi_SHIFT		0
1491da0436e9SJames Smart #define lpfc_init_vfi_vfi_MASK		0x0000FFFF
1492da0436e9SJames Smart #define lpfc_init_vfi_vfi_WORD		word1
1493da0436e9SJames Smart 	uint32_t word2;
149476a95d75SJames Smart #define lpfc_init_vfi_vpi_SHIFT		16
149576a95d75SJames Smart #define lpfc_init_vfi_vpi_MASK		0x0000FFFF
149676a95d75SJames Smart #define lpfc_init_vfi_vpi_WORD		word2
1497da0436e9SJames Smart #define lpfc_init_vfi_fcfi_SHIFT	0
1498da0436e9SJames Smart #define lpfc_init_vfi_fcfi_MASK		0x0000FFFF
1499da0436e9SJames Smart #define lpfc_init_vfi_fcfi_WORD		word2
1500da0436e9SJames Smart 	uint32_t word3;
1501da0436e9SJames Smart #define lpfc_init_vfi_pri_SHIFT		13
1502da0436e9SJames Smart #define lpfc_init_vfi_pri_MASK		0x00000007
1503da0436e9SJames Smart #define lpfc_init_vfi_pri_WORD		word3
1504da0436e9SJames Smart #define lpfc_init_vfi_vf_id_SHIFT	1
1505da0436e9SJames Smart #define lpfc_init_vfi_vf_id_MASK	0x00000FFF
1506da0436e9SJames Smart #define lpfc_init_vfi_vf_id_WORD	word3
1507da0436e9SJames Smart 	uint32_t word4;
1508da0436e9SJames Smart #define lpfc_init_vfi_hop_count_SHIFT	24
1509da0436e9SJames Smart #define lpfc_init_vfi_hop_count_MASK	0x000000FF
1510da0436e9SJames Smart #define lpfc_init_vfi_hop_count_WORD	word4
1511da0436e9SJames Smart };
1512da0436e9SJames Smart 
1513da0436e9SJames Smart struct lpfc_mbx_reg_vfi {
1514da0436e9SJames Smart 	uint32_t word1;
1515da0436e9SJames Smart #define lpfc_reg_vfi_vp_SHIFT		28
1516da0436e9SJames Smart #define lpfc_reg_vfi_vp_MASK		0x00000001
1517da0436e9SJames Smart #define lpfc_reg_vfi_vp_WORD		word1
1518da0436e9SJames Smart #define lpfc_reg_vfi_vfi_SHIFT		0
1519da0436e9SJames Smart #define lpfc_reg_vfi_vfi_MASK		0x0000FFFF
1520da0436e9SJames Smart #define lpfc_reg_vfi_vfi_WORD		word1
1521da0436e9SJames Smart 	uint32_t word2;
1522da0436e9SJames Smart #define lpfc_reg_vfi_vpi_SHIFT		16
1523da0436e9SJames Smart #define lpfc_reg_vfi_vpi_MASK		0x0000FFFF
1524da0436e9SJames Smart #define lpfc_reg_vfi_vpi_WORD		word2
1525da0436e9SJames Smart #define lpfc_reg_vfi_fcfi_SHIFT		0
1526da0436e9SJames Smart #define lpfc_reg_vfi_fcfi_MASK		0x0000FFFF
1527da0436e9SJames Smart #define lpfc_reg_vfi_fcfi_WORD		word2
1528c868595dSJames Smart 	uint32_t wwn[2];
1529da0436e9SJames Smart 	struct ulp_bde64 bde;
1530b19a061aSJames Smart 	uint32_t e_d_tov;
1531b19a061aSJames Smart 	uint32_t r_a_tov;
1532da0436e9SJames Smart 	uint32_t word10;
1533da0436e9SJames Smart #define lpfc_reg_vfi_nport_id_SHIFT		0
1534da0436e9SJames Smart #define lpfc_reg_vfi_nport_id_MASK		0x00FFFFFF
1535da0436e9SJames Smart #define lpfc_reg_vfi_nport_id_WORD		word10
1536da0436e9SJames Smart };
1537da0436e9SJames Smart 
1538da0436e9SJames Smart struct lpfc_mbx_init_vpi {
1539da0436e9SJames Smart 	uint32_t word1;
1540da0436e9SJames Smart #define lpfc_init_vpi_vfi_SHIFT		16
1541da0436e9SJames Smart #define lpfc_init_vpi_vfi_MASK		0x0000FFFF
1542da0436e9SJames Smart #define lpfc_init_vpi_vfi_WORD		word1
1543da0436e9SJames Smart #define lpfc_init_vpi_vpi_SHIFT		0
1544da0436e9SJames Smart #define lpfc_init_vpi_vpi_MASK		0x0000FFFF
1545da0436e9SJames Smart #define lpfc_init_vpi_vpi_WORD		word1
1546da0436e9SJames Smart };
1547da0436e9SJames Smart 
1548da0436e9SJames Smart struct lpfc_mbx_read_vpi {
1549da0436e9SJames Smart 	uint32_t word1_rsvd;
1550da0436e9SJames Smart 	uint32_t word2;
1551da0436e9SJames Smart #define lpfc_mbx_read_vpi_vnportid_SHIFT	0
1552da0436e9SJames Smart #define lpfc_mbx_read_vpi_vnportid_MASK		0x00FFFFFF
1553da0436e9SJames Smart #define lpfc_mbx_read_vpi_vnportid_WORD		word2
1554da0436e9SJames Smart 	uint32_t word3_rsvd;
1555da0436e9SJames Smart 	uint32_t word4;
1556da0436e9SJames Smart #define lpfc_mbx_read_vpi_acq_alpa_SHIFT	0
1557da0436e9SJames Smart #define lpfc_mbx_read_vpi_acq_alpa_MASK		0x000000FF
1558da0436e9SJames Smart #define lpfc_mbx_read_vpi_acq_alpa_WORD		word4
1559da0436e9SJames Smart #define lpfc_mbx_read_vpi_pb_SHIFT		15
1560da0436e9SJames Smart #define lpfc_mbx_read_vpi_pb_MASK		0x00000001
1561da0436e9SJames Smart #define lpfc_mbx_read_vpi_pb_WORD		word4
1562da0436e9SJames Smart #define lpfc_mbx_read_vpi_spec_alpa_SHIFT	16
1563da0436e9SJames Smart #define lpfc_mbx_read_vpi_spec_alpa_MASK	0x000000FF
1564da0436e9SJames Smart #define lpfc_mbx_read_vpi_spec_alpa_WORD	word4
1565da0436e9SJames Smart #define lpfc_mbx_read_vpi_ns_SHIFT		30
1566da0436e9SJames Smart #define lpfc_mbx_read_vpi_ns_MASK		0x00000001
1567da0436e9SJames Smart #define lpfc_mbx_read_vpi_ns_WORD		word4
1568da0436e9SJames Smart #define lpfc_mbx_read_vpi_hl_SHIFT		31
1569da0436e9SJames Smart #define lpfc_mbx_read_vpi_hl_MASK		0x00000001
1570da0436e9SJames Smart #define lpfc_mbx_read_vpi_hl_WORD		word4
1571da0436e9SJames Smart 	uint32_t word5_rsvd;
1572da0436e9SJames Smart 	uint32_t word6;
1573da0436e9SJames Smart #define lpfc_mbx_read_vpi_vpi_SHIFT		0
1574da0436e9SJames Smart #define lpfc_mbx_read_vpi_vpi_MASK		0x0000FFFF
1575da0436e9SJames Smart #define lpfc_mbx_read_vpi_vpi_WORD		word6
1576da0436e9SJames Smart 	uint32_t word7;
1577da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_0_SHIFT		0
1578da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_0_MASK		0x000000FF
1579da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_0_WORD		word7
1580da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_1_SHIFT		8
1581da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_1_MASK		0x000000FF
1582da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_1_WORD		word7
1583da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_2_SHIFT		16
1584da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_2_MASK		0x000000FF
1585da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_2_WORD		word7
1586da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_3_SHIFT		24
1587da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_3_MASK		0x000000FF
1588da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_3_WORD		word7
1589da0436e9SJames Smart 	uint32_t word8;
1590da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_4_SHIFT		0
1591da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_4_MASK		0x000000FF
1592da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_4_WORD		word8
1593da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_5_SHIFT		8
1594da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_5_MASK		0x000000FF
1595da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_5_WORD		word8
1596da0436e9SJames Smart #define lpfc_mbx_read_vpi_vlan_tag_SHIFT	16
1597da0436e9SJames Smart #define lpfc_mbx_read_vpi_vlan_tag_MASK		0x00000FFF
1598da0436e9SJames Smart #define lpfc_mbx_read_vpi_vlan_tag_WORD		word8
1599da0436e9SJames Smart #define lpfc_mbx_read_vpi_vv_SHIFT		28
1600da0436e9SJames Smart #define lpfc_mbx_read_vpi_vv_MASK		0x0000001
1601da0436e9SJames Smart #define lpfc_mbx_read_vpi_vv_WORD		word8
1602da0436e9SJames Smart };
1603da0436e9SJames Smart 
1604da0436e9SJames Smart struct lpfc_mbx_unreg_vfi {
1605da0436e9SJames Smart 	uint32_t word1_rsvd;
1606da0436e9SJames Smart 	uint32_t word2;
1607da0436e9SJames Smart #define lpfc_unreg_vfi_vfi_SHIFT	0
1608da0436e9SJames Smart #define lpfc_unreg_vfi_vfi_MASK		0x0000FFFF
1609da0436e9SJames Smart #define lpfc_unreg_vfi_vfi_WORD		word2
1610da0436e9SJames Smart };
1611da0436e9SJames Smart 
1612da0436e9SJames Smart struct lpfc_mbx_resume_rpi {
1613da0436e9SJames Smart 	uint32_t word1;
16148fa38513SJames Smart #define lpfc_resume_rpi_index_SHIFT	0
16158fa38513SJames Smart #define lpfc_resume_rpi_index_MASK	0x0000FFFF
16168fa38513SJames Smart #define lpfc_resume_rpi_index_WORD	word1
16178fa38513SJames Smart #define lpfc_resume_rpi_ii_SHIFT	30
16188fa38513SJames Smart #define lpfc_resume_rpi_ii_MASK		0x00000003
16198fa38513SJames Smart #define lpfc_resume_rpi_ii_WORD		word1
16208fa38513SJames Smart #define RESUME_INDEX_RPI		0
16218fa38513SJames Smart #define RESUME_INDEX_VPI		1
16228fa38513SJames Smart #define RESUME_INDEX_VFI		2
16238fa38513SJames Smart #define RESUME_INDEX_FCFI		3
1624da0436e9SJames Smart 	uint32_t event_tag;
1625da0436e9SJames Smart };
1626da0436e9SJames Smart 
1627da0436e9SJames Smart #define REG_FCF_INVALID_QID	0xFFFF
1628da0436e9SJames Smart struct lpfc_mbx_reg_fcfi {
1629da0436e9SJames Smart 	uint32_t word1;
1630da0436e9SJames Smart #define lpfc_reg_fcfi_info_index_SHIFT	0
1631da0436e9SJames Smart #define lpfc_reg_fcfi_info_index_MASK	0x0000FFFF
1632da0436e9SJames Smart #define lpfc_reg_fcfi_info_index_WORD	word1
1633da0436e9SJames Smart #define lpfc_reg_fcfi_fcfi_SHIFT	16
1634da0436e9SJames Smart #define lpfc_reg_fcfi_fcfi_MASK		0x0000FFFF
1635da0436e9SJames Smart #define lpfc_reg_fcfi_fcfi_WORD		word1
1636da0436e9SJames Smart 	uint32_t word2;
1637da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id1_SHIFT	0
1638da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id1_MASK	0x0000FFFF
1639da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id1_WORD	word2
1640da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id0_SHIFT	16
1641da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id0_MASK	0x0000FFFF
1642da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id0_WORD	word2
1643da0436e9SJames Smart 	uint32_t word3;
1644da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id3_SHIFT	0
1645da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id3_MASK	0x0000FFFF
1646da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id3_WORD	word3
1647da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id2_SHIFT	16
1648da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id2_MASK	0x0000FFFF
1649da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id2_WORD	word3
1650da0436e9SJames Smart 	uint32_t word4;
1651da0436e9SJames Smart #define lpfc_reg_fcfi_type_match0_SHIFT	24
1652da0436e9SJames Smart #define lpfc_reg_fcfi_type_match0_MASK	0x000000FF
1653da0436e9SJames Smart #define lpfc_reg_fcfi_type_match0_WORD	word4
1654da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask0_SHIFT	16
1655da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask0_MASK	0x000000FF
1656da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask0_WORD	word4
1657da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match0_SHIFT	8
1658da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match0_MASK	0x000000FF
1659da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match0_WORD	word4
1660da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask0_SHIFT	0
1661da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask0_MASK	0x000000FF
1662da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask0_WORD	word4
1663da0436e9SJames Smart 	uint32_t word5;
1664da0436e9SJames Smart #define lpfc_reg_fcfi_type_match1_SHIFT	24
1665da0436e9SJames Smart #define lpfc_reg_fcfi_type_match1_MASK	0x000000FF
1666da0436e9SJames Smart #define lpfc_reg_fcfi_type_match1_WORD	word5
1667da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask1_SHIFT	16
1668da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask1_MASK	0x000000FF
1669da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask1_WORD	word5
1670da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match1_SHIFT	8
1671da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match1_MASK	0x000000FF
1672da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match1_WORD	word5
1673da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask1_SHIFT	0
1674da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask1_MASK	0x000000FF
1675da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask1_WORD	word5
1676da0436e9SJames Smart 	uint32_t word6;
1677da0436e9SJames Smart #define lpfc_reg_fcfi_type_match2_SHIFT	24
1678da0436e9SJames Smart #define lpfc_reg_fcfi_type_match2_MASK	0x000000FF
1679da0436e9SJames Smart #define lpfc_reg_fcfi_type_match2_WORD	word6
1680da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask2_SHIFT	16
1681da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask2_MASK	0x000000FF
1682da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask2_WORD	word6
1683da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match2_SHIFT	8
1684da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match2_MASK	0x000000FF
1685da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match2_WORD	word6
1686da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask2_SHIFT	0
1687da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask2_MASK	0x000000FF
1688da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask2_WORD	word6
1689da0436e9SJames Smart 	uint32_t word7;
1690da0436e9SJames Smart #define lpfc_reg_fcfi_type_match3_SHIFT	24
1691da0436e9SJames Smart #define lpfc_reg_fcfi_type_match3_MASK	0x000000FF
1692da0436e9SJames Smart #define lpfc_reg_fcfi_type_match3_WORD	word7
1693da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask3_SHIFT	16
1694da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask3_MASK	0x000000FF
1695da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask3_WORD	word7
1696da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match3_SHIFT	8
1697da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match3_MASK	0x000000FF
1698da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match3_WORD	word7
1699da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask3_SHIFT	0
1700da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask3_MASK	0x000000FF
1701da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask3_WORD	word7
1702da0436e9SJames Smart 	uint32_t word8;
1703da0436e9SJames Smart #define lpfc_reg_fcfi_mam_SHIFT		13
1704da0436e9SJames Smart #define lpfc_reg_fcfi_mam_MASK		0x00000003
1705da0436e9SJames Smart #define lpfc_reg_fcfi_mam_WORD		word8
1706da0436e9SJames Smart #define LPFC_MAM_BOTH		0	/* Both SPMA and FPMA */
1707da0436e9SJames Smart #define LPFC_MAM_SPMA		1	/* Server Provided MAC Address */
1708da0436e9SJames Smart #define LPFC_MAM_FPMA		2	/* Fabric Provided MAC Address */
1709da0436e9SJames Smart #define lpfc_reg_fcfi_vv_SHIFT		12
1710da0436e9SJames Smart #define lpfc_reg_fcfi_vv_MASK		0x00000001
1711da0436e9SJames Smart #define lpfc_reg_fcfi_vv_WORD		word8
1712da0436e9SJames Smart #define lpfc_reg_fcfi_vlan_tag_SHIFT	0
1713da0436e9SJames Smart #define lpfc_reg_fcfi_vlan_tag_MASK	0x00000FFF
1714da0436e9SJames Smart #define lpfc_reg_fcfi_vlan_tag_WORD	word8
1715da0436e9SJames Smart };
1716da0436e9SJames Smart 
1717da0436e9SJames Smart struct lpfc_mbx_unreg_fcfi {
1718da0436e9SJames Smart 	uint32_t word1_rsv;
1719da0436e9SJames Smart 	uint32_t word2;
1720da0436e9SJames Smart #define lpfc_unreg_fcfi_SHIFT		0
1721da0436e9SJames Smart #define lpfc_unreg_fcfi_MASK		0x0000FFFF
1722da0436e9SJames Smart #define lpfc_unreg_fcfi_WORD		word2
1723da0436e9SJames Smart };
1724da0436e9SJames Smart 
1725da0436e9SJames Smart struct lpfc_mbx_read_rev {
1726da0436e9SJames Smart 	uint32_t word1;
1727da0436e9SJames Smart #define lpfc_mbx_rd_rev_sli_lvl_SHIFT  		16
1728da0436e9SJames Smart #define lpfc_mbx_rd_rev_sli_lvl_MASK   		0x0000000F
1729da0436e9SJames Smart #define lpfc_mbx_rd_rev_sli_lvl_WORD   		word1
1730da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcoe_SHIFT		20
1731da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcoe_MASK		0x00000001
1732da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcoe_WORD		word1
173345ed1190SJames Smart #define lpfc_mbx_rd_rev_cee_ver_SHIFT		21
173445ed1190SJames Smart #define lpfc_mbx_rd_rev_cee_ver_MASK		0x00000003
173545ed1190SJames Smart #define lpfc_mbx_rd_rev_cee_ver_WORD		word1
173645ed1190SJames Smart #define LPFC_PREDCBX_CEE_MODE	0
173745ed1190SJames Smart #define LPFC_DCBX_CEE_MODE	1
1738da0436e9SJames Smart #define lpfc_mbx_rd_rev_vpd_SHIFT		29
1739da0436e9SJames Smart #define lpfc_mbx_rd_rev_vpd_MASK		0x00000001
1740da0436e9SJames Smart #define lpfc_mbx_rd_rev_vpd_WORD		word1
1741da0436e9SJames Smart 	uint32_t first_hw_rev;
1742da0436e9SJames Smart 	uint32_t second_hw_rev;
1743da0436e9SJames Smart 	uint32_t word4_rsvd;
1744da0436e9SJames Smart 	uint32_t third_hw_rev;
1745da0436e9SJames Smart 	uint32_t word6;
1746da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_low_SHIFT		0
1747da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_low_MASK		0x000000FF
1748da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_low_WORD		word6
1749da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_high_SHIFT		8
1750da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_high_MASK		0x000000FF
1751da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_high_WORD		word6
1752da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_low_SHIFT	16
1753da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_low_MASK	0x000000FF
1754da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_low_WORD	word6
1755da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_high_SHIFT	24
1756da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_high_MASK	0x000000FF
1757da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_high_WORD	word6
1758da0436e9SJames Smart 	uint32_t word7_rsvd;
1759da0436e9SJames Smart 	uint32_t fw_id_rev;
1760da0436e9SJames Smart 	uint8_t  fw_name[16];
1761da0436e9SJames Smart 	uint32_t ulp_fw_id_rev;
1762da0436e9SJames Smart 	uint8_t  ulp_fw_name[16];
1763da0436e9SJames Smart 	uint32_t word18_47_rsvd[30];
1764da0436e9SJames Smart 	uint32_t word48;
1765da0436e9SJames Smart #define lpfc_mbx_rd_rev_avail_len_SHIFT		0
1766da0436e9SJames Smart #define lpfc_mbx_rd_rev_avail_len_MASK		0x00FFFFFF
1767da0436e9SJames Smart #define lpfc_mbx_rd_rev_avail_len_WORD		word48
1768da0436e9SJames Smart 	uint32_t vpd_paddr_low;
1769da0436e9SJames Smart 	uint32_t vpd_paddr_high;
1770da0436e9SJames Smart 	uint32_t avail_vpd_len;
1771da0436e9SJames Smart 	uint32_t rsvd_52_63[12];
1772da0436e9SJames Smart };
1773da0436e9SJames Smart 
1774da0436e9SJames Smart struct lpfc_mbx_read_config {
1775da0436e9SJames Smart 	uint32_t word1;
1776da0436e9SJames Smart #define lpfc_mbx_rd_conf_max_bbc_SHIFT		0
1777da0436e9SJames Smart #define lpfc_mbx_rd_conf_max_bbc_MASK		0x000000FF
1778da0436e9SJames Smart #define lpfc_mbx_rd_conf_max_bbc_WORD		word1
1779da0436e9SJames Smart #define lpfc_mbx_rd_conf_init_bbc_SHIFT		8
1780da0436e9SJames Smart #define lpfc_mbx_rd_conf_init_bbc_MASK		0x000000FF
1781da0436e9SJames Smart #define lpfc_mbx_rd_conf_init_bbc_WORD		word1
1782da0436e9SJames Smart 	uint32_t word2;
1783da0436e9SJames Smart #define lpfc_mbx_rd_conf_nport_did_SHIFT	0
1784da0436e9SJames Smart #define lpfc_mbx_rd_conf_nport_did_MASK		0x00FFFFFF
1785da0436e9SJames Smart #define lpfc_mbx_rd_conf_nport_did_WORD		word2
1786da0436e9SJames Smart #define lpfc_mbx_rd_conf_topology_SHIFT		24
1787da0436e9SJames Smart #define lpfc_mbx_rd_conf_topology_MASK		0x000000FF
1788da0436e9SJames Smart #define lpfc_mbx_rd_conf_topology_WORD		word2
1789da0436e9SJames Smart 	uint32_t word3;
1790da0436e9SJames Smart #define lpfc_mbx_rd_conf_ao_SHIFT		0
1791da0436e9SJames Smart #define lpfc_mbx_rd_conf_ao_MASK		0x00000001
1792da0436e9SJames Smart #define lpfc_mbx_rd_conf_ao_WORD		word3
1793da0436e9SJames Smart #define lpfc_mbx_rd_conf_bb_scn_SHIFT		8
1794da0436e9SJames Smart #define lpfc_mbx_rd_conf_bb_scn_MASK		0x0000000F
1795da0436e9SJames Smart #define lpfc_mbx_rd_conf_bb_scn_WORD		word3
1796da0436e9SJames Smart #define lpfc_mbx_rd_conf_cbb_scn_SHIFT		12
1797da0436e9SJames Smart #define lpfc_mbx_rd_conf_cbb_scn_MASK		0x0000000F
1798da0436e9SJames Smart #define lpfc_mbx_rd_conf_cbb_scn_WORD		word3
1799da0436e9SJames Smart #define lpfc_mbx_rd_conf_mc_SHIFT		29
1800da0436e9SJames Smart #define lpfc_mbx_rd_conf_mc_MASK		0x00000001
1801da0436e9SJames Smart #define lpfc_mbx_rd_conf_mc_WORD		word3
1802da0436e9SJames Smart 	uint32_t word4;
1803da0436e9SJames Smart #define lpfc_mbx_rd_conf_e_d_tov_SHIFT		0
1804da0436e9SJames Smart #define lpfc_mbx_rd_conf_e_d_tov_MASK		0x0000FFFF
1805da0436e9SJames Smart #define lpfc_mbx_rd_conf_e_d_tov_WORD		word4
1806da0436e9SJames Smart 	uint32_t word5;
1807da0436e9SJames Smart #define lpfc_mbx_rd_conf_lp_tov_SHIFT		0
1808da0436e9SJames Smart #define lpfc_mbx_rd_conf_lp_tov_MASK		0x0000FFFF
1809da0436e9SJames Smart #define lpfc_mbx_rd_conf_lp_tov_WORD		word5
1810da0436e9SJames Smart 	uint32_t word6;
1811da0436e9SJames Smart #define lpfc_mbx_rd_conf_r_a_tov_SHIFT		0
1812da0436e9SJames Smart #define lpfc_mbx_rd_conf_r_a_tov_MASK		0x0000FFFF
1813da0436e9SJames Smart #define lpfc_mbx_rd_conf_r_a_tov_WORD		word6
1814da0436e9SJames Smart 	uint32_t word7;
1815da0436e9SJames Smart #define lpfc_mbx_rd_conf_r_t_tov_SHIFT		0
1816da0436e9SJames Smart #define lpfc_mbx_rd_conf_r_t_tov_MASK		0x000000FF
1817da0436e9SJames Smart #define lpfc_mbx_rd_conf_r_t_tov_WORD		word7
1818da0436e9SJames Smart 	uint32_t word8;
1819da0436e9SJames Smart #define lpfc_mbx_rd_conf_al_tov_SHIFT		0
1820da0436e9SJames Smart #define lpfc_mbx_rd_conf_al_tov_MASK		0x0000000F
1821da0436e9SJames Smart #define lpfc_mbx_rd_conf_al_tov_WORD		word8
1822da0436e9SJames Smart 	uint32_t word9;
1823da0436e9SJames Smart #define lpfc_mbx_rd_conf_lmt_SHIFT		0
1824da0436e9SJames Smart #define lpfc_mbx_rd_conf_lmt_MASK		0x0000FFFF
1825da0436e9SJames Smart #define lpfc_mbx_rd_conf_lmt_WORD		word9
1826da0436e9SJames Smart 	uint32_t word10;
1827da0436e9SJames Smart #define lpfc_mbx_rd_conf_max_alpa_SHIFT		0
1828da0436e9SJames Smart #define lpfc_mbx_rd_conf_max_alpa_MASK		0x000000FF
1829da0436e9SJames Smart #define lpfc_mbx_rd_conf_max_alpa_WORD		word10
1830da0436e9SJames Smart 	uint32_t word11_rsvd;
1831da0436e9SJames Smart 	uint32_t word12;
1832da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_base_SHIFT		0
1833da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_base_MASK		0x0000FFFF
1834da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_base_WORD		word12
1835da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_count_SHIFT	16
1836da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_count_MASK		0x0000FFFF
1837da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_count_WORD		word12
1838da0436e9SJames Smart 	uint32_t word13;
1839da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_base_SHIFT		0
1840da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_base_MASK		0x0000FFFF
1841da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_base_WORD		word13
1842da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_count_SHIFT	16
1843da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_count_MASK		0x0000FFFF
1844da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_count_WORD		word13
1845da0436e9SJames Smart 	uint32_t word14;
1846da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_base_SHIFT		0
1847da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_base_MASK		0x0000FFFF
1848da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_base_WORD		word14
1849da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_count_SHIFT	16
1850da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_count_MASK		0x0000FFFF
1851da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_count_WORD		word14
1852da0436e9SJames Smart 	uint32_t word15;
1853da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_base_SHIFT         0
1854da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_base_MASK          0x0000FFFF
1855da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_base_WORD          word15
1856da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_count_SHIFT        16
1857da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_count_MASK         0x0000FFFF
1858da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_count_WORD         word15
1859da0436e9SJames Smart 	uint32_t word16;
1860da0436e9SJames Smart #define lpfc_mbx_rd_conf_fcfi_base_SHIFT	0
1861da0436e9SJames Smart #define lpfc_mbx_rd_conf_fcfi_base_MASK		0x0000FFFF
1862da0436e9SJames Smart #define lpfc_mbx_rd_conf_fcfi_base_WORD		word16
1863da0436e9SJames Smart #define lpfc_mbx_rd_conf_fcfi_count_SHIFT	16
1864da0436e9SJames Smart #define lpfc_mbx_rd_conf_fcfi_count_MASK	0x0000FFFF
1865da0436e9SJames Smart #define lpfc_mbx_rd_conf_fcfi_count_WORD	word16
1866da0436e9SJames Smart 	uint32_t word17;
1867da0436e9SJames Smart #define lpfc_mbx_rd_conf_rq_count_SHIFT		0
1868da0436e9SJames Smart #define lpfc_mbx_rd_conf_rq_count_MASK		0x0000FFFF
1869da0436e9SJames Smart #define lpfc_mbx_rd_conf_rq_count_WORD		word17
1870da0436e9SJames Smart #define lpfc_mbx_rd_conf_eq_count_SHIFT		16
1871da0436e9SJames Smart #define lpfc_mbx_rd_conf_eq_count_MASK		0x0000FFFF
1872da0436e9SJames Smart #define lpfc_mbx_rd_conf_eq_count_WORD		word17
1873da0436e9SJames Smart 	uint32_t word18;
1874da0436e9SJames Smart #define lpfc_mbx_rd_conf_wq_count_SHIFT		0
1875da0436e9SJames Smart #define lpfc_mbx_rd_conf_wq_count_MASK		0x0000FFFF
1876da0436e9SJames Smart #define lpfc_mbx_rd_conf_wq_count_WORD		word18
1877da0436e9SJames Smart #define lpfc_mbx_rd_conf_cq_count_SHIFT		16
1878da0436e9SJames Smart #define lpfc_mbx_rd_conf_cq_count_MASK		0x0000FFFF
1879da0436e9SJames Smart #define lpfc_mbx_rd_conf_cq_count_WORD		word18
1880da0436e9SJames Smart };
1881da0436e9SJames Smart 
1882da0436e9SJames Smart struct lpfc_mbx_request_features {
1883da0436e9SJames Smart 	uint32_t word1;
1884da0436e9SJames Smart #define lpfc_mbx_rq_ftr_qry_SHIFT		0
1885da0436e9SJames Smart #define lpfc_mbx_rq_ftr_qry_MASK		0x00000001
1886da0436e9SJames Smart #define lpfc_mbx_rq_ftr_qry_WORD		word1
1887da0436e9SJames Smart 	uint32_t word2;
1888da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_iaab_SHIFT		0
1889da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_iaab_MASK		0x00000001
1890da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_iaab_WORD		word2
1891da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_npiv_SHIFT		1
1892da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_npiv_MASK		0x00000001
1893da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_npiv_WORD		word2
1894da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_dif_SHIFT		2
1895da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_dif_MASK		0x00000001
1896da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_dif_WORD		word2
1897da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_vf_SHIFT		3
1898da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_vf_MASK		0x00000001
1899da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_vf_WORD		word2
1900da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpi_SHIFT		4
1901da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpi_MASK		0x00000001
1902da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpi_WORD		word2
1903da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpt_SHIFT		5
1904da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpt_MASK		0x00000001
1905da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpt_WORD		word2
1906da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpc_SHIFT		6
1907da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpc_MASK		0x00000001
1908da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpc_WORD		word2
1909da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_ifip_SHIFT		7
1910da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_ifip_MASK		0x00000001
1911da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_ifip_WORD		word2
1912fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rq_perfh_SHIFT		11
1913fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rq_perfh_MASK		0x00000001
1914fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rq_perfh_WORD		word2
1915da0436e9SJames Smart 	uint32_t word3;
1916da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_iaab_SHIFT		0
1917da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_iaab_MASK		0x00000001
1918da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_iaab_WORD		word3
1919da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_npiv_SHIFT		1
1920da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_npiv_MASK		0x00000001
1921da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_npiv_WORD		word3
1922da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_dif_SHIFT		2
1923da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_dif_MASK		0x00000001
1924da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_dif_WORD		word3
1925da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_vf_SHIFT		3
1926da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_vf__MASK		0x00000001
1927da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_vf_WORD		word3
1928da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpi_SHIFT		4
1929da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpi_MASK		0x00000001
1930da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpi_WORD		word3
1931da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpt_SHIFT		5
1932da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpt_MASK		0x00000001
1933da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpt_WORD		word3
1934da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpc_SHIFT		6
1935da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpc_MASK		0x00000001
1936da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpc_WORD		word3
1937da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_ifip_SHIFT		7
1938da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_ifip_MASK		0x00000001
1939da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_ifip_WORD		word3
1940fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rsp_perfh_SHIFT		11
1941fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rsp_perfh_MASK		0x00000001
1942fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rsp_perfh_WORD		word3
1943da0436e9SJames Smart };
1944da0436e9SJames Smart 
194528baac74SJames Smart struct lpfc_mbx_supp_pages {
194628baac74SJames Smart 	uint32_t word1;
194728baac74SJames Smart #define qs_SHIFT 				0
194828baac74SJames Smart #define qs_MASK					0x00000001
194928baac74SJames Smart #define qs_WORD					word1
195028baac74SJames Smart #define wr_SHIFT				1
195128baac74SJames Smart #define wr_MASK 				0x00000001
195228baac74SJames Smart #define wr_WORD					word1
195328baac74SJames Smart #define pf_SHIFT				8
195428baac74SJames Smart #define pf_MASK					0x000000ff
195528baac74SJames Smart #define pf_WORD					word1
195628baac74SJames Smart #define cpn_SHIFT				16
195728baac74SJames Smart #define cpn_MASK				0x000000ff
195828baac74SJames Smart #define cpn_WORD				word1
195928baac74SJames Smart 	uint32_t word2;
196028baac74SJames Smart #define list_offset_SHIFT 			0
196128baac74SJames Smart #define list_offset_MASK			0x000000ff
196228baac74SJames Smart #define list_offset_WORD			word2
196328baac74SJames Smart #define next_offset_SHIFT			8
196428baac74SJames Smart #define next_offset_MASK			0x000000ff
196528baac74SJames Smart #define next_offset_WORD			word2
196628baac74SJames Smart #define elem_cnt_SHIFT				16
196728baac74SJames Smart #define elem_cnt_MASK				0x000000ff
196828baac74SJames Smart #define elem_cnt_WORD				word2
196928baac74SJames Smart 	uint32_t word3;
197028baac74SJames Smart #define pn_0_SHIFT				24
197128baac74SJames Smart #define pn_0_MASK  				0x000000ff
197228baac74SJames Smart #define pn_0_WORD				word3
197328baac74SJames Smart #define pn_1_SHIFT				16
197428baac74SJames Smart #define pn_1_MASK				0x000000ff
197528baac74SJames Smart #define pn_1_WORD				word3
197628baac74SJames Smart #define pn_2_SHIFT				8
197728baac74SJames Smart #define pn_2_MASK				0x000000ff
197828baac74SJames Smart #define pn_2_WORD				word3
197928baac74SJames Smart #define pn_3_SHIFT				0
198028baac74SJames Smart #define pn_3_MASK				0x000000ff
198128baac74SJames Smart #define pn_3_WORD				word3
198228baac74SJames Smart 	uint32_t word4;
198328baac74SJames Smart #define pn_4_SHIFT				24
198428baac74SJames Smart #define pn_4_MASK				0x000000ff
198528baac74SJames Smart #define pn_4_WORD				word4
198628baac74SJames Smart #define pn_5_SHIFT				16
198728baac74SJames Smart #define pn_5_MASK				0x000000ff
198828baac74SJames Smart #define pn_5_WORD				word4
198928baac74SJames Smart #define pn_6_SHIFT				8
199028baac74SJames Smart #define pn_6_MASK				0x000000ff
199128baac74SJames Smart #define pn_6_WORD				word4
199228baac74SJames Smart #define pn_7_SHIFT				0
199328baac74SJames Smart #define pn_7_MASK				0x000000ff
199428baac74SJames Smart #define pn_7_WORD				word4
199528baac74SJames Smart 	uint32_t rsvd[27];
199628baac74SJames Smart #define LPFC_SUPP_PAGES			0
199728baac74SJames Smart #define LPFC_BLOCK_GUARD_PROFILES	1
199828baac74SJames Smart #define LPFC_SLI4_PARAMETERS		2
199928baac74SJames Smart };
200028baac74SJames Smart 
2001fedd3b7bSJames Smart struct lpfc_mbx_pc_sli4_params {
200228baac74SJames Smart 	uint32_t word1;
200328baac74SJames Smart #define qs_SHIFT				0
200428baac74SJames Smart #define qs_MASK					0x00000001
200528baac74SJames Smart #define qs_WORD					word1
200628baac74SJames Smart #define wr_SHIFT				1
200728baac74SJames Smart #define wr_MASK					0x00000001
200828baac74SJames Smart #define wr_WORD					word1
200928baac74SJames Smart #define pf_SHIFT				8
201028baac74SJames Smart #define pf_MASK					0x000000ff
201128baac74SJames Smart #define pf_WORD					word1
201228baac74SJames Smart #define cpn_SHIFT				16
201328baac74SJames Smart #define cpn_MASK				0x000000ff
201428baac74SJames Smart #define cpn_WORD				word1
201528baac74SJames Smart 	uint32_t word2;
201628baac74SJames Smart #define if_type_SHIFT				0
201728baac74SJames Smart #define if_type_MASK				0x00000007
201828baac74SJames Smart #define if_type_WORD				word2
201928baac74SJames Smart #define sli_rev_SHIFT				4
202028baac74SJames Smart #define sli_rev_MASK				0x0000000f
202128baac74SJames Smart #define sli_rev_WORD				word2
202228baac74SJames Smart #define sli_family_SHIFT			8
202328baac74SJames Smart #define sli_family_MASK				0x000000ff
202428baac74SJames Smart #define sli_family_WORD				word2
202528baac74SJames Smart #define featurelevel_1_SHIFT			16
202628baac74SJames Smart #define featurelevel_1_MASK			0x000000ff
202728baac74SJames Smart #define featurelevel_1_WORD			word2
202828baac74SJames Smart #define featurelevel_2_SHIFT			24
202928baac74SJames Smart #define featurelevel_2_MASK			0x0000001f
203028baac74SJames Smart #define featurelevel_2_WORD			word2
203128baac74SJames Smart 	uint32_t word3;
203228baac74SJames Smart #define fcoe_SHIFT 				0
203328baac74SJames Smart #define fcoe_MASK				0x00000001
203428baac74SJames Smart #define fcoe_WORD				word3
203528baac74SJames Smart #define fc_SHIFT				1
203628baac74SJames Smart #define fc_MASK					0x00000001
203728baac74SJames Smart #define fc_WORD					word3
203828baac74SJames Smart #define nic_SHIFT				2
203928baac74SJames Smart #define nic_MASK				0x00000001
204028baac74SJames Smart #define nic_WORD				word3
204128baac74SJames Smart #define iscsi_SHIFT				3
204228baac74SJames Smart #define iscsi_MASK				0x00000001
204328baac74SJames Smart #define iscsi_WORD				word3
204428baac74SJames Smart #define rdma_SHIFT				4
204528baac74SJames Smart #define rdma_MASK				0x00000001
204628baac74SJames Smart #define rdma_WORD				word3
204728baac74SJames Smart 	uint32_t sge_supp_len;
2048cb5172eaSJames Smart #define SLI4_PAGE_SIZE 4096
204928baac74SJames Smart 	uint32_t word5;
205028baac74SJames Smart #define if_page_sz_SHIFT			0
205128baac74SJames Smart #define if_page_sz_MASK				0x0000ffff
205228baac74SJames Smart #define if_page_sz_WORD				word5
205328baac74SJames Smart #define loopbk_scope_SHIFT			24
205428baac74SJames Smart #define loopbk_scope_MASK			0x0000000f
205528baac74SJames Smart #define loopbk_scope_WORD			word5
205628baac74SJames Smart #define rq_db_window_SHIFT			28
205728baac74SJames Smart #define rq_db_window_MASK			0x0000000f
205828baac74SJames Smart #define rq_db_window_WORD			word5
205928baac74SJames Smart 	uint32_t word6;
206028baac74SJames Smart #define eq_pages_SHIFT				0
206128baac74SJames Smart #define eq_pages_MASK				0x0000000f
206228baac74SJames Smart #define eq_pages_WORD				word6
206328baac74SJames Smart #define eqe_size_SHIFT				8
206428baac74SJames Smart #define eqe_size_MASK				0x000000ff
206528baac74SJames Smart #define eqe_size_WORD				word6
206628baac74SJames Smart 	uint32_t word7;
206728baac74SJames Smart #define cq_pages_SHIFT				0
206828baac74SJames Smart #define cq_pages_MASK				0x0000000f
206928baac74SJames Smart #define cq_pages_WORD				word7
207028baac74SJames Smart #define cqe_size_SHIFT				8
207128baac74SJames Smart #define cqe_size_MASK				0x000000ff
207228baac74SJames Smart #define cqe_size_WORD				word7
207328baac74SJames Smart 	uint32_t word8;
207428baac74SJames Smart #define mq_pages_SHIFT				0
207528baac74SJames Smart #define mq_pages_MASK				0x0000000f
207628baac74SJames Smart #define mq_pages_WORD				word8
207728baac74SJames Smart #define mqe_size_SHIFT				8
207828baac74SJames Smart #define mqe_size_MASK				0x000000ff
207928baac74SJames Smart #define mqe_size_WORD				word8
208028baac74SJames Smart #define mq_elem_cnt_SHIFT			16
208128baac74SJames Smart #define mq_elem_cnt_MASK			0x000000ff
208228baac74SJames Smart #define mq_elem_cnt_WORD			word8
208328baac74SJames Smart 	uint32_t word9;
208428baac74SJames Smart #define wq_pages_SHIFT				0
208528baac74SJames Smart #define wq_pages_MASK				0x0000ffff
208628baac74SJames Smart #define wq_pages_WORD				word9
208728baac74SJames Smart #define wqe_size_SHIFT				8
208828baac74SJames Smart #define wqe_size_MASK				0x000000ff
208928baac74SJames Smart #define wqe_size_WORD				word9
209028baac74SJames Smart 	uint32_t word10;
209128baac74SJames Smart #define rq_pages_SHIFT				0
209228baac74SJames Smart #define rq_pages_MASK				0x0000ffff
209328baac74SJames Smart #define rq_pages_WORD				word10
209428baac74SJames Smart #define rqe_size_SHIFT				8
209528baac74SJames Smart #define rqe_size_MASK				0x000000ff
209628baac74SJames Smart #define rqe_size_WORD				word10
209728baac74SJames Smart 	uint32_t word11;
209828baac74SJames Smart #define hdr_pages_SHIFT				0
209928baac74SJames Smart #define hdr_pages_MASK				0x0000000f
210028baac74SJames Smart #define hdr_pages_WORD				word11
210128baac74SJames Smart #define hdr_size_SHIFT				8
210228baac74SJames Smart #define hdr_size_MASK				0x0000000f
210328baac74SJames Smart #define hdr_size_WORD				word11
210428baac74SJames Smart #define hdr_pp_align_SHIFT			16
210528baac74SJames Smart #define hdr_pp_align_MASK			0x0000ffff
210628baac74SJames Smart #define hdr_pp_align_WORD			word11
210728baac74SJames Smart 	uint32_t word12;
210828baac74SJames Smart #define sgl_pages_SHIFT				0
210928baac74SJames Smart #define sgl_pages_MASK				0x0000000f
211028baac74SJames Smart #define sgl_pages_WORD				word12
211128baac74SJames Smart #define sgl_pp_align_SHIFT			16
211228baac74SJames Smart #define sgl_pp_align_MASK			0x0000ffff
211328baac74SJames Smart #define sgl_pp_align_WORD			word12
211428baac74SJames Smart 	uint32_t rsvd_13_63[51];
211528baac74SJames Smart };
21169589b062SJames Smart #define SLI4_PAGE_ALIGN(addr) (((addr)+((SLI4_PAGE_SIZE)-1)) \
21179589b062SJames Smart 			       &(~((SLI4_PAGE_SIZE)-1)))
211828baac74SJames Smart 
2119fedd3b7bSJames Smart struct lpfc_sli4_parameters {
2120fedd3b7bSJames Smart 	uint32_t word0;
2121fedd3b7bSJames Smart #define cfg_prot_type_SHIFT			0
2122fedd3b7bSJames Smart #define cfg_prot_type_MASK			0x000000FF
2123fedd3b7bSJames Smart #define cfg_prot_type_WORD			word0
2124fedd3b7bSJames Smart 	uint32_t word1;
2125fedd3b7bSJames Smart #define cfg_ft_SHIFT				0
2126fedd3b7bSJames Smart #define cfg_ft_MASK				0x00000001
2127fedd3b7bSJames Smart #define cfg_ft_WORD				word1
2128fedd3b7bSJames Smart #define cfg_sli_rev_SHIFT			4
2129fedd3b7bSJames Smart #define cfg_sli_rev_MASK			0x0000000f
2130fedd3b7bSJames Smart #define cfg_sli_rev_WORD			word1
2131fedd3b7bSJames Smart #define cfg_sli_family_SHIFT			8
2132fedd3b7bSJames Smart #define cfg_sli_family_MASK			0x0000000f
2133fedd3b7bSJames Smart #define cfg_sli_family_WORD			word1
2134fedd3b7bSJames Smart #define cfg_if_type_SHIFT			12
2135fedd3b7bSJames Smart #define cfg_if_type_MASK			0x0000000f
2136fedd3b7bSJames Smart #define cfg_if_type_WORD			word1
2137fedd3b7bSJames Smart #define cfg_sli_hint_1_SHIFT			16
2138fedd3b7bSJames Smart #define cfg_sli_hint_1_MASK			0x000000ff
2139fedd3b7bSJames Smart #define cfg_sli_hint_1_WORD			word1
2140fedd3b7bSJames Smart #define cfg_sli_hint_2_SHIFT			24
2141fedd3b7bSJames Smart #define cfg_sli_hint_2_MASK			0x0000001f
2142fedd3b7bSJames Smart #define cfg_sli_hint_2_WORD			word1
2143fedd3b7bSJames Smart 	uint32_t word2;
2144fedd3b7bSJames Smart 	uint32_t word3;
2145fedd3b7bSJames Smart 	uint32_t word4;
2146fedd3b7bSJames Smart #define cfg_cqv_SHIFT				14
2147fedd3b7bSJames Smart #define cfg_cqv_MASK				0x00000003
2148fedd3b7bSJames Smart #define cfg_cqv_WORD				word4
2149fedd3b7bSJames Smart 	uint32_t word5;
2150fedd3b7bSJames Smart 	uint32_t word6;
2151fedd3b7bSJames Smart #define cfg_mqv_SHIFT				14
2152fedd3b7bSJames Smart #define cfg_mqv_MASK				0x00000003
2153fedd3b7bSJames Smart #define cfg_mqv_WORD				word6
2154fedd3b7bSJames Smart 	uint32_t word7;
2155fedd3b7bSJames Smart 	uint32_t word8;
2156fedd3b7bSJames Smart #define cfg_wqv_SHIFT				14
2157fedd3b7bSJames Smart #define cfg_wqv_MASK				0x00000003
2158fedd3b7bSJames Smart #define cfg_wqv_WORD				word8
2159fedd3b7bSJames Smart 	uint32_t word9;
2160fedd3b7bSJames Smart 	uint32_t word10;
2161fedd3b7bSJames Smart #define cfg_rqv_SHIFT				14
2162fedd3b7bSJames Smart #define cfg_rqv_MASK				0x00000003
2163fedd3b7bSJames Smart #define cfg_rqv_WORD				word10
2164fedd3b7bSJames Smart 	uint32_t word11;
2165fedd3b7bSJames Smart #define cfg_rq_db_window_SHIFT			28
2166fedd3b7bSJames Smart #define cfg_rq_db_window_MASK			0x0000000f
2167fedd3b7bSJames Smart #define cfg_rq_db_window_WORD			word11
2168fedd3b7bSJames Smart 	uint32_t word12;
2169fedd3b7bSJames Smart #define cfg_fcoe_SHIFT				0
2170fedd3b7bSJames Smart #define cfg_fcoe_MASK				0x00000001
2171fedd3b7bSJames Smart #define cfg_fcoe_WORD				word12
2172fedd3b7bSJames Smart #define cfg_phwq_SHIFT				15
2173fedd3b7bSJames Smart #define cfg_phwq_MASK				0x00000001
2174fedd3b7bSJames Smart #define cfg_phwq_WORD				word12
2175fedd3b7bSJames Smart #define cfg_loopbk_scope_SHIFT			28
2176fedd3b7bSJames Smart #define cfg_loopbk_scope_MASK			0x0000000f
2177fedd3b7bSJames Smart #define cfg_loopbk_scope_WORD			word12
2178fedd3b7bSJames Smart 	uint32_t sge_supp_len;
2179fedd3b7bSJames Smart 	uint32_t word14;
2180fedd3b7bSJames Smart #define cfg_sgl_page_cnt_SHIFT			0
2181fedd3b7bSJames Smart #define cfg_sgl_page_cnt_MASK			0x0000000f
2182fedd3b7bSJames Smart #define cfg_sgl_page_cnt_WORD			word14
2183fedd3b7bSJames Smart #define cfg_sgl_page_size_SHIFT			8
2184fedd3b7bSJames Smart #define cfg_sgl_page_size_MASK			0x000000ff
2185fedd3b7bSJames Smart #define cfg_sgl_page_size_WORD			word14
2186fedd3b7bSJames Smart #define cfg_sgl_pp_align_SHIFT			16
2187fedd3b7bSJames Smart #define cfg_sgl_pp_align_MASK			0x000000ff
2188fedd3b7bSJames Smart #define cfg_sgl_pp_align_WORD			word14
2189fedd3b7bSJames Smart 	uint32_t word15;
2190fedd3b7bSJames Smart 	uint32_t word16;
2191fedd3b7bSJames Smart 	uint32_t word17;
2192fedd3b7bSJames Smart 	uint32_t word18;
2193fedd3b7bSJames Smart 	uint32_t word19;
2194fedd3b7bSJames Smart };
2195fedd3b7bSJames Smart 
2196fedd3b7bSJames Smart struct lpfc_mbx_get_sli4_parameters {
2197fedd3b7bSJames Smart 	struct mbox_header header;
2198fedd3b7bSJames Smart 	struct lpfc_sli4_parameters sli4_parameters;
2199fedd3b7bSJames Smart };
2200fedd3b7bSJames Smart 
2201da0436e9SJames Smart /* Mailbox Completion Queue Error Messages */
2202da0436e9SJames Smart #define MB_CQE_STATUS_SUCCESS 			0x0
2203da0436e9SJames Smart #define MB_CQE_STATUS_INSUFFICIENT_PRIVILEGES	0x1
2204da0436e9SJames Smart #define MB_CQE_STATUS_INVALID_PARAMETER		0x2
2205da0436e9SJames Smart #define MB_CQE_STATUS_INSUFFICIENT_RESOURCES	0x3
2206da0436e9SJames Smart #define MB_CEQ_STATUS_QUEUE_FLUSHING		0x4
2207da0436e9SJames Smart #define MB_CQE_STATUS_DMA_FAILED		0x5
2208da0436e9SJames Smart 
2209da0436e9SJames Smart /* mailbox queue entry structure */
2210da0436e9SJames Smart struct lpfc_mqe {
2211da0436e9SJames Smart 	uint32_t word0;
2212da0436e9SJames Smart #define lpfc_mqe_status_SHIFT		16
2213da0436e9SJames Smart #define lpfc_mqe_status_MASK		0x0000FFFF
2214da0436e9SJames Smart #define lpfc_mqe_status_WORD		word0
2215da0436e9SJames Smart #define lpfc_mqe_command_SHIFT		8
2216da0436e9SJames Smart #define lpfc_mqe_command_MASK		0x000000FF
2217da0436e9SJames Smart #define lpfc_mqe_command_WORD		word0
2218da0436e9SJames Smart 	union {
2219da0436e9SJames Smart 		uint32_t mb_words[LPFC_SLI4_MB_WORD_COUNT - 1];
2220da0436e9SJames Smart 		/* sli4 mailbox commands */
2221da0436e9SJames Smart 		struct lpfc_mbx_sli4_config sli4_config;
2222da0436e9SJames Smart 		struct lpfc_mbx_init_vfi init_vfi;
2223da0436e9SJames Smart 		struct lpfc_mbx_reg_vfi reg_vfi;
2224da0436e9SJames Smart 		struct lpfc_mbx_reg_vfi unreg_vfi;
2225da0436e9SJames Smart 		struct lpfc_mbx_init_vpi init_vpi;
2226da0436e9SJames Smart 		struct lpfc_mbx_resume_rpi resume_rpi;
2227da0436e9SJames Smart 		struct lpfc_mbx_read_fcf_tbl read_fcf_tbl;
2228da0436e9SJames Smart 		struct lpfc_mbx_add_fcf_tbl_entry add_fcf_entry;
2229da0436e9SJames Smart 		struct lpfc_mbx_del_fcf_tbl_entry del_fcf_entry;
2230ecfd03c6SJames Smart 		struct lpfc_mbx_redisc_fcf_tbl redisc_fcf_tbl;
2231da0436e9SJames Smart 		struct lpfc_mbx_reg_fcfi reg_fcfi;
2232da0436e9SJames Smart 		struct lpfc_mbx_unreg_fcfi unreg_fcfi;
2233da0436e9SJames Smart 		struct lpfc_mbx_mq_create mq_create;
2234b19a061aSJames Smart 		struct lpfc_mbx_mq_create_ext mq_create_ext;
2235da0436e9SJames Smart 		struct lpfc_mbx_eq_create eq_create;
2236da0436e9SJames Smart 		struct lpfc_mbx_cq_create cq_create;
2237da0436e9SJames Smart 		struct lpfc_mbx_wq_create wq_create;
2238da0436e9SJames Smart 		struct lpfc_mbx_rq_create rq_create;
2239da0436e9SJames Smart 		struct lpfc_mbx_mq_destroy mq_destroy;
2240da0436e9SJames Smart 		struct lpfc_mbx_eq_destroy eq_destroy;
2241da0436e9SJames Smart 		struct lpfc_mbx_cq_destroy cq_destroy;
2242da0436e9SJames Smart 		struct lpfc_mbx_wq_destroy wq_destroy;
2243da0436e9SJames Smart 		struct lpfc_mbx_rq_destroy rq_destroy;
2244da0436e9SJames Smart 		struct lpfc_mbx_post_sgl_pages post_sgl_pages;
2245da0436e9SJames Smart 		struct lpfc_mbx_nembed_cmd nembed_cmd;
2246da0436e9SJames Smart 		struct lpfc_mbx_read_rev read_rev;
2247da0436e9SJames Smart 		struct lpfc_mbx_read_vpi read_vpi;
2248da0436e9SJames Smart 		struct lpfc_mbx_read_config rd_config;
2249da0436e9SJames Smart 		struct lpfc_mbx_request_features req_ftrs;
2250da0436e9SJames Smart 		struct lpfc_mbx_post_hdr_tmpl hdr_tmpl;
22516669f9bbSJames Smart 		struct lpfc_mbx_query_fw_cfg query_fw_cfg;
225228baac74SJames Smart 		struct lpfc_mbx_supp_pages supp_pages;
2253fedd3b7bSJames Smart 		struct lpfc_mbx_pc_sli4_params sli4_params;
2254fedd3b7bSJames Smart 		struct lpfc_mbx_get_sli4_parameters get_sli4_parameters;
2255da0436e9SJames Smart 		struct lpfc_mbx_nop nop;
2256da0436e9SJames Smart 	} un;
2257da0436e9SJames Smart };
2258da0436e9SJames Smart 
2259da0436e9SJames Smart struct lpfc_mcqe {
2260da0436e9SJames Smart 	uint32_t word0;
2261da0436e9SJames Smart #define lpfc_mcqe_status_SHIFT		0
2262da0436e9SJames Smart #define lpfc_mcqe_status_MASK		0x0000FFFF
2263da0436e9SJames Smart #define lpfc_mcqe_status_WORD		word0
2264da0436e9SJames Smart #define lpfc_mcqe_ext_status_SHIFT	16
2265da0436e9SJames Smart #define lpfc_mcqe_ext_status_MASK  	0x0000FFFF
2266da0436e9SJames Smart #define lpfc_mcqe_ext_status_WORD 	word0
2267da0436e9SJames Smart 	uint32_t mcqe_tag0;
2268da0436e9SJames Smart 	uint32_t mcqe_tag1;
2269da0436e9SJames Smart 	uint32_t trailer;
2270da0436e9SJames Smart #define lpfc_trailer_valid_SHIFT	31
2271da0436e9SJames Smart #define lpfc_trailer_valid_MASK		0x00000001
2272da0436e9SJames Smart #define lpfc_trailer_valid_WORD		trailer
2273da0436e9SJames Smart #define lpfc_trailer_async_SHIFT	30
2274da0436e9SJames Smart #define lpfc_trailer_async_MASK		0x00000001
2275da0436e9SJames Smart #define lpfc_trailer_async_WORD		trailer
2276da0436e9SJames Smart #define lpfc_trailer_hpi_SHIFT		29
2277da0436e9SJames Smart #define lpfc_trailer_hpi_MASK		0x00000001
2278da0436e9SJames Smart #define lpfc_trailer_hpi_WORD		trailer
2279da0436e9SJames Smart #define lpfc_trailer_completed_SHIFT	28
2280da0436e9SJames Smart #define lpfc_trailer_completed_MASK	0x00000001
2281da0436e9SJames Smart #define lpfc_trailer_completed_WORD	trailer
2282da0436e9SJames Smart #define lpfc_trailer_consumed_SHIFT	27
2283da0436e9SJames Smart #define lpfc_trailer_consumed_MASK	0x00000001
2284da0436e9SJames Smart #define lpfc_trailer_consumed_WORD	trailer
2285da0436e9SJames Smart #define lpfc_trailer_type_SHIFT		16
2286da0436e9SJames Smart #define lpfc_trailer_type_MASK		0x000000FF
2287da0436e9SJames Smart #define lpfc_trailer_type_WORD		trailer
2288da0436e9SJames Smart #define lpfc_trailer_code_SHIFT		8
2289da0436e9SJames Smart #define lpfc_trailer_code_MASK		0x000000FF
2290da0436e9SJames Smart #define lpfc_trailer_code_WORD		trailer
2291da0436e9SJames Smart #define LPFC_TRAILER_CODE_LINK	0x1
2292da0436e9SJames Smart #define LPFC_TRAILER_CODE_FCOE	0x2
2293da0436e9SJames Smart #define LPFC_TRAILER_CODE_DCBX	0x3
2294b19a061aSJames Smart #define LPFC_TRAILER_CODE_GRP5	0x5
229576a95d75SJames Smart #define LPFC_TRAILER_CODE_FC	0x10
229670f3c073SJames Smart #define LPFC_TRAILER_CODE_SLI	0x11
2297da0436e9SJames Smart };
2298da0436e9SJames Smart 
2299da0436e9SJames Smart struct lpfc_acqe_link {
2300da0436e9SJames Smart 	uint32_t word0;
2301da0436e9SJames Smart #define lpfc_acqe_link_speed_SHIFT		24
2302da0436e9SJames Smart #define lpfc_acqe_link_speed_MASK		0x000000FF
2303da0436e9SJames Smart #define lpfc_acqe_link_speed_WORD		word0
2304da0436e9SJames Smart #define LPFC_ASYNC_LINK_SPEED_ZERO		0x0
2305da0436e9SJames Smart #define LPFC_ASYNC_LINK_SPEED_10MBPS		0x1
2306da0436e9SJames Smart #define LPFC_ASYNC_LINK_SPEED_100MBPS		0x2
2307da0436e9SJames Smart #define LPFC_ASYNC_LINK_SPEED_1GBPS		0x3
2308da0436e9SJames Smart #define LPFC_ASYNC_LINK_SPEED_10GBPS		0x4
2309da0436e9SJames Smart #define lpfc_acqe_link_duplex_SHIFT		16
2310da0436e9SJames Smart #define lpfc_acqe_link_duplex_MASK		0x000000FF
2311da0436e9SJames Smart #define lpfc_acqe_link_duplex_WORD		word0
2312da0436e9SJames Smart #define LPFC_ASYNC_LINK_DUPLEX_NONE		0x0
2313da0436e9SJames Smart #define LPFC_ASYNC_LINK_DUPLEX_HALF		0x1
2314da0436e9SJames Smart #define LPFC_ASYNC_LINK_DUPLEX_FULL		0x2
2315da0436e9SJames Smart #define lpfc_acqe_link_status_SHIFT		8
2316da0436e9SJames Smart #define lpfc_acqe_link_status_MASK		0x000000FF
2317da0436e9SJames Smart #define lpfc_acqe_link_status_WORD		word0
2318da0436e9SJames Smart #define LPFC_ASYNC_LINK_STATUS_DOWN		0x0
2319da0436e9SJames Smart #define LPFC_ASYNC_LINK_STATUS_UP		0x1
2320da0436e9SJames Smart #define LPFC_ASYNC_LINK_STATUS_LOGICAL_DOWN	0x2
2321da0436e9SJames Smart #define LPFC_ASYNC_LINK_STATUS_LOGICAL_UP	0x3
232270f3c073SJames Smart #define lpfc_acqe_link_type_SHIFT		6
232370f3c073SJames Smart #define lpfc_acqe_link_type_MASK		0x00000003
232470f3c073SJames Smart #define lpfc_acqe_link_type_WORD		word0
232570f3c073SJames Smart #define lpfc_acqe_link_number_SHIFT		0
232670f3c073SJames Smart #define lpfc_acqe_link_number_MASK		0x0000003F
232770f3c073SJames Smart #define lpfc_acqe_link_number_WORD		word0
2328da0436e9SJames Smart 	uint32_t word1;
2329da0436e9SJames Smart #define lpfc_acqe_link_fault_SHIFT	0
2330da0436e9SJames Smart #define lpfc_acqe_link_fault_MASK	0x000000FF
2331da0436e9SJames Smart #define lpfc_acqe_link_fault_WORD	word1
2332da0436e9SJames Smart #define LPFC_ASYNC_LINK_FAULT_NONE	0x0
2333da0436e9SJames Smart #define LPFC_ASYNC_LINK_FAULT_LOCAL	0x1
2334da0436e9SJames Smart #define LPFC_ASYNC_LINK_FAULT_REMOTE	0x2
233570f3c073SJames Smart #define lpfc_acqe_logical_link_speed_SHIFT	16
233670f3c073SJames Smart #define lpfc_acqe_logical_link_speed_MASK	0x0000FFFF
233770f3c073SJames Smart #define lpfc_acqe_logical_link_speed_WORD	word1
2338da0436e9SJames Smart 	uint32_t event_tag;
2339da0436e9SJames Smart 	uint32_t trailer;
234070f3c073SJames Smart #define LPFC_LINK_EVENT_TYPE_PHYSICAL	0x0
234170f3c073SJames Smart #define LPFC_LINK_EVENT_TYPE_VIRTUAL	0x1
2342da0436e9SJames Smart };
2343da0436e9SJames Smart 
234470f3c073SJames Smart struct lpfc_acqe_fip {
23456669f9bbSJames Smart 	uint32_t index;
2346da0436e9SJames Smart 	uint32_t word1;
234770f3c073SJames Smart #define lpfc_acqe_fip_fcf_count_SHIFT		0
234870f3c073SJames Smart #define lpfc_acqe_fip_fcf_count_MASK		0x0000FFFF
234970f3c073SJames Smart #define lpfc_acqe_fip_fcf_count_WORD		word1
235070f3c073SJames Smart #define lpfc_acqe_fip_event_type_SHIFT		16
235170f3c073SJames Smart #define lpfc_acqe_fip_event_type_MASK		0x0000FFFF
235270f3c073SJames Smart #define lpfc_acqe_fip_event_type_WORD		word1
2353da0436e9SJames Smart 	uint32_t event_tag;
2354da0436e9SJames Smart 	uint32_t trailer;
235570f3c073SJames Smart #define LPFC_FIP_EVENT_TYPE_NEW_FCF		0x1
235670f3c073SJames Smart #define LPFC_FIP_EVENT_TYPE_FCF_TABLE_FULL	0x2
235770f3c073SJames Smart #define LPFC_FIP_EVENT_TYPE_FCF_DEAD		0x3
235870f3c073SJames Smart #define LPFC_FIP_EVENT_TYPE_CVL			0x4
235970f3c073SJames Smart #define LPFC_FIP_EVENT_TYPE_FCF_PARAM_MOD	0x5
2360da0436e9SJames Smart };
2361da0436e9SJames Smart 
2362da0436e9SJames Smart struct lpfc_acqe_dcbx {
2363da0436e9SJames Smart 	uint32_t tlv_ttl;
2364da0436e9SJames Smart 	uint32_t reserved;
2365da0436e9SJames Smart 	uint32_t event_tag;
2366da0436e9SJames Smart 	uint32_t trailer;
2367da0436e9SJames Smart };
2368da0436e9SJames Smart 
2369b19a061aSJames Smart struct lpfc_acqe_grp5 {
2370b19a061aSJames Smart 	uint32_t word0;
237170f3c073SJames Smart #define lpfc_acqe_grp5_type_SHIFT		6
237270f3c073SJames Smart #define lpfc_acqe_grp5_type_MASK		0x00000003
237370f3c073SJames Smart #define lpfc_acqe_grp5_type_WORD		word0
237470f3c073SJames Smart #define lpfc_acqe_grp5_number_SHIFT		0
237570f3c073SJames Smart #define lpfc_acqe_grp5_number_MASK		0x0000003F
237670f3c073SJames Smart #define lpfc_acqe_grp5_number_WORD		word0
2377b19a061aSJames Smart 	uint32_t word1;
2378b19a061aSJames Smart #define lpfc_acqe_grp5_llink_spd_SHIFT	16
2379b19a061aSJames Smart #define lpfc_acqe_grp5_llink_spd_MASK	0x0000FFFF
2380b19a061aSJames Smart #define lpfc_acqe_grp5_llink_spd_WORD	word1
2381b19a061aSJames Smart 	uint32_t event_tag;
2382b19a061aSJames Smart 	uint32_t trailer;
2383b19a061aSJames Smart };
2384b19a061aSJames Smart 
238570f3c073SJames Smart struct lpfc_acqe_fc_la {
238670f3c073SJames Smart 	uint32_t word0;
238770f3c073SJames Smart #define lpfc_acqe_fc_la_speed_SHIFT		24
238870f3c073SJames Smart #define lpfc_acqe_fc_la_speed_MASK		0x000000FF
238970f3c073SJames Smart #define lpfc_acqe_fc_la_speed_WORD		word0
239070f3c073SJames Smart #define LPFC_FC_LA_SPEED_UNKOWN		0x0
239170f3c073SJames Smart #define LPFC_FC_LA_SPEED_1G		0x1
239270f3c073SJames Smart #define LPFC_FC_LA_SPEED_2G		0x2
239370f3c073SJames Smart #define LPFC_FC_LA_SPEED_4G		0x4
239470f3c073SJames Smart #define LPFC_FC_LA_SPEED_8G		0x8
239570f3c073SJames Smart #define LPFC_FC_LA_SPEED_10G		0xA
239670f3c073SJames Smart #define LPFC_FC_LA_SPEED_16G		0x10
239770f3c073SJames Smart #define lpfc_acqe_fc_la_topology_SHIFT		16
239870f3c073SJames Smart #define lpfc_acqe_fc_la_topology_MASK		0x000000FF
239970f3c073SJames Smart #define lpfc_acqe_fc_la_topology_WORD		word0
240070f3c073SJames Smart #define LPFC_FC_LA_TOP_UNKOWN		0x0
240170f3c073SJames Smart #define LPFC_FC_LA_TOP_P2P		0x1
240270f3c073SJames Smart #define LPFC_FC_LA_TOP_FCAL		0x2
240370f3c073SJames Smart #define LPFC_FC_LA_TOP_INTERNAL_LOOP	0x3
240470f3c073SJames Smart #define LPFC_FC_LA_TOP_SERDES_LOOP	0x4
240570f3c073SJames Smart #define lpfc_acqe_fc_la_att_type_SHIFT		8
240670f3c073SJames Smart #define lpfc_acqe_fc_la_att_type_MASK		0x000000FF
240770f3c073SJames Smart #define lpfc_acqe_fc_la_att_type_WORD		word0
240870f3c073SJames Smart #define LPFC_FC_LA_TYPE_LINK_UP		0x1
240970f3c073SJames Smart #define LPFC_FC_LA_TYPE_LINK_DOWN	0x2
241070f3c073SJames Smart #define LPFC_FC_LA_TYPE_NO_HARD_ALPA	0x3
241170f3c073SJames Smart #define lpfc_acqe_fc_la_port_type_SHIFT		6
241270f3c073SJames Smart #define lpfc_acqe_fc_la_port_type_MASK		0x00000003
241370f3c073SJames Smart #define lpfc_acqe_fc_la_port_type_WORD		word0
241470f3c073SJames Smart #define LPFC_LINK_TYPE_ETHERNET		0x0
241570f3c073SJames Smart #define LPFC_LINK_TYPE_FC		0x1
241670f3c073SJames Smart #define lpfc_acqe_fc_la_port_number_SHIFT	0
241770f3c073SJames Smart #define lpfc_acqe_fc_la_port_number_MASK	0x0000003F
241870f3c073SJames Smart #define lpfc_acqe_fc_la_port_number_WORD	word0
241970f3c073SJames Smart 	uint32_t word1;
242070f3c073SJames Smart #define lpfc_acqe_fc_la_llink_spd_SHIFT		16
242170f3c073SJames Smart #define lpfc_acqe_fc_la_llink_spd_MASK		0x0000FFFF
242270f3c073SJames Smart #define lpfc_acqe_fc_la_llink_spd_WORD		word1
242370f3c073SJames Smart #define lpfc_acqe_fc_la_fault_SHIFT		0
242470f3c073SJames Smart #define lpfc_acqe_fc_la_fault_MASK		0x000000FF
242570f3c073SJames Smart #define lpfc_acqe_fc_la_fault_WORD		word1
242670f3c073SJames Smart #define LPFC_FC_LA_FAULT_NONE		0x0
242770f3c073SJames Smart #define LPFC_FC_LA_FAULT_LOCAL		0x1
242870f3c073SJames Smart #define LPFC_FC_LA_FAULT_REMOTE		0x2
242970f3c073SJames Smart 	uint32_t event_tag;
243070f3c073SJames Smart 	uint32_t trailer;
243170f3c073SJames Smart #define LPFC_FC_LA_EVENT_TYPE_FC_LINK		0x1
243270f3c073SJames Smart #define LPFC_FC_LA_EVENT_TYPE_SHARED_LINK	0x2
243370f3c073SJames Smart };
243470f3c073SJames Smart 
243570f3c073SJames Smart struct lpfc_acqe_sli {
243670f3c073SJames Smart 	uint32_t event_data1;
243770f3c073SJames Smart 	uint32_t event_data2;
243870f3c073SJames Smart 	uint32_t reserved;
243970f3c073SJames Smart 	uint32_t trailer;
244070f3c073SJames Smart #define LPFC_SLI_EVENT_TYPE_PORT_ERROR		0x1
244170f3c073SJames Smart #define LPFC_SLI_EVENT_TYPE_OVER_TEMP		0x2
244270f3c073SJames Smart #define LPFC_SLI_EVENT_TYPE_NORM_TEMP		0x3
244370f3c073SJames Smart #define LPFC_SLI_EVENT_TYPE_NVLOG_POST		0x4
244470f3c073SJames Smart #define LPFC_SLI_EVENT_TYPE_DIAG_DUMP		0x5
244570f3c073SJames Smart };
244670f3c073SJames Smart 
2447da0436e9SJames Smart /*
2448da0436e9SJames Smart  * Define the bootstrap mailbox (bmbx) region used to communicate
2449da0436e9SJames Smart  * mailbox command between the host and port. The mailbox consists
2450da0436e9SJames Smart  * of a payload area of 256 bytes and a completion queue of length
2451da0436e9SJames Smart  * 16 bytes.
2452da0436e9SJames Smart  */
2453da0436e9SJames Smart struct lpfc_bmbx_create {
2454da0436e9SJames Smart 	struct lpfc_mqe mqe;
2455da0436e9SJames Smart 	struct lpfc_mcqe mcqe;
2456da0436e9SJames Smart };
2457da0436e9SJames Smart 
2458da0436e9SJames Smart #define SGL_ALIGN_SZ 64
2459da0436e9SJames Smart #define SGL_PAGE_SIZE 4096
2460da0436e9SJames Smart /* align SGL addr on a size boundary - adjust address up */
2461da0436e9SJames Smart #define NO_XRI  ((uint16_t)-1)
24625ffc266eSJames Smart 
2463da0436e9SJames Smart struct wqe_common {
2464da0436e9SJames Smart 	uint32_t word6;
24656669f9bbSJames Smart #define wqe_xri_tag_SHIFT     0
24666669f9bbSJames Smart #define wqe_xri_tag_MASK      0x0000FFFF
24676669f9bbSJames Smart #define wqe_xri_tag_WORD      word6
2468da0436e9SJames Smart #define wqe_ctxt_tag_SHIFT    16
2469da0436e9SJames Smart #define wqe_ctxt_tag_MASK     0x0000FFFF
2470da0436e9SJames Smart #define wqe_ctxt_tag_WORD     word6
2471da0436e9SJames Smart 	uint32_t word7;
2472da0436e9SJames Smart #define wqe_ct_SHIFT          2
2473da0436e9SJames Smart #define wqe_ct_MASK           0x00000003
2474da0436e9SJames Smart #define wqe_ct_WORD           word7
2475da0436e9SJames Smart #define wqe_status_SHIFT      4
2476da0436e9SJames Smart #define wqe_status_MASK       0x0000000f
2477da0436e9SJames Smart #define wqe_status_WORD       word7
2478da0436e9SJames Smart #define wqe_cmnd_SHIFT        8
2479da0436e9SJames Smart #define wqe_cmnd_MASK         0x000000ff
2480da0436e9SJames Smart #define wqe_cmnd_WORD         word7
2481da0436e9SJames Smart #define wqe_class_SHIFT       16
2482da0436e9SJames Smart #define wqe_class_MASK        0x00000007
2483da0436e9SJames Smart #define wqe_class_WORD        word7
2484da0436e9SJames Smart #define wqe_pu_SHIFT          20
2485da0436e9SJames Smart #define wqe_pu_MASK           0x00000003
2486da0436e9SJames Smart #define wqe_pu_WORD           word7
2487da0436e9SJames Smart #define wqe_erp_SHIFT         22
2488da0436e9SJames Smart #define wqe_erp_MASK          0x00000001
2489da0436e9SJames Smart #define wqe_erp_WORD          word7
2490da0436e9SJames Smart #define wqe_lnk_SHIFT         23
2491da0436e9SJames Smart #define wqe_lnk_MASK          0x00000001
2492da0436e9SJames Smart #define wqe_lnk_WORD          word7
2493da0436e9SJames Smart #define wqe_tmo_SHIFT         24
2494da0436e9SJames Smart #define wqe_tmo_MASK          0x000000ff
2495da0436e9SJames Smart #define wqe_tmo_WORD          word7
2496da0436e9SJames Smart 	uint32_t abort_tag; /* word 8 in WQE */
2497da0436e9SJames Smart 	uint32_t word9;
2498da0436e9SJames Smart #define wqe_reqtag_SHIFT      0
2499da0436e9SJames Smart #define wqe_reqtag_MASK       0x0000FFFF
2500da0436e9SJames Smart #define wqe_reqtag_WORD       word9
2501*c31098ceSJames Smart #define wqe_temp_rpi_SHIFT    16
2502*c31098ceSJames Smart #define wqe_temp_rpi_MASK     0x0000FFFF
2503*c31098ceSJames Smart #define wqe_temp_rpi_WORD     word9
2504da0436e9SJames Smart #define wqe_rcvoxid_SHIFT     16
2505da0436e9SJames Smart #define wqe_rcvoxid_MASK      0x0000FFFF
2506da0436e9SJames Smart #define wqe_rcvoxid_WORD      word9
2507da0436e9SJames Smart 	uint32_t word10;
2508f0d9bcccSJames Smart #define wqe_ebde_cnt_SHIFT    0
25092fcee4bfSJames Smart #define wqe_ebde_cnt_MASK     0x0000000f
2510f0d9bcccSJames Smart #define wqe_ebde_cnt_WORD     word10
2511f0d9bcccSJames Smart #define wqe_lenloc_SHIFT      7
2512f0d9bcccSJames Smart #define wqe_lenloc_MASK       0x00000003
2513f0d9bcccSJames Smart #define wqe_lenloc_WORD       word10
2514f0d9bcccSJames Smart #define LPFC_WQE_LENLOC_NONE		0
2515f0d9bcccSJames Smart #define LPFC_WQE_LENLOC_WORD3	1
2516f0d9bcccSJames Smart #define LPFC_WQE_LENLOC_WORD12	2
2517f0d9bcccSJames Smart #define LPFC_WQE_LENLOC_WORD4	3
2518f0d9bcccSJames Smart #define wqe_qosd_SHIFT        9
2519f0d9bcccSJames Smart #define wqe_qosd_MASK         0x00000001
2520f0d9bcccSJames Smart #define wqe_qosd_WORD         word10
2521f0d9bcccSJames Smart #define wqe_xbl_SHIFT         11
2522f0d9bcccSJames Smart #define wqe_xbl_MASK          0x00000001
2523f0d9bcccSJames Smart #define wqe_xbl_WORD          word10
2524f0d9bcccSJames Smart #define wqe_iod_SHIFT         13
2525f0d9bcccSJames Smart #define wqe_iod_MASK          0x00000001
2526f0d9bcccSJames Smart #define wqe_iod_WORD          word10
2527f0d9bcccSJames Smart #define LPFC_WQE_IOD_WRITE	0
2528f0d9bcccSJames Smart #define LPFC_WQE_IOD_READ	1
2529f0d9bcccSJames Smart #define wqe_dbde_SHIFT        14
2530f0d9bcccSJames Smart #define wqe_dbde_MASK         0x00000001
2531f0d9bcccSJames Smart #define wqe_dbde_WORD         word10
2532f0d9bcccSJames Smart #define wqe_wqes_SHIFT        15
2533f0d9bcccSJames Smart #define wqe_wqes_MASK         0x00000001
2534f0d9bcccSJames Smart #define wqe_wqes_WORD         word10
2535fedd3b7bSJames Smart /* Note that this field overlaps above fields */
2536fedd3b7bSJames Smart #define wqe_wqid_SHIFT        1
25379589b062SJames Smart #define wqe_wqid_MASK         0x00007fff
2538fedd3b7bSJames Smart #define wqe_wqid_WORD         word10
2539da0436e9SJames Smart #define wqe_pri_SHIFT         16
2540da0436e9SJames Smart #define wqe_pri_MASK          0x00000007
2541da0436e9SJames Smart #define wqe_pri_WORD          word10
2542da0436e9SJames Smart #define wqe_pv_SHIFT          19
2543da0436e9SJames Smart #define wqe_pv_MASK           0x00000001
2544da0436e9SJames Smart #define wqe_pv_WORD           word10
2545da0436e9SJames Smart #define wqe_xc_SHIFT          21
2546da0436e9SJames Smart #define wqe_xc_MASK           0x00000001
2547da0436e9SJames Smart #define wqe_xc_WORD           word10
2548da0436e9SJames Smart #define wqe_ccpe_SHIFT        23
2549da0436e9SJames Smart #define wqe_ccpe_MASK         0x00000001
2550da0436e9SJames Smart #define wqe_ccpe_WORD         word10
2551da0436e9SJames Smart #define wqe_ccp_SHIFT         24
2552da0436e9SJames Smart #define wqe_ccp_MASK          0x000000ff
2553da0436e9SJames Smart #define wqe_ccp_WORD          word10
2554da0436e9SJames Smart 	uint32_t word11;
2555da0436e9SJames Smart #define wqe_cmd_type_SHIFT    0
2556da0436e9SJames Smart #define wqe_cmd_type_MASK     0x0000000f
2557da0436e9SJames Smart #define wqe_cmd_type_WORD     word11
2558f0d9bcccSJames Smart #define wqe_els_id_SHIFT      4
2559f0d9bcccSJames Smart #define wqe_els_id_MASK       0x00000003
2560f0d9bcccSJames Smart #define wqe_els_id_WORD       word11
2561f0d9bcccSJames Smart #define LPFC_ELS_ID_FLOGI	3
2562f0d9bcccSJames Smart #define LPFC_ELS_ID_FDISC	2
2563f0d9bcccSJames Smart #define LPFC_ELS_ID_LOGO	1
2564f0d9bcccSJames Smart #define LPFC_ELS_ID_DEFAULT	0
2565da0436e9SJames Smart #define wqe_wqec_SHIFT        7
2566da0436e9SJames Smart #define wqe_wqec_MASK         0x00000001
2567da0436e9SJames Smart #define wqe_wqec_WORD         word11
2568da0436e9SJames Smart #define wqe_cqid_SHIFT        16
25696669f9bbSJames Smart #define wqe_cqid_MASK         0x0000ffff
2570da0436e9SJames Smart #define wqe_cqid_WORD         word11
2571f0d9bcccSJames Smart #define LPFC_WQE_CQ_ID_DEFAULT	0xffff
2572da0436e9SJames Smart };
2573da0436e9SJames Smart 
2574da0436e9SJames Smart struct wqe_did {
2575da0436e9SJames Smart 	uint32_t word5;
2576da0436e9SJames Smart #define wqe_els_did_SHIFT         0
2577da0436e9SJames Smart #define wqe_els_did_MASK          0x00FFFFFF
2578da0436e9SJames Smart #define wqe_els_did_WORD          word5
25796669f9bbSJames Smart #define wqe_xmit_bls_pt_SHIFT         28
25806669f9bbSJames Smart #define wqe_xmit_bls_pt_MASK          0x00000003
25816669f9bbSJames Smart #define wqe_xmit_bls_pt_WORD          word5
2582da0436e9SJames Smart #define wqe_xmit_bls_ar_SHIFT         30
2583da0436e9SJames Smart #define wqe_xmit_bls_ar_MASK          0x00000001
2584da0436e9SJames Smart #define wqe_xmit_bls_ar_WORD          word5
2585da0436e9SJames Smart #define wqe_xmit_bls_xo_SHIFT         31
2586da0436e9SJames Smart #define wqe_xmit_bls_xo_MASK          0x00000001
2587da0436e9SJames Smart #define wqe_xmit_bls_xo_WORD          word5
2588da0436e9SJames Smart };
2589da0436e9SJames Smart 
2590f0d9bcccSJames Smart struct lpfc_wqe_generic{
2591f0d9bcccSJames Smart 	struct ulp_bde64 bde;
2592f0d9bcccSJames Smart 	uint32_t word3;
2593f0d9bcccSJames Smart 	uint32_t word4;
2594f0d9bcccSJames Smart 	uint32_t word5;
2595f0d9bcccSJames Smart 	struct wqe_common wqe_com;
2596f0d9bcccSJames Smart 	uint32_t payload[4];
2597f0d9bcccSJames Smart };
2598f0d9bcccSJames Smart 
2599da0436e9SJames Smart struct els_request64_wqe {
2600da0436e9SJames Smart 	struct ulp_bde64 bde;
2601da0436e9SJames Smart 	uint32_t payload_len;
2602da0436e9SJames Smart 	uint32_t word4;
2603da0436e9SJames Smart #define els_req64_sid_SHIFT         0
2604da0436e9SJames Smart #define els_req64_sid_MASK          0x00FFFFFF
2605da0436e9SJames Smart #define els_req64_sid_WORD          word4
2606da0436e9SJames Smart #define els_req64_sp_SHIFT          24
2607da0436e9SJames Smart #define els_req64_sp_MASK           0x00000001
2608da0436e9SJames Smart #define els_req64_sp_WORD           word4
2609da0436e9SJames Smart #define els_req64_vf_SHIFT          25
2610da0436e9SJames Smart #define els_req64_vf_MASK           0x00000001
2611da0436e9SJames Smart #define els_req64_vf_WORD           word4
2612da0436e9SJames Smart 	struct wqe_did	wqe_dest;
2613da0436e9SJames Smart 	struct wqe_common wqe_com; /* words 6-11 */
2614da0436e9SJames Smart 	uint32_t word12;
2615da0436e9SJames Smart #define els_req64_vfid_SHIFT        1
2616da0436e9SJames Smart #define els_req64_vfid_MASK         0x00000FFF
2617da0436e9SJames Smart #define els_req64_vfid_WORD         word12
2618da0436e9SJames Smart #define els_req64_pri_SHIFT         13
2619da0436e9SJames Smart #define els_req64_pri_MASK          0x00000007
2620da0436e9SJames Smart #define els_req64_pri_WORD          word12
2621da0436e9SJames Smart 	uint32_t word13;
2622da0436e9SJames Smart #define els_req64_hopcnt_SHIFT      24
2623da0436e9SJames Smart #define els_req64_hopcnt_MASK       0x000000ff
2624da0436e9SJames Smart #define els_req64_hopcnt_WORD       word13
2625da0436e9SJames Smart 	uint32_t reserved[2];
2626da0436e9SJames Smart };
2627da0436e9SJames Smart 
2628da0436e9SJames Smart struct xmit_els_rsp64_wqe {
2629da0436e9SJames Smart 	struct ulp_bde64 bde;
2630f0d9bcccSJames Smart 	uint32_t response_payload_len;
2631da0436e9SJames Smart 	uint32_t rsvd4;
2632da0436e9SJames Smart 	struct wqe_did wqe_dest;
2633da0436e9SJames Smart 	struct wqe_common wqe_com; /* words 6-11 */
2634*c31098ceSJames Smart 	uint32_t word12;
2635*c31098ceSJames Smart #define wqe_rsp_temp_rpi_SHIFT    0
2636*c31098ceSJames Smart #define wqe_rsp_temp_rpi_MASK     0x0000FFFF
2637*c31098ceSJames Smart #define wqe_rsp_temp_rpi_WORD     word12
2638*c31098ceSJames Smart 	uint32_t rsvd_13_15[3];
2639da0436e9SJames Smart };
2640da0436e9SJames Smart 
2641da0436e9SJames Smart struct xmit_bls_rsp64_wqe {
2642da0436e9SJames Smart 	uint32_t payload0;
26436669f9bbSJames Smart /* Payload0 for BA_ACC */
26446669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_SHIFT        16
26456669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_MASK         0x000000ff
26466669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_WORD         payload0
26476669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_vald_SHIFT   24
26486669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_vald_MASK    0x000000ff
26496669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_vald_WORD    payload0
26506669f9bbSJames Smart /* Payload0 for BA_RJT */
26516669f9bbSJames Smart #define xmit_bls_rsp64_rjt_vspec_SHIFT   0
26526669f9bbSJames Smart #define xmit_bls_rsp64_rjt_vspec_MASK    0x000000ff
26536669f9bbSJames Smart #define xmit_bls_rsp64_rjt_vspec_WORD    payload0
26546669f9bbSJames Smart #define xmit_bls_rsp64_rjt_expc_SHIFT    8
26556669f9bbSJames Smart #define xmit_bls_rsp64_rjt_expc_MASK     0x000000ff
26566669f9bbSJames Smart #define xmit_bls_rsp64_rjt_expc_WORD     payload0
26576669f9bbSJames Smart #define xmit_bls_rsp64_rjt_rsnc_SHIFT    16
26586669f9bbSJames Smart #define xmit_bls_rsp64_rjt_rsnc_MASK     0x000000ff
26596669f9bbSJames Smart #define xmit_bls_rsp64_rjt_rsnc_WORD     payload0
2660da0436e9SJames Smart 	uint32_t word1;
2661da0436e9SJames Smart #define xmit_bls_rsp64_rxid_SHIFT  0
2662da0436e9SJames Smart #define xmit_bls_rsp64_rxid_MASK   0x0000ffff
2663da0436e9SJames Smart #define xmit_bls_rsp64_rxid_WORD   word1
2664da0436e9SJames Smart #define xmit_bls_rsp64_oxid_SHIFT  16
2665da0436e9SJames Smart #define xmit_bls_rsp64_oxid_MASK   0x0000ffff
2666da0436e9SJames Smart #define xmit_bls_rsp64_oxid_WORD   word1
2667da0436e9SJames Smart 	uint32_t word2;
26686669f9bbSJames Smart #define xmit_bls_rsp64_seqcnthi_SHIFT  0
2669da0436e9SJames Smart #define xmit_bls_rsp64_seqcnthi_MASK   0x0000ffff
2670da0436e9SJames Smart #define xmit_bls_rsp64_seqcnthi_WORD   word2
26716669f9bbSJames Smart #define xmit_bls_rsp64_seqcntlo_SHIFT  16
26726669f9bbSJames Smart #define xmit_bls_rsp64_seqcntlo_MASK   0x0000ffff
26736669f9bbSJames Smart #define xmit_bls_rsp64_seqcntlo_WORD   word2
2674da0436e9SJames Smart 	uint32_t rsrvd3;
2675da0436e9SJames Smart 	uint32_t rsrvd4;
2676da0436e9SJames Smart 	struct wqe_did	wqe_dest;
2677da0436e9SJames Smart 	struct wqe_common wqe_com; /* words 6-11 */
2678da0436e9SJames Smart 	uint32_t rsvd_12_15[4];
2679da0436e9SJames Smart };
26806669f9bbSJames Smart 
2681da0436e9SJames Smart struct wqe_rctl_dfctl {
2682da0436e9SJames Smart 	uint32_t word5;
2683da0436e9SJames Smart #define wqe_si_SHIFT 2
2684da0436e9SJames Smart #define wqe_si_MASK  0x000000001
2685da0436e9SJames Smart #define wqe_si_WORD  word5
2686da0436e9SJames Smart #define wqe_la_SHIFT 3
2687da0436e9SJames Smart #define wqe_la_MASK  0x000000001
2688da0436e9SJames Smart #define wqe_la_WORD  word5
2689da0436e9SJames Smart #define wqe_ls_SHIFT 7
2690da0436e9SJames Smart #define wqe_ls_MASK  0x000000001
2691da0436e9SJames Smart #define wqe_ls_WORD  word5
2692da0436e9SJames Smart #define wqe_dfctl_SHIFT 8
2693da0436e9SJames Smart #define wqe_dfctl_MASK  0x0000000ff
2694da0436e9SJames Smart #define wqe_dfctl_WORD  word5
2695da0436e9SJames Smart #define wqe_type_SHIFT 16
2696da0436e9SJames Smart #define wqe_type_MASK  0x0000000ff
2697da0436e9SJames Smart #define wqe_type_WORD  word5
2698da0436e9SJames Smart #define wqe_rctl_SHIFT 24
2699da0436e9SJames Smart #define wqe_rctl_MASK  0x0000000ff
2700da0436e9SJames Smart #define wqe_rctl_WORD  word5
2701da0436e9SJames Smart };
2702da0436e9SJames Smart 
2703da0436e9SJames Smart struct xmit_seq64_wqe {
2704da0436e9SJames Smart 	struct ulp_bde64 bde;
2705f0d9bcccSJames Smart 	uint32_t rsvd3;
2706da0436e9SJames Smart 	uint32_t relative_offset;
2707da0436e9SJames Smart 	struct wqe_rctl_dfctl wge_ctl;
2708da0436e9SJames Smart 	struct wqe_common wqe_com; /* words 6-11 */
2709da0436e9SJames Smart 	uint32_t xmit_len;
2710da0436e9SJames Smart 	uint32_t rsvd_12_15[3];
2711da0436e9SJames Smart };
2712da0436e9SJames Smart struct xmit_bcast64_wqe {
2713da0436e9SJames Smart 	struct ulp_bde64 bde;
2714f0d9bcccSJames Smart 	uint32_t seq_payload_len;
2715da0436e9SJames Smart 	uint32_t rsvd4;
2716da0436e9SJames Smart 	struct wqe_rctl_dfctl wge_ctl; /* word 5 */
2717da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
2718da0436e9SJames Smart 	uint32_t rsvd_12_15[4];
2719da0436e9SJames Smart };
2720da0436e9SJames Smart 
2721da0436e9SJames Smart struct gen_req64_wqe {
2722da0436e9SJames Smart 	struct ulp_bde64 bde;
2723f0d9bcccSJames Smart 	uint32_t request_payload_len;
2724f0d9bcccSJames Smart 	uint32_t relative_offset;
2725da0436e9SJames Smart 	struct wqe_rctl_dfctl wge_ctl; /* word 5 */
2726da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
2727da0436e9SJames Smart 	uint32_t rsvd_12_15[4];
2728da0436e9SJames Smart };
2729da0436e9SJames Smart 
2730da0436e9SJames Smart struct create_xri_wqe {
2731da0436e9SJames Smart 	uint32_t rsrvd[5];           /* words 0-4 */
2732da0436e9SJames Smart 	struct wqe_did	wqe_dest;  /* word 5 */
2733da0436e9SJames Smart 	struct wqe_common wqe_com; /* words 6-11 */
2734da0436e9SJames Smart 	uint32_t rsvd_12_15[4];         /* word 12-15 */
2735da0436e9SJames Smart };
2736da0436e9SJames Smart 
2737da0436e9SJames Smart #define T_REQUEST_TAG 3
2738da0436e9SJames Smart #define T_XRI_TAG 1
2739da0436e9SJames Smart 
2740da0436e9SJames Smart struct abort_cmd_wqe {
2741da0436e9SJames Smart 	uint32_t rsrvd[3];
2742da0436e9SJames Smart 	uint32_t word3;
2743da0436e9SJames Smart #define	abort_cmd_ia_SHIFT  0
2744da0436e9SJames Smart #define	abort_cmd_ia_MASK  0x000000001
2745da0436e9SJames Smart #define	abort_cmd_ia_WORD  word3
2746da0436e9SJames Smart #define	abort_cmd_criteria_SHIFT  8
2747da0436e9SJames Smart #define	abort_cmd_criteria_MASK  0x0000000ff
2748da0436e9SJames Smart #define	abort_cmd_criteria_WORD  word3
2749da0436e9SJames Smart 	uint32_t rsrvd4;
2750da0436e9SJames Smart 	uint32_t rsrvd5;
2751da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
2752da0436e9SJames Smart 	uint32_t rsvd_12_15[4];         /* word 12-15 */
2753da0436e9SJames Smart };
2754da0436e9SJames Smart 
2755da0436e9SJames Smart struct fcp_iwrite64_wqe {
2756da0436e9SJames Smart 	struct ulp_bde64 bde;
2757f0d9bcccSJames Smart 	uint32_t payload_offset_len;
2758da0436e9SJames Smart 	uint32_t total_xfer_len;
2759da0436e9SJames Smart 	uint32_t initial_xfer_len;
2760da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
2761fedd3b7bSJames Smart 	uint32_t rsrvd12;
2762fedd3b7bSJames Smart 	struct ulp_bde64 ph_bde;       /* words 13-15 */
2763da0436e9SJames Smart };
2764da0436e9SJames Smart 
2765da0436e9SJames Smart struct fcp_iread64_wqe {
2766da0436e9SJames Smart 	struct ulp_bde64 bde;
2767f0d9bcccSJames Smart 	uint32_t payload_offset_len;   /* word 3 */
2768da0436e9SJames Smart 	uint32_t total_xfer_len;       /* word 4 */
2769da0436e9SJames Smart 	uint32_t rsrvd5;               /* word 5 */
2770da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
2771fedd3b7bSJames Smart 	uint32_t rsrvd12;
2772fedd3b7bSJames Smart 	struct ulp_bde64 ph_bde;       /* words 13-15 */
2773da0436e9SJames Smart };
2774da0436e9SJames Smart 
2775da0436e9SJames Smart struct fcp_icmnd64_wqe {
2776da0436e9SJames Smart 	struct ulp_bde64 bde;          /* words 0-2 */
2777f0d9bcccSJames Smart 	uint32_t rsrvd3;               /* word 3 */
2778f0d9bcccSJames Smart 	uint32_t rsrvd4;               /* word 4 */
2779f0d9bcccSJames Smart 	uint32_t rsrvd5;               /* word 5 */
2780da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
2781da0436e9SJames Smart 	uint32_t rsvd_12_15[4];        /* word 12-15 */
2782da0436e9SJames Smart };
2783da0436e9SJames Smart 
2784da0436e9SJames Smart 
2785da0436e9SJames Smart union lpfc_wqe {
2786da0436e9SJames Smart 	uint32_t words[16];
2787da0436e9SJames Smart 	struct lpfc_wqe_generic generic;
2788da0436e9SJames Smart 	struct fcp_icmnd64_wqe fcp_icmd;
2789da0436e9SJames Smart 	struct fcp_iread64_wqe fcp_iread;
2790da0436e9SJames Smart 	struct fcp_iwrite64_wqe fcp_iwrite;
2791da0436e9SJames Smart 	struct abort_cmd_wqe abort_cmd;
2792da0436e9SJames Smart 	struct create_xri_wqe create_xri;
2793da0436e9SJames Smart 	struct xmit_bcast64_wqe xmit_bcast64;
2794da0436e9SJames Smart 	struct xmit_seq64_wqe xmit_sequence;
2795da0436e9SJames Smart 	struct xmit_bls_rsp64_wqe xmit_bls_rsp;
2796da0436e9SJames Smart 	struct xmit_els_rsp64_wqe xmit_els_rsp;
2797da0436e9SJames Smart 	struct els_request64_wqe els_req;
2798da0436e9SJames Smart 	struct gen_req64_wqe gen_req;
2799da0436e9SJames Smart };
2800da0436e9SJames Smart 
2801da0436e9SJames Smart #define FCP_COMMAND 0x0
2802da0436e9SJames Smart #define FCP_COMMAND_DATA_OUT 0x1
2803da0436e9SJames Smart #define ELS_COMMAND_NON_FIP 0xC
2804da0436e9SJames Smart #define ELS_COMMAND_FIP 0xD
2805da0436e9SJames Smart #define OTHER_COMMAND 0x8
2806da0436e9SJames Smart 
2807