xref: /openbmc/linux/drivers/scsi/lpfc/lpfc_bsg.h (revision acbaa8c8ed17e768dab3f09f457fd265d7c94848)
1c79c1292SJames Smart /*******************************************************************
2c79c1292SJames Smart  * This file is part of the Emulex Linux Device Driver for         *
3c79c1292SJames Smart  * Fibre Channel Host Bus Adapters.                                *
495df18c2SJames Smart  * Copyright (C) 2017-2019 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
36e2aed29fSJames Smart #define LPFC_BSG_VENDOR_MENLO_CMD		8
37e2aed29fSJames Smart #define LPFC_BSG_VENDOR_MENLO_DATA		9
387ad20aa9SJames Smart #define LPFC_BSG_VENDOR_DIAG_MODE_END		10
397ad20aa9SJames Smart #define LPFC_BSG_VENDOR_LINK_DIAG_TEST		11
40c691816eSJames Smart #define LPFC_BSG_VENDOR_FORCED_LINK_SPEED	14
41d2cc9bcdSJames Smart #define LPFC_BSG_VENDOR_RAS_GET_LWPD		16
42d2cc9bcdSJames Smart #define LPFC_BSG_VENDOR_RAS_GET_FWLOG		17
43d2cc9bcdSJames Smart #define LPFC_BSG_VENDOR_RAS_GET_CONFIG		18
44d2cc9bcdSJames Smart #define LPFC_BSG_VENDOR_RAS_SET_CONFIG		19
451dc5ec24SJames Smart #define LPFC_BSG_VENDOR_GET_TRUNK_INFO		20
46*acbaa8c8SJames Smart #define LPFC_BSG_VENDOR_GET_CGNBUF_INFO		21
47c79c1292SJames Smart 
48c79c1292SJames Smart struct set_ct_event {
49c79c1292SJames Smart 	uint32_t command;
50c79c1292SJames Smart 	uint32_t type_mask;
51c79c1292SJames Smart 	uint32_t ev_req_id;
52c79c1292SJames Smart 	uint32_t ev_reg_id;
53c79c1292SJames Smart };
54c79c1292SJames Smart 
55c79c1292SJames Smart struct get_ct_event {
56c79c1292SJames Smart 	uint32_t command;
57c79c1292SJames Smart 	uint32_t ev_reg_id;
58c79c1292SJames Smart 	uint32_t ev_req_id;
59c79c1292SJames Smart };
60c79c1292SJames Smart 
61c79c1292SJames Smart struct get_ct_event_reply {
62c79c1292SJames Smart 	uint32_t immed_data;
63c79c1292SJames Smart 	uint32_t type;
64c79c1292SJames Smart };
65c79c1292SJames Smart 
66c79c1292SJames Smart struct send_mgmt_resp {
67c79c1292SJames Smart 	uint32_t command;
68c79c1292SJames Smart 	uint32_t tag;
69c79c1292SJames Smart };
70c79c1292SJames Smart 
71c79c1292SJames Smart 
729a66d990SJames Smart #define DISABLE_LOOP_BACK  0x0 /* disables loop back */
73c79c1292SJames Smart #define INTERNAL_LOOP_BACK 0x1 /* adapter short cuts the loop internally */
74c79c1292SJames Smart #define EXTERNAL_LOOP_BACK 0x2 /* requires an external loopback plug */
75c79c1292SJames Smart 
76c79c1292SJames Smart struct diag_mode_set {
77c79c1292SJames Smart 	uint32_t command;
78c79c1292SJames Smart 	uint32_t type;
79c79c1292SJames Smart 	uint32_t timeout;
809a66d990SJames Smart 	uint32_t physical_link;
81c79c1292SJames Smart };
82c79c1292SJames Smart 
837ad20aa9SJames Smart struct sli4_link_diag {
847ad20aa9SJames Smart 	uint32_t command;
857ad20aa9SJames Smart 	uint32_t timeout;
867ad20aa9SJames Smart 	uint32_t test_id;
877ad20aa9SJames Smart 	uint32_t loops;
887ad20aa9SJames Smart 	uint32_t test_version;
897ad20aa9SJames Smart 	uint32_t error_action;
907ad20aa9SJames Smart };
917ad20aa9SJames Smart 
92c79c1292SJames Smart struct diag_mode_test {
93c79c1292SJames Smart 	uint32_t command;
94c79c1292SJames Smart };
95c79c1292SJames Smart 
967ad20aa9SJames Smart struct diag_status {
977ad20aa9SJames Smart 	uint32_t mbox_status;
987ad20aa9SJames Smart 	uint32_t shdr_status;
997ad20aa9SJames Smart 	uint32_t shdr_add_status;
1007ad20aa9SJames Smart };
1017ad20aa9SJames Smart 
102c79c1292SJames Smart #define LPFC_WWNN_TYPE		0
103c79c1292SJames Smart #define LPFC_WWPN_TYPE		1
104c79c1292SJames Smart 
105c79c1292SJames Smart struct get_mgmt_rev {
106c79c1292SJames Smart 	uint32_t command;
107c79c1292SJames Smart };
108c79c1292SJames Smart 
109c79c1292SJames Smart #define MANAGEMENT_MAJOR_REV   1
110026abb87SJames Smart #define MANAGEMENT_MINOR_REV   1
111c79c1292SJames Smart 
112c79c1292SJames Smart /* the MgmtRevInfo structure */
113c79c1292SJames Smart struct MgmtRevInfo {
114c79c1292SJames Smart 	uint32_t a_Major;
115c79c1292SJames Smart 	uint32_t a_Minor;
116c79c1292SJames Smart };
117c79c1292SJames Smart 
118c79c1292SJames Smart struct get_mgmt_rev_reply {
119c79c1292SJames Smart 	struct MgmtRevInfo info;
120c79c1292SJames Smart };
121c79c1292SJames Smart 
12249198b37SJames Smart #define BSG_MBOX_SIZE 4096 /* mailbox command plus extended data */
1237ad20aa9SJames Smart 
1247ad20aa9SJames Smart /* BSG mailbox request header */
125c79c1292SJames Smart struct dfc_mbox_req {
126c79c1292SJames Smart 	uint32_t command;
1277a470277SJames Smart 	uint32_t mbOffset;
128c79c1292SJames Smart 	uint32_t inExtWLen;
129c7495937SJames Smart 	uint32_t outExtWLen;
1307ad20aa9SJames Smart 	uint32_t extMboxTag;
1317ad20aa9SJames Smart 	uint32_t extSeqNum;
132c79c1292SJames Smart };
133c79c1292SJames Smart 
134e2aed29fSJames Smart /* Used for menlo command or menlo data. The xri is only used for menlo data */
135e2aed29fSJames Smart struct menlo_command {
136e2aed29fSJames Smart 	uint32_t cmd;
137e2aed29fSJames Smart 	uint32_t xri;
138e2aed29fSJames Smart };
139e2aed29fSJames Smart 
140e2aed29fSJames Smart struct menlo_response {
141e2aed29fSJames Smart 	uint32_t xri; /* return the xri of the iocb exchange */
142e2aed29fSJames Smart };
143e2aed29fSJames Smart 
144b6e3b9c6SJames Smart /*
145b6e3b9c6SJames Smart  * macros and data structures for handling sli-config mailbox command
146b6e3b9c6SJames Smart  * pass-through support, this header file is shared between user and
147b6e3b9c6SJames Smart  * kernel spaces, note the set of macros are duplicates from lpfc_hw4.h,
148b6e3b9c6SJames Smart  * with macro names prefixed with bsg_, as the macros defined in
149b6e3b9c6SJames Smart  * lpfc_hw4.h are not accessible from user space.
150b6e3b9c6SJames Smart  */
151b6e3b9c6SJames Smart 
152b6e3b9c6SJames Smart /* Macros to deal with bit fields. Each bit field must have 3 #defines
153b6e3b9c6SJames Smart  * associated with it (_SHIFT, _MASK, and _WORD).
154b6e3b9c6SJames Smart  * EG. For a bit field that is in the 7th bit of the "field4" field of a
155b6e3b9c6SJames Smart  * structure and is 2 bits in size the following #defines must exist:
156b6e3b9c6SJames Smart  *      struct temp {
157b6e3b9c6SJames Smart  *              uint32_t        field1;
158b6e3b9c6SJames Smart  *              uint32_t        field2;
159b6e3b9c6SJames Smart  *              uint32_t        field3;
160b6e3b9c6SJames Smart  *              uint32_t        field4;
161b6e3b9c6SJames Smart  *      #define example_bit_field_SHIFT         7
162b6e3b9c6SJames Smart  *      #define example_bit_field_MASK          0x03
163b6e3b9c6SJames Smart  *      #define example_bit_field_WORD          field4
164b6e3b9c6SJames Smart  *              uint32_t        field5;
165b6e3b9c6SJames Smart  *      };
166b6e3b9c6SJames Smart  * Then the macros below may be used to get or set the value of that field.
167b6e3b9c6SJames Smart  * EG. To get the value of the bit field from the above example:
168b6e3b9c6SJames Smart  *      struct temp t1;
169b6e3b9c6SJames Smart  *      value = bsg_bf_get(example_bit_field, &t1);
170b6e3b9c6SJames Smart  * And then to set that bit field:
171b6e3b9c6SJames Smart  *      bsg_bf_set(example_bit_field, &t1, 2);
172b6e3b9c6SJames Smart  * Or clear that bit field:
173b6e3b9c6SJames Smart  *      bsg_bf_set(example_bit_field, &t1, 0);
174b6e3b9c6SJames Smart  */
175b6e3b9c6SJames Smart #define bsg_bf_get_le32(name, ptr) \
176b6e3b9c6SJames Smart 	((le32_to_cpu((ptr)->name##_WORD) >> name##_SHIFT) & name##_MASK)
177b6e3b9c6SJames Smart #define bsg_bf_get(name, ptr) \
178b6e3b9c6SJames Smart 	(((ptr)->name##_WORD >> name##_SHIFT) & name##_MASK)
179b6e3b9c6SJames Smart #define bsg_bf_set_le32(name, ptr, value) \
180b6e3b9c6SJames Smart 	((ptr)->name##_WORD = cpu_to_le32(((((value) & \
181b6e3b9c6SJames Smart 	name##_MASK) << name##_SHIFT) | (le32_to_cpu((ptr)->name##_WORD) & \
182b6e3b9c6SJames Smart 	~(name##_MASK << name##_SHIFT)))))
183b6e3b9c6SJames Smart #define bsg_bf_set(name, ptr, value) \
184b6e3b9c6SJames Smart 	((ptr)->name##_WORD = ((((value) & name##_MASK) << name##_SHIFT) | \
185b6e3b9c6SJames Smart 	((ptr)->name##_WORD & ~(name##_MASK << name##_SHIFT))))
186b6e3b9c6SJames Smart 
187b6e3b9c6SJames Smart /*
188b6e3b9c6SJames Smart  * The sli_config structure specified here is based on the following
189b6e3b9c6SJames Smart  * restriction:
190b6e3b9c6SJames Smart  *
191b6e3b9c6SJames Smart  * -- SLI_CONFIG EMB=0, carrying MSEs, will carry subcommands without
192b6e3b9c6SJames Smart  *    carrying HBD.
193b6e3b9c6SJames Smart  * -- SLI_CONFIG EMB=1, not carrying MSE, will carry subcommands with or
194b6e3b9c6SJames Smart  *    without carrying HBDs.
195b6e3b9c6SJames Smart  */
196b6e3b9c6SJames Smart 
197b6e3b9c6SJames Smart struct lpfc_sli_config_mse {
198b6e3b9c6SJames Smart 	uint32_t pa_lo;
199b6e3b9c6SJames Smart 	uint32_t pa_hi;
200b6e3b9c6SJames Smart 	uint32_t buf_len;
201b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_mse_len_SHIFT	0
202b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_mse_len_MASK	0xffffff
203b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_mse_len_WORD	buf_len
204b6e3b9c6SJames Smart };
205b6e3b9c6SJames Smart 
2067ad20aa9SJames Smart struct lpfc_sli_config_hbd {
207b6e3b9c6SJames Smart 	uint32_t buf_len;
208b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_ecmn_hbd_len_SHIFT	0
209b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_ecmn_hbd_len_MASK	0xffffff
210b6e3b9c6SJames Smart #define lpfc_mbox_sli_config_ecmn_hbd_len_WORD	buf_len
211b6e3b9c6SJames Smart 	uint32_t pa_lo;
212b6e3b9c6SJames Smart 	uint32_t pa_hi;
213b6e3b9c6SJames Smart };
214b6e3b9c6SJames Smart 
215b6e3b9c6SJames Smart struct lpfc_sli_config_hdr {
216b6e3b9c6SJames Smart 	uint32_t word1;
217b6e3b9c6SJames Smart #define lpfc_mbox_hdr_emb_SHIFT		0
218b6e3b9c6SJames Smart #define lpfc_mbox_hdr_emb_MASK		0x00000001
219b6e3b9c6SJames Smart #define lpfc_mbox_hdr_emb_WORD		word1
220b6e3b9c6SJames Smart #define lpfc_mbox_hdr_mse_cnt_SHIFT	3
221b6e3b9c6SJames Smart #define lpfc_mbox_hdr_mse_cnt_MASK	0x0000001f
222b6e3b9c6SJames Smart #define lpfc_mbox_hdr_mse_cnt_WORD	word1
223b6e3b9c6SJames Smart 	uint32_t payload_length;
224b6e3b9c6SJames Smart 	uint32_t tag_lo;
225b6e3b9c6SJames Smart 	uint32_t tag_hi;
226b6e3b9c6SJames Smart 	uint32_t reserved5;
227b6e3b9c6SJames Smart };
228b6e3b9c6SJames Smart 
22945bc4427SDick Kennedy #define LPFC_CSF_BOOT_DEV		0x1D
23045bc4427SDick Kennedy #define LPFC_CSF_QUERY			0
23145bc4427SDick Kennedy #define LPFC_CSF_SAVE			1
23245bc4427SDick Kennedy 
2337ad20aa9SJames Smart struct lpfc_sli_config_emb0_subsys {
234b6e3b9c6SJames Smart 	struct lpfc_sli_config_hdr	sli_config_hdr;
235b6e3b9c6SJames Smart #define LPFC_MBX_SLI_CONFIG_MAX_MSE     19
236b6e3b9c6SJames Smart 	struct lpfc_sli_config_mse	mse[LPFC_MBX_SLI_CONFIG_MAX_MSE];
2377ad20aa9SJames Smart 	uint32_t padding;
2387ad20aa9SJames Smart 	uint32_t word64;
2397ad20aa9SJames Smart #define lpfc_emb0_subcmnd_opcode_SHIFT	0
2407ad20aa9SJames Smart #define lpfc_emb0_subcmnd_opcode_MASK	0xff
2417ad20aa9SJames Smart #define lpfc_emb0_subcmnd_opcode_WORD	word64
2427ad20aa9SJames Smart #define lpfc_emb0_subcmnd_subsys_SHIFT	8
2437ad20aa9SJames Smart #define lpfc_emb0_subcmnd_subsys_MASK	0xff
2447ad20aa9SJames Smart #define lpfc_emb0_subcmnd_subsys_WORD	word64
2457ad20aa9SJames Smart /* Subsystem FCOE (0x0C) OpCodes */
2467ad20aa9SJames Smart #define SLI_CONFIG_SUBSYS_FCOE		0x0C
2477ad20aa9SJames Smart #define FCOE_OPCODE_READ_FCF		0x08
2487ad20aa9SJames Smart #define FCOE_OPCODE_ADD_FCF		0x09
2492a2719d3SJames Smart #define FCOE_OPCODE_SET_DPORT_MODE	0x27
2502a2719d3SJames Smart #define FCOE_OPCODE_GET_DPORT_RESULTS	0x28
25145bc4427SDick Kennedy 	uint32_t timeout;		/* comn_set_feature timeout */
25245bc4427SDick Kennedy 	uint32_t request_length;	/* comn_set_feature request len */
25345bc4427SDick Kennedy 	uint32_t version;		/* comn_set_feature version */
25445bc4427SDick Kennedy 	uint32_t csf_feature;		/* comn_set_feature feature */
25545bc4427SDick Kennedy 	uint32_t word69;		/* comn_set_feature parameter len */
25645bc4427SDick Kennedy 	uint32_t word70;		/* comn_set_feature parameter val0 */
25745bc4427SDick Kennedy #define lpfc_emb0_subcmnd_csf_p0_SHIFT	0
25845bc4427SDick Kennedy #define lpfc_emb0_subcmnd_csf_p0_MASK	0x3
25945bc4427SDick Kennedy #define lpfc_emb0_subcmnd_csf_p0_WORD	word70
260b6e3b9c6SJames Smart };
261b6e3b9c6SJames Smart 
2627ad20aa9SJames Smart struct lpfc_sli_config_emb1_subsys {
263b6e3b9c6SJames Smart 	struct lpfc_sli_config_hdr	sli_config_hdr;
264b6e3b9c6SJames Smart 	uint32_t word6;
2657ad20aa9SJames Smart #define lpfc_emb1_subcmnd_opcode_SHIFT	0
2667ad20aa9SJames Smart #define lpfc_emb1_subcmnd_opcode_MASK	0xff
2677ad20aa9SJames Smart #define lpfc_emb1_subcmnd_opcode_WORD	word6
2687ad20aa9SJames Smart #define lpfc_emb1_subcmnd_subsys_SHIFT	8
2697ad20aa9SJames Smart #define lpfc_emb1_subcmnd_subsys_MASK	0xff
2707ad20aa9SJames Smart #define lpfc_emb1_subcmnd_subsys_WORD	word6
2717ad20aa9SJames Smart /* Subsystem COMN (0x01) OpCodes */
2727ad20aa9SJames Smart #define SLI_CONFIG_SUBSYS_COMN		0x01
273c6377970SJames Smart #define COMN_OPCODE_GET_PROFILE_CONFIG	0xA4
2747ad20aa9SJames Smart #define COMN_OPCODE_READ_OBJECT		0xAB
2757ad20aa9SJames Smart #define COMN_OPCODE_WRITE_OBJECT	0xAC
2767ad20aa9SJames Smart #define COMN_OPCODE_READ_OBJECT_LIST	0xAD
2777ad20aa9SJames Smart #define COMN_OPCODE_DELETE_OBJECT	0xAE
27845bc4427SDick Kennedy #define COMN_OPCODE_SET_FEATURES	0xBF
279026abb87SJames Smart #define COMN_OPCODE_GET_CNTL_ADDL_ATTRIBUTES	0x79
280b99570ddSJames Smart #define COMN_OPCODE_GET_CNTL_ATTRIBUTES	0x20
281b6e3b9c6SJames Smart 	uint32_t timeout;
282b6e3b9c6SJames Smart 	uint32_t request_length;
283b6e3b9c6SJames Smart 	uint32_t word9;
284b6e3b9c6SJames Smart #define lpfc_subcmnd_version_SHIFT	0
285b6e3b9c6SJames Smart #define lpfc_subcmnd_version_MASK	0xff
286b6e3b9c6SJames Smart #define lpfc_subcmnd_version_WORD	word9
287b6e3b9c6SJames Smart 	uint32_t word10;
288b6e3b9c6SJames Smart #define lpfc_subcmnd_ask_rd_len_SHIFT	0
289b6e3b9c6SJames Smart #define lpfc_subcmnd_ask_rd_len_MASK	0xffffff
290b6e3b9c6SJames Smart #define lpfc_subcmnd_ask_rd_len_WORD	word10
291b6e3b9c6SJames Smart 	uint32_t rd_offset;
292b6e3b9c6SJames Smart 	uint32_t obj_name[26];
293b6e3b9c6SJames Smart 	uint32_t hbd_count;
2947ad20aa9SJames Smart #define LPFC_MBX_SLI_CONFIG_MAX_HBD	8
2957ad20aa9SJames Smart 	struct lpfc_sli_config_hbd	hbd[LPFC_MBX_SLI_CONFIG_MAX_HBD];
296b6e3b9c6SJames Smart };
297b6e3b9c6SJames Smart 
298b6e3b9c6SJames Smart struct lpfc_sli_config_mbox {
299b6e3b9c6SJames Smart 	uint32_t word0;
300b6e3b9c6SJames Smart #define lpfc_mqe_status_SHIFT		16
301b6e3b9c6SJames Smart #define lpfc_mqe_status_MASK		0x0000FFFF
302b6e3b9c6SJames Smart #define lpfc_mqe_status_WORD		word0
303b6e3b9c6SJames Smart #define lpfc_mqe_command_SHIFT		8
304b6e3b9c6SJames Smart #define lpfc_mqe_command_MASK		0x000000FF
305b6e3b9c6SJames Smart #define lpfc_mqe_command_WORD		word0
306b6e3b9c6SJames Smart 	union {
3077ad20aa9SJames Smart 		struct lpfc_sli_config_emb0_subsys sli_config_emb0_subsys;
3087ad20aa9SJames Smart 		struct lpfc_sli_config_emb1_subsys sli_config_emb1_subsys;
309b6e3b9c6SJames Smart 	} un;
310b6e3b9c6SJames Smart };
3117ad20aa9SJames Smart 
312c691816eSJames Smart #define LPFC_FORCED_LINK_SPEED_NOT_SUPPORTED	0
313c691816eSJames Smart #define LPFC_FORCED_LINK_SPEED_SUPPORTED	1
314c691816eSJames Smart struct get_forced_link_speed_support {
315c691816eSJames Smart 	uint32_t command;
316c691816eSJames Smart };
317c691816eSJames Smart struct forced_link_speed_support_reply {
318c691816eSJames Smart 	uint8_t supported;
319c691816eSJames Smart };
320c691816eSJames Smart 
321d2cc9bcdSJames Smart struct lpfc_bsg_ras_req {
322d2cc9bcdSJames Smart 	uint32_t command;
323d2cc9bcdSJames Smart };
324d2cc9bcdSJames Smart 
325d2cc9bcdSJames Smart struct lpfc_bsg_get_fwlog_req {
326d2cc9bcdSJames Smart 	uint32_t command;
327d2cc9bcdSJames Smart 	uint32_t read_size;
328d2cc9bcdSJames Smart 	uint32_t read_offset;
329d2cc9bcdSJames Smart };
330d2cc9bcdSJames Smart 
331d2cc9bcdSJames Smart struct lpfc_bsg_get_ras_lwpd {
332d2cc9bcdSJames Smart 	uint32_t offset;
333d2cc9bcdSJames Smart 	uint32_t wrap_count;
334d2cc9bcdSJames Smart };
335d2cc9bcdSJames Smart 
336d2cc9bcdSJames Smart struct lpfc_bsg_set_ras_config_req {
337d2cc9bcdSJames Smart 	uint32_t command;
338d2cc9bcdSJames Smart 	uint8_t action;
339d2cc9bcdSJames Smart #define LPFC_RASACTION_STOP_LOGGING     0x00
340d2cc9bcdSJames Smart #define LPFC_RASACTION_START_LOGGING    0x01
341d2cc9bcdSJames Smart 	uint8_t log_level;
342d2cc9bcdSJames Smart };
343d2cc9bcdSJames Smart 
344d2cc9bcdSJames Smart struct lpfc_bsg_get_ras_config_reply {
345d2cc9bcdSJames Smart 	uint8_t state;
346d2cc9bcdSJames Smart #define LPFC_RASLOG_STATE_STOPPED 0x00
347d2cc9bcdSJames Smart #define LPFC_RASLOG_STATE_RUNNING 0x01
348d2cc9bcdSJames Smart 	uint8_t log_level;
349d2cc9bcdSJames Smart 	uint32_t log_buff_sz;
350d2cc9bcdSJames Smart };
351d2cc9bcdSJames Smart 
3521dc5ec24SJames Smart struct lpfc_trunk_info {
3531dc5ec24SJames Smart 	uint32_t word0;
3541dc5ec24SJames Smart #define lpfc_trunk_info_link_status_SHIFT      0
3551dc5ec24SJames Smart #define lpfc_trunk_info_link_status_MASK       1
3561dc5ec24SJames Smart #define lpfc_trunk_info_link_status_WORD       word0
3571dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active0_SHIFT    8
3581dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active0_MASK     1
3591dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active0_WORD     word0
3601dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active1_SHIFT    9
3611dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active1_MASK     1
3621dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active1_WORD     word0
3631dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active2_SHIFT    10
3641dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active2_MASK     1
3651dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active2_WORD     word0
3661dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active3_SHIFT    11
3671dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active3_MASK     1
3681dc5ec24SJames Smart #define lpfc_trunk_info_trunk_active3_WORD     word0
3691dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config0_SHIFT    12
3701dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config0_MASK     1
3711dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config0_WORD     word0
3721dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config1_SHIFT    13
3731dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config1_MASK     1
3741dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config1_WORD     word0
3751dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config2_SHIFT    14
3761dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config2_MASK     1
3771dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config2_WORD     word0
3781dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config3_SHIFT    15
3791dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config3_MASK     1
3801dc5ec24SJames Smart #define lpfc_trunk_info_trunk_config3_WORD     word0
3811dc5ec24SJames Smart 	uint16_t    port_speed;
3821dc5ec24SJames Smart 	uint16_t    logical_speed;
3831dc5ec24SJames Smart 	uint32_t    reserved3;
3841dc5ec24SJames Smart };
3851dc5ec24SJames Smart 
3861dc5ec24SJames Smart struct get_trunk_info_req {
3871dc5ec24SJames Smart 	uint32_t command;
3881dc5ec24SJames Smart };
389d2cc9bcdSJames Smart 
390*acbaa8c8SJames Smart struct get_cgnbuf_info_req {
391*acbaa8c8SJames Smart 	uint32_t command;
392*acbaa8c8SJames Smart 	uint32_t read_size;
393*acbaa8c8SJames Smart 	uint32_t reset;
394*acbaa8c8SJames Smart #define LPFC_BSG_CGN_RESET_STAT		1
395*acbaa8c8SJames Smart };
396*acbaa8c8SJames Smart 
3977ad20aa9SJames Smart /* driver only */
3987ad20aa9SJames Smart #define SLI_CONFIG_NOT_HANDLED		0
3997ad20aa9SJames Smart #define SLI_CONFIG_HANDLED		1
400