xref: /linux/drivers/scsi/lpfc/lpfc_hw4.h (revision a5b141a895b592b401d739949d347ca473921c92)
1da0436e9SJames Smart /*******************************************************************
2da0436e9SJames Smart  * This file is part of the Emulex Linux Device Driver for         *
3da0436e9SJames Smart  * Fibre Channel Host Bus Adapters.                                *
4cf270817SJames Smart  * Copyright (C) 2017-2021 Broadcom. All Rights Reserved. The term *
53e21d1cbSJames Smart  * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.  *
650611577SJames Smart  * Copyright (C) 2009-2016 Emulex.  All rights reserved.           *
7da0436e9SJames Smart  * EMULEX and SLI are trademarks of Emulex.                        *
8d080abe0SJames Smart  * www.broadcom.com                                                *
9da0436e9SJames Smart  *                                                                 *
10da0436e9SJames Smart  * This program is free software; you can redistribute it and/or   *
11da0436e9SJames Smart  * modify it under the terms of version 2 of the GNU General       *
12da0436e9SJames Smart  * Public License as published by the Free Software Foundation.    *
13da0436e9SJames Smart  * This program is distributed in the hope that it will be useful. *
14da0436e9SJames Smart  * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND          *
15da0436e9SJames Smart  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  *
16da0436e9SJames Smart  * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE      *
17da0436e9SJames Smart  * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
18da0436e9SJames Smart  * TO BE LEGALLY INVALID.  See the GNU General Public License for  *
19da0436e9SJames Smart  * more details, a copy of which can be found in the file COPYING  *
20da0436e9SJames Smart  * included with this package.                                     *
21da0436e9SJames Smart  *******************************************************************/
22da0436e9SJames Smart 
23428569e6SJames Smart #include <uapi/scsi/fc/fc_fs.h>
24df3fe766SJames Smart #include <uapi/scsi/fc/fc_els.h>
25df3fe766SJames Smart 
26da0436e9SJames Smart /* Macros to deal with bit fields. Each bit field must have 3 #defines
27da0436e9SJames Smart  * associated with it (_SHIFT, _MASK, and _WORD).
28da0436e9SJames Smart  * EG. For a bit field that is in the 7th bit of the "field4" field of a
29da0436e9SJames Smart  * structure and is 2 bits in size the following #defines must exist:
30da0436e9SJames Smart  *	struct temp {
31da0436e9SJames Smart  *		uint32_t	field1;
32da0436e9SJames Smart  *		uint32_t	field2;
33da0436e9SJames Smart  *		uint32_t	field3;
34da0436e9SJames Smart  *		uint32_t	field4;
35da0436e9SJames Smart  *	#define example_bit_field_SHIFT		7
36da0436e9SJames Smart  *	#define example_bit_field_MASK		0x03
37da0436e9SJames Smart  *	#define example_bit_field_WORD		field4
38da0436e9SJames Smart  *		uint32_t	field5;
39da0436e9SJames Smart  *	};
40da0436e9SJames Smart  * Then the macros below may be used to get or set the value of that field.
41da0436e9SJames Smart  * EG. To get the value of the bit field from the above example:
42da0436e9SJames Smart  *	struct temp t1;
43da0436e9SJames Smart  *	value = bf_get(example_bit_field, &t1);
44da0436e9SJames Smart  * And then to set that bit field:
45da0436e9SJames Smart  *	bf_set(example_bit_field, &t1, 2);
46da0436e9SJames Smart  * Or clear that bit field:
47da0436e9SJames Smart  *	bf_set(example_bit_field, &t1, 0);
48da0436e9SJames Smart  */
49079b5c91SJames Smart #define bf_get_be32(name, ptr) \
50079b5c91SJames Smart 	((be32_to_cpu((ptr)->name##_WORD) >> name##_SHIFT) & name##_MASK)
51cb5172eaSJames Smart #define bf_get_le32(name, ptr) \
52cb5172eaSJames Smart 	((le32_to_cpu((ptr)->name##_WORD) >> name##_SHIFT) & name##_MASK)
53da0436e9SJames Smart #define bf_get(name, ptr) \
54da0436e9SJames Smart 	(((ptr)->name##_WORD >> name##_SHIFT) & name##_MASK)
55cb5172eaSJames Smart #define bf_set_le32(name, ptr, value) \
56cb5172eaSJames Smart 	((ptr)->name##_WORD = cpu_to_le32(((((value) & \
57cb5172eaSJames Smart 	name##_MASK) << name##_SHIFT) | (le32_to_cpu((ptr)->name##_WORD) & \
58cb5172eaSJames Smart 	~(name##_MASK << name##_SHIFT)))))
59da0436e9SJames Smart #define bf_set(name, ptr, value) \
60da0436e9SJames Smart 	((ptr)->name##_WORD = ((((value) & name##_MASK) << name##_SHIFT) | \
61da0436e9SJames Smart 		 ((ptr)->name##_WORD & ~(name##_MASK << name##_SHIFT))))
62da0436e9SJames Smart 
63da0436e9SJames Smart struct dma_address {
64da0436e9SJames Smart 	uint32_t addr_lo;
65da0436e9SJames Smart 	uint32_t addr_hi;
66da0436e9SJames Smart };
67da0436e9SJames Smart 
688fa38513SJames Smart struct lpfc_sli_intf {
698fa38513SJames Smart 	uint32_t word0;
708fa38513SJames Smart #define lpfc_sli_intf_valid_SHIFT		29
7128baac74SJames Smart #define lpfc_sli_intf_valid_MASK		0x00000007
728fa38513SJames Smart #define lpfc_sli_intf_valid_WORD		word0
738fa38513SJames Smart #define LPFC_SLI_INTF_VALID		6
74085c647cSJames Smart #define lpfc_sli_intf_sli_hint2_SHIFT		24
75085c647cSJames Smart #define lpfc_sli_intf_sli_hint2_MASK		0x0000001F
76085c647cSJames Smart #define lpfc_sli_intf_sli_hint2_WORD		word0
77085c647cSJames Smart #define LPFC_SLI_INTF_SLI_HINT2_NONE	0
78085c647cSJames Smart #define lpfc_sli_intf_sli_hint1_SHIFT		16
79085c647cSJames Smart #define lpfc_sli_intf_sli_hint1_MASK		0x000000FF
80085c647cSJames Smart #define lpfc_sli_intf_sli_hint1_WORD		word0
81085c647cSJames Smart #define LPFC_SLI_INTF_SLI_HINT1_NONE	0
82085c647cSJames Smart #define LPFC_SLI_INTF_SLI_HINT1_1	1
83085c647cSJames Smart #define LPFC_SLI_INTF_SLI_HINT1_2	2
84085c647cSJames Smart #define lpfc_sli_intf_if_type_SHIFT		12
85085c647cSJames Smart #define lpfc_sli_intf_if_type_MASK		0x0000000F
86085c647cSJames Smart #define lpfc_sli_intf_if_type_WORD		word0
87085c647cSJames Smart #define LPFC_SLI_INTF_IF_TYPE_0		0
88085c647cSJames Smart #define LPFC_SLI_INTF_IF_TYPE_1		1
89085c647cSJames Smart #define LPFC_SLI_INTF_IF_TYPE_2		2
9027d6ac0aSJames Smart #define LPFC_SLI_INTF_IF_TYPE_6		6
9128baac74SJames Smart #define lpfc_sli_intf_sli_family_SHIFT		8
92085c647cSJames Smart #define lpfc_sli_intf_sli_family_MASK		0x0000000F
9328baac74SJames Smart #define lpfc_sli_intf_sli_family_WORD		word0
94085c647cSJames Smart #define LPFC_SLI_INTF_FAMILY_BE2	0x0
95085c647cSJames Smart #define LPFC_SLI_INTF_FAMILY_BE3	0x1
96085c647cSJames Smart #define LPFC_SLI_INTF_FAMILY_LNCR_A0	0xa
97085c647cSJames Smart #define LPFC_SLI_INTF_FAMILY_LNCR_B0	0xb
98f6c5e6c4SJames Smart #define LPFC_SLI_INTF_FAMILY_G6		0xc
99f6c5e6c4SJames Smart #define LPFC_SLI_INTF_FAMILY_G7		0xd
100f6c5e6c4SJames Smart #define LPFC_SLI_INTF_FAMILY_G7P	0xe
10128baac74SJames Smart #define lpfc_sli_intf_slirev_SHIFT		4
10228baac74SJames Smart #define lpfc_sli_intf_slirev_MASK		0x0000000F
10328baac74SJames Smart #define lpfc_sli_intf_slirev_WORD		word0
10428baac74SJames Smart #define LPFC_SLI_INTF_REV_SLI3		3
10528baac74SJames Smart #define LPFC_SLI_INTF_REV_SLI4		4
106085c647cSJames Smart #define lpfc_sli_intf_func_type_SHIFT		0
107085c647cSJames Smart #define lpfc_sli_intf_func_type_MASK		0x00000001
108085c647cSJames Smart #define lpfc_sli_intf_func_type_WORD		word0
109085c647cSJames Smart #define LPFC_SLI_INTF_IF_TYPE_PHYS	0
110085c647cSJames Smart #define LPFC_SLI_INTF_IF_TYPE_VIRT	1
1118fa38513SJames Smart };
1128fa38513SJames Smart 
113da0436e9SJames Smart #define LPFC_SLI4_MBX_EMBED	true
114da0436e9SJames Smart #define LPFC_SLI4_MBX_NEMBED	false
115da0436e9SJames Smart 
116da0436e9SJames Smart #define LPFC_SLI4_MB_WORD_COUNT		64
117da0436e9SJames Smart #define LPFC_MAX_MQ_PAGE		8
118962bc51bSJames Smart #define LPFC_MAX_WQ_PAGE_V0		4
119da0436e9SJames Smart #define LPFC_MAX_WQ_PAGE		8
120895427bdSJames Smart #define LPFC_MAX_RQ_PAGE		8
121da0436e9SJames Smart #define LPFC_MAX_CQ_PAGE		4
122da0436e9SJames Smart #define LPFC_MAX_EQ_PAGE		8
123da0436e9SJames Smart 
124da0436e9SJames Smart #define LPFC_VIR_FUNC_MAX       32 /* Maximum number of virtual functions */
125da0436e9SJames Smart #define LPFC_PCI_FUNC_MAX        5 /* Maximum number of PCI functions */
126da0436e9SJames Smart #define LPFC_VFR_PAGE_SIZE	0x1000 /* 4KB BAR2 per-VF register page size */
127da0436e9SJames Smart 
128da0436e9SJames Smart /* Define SLI4 Alignment requirements. */
129da0436e9SJames Smart #define LPFC_ALIGN_16_BYTE	16
130da0436e9SJames Smart #define LPFC_ALIGN_64_BYTE	64
131b62232baSJames Smart #define SLI4_PAGE_SIZE		4096
132da0436e9SJames Smart 
133da0436e9SJames Smart /* Define SLI4 specific definitions. */
134da0436e9SJames Smart #define LPFC_MQ_CQE_BYTE_OFFSET	256
135da0436e9SJames Smart #define LPFC_MBX_CMD_HDR_LENGTH 16
136da0436e9SJames Smart #define LPFC_MBX_ERROR_RANGE	0x4000
137da0436e9SJames Smart #define LPFC_BMBX_BIT1_ADDR_HI	0x2
138da0436e9SJames Smart #define LPFC_BMBX_BIT1_ADDR_LO	0
139da0436e9SJames Smart #define LPFC_RPI_HDR_COUNT	64
140da0436e9SJames Smart #define LPFC_HDR_TEMPLATE_SIZE	4096
141da0436e9SJames Smart #define LPFC_RPI_ALLOC_ERROR 	0xFFFF
142da0436e9SJames Smart #define LPFC_FCF_RECORD_WD_CNT	132
143da0436e9SJames Smart #define LPFC_ENTIRE_FCF_DATABASE 0
144da0436e9SJames Smart #define LPFC_DFLT_FCF_INDEX	 0
145da0436e9SJames Smart 
146da0436e9SJames Smart /* Virtual function numbers */
147da0436e9SJames Smart #define LPFC_VF0		0
148da0436e9SJames Smart #define LPFC_VF1		1
149da0436e9SJames Smart #define LPFC_VF2		2
150da0436e9SJames Smart #define LPFC_VF3		3
151da0436e9SJames Smart #define LPFC_VF4		4
152da0436e9SJames Smart #define LPFC_VF5		5
153da0436e9SJames Smart #define LPFC_VF6		6
154da0436e9SJames Smart #define LPFC_VF7		7
155da0436e9SJames Smart #define LPFC_VF8		8
156da0436e9SJames Smart #define LPFC_VF9		9
157da0436e9SJames Smart #define LPFC_VF10		10
158da0436e9SJames Smart #define LPFC_VF11		11
159da0436e9SJames Smart #define LPFC_VF12		12
160da0436e9SJames Smart #define LPFC_VF13		13
161da0436e9SJames Smart #define LPFC_VF14		14
162da0436e9SJames Smart #define LPFC_VF15		15
163da0436e9SJames Smart #define LPFC_VF16		16
164da0436e9SJames Smart #define LPFC_VF17		17
165da0436e9SJames Smart #define LPFC_VF18		18
166da0436e9SJames Smart #define LPFC_VF19		19
167da0436e9SJames Smart #define LPFC_VF20		20
168da0436e9SJames Smart #define LPFC_VF21		21
169da0436e9SJames Smart #define LPFC_VF22		22
170da0436e9SJames Smart #define LPFC_VF23		23
171da0436e9SJames Smart #define LPFC_VF24		24
172da0436e9SJames Smart #define LPFC_VF25		25
173da0436e9SJames Smart #define LPFC_VF26		26
174da0436e9SJames Smart #define LPFC_VF27		27
175da0436e9SJames Smart #define LPFC_VF28		28
176da0436e9SJames Smart #define LPFC_VF29		29
177da0436e9SJames Smart #define LPFC_VF30		30
178da0436e9SJames Smart #define LPFC_VF31		31
179da0436e9SJames Smart 
180da0436e9SJames Smart /* PCI function numbers */
181da0436e9SJames Smart #define LPFC_PCI_FUNC0		0
182da0436e9SJames Smart #define LPFC_PCI_FUNC1		1
183da0436e9SJames Smart #define LPFC_PCI_FUNC2		2
184da0436e9SJames Smart #define LPFC_PCI_FUNC3		3
185da0436e9SJames Smart #define LPFC_PCI_FUNC4		4
186da0436e9SJames Smart 
18788a2cfbbSJames Smart /* SLI4 interface type-2 PDEV_CTL register */
188c0c11512SJames Smart #define LPFC_CTL_PDEV_CTL_OFFSET	0x414
189c0c11512SJames Smart #define LPFC_CTL_PDEV_CTL_DRST		0x00000001
190c0c11512SJames Smart #define LPFC_CTL_PDEV_CTL_FRST		0x00000002
191c0c11512SJames Smart #define LPFC_CTL_PDEV_CTL_DD		0x00000004
192c0c11512SJames Smart #define LPFC_CTL_PDEV_CTL_LC		0x00000008
193c0c11512SJames Smart #define LPFC_CTL_PDEV_CTL_FRL_ALL	0x00
194c0c11512SJames Smart #define LPFC_CTL_PDEV_CTL_FRL_FC_FCOE	0x10
195c0c11512SJames Smart #define LPFC_CTL_PDEV_CTL_FRL_NIC	0x20
196d2cc9bcdSJames Smart #define LPFC_CTL_PDEV_CTL_DDL_RAS	0x1000000
197c0c11512SJames Smart 
198c0c11512SJames Smart #define LPFC_FW_DUMP_REQUEST    (LPFC_CTL_PDEV_CTL_DD | LPFC_CTL_PDEV_CTL_FRST)
199c0c11512SJames Smart 
200da0436e9SJames Smart /* Active interrupt test count */
201da0436e9SJames Smart #define LPFC_ACT_INTR_CNT	4
202da0436e9SJames Smart 
20349aa143dSJames Smart /* Algrithmns for scheduling FCP commands to WQs */
20445aa312eSJames Smart #define	LPFC_FCP_SCHED_BY_HDWQ		0
20549aa143dSJames Smart #define	LPFC_FCP_SCHED_BY_CPU		1
20649aa143dSJames Smart 
2077ea92eb4SJames Smart /* Algrithmns for NameServer Query after RSCN */
2087ea92eb4SJames Smart #define LPFC_NS_QUERY_GID_FT	0
2097ea92eb4SJames Smart #define LPFC_NS_QUERY_GID_PT	1
2107ea92eb4SJames Smart 
211da0436e9SJames Smart /* Delay Multiplier constant */
212da0436e9SJames Smart #define LPFC_DMULT_CONST       651042
2130cf07f84SJames Smart #define LPFC_DMULT_MAX         1023
214bf8dae83SJames Smart 
215bf8dae83SJames Smart /* Configuration of Interrupts / sec for entire HBA port */
216bf8dae83SJames Smart #define LPFC_MIN_IMAX          5000
217bf8dae83SJames Smart #define LPFC_MAX_IMAX          5000000
21832517fc0SJames Smart #define LPFC_DEF_IMAX          0
21932517fc0SJames Smart 
22032517fc0SJames Smart #define LPFC_MAX_AUTO_EQ_DELAY 120
22132517fc0SJames Smart #define LPFC_EQ_DELAY_STEP     15
22232517fc0SJames Smart #define LPFC_EQD_ISR_TRIGGER   20000
22332517fc0SJames Smart /* 1s intervals */
22432517fc0SJames Smart #define LPFC_EQ_DELAY_MSECS    1000
225da0436e9SJames Smart 
2267bb03bbfSJames Smart #define LPFC_MIN_CPU_MAP       0
2276a828b0fSJames Smart #define LPFC_MAX_CPU_MAP       1
2287bb03bbfSJames Smart #define LPFC_HBA_CPU_MAP       1
2297bb03bbfSJames Smart 
23028baac74SJames Smart /* PORT_CAPABILITIES constants. */
23128baac74SJames Smart #define LPFC_MAX_SUPPORTED_PAGES	8
23228baac74SJames Smart 
233da0436e9SJames Smart struct ulp_bde64 {
234da0436e9SJames Smart 	union ULP_BDE_TUS {
235da0436e9SJames Smart 		uint32_t w;
236da0436e9SJames Smart 		struct {
237da0436e9SJames Smart #ifdef __BIG_ENDIAN_BITFIELD
238da0436e9SJames Smart 			uint32_t bdeFlags:8;	/* BDE Flags 0 IS A SUPPORTED
239da0436e9SJames Smart 						   VALUE !! */
240da0436e9SJames Smart 			uint32_t bdeSize:24;	/* Size of buffer (in bytes) */
241da0436e9SJames Smart #else	/*  __LITTLE_ENDIAN_BITFIELD */
242da0436e9SJames Smart 			uint32_t bdeSize:24;	/* Size of buffer (in bytes) */
243da0436e9SJames Smart 			uint32_t bdeFlags:8;	/* BDE Flags 0 IS A SUPPORTED
244da0436e9SJames Smart 						   VALUE !! */
245da0436e9SJames Smart #endif
246da0436e9SJames Smart #define BUFF_TYPE_BDE_64    0x00	/* BDE (Host_resident) */
247da0436e9SJames Smart #define BUFF_TYPE_BDE_IMMED 0x01	/* Immediate Data BDE */
248da0436e9SJames Smart #define BUFF_TYPE_BDE_64P   0x02	/* BDE (Port-resident) */
249da0436e9SJames Smart #define BUFF_TYPE_BDE_64I   0x08	/* Input BDE (Host-resident) */
250da0436e9SJames Smart #define BUFF_TYPE_BDE_64IP  0x0A	/* Input BDE (Port-resident) */
251da0436e9SJames Smart #define BUFF_TYPE_BLP_64    0x40	/* BLP (Host-resident) */
252da0436e9SJames Smart #define BUFF_TYPE_BLP_64P   0x42	/* BLP (Port-resident) */
253da0436e9SJames Smart 		} f;
254da0436e9SJames Smart 	} tus;
255da0436e9SJames Smart 	uint32_t addrLow;
256da0436e9SJames Smart 	uint32_t addrHigh;
257da0436e9SJames Smart };
258da0436e9SJames Smart 
2590c651878SJames Smart /* Maximun size of immediate data that can fit into a 128 byte WQE */
2600c651878SJames Smart #define LPFC_MAX_BDE_IMM_SIZE	64
2610c651878SJames Smart 
262da0436e9SJames Smart struct lpfc_sli4_flags {
263da0436e9SJames Smart 	uint32_t word0;
2646d368e53SJames Smart #define lpfc_idx_rsrc_rdy_SHIFT		0
2656d368e53SJames Smart #define lpfc_idx_rsrc_rdy_MASK		0x00000001
2666d368e53SJames Smart #define lpfc_idx_rsrc_rdy_WORD		word0
2676d368e53SJames Smart #define LPFC_IDX_RSRC_RDY		1
2688a9d2e80SJames Smart #define lpfc_rpi_rsrc_rdy_SHIFT		1
2696d368e53SJames Smart #define lpfc_rpi_rsrc_rdy_MASK		0x00000001
2706d368e53SJames Smart #define lpfc_rpi_rsrc_rdy_WORD		word0
2716d368e53SJames Smart #define LPFC_RPI_RSRC_RDY		1
2728a9d2e80SJames Smart #define lpfc_vpi_rsrc_rdy_SHIFT		2
2736d368e53SJames Smart #define lpfc_vpi_rsrc_rdy_MASK		0x00000001
2746d368e53SJames Smart #define lpfc_vpi_rsrc_rdy_WORD		word0
2756d368e53SJames Smart #define LPFC_VPI_RSRC_RDY		1
2768a9d2e80SJames Smart #define lpfc_vfi_rsrc_rdy_SHIFT		3
2776d368e53SJames Smart #define lpfc_vfi_rsrc_rdy_MASK		0x00000001
2786d368e53SJames Smart #define lpfc_vfi_rsrc_rdy_WORD		word0
2796d368e53SJames Smart #define LPFC_VFI_RSRC_RDY		1
2805e633302SGaurav Srivastava #define lpfc_ftr_ashdr_SHIFT            4
2815e633302SGaurav Srivastava #define lpfc_ftr_ashdr_MASK             0x00000001
2825e633302SGaurav Srivastava #define lpfc_ftr_ashdr_WORD             word0
283da0436e9SJames Smart };
284da0436e9SJames Smart 
285546fc854SJames Smart struct sli4_bls_rsp {
2865ffc266eSJames Smart 	uint32_t word0_rsvd;      /* Word0 must be reserved */
2875ffc266eSJames Smart 	uint32_t word1;
2885ffc266eSJames Smart #define lpfc_abts_orig_SHIFT      0
2895ffc266eSJames Smart #define lpfc_abts_orig_MASK       0x00000001
2905ffc266eSJames Smart #define lpfc_abts_orig_WORD       word1
2915ffc266eSJames Smart #define LPFC_ABTS_UNSOL_RSP       1
2925ffc266eSJames Smart #define LPFC_ABTS_UNSOL_INT       0
2935ffc266eSJames Smart 	uint32_t word2;
2945ffc266eSJames Smart #define lpfc_abts_rxid_SHIFT      0
2955ffc266eSJames Smart #define lpfc_abts_rxid_MASK       0x0000FFFF
2965ffc266eSJames Smart #define lpfc_abts_rxid_WORD       word2
2975ffc266eSJames Smart #define lpfc_abts_oxid_SHIFT      16
2985ffc266eSJames Smart #define lpfc_abts_oxid_MASK       0x0000FFFF
2995ffc266eSJames Smart #define lpfc_abts_oxid_WORD       word2
3005ffc266eSJames Smart 	uint32_t word3;
301546fc854SJames Smart #define lpfc_vndr_code_SHIFT	0
302546fc854SJames Smart #define lpfc_vndr_code_MASK	0x000000FF
303546fc854SJames Smart #define lpfc_vndr_code_WORD	word3
304546fc854SJames Smart #define lpfc_rsn_expln_SHIFT	8
305546fc854SJames Smart #define lpfc_rsn_expln_MASK	0x000000FF
306546fc854SJames Smart #define lpfc_rsn_expln_WORD	word3
307546fc854SJames Smart #define lpfc_rsn_code_SHIFT	16
308546fc854SJames Smart #define lpfc_rsn_code_MASK	0x000000FF
309546fc854SJames Smart #define lpfc_rsn_code_WORD	word3
310546fc854SJames Smart 
3115ffc266eSJames Smart 	uint32_t word4;
3125ffc266eSJames Smart 	uint32_t word5_rsvd;	/* Word5 must be reserved */
3135ffc266eSJames Smart };
3145ffc266eSJames Smart 
315da0436e9SJames Smart /* event queue entry structure */
316da0436e9SJames Smart struct lpfc_eqe {
317da0436e9SJames Smart 	uint32_t word0;
318da0436e9SJames Smart #define lpfc_eqe_resource_id_SHIFT	16
31916f3b48dSJames Smart #define lpfc_eqe_resource_id_MASK	0x0000FFFF
320da0436e9SJames Smart #define lpfc_eqe_resource_id_WORD	word0
321da0436e9SJames Smart #define lpfc_eqe_minor_code_SHIFT	4
322da0436e9SJames Smart #define lpfc_eqe_minor_code_MASK	0x00000FFF
323da0436e9SJames Smart #define lpfc_eqe_minor_code_WORD	word0
324da0436e9SJames Smart #define lpfc_eqe_major_code_SHIFT	1
325da0436e9SJames Smart #define lpfc_eqe_major_code_MASK	0x00000007
326da0436e9SJames Smart #define lpfc_eqe_major_code_WORD	word0
327da0436e9SJames Smart #define lpfc_eqe_valid_SHIFT		0
328da0436e9SJames Smart #define lpfc_eqe_valid_MASK		0x00000001
329da0436e9SJames Smart #define lpfc_eqe_valid_WORD		word0
330da0436e9SJames Smart };
331da0436e9SJames Smart 
332da0436e9SJames Smart /* completion queue entry structure (common fields for all cqe types) */
333da0436e9SJames Smart struct lpfc_cqe {
334da0436e9SJames Smart 	uint32_t reserved0;
335da0436e9SJames Smart 	uint32_t reserved1;
336da0436e9SJames Smart 	uint32_t reserved2;
337da0436e9SJames Smart 	uint32_t word3;
338da0436e9SJames Smart #define lpfc_cqe_valid_SHIFT		31
339da0436e9SJames Smart #define lpfc_cqe_valid_MASK		0x00000001
340da0436e9SJames Smart #define lpfc_cqe_valid_WORD		word3
341da0436e9SJames Smart #define lpfc_cqe_code_SHIFT		16
342da0436e9SJames Smart #define lpfc_cqe_code_MASK		0x000000FF
343da0436e9SJames Smart #define lpfc_cqe_code_WORD		word3
344da0436e9SJames Smart };
345da0436e9SJames Smart 
346da0436e9SJames Smart /* Completion Queue Entry Status Codes */
347da0436e9SJames Smart #define CQE_STATUS_SUCCESS		0x0
348da0436e9SJames Smart #define CQE_STATUS_FCP_RSP_FAILURE	0x1
349da0436e9SJames Smart #define CQE_STATUS_REMOTE_STOP		0x2
350da0436e9SJames Smart #define CQE_STATUS_LOCAL_REJECT		0x3
351da0436e9SJames Smart #define CQE_STATUS_NPORT_RJT		0x4
352da0436e9SJames Smart #define CQE_STATUS_FABRIC_RJT		0x5
353da0436e9SJames Smart #define CQE_STATUS_NPORT_BSY		0x6
354da0436e9SJames Smart #define CQE_STATUS_FABRIC_BSY		0x7
355da0436e9SJames Smart #define CQE_STATUS_INTERMED_RSP		0x8
356da0436e9SJames Smart #define CQE_STATUS_LS_RJT		0x9
357da0436e9SJames Smart #define CQE_STATUS_CMD_REJECT		0xb
358da0436e9SJames Smart #define CQE_STATUS_FCP_TGT_LENCHECK	0xc
359da0436e9SJames Smart #define CQE_STATUS_NEED_BUFF_ENTRY	0xf
360acd6859bSJames Smart #define CQE_STATUS_DI_ERROR		0x16
361acd6859bSJames Smart 
362acd6859bSJames Smart /* Used when mapping CQE status to IOCB */
363acd6859bSJames Smart #define LPFC_IOCB_STATUS_MASK		0xf
364da0436e9SJames Smart 
365da0436e9SJames Smart /* Status returned by hardware (valid only if status = CQE_STATUS_SUCCESS). */
366da0436e9SJames Smart #define CQE_HW_STATUS_NO_ERR		0x0
367da0436e9SJames Smart #define CQE_HW_STATUS_UNDERRUN		0x1
368da0436e9SJames Smart #define CQE_HW_STATUS_OVERRUN		0x2
369da0436e9SJames Smart 
370da0436e9SJames Smart /* Completion Queue Entry Codes */
371da0436e9SJames Smart #define CQE_CODE_COMPL_WQE		0x1
372da0436e9SJames Smart #define CQE_CODE_RELEASE_WQE		0x2
373da0436e9SJames Smart #define CQE_CODE_RECEIVE		0x4
374da0436e9SJames Smart #define CQE_CODE_XRI_ABORTED		0x5
3757851fe2cSJames Smart #define CQE_CODE_RECEIVE_V1		0x9
376895427bdSJames Smart #define CQE_CODE_NVME_ERSP		0xd
377da0436e9SJames Smart 
3785c1db2acSJames Smart /*
3795c1db2acSJames Smart  * Define mask value for xri_aborted and wcqe completed CQE extended status.
3805c1db2acSJames Smart  * Currently, extended status is limited to 9 bits (0x0 -> 0x103) .
3815c1db2acSJames Smart  */
382e3d2b802SJames Smart #define WCQE_PARAM_MASK		0x1FF
3835c1db2acSJames Smart 
384da0436e9SJames Smart /* completion queue entry for wqe completions */
385da0436e9SJames Smart struct lpfc_wcqe_complete {
386da0436e9SJames Smart 	uint32_t word0;
387da0436e9SJames Smart #define lpfc_wcqe_c_request_tag_SHIFT	16
388da0436e9SJames Smart #define lpfc_wcqe_c_request_tag_MASK	0x0000FFFF
389da0436e9SJames Smart #define lpfc_wcqe_c_request_tag_WORD	word0
390da0436e9SJames Smart #define lpfc_wcqe_c_status_SHIFT	8
391da0436e9SJames Smart #define lpfc_wcqe_c_status_MASK		0x000000FF
392da0436e9SJames Smart #define lpfc_wcqe_c_status_WORD		word0
393da0436e9SJames Smart #define lpfc_wcqe_c_hw_status_SHIFT	0
394da0436e9SJames Smart #define lpfc_wcqe_c_hw_status_MASK	0x000000FF
395da0436e9SJames Smart #define lpfc_wcqe_c_hw_status_WORD	word0
396895427bdSJames Smart #define lpfc_wcqe_c_ersp0_SHIFT		0
397895427bdSJames Smart #define lpfc_wcqe_c_ersp0_MASK		0x0000FFFF
398895427bdSJames Smart #define lpfc_wcqe_c_ersp0_WORD		word0
399da0436e9SJames Smart 	uint32_t total_data_placed;
400daebf93fSJames Smart #define lpfc_wcqe_c_cmf_cg_SHIFT	31
401daebf93fSJames Smart #define lpfc_wcqe_c_cmf_cg_MASK		0x00000001
402daebf93fSJames Smart #define lpfc_wcqe_c_cmf_cg_WORD		total_data_placed
403daebf93fSJames Smart #define lpfc_wcqe_c_cmf_bw_SHIFT	0
404daebf93fSJames Smart #define lpfc_wcqe_c_cmf_bw_MASK		0x0FFFFFFF
405daebf93fSJames Smart #define lpfc_wcqe_c_cmf_bw_WORD		total_data_placed
406da0436e9SJames Smart 	uint32_t parameter;
407acd6859bSJames Smart #define lpfc_wcqe_c_bg_edir_SHIFT	5
408acd6859bSJames Smart #define lpfc_wcqe_c_bg_edir_MASK	0x00000001
409acd6859bSJames Smart #define lpfc_wcqe_c_bg_edir_WORD	parameter
410acd6859bSJames Smart #define lpfc_wcqe_c_bg_tdpv_SHIFT	3
411acd6859bSJames Smart #define lpfc_wcqe_c_bg_tdpv_MASK	0x00000001
412acd6859bSJames Smart #define lpfc_wcqe_c_bg_tdpv_WORD	parameter
413acd6859bSJames Smart #define lpfc_wcqe_c_bg_re_SHIFT		2
414acd6859bSJames Smart #define lpfc_wcqe_c_bg_re_MASK		0x00000001
415acd6859bSJames Smart #define lpfc_wcqe_c_bg_re_WORD		parameter
416acd6859bSJames Smart #define lpfc_wcqe_c_bg_ae_SHIFT		1
417acd6859bSJames Smart #define lpfc_wcqe_c_bg_ae_MASK		0x00000001
418acd6859bSJames Smart #define lpfc_wcqe_c_bg_ae_WORD		parameter
419acd6859bSJames Smart #define lpfc_wcqe_c_bg_ge_SHIFT		0
420acd6859bSJames Smart #define lpfc_wcqe_c_bg_ge_MASK		0x00000001
421acd6859bSJames Smart #define lpfc_wcqe_c_bg_ge_WORD		parameter
422da0436e9SJames Smart 	uint32_t word3;
423da0436e9SJames Smart #define lpfc_wcqe_c_valid_SHIFT		lpfc_cqe_valid_SHIFT
424da0436e9SJames Smart #define lpfc_wcqe_c_valid_MASK		lpfc_cqe_valid_MASK
425da0436e9SJames Smart #define lpfc_wcqe_c_valid_WORD		lpfc_cqe_valid_WORD
426da0436e9SJames Smart #define lpfc_wcqe_c_xb_SHIFT		28
427da0436e9SJames Smart #define lpfc_wcqe_c_xb_MASK		0x00000001
428da0436e9SJames Smart #define lpfc_wcqe_c_xb_WORD		word3
429da0436e9SJames Smart #define lpfc_wcqe_c_pv_SHIFT		27
430da0436e9SJames Smart #define lpfc_wcqe_c_pv_MASK		0x00000001
431da0436e9SJames Smart #define lpfc_wcqe_c_pv_WORD		word3
432da0436e9SJames Smart #define lpfc_wcqe_c_priority_SHIFT	24
433da0436e9SJames Smart #define lpfc_wcqe_c_priority_MASK	0x00000007
434da0436e9SJames Smart #define lpfc_wcqe_c_priority_WORD	word3
435da0436e9SJames Smart #define lpfc_wcqe_c_code_SHIFT		lpfc_cqe_code_SHIFT
436da0436e9SJames Smart #define lpfc_wcqe_c_code_MASK		lpfc_cqe_code_MASK
437da0436e9SJames Smart #define lpfc_wcqe_c_code_WORD		lpfc_cqe_code_WORD
438895427bdSJames Smart #define lpfc_wcqe_c_sqhead_SHIFT	0
439895427bdSJames Smart #define lpfc_wcqe_c_sqhead_MASK		0x0000FFFF
440895427bdSJames Smart #define lpfc_wcqe_c_sqhead_WORD		word3
441da0436e9SJames Smart };
442da0436e9SJames Smart 
443da0436e9SJames Smart /* completion queue entry for wqe release */
444da0436e9SJames Smart struct lpfc_wcqe_release {
445da0436e9SJames Smart 	uint32_t reserved0;
446da0436e9SJames Smart 	uint32_t reserved1;
447da0436e9SJames Smart 	uint32_t word2;
448da0436e9SJames Smart #define lpfc_wcqe_r_wq_id_SHIFT		16
449da0436e9SJames Smart #define lpfc_wcqe_r_wq_id_MASK		0x0000FFFF
450da0436e9SJames Smart #define lpfc_wcqe_r_wq_id_WORD		word2
451da0436e9SJames Smart #define lpfc_wcqe_r_wqe_index_SHIFT	0
452da0436e9SJames Smart #define lpfc_wcqe_r_wqe_index_MASK	0x0000FFFF
453da0436e9SJames Smart #define lpfc_wcqe_r_wqe_index_WORD	word2
454da0436e9SJames Smart 	uint32_t word3;
455da0436e9SJames Smart #define lpfc_wcqe_r_valid_SHIFT		lpfc_cqe_valid_SHIFT
456da0436e9SJames Smart #define lpfc_wcqe_r_valid_MASK		lpfc_cqe_valid_MASK
457da0436e9SJames Smart #define lpfc_wcqe_r_valid_WORD		lpfc_cqe_valid_WORD
458da0436e9SJames Smart #define lpfc_wcqe_r_code_SHIFT		lpfc_cqe_code_SHIFT
459da0436e9SJames Smart #define lpfc_wcqe_r_code_MASK		lpfc_cqe_code_MASK
460da0436e9SJames Smart #define lpfc_wcqe_r_code_WORD		lpfc_cqe_code_WORD
461da0436e9SJames Smart };
462da0436e9SJames Smart 
463da0436e9SJames Smart struct sli4_wcqe_xri_aborted {
464da0436e9SJames Smart 	uint32_t word0;
465da0436e9SJames Smart #define lpfc_wcqe_xa_status_SHIFT		8
466da0436e9SJames Smart #define lpfc_wcqe_xa_status_MASK		0x000000FF
467da0436e9SJames Smart #define lpfc_wcqe_xa_status_WORD		word0
468da0436e9SJames Smart 	uint32_t parameter;
469da0436e9SJames Smart 	uint32_t word2;
470da0436e9SJames Smart #define lpfc_wcqe_xa_remote_xid_SHIFT	16
471da0436e9SJames Smart #define lpfc_wcqe_xa_remote_xid_MASK	0x0000FFFF
472da0436e9SJames Smart #define lpfc_wcqe_xa_remote_xid_WORD	word2
473da0436e9SJames Smart #define lpfc_wcqe_xa_xri_SHIFT		0
474da0436e9SJames Smart #define lpfc_wcqe_xa_xri_MASK		0x0000FFFF
475da0436e9SJames Smart #define lpfc_wcqe_xa_xri_WORD		word2
476da0436e9SJames Smart 	uint32_t word3;
477da0436e9SJames Smart #define lpfc_wcqe_xa_valid_SHIFT	lpfc_cqe_valid_SHIFT
478da0436e9SJames Smart #define lpfc_wcqe_xa_valid_MASK		lpfc_cqe_valid_MASK
479da0436e9SJames Smart #define lpfc_wcqe_xa_valid_WORD		lpfc_cqe_valid_WORD
480da0436e9SJames Smart #define lpfc_wcqe_xa_ia_SHIFT		30
481da0436e9SJames Smart #define lpfc_wcqe_xa_ia_MASK		0x00000001
482da0436e9SJames Smart #define lpfc_wcqe_xa_ia_WORD		word3
483da0436e9SJames Smart #define CQE_XRI_ABORTED_IA_REMOTE	0
484da0436e9SJames Smart #define CQE_XRI_ABORTED_IA_LOCAL	1
485da0436e9SJames Smart #define lpfc_wcqe_xa_br_SHIFT		29
486da0436e9SJames Smart #define lpfc_wcqe_xa_br_MASK		0x00000001
487da0436e9SJames Smart #define lpfc_wcqe_xa_br_WORD		word3
488da0436e9SJames Smart #define CQE_XRI_ABORTED_BR_BA_ACC	0
489da0436e9SJames Smart #define CQE_XRI_ABORTED_BR_BA_RJT	1
490da0436e9SJames Smart #define lpfc_wcqe_xa_eo_SHIFT		28
491da0436e9SJames Smart #define lpfc_wcqe_xa_eo_MASK		0x00000001
492da0436e9SJames Smart #define lpfc_wcqe_xa_eo_WORD		word3
493da0436e9SJames Smart #define CQE_XRI_ABORTED_EO_REMOTE	0
494da0436e9SJames Smart #define CQE_XRI_ABORTED_EO_LOCAL	1
495da0436e9SJames Smart #define lpfc_wcqe_xa_code_SHIFT		lpfc_cqe_code_SHIFT
496da0436e9SJames Smart #define lpfc_wcqe_xa_code_MASK		lpfc_cqe_code_MASK
497da0436e9SJames Smart #define lpfc_wcqe_xa_code_WORD		lpfc_cqe_code_WORD
498da0436e9SJames Smart };
499da0436e9SJames Smart 
500da0436e9SJames Smart /* completion queue entry structure for rqe completion */
501da0436e9SJames Smart struct lpfc_rcqe {
502da0436e9SJames Smart 	uint32_t word0;
503da0436e9SJames Smart #define lpfc_rcqe_bindex_SHIFT		16
504da0436e9SJames Smart #define lpfc_rcqe_bindex_MASK		0x0000FFF
505da0436e9SJames Smart #define lpfc_rcqe_bindex_WORD		word0
506da0436e9SJames Smart #define lpfc_rcqe_status_SHIFT		8
507da0436e9SJames Smart #define lpfc_rcqe_status_MASK		0x000000FF
508da0436e9SJames Smart #define lpfc_rcqe_status_WORD		word0
509da0436e9SJames Smart #define FC_STATUS_RQ_SUCCESS		0x10 /* Async receive successful */
510da0436e9SJames Smart #define FC_STATUS_RQ_BUF_LEN_EXCEEDED 	0x11 /* payload truncated */
511da0436e9SJames Smart #define FC_STATUS_INSUFF_BUF_NEED_BUF 	0x12 /* Insufficient buffers */
512da0436e9SJames Smart #define FC_STATUS_INSUFF_BUF_FRM_DISC 	0x13 /* Frame Discard */
5137851fe2cSJames Smart 	uint32_t word1;
5147851fe2cSJames Smart #define lpfc_rcqe_fcf_id_v1_SHIFT	0
5157851fe2cSJames Smart #define lpfc_rcqe_fcf_id_v1_MASK	0x0000003F
5167851fe2cSJames Smart #define lpfc_rcqe_fcf_id_v1_WORD	word1
517da0436e9SJames Smart 	uint32_t word2;
518da0436e9SJames Smart #define lpfc_rcqe_length_SHIFT		16
519da0436e9SJames Smart #define lpfc_rcqe_length_MASK		0x0000FFFF
520da0436e9SJames Smart #define lpfc_rcqe_length_WORD		word2
521da0436e9SJames Smart #define lpfc_rcqe_rq_id_SHIFT		6
522da0436e9SJames Smart #define lpfc_rcqe_rq_id_MASK		0x000003FF
523da0436e9SJames Smart #define lpfc_rcqe_rq_id_WORD		word2
524da0436e9SJames Smart #define lpfc_rcqe_fcf_id_SHIFT		0
525da0436e9SJames Smart #define lpfc_rcqe_fcf_id_MASK		0x0000003F
526da0436e9SJames Smart #define lpfc_rcqe_fcf_id_WORD		word2
5277851fe2cSJames Smart #define lpfc_rcqe_rq_id_v1_SHIFT	0
5287851fe2cSJames Smart #define lpfc_rcqe_rq_id_v1_MASK		0x0000FFFF
5297851fe2cSJames Smart #define lpfc_rcqe_rq_id_v1_WORD		word2
530da0436e9SJames Smart 	uint32_t word3;
531da0436e9SJames Smart #define lpfc_rcqe_valid_SHIFT		lpfc_cqe_valid_SHIFT
532da0436e9SJames Smart #define lpfc_rcqe_valid_MASK		lpfc_cqe_valid_MASK
533da0436e9SJames Smart #define lpfc_rcqe_valid_WORD		lpfc_cqe_valid_WORD
534da0436e9SJames Smart #define lpfc_rcqe_port_SHIFT		30
535da0436e9SJames Smart #define lpfc_rcqe_port_MASK		0x00000001
536da0436e9SJames Smart #define lpfc_rcqe_port_WORD		word3
537da0436e9SJames Smart #define lpfc_rcqe_hdr_length_SHIFT	24
538da0436e9SJames Smart #define lpfc_rcqe_hdr_length_MASK	0x0000001F
539da0436e9SJames Smart #define lpfc_rcqe_hdr_length_WORD	word3
540da0436e9SJames Smart #define lpfc_rcqe_code_SHIFT		lpfc_cqe_code_SHIFT
541da0436e9SJames Smart #define lpfc_rcqe_code_MASK		lpfc_cqe_code_MASK
542da0436e9SJames Smart #define lpfc_rcqe_code_WORD		lpfc_cqe_code_WORD
543da0436e9SJames Smart #define lpfc_rcqe_eof_SHIFT		8
544da0436e9SJames Smart #define lpfc_rcqe_eof_MASK		0x000000FF
545da0436e9SJames Smart #define lpfc_rcqe_eof_WORD		word3
546da0436e9SJames Smart #define FCOE_EOFn	0x41
547da0436e9SJames Smart #define FCOE_EOFt	0x42
548da0436e9SJames Smart #define FCOE_EOFni	0x49
549da0436e9SJames Smart #define FCOE_EOFa	0x50
550da0436e9SJames Smart #define lpfc_rcqe_sof_SHIFT		0
551da0436e9SJames Smart #define lpfc_rcqe_sof_MASK		0x000000FF
552da0436e9SJames Smart #define lpfc_rcqe_sof_WORD		word3
553da0436e9SJames Smart #define FCOE_SOFi2	0x2d
554da0436e9SJames Smart #define FCOE_SOFi3	0x2e
555da0436e9SJames Smart #define FCOE_SOFn2	0x35
556da0436e9SJames Smart #define FCOE_SOFn3	0x36
557da0436e9SJames Smart };
558da0436e9SJames Smart 
559da0436e9SJames Smart struct lpfc_rqe {
560da0436e9SJames Smart 	uint32_t address_hi;
561da0436e9SJames Smart 	uint32_t address_lo;
562da0436e9SJames Smart };
563da0436e9SJames Smart 
564da0436e9SJames Smart /* buffer descriptors */
565da0436e9SJames Smart struct lpfc_bde4 {
566da0436e9SJames Smart 	uint32_t addr_hi;
567da0436e9SJames Smart 	uint32_t addr_lo;
568da0436e9SJames Smart 	uint32_t word2;
569da0436e9SJames Smart #define lpfc_bde4_last_SHIFT		31
570da0436e9SJames Smart #define lpfc_bde4_last_MASK		0x00000001
571da0436e9SJames Smart #define lpfc_bde4_last_WORD		word2
572da0436e9SJames Smart #define lpfc_bde4_sge_offset_SHIFT	0
573da0436e9SJames Smart #define lpfc_bde4_sge_offset_MASK	0x000003FF
574da0436e9SJames Smart #define lpfc_bde4_sge_offset_WORD	word2
575da0436e9SJames Smart 	uint32_t word3;
576da0436e9SJames Smart #define lpfc_bde4_length_SHIFT		0
577da0436e9SJames Smart #define lpfc_bde4_length_MASK		0x000000FF
578da0436e9SJames Smart #define lpfc_bde4_length_WORD		word3
579da0436e9SJames Smart };
580da0436e9SJames Smart 
581da0436e9SJames Smart struct lpfc_register {
582da0436e9SJames Smart 	uint32_t word0;
583da0436e9SJames Smart };
584da0436e9SJames Smart 
58565791f1fSJames Smart #define LPFC_PORT_SEM_UE_RECOVERABLE    0xE000
58665791f1fSJames Smart #define LPFC_PORT_SEM_MASK		0xF000
587085c647cSJames Smart /* The following BAR0 Registers apply to SLI4 if_type 0 UCNAs. */
588da0436e9SJames Smart #define LPFC_UERR_STATUS_HI		0x00A4
589da0436e9SJames Smart #define LPFC_UERR_STATUS_LO		0x00A0
590a747c9ceSJames Smart #define LPFC_UE_MASK_HI			0x00AC
591a747c9ceSJames Smart #define LPFC_UE_MASK_LO			0x00A8
592da0436e9SJames Smart 
5932fcee4bfSJames Smart /* The following BAR0 register sets are defined for if_type 0 and 2 UCNAs. */
5942fcee4bfSJames Smart #define LPFC_SLI_INTF			0x0058
595bf316c78SJames Smart #define LPFC_SLI_ASIC_VER		0x009C
596da0436e9SJames Smart 
59788a2cfbbSJames Smart #define LPFC_CTL_PORT_SEM_OFFSET	0x400
5982fcee4bfSJames Smart #define lpfc_port_smphr_perr_SHIFT	31
5992fcee4bfSJames Smart #define lpfc_port_smphr_perr_MASK	0x1
6002fcee4bfSJames Smart #define lpfc_port_smphr_perr_WORD	word0
6012fcee4bfSJames Smart #define lpfc_port_smphr_sfi_SHIFT	30
6022fcee4bfSJames Smart #define lpfc_port_smphr_sfi_MASK	0x1
6032fcee4bfSJames Smart #define lpfc_port_smphr_sfi_WORD	word0
6042fcee4bfSJames Smart #define lpfc_port_smphr_nip_SHIFT	29
6052fcee4bfSJames Smart #define lpfc_port_smphr_nip_MASK	0x1
6062fcee4bfSJames Smart #define lpfc_port_smphr_nip_WORD	word0
6072fcee4bfSJames Smart #define lpfc_port_smphr_ipc_SHIFT	28
6082fcee4bfSJames Smart #define lpfc_port_smphr_ipc_MASK	0x1
6092fcee4bfSJames Smart #define lpfc_port_smphr_ipc_WORD	word0
6102fcee4bfSJames Smart #define lpfc_port_smphr_scr1_SHIFT	27
6112fcee4bfSJames Smart #define lpfc_port_smphr_scr1_MASK	0x1
6122fcee4bfSJames Smart #define lpfc_port_smphr_scr1_WORD	word0
6132fcee4bfSJames Smart #define lpfc_port_smphr_scr2_SHIFT	26
6142fcee4bfSJames Smart #define lpfc_port_smphr_scr2_MASK	0x1
6152fcee4bfSJames Smart #define lpfc_port_smphr_scr2_WORD	word0
6162fcee4bfSJames Smart #define lpfc_port_smphr_host_scratch_SHIFT	16
6172fcee4bfSJames Smart #define lpfc_port_smphr_host_scratch_MASK	0xFF
6182fcee4bfSJames Smart #define lpfc_port_smphr_host_scratch_WORD	word0
6192fcee4bfSJames Smart #define lpfc_port_smphr_port_status_SHIFT	0
6202fcee4bfSJames Smart #define lpfc_port_smphr_port_status_MASK	0xFFFF
6212fcee4bfSJames Smart #define lpfc_port_smphr_port_status_WORD	word0
6222fcee4bfSJames Smart 
623da0436e9SJames Smart #define LPFC_POST_STAGE_POWER_ON_RESET			0x0000
624da0436e9SJames Smart #define LPFC_POST_STAGE_AWAITING_HOST_RDY		0x0001
625da0436e9SJames Smart #define LPFC_POST_STAGE_HOST_RDY			0x0002
626da0436e9SJames Smart #define LPFC_POST_STAGE_BE_RESET			0x0003
627da0436e9SJames Smart #define LPFC_POST_STAGE_SEEPROM_CS_START		0x0100
628da0436e9SJames Smart #define LPFC_POST_STAGE_SEEPROM_CS_DONE			0x0101
629da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_CONFIG_START		0x0200
630da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_CONFIG_DONE			0x0201
631da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_CALIBRATE_START		0x0300
632da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_CALIBRATE_DONE		0x0301
633da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_TEST_START			0x0400
634da0436e9SJames Smart #define LPFC_POST_STAGE_DDR_TEST_DONE			0x0401
635da0436e9SJames Smart #define LPFC_POST_STAGE_REDBOOT_INIT_START		0x0600
636da0436e9SJames Smart #define LPFC_POST_STAGE_REDBOOT_INIT_DONE		0x0601
637da0436e9SJames Smart #define LPFC_POST_STAGE_FW_IMAGE_LOAD_START		0x0700
638da0436e9SJames Smart #define LPFC_POST_STAGE_FW_IMAGE_LOAD_DONE		0x0701
639da0436e9SJames Smart #define LPFC_POST_STAGE_ARMFW_START			0x0800
640da0436e9SJames Smart #define LPFC_POST_STAGE_DHCP_QUERY_START		0x0900
641da0436e9SJames Smart #define LPFC_POST_STAGE_DHCP_QUERY_DONE			0x0901
642da0436e9SJames Smart #define LPFC_POST_STAGE_BOOT_TARGET_DISCOVERY_START	0x0A00
643da0436e9SJames Smart #define LPFC_POST_STAGE_BOOT_TARGET_DISCOVERY_DONE	0x0A01
644da0436e9SJames Smart #define LPFC_POST_STAGE_RC_OPTION_SET			0x0B00
645da0436e9SJames Smart #define LPFC_POST_STAGE_SWITCH_LINK			0x0B01
646da0436e9SJames Smart #define LPFC_POST_STAGE_SEND_ICDS_MESSAGE		0x0B02
647da0436e9SJames Smart #define LPFC_POST_STAGE_PERFROM_TFTP			0x0B03
648da0436e9SJames Smart #define LPFC_POST_STAGE_PARSE_XML			0x0B04
649da0436e9SJames Smart #define LPFC_POST_STAGE_DOWNLOAD_IMAGE			0x0B05
650da0436e9SJames Smart #define LPFC_POST_STAGE_FLASH_IMAGE			0x0B06
651da0436e9SJames Smart #define LPFC_POST_STAGE_RC_DONE				0x0B07
652da0436e9SJames Smart #define LPFC_POST_STAGE_REBOOT_SYSTEM			0x0B08
653da0436e9SJames Smart #define LPFC_POST_STAGE_MAC_ADDRESS			0x0C00
6542fcee4bfSJames Smart #define LPFC_POST_STAGE_PORT_READY			0xC000
6552fcee4bfSJames Smart #define LPFC_POST_STAGE_PORT_UE 			0xF000
656085c647cSJames Smart 
65788a2cfbbSJames Smart #define LPFC_CTL_PORT_STA_OFFSET	0x404
658085c647cSJames Smart #define lpfc_sliport_status_err_SHIFT	31
659085c647cSJames Smart #define lpfc_sliport_status_err_MASK	0x1
660085c647cSJames Smart #define lpfc_sliport_status_err_WORD	word0
661085c647cSJames Smart #define lpfc_sliport_status_end_SHIFT	30
662085c647cSJames Smart #define lpfc_sliport_status_end_MASK	0x1
663085c647cSJames Smart #define lpfc_sliport_status_end_WORD	word0
664085c647cSJames Smart #define lpfc_sliport_status_oti_SHIFT	29
665085c647cSJames Smart #define lpfc_sliport_status_oti_MASK	0x1
666085c647cSJames Smart #define lpfc_sliport_status_oti_WORD	word0
667f0020e42SDick Kennedy #define lpfc_sliport_status_dip_SHIFT	25
668f0020e42SDick Kennedy #define lpfc_sliport_status_dip_MASK	0x1
669f0020e42SDick Kennedy #define lpfc_sliport_status_dip_WORD	word0
670085c647cSJames Smart #define lpfc_sliport_status_rn_SHIFT	24
671085c647cSJames Smart #define lpfc_sliport_status_rn_MASK	0x1
672085c647cSJames Smart #define lpfc_sliport_status_rn_WORD	word0
673085c647cSJames Smart #define lpfc_sliport_status_rdy_SHIFT	23
674085c647cSJames Smart #define lpfc_sliport_status_rdy_MASK	0x1
675085c647cSJames Smart #define lpfc_sliport_status_rdy_WORD	word0
676*a5b141a8SJames Smart #define lpfc_sliport_status_pldv_SHIFT	0
677*a5b141a8SJames Smart #define lpfc_sliport_status_pldv_MASK	0x1
678*a5b141a8SJames Smart #define lpfc_sliport_status_pldv_WORD	word0
679*a5b141a8SJames Smart #define CFG_PLD				0x3C
680229adb0eSJames Smart #define MAX_IF_TYPE_2_RESETS		6
681085c647cSJames Smart 
68288a2cfbbSJames Smart #define LPFC_CTL_PORT_CTL_OFFSET	0x408
683085c647cSJames Smart #define lpfc_sliport_ctrl_end_SHIFT	30
684085c647cSJames Smart #define lpfc_sliport_ctrl_end_MASK	0x1
685085c647cSJames Smart #define lpfc_sliport_ctrl_end_WORD	word0
686085c647cSJames Smart #define LPFC_SLIPORT_LITTLE_ENDIAN 0
687085c647cSJames Smart #define LPFC_SLIPORT_BIG_ENDIAN	   1
688085c647cSJames Smart #define lpfc_sliport_ctrl_ip_SHIFT	27
689085c647cSJames Smart #define lpfc_sliport_ctrl_ip_MASK	0x1
690085c647cSJames Smart #define lpfc_sliport_ctrl_ip_WORD	word0
6912fcee4bfSJames Smart #define LPFC_SLIPORT_INIT_PORT	1
692085c647cSJames Smart 
69388a2cfbbSJames Smart #define LPFC_CTL_PORT_ER1_OFFSET	0x40C
69488a2cfbbSJames Smart #define LPFC_CTL_PORT_ER2_OFFSET	0x410
695085c647cSJames Smart 
6960cf07f84SJames Smart #define LPFC_CTL_PORT_EQ_DELAY_OFFSET	0x418
6970cf07f84SJames Smart #define lpfc_sliport_eqdelay_delay_SHIFT 16
6980cf07f84SJames Smart #define lpfc_sliport_eqdelay_delay_MASK	0xffff
6990cf07f84SJames Smart #define lpfc_sliport_eqdelay_delay_WORD	word0
7000cf07f84SJames Smart #define lpfc_sliport_eqdelay_id_SHIFT	0
7010cf07f84SJames Smart #define lpfc_sliport_eqdelay_id_MASK	0xfff
7020cf07f84SJames Smart #define lpfc_sliport_eqdelay_id_WORD	word0
7030cf07f84SJames Smart #define LPFC_SEC_TO_USEC		1000000
704daebf93fSJames Smart #define LPFC_SEC_TO_MSEC		1000
7050cf07f84SJames Smart 
7062fcee4bfSJames Smart /* The following Registers apply to SLI4 if_type 0 UCNAs. They typically
7072fcee4bfSJames Smart  * reside in BAR 2.
7082fcee4bfSJames Smart  */
7092fcee4bfSJames Smart #define LPFC_SLIPORT_IF0_SMPHR	0x00AC
7102fcee4bfSJames Smart 
711da0436e9SJames Smart #define LPFC_IMR_MASK_ALL	0xFFFFFFFF
712da0436e9SJames Smart #define LPFC_ISCR_CLEAR_ALL	0xFFFFFFFF
713da0436e9SJames Smart 
714da0436e9SJames Smart #define LPFC_HST_ISR0		0x0C18
715da0436e9SJames Smart #define LPFC_HST_ISR1		0x0C1C
716da0436e9SJames Smart #define LPFC_HST_ISR2		0x0C20
717da0436e9SJames Smart #define LPFC_HST_ISR3		0x0C24
718da0436e9SJames Smart #define LPFC_HST_ISR4		0x0C28
719da0436e9SJames Smart 
720da0436e9SJames Smart #define LPFC_HST_IMR0		0x0C48
721da0436e9SJames Smart #define LPFC_HST_IMR1		0x0C4C
722da0436e9SJames Smart #define LPFC_HST_IMR2		0x0C50
723da0436e9SJames Smart #define LPFC_HST_IMR3		0x0C54
724da0436e9SJames Smart #define LPFC_HST_IMR4		0x0C58
725da0436e9SJames Smart 
726da0436e9SJames Smart #define LPFC_HST_ISCR0		0x0C78
727da0436e9SJames Smart #define LPFC_HST_ISCR1		0x0C7C
728da0436e9SJames Smart #define LPFC_HST_ISCR2		0x0C80
729da0436e9SJames Smart #define LPFC_HST_ISCR3		0x0C84
730da0436e9SJames Smart #define LPFC_HST_ISCR4		0x0C88
731da0436e9SJames Smart 
732da0436e9SJames Smart #define LPFC_SLI4_INTR0			BIT0
733da0436e9SJames Smart #define LPFC_SLI4_INTR1			BIT1
734da0436e9SJames Smart #define LPFC_SLI4_INTR2			BIT2
735da0436e9SJames Smart #define LPFC_SLI4_INTR3			BIT3
736da0436e9SJames Smart #define LPFC_SLI4_INTR4			BIT4
737da0436e9SJames Smart #define LPFC_SLI4_INTR5			BIT5
738da0436e9SJames Smart #define LPFC_SLI4_INTR6			BIT6
739da0436e9SJames Smart #define LPFC_SLI4_INTR7			BIT7
740da0436e9SJames Smart #define LPFC_SLI4_INTR8			BIT8
741da0436e9SJames Smart #define LPFC_SLI4_INTR9			BIT9
742da0436e9SJames Smart #define LPFC_SLI4_INTR10		BIT10
743da0436e9SJames Smart #define LPFC_SLI4_INTR11		BIT11
744da0436e9SJames Smart #define LPFC_SLI4_INTR12		BIT12
745da0436e9SJames Smart #define LPFC_SLI4_INTR13		BIT13
746da0436e9SJames Smart #define LPFC_SLI4_INTR14		BIT14
747da0436e9SJames Smart #define LPFC_SLI4_INTR15		BIT15
748da0436e9SJames Smart #define LPFC_SLI4_INTR16		BIT16
749da0436e9SJames Smart #define LPFC_SLI4_INTR17		BIT17
750da0436e9SJames Smart #define LPFC_SLI4_INTR18		BIT18
751da0436e9SJames Smart #define LPFC_SLI4_INTR19		BIT19
752da0436e9SJames Smart #define LPFC_SLI4_INTR20		BIT20
753da0436e9SJames Smart #define LPFC_SLI4_INTR21		BIT21
754da0436e9SJames Smart #define LPFC_SLI4_INTR22		BIT22
755da0436e9SJames Smart #define LPFC_SLI4_INTR23		BIT23
756da0436e9SJames Smart #define LPFC_SLI4_INTR24		BIT24
757da0436e9SJames Smart #define LPFC_SLI4_INTR25		BIT25
758da0436e9SJames Smart #define LPFC_SLI4_INTR26		BIT26
759da0436e9SJames Smart #define LPFC_SLI4_INTR27		BIT27
760da0436e9SJames Smart #define LPFC_SLI4_INTR28		BIT28
761da0436e9SJames Smart #define LPFC_SLI4_INTR29		BIT29
762da0436e9SJames Smart #define LPFC_SLI4_INTR30		BIT30
763da0436e9SJames Smart #define LPFC_SLI4_INTR31		BIT31
764da0436e9SJames Smart 
765085c647cSJames Smart /*
766085c647cSJames Smart  * The Doorbell registers defined here exist in different BAR
767085c647cSJames Smart  * register sets depending on the UCNA Port's reported if_type
768085c647cSJames Smart  * value.  For UCNA ports running SLI4 and if_type 0, they reside in
7692fcee4bfSJames Smart  * BAR4.  For UCNA ports running SLI4 and if_type 2, they reside in
77027d6ac0aSJames Smart  * BAR0.  For FC ports running SLI4 and if_type 6, they reside in
77127d6ac0aSJames Smart  * BAR2. The offsets and base address are different,  so the driver
77227d6ac0aSJames Smart  * has to compute the register addresses accordingly
773085c647cSJames Smart  */
774962bc51bSJames Smart #define LPFC_ULP0_RQ_DOORBELL		0x00A0
775962bc51bSJames Smart #define LPFC_ULP1_RQ_DOORBELL		0x00C0
77627d6ac0aSJames Smart #define LPFC_IF6_RQ_DOORBELL		0x0080
777962bc51bSJames Smart #define lpfc_rq_db_list_fm_num_posted_SHIFT	24
778962bc51bSJames Smart #define lpfc_rq_db_list_fm_num_posted_MASK	0x00FF
779962bc51bSJames Smart #define lpfc_rq_db_list_fm_num_posted_WORD	word0
780962bc51bSJames Smart #define lpfc_rq_db_list_fm_index_SHIFT		16
781962bc51bSJames Smart #define lpfc_rq_db_list_fm_index_MASK		0x00FF
782962bc51bSJames Smart #define lpfc_rq_db_list_fm_index_WORD		word0
783962bc51bSJames Smart #define lpfc_rq_db_list_fm_id_SHIFT		0
784962bc51bSJames Smart #define lpfc_rq_db_list_fm_id_MASK		0xFFFF
785962bc51bSJames Smart #define lpfc_rq_db_list_fm_id_WORD		word0
786962bc51bSJames Smart #define lpfc_rq_db_ring_fm_num_posted_SHIFT	16
787962bc51bSJames Smart #define lpfc_rq_db_ring_fm_num_posted_MASK	0x3FFF
788962bc51bSJames Smart #define lpfc_rq_db_ring_fm_num_posted_WORD	word0
789962bc51bSJames Smart #define lpfc_rq_db_ring_fm_id_SHIFT		0
790962bc51bSJames Smart #define lpfc_rq_db_ring_fm_id_MASK		0xFFFF
791962bc51bSJames Smart #define lpfc_rq_db_ring_fm_id_WORD		word0
792da0436e9SJames Smart 
793962bc51bSJames Smart #define LPFC_ULP0_WQ_DOORBELL		0x0040
794962bc51bSJames Smart #define LPFC_ULP1_WQ_DOORBELL		0x0060
795962bc51bSJames Smart #define lpfc_wq_db_list_fm_num_posted_SHIFT	24
796962bc51bSJames Smart #define lpfc_wq_db_list_fm_num_posted_MASK	0x00FF
797962bc51bSJames Smart #define lpfc_wq_db_list_fm_num_posted_WORD	word0
798962bc51bSJames Smart #define lpfc_wq_db_list_fm_index_SHIFT		16
799962bc51bSJames Smart #define lpfc_wq_db_list_fm_index_MASK		0x00FF
800962bc51bSJames Smart #define lpfc_wq_db_list_fm_index_WORD		word0
801962bc51bSJames Smart #define lpfc_wq_db_list_fm_id_SHIFT		0
802962bc51bSJames Smart #define lpfc_wq_db_list_fm_id_MASK		0xFFFF
803962bc51bSJames Smart #define lpfc_wq_db_list_fm_id_WORD		word0
804962bc51bSJames Smart #define lpfc_wq_db_ring_fm_num_posted_SHIFT     16
805962bc51bSJames Smart #define lpfc_wq_db_ring_fm_num_posted_MASK      0x3FFF
806962bc51bSJames Smart #define lpfc_wq_db_ring_fm_num_posted_WORD      word0
807962bc51bSJames Smart #define lpfc_wq_db_ring_fm_id_SHIFT             0
808962bc51bSJames Smart #define lpfc_wq_db_ring_fm_id_MASK              0xFFFF
809962bc51bSJames Smart #define lpfc_wq_db_ring_fm_id_WORD              word0
810da0436e9SJames Smart 
81127d6ac0aSJames Smart #define LPFC_IF6_WQ_DOORBELL		0x0040
81227d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_num_posted_SHIFT	24
81327d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_num_posted_MASK	0x00FF
81427d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_num_posted_WORD	word0
81527d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_dpp_SHIFT	23
81627d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_dpp_MASK		0x0001
81727d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_dpp_WORD		word0
81827d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_dpp_id_SHIFT	16
81927d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_dpp_id_MASK	0x001F
82027d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_dpp_id_WORD	word0
82127d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_id_SHIFT		0
82227d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_id_MASK		0xFFFF
82327d6ac0aSJames Smart #define lpfc_if6_wq_db_list_fm_id_WORD		word0
82427d6ac0aSJames Smart 
825da0436e9SJames Smart #define LPFC_EQCQ_DOORBELL		0x0120
826085c647cSJames Smart #define lpfc_eqcq_doorbell_se_SHIFT		31
827085c647cSJames Smart #define lpfc_eqcq_doorbell_se_MASK		0x0001
828085c647cSJames Smart #define lpfc_eqcq_doorbell_se_WORD		word0
829085c647cSJames Smart #define LPFC_EQCQ_SOLICIT_ENABLE_OFF	0
830085c647cSJames Smart #define LPFC_EQCQ_SOLICIT_ENABLE_ON	1
831da0436e9SJames Smart #define lpfc_eqcq_doorbell_arm_SHIFT		29
832da0436e9SJames Smart #define lpfc_eqcq_doorbell_arm_MASK		0x0001
833da0436e9SJames Smart #define lpfc_eqcq_doorbell_arm_WORD		word0
834da0436e9SJames Smart #define lpfc_eqcq_doorbell_num_released_SHIFT	16
835da0436e9SJames Smart #define lpfc_eqcq_doorbell_num_released_MASK	0x1FFF
836da0436e9SJames Smart #define lpfc_eqcq_doorbell_num_released_WORD	word0
837da0436e9SJames Smart #define lpfc_eqcq_doorbell_qt_SHIFT		10
838da0436e9SJames Smart #define lpfc_eqcq_doorbell_qt_MASK		0x0001
839da0436e9SJames Smart #define lpfc_eqcq_doorbell_qt_WORD		word0
840da0436e9SJames Smart #define LPFC_QUEUE_TYPE_COMPLETION	0
841da0436e9SJames Smart #define LPFC_QUEUE_TYPE_EVENT		1
842da0436e9SJames Smart #define lpfc_eqcq_doorbell_eqci_SHIFT		9
843da0436e9SJames Smart #define lpfc_eqcq_doorbell_eqci_MASK		0x0001
844da0436e9SJames Smart #define lpfc_eqcq_doorbell_eqci_WORD		word0
8456b5151fdSJames Smart #define lpfc_eqcq_doorbell_cqid_lo_SHIFT	0
8466b5151fdSJames Smart #define lpfc_eqcq_doorbell_cqid_lo_MASK		0x03FF
8476b5151fdSJames Smart #define lpfc_eqcq_doorbell_cqid_lo_WORD		word0
8486b5151fdSJames Smart #define lpfc_eqcq_doorbell_cqid_hi_SHIFT	11
8496b5151fdSJames Smart #define lpfc_eqcq_doorbell_cqid_hi_MASK		0x001F
8506b5151fdSJames Smart #define lpfc_eqcq_doorbell_cqid_hi_WORD		word0
8516b5151fdSJames Smart #define lpfc_eqcq_doorbell_eqid_lo_SHIFT	0
8526b5151fdSJames Smart #define lpfc_eqcq_doorbell_eqid_lo_MASK		0x01FF
8536b5151fdSJames Smart #define lpfc_eqcq_doorbell_eqid_lo_WORD		word0
8546b5151fdSJames Smart #define lpfc_eqcq_doorbell_eqid_hi_SHIFT	11
8556b5151fdSJames Smart #define lpfc_eqcq_doorbell_eqid_hi_MASK		0x001F
8566b5151fdSJames Smart #define lpfc_eqcq_doorbell_eqid_hi_WORD		word0
8576b5151fdSJames Smart #define LPFC_CQID_HI_FIELD_SHIFT		10
8586b5151fdSJames Smart #define LPFC_EQID_HI_FIELD_SHIFT		9
859da0436e9SJames Smart 
86027d6ac0aSJames Smart #define LPFC_IF6_CQ_DOORBELL			0x00C0
86127d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_se_SHIFT		31
86227d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_se_MASK		0x0001
86327d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_se_WORD		word0
86427d6ac0aSJames Smart #define LPFC_IF6_CQ_SOLICIT_ENABLE_OFF		0
86527d6ac0aSJames Smart #define LPFC_IF6_CQ_SOLICIT_ENABLE_ON		1
86627d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_arm_SHIFT		29
86727d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_arm_MASK		0x0001
86827d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_arm_WORD		word0
86927d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_num_released_SHIFT	16
87027d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_num_released_MASK	0x1FFF
87127d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_num_released_WORD	word0
87227d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_cqid_SHIFT		0
87327d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_cqid_MASK		0xFFFF
87427d6ac0aSJames Smart #define lpfc_if6_cq_doorbell_cqid_WORD		word0
87527d6ac0aSJames Smart 
87627d6ac0aSJames Smart #define LPFC_IF6_EQ_DOORBELL			0x0120
87727d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_io_SHIFT		31
87827d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_io_MASK		0x0001
87927d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_io_WORD		word0
88027d6ac0aSJames Smart #define LPFC_IF6_EQ_INTR_OVERRIDE_OFF		0
88127d6ac0aSJames Smart #define LPFC_IF6_EQ_INTR_OVERRIDE_ON		1
88227d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_arm_SHIFT		29
88327d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_arm_MASK		0x0001
88427d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_arm_WORD		word0
88527d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_num_released_SHIFT	16
88627d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_num_released_MASK	0x1FFF
88727d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_num_released_WORD	word0
88827d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_eqid_SHIFT		0
88927d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_eqid_MASK		0x0FFF
89027d6ac0aSJames Smart #define lpfc_if6_eq_doorbell_eqid_WORD		word0
89127d6ac0aSJames Smart 
892da0436e9SJames Smart #define LPFC_BMBX			0x0160
893da0436e9SJames Smart #define lpfc_bmbx_addr_SHIFT		2
894da0436e9SJames Smart #define lpfc_bmbx_addr_MASK		0x3FFFFFFF
895da0436e9SJames Smart #define lpfc_bmbx_addr_WORD		word0
896da0436e9SJames Smart #define lpfc_bmbx_hi_SHIFT		1
897da0436e9SJames Smart #define lpfc_bmbx_hi_MASK		0x0001
898da0436e9SJames Smart #define lpfc_bmbx_hi_WORD		word0
899da0436e9SJames Smart #define lpfc_bmbx_rdy_SHIFT		0
900da0436e9SJames Smart #define lpfc_bmbx_rdy_MASK		0x0001
901da0436e9SJames Smart #define lpfc_bmbx_rdy_WORD		word0
902da0436e9SJames Smart 
903da0436e9SJames Smart #define LPFC_MQ_DOORBELL			0x0140
90427d6ac0aSJames Smart #define LPFC_IF6_MQ_DOORBELL			0x0160
905da0436e9SJames Smart #define lpfc_mq_doorbell_num_posted_SHIFT	16
906da0436e9SJames Smart #define lpfc_mq_doorbell_num_posted_MASK	0x3FFF
907da0436e9SJames Smart #define lpfc_mq_doorbell_num_posted_WORD	word0
908da0436e9SJames Smart #define lpfc_mq_doorbell_id_SHIFT		0
909085c647cSJames Smart #define lpfc_mq_doorbell_id_MASK		0xFFFF
910da0436e9SJames Smart #define lpfc_mq_doorbell_id_WORD		word0
911da0436e9SJames Smart 
912da0436e9SJames Smart struct lpfc_sli4_cfg_mhdr {
913da0436e9SJames Smart 	uint32_t word1;
914da0436e9SJames Smart #define lpfc_mbox_hdr_emb_SHIFT		0
915da0436e9SJames Smart #define lpfc_mbox_hdr_emb_MASK		0x00000001
916da0436e9SJames Smart #define lpfc_mbox_hdr_emb_WORD		word1
917da0436e9SJames Smart #define lpfc_mbox_hdr_sge_cnt_SHIFT	3
918da0436e9SJames Smart #define lpfc_mbox_hdr_sge_cnt_MASK	0x0000001F
919da0436e9SJames Smart #define lpfc_mbox_hdr_sge_cnt_WORD	word1
920da0436e9SJames Smart 	uint32_t payload_length;
921da0436e9SJames Smart 	uint32_t tag_lo;
922da0436e9SJames Smart 	uint32_t tag_hi;
923da0436e9SJames Smart 	uint32_t reserved5;
924da0436e9SJames Smart };
925da0436e9SJames Smart 
926da0436e9SJames Smart union lpfc_sli4_cfg_shdr {
927da0436e9SJames Smart 	struct {
928da0436e9SJames Smart 		uint32_t word6;
929da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_SHIFT	0
930da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_MASK	0x000000FF
931da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_WORD	word6
932da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_SHIFT	8
933da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_MASK	0x000000FF
934da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_WORD	word6
935da0436e9SJames Smart #define lpfc_mbox_hdr_port_number_SHIFT	16
936da0436e9SJames Smart #define lpfc_mbox_hdr_port_number_MASK	0x000000FF
937da0436e9SJames Smart #define lpfc_mbox_hdr_port_number_WORD	word6
938da0436e9SJames Smart #define lpfc_mbox_hdr_domain_SHIFT	24
939da0436e9SJames Smart #define lpfc_mbox_hdr_domain_MASK	0x000000FF
940da0436e9SJames Smart #define lpfc_mbox_hdr_domain_WORD	word6
941da0436e9SJames Smart 		uint32_t timeout;
942da0436e9SJames Smart 		uint32_t request_length;
9435a6f133eSJames Smart 		uint32_t word9;
9445a6f133eSJames Smart #define lpfc_mbox_hdr_version_SHIFT	0
9455a6f133eSJames Smart #define lpfc_mbox_hdr_version_MASK	0x000000FF
9465a6f133eSJames Smart #define lpfc_mbox_hdr_version_WORD	word9
947912e3acdSJames Smart #define lpfc_mbox_hdr_pf_num_SHIFT	16
948912e3acdSJames Smart #define lpfc_mbox_hdr_pf_num_MASK	0x000000FF
949912e3acdSJames Smart #define lpfc_mbox_hdr_pf_num_WORD	word9
950912e3acdSJames Smart #define lpfc_mbox_hdr_vh_num_SHIFT	24
951912e3acdSJames Smart #define lpfc_mbox_hdr_vh_num_MASK	0x000000FF
952912e3acdSJames Smart #define lpfc_mbox_hdr_vh_num_WORD	word9
9535a6f133eSJames Smart #define LPFC_Q_CREATE_VERSION_2	2
9545a6f133eSJames Smart #define LPFC_Q_CREATE_VERSION_1	1
9555a6f133eSJames Smart #define LPFC_Q_CREATE_VERSION_0	0
956cd1c8301SJames Smart #define LPFC_OPCODE_VERSION_0	0
957cd1c8301SJames Smart #define LPFC_OPCODE_VERSION_1	1
958da0436e9SJames Smart 	} request;
959da0436e9SJames Smart 	struct {
960da0436e9SJames Smart 		uint32_t word6;
961da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_SHIFT		0
962da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_MASK		0x000000FF
963da0436e9SJames Smart #define lpfc_mbox_hdr_opcode_WORD		word6
964da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_SHIFT		8
965da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_MASK		0x000000FF
966da0436e9SJames Smart #define lpfc_mbox_hdr_subsystem_WORD		word6
967da0436e9SJames Smart #define lpfc_mbox_hdr_domain_SHIFT		24
968da0436e9SJames Smart #define lpfc_mbox_hdr_domain_MASK		0x000000FF
969da0436e9SJames Smart #define lpfc_mbox_hdr_domain_WORD		word6
970da0436e9SJames Smart 		uint32_t word7;
971da0436e9SJames Smart #define lpfc_mbox_hdr_status_SHIFT		0
972da0436e9SJames Smart #define lpfc_mbox_hdr_status_MASK		0x000000FF
973da0436e9SJames Smart #define lpfc_mbox_hdr_status_WORD		word7
974da0436e9SJames Smart #define lpfc_mbox_hdr_add_status_SHIFT		8
975da0436e9SJames Smart #define lpfc_mbox_hdr_add_status_MASK		0x000000FF
976da0436e9SJames Smart #define lpfc_mbox_hdr_add_status_WORD		word7
97716a93e83SJames Smart #define LPFC_ADD_STATUS_INCOMPAT_OBJ		0xA2
97816a93e83SJames Smart #define lpfc_mbox_hdr_add_status_2_SHIFT	16
97916a93e83SJames Smart #define lpfc_mbox_hdr_add_status_2_MASK		0x000000FF
98016a93e83SJames Smart #define lpfc_mbox_hdr_add_status_2_WORD		word7
98116a93e83SJames Smart #define LPFC_ADD_STATUS_2_INCOMPAT_FLASH	0x01
98216a93e83SJames Smart #define LPFC_ADD_STATUS_2_INCORRECT_ASIC	0x02
983da0436e9SJames Smart 		uint32_t response_length;
984da0436e9SJames Smart 		uint32_t actual_response_length;
985da0436e9SJames Smart 	} response;
986da0436e9SJames Smart };
987da0436e9SJames Smart 
9886d368e53SJames Smart /* Mailbox Header structures.
9896d368e53SJames Smart  * struct mbox_header is defined for first generation SLI4_CFG mailbox
9906d368e53SJames Smart  * calls deployed for BE-based ports.
9916d368e53SJames Smart  *
9926d368e53SJames Smart  * struct sli4_mbox_header is defined for second generation SLI4
9936d368e53SJames Smart  * ports that don't deploy the SLI4_CFG mechanism.
9946d368e53SJames Smart  */
995da0436e9SJames Smart struct mbox_header {
996da0436e9SJames Smart 	struct lpfc_sli4_cfg_mhdr cfg_mhdr;
997da0436e9SJames Smart 	union  lpfc_sli4_cfg_shdr cfg_shdr;
998da0436e9SJames Smart };
999da0436e9SJames Smart 
10006d368e53SJames Smart #define LPFC_EXTENT_LOCAL		0
10016d368e53SJames Smart #define LPFC_TIMEOUT_DEFAULT		0
10026d368e53SJames Smart #define LPFC_EXTENT_VERSION_DEFAULT	0
10036d368e53SJames Smart 
1004da0436e9SJames Smart /* Subsystem Definitions */
1005a183a15fSJames Smart #define LPFC_MBOX_SUBSYSTEM_NA		0x0
1006da0436e9SJames Smart #define LPFC_MBOX_SUBSYSTEM_COMMON	0x1
1007d2cc9bcdSJames Smart #define LPFC_MBOX_SUBSYSTEM_LOWLEVEL	0xB
1008da0436e9SJames Smart #define LPFC_MBOX_SUBSYSTEM_FCOE	0xC
1009da0436e9SJames Smart 
1010da0436e9SJames Smart /* Device Specific Definitions */
1011da0436e9SJames Smart 
1012da0436e9SJames Smart /* The HOST ENDIAN defines are in Big Endian format. */
1013da0436e9SJames Smart #define HOST_ENDIAN_LOW_WORD0   0xFF3412FF
1014da0436e9SJames Smart #define HOST_ENDIAN_HIGH_WORD1	0xFF7856FF
1015da0436e9SJames Smart 
1016da0436e9SJames Smart /* Common Opcodes */
1017a183a15fSJames Smart #define LPFC_MBOX_OPCODE_NA				0x00
1018da0436e9SJames Smart #define LPFC_MBOX_OPCODE_CQ_CREATE			0x0C
1019da0436e9SJames Smart #define LPFC_MBOX_OPCODE_EQ_CREATE			0x0D
1020da0436e9SJames Smart #define LPFC_MBOX_OPCODE_MQ_CREATE			0x15
1021da0436e9SJames Smart #define LPFC_MBOX_OPCODE_GET_CNTL_ATTRIBUTES		0x20
1022da0436e9SJames Smart #define LPFC_MBOX_OPCODE_NOP				0x21
1023173edbb2SJames Smart #define LPFC_MBOX_OPCODE_MODIFY_EQ_DELAY		0x29
1024da0436e9SJames Smart #define LPFC_MBOX_OPCODE_MQ_DESTROY			0x35
1025da0436e9SJames Smart #define LPFC_MBOX_OPCODE_CQ_DESTROY			0x36
1026da0436e9SJames Smart #define LPFC_MBOX_OPCODE_EQ_DESTROY			0x37
10276669f9bbSJames Smart #define LPFC_MBOX_OPCODE_QUERY_FW_CFG			0x3A
1028da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FUNCTION_RESET			0x3D
1029940eb687SJames Smart #define LPFC_MBOX_OPCODE_SET_PHYSICAL_LINK_CONFIG	0x3E
1030940eb687SJames Smart #define LPFC_MBOX_OPCODE_SET_BOOT_CONFIG		0x43
10318b017a30SJames Smart #define LPFC_MBOX_OPCODE_SET_BEACON_CONFIG              0x45
10328b017a30SJames Smart #define LPFC_MBOX_OPCODE_GET_BEACON_CONFIG              0x46
1033cd1c8301SJames Smart #define LPFC_MBOX_OPCODE_GET_PORT_NAME			0x4D
1034b19a061aSJames Smart #define LPFC_MBOX_OPCODE_MQ_CREATE_EXT			0x5A
1035940eb687SJames Smart #define LPFC_MBOX_OPCODE_GET_VPD_DATA			0x5B
103661bda8f7SJames Smart #define LPFC_MBOX_OPCODE_SET_HOST_DATA			0x5D
1037940eb687SJames Smart #define LPFC_MBOX_OPCODE_SEND_ACTIVATION		0x73
1038940eb687SJames Smart #define LPFC_MBOX_OPCODE_RESET_LICENSES			0x74
10398c42a65cSJames Smart #define LPFC_MBOX_OPCODE_REG_CONGESTION_BUF		0x8E
10406d368e53SJames Smart #define LPFC_MBOX_OPCODE_GET_RSRC_EXTENT_INFO		0x9A
10416d368e53SJames Smart #define LPFC_MBOX_OPCODE_GET_ALLOC_RSRC_EXTENT		0x9B
10426d368e53SJames Smart #define LPFC_MBOX_OPCODE_ALLOC_RSRC_EXTENT		0x9C
10436d368e53SJames Smart #define LPFC_MBOX_OPCODE_DEALLOC_RSRC_EXTENT		0x9D
1044912e3acdSJames Smart #define LPFC_MBOX_OPCODE_GET_FUNCTION_CONFIG		0xA0
1045940eb687SJames Smart #define LPFC_MBOX_OPCODE_GET_PROFILE_CAPACITIES		0xA1
1046912e3acdSJames Smart #define LPFC_MBOX_OPCODE_GET_PROFILE_CONFIG		0xA4
1047a183a15fSJames Smart #define LPFC_MBOX_OPCODE_SET_PROFILE_CONFIG		0xA5
1048a183a15fSJames Smart #define LPFC_MBOX_OPCODE_GET_PROFILE_LIST		0xA6
1049a183a15fSJames Smart #define LPFC_MBOX_OPCODE_SET_ACT_PROFILE		0xA8
1050a183a15fSJames Smart #define LPFC_MBOX_OPCODE_GET_FACTORY_PROFILE_CONFIG	0xA9
1051a183a15fSJames Smart #define LPFC_MBOX_OPCODE_READ_OBJECT			0xAB
105252d52440SJames Smart #define LPFC_MBOX_OPCODE_WRITE_OBJECT			0xAC
1053a183a15fSJames Smart #define LPFC_MBOX_OPCODE_READ_OBJECT_LIST		0xAD
1054a183a15fSJames Smart #define LPFC_MBOX_OPCODE_DELETE_OBJECT			0xAE
1055fedd3b7bSJames Smart #define LPFC_MBOX_OPCODE_GET_SLI4_PARAMETERS		0xB5
105665791f1fSJames Smart #define LPFC_MBOX_OPCODE_SET_FEATURES                   0xBF
1057da0436e9SJames Smart 
1058da0436e9SJames Smart /* FCoE Opcodes */
1059da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_WQ_CREATE			0x01
1060da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_WQ_DESTROY		0x02
1061da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_POST_SGL_PAGES		0x03
1062da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_REMOVE_SGL_PAGES		0x04
1063da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_RQ_CREATE			0x05
1064da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_RQ_DESTROY		0x06
1065da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_READ_FCF_TABLE		0x08
1066da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_ADD_FCF			0x09
1067da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_DELETE_FCF		0x0A
1068da0436e9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_POST_HDR_TEMPLATE		0x0B
1069ecfd03c6SJames Smart #define LPFC_MBOX_OPCODE_FCOE_REDISCOVER_FCF		0x10
10702d7dbc4cSJames Smart #define LPFC_MBOX_OPCODE_FCOE_CQ_CREATE_SET		0x1D
1071a183a15fSJames Smart #define LPFC_MBOX_OPCODE_FCOE_SET_FCLINK_SETTINGS	0x21
10727ad20aa9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_STATE		0x22
10737ad20aa9SJames Smart #define LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_LOOPBACK	0x23
10741dc5ec24SJames Smart #define LPFC_MBOX_OPCODE_FCOE_FC_SET_TRUNK_MODE		0x42
1075da0436e9SJames Smart 
1076d2cc9bcdSJames Smart /* Low level Opcodes */
1077d2cc9bcdSJames Smart #define LPFC_MBOX_OPCODE_SET_DIAG_LOG_OPTION		0x37
1078d2cc9bcdSJames Smart 
1079da0436e9SJames Smart /* Mailbox command structures */
1080da0436e9SJames Smart struct eq_context {
1081da0436e9SJames Smart 	uint32_t word0;
1082da0436e9SJames Smart #define lpfc_eq_context_size_SHIFT	31
1083da0436e9SJames Smart #define lpfc_eq_context_size_MASK	0x00000001
1084da0436e9SJames Smart #define lpfc_eq_context_size_WORD	word0
1085da0436e9SJames Smart #define LPFC_EQE_SIZE_4			0x0
1086da0436e9SJames Smart #define LPFC_EQE_SIZE_16		0x1
1087da0436e9SJames Smart #define lpfc_eq_context_valid_SHIFT	29
1088da0436e9SJames Smart #define lpfc_eq_context_valid_MASK	0x00000001
1089da0436e9SJames Smart #define lpfc_eq_context_valid_WORD	word0
10907365f6fdSJames Smart #define lpfc_eq_context_autovalid_SHIFT 28
10917365f6fdSJames Smart #define lpfc_eq_context_autovalid_MASK  0x00000001
10927365f6fdSJames Smart #define lpfc_eq_context_autovalid_WORD  word0
1093da0436e9SJames Smart 	uint32_t word1;
1094da0436e9SJames Smart #define lpfc_eq_context_count_SHIFT	26
1095da0436e9SJames Smart #define lpfc_eq_context_count_MASK	0x00000003
1096da0436e9SJames Smart #define lpfc_eq_context_count_WORD	word1
1097da0436e9SJames Smart #define LPFC_EQ_CNT_256		0x0
1098da0436e9SJames Smart #define LPFC_EQ_CNT_512		0x1
1099da0436e9SJames Smart #define LPFC_EQ_CNT_1024	0x2
1100da0436e9SJames Smart #define LPFC_EQ_CNT_2048	0x3
1101da0436e9SJames Smart #define LPFC_EQ_CNT_4096	0x4
1102da0436e9SJames Smart 	uint32_t word2;
1103da0436e9SJames Smart #define lpfc_eq_context_delay_multi_SHIFT	13
1104da0436e9SJames Smart #define lpfc_eq_context_delay_multi_MASK	0x000003FF
1105da0436e9SJames Smart #define lpfc_eq_context_delay_multi_WORD	word2
1106da0436e9SJames Smart 	uint32_t reserved3;
1107da0436e9SJames Smart };
1108da0436e9SJames Smart 
1109173edbb2SJames Smart struct eq_delay_info {
1110173edbb2SJames Smart 	uint32_t eq_id;
1111173edbb2SJames Smart 	uint32_t phase;
1112173edbb2SJames Smart 	uint32_t delay_multi;
1113173edbb2SJames Smart };
111443140ca6SJames Smart #define	LPFC_MAX_EQ_DELAY_EQID_CNT	8
1115173edbb2SJames Smart 
1116da0436e9SJames Smart struct sgl_page_pairs {
1117da0436e9SJames Smart 	uint32_t sgl_pg0_addr_lo;
1118da0436e9SJames Smart 	uint32_t sgl_pg0_addr_hi;
1119da0436e9SJames Smart 	uint32_t sgl_pg1_addr_lo;
1120da0436e9SJames Smart 	uint32_t sgl_pg1_addr_hi;
1121da0436e9SJames Smart };
1122da0436e9SJames Smart 
1123da0436e9SJames Smart struct lpfc_mbx_post_sgl_pages {
1124da0436e9SJames Smart 	struct mbox_header header;
1125da0436e9SJames Smart 	uint32_t word0;
1126da0436e9SJames Smart #define lpfc_post_sgl_pages_xri_SHIFT	0
1127da0436e9SJames Smart #define lpfc_post_sgl_pages_xri_MASK	0x0000FFFF
1128da0436e9SJames Smart #define lpfc_post_sgl_pages_xri_WORD	word0
1129da0436e9SJames Smart #define lpfc_post_sgl_pages_xricnt_SHIFT	16
1130da0436e9SJames Smart #define lpfc_post_sgl_pages_xricnt_MASK	0x0000FFFF
1131da0436e9SJames Smart #define lpfc_post_sgl_pages_xricnt_WORD	word0
1132da0436e9SJames Smart 	struct sgl_page_pairs  sgl_pg_pairs[1];
1133da0436e9SJames Smart };
1134da0436e9SJames Smart 
1135da0436e9SJames Smart /* word0 of page-1 struct shares the same SHIFT/MASK/WORD defines as above */
1136da0436e9SJames Smart struct lpfc_mbx_post_uembed_sgl_page1 {
1137da0436e9SJames Smart 	union  lpfc_sli4_cfg_shdr cfg_shdr;
1138da0436e9SJames Smart 	uint32_t word0;
1139da0436e9SJames Smart 	struct sgl_page_pairs sgl_pg_pairs;
1140da0436e9SJames Smart };
1141da0436e9SJames Smart 
1142da0436e9SJames Smart struct lpfc_mbx_sge {
1143da0436e9SJames Smart 	uint32_t pa_lo;
1144da0436e9SJames Smart 	uint32_t pa_hi;
1145da0436e9SJames Smart 	uint32_t length;
1146da0436e9SJames Smart };
1147da0436e9SJames Smart 
114872df8a45SJames Smart struct lpfc_mbx_host_buf {
114972df8a45SJames Smart 	uint32_t length;
115072df8a45SJames Smart 	uint32_t pa_lo;
115172df8a45SJames Smart 	uint32_t pa_hi;
115272df8a45SJames Smart };
115372df8a45SJames Smart 
1154da0436e9SJames Smart struct lpfc_mbx_nembed_cmd {
1155da0436e9SJames Smart 	struct lpfc_sli4_cfg_mhdr cfg_mhdr;
1156da0436e9SJames Smart #define LPFC_SLI4_MBX_SGE_MAX_PAGES	19
1157da0436e9SJames Smart 	struct lpfc_mbx_sge sge[LPFC_SLI4_MBX_SGE_MAX_PAGES];
1158da0436e9SJames Smart };
1159da0436e9SJames Smart 
1160da0436e9SJames Smart struct lpfc_mbx_nembed_sge_virt {
1161da0436e9SJames Smart 	void *addr[LPFC_SLI4_MBX_SGE_MAX_PAGES];
1162da0436e9SJames Smart };
1163da0436e9SJames Smart 
116474a7baa2SJames Smart #define LPFC_MBX_OBJECT_NAME_LEN_DW	26
116572df8a45SJames Smart struct lpfc_mbx_read_object {  /* Version 0 */
116672df8a45SJames Smart 	struct mbox_header header;
116772df8a45SJames Smart 	union {
116872df8a45SJames Smart 		struct {
116972df8a45SJames Smart 			uint32_t word0;
117072df8a45SJames Smart #define lpfc_mbx_rd_object_rlen_SHIFT	0
117172df8a45SJames Smart #define lpfc_mbx_rd_object_rlen_MASK	0x00FFFFFF
117272df8a45SJames Smart #define lpfc_mbx_rd_object_rlen_WORD	word0
117372df8a45SJames Smart 			uint32_t rd_object_offset;
117474a7baa2SJames Smart 			uint32_t rd_object_name[LPFC_MBX_OBJECT_NAME_LEN_DW];
117572df8a45SJames Smart #define LPFC_OBJ_NAME_SZ 104   /* 26 x sizeof(uint32_t) is 104. */
117672df8a45SJames Smart 			uint32_t rd_object_cnt;
117772df8a45SJames Smart 			struct lpfc_mbx_host_buf rd_object_hbuf[4];
117872df8a45SJames Smart 		} request;
117972df8a45SJames Smart 		struct {
118072df8a45SJames Smart 			uint32_t rd_object_actual_rlen;
118172df8a45SJames Smart 			uint32_t word1;
118272df8a45SJames Smart #define lpfc_mbx_rd_object_eof_SHIFT	31
118372df8a45SJames Smart #define lpfc_mbx_rd_object_eof_MASK	0x1
118472df8a45SJames Smart #define lpfc_mbx_rd_object_eof_WORD	word1
118572df8a45SJames Smart 		} response;
118672df8a45SJames Smart 	} u;
118772df8a45SJames Smart };
118872df8a45SJames Smart 
1189da0436e9SJames Smart struct lpfc_mbx_eq_create {
1190da0436e9SJames Smart 	struct mbox_header header;
1191da0436e9SJames Smart 	union {
1192da0436e9SJames Smart 		struct {
1193da0436e9SJames Smart 			uint32_t word0;
1194da0436e9SJames Smart #define lpfc_mbx_eq_create_num_pages_SHIFT	0
1195da0436e9SJames Smart #define lpfc_mbx_eq_create_num_pages_MASK	0x0000FFFF
1196da0436e9SJames Smart #define lpfc_mbx_eq_create_num_pages_WORD	word0
1197da0436e9SJames Smart 			struct eq_context context;
1198da0436e9SJames Smart 			struct dma_address page[LPFC_MAX_EQ_PAGE];
1199da0436e9SJames Smart 		} request;
1200da0436e9SJames Smart 		struct {
1201da0436e9SJames Smart 			uint32_t word0;
1202da0436e9SJames Smart #define lpfc_mbx_eq_create_q_id_SHIFT	0
1203da0436e9SJames Smart #define lpfc_mbx_eq_create_q_id_MASK	0x0000FFFF
1204da0436e9SJames Smart #define lpfc_mbx_eq_create_q_id_WORD	word0
1205da0436e9SJames Smart 		} response;
1206da0436e9SJames Smart 	} u;
1207da0436e9SJames Smart };
1208da0436e9SJames Smart 
1209173edbb2SJames Smart struct lpfc_mbx_modify_eq_delay {
1210173edbb2SJames Smart 	struct mbox_header header;
1211173edbb2SJames Smart 	union {
1212173edbb2SJames Smart 		struct {
1213173edbb2SJames Smart 			uint32_t num_eq;
121443140ca6SJames Smart 			struct eq_delay_info eq[LPFC_MAX_EQ_DELAY_EQID_CNT];
1215173edbb2SJames Smart 		} request;
1216173edbb2SJames Smart 		struct {
1217173edbb2SJames Smart 			uint32_t word0;
1218173edbb2SJames Smart 		} response;
1219173edbb2SJames Smart 	} u;
1220173edbb2SJames Smart };
1221173edbb2SJames Smart 
1222da0436e9SJames Smart struct lpfc_mbx_eq_destroy {
1223da0436e9SJames Smart 	struct mbox_header header;
1224da0436e9SJames Smart 	union {
1225da0436e9SJames Smart 		struct {
1226da0436e9SJames Smart 			uint32_t word0;
1227da0436e9SJames Smart #define lpfc_mbx_eq_destroy_q_id_SHIFT	0
1228da0436e9SJames Smart #define lpfc_mbx_eq_destroy_q_id_MASK	0x0000FFFF
1229da0436e9SJames Smart #define lpfc_mbx_eq_destroy_q_id_WORD	word0
1230da0436e9SJames Smart 		} request;
1231da0436e9SJames Smart 		struct {
1232da0436e9SJames Smart 			uint32_t word0;
1233da0436e9SJames Smart 		} response;
1234da0436e9SJames Smart 	} u;
1235da0436e9SJames Smart };
1236da0436e9SJames Smart 
1237da0436e9SJames Smart struct lpfc_mbx_nop {
1238da0436e9SJames Smart 	struct mbox_header header;
1239da0436e9SJames Smart 	uint32_t context[2];
1240da0436e9SJames Smart };
1241da0436e9SJames Smart 
1242d2cc9bcdSJames Smart 
1243d2cc9bcdSJames Smart 
1244d2cc9bcdSJames Smart struct lpfc_mbx_set_ras_fwlog {
1245d2cc9bcdSJames Smart 	struct mbox_header header;
1246d2cc9bcdSJames Smart 	union {
1247d2cc9bcdSJames Smart 		struct {
1248d2cc9bcdSJames Smart 			uint32_t word4;
1249d2cc9bcdSJames Smart #define lpfc_fwlog_enable_SHIFT		0
1250d2cc9bcdSJames Smart #define lpfc_fwlog_enable_MASK		0x00000001
1251d2cc9bcdSJames Smart #define lpfc_fwlog_enable_WORD		word4
1252d2cc9bcdSJames Smart #define lpfc_fwlog_loglvl_SHIFT		8
1253d2cc9bcdSJames Smart #define lpfc_fwlog_loglvl_MASK		0x0000000F
1254d2cc9bcdSJames Smart #define lpfc_fwlog_loglvl_WORD		word4
1255d2cc9bcdSJames Smart #define lpfc_fwlog_ra_SHIFT		15
1256d2cc9bcdSJames Smart #define lpfc_fwlog_ra_WORD		0x00000008
1257d2cc9bcdSJames Smart #define lpfc_fwlog_buffcnt_SHIFT	16
1258d2cc9bcdSJames Smart #define lpfc_fwlog_buffcnt_MASK		0x000000FF
1259d2cc9bcdSJames Smart #define lpfc_fwlog_buffcnt_WORD		word4
1260d2cc9bcdSJames Smart #define lpfc_fwlog_buffsz_SHIFT		24
1261d2cc9bcdSJames Smart #define lpfc_fwlog_buffsz_MASK		0x000000FF
1262d2cc9bcdSJames Smart #define lpfc_fwlog_buffsz_WORD		word4
1263d2cc9bcdSJames Smart 			uint32_t word5;
1264d2cc9bcdSJames Smart #define lpfc_fwlog_acqe_SHIFT		0
1265d2cc9bcdSJames Smart #define lpfc_fwlog_acqe_MASK		0x0000FFFF
1266d2cc9bcdSJames Smart #define lpfc_fwlog_acqe_WORD		word5
1267d2cc9bcdSJames Smart #define lpfc_fwlog_cqid_SHIFT		16
1268d2cc9bcdSJames Smart #define lpfc_fwlog_cqid_MASK		0x0000FFFF
1269d2cc9bcdSJames Smart #define lpfc_fwlog_cqid_WORD		word5
1270d2cc9bcdSJames Smart #define LPFC_MAX_FWLOG_PAGE	16
1271d2cc9bcdSJames Smart 			struct dma_address lwpd;
1272d2cc9bcdSJames Smart 			struct dma_address buff_fwlog[LPFC_MAX_FWLOG_PAGE];
1273d2cc9bcdSJames Smart 		} request;
1274d2cc9bcdSJames Smart 		struct {
1275d2cc9bcdSJames Smart 			uint32_t word0;
1276d2cc9bcdSJames Smart 		} response;
1277d2cc9bcdSJames Smart 	} u;
1278d2cc9bcdSJames Smart };
1279d2cc9bcdSJames Smart 
1280d2cc9bcdSJames Smart 
1281da0436e9SJames Smart struct cq_context {
1282da0436e9SJames Smart 	uint32_t word0;
1283da0436e9SJames Smart #define lpfc_cq_context_event_SHIFT	31
1284da0436e9SJames Smart #define lpfc_cq_context_event_MASK	0x00000001
1285da0436e9SJames Smart #define lpfc_cq_context_event_WORD	word0
1286da0436e9SJames Smart #define lpfc_cq_context_valid_SHIFT	29
1287da0436e9SJames Smart #define lpfc_cq_context_valid_MASK	0x00000001
1288da0436e9SJames Smart #define lpfc_cq_context_valid_WORD	word0
1289da0436e9SJames Smart #define lpfc_cq_context_count_SHIFT	27
1290da0436e9SJames Smart #define lpfc_cq_context_count_MASK	0x00000003
1291da0436e9SJames Smart #define lpfc_cq_context_count_WORD	word0
1292da0436e9SJames Smart #define LPFC_CQ_CNT_256		0x0
1293da0436e9SJames Smart #define LPFC_CQ_CNT_512		0x1
1294da0436e9SJames Smart #define LPFC_CQ_CNT_1024	0x2
129581b96edaSJames Smart #define LPFC_CQ_CNT_WORD7	0x3
12967365f6fdSJames Smart #define lpfc_cq_context_autovalid_SHIFT 15
12977365f6fdSJames Smart #define lpfc_cq_context_autovalid_MASK  0x00000001
12987365f6fdSJames Smart #define lpfc_cq_context_autovalid_WORD  word0
1299da0436e9SJames Smart 	uint32_t word1;
13005a6f133eSJames Smart #define lpfc_cq_eq_id_SHIFT		22	/* Version 0 Only */
1301da0436e9SJames Smart #define lpfc_cq_eq_id_MASK		0x000000FF
1302da0436e9SJames Smart #define lpfc_cq_eq_id_WORD		word1
13035a6f133eSJames Smart #define lpfc_cq_eq_id_2_SHIFT		0 	/* Version 2 Only */
13045a6f133eSJames Smart #define lpfc_cq_eq_id_2_MASK		0x0000FFFF
13055a6f133eSJames Smart #define lpfc_cq_eq_id_2_WORD		word1
130681b96edaSJames Smart 	uint32_t lpfc_cq_context_count;		/* Version 2 Only */
1307da0436e9SJames Smart 	uint32_t reserved1;
1308da0436e9SJames Smart };
1309da0436e9SJames Smart 
1310da0436e9SJames Smart struct lpfc_mbx_cq_create {
1311da0436e9SJames Smart 	struct mbox_header header;
1312da0436e9SJames Smart 	union {
1313da0436e9SJames Smart 		struct {
1314da0436e9SJames Smart 			uint32_t word0;
13155a6f133eSJames Smart #define lpfc_mbx_cq_create_page_size_SHIFT	16	/* Version 2 Only */
13165a6f133eSJames Smart #define lpfc_mbx_cq_create_page_size_MASK	0x000000FF
13175a6f133eSJames Smart #define lpfc_mbx_cq_create_page_size_WORD	word0
1318da0436e9SJames Smart #define lpfc_mbx_cq_create_num_pages_SHIFT	0
1319da0436e9SJames Smart #define lpfc_mbx_cq_create_num_pages_MASK	0x0000FFFF
1320da0436e9SJames Smart #define lpfc_mbx_cq_create_num_pages_WORD	word0
1321da0436e9SJames Smart 			struct cq_context context;
1322da0436e9SJames Smart 			struct dma_address page[LPFC_MAX_CQ_PAGE];
1323da0436e9SJames Smart 		} request;
1324da0436e9SJames Smart 		struct {
1325da0436e9SJames Smart 			uint32_t word0;
1326da0436e9SJames Smart #define lpfc_mbx_cq_create_q_id_SHIFT	0
1327da0436e9SJames Smart #define lpfc_mbx_cq_create_q_id_MASK	0x0000FFFF
1328da0436e9SJames Smart #define lpfc_mbx_cq_create_q_id_WORD	word0
1329da0436e9SJames Smart 		} response;
1330da0436e9SJames Smart 	} u;
1331da0436e9SJames Smart };
1332da0436e9SJames Smart 
13332d7dbc4cSJames Smart struct lpfc_mbx_cq_create_set {
13342d7dbc4cSJames Smart 	union  lpfc_sli4_cfg_shdr cfg_shdr;
13352d7dbc4cSJames Smart 	union {
13362d7dbc4cSJames Smart 		struct {
13372d7dbc4cSJames Smart 			uint32_t word0;
13382d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_page_size_SHIFT	16	/* Version 2 Only */
13392d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_page_size_MASK	0x000000FF
13402d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_page_size_WORD	word0
13412d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_num_pages_SHIFT	0
13422d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_num_pages_MASK	0x0000FFFF
13432d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_num_pages_WORD	word0
13442d7dbc4cSJames Smart 			uint32_t word1;
13452d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_evt_SHIFT	31
13462d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_evt_MASK		0x00000001
13472d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_evt_WORD		word1
13482d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_valid_SHIFT	29
13492d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_valid_MASK	0x00000001
13502d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_valid_WORD	word1
13512d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_cqe_cnt_SHIFT	27
13522d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_cqe_cnt_MASK	0x00000003
13532d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_cqe_cnt_WORD	word1
13542d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_cqe_size_SHIFT	25
13552d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_cqe_size_MASK	0x00000003
13562d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_cqe_size_WORD	word1
13577365f6fdSJames Smart #define lpfc_mbx_cq_create_set_autovalid_SHIFT	15
13587365f6fdSJames Smart #define lpfc_mbx_cq_create_set_autovalid_MASK	0x0000001
13597365f6fdSJames Smart #define lpfc_mbx_cq_create_set_autovalid_WORD	word1
13602d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_nodelay_SHIFT	14
13612d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_nodelay_MASK	0x00000001
13622d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_nodelay_WORD	word1
13632d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_clswm_SHIFT	12
13642d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_clswm_MASK	0x00000003
13652d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_clswm_WORD	word1
13662d7dbc4cSJames Smart 			uint32_t word2;
13672d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_arm_SHIFT	31
13682d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_arm_MASK		0x00000001
13692d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_arm_WORD		word2
137081b96edaSJames Smart #define lpfc_mbx_cq_create_set_cq_cnt_SHIFT	16
137181b96edaSJames Smart #define lpfc_mbx_cq_create_set_cq_cnt_MASK	0x00007FFF
137281b96edaSJames Smart #define lpfc_mbx_cq_create_set_cq_cnt_WORD	word2
13732d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_num_cq_SHIFT	0
13742d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_num_cq_MASK	0x0000FFFF
13752d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_num_cq_WORD	word2
13762d7dbc4cSJames Smart 			uint32_t word3;
13772d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id1_SHIFT	16
13782d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id1_MASK	0x0000FFFF
13792d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id1_WORD	word3
13802d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id0_SHIFT	0
13812d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id0_MASK	0x0000FFFF
13822d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id0_WORD	word3
13832d7dbc4cSJames Smart 			uint32_t word4;
13842d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id3_SHIFT	16
13852d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id3_MASK	0x0000FFFF
13862d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id3_WORD	word4
13872d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id2_SHIFT	0
13882d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id2_MASK	0x0000FFFF
13892d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id2_WORD	word4
13902d7dbc4cSJames Smart 			uint32_t word5;
13912d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id5_SHIFT	16
13922d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id5_MASK	0x0000FFFF
13932d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id5_WORD	word5
13942d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id4_SHIFT	0
13952d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id4_MASK	0x0000FFFF
13962d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id4_WORD	word5
13972d7dbc4cSJames Smart 			uint32_t word6;
13982d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id7_SHIFT	16
13992d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id7_MASK	0x0000FFFF
14002d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id7_WORD	word6
14012d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id6_SHIFT	0
14022d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id6_MASK	0x0000FFFF
14032d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id6_WORD	word6
14042d7dbc4cSJames Smart 			uint32_t word7;
14052d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id9_SHIFT	16
14062d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id9_MASK	0x0000FFFF
14072d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id9_WORD	word7
14082d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id8_SHIFT	0
14092d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id8_MASK	0x0000FFFF
14102d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id8_WORD	word7
14112d7dbc4cSJames Smart 			uint32_t word8;
14122d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id11_SHIFT	16
14132d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id11_MASK	0x0000FFFF
14142d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id11_WORD	word8
14152d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id10_SHIFT	0
14162d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id10_MASK	0x0000FFFF
14172d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id10_WORD	word8
14182d7dbc4cSJames Smart 			uint32_t word9;
14192d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id13_SHIFT	16
14202d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id13_MASK	0x0000FFFF
14212d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id13_WORD	word9
14222d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id12_SHIFT	0
14232d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id12_MASK	0x0000FFFF
14242d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id12_WORD	word9
14252d7dbc4cSJames Smart 			uint32_t word10;
14262d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id15_SHIFT	16
14272d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id15_MASK	0x0000FFFF
14282d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id15_WORD	word10
14292d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id14_SHIFT	0
14302d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id14_MASK	0x0000FFFF
14312d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_eq_id14_WORD	word10
14322d7dbc4cSJames Smart 			struct dma_address page[1];
14332d7dbc4cSJames Smart 		} request;
14342d7dbc4cSJames Smart 		struct {
14352d7dbc4cSJames Smart 			uint32_t word0;
14362d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_num_alloc_SHIFT	16
14372d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_num_alloc_MASK	0x0000FFFF
14382d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_num_alloc_WORD	word0
14392d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_base_id_SHIFT	0
14402d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_base_id_MASK	0x0000FFFF
14412d7dbc4cSJames Smart #define lpfc_mbx_cq_create_set_base_id_WORD	word0
14422d7dbc4cSJames Smart 		} response;
14432d7dbc4cSJames Smart 	} u;
14442d7dbc4cSJames Smart };
14452d7dbc4cSJames Smart 
1446da0436e9SJames Smart struct lpfc_mbx_cq_destroy {
1447da0436e9SJames Smart 	struct mbox_header header;
1448da0436e9SJames Smart 	union {
1449da0436e9SJames Smart 		struct {
1450da0436e9SJames Smart 			uint32_t word0;
1451da0436e9SJames Smart #define lpfc_mbx_cq_destroy_q_id_SHIFT	0
1452da0436e9SJames Smart #define lpfc_mbx_cq_destroy_q_id_MASK	0x0000FFFF
1453da0436e9SJames Smart #define lpfc_mbx_cq_destroy_q_id_WORD	word0
1454da0436e9SJames Smart 		} request;
1455da0436e9SJames Smart 		struct {
1456da0436e9SJames Smart 			uint32_t word0;
1457da0436e9SJames Smart 		} response;
1458da0436e9SJames Smart 	} u;
1459da0436e9SJames Smart };
1460da0436e9SJames Smart 
1461da0436e9SJames Smart struct wq_context {
1462da0436e9SJames Smart 	uint32_t reserved0;
1463da0436e9SJames Smart 	uint32_t reserved1;
1464da0436e9SJames Smart 	uint32_t reserved2;
1465da0436e9SJames Smart 	uint32_t reserved3;
1466da0436e9SJames Smart };
1467da0436e9SJames Smart 
1468da0436e9SJames Smart struct lpfc_mbx_wq_create {
1469da0436e9SJames Smart 	struct mbox_header header;
1470da0436e9SJames Smart 	union {
14715a6f133eSJames Smart 		struct {	/* Version 0 Request */
1472da0436e9SJames Smart 			uint32_t word0;
1473da0436e9SJames Smart #define lpfc_mbx_wq_create_num_pages_SHIFT	0
1474962bc51bSJames Smart #define lpfc_mbx_wq_create_num_pages_MASK	0x000000FF
1475da0436e9SJames Smart #define lpfc_mbx_wq_create_num_pages_WORD	word0
1476962bc51bSJames Smart #define lpfc_mbx_wq_create_dua_SHIFT		8
1477962bc51bSJames Smart #define lpfc_mbx_wq_create_dua_MASK		0x00000001
1478962bc51bSJames Smart #define lpfc_mbx_wq_create_dua_WORD		word0
1479da0436e9SJames Smart #define lpfc_mbx_wq_create_cq_id_SHIFT		16
1480da0436e9SJames Smart #define lpfc_mbx_wq_create_cq_id_MASK		0x0000FFFF
1481da0436e9SJames Smart #define lpfc_mbx_wq_create_cq_id_WORD		word0
1482962bc51bSJames Smart 			struct dma_address page[LPFC_MAX_WQ_PAGE_V0];
1483962bc51bSJames Smart 			uint32_t word9;
1484962bc51bSJames Smart #define lpfc_mbx_wq_create_bua_SHIFT		0
1485962bc51bSJames Smart #define lpfc_mbx_wq_create_bua_MASK		0x00000001
1486962bc51bSJames Smart #define lpfc_mbx_wq_create_bua_WORD		word9
1487962bc51bSJames Smart #define lpfc_mbx_wq_create_ulp_num_SHIFT	8
1488962bc51bSJames Smart #define lpfc_mbx_wq_create_ulp_num_MASK		0x000000FF
1489962bc51bSJames Smart #define lpfc_mbx_wq_create_ulp_num_WORD		word9
1490da0436e9SJames Smart 		} request;
14915a6f133eSJames Smart 		struct {	/* Version 1 Request */
14925a6f133eSJames Smart 			uint32_t word0;	/* Word 0 is the same as in v0 */
14935a6f133eSJames Smart 			uint32_t word1;
14945a6f133eSJames Smart #define lpfc_mbx_wq_create_page_size_SHIFT	0
14955a6f133eSJames Smart #define lpfc_mbx_wq_create_page_size_MASK	0x000000FF
14965a6f133eSJames Smart #define lpfc_mbx_wq_create_page_size_WORD	word1
14978ea73db4SJames Smart #define LPFC_WQ_PAGE_SIZE_4096	0x1
14981351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_req_SHIFT	15
14991351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_req_MASK		0x00000001
15001351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_req_WORD		word1
15011351e69fSJames Smart #define lpfc_mbx_wq_create_doe_SHIFT		14
15021351e69fSJames Smart #define lpfc_mbx_wq_create_doe_MASK		0x00000001
15031351e69fSJames Smart #define lpfc_mbx_wq_create_doe_WORD		word1
15041351e69fSJames Smart #define lpfc_mbx_wq_create_toe_SHIFT		13
15051351e69fSJames Smart #define lpfc_mbx_wq_create_toe_MASK		0x00000001
15061351e69fSJames Smart #define lpfc_mbx_wq_create_toe_WORD		word1
15075a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_size_SHIFT	8
15085a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_size_MASK	0x0000000F
15095a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_size_WORD	word1
15105a6f133eSJames Smart #define LPFC_WQ_WQE_SIZE_64	0x5
15115a6f133eSJames Smart #define LPFC_WQ_WQE_SIZE_128	0x6
15125a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_count_SHIFT	16
15135a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_count_MASK	0x0000FFFF
15145a6f133eSJames Smart #define lpfc_mbx_wq_create_wqe_count_WORD	word1
15155a6f133eSJames Smart 			uint32_t word2;
15165a6f133eSJames Smart 			struct dma_address page[LPFC_MAX_WQ_PAGE-1];
15175a6f133eSJames Smart 		} request_1;
1518da0436e9SJames Smart 		struct {
1519da0436e9SJames Smart 			uint32_t word0;
1520da0436e9SJames Smart #define lpfc_mbx_wq_create_q_id_SHIFT	0
1521da0436e9SJames Smart #define lpfc_mbx_wq_create_q_id_MASK	0x0000FFFF
1522da0436e9SJames Smart #define lpfc_mbx_wq_create_q_id_WORD	word0
1523962bc51bSJames Smart 			uint32_t doorbell_offset;
1524962bc51bSJames Smart 			uint32_t word2;
1525962bc51bSJames Smart #define lpfc_mbx_wq_create_bar_set_SHIFT	0
1526962bc51bSJames Smart #define lpfc_mbx_wq_create_bar_set_MASK		0x0000FFFF
1527962bc51bSJames Smart #define lpfc_mbx_wq_create_bar_set_WORD		word2
1528962bc51bSJames Smart #define WQ_PCI_BAR_0_AND_1	0x00
1529962bc51bSJames Smart #define WQ_PCI_BAR_2_AND_3	0x01
1530962bc51bSJames Smart #define WQ_PCI_BAR_4_AND_5	0x02
1531962bc51bSJames Smart #define lpfc_mbx_wq_create_db_format_SHIFT	16
1532962bc51bSJames Smart #define lpfc_mbx_wq_create_db_format_MASK	0x0000FFFF
1533962bc51bSJames Smart #define lpfc_mbx_wq_create_db_format_WORD	word2
1534da0436e9SJames Smart 		} response;
15351351e69fSJames Smart 		struct {
15361351e69fSJames Smart 			uint32_t word0;
15371351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_rsp_SHIFT	31
15381351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_rsp_MASK		0x00000001
15391351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_rsp_WORD		word0
15401351e69fSJames Smart #define lpfc_mbx_wq_create_v1_q_id_SHIFT	0
15411351e69fSJames Smart #define lpfc_mbx_wq_create_v1_q_id_MASK		0x0000FFFF
15421351e69fSJames Smart #define lpfc_mbx_wq_create_v1_q_id_WORD		word0
15431351e69fSJames Smart 			uint32_t word1;
15441351e69fSJames Smart #define lpfc_mbx_wq_create_v1_bar_set_SHIFT	0
15451351e69fSJames Smart #define lpfc_mbx_wq_create_v1_bar_set_MASK	0x0000000F
15461351e69fSJames Smart #define lpfc_mbx_wq_create_v1_bar_set_WORD	word1
15471351e69fSJames Smart 			uint32_t doorbell_offset;
15481351e69fSJames Smart 			uint32_t word3;
15491351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_id_SHIFT		16
15501351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_id_MASK		0x0000001F
15511351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_id_WORD		word3
15521351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_bar_SHIFT	0
15531351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_bar_MASK		0x0000000F
15541351e69fSJames Smart #define lpfc_mbx_wq_create_dpp_bar_WORD		word3
15551351e69fSJames Smart 			uint32_t dpp_offset;
15561351e69fSJames Smart 		} response_1;
1557da0436e9SJames Smart 	} u;
1558da0436e9SJames Smart };
1559da0436e9SJames Smart 
1560da0436e9SJames Smart struct lpfc_mbx_wq_destroy {
1561da0436e9SJames Smart 	struct mbox_header header;
1562da0436e9SJames Smart 	union {
1563da0436e9SJames Smart 		struct {
1564da0436e9SJames Smart 			uint32_t word0;
1565da0436e9SJames Smart #define lpfc_mbx_wq_destroy_q_id_SHIFT	0
1566da0436e9SJames Smart #define lpfc_mbx_wq_destroy_q_id_MASK	0x0000FFFF
1567da0436e9SJames Smart #define lpfc_mbx_wq_destroy_q_id_WORD	word0
1568da0436e9SJames Smart 		} request;
1569da0436e9SJames Smart 		struct {
1570da0436e9SJames Smart 			uint32_t word0;
1571da0436e9SJames Smart 		} response;
1572da0436e9SJames Smart 	} u;
1573da0436e9SJames Smart };
1574da0436e9SJames Smart 
1575da0436e9SJames Smart #define LPFC_HDR_BUF_SIZE 128
1576eeead811SJames Smart #define LPFC_DATA_BUF_SIZE 2048
15773c603be9SJames Smart #define LPFC_NVMET_DATA_BUF_SIZE 128
1578da0436e9SJames Smart struct rq_context {
1579da0436e9SJames Smart 	uint32_t word0;
15805a6f133eSJames Smart #define lpfc_rq_context_rqe_count_SHIFT	16	/* Version 0 Only */
15815a6f133eSJames Smart #define lpfc_rq_context_rqe_count_MASK	0x0000000F
15825a6f133eSJames Smart #define lpfc_rq_context_rqe_count_WORD	word0
1583da0436e9SJames Smart #define LPFC_RQ_RING_SIZE_512		9	/* 512 entries */
1584da0436e9SJames Smart #define LPFC_RQ_RING_SIZE_1024		10	/* 1024 entries */
1585da0436e9SJames Smart #define LPFC_RQ_RING_SIZE_2048		11	/* 2048 entries */
1586da0436e9SJames Smart #define LPFC_RQ_RING_SIZE_4096		12	/* 4096 entries */
15872d7dbc4cSJames Smart #define lpfc_rq_context_rqe_count_1_SHIFT	16	/* Version 1-2 Only */
15885a6f133eSJames Smart #define lpfc_rq_context_rqe_count_1_MASK	0x0000FFFF
15895a6f133eSJames Smart #define lpfc_rq_context_rqe_count_1_WORD	word0
15902d7dbc4cSJames Smart #define lpfc_rq_context_rqe_size_SHIFT	8		/* Version 1-2 Only */
15915a6f133eSJames Smart #define lpfc_rq_context_rqe_size_MASK	0x0000000F
15925a6f133eSJames Smart #define lpfc_rq_context_rqe_size_WORD	word0
1593c31098ceSJames Smart #define LPFC_RQE_SIZE_8		2
1594c31098ceSJames Smart #define LPFC_RQE_SIZE_16	3
1595c31098ceSJames Smart #define LPFC_RQE_SIZE_32	4
1596c31098ceSJames Smart #define LPFC_RQE_SIZE_64	5
1597c31098ceSJames Smart #define LPFC_RQE_SIZE_128	6
15985a6f133eSJames Smart #define lpfc_rq_context_page_size_SHIFT	0		/* Version 1 Only */
15995a6f133eSJames Smart #define lpfc_rq_context_page_size_MASK	0x000000FF
16005a6f133eSJames Smart #define lpfc_rq_context_page_size_WORD	word0
16018ea73db4SJames Smart #define	LPFC_RQ_PAGE_SIZE_4096	0x1
16022d7dbc4cSJames Smart 	uint32_t word1;
16032d7dbc4cSJames Smart #define lpfc_rq_context_data_size_SHIFT	16		/* Version 2 Only */
16042d7dbc4cSJames Smart #define lpfc_rq_context_data_size_MASK	0x0000FFFF
16052d7dbc4cSJames Smart #define lpfc_rq_context_data_size_WORD	word1
16062d7dbc4cSJames Smart #define lpfc_rq_context_hdr_size_SHIFT	0		/* Version 2 Only */
16072d7dbc4cSJames Smart #define lpfc_rq_context_hdr_size_MASK	0x0000FFFF
16082d7dbc4cSJames Smart #define lpfc_rq_context_hdr_size_WORD	word1
1609da0436e9SJames Smart 	uint32_t word2;
1610da0436e9SJames Smart #define lpfc_rq_context_cq_id_SHIFT	16
1611df3d78c3SJames Smart #define lpfc_rq_context_cq_id_MASK	0x0000FFFF
1612da0436e9SJames Smart #define lpfc_rq_context_cq_id_WORD	word2
1613da0436e9SJames Smart #define lpfc_rq_context_buf_size_SHIFT	0
1614da0436e9SJames Smart #define lpfc_rq_context_buf_size_MASK	0x0000FFFF
1615da0436e9SJames Smart #define lpfc_rq_context_buf_size_WORD	word2
16162d7dbc4cSJames Smart #define lpfc_rq_context_base_cq_SHIFT	0		/* Version 2 Only */
16172d7dbc4cSJames Smart #define lpfc_rq_context_base_cq_MASK	0x0000FFFF
16182d7dbc4cSJames Smart #define lpfc_rq_context_base_cq_WORD	word2
16195a6f133eSJames Smart 	uint32_t buffer_size;				/* Version 1 Only */
1620da0436e9SJames Smart };
1621da0436e9SJames Smart 
1622da0436e9SJames Smart struct lpfc_mbx_rq_create {
1623da0436e9SJames Smart 	struct mbox_header header;
1624da0436e9SJames Smart 	union {
1625da0436e9SJames Smart 		struct {
1626da0436e9SJames Smart 			uint32_t word0;
1627da0436e9SJames Smart #define lpfc_mbx_rq_create_num_pages_SHIFT	0
1628da0436e9SJames Smart #define lpfc_mbx_rq_create_num_pages_MASK	0x0000FFFF
1629da0436e9SJames Smart #define lpfc_mbx_rq_create_num_pages_WORD	word0
1630962bc51bSJames Smart #define lpfc_mbx_rq_create_dua_SHIFT		16
1631962bc51bSJames Smart #define lpfc_mbx_rq_create_dua_MASK		0x00000001
1632962bc51bSJames Smart #define lpfc_mbx_rq_create_dua_WORD		word0
1633962bc51bSJames Smart #define lpfc_mbx_rq_create_bqu_SHIFT		17
1634962bc51bSJames Smart #define lpfc_mbx_rq_create_bqu_MASK		0x00000001
1635962bc51bSJames Smart #define lpfc_mbx_rq_create_bqu_WORD		word0
1636962bc51bSJames Smart #define lpfc_mbx_rq_create_ulp_num_SHIFT	24
1637962bc51bSJames Smart #define lpfc_mbx_rq_create_ulp_num_MASK		0x000000FF
1638962bc51bSJames Smart #define lpfc_mbx_rq_create_ulp_num_WORD		word0
1639da0436e9SJames Smart 			struct rq_context context;
16402d7dbc4cSJames Smart 			struct dma_address page[LPFC_MAX_RQ_PAGE];
1641da0436e9SJames Smart 		} request;
1642da0436e9SJames Smart 		struct {
1643da0436e9SJames Smart 			uint32_t word0;
16442d7dbc4cSJames Smart #define lpfc_mbx_rq_create_q_cnt_v2_SHIFT	16
16452d7dbc4cSJames Smart #define lpfc_mbx_rq_create_q_cnt_v2_MASK	0x0000FFFF
16462d7dbc4cSJames Smart #define lpfc_mbx_rq_create_q_cnt_v2_WORD	word0
16472d7dbc4cSJames Smart #define lpfc_mbx_rq_create_q_id_SHIFT		0
16482d7dbc4cSJames Smart #define lpfc_mbx_rq_create_q_id_MASK		0x0000FFFF
16492d7dbc4cSJames Smart #define lpfc_mbx_rq_create_q_id_WORD		word0
16502d7dbc4cSJames Smart 			uint32_t doorbell_offset;
16512d7dbc4cSJames Smart 			uint32_t word2;
16522d7dbc4cSJames Smart #define lpfc_mbx_rq_create_bar_set_SHIFT	0
16532d7dbc4cSJames Smart #define lpfc_mbx_rq_create_bar_set_MASK		0x0000FFFF
16542d7dbc4cSJames Smart #define lpfc_mbx_rq_create_bar_set_WORD		word2
16552d7dbc4cSJames Smart #define lpfc_mbx_rq_create_db_format_SHIFT	16
16562d7dbc4cSJames Smart #define lpfc_mbx_rq_create_db_format_MASK	0x0000FFFF
16572d7dbc4cSJames Smart #define lpfc_mbx_rq_create_db_format_WORD	word2
16582d7dbc4cSJames Smart 		} response;
16592d7dbc4cSJames Smart 	} u;
16602d7dbc4cSJames Smart };
16612d7dbc4cSJames Smart 
16622d7dbc4cSJames Smart struct lpfc_mbx_rq_create_v2 {
16632d7dbc4cSJames Smart 	union  lpfc_sli4_cfg_shdr cfg_shdr;
16642d7dbc4cSJames Smart 	union {
16652d7dbc4cSJames Smart 		struct {
16662d7dbc4cSJames Smart 			uint32_t word0;
16672d7dbc4cSJames Smart #define lpfc_mbx_rq_create_num_pages_SHIFT	0
16682d7dbc4cSJames Smart #define lpfc_mbx_rq_create_num_pages_MASK	0x0000FFFF
16692d7dbc4cSJames Smart #define lpfc_mbx_rq_create_num_pages_WORD	word0
16702d7dbc4cSJames Smart #define lpfc_mbx_rq_create_rq_cnt_SHIFT		16
16712d7dbc4cSJames Smart #define lpfc_mbx_rq_create_rq_cnt_MASK		0x000000FF
16722d7dbc4cSJames Smart #define lpfc_mbx_rq_create_rq_cnt_WORD		word0
16732d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dua_SHIFT		16
16742d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dua_MASK		0x00000001
16752d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dua_WORD		word0
16762d7dbc4cSJames Smart #define lpfc_mbx_rq_create_bqu_SHIFT		17
16772d7dbc4cSJames Smart #define lpfc_mbx_rq_create_bqu_MASK		0x00000001
16782d7dbc4cSJames Smart #define lpfc_mbx_rq_create_bqu_WORD		word0
16792d7dbc4cSJames Smart #define lpfc_mbx_rq_create_ulp_num_SHIFT	24
16802d7dbc4cSJames Smart #define lpfc_mbx_rq_create_ulp_num_MASK		0x000000FF
16812d7dbc4cSJames Smart #define lpfc_mbx_rq_create_ulp_num_WORD		word0
16822d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dim_SHIFT		29
16832d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dim_MASK		0x00000001
16842d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dim_WORD		word0
16852d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dfd_SHIFT		30
16862d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dfd_MASK		0x00000001
16872d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dfd_WORD		word0
16882d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dnb_SHIFT		31
16892d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dnb_MASK		0x00000001
16902d7dbc4cSJames Smart #define lpfc_mbx_rq_create_dnb_WORD		word0
16912d7dbc4cSJames Smart 			struct rq_context context;
16922d7dbc4cSJames Smart 			struct dma_address page[1];
16932d7dbc4cSJames Smart 		} request;
16942d7dbc4cSJames Smart 		struct {
16952d7dbc4cSJames Smart 			uint32_t word0;
16962d7dbc4cSJames Smart #define lpfc_mbx_rq_create_q_cnt_v2_SHIFT	16
16972d7dbc4cSJames Smart #define lpfc_mbx_rq_create_q_cnt_v2_MASK	0x0000FFFF
16982d7dbc4cSJames Smart #define lpfc_mbx_rq_create_q_cnt_v2_WORD	word0
1699da0436e9SJames Smart #define lpfc_mbx_rq_create_q_id_SHIFT		0
1700da0436e9SJames Smart #define lpfc_mbx_rq_create_q_id_MASK		0x0000FFFF
1701da0436e9SJames Smart #define lpfc_mbx_rq_create_q_id_WORD		word0
1702962bc51bSJames Smart 			uint32_t doorbell_offset;
1703962bc51bSJames Smart 			uint32_t word2;
1704962bc51bSJames Smart #define lpfc_mbx_rq_create_bar_set_SHIFT	0
1705962bc51bSJames Smart #define lpfc_mbx_rq_create_bar_set_MASK		0x0000FFFF
1706962bc51bSJames Smart #define lpfc_mbx_rq_create_bar_set_WORD		word2
1707962bc51bSJames Smart #define lpfc_mbx_rq_create_db_format_SHIFT	16
1708962bc51bSJames Smart #define lpfc_mbx_rq_create_db_format_MASK	0x0000FFFF
1709962bc51bSJames Smart #define lpfc_mbx_rq_create_db_format_WORD	word2
1710da0436e9SJames Smart 		} response;
1711da0436e9SJames Smart 	} u;
1712da0436e9SJames Smart };
1713da0436e9SJames Smart 
1714da0436e9SJames Smart struct lpfc_mbx_rq_destroy {
1715da0436e9SJames Smart 	struct mbox_header header;
1716da0436e9SJames Smart 	union {
1717da0436e9SJames Smart 		struct {
1718da0436e9SJames Smart 			uint32_t word0;
1719da0436e9SJames Smart #define lpfc_mbx_rq_destroy_q_id_SHIFT	0
1720da0436e9SJames Smart #define lpfc_mbx_rq_destroy_q_id_MASK	0x0000FFFF
1721da0436e9SJames Smart #define lpfc_mbx_rq_destroy_q_id_WORD	word0
1722da0436e9SJames Smart 		} request;
1723da0436e9SJames Smart 		struct {
1724da0436e9SJames Smart 			uint32_t word0;
1725da0436e9SJames Smart 		} response;
1726da0436e9SJames Smart 	} u;
1727da0436e9SJames Smart };
1728da0436e9SJames Smart 
1729da0436e9SJames Smart struct mq_context {
1730da0436e9SJames Smart 	uint32_t word0;
17315a6f133eSJames Smart #define lpfc_mq_context_cq_id_SHIFT	22 	/* Version 0 Only */
1732da0436e9SJames Smart #define lpfc_mq_context_cq_id_MASK	0x000003FF
1733da0436e9SJames Smart #define lpfc_mq_context_cq_id_WORD	word0
17345a6f133eSJames Smart #define lpfc_mq_context_ring_size_SHIFT	16
17355a6f133eSJames Smart #define lpfc_mq_context_ring_size_MASK	0x0000000F
17365a6f133eSJames Smart #define lpfc_mq_context_ring_size_WORD	word0
17375a6f133eSJames Smart #define LPFC_MQ_RING_SIZE_16		0x5
17385a6f133eSJames Smart #define LPFC_MQ_RING_SIZE_32		0x6
17395a6f133eSJames Smart #define LPFC_MQ_RING_SIZE_64		0x7
17405a6f133eSJames Smart #define LPFC_MQ_RING_SIZE_128		0x8
1741da0436e9SJames Smart 	uint32_t word1;
1742da0436e9SJames Smart #define lpfc_mq_context_valid_SHIFT	31
1743da0436e9SJames Smart #define lpfc_mq_context_valid_MASK	0x00000001
1744da0436e9SJames Smart #define lpfc_mq_context_valid_WORD	word1
1745da0436e9SJames Smart 	uint32_t reserved2;
1746da0436e9SJames Smart 	uint32_t reserved3;
1747da0436e9SJames Smart };
1748da0436e9SJames Smart 
1749da0436e9SJames Smart struct lpfc_mbx_mq_create {
1750da0436e9SJames Smart 	struct mbox_header header;
1751da0436e9SJames Smart 	union {
1752da0436e9SJames Smart 		struct {
1753da0436e9SJames Smart 			uint32_t word0;
1754da0436e9SJames Smart #define lpfc_mbx_mq_create_num_pages_SHIFT	0
1755da0436e9SJames Smart #define lpfc_mbx_mq_create_num_pages_MASK	0x0000FFFF
1756da0436e9SJames Smart #define lpfc_mbx_mq_create_num_pages_WORD	word0
1757da0436e9SJames Smart 			struct mq_context context;
1758da0436e9SJames Smart 			struct dma_address page[LPFC_MAX_MQ_PAGE];
1759da0436e9SJames Smart 		} request;
1760da0436e9SJames Smart 		struct {
1761da0436e9SJames Smart 			uint32_t word0;
1762da0436e9SJames Smart #define lpfc_mbx_mq_create_q_id_SHIFT	0
1763da0436e9SJames Smart #define lpfc_mbx_mq_create_q_id_MASK	0x0000FFFF
1764da0436e9SJames Smart #define lpfc_mbx_mq_create_q_id_WORD	word0
1765da0436e9SJames Smart 		} response;
1766da0436e9SJames Smart 	} u;
1767da0436e9SJames Smart };
1768da0436e9SJames Smart 
1769b19a061aSJames Smart struct lpfc_mbx_mq_create_ext {
1770b19a061aSJames Smart 	struct mbox_header header;
1771b19a061aSJames Smart 	union {
1772b19a061aSJames Smart 		struct {
1773b19a061aSJames Smart 			uint32_t word0;
1774b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_num_pages_SHIFT	0
1775b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_num_pages_MASK	0x0000FFFF
1776b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_num_pages_WORD	word0
17775a6f133eSJames Smart #define lpfc_mbx_mq_create_ext_cq_id_SHIFT	16	/* Version 1 Only */
17785a6f133eSJames Smart #define lpfc_mbx_mq_create_ext_cq_id_MASK	0x0000FFFF
17795a6f133eSJames Smart #define lpfc_mbx_mq_create_ext_cq_id_WORD	word0
1780b19a061aSJames Smart 			uint32_t async_evt_bmap;
1781b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_link_SHIFT	LPFC_TRAILER_CODE_LINK
1782b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_link_MASK	0x00000001
1783b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_link_WORD	async_evt_bmap
17848b68cd52SJames Smart #define LPFC_EVT_CODE_LINK_NO_LINK	0x0
17858b68cd52SJames Smart #define LPFC_EVT_CODE_LINK_10_MBIT	0x1
17868b68cd52SJames Smart #define LPFC_EVT_CODE_LINK_100_MBIT	0x2
17878b68cd52SJames Smart #define LPFC_EVT_CODE_LINK_1_GBIT	0x3
17888b68cd52SJames Smart #define LPFC_EVT_CODE_LINK_10_GBIT	0x4
178970f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fip_SHIFT	LPFC_TRAILER_CODE_FCOE
179070f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fip_MASK	0x00000001
179170f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fip_WORD	async_evt_bmap
1792b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_group5_SHIFT	LPFC_TRAILER_CODE_GRP5
1793b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_group5_MASK	0x00000001
1794b19a061aSJames Smart #define lpfc_mbx_mq_create_ext_async_evt_group5_WORD	async_evt_bmap
179570f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fc_SHIFT	LPFC_TRAILER_CODE_FC
179670f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fc_MASK	0x00000001
179770f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_fc_WORD	async_evt_bmap
17988b68cd52SJames Smart #define LPFC_EVT_CODE_FC_NO_LINK	0x0
17998b68cd52SJames Smart #define LPFC_EVT_CODE_FC_1_GBAUD	0x1
18008b68cd52SJames Smart #define LPFC_EVT_CODE_FC_2_GBAUD	0x2
18018b68cd52SJames Smart #define LPFC_EVT_CODE_FC_4_GBAUD	0x4
18028b68cd52SJames Smart #define LPFC_EVT_CODE_FC_8_GBAUD	0x8
18038b68cd52SJames Smart #define LPFC_EVT_CODE_FC_10_GBAUD	0xA
18048b68cd52SJames Smart #define LPFC_EVT_CODE_FC_16_GBAUD	0x10
180570f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_sli_SHIFT	LPFC_TRAILER_CODE_SLI
180670f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_sli_MASK	0x00000001
180770f3c073SJames Smart #define lpfc_mbx_mq_create_ext_async_evt_sli_WORD	async_evt_bmap
1808b19a061aSJames Smart 			struct mq_context context;
1809b19a061aSJames Smart 			struct dma_address page[LPFC_MAX_MQ_PAGE];
1810b19a061aSJames Smart 		} request;
1811b19a061aSJames Smart 		struct {
1812b19a061aSJames Smart 			uint32_t word0;
1813b19a061aSJames Smart #define lpfc_mbx_mq_create_q_id_SHIFT	0
1814b19a061aSJames Smart #define lpfc_mbx_mq_create_q_id_MASK	0x0000FFFF
1815b19a061aSJames Smart #define lpfc_mbx_mq_create_q_id_WORD	word0
1816b19a061aSJames Smart 		} response;
1817b19a061aSJames Smart 	} u;
1818b19a061aSJames Smart #define LPFC_ASYNC_EVENT_LINK_STATE	0x2
1819b19a061aSJames Smart #define LPFC_ASYNC_EVENT_FCF_STATE	0x4
1820b19a061aSJames Smart #define LPFC_ASYNC_EVENT_GROUP5		0x20
1821b19a061aSJames Smart };
1822b19a061aSJames Smart 
1823da0436e9SJames Smart struct lpfc_mbx_mq_destroy {
1824da0436e9SJames Smart 	struct mbox_header header;
1825da0436e9SJames Smart 	union {
1826da0436e9SJames Smart 		struct {
1827da0436e9SJames Smart 			uint32_t word0;
1828da0436e9SJames Smart #define lpfc_mbx_mq_destroy_q_id_SHIFT	0
1829da0436e9SJames Smart #define lpfc_mbx_mq_destroy_q_id_MASK	0x0000FFFF
1830da0436e9SJames Smart #define lpfc_mbx_mq_destroy_q_id_WORD	word0
1831da0436e9SJames Smart 		} request;
1832da0436e9SJames Smart 		struct {
1833da0436e9SJames Smart 			uint32_t word0;
1834da0436e9SJames Smart 		} response;
1835da0436e9SJames Smart 	} u;
1836da0436e9SJames Smart };
1837da0436e9SJames Smart 
18386d368e53SJames Smart /* Start Gen 2 SLI4 Mailbox definitions: */
18396d368e53SJames Smart 
18406d368e53SJames Smart /* Define allocate-ready Gen 2 SLI4 FCoE Resource Extent Types. */
18416d368e53SJames Smart #define LPFC_RSC_TYPE_FCOE_VFI	0x20
18426d368e53SJames Smart #define LPFC_RSC_TYPE_FCOE_VPI	0x21
18436d368e53SJames Smart #define LPFC_RSC_TYPE_FCOE_RPI	0x22
18446d368e53SJames Smart #define LPFC_RSC_TYPE_FCOE_XRI	0x23
18456d368e53SJames Smart 
18466d368e53SJames Smart struct lpfc_mbx_get_rsrc_extent_info {
18476d368e53SJames Smart 	struct mbox_header header;
18486d368e53SJames Smart 	union {
18496d368e53SJames Smart 		struct {
18506d368e53SJames Smart 			uint32_t word4;
18516d368e53SJames Smart #define lpfc_mbx_get_rsrc_extent_info_type_SHIFT	0
18526d368e53SJames Smart #define lpfc_mbx_get_rsrc_extent_info_type_MASK		0x0000FFFF
18536d368e53SJames Smart #define lpfc_mbx_get_rsrc_extent_info_type_WORD		word4
18546d368e53SJames Smart 		} req;
18556d368e53SJames Smart 		struct {
18566d368e53SJames Smart 			uint32_t word4;
18576d368e53SJames Smart #define lpfc_mbx_get_rsrc_extent_info_cnt_SHIFT		0
18586d368e53SJames Smart #define lpfc_mbx_get_rsrc_extent_info_cnt_MASK		0x0000FFFF
18596d368e53SJames Smart #define lpfc_mbx_get_rsrc_extent_info_cnt_WORD		word4
18606d368e53SJames Smart #define lpfc_mbx_get_rsrc_extent_info_size_SHIFT	16
18616d368e53SJames Smart #define lpfc_mbx_get_rsrc_extent_info_size_MASK		0x0000FFFF
18626d368e53SJames Smart #define lpfc_mbx_get_rsrc_extent_info_size_WORD		word4
18636d368e53SJames Smart 		} rsp;
18646d368e53SJames Smart 	} u;
18656d368e53SJames Smart };
18666d368e53SJames Smart 
1867962bc51bSJames Smart struct lpfc_mbx_query_fw_config {
1868962bc51bSJames Smart 	struct mbox_header header;
1869962bc51bSJames Smart 	struct {
1870962bc51bSJames Smart 		uint32_t config_number;
1871962bc51bSJames Smart #define	LPFC_FC_FCOE		0x00000007
1872962bc51bSJames Smart 		uint32_t asic_revision;
1873962bc51bSJames Smart 		uint32_t physical_port;
1874962bc51bSJames Smart 		uint32_t function_mode;
1875962bc51bSJames Smart #define LPFC_FCOE_INI_MODE	0x00000040
1876962bc51bSJames Smart #define LPFC_FCOE_TGT_MODE	0x00000080
1877962bc51bSJames Smart #define LPFC_DUA_MODE		0x00000800
1878962bc51bSJames Smart 		uint32_t ulp0_mode;
1879962bc51bSJames Smart #define LPFC_ULP_FCOE_INIT_MODE	0x00000040
1880962bc51bSJames Smart #define LPFC_ULP_FCOE_TGT_MODE	0x00000080
1881962bc51bSJames Smart 		uint32_t ulp0_nap_words[12];
1882962bc51bSJames Smart 		uint32_t ulp1_mode;
1883962bc51bSJames Smart 		uint32_t ulp1_nap_words[12];
1884962bc51bSJames Smart 		uint32_t function_capabilities;
1885962bc51bSJames Smart 		uint32_t cqid_base;
1886962bc51bSJames Smart 		uint32_t cqid_tot;
1887962bc51bSJames Smart 		uint32_t eqid_base;
1888962bc51bSJames Smart 		uint32_t eqid_tot;
1889962bc51bSJames Smart 		uint32_t ulp0_nap2_words[2];
1890962bc51bSJames Smart 		uint32_t ulp1_nap2_words[2];
1891962bc51bSJames Smart 	} rsp;
1892962bc51bSJames Smart };
1893962bc51bSJames Smart 
18948b017a30SJames Smart struct lpfc_mbx_set_beacon_config {
18958b017a30SJames Smart 	struct mbox_header header;
18968b017a30SJames Smart 	uint32_t word4;
18978b017a30SJames Smart #define lpfc_mbx_set_beacon_port_num_SHIFT		0
18988b017a30SJames Smart #define lpfc_mbx_set_beacon_port_num_MASK		0x0000003F
18998b017a30SJames Smart #define lpfc_mbx_set_beacon_port_num_WORD		word4
19008b017a30SJames Smart #define lpfc_mbx_set_beacon_port_type_SHIFT		6
19018b017a30SJames Smart #define lpfc_mbx_set_beacon_port_type_MASK		0x00000003
19028b017a30SJames Smart #define lpfc_mbx_set_beacon_port_type_WORD		word4
19038b017a30SJames Smart #define lpfc_mbx_set_beacon_state_SHIFT			8
19048b017a30SJames Smart #define lpfc_mbx_set_beacon_state_MASK			0x000000FF
19058b017a30SJames Smart #define lpfc_mbx_set_beacon_state_WORD			word4
19068b017a30SJames Smart #define lpfc_mbx_set_beacon_duration_SHIFT		16
19078b017a30SJames Smart #define lpfc_mbx_set_beacon_duration_MASK		0x000000FF
19088b017a30SJames Smart #define lpfc_mbx_set_beacon_duration_WORD		word4
190966e9e6bfSJames Smart 
191066e9e6bfSJames Smart /* COMMON_SET_BEACON_CONFIG_V1 */
191166e9e6bfSJames Smart #define lpfc_mbx_set_beacon_duration_v1_SHIFT		16
191266e9e6bfSJames Smart #define lpfc_mbx_set_beacon_duration_v1_MASK		0x0000FFFF
191366e9e6bfSJames Smart #define lpfc_mbx_set_beacon_duration_v1_WORD		word4
191466e9e6bfSJames Smart 	uint32_t word5;  /* RESERVED  */
19158b017a30SJames Smart };
19168b017a30SJames Smart 
19176d368e53SJames Smart struct lpfc_id_range {
19186d368e53SJames Smart 	uint32_t word5;
19196d368e53SJames Smart #define lpfc_mbx_rsrc_id_word4_0_SHIFT	0
19206d368e53SJames Smart #define lpfc_mbx_rsrc_id_word4_0_MASK	0x0000FFFF
19216d368e53SJames Smart #define lpfc_mbx_rsrc_id_word4_0_WORD	word5
19226d368e53SJames Smart #define lpfc_mbx_rsrc_id_word4_1_SHIFT	16
19236d368e53SJames Smart #define lpfc_mbx_rsrc_id_word4_1_MASK	0x0000FFFF
19246d368e53SJames Smart #define lpfc_mbx_rsrc_id_word4_1_WORD	word5
19256d368e53SJames Smart };
19266d368e53SJames Smart 
19277ad20aa9SJames Smart struct lpfc_mbx_set_link_diag_state {
19287ad20aa9SJames Smart 	struct mbox_header header;
19297ad20aa9SJames Smart 	union {
19307ad20aa9SJames Smart 		struct {
19317ad20aa9SJames Smart 			uint32_t word0;
19327ad20aa9SJames Smart #define lpfc_mbx_set_diag_state_diag_SHIFT	0
19337ad20aa9SJames Smart #define lpfc_mbx_set_diag_state_diag_MASK	0x00000001
19347ad20aa9SJames Smart #define lpfc_mbx_set_diag_state_diag_WORD	word0
19359731592bSJames Smart #define lpfc_mbx_set_diag_state_diag_bit_valid_SHIFT	2
19369731592bSJames Smart #define lpfc_mbx_set_diag_state_diag_bit_valid_MASK	0x00000001
19379731592bSJames Smart #define lpfc_mbx_set_diag_state_diag_bit_valid_WORD	word0
19389731592bSJames Smart #define LPFC_DIAG_STATE_DIAG_BIT_VALID_NO_CHANGE	0
19399731592bSJames Smart #define LPFC_DIAG_STATE_DIAG_BIT_VALID_CHANGE		1
19407ad20aa9SJames Smart #define lpfc_mbx_set_diag_state_link_num_SHIFT	16
19417ad20aa9SJames Smart #define lpfc_mbx_set_diag_state_link_num_MASK	0x0000003F
19427ad20aa9SJames Smart #define lpfc_mbx_set_diag_state_link_num_WORD	word0
19437ad20aa9SJames Smart #define lpfc_mbx_set_diag_state_link_type_SHIFT 22
19447ad20aa9SJames Smart #define lpfc_mbx_set_diag_state_link_type_MASK	0x00000003
19457ad20aa9SJames Smart #define lpfc_mbx_set_diag_state_link_type_WORD	word0
19467ad20aa9SJames Smart 		} req;
19477ad20aa9SJames Smart 		struct {
19487ad20aa9SJames Smart 			uint32_t word0;
19497ad20aa9SJames Smart 		} rsp;
19507ad20aa9SJames Smart 	} u;
19517ad20aa9SJames Smart };
19527ad20aa9SJames Smart 
19537ad20aa9SJames Smart struct lpfc_mbx_set_link_diag_loopback {
19547ad20aa9SJames Smart 	struct mbox_header header;
19557ad20aa9SJames Smart 	union {
19567ad20aa9SJames Smart 		struct {
19577ad20aa9SJames Smart 			uint32_t word0;
19587ad20aa9SJames Smart #define lpfc_mbx_set_diag_lpbk_type_SHIFT		0
19591b51197dSJames Smart #define lpfc_mbx_set_diag_lpbk_type_MASK		0x00000003
19607ad20aa9SJames Smart #define lpfc_mbx_set_diag_lpbk_type_WORD		word0
19617ad20aa9SJames Smart #define LPFC_DIAG_LOOPBACK_TYPE_DISABLE			0x0
19627ad20aa9SJames Smart #define LPFC_DIAG_LOOPBACK_TYPE_INTERNAL		0x1
19631b51197dSJames Smart #define LPFC_DIAG_LOOPBACK_TYPE_SERDES			0x2
19649a66d990SJames Smart #define LPFC_DIAG_LOOPBACK_TYPE_EXTERNAL_TRUNKED	0x3
19657ad20aa9SJames Smart #define lpfc_mbx_set_diag_lpbk_link_num_SHIFT		16
19667ad20aa9SJames Smart #define lpfc_mbx_set_diag_lpbk_link_num_MASK		0x0000003F
19677ad20aa9SJames Smart #define lpfc_mbx_set_diag_lpbk_link_num_WORD		word0
19687ad20aa9SJames Smart #define lpfc_mbx_set_diag_lpbk_link_type_SHIFT		22
19697ad20aa9SJames Smart #define lpfc_mbx_set_diag_lpbk_link_type_MASK		0x00000003
19707ad20aa9SJames Smart #define lpfc_mbx_set_diag_lpbk_link_type_WORD		word0
19717ad20aa9SJames Smart 		} req;
19727ad20aa9SJames Smart 		struct {
19737ad20aa9SJames Smart 			uint32_t word0;
19747ad20aa9SJames Smart 		} rsp;
19757ad20aa9SJames Smart 	} u;
19767ad20aa9SJames Smart };
19777ad20aa9SJames Smart 
19787ad20aa9SJames Smart struct lpfc_mbx_run_link_diag_test {
19797ad20aa9SJames Smart 	struct mbox_header header;
19807ad20aa9SJames Smart 	union {
19817ad20aa9SJames Smart 		struct {
19827ad20aa9SJames Smart 			uint32_t word0;
19837ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_link_num_SHIFT	16
19847ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_link_num_MASK	0x0000003F
19857ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_link_num_WORD	word0
19867ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_link_type_SHIFT	22
19877ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_link_type_MASK	0x00000003
19887ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_link_type_WORD	word0
19897ad20aa9SJames Smart 			uint32_t word1;
19907ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_test_id_SHIFT	0
19917ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_test_id_MASK	0x0000FFFF
19927ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_test_id_WORD	word1
19937ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_loops_SHIFT	16
19947ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_loops_MASK	0x0000FFFF
19957ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_loops_WORD	word1
19967ad20aa9SJames Smart 			uint32_t word2;
19977ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_test_ver_SHIFT	0
19987ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_test_ver_MASK	0x0000FFFF
19997ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_test_ver_WORD	word2
20007ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_err_act_SHIFT	16
20017ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_err_act_MASK	0x000000FF
20027ad20aa9SJames Smart #define lpfc_mbx_run_diag_test_err_act_WORD	word2
20037ad20aa9SJames Smart 		} req;
20047ad20aa9SJames Smart 		struct {
20057ad20aa9SJames Smart 			uint32_t word0;
20067ad20aa9SJames Smart 		} rsp;
20077ad20aa9SJames Smart 	} u;
20087ad20aa9SJames Smart };
20097ad20aa9SJames Smart 
20106d368e53SJames Smart /*
20116d368e53SJames Smart  * struct lpfc_mbx_alloc_rsrc_extents:
20126d368e53SJames Smart  * A mbox is generically 256 bytes long. An SLI4_CONFIG mailbox requires
20136d368e53SJames Smart  * 6 words of header + 4 words of shared subcommand header +
20146d368e53SJames Smart  * 1 words of Extent-Opcode-specific header = 11 words or 44 bytes total.
20156d368e53SJames Smart  *
20166d368e53SJames Smart  * An embedded version of SLI4_CONFIG therefore has 256 - 44 = 212 bytes
20176d368e53SJames Smart  * for extents payload.
20186d368e53SJames Smart  *
20196d368e53SJames Smart  * 212/2 (bytes per extent) = 106 extents.
20206d368e53SJames Smart  * 106/2 (extents per word) = 53 words.
20216d368e53SJames Smart  * lpfc_id_range id is statically size to 53.
20226d368e53SJames Smart  *
20236d368e53SJames Smart  * This mailbox definition is used for ALLOC or GET_ALLOCATED
20246d368e53SJames Smart  * extent ranges.  For ALLOC, the type and cnt are required.
20256d368e53SJames Smart  * For GET_ALLOCATED, only the type is required.
20266d368e53SJames Smart  */
20276d368e53SJames Smart struct lpfc_mbx_alloc_rsrc_extents {
20286d368e53SJames Smart 	struct mbox_header header;
20296d368e53SJames Smart 	union {
20306d368e53SJames Smart 		struct {
20316d368e53SJames Smart 			uint32_t word4;
20326d368e53SJames Smart #define lpfc_mbx_alloc_rsrc_extents_type_SHIFT	0
20336d368e53SJames Smart #define lpfc_mbx_alloc_rsrc_extents_type_MASK	0x0000FFFF
20346d368e53SJames Smart #define lpfc_mbx_alloc_rsrc_extents_type_WORD	word4
20356d368e53SJames Smart #define lpfc_mbx_alloc_rsrc_extents_cnt_SHIFT	16
20366d368e53SJames Smart #define lpfc_mbx_alloc_rsrc_extents_cnt_MASK	0x0000FFFF
20376d368e53SJames Smart #define lpfc_mbx_alloc_rsrc_extents_cnt_WORD	word4
20386d368e53SJames Smart 		} req;
20396d368e53SJames Smart 		struct {
20406d368e53SJames Smart 			uint32_t word4;
20416d368e53SJames Smart #define lpfc_mbx_rsrc_cnt_SHIFT	0
20426d368e53SJames Smart #define lpfc_mbx_rsrc_cnt_MASK	0x0000FFFF
20436d368e53SJames Smart #define lpfc_mbx_rsrc_cnt_WORD	word4
20446d368e53SJames Smart 			struct lpfc_id_range id[53];
20456d368e53SJames Smart 		} rsp;
20466d368e53SJames Smart 	} u;
20476d368e53SJames Smart };
20486d368e53SJames Smart 
20496d368e53SJames Smart /*
20506d368e53SJames Smart  * This is the non-embedded version of ALLOC or GET RSRC_EXTENTS. Word4 in this
20516d368e53SJames Smart  * structure shares the same SHIFT/MASK/WORD defines provided in the
20526d368e53SJames Smart  * mbx_alloc_rsrc_extents and mbx_get_alloc_rsrc_extents, word4, provided in
20536d368e53SJames Smart  * the structures defined above.  This non-embedded structure provides for the
20546d368e53SJames Smart  * maximum number of extents supported by the port.
20556d368e53SJames Smart  */
20566d368e53SJames Smart struct lpfc_mbx_nembed_rsrc_extent {
20576d368e53SJames Smart 	union  lpfc_sli4_cfg_shdr cfg_shdr;
20586d368e53SJames Smart 	uint32_t word4;
20596d368e53SJames Smart 	struct lpfc_id_range id;
20606d368e53SJames Smart };
20616d368e53SJames Smart 
20626d368e53SJames Smart struct lpfc_mbx_dealloc_rsrc_extents {
20636d368e53SJames Smart 	struct mbox_header header;
20646d368e53SJames Smart 	struct {
20656d368e53SJames Smart 		uint32_t word4;
20666d368e53SJames Smart #define lpfc_mbx_dealloc_rsrc_extents_type_SHIFT	0
20676d368e53SJames Smart #define lpfc_mbx_dealloc_rsrc_extents_type_MASK		0x0000FFFF
20686d368e53SJames Smart #define lpfc_mbx_dealloc_rsrc_extents_type_WORD		word4
20696d368e53SJames Smart 	} req;
20706d368e53SJames Smart 
20716d368e53SJames Smart };
20726d368e53SJames Smart 
20736d368e53SJames Smart /* Start SLI4 FCoE specific mbox structures. */
20746d368e53SJames Smart 
2075da0436e9SJames Smart struct lpfc_mbx_post_hdr_tmpl {
2076da0436e9SJames Smart 	struct mbox_header header;
2077da0436e9SJames Smart 	uint32_t word10;
2078da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_rpi_offset_SHIFT  0
2079da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_rpi_offset_MASK   0x0000FFFF
2080da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_rpi_offset_WORD   word10
2081da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_page_cnt_SHIFT   16
2082da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_page_cnt_MASK    0x0000FFFF
2083da0436e9SJames Smart #define lpfc_mbx_post_hdr_tmpl_page_cnt_WORD    word10
2084da0436e9SJames Smart 	uint32_t rpi_paddr_lo;
2085da0436e9SJames Smart 	uint32_t rpi_paddr_hi;
2086da0436e9SJames Smart };
2087da0436e9SJames Smart 
2088da0436e9SJames Smart struct sli4_sge {	/* SLI-4 */
2089da0436e9SJames Smart 	uint32_t addr_hi;
2090da0436e9SJames Smart 	uint32_t addr_lo;
2091da0436e9SJames Smart 
2092da0436e9SJames Smart 	uint32_t word2;
2093f9bb2da1SJames Smart #define lpfc_sli4_sge_offset_SHIFT	0
2094f9bb2da1SJames Smart #define lpfc_sli4_sge_offset_MASK	0x07FFFFFF
2095da0436e9SJames Smart #define lpfc_sli4_sge_offset_WORD	word2
2096f9bb2da1SJames Smart #define lpfc_sli4_sge_type_SHIFT	27
2097f9bb2da1SJames Smart #define lpfc_sli4_sge_type_MASK		0x0000000F
2098f9bb2da1SJames Smart #define lpfc_sli4_sge_type_WORD		word2
2099f9bb2da1SJames Smart #define LPFC_SGE_TYPE_DATA		0x0
2100f9bb2da1SJames Smart #define LPFC_SGE_TYPE_DIF		0x4
2101f9bb2da1SJames Smart #define LPFC_SGE_TYPE_LSP		0x5
2102f9bb2da1SJames Smart #define LPFC_SGE_TYPE_PEDIF		0x6
2103f9bb2da1SJames Smart #define LPFC_SGE_TYPE_PESEED		0x7
2104f9bb2da1SJames Smart #define LPFC_SGE_TYPE_DISEED		0x8
2105f9bb2da1SJames Smart #define LPFC_SGE_TYPE_ENC		0x9
2106f9bb2da1SJames Smart #define LPFC_SGE_TYPE_ATM		0xA
2107f9bb2da1SJames Smart #define LPFC_SGE_TYPE_SKIP		0xC
2108f9bb2da1SJames Smart #define lpfc_sli4_sge_last_SHIFT	31 /* Last SEG in the SGL sets it */
2109da0436e9SJames Smart #define lpfc_sli4_sge_last_MASK		0x00000001
2110da0436e9SJames Smart #define lpfc_sli4_sge_last_WORD		word2
211128baac74SJames Smart 	uint32_t sge_len;
2112da0436e9SJames Smart };
2113da0436e9SJames Smart 
2114d79c9e9dSJames Smart struct sli4_hybrid_sgl {
2115d79c9e9dSJames Smart 	struct list_head list_node;
2116d79c9e9dSJames Smart 	struct sli4_sge *dma_sgl;
2117d79c9e9dSJames Smart 	dma_addr_t dma_phys_sgl;
2118d79c9e9dSJames Smart };
2119d79c9e9dSJames Smart 
2120d79c9e9dSJames Smart struct fcp_cmd_rsp_buf {
2121d79c9e9dSJames Smart 	struct list_head list_node;
2122d79c9e9dSJames Smart 
2123d79c9e9dSJames Smart 	/* for storing cmd/rsp dma alloc'ed virt_addr */
2124d79c9e9dSJames Smart 	struct fcp_cmnd *fcp_cmnd;
2125d79c9e9dSJames Smart 	struct fcp_rsp *fcp_rsp;
2126d79c9e9dSJames Smart 
2127d79c9e9dSJames Smart 	/* for storing this cmd/rsp's dma mapped phys addr from per CPU pool */
2128d79c9e9dSJames Smart 	dma_addr_t fcp_cmd_rsp_dma_handle;
2129d79c9e9dSJames Smart };
2130d79c9e9dSJames Smart 
2131f9bb2da1SJames Smart struct sli4_sge_diseed {	/* SLI-4 */
2132f9bb2da1SJames Smart 	uint32_t ref_tag;
2133f9bb2da1SJames Smart 	uint32_t ref_tag_tran;
2134f9bb2da1SJames Smart 
2135f9bb2da1SJames Smart 	uint32_t word2;
2136f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_apptran_SHIFT	0
2137f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_apptran_MASK	0x0000FFFF
2138f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_apptran_WORD	word2
2139f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_af_SHIFT	24
2140f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_af_MASK	0x00000001
2141f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_af_WORD	word2
2142f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_na_SHIFT	25
2143f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_na_MASK	0x00000001
2144f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_na_WORD	word2
2145f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_hi_SHIFT	26
2146f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_hi_MASK	0x00000001
2147f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_hi_WORD	word2
2148f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_type_SHIFT	27
2149f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_type_MASK	0x0000000F
2150f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_type_WORD	word2
2151f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_last_SHIFT	31 /* Last SEG in the SGL sets it */
2152f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_last_MASK	0x00000001
2153f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_last_WORD	word2
2154f9bb2da1SJames Smart 	uint32_t word3;
2155f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_apptag_SHIFT	0
2156f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_apptag_MASK	0x0000FFFF
2157f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_apptag_WORD	word3
2158f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_bs_SHIFT	16
2159f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_bs_MASK	0x00000007
2160f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_bs_WORD	word3
2161f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_ai_SHIFT	19
2162f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_ai_MASK	0x00000001
2163f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_ai_WORD	word3
2164f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_me_SHIFT	20
2165f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_me_MASK	0x00000001
2166f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_me_WORD	word3
2167f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_re_SHIFT	21
2168f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_re_MASK	0x00000001
2169f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_re_WORD	word3
2170f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_ce_SHIFT	22
2171f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_ce_MASK	0x00000001
2172f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_ce_WORD	word3
2173f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_nr_SHIFT	23
2174f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_nr_MASK	0x00000001
2175f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_nr_WORD	word3
2176f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_oprx_SHIFT	24
2177f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_oprx_MASK	0x0000000F
2178f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_oprx_WORD	word3
2179f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_optx_SHIFT	28
2180f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_optx_MASK	0x0000000F
2181f9bb2da1SJames Smart #define lpfc_sli4_sge_dif_optx_WORD	word3
2182f9bb2da1SJames Smart /* optx and oprx use BG_OP_IN defines in lpfc_hw.h */
2183f9bb2da1SJames Smart };
2184f9bb2da1SJames Smart 
2185da0436e9SJames Smart struct fcf_record {
2186da0436e9SJames Smart 	uint32_t max_rcv_size;
2187da0436e9SJames Smart 	uint32_t fka_adv_period;
2188da0436e9SJames Smart 	uint32_t fip_priority;
2189da0436e9SJames Smart 	uint32_t word3;
2190da0436e9SJames Smart #define lpfc_fcf_record_mac_0_SHIFT		0
2191da0436e9SJames Smart #define lpfc_fcf_record_mac_0_MASK		0x000000FF
2192da0436e9SJames Smart #define lpfc_fcf_record_mac_0_WORD		word3
2193da0436e9SJames Smart #define lpfc_fcf_record_mac_1_SHIFT		8
2194da0436e9SJames Smart #define lpfc_fcf_record_mac_1_MASK		0x000000FF
2195da0436e9SJames Smart #define lpfc_fcf_record_mac_1_WORD		word3
2196da0436e9SJames Smart #define lpfc_fcf_record_mac_2_SHIFT		16
2197da0436e9SJames Smart #define lpfc_fcf_record_mac_2_MASK		0x000000FF
2198da0436e9SJames Smart #define lpfc_fcf_record_mac_2_WORD		word3
2199da0436e9SJames Smart #define lpfc_fcf_record_mac_3_SHIFT		24
2200da0436e9SJames Smart #define lpfc_fcf_record_mac_3_MASK		0x000000FF
2201da0436e9SJames Smart #define lpfc_fcf_record_mac_3_WORD		word3
2202da0436e9SJames Smart 	uint32_t word4;
2203da0436e9SJames Smart #define lpfc_fcf_record_mac_4_SHIFT		0
2204da0436e9SJames Smart #define lpfc_fcf_record_mac_4_MASK		0x000000FF
2205da0436e9SJames Smart #define lpfc_fcf_record_mac_4_WORD		word4
2206da0436e9SJames Smart #define lpfc_fcf_record_mac_5_SHIFT		8
2207da0436e9SJames Smart #define lpfc_fcf_record_mac_5_MASK		0x000000FF
2208da0436e9SJames Smart #define lpfc_fcf_record_mac_5_WORD		word4
2209da0436e9SJames Smart #define lpfc_fcf_record_fcf_avail_SHIFT		16
2210da0436e9SJames Smart #define lpfc_fcf_record_fcf_avail_MASK		0x000000FF
22110c287589SJames Smart #define lpfc_fcf_record_fcf_avail_WORD		word4
2212da0436e9SJames Smart #define lpfc_fcf_record_mac_addr_prov_SHIFT	24
2213da0436e9SJames Smart #define lpfc_fcf_record_mac_addr_prov_MASK	0x000000FF
2214da0436e9SJames Smart #define lpfc_fcf_record_mac_addr_prov_WORD	word4
2215da0436e9SJames Smart #define LPFC_FCF_FPMA           1 	/* Fabric Provided MAC Address */
2216da0436e9SJames Smart #define LPFC_FCF_SPMA           2       /* Server Provided MAC Address */
2217da0436e9SJames Smart 	uint32_t word5;
2218da0436e9SJames Smart #define lpfc_fcf_record_fab_name_0_SHIFT	0
2219da0436e9SJames Smart #define lpfc_fcf_record_fab_name_0_MASK		0x000000FF
2220da0436e9SJames Smart #define lpfc_fcf_record_fab_name_0_WORD		word5
2221da0436e9SJames Smart #define lpfc_fcf_record_fab_name_1_SHIFT	8
2222da0436e9SJames Smart #define lpfc_fcf_record_fab_name_1_MASK		0x000000FF
2223da0436e9SJames Smart #define lpfc_fcf_record_fab_name_1_WORD		word5
2224da0436e9SJames Smart #define lpfc_fcf_record_fab_name_2_SHIFT	16
2225da0436e9SJames Smart #define lpfc_fcf_record_fab_name_2_MASK		0x000000FF
2226da0436e9SJames Smart #define lpfc_fcf_record_fab_name_2_WORD		word5
2227da0436e9SJames Smart #define lpfc_fcf_record_fab_name_3_SHIFT	24
2228da0436e9SJames Smart #define lpfc_fcf_record_fab_name_3_MASK		0x000000FF
2229da0436e9SJames Smart #define lpfc_fcf_record_fab_name_3_WORD		word5
2230da0436e9SJames Smart 	uint32_t word6;
2231da0436e9SJames Smart #define lpfc_fcf_record_fab_name_4_SHIFT	0
2232da0436e9SJames Smart #define lpfc_fcf_record_fab_name_4_MASK		0x000000FF
2233da0436e9SJames Smart #define lpfc_fcf_record_fab_name_4_WORD		word6
2234da0436e9SJames Smart #define lpfc_fcf_record_fab_name_5_SHIFT	8
2235da0436e9SJames Smart #define lpfc_fcf_record_fab_name_5_MASK		0x000000FF
2236da0436e9SJames Smart #define lpfc_fcf_record_fab_name_5_WORD		word6
2237da0436e9SJames Smart #define lpfc_fcf_record_fab_name_6_SHIFT	16
2238da0436e9SJames Smart #define lpfc_fcf_record_fab_name_6_MASK		0x000000FF
2239da0436e9SJames Smart #define lpfc_fcf_record_fab_name_6_WORD		word6
2240da0436e9SJames Smart #define lpfc_fcf_record_fab_name_7_SHIFT	24
2241da0436e9SJames Smart #define lpfc_fcf_record_fab_name_7_MASK		0x000000FF
2242da0436e9SJames Smart #define lpfc_fcf_record_fab_name_7_WORD		word6
2243da0436e9SJames Smart 	uint32_t word7;
2244da0436e9SJames Smart #define lpfc_fcf_record_fc_map_0_SHIFT		0
2245da0436e9SJames Smart #define lpfc_fcf_record_fc_map_0_MASK		0x000000FF
2246da0436e9SJames Smart #define lpfc_fcf_record_fc_map_0_WORD		word7
2247da0436e9SJames Smart #define lpfc_fcf_record_fc_map_1_SHIFT		8
2248da0436e9SJames Smart #define lpfc_fcf_record_fc_map_1_MASK		0x000000FF
2249da0436e9SJames Smart #define lpfc_fcf_record_fc_map_1_WORD		word7
2250da0436e9SJames Smart #define lpfc_fcf_record_fc_map_2_SHIFT		16
2251da0436e9SJames Smart #define lpfc_fcf_record_fc_map_2_MASK		0x000000FF
2252da0436e9SJames Smart #define lpfc_fcf_record_fc_map_2_WORD		word7
2253da0436e9SJames Smart #define lpfc_fcf_record_fcf_valid_SHIFT		24
225426979cedSJames Smart #define lpfc_fcf_record_fcf_valid_MASK		0x00000001
2255da0436e9SJames Smart #define lpfc_fcf_record_fcf_valid_WORD		word7
225626979cedSJames Smart #define lpfc_fcf_record_fcf_fc_SHIFT		25
225726979cedSJames Smart #define lpfc_fcf_record_fcf_fc_MASK		0x00000001
225826979cedSJames Smart #define lpfc_fcf_record_fcf_fc_WORD		word7
225926979cedSJames Smart #define lpfc_fcf_record_fcf_sol_SHIFT		31
226026979cedSJames Smart #define lpfc_fcf_record_fcf_sol_MASK		0x00000001
226126979cedSJames Smart #define lpfc_fcf_record_fcf_sol_WORD		word7
2262da0436e9SJames Smart 	uint32_t word8;
2263da0436e9SJames Smart #define lpfc_fcf_record_fcf_index_SHIFT		0
2264da0436e9SJames Smart #define lpfc_fcf_record_fcf_index_MASK		0x0000FFFF
2265da0436e9SJames Smart #define lpfc_fcf_record_fcf_index_WORD		word8
2266da0436e9SJames Smart #define lpfc_fcf_record_fcf_state_SHIFT		16
2267da0436e9SJames Smart #define lpfc_fcf_record_fcf_state_MASK		0x0000FFFF
2268da0436e9SJames Smart #define lpfc_fcf_record_fcf_state_WORD		word8
2269da0436e9SJames Smart 	uint8_t vlan_bitmap[512];
22708fa38513SJames Smart 	uint32_t word137;
22718fa38513SJames Smart #define lpfc_fcf_record_switch_name_0_SHIFT	0
22728fa38513SJames Smart #define lpfc_fcf_record_switch_name_0_MASK	0x000000FF
22738fa38513SJames Smart #define lpfc_fcf_record_switch_name_0_WORD	word137
22748fa38513SJames Smart #define lpfc_fcf_record_switch_name_1_SHIFT	8
22758fa38513SJames Smart #define lpfc_fcf_record_switch_name_1_MASK	0x000000FF
22768fa38513SJames Smart #define lpfc_fcf_record_switch_name_1_WORD	word137
22778fa38513SJames Smart #define lpfc_fcf_record_switch_name_2_SHIFT	16
22788fa38513SJames Smart #define lpfc_fcf_record_switch_name_2_MASK	0x000000FF
22798fa38513SJames Smart #define lpfc_fcf_record_switch_name_2_WORD	word137
22808fa38513SJames Smart #define lpfc_fcf_record_switch_name_3_SHIFT	24
22818fa38513SJames Smart #define lpfc_fcf_record_switch_name_3_MASK	0x000000FF
22828fa38513SJames Smart #define lpfc_fcf_record_switch_name_3_WORD	word137
22838fa38513SJames Smart 	uint32_t word138;
22848fa38513SJames Smart #define lpfc_fcf_record_switch_name_4_SHIFT	0
22858fa38513SJames Smart #define lpfc_fcf_record_switch_name_4_MASK	0x000000FF
22868fa38513SJames Smart #define lpfc_fcf_record_switch_name_4_WORD	word138
22878fa38513SJames Smart #define lpfc_fcf_record_switch_name_5_SHIFT	8
22888fa38513SJames Smart #define lpfc_fcf_record_switch_name_5_MASK	0x000000FF
22898fa38513SJames Smart #define lpfc_fcf_record_switch_name_5_WORD	word138
22908fa38513SJames Smart #define lpfc_fcf_record_switch_name_6_SHIFT	16
22918fa38513SJames Smart #define lpfc_fcf_record_switch_name_6_MASK	0x000000FF
22928fa38513SJames Smart #define lpfc_fcf_record_switch_name_6_WORD	word138
22938fa38513SJames Smart #define lpfc_fcf_record_switch_name_7_SHIFT	24
22948fa38513SJames Smart #define lpfc_fcf_record_switch_name_7_MASK	0x000000FF
22958fa38513SJames Smart #define lpfc_fcf_record_switch_name_7_WORD	word138
2296da0436e9SJames Smart };
2297da0436e9SJames Smart 
2298da0436e9SJames Smart struct lpfc_mbx_read_fcf_tbl {
2299da0436e9SJames Smart 	union lpfc_sli4_cfg_shdr cfg_shdr;
2300da0436e9SJames Smart 	union {
2301da0436e9SJames Smart 		struct {
2302da0436e9SJames Smart 			uint32_t word10;
2303da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_indx_SHIFT	0
2304da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_indx_MASK		0x0000FFFF
2305da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_indx_WORD		word10
2306da0436e9SJames Smart 		} request;
2307da0436e9SJames Smart 		struct {
2308da0436e9SJames Smart 			uint32_t eventag;
2309da0436e9SJames Smart 		} response;
2310da0436e9SJames Smart 	} u;
2311da0436e9SJames Smart 	uint32_t word11;
2312da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_nxt_vindx_SHIFT	0
2313da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_nxt_vindx_MASK	0x0000FFFF
2314da0436e9SJames Smart #define lpfc_mbx_read_fcf_tbl_nxt_vindx_WORD	word11
2315da0436e9SJames Smart };
2316da0436e9SJames Smart 
2317da0436e9SJames Smart struct lpfc_mbx_add_fcf_tbl_entry {
2318da0436e9SJames Smart 	union lpfc_sli4_cfg_shdr cfg_shdr;
2319da0436e9SJames Smart 	uint32_t word10;
2320da0436e9SJames Smart #define lpfc_mbx_add_fcf_tbl_fcfi_SHIFT        0
2321da0436e9SJames Smart #define lpfc_mbx_add_fcf_tbl_fcfi_MASK         0x0000FFFF
2322da0436e9SJames Smart #define lpfc_mbx_add_fcf_tbl_fcfi_WORD         word10
2323da0436e9SJames Smart 	struct lpfc_mbx_sge fcf_sge;
2324da0436e9SJames Smart };
2325da0436e9SJames Smart 
2326da0436e9SJames Smart struct lpfc_mbx_del_fcf_tbl_entry {
2327da0436e9SJames Smart 	struct mbox_header header;
2328da0436e9SJames Smart 	uint32_t word10;
2329da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_count_SHIFT	0
2330da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_count_MASK		0x0000FFFF
2331da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_count_WORD		word10
2332da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_index_SHIFT	16
2333da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_index_MASK		0x0000FFFF
2334da0436e9SJames Smart #define lpfc_mbx_del_fcf_tbl_index_WORD		word10
2335da0436e9SJames Smart };
2336da0436e9SJames Smart 
2337ecfd03c6SJames Smart struct lpfc_mbx_redisc_fcf_tbl {
2338ecfd03c6SJames Smart 	struct mbox_header header;
2339ecfd03c6SJames Smart 	uint32_t word10;
2340ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_count_SHIFT		0
2341ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_count_MASK		0x0000FFFF
2342ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_count_WORD		word10
2343ecfd03c6SJames Smart 	uint32_t resvd;
2344ecfd03c6SJames Smart 	uint32_t word12;
2345ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_index_SHIFT		0
2346ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_index_MASK		0x0000FFFF
2347ecfd03c6SJames Smart #define lpfc_mbx_redisc_fcf_index_WORD		word12
2348ecfd03c6SJames Smart };
2349ecfd03c6SJames Smart 
2350da0436e9SJames Smart /* Status field for embedded SLI_CONFIG mailbox command */
2351da0436e9SJames Smart #define STATUS_SUCCESS					0x0
2352da0436e9SJames Smart #define STATUS_FAILED 					0x1
2353da0436e9SJames Smart #define STATUS_ILLEGAL_REQUEST				0x2
2354da0436e9SJames Smart #define STATUS_ILLEGAL_FIELD				0x3
2355da0436e9SJames Smart #define STATUS_INSUFFICIENT_BUFFER 			0x4
2356da0436e9SJames Smart #define STATUS_UNAUTHORIZED_REQUEST			0x5
2357da0436e9SJames Smart #define STATUS_FLASHROM_SAVE_FAILED			0x17
2358da0436e9SJames Smart #define STATUS_FLASHROM_RESTORE_FAILED			0x18
2359da0436e9SJames Smart #define STATUS_ICCBINDEX_ALLOC_FAILED			0x1a
2360da0436e9SJames Smart #define STATUS_IOCTLHANDLE_ALLOC_FAILED 		0x1b
2361da0436e9SJames Smart #define STATUS_INVALID_PHY_ADDR_FROM_OSM		0x1c
2362da0436e9SJames Smart #define STATUS_INVALID_PHY_ADDR_LEN_FROM_OSM		0x1d
2363da0436e9SJames Smart #define STATUS_ASSERT_FAILED				0x1e
2364da0436e9SJames Smart #define STATUS_INVALID_SESSION				0x1f
2365da0436e9SJames Smart #define STATUS_INVALID_CONNECTION			0x20
2366da0436e9SJames Smart #define STATUS_BTL_PATH_EXCEEDS_OSM_LIMIT		0x21
2367da0436e9SJames Smart #define STATUS_BTL_NO_FREE_SLOT_PATH			0x24
2368da0436e9SJames Smart #define STATUS_BTL_NO_FREE_SLOT_TGTID			0x25
2369da0436e9SJames Smart #define STATUS_OSM_DEVSLOT_NOT_FOUND			0x26
2370da0436e9SJames Smart #define STATUS_FLASHROM_READ_FAILED			0x27
2371da0436e9SJames Smart #define STATUS_POLL_IOCTL_TIMEOUT			0x28
2372da0436e9SJames Smart #define STATUS_ERROR_ACITMAIN				0x2a
2373da0436e9SJames Smart #define STATUS_REBOOT_REQUIRED				0x2c
2374da0436e9SJames Smart #define STATUS_FCF_IN_USE				0x3a
2375def9c7a9SJames Smart #define STATUS_FCF_TABLE_EMPTY				0x43
2376da0436e9SJames Smart 
2377481ad967SJames Smart /*
2378481ad967SJames Smart  * Additional status field for embedded SLI_CONFIG mailbox
2379481ad967SJames Smart  * command.
2380481ad967SJames Smart  */
2381481ad967SJames Smart #define ADD_STATUS_OPERATION_ALREADY_ACTIVE		0x67
23821feb8204SJames Smart #define ADD_STATUS_FW_NOT_SUPPORTED			0xEB
238366e9e6bfSJames Smart #define ADD_STATUS_INVALID_REQUEST			0x4B
238472df8a45SJames Smart #define ADD_STATUS_INVALID_OBJECT_NAME			0xA0
23850a5ce731SJames Smart #define ADD_STATUS_FW_DOWNLOAD_HW_DISABLED              0x58
2386481ad967SJames Smart 
2387da0436e9SJames Smart struct lpfc_mbx_sli4_config {
2388da0436e9SJames Smart 	struct mbox_header header;
2389da0436e9SJames Smart };
2390da0436e9SJames Smart 
2391da0436e9SJames Smart struct lpfc_mbx_init_vfi {
2392da0436e9SJames Smart 	uint32_t word1;
2393da0436e9SJames Smart #define lpfc_init_vfi_vr_SHIFT		31
2394da0436e9SJames Smart #define lpfc_init_vfi_vr_MASK		0x00000001
2395da0436e9SJames Smart #define lpfc_init_vfi_vr_WORD		word1
2396da0436e9SJames Smart #define lpfc_init_vfi_vt_SHIFT		30
2397da0436e9SJames Smart #define lpfc_init_vfi_vt_MASK		0x00000001
2398da0436e9SJames Smart #define lpfc_init_vfi_vt_WORD		word1
2399da0436e9SJames Smart #define lpfc_init_vfi_vf_SHIFT		29
2400da0436e9SJames Smart #define lpfc_init_vfi_vf_MASK		0x00000001
2401da0436e9SJames Smart #define lpfc_init_vfi_vf_WORD		word1
240276a95d75SJames Smart #define lpfc_init_vfi_vp_SHIFT		28
240376a95d75SJames Smart #define lpfc_init_vfi_vp_MASK		0x00000001
240476a95d75SJames Smart #define lpfc_init_vfi_vp_WORD		word1
2405da0436e9SJames Smart #define lpfc_init_vfi_vfi_SHIFT		0
2406da0436e9SJames Smart #define lpfc_init_vfi_vfi_MASK		0x0000FFFF
2407da0436e9SJames Smart #define lpfc_init_vfi_vfi_WORD		word1
2408da0436e9SJames Smart 	uint32_t word2;
240976a95d75SJames Smart #define lpfc_init_vfi_vpi_SHIFT		16
241076a95d75SJames Smart #define lpfc_init_vfi_vpi_MASK		0x0000FFFF
241176a95d75SJames Smart #define lpfc_init_vfi_vpi_WORD		word2
2412da0436e9SJames Smart #define lpfc_init_vfi_fcfi_SHIFT	0
2413da0436e9SJames Smart #define lpfc_init_vfi_fcfi_MASK		0x0000FFFF
2414da0436e9SJames Smart #define lpfc_init_vfi_fcfi_WORD		word2
2415da0436e9SJames Smart 	uint32_t word3;
2416da0436e9SJames Smart #define lpfc_init_vfi_pri_SHIFT		13
2417da0436e9SJames Smart #define lpfc_init_vfi_pri_MASK		0x00000007
2418da0436e9SJames Smart #define lpfc_init_vfi_pri_WORD		word3
2419da0436e9SJames Smart #define lpfc_init_vfi_vf_id_SHIFT	1
2420da0436e9SJames Smart #define lpfc_init_vfi_vf_id_MASK	0x00000FFF
2421da0436e9SJames Smart #define lpfc_init_vfi_vf_id_WORD	word3
2422da0436e9SJames Smart 	uint32_t word4;
2423da0436e9SJames Smart #define lpfc_init_vfi_hop_count_SHIFT	24
2424da0436e9SJames Smart #define lpfc_init_vfi_hop_count_MASK	0x000000FF
2425da0436e9SJames Smart #define lpfc_init_vfi_hop_count_WORD	word4
2426da0436e9SJames Smart };
2427df9e1b59SJames Smart #define MBX_VFI_IN_USE			0x9F02
2428df9e1b59SJames Smart 
2429da0436e9SJames Smart 
2430da0436e9SJames Smart struct lpfc_mbx_reg_vfi {
2431da0436e9SJames Smart 	uint32_t word1;
2432ae05ebe3SJames Smart #define lpfc_reg_vfi_upd_SHIFT		29
2433ae05ebe3SJames Smart #define lpfc_reg_vfi_upd_MASK		0x00000001
2434ae05ebe3SJames Smart #define lpfc_reg_vfi_upd_WORD		word1
2435da0436e9SJames Smart #define lpfc_reg_vfi_vp_SHIFT		28
2436da0436e9SJames Smart #define lpfc_reg_vfi_vp_MASK		0x00000001
2437da0436e9SJames Smart #define lpfc_reg_vfi_vp_WORD		word1
2438da0436e9SJames Smart #define lpfc_reg_vfi_vfi_SHIFT		0
2439da0436e9SJames Smart #define lpfc_reg_vfi_vfi_MASK		0x0000FFFF
2440da0436e9SJames Smart #define lpfc_reg_vfi_vfi_WORD		word1
2441da0436e9SJames Smart 	uint32_t word2;
2442da0436e9SJames Smart #define lpfc_reg_vfi_vpi_SHIFT		16
2443da0436e9SJames Smart #define lpfc_reg_vfi_vpi_MASK		0x0000FFFF
2444da0436e9SJames Smart #define lpfc_reg_vfi_vpi_WORD		word2
2445da0436e9SJames Smart #define lpfc_reg_vfi_fcfi_SHIFT		0
2446da0436e9SJames Smart #define lpfc_reg_vfi_fcfi_MASK		0x0000FFFF
2447da0436e9SJames Smart #define lpfc_reg_vfi_fcfi_WORD		word2
2448c868595dSJames Smart 	uint32_t wwn[2];
2449da0436e9SJames Smart 	struct ulp_bde64 bde;
2450b19a061aSJames Smart 	uint32_t e_d_tov;
2451b19a061aSJames Smart 	uint32_t r_a_tov;
2452da0436e9SJames Smart 	uint32_t word10;
2453da0436e9SJames Smart #define lpfc_reg_vfi_nport_id_SHIFT	0
2454da0436e9SJames Smart #define lpfc_reg_vfi_nport_id_MASK	0x00FFFFFF
2455da0436e9SJames Smart #define lpfc_reg_vfi_nport_id_WORD	word10
245644fd7fe3SJames Smart #define lpfc_reg_vfi_bbcr_SHIFT		27
245744fd7fe3SJames Smart #define lpfc_reg_vfi_bbcr_MASK		0x00000001
245844fd7fe3SJames Smart #define lpfc_reg_vfi_bbcr_WORD		word10
245944fd7fe3SJames Smart #define lpfc_reg_vfi_bbscn_SHIFT	28
246044fd7fe3SJames Smart #define lpfc_reg_vfi_bbscn_MASK		0x0000000F
246144fd7fe3SJames Smart #define lpfc_reg_vfi_bbscn_WORD		word10
2462da0436e9SJames Smart };
2463da0436e9SJames Smart 
2464da0436e9SJames Smart struct lpfc_mbx_init_vpi {
2465da0436e9SJames Smart 	uint32_t word1;
2466da0436e9SJames Smart #define lpfc_init_vpi_vfi_SHIFT		16
2467da0436e9SJames Smart #define lpfc_init_vpi_vfi_MASK		0x0000FFFF
2468da0436e9SJames Smart #define lpfc_init_vpi_vfi_WORD		word1
2469da0436e9SJames Smart #define lpfc_init_vpi_vpi_SHIFT		0
2470da0436e9SJames Smart #define lpfc_init_vpi_vpi_MASK		0x0000FFFF
2471da0436e9SJames Smart #define lpfc_init_vpi_vpi_WORD		word1
2472da0436e9SJames Smart };
2473da0436e9SJames Smart 
2474da0436e9SJames Smart struct lpfc_mbx_read_vpi {
2475da0436e9SJames Smart 	uint32_t word1_rsvd;
2476da0436e9SJames Smart 	uint32_t word2;
2477da0436e9SJames Smart #define lpfc_mbx_read_vpi_vnportid_SHIFT	0
2478da0436e9SJames Smart #define lpfc_mbx_read_vpi_vnportid_MASK		0x00FFFFFF
2479da0436e9SJames Smart #define lpfc_mbx_read_vpi_vnportid_WORD		word2
2480da0436e9SJames Smart 	uint32_t word3_rsvd;
2481da0436e9SJames Smart 	uint32_t word4;
2482da0436e9SJames Smart #define lpfc_mbx_read_vpi_acq_alpa_SHIFT	0
2483da0436e9SJames Smart #define lpfc_mbx_read_vpi_acq_alpa_MASK		0x000000FF
2484da0436e9SJames Smart #define lpfc_mbx_read_vpi_acq_alpa_WORD		word4
2485da0436e9SJames Smart #define lpfc_mbx_read_vpi_pb_SHIFT		15
2486da0436e9SJames Smart #define lpfc_mbx_read_vpi_pb_MASK		0x00000001
2487da0436e9SJames Smart #define lpfc_mbx_read_vpi_pb_WORD		word4
2488da0436e9SJames Smart #define lpfc_mbx_read_vpi_spec_alpa_SHIFT	16
2489da0436e9SJames Smart #define lpfc_mbx_read_vpi_spec_alpa_MASK	0x000000FF
2490da0436e9SJames Smart #define lpfc_mbx_read_vpi_spec_alpa_WORD	word4
2491da0436e9SJames Smart #define lpfc_mbx_read_vpi_ns_SHIFT		30
2492da0436e9SJames Smart #define lpfc_mbx_read_vpi_ns_MASK		0x00000001
2493da0436e9SJames Smart #define lpfc_mbx_read_vpi_ns_WORD		word4
2494da0436e9SJames Smart #define lpfc_mbx_read_vpi_hl_SHIFT		31
2495da0436e9SJames Smart #define lpfc_mbx_read_vpi_hl_MASK		0x00000001
2496da0436e9SJames Smart #define lpfc_mbx_read_vpi_hl_WORD		word4
2497da0436e9SJames Smart 	uint32_t word5_rsvd;
2498da0436e9SJames Smart 	uint32_t word6;
2499da0436e9SJames Smart #define lpfc_mbx_read_vpi_vpi_SHIFT		0
2500da0436e9SJames Smart #define lpfc_mbx_read_vpi_vpi_MASK		0x0000FFFF
2501da0436e9SJames Smart #define lpfc_mbx_read_vpi_vpi_WORD		word6
2502da0436e9SJames Smart 	uint32_t word7;
2503da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_0_SHIFT		0
2504da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_0_MASK		0x000000FF
2505da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_0_WORD		word7
2506da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_1_SHIFT		8
2507da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_1_MASK		0x000000FF
2508da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_1_WORD		word7
2509da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_2_SHIFT		16
2510da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_2_MASK		0x000000FF
2511da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_2_WORD		word7
2512da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_3_SHIFT		24
2513da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_3_MASK		0x000000FF
2514da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_3_WORD		word7
2515da0436e9SJames Smart 	uint32_t word8;
2516da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_4_SHIFT		0
2517da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_4_MASK		0x000000FF
2518da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_4_WORD		word8
2519da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_5_SHIFT		8
2520da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_5_MASK		0x000000FF
2521da0436e9SJames Smart #define lpfc_mbx_read_vpi_mac_5_WORD		word8
2522da0436e9SJames Smart #define lpfc_mbx_read_vpi_vlan_tag_SHIFT	16
2523da0436e9SJames Smart #define lpfc_mbx_read_vpi_vlan_tag_MASK		0x00000FFF
2524da0436e9SJames Smart #define lpfc_mbx_read_vpi_vlan_tag_WORD		word8
2525da0436e9SJames Smart #define lpfc_mbx_read_vpi_vv_SHIFT		28
2526da0436e9SJames Smart #define lpfc_mbx_read_vpi_vv_MASK		0x0000001
2527da0436e9SJames Smart #define lpfc_mbx_read_vpi_vv_WORD		word8
2528da0436e9SJames Smart };
2529da0436e9SJames Smart 
2530da0436e9SJames Smart struct lpfc_mbx_unreg_vfi {
2531da0436e9SJames Smart 	uint32_t word1_rsvd;
2532da0436e9SJames Smart 	uint32_t word2;
2533da0436e9SJames Smart #define lpfc_unreg_vfi_vfi_SHIFT	0
2534da0436e9SJames Smart #define lpfc_unreg_vfi_vfi_MASK		0x0000FFFF
2535da0436e9SJames Smart #define lpfc_unreg_vfi_vfi_WORD		word2
2536da0436e9SJames Smart };
2537da0436e9SJames Smart 
2538da0436e9SJames Smart struct lpfc_mbx_resume_rpi {
2539da0436e9SJames Smart 	uint32_t word1;
25408fa38513SJames Smart #define lpfc_resume_rpi_index_SHIFT	0
25418fa38513SJames Smart #define lpfc_resume_rpi_index_MASK	0x0000FFFF
25428fa38513SJames Smart #define lpfc_resume_rpi_index_WORD	word1
25438fa38513SJames Smart #define lpfc_resume_rpi_ii_SHIFT	30
25448fa38513SJames Smart #define lpfc_resume_rpi_ii_MASK		0x00000003
25458fa38513SJames Smart #define lpfc_resume_rpi_ii_WORD		word1
25468fa38513SJames Smart #define RESUME_INDEX_RPI		0
25478fa38513SJames Smart #define RESUME_INDEX_VPI		1
25488fa38513SJames Smart #define RESUME_INDEX_VFI		2
25498fa38513SJames Smart #define RESUME_INDEX_FCFI		3
2550da0436e9SJames Smart 	uint32_t event_tag;
2551da0436e9SJames Smart };
2552da0436e9SJames Smart 
2553da0436e9SJames Smart #define REG_FCF_INVALID_QID	0xFFFF
2554da0436e9SJames Smart struct lpfc_mbx_reg_fcfi {
2555da0436e9SJames Smart 	uint32_t word1;
2556da0436e9SJames Smart #define lpfc_reg_fcfi_info_index_SHIFT	0
2557da0436e9SJames Smart #define lpfc_reg_fcfi_info_index_MASK	0x0000FFFF
2558da0436e9SJames Smart #define lpfc_reg_fcfi_info_index_WORD	word1
2559da0436e9SJames Smart #define lpfc_reg_fcfi_fcfi_SHIFT	16
2560da0436e9SJames Smart #define lpfc_reg_fcfi_fcfi_MASK		0x0000FFFF
2561da0436e9SJames Smart #define lpfc_reg_fcfi_fcfi_WORD		word1
2562da0436e9SJames Smart 	uint32_t word2;
2563da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id1_SHIFT	0
2564da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id1_MASK	0x0000FFFF
2565da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id1_WORD	word2
2566da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id0_SHIFT	16
2567da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id0_MASK	0x0000FFFF
2568da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id0_WORD	word2
2569da0436e9SJames Smart 	uint32_t word3;
2570da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id3_SHIFT	0
2571da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id3_MASK	0x0000FFFF
2572da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id3_WORD	word3
2573da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id2_SHIFT	16
2574da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id2_MASK	0x0000FFFF
2575da0436e9SJames Smart #define lpfc_reg_fcfi_rq_id2_WORD	word3
2576da0436e9SJames Smart 	uint32_t word4;
2577da0436e9SJames Smart #define lpfc_reg_fcfi_type_match0_SHIFT	24
2578da0436e9SJames Smart #define lpfc_reg_fcfi_type_match0_MASK	0x000000FF
2579da0436e9SJames Smart #define lpfc_reg_fcfi_type_match0_WORD	word4
2580da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask0_SHIFT	16
2581da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask0_MASK	0x000000FF
2582da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask0_WORD	word4
2583da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match0_SHIFT	8
2584da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match0_MASK	0x000000FF
2585da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match0_WORD	word4
2586da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask0_SHIFT	0
2587da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask0_MASK	0x000000FF
2588da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask0_WORD	word4
2589da0436e9SJames Smart 	uint32_t word5;
2590da0436e9SJames Smart #define lpfc_reg_fcfi_type_match1_SHIFT	24
2591da0436e9SJames Smart #define lpfc_reg_fcfi_type_match1_MASK	0x000000FF
2592da0436e9SJames Smart #define lpfc_reg_fcfi_type_match1_WORD	word5
2593da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask1_SHIFT	16
2594da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask1_MASK	0x000000FF
2595da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask1_WORD	word5
2596da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match1_SHIFT	8
2597da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match1_MASK	0x000000FF
2598da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match1_WORD	word5
2599da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask1_SHIFT	0
2600da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask1_MASK	0x000000FF
2601da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask1_WORD	word5
2602da0436e9SJames Smart 	uint32_t word6;
2603da0436e9SJames Smart #define lpfc_reg_fcfi_type_match2_SHIFT	24
2604da0436e9SJames Smart #define lpfc_reg_fcfi_type_match2_MASK	0x000000FF
2605da0436e9SJames Smart #define lpfc_reg_fcfi_type_match2_WORD	word6
2606da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask2_SHIFT	16
2607da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask2_MASK	0x000000FF
2608da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask2_WORD	word6
2609da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match2_SHIFT	8
2610da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match2_MASK	0x000000FF
2611da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match2_WORD	word6
2612da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask2_SHIFT	0
2613da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask2_MASK	0x000000FF
2614da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask2_WORD	word6
2615da0436e9SJames Smart 	uint32_t word7;
2616da0436e9SJames Smart #define lpfc_reg_fcfi_type_match3_SHIFT	24
2617da0436e9SJames Smart #define lpfc_reg_fcfi_type_match3_MASK	0x000000FF
2618da0436e9SJames Smart #define lpfc_reg_fcfi_type_match3_WORD	word7
2619da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask3_SHIFT	16
2620da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask3_MASK	0x000000FF
2621da0436e9SJames Smart #define lpfc_reg_fcfi_type_mask3_WORD	word7
2622da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match3_SHIFT	8
2623da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match3_MASK	0x000000FF
2624da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_match3_WORD	word7
2625da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask3_SHIFT	0
2626da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask3_MASK	0x000000FF
2627da0436e9SJames Smart #define lpfc_reg_fcfi_rctl_mask3_WORD	word7
2628da0436e9SJames Smart 	uint32_t word8;
2629da0436e9SJames Smart #define lpfc_reg_fcfi_mam_SHIFT		13
2630da0436e9SJames Smart #define lpfc_reg_fcfi_mam_MASK		0x00000003
2631da0436e9SJames Smart #define lpfc_reg_fcfi_mam_WORD		word8
2632da0436e9SJames Smart #define LPFC_MAM_BOTH		0	/* Both SPMA and FPMA */
2633da0436e9SJames Smart #define LPFC_MAM_SPMA		1	/* Server Provided MAC Address */
2634da0436e9SJames Smart #define LPFC_MAM_FPMA		2	/* Fabric Provided MAC Address */
2635da0436e9SJames Smart #define lpfc_reg_fcfi_vv_SHIFT		12
2636da0436e9SJames Smart #define lpfc_reg_fcfi_vv_MASK		0x00000001
2637da0436e9SJames Smart #define lpfc_reg_fcfi_vv_WORD		word8
2638da0436e9SJames Smart #define lpfc_reg_fcfi_vlan_tag_SHIFT	0
2639da0436e9SJames Smart #define lpfc_reg_fcfi_vlan_tag_MASK	0x00000FFF
2640da0436e9SJames Smart #define lpfc_reg_fcfi_vlan_tag_WORD	word8
2641da0436e9SJames Smart };
2642da0436e9SJames Smart 
26432d7dbc4cSJames Smart struct lpfc_mbx_reg_fcfi_mrq {
26442d7dbc4cSJames Smart 	uint32_t word1;
26452d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_info_index_SHIFT	0
26462d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_info_index_MASK	0x0000FFFF
26472d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_info_index_WORD	word1
26482d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_fcfi_SHIFT		16
26492d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_fcfi_MASK		0x0000FFFF
26502d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_fcfi_WORD		word1
26512d7dbc4cSJames Smart 	uint32_t word2;
26522d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id1_SHIFT		0
26532d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id1_MASK		0x0000FFFF
26542d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id1_WORD		word2
26552d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id0_SHIFT		16
26562d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id0_MASK		0x0000FFFF
26572d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id0_WORD		word2
26582d7dbc4cSJames Smart 	uint32_t word3;
26592d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id3_SHIFT		0
26602d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id3_MASK		0x0000FFFF
26612d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id3_WORD		word3
26622d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id2_SHIFT		16
26632d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id2_MASK		0x0000FFFF
26642d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rq_id2_WORD		word3
26652d7dbc4cSJames Smart 	uint32_t word4;
26662d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match0_SHIFT	24
26672d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match0_MASK	0x000000FF
26682d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match0_WORD	word4
26692d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask0_SHIFT	16
26702d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask0_MASK	0x000000FF
26712d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask0_WORD	word4
26722d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match0_SHIFT	8
26732d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match0_MASK	0x000000FF
26742d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match0_WORD	word4
26752d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask0_SHIFT	0
26762d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask0_MASK	0x000000FF
26772d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask0_WORD	word4
26782d7dbc4cSJames Smart 	uint32_t word5;
26792d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match1_SHIFT	24
26802d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match1_MASK	0x000000FF
26812d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match1_WORD	word5
26822d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask1_SHIFT	16
26832d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask1_MASK	0x000000FF
26842d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask1_WORD	word5
26852d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match1_SHIFT	8
26862d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match1_MASK	0x000000FF
26872d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match1_WORD	word5
26882d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask1_SHIFT	0
26892d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask1_MASK	0x000000FF
26902d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask1_WORD	word5
26912d7dbc4cSJames Smart 	uint32_t word6;
26922d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match2_SHIFT	24
26932d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match2_MASK	0x000000FF
26942d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match2_WORD	word6
26952d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask2_SHIFT	16
26962d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask2_MASK	0x000000FF
26972d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask2_WORD	word6
26982d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match2_SHIFT	8
26992d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match2_MASK	0x000000FF
27002d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match2_WORD	word6
27012d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask2_SHIFT	0
27022d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask2_MASK	0x000000FF
27032d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask2_WORD	word6
27042d7dbc4cSJames Smart 	uint32_t word7;
27052d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match3_SHIFT	24
27062d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match3_MASK	0x000000FF
27072d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_match3_WORD	word7
27082d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask3_SHIFT	16
27092d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask3_MASK	0x000000FF
27102d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_type_mask3_WORD	word7
27112d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match3_SHIFT	8
27122d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match3_MASK	0x000000FF
27132d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_match3_WORD	word7
27142d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask3_SHIFT	0
27152d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask3_MASK	0x000000FF
27162d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_rctl_mask3_WORD	word7
27172d7dbc4cSJames Smart 	uint32_t word8;
27182d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc7_SHIFT		31
27192d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc7_MASK		0x00000001
27202d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc7_WORD		word8
27212d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc6_SHIFT		30
27222d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc6_MASK		0x00000001
27232d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc6_WORD		word8
27242d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc5_SHIFT		29
27252d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc5_MASK		0x00000001
27262d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc5_WORD		word8
27272d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc4_SHIFT		28
27282d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc4_MASK		0x00000001
27292d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc4_WORD		word8
27302d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc3_SHIFT		27
27312d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc3_MASK		0x00000001
27322d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc3_WORD		word8
27332d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc2_SHIFT		26
27342d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc2_MASK		0x00000001
27352d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc2_WORD		word8
27362d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc1_SHIFT		25
27372d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc1_MASK		0x00000001
27382d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc1_WORD		word8
27392d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc0_SHIFT		24
27402d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc0_MASK		0x00000001
27412d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_ptc0_WORD		word8
27422d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt7_SHIFT		23
27432d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt7_MASK		0x00000001
27442d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt7_WORD		word8
27452d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt6_SHIFT		22
27462d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt6_MASK		0x00000001
27472d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt6_WORD		word8
27482d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt5_SHIFT		21
27492d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt5_MASK		0x00000001
27502d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt5_WORD		word8
27512d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt4_SHIFT		20
27522d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt4_MASK		0x00000001
27532d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt4_WORD		word8
27542d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt3_SHIFT		19
27552d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt3_MASK		0x00000001
27562d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt3_WORD		word8
27572d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt2_SHIFT		18
27582d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt2_MASK		0x00000001
27592d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt2_WORD		word8
27602d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt1_SHIFT		17
27612d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt1_MASK		0x00000001
27622d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt1_WORD		word8
27632d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt0_SHIFT		16
27642d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt0_MASK		0x00000001
27652d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_pt0_WORD		word8
27662d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_xmv_SHIFT		15
27672d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_xmv_MASK		0x00000001
27682d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_xmv_WORD		word8
27692d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_mode_SHIFT		13
27702d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_mode_MASK		0x00000001
27712d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_mode_WORD		word8
27722d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_vv_SHIFT		12
27732d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_vv_MASK		0x00000001
27742d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_vv_WORD		word8
27752d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_vlan_tag_SHIFT	0
27762d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_vlan_tag_MASK		0x00000FFF
27772d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_vlan_tag_WORD		word8
27782d7dbc4cSJames Smart 	uint32_t word9;
27792d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_policy_SHIFT		12
27802d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_policy_MASK		0x0000000F
27812d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_policy_WORD		word9
27822d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_filter_SHIFT		8
27832d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_filter_MASK		0x0000000F
27842d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_filter_WORD		word9
27852d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_npairs_SHIFT		0
27862d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_npairs_MASK		0x000000FF
27872d7dbc4cSJames Smart #define lpfc_reg_fcfi_mrq_npairs_WORD		word9
27882d7dbc4cSJames Smart 	uint32_t word10;
27892d7dbc4cSJames Smart 	uint32_t word11;
27902d7dbc4cSJames Smart 	uint32_t word12;
27912d7dbc4cSJames Smart 	uint32_t word13;
27922d7dbc4cSJames Smart 	uint32_t word14;
27932d7dbc4cSJames Smart 	uint32_t word15;
27942d7dbc4cSJames Smart 	uint32_t word16;
27952d7dbc4cSJames Smart };
27962d7dbc4cSJames Smart 
2797da0436e9SJames Smart struct lpfc_mbx_unreg_fcfi {
2798da0436e9SJames Smart 	uint32_t word1_rsv;
2799da0436e9SJames Smart 	uint32_t word2;
2800da0436e9SJames Smart #define lpfc_unreg_fcfi_SHIFT		0
2801da0436e9SJames Smart #define lpfc_unreg_fcfi_MASK		0x0000FFFF
2802da0436e9SJames Smart #define lpfc_unreg_fcfi_WORD		word2
2803da0436e9SJames Smart };
2804da0436e9SJames Smart 
2805da0436e9SJames Smart struct lpfc_mbx_read_rev {
2806da0436e9SJames Smart 	uint32_t word1;
2807da0436e9SJames Smart #define lpfc_mbx_rd_rev_sli_lvl_SHIFT  		16
2808da0436e9SJames Smart #define lpfc_mbx_rd_rev_sli_lvl_MASK   		0x0000000F
2809da0436e9SJames Smart #define lpfc_mbx_rd_rev_sli_lvl_WORD   		word1
2810da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcoe_SHIFT		20
2811da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcoe_MASK		0x00000001
2812da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcoe_WORD		word1
281345ed1190SJames Smart #define lpfc_mbx_rd_rev_cee_ver_SHIFT		21
281445ed1190SJames Smart #define lpfc_mbx_rd_rev_cee_ver_MASK		0x00000003
281545ed1190SJames Smart #define lpfc_mbx_rd_rev_cee_ver_WORD		word1
281645ed1190SJames Smart #define LPFC_PREDCBX_CEE_MODE	0
281745ed1190SJames Smart #define LPFC_DCBX_CEE_MODE	1
2818da0436e9SJames Smart #define lpfc_mbx_rd_rev_vpd_SHIFT		29
2819da0436e9SJames Smart #define lpfc_mbx_rd_rev_vpd_MASK		0x00000001
2820da0436e9SJames Smart #define lpfc_mbx_rd_rev_vpd_WORD		word1
2821da0436e9SJames Smart 	uint32_t first_hw_rev;
28224e565cf0SJames Smart #define LPFC_G7_ASIC_1				0xd
2823da0436e9SJames Smart 	uint32_t second_hw_rev;
2824da0436e9SJames Smart 	uint32_t word4_rsvd;
2825da0436e9SJames Smart 	uint32_t third_hw_rev;
2826da0436e9SJames Smart 	uint32_t word6;
2827da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_low_SHIFT		0
2828da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_low_MASK		0x000000FF
2829da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_low_WORD		word6
2830da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_high_SHIFT		8
2831da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_high_MASK		0x000000FF
2832da0436e9SJames Smart #define lpfc_mbx_rd_rev_fcph_high_WORD		word6
2833da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_low_SHIFT	16
2834da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_low_MASK	0x000000FF
2835da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_low_WORD	word6
2836da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_high_SHIFT	24
2837da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_high_MASK	0x000000FF
2838da0436e9SJames Smart #define lpfc_mbx_rd_rev_ftr_lvl_high_WORD	word6
2839da0436e9SJames Smart 	uint32_t word7_rsvd;
2840da0436e9SJames Smart 	uint32_t fw_id_rev;
2841da0436e9SJames Smart 	uint8_t  fw_name[16];
2842da0436e9SJames Smart 	uint32_t ulp_fw_id_rev;
2843da0436e9SJames Smart 	uint8_t  ulp_fw_name[16];
2844da0436e9SJames Smart 	uint32_t word18_47_rsvd[30];
2845da0436e9SJames Smart 	uint32_t word48;
2846da0436e9SJames Smart #define lpfc_mbx_rd_rev_avail_len_SHIFT		0
2847da0436e9SJames Smart #define lpfc_mbx_rd_rev_avail_len_MASK		0x00FFFFFF
2848da0436e9SJames Smart #define lpfc_mbx_rd_rev_avail_len_WORD		word48
2849da0436e9SJames Smart 	uint32_t vpd_paddr_low;
2850da0436e9SJames Smart 	uint32_t vpd_paddr_high;
2851da0436e9SJames Smart 	uint32_t avail_vpd_len;
2852da0436e9SJames Smart 	uint32_t rsvd_52_63[12];
2853da0436e9SJames Smart };
2854da0436e9SJames Smart 
2855da0436e9SJames Smart struct lpfc_mbx_read_config {
2856da0436e9SJames Smart 	uint32_t word1;
28576d368e53SJames Smart #define lpfc_mbx_rd_conf_extnts_inuse_SHIFT	31
28586d368e53SJames Smart #define lpfc_mbx_rd_conf_extnts_inuse_MASK	0x00000001
28596d368e53SJames Smart #define lpfc_mbx_rd_conf_extnts_inuse_WORD	word1
28609064aeb2SJames Smart #define lpfc_mbx_rd_conf_wcs_SHIFT		28	/* warning signaling */
28619064aeb2SJames Smart #define lpfc_mbx_rd_conf_wcs_MASK		0x00000001
28629064aeb2SJames Smart #define lpfc_mbx_rd_conf_wcs_WORD		word1
28639064aeb2SJames Smart #define lpfc_mbx_rd_conf_acs_SHIFT		27	/* alarm signaling */
28649064aeb2SJames Smart #define lpfc_mbx_rd_conf_acs_MASK		0x00000001
28659064aeb2SJames Smart #define lpfc_mbx_rd_conf_acs_WORD		word1
2866da0436e9SJames Smart 	uint32_t word2;
2867cd1c8301SJames Smart #define lpfc_mbx_rd_conf_lnk_numb_SHIFT		0
2868cd1c8301SJames Smart #define lpfc_mbx_rd_conf_lnk_numb_MASK		0x0000003F
2869cd1c8301SJames Smart #define lpfc_mbx_rd_conf_lnk_numb_WORD		word2
2870cd1c8301SJames Smart #define lpfc_mbx_rd_conf_lnk_type_SHIFT		6
2871cd1c8301SJames Smart #define lpfc_mbx_rd_conf_lnk_type_MASK		0x00000003
2872cd1c8301SJames Smart #define lpfc_mbx_rd_conf_lnk_type_WORD		word2
2873026abb87SJames Smart #define LPFC_LNK_TYPE_GE	0
2874026abb87SJames Smart #define LPFC_LNK_TYPE_FC	1
2875cd1c8301SJames Smart #define lpfc_mbx_rd_conf_lnk_ldv_SHIFT		8
2876cd1c8301SJames Smart #define lpfc_mbx_rd_conf_lnk_ldv_MASK		0x00000001
2877cd1c8301SJames Smart #define lpfc_mbx_rd_conf_lnk_ldv_WORD		word2
28781dc5ec24SJames Smart #define lpfc_mbx_rd_conf_trunk_SHIFT		12
28791dc5ec24SJames Smart #define lpfc_mbx_rd_conf_trunk_MASK		0x0000000F
28801dc5ec24SJames Smart #define lpfc_mbx_rd_conf_trunk_WORD		word2
288183c6cb1aSJames Smart #define lpfc_mbx_rd_conf_pt_SHIFT		20
288283c6cb1aSJames Smart #define lpfc_mbx_rd_conf_pt_MASK		0x00000003
288383c6cb1aSJames Smart #define lpfc_mbx_rd_conf_pt_WORD		word2
288483c6cb1aSJames Smart #define lpfc_mbx_rd_conf_tf_SHIFT		22
288583c6cb1aSJames Smart #define lpfc_mbx_rd_conf_tf_MASK		0x00000001
288683c6cb1aSJames Smart #define lpfc_mbx_rd_conf_tf_WORD		word2
288783c6cb1aSJames Smart #define lpfc_mbx_rd_conf_ptv_SHIFT		23
288883c6cb1aSJames Smart #define lpfc_mbx_rd_conf_ptv_MASK		0x00000001
288983c6cb1aSJames Smart #define lpfc_mbx_rd_conf_ptv_WORD		word2
2890da0436e9SJames Smart #define lpfc_mbx_rd_conf_topology_SHIFT		24
2891da0436e9SJames Smart #define lpfc_mbx_rd_conf_topology_MASK		0x000000FF
2892da0436e9SJames Smart #define lpfc_mbx_rd_conf_topology_WORD		word2
28936d368e53SJames Smart 	uint32_t rsvd_3;
2894da0436e9SJames Smart 	uint32_t word4;
2895da0436e9SJames Smart #define lpfc_mbx_rd_conf_e_d_tov_SHIFT		0
2896da0436e9SJames Smart #define lpfc_mbx_rd_conf_e_d_tov_MASK		0x0000FFFF
2897da0436e9SJames Smart #define lpfc_mbx_rd_conf_e_d_tov_WORD		word4
28986d368e53SJames Smart 	uint32_t rsvd_5;
2899da0436e9SJames Smart 	uint32_t word6;
2900da0436e9SJames Smart #define lpfc_mbx_rd_conf_r_a_tov_SHIFT		0
2901da0436e9SJames Smart #define lpfc_mbx_rd_conf_r_a_tov_MASK		0x0000FFFF
2902da0436e9SJames Smart #define lpfc_mbx_rd_conf_r_a_tov_WORD		word6
2903c691816eSJames Smart #define lpfc_mbx_rd_conf_link_speed_SHIFT	16
2904c691816eSJames Smart #define lpfc_mbx_rd_conf_link_speed_MASK	0x0000FFFF
2905c691816eSJames Smart #define lpfc_mbx_rd_conf_link_speed_WORD	word6
29066d368e53SJames Smart 	uint32_t rsvd_7;
290744fd7fe3SJames Smart 	uint32_t word8;
290844fd7fe3SJames Smart #define lpfc_mbx_rd_conf_bbscn_min_SHIFT	0
290944fd7fe3SJames Smart #define lpfc_mbx_rd_conf_bbscn_min_MASK		0x0000000F
291044fd7fe3SJames Smart #define lpfc_mbx_rd_conf_bbscn_min_WORD		word8
291144fd7fe3SJames Smart #define lpfc_mbx_rd_conf_bbscn_max_SHIFT	4
291244fd7fe3SJames Smart #define lpfc_mbx_rd_conf_bbscn_max_MASK		0x0000000F
291344fd7fe3SJames Smart #define lpfc_mbx_rd_conf_bbscn_max_WORD		word8
291444fd7fe3SJames Smart #define lpfc_mbx_rd_conf_bbscn_def_SHIFT	8
291544fd7fe3SJames Smart #define lpfc_mbx_rd_conf_bbscn_def_MASK		0x0000000F
291644fd7fe3SJames Smart #define lpfc_mbx_rd_conf_bbscn_def_WORD		word8
2917da0436e9SJames Smart 	uint32_t word9;
2918da0436e9SJames Smart #define lpfc_mbx_rd_conf_lmt_SHIFT		0
2919da0436e9SJames Smart #define lpfc_mbx_rd_conf_lmt_MASK		0x0000FFFF
2920da0436e9SJames Smart #define lpfc_mbx_rd_conf_lmt_WORD		word9
29216d368e53SJames Smart 	uint32_t rsvd_10;
29226d368e53SJames Smart 	uint32_t rsvd_11;
2923da0436e9SJames Smart 	uint32_t word12;
2924da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_base_SHIFT		0
2925da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_base_MASK		0x0000FFFF
2926da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_base_WORD		word12
2927da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_count_SHIFT	16
2928da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_count_MASK		0x0000FFFF
2929da0436e9SJames Smart #define lpfc_mbx_rd_conf_xri_count_WORD		word12
2930da0436e9SJames Smart 	uint32_t word13;
2931da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_base_SHIFT		0
2932da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_base_MASK		0x0000FFFF
2933da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_base_WORD		word13
2934da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_count_SHIFT	16
2935da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_count_MASK		0x0000FFFF
2936da0436e9SJames Smart #define lpfc_mbx_rd_conf_rpi_count_WORD		word13
2937da0436e9SJames Smart 	uint32_t word14;
2938da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_base_SHIFT		0
2939da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_base_MASK		0x0000FFFF
2940da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_base_WORD		word14
2941da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_count_SHIFT	16
2942da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_count_MASK		0x0000FFFF
2943da0436e9SJames Smart #define lpfc_mbx_rd_conf_vpi_count_WORD		word14
2944da0436e9SJames Smart 	uint32_t word15;
2945da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_base_SHIFT         0
2946da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_base_MASK          0x0000FFFF
2947da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_base_WORD          word15
2948da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_count_SHIFT        16
2949da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_count_MASK         0x0000FFFF
2950da0436e9SJames Smart #define lpfc_mbx_rd_conf_vfi_count_WORD         word15
2951da0436e9SJames Smart 	uint32_t word16;
2952da0436e9SJames Smart #define lpfc_mbx_rd_conf_fcfi_count_SHIFT	16
2953da0436e9SJames Smart #define lpfc_mbx_rd_conf_fcfi_count_MASK	0x0000FFFF
2954da0436e9SJames Smart #define lpfc_mbx_rd_conf_fcfi_count_WORD	word16
2955da0436e9SJames Smart 	uint32_t word17;
2956da0436e9SJames Smart #define lpfc_mbx_rd_conf_rq_count_SHIFT		0
2957da0436e9SJames Smart #define lpfc_mbx_rd_conf_rq_count_MASK		0x0000FFFF
2958da0436e9SJames Smart #define lpfc_mbx_rd_conf_rq_count_WORD		word17
2959da0436e9SJames Smart #define lpfc_mbx_rd_conf_eq_count_SHIFT		16
2960da0436e9SJames Smart #define lpfc_mbx_rd_conf_eq_count_MASK		0x0000FFFF
2961da0436e9SJames Smart #define lpfc_mbx_rd_conf_eq_count_WORD		word17
2962da0436e9SJames Smart 	uint32_t word18;
2963da0436e9SJames Smart #define lpfc_mbx_rd_conf_wq_count_SHIFT		0
2964da0436e9SJames Smart #define lpfc_mbx_rd_conf_wq_count_MASK		0x0000FFFF
2965da0436e9SJames Smart #define lpfc_mbx_rd_conf_wq_count_WORD		word18
2966da0436e9SJames Smart #define lpfc_mbx_rd_conf_cq_count_SHIFT		16
2967da0436e9SJames Smart #define lpfc_mbx_rd_conf_cq_count_MASK		0x0000FFFF
2968da0436e9SJames Smart #define lpfc_mbx_rd_conf_cq_count_WORD		word18
2969da0436e9SJames Smart };
2970da0436e9SJames Smart 
2971da0436e9SJames Smart struct lpfc_mbx_request_features {
2972da0436e9SJames Smart 	uint32_t word1;
2973da0436e9SJames Smart #define lpfc_mbx_rq_ftr_qry_SHIFT		0
2974da0436e9SJames Smart #define lpfc_mbx_rq_ftr_qry_MASK		0x00000001
2975da0436e9SJames Smart #define lpfc_mbx_rq_ftr_qry_WORD		word1
2976da0436e9SJames Smart 	uint32_t word2;
2977da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_iaab_SHIFT		0
2978da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_iaab_MASK		0x00000001
2979da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_iaab_WORD		word2
2980da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_npiv_SHIFT		1
2981da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_npiv_MASK		0x00000001
2982da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_npiv_WORD		word2
2983da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_dif_SHIFT		2
2984da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_dif_MASK		0x00000001
2985da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_dif_WORD		word2
2986da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_vf_SHIFT		3
2987da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_vf_MASK		0x00000001
2988da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_vf_WORD		word2
2989da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpi_SHIFT		4
2990da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpi_MASK		0x00000001
2991da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpi_WORD		word2
2992da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpt_SHIFT		5
2993da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpt_MASK		0x00000001
2994da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpt_WORD		word2
2995da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpc_SHIFT		6
2996da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpc_MASK		0x00000001
2997da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_fcpc_WORD		word2
2998da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_ifip_SHIFT		7
2999da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_ifip_MASK		0x00000001
3000da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rq_ifip_WORD		word2
300186c67379SJames Smart #define lpfc_mbx_rq_ftr_rq_iaar_SHIFT		9
300286c67379SJames Smart #define lpfc_mbx_rq_ftr_rq_iaar_MASK		0x00000001
300386c67379SJames Smart #define lpfc_mbx_rq_ftr_rq_iaar_WORD		word2
3004fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rq_perfh_SHIFT		11
3005fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rq_perfh_MASK		0x00000001
3006fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rq_perfh_WORD		word2
30072d7dbc4cSJames Smart #define lpfc_mbx_rq_ftr_rq_mrqp_SHIFT		16
30082d7dbc4cSJames Smart #define lpfc_mbx_rq_ftr_rq_mrqp_MASK		0x00000001
30092d7dbc4cSJames Smart #define lpfc_mbx_rq_ftr_rq_mrqp_WORD		word2
30105e633302SGaurav Srivastava #define lpfc_mbx_rq_ftr_rq_ashdr_SHIFT          17
30115e633302SGaurav Srivastava #define lpfc_mbx_rq_ftr_rq_ashdr_MASK           0x00000001
30125e633302SGaurav Srivastava #define lpfc_mbx_rq_ftr_rq_ashdr_WORD           word2
3013da0436e9SJames Smart 	uint32_t word3;
3014da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_iaab_SHIFT		0
3015da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_iaab_MASK		0x00000001
3016da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_iaab_WORD		word3
3017da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_npiv_SHIFT		1
3018da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_npiv_MASK		0x00000001
3019da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_npiv_WORD		word3
3020da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_dif_SHIFT		2
3021da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_dif_MASK		0x00000001
3022da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_dif_WORD		word3
3023da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_vf_SHIFT		3
3024da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_vf__MASK		0x00000001
3025da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_vf_WORD		word3
3026da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpi_SHIFT		4
3027da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpi_MASK		0x00000001
3028da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpi_WORD		word3
3029da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpt_SHIFT		5
3030da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpt_MASK		0x00000001
3031da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpt_WORD		word3
3032da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpc_SHIFT		6
3033da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpc_MASK		0x00000001
3034da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_fcpc_WORD		word3
3035da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_ifip_SHIFT		7
3036da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_ifip_MASK		0x00000001
3037da0436e9SJames Smart #define lpfc_mbx_rq_ftr_rsp_ifip_WORD		word3
3038fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rsp_perfh_SHIFT		11
3039fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rsp_perfh_MASK		0x00000001
3040fedd3b7bSJames Smart #define lpfc_mbx_rq_ftr_rsp_perfh_WORD		word3
30412d7dbc4cSJames Smart #define lpfc_mbx_rq_ftr_rsp_mrqp_SHIFT		16
30422d7dbc4cSJames Smart #define lpfc_mbx_rq_ftr_rsp_mrqp_MASK		0x00000001
30432d7dbc4cSJames Smart #define lpfc_mbx_rq_ftr_rsp_mrqp_WORD		word3
30445e633302SGaurav Srivastava #define lpfc_mbx_rq_ftr_rsp_ashdr_SHIFT         17
30455e633302SGaurav Srivastava #define lpfc_mbx_rq_ftr_rsp_ashdr_MASK          0x00000001
30465e633302SGaurav Srivastava #define lpfc_mbx_rq_ftr_rsp_ashdr_WORD          word3
3047da0436e9SJames Smart };
3048da0436e9SJames Smart 
304986478875SJames Smart struct lpfc_mbx_memory_dump_type3 {
305086478875SJames Smart 	uint32_t word1;
305186478875SJames Smart #define lpfc_mbx_memory_dump_type3_type_SHIFT    0
305286478875SJames Smart #define lpfc_mbx_memory_dump_type3_type_MASK     0x0000000f
305386478875SJames Smart #define lpfc_mbx_memory_dump_type3_type_WORD     word1
305486478875SJames Smart #define lpfc_mbx_memory_dump_type3_link_SHIFT    24
305586478875SJames Smart #define lpfc_mbx_memory_dump_type3_link_MASK     0x000000ff
305686478875SJames Smart #define lpfc_mbx_memory_dump_type3_link_WORD     word1
305786478875SJames Smart 	uint32_t word2;
305886478875SJames Smart #define lpfc_mbx_memory_dump_type3_page_no_SHIFT  0
305986478875SJames Smart #define lpfc_mbx_memory_dump_type3_page_no_MASK   0x0000ffff
306086478875SJames Smart #define lpfc_mbx_memory_dump_type3_page_no_WORD   word2
306186478875SJames Smart #define lpfc_mbx_memory_dump_type3_offset_SHIFT   16
306286478875SJames Smart #define lpfc_mbx_memory_dump_type3_offset_MASK    0x0000ffff
306386478875SJames Smart #define lpfc_mbx_memory_dump_type3_offset_WORD    word2
306486478875SJames Smart 	uint32_t word3;
306586478875SJames Smart #define lpfc_mbx_memory_dump_type3_length_SHIFT  0
306686478875SJames Smart #define lpfc_mbx_memory_dump_type3_length_MASK   0x00ffffff
306786478875SJames Smart #define lpfc_mbx_memory_dump_type3_length_WORD   word3
306886478875SJames Smart 	uint32_t addr_lo;
306986478875SJames Smart 	uint32_t addr_hi;
307086478875SJames Smart 	uint32_t return_len;
307186478875SJames Smart };
307286478875SJames Smart 
307386478875SJames Smart #define DMP_PAGE_A0             0xa0
307486478875SJames Smart #define DMP_PAGE_A2             0xa2
307586478875SJames Smart #define DMP_SFF_PAGE_A0_SIZE	256
307686478875SJames Smart #define DMP_SFF_PAGE_A2_SIZE	256
307786478875SJames Smart 
307886478875SJames Smart #define SFP_WAVELENGTH_LC1310	1310
307986478875SJames Smart #define SFP_WAVELENGTH_LL1550	1550
308086478875SJames Smart 
308186478875SJames Smart 
308286478875SJames Smart /*
308386478875SJames Smart  *  * SFF-8472 TABLE 3.4
308486478875SJames Smart  *   */
308586478875SJames Smart #define  SFF_PG0_CONNECTOR_UNKNOWN    0x00   /* Unknown  */
308686478875SJames Smart #define  SFF_PG0_CONNECTOR_SC         0x01   /* SC       */
308786478875SJames Smart #define  SFF_PG0_CONNECTOR_FC_COPPER1 0x02   /* FC style 1 copper connector */
308886478875SJames Smart #define  SFF_PG0_CONNECTOR_FC_COPPER2 0x03   /* FC style 2 copper connector */
308986478875SJames Smart #define  SFF_PG0_CONNECTOR_BNC        0x04   /* BNC / TNC */
309086478875SJames Smart #define  SFF_PG0_CONNECTOR__FC_COAX   0x05   /* FC coaxial headers */
309186478875SJames Smart #define  SFF_PG0_CONNECTOR_FIBERJACK  0x06   /* FiberJack */
309286478875SJames Smart #define  SFF_PG0_CONNECTOR_LC         0x07   /* LC        */
309386478875SJames Smart #define  SFF_PG0_CONNECTOR_MT         0x08   /* MT - RJ   */
309486478875SJames Smart #define  SFF_PG0_CONNECTOR_MU         0x09   /* MU        */
309586478875SJames Smart #define  SFF_PG0_CONNECTOR_SF         0x0A   /* SG        */
309686478875SJames Smart #define  SFF_PG0_CONNECTOR_OPTICAL_PIGTAIL 0x0B /* Optical pigtail */
309786478875SJames Smart #define  SFF_PG0_CONNECTOR_OPTICAL_PARALLEL 0x0C /* MPO Parallel Optic */
309886478875SJames Smart #define  SFF_PG0_CONNECTOR_HSSDC_II   0x20   /* HSSDC II */
309986478875SJames Smart #define  SFF_PG0_CONNECTOR_COPPER_PIGTAIL 0x21 /* Copper pigtail */
310086478875SJames Smart #define  SFF_PG0_CONNECTOR_RJ45       0x22  /* RJ45 */
310186478875SJames Smart 
310286478875SJames Smart /* SFF-8472 Table 3.1 Diagnostics: Data Fields Address/Page A0 */
310386478875SJames Smart 
310486478875SJames Smart #define SSF_IDENTIFIER			0
310586478875SJames Smart #define SSF_EXT_IDENTIFIER		1
310686478875SJames Smart #define SSF_CONNECTOR			2
310786478875SJames Smart #define SSF_TRANSCEIVER_CODE_B0		3
310886478875SJames Smart #define SSF_TRANSCEIVER_CODE_B1		4
310986478875SJames Smart #define SSF_TRANSCEIVER_CODE_B2		5
311086478875SJames Smart #define SSF_TRANSCEIVER_CODE_B3		6
311186478875SJames Smart #define SSF_TRANSCEIVER_CODE_B4		7
311286478875SJames Smart #define SSF_TRANSCEIVER_CODE_B5		8
311386478875SJames Smart #define SSF_TRANSCEIVER_CODE_B6		9
311486478875SJames Smart #define SSF_TRANSCEIVER_CODE_B7		10
311586478875SJames Smart #define SSF_ENCODING			11
311686478875SJames Smart #define SSF_BR_NOMINAL			12
311786478875SJames Smart #define SSF_RATE_IDENTIFIER		13
311886478875SJames Smart #define SSF_LENGTH_9UM_KM		14
311986478875SJames Smart #define SSF_LENGTH_9UM			15
312086478875SJames Smart #define SSF_LENGTH_50UM_OM2		16
312186478875SJames Smart #define SSF_LENGTH_62UM_OM1		17
312286478875SJames Smart #define SFF_LENGTH_COPPER		18
312386478875SJames Smart #define SSF_LENGTH_50UM_OM3		19
312486478875SJames Smart #define SSF_VENDOR_NAME			20
312586478875SJames Smart #define SSF_VENDOR_OUI			36
312686478875SJames Smart #define SSF_VENDOR_PN			40
312786478875SJames Smart #define SSF_VENDOR_REV			56
312886478875SJames Smart #define SSF_WAVELENGTH_B1		60
312986478875SJames Smart #define SSF_WAVELENGTH_B0		61
313086478875SJames Smart #define SSF_CC_BASE			63
313186478875SJames Smart #define SSF_OPTIONS_B1			64
313286478875SJames Smart #define SSF_OPTIONS_B0			65
313386478875SJames Smart #define SSF_BR_MAX			66
313486478875SJames Smart #define SSF_BR_MIN			67
313586478875SJames Smart #define SSF_VENDOR_SN			68
313686478875SJames Smart #define SSF_DATE_CODE			84
313786478875SJames Smart #define SSF_MONITORING_TYPEDIAGNOSTIC	92
313886478875SJames Smart #define SSF_ENHANCED_OPTIONS		93
313986478875SJames Smart #define SFF_8472_COMPLIANCE		94
314086478875SJames Smart #define SSF_CC_EXT			95
314186478875SJames Smart #define SSF_A0_VENDOR_SPECIFIC		96
314286478875SJames Smart 
314386478875SJames Smart /* SFF-8472 Table 3.1a Diagnostics: Data Fields Address/Page A2 */
314486478875SJames Smart 
314556204984SJames Smart #define SSF_TEMP_HIGH_ALARM		0
314656204984SJames Smart #define SSF_TEMP_LOW_ALARM		2
314756204984SJames Smart #define SSF_TEMP_HIGH_WARNING		4
314856204984SJames Smart #define SSF_TEMP_LOW_WARNING		6
314956204984SJames Smart #define SSF_VOLTAGE_HIGH_ALARM		8
315056204984SJames Smart #define SSF_VOLTAGE_LOW_ALARM		10
315156204984SJames Smart #define SSF_VOLTAGE_HIGH_WARNING	12
315256204984SJames Smart #define SSF_VOLTAGE_LOW_WARNING		14
315356204984SJames Smart #define SSF_BIAS_HIGH_ALARM		16
315456204984SJames Smart #define SSF_BIAS_LOW_ALARM		18
315556204984SJames Smart #define SSF_BIAS_HIGH_WARNING		20
315656204984SJames Smart #define SSF_BIAS_LOW_WARNING		22
315756204984SJames Smart #define SSF_TXPOWER_HIGH_ALARM		24
315856204984SJames Smart #define SSF_TXPOWER_LOW_ALARM		26
315956204984SJames Smart #define SSF_TXPOWER_HIGH_WARNING	28
316056204984SJames Smart #define SSF_TXPOWER_LOW_WARNING		30
316156204984SJames Smart #define SSF_RXPOWER_HIGH_ALARM		32
316256204984SJames Smart #define SSF_RXPOWER_LOW_ALARM		34
316356204984SJames Smart #define SSF_RXPOWER_HIGH_WARNING	36
316456204984SJames Smart #define SSF_RXPOWER_LOW_WARNING		38
316586478875SJames Smart #define SSF_EXT_CAL_CONSTANTS		56
316686478875SJames Smart #define SSF_CC_DMI			95
316786478875SJames Smart #define SFF_TEMPERATURE_B1		96
316886478875SJames Smart #define SFF_TEMPERATURE_B0		97
316986478875SJames Smart #define SFF_VCC_B1			98
317086478875SJames Smart #define SFF_VCC_B0			99
317186478875SJames Smart #define SFF_TX_BIAS_CURRENT_B1		100
317286478875SJames Smart #define SFF_TX_BIAS_CURRENT_B0		101
317386478875SJames Smart #define SFF_TXPOWER_B1			102
317486478875SJames Smart #define SFF_TXPOWER_B0			103
317586478875SJames Smart #define SFF_RXPOWER_B1			104
317686478875SJames Smart #define SFF_RXPOWER_B0			105
317786478875SJames Smart #define SSF_STATUS_CONTROL		110
3178310429efSJames Smart #define SSF_ALARM_FLAGS			112
3179310429efSJames Smart #define SSF_WARNING_FLAGS		116
318086478875SJames Smart #define SSF_EXT_TATUS_CONTROL_B1	118
318186478875SJames Smart #define SSF_EXT_TATUS_CONTROL_B0	119
318286478875SJames Smart #define SSF_A2_VENDOR_SPECIFIC		120
318386478875SJames Smart #define SSF_USER_EEPROM			128
318486478875SJames Smart #define SSF_VENDOR_CONTROL		148
318586478875SJames Smart 
318686478875SJames Smart 
318786478875SJames Smart /*
318886478875SJames Smart  * Tranceiver codes Fibre Channel SFF-8472
318986478875SJames Smart  * Table 3.5.
319086478875SJames Smart  */
319186478875SJames Smart 
319286478875SJames Smart struct sff_trasnceiver_codes_byte0 {
319386478875SJames Smart 	uint8_t inifiband:4;
319486478875SJames Smart 	uint8_t teng_ethernet:4;
319586478875SJames Smart };
319686478875SJames Smart 
319786478875SJames Smart struct sff_trasnceiver_codes_byte1 {
319886478875SJames Smart 	uint8_t  sonet:6;
319986478875SJames Smart 	uint8_t  escon:2;
320086478875SJames Smart };
320186478875SJames Smart 
320286478875SJames Smart struct sff_trasnceiver_codes_byte2 {
320386478875SJames Smart 	uint8_t  soNet:8;
320486478875SJames Smart };
320586478875SJames Smart 
320686478875SJames Smart struct sff_trasnceiver_codes_byte3 {
320786478875SJames Smart 	uint8_t ethernet:8;
320886478875SJames Smart };
320986478875SJames Smart 
321086478875SJames Smart struct sff_trasnceiver_codes_byte4 {
321186478875SJames Smart 	uint8_t fc_el_lo:1;
321286478875SJames Smart 	uint8_t fc_lw_laser:1;
321386478875SJames Smart 	uint8_t fc_sw_laser:1;
321486478875SJames Smart 	uint8_t fc_md_distance:1;
321586478875SJames Smart 	uint8_t fc_lg_distance:1;
321686478875SJames Smart 	uint8_t fc_int_distance:1;
321786478875SJames Smart 	uint8_t fc_short_distance:1;
321886478875SJames Smart 	uint8_t fc_vld_distance:1;
321986478875SJames Smart };
322086478875SJames Smart 
322186478875SJames Smart struct sff_trasnceiver_codes_byte5 {
322286478875SJames Smart 	uint8_t reserved1:1;
322386478875SJames Smart 	uint8_t reserved2:1;
322486478875SJames Smart 	uint8_t fc_sfp_active:1;  /* Active cable   */
322586478875SJames Smart 	uint8_t fc_sfp_passive:1; /* Passive cable  */
322686478875SJames Smart 	uint8_t fc_lw_laser:1;     /* Longwave laser */
322786478875SJames Smart 	uint8_t fc_sw_laser_sl:1;
322886478875SJames Smart 	uint8_t fc_sw_laser_sn:1;
322986478875SJames Smart 	uint8_t fc_el_hi:1;        /* Electrical enclosure high bit */
323086478875SJames Smart };
323186478875SJames Smart 
323286478875SJames Smart struct sff_trasnceiver_codes_byte6 {
323386478875SJames Smart 	uint8_t fc_tm_sm:1;      /* Single Mode */
323486478875SJames Smart 	uint8_t reserved:1;
323586478875SJames Smart 	uint8_t fc_tm_m6:1;       /* Multimode, 62.5um (M6) */
323686478875SJames Smart 	uint8_t fc_tm_tv:1;      /* Video Coax (TV) */
323786478875SJames Smart 	uint8_t fc_tm_mi:1;      /* Miniature Coax (MI) */
323886478875SJames Smart 	uint8_t fc_tm_tp:1;      /* Twisted Pair (TP) */
323986478875SJames Smart 	uint8_t fc_tm_tw:1;      /* Twin Axial Pair  */
324086478875SJames Smart };
324186478875SJames Smart 
324286478875SJames Smart struct sff_trasnceiver_codes_byte7 {
324386478875SJames Smart 	uint8_t fc_sp_100MB:1;   /*  100 MB/sec */
324486478875SJames Smart 	uint8_t reserve:1;
324586478875SJames Smart 	uint8_t fc_sp_200mb:1;   /*  200 MB/sec */
324686478875SJames Smart 	uint8_t fc_sp_3200MB:1;  /* 3200 MB/sec */
324786478875SJames Smart 	uint8_t fc_sp_400MB:1;   /*  400 MB/sec */
324886478875SJames Smart 	uint8_t fc_sp_1600MB:1;  /* 1600 MB/sec */
324986478875SJames Smart 	uint8_t fc_sp_800MB:1;   /*  800 MB/sec */
325086478875SJames Smart 	uint8_t fc_sp_1200MB:1;  /* 1200 MB/sec */
325186478875SJames Smart };
325286478875SJames Smart 
325386478875SJames Smart /* User writable non-volatile memory, SFF-8472 Table 3.20 */
325486478875SJames Smart struct user_eeprom {
325586478875SJames Smart 	uint8_t vendor_name[16];
325686478875SJames Smart 	uint8_t vendor_oui[3];
325786478875SJames Smart 	uint8_t vendor_pn[816];
325886478875SJames Smart 	uint8_t vendor_rev[4];
325986478875SJames Smart 	uint8_t vendor_sn[16];
326086478875SJames Smart 	uint8_t datecode[6];
326186478875SJames Smart 	uint8_t lot_code[2];
326286478875SJames Smart 	uint8_t reserved191[57];
326386478875SJames Smart };
326486478875SJames Smart 
32659589b062SJames Smart #define SLI4_PAGE_ALIGN(addr) (((addr)+((SLI4_PAGE_SIZE)-1)) \
32669589b062SJames Smart 			       &(~((SLI4_PAGE_SIZE)-1)))
326728baac74SJames Smart 
3268fedd3b7bSJames Smart struct lpfc_sli4_parameters {
3269fedd3b7bSJames Smart 	uint32_t word0;
3270fedd3b7bSJames Smart #define cfg_prot_type_SHIFT			0
3271fedd3b7bSJames Smart #define cfg_prot_type_MASK			0x000000FF
3272fedd3b7bSJames Smart #define cfg_prot_type_WORD			word0
3273fedd3b7bSJames Smart 	uint32_t word1;
3274fedd3b7bSJames Smart #define cfg_ft_SHIFT				0
3275fedd3b7bSJames Smart #define cfg_ft_MASK				0x00000001
3276fedd3b7bSJames Smart #define cfg_ft_WORD				word1
3277fedd3b7bSJames Smart #define cfg_sli_rev_SHIFT			4
3278fedd3b7bSJames Smart #define cfg_sli_rev_MASK			0x0000000f
3279fedd3b7bSJames Smart #define cfg_sli_rev_WORD			word1
3280fedd3b7bSJames Smart #define cfg_sli_family_SHIFT			8
3281fedd3b7bSJames Smart #define cfg_sli_family_MASK			0x0000000f
3282fedd3b7bSJames Smart #define cfg_sli_family_WORD			word1
3283fedd3b7bSJames Smart #define cfg_if_type_SHIFT			12
3284fedd3b7bSJames Smart #define cfg_if_type_MASK			0x0000000f
3285fedd3b7bSJames Smart #define cfg_if_type_WORD			word1
3286fedd3b7bSJames Smart #define cfg_sli_hint_1_SHIFT			16
3287fedd3b7bSJames Smart #define cfg_sli_hint_1_MASK			0x000000ff
3288fedd3b7bSJames Smart #define cfg_sli_hint_1_WORD			word1
3289fedd3b7bSJames Smart #define cfg_sli_hint_2_SHIFT			24
3290fedd3b7bSJames Smart #define cfg_sli_hint_2_MASK			0x0000001f
3291fedd3b7bSJames Smart #define cfg_sli_hint_2_WORD			word1
3292fedd3b7bSJames Smart 	uint32_t word2;
32937365f6fdSJames Smart #define cfg_eqav_SHIFT				31
32947365f6fdSJames Smart #define cfg_eqav_MASK				0x00000001
32957365f6fdSJames Smart #define cfg_eqav_WORD				word2
3296fedd3b7bSJames Smart 	uint32_t word3;
3297fedd3b7bSJames Smart 	uint32_t word4;
3298fedd3b7bSJames Smart #define cfg_cqv_SHIFT				14
3299fedd3b7bSJames Smart #define cfg_cqv_MASK				0x00000003
3300fedd3b7bSJames Smart #define cfg_cqv_WORD				word4
3301c176ffa0SJames Smart #define cfg_cqpsize_SHIFT			16
3302c176ffa0SJames Smart #define cfg_cqpsize_MASK			0x000000ff
3303c176ffa0SJames Smart #define cfg_cqpsize_WORD			word4
33047365f6fdSJames Smart #define cfg_cqav_SHIFT				31
33057365f6fdSJames Smart #define cfg_cqav_MASK				0x00000001
33067365f6fdSJames Smart #define cfg_cqav_WORD				word4
3307fedd3b7bSJames Smart 	uint32_t word5;
3308fedd3b7bSJames Smart 	uint32_t word6;
3309fedd3b7bSJames Smart #define cfg_mqv_SHIFT				14
3310fedd3b7bSJames Smart #define cfg_mqv_MASK				0x00000003
3311fedd3b7bSJames Smart #define cfg_mqv_WORD				word6
3312fedd3b7bSJames Smart 	uint32_t word7;
3313fedd3b7bSJames Smart 	uint32_t word8;
3314895427bdSJames Smart #define cfg_wqpcnt_SHIFT			0
3315895427bdSJames Smart #define cfg_wqpcnt_MASK				0x0000000f
3316895427bdSJames Smart #define cfg_wqpcnt_WORD				word8
33170c651878SJames Smart #define cfg_wqsize_SHIFT			8
33180c651878SJames Smart #define cfg_wqsize_MASK				0x0000000f
33190c651878SJames Smart #define cfg_wqsize_WORD				word8
3320fedd3b7bSJames Smart #define cfg_wqv_SHIFT				14
3321fedd3b7bSJames Smart #define cfg_wqv_MASK				0x00000003
3322fedd3b7bSJames Smart #define cfg_wqv_WORD				word8
3323895427bdSJames Smart #define cfg_wqpsize_SHIFT			16
3324895427bdSJames Smart #define cfg_wqpsize_MASK			0x000000ff
3325895427bdSJames Smart #define cfg_wqpsize_WORD			word8
3326fedd3b7bSJames Smart 	uint32_t word9;
3327fedd3b7bSJames Smart 	uint32_t word10;
3328fedd3b7bSJames Smart #define cfg_rqv_SHIFT				14
3329fedd3b7bSJames Smart #define cfg_rqv_MASK				0x00000003
3330fedd3b7bSJames Smart #define cfg_rqv_WORD				word10
3331fedd3b7bSJames Smart 	uint32_t word11;
3332fedd3b7bSJames Smart #define cfg_rq_db_window_SHIFT			28
3333fedd3b7bSJames Smart #define cfg_rq_db_window_MASK			0x0000000f
3334fedd3b7bSJames Smart #define cfg_rq_db_window_WORD			word11
3335fedd3b7bSJames Smart 	uint32_t word12;
3336fedd3b7bSJames Smart #define cfg_fcoe_SHIFT				0
3337fedd3b7bSJames Smart #define cfg_fcoe_MASK				0x00000001
3338fedd3b7bSJames Smart #define cfg_fcoe_WORD				word12
33396d368e53SJames Smart #define cfg_ext_SHIFT				1
33406d368e53SJames Smart #define cfg_ext_MASK				0x00000001
33416d368e53SJames Smart #define cfg_ext_WORD				word12
33426d368e53SJames Smart #define cfg_hdrr_SHIFT				2
33436d368e53SJames Smart #define cfg_hdrr_MASK				0x00000001
33446d368e53SJames Smart #define cfg_hdrr_WORD				word12
3345fedd3b7bSJames Smart #define cfg_phwq_SHIFT				15
3346fedd3b7bSJames Smart #define cfg_phwq_MASK				0x00000001
3347fedd3b7bSJames Smart #define cfg_phwq_WORD				word12
33481ba981fdSJames Smart #define cfg_oas_SHIFT				25
33491ba981fdSJames Smart #define cfg_oas_MASK				0x00000001
33501ba981fdSJames Smart #define cfg_oas_WORD				word12
3351fedd3b7bSJames Smart #define cfg_loopbk_scope_SHIFT			28
3352fedd3b7bSJames Smart #define cfg_loopbk_scope_MASK			0x0000000f
3353fedd3b7bSJames Smart #define cfg_loopbk_scope_WORD			word12
3354fedd3b7bSJames Smart 	uint32_t sge_supp_len;
3355fedd3b7bSJames Smart 	uint32_t word14;
3356fedd3b7bSJames Smart #define cfg_sgl_page_cnt_SHIFT			0
3357fedd3b7bSJames Smart #define cfg_sgl_page_cnt_MASK			0x0000000f
3358fedd3b7bSJames Smart #define cfg_sgl_page_cnt_WORD			word14
3359fedd3b7bSJames Smart #define cfg_sgl_page_size_SHIFT			8
3360fedd3b7bSJames Smart #define cfg_sgl_page_size_MASK			0x000000ff
3361fedd3b7bSJames Smart #define cfg_sgl_page_size_WORD			word14
3362fedd3b7bSJames Smart #define cfg_sgl_pp_align_SHIFT			16
3363fedd3b7bSJames Smart #define cfg_sgl_pp_align_MASK			0x000000ff
3364fedd3b7bSJames Smart #define cfg_sgl_pp_align_WORD			word14
3365fedd3b7bSJames Smart 	uint32_t word15;
3366fedd3b7bSJames Smart 	uint32_t word16;
3367fedd3b7bSJames Smart 	uint32_t word17;
3368fedd3b7bSJames Smart 	uint32_t word18;
3369fedd3b7bSJames Smart 	uint32_t word19;
3370b5c53958SJames Smart #define cfg_ext_embed_cb_SHIFT			0
3371b5c53958SJames Smart #define cfg_ext_embed_cb_MASK			0x00000001
3372b5c53958SJames Smart #define cfg_ext_embed_cb_WORD			word19
33737bdedb34SJames Smart #define cfg_mds_diags_SHIFT			1
33747bdedb34SJames Smart #define cfg_mds_diags_MASK			0x00000001
33757bdedb34SJames Smart #define cfg_mds_diags_WORD			word19
3376895427bdSJames Smart #define cfg_nvme_SHIFT				3
3377895427bdSJames Smart #define cfg_nvme_MASK				0x00000001
3378895427bdSJames Smart #define cfg_nvme_WORD				word19
3379895427bdSJames Smart #define cfg_xib_SHIFT				4
3380895427bdSJames Smart #define cfg_xib_MASK				0x00000001
3381895427bdSJames Smart #define cfg_xib_WORD				word19
3382d79c9e9dSJames Smart #define cfg_xpsgl_SHIFT				6
3383d79c9e9dSJames Smart #define cfg_xpsgl_MASK				0x00000001
3384d79c9e9dSJames Smart #define cfg_xpsgl_WORD				word19
33850cf07f84SJames Smart #define cfg_eqdr_SHIFT				8
33860cf07f84SJames Smart #define cfg_eqdr_MASK				0x00000001
33870cf07f84SJames Smart #define cfg_eqdr_WORD				word19
338820aefac3SJames Smart #define cfg_nosr_SHIFT				9
338920aefac3SJames Smart #define cfg_nosr_MASK				0x00000001
339020aefac3SJames Smart #define cfg_nosr_WORD				word19
339166e9e6bfSJames Smart #define cfg_bv1s_SHIFT                          10
339266e9e6bfSJames Smart #define cfg_bv1s_MASK                           0x00000001
339366e9e6bfSJames Smart #define cfg_bv1s_WORD                           word19
339466e9e6bfSJames Smart 
33950d8af096SJames Smart #define cfg_nsler_SHIFT                         12
33960d8af096SJames Smart #define cfg_nsler_MASK                          0x00000001
33970d8af096SJames Smart #define cfg_nsler_WORD                          word19
3398137ddf03SJames Smart #define cfg_pvl_SHIFT				13
3399137ddf03SJames Smart #define cfg_pvl_MASK				0x00000001
3400137ddf03SJames Smart #define cfg_pvl_WORD				word19
3401137ddf03SJames Smart 
3402137ddf03SJames Smart #define cfg_pbde_SHIFT				20
3403137ddf03SJames Smart #define cfg_pbde_MASK				0x00000001
3404137ddf03SJames Smart #define cfg_pbde_WORD				word19
34050d8af096SJames Smart 
340666e9e6bfSJames Smart 	uint32_t word20;
340766e9e6bfSJames Smart #define cfg_max_tow_xri_SHIFT			0
340866e9e6bfSJames Smart #define cfg_max_tow_xri_MASK			0x0000ffff
340966e9e6bfSJames Smart #define cfg_max_tow_xri_WORD			word20
341066e9e6bfSJames Smart 
34118aaa7bcfSJames Smart 	uint32_t word21;
34128aaa7bcfSJames Smart #define cfg_mi_ver_SHIFT			0
34138aaa7bcfSJames Smart #define cfg_mi_ver_MASK				0x0000ffff
34148aaa7bcfSJames Smart #define cfg_mi_ver_WORD				word21
3415daebf93fSJames Smart #define cfg_cmf_SHIFT				24
3416daebf93fSJames Smart #define cfg_cmf_MASK				0x000000ff
3417daebf93fSJames Smart #define cfg_cmf_WORD				word21
3418daebf93fSJames Smart 
34198aaa7bcfSJames Smart 	uint32_t mib_size;
342066e9e6bfSJames Smart 	uint32_t word23;                        /* RESERVED */
342166e9e6bfSJames Smart 
342266e9e6bfSJames Smart 	uint32_t word24;
342366e9e6bfSJames Smart #define cfg_frag_field_offset_SHIFT		0
342466e9e6bfSJames Smart #define cfg_frag_field_offset_MASK		0x0000ffff
342566e9e6bfSJames Smart #define cfg_frag_field_offset_WORD		word24
342666e9e6bfSJames Smart 
342766e9e6bfSJames Smart #define cfg_frag_field_size_SHIFT		16
342866e9e6bfSJames Smart #define cfg_frag_field_size_MASK		0x0000ffff
342966e9e6bfSJames Smart #define cfg_frag_field_size_WORD		word24
343066e9e6bfSJames Smart 
343166e9e6bfSJames Smart 	uint32_t word25;
343266e9e6bfSJames Smart #define cfg_sgl_field_offset_SHIFT		0
343366e9e6bfSJames Smart #define cfg_sgl_field_offset_MASK		0x0000ffff
343466e9e6bfSJames Smart #define cfg_sgl_field_offset_WORD		word25
343566e9e6bfSJames Smart 
343666e9e6bfSJames Smart #define cfg_sgl_field_size_SHIFT		16
343766e9e6bfSJames Smart #define cfg_sgl_field_size_MASK			0x0000ffff
343866e9e6bfSJames Smart #define cfg_sgl_field_size_WORD			word25
343966e9e6bfSJames Smart 
344066e9e6bfSJames Smart 	uint32_t word26;	/* Chain SGE initial value LOW  */
344166e9e6bfSJames Smart 	uint32_t word27;	/* Chain SGE initial value HIGH */
34420cf07f84SJames Smart #define LPFC_NODELAY_MAX_IO			32
3443fedd3b7bSJames Smart };
3444fedd3b7bSJames Smart 
344565791f1fSJames Smart #define LPFC_SET_UE_RECOVERY		0x10
3446c93764a6SDick Kennedy #define LPFC_SET_MDS_DIAGS		0x12
34479064aeb2SJames Smart #define LPFC_SET_CGN_SIGNAL		0x1f
3448171f6c41SJames Smart #define LPFC_SET_DUAL_DUMP		0x1e
3449c6a5c747SJames Smart #define LPFC_SET_ENABLE_MI		0x21
3450daebf93fSJames Smart #define LPFC_SET_ENABLE_CMF		0x24
345165791f1fSJames Smart struct lpfc_mbx_set_feature {
345265791f1fSJames Smart 	struct mbox_header header;
345365791f1fSJames Smart 	uint32_t feature;
345465791f1fSJames Smart 	uint32_t param_len;
345565791f1fSJames Smart 	uint32_t word6;
345665791f1fSJames Smart #define lpfc_mbx_set_feature_UER_SHIFT  0
345765791f1fSJames Smart #define lpfc_mbx_set_feature_UER_MASK   0x00000001
345865791f1fSJames Smart #define lpfc_mbx_set_feature_UER_WORD   word6
34598cdc5a22SDick Kennedy #define lpfc_mbx_set_feature_mds_SHIFT  2
34607bdedb34SJames Smart #define lpfc_mbx_set_feature_mds_MASK   0x00000001
34617bdedb34SJames Smart #define lpfc_mbx_set_feature_mds_WORD   word6
34627bdedb34SJames Smart #define lpfc_mbx_set_feature_mds_deep_loopbk_SHIFT  1
34637bdedb34SJames Smart #define lpfc_mbx_set_feature_mds_deep_loopbk_MASK   0x00000001
34647bdedb34SJames Smart #define lpfc_mbx_set_feature_mds_deep_loopbk_WORD   word6
34659064aeb2SJames Smart #define lpfc_mbx_set_feature_CGN_warn_freq_SHIFT 0
34669064aeb2SJames Smart #define lpfc_mbx_set_feature_CGN_warn_freq_MASK  0x0000ffff
34679064aeb2SJames Smart #define lpfc_mbx_set_feature_CGN_warn_freq_WORD  word6
3468171f6c41SJames Smart #define lpfc_mbx_set_feature_dd_SHIFT		0
3469171f6c41SJames Smart #define lpfc_mbx_set_feature_dd_MASK		0x00000001
3470171f6c41SJames Smart #define lpfc_mbx_set_feature_dd_WORD		word6
3471171f6c41SJames Smart #define lpfc_mbx_set_feature_ddquery_SHIFT	1
3472171f6c41SJames Smart #define lpfc_mbx_set_feature_ddquery_MASK	0x00000001
3473171f6c41SJames Smart #define lpfc_mbx_set_feature_ddquery_WORD	word6
3474171f6c41SJames Smart #define LPFC_DISABLE_DUAL_DUMP		0
3475171f6c41SJames Smart #define LPFC_ENABLE_DUAL_DUMP		1
3476171f6c41SJames Smart #define LPFC_QUERY_OP_DUAL_DUMP		2
3477daebf93fSJames Smart #define lpfc_mbx_set_feature_cmf_SHIFT		0
3478daebf93fSJames Smart #define lpfc_mbx_set_feature_cmf_MASK		0x00000001
3479daebf93fSJames Smart #define lpfc_mbx_set_feature_cmf_WORD		word6
3480c6a5c747SJames Smart #define lpfc_mbx_set_feature_mi_SHIFT		0
3481c6a5c747SJames Smart #define lpfc_mbx_set_feature_mi_MASK		0x0000ffff
3482c6a5c747SJames Smart #define lpfc_mbx_set_feature_mi_WORD		word6
3483c6a5c747SJames Smart #define lpfc_mbx_set_feature_milunq_SHIFT	16
3484c6a5c747SJames Smart #define lpfc_mbx_set_feature_milunq_MASK	0x0000ffff
3485c6a5c747SJames Smart #define lpfc_mbx_set_feature_milunq_WORD	word6
348665791f1fSJames Smart 	uint32_t word7;
348765791f1fSJames Smart #define lpfc_mbx_set_feature_UERP_SHIFT 0
348865791f1fSJames Smart #define lpfc_mbx_set_feature_UERP_MASK  0x0000ffff
348965791f1fSJames Smart #define lpfc_mbx_set_feature_UERP_WORD  word7
349065791f1fSJames Smart #define lpfc_mbx_set_feature_UESR_SHIFT 16
349165791f1fSJames Smart #define lpfc_mbx_set_feature_UESR_MASK  0x0000ffff
349265791f1fSJames Smart #define lpfc_mbx_set_feature_UESR_WORD  word7
34939064aeb2SJames Smart #define lpfc_mbx_set_feature_CGN_alarm_freq_SHIFT 0
34949064aeb2SJames Smart #define lpfc_mbx_set_feature_CGN_alarm_freq_MASK  0x0000ffff
34959064aeb2SJames Smart #define lpfc_mbx_set_feature_CGN_alarm_freq_WORD  word7
34969064aeb2SJames Smart 	u32 word8;
34979064aeb2SJames Smart #define lpfc_mbx_set_feature_CGN_acqe_freq_SHIFT 0
34989064aeb2SJames Smart #define lpfc_mbx_set_feature_CGN_acqe_freq_MASK  0x000000ff
34999064aeb2SJames Smart #define lpfc_mbx_set_feature_CGN_acqe_freq_WORD  word8
350065791f1fSJames Smart };
350165791f1fSJames Smart 
350265791f1fSJames Smart 
350361bda8f7SJames Smart #define LPFC_SET_HOST_OS_DRIVER_VERSION    0x2
35043b0009c8SJames Smart #define LPFC_SET_HOST_DATE_TIME		   0x4
35053b0009c8SJames Smart 
35063b0009c8SJames Smart struct lpfc_mbx_set_host_date_time {
35073b0009c8SJames Smart 	uint32_t word6;
35083b0009c8SJames Smart #define lpfc_mbx_set_host_month_WORD	word6
35093b0009c8SJames Smart #define lpfc_mbx_set_host_month_SHIFT	16
35103b0009c8SJames Smart #define lpfc_mbx_set_host_month_MASK	0xFF
35113b0009c8SJames Smart #define lpfc_mbx_set_host_day_WORD	word6
35123b0009c8SJames Smart #define lpfc_mbx_set_host_day_SHIFT	8
35133b0009c8SJames Smart #define lpfc_mbx_set_host_day_MASK	0xFF
35143b0009c8SJames Smart #define lpfc_mbx_set_host_year_WORD	word6
35153b0009c8SJames Smart #define lpfc_mbx_set_host_year_SHIFT	0
35163b0009c8SJames Smart #define lpfc_mbx_set_host_year_MASK	0xFF
35173b0009c8SJames Smart 	uint32_t word7;
35183b0009c8SJames Smart #define lpfc_mbx_set_host_hour_WORD	word7
35193b0009c8SJames Smart #define lpfc_mbx_set_host_hour_SHIFT	16
35203b0009c8SJames Smart #define lpfc_mbx_set_host_hour_MASK	0xFF
35213b0009c8SJames Smart #define lpfc_mbx_set_host_min_WORD	word7
35223b0009c8SJames Smart #define lpfc_mbx_set_host_min_SHIFT	8
35233b0009c8SJames Smart #define lpfc_mbx_set_host_min_MASK	0xFF
35243b0009c8SJames Smart #define lpfc_mbx_set_host_sec_WORD	word7
35253b0009c8SJames Smart #define lpfc_mbx_set_host_sec_SHIFT     0
35263b0009c8SJames Smart #define lpfc_mbx_set_host_sec_MASK      0xFF
35273b0009c8SJames Smart };
35283b0009c8SJames Smart 
352961bda8f7SJames Smart struct lpfc_mbx_set_host_data {
353061bda8f7SJames Smart #define LPFC_HOST_OS_DRIVER_VERSION_SIZE   48
353161bda8f7SJames Smart 	struct mbox_header header;
353261bda8f7SJames Smart 	uint32_t param_id;
353361bda8f7SJames Smart 	uint32_t param_len;
35343b0009c8SJames Smart 	union {
353561bda8f7SJames Smart 		uint8_t data[LPFC_HOST_OS_DRIVER_VERSION_SIZE];
35363b0009c8SJames Smart 		struct  lpfc_mbx_set_host_date_time tm;
35373b0009c8SJames Smart 	} un;
353861bda8f7SJames Smart };
353961bda8f7SJames Smart 
35401dc5ec24SJames Smart struct lpfc_mbx_set_trunk_mode {
35411dc5ec24SJames Smart 	struct mbox_header header;
35421dc5ec24SJames Smart 	uint32_t word0;
35431dc5ec24SJames Smart #define lpfc_mbx_set_trunk_mode_WORD      word0
35441dc5ec24SJames Smart #define lpfc_mbx_set_trunk_mode_SHIFT     0
35451dc5ec24SJames Smart #define lpfc_mbx_set_trunk_mode_MASK      0xFF
35461dc5ec24SJames Smart 	uint32_t word1;
35471dc5ec24SJames Smart 	uint32_t word2;
35481dc5ec24SJames Smart };
354961bda8f7SJames Smart 
3550fedd3b7bSJames Smart struct lpfc_mbx_get_sli4_parameters {
3551fedd3b7bSJames Smart 	struct mbox_header header;
3552fedd3b7bSJames Smart 	struct lpfc_sli4_parameters sli4_parameters;
3553fedd3b7bSJames Smart };
3554fedd3b7bSJames Smart 
35558c42a65cSJames Smart struct lpfc_mbx_reg_congestion_buf {
35568c42a65cSJames Smart 	struct mbox_header header;
35578c42a65cSJames Smart 	uint32_t word0;
35588c42a65cSJames Smart #define lpfc_mbx_reg_cgn_buf_type_WORD		word0
35598c42a65cSJames Smart #define lpfc_mbx_reg_cgn_buf_type_SHIFT		0
35608c42a65cSJames Smart #define lpfc_mbx_reg_cgn_buf_type_MASK		0xFF
35618c42a65cSJames Smart #define lpfc_mbx_reg_cgn_buf_cnt_WORD		word0
35628c42a65cSJames Smart #define lpfc_mbx_reg_cgn_buf_cnt_SHIFT		16
35638c42a65cSJames Smart #define lpfc_mbx_reg_cgn_buf_cnt_MASK		0xFF
35648c42a65cSJames Smart 	uint32_t word1;
35658c42a65cSJames Smart 	uint32_t length;
35668c42a65cSJames Smart 	uint32_t addr_lo;
35678c42a65cSJames Smart 	uint32_t addr_hi;
35688c42a65cSJames Smart };
35698c42a65cSJames Smart 
3570912e3acdSJames Smart struct lpfc_rscr_desc_generic {
35718aa134a8SJames Smart #define LPFC_RSRC_DESC_WSIZE			22
3572912e3acdSJames Smart 	uint32_t desc[LPFC_RSRC_DESC_WSIZE];
3573912e3acdSJames Smart };
3574912e3acdSJames Smart 
3575912e3acdSJames Smart struct lpfc_rsrc_desc_pcie {
3576912e3acdSJames Smart 	uint32_t word0;
3577912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_type_SHIFT		0
3578912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_type_MASK		0x000000ff
3579912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_type_WORD		word0
3580912e3acdSJames Smart #define LPFC_RSRC_DESC_TYPE_PCIE		0x40
35818aa134a8SJames Smart #define lpfc_rsrc_desc_pcie_length_SHIFT	8
35828aa134a8SJames Smart #define lpfc_rsrc_desc_pcie_length_MASK		0x000000ff
35838aa134a8SJames Smart #define lpfc_rsrc_desc_pcie_length_WORD		word0
3584912e3acdSJames Smart 	uint32_t word1;
3585912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_pfnum_SHIFT		0
3586912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_pfnum_MASK		0x000000ff
3587912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_pfnum_WORD		word1
3588912e3acdSJames Smart 	uint32_t reserved;
3589912e3acdSJames Smart 	uint32_t word3;
3590912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_sriov_sta_SHIFT	0
3591912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_sriov_sta_MASK	0x000000ff
3592912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_sriov_sta_WORD	word3
3593912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_pf_sta_SHIFT	8
3594912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_pf_sta_MASK		0x000000ff
3595912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_pf_sta_WORD		word3
3596912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_pf_type_SHIFT	16
3597912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_pf_type_MASK	0x000000ff
3598912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_pf_type_WORD	word3
3599912e3acdSJames Smart 	uint32_t word4;
3600912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_nr_virtfn_SHIFT	0
3601912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_nr_virtfn_MASK	0x0000ffff
3602912e3acdSJames Smart #define lpfc_rsrc_desc_pcie_nr_virtfn_WORD	word4
3603912e3acdSJames Smart };
3604912e3acdSJames Smart 
3605912e3acdSJames Smart struct lpfc_rsrc_desc_fcfcoe {
3606912e3acdSJames Smart 	uint32_t word0;
3607912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_type_SHIFT	0
3608912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_type_MASK		0x000000ff
3609912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_type_WORD		word0
3610912e3acdSJames Smart #define LPFC_RSRC_DESC_TYPE_FCFCOE		0x43
36118aa134a8SJames Smart #define lpfc_rsrc_desc_fcfcoe_length_SHIFT	8
36128aa134a8SJames Smart #define lpfc_rsrc_desc_fcfcoe_length_MASK	0x000000ff
36138aa134a8SJames Smart #define lpfc_rsrc_desc_fcfcoe_length_WORD	word0
36148aa134a8SJames Smart #define LPFC_RSRC_DESC_TYPE_FCFCOE_V0_RSVD	0
36158aa134a8SJames Smart #define LPFC_RSRC_DESC_TYPE_FCFCOE_V0_LENGTH	72
36168aa134a8SJames Smart #define LPFC_RSRC_DESC_TYPE_FCFCOE_V1_LENGTH	88
3617912e3acdSJames Smart 	uint32_t word1;
3618912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_vfnum_SHIFT	0
3619912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_vfnum_MASK	0x000000ff
3620912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_vfnum_WORD	word1
3621912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_pfnum_SHIFT	16
3622912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_pfnum_MASK        0x000007ff
3623912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_pfnum_WORD        word1
3624912e3acdSJames Smart 	uint32_t word2;
3625912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_rpi_cnt_SHIFT	0
3626912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_rpi_cnt_MASK	0x0000ffff
3627912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_rpi_cnt_WORD	word2
3628912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_xri_cnt_SHIFT	16
3629912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_xri_cnt_MASK	0x0000ffff
3630912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_xri_cnt_WORD	word2
3631912e3acdSJames Smart 	uint32_t word3;
3632912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_wq_cnt_SHIFT	0
3633912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_wq_cnt_MASK	0x0000ffff
3634912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_wq_cnt_WORD	word3
3635912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_rq_cnt_SHIFT	16
3636912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_rq_cnt_MASK	0x0000ffff
3637912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_rq_cnt_WORD	word3
3638912e3acdSJames Smart 	uint32_t word4;
3639912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_cq_cnt_SHIFT	0
3640912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_cq_cnt_MASK	0x0000ffff
3641912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_cq_cnt_WORD	word4
3642912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_vpi_cnt_SHIFT	16
3643912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_vpi_cnt_MASK	0x0000ffff
3644912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_vpi_cnt_WORD	word4
3645912e3acdSJames Smart 	uint32_t word5;
3646912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_fcfi_cnt_SHIFT	0
3647912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_fcfi_cnt_MASK	0x0000ffff
3648912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_fcfi_cnt_WORD	word5
3649912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_vfi_cnt_SHIFT	16
3650912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_vfi_cnt_MASK	0x0000ffff
3651912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_vfi_cnt_WORD	word5
3652912e3acdSJames Smart 	uint32_t word6;
3653912e3acdSJames Smart 	uint32_t word7;
3654912e3acdSJames Smart 	uint32_t word8;
3655912e3acdSJames Smart 	uint32_t word9;
3656912e3acdSJames Smart 	uint32_t word10;
3657912e3acdSJames Smart 	uint32_t word11;
3658912e3acdSJames Smart 	uint32_t word12;
3659912e3acdSJames Smart 	uint32_t word13;
3660912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lnk_nr_SHIFT	0
3661912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lnk_nr_MASK	0x0000003f
3662912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lnk_nr_WORD	word13
3663912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lnk_tp_SHIFT      6
3664912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lnk_tp_MASK	0x00000003
3665912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lnk_tp_WORD	word13
3666912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lmc_SHIFT		8
3667912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lmc_MASK		0x00000001
3668912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lmc_WORD		word13
3669912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lld_SHIFT		9
3670912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lld_MASK		0x00000001
3671912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_lld_WORD		word13
3672912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_eq_cnt_SHIFT	16
3673912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_eq_cnt_MASK	0x0000ffff
3674912e3acdSJames Smart #define lpfc_rsrc_desc_fcfcoe_eq_cnt_WORD	word13
36758aa134a8SJames Smart /* extended FC/FCoE Resource Descriptor when length = 88 bytes */
36768aa134a8SJames Smart 	uint32_t bw_min;
36778aa134a8SJames Smart 	uint32_t bw_max;
36788aa134a8SJames Smart 	uint32_t iops_min;
36798aa134a8SJames Smart 	uint32_t iops_max;
36808aa134a8SJames Smart 	uint32_t reserved[4];
3681912e3acdSJames Smart };
3682912e3acdSJames Smart 
3683912e3acdSJames Smart struct lpfc_func_cfg {
3684912e3acdSJames Smart #define LPFC_RSRC_DESC_MAX_NUM			2
3685912e3acdSJames Smart 	uint32_t rsrc_desc_count;
3686912e3acdSJames Smart 	struct lpfc_rscr_desc_generic desc[LPFC_RSRC_DESC_MAX_NUM];
3687912e3acdSJames Smart };
3688912e3acdSJames Smart 
3689912e3acdSJames Smart struct lpfc_mbx_get_func_cfg {
3690912e3acdSJames Smart 	struct mbox_header header;
3691912e3acdSJames Smart #define LPFC_CFG_TYPE_PERSISTENT_OVERRIDE	0x0
3692912e3acdSJames Smart #define LPFC_CFG_TYPE_FACTURY_DEFAULT		0x1
3693912e3acdSJames Smart #define LPFC_CFG_TYPE_CURRENT_ACTIVE		0x2
3694912e3acdSJames Smart 	struct lpfc_func_cfg func_cfg;
3695912e3acdSJames Smart };
3696912e3acdSJames Smart 
3697912e3acdSJames Smart struct lpfc_prof_cfg {
3698912e3acdSJames Smart #define LPFC_RSRC_DESC_MAX_NUM			2
3699912e3acdSJames Smart 	uint32_t rsrc_desc_count;
3700912e3acdSJames Smart 	struct lpfc_rscr_desc_generic desc[LPFC_RSRC_DESC_MAX_NUM];
3701912e3acdSJames Smart };
3702912e3acdSJames Smart 
3703912e3acdSJames Smart struct lpfc_mbx_get_prof_cfg {
3704912e3acdSJames Smart 	struct mbox_header header;
3705912e3acdSJames Smart #define LPFC_CFG_TYPE_PERSISTENT_OVERRIDE	0x0
3706912e3acdSJames Smart #define LPFC_CFG_TYPE_FACTURY_DEFAULT		0x1
3707912e3acdSJames Smart #define LPFC_CFG_TYPE_CURRENT_ACTIVE		0x2
3708912e3acdSJames Smart 	union {
3709912e3acdSJames Smart 		struct {
3710912e3acdSJames Smart 			uint32_t word10;
3711912e3acdSJames Smart #define lpfc_mbx_get_prof_cfg_prof_id_SHIFT	0
3712912e3acdSJames Smart #define lpfc_mbx_get_prof_cfg_prof_id_MASK	0x000000ff
3713912e3acdSJames Smart #define lpfc_mbx_get_prof_cfg_prof_id_WORD	word10
3714912e3acdSJames Smart #define lpfc_mbx_get_prof_cfg_prof_tp_SHIFT	8
3715912e3acdSJames Smart #define lpfc_mbx_get_prof_cfg_prof_tp_MASK	0x00000003
3716912e3acdSJames Smart #define lpfc_mbx_get_prof_cfg_prof_tp_WORD	word10
3717912e3acdSJames Smart 		} request;
3718912e3acdSJames Smart 		struct {
3719912e3acdSJames Smart 			struct lpfc_prof_cfg prof_cfg;
3720912e3acdSJames Smart 		} response;
3721912e3acdSJames Smart 	} u;
3722912e3acdSJames Smart };
3723912e3acdSJames Smart 
3724cd1c8301SJames Smart struct lpfc_controller_attribute {
3725cd1c8301SJames Smart 	uint32_t version_string[8];
3726cd1c8301SJames Smart 	uint32_t manufacturer_name[8];
3727cd1c8301SJames Smart 	uint32_t supported_modes;
3728cd1c8301SJames Smart 	uint32_t word17;
3729cd1c8301SJames Smart #define lpfc_cntl_attr_eprom_ver_lo_SHIFT	0
3730cd1c8301SJames Smart #define lpfc_cntl_attr_eprom_ver_lo_MASK	0x000000ff
3731cd1c8301SJames Smart #define lpfc_cntl_attr_eprom_ver_lo_WORD	word17
3732cd1c8301SJames Smart #define lpfc_cntl_attr_eprom_ver_hi_SHIFT	8
3733cd1c8301SJames Smart #define lpfc_cntl_attr_eprom_ver_hi_MASK	0x000000ff
3734cd1c8301SJames Smart #define lpfc_cntl_attr_eprom_ver_hi_WORD	word17
373516a93e83SJames Smart #define lpfc_cntl_attr_flash_id_SHIFT		16
373616a93e83SJames Smart #define lpfc_cntl_attr_flash_id_MASK		0x000000ff
373716a93e83SJames Smart #define lpfc_cntl_attr_flash_id_WORD		word17
3738cd1c8301SJames Smart 	uint32_t mbx_da_struct_ver;
3739cd1c8301SJames Smart 	uint32_t ep_fw_da_struct_ver;
3740cd1c8301SJames Smart 	uint32_t ncsi_ver_str[3];
3741cd1c8301SJames Smart 	uint32_t dflt_ext_timeout;
3742cd1c8301SJames Smart 	uint32_t model_number[8];
3743cd1c8301SJames Smart 	uint32_t description[16];
3744cd1c8301SJames Smart 	uint32_t serial_number[8];
3745cd1c8301SJames Smart 	uint32_t ip_ver_str[8];
3746cd1c8301SJames Smart 	uint32_t fw_ver_str[8];
3747cd1c8301SJames Smart 	uint32_t bios_ver_str[8];
3748cd1c8301SJames Smart 	uint32_t redboot_ver_str[8];
3749cd1c8301SJames Smart 	uint32_t driver_ver_str[8];
3750cd1c8301SJames Smart 	uint32_t flash_fw_ver_str[8];
3751cd1c8301SJames Smart 	uint32_t functionality;
3752cd1c8301SJames Smart 	uint32_t word105;
3753cd1c8301SJames Smart #define lpfc_cntl_attr_max_cbd_len_SHIFT	0
3754cd1c8301SJames Smart #define lpfc_cntl_attr_max_cbd_len_MASK		0x0000ffff
3755cd1c8301SJames Smart #define lpfc_cntl_attr_max_cbd_len_WORD		word105
3756cd1c8301SJames Smart #define lpfc_cntl_attr_asic_rev_SHIFT		16
3757cd1c8301SJames Smart #define lpfc_cntl_attr_asic_rev_MASK		0x000000ff
3758cd1c8301SJames Smart #define lpfc_cntl_attr_asic_rev_WORD		word105
3759cd1c8301SJames Smart #define lpfc_cntl_attr_gen_guid0_SHIFT		24
3760cd1c8301SJames Smart #define lpfc_cntl_attr_gen_guid0_MASK		0x000000ff
3761cd1c8301SJames Smart #define lpfc_cntl_attr_gen_guid0_WORD		word105
3762cd1c8301SJames Smart 	uint32_t gen_guid1_12[3];
3763cd1c8301SJames Smart 	uint32_t word109;
3764cd1c8301SJames Smart #define lpfc_cntl_attr_gen_guid13_14_SHIFT	0
3765cd1c8301SJames Smart #define lpfc_cntl_attr_gen_guid13_14_MASK	0x0000ffff
3766cd1c8301SJames Smart #define lpfc_cntl_attr_gen_guid13_14_WORD	word109
3767cd1c8301SJames Smart #define lpfc_cntl_attr_gen_guid15_SHIFT		16
3768cd1c8301SJames Smart #define lpfc_cntl_attr_gen_guid15_MASK		0x000000ff
3769cd1c8301SJames Smart #define lpfc_cntl_attr_gen_guid15_WORD		word109
3770cd1c8301SJames Smart #define lpfc_cntl_attr_hba_port_cnt_SHIFT	24
3771cd1c8301SJames Smart #define lpfc_cntl_attr_hba_port_cnt_MASK	0x000000ff
3772cd1c8301SJames Smart #define lpfc_cntl_attr_hba_port_cnt_WORD	word109
3773cd1c8301SJames Smart 	uint32_t word110;
3774cd1c8301SJames Smart #define lpfc_cntl_attr_dflt_lnk_tmo_SHIFT	0
3775cd1c8301SJames Smart #define lpfc_cntl_attr_dflt_lnk_tmo_MASK	0x0000ffff
3776cd1c8301SJames Smart #define lpfc_cntl_attr_dflt_lnk_tmo_WORD	word110
3777cd1c8301SJames Smart #define lpfc_cntl_attr_multi_func_dev_SHIFT	24
3778cd1c8301SJames Smart #define lpfc_cntl_attr_multi_func_dev_MASK	0x000000ff
3779cd1c8301SJames Smart #define lpfc_cntl_attr_multi_func_dev_WORD	word110
3780cd1c8301SJames Smart 	uint32_t word111;
3781cd1c8301SJames Smart #define lpfc_cntl_attr_cache_valid_SHIFT	0
3782cd1c8301SJames Smart #define lpfc_cntl_attr_cache_valid_MASK		0x000000ff
3783cd1c8301SJames Smart #define lpfc_cntl_attr_cache_valid_WORD		word111
3784cd1c8301SJames Smart #define lpfc_cntl_attr_hba_status_SHIFT		8
3785cd1c8301SJames Smart #define lpfc_cntl_attr_hba_status_MASK		0x000000ff
3786cd1c8301SJames Smart #define lpfc_cntl_attr_hba_status_WORD		word111
3787cd1c8301SJames Smart #define lpfc_cntl_attr_max_domain_SHIFT		16
3788cd1c8301SJames Smart #define lpfc_cntl_attr_max_domain_MASK		0x000000ff
3789cd1c8301SJames Smart #define lpfc_cntl_attr_max_domain_WORD		word111
3790cd1c8301SJames Smart #define lpfc_cntl_attr_lnk_numb_SHIFT		24
3791cd1c8301SJames Smart #define lpfc_cntl_attr_lnk_numb_MASK		0x0000003f
3792cd1c8301SJames Smart #define lpfc_cntl_attr_lnk_numb_WORD		word111
3793cd1c8301SJames Smart #define lpfc_cntl_attr_lnk_type_SHIFT		30
3794cd1c8301SJames Smart #define lpfc_cntl_attr_lnk_type_MASK		0x00000003
3795cd1c8301SJames Smart #define lpfc_cntl_attr_lnk_type_WORD		word111
3796cd1c8301SJames Smart 	uint32_t fw_post_status;
3797cd1c8301SJames Smart 	uint32_t hba_mtu[8];
3798cd1c8301SJames Smart 	uint32_t word121;
3799cd1c8301SJames Smart 	uint32_t reserved1[3];
3800cd1c8301SJames Smart 	uint32_t word125;
3801cd1c8301SJames Smart #define lpfc_cntl_attr_pci_vendor_id_SHIFT	0
3802cd1c8301SJames Smart #define lpfc_cntl_attr_pci_vendor_id_MASK	0x0000ffff
3803cd1c8301SJames Smart #define lpfc_cntl_attr_pci_vendor_id_WORD	word125
3804cd1c8301SJames Smart #define lpfc_cntl_attr_pci_device_id_SHIFT	16
3805cd1c8301SJames Smart #define lpfc_cntl_attr_pci_device_id_MASK	0x0000ffff
3806cd1c8301SJames Smart #define lpfc_cntl_attr_pci_device_id_WORD	word125
3807cd1c8301SJames Smart 	uint32_t word126;
3808cd1c8301SJames Smart #define lpfc_cntl_attr_pci_subvdr_id_SHIFT	0
3809cd1c8301SJames Smart #define lpfc_cntl_attr_pci_subvdr_id_MASK	0x0000ffff
3810cd1c8301SJames Smart #define lpfc_cntl_attr_pci_subvdr_id_WORD	word126
3811cd1c8301SJames Smart #define lpfc_cntl_attr_pci_subsys_id_SHIFT	16
3812cd1c8301SJames Smart #define lpfc_cntl_attr_pci_subsys_id_MASK	0x0000ffff
3813cd1c8301SJames Smart #define lpfc_cntl_attr_pci_subsys_id_WORD	word126
3814cd1c8301SJames Smart 	uint32_t word127;
3815cd1c8301SJames Smart #define lpfc_cntl_attr_pci_bus_num_SHIFT	0
3816cd1c8301SJames Smart #define lpfc_cntl_attr_pci_bus_num_MASK		0x000000ff
3817cd1c8301SJames Smart #define lpfc_cntl_attr_pci_bus_num_WORD		word127
3818cd1c8301SJames Smart #define lpfc_cntl_attr_pci_dev_num_SHIFT	8
3819cd1c8301SJames Smart #define lpfc_cntl_attr_pci_dev_num_MASK		0x000000ff
3820cd1c8301SJames Smart #define lpfc_cntl_attr_pci_dev_num_WORD		word127
3821cd1c8301SJames Smart #define lpfc_cntl_attr_pci_fnc_num_SHIFT	16
3822cd1c8301SJames Smart #define lpfc_cntl_attr_pci_fnc_num_MASK		0x000000ff
3823cd1c8301SJames Smart #define lpfc_cntl_attr_pci_fnc_num_WORD		word127
3824cd1c8301SJames Smart #define lpfc_cntl_attr_inf_type_SHIFT		24
3825cd1c8301SJames Smart #define lpfc_cntl_attr_inf_type_MASK		0x000000ff
3826cd1c8301SJames Smart #define lpfc_cntl_attr_inf_type_WORD		word127
3827cd1c8301SJames Smart 	uint32_t unique_id[2];
3828cd1c8301SJames Smart 	uint32_t word130;
3829cd1c8301SJames Smart #define lpfc_cntl_attr_num_netfil_SHIFT		0
3830cd1c8301SJames Smart #define lpfc_cntl_attr_num_netfil_MASK		0x000000ff
3831cd1c8301SJames Smart #define lpfc_cntl_attr_num_netfil_WORD		word130
3832cd1c8301SJames Smart 	uint32_t reserved2[4];
3833cd1c8301SJames Smart };
3834cd1c8301SJames Smart 
3835cd1c8301SJames Smart struct lpfc_mbx_get_cntl_attributes {
3836cd1c8301SJames Smart 	union  lpfc_sli4_cfg_shdr cfg_shdr;
3837cd1c8301SJames Smart 	struct lpfc_controller_attribute cntl_attr;
3838cd1c8301SJames Smart };
3839cd1c8301SJames Smart 
3840cd1c8301SJames Smart struct lpfc_mbx_get_port_name {
3841cd1c8301SJames Smart 	struct mbox_header header;
3842cd1c8301SJames Smart 	union {
3843cd1c8301SJames Smart 		struct {
3844cd1c8301SJames Smart 			uint32_t word4;
3845cd1c8301SJames Smart #define lpfc_mbx_get_port_name_lnk_type_SHIFT	0
3846cd1c8301SJames Smart #define lpfc_mbx_get_port_name_lnk_type_MASK	0x00000003
3847cd1c8301SJames Smart #define lpfc_mbx_get_port_name_lnk_type_WORD	word4
3848cd1c8301SJames Smart 		} request;
3849cd1c8301SJames Smart 		struct {
3850cd1c8301SJames Smart 			uint32_t word4;
3851cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name0_SHIFT	0
3852cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name0_MASK	0x000000FF
3853cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name0_WORD	word4
3854cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name1_SHIFT	8
3855cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name1_MASK	0x000000FF
3856cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name1_WORD	word4
3857cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name2_SHIFT	16
3858cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name2_MASK	0x000000FF
3859cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name2_WORD	word4
3860cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name3_SHIFT	24
3861cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name3_MASK	0x000000FF
3862cd1c8301SJames Smart #define lpfc_mbx_get_port_name_name3_WORD	word4
3863cd1c8301SJames Smart #define LPFC_LINK_NUMBER_0			0
3864cd1c8301SJames Smart #define LPFC_LINK_NUMBER_1			1
3865cd1c8301SJames Smart #define LPFC_LINK_NUMBER_2			2
3866cd1c8301SJames Smart #define LPFC_LINK_NUMBER_3			3
3867cd1c8301SJames Smart 		} response;
3868cd1c8301SJames Smart 	} u;
3869cd1c8301SJames Smart };
3870cd1c8301SJames Smart 
3871da0436e9SJames Smart /* Mailbox Completion Queue Error Messages */
3872da0436e9SJames Smart #define MB_CQE_STATUS_SUCCESS			0x0
3873da0436e9SJames Smart #define MB_CQE_STATUS_INSUFFICIENT_PRIVILEGES	0x1
3874da0436e9SJames Smart #define MB_CQE_STATUS_INVALID_PARAMETER		0x2
3875da0436e9SJames Smart #define MB_CQE_STATUS_INSUFFICIENT_RESOURCES	0x3
3876da0436e9SJames Smart #define MB_CEQ_STATUS_QUEUE_FLUSHING		0x4
3877da0436e9SJames Smart #define MB_CQE_STATUS_DMA_FAILED		0x5
3878da0436e9SJames Smart 
387974a7baa2SJames Smart 
3880184fc2b9SDick Kennedy #define LPFC_MBX_WR_CONFIG_MAX_BDE		1
388152d52440SJames Smart struct lpfc_mbx_wr_object {
388252d52440SJames Smart 	struct mbox_header header;
388352d52440SJames Smart 	union {
388452d52440SJames Smart 		struct {
388552d52440SJames Smart 			uint32_t word4;
388652d52440SJames Smart #define lpfc_wr_object_eof_SHIFT		31
388752d52440SJames Smart #define lpfc_wr_object_eof_MASK			0x00000001
388852d52440SJames Smart #define lpfc_wr_object_eof_WORD			word4
38895021267aSJames Smart #define lpfc_wr_object_eas_SHIFT		29
38905021267aSJames Smart #define lpfc_wr_object_eas_MASK			0x00000001
38915021267aSJames Smart #define lpfc_wr_object_eas_WORD			word4
389252d52440SJames Smart #define lpfc_wr_object_write_length_SHIFT	0
389352d52440SJames Smart #define lpfc_wr_object_write_length_MASK	0x00FFFFFF
389452d52440SJames Smart #define lpfc_wr_object_write_length_WORD	word4
389552d52440SJames Smart 			uint32_t write_offset;
389674a7baa2SJames Smart 			uint32_t object_name[LPFC_MBX_OBJECT_NAME_LEN_DW];
389752d52440SJames Smart 			uint32_t bde_count;
389852d52440SJames Smart 			struct ulp_bde64 bde[LPFC_MBX_WR_CONFIG_MAX_BDE];
389952d52440SJames Smart 		} request;
390052d52440SJames Smart 		struct {
390152d52440SJames Smart 			uint32_t actual_write_length;
39025021267aSJames Smart 			uint32_t word5;
39035021267aSJames Smart #define lpfc_wr_object_change_status_SHIFT	0
39045021267aSJames Smart #define lpfc_wr_object_change_status_MASK	0x000000FF
39055021267aSJames Smart #define lpfc_wr_object_change_status_WORD	word5
39065021267aSJames Smart #define LPFC_CHANGE_STATUS_NO_RESET_NEEDED	0x00
39075021267aSJames Smart #define LPFC_CHANGE_STATUS_PHYS_DEV_RESET	0x01
39085021267aSJames Smart #define LPFC_CHANGE_STATUS_FW_RESET		0x02
39095021267aSJames Smart #define LPFC_CHANGE_STATUS_PORT_MIGRATION	0x04
39105021267aSJames Smart #define LPFC_CHANGE_STATUS_PCI_RESET		0x05
3911f3d0a8acSJames Smart #define lpfc_wr_object_csf_SHIFT		8
3912f3d0a8acSJames Smart #define lpfc_wr_object_csf_MASK			0x00000001
3913f3d0a8acSJames Smart #define lpfc_wr_object_csf_WORD			word5
391452d52440SJames Smart 		} response;
391552d52440SJames Smart 	} u;
391652d52440SJames Smart };
391752d52440SJames Smart 
3918da0436e9SJames Smart /* mailbox queue entry structure */
3919da0436e9SJames Smart struct lpfc_mqe {
3920da0436e9SJames Smart 	uint32_t word0;
3921da0436e9SJames Smart #define lpfc_mqe_status_SHIFT		16
3922da0436e9SJames Smart #define lpfc_mqe_status_MASK		0x0000FFFF
3923da0436e9SJames Smart #define lpfc_mqe_status_WORD		word0
3924da0436e9SJames Smart #define lpfc_mqe_command_SHIFT		8
3925da0436e9SJames Smart #define lpfc_mqe_command_MASK		0x000000FF
3926da0436e9SJames Smart #define lpfc_mqe_command_WORD		word0
3927da0436e9SJames Smart 	union {
3928da0436e9SJames Smart 		uint32_t mb_words[LPFC_SLI4_MB_WORD_COUNT - 1];
3929da0436e9SJames Smart 		/* sli4 mailbox commands */
3930da0436e9SJames Smart 		struct lpfc_mbx_sli4_config sli4_config;
3931da0436e9SJames Smart 		struct lpfc_mbx_init_vfi init_vfi;
3932da0436e9SJames Smart 		struct lpfc_mbx_reg_vfi reg_vfi;
3933da0436e9SJames Smart 		struct lpfc_mbx_reg_vfi unreg_vfi;
3934da0436e9SJames Smart 		struct lpfc_mbx_init_vpi init_vpi;
3935da0436e9SJames Smart 		struct lpfc_mbx_resume_rpi resume_rpi;
3936da0436e9SJames Smart 		struct lpfc_mbx_read_fcf_tbl read_fcf_tbl;
3937da0436e9SJames Smart 		struct lpfc_mbx_add_fcf_tbl_entry add_fcf_entry;
3938da0436e9SJames Smart 		struct lpfc_mbx_del_fcf_tbl_entry del_fcf_entry;
3939ecfd03c6SJames Smart 		struct lpfc_mbx_redisc_fcf_tbl redisc_fcf_tbl;
3940da0436e9SJames Smart 		struct lpfc_mbx_reg_fcfi reg_fcfi;
39412d7dbc4cSJames Smart 		struct lpfc_mbx_reg_fcfi_mrq reg_fcfi_mrq;
3942da0436e9SJames Smart 		struct lpfc_mbx_unreg_fcfi unreg_fcfi;
3943da0436e9SJames Smart 		struct lpfc_mbx_mq_create mq_create;
3944b19a061aSJames Smart 		struct lpfc_mbx_mq_create_ext mq_create_ext;
394572df8a45SJames Smart 		struct lpfc_mbx_read_object read_object;
3946da0436e9SJames Smart 		struct lpfc_mbx_eq_create eq_create;
3947173edbb2SJames Smart 		struct lpfc_mbx_modify_eq_delay eq_delay;
3948da0436e9SJames Smart 		struct lpfc_mbx_cq_create cq_create;
39492d7dbc4cSJames Smart 		struct lpfc_mbx_cq_create_set cq_create_set;
3950da0436e9SJames Smart 		struct lpfc_mbx_wq_create wq_create;
3951da0436e9SJames Smart 		struct lpfc_mbx_rq_create rq_create;
39522d7dbc4cSJames Smart 		struct lpfc_mbx_rq_create_v2 rq_create_v2;
3953da0436e9SJames Smart 		struct lpfc_mbx_mq_destroy mq_destroy;
3954da0436e9SJames Smart 		struct lpfc_mbx_eq_destroy eq_destroy;
3955da0436e9SJames Smart 		struct lpfc_mbx_cq_destroy cq_destroy;
3956da0436e9SJames Smart 		struct lpfc_mbx_wq_destroy wq_destroy;
3957da0436e9SJames Smart 		struct lpfc_mbx_rq_destroy rq_destroy;
39586d368e53SJames Smart 		struct lpfc_mbx_get_rsrc_extent_info rsrc_extent_info;
39596d368e53SJames Smart 		struct lpfc_mbx_alloc_rsrc_extents alloc_rsrc_extents;
39606d368e53SJames Smart 		struct lpfc_mbx_dealloc_rsrc_extents dealloc_rsrc_extents;
3961da0436e9SJames Smart 		struct lpfc_mbx_post_sgl_pages post_sgl_pages;
3962da0436e9SJames Smart 		struct lpfc_mbx_nembed_cmd nembed_cmd;
3963da0436e9SJames Smart 		struct lpfc_mbx_read_rev read_rev;
3964da0436e9SJames Smart 		struct lpfc_mbx_read_vpi read_vpi;
3965da0436e9SJames Smart 		struct lpfc_mbx_read_config rd_config;
3966da0436e9SJames Smart 		struct lpfc_mbx_request_features req_ftrs;
3967da0436e9SJames Smart 		struct lpfc_mbx_post_hdr_tmpl hdr_tmpl;
3968962bc51bSJames Smart 		struct lpfc_mbx_query_fw_config query_fw_cfg;
39698b017a30SJames Smart 		struct lpfc_mbx_set_beacon_config beacon_config;
3970fedd3b7bSJames Smart 		struct lpfc_mbx_get_sli4_parameters get_sli4_parameters;
39718c42a65cSJames Smart 		struct lpfc_mbx_reg_congestion_buf reg_congestion_buf;
39727ad20aa9SJames Smart 		struct lpfc_mbx_set_link_diag_state link_diag_state;
39737ad20aa9SJames Smart 		struct lpfc_mbx_set_link_diag_loopback link_diag_loopback;
39747ad20aa9SJames Smart 		struct lpfc_mbx_run_link_diag_test link_diag_test;
3975912e3acdSJames Smart 		struct lpfc_mbx_get_func_cfg get_func_cfg;
3976912e3acdSJames Smart 		struct lpfc_mbx_get_prof_cfg get_prof_cfg;
397752d52440SJames Smart 		struct lpfc_mbx_wr_object wr_object;
3978cd1c8301SJames Smart 		struct lpfc_mbx_get_port_name get_port_name;
397965791f1fSJames Smart 		struct lpfc_mbx_set_feature  set_feature;
398086478875SJames Smart 		struct lpfc_mbx_memory_dump_type3 mem_dump_type3;
398161bda8f7SJames Smart 		struct lpfc_mbx_set_host_data set_host_data;
39821dc5ec24SJames Smart 		struct lpfc_mbx_set_trunk_mode set_trunk_mode;
3983cd1c8301SJames Smart 		struct lpfc_mbx_nop nop;
3984d2cc9bcdSJames Smart 		struct lpfc_mbx_set_ras_fwlog ras_fwlog;
3985da0436e9SJames Smart 	} un;
3986da0436e9SJames Smart };
3987da0436e9SJames Smart 
3988da0436e9SJames Smart struct lpfc_mcqe {
3989da0436e9SJames Smart 	uint32_t word0;
3990da0436e9SJames Smart #define lpfc_mcqe_status_SHIFT		0
3991da0436e9SJames Smart #define lpfc_mcqe_status_MASK		0x0000FFFF
3992da0436e9SJames Smart #define lpfc_mcqe_status_WORD		word0
3993da0436e9SJames Smart #define lpfc_mcqe_ext_status_SHIFT	16
3994da0436e9SJames Smart #define lpfc_mcqe_ext_status_MASK	0x0000FFFF
3995da0436e9SJames Smart #define lpfc_mcqe_ext_status_WORD	word0
3996da0436e9SJames Smart 	uint32_t mcqe_tag0;
3997da0436e9SJames Smart 	uint32_t mcqe_tag1;
3998da0436e9SJames Smart 	uint32_t trailer;
3999da0436e9SJames Smart #define lpfc_trailer_valid_SHIFT	31
4000da0436e9SJames Smart #define lpfc_trailer_valid_MASK		0x00000001
4001da0436e9SJames Smart #define lpfc_trailer_valid_WORD		trailer
4002da0436e9SJames Smart #define lpfc_trailer_async_SHIFT	30
4003da0436e9SJames Smart #define lpfc_trailer_async_MASK		0x00000001
4004da0436e9SJames Smart #define lpfc_trailer_async_WORD		trailer
4005da0436e9SJames Smart #define lpfc_trailer_hpi_SHIFT		29
4006da0436e9SJames Smart #define lpfc_trailer_hpi_MASK		0x00000001
4007da0436e9SJames Smart #define lpfc_trailer_hpi_WORD		trailer
4008da0436e9SJames Smart #define lpfc_trailer_completed_SHIFT	28
4009da0436e9SJames Smart #define lpfc_trailer_completed_MASK	0x00000001
4010da0436e9SJames Smart #define lpfc_trailer_completed_WORD	trailer
4011da0436e9SJames Smart #define lpfc_trailer_consumed_SHIFT	27
4012da0436e9SJames Smart #define lpfc_trailer_consumed_MASK	0x00000001
4013da0436e9SJames Smart #define lpfc_trailer_consumed_WORD	trailer
4014da0436e9SJames Smart #define lpfc_trailer_type_SHIFT		16
4015da0436e9SJames Smart #define lpfc_trailer_type_MASK		0x000000FF
4016da0436e9SJames Smart #define lpfc_trailer_type_WORD		trailer
4017da0436e9SJames Smart #define lpfc_trailer_code_SHIFT		8
4018da0436e9SJames Smart #define lpfc_trailer_code_MASK		0x000000FF
4019da0436e9SJames Smart #define lpfc_trailer_code_WORD		trailer
4020da0436e9SJames Smart #define LPFC_TRAILER_CODE_LINK	0x1
4021da0436e9SJames Smart #define LPFC_TRAILER_CODE_FCOE	0x2
4022da0436e9SJames Smart #define LPFC_TRAILER_CODE_DCBX	0x3
4023b19a061aSJames Smart #define LPFC_TRAILER_CODE_GRP5	0x5
402476a95d75SJames Smart #define LPFC_TRAILER_CODE_FC	0x10
402570f3c073SJames Smart #define LPFC_TRAILER_CODE_SLI	0x11
4026daebf93fSJames Smart #define LPFC_TRAILER_CODE_CMSTAT        0x13
4027da0436e9SJames Smart };
4028da0436e9SJames Smart 
4029da0436e9SJames Smart struct lpfc_acqe_link {
4030da0436e9SJames Smart 	uint32_t word0;
4031da0436e9SJames Smart #define lpfc_acqe_link_speed_SHIFT		24
4032da0436e9SJames Smart #define lpfc_acqe_link_speed_MASK		0x000000FF
4033da0436e9SJames Smart #define lpfc_acqe_link_speed_WORD		word0
4034da0436e9SJames Smart #define LPFC_ASYNC_LINK_SPEED_ZERO		0x0
4035da0436e9SJames Smart #define LPFC_ASYNC_LINK_SPEED_10MBPS		0x1
4036da0436e9SJames Smart #define LPFC_ASYNC_LINK_SPEED_100MBPS		0x2
4037da0436e9SJames Smart #define LPFC_ASYNC_LINK_SPEED_1GBPS		0x3
4038da0436e9SJames Smart #define LPFC_ASYNC_LINK_SPEED_10GBPS		0x4
403926d830ecSJames Smart #define LPFC_ASYNC_LINK_SPEED_20GBPS		0x5
404026d830ecSJames Smart #define LPFC_ASYNC_LINK_SPEED_25GBPS		0x6
404126d830ecSJames Smart #define LPFC_ASYNC_LINK_SPEED_40GBPS		0x7
4042a085e87cSJames Smart #define LPFC_ASYNC_LINK_SPEED_100GBPS		0x8
4043da0436e9SJames Smart #define lpfc_acqe_link_duplex_SHIFT		16
4044da0436e9SJames Smart #define lpfc_acqe_link_duplex_MASK		0x000000FF
4045da0436e9SJames Smart #define lpfc_acqe_link_duplex_WORD		word0
4046da0436e9SJames Smart #define LPFC_ASYNC_LINK_DUPLEX_NONE		0x0
4047da0436e9SJames Smart #define LPFC_ASYNC_LINK_DUPLEX_HALF		0x1
4048da0436e9SJames Smart #define LPFC_ASYNC_LINK_DUPLEX_FULL		0x2
4049da0436e9SJames Smart #define lpfc_acqe_link_status_SHIFT		8
4050da0436e9SJames Smart #define lpfc_acqe_link_status_MASK		0x000000FF
4051da0436e9SJames Smart #define lpfc_acqe_link_status_WORD		word0
4052da0436e9SJames Smart #define LPFC_ASYNC_LINK_STATUS_DOWN		0x0
4053da0436e9SJames Smart #define LPFC_ASYNC_LINK_STATUS_UP		0x1
4054da0436e9SJames Smart #define LPFC_ASYNC_LINK_STATUS_LOGICAL_DOWN	0x2
4055da0436e9SJames Smart #define LPFC_ASYNC_LINK_STATUS_LOGICAL_UP	0x3
405670f3c073SJames Smart #define lpfc_acqe_link_type_SHIFT		6
405770f3c073SJames Smart #define lpfc_acqe_link_type_MASK		0x00000003
405870f3c073SJames Smart #define lpfc_acqe_link_type_WORD		word0
405970f3c073SJames Smart #define lpfc_acqe_link_number_SHIFT		0
406070f3c073SJames Smart #define lpfc_acqe_link_number_MASK		0x0000003F
406170f3c073SJames Smart #define lpfc_acqe_link_number_WORD		word0
4062da0436e9SJames Smart 	uint32_t word1;
4063da0436e9SJames Smart #define lpfc_acqe_link_fault_SHIFT	0
4064da0436e9SJames Smart #define lpfc_acqe_link_fault_MASK	0x000000FF
4065da0436e9SJames Smart #define lpfc_acqe_link_fault_WORD	word1
4066da0436e9SJames Smart #define LPFC_ASYNC_LINK_FAULT_NONE	0x0
4067da0436e9SJames Smart #define LPFC_ASYNC_LINK_FAULT_LOCAL	0x1
4068da0436e9SJames Smart #define LPFC_ASYNC_LINK_FAULT_REMOTE	0x2
406923288b78SJames Smart #define LPFC_ASYNC_LINK_FAULT_LR_LRR	0x3
407070f3c073SJames Smart #define lpfc_acqe_logical_link_speed_SHIFT	16
407170f3c073SJames Smart #define lpfc_acqe_logical_link_speed_MASK	0x0000FFFF
407270f3c073SJames Smart #define lpfc_acqe_logical_link_speed_WORD	word1
4073da0436e9SJames Smart 	uint32_t event_tag;
4074da0436e9SJames Smart 	uint32_t trailer;
407570f3c073SJames Smart #define LPFC_LINK_EVENT_TYPE_PHYSICAL	0x0
407670f3c073SJames Smart #define LPFC_LINK_EVENT_TYPE_VIRTUAL	0x1
4077da0436e9SJames Smart };
4078da0436e9SJames Smart 
407970f3c073SJames Smart struct lpfc_acqe_fip {
40806669f9bbSJames Smart 	uint32_t index;
4081da0436e9SJames Smart 	uint32_t word1;
408270f3c073SJames Smart #define lpfc_acqe_fip_fcf_count_SHIFT		0
408370f3c073SJames Smart #define lpfc_acqe_fip_fcf_count_MASK		0x0000FFFF
408470f3c073SJames Smart #define lpfc_acqe_fip_fcf_count_WORD		word1
408570f3c073SJames Smart #define lpfc_acqe_fip_event_type_SHIFT		16
408670f3c073SJames Smart #define lpfc_acqe_fip_event_type_MASK		0x0000FFFF
408770f3c073SJames Smart #define lpfc_acqe_fip_event_type_WORD		word1
4088da0436e9SJames Smart 	uint32_t event_tag;
4089da0436e9SJames Smart 	uint32_t trailer;
409070f3c073SJames Smart #define LPFC_FIP_EVENT_TYPE_NEW_FCF		0x1
409170f3c073SJames Smart #define LPFC_FIP_EVENT_TYPE_FCF_TABLE_FULL	0x2
409270f3c073SJames Smart #define LPFC_FIP_EVENT_TYPE_FCF_DEAD		0x3
409370f3c073SJames Smart #define LPFC_FIP_EVENT_TYPE_CVL			0x4
409470f3c073SJames Smart #define LPFC_FIP_EVENT_TYPE_FCF_PARAM_MOD	0x5
4095da0436e9SJames Smart };
4096da0436e9SJames Smart 
4097da0436e9SJames Smart struct lpfc_acqe_dcbx {
4098da0436e9SJames Smart 	uint32_t tlv_ttl;
4099da0436e9SJames Smart 	uint32_t reserved;
4100da0436e9SJames Smart 	uint32_t event_tag;
4101da0436e9SJames Smart 	uint32_t trailer;
4102da0436e9SJames Smart };
4103da0436e9SJames Smart 
4104b19a061aSJames Smart struct lpfc_acqe_grp5 {
4105b19a061aSJames Smart 	uint32_t word0;
410670f3c073SJames Smart #define lpfc_acqe_grp5_type_SHIFT		6
410770f3c073SJames Smart #define lpfc_acqe_grp5_type_MASK		0x00000003
410870f3c073SJames Smart #define lpfc_acqe_grp5_type_WORD		word0
410970f3c073SJames Smart #define lpfc_acqe_grp5_number_SHIFT		0
411070f3c073SJames Smart #define lpfc_acqe_grp5_number_MASK		0x0000003F
411170f3c073SJames Smart #define lpfc_acqe_grp5_number_WORD		word0
4112b19a061aSJames Smart 	uint32_t word1;
4113b19a061aSJames Smart #define lpfc_acqe_grp5_llink_spd_SHIFT	16
4114b19a061aSJames Smart #define lpfc_acqe_grp5_llink_spd_MASK	0x0000FFFF
4115b19a061aSJames Smart #define lpfc_acqe_grp5_llink_spd_WORD	word1
4116b19a061aSJames Smart 	uint32_t event_tag;
4117b19a061aSJames Smart 	uint32_t trailer;
4118b19a061aSJames Smart };
4119b19a061aSJames Smart 
4120a73cb814SBart Van Assche extern const char *const trunk_errmsg[];
41211dc5ec24SJames Smart 
412270f3c073SJames Smart struct lpfc_acqe_fc_la {
412370f3c073SJames Smart 	uint32_t word0;
412470f3c073SJames Smart #define lpfc_acqe_fc_la_speed_SHIFT		24
412570f3c073SJames Smart #define lpfc_acqe_fc_la_speed_MASK		0x000000FF
412670f3c073SJames Smart #define lpfc_acqe_fc_la_speed_WORD		word0
412726d830ecSJames Smart #define LPFC_FC_LA_SPEED_UNKNOWN		0x0
412870f3c073SJames Smart #define LPFC_FC_LA_SPEED_1G		0x1
412970f3c073SJames Smart #define LPFC_FC_LA_SPEED_2G		0x2
413070f3c073SJames Smart #define LPFC_FC_LA_SPEED_4G		0x4
413170f3c073SJames Smart #define LPFC_FC_LA_SPEED_8G		0x8
413270f3c073SJames Smart #define LPFC_FC_LA_SPEED_10G		0xA
413370f3c073SJames Smart #define LPFC_FC_LA_SPEED_16G		0x10
413486478875SJames Smart #define LPFC_FC_LA_SPEED_32G            0x20
4135fbd8a6baSJames Smart #define LPFC_FC_LA_SPEED_64G            0x21
4136fbd8a6baSJames Smart #define LPFC_FC_LA_SPEED_128G           0x22
4137fbd8a6baSJames Smart #define LPFC_FC_LA_SPEED_256G           0x23
413870f3c073SJames Smart #define lpfc_acqe_fc_la_topology_SHIFT		16
413970f3c073SJames Smart #define lpfc_acqe_fc_la_topology_MASK		0x000000FF
414070f3c073SJames Smart #define lpfc_acqe_fc_la_topology_WORD		word0
414170f3c073SJames Smart #define LPFC_FC_LA_TOP_UNKOWN		0x0
414270f3c073SJames Smart #define LPFC_FC_LA_TOP_P2P		0x1
414370f3c073SJames Smart #define LPFC_FC_LA_TOP_FCAL		0x2
414470f3c073SJames Smart #define LPFC_FC_LA_TOP_INTERNAL_LOOP	0x3
414570f3c073SJames Smart #define LPFC_FC_LA_TOP_SERDES_LOOP	0x4
414670f3c073SJames Smart #define lpfc_acqe_fc_la_att_type_SHIFT		8
414770f3c073SJames Smart #define lpfc_acqe_fc_la_att_type_MASK		0x000000FF
414870f3c073SJames Smart #define lpfc_acqe_fc_la_att_type_WORD		word0
414970f3c073SJames Smart #define LPFC_FC_LA_TYPE_LINK_UP		0x1
415070f3c073SJames Smart #define LPFC_FC_LA_TYPE_LINK_DOWN	0x2
415170f3c073SJames Smart #define LPFC_FC_LA_TYPE_NO_HARD_ALPA	0x3
41527bdedb34SJames Smart #define LPFC_FC_LA_TYPE_MDS_LINK_DOWN	0x4
41537bdedb34SJames Smart #define LPFC_FC_LA_TYPE_MDS_LOOPBACK	0x5
4154aeb3c817SJames Smart #define LPFC_FC_LA_TYPE_UNEXP_WWPN	0x6
41551dc5ec24SJames Smart #define LPFC_FC_LA_TYPE_TRUNKING_EVENT  0x7
415670f3c073SJames Smart #define lpfc_acqe_fc_la_port_type_SHIFT		6
415770f3c073SJames Smart #define lpfc_acqe_fc_la_port_type_MASK		0x00000003
415870f3c073SJames Smart #define lpfc_acqe_fc_la_port_type_WORD		word0
415970f3c073SJames Smart #define LPFC_LINK_TYPE_ETHERNET		0x0
416070f3c073SJames Smart #define LPFC_LINK_TYPE_FC		0x1
416170f3c073SJames Smart #define lpfc_acqe_fc_la_port_number_SHIFT	0
416270f3c073SJames Smart #define lpfc_acqe_fc_la_port_number_MASK	0x0000003F
416370f3c073SJames Smart #define lpfc_acqe_fc_la_port_number_WORD	word0
41641dc5ec24SJames Smart 
41651dc5ec24SJames Smart /* Attention Type is 0x07 (Trunking Event) word0 */
41661dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port0_SHIFT	16
41671dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port0_MASK	0x0000001
41681dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port0_WORD	word0
41691dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port1_SHIFT	17
41701dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port1_MASK	0x0000001
41711dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port1_WORD	word0
41721dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port2_SHIFT	18
41731dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port2_MASK	0x0000001
41741dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port2_WORD	word0
41751dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port3_SHIFT	19
41761dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port3_MASK	0x0000001
41771dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_link_status_port3_WORD	word0
41781dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port0_SHIFT	20
41791dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port0_MASK		0x0000001
41801dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port0_WORD		word0
41811dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port1_SHIFT	21
41821dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port1_MASK		0x0000001
41831dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port1_WORD		word0
41841dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port2_SHIFT	22
41851dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port2_MASK		0x0000001
41861dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port2_WORD		word0
41871dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port3_SHIFT	23
41881dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port3_MASK		0x0000001
41891dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_config_port3_WORD		word0
419070f3c073SJames Smart 	uint32_t word1;
419170f3c073SJames Smart #define lpfc_acqe_fc_la_llink_spd_SHIFT		16
419270f3c073SJames Smart #define lpfc_acqe_fc_la_llink_spd_MASK		0x0000FFFF
419370f3c073SJames Smart #define lpfc_acqe_fc_la_llink_spd_WORD		word1
419470f3c073SJames Smart #define lpfc_acqe_fc_la_fault_SHIFT		0
419570f3c073SJames Smart #define lpfc_acqe_fc_la_fault_MASK		0x000000FF
419670f3c073SJames Smart #define lpfc_acqe_fc_la_fault_WORD		word1
41971dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_fault_SHIFT		0
41981dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_fault_MASK		0x0000000F
41991dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_fault_WORD		word1
42001dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_linkmask_SHIFT		4
42011dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_linkmask_MASK		0x000000F
42021dc5ec24SJames Smart #define lpfc_acqe_fc_la_trunk_linkmask_WORD		word1
420370f3c073SJames Smart #define LPFC_FC_LA_FAULT_NONE		0x0
420470f3c073SJames Smart #define LPFC_FC_LA_FAULT_LOCAL		0x1
420570f3c073SJames Smart #define LPFC_FC_LA_FAULT_REMOTE		0x2
420670f3c073SJames Smart 	uint32_t event_tag;
420770f3c073SJames Smart 	uint32_t trailer;
420870f3c073SJames Smart #define LPFC_FC_LA_EVENT_TYPE_FC_LINK		0x1
420970f3c073SJames Smart #define LPFC_FC_LA_EVENT_TYPE_SHARED_LINK	0x2
421070f3c073SJames Smart };
421170f3c073SJames Smart 
42124b8bae08SJames Smart struct lpfc_acqe_misconfigured_event {
42134b8bae08SJames Smart 	struct {
42144b8bae08SJames Smart 	uint32_t word0;
4215448193b5SJames Smart #define lpfc_sli_misconfigured_port0_state_SHIFT	0
4216448193b5SJames Smart #define lpfc_sli_misconfigured_port0_state_MASK		0x000000FF
4217448193b5SJames Smart #define lpfc_sli_misconfigured_port0_state_WORD		word0
4218448193b5SJames Smart #define lpfc_sli_misconfigured_port1_state_SHIFT	8
4219448193b5SJames Smart #define lpfc_sli_misconfigured_port1_state_MASK		0x000000FF
4220448193b5SJames Smart #define lpfc_sli_misconfigured_port1_state_WORD		word0
4221448193b5SJames Smart #define lpfc_sli_misconfigured_port2_state_SHIFT	16
4222448193b5SJames Smart #define lpfc_sli_misconfigured_port2_state_MASK		0x000000FF
4223448193b5SJames Smart #define lpfc_sli_misconfigured_port2_state_WORD		word0
4224448193b5SJames Smart #define lpfc_sli_misconfigured_port3_state_SHIFT	24
4225448193b5SJames Smart #define lpfc_sli_misconfigured_port3_state_MASK		0x000000FF
4226448193b5SJames Smart #define lpfc_sli_misconfigured_port3_state_WORD		word0
4227448193b5SJames Smart 	uint32_t word1;
4228448193b5SJames Smart #define lpfc_sli_misconfigured_port0_op_SHIFT		0
4229448193b5SJames Smart #define lpfc_sli_misconfigured_port0_op_MASK		0x00000001
4230448193b5SJames Smart #define lpfc_sli_misconfigured_port0_op_WORD		word1
4231448193b5SJames Smart #define lpfc_sli_misconfigured_port0_severity_SHIFT	1
4232448193b5SJames Smart #define lpfc_sli_misconfigured_port0_severity_MASK	0x00000003
4233448193b5SJames Smart #define lpfc_sli_misconfigured_port0_severity_WORD	word1
4234448193b5SJames Smart #define lpfc_sli_misconfigured_port1_op_SHIFT		8
4235448193b5SJames Smart #define lpfc_sli_misconfigured_port1_op_MASK		0x00000001
4236448193b5SJames Smart #define lpfc_sli_misconfigured_port1_op_WORD		word1
4237448193b5SJames Smart #define lpfc_sli_misconfigured_port1_severity_SHIFT	9
4238448193b5SJames Smart #define lpfc_sli_misconfigured_port1_severity_MASK	0x00000003
4239448193b5SJames Smart #define lpfc_sli_misconfigured_port1_severity_WORD	word1
4240448193b5SJames Smart #define lpfc_sli_misconfigured_port2_op_SHIFT		16
4241448193b5SJames Smart #define lpfc_sli_misconfigured_port2_op_MASK		0x00000001
4242448193b5SJames Smart #define lpfc_sli_misconfigured_port2_op_WORD		word1
4243448193b5SJames Smart #define lpfc_sli_misconfigured_port2_severity_SHIFT	17
4244448193b5SJames Smart #define lpfc_sli_misconfigured_port2_severity_MASK	0x00000003
4245448193b5SJames Smart #define lpfc_sli_misconfigured_port2_severity_WORD	word1
4246448193b5SJames Smart #define lpfc_sli_misconfigured_port3_op_SHIFT		24
4247448193b5SJames Smart #define lpfc_sli_misconfigured_port3_op_MASK		0x00000001
4248448193b5SJames Smart #define lpfc_sli_misconfigured_port3_op_WORD		word1
4249448193b5SJames Smart #define lpfc_sli_misconfigured_port3_severity_SHIFT	25
4250448193b5SJames Smart #define lpfc_sli_misconfigured_port3_severity_MASK	0x00000003
4251448193b5SJames Smart #define lpfc_sli_misconfigured_port3_severity_WORD	word1
42524b8bae08SJames Smart 	} theEvent;
42534b8bae08SJames Smart #define LPFC_SLI_EVENT_STATUS_VALID			0x00
42544b8bae08SJames Smart #define LPFC_SLI_EVENT_STATUS_NOT_PRESENT	0x01
42554b8bae08SJames Smart #define LPFC_SLI_EVENT_STATUS_WRONG_TYPE	0x02
42564b8bae08SJames Smart #define LPFC_SLI_EVENT_STATUS_UNSUPPORTED	0x03
4257448193b5SJames Smart #define LPFC_SLI_EVENT_STATUS_UNQUALIFIED	0x04
4258448193b5SJames Smart #define LPFC_SLI_EVENT_STATUS_UNCERTIFIED	0x05
42594b8bae08SJames Smart };
42604b8bae08SJames Smart 
42619064aeb2SJames Smart struct lpfc_acqe_cgn_signal {
42629064aeb2SJames Smart 	u32 word0;
42639064aeb2SJames Smart #define lpfc_warn_acqe_SHIFT		0
42649064aeb2SJames Smart #define lpfc_warn_acqe_MASK		0x7FFFFFFF
42659064aeb2SJames Smart #define lpfc_warn_acqe_WORD		word0
42669064aeb2SJames Smart #define lpfc_imm_acqe_SHIFT		31
42679064aeb2SJames Smart #define lpfc_imm_acqe_MASK		0x1
42689064aeb2SJames Smart #define lpfc_imm_acqe_WORD		word0
42699064aeb2SJames Smart 	u32 alarm_cnt;
42709064aeb2SJames Smart 	u32 word2;
42719064aeb2SJames Smart 	u32 trailer;
42729064aeb2SJames Smart };
42739064aeb2SJames Smart 
427470f3c073SJames Smart struct lpfc_acqe_sli {
427570f3c073SJames Smart 	uint32_t event_data1;
427670f3c073SJames Smart 	uint32_t event_data2;
427770f3c073SJames Smart 	uint32_t reserved;
427870f3c073SJames Smart 	uint32_t trailer;
427970f3c073SJames Smart #define LPFC_SLI_EVENT_TYPE_PORT_ERROR		0x1
428070f3c073SJames Smart #define LPFC_SLI_EVENT_TYPE_OVER_TEMP		0x2
428170f3c073SJames Smart #define LPFC_SLI_EVENT_TYPE_NORM_TEMP		0x3
428270f3c073SJames Smart #define LPFC_SLI_EVENT_TYPE_NVLOG_POST		0x4
428370f3c073SJames Smart #define LPFC_SLI_EVENT_TYPE_DIAG_DUMP		0x5
42844b8bae08SJames Smart #define LPFC_SLI_EVENT_TYPE_MISCONFIGURED	0x9
4285946727dcSJames Smart #define LPFC_SLI_EVENT_TYPE_REMOTE_DPORT	0xA
4286daebf93fSJames Smart #define LPFC_SLI_EVENT_TYPE_PORT_PARAMS_CHG	0xE
4287e7d85952SJames Smart #define LPFC_SLI_EVENT_TYPE_MISCONF_FAWWN	0xF
4288d11ed16dSJames Smart #define LPFC_SLI_EVENT_TYPE_EEPROM_FAILURE	0x10
42899064aeb2SJames Smart #define LPFC_SLI_EVENT_TYPE_CGN_SIGNAL		0x11
429070f3c073SJames Smart };
429170f3c073SJames Smart 
4292da0436e9SJames Smart /*
4293da0436e9SJames Smart  * Define the bootstrap mailbox (bmbx) region used to communicate
4294da0436e9SJames Smart  * mailbox command between the host and port. The mailbox consists
4295da0436e9SJames Smart  * of a payload area of 256 bytes and a completion queue of length
4296da0436e9SJames Smart  * 16 bytes.
4297da0436e9SJames Smart  */
4298da0436e9SJames Smart struct lpfc_bmbx_create {
4299da0436e9SJames Smart 	struct lpfc_mqe mqe;
4300da0436e9SJames Smart 	struct lpfc_mcqe mcqe;
4301da0436e9SJames Smart };
4302da0436e9SJames Smart 
4303da0436e9SJames Smart #define SGL_ALIGN_SZ 64
4304da0436e9SJames Smart #define SGL_PAGE_SIZE 4096
4305da0436e9SJames Smart /* align SGL addr on a size boundary - adjust address up */
43066d368e53SJames Smart #define NO_XRI  0xffff
43075ffc266eSJames Smart 
4308da0436e9SJames Smart struct wqe_common {
4309da0436e9SJames Smart 	uint32_t word6;
43106669f9bbSJames Smart #define wqe_xri_tag_SHIFT     0
43116669f9bbSJames Smart #define wqe_xri_tag_MASK      0x0000FFFF
43126669f9bbSJames Smart #define wqe_xri_tag_WORD      word6
4313da0436e9SJames Smart #define wqe_ctxt_tag_SHIFT    16
4314da0436e9SJames Smart #define wqe_ctxt_tag_MASK     0x0000FFFF
4315da0436e9SJames Smart #define wqe_ctxt_tag_WORD     word6
4316da0436e9SJames Smart 	uint32_t word7;
4317f9bb2da1SJames Smart #define wqe_dif_SHIFT         0
4318f9bb2da1SJames Smart #define wqe_dif_MASK          0x00000003
4319f9bb2da1SJames Smart #define wqe_dif_WORD          word7
43208012cc38SJames Smart #define LPFC_WQE_DIF_PASSTHRU	1
43218012cc38SJames Smart #define LPFC_WQE_DIF_STRIP	2
43228012cc38SJames Smart #define LPFC_WQE_DIF_INSERT	3
4323da0436e9SJames Smart #define wqe_ct_SHIFT          2
4324da0436e9SJames Smart #define wqe_ct_MASK           0x00000003
4325da0436e9SJames Smart #define wqe_ct_WORD           word7
4326da0436e9SJames Smart #define wqe_status_SHIFT      4
4327da0436e9SJames Smart #define wqe_status_MASK       0x0000000f
4328da0436e9SJames Smart #define wqe_status_WORD       word7
4329da0436e9SJames Smart #define wqe_cmnd_SHIFT        8
4330da0436e9SJames Smart #define wqe_cmnd_MASK         0x000000ff
4331da0436e9SJames Smart #define wqe_cmnd_WORD         word7
4332da0436e9SJames Smart #define wqe_class_SHIFT       16
4333da0436e9SJames Smart #define wqe_class_MASK        0x00000007
4334da0436e9SJames Smart #define wqe_class_WORD        word7
4335f9bb2da1SJames Smart #define wqe_ar_SHIFT          19
4336f9bb2da1SJames Smart #define wqe_ar_MASK           0x00000001
4337f9bb2da1SJames Smart #define wqe_ar_WORD           word7
4338f9bb2da1SJames Smart #define wqe_ag_SHIFT          wqe_ar_SHIFT
4339f9bb2da1SJames Smart #define wqe_ag_MASK           wqe_ar_MASK
4340f9bb2da1SJames Smart #define wqe_ag_WORD           wqe_ar_WORD
4341da0436e9SJames Smart #define wqe_pu_SHIFT          20
4342da0436e9SJames Smart #define wqe_pu_MASK           0x00000003
4343da0436e9SJames Smart #define wqe_pu_WORD           word7
4344da0436e9SJames Smart #define wqe_erp_SHIFT         22
4345da0436e9SJames Smart #define wqe_erp_MASK          0x00000001
4346da0436e9SJames Smart #define wqe_erp_WORD          word7
4347f9bb2da1SJames Smart #define wqe_conf_SHIFT        wqe_erp_SHIFT
4348f9bb2da1SJames Smart #define wqe_conf_MASK         wqe_erp_MASK
4349f9bb2da1SJames Smart #define wqe_conf_WORD         wqe_erp_WORD
4350da0436e9SJames Smart #define wqe_lnk_SHIFT         23
4351da0436e9SJames Smart #define wqe_lnk_MASK          0x00000001
4352da0436e9SJames Smart #define wqe_lnk_WORD          word7
4353da0436e9SJames Smart #define wqe_tmo_SHIFT         24
4354da0436e9SJames Smart #define wqe_tmo_MASK          0x000000ff
4355da0436e9SJames Smart #define wqe_tmo_WORD          word7
4356da0436e9SJames Smart 	uint32_t abort_tag; /* word 8 in WQE */
4357da0436e9SJames Smart 	uint32_t word9;
4358da0436e9SJames Smart #define wqe_reqtag_SHIFT      0
4359da0436e9SJames Smart #define wqe_reqtag_MASK       0x0000FFFF
4360da0436e9SJames Smart #define wqe_reqtag_WORD       word9
4361c31098ceSJames Smart #define wqe_temp_rpi_SHIFT    16
4362c31098ceSJames Smart #define wqe_temp_rpi_MASK     0x0000FFFF
4363c31098ceSJames Smart #define wqe_temp_rpi_WORD     word9
4364da0436e9SJames Smart #define wqe_rcvoxid_SHIFT     16
4365da0436e9SJames Smart #define wqe_rcvoxid_MASK      0x0000FFFF
4366da0436e9SJames Smart #define wqe_rcvoxid_WORD      word9
4367e62245d9SJames Smart #define wqe_sof_SHIFT         24
4368e62245d9SJames Smart #define wqe_sof_MASK          0x000000FF
4369e62245d9SJames Smart #define wqe_sof_WORD          word9
4370e62245d9SJames Smart #define wqe_eof_SHIFT         16
4371e62245d9SJames Smart #define wqe_eof_MASK          0x000000FF
4372e62245d9SJames Smart #define wqe_eof_WORD          word9
4373da0436e9SJames Smart 	uint32_t word10;
4374f0d9bcccSJames Smart #define wqe_ebde_cnt_SHIFT    0
43752fcee4bfSJames Smart #define wqe_ebde_cnt_MASK     0x0000000f
4376f0d9bcccSJames Smart #define wqe_ebde_cnt_WORD     word10
4377b101eb27SJames Smart #define wqe_xchg_SHIFT        4
4378b101eb27SJames Smart #define wqe_xchg_MASK         0x00000001
4379b101eb27SJames Smart #define wqe_xchg_WORD         word10
4380b101eb27SJames Smart #define LPFC_SCSI_XCHG	      0x0
4381b101eb27SJames Smart #define LPFC_NVME_XCHG	      0x1
43825e633302SGaurav Srivastava #define wqe_appid_SHIFT       5
43835e633302SGaurav Srivastava #define wqe_appid_MASK        0x00000001
43845e633302SGaurav Srivastava #define wqe_appid_WORD        word10
43851ba981fdSJames Smart #define wqe_oas_SHIFT         6
43861ba981fdSJames Smart #define wqe_oas_MASK          0x00000001
43871ba981fdSJames Smart #define wqe_oas_WORD          word10
4388f0d9bcccSJames Smart #define wqe_lenloc_SHIFT      7
4389f0d9bcccSJames Smart #define wqe_lenloc_MASK       0x00000003
4390f0d9bcccSJames Smart #define wqe_lenloc_WORD       word10
4391f0d9bcccSJames Smart #define LPFC_WQE_LENLOC_NONE		0
4392f0d9bcccSJames Smart #define LPFC_WQE_LENLOC_WORD3	1
4393f0d9bcccSJames Smart #define LPFC_WQE_LENLOC_WORD12	2
4394f0d9bcccSJames Smart #define LPFC_WQE_LENLOC_WORD4	3
4395f0d9bcccSJames Smart #define wqe_qosd_SHIFT        9
4396f0d9bcccSJames Smart #define wqe_qosd_MASK         0x00000001
4397f0d9bcccSJames Smart #define wqe_qosd_WORD         word10
4398f0d9bcccSJames Smart #define wqe_xbl_SHIFT         11
4399f0d9bcccSJames Smart #define wqe_xbl_MASK          0x00000001
4400f0d9bcccSJames Smart #define wqe_xbl_WORD          word10
4401f0d9bcccSJames Smart #define wqe_iod_SHIFT         13
4402f0d9bcccSJames Smart #define wqe_iod_MASK          0x00000001
4403f0d9bcccSJames Smart #define wqe_iod_WORD          word10
44045fd11085SJames Smart #define LPFC_WQE_IOD_NONE	0
4405f0d9bcccSJames Smart #define LPFC_WQE_IOD_WRITE	0
4406f0d9bcccSJames Smart #define LPFC_WQE_IOD_READ	1
4407f0d9bcccSJames Smart #define wqe_dbde_SHIFT        14
4408f0d9bcccSJames Smart #define wqe_dbde_MASK         0x00000001
4409f0d9bcccSJames Smart #define wqe_dbde_WORD         word10
4410f0d9bcccSJames Smart #define wqe_wqes_SHIFT        15
4411f0d9bcccSJames Smart #define wqe_wqes_MASK         0x00000001
4412f0d9bcccSJames Smart #define wqe_wqes_WORD         word10
4413fedd3b7bSJames Smart /* Note that this field overlaps above fields */
4414fedd3b7bSJames Smart #define wqe_wqid_SHIFT        1
44159589b062SJames Smart #define wqe_wqid_MASK         0x00007fff
4416fedd3b7bSJames Smart #define wqe_wqid_WORD         word10
4417da0436e9SJames Smart #define wqe_pri_SHIFT         16
4418da0436e9SJames Smart #define wqe_pri_MASK          0x00000007
4419da0436e9SJames Smart #define wqe_pri_WORD          word10
4420da0436e9SJames Smart #define wqe_pv_SHIFT          19
4421da0436e9SJames Smart #define wqe_pv_MASK           0x00000001
4422da0436e9SJames Smart #define wqe_pv_WORD           word10
4423da0436e9SJames Smart #define wqe_xc_SHIFT          21
4424da0436e9SJames Smart #define wqe_xc_MASK           0x00000001
4425da0436e9SJames Smart #define wqe_xc_WORD           word10
4426f9bb2da1SJames Smart #define wqe_sr_SHIFT          22
4427f9bb2da1SJames Smart #define wqe_sr_MASK           0x00000001
4428f9bb2da1SJames Smart #define wqe_sr_WORD           word10
4429da0436e9SJames Smart #define wqe_ccpe_SHIFT        23
4430da0436e9SJames Smart #define wqe_ccpe_MASK         0x00000001
4431da0436e9SJames Smart #define wqe_ccpe_WORD         word10
4432da0436e9SJames Smart #define wqe_ccp_SHIFT         24
4433da0436e9SJames Smart #define wqe_ccp_MASK          0x000000ff
4434da0436e9SJames Smart #define wqe_ccp_WORD          word10
4435da0436e9SJames Smart 	uint32_t word11;
4436da0436e9SJames Smart #define wqe_cmd_type_SHIFT    0
4437da0436e9SJames Smart #define wqe_cmd_type_MASK     0x0000000f
4438da0436e9SJames Smart #define wqe_cmd_type_WORD     word11
4439f0d9bcccSJames Smart #define wqe_els_id_SHIFT      4
4440f0d9bcccSJames Smart #define wqe_els_id_MASK       0x00000003
4441f0d9bcccSJames Smart #define wqe_els_id_WORD       word11
4442f0d9bcccSJames Smart #define LPFC_ELS_ID_FLOGI	3
4443f0d9bcccSJames Smart #define LPFC_ELS_ID_FDISC	2
4444f0d9bcccSJames Smart #define LPFC_ELS_ID_LOGO	1
4445f0d9bcccSJames Smart #define LPFC_ELS_ID_DEFAULT	0
4446f358dd0cSJames Smart #define wqe_irsp_SHIFT        4
4447f358dd0cSJames Smart #define wqe_irsp_MASK         0x00000001
4448f358dd0cSJames Smart #define wqe_irsp_WORD         word11
44490bc2b7c5SJames Smart #define wqe_pbde_SHIFT        5
44500bc2b7c5SJames Smart #define wqe_pbde_MASK         0x00000001
44510bc2b7c5SJames Smart #define wqe_pbde_WORD         word11
4452f358dd0cSJames Smart #define wqe_sup_SHIFT         6
4453f358dd0cSJames Smart #define wqe_sup_MASK          0x00000001
4454f358dd0cSJames Smart #define wqe_sup_WORD          word11
4455da0436e9SJames Smart #define wqe_wqec_SHIFT        7
4456da0436e9SJames Smart #define wqe_wqec_MASK         0x00000001
4457da0436e9SJames Smart #define wqe_wqec_WORD         word11
4458f358dd0cSJames Smart #define wqe_irsplen_SHIFT     8
4459f358dd0cSJames Smart #define wqe_irsplen_MASK      0x0000000f
4460f358dd0cSJames Smart #define wqe_irsplen_WORD      word11
4461da0436e9SJames Smart #define wqe_cqid_SHIFT        16
44626669f9bbSJames Smart #define wqe_cqid_MASK         0x0000ffff
4463da0436e9SJames Smart #define wqe_cqid_WORD         word11
4464f0d9bcccSJames Smart #define LPFC_WQE_CQ_ID_DEFAULT	0xffff
4465da0436e9SJames Smart };
4466da0436e9SJames Smart 
4467da0436e9SJames Smart struct wqe_did {
4468da0436e9SJames Smart 	uint32_t word5;
4469da0436e9SJames Smart #define wqe_els_did_SHIFT         0
4470da0436e9SJames Smart #define wqe_els_did_MASK          0x00FFFFFF
4471da0436e9SJames Smart #define wqe_els_did_WORD          word5
44726669f9bbSJames Smart #define wqe_xmit_bls_pt_SHIFT         28
44736669f9bbSJames Smart #define wqe_xmit_bls_pt_MASK          0x00000003
44746669f9bbSJames Smart #define wqe_xmit_bls_pt_WORD          word5
4475da0436e9SJames Smart #define wqe_xmit_bls_ar_SHIFT         30
4476da0436e9SJames Smart #define wqe_xmit_bls_ar_MASK          0x00000001
4477da0436e9SJames Smart #define wqe_xmit_bls_ar_WORD          word5
4478da0436e9SJames Smart #define wqe_xmit_bls_xo_SHIFT         31
4479da0436e9SJames Smart #define wqe_xmit_bls_xo_MASK          0x00000001
4480da0436e9SJames Smart #define wqe_xmit_bls_xo_WORD          word5
4481da0436e9SJames Smart };
4482da0436e9SJames Smart 
4483f0d9bcccSJames Smart struct lpfc_wqe_generic{
4484f0d9bcccSJames Smart 	struct ulp_bde64 bde;
4485f0d9bcccSJames Smart 	uint32_t word3;
4486f0d9bcccSJames Smart 	uint32_t word4;
4487f0d9bcccSJames Smart 	uint32_t word5;
4488f0d9bcccSJames Smart 	struct wqe_common wqe_com;
4489f0d9bcccSJames Smart 	uint32_t payload[4];
4490f0d9bcccSJames Smart };
4491f0d9bcccSJames Smart 
4492da0436e9SJames Smart struct els_request64_wqe {
4493da0436e9SJames Smart 	struct ulp_bde64 bde;
4494da0436e9SJames Smart 	uint32_t payload_len;
4495da0436e9SJames Smart 	uint32_t word4;
4496da0436e9SJames Smart #define els_req64_sid_SHIFT         0
4497da0436e9SJames Smart #define els_req64_sid_MASK          0x00FFFFFF
4498da0436e9SJames Smart #define els_req64_sid_WORD          word4
4499da0436e9SJames Smart #define els_req64_sp_SHIFT          24
4500da0436e9SJames Smart #define els_req64_sp_MASK           0x00000001
4501da0436e9SJames Smart #define els_req64_sp_WORD           word4
4502da0436e9SJames Smart #define els_req64_vf_SHIFT          25
4503da0436e9SJames Smart #define els_req64_vf_MASK           0x00000001
4504da0436e9SJames Smart #define els_req64_vf_WORD           word4
4505da0436e9SJames Smart 	struct wqe_did	wqe_dest;
4506da0436e9SJames Smart 	struct wqe_common wqe_com; /* words 6-11 */
4507da0436e9SJames Smart 	uint32_t word12;
4508da0436e9SJames Smart #define els_req64_vfid_SHIFT        1
4509da0436e9SJames Smart #define els_req64_vfid_MASK         0x00000FFF
4510da0436e9SJames Smart #define els_req64_vfid_WORD         word12
4511da0436e9SJames Smart #define els_req64_pri_SHIFT         13
4512da0436e9SJames Smart #define els_req64_pri_MASK          0x00000007
4513da0436e9SJames Smart #define els_req64_pri_WORD          word12
4514da0436e9SJames Smart 	uint32_t word13;
4515da0436e9SJames Smart #define els_req64_hopcnt_SHIFT      24
4516da0436e9SJames Smart #define els_req64_hopcnt_MASK       0x000000ff
4517da0436e9SJames Smart #define els_req64_hopcnt_WORD       word13
4518af22741cSJames Smart 	uint32_t word14;
4519af22741cSJames Smart 	uint32_t max_response_payload_len;
4520da0436e9SJames Smart };
4521da0436e9SJames Smart 
4522da0436e9SJames Smart struct xmit_els_rsp64_wqe {
4523da0436e9SJames Smart 	struct ulp_bde64 bde;
4524f0d9bcccSJames Smart 	uint32_t response_payload_len;
4525939723a4SJames Smart 	uint32_t word4;
4526939723a4SJames Smart #define els_rsp64_sid_SHIFT         0
4527939723a4SJames Smart #define els_rsp64_sid_MASK          0x00FFFFFF
4528939723a4SJames Smart #define els_rsp64_sid_WORD          word4
4529939723a4SJames Smart #define els_rsp64_sp_SHIFT          24
4530939723a4SJames Smart #define els_rsp64_sp_MASK           0x00000001
4531939723a4SJames Smart #define els_rsp64_sp_WORD           word4
4532da0436e9SJames Smart 	struct wqe_did wqe_dest;
4533da0436e9SJames Smart 	struct wqe_common wqe_com; /* words 6-11 */
4534c31098ceSJames Smart 	uint32_t word12;
4535c31098ceSJames Smart #define wqe_rsp_temp_rpi_SHIFT    0
4536c31098ceSJames Smart #define wqe_rsp_temp_rpi_MASK     0x0000FFFF
4537c31098ceSJames Smart #define wqe_rsp_temp_rpi_WORD     word12
4538c31098ceSJames Smart 	uint32_t rsvd_13_15[3];
4539da0436e9SJames Smart };
4540da0436e9SJames Smart 
4541da0436e9SJames Smart struct xmit_bls_rsp64_wqe {
4542da0436e9SJames Smart 	uint32_t payload0;
45436669f9bbSJames Smart /* Payload0 for BA_ACC */
45446669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_SHIFT        16
45456669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_MASK         0x000000ff
45466669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_WORD         payload0
45476669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_vald_SHIFT   24
45486669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_vald_MASK    0x000000ff
45496669f9bbSJames Smart #define xmit_bls_rsp64_acc_seq_id_vald_WORD    payload0
45506669f9bbSJames Smart /* Payload0 for BA_RJT */
45516669f9bbSJames Smart #define xmit_bls_rsp64_rjt_vspec_SHIFT   0
45526669f9bbSJames Smart #define xmit_bls_rsp64_rjt_vspec_MASK    0x000000ff
45536669f9bbSJames Smart #define xmit_bls_rsp64_rjt_vspec_WORD    payload0
45546669f9bbSJames Smart #define xmit_bls_rsp64_rjt_expc_SHIFT    8
45556669f9bbSJames Smart #define xmit_bls_rsp64_rjt_expc_MASK     0x000000ff
45566669f9bbSJames Smart #define xmit_bls_rsp64_rjt_expc_WORD     payload0
45576669f9bbSJames Smart #define xmit_bls_rsp64_rjt_rsnc_SHIFT    16
45586669f9bbSJames Smart #define xmit_bls_rsp64_rjt_rsnc_MASK     0x000000ff
45596669f9bbSJames Smart #define xmit_bls_rsp64_rjt_rsnc_WORD     payload0
4560da0436e9SJames Smart 	uint32_t word1;
4561da0436e9SJames Smart #define xmit_bls_rsp64_rxid_SHIFT  0
4562da0436e9SJames Smart #define xmit_bls_rsp64_rxid_MASK   0x0000ffff
4563da0436e9SJames Smart #define xmit_bls_rsp64_rxid_WORD   word1
4564da0436e9SJames Smart #define xmit_bls_rsp64_oxid_SHIFT  16
4565da0436e9SJames Smart #define xmit_bls_rsp64_oxid_MASK   0x0000ffff
4566da0436e9SJames Smart #define xmit_bls_rsp64_oxid_WORD   word1
4567da0436e9SJames Smart 	uint32_t word2;
45686669f9bbSJames Smart #define xmit_bls_rsp64_seqcnthi_SHIFT  0
4569da0436e9SJames Smart #define xmit_bls_rsp64_seqcnthi_MASK   0x0000ffff
4570da0436e9SJames Smart #define xmit_bls_rsp64_seqcnthi_WORD   word2
45716669f9bbSJames Smart #define xmit_bls_rsp64_seqcntlo_SHIFT  16
45726669f9bbSJames Smart #define xmit_bls_rsp64_seqcntlo_MASK   0x0000ffff
45736669f9bbSJames Smart #define xmit_bls_rsp64_seqcntlo_WORD   word2
4574da0436e9SJames Smart 	uint32_t rsrvd3;
4575da0436e9SJames Smart 	uint32_t rsrvd4;
4576da0436e9SJames Smart 	struct wqe_did	wqe_dest;
4577da0436e9SJames Smart 	struct wqe_common wqe_com; /* words 6-11 */
45786b5151fdSJames Smart 	uint32_t word12;
45796b5151fdSJames Smart #define xmit_bls_rsp64_temprpi_SHIFT  0
45806b5151fdSJames Smart #define xmit_bls_rsp64_temprpi_MASK   0x0000ffff
45816b5151fdSJames Smart #define xmit_bls_rsp64_temprpi_WORD   word12
45826b5151fdSJames Smart 	uint32_t rsvd_13_15[3];
4583da0436e9SJames Smart };
45846669f9bbSJames Smart 
4585da0436e9SJames Smart struct wqe_rctl_dfctl {
4586da0436e9SJames Smart 	uint32_t word5;
4587da0436e9SJames Smart #define wqe_si_SHIFT 2
4588da0436e9SJames Smart #define wqe_si_MASK  0x000000001
4589da0436e9SJames Smart #define wqe_si_WORD  word5
4590da0436e9SJames Smart #define wqe_la_SHIFT 3
4591da0436e9SJames Smart #define wqe_la_MASK  0x000000001
4592da0436e9SJames Smart #define wqe_la_WORD  word5
45931b51197dSJames Smart #define wqe_xo_SHIFT	6
45941b51197dSJames Smart #define wqe_xo_MASK	0x000000001
45951b51197dSJames Smart #define wqe_xo_WORD	word5
4596da0436e9SJames Smart #define wqe_ls_SHIFT 7
4597da0436e9SJames Smart #define wqe_ls_MASK  0x000000001
4598da0436e9SJames Smart #define wqe_ls_WORD  word5
4599da0436e9SJames Smart #define wqe_dfctl_SHIFT 8
4600da0436e9SJames Smart #define wqe_dfctl_MASK  0x0000000ff
4601da0436e9SJames Smart #define wqe_dfctl_WORD  word5
4602da0436e9SJames Smart #define wqe_type_SHIFT 16
4603da0436e9SJames Smart #define wqe_type_MASK  0x0000000ff
4604da0436e9SJames Smart #define wqe_type_WORD  word5
4605da0436e9SJames Smart #define wqe_rctl_SHIFT 24
4606da0436e9SJames Smart #define wqe_rctl_MASK  0x0000000ff
4607da0436e9SJames Smart #define wqe_rctl_WORD  word5
4608da0436e9SJames Smart };
4609da0436e9SJames Smart 
4610da0436e9SJames Smart struct xmit_seq64_wqe {
4611da0436e9SJames Smart 	struct ulp_bde64 bde;
4612f0d9bcccSJames Smart 	uint32_t rsvd3;
4613da0436e9SJames Smart 	uint32_t relative_offset;
4614da0436e9SJames Smart 	struct wqe_rctl_dfctl wge_ctl;
4615da0436e9SJames Smart 	struct wqe_common wqe_com; /* words 6-11 */
4616da0436e9SJames Smart 	uint32_t xmit_len;
4617da0436e9SJames Smart 	uint32_t rsvd_12_15[3];
4618da0436e9SJames Smart };
4619da0436e9SJames Smart struct xmit_bcast64_wqe {
4620da0436e9SJames Smart 	struct ulp_bde64 bde;
4621f0d9bcccSJames Smart 	uint32_t seq_payload_len;
4622da0436e9SJames Smart 	uint32_t rsvd4;
4623da0436e9SJames Smart 	struct wqe_rctl_dfctl wge_ctl; /* word 5 */
4624da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
4625da0436e9SJames Smart 	uint32_t rsvd_12_15[4];
4626da0436e9SJames Smart };
4627da0436e9SJames Smart 
4628da0436e9SJames Smart struct gen_req64_wqe {
4629da0436e9SJames Smart 	struct ulp_bde64 bde;
4630f0d9bcccSJames Smart 	uint32_t request_payload_len;
4631f0d9bcccSJames Smart 	uint32_t relative_offset;
4632da0436e9SJames Smart 	struct wqe_rctl_dfctl wge_ctl; /* word 5 */
4633da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
4634af22741cSJames Smart 	uint32_t rsvd_12_14[3];
4635af22741cSJames Smart 	uint32_t max_response_payload_len;
4636da0436e9SJames Smart };
4637da0436e9SJames Smart 
4638a0f2d3efSJames Smart /* Define NVME PRLI request to fabric. NVME is a
4639a0f2d3efSJames Smart  * fabric-only protocol.
4640a0f2d3efSJames Smart  * Updated to red-lined v1.08 on Sept 16, 2016
4641a0f2d3efSJames Smart  */
4642a0f2d3efSJames Smart struct lpfc_nvme_prli {
4643a0f2d3efSJames Smart 	uint32_t word1;
4644a0f2d3efSJames Smart 	/* The Response Code is defined in the FCP PRLI lpfc_hw.h */
4645a0f2d3efSJames Smart #define prli_acc_rsp_code_SHIFT         8
4646a0f2d3efSJames Smart #define prli_acc_rsp_code_MASK          0x0000000f
4647a0f2d3efSJames Smart #define prli_acc_rsp_code_WORD          word1
4648a0f2d3efSJames Smart #define prli_estabImagePair_SHIFT       13
4649a0f2d3efSJames Smart #define prli_estabImagePair_MASK        0x00000001
4650a0f2d3efSJames Smart #define prli_estabImagePair_WORD        word1
4651a0f2d3efSJames Smart #define prli_type_code_ext_SHIFT        16
4652a0f2d3efSJames Smart #define prli_type_code_ext_MASK         0x000000ff
4653a0f2d3efSJames Smart #define prli_type_code_ext_WORD         word1
4654a0f2d3efSJames Smart #define prli_type_code_SHIFT            24
4655a0f2d3efSJames Smart #define prli_type_code_MASK             0x000000ff
4656a0f2d3efSJames Smart #define prli_type_code_WORD             word1
4657a0f2d3efSJames Smart 	uint32_t word_rsvd2;
4658a0f2d3efSJames Smart 	uint32_t word_rsvd3;
46590d8af096SJames Smart 
4660a0f2d3efSJames Smart 	uint32_t word4;
4661a0f2d3efSJames Smart #define prli_fba_SHIFT                  0
4662a0f2d3efSJames Smart #define prli_fba_MASK                   0x00000001
4663a0f2d3efSJames Smart #define prli_fba_WORD                   word4
4664a0f2d3efSJames Smart #define prli_disc_SHIFT                 3
4665a0f2d3efSJames Smart #define prli_disc_MASK                  0x00000001
4666a0f2d3efSJames Smart #define prli_disc_WORD                  word4
4667a0f2d3efSJames Smart #define prli_tgt_SHIFT                  4
4668a0f2d3efSJames Smart #define prli_tgt_MASK                   0x00000001
4669a0f2d3efSJames Smart #define prli_tgt_WORD                   word4
4670a0f2d3efSJames Smart #define prli_init_SHIFT                 5
4671a0f2d3efSJames Smart #define prli_init_MASK                  0x00000001
4672a0f2d3efSJames Smart #define prli_init_WORD                  word4
4673a5ff0681SJames Smart #define prli_conf_SHIFT                 7
4674a5ff0681SJames Smart #define prli_conf_MASK                  0x00000001
4675a5ff0681SJames Smart #define prli_conf_WORD                  word4
46760d8af096SJames Smart #define prli_nsler_SHIFT		8
46770d8af096SJames Smart #define prli_nsler_MASK			0x00000001
46780d8af096SJames Smart #define prli_nsler_WORD			word4
4679a0f2d3efSJames Smart 	uint32_t word5;
4680a0f2d3efSJames Smart #define prli_fb_sz_SHIFT                0
4681a0f2d3efSJames Smart #define prli_fb_sz_MASK                 0x0000ffff
4682a0f2d3efSJames Smart #define prli_fb_sz_WORD                 word5
46832d7dbc4cSJames Smart #define LPFC_NVMET_FB_SZ_MAX  65536   /* Driver target mode only. */
4684a0f2d3efSJames Smart };
4685a0f2d3efSJames Smart 
4686da0436e9SJames Smart struct create_xri_wqe {
4687da0436e9SJames Smart 	uint32_t rsrvd[5];           /* words 0-4 */
4688da0436e9SJames Smart 	struct wqe_did	wqe_dest;  /* word 5 */
4689da0436e9SJames Smart 	struct wqe_common wqe_com; /* words 6-11 */
4690da0436e9SJames Smart 	uint32_t rsvd_12_15[4];         /* word 12-15 */
4691da0436e9SJames Smart };
4692da0436e9SJames Smart 
469351f8e43eSJames Smart #define INHIBIT_ABORT 1
4694da0436e9SJames Smart #define T_REQUEST_TAG 3
4695da0436e9SJames Smart #define T_XRI_TAG 1
4696da0436e9SJames Smart 
4697daebf93fSJames Smart struct cmf_sync_wqe {
4698daebf93fSJames Smart 	uint32_t rsrvd[3];
4699daebf93fSJames Smart 	uint32_t word3;
4700daebf93fSJames Smart #define	cmf_sync_interval_SHIFT	0
4701daebf93fSJames Smart #define	cmf_sync_interval_MASK	0x00000ffff
4702daebf93fSJames Smart #define	cmf_sync_interval_WORD	word3
4703daebf93fSJames Smart #define	cmf_sync_afpin_SHIFT	16
4704daebf93fSJames Smart #define	cmf_sync_afpin_MASK	0x000000001
4705daebf93fSJames Smart #define	cmf_sync_afpin_WORD	word3
4706daebf93fSJames Smart #define	cmf_sync_asig_SHIFT	17
4707daebf93fSJames Smart #define	cmf_sync_asig_MASK	0x000000001
4708daebf93fSJames Smart #define	cmf_sync_asig_WORD	word3
4709daebf93fSJames Smart #define	cmf_sync_op_SHIFT	20
4710daebf93fSJames Smart #define	cmf_sync_op_MASK	0x00000000f
4711daebf93fSJames Smart #define	cmf_sync_op_WORD	word3
4712daebf93fSJames Smart #define	cmf_sync_ver_SHIFT	24
4713daebf93fSJames Smart #define	cmf_sync_ver_MASK	0x0000000ff
4714daebf93fSJames Smart #define	cmf_sync_ver_WORD	word3
4715daebf93fSJames Smart #define LPFC_CMF_SYNC_VER	1
4716daebf93fSJames Smart 	uint32_t event_tag;
4717daebf93fSJames Smart 	uint32_t word5;
4718daebf93fSJames Smart #define	cmf_sync_wsigmax_SHIFT	0
4719daebf93fSJames Smart #define	cmf_sync_wsigmax_MASK	0x00000ffff
4720daebf93fSJames Smart #define	cmf_sync_wsigmax_WORD	word5
4721daebf93fSJames Smart #define	cmf_sync_wsigcnt_SHIFT	16
4722daebf93fSJames Smart #define	cmf_sync_wsigcnt_MASK	0x00000ffff
4723daebf93fSJames Smart #define	cmf_sync_wsigcnt_WORD	word5
4724daebf93fSJames Smart 	uint32_t word6;
4725daebf93fSJames Smart 	uint32_t word7;
4726daebf93fSJames Smart #define	cmf_sync_cmnd_SHIFT	8
4727daebf93fSJames Smart #define	cmf_sync_cmnd_MASK	0x0000000ff
4728daebf93fSJames Smart #define	cmf_sync_cmnd_WORD	word7
4729daebf93fSJames Smart 	uint32_t word8;
4730daebf93fSJames Smart 	uint32_t word9;
4731daebf93fSJames Smart #define	cmf_sync_reqtag_SHIFT	0
4732daebf93fSJames Smart #define	cmf_sync_reqtag_MASK	0x00000ffff
4733daebf93fSJames Smart #define	cmf_sync_reqtag_WORD	word9
4734daebf93fSJames Smart #define	cmf_sync_wfpinmax_SHIFT	16
4735daebf93fSJames Smart #define	cmf_sync_wfpinmax_MASK	0x0000000ff
4736daebf93fSJames Smart #define	cmf_sync_wfpinmax_WORD	word9
4737daebf93fSJames Smart #define	cmf_sync_wfpincnt_SHIFT	24
4738daebf93fSJames Smart #define	cmf_sync_wfpincnt_MASK	0x0000000ff
4739daebf93fSJames Smart #define	cmf_sync_wfpincnt_WORD	word9
4740daebf93fSJames Smart 	uint32_t word10;
4741daebf93fSJames Smart #define cmf_sync_qosd_SHIFT	9
4742daebf93fSJames Smart #define cmf_sync_qosd_MASK	0x00000001
4743daebf93fSJames Smart #define cmf_sync_qosd_WORD	word10
4744daebf93fSJames Smart 	uint32_t word11;
4745daebf93fSJames Smart #define cmf_sync_cmd_type_SHIFT	0
4746daebf93fSJames Smart #define cmf_sync_cmd_type_MASK	0x0000000f
4747daebf93fSJames Smart #define cmf_sync_cmd_type_WORD	word11
4748daebf93fSJames Smart #define cmf_sync_wqec_SHIFT	7
4749daebf93fSJames Smart #define cmf_sync_wqec_MASK	0x00000001
4750daebf93fSJames Smart #define cmf_sync_wqec_WORD	word11
4751daebf93fSJames Smart #define cmf_sync_cqid_SHIFT	16
4752daebf93fSJames Smart #define cmf_sync_cqid_MASK	0x0000ffff
4753daebf93fSJames Smart #define cmf_sync_cqid_WORD	word11
4754daebf93fSJames Smart 	uint32_t read_bytes;
4755daebf93fSJames Smart 	uint32_t word13;
4756daebf93fSJames Smart 	uint32_t word14;
4757daebf93fSJames Smart 	uint32_t word15;
4758daebf93fSJames Smart };
4759daebf93fSJames Smart 
4760da0436e9SJames Smart struct abort_cmd_wqe {
4761da0436e9SJames Smart 	uint32_t rsrvd[3];
4762da0436e9SJames Smart 	uint32_t word3;
4763da0436e9SJames Smart #define	abort_cmd_ia_SHIFT  0
4764da0436e9SJames Smart #define	abort_cmd_ia_MASK  0x000000001
4765da0436e9SJames Smart #define	abort_cmd_ia_WORD  word3
4766da0436e9SJames Smart #define	abort_cmd_criteria_SHIFT  8
4767da0436e9SJames Smart #define	abort_cmd_criteria_MASK  0x0000000ff
4768da0436e9SJames Smart #define	abort_cmd_criteria_WORD  word3
4769da0436e9SJames Smart 	uint32_t rsrvd4;
4770da0436e9SJames Smart 	uint32_t rsrvd5;
4771da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
4772da0436e9SJames Smart 	uint32_t rsvd_12_15[4];         /* word 12-15 */
4773da0436e9SJames Smart };
4774da0436e9SJames Smart 
4775da0436e9SJames Smart struct fcp_iwrite64_wqe {
4776da0436e9SJames Smart 	struct ulp_bde64 bde;
47770ba4b219SJames Smart 	uint32_t word3;
47780ba4b219SJames Smart #define	cmd_buff_len_SHIFT  16
47790ba4b219SJames Smart #define	cmd_buff_len_MASK  0x00000ffff
47800ba4b219SJames Smart #define	cmd_buff_len_WORD  word3
47810ba4b219SJames Smart #define payload_offset_len_SHIFT 0
47820ba4b219SJames Smart #define payload_offset_len_MASK 0x0000ffff
47830ba4b219SJames Smart #define payload_offset_len_WORD word3
4784da0436e9SJames Smart 	uint32_t total_xfer_len;
4785da0436e9SJames Smart 	uint32_t initial_xfer_len;
4786da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
4787fedd3b7bSJames Smart 	uint32_t rsrvd12;
4788fedd3b7bSJames Smart 	struct ulp_bde64 ph_bde;       /* words 13-15 */
4789da0436e9SJames Smart };
4790da0436e9SJames Smart 
4791da0436e9SJames Smart struct fcp_iread64_wqe {
4792da0436e9SJames Smart 	struct ulp_bde64 bde;
47930ba4b219SJames Smart 	uint32_t word3;
47940ba4b219SJames Smart #define	cmd_buff_len_SHIFT  16
47950ba4b219SJames Smart #define	cmd_buff_len_MASK  0x00000ffff
47960ba4b219SJames Smart #define	cmd_buff_len_WORD  word3
47970ba4b219SJames Smart #define payload_offset_len_SHIFT 0
47980ba4b219SJames Smart #define payload_offset_len_MASK 0x0000ffff
47990ba4b219SJames Smart #define payload_offset_len_WORD word3
4800da0436e9SJames Smart 	uint32_t total_xfer_len;       /* word 4 */
4801da0436e9SJames Smart 	uint32_t rsrvd5;               /* word 5 */
4802da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
4803fedd3b7bSJames Smart 	uint32_t rsrvd12;
4804fedd3b7bSJames Smart 	struct ulp_bde64 ph_bde;       /* words 13-15 */
4805da0436e9SJames Smart };
4806da0436e9SJames Smart 
4807da0436e9SJames Smart struct fcp_icmnd64_wqe {
4808da0436e9SJames Smart 	struct ulp_bde64 bde;          /* words 0-2 */
48090ba4b219SJames Smart 	uint32_t word3;
48100ba4b219SJames Smart #define	cmd_buff_len_SHIFT  16
48110ba4b219SJames Smart #define	cmd_buff_len_MASK  0x00000ffff
48120ba4b219SJames Smart #define	cmd_buff_len_WORD  word3
48130ba4b219SJames Smart #define payload_offset_len_SHIFT 0
48140ba4b219SJames Smart #define payload_offset_len_MASK 0x0000ffff
48150ba4b219SJames Smart #define payload_offset_len_WORD word3
4816f0d9bcccSJames Smart 	uint32_t rsrvd4;               /* word 4 */
4817f0d9bcccSJames Smart 	uint32_t rsrvd5;               /* word 5 */
4818da0436e9SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
4819da0436e9SJames Smart 	uint32_t rsvd_12_15[4];        /* word 12-15 */
4820da0436e9SJames Smart };
4821da0436e9SJames Smart 
4822f358dd0cSJames Smart struct fcp_trsp64_wqe {
4823f358dd0cSJames Smart 	struct ulp_bde64 bde;
4824f358dd0cSJames Smart 	uint32_t response_len;
4825f358dd0cSJames Smart 	uint32_t rsvd_4_5[2];
4826f358dd0cSJames Smart 	struct wqe_common wqe_com;      /* words 6-11 */
4827f358dd0cSJames Smart 	uint32_t rsvd_12_15[4];         /* word 12-15 */
4828f358dd0cSJames Smart };
4829f358dd0cSJames Smart 
4830f358dd0cSJames Smart struct fcp_tsend64_wqe {
4831f358dd0cSJames Smart 	struct ulp_bde64 bde;
4832f358dd0cSJames Smart 	uint32_t payload_offset_len;
4833f358dd0cSJames Smart 	uint32_t relative_offset;
4834f358dd0cSJames Smart 	uint32_t reserved;
4835f358dd0cSJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
4836f358dd0cSJames Smart 	uint32_t fcp_data_len;         /* word 12 */
4837f358dd0cSJames Smart 	uint32_t rsvd_13_15[3];        /* word 13-15 */
4838f358dd0cSJames Smart };
4839f358dd0cSJames Smart 
4840f358dd0cSJames Smart struct fcp_treceive64_wqe {
4841f358dd0cSJames Smart 	struct ulp_bde64 bde;
4842f358dd0cSJames Smart 	uint32_t payload_offset_len;
4843f358dd0cSJames Smart 	uint32_t relative_offset;
4844f358dd0cSJames Smart 	uint32_t reserved;
4845f358dd0cSJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
4846f358dd0cSJames Smart 	uint32_t fcp_data_len;         /* word 12 */
4847f358dd0cSJames Smart 	uint32_t rsvd_13_15[3];        /* word 13-15 */
4848f358dd0cSJames Smart };
4849f358dd0cSJames Smart #define TXRDY_PAYLOAD_LEN      12
4850f358dd0cSJames Smart 
4851ae9e28f3SJames Smart #define CMD_SEND_FRAME	0xE1
4852ae9e28f3SJames Smart 
4853ae9e28f3SJames Smart struct send_frame_wqe {
4854ae9e28f3SJames Smart 	struct ulp_bde64 bde;          /* words 0-2 */
4855ae9e28f3SJames Smart 	uint32_t frame_len;            /* word 3 */
4856ae9e28f3SJames Smart 	uint32_t fc_hdr_wd0;           /* word 4 */
4857ae9e28f3SJames Smart 	uint32_t fc_hdr_wd1;           /* word 5 */
4858ae9e28f3SJames Smart 	struct wqe_common wqe_com;     /* words 6-11 */
4859ae9e28f3SJames Smart 	uint32_t fc_hdr_wd2;           /* word 12 */
4860ae9e28f3SJames Smart 	uint32_t fc_hdr_wd3;           /* word 13 */
4861ae9e28f3SJames Smart 	uint32_t fc_hdr_wd4;           /* word 14 */
4862ae9e28f3SJames Smart 	uint32_t fc_hdr_wd5;           /* word 15 */
4863ae9e28f3SJames Smart };
4864da0436e9SJames Smart 
4865441f6b5bSJames Smart #define ELS_RDF_REG_TAG_CNT		4
4866df3fe766SJames Smart struct lpfc_els_rdf_reg_desc {
4867df3fe766SJames Smart 	struct fc_df_desc_fpin_reg	reg_desc;	/* descriptor header */
4868df3fe766SJames Smart 	__be32				desc_tags[ELS_RDF_REG_TAG_CNT];
4869df3fe766SJames Smart 							/* tags in reg_desc */
4870df3fe766SJames Smart };
4871df3fe766SJames Smart 
4872df3fe766SJames Smart struct lpfc_els_rdf_req {
4873df3fe766SJames Smart 	struct fc_els_rdf		rdf;	   /* hdr up to descriptors */
4874df3fe766SJames Smart 	struct lpfc_els_rdf_reg_desc	reg_d1;	/* 1st descriptor */
4875df3fe766SJames Smart };
4876df3fe766SJames Smart 
4877df3fe766SJames Smart struct lpfc_els_rdf_rsp {
4878df3fe766SJames Smart 	struct fc_els_rdf_resp		rdf_resp;  /* hdr up to descriptors */
4879df3fe766SJames Smart 	struct lpfc_els_rdf_reg_desc	reg_d1;	/* 1st descriptor */
4880df3fe766SJames Smart };
4881df3fe766SJames Smart 
4882da0436e9SJames Smart union lpfc_wqe {
4883da0436e9SJames Smart 	uint32_t words[16];
4884da0436e9SJames Smart 	struct lpfc_wqe_generic generic;
4885da0436e9SJames Smart 	struct fcp_icmnd64_wqe fcp_icmd;
4886da0436e9SJames Smart 	struct fcp_iread64_wqe fcp_iread;
4887da0436e9SJames Smart 	struct fcp_iwrite64_wqe fcp_iwrite;
4888da0436e9SJames Smart 	struct abort_cmd_wqe abort_cmd;
4889daebf93fSJames Smart 	struct cmf_sync_wqe cmf_sync;
4890da0436e9SJames Smart 	struct create_xri_wqe create_xri;
4891da0436e9SJames Smart 	struct xmit_bcast64_wqe xmit_bcast64;
4892da0436e9SJames Smart 	struct xmit_seq64_wqe xmit_sequence;
4893da0436e9SJames Smart 	struct xmit_bls_rsp64_wqe xmit_bls_rsp;
4894da0436e9SJames Smart 	struct xmit_els_rsp64_wqe xmit_els_rsp;
4895da0436e9SJames Smart 	struct els_request64_wqe els_req;
4896da0436e9SJames Smart 	struct gen_req64_wqe gen_req;
4897f358dd0cSJames Smart 	struct fcp_trsp64_wqe fcp_trsp;
4898f358dd0cSJames Smart 	struct fcp_tsend64_wqe fcp_tsend;
4899f358dd0cSJames Smart 	struct fcp_treceive64_wqe fcp_treceive;
4900ae9e28f3SJames Smart 	struct send_frame_wqe send_frame;
4901da0436e9SJames Smart };
4902da0436e9SJames Smart 
49030c651878SJames Smart union lpfc_wqe128 {
49040c651878SJames Smart 	uint32_t words[32];
49050c651878SJames Smart 	struct lpfc_wqe_generic generic;
4906b5c53958SJames Smart 	struct fcp_icmnd64_wqe fcp_icmd;
4907b5c53958SJames Smart 	struct fcp_iread64_wqe fcp_iread;
4908b5c53958SJames Smart 	struct fcp_iwrite64_wqe fcp_iwrite;
4909205e8240SJames Smart 	struct abort_cmd_wqe abort_cmd;
4910daebf93fSJames Smart 	struct cmf_sync_wqe cmf_sync;
4911205e8240SJames Smart 	struct create_xri_wqe create_xri;
4912205e8240SJames Smart 	struct xmit_bcast64_wqe xmit_bcast64;
4913205e8240SJames Smart 	struct xmit_seq64_wqe xmit_sequence;
4914205e8240SJames Smart 	struct xmit_bls_rsp64_wqe xmit_bls_rsp;
4915205e8240SJames Smart 	struct xmit_els_rsp64_wqe xmit_els_rsp;
4916205e8240SJames Smart 	struct els_request64_wqe els_req;
4917205e8240SJames Smart 	struct gen_req64_wqe gen_req;
4918f358dd0cSJames Smart 	struct fcp_trsp64_wqe fcp_trsp;
4919f358dd0cSJames Smart 	struct fcp_tsend64_wqe fcp_tsend;
4920f358dd0cSJames Smart 	struct fcp_treceive64_wqe fcp_treceive;
4921205e8240SJames Smart 	struct send_frame_wqe send_frame;
49220c651878SJames Smart };
49230c651878SJames Smart 
49245792a0e8SJames Smart #define MAGIC_NUMBER_G6 0xFEAA0003
49255792a0e8SJames Smart #define MAGIC_NUMBER_G7 0xFEAA0005
4926f6c5e6c4SJames Smart #define MAGIC_NUMBER_G7P 0xFEAA0020
4927a72d56b2SJames Smart 
492852d52440SJames Smart struct lpfc_grp_hdr {
492952d52440SJames Smart 	uint32_t size;
493052d52440SJames Smart 	uint32_t magic_number;
493152d52440SJames Smart 	uint32_t word2;
493252d52440SJames Smart #define lpfc_grp_hdr_file_type_SHIFT	24
493352d52440SJames Smart #define lpfc_grp_hdr_file_type_MASK	0x000000FF
493452d52440SJames Smart #define lpfc_grp_hdr_file_type_WORD	word2
493552d52440SJames Smart #define lpfc_grp_hdr_id_SHIFT		16
493652d52440SJames Smart #define lpfc_grp_hdr_id_MASK		0x000000FF
493752d52440SJames Smart #define lpfc_grp_hdr_id_WORD		word2
493852d52440SJames Smart 	uint8_t rev_name[128];
493988a2cfbbSJames Smart 	uint8_t date[12];
494088a2cfbbSJames Smart 	uint8_t revision[32];
494152d52440SJames Smart };
494252d52440SJames Smart 
4943895427bdSJames Smart /* Defines for WQE command type */
4944da0436e9SJames Smart #define FCP_COMMAND		0x0
4945895427bdSJames Smart #define NVME_READ_CMD		0x0
4946da0436e9SJames Smart #define FCP_COMMAND_DATA_OUT	0x1
4947895427bdSJames Smart #define NVME_WRITE_CMD		0x1
4948b101eb27SJames Smart #define COMMAND_DATA_IN		0x0
4949b101eb27SJames Smart #define COMMAND_DATA_OUT	0x1
4950895427bdSJames Smart #define FCP_COMMAND_TRECEIVE	0x2
4951895427bdSJames Smart #define FCP_COMMAND_TRSP	0x3
4952895427bdSJames Smart #define FCP_COMMAND_TSEND	0x7
4953895427bdSJames Smart #define OTHER_COMMAND		0x8
4954daebf93fSJames Smart #define CMF_SYNC_COMMAND	0xA
4955da0436e9SJames Smart #define ELS_COMMAND_NON_FIP	0xC
4956da0436e9SJames Smart #define ELS_COMMAND_FIP		0xD
4957895427bdSJames Smart 
4958895427bdSJames Smart #define LPFC_NVME_EMBED_CMD	0x0
4959895427bdSJames Smart #define LPFC_NVME_EMBED_WRITE	0x1
4960895427bdSJames Smart #define LPFC_NVME_EMBED_READ	0x2
4961895427bdSJames Smart 
4962895427bdSJames Smart /* WQE Commands */
4963895427bdSJames Smart #define CMD_ABORT_XRI_WQE       0x0F
4964895427bdSJames Smart #define CMD_XMIT_SEQUENCE64_WQE 0x82
4965895427bdSJames Smart #define CMD_XMIT_BCAST64_WQE    0x84
4966895427bdSJames Smart #define CMD_ELS_REQUEST64_WQE   0x8A
4967895427bdSJames Smart #define CMD_XMIT_ELS_RSP64_WQE  0x95
4968895427bdSJames Smart #define CMD_XMIT_BLS_RSP64_WQE  0x97
4969895427bdSJames Smart #define CMD_FCP_IWRITE64_WQE    0x98
4970895427bdSJames Smart #define CMD_FCP_IREAD64_WQE     0x9A
4971895427bdSJames Smart #define CMD_FCP_ICMND64_WQE     0x9C
4972895427bdSJames Smart #define CMD_FCP_TSEND64_WQE     0x9F
4973895427bdSJames Smart #define CMD_FCP_TRECEIVE64_WQE  0xA1
4974895427bdSJames Smart #define CMD_FCP_TRSP64_WQE      0xA3
4975895427bdSJames Smart #define CMD_GEN_REQUEST64_WQE   0xC2
4976daebf93fSJames Smart #define CMD_CMF_SYNC_WQE	0xE8
4977895427bdSJames Smart 
4978895427bdSJames Smart #define CMD_WQE_MASK            0xff
4979895427bdSJames Smart 
4980da0436e9SJames Smart 
498152d52440SJames Smart #define LPFC_FW_DUMP	1
498252d52440SJames Smart #define LPFC_FW_RESET	2
498352d52440SJames Smart #define LPFC_DV_RESET	3
4984428569e6SJames Smart 
49859064aeb2SJames Smart /* On some kernels, enum fc_ls_tlv_dtag does not have
49869064aeb2SJames Smart  * these 2 enums defined, on other kernels it does.
49879064aeb2SJames Smart  * To get aound this we need to add these 2 defines here.
49889064aeb2SJames Smart  */
49899064aeb2SJames Smart #ifndef ELS_DTAG_LNK_FAULT_CAP
49909064aeb2SJames Smart #define ELS_DTAG_LNK_FAULT_CAP        0x0001000D
49919064aeb2SJames Smart #endif
49929064aeb2SJames Smart #ifndef ELS_DTAG_CG_SIGNAL_CAP
49939064aeb2SJames Smart #define ELS_DTAG_CG_SIGNAL_CAP        0x0001000F
49949064aeb2SJames Smart #endif
49959064aeb2SJames Smart 
4996428569e6SJames Smart /*
4997428569e6SJames Smart  * Initializer useful for decoding FPIN string table.
4998428569e6SJames Smart  */
4999428569e6SJames Smart #define FC_FPIN_CONGN_SEVERITY_INIT {				\
5000428569e6SJames Smart 	{ FPIN_CONGN_SEVERITY_WARNING,		"Warning" },	\
5001428569e6SJames Smart 	{ FPIN_CONGN_SEVERITY_ERROR,		"Alarm" },	\
5002428569e6SJames Smart }
5003428569e6SJames Smart 
50049064aeb2SJames Smart /* EDC supports two descriptors.  When allocated, it is the
50059064aeb2SJames Smart  * size of this structure plus each supported descriptor.
50069064aeb2SJames Smart  */
50079064aeb2SJames Smart struct lpfc_els_edc_req {
50089064aeb2SJames Smart 	struct fc_els_edc               edc;       /* hdr up to descriptors */
50099064aeb2SJames Smart 	struct fc_diag_cg_sig_desc      cgn_desc;  /* 1st descriptor */
50109064aeb2SJames Smart };
50119064aeb2SJames Smart 
50129064aeb2SJames Smart /* Minimum structure defines for the EDC response.
50139064aeb2SJames Smart  * Balance is in buffer.
50149064aeb2SJames Smart  */
50159064aeb2SJames Smart struct lpfc_els_edc_rsp {
50169064aeb2SJames Smart 	struct fc_els_edc_resp          edc_rsp;   /* hdr up to descriptors */
50179064aeb2SJames Smart 	struct fc_diag_cg_sig_desc      cgn_desc;  /* 1st descriptor */
50189064aeb2SJames Smart };
50199064aeb2SJames Smart 
5020428569e6SJames Smart /* Used for logging FPIN messages */
5021428569e6SJames Smart #define LPFC_FPIN_WWPN_LINE_SZ  128
5022428569e6SJames Smart #define LPFC_FPIN_WWPN_LINE_CNT 6
5023428569e6SJames Smart #define LPFC_FPIN_WWPN_NUM_LINE 6
5024