xref: /openbmc/linux/drivers/scsi/lpfc/lpfc_bsg.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1c79c1292SJames Smart /*******************************************************************
2c79c1292SJames Smart  * This file is part of the Emulex Linux Device Driver for         *
3c79c1292SJames Smart  * Fibre Channel Host Bus Adapters.                                *
4*b3d11f19SJames Smart  * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
54ae2ebdeSJames Smart  * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
6f25e8e79SJames Smart  * Copyright (C) 2010-2015 Emulex.  All rights reserved.           *
7c79c1292SJames Smart  * EMULEX and SLI are trademarks of Emulex.                        *
8d080abe0SJames Smart  * www.broadcom.com                                                *
9c79c1292SJames Smart  *                                                                 *
10c79c1292SJames Smart  * This program is free software; you can redistribute it and/or   *
11c79c1292SJames Smart  * modify it under the terms of version 2 of the GNU General       *
12c79c1292SJames Smart  * Public License as published by the Free Software Foundation.    *
13c79c1292SJames Smart  * This program is distributed in the hope that it will be useful. *
14c79c1292SJames Smart  * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND          *
15c79c1292SJames Smart  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  *
16c79c1292SJames Smart  * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE      *
17c79c1292SJames Smart  * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
18c79c1292SJames Smart  * TO BE LEGALLY INVALID.  See the GNU General Public License for  *
19c79c1292SJames Smart  * more details, a copy of which can be found in the file COPYING  *
20c79c1292SJames Smart  * included with this package.                                     *
21c79c1292SJames Smart  *******************************************************************/
22c79c1292SJames Smart /* bsg definitions
23c79c1292SJames Smart  * No pointers to user data are allowed, all application buffers and sizes will
24c79c1292SJames Smart  * derived through the bsg interface.
25c79c1292SJames Smart  *
26c79c1292SJames Smart  * These are the vendor unique structures passed in using the bsg
27c79c1292SJames Smart  * FC_BSG_HST_VENDOR message code type.
28c79c1292SJames Smart  */
29c79c1292SJames Smart #define LPFC_BSG_VENDOR_SET_CT_EVENT		1
30c79c1292SJames Smart #define LPFC_BSG_VENDOR_GET_CT_EVENT		2
31c79c1292SJames Smart #define LPFC_BSG_VENDOR_SEND_MGMT_RESP		3
32c79c1292SJames Smart #define LPFC_BSG_VENDOR_DIAG_MODE		4
337ad20aa9SJames Smart #define LPFC_BSG_VENDOR_DIAG_RUN_LOOPBACK	5
34c79c1292SJames Smart #define LPFC_BSG_VENDOR_GET_MGMT_REV		6
35c79c1292SJames Smart #define LPFC_BSG_VENDOR_MBOX			7
367ad20aa9SJames Smart #define LPFC_BSG_VENDOR_DIAG_MODE_END		10
377ad20aa9SJames Smart #define LPFC_BSG_VENDOR_LINK_DIAG_TEST		11
38c691816eSJames Smart #define LPFC_BSG_VENDOR_FORCED_LINK_SPEED	14
39d2cc9bcdSJames Smart #define LPFC_BSG_VENDOR_RAS_GET_LWPD		16
40d2cc9bcdSJames Smart #define LPFC_BSG_VENDOR_RAS_GET_FWLOG		17
41d2cc9bcdSJames Smart #define LPFC_BSG_VENDOR_RAS_GET_CONFIG		18
42d2cc9bcdSJames Smart #define LPFC_BSG_VENDOR_RAS_SET_CONFIG		19
431dc5ec24SJames Smart #define LPFC_BSG_VENDOR_GET_TRUNK_INFO		20
44acbaa8c8SJames Smart #define LPFC_BSG_VENDOR_GET_CGNBUF_INFO		21
45c79c1292SJames Smart 
46c79c1292SJames Smart struct set_ct_event {
47c79c1292SJames Smart 	uint32_t command;
48c79c1292SJames Smart 	uint32_t type_mask;
49c79c1292SJames Smart 	uint32_t ev_req_id;
50c79c1292SJames Smart 	uint32_t ev_reg_id;
51c79c1292SJames Smart };
52c79c1292SJames Smart 
53c79c1292SJames Smart struct get_ct_event {
54c79c1292SJames Smart 	uint32_t command;
55c79c1292SJames Smart 	uint32_t ev_reg_id;
56c79c1292SJames Smart 	uint32_t ev_req_id;
57c79c1292SJames Smart };
58c79c1292SJames Smart 
59c79c1292SJames Smart struct get_ct_event_reply {
60c79c1292SJames Smart 	uint32_t immed_data;
61c79c1292SJames Smart 	uint32_t type;
62c79c1292SJames Smart };
63c79c1292SJames Smart 
64c79c1292SJames Smart struct send_mgmt_resp {
65c79c1292SJames Smart 	uint32_t command;
66c79c1292SJames Smart 	uint32_t tag;
67c79c1292SJames Smart };
68c79c1292SJames Smart 
69c79c1292SJames Smart 
709a66d990SJames Smart #define DISABLE_LOOP_BACK  0x0 /* disables loop back */
71c79c1292SJames Smart #define INTERNAL_LOOP_BACK 0x1 /* adapter short cuts the loop internally */
72c79c1292SJames Smart #define EXTERNAL_LOOP_BACK 0x2 /* requires an external loopback plug */
73c79c1292SJames Smart 
74c79c1292SJames Smart struct diag_mode_set {
75c79c1292SJames Smart 	uint32_t command;
76c79c1292SJames Smart 	uint32_t type;
77c79c1292SJames Smart 	uint32_t timeout;
789a66d990SJames Smart 	uint32_t physical_link;
79c79c1292SJames Smart };
80c79c1292SJames Smart 
817ad20aa9SJames Smart struct sli4_link_diag {
827ad20aa9SJames Smart 	uint32_t command;
837ad20aa9SJames Smart 	uint32_t timeout;
847ad20aa9SJames Smart 	uint32_t test_id;
857ad20aa9SJames Smart 	uint32_t loops;
867ad20aa9SJames Smart 	uint32_t test_version;
877ad20aa9SJames Smart 	uint32_t error_action;
887ad20aa9SJames Smart };
897ad20aa9SJames Smart 
90c79c1292SJames Smart struct diag_mode_test {
91c79c1292SJames Smart 	uint32_t command;
92c79c1292SJames Smart };
93c79c1292SJames Smart 
947ad20aa9SJames Smart struct diag_status {
957ad20aa9SJames Smart 	uint32_t mbox_status;
967ad20aa9SJames Smart 	uint32_t shdr_status;
977ad20aa9SJames Smart 	uint32_t shdr_add_status;
987ad20aa9SJames Smart };
997ad20aa9SJames Smart 
100c79c1292SJames Smart #define LPFC_WWNN_TYPE		0
101c79c1292SJames Smart #define LPFC_WWPN_TYPE		1
102c79c1292SJames Smart 
103c79c1292SJames Smart struct get_mgmt_rev {
104c79c1292SJames Smart 	uint32_t command;
105c79c1292SJames Smart };
106c79c1292SJames Smart 
107c79c1292SJames Smart #define MANAGEMENT_MAJOR_REV   1
108026abb87SJames Smart #define MANAGEMENT_MINOR_REV   1
109c79c1292SJames Smart 
110c79c1292SJames Smart /* the MgmtRevInfo structure */
111c79c1292SJames Smart struct MgmtRevInfo {
112c79c1292SJames Smart 	uint32_t a_Major;
113c79c1292SJames Smart 	uint32_t a_Minor;
114c79c1292SJames Smart };
115c79c1292SJames Smart 
116c79c1292SJames Smart struct get_mgmt_rev_reply {
117c79c1292SJames Smart 	struct MgmtRevInfo info;
118c79c1292SJames Smart };
119c79c1292SJames Smart 
12049198b37SJames Smart #define BSG_MBOX_SIZE 4096 /* mailbox command plus extended data */
1217ad20aa9SJames Smart 
1227ad20aa9SJames Smart /* BSG mailbox request header */
123c79c1292SJames Smart struct dfc_mbox_req {
124c79c1292SJames Smart 	uint32_t command;
1257a470277SJames Smart 	uint32_t mbOffset;
126c79c1292SJames Smart 	uint32_t inExtWLen;
127c7495937SJames Smart 	uint32_t outExtWLen;
1287ad20aa9SJames Smart 	uint32_t extMboxTag;
1297ad20aa9SJames Smart 	uint32_t extSeqNum;
130c79c1292SJames Smart };
131c79c1292SJames Smart 
132b6e3b9c6SJames Smart /*
133b6e3b9c6SJames Smart  * macros and data structures for handling sli-config mailbox command
134b6e3b9c6SJames Smart  * pass-through support, this header file is shared between user and
135b6e3b9c6SJames Smart  * kernel spaces, note the set of macros are duplicates from lpfc_hw4.h,
136b6e3b9c6SJames Smart  * with macro names prefixed with bsg_, as the macros defined in
137b6e3b9c6SJames Smart  * lpfc_hw4.h are not accessible from user space.
138b6e3b9c6SJames Smart  */
139b6e3b9c6SJames Smart 
140b6e3b9c6SJames Smart /* Macros to deal with bit fields. Each bit field must have 3 #defines
141b6e3b9c6SJames Smart  * associated with it (_SHIFT, _MASK, and _WORD).
142b6e3b9c6SJames Smart  * EG. For a bit field that is in the 7th bit of the "field4" field of a
143b6e3b9c6SJames Smart  * structure and is 2 bits in size the following #defines must exist:
144b6e3b9c6SJames Smart  *      struct temp {
145b6e3b9c6SJames Smart  *              uint32_t        field1;
146b6e3b9c6SJames Smart  *              uint32_t        field2;
147b6e3b9c6SJames Smart  *              uint32_t        field3;
148b6e3b9c6SJames Smart  *              uint32_t        field4;
149b6e3b9c6SJames Smart  *      #define example_bit_field_SHIFT         7
150b6e3b9c6SJames Smart  *      #define example_bit_field_MASK          0x03
151b6e3b9c6SJames Smart  *      #define example_bit_field_WORD          field4
152b6e3b9c6SJames Smart  *              uint32_t        field5;
153b6e3b9c6SJames Smart  *      };
154b6e3b9c6SJames Smart  * Then the macros below may be used to get or set the value of that field.
155b6e3b9c6SJames Smart  * EG. To get the value of the bit field from the above example:
156b6e3b9c6SJames Smart  *      struct temp t1;
157b6e3b9c6SJames Smart  *      value = bsg_bf_get(example_bit_field, &t1);
158b6e3b9c6SJames Smart  * And then to set that bit field:
159b6e3b9c6SJames Smart  *      bsg_bf_set(example_bit_field, &t1, 2);
160b6e3b9c6SJames Smart  * Or clear that bit field:
161b6e3b9c6SJames Smart  *      bsg_bf_set(example_bit_field, &t1, 0);
162b6e3b9c6SJames Smart  */
163b6e3b9c6SJames Smart #define bsg_bf_get_le32(name, ptr) \
164b6e3b9c6SJames Smart 	((le32_to_cpu((ptr)->name##_WORD) >> name##_SHIFT) & name##_MASK)
165b6e3b9c6SJames Smart #define bsg_bf_get(name, ptr) \
166b6e3b9c6SJames Smart 	(((ptr)->name##_WORD >> name##_SHIFT) & name##_MASK)
167b6e3b9c6SJames Smart #define bsg_bf_set_le32(name, ptr, value) \
168b6e3b9c6SJames Smart 	((ptr)->name##_WORD = cpu_to_le32(((((value) & \
169b6e3b9c6SJames Smart 	name##_MASK) << name##_SHIFT) | (le32_to_cpu((ptr)->name##_WORD) & \
170b6e3b9c6SJames Smart 	~(name##_MASK << name##_SHIFT)))))
171b6e3b9c6SJames Smart #define bsg_bf_set(name, ptr, value) \
172b6e3b9c6SJames Smart 	((ptr)->name##_WORD = ((((value) & name##_MASK) << name##_SHIFT) | \
173b6e3b9c6SJames Smart 	((ptr)->name##_WORD & ~(name##_MASK << name##_SHIFT))))
174b6e3b9c6SJames Smart 
175b6e3b9c6SJames Smart /*
176b6e3b9c6SJames Smart  * The sli_config structure specified here is based on the following
177b6e3b9c6SJames Smart  * restriction:
178b6e3b9c6SJames Smart  *
179b6e3b9c6SJames Smart  * -- SLI_CONFIG EMB=0, carrying MSEs, will carry subcommands without
180b6e3b9c6SJames Smart  *    carrying HBD.
181b6e3b9c6SJames Smart  * -- SLI_CONFIG EMB=1, not carrying MSE, will carry subcommands with or
182b6e3b9c6SJames Smart  *    without carrying HBDs.
183b6e3b9c6SJames Smart  */
184b6e3b9c6SJames Smart 
185b6e3b9c6SJames Smart struct lpfc_sli_config_mse {
186b6e3b9c6SJames Smart 	uint32_t pa_lo;
187b6e3b9c6SJames Smart 	uint32_t pa_hi;
188b6e3b9c6SJames Smart 	uint32_t buf_len;
189b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_mse_len_SHIFT	0
190b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_mse_len_MASK	0xffffff
191b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_mse_len_WORD	buf_len
192b6e3b9c6SJames Smart };
193b6e3b9c6SJames Smart 
1947ad20aa9SJames Smart struct lpfc_sli_config_hbd {
195b6e3b9c6SJames Smart 	uint32_t buf_len;
196b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_ecmn_hbd_len_SHIFT	0
197b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_ecmn_hbd_len_MASK	0xffffff
198b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_ecmn_hbd_len_WORD	buf_len
199b6e3b9c6SJames Smart 	uint32_t pa_lo;
200b6e3b9c6SJames Smart 	uint32_t pa_hi;
201b6e3b9c6SJames Smart };
202b6e3b9c6SJames Smart 
203b6e3b9c6SJames Smart struct lpfc_sli_config_hdr {
204b6e3b9c6SJames Smart 	uint32_t word1;
205b6e3b9c6SJames Smart #define lpfc_mbox_hdr_emb_SHIFT		0
206b6e3b9c6SJames Smart #define lpfc_mbox_hdr_emb_MASK		0x00000001
207b6e3b9c6SJames Smart #define lpfc_mbox_hdr_emb_WORD		word1
208b6e3b9c6SJames Smart #define lpfc_mbox_hdr_mse_cnt_SHIFT	3
209b6e3b9c6SJames Smart #define lpfc_mbox_hdr_mse_cnt_MASK	0x0000001f
210b6e3b9c6SJames Smart #define lpfc_mbox_hdr_mse_cnt_WORD	word1
211b6e3b9c6SJames Smart 	uint32_t payload_length;
212b6e3b9c6SJames Smart 	uint32_t tag_lo;
213b6e3b9c6SJames Smart 	uint32_t tag_hi;
214b6e3b9c6SJames Smart 	uint32_t reserved5;
215b6e3b9c6SJames Smart };
216b6e3b9c6SJames Smart 
21745bc4427SDick Kennedy #define LPFC_CSF_BOOT_DEV		0x1D
21845bc4427SDick Kennedy #define LPFC_CSF_QUERY			0
21945bc4427SDick Kennedy #define LPFC_CSF_SAVE			1
22045bc4427SDick Kennedy 
2217ad20aa9SJames Smart struct lpfc_sli_config_emb0_subsys {
222b6e3b9c6SJames Smart 	struct lpfc_sli_config_hdr	sli_config_hdr;
223b6e3b9c6SJames Smart #define LPFC_MBX_SLI_CONFIG_MAX_MSE     19
224b6e3b9c6SJames Smart 	struct lpfc_sli_config_mse	mse[LPFC_MBX_SLI_CONFIG_MAX_MSE];
2257ad20aa9SJames Smart 	uint32_t padding;
2267ad20aa9SJames Smart 	uint32_t word64;
2277ad20aa9SJames Smart #define lpfc_emb0_subcmnd_opcode_SHIFT	0
2287ad20aa9SJames Smart #define lpfc_emb0_subcmnd_opcode_MASK	0xff
2297ad20aa9SJames Smart #define lpfc_emb0_subcmnd_opcode_WORD	word64
2307ad20aa9SJames Smart #define lpfc_emb0_subcmnd_subsys_SHIFT	8
2317ad20aa9SJames Smart #define lpfc_emb0_subcmnd_subsys_MASK	0xff
2327ad20aa9SJames Smart #define lpfc_emb0_subcmnd_subsys_WORD	word64
2337ad20aa9SJames Smart /* Subsystem FCOE (0x0C) OpCodes */
2347ad20aa9SJames Smart #define SLI_CONFIG_SUBSYS_FCOE		0x0C
2357ad20aa9SJames Smart #define FCOE_OPCODE_READ_FCF		0x08
2367ad20aa9SJames Smart #define FCOE_OPCODE_ADD_FCF		0x09
2372a2719d3SJames Smart #define FCOE_OPCODE_SET_DPORT_MODE	0x27
2382a2719d3SJames Smart #define FCOE_OPCODE_GET_DPORT_RESULTS	0x28
23945bc4427SDick Kennedy 	uint32_t timeout;		/* comn_set_feature timeout */
24045bc4427SDick Kennedy 	uint32_t request_length;	/* comn_set_feature request len */
24145bc4427SDick Kennedy 	uint32_t version;		/* comn_set_feature version */
24245bc4427SDick Kennedy 	uint32_t csf_feature;		/* comn_set_feature feature */
24345bc4427SDick Kennedy 	uint32_t word69;		/* comn_set_feature parameter len */
24445bc4427SDick Kennedy 	uint32_t word70;		/* comn_set_feature parameter val0 */
24545bc4427SDick Kennedy #define lpfc_emb0_subcmnd_csf_p0_SHIFT	0
24645bc4427SDick Kennedy #define lpfc_emb0_subcmnd_csf_p0_MASK	0x3
24745bc4427SDick Kennedy #define lpfc_emb0_subcmnd_csf_p0_WORD	word70
248b6e3b9c6SJames Smart };
249b6e3b9c6SJames Smart 
2507ad20aa9SJames Smart struct lpfc_sli_config_emb1_subsys {
251b6e3b9c6SJames Smart 	struct lpfc_sli_config_hdr	sli_config_hdr;
252b6e3b9c6SJames Smart 	uint32_t word6;
2537ad20aa9SJames Smart #define lpfc_emb1_subcmnd_opcode_SHIFT	0
2547ad20aa9SJames Smart #define lpfc_emb1_subcmnd_opcode_MASK	0xff
2557ad20aa9SJames Smart #define lpfc_emb1_subcmnd_opcode_WORD	word6
2567ad20aa9SJames Smart #define lpfc_emb1_subcmnd_subsys_SHIFT	8
2577ad20aa9SJames Smart #define lpfc_emb1_subcmnd_subsys_MASK	0xff
2587ad20aa9SJames Smart #define lpfc_emb1_subcmnd_subsys_WORD	word6
2597ad20aa9SJames Smart /* Subsystem COMN (0x01) OpCodes */
2607ad20aa9SJames Smart #define SLI_CONFIG_SUBSYS_COMN		0x01
261c6377970SJames Smart #define COMN_OPCODE_GET_PROFILE_CONFIG	0xA4
2627ad20aa9SJames Smart #define COMN_OPCODE_READ_OBJECT		0xAB
2637ad20aa9SJames Smart #define COMN_OPCODE_WRITE_OBJECT	0xAC
2647ad20aa9SJames Smart #define COMN_OPCODE_READ_OBJECT_LIST	0xAD
2657ad20aa9SJames Smart #define COMN_OPCODE_DELETE_OBJECT	0xAE
26645bc4427SDick Kennedy #define COMN_OPCODE_SET_FEATURES	0xBF
267026abb87SJames Smart #define COMN_OPCODE_GET_CNTL_ADDL_ATTRIBUTES	0x79
268b99570ddSJames Smart #define COMN_OPCODE_GET_CNTL_ATTRIBUTES	0x20
269b6e3b9c6SJames Smart 	uint32_t timeout;
270b6e3b9c6SJames Smart 	uint32_t request_length;
271b6e3b9c6SJames Smart 	uint32_t word9;
272b6e3b9c6SJames Smart #define lpfc_subcmnd_version_SHIFT	0
273b6e3b9c6SJames Smart #define lpfc_subcmnd_version_MASK	0xff
274b6e3b9c6SJames Smart #define lpfc_subcmnd_version_WORD	word9
275b6e3b9c6SJames Smart 	uint32_t word10;
276b6e3b9c6SJames Smart #define lpfc_subcmnd_ask_rd_len_SHIFT	0
277b6e3b9c6SJames Smart #define lpfc_subcmnd_ask_rd_len_MASK	0xffffff
278b6e3b9c6SJames Smart #define lpfc_subcmnd_ask_rd_len_WORD	word10
279b6e3b9c6SJames Smart 	uint32_t rd_offset;
280b6e3b9c6SJames Smart 	uint32_t obj_name[26];
281b6e3b9c6SJames Smart 	uint32_t hbd_count;
2827ad20aa9SJames Smart #define LPFC_MBX_SLI_CONFIG_MAX_HBD	8
2837ad20aa9SJames Smart 	struct lpfc_sli_config_hbd	hbd[LPFC_MBX_SLI_CONFIG_MAX_HBD];
284b6e3b9c6SJames Smart };
285b6e3b9c6SJames Smart 
286b6e3b9c6SJames Smart struct lpfc_sli_config_mbox {
287b6e3b9c6SJames Smart 	uint32_t word0;
288b6e3b9c6SJames Smart #define lpfc_mqe_status_SHIFT		16
289b6e3b9c6SJames Smart #define lpfc_mqe_status_MASK		0x0000FFFF
290b6e3b9c6SJames Smart #define lpfc_mqe_status_WORD		word0
291b6e3b9c6SJames Smart #define lpfc_mqe_command_SHIFT		8
292b6e3b9c6SJames Smart #define lpfc_mqe_command_MASK		0x000000FF
293b6e3b9c6SJames Smart #define lpfc_mqe_command_WORD		word0
294b6e3b9c6SJames Smart 	union {
2957ad20aa9SJames Smart 		struct lpfc_sli_config_emb0_subsys sli_config_emb0_subsys;
2967ad20aa9SJames Smart 		struct lpfc_sli_config_emb1_subsys sli_config_emb1_subsys;
297b6e3b9c6SJames Smart 	} un;
298b6e3b9c6SJames Smart };
2997ad20aa9SJames Smart 
300c691816eSJames Smart #define LPFC_FORCED_LINK_SPEED_NOT_SUPPORTED	0
301c691816eSJames Smart #define LPFC_FORCED_LINK_SPEED_SUPPORTED	1
302c691816eSJames Smart struct get_forced_link_speed_support {
303c691816eSJames Smart 	uint32_t command;
304c691816eSJames Smart };
305c691816eSJames Smart struct forced_link_speed_support_reply {
306c691816eSJames Smart 	uint8_t supported;
307c691816eSJames Smart };
308c691816eSJames Smart 
309d2cc9bcdSJames Smart struct lpfc_bsg_ras_req {
310d2cc9bcdSJames Smart 	uint32_t command;
311d2cc9bcdSJames Smart };
312d2cc9bcdSJames Smart 
313d2cc9bcdSJames Smart struct lpfc_bsg_get_fwlog_req {
314d2cc9bcdSJames Smart 	uint32_t command;
315d2cc9bcdSJames Smart 	uint32_t read_size;
316d2cc9bcdSJames Smart 	uint32_t read_offset;
317d2cc9bcdSJames Smart };
318d2cc9bcdSJames Smart 
319d2cc9bcdSJames Smart struct lpfc_bsg_get_ras_lwpd {
320d2cc9bcdSJames Smart 	uint32_t offset;
321d2cc9bcdSJames Smart 	uint32_t wrap_count;
322d2cc9bcdSJames Smart };
323d2cc9bcdSJames Smart 
324d2cc9bcdSJames Smart struct lpfc_bsg_set_ras_config_req {
325d2cc9bcdSJames Smart 	uint32_t command;
326d2cc9bcdSJames Smart 	uint8_t action;
327d2cc9bcdSJames Smart #define LPFC_RASACTION_STOP_LOGGING     0x00
328d2cc9bcdSJames Smart #define LPFC_RASACTION_START_LOGGING    0x01
329d2cc9bcdSJames Smart 	uint8_t log_level;
330d2cc9bcdSJames Smart };
331d2cc9bcdSJames Smart 
332d2cc9bcdSJames Smart struct lpfc_bsg_get_ras_config_reply {
333d2cc9bcdSJames Smart 	uint8_t state;
334d2cc9bcdSJames Smart #define LPFC_RASLOG_STATE_STOPPED 0x00
335d2cc9bcdSJames Smart #define LPFC_RASLOG_STATE_RUNNING 0x01
336d2cc9bcdSJames Smart 	uint8_t log_level;
337d2cc9bcdSJames Smart 	uint32_t log_buff_sz;
338d2cc9bcdSJames Smart };
339d2cc9bcdSJames Smart 
3401dc5ec24SJames Smart struct lpfc_trunk_info {
3411dc5ec24SJames Smart 	uint32_t word0;
3421dc5ec24SJames Smart #define lpfc_trunk_info_link_status_SHIFT      0
3431dc5ec24SJames Smart #define lpfc_trunk_info_link_status_MASK       1
3441dc5ec24SJames Smart #define lpfc_trunk_info_link_status_WORD       word0
3451dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active0_SHIFT    8
3461dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active0_MASK     1
3471dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active0_WORD     word0
3481dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active1_SHIFT    9
3491dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active1_MASK     1
3501dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active1_WORD     word0
3511dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active2_SHIFT    10
3521dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active2_MASK     1
3531dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active2_WORD     word0
3541dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active3_SHIFT    11
3551dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active3_MASK     1
3561dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active3_WORD     word0
3571dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config0_SHIFT    12
3581dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config0_MASK     1
3591dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config0_WORD     word0
3601dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config1_SHIFT    13
3611dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config1_MASK     1
3621dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config1_WORD     word0
3631dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config2_SHIFT    14
3641dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config2_MASK     1
3651dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config2_WORD     word0
3661dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config3_SHIFT    15
3671dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config3_MASK     1
3681dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config3_WORD     word0
3691dc5ec24SJames Smart 	uint16_t    port_speed;
3701dc5ec24SJames Smart 	uint16_t    logical_speed;
3711dc5ec24SJames Smart 	uint32_t    reserved3;
3721dc5ec24SJames Smart };
3731dc5ec24SJames Smart 
3741dc5ec24SJames Smart struct get_trunk_info_req {
3751dc5ec24SJames Smart 	uint32_t command;
3761dc5ec24SJames Smart };
377d2cc9bcdSJames Smart 
378acbaa8c8SJames Smart struct get_cgnbuf_info_req {
379acbaa8c8SJames Smart 	uint32_t command;
380acbaa8c8SJames Smart 	uint32_t read_size;
381acbaa8c8SJames Smart 	uint32_t reset;
382acbaa8c8SJames Smart #define LPFC_BSG_CGN_RESET_STAT		1
383acbaa8c8SJames Smart };
384acbaa8c8SJames Smart 
3857ad20aa9SJames Smart /* driver only */
3867ad20aa9SJames Smart #define SLI_CONFIG_NOT_HANDLED		0
3877ad20aa9SJames Smart #define SLI_CONFIG_HANDLED		1
388