blob: 999e49f6071e14772aadbc067ade71bca141d5a1 [file] [log] [blame]
James Smartda0436e2009-05-22 14:51:39 -04001/*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. *
4 * Copyright (C) 2009 Emulex. All rights reserved. *
5 * EMULEX and SLI are trademarks of Emulex. *
6 * www.emulex.com *
7 * *
8 * This program is free software; you can redistribute it and/or *
9 * modify it under the terms of version 2 of the GNU General *
10 * Public License as published by the Free Software Foundation. *
11 * This program is distributed in the hope that it will be useful. *
12 * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
13 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
14 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
15 * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
16 * TO BE LEGALLY INVALID. See the GNU General Public License for *
17 * more details, a copy of which can be found in the file COPYING *
18 * included with this package. *
19 *******************************************************************/
20
21/* Macros to deal with bit fields. Each bit field must have 3 #defines
22 * associated with it (_SHIFT, _MASK, and _WORD).
23 * EG. For a bit field that is in the 7th bit of the "field4" field of a
24 * structure and is 2 bits in size the following #defines must exist:
25 * struct temp {
26 * uint32_t field1;
27 * uint32_t field2;
28 * uint32_t field3;
29 * uint32_t field4;
30 * #define example_bit_field_SHIFT 7
31 * #define example_bit_field_MASK 0x03
32 * #define example_bit_field_WORD field4
33 * uint32_t field5;
34 * };
35 * Then the macros below may be used to get or set the value of that field.
36 * EG. To get the value of the bit field from the above example:
37 * struct temp t1;
38 * value = bf_get(example_bit_field, &t1);
39 * And then to set that bit field:
40 * bf_set(example_bit_field, &t1, 2);
41 * Or clear that bit field:
42 * bf_set(example_bit_field, &t1, 0);
43 */
44#define bf_get(name, ptr) \
45 (((ptr)->name##_WORD >> name##_SHIFT) & name##_MASK)
46#define bf_set(name, ptr, value) \
47 ((ptr)->name##_WORD = ((((value) & name##_MASK) << name##_SHIFT) | \
48 ((ptr)->name##_WORD & ~(name##_MASK << name##_SHIFT))))
49
50struct dma_address {
51 uint32_t addr_lo;
52 uint32_t addr_hi;
53};
54
James Smart8fa38512009-07-19 10:01:03 -040055#define LPFC_SLIREV_CONF_WORD 0x58
56struct lpfc_sli_intf {
57 uint32_t word0;
58#define lpfc_sli_intf_iftype_MASK 0x00000007
59#define lpfc_sli_intf_iftype_SHIFT 0
60#define lpfc_sli_intf_iftype_WORD word0
61#define lpfc_sli_intf_rev_MASK 0x0000000f
62#define lpfc_sli_intf_rev_SHIFT 4
63#define lpfc_sli_intf_rev_WORD word0
64#define LPFC_SLIREV_CONF_SLI4 4
65#define lpfc_sli_intf_family_MASK 0x000000ff
66#define lpfc_sli_intf_family_SHIFT 8
67#define lpfc_sli_intf_family_WORD word0
68#define lpfc_sli_intf_feat1_MASK 0x000000ff
69#define lpfc_sli_intf_feat1_SHIFT 16
70#define lpfc_sli_intf_feat1_WORD word0
71#define lpfc_sli_intf_feat2_MASK 0x0000001f
72#define lpfc_sli_intf_feat2_SHIFT 24
73#define lpfc_sli_intf_feat2_WORD word0
74#define lpfc_sli_intf_valid_MASK 0x00000007
75#define lpfc_sli_intf_valid_SHIFT 29
76#define lpfc_sli_intf_valid_WORD word0
77#define LPFC_SLI_INTF_VALID 6
78};
79
James Smartda0436e2009-05-22 14:51:39 -040080#define LPFC_SLI4_MBX_EMBED true
81#define LPFC_SLI4_MBX_NEMBED false
82
83#define LPFC_SLI4_MB_WORD_COUNT 64
84#define LPFC_MAX_MQ_PAGE 8
85#define LPFC_MAX_WQ_PAGE 8
86#define LPFC_MAX_CQ_PAGE 4
87#define LPFC_MAX_EQ_PAGE 8
88
89#define LPFC_VIR_FUNC_MAX 32 /* Maximum number of virtual functions */
90#define LPFC_PCI_FUNC_MAX 5 /* Maximum number of PCI functions */
91#define LPFC_VFR_PAGE_SIZE 0x1000 /* 4KB BAR2 per-VF register page size */
92
93/* Define SLI4 Alignment requirements. */
94#define LPFC_ALIGN_16_BYTE 16
95#define LPFC_ALIGN_64_BYTE 64
96
97/* Define SLI4 specific definitions. */
98#define LPFC_MQ_CQE_BYTE_OFFSET 256
99#define LPFC_MBX_CMD_HDR_LENGTH 16
100#define LPFC_MBX_ERROR_RANGE 0x4000
101#define LPFC_BMBX_BIT1_ADDR_HI 0x2
102#define LPFC_BMBX_BIT1_ADDR_LO 0
103#define LPFC_RPI_HDR_COUNT 64
104#define LPFC_HDR_TEMPLATE_SIZE 4096
105#define LPFC_RPI_ALLOC_ERROR 0xFFFF
106#define LPFC_FCF_RECORD_WD_CNT 132
107#define LPFC_ENTIRE_FCF_DATABASE 0
108#define LPFC_DFLT_FCF_INDEX 0
109
110/* Virtual function numbers */
111#define LPFC_VF0 0
112#define LPFC_VF1 1
113#define LPFC_VF2 2
114#define LPFC_VF3 3
115#define LPFC_VF4 4
116#define LPFC_VF5 5
117#define LPFC_VF6 6
118#define LPFC_VF7 7
119#define LPFC_VF8 8
120#define LPFC_VF9 9
121#define LPFC_VF10 10
122#define LPFC_VF11 11
123#define LPFC_VF12 12
124#define LPFC_VF13 13
125#define LPFC_VF14 14
126#define LPFC_VF15 15
127#define LPFC_VF16 16
128#define LPFC_VF17 17
129#define LPFC_VF18 18
130#define LPFC_VF19 19
131#define LPFC_VF20 20
132#define LPFC_VF21 21
133#define LPFC_VF22 22
134#define LPFC_VF23 23
135#define LPFC_VF24 24
136#define LPFC_VF25 25
137#define LPFC_VF26 26
138#define LPFC_VF27 27
139#define LPFC_VF28 28
140#define LPFC_VF29 29
141#define LPFC_VF30 30
142#define LPFC_VF31 31
143
144/* PCI function numbers */
145#define LPFC_PCI_FUNC0 0
146#define LPFC_PCI_FUNC1 1
147#define LPFC_PCI_FUNC2 2
148#define LPFC_PCI_FUNC3 3
149#define LPFC_PCI_FUNC4 4
150
151/* Active interrupt test count */
152#define LPFC_ACT_INTR_CNT 4
153
154/* Delay Multiplier constant */
155#define LPFC_DMULT_CONST 651042
156#define LPFC_MIM_IMAX 636
157#define LPFC_FP_DEF_IMAX 10000
158#define LPFC_SP_DEF_IMAX 10000
159
160struct ulp_bde64 {
161 union ULP_BDE_TUS {
162 uint32_t w;
163 struct {
164#ifdef __BIG_ENDIAN_BITFIELD
165 uint32_t bdeFlags:8; /* BDE Flags 0 IS A SUPPORTED
166 VALUE !! */
167 uint32_t bdeSize:24; /* Size of buffer (in bytes) */
168#else /* __LITTLE_ENDIAN_BITFIELD */
169 uint32_t bdeSize:24; /* Size of buffer (in bytes) */
170 uint32_t bdeFlags:8; /* BDE Flags 0 IS A SUPPORTED
171 VALUE !! */
172#endif
173#define BUFF_TYPE_BDE_64 0x00 /* BDE (Host_resident) */
174#define BUFF_TYPE_BDE_IMMED 0x01 /* Immediate Data BDE */
175#define BUFF_TYPE_BDE_64P 0x02 /* BDE (Port-resident) */
176#define BUFF_TYPE_BDE_64I 0x08 /* Input BDE (Host-resident) */
177#define BUFF_TYPE_BDE_64IP 0x0A /* Input BDE (Port-resident) */
178#define BUFF_TYPE_BLP_64 0x40 /* BLP (Host-resident) */
179#define BUFF_TYPE_BLP_64P 0x42 /* BLP (Port-resident) */
180 } f;
181 } tus;
182 uint32_t addrLow;
183 uint32_t addrHigh;
184};
185
186struct lpfc_sli4_flags {
187 uint32_t word0;
188#define lpfc_fip_flag_SHIFT 0
189#define lpfc_fip_flag_MASK 0x00000001
190#define lpfc_fip_flag_WORD word0
191};
192
James Smart5ffc2662009-11-18 15:39:44 -0500193struct sli4_bls_acc {
194 uint32_t word0_rsvd; /* Word0 must be reserved */
195 uint32_t word1;
196#define lpfc_abts_orig_SHIFT 0
197#define lpfc_abts_orig_MASK 0x00000001
198#define lpfc_abts_orig_WORD word1
199#define LPFC_ABTS_UNSOL_RSP 1
200#define LPFC_ABTS_UNSOL_INT 0
201 uint32_t word2;
202#define lpfc_abts_rxid_SHIFT 0
203#define lpfc_abts_rxid_MASK 0x0000FFFF
204#define lpfc_abts_rxid_WORD word2
205#define lpfc_abts_oxid_SHIFT 16
206#define lpfc_abts_oxid_MASK 0x0000FFFF
207#define lpfc_abts_oxid_WORD word2
208 uint32_t word3;
209 uint32_t word4;
210 uint32_t word5_rsvd; /* Word5 must be reserved */
211};
212
James Smartda0436e2009-05-22 14:51:39 -0400213/* event queue entry structure */
214struct lpfc_eqe {
215 uint32_t word0;
216#define lpfc_eqe_resource_id_SHIFT 16
217#define lpfc_eqe_resource_id_MASK 0x000000FF
218#define lpfc_eqe_resource_id_WORD word0
219#define lpfc_eqe_minor_code_SHIFT 4
220#define lpfc_eqe_minor_code_MASK 0x00000FFF
221#define lpfc_eqe_minor_code_WORD word0
222#define lpfc_eqe_major_code_SHIFT 1
223#define lpfc_eqe_major_code_MASK 0x00000007
224#define lpfc_eqe_major_code_WORD word0
225#define lpfc_eqe_valid_SHIFT 0
226#define lpfc_eqe_valid_MASK 0x00000001
227#define lpfc_eqe_valid_WORD word0
228};
229
230/* completion queue entry structure (common fields for all cqe types) */
231struct lpfc_cqe {
232 uint32_t reserved0;
233 uint32_t reserved1;
234 uint32_t reserved2;
235 uint32_t word3;
236#define lpfc_cqe_valid_SHIFT 31
237#define lpfc_cqe_valid_MASK 0x00000001
238#define lpfc_cqe_valid_WORD word3
239#define lpfc_cqe_code_SHIFT 16
240#define lpfc_cqe_code_MASK 0x000000FF
241#define lpfc_cqe_code_WORD word3
242};
243
244/* Completion Queue Entry Status Codes */
245#define CQE_STATUS_SUCCESS 0x0
246#define CQE_STATUS_FCP_RSP_FAILURE 0x1
247#define CQE_STATUS_REMOTE_STOP 0x2
248#define CQE_STATUS_LOCAL_REJECT 0x3
249#define CQE_STATUS_NPORT_RJT 0x4
250#define CQE_STATUS_FABRIC_RJT 0x5
251#define CQE_STATUS_NPORT_BSY 0x6
252#define CQE_STATUS_FABRIC_BSY 0x7
253#define CQE_STATUS_INTERMED_RSP 0x8
254#define CQE_STATUS_LS_RJT 0x9
255#define CQE_STATUS_CMD_REJECT 0xb
256#define CQE_STATUS_FCP_TGT_LENCHECK 0xc
257#define CQE_STATUS_NEED_BUFF_ENTRY 0xf
258
259/* Status returned by hardware (valid only if status = CQE_STATUS_SUCCESS). */
260#define CQE_HW_STATUS_NO_ERR 0x0
261#define CQE_HW_STATUS_UNDERRUN 0x1
262#define CQE_HW_STATUS_OVERRUN 0x2
263
264/* Completion Queue Entry Codes */
265#define CQE_CODE_COMPL_WQE 0x1
266#define CQE_CODE_RELEASE_WQE 0x2
267#define CQE_CODE_RECEIVE 0x4
268#define CQE_CODE_XRI_ABORTED 0x5
269
270/* completion queue entry for wqe completions */
271struct lpfc_wcqe_complete {
272 uint32_t word0;
273#define lpfc_wcqe_c_request_tag_SHIFT 16
274#define lpfc_wcqe_c_request_tag_MASK 0x0000FFFF
275#define lpfc_wcqe_c_request_tag_WORD word0
276#define lpfc_wcqe_c_status_SHIFT 8
277#define lpfc_wcqe_c_status_MASK 0x000000FF
278#define lpfc_wcqe_c_status_WORD word0
279#define lpfc_wcqe_c_hw_status_SHIFT 0
280#define lpfc_wcqe_c_hw_status_MASK 0x000000FF
281#define lpfc_wcqe_c_hw_status_WORD word0
282 uint32_t total_data_placed;
283 uint32_t parameter;
284 uint32_t word3;
285#define lpfc_wcqe_c_valid_SHIFT lpfc_cqe_valid_SHIFT
286#define lpfc_wcqe_c_valid_MASK lpfc_cqe_valid_MASK
287#define lpfc_wcqe_c_valid_WORD lpfc_cqe_valid_WORD
288#define lpfc_wcqe_c_xb_SHIFT 28
289#define lpfc_wcqe_c_xb_MASK 0x00000001
290#define lpfc_wcqe_c_xb_WORD word3
291#define lpfc_wcqe_c_pv_SHIFT 27
292#define lpfc_wcqe_c_pv_MASK 0x00000001
293#define lpfc_wcqe_c_pv_WORD word3
294#define lpfc_wcqe_c_priority_SHIFT 24
295#define lpfc_wcqe_c_priority_MASK 0x00000007
296#define lpfc_wcqe_c_priority_WORD word3
297#define lpfc_wcqe_c_code_SHIFT lpfc_cqe_code_SHIFT
298#define lpfc_wcqe_c_code_MASK lpfc_cqe_code_MASK
299#define lpfc_wcqe_c_code_WORD lpfc_cqe_code_WORD
300};
301
302/* completion queue entry for wqe release */
303struct lpfc_wcqe_release {
304 uint32_t reserved0;
305 uint32_t reserved1;
306 uint32_t word2;
307#define lpfc_wcqe_r_wq_id_SHIFT 16
308#define lpfc_wcqe_r_wq_id_MASK 0x0000FFFF
309#define lpfc_wcqe_r_wq_id_WORD word2
310#define lpfc_wcqe_r_wqe_index_SHIFT 0
311#define lpfc_wcqe_r_wqe_index_MASK 0x0000FFFF
312#define lpfc_wcqe_r_wqe_index_WORD word2
313 uint32_t word3;
314#define lpfc_wcqe_r_valid_SHIFT lpfc_cqe_valid_SHIFT
315#define lpfc_wcqe_r_valid_MASK lpfc_cqe_valid_MASK
316#define lpfc_wcqe_r_valid_WORD lpfc_cqe_valid_WORD
317#define lpfc_wcqe_r_code_SHIFT lpfc_cqe_code_SHIFT
318#define lpfc_wcqe_r_code_MASK lpfc_cqe_code_MASK
319#define lpfc_wcqe_r_code_WORD lpfc_cqe_code_WORD
320};
321
322struct sli4_wcqe_xri_aborted {
323 uint32_t word0;
324#define lpfc_wcqe_xa_status_SHIFT 8
325#define lpfc_wcqe_xa_status_MASK 0x000000FF
326#define lpfc_wcqe_xa_status_WORD word0
327 uint32_t parameter;
328 uint32_t word2;
329#define lpfc_wcqe_xa_remote_xid_SHIFT 16
330#define lpfc_wcqe_xa_remote_xid_MASK 0x0000FFFF
331#define lpfc_wcqe_xa_remote_xid_WORD word2
332#define lpfc_wcqe_xa_xri_SHIFT 0
333#define lpfc_wcqe_xa_xri_MASK 0x0000FFFF
334#define lpfc_wcqe_xa_xri_WORD word2
335 uint32_t word3;
336#define lpfc_wcqe_xa_valid_SHIFT lpfc_cqe_valid_SHIFT
337#define lpfc_wcqe_xa_valid_MASK lpfc_cqe_valid_MASK
338#define lpfc_wcqe_xa_valid_WORD lpfc_cqe_valid_WORD
339#define lpfc_wcqe_xa_ia_SHIFT 30
340#define lpfc_wcqe_xa_ia_MASK 0x00000001
341#define lpfc_wcqe_xa_ia_WORD word3
342#define CQE_XRI_ABORTED_IA_REMOTE 0
343#define CQE_XRI_ABORTED_IA_LOCAL 1
344#define lpfc_wcqe_xa_br_SHIFT 29
345#define lpfc_wcqe_xa_br_MASK 0x00000001
346#define lpfc_wcqe_xa_br_WORD word3
347#define CQE_XRI_ABORTED_BR_BA_ACC 0
348#define CQE_XRI_ABORTED_BR_BA_RJT 1
349#define lpfc_wcqe_xa_eo_SHIFT 28
350#define lpfc_wcqe_xa_eo_MASK 0x00000001
351#define lpfc_wcqe_xa_eo_WORD word3
352#define CQE_XRI_ABORTED_EO_REMOTE 0
353#define CQE_XRI_ABORTED_EO_LOCAL 1
354#define lpfc_wcqe_xa_code_SHIFT lpfc_cqe_code_SHIFT
355#define lpfc_wcqe_xa_code_MASK lpfc_cqe_code_MASK
356#define lpfc_wcqe_xa_code_WORD lpfc_cqe_code_WORD
357};
358
359/* completion queue entry structure for rqe completion */
360struct lpfc_rcqe {
361 uint32_t word0;
362#define lpfc_rcqe_bindex_SHIFT 16
363#define lpfc_rcqe_bindex_MASK 0x0000FFF
364#define lpfc_rcqe_bindex_WORD word0
365#define lpfc_rcqe_status_SHIFT 8
366#define lpfc_rcqe_status_MASK 0x000000FF
367#define lpfc_rcqe_status_WORD word0
368#define FC_STATUS_RQ_SUCCESS 0x10 /* Async receive successful */
369#define FC_STATUS_RQ_BUF_LEN_EXCEEDED 0x11 /* payload truncated */
370#define FC_STATUS_INSUFF_BUF_NEED_BUF 0x12 /* Insufficient buffers */
371#define FC_STATUS_INSUFF_BUF_FRM_DISC 0x13 /* Frame Discard */
372 uint32_t reserved1;
373 uint32_t word2;
374#define lpfc_rcqe_length_SHIFT 16
375#define lpfc_rcqe_length_MASK 0x0000FFFF
376#define lpfc_rcqe_length_WORD word2
377#define lpfc_rcqe_rq_id_SHIFT 6
378#define lpfc_rcqe_rq_id_MASK 0x000003FF
379#define lpfc_rcqe_rq_id_WORD word2
380#define lpfc_rcqe_fcf_id_SHIFT 0
381#define lpfc_rcqe_fcf_id_MASK 0x0000003F
382#define lpfc_rcqe_fcf_id_WORD word2
383 uint32_t word3;
384#define lpfc_rcqe_valid_SHIFT lpfc_cqe_valid_SHIFT
385#define lpfc_rcqe_valid_MASK lpfc_cqe_valid_MASK
386#define lpfc_rcqe_valid_WORD lpfc_cqe_valid_WORD
387#define lpfc_rcqe_port_SHIFT 30
388#define lpfc_rcqe_port_MASK 0x00000001
389#define lpfc_rcqe_port_WORD word3
390#define lpfc_rcqe_hdr_length_SHIFT 24
391#define lpfc_rcqe_hdr_length_MASK 0x0000001F
392#define lpfc_rcqe_hdr_length_WORD word3
393#define lpfc_rcqe_code_SHIFT lpfc_cqe_code_SHIFT
394#define lpfc_rcqe_code_MASK lpfc_cqe_code_MASK
395#define lpfc_rcqe_code_WORD lpfc_cqe_code_WORD
396#define lpfc_rcqe_eof_SHIFT 8
397#define lpfc_rcqe_eof_MASK 0x000000FF
398#define lpfc_rcqe_eof_WORD word3
399#define FCOE_EOFn 0x41
400#define FCOE_EOFt 0x42
401#define FCOE_EOFni 0x49
402#define FCOE_EOFa 0x50
403#define lpfc_rcqe_sof_SHIFT 0
404#define lpfc_rcqe_sof_MASK 0x000000FF
405#define lpfc_rcqe_sof_WORD word3
406#define FCOE_SOFi2 0x2d
407#define FCOE_SOFi3 0x2e
408#define FCOE_SOFn2 0x35
409#define FCOE_SOFn3 0x36
410};
411
412struct lpfc_wqe_generic{
413 struct ulp_bde64 bde;
414 uint32_t word3;
415 uint32_t word4;
416 uint32_t word5;
417 uint32_t word6;
418#define lpfc_wqe_gen_context_SHIFT 16
419#define lpfc_wqe_gen_context_MASK 0x0000FFFF
420#define lpfc_wqe_gen_context_WORD word6
421#define lpfc_wqe_gen_xri_SHIFT 0
422#define lpfc_wqe_gen_xri_MASK 0x0000FFFF
423#define lpfc_wqe_gen_xri_WORD word6
424 uint32_t word7;
425#define lpfc_wqe_gen_lnk_SHIFT 23
426#define lpfc_wqe_gen_lnk_MASK 0x00000001
427#define lpfc_wqe_gen_lnk_WORD word7
428#define lpfc_wqe_gen_erp_SHIFT 22
429#define lpfc_wqe_gen_erp_MASK 0x00000001
430#define lpfc_wqe_gen_erp_WORD word7
431#define lpfc_wqe_gen_pu_SHIFT 20
432#define lpfc_wqe_gen_pu_MASK 0x00000003
433#define lpfc_wqe_gen_pu_WORD word7
434#define lpfc_wqe_gen_class_SHIFT 16
435#define lpfc_wqe_gen_class_MASK 0x00000007
436#define lpfc_wqe_gen_class_WORD word7
437#define lpfc_wqe_gen_command_SHIFT 8
438#define lpfc_wqe_gen_command_MASK 0x000000FF
439#define lpfc_wqe_gen_command_WORD word7
440#define lpfc_wqe_gen_status_SHIFT 4
441#define lpfc_wqe_gen_status_MASK 0x0000000F
442#define lpfc_wqe_gen_status_WORD word7
443#define lpfc_wqe_gen_ct_SHIFT 2
James Smart6669f9b2009-10-02 15:16:45 -0400444#define lpfc_wqe_gen_ct_MASK 0x00000003
James Smartda0436e2009-05-22 14:51:39 -0400445#define lpfc_wqe_gen_ct_WORD word7
446 uint32_t abort_tag;
447 uint32_t word9;
448#define lpfc_wqe_gen_request_tag_SHIFT 0
449#define lpfc_wqe_gen_request_tag_MASK 0x0000FFFF
450#define lpfc_wqe_gen_request_tag_WORD word9
451 uint32_t word10;
452#define lpfc_wqe_gen_ccp_SHIFT 24
453#define lpfc_wqe_gen_ccp_MASK 0x000000FF
454#define lpfc_wqe_gen_ccp_WORD word10
455#define lpfc_wqe_gen_ccpe_SHIFT 23
456#define lpfc_wqe_gen_ccpe_MASK 0x00000001
457#define lpfc_wqe_gen_ccpe_WORD word10
458#define lpfc_wqe_gen_pv_SHIFT 19
459#define lpfc_wqe_gen_pv_MASK 0x00000001
460#define lpfc_wqe_gen_pv_WORD word10
461#define lpfc_wqe_gen_pri_SHIFT 16
462#define lpfc_wqe_gen_pri_MASK 0x00000007
463#define lpfc_wqe_gen_pri_WORD word10
464 uint32_t word11;
465#define lpfc_wqe_gen_cq_id_SHIFT 16
James Smartf1126682009-06-10 17:22:44 -0400466#define lpfc_wqe_gen_cq_id_MASK 0x0000FFFF
James Smartda0436e2009-05-22 14:51:39 -0400467#define lpfc_wqe_gen_cq_id_WORD word11
James Smartf1126682009-06-10 17:22:44 -0400468#define LPFC_WQE_CQ_ID_DEFAULT 0xffff
James Smartda0436e2009-05-22 14:51:39 -0400469#define lpfc_wqe_gen_wqec_SHIFT 7
470#define lpfc_wqe_gen_wqec_MASK 0x00000001
471#define lpfc_wqe_gen_wqec_WORD word11
James Smartc8685952009-11-18 15:39:16 -0500472#define ELS_ID_FLOGI 3
473#define ELS_ID_FDISC 2
474#define ELS_ID_LOGO 1
475#define ELS_ID_DEFAULT 0
476#define lpfc_wqe_gen_els_id_SHIFT 4
477#define lpfc_wqe_gen_els_id_MASK 0x00000003
478#define lpfc_wqe_gen_els_id_WORD word11
James Smartda0436e2009-05-22 14:51:39 -0400479#define lpfc_wqe_gen_cmd_type_SHIFT 0
480#define lpfc_wqe_gen_cmd_type_MASK 0x0000000F
481#define lpfc_wqe_gen_cmd_type_WORD word11
482 uint32_t payload[4];
483};
484
485struct lpfc_rqe {
486 uint32_t address_hi;
487 uint32_t address_lo;
488};
489
490/* buffer descriptors */
491struct lpfc_bde4 {
492 uint32_t addr_hi;
493 uint32_t addr_lo;
494 uint32_t word2;
495#define lpfc_bde4_last_SHIFT 31
496#define lpfc_bde4_last_MASK 0x00000001
497#define lpfc_bde4_last_WORD word2
498#define lpfc_bde4_sge_offset_SHIFT 0
499#define lpfc_bde4_sge_offset_MASK 0x000003FF
500#define lpfc_bde4_sge_offset_WORD word2
501 uint32_t word3;
502#define lpfc_bde4_length_SHIFT 0
503#define lpfc_bde4_length_MASK 0x000000FF
504#define lpfc_bde4_length_WORD word3
505};
506
507struct lpfc_register {
508 uint32_t word0;
509};
510
511#define LPFC_UERR_STATUS_HI 0x00A4
512#define LPFC_UERR_STATUS_LO 0x00A0
James Smarta747c9c2009-11-18 15:41:10 -0500513#define LPFC_UE_MASK_HI 0x00AC
514#define LPFC_UE_MASK_LO 0x00A8
James Smartda0436e2009-05-22 14:51:39 -0400515#define LPFC_SCRATCHPAD 0x0058
516
517/* BAR0 Registers */
518#define LPFC_HST_STATE 0x00AC
519#define lpfc_hst_state_perr_SHIFT 31
520#define lpfc_hst_state_perr_MASK 0x1
521#define lpfc_hst_state_perr_WORD word0
522#define lpfc_hst_state_sfi_SHIFT 30
523#define lpfc_hst_state_sfi_MASK 0x1
524#define lpfc_hst_state_sfi_WORD word0
525#define lpfc_hst_state_nip_SHIFT 29
526#define lpfc_hst_state_nip_MASK 0x1
527#define lpfc_hst_state_nip_WORD word0
528#define lpfc_hst_state_ipc_SHIFT 28
529#define lpfc_hst_state_ipc_MASK 0x1
530#define lpfc_hst_state_ipc_WORD word0
531#define lpfc_hst_state_xrom_SHIFT 27
532#define lpfc_hst_state_xrom_MASK 0x1
533#define lpfc_hst_state_xrom_WORD word0
534#define lpfc_hst_state_dl_SHIFT 26
535#define lpfc_hst_state_dl_MASK 0x1
536#define lpfc_hst_state_dl_WORD word0
537#define lpfc_hst_state_port_status_SHIFT 0
538#define lpfc_hst_state_port_status_MASK 0xFFFF
539#define lpfc_hst_state_port_status_WORD word0
540
541#define LPFC_POST_STAGE_POWER_ON_RESET 0x0000
542#define LPFC_POST_STAGE_AWAITING_HOST_RDY 0x0001
543#define LPFC_POST_STAGE_HOST_RDY 0x0002
544#define LPFC_POST_STAGE_BE_RESET 0x0003
545#define LPFC_POST_STAGE_SEEPROM_CS_START 0x0100
546#define LPFC_POST_STAGE_SEEPROM_CS_DONE 0x0101
547#define LPFC_POST_STAGE_DDR_CONFIG_START 0x0200
548#define LPFC_POST_STAGE_DDR_CONFIG_DONE 0x0201
549#define LPFC_POST_STAGE_DDR_CALIBRATE_START 0x0300
550#define LPFC_POST_STAGE_DDR_CALIBRATE_DONE 0x0301
551#define LPFC_POST_STAGE_DDR_TEST_START 0x0400
552#define LPFC_POST_STAGE_DDR_TEST_DONE 0x0401
553#define LPFC_POST_STAGE_REDBOOT_INIT_START 0x0600
554#define LPFC_POST_STAGE_REDBOOT_INIT_DONE 0x0601
555#define LPFC_POST_STAGE_FW_IMAGE_LOAD_START 0x0700
556#define LPFC_POST_STAGE_FW_IMAGE_LOAD_DONE 0x0701
557#define LPFC_POST_STAGE_ARMFW_START 0x0800
558#define LPFC_POST_STAGE_DHCP_QUERY_START 0x0900
559#define LPFC_POST_STAGE_DHCP_QUERY_DONE 0x0901
560#define LPFC_POST_STAGE_BOOT_TARGET_DISCOVERY_START 0x0A00
561#define LPFC_POST_STAGE_BOOT_TARGET_DISCOVERY_DONE 0x0A01
562#define LPFC_POST_STAGE_RC_OPTION_SET 0x0B00
563#define LPFC_POST_STAGE_SWITCH_LINK 0x0B01
564#define LPFC_POST_STAGE_SEND_ICDS_MESSAGE 0x0B02
565#define LPFC_POST_STAGE_PERFROM_TFTP 0x0B03
566#define LPFC_POST_STAGE_PARSE_XML 0x0B04
567#define LPFC_POST_STAGE_DOWNLOAD_IMAGE 0x0B05
568#define LPFC_POST_STAGE_FLASH_IMAGE 0x0B06
569#define LPFC_POST_STAGE_RC_DONE 0x0B07
570#define LPFC_POST_STAGE_REBOOT_SYSTEM 0x0B08
571#define LPFC_POST_STAGE_MAC_ADDRESS 0x0C00
572#define LPFC_POST_STAGE_ARMFW_READY 0xC000
573#define LPFC_POST_STAGE_ARMFW_UE 0xF000
574
575#define lpfc_scratchpad_slirev_SHIFT 4
576#define lpfc_scratchpad_slirev_MASK 0xF
577#define lpfc_scratchpad_slirev_WORD word0
578#define lpfc_scratchpad_chiptype_SHIFT 8
579#define lpfc_scratchpad_chiptype_MASK 0xFF
580#define lpfc_scratchpad_chiptype_WORD word0
581#define lpfc_scratchpad_featurelevel1_SHIFT 16
582#define lpfc_scratchpad_featurelevel1_MASK 0xFF
583#define lpfc_scratchpad_featurelevel1_WORD word0
584#define lpfc_scratchpad_featurelevel2_SHIFT 24
585#define lpfc_scratchpad_featurelevel2_MASK 0xFF
586#define lpfc_scratchpad_featurelevel2_WORD word0
587
588/* BAR1 Registers */
589#define LPFC_IMR_MASK_ALL 0xFFFFFFFF
590#define LPFC_ISCR_CLEAR_ALL 0xFFFFFFFF
591
592#define LPFC_HST_ISR0 0x0C18
593#define LPFC_HST_ISR1 0x0C1C
594#define LPFC_HST_ISR2 0x0C20
595#define LPFC_HST_ISR3 0x0C24
596#define LPFC_HST_ISR4 0x0C28
597
598#define LPFC_HST_IMR0 0x0C48
599#define LPFC_HST_IMR1 0x0C4C
600#define LPFC_HST_IMR2 0x0C50
601#define LPFC_HST_IMR3 0x0C54
602#define LPFC_HST_IMR4 0x0C58
603
604#define LPFC_HST_ISCR0 0x0C78
605#define LPFC_HST_ISCR1 0x0C7C
606#define LPFC_HST_ISCR2 0x0C80
607#define LPFC_HST_ISCR3 0x0C84
608#define LPFC_HST_ISCR4 0x0C88
609
610#define LPFC_SLI4_INTR0 BIT0
611#define LPFC_SLI4_INTR1 BIT1
612#define LPFC_SLI4_INTR2 BIT2
613#define LPFC_SLI4_INTR3 BIT3
614#define LPFC_SLI4_INTR4 BIT4
615#define LPFC_SLI4_INTR5 BIT5
616#define LPFC_SLI4_INTR6 BIT6
617#define LPFC_SLI4_INTR7 BIT7
618#define LPFC_SLI4_INTR8 BIT8
619#define LPFC_SLI4_INTR9 BIT9
620#define LPFC_SLI4_INTR10 BIT10
621#define LPFC_SLI4_INTR11 BIT11
622#define LPFC_SLI4_INTR12 BIT12
623#define LPFC_SLI4_INTR13 BIT13
624#define LPFC_SLI4_INTR14 BIT14
625#define LPFC_SLI4_INTR15 BIT15
626#define LPFC_SLI4_INTR16 BIT16
627#define LPFC_SLI4_INTR17 BIT17
628#define LPFC_SLI4_INTR18 BIT18
629#define LPFC_SLI4_INTR19 BIT19
630#define LPFC_SLI4_INTR20 BIT20
631#define LPFC_SLI4_INTR21 BIT21
632#define LPFC_SLI4_INTR22 BIT22
633#define LPFC_SLI4_INTR23 BIT23
634#define LPFC_SLI4_INTR24 BIT24
635#define LPFC_SLI4_INTR25 BIT25
636#define LPFC_SLI4_INTR26 BIT26
637#define LPFC_SLI4_INTR27 BIT27
638#define LPFC_SLI4_INTR28 BIT28
639#define LPFC_SLI4_INTR29 BIT29
640#define LPFC_SLI4_INTR30 BIT30
641#define LPFC_SLI4_INTR31 BIT31
642
643/* BAR2 Registers */
644#define LPFC_RQ_DOORBELL 0x00A0
645#define lpfc_rq_doorbell_num_posted_SHIFT 16
646#define lpfc_rq_doorbell_num_posted_MASK 0x3FFF
647#define lpfc_rq_doorbell_num_posted_WORD word0
648#define LPFC_RQ_POST_BATCH 8 /* RQEs to post at one time */
649#define lpfc_rq_doorbell_id_SHIFT 0
650#define lpfc_rq_doorbell_id_MASK 0x03FF
651#define lpfc_rq_doorbell_id_WORD word0
652
653#define LPFC_WQ_DOORBELL 0x0040
654#define lpfc_wq_doorbell_num_posted_SHIFT 24
655#define lpfc_wq_doorbell_num_posted_MASK 0x00FF
656#define lpfc_wq_doorbell_num_posted_WORD word0
657#define lpfc_wq_doorbell_index_SHIFT 16
658#define lpfc_wq_doorbell_index_MASK 0x00FF
659#define lpfc_wq_doorbell_index_WORD word0
660#define lpfc_wq_doorbell_id_SHIFT 0
661#define lpfc_wq_doorbell_id_MASK 0xFFFF
662#define lpfc_wq_doorbell_id_WORD word0
663
664#define LPFC_EQCQ_DOORBELL 0x0120
665#define lpfc_eqcq_doorbell_arm_SHIFT 29
666#define lpfc_eqcq_doorbell_arm_MASK 0x0001
667#define lpfc_eqcq_doorbell_arm_WORD word0
668#define lpfc_eqcq_doorbell_num_released_SHIFT 16
669#define lpfc_eqcq_doorbell_num_released_MASK 0x1FFF
670#define lpfc_eqcq_doorbell_num_released_WORD word0
671#define lpfc_eqcq_doorbell_qt_SHIFT 10
672#define lpfc_eqcq_doorbell_qt_MASK 0x0001
673#define lpfc_eqcq_doorbell_qt_WORD word0
674#define LPFC_QUEUE_TYPE_COMPLETION 0
675#define LPFC_QUEUE_TYPE_EVENT 1
676#define lpfc_eqcq_doorbell_eqci_SHIFT 9
677#define lpfc_eqcq_doorbell_eqci_MASK 0x0001
678#define lpfc_eqcq_doorbell_eqci_WORD word0
679#define lpfc_eqcq_doorbell_cqid_SHIFT 0
680#define lpfc_eqcq_doorbell_cqid_MASK 0x03FF
681#define lpfc_eqcq_doorbell_cqid_WORD word0
682#define lpfc_eqcq_doorbell_eqid_SHIFT 0
683#define lpfc_eqcq_doorbell_eqid_MASK 0x01FF
684#define lpfc_eqcq_doorbell_eqid_WORD word0
685
686#define LPFC_BMBX 0x0160
687#define lpfc_bmbx_addr_SHIFT 2
688#define lpfc_bmbx_addr_MASK 0x3FFFFFFF
689#define lpfc_bmbx_addr_WORD word0
690#define lpfc_bmbx_hi_SHIFT 1
691#define lpfc_bmbx_hi_MASK 0x0001
692#define lpfc_bmbx_hi_WORD word0
693#define lpfc_bmbx_rdy_SHIFT 0
694#define lpfc_bmbx_rdy_MASK 0x0001
695#define lpfc_bmbx_rdy_WORD word0
696
697#define LPFC_MQ_DOORBELL 0x0140
698#define lpfc_mq_doorbell_num_posted_SHIFT 16
699#define lpfc_mq_doorbell_num_posted_MASK 0x3FFF
700#define lpfc_mq_doorbell_num_posted_WORD word0
701#define lpfc_mq_doorbell_id_SHIFT 0
702#define lpfc_mq_doorbell_id_MASK 0x03FF
703#define lpfc_mq_doorbell_id_WORD word0
704
705struct lpfc_sli4_cfg_mhdr {
706 uint32_t word1;
707#define lpfc_mbox_hdr_emb_SHIFT 0
708#define lpfc_mbox_hdr_emb_MASK 0x00000001
709#define lpfc_mbox_hdr_emb_WORD word1
710#define lpfc_mbox_hdr_sge_cnt_SHIFT 3
711#define lpfc_mbox_hdr_sge_cnt_MASK 0x0000001F
712#define lpfc_mbox_hdr_sge_cnt_WORD word1
713 uint32_t payload_length;
714 uint32_t tag_lo;
715 uint32_t tag_hi;
716 uint32_t reserved5;
717};
718
719union lpfc_sli4_cfg_shdr {
720 struct {
721 uint32_t word6;
722#define lpfc_mbox_hdr_opcode_SHIFT 0
723#define lpfc_mbox_hdr_opcode_MASK 0x000000FF
724#define lpfc_mbox_hdr_opcode_WORD word6
725#define lpfc_mbox_hdr_subsystem_SHIFT 8
726#define lpfc_mbox_hdr_subsystem_MASK 0x000000FF
727#define lpfc_mbox_hdr_subsystem_WORD word6
728#define lpfc_mbox_hdr_port_number_SHIFT 16
729#define lpfc_mbox_hdr_port_number_MASK 0x000000FF
730#define lpfc_mbox_hdr_port_number_WORD word6
731#define lpfc_mbox_hdr_domain_SHIFT 24
732#define lpfc_mbox_hdr_domain_MASK 0x000000FF
733#define lpfc_mbox_hdr_domain_WORD word6
734 uint32_t timeout;
735 uint32_t request_length;
736 uint32_t reserved9;
737 } request;
738 struct {
739 uint32_t word6;
740#define lpfc_mbox_hdr_opcode_SHIFT 0
741#define lpfc_mbox_hdr_opcode_MASK 0x000000FF
742#define lpfc_mbox_hdr_opcode_WORD word6
743#define lpfc_mbox_hdr_subsystem_SHIFT 8
744#define lpfc_mbox_hdr_subsystem_MASK 0x000000FF
745#define lpfc_mbox_hdr_subsystem_WORD word6
746#define lpfc_mbox_hdr_domain_SHIFT 24
747#define lpfc_mbox_hdr_domain_MASK 0x000000FF
748#define lpfc_mbox_hdr_domain_WORD word6
749 uint32_t word7;
750#define lpfc_mbox_hdr_status_SHIFT 0
751#define lpfc_mbox_hdr_status_MASK 0x000000FF
752#define lpfc_mbox_hdr_status_WORD word7
753#define lpfc_mbox_hdr_add_status_SHIFT 8
754#define lpfc_mbox_hdr_add_status_MASK 0x000000FF
755#define lpfc_mbox_hdr_add_status_WORD word7
756 uint32_t response_length;
757 uint32_t actual_response_length;
758 } response;
759};
760
761/* Mailbox structures */
762struct mbox_header {
763 struct lpfc_sli4_cfg_mhdr cfg_mhdr;
764 union lpfc_sli4_cfg_shdr cfg_shdr;
765};
766
767/* Subsystem Definitions */
768#define LPFC_MBOX_SUBSYSTEM_COMMON 0x1
769#define LPFC_MBOX_SUBSYSTEM_FCOE 0xC
770
771/* Device Specific Definitions */
772
773/* The HOST ENDIAN defines are in Big Endian format. */
774#define HOST_ENDIAN_LOW_WORD0 0xFF3412FF
775#define HOST_ENDIAN_HIGH_WORD1 0xFF7856FF
776
777/* Common Opcodes */
778#define LPFC_MBOX_OPCODE_CQ_CREATE 0x0C
779#define LPFC_MBOX_OPCODE_EQ_CREATE 0x0D
780#define LPFC_MBOX_OPCODE_MQ_CREATE 0x15
781#define LPFC_MBOX_OPCODE_GET_CNTL_ATTRIBUTES 0x20
782#define LPFC_MBOX_OPCODE_NOP 0x21
783#define LPFC_MBOX_OPCODE_MQ_DESTROY 0x35
784#define LPFC_MBOX_OPCODE_CQ_DESTROY 0x36
785#define LPFC_MBOX_OPCODE_EQ_DESTROY 0x37
James Smart6669f9b2009-10-02 15:16:45 -0400786#define LPFC_MBOX_OPCODE_QUERY_FW_CFG 0x3A
James Smartda0436e2009-05-22 14:51:39 -0400787#define LPFC_MBOX_OPCODE_FUNCTION_RESET 0x3D
788
789/* FCoE Opcodes */
790#define LPFC_MBOX_OPCODE_FCOE_WQ_CREATE 0x01
791#define LPFC_MBOX_OPCODE_FCOE_WQ_DESTROY 0x02
792#define LPFC_MBOX_OPCODE_FCOE_POST_SGL_PAGES 0x03
793#define LPFC_MBOX_OPCODE_FCOE_REMOVE_SGL_PAGES 0x04
794#define LPFC_MBOX_OPCODE_FCOE_RQ_CREATE 0x05
795#define LPFC_MBOX_OPCODE_FCOE_RQ_DESTROY 0x06
796#define LPFC_MBOX_OPCODE_FCOE_READ_FCF_TABLE 0x08
797#define LPFC_MBOX_OPCODE_FCOE_ADD_FCF 0x09
798#define LPFC_MBOX_OPCODE_FCOE_DELETE_FCF 0x0A
799#define LPFC_MBOX_OPCODE_FCOE_POST_HDR_TEMPLATE 0x0B
James Smartecfd03c2010-02-12 14:41:27 -0500800#define LPFC_MBOX_OPCODE_FCOE_REDISCOVER_FCF 0x10
James Smartda0436e2009-05-22 14:51:39 -0400801
802/* Mailbox command structures */
803struct eq_context {
804 uint32_t word0;
805#define lpfc_eq_context_size_SHIFT 31
806#define lpfc_eq_context_size_MASK 0x00000001
807#define lpfc_eq_context_size_WORD word0
808#define LPFC_EQE_SIZE_4 0x0
809#define LPFC_EQE_SIZE_16 0x1
810#define lpfc_eq_context_valid_SHIFT 29
811#define lpfc_eq_context_valid_MASK 0x00000001
812#define lpfc_eq_context_valid_WORD word0
813 uint32_t word1;
814#define lpfc_eq_context_count_SHIFT 26
815#define lpfc_eq_context_count_MASK 0x00000003
816#define lpfc_eq_context_count_WORD word1
817#define LPFC_EQ_CNT_256 0x0
818#define LPFC_EQ_CNT_512 0x1
819#define LPFC_EQ_CNT_1024 0x2
820#define LPFC_EQ_CNT_2048 0x3
821#define LPFC_EQ_CNT_4096 0x4
822 uint32_t word2;
823#define lpfc_eq_context_delay_multi_SHIFT 13
824#define lpfc_eq_context_delay_multi_MASK 0x000003FF
825#define lpfc_eq_context_delay_multi_WORD word2
826 uint32_t reserved3;
827};
828
829struct sgl_page_pairs {
830 uint32_t sgl_pg0_addr_lo;
831 uint32_t sgl_pg0_addr_hi;
832 uint32_t sgl_pg1_addr_lo;
833 uint32_t sgl_pg1_addr_hi;
834};
835
836struct lpfc_mbx_post_sgl_pages {
837 struct mbox_header header;
838 uint32_t word0;
839#define lpfc_post_sgl_pages_xri_SHIFT 0
840#define lpfc_post_sgl_pages_xri_MASK 0x0000FFFF
841#define lpfc_post_sgl_pages_xri_WORD word0
842#define lpfc_post_sgl_pages_xricnt_SHIFT 16
843#define lpfc_post_sgl_pages_xricnt_MASK 0x0000FFFF
844#define lpfc_post_sgl_pages_xricnt_WORD word0
845 struct sgl_page_pairs sgl_pg_pairs[1];
846};
847
848/* word0 of page-1 struct shares the same SHIFT/MASK/WORD defines as above */
849struct lpfc_mbx_post_uembed_sgl_page1 {
850 union lpfc_sli4_cfg_shdr cfg_shdr;
851 uint32_t word0;
852 struct sgl_page_pairs sgl_pg_pairs;
853};
854
855struct lpfc_mbx_sge {
856 uint32_t pa_lo;
857 uint32_t pa_hi;
858 uint32_t length;
859};
860
861struct lpfc_mbx_nembed_cmd {
862 struct lpfc_sli4_cfg_mhdr cfg_mhdr;
863#define LPFC_SLI4_MBX_SGE_MAX_PAGES 19
864 struct lpfc_mbx_sge sge[LPFC_SLI4_MBX_SGE_MAX_PAGES];
865};
866
867struct lpfc_mbx_nembed_sge_virt {
868 void *addr[LPFC_SLI4_MBX_SGE_MAX_PAGES];
869};
870
871struct lpfc_mbx_eq_create {
872 struct mbox_header header;
873 union {
874 struct {
875 uint32_t word0;
876#define lpfc_mbx_eq_create_num_pages_SHIFT 0
877#define lpfc_mbx_eq_create_num_pages_MASK 0x0000FFFF
878#define lpfc_mbx_eq_create_num_pages_WORD word0
879 struct eq_context context;
880 struct dma_address page[LPFC_MAX_EQ_PAGE];
881 } request;
882 struct {
883 uint32_t word0;
884#define lpfc_mbx_eq_create_q_id_SHIFT 0
885#define lpfc_mbx_eq_create_q_id_MASK 0x0000FFFF
886#define lpfc_mbx_eq_create_q_id_WORD word0
887 } response;
888 } u;
889};
890
891struct lpfc_mbx_eq_destroy {
892 struct mbox_header header;
893 union {
894 struct {
895 uint32_t word0;
896#define lpfc_mbx_eq_destroy_q_id_SHIFT 0
897#define lpfc_mbx_eq_destroy_q_id_MASK 0x0000FFFF
898#define lpfc_mbx_eq_destroy_q_id_WORD word0
899 } request;
900 struct {
901 uint32_t word0;
902 } response;
903 } u;
904};
905
906struct lpfc_mbx_nop {
907 struct mbox_header header;
908 uint32_t context[2];
909};
910
911struct cq_context {
912 uint32_t word0;
913#define lpfc_cq_context_event_SHIFT 31
914#define lpfc_cq_context_event_MASK 0x00000001
915#define lpfc_cq_context_event_WORD word0
916#define lpfc_cq_context_valid_SHIFT 29
917#define lpfc_cq_context_valid_MASK 0x00000001
918#define lpfc_cq_context_valid_WORD word0
919#define lpfc_cq_context_count_SHIFT 27
920#define lpfc_cq_context_count_MASK 0x00000003
921#define lpfc_cq_context_count_WORD word0
922#define LPFC_CQ_CNT_256 0x0
923#define LPFC_CQ_CNT_512 0x1
924#define LPFC_CQ_CNT_1024 0x2
925 uint32_t word1;
926#define lpfc_cq_eq_id_SHIFT 22
927#define lpfc_cq_eq_id_MASK 0x000000FF
928#define lpfc_cq_eq_id_WORD word1
929 uint32_t reserved0;
930 uint32_t reserved1;
931};
932
933struct lpfc_mbx_cq_create {
934 struct mbox_header header;
935 union {
936 struct {
937 uint32_t word0;
938#define lpfc_mbx_cq_create_num_pages_SHIFT 0
939#define lpfc_mbx_cq_create_num_pages_MASK 0x0000FFFF
940#define lpfc_mbx_cq_create_num_pages_WORD word0
941 struct cq_context context;
942 struct dma_address page[LPFC_MAX_CQ_PAGE];
943 } request;
944 struct {
945 uint32_t word0;
946#define lpfc_mbx_cq_create_q_id_SHIFT 0
947#define lpfc_mbx_cq_create_q_id_MASK 0x0000FFFF
948#define lpfc_mbx_cq_create_q_id_WORD word0
949 } response;
950 } u;
951};
952
953struct lpfc_mbx_cq_destroy {
954 struct mbox_header header;
955 union {
956 struct {
957 uint32_t word0;
958#define lpfc_mbx_cq_destroy_q_id_SHIFT 0
959#define lpfc_mbx_cq_destroy_q_id_MASK 0x0000FFFF
960#define lpfc_mbx_cq_destroy_q_id_WORD word0
961 } request;
962 struct {
963 uint32_t word0;
964 } response;
965 } u;
966};
967
968struct wq_context {
969 uint32_t reserved0;
970 uint32_t reserved1;
971 uint32_t reserved2;
972 uint32_t reserved3;
973};
974
975struct lpfc_mbx_wq_create {
976 struct mbox_header header;
977 union {
978 struct {
979 uint32_t word0;
980#define lpfc_mbx_wq_create_num_pages_SHIFT 0
981#define lpfc_mbx_wq_create_num_pages_MASK 0x0000FFFF
982#define lpfc_mbx_wq_create_num_pages_WORD word0
983#define lpfc_mbx_wq_create_cq_id_SHIFT 16
984#define lpfc_mbx_wq_create_cq_id_MASK 0x0000FFFF
985#define lpfc_mbx_wq_create_cq_id_WORD word0
986 struct dma_address page[LPFC_MAX_WQ_PAGE];
987 } request;
988 struct {
989 uint32_t word0;
990#define lpfc_mbx_wq_create_q_id_SHIFT 0
991#define lpfc_mbx_wq_create_q_id_MASK 0x0000FFFF
992#define lpfc_mbx_wq_create_q_id_WORD word0
993 } response;
994 } u;
995};
996
997struct lpfc_mbx_wq_destroy {
998 struct mbox_header header;
999 union {
1000 struct {
1001 uint32_t word0;
1002#define lpfc_mbx_wq_destroy_q_id_SHIFT 0
1003#define lpfc_mbx_wq_destroy_q_id_MASK 0x0000FFFF
1004#define lpfc_mbx_wq_destroy_q_id_WORD word0
1005 } request;
1006 struct {
1007 uint32_t word0;
1008 } response;
1009 } u;
1010};
1011
1012#define LPFC_HDR_BUF_SIZE 128
James Smarteeead812009-12-21 17:01:23 -05001013#define LPFC_DATA_BUF_SIZE 2048
James Smartda0436e2009-05-22 14:51:39 -04001014struct rq_context {
1015 uint32_t word0;
1016#define lpfc_rq_context_rq_size_SHIFT 16
1017#define lpfc_rq_context_rq_size_MASK 0x0000000F
1018#define lpfc_rq_context_rq_size_WORD word0
1019#define LPFC_RQ_RING_SIZE_512 9 /* 512 entries */
1020#define LPFC_RQ_RING_SIZE_1024 10 /* 1024 entries */
1021#define LPFC_RQ_RING_SIZE_2048 11 /* 2048 entries */
1022#define LPFC_RQ_RING_SIZE_4096 12 /* 4096 entries */
1023 uint32_t reserved1;
1024 uint32_t word2;
1025#define lpfc_rq_context_cq_id_SHIFT 16
1026#define lpfc_rq_context_cq_id_MASK 0x000003FF
1027#define lpfc_rq_context_cq_id_WORD word2
1028#define lpfc_rq_context_buf_size_SHIFT 0
1029#define lpfc_rq_context_buf_size_MASK 0x0000FFFF
1030#define lpfc_rq_context_buf_size_WORD word2
1031 uint32_t reserved3;
1032};
1033
1034struct lpfc_mbx_rq_create {
1035 struct mbox_header header;
1036 union {
1037 struct {
1038 uint32_t word0;
1039#define lpfc_mbx_rq_create_num_pages_SHIFT 0
1040#define lpfc_mbx_rq_create_num_pages_MASK 0x0000FFFF
1041#define lpfc_mbx_rq_create_num_pages_WORD word0
1042 struct rq_context context;
1043 struct dma_address page[LPFC_MAX_WQ_PAGE];
1044 } request;
1045 struct {
1046 uint32_t word0;
1047#define lpfc_mbx_rq_create_q_id_SHIFT 0
1048#define lpfc_mbx_rq_create_q_id_MASK 0x0000FFFF
1049#define lpfc_mbx_rq_create_q_id_WORD word0
1050 } response;
1051 } u;
1052};
1053
1054struct lpfc_mbx_rq_destroy {
1055 struct mbox_header header;
1056 union {
1057 struct {
1058 uint32_t word0;
1059#define lpfc_mbx_rq_destroy_q_id_SHIFT 0
1060#define lpfc_mbx_rq_destroy_q_id_MASK 0x0000FFFF
1061#define lpfc_mbx_rq_destroy_q_id_WORD word0
1062 } request;
1063 struct {
1064 uint32_t word0;
1065 } response;
1066 } u;
1067};
1068
1069struct mq_context {
1070 uint32_t word0;
1071#define lpfc_mq_context_cq_id_SHIFT 22
1072#define lpfc_mq_context_cq_id_MASK 0x000003FF
1073#define lpfc_mq_context_cq_id_WORD word0
1074#define lpfc_mq_context_count_SHIFT 16
1075#define lpfc_mq_context_count_MASK 0x0000000F
1076#define lpfc_mq_context_count_WORD word0
1077#define LPFC_MQ_CNT_16 0x5
1078#define LPFC_MQ_CNT_32 0x6
1079#define LPFC_MQ_CNT_64 0x7
1080#define LPFC_MQ_CNT_128 0x8
1081 uint32_t word1;
1082#define lpfc_mq_context_valid_SHIFT 31
1083#define lpfc_mq_context_valid_MASK 0x00000001
1084#define lpfc_mq_context_valid_WORD word1
1085 uint32_t reserved2;
1086 uint32_t reserved3;
1087};
1088
1089struct lpfc_mbx_mq_create {
1090 struct mbox_header header;
1091 union {
1092 struct {
1093 uint32_t word0;
1094#define lpfc_mbx_mq_create_num_pages_SHIFT 0
1095#define lpfc_mbx_mq_create_num_pages_MASK 0x0000FFFF
1096#define lpfc_mbx_mq_create_num_pages_WORD word0
1097 struct mq_context context;
1098 struct dma_address page[LPFC_MAX_MQ_PAGE];
1099 } request;
1100 struct {
1101 uint32_t word0;
1102#define lpfc_mbx_mq_create_q_id_SHIFT 0
1103#define lpfc_mbx_mq_create_q_id_MASK 0x0000FFFF
1104#define lpfc_mbx_mq_create_q_id_WORD word0
1105 } response;
1106 } u;
1107};
1108
1109struct lpfc_mbx_mq_destroy {
1110 struct mbox_header header;
1111 union {
1112 struct {
1113 uint32_t word0;
1114#define lpfc_mbx_mq_destroy_q_id_SHIFT 0
1115#define lpfc_mbx_mq_destroy_q_id_MASK 0x0000FFFF
1116#define lpfc_mbx_mq_destroy_q_id_WORD word0
1117 } request;
1118 struct {
1119 uint32_t word0;
1120 } response;
1121 } u;
1122};
1123
1124struct lpfc_mbx_post_hdr_tmpl {
1125 struct mbox_header header;
1126 uint32_t word10;
1127#define lpfc_mbx_post_hdr_tmpl_rpi_offset_SHIFT 0
1128#define lpfc_mbx_post_hdr_tmpl_rpi_offset_MASK 0x0000FFFF
1129#define lpfc_mbx_post_hdr_tmpl_rpi_offset_WORD word10
1130#define lpfc_mbx_post_hdr_tmpl_page_cnt_SHIFT 16
1131#define lpfc_mbx_post_hdr_tmpl_page_cnt_MASK 0x0000FFFF
1132#define lpfc_mbx_post_hdr_tmpl_page_cnt_WORD word10
1133 uint32_t rpi_paddr_lo;
1134 uint32_t rpi_paddr_hi;
1135};
1136
1137struct sli4_sge { /* SLI-4 */
1138 uint32_t addr_hi;
1139 uint32_t addr_lo;
1140
1141 uint32_t word2;
1142#define lpfc_sli4_sge_offset_SHIFT 0 /* Offset of buffer - Not used*/
1143#define lpfc_sli4_sge_offset_MASK 0x00FFFFFF
1144#define lpfc_sli4_sge_offset_WORD word2
1145#define lpfc_sli4_sge_last_SHIFT 31 /* Last SEG in the SGL sets
1146 this flag !! */
1147#define lpfc_sli4_sge_last_MASK 0x00000001
1148#define lpfc_sli4_sge_last_WORD word2
1149 uint32_t word3;
1150#define lpfc_sli4_sge_len_SHIFT 0
1151#define lpfc_sli4_sge_len_MASK 0x0001FFFF
1152#define lpfc_sli4_sge_len_WORD word3
1153};
1154
1155struct fcf_record {
1156 uint32_t max_rcv_size;
1157 uint32_t fka_adv_period;
1158 uint32_t fip_priority;
1159 uint32_t word3;
1160#define lpfc_fcf_record_mac_0_SHIFT 0
1161#define lpfc_fcf_record_mac_0_MASK 0x000000FF
1162#define lpfc_fcf_record_mac_0_WORD word3
1163#define lpfc_fcf_record_mac_1_SHIFT 8
1164#define lpfc_fcf_record_mac_1_MASK 0x000000FF
1165#define lpfc_fcf_record_mac_1_WORD word3
1166#define lpfc_fcf_record_mac_2_SHIFT 16
1167#define lpfc_fcf_record_mac_2_MASK 0x000000FF
1168#define lpfc_fcf_record_mac_2_WORD word3
1169#define lpfc_fcf_record_mac_3_SHIFT 24
1170#define lpfc_fcf_record_mac_3_MASK 0x000000FF
1171#define lpfc_fcf_record_mac_3_WORD word3
1172 uint32_t word4;
1173#define lpfc_fcf_record_mac_4_SHIFT 0
1174#define lpfc_fcf_record_mac_4_MASK 0x000000FF
1175#define lpfc_fcf_record_mac_4_WORD word4
1176#define lpfc_fcf_record_mac_5_SHIFT 8
1177#define lpfc_fcf_record_mac_5_MASK 0x000000FF
1178#define lpfc_fcf_record_mac_5_WORD word4
1179#define lpfc_fcf_record_fcf_avail_SHIFT 16
1180#define lpfc_fcf_record_fcf_avail_MASK 0x000000FF
James Smart0c287582009-06-10 17:22:56 -04001181#define lpfc_fcf_record_fcf_avail_WORD word4
James Smartda0436e2009-05-22 14:51:39 -04001182#define lpfc_fcf_record_mac_addr_prov_SHIFT 24
1183#define lpfc_fcf_record_mac_addr_prov_MASK 0x000000FF
1184#define lpfc_fcf_record_mac_addr_prov_WORD word4
1185#define LPFC_FCF_FPMA 1 /* Fabric Provided MAC Address */
1186#define LPFC_FCF_SPMA 2 /* Server Provided MAC Address */
1187 uint32_t word5;
1188#define lpfc_fcf_record_fab_name_0_SHIFT 0
1189#define lpfc_fcf_record_fab_name_0_MASK 0x000000FF
1190#define lpfc_fcf_record_fab_name_0_WORD word5
1191#define lpfc_fcf_record_fab_name_1_SHIFT 8
1192#define lpfc_fcf_record_fab_name_1_MASK 0x000000FF
1193#define lpfc_fcf_record_fab_name_1_WORD word5
1194#define lpfc_fcf_record_fab_name_2_SHIFT 16
1195#define lpfc_fcf_record_fab_name_2_MASK 0x000000FF
1196#define lpfc_fcf_record_fab_name_2_WORD word5
1197#define lpfc_fcf_record_fab_name_3_SHIFT 24
1198#define lpfc_fcf_record_fab_name_3_MASK 0x000000FF
1199#define lpfc_fcf_record_fab_name_3_WORD word5
1200 uint32_t word6;
1201#define lpfc_fcf_record_fab_name_4_SHIFT 0
1202#define lpfc_fcf_record_fab_name_4_MASK 0x000000FF
1203#define lpfc_fcf_record_fab_name_4_WORD word6
1204#define lpfc_fcf_record_fab_name_5_SHIFT 8
1205#define lpfc_fcf_record_fab_name_5_MASK 0x000000FF
1206#define lpfc_fcf_record_fab_name_5_WORD word6
1207#define lpfc_fcf_record_fab_name_6_SHIFT 16
1208#define lpfc_fcf_record_fab_name_6_MASK 0x000000FF
1209#define lpfc_fcf_record_fab_name_6_WORD word6
1210#define lpfc_fcf_record_fab_name_7_SHIFT 24
1211#define lpfc_fcf_record_fab_name_7_MASK 0x000000FF
1212#define lpfc_fcf_record_fab_name_7_WORD word6
1213 uint32_t word7;
1214#define lpfc_fcf_record_fc_map_0_SHIFT 0
1215#define lpfc_fcf_record_fc_map_0_MASK 0x000000FF
1216#define lpfc_fcf_record_fc_map_0_WORD word7
1217#define lpfc_fcf_record_fc_map_1_SHIFT 8
1218#define lpfc_fcf_record_fc_map_1_MASK 0x000000FF
1219#define lpfc_fcf_record_fc_map_1_WORD word7
1220#define lpfc_fcf_record_fc_map_2_SHIFT 16
1221#define lpfc_fcf_record_fc_map_2_MASK 0x000000FF
1222#define lpfc_fcf_record_fc_map_2_WORD word7
1223#define lpfc_fcf_record_fcf_valid_SHIFT 24
1224#define lpfc_fcf_record_fcf_valid_MASK 0x000000FF
1225#define lpfc_fcf_record_fcf_valid_WORD word7
1226 uint32_t word8;
1227#define lpfc_fcf_record_fcf_index_SHIFT 0
1228#define lpfc_fcf_record_fcf_index_MASK 0x0000FFFF
1229#define lpfc_fcf_record_fcf_index_WORD word8
1230#define lpfc_fcf_record_fcf_state_SHIFT 16
1231#define lpfc_fcf_record_fcf_state_MASK 0x0000FFFF
1232#define lpfc_fcf_record_fcf_state_WORD word8
1233 uint8_t vlan_bitmap[512];
James Smart8fa38512009-07-19 10:01:03 -04001234 uint32_t word137;
1235#define lpfc_fcf_record_switch_name_0_SHIFT 0
1236#define lpfc_fcf_record_switch_name_0_MASK 0x000000FF
1237#define lpfc_fcf_record_switch_name_0_WORD word137
1238#define lpfc_fcf_record_switch_name_1_SHIFT 8
1239#define lpfc_fcf_record_switch_name_1_MASK 0x000000FF
1240#define lpfc_fcf_record_switch_name_1_WORD word137
1241#define lpfc_fcf_record_switch_name_2_SHIFT 16
1242#define lpfc_fcf_record_switch_name_2_MASK 0x000000FF
1243#define lpfc_fcf_record_switch_name_2_WORD word137
1244#define lpfc_fcf_record_switch_name_3_SHIFT 24
1245#define lpfc_fcf_record_switch_name_3_MASK 0x000000FF
1246#define lpfc_fcf_record_switch_name_3_WORD word137
1247 uint32_t word138;
1248#define lpfc_fcf_record_switch_name_4_SHIFT 0
1249#define lpfc_fcf_record_switch_name_4_MASK 0x000000FF
1250#define lpfc_fcf_record_switch_name_4_WORD word138
1251#define lpfc_fcf_record_switch_name_5_SHIFT 8
1252#define lpfc_fcf_record_switch_name_5_MASK 0x000000FF
1253#define lpfc_fcf_record_switch_name_5_WORD word138
1254#define lpfc_fcf_record_switch_name_6_SHIFT 16
1255#define lpfc_fcf_record_switch_name_6_MASK 0x000000FF
1256#define lpfc_fcf_record_switch_name_6_WORD word138
1257#define lpfc_fcf_record_switch_name_7_SHIFT 24
1258#define lpfc_fcf_record_switch_name_7_MASK 0x000000FF
1259#define lpfc_fcf_record_switch_name_7_WORD word138
James Smartda0436e2009-05-22 14:51:39 -04001260};
1261
1262struct lpfc_mbx_read_fcf_tbl {
1263 union lpfc_sli4_cfg_shdr cfg_shdr;
1264 union {
1265 struct {
1266 uint32_t word10;
1267#define lpfc_mbx_read_fcf_tbl_indx_SHIFT 0
1268#define lpfc_mbx_read_fcf_tbl_indx_MASK 0x0000FFFF
1269#define lpfc_mbx_read_fcf_tbl_indx_WORD word10
1270 } request;
1271 struct {
1272 uint32_t eventag;
1273 } response;
1274 } u;
1275 uint32_t word11;
1276#define lpfc_mbx_read_fcf_tbl_nxt_vindx_SHIFT 0
1277#define lpfc_mbx_read_fcf_tbl_nxt_vindx_MASK 0x0000FFFF
1278#define lpfc_mbx_read_fcf_tbl_nxt_vindx_WORD word11
1279};
1280
1281struct lpfc_mbx_add_fcf_tbl_entry {
1282 union lpfc_sli4_cfg_shdr cfg_shdr;
1283 uint32_t word10;
1284#define lpfc_mbx_add_fcf_tbl_fcfi_SHIFT 0
1285#define lpfc_mbx_add_fcf_tbl_fcfi_MASK 0x0000FFFF
1286#define lpfc_mbx_add_fcf_tbl_fcfi_WORD word10
1287 struct lpfc_mbx_sge fcf_sge;
1288};
1289
1290struct lpfc_mbx_del_fcf_tbl_entry {
1291 struct mbox_header header;
1292 uint32_t word10;
1293#define lpfc_mbx_del_fcf_tbl_count_SHIFT 0
1294#define lpfc_mbx_del_fcf_tbl_count_MASK 0x0000FFFF
1295#define lpfc_mbx_del_fcf_tbl_count_WORD word10
1296#define lpfc_mbx_del_fcf_tbl_index_SHIFT 16
1297#define lpfc_mbx_del_fcf_tbl_index_MASK 0x0000FFFF
1298#define lpfc_mbx_del_fcf_tbl_index_WORD word10
1299};
1300
James Smartecfd03c2010-02-12 14:41:27 -05001301struct lpfc_mbx_redisc_fcf_tbl {
1302 struct mbox_header header;
1303 uint32_t word10;
1304#define lpfc_mbx_redisc_fcf_count_SHIFT 0
1305#define lpfc_mbx_redisc_fcf_count_MASK 0x0000FFFF
1306#define lpfc_mbx_redisc_fcf_count_WORD word10
1307 uint32_t resvd;
1308 uint32_t word12;
1309#define lpfc_mbx_redisc_fcf_index_SHIFT 0
1310#define lpfc_mbx_redisc_fcf_index_MASK 0x0000FFFF
1311#define lpfc_mbx_redisc_fcf_index_WORD word12
1312};
1313
James Smart6669f9b2009-10-02 15:16:45 -04001314struct lpfc_mbx_query_fw_cfg {
1315 struct mbox_header header;
1316 uint32_t config_number;
1317 uint32_t asic_rev;
1318 uint32_t phys_port;
1319 uint32_t function_mode;
1320/* firmware Function Mode */
1321#define lpfc_function_mode_toe_SHIFT 0
1322#define lpfc_function_mode_toe_MASK 0x00000001
1323#define lpfc_function_mode_toe_WORD function_mode
1324#define lpfc_function_mode_nic_SHIFT 1
1325#define lpfc_function_mode_nic_MASK 0x00000001
1326#define lpfc_function_mode_nic_WORD function_mode
1327#define lpfc_function_mode_rdma_SHIFT 2
1328#define lpfc_function_mode_rdma_MASK 0x00000001
1329#define lpfc_function_mode_rdma_WORD function_mode
1330#define lpfc_function_mode_vm_SHIFT 3
1331#define lpfc_function_mode_vm_MASK 0x00000001
1332#define lpfc_function_mode_vm_WORD function_mode
1333#define lpfc_function_mode_iscsi_i_SHIFT 4
1334#define lpfc_function_mode_iscsi_i_MASK 0x00000001
1335#define lpfc_function_mode_iscsi_i_WORD function_mode
1336#define lpfc_function_mode_iscsi_t_SHIFT 5
1337#define lpfc_function_mode_iscsi_t_MASK 0x00000001
1338#define lpfc_function_mode_iscsi_t_WORD function_mode
1339#define lpfc_function_mode_fcoe_i_SHIFT 6
1340#define lpfc_function_mode_fcoe_i_MASK 0x00000001
1341#define lpfc_function_mode_fcoe_i_WORD function_mode
1342#define lpfc_function_mode_fcoe_t_SHIFT 7
1343#define lpfc_function_mode_fcoe_t_MASK 0x00000001
1344#define lpfc_function_mode_fcoe_t_WORD function_mode
1345#define lpfc_function_mode_dal_SHIFT 8
1346#define lpfc_function_mode_dal_MASK 0x00000001
1347#define lpfc_function_mode_dal_WORD function_mode
1348#define lpfc_function_mode_lro_SHIFT 9
1349#define lpfc_function_mode_lro_MASK 0x00000001
1350#define lpfc_function_mode_lro_WORD function_mode9
1351#define lpfc_function_mode_flex10_SHIFT 10
1352#define lpfc_function_mode_flex10_MASK 0x00000001
1353#define lpfc_function_mode_flex10_WORD function_mode
1354#define lpfc_function_mode_ncsi_SHIFT 11
1355#define lpfc_function_mode_ncsi_MASK 0x00000001
1356#define lpfc_function_mode_ncsi_WORD function_mode
1357};
1358
James Smartda0436e2009-05-22 14:51:39 -04001359/* Status field for embedded SLI_CONFIG mailbox command */
1360#define STATUS_SUCCESS 0x0
1361#define STATUS_FAILED 0x1
1362#define STATUS_ILLEGAL_REQUEST 0x2
1363#define STATUS_ILLEGAL_FIELD 0x3
1364#define STATUS_INSUFFICIENT_BUFFER 0x4
1365#define STATUS_UNAUTHORIZED_REQUEST 0x5
1366#define STATUS_FLASHROM_SAVE_FAILED 0x17
1367#define STATUS_FLASHROM_RESTORE_FAILED 0x18
1368#define STATUS_ICCBINDEX_ALLOC_FAILED 0x1a
1369#define STATUS_IOCTLHANDLE_ALLOC_FAILED 0x1b
1370#define STATUS_INVALID_PHY_ADDR_FROM_OSM 0x1c
1371#define STATUS_INVALID_PHY_ADDR_LEN_FROM_OSM 0x1d
1372#define STATUS_ASSERT_FAILED 0x1e
1373#define STATUS_INVALID_SESSION 0x1f
1374#define STATUS_INVALID_CONNECTION 0x20
1375#define STATUS_BTL_PATH_EXCEEDS_OSM_LIMIT 0x21
1376#define STATUS_BTL_NO_FREE_SLOT_PATH 0x24
1377#define STATUS_BTL_NO_FREE_SLOT_TGTID 0x25
1378#define STATUS_OSM_DEVSLOT_NOT_FOUND 0x26
1379#define STATUS_FLASHROM_READ_FAILED 0x27
1380#define STATUS_POLL_IOCTL_TIMEOUT 0x28
1381#define STATUS_ERROR_ACITMAIN 0x2a
1382#define STATUS_REBOOT_REQUIRED 0x2c
1383#define STATUS_FCF_IN_USE 0x3a
James Smartdef9c7a2009-12-21 17:02:28 -05001384#define STATUS_FCF_TABLE_EMPTY 0x43
James Smartda0436e2009-05-22 14:51:39 -04001385
1386struct lpfc_mbx_sli4_config {
1387 struct mbox_header header;
1388};
1389
1390struct lpfc_mbx_init_vfi {
1391 uint32_t word1;
1392#define lpfc_init_vfi_vr_SHIFT 31
1393#define lpfc_init_vfi_vr_MASK 0x00000001
1394#define lpfc_init_vfi_vr_WORD word1
1395#define lpfc_init_vfi_vt_SHIFT 30
1396#define lpfc_init_vfi_vt_MASK 0x00000001
1397#define lpfc_init_vfi_vt_WORD word1
1398#define lpfc_init_vfi_vf_SHIFT 29
1399#define lpfc_init_vfi_vf_MASK 0x00000001
1400#define lpfc_init_vfi_vf_WORD word1
1401#define lpfc_init_vfi_vfi_SHIFT 0
1402#define lpfc_init_vfi_vfi_MASK 0x0000FFFF
1403#define lpfc_init_vfi_vfi_WORD word1
1404 uint32_t word2;
1405#define lpfc_init_vfi_fcfi_SHIFT 0
1406#define lpfc_init_vfi_fcfi_MASK 0x0000FFFF
1407#define lpfc_init_vfi_fcfi_WORD word2
1408 uint32_t word3;
1409#define lpfc_init_vfi_pri_SHIFT 13
1410#define lpfc_init_vfi_pri_MASK 0x00000007
1411#define lpfc_init_vfi_pri_WORD word3
1412#define lpfc_init_vfi_vf_id_SHIFT 1
1413#define lpfc_init_vfi_vf_id_MASK 0x00000FFF
1414#define lpfc_init_vfi_vf_id_WORD word3
1415 uint32_t word4;
1416#define lpfc_init_vfi_hop_count_SHIFT 24
1417#define lpfc_init_vfi_hop_count_MASK 0x000000FF
1418#define lpfc_init_vfi_hop_count_WORD word4
1419};
1420
1421struct lpfc_mbx_reg_vfi {
1422 uint32_t word1;
1423#define lpfc_reg_vfi_vp_SHIFT 28
1424#define lpfc_reg_vfi_vp_MASK 0x00000001
1425#define lpfc_reg_vfi_vp_WORD word1
1426#define lpfc_reg_vfi_vfi_SHIFT 0
1427#define lpfc_reg_vfi_vfi_MASK 0x0000FFFF
1428#define lpfc_reg_vfi_vfi_WORD word1
1429 uint32_t word2;
1430#define lpfc_reg_vfi_vpi_SHIFT 16
1431#define lpfc_reg_vfi_vpi_MASK 0x0000FFFF
1432#define lpfc_reg_vfi_vpi_WORD word2
1433#define lpfc_reg_vfi_fcfi_SHIFT 0
1434#define lpfc_reg_vfi_fcfi_MASK 0x0000FFFF
1435#define lpfc_reg_vfi_fcfi_WORD word2
James Smartc8685952009-11-18 15:39:16 -05001436 uint32_t wwn[2];
James Smartda0436e2009-05-22 14:51:39 -04001437 struct ulp_bde64 bde;
1438 uint32_t word8_rsvd;
1439 uint32_t word9_rsvd;
1440 uint32_t word10;
1441#define lpfc_reg_vfi_nport_id_SHIFT 0
1442#define lpfc_reg_vfi_nport_id_MASK 0x00FFFFFF
1443#define lpfc_reg_vfi_nport_id_WORD word10
1444};
1445
1446struct lpfc_mbx_init_vpi {
1447 uint32_t word1;
1448#define lpfc_init_vpi_vfi_SHIFT 16
1449#define lpfc_init_vpi_vfi_MASK 0x0000FFFF
1450#define lpfc_init_vpi_vfi_WORD word1
1451#define lpfc_init_vpi_vpi_SHIFT 0
1452#define lpfc_init_vpi_vpi_MASK 0x0000FFFF
1453#define lpfc_init_vpi_vpi_WORD word1
1454};
1455
1456struct lpfc_mbx_read_vpi {
1457 uint32_t word1_rsvd;
1458 uint32_t word2;
1459#define lpfc_mbx_read_vpi_vnportid_SHIFT 0
1460#define lpfc_mbx_read_vpi_vnportid_MASK 0x00FFFFFF
1461#define lpfc_mbx_read_vpi_vnportid_WORD word2
1462 uint32_t word3_rsvd;
1463 uint32_t word4;
1464#define lpfc_mbx_read_vpi_acq_alpa_SHIFT 0
1465#define lpfc_mbx_read_vpi_acq_alpa_MASK 0x000000FF
1466#define lpfc_mbx_read_vpi_acq_alpa_WORD word4
1467#define lpfc_mbx_read_vpi_pb_SHIFT 15
1468#define lpfc_mbx_read_vpi_pb_MASK 0x00000001
1469#define lpfc_mbx_read_vpi_pb_WORD word4
1470#define lpfc_mbx_read_vpi_spec_alpa_SHIFT 16
1471#define lpfc_mbx_read_vpi_spec_alpa_MASK 0x000000FF
1472#define lpfc_mbx_read_vpi_spec_alpa_WORD word4
1473#define lpfc_mbx_read_vpi_ns_SHIFT 30
1474#define lpfc_mbx_read_vpi_ns_MASK 0x00000001
1475#define lpfc_mbx_read_vpi_ns_WORD word4
1476#define lpfc_mbx_read_vpi_hl_SHIFT 31
1477#define lpfc_mbx_read_vpi_hl_MASK 0x00000001
1478#define lpfc_mbx_read_vpi_hl_WORD word4
1479 uint32_t word5_rsvd;
1480 uint32_t word6;
1481#define lpfc_mbx_read_vpi_vpi_SHIFT 0
1482#define lpfc_mbx_read_vpi_vpi_MASK 0x0000FFFF
1483#define lpfc_mbx_read_vpi_vpi_WORD word6
1484 uint32_t word7;
1485#define lpfc_mbx_read_vpi_mac_0_SHIFT 0
1486#define lpfc_mbx_read_vpi_mac_0_MASK 0x000000FF
1487#define lpfc_mbx_read_vpi_mac_0_WORD word7
1488#define lpfc_mbx_read_vpi_mac_1_SHIFT 8
1489#define lpfc_mbx_read_vpi_mac_1_MASK 0x000000FF
1490#define lpfc_mbx_read_vpi_mac_1_WORD word7
1491#define lpfc_mbx_read_vpi_mac_2_SHIFT 16
1492#define lpfc_mbx_read_vpi_mac_2_MASK 0x000000FF
1493#define lpfc_mbx_read_vpi_mac_2_WORD word7
1494#define lpfc_mbx_read_vpi_mac_3_SHIFT 24
1495#define lpfc_mbx_read_vpi_mac_3_MASK 0x000000FF
1496#define lpfc_mbx_read_vpi_mac_3_WORD word7
1497 uint32_t word8;
1498#define lpfc_mbx_read_vpi_mac_4_SHIFT 0
1499#define lpfc_mbx_read_vpi_mac_4_MASK 0x000000FF
1500#define lpfc_mbx_read_vpi_mac_4_WORD word8
1501#define lpfc_mbx_read_vpi_mac_5_SHIFT 8
1502#define lpfc_mbx_read_vpi_mac_5_MASK 0x000000FF
1503#define lpfc_mbx_read_vpi_mac_5_WORD word8
1504#define lpfc_mbx_read_vpi_vlan_tag_SHIFT 16
1505#define lpfc_mbx_read_vpi_vlan_tag_MASK 0x00000FFF
1506#define lpfc_mbx_read_vpi_vlan_tag_WORD word8
1507#define lpfc_mbx_read_vpi_vv_SHIFT 28
1508#define lpfc_mbx_read_vpi_vv_MASK 0x0000001
1509#define lpfc_mbx_read_vpi_vv_WORD word8
1510};
1511
1512struct lpfc_mbx_unreg_vfi {
1513 uint32_t word1_rsvd;
1514 uint32_t word2;
1515#define lpfc_unreg_vfi_vfi_SHIFT 0
1516#define lpfc_unreg_vfi_vfi_MASK 0x0000FFFF
1517#define lpfc_unreg_vfi_vfi_WORD word2
1518};
1519
1520struct lpfc_mbx_resume_rpi {
1521 uint32_t word1;
James Smart8fa38512009-07-19 10:01:03 -04001522#define lpfc_resume_rpi_index_SHIFT 0
1523#define lpfc_resume_rpi_index_MASK 0x0000FFFF
1524#define lpfc_resume_rpi_index_WORD word1
1525#define lpfc_resume_rpi_ii_SHIFT 30
1526#define lpfc_resume_rpi_ii_MASK 0x00000003
1527#define lpfc_resume_rpi_ii_WORD word1
1528#define RESUME_INDEX_RPI 0
1529#define RESUME_INDEX_VPI 1
1530#define RESUME_INDEX_VFI 2
1531#define RESUME_INDEX_FCFI 3
James Smartda0436e2009-05-22 14:51:39 -04001532 uint32_t event_tag;
James Smartda0436e2009-05-22 14:51:39 -04001533};
1534
1535#define REG_FCF_INVALID_QID 0xFFFF
1536struct lpfc_mbx_reg_fcfi {
1537 uint32_t word1;
1538#define lpfc_reg_fcfi_info_index_SHIFT 0
1539#define lpfc_reg_fcfi_info_index_MASK 0x0000FFFF
1540#define lpfc_reg_fcfi_info_index_WORD word1
1541#define lpfc_reg_fcfi_fcfi_SHIFT 16
1542#define lpfc_reg_fcfi_fcfi_MASK 0x0000FFFF
1543#define lpfc_reg_fcfi_fcfi_WORD word1
1544 uint32_t word2;
1545#define lpfc_reg_fcfi_rq_id1_SHIFT 0
1546#define lpfc_reg_fcfi_rq_id1_MASK 0x0000FFFF
1547#define lpfc_reg_fcfi_rq_id1_WORD word2
1548#define lpfc_reg_fcfi_rq_id0_SHIFT 16
1549#define lpfc_reg_fcfi_rq_id0_MASK 0x0000FFFF
1550#define lpfc_reg_fcfi_rq_id0_WORD word2
1551 uint32_t word3;
1552#define lpfc_reg_fcfi_rq_id3_SHIFT 0
1553#define lpfc_reg_fcfi_rq_id3_MASK 0x0000FFFF
1554#define lpfc_reg_fcfi_rq_id3_WORD word3
1555#define lpfc_reg_fcfi_rq_id2_SHIFT 16
1556#define lpfc_reg_fcfi_rq_id2_MASK 0x0000FFFF
1557#define lpfc_reg_fcfi_rq_id2_WORD word3
1558 uint32_t word4;
1559#define lpfc_reg_fcfi_type_match0_SHIFT 24
1560#define lpfc_reg_fcfi_type_match0_MASK 0x000000FF
1561#define lpfc_reg_fcfi_type_match0_WORD word4
1562#define lpfc_reg_fcfi_type_mask0_SHIFT 16
1563#define lpfc_reg_fcfi_type_mask0_MASK 0x000000FF
1564#define lpfc_reg_fcfi_type_mask0_WORD word4
1565#define lpfc_reg_fcfi_rctl_match0_SHIFT 8
1566#define lpfc_reg_fcfi_rctl_match0_MASK 0x000000FF
1567#define lpfc_reg_fcfi_rctl_match0_WORD word4
1568#define lpfc_reg_fcfi_rctl_mask0_SHIFT 0
1569#define lpfc_reg_fcfi_rctl_mask0_MASK 0x000000FF
1570#define lpfc_reg_fcfi_rctl_mask0_WORD word4
1571 uint32_t word5;
1572#define lpfc_reg_fcfi_type_match1_SHIFT 24
1573#define lpfc_reg_fcfi_type_match1_MASK 0x000000FF
1574#define lpfc_reg_fcfi_type_match1_WORD word5
1575#define lpfc_reg_fcfi_type_mask1_SHIFT 16
1576#define lpfc_reg_fcfi_type_mask1_MASK 0x000000FF
1577#define lpfc_reg_fcfi_type_mask1_WORD word5
1578#define lpfc_reg_fcfi_rctl_match1_SHIFT 8
1579#define lpfc_reg_fcfi_rctl_match1_MASK 0x000000FF
1580#define lpfc_reg_fcfi_rctl_match1_WORD word5
1581#define lpfc_reg_fcfi_rctl_mask1_SHIFT 0
1582#define lpfc_reg_fcfi_rctl_mask1_MASK 0x000000FF
1583#define lpfc_reg_fcfi_rctl_mask1_WORD word5
1584 uint32_t word6;
1585#define lpfc_reg_fcfi_type_match2_SHIFT 24
1586#define lpfc_reg_fcfi_type_match2_MASK 0x000000FF
1587#define lpfc_reg_fcfi_type_match2_WORD word6
1588#define lpfc_reg_fcfi_type_mask2_SHIFT 16
1589#define lpfc_reg_fcfi_type_mask2_MASK 0x000000FF
1590#define lpfc_reg_fcfi_type_mask2_WORD word6
1591#define lpfc_reg_fcfi_rctl_match2_SHIFT 8
1592#define lpfc_reg_fcfi_rctl_match2_MASK 0x000000FF
1593#define lpfc_reg_fcfi_rctl_match2_WORD word6
1594#define lpfc_reg_fcfi_rctl_mask2_SHIFT 0
1595#define lpfc_reg_fcfi_rctl_mask2_MASK 0x000000FF
1596#define lpfc_reg_fcfi_rctl_mask2_WORD word6
1597 uint32_t word7;
1598#define lpfc_reg_fcfi_type_match3_SHIFT 24
1599#define lpfc_reg_fcfi_type_match3_MASK 0x000000FF
1600#define lpfc_reg_fcfi_type_match3_WORD word7
1601#define lpfc_reg_fcfi_type_mask3_SHIFT 16
1602#define lpfc_reg_fcfi_type_mask3_MASK 0x000000FF
1603#define lpfc_reg_fcfi_type_mask3_WORD word7
1604#define lpfc_reg_fcfi_rctl_match3_SHIFT 8
1605#define lpfc_reg_fcfi_rctl_match3_MASK 0x000000FF
1606#define lpfc_reg_fcfi_rctl_match3_WORD word7
1607#define lpfc_reg_fcfi_rctl_mask3_SHIFT 0
1608#define lpfc_reg_fcfi_rctl_mask3_MASK 0x000000FF
1609#define lpfc_reg_fcfi_rctl_mask3_WORD word7
1610 uint32_t word8;
1611#define lpfc_reg_fcfi_mam_SHIFT 13
1612#define lpfc_reg_fcfi_mam_MASK 0x00000003
1613#define lpfc_reg_fcfi_mam_WORD word8
1614#define LPFC_MAM_BOTH 0 /* Both SPMA and FPMA */
1615#define LPFC_MAM_SPMA 1 /* Server Provided MAC Address */
1616#define LPFC_MAM_FPMA 2 /* Fabric Provided MAC Address */
1617#define lpfc_reg_fcfi_vv_SHIFT 12
1618#define lpfc_reg_fcfi_vv_MASK 0x00000001
1619#define lpfc_reg_fcfi_vv_WORD word8
1620#define lpfc_reg_fcfi_vlan_tag_SHIFT 0
1621#define lpfc_reg_fcfi_vlan_tag_MASK 0x00000FFF
1622#define lpfc_reg_fcfi_vlan_tag_WORD word8
1623};
1624
1625struct lpfc_mbx_unreg_fcfi {
1626 uint32_t word1_rsv;
1627 uint32_t word2;
1628#define lpfc_unreg_fcfi_SHIFT 0
1629#define lpfc_unreg_fcfi_MASK 0x0000FFFF
1630#define lpfc_unreg_fcfi_WORD word2
1631};
1632
1633struct lpfc_mbx_read_rev {
1634 uint32_t word1;
1635#define lpfc_mbx_rd_rev_sli_lvl_SHIFT 16
1636#define lpfc_mbx_rd_rev_sli_lvl_MASK 0x0000000F
1637#define lpfc_mbx_rd_rev_sli_lvl_WORD word1
1638#define lpfc_mbx_rd_rev_fcoe_SHIFT 20
1639#define lpfc_mbx_rd_rev_fcoe_MASK 0x00000001
1640#define lpfc_mbx_rd_rev_fcoe_WORD word1
James Smart45ed1192009-10-02 15:17:02 -04001641#define lpfc_mbx_rd_rev_cee_ver_SHIFT 21
1642#define lpfc_mbx_rd_rev_cee_ver_MASK 0x00000003
1643#define lpfc_mbx_rd_rev_cee_ver_WORD word1
1644#define LPFC_PREDCBX_CEE_MODE 0
1645#define LPFC_DCBX_CEE_MODE 1
James Smartda0436e2009-05-22 14:51:39 -04001646#define lpfc_mbx_rd_rev_vpd_SHIFT 29
1647#define lpfc_mbx_rd_rev_vpd_MASK 0x00000001
1648#define lpfc_mbx_rd_rev_vpd_WORD word1
1649 uint32_t first_hw_rev;
1650 uint32_t second_hw_rev;
1651 uint32_t word4_rsvd;
1652 uint32_t third_hw_rev;
1653 uint32_t word6;
1654#define lpfc_mbx_rd_rev_fcph_low_SHIFT 0
1655#define lpfc_mbx_rd_rev_fcph_low_MASK 0x000000FF
1656#define lpfc_mbx_rd_rev_fcph_low_WORD word6
1657#define lpfc_mbx_rd_rev_fcph_high_SHIFT 8
1658#define lpfc_mbx_rd_rev_fcph_high_MASK 0x000000FF
1659#define lpfc_mbx_rd_rev_fcph_high_WORD word6
1660#define lpfc_mbx_rd_rev_ftr_lvl_low_SHIFT 16
1661#define lpfc_mbx_rd_rev_ftr_lvl_low_MASK 0x000000FF
1662#define lpfc_mbx_rd_rev_ftr_lvl_low_WORD word6
1663#define lpfc_mbx_rd_rev_ftr_lvl_high_SHIFT 24
1664#define lpfc_mbx_rd_rev_ftr_lvl_high_MASK 0x000000FF
1665#define lpfc_mbx_rd_rev_ftr_lvl_high_WORD word6
1666 uint32_t word7_rsvd;
1667 uint32_t fw_id_rev;
1668 uint8_t fw_name[16];
1669 uint32_t ulp_fw_id_rev;
1670 uint8_t ulp_fw_name[16];
1671 uint32_t word18_47_rsvd[30];
1672 uint32_t word48;
1673#define lpfc_mbx_rd_rev_avail_len_SHIFT 0
1674#define lpfc_mbx_rd_rev_avail_len_MASK 0x00FFFFFF
1675#define lpfc_mbx_rd_rev_avail_len_WORD word48
1676 uint32_t vpd_paddr_low;
1677 uint32_t vpd_paddr_high;
1678 uint32_t avail_vpd_len;
1679 uint32_t rsvd_52_63[12];
1680};
1681
1682struct lpfc_mbx_read_config {
1683 uint32_t word1;
1684#define lpfc_mbx_rd_conf_max_bbc_SHIFT 0
1685#define lpfc_mbx_rd_conf_max_bbc_MASK 0x000000FF
1686#define lpfc_mbx_rd_conf_max_bbc_WORD word1
1687#define lpfc_mbx_rd_conf_init_bbc_SHIFT 8
1688#define lpfc_mbx_rd_conf_init_bbc_MASK 0x000000FF
1689#define lpfc_mbx_rd_conf_init_bbc_WORD word1
1690 uint32_t word2;
1691#define lpfc_mbx_rd_conf_nport_did_SHIFT 0
1692#define lpfc_mbx_rd_conf_nport_did_MASK 0x00FFFFFF
1693#define lpfc_mbx_rd_conf_nport_did_WORD word2
1694#define lpfc_mbx_rd_conf_topology_SHIFT 24
1695#define lpfc_mbx_rd_conf_topology_MASK 0x000000FF
1696#define lpfc_mbx_rd_conf_topology_WORD word2
1697 uint32_t word3;
1698#define lpfc_mbx_rd_conf_ao_SHIFT 0
1699#define lpfc_mbx_rd_conf_ao_MASK 0x00000001
1700#define lpfc_mbx_rd_conf_ao_WORD word3
1701#define lpfc_mbx_rd_conf_bb_scn_SHIFT 8
1702#define lpfc_mbx_rd_conf_bb_scn_MASK 0x0000000F
1703#define lpfc_mbx_rd_conf_bb_scn_WORD word3
1704#define lpfc_mbx_rd_conf_cbb_scn_SHIFT 12
1705#define lpfc_mbx_rd_conf_cbb_scn_MASK 0x0000000F
1706#define lpfc_mbx_rd_conf_cbb_scn_WORD word3
1707#define lpfc_mbx_rd_conf_mc_SHIFT 29
1708#define lpfc_mbx_rd_conf_mc_MASK 0x00000001
1709#define lpfc_mbx_rd_conf_mc_WORD word3
1710 uint32_t word4;
1711#define lpfc_mbx_rd_conf_e_d_tov_SHIFT 0
1712#define lpfc_mbx_rd_conf_e_d_tov_MASK 0x0000FFFF
1713#define lpfc_mbx_rd_conf_e_d_tov_WORD word4
1714 uint32_t word5;
1715#define lpfc_mbx_rd_conf_lp_tov_SHIFT 0
1716#define lpfc_mbx_rd_conf_lp_tov_MASK 0x0000FFFF
1717#define lpfc_mbx_rd_conf_lp_tov_WORD word5
1718 uint32_t word6;
1719#define lpfc_mbx_rd_conf_r_a_tov_SHIFT 0
1720#define lpfc_mbx_rd_conf_r_a_tov_MASK 0x0000FFFF
1721#define lpfc_mbx_rd_conf_r_a_tov_WORD word6
1722 uint32_t word7;
1723#define lpfc_mbx_rd_conf_r_t_tov_SHIFT 0
1724#define lpfc_mbx_rd_conf_r_t_tov_MASK 0x000000FF
1725#define lpfc_mbx_rd_conf_r_t_tov_WORD word7
1726 uint32_t word8;
1727#define lpfc_mbx_rd_conf_al_tov_SHIFT 0
1728#define lpfc_mbx_rd_conf_al_tov_MASK 0x0000000F
1729#define lpfc_mbx_rd_conf_al_tov_WORD word8
1730 uint32_t word9;
1731#define lpfc_mbx_rd_conf_lmt_SHIFT 0
1732#define lpfc_mbx_rd_conf_lmt_MASK 0x0000FFFF
1733#define lpfc_mbx_rd_conf_lmt_WORD word9
1734 uint32_t word10;
1735#define lpfc_mbx_rd_conf_max_alpa_SHIFT 0
1736#define lpfc_mbx_rd_conf_max_alpa_MASK 0x000000FF
1737#define lpfc_mbx_rd_conf_max_alpa_WORD word10
1738 uint32_t word11_rsvd;
1739 uint32_t word12;
1740#define lpfc_mbx_rd_conf_xri_base_SHIFT 0
1741#define lpfc_mbx_rd_conf_xri_base_MASK 0x0000FFFF
1742#define lpfc_mbx_rd_conf_xri_base_WORD word12
1743#define lpfc_mbx_rd_conf_xri_count_SHIFT 16
1744#define lpfc_mbx_rd_conf_xri_count_MASK 0x0000FFFF
1745#define lpfc_mbx_rd_conf_xri_count_WORD word12
1746 uint32_t word13;
1747#define lpfc_mbx_rd_conf_rpi_base_SHIFT 0
1748#define lpfc_mbx_rd_conf_rpi_base_MASK 0x0000FFFF
1749#define lpfc_mbx_rd_conf_rpi_base_WORD word13
1750#define lpfc_mbx_rd_conf_rpi_count_SHIFT 16
1751#define lpfc_mbx_rd_conf_rpi_count_MASK 0x0000FFFF
1752#define lpfc_mbx_rd_conf_rpi_count_WORD word13
1753 uint32_t word14;
1754#define lpfc_mbx_rd_conf_vpi_base_SHIFT 0
1755#define lpfc_mbx_rd_conf_vpi_base_MASK 0x0000FFFF
1756#define lpfc_mbx_rd_conf_vpi_base_WORD word14
1757#define lpfc_mbx_rd_conf_vpi_count_SHIFT 16
1758#define lpfc_mbx_rd_conf_vpi_count_MASK 0x0000FFFF
1759#define lpfc_mbx_rd_conf_vpi_count_WORD word14
1760 uint32_t word15;
1761#define lpfc_mbx_rd_conf_vfi_base_SHIFT 0
1762#define lpfc_mbx_rd_conf_vfi_base_MASK 0x0000FFFF
1763#define lpfc_mbx_rd_conf_vfi_base_WORD word15
1764#define lpfc_mbx_rd_conf_vfi_count_SHIFT 16
1765#define lpfc_mbx_rd_conf_vfi_count_MASK 0x0000FFFF
1766#define lpfc_mbx_rd_conf_vfi_count_WORD word15
1767 uint32_t word16;
1768#define lpfc_mbx_rd_conf_fcfi_base_SHIFT 0
1769#define lpfc_mbx_rd_conf_fcfi_base_MASK 0x0000FFFF
1770#define lpfc_mbx_rd_conf_fcfi_base_WORD word16
1771#define lpfc_mbx_rd_conf_fcfi_count_SHIFT 16
1772#define lpfc_mbx_rd_conf_fcfi_count_MASK 0x0000FFFF
1773#define lpfc_mbx_rd_conf_fcfi_count_WORD word16
1774 uint32_t word17;
1775#define lpfc_mbx_rd_conf_rq_count_SHIFT 0
1776#define lpfc_mbx_rd_conf_rq_count_MASK 0x0000FFFF
1777#define lpfc_mbx_rd_conf_rq_count_WORD word17
1778#define lpfc_mbx_rd_conf_eq_count_SHIFT 16
1779#define lpfc_mbx_rd_conf_eq_count_MASK 0x0000FFFF
1780#define lpfc_mbx_rd_conf_eq_count_WORD word17
1781 uint32_t word18;
1782#define lpfc_mbx_rd_conf_wq_count_SHIFT 0
1783#define lpfc_mbx_rd_conf_wq_count_MASK 0x0000FFFF
1784#define lpfc_mbx_rd_conf_wq_count_WORD word18
1785#define lpfc_mbx_rd_conf_cq_count_SHIFT 16
1786#define lpfc_mbx_rd_conf_cq_count_MASK 0x0000FFFF
1787#define lpfc_mbx_rd_conf_cq_count_WORD word18
1788};
1789
1790struct lpfc_mbx_request_features {
1791 uint32_t word1;
1792#define lpfc_mbx_rq_ftr_qry_SHIFT 0
1793#define lpfc_mbx_rq_ftr_qry_MASK 0x00000001
1794#define lpfc_mbx_rq_ftr_qry_WORD word1
1795 uint32_t word2;
1796#define lpfc_mbx_rq_ftr_rq_iaab_SHIFT 0
1797#define lpfc_mbx_rq_ftr_rq_iaab_MASK 0x00000001
1798#define lpfc_mbx_rq_ftr_rq_iaab_WORD word2
1799#define lpfc_mbx_rq_ftr_rq_npiv_SHIFT 1
1800#define lpfc_mbx_rq_ftr_rq_npiv_MASK 0x00000001
1801#define lpfc_mbx_rq_ftr_rq_npiv_WORD word2
1802#define lpfc_mbx_rq_ftr_rq_dif_SHIFT 2
1803#define lpfc_mbx_rq_ftr_rq_dif_MASK 0x00000001
1804#define lpfc_mbx_rq_ftr_rq_dif_WORD word2
1805#define lpfc_mbx_rq_ftr_rq_vf_SHIFT 3
1806#define lpfc_mbx_rq_ftr_rq_vf_MASK 0x00000001
1807#define lpfc_mbx_rq_ftr_rq_vf_WORD word2
1808#define lpfc_mbx_rq_ftr_rq_fcpi_SHIFT 4
1809#define lpfc_mbx_rq_ftr_rq_fcpi_MASK 0x00000001
1810#define lpfc_mbx_rq_ftr_rq_fcpi_WORD word2
1811#define lpfc_mbx_rq_ftr_rq_fcpt_SHIFT 5
1812#define lpfc_mbx_rq_ftr_rq_fcpt_MASK 0x00000001
1813#define lpfc_mbx_rq_ftr_rq_fcpt_WORD word2
1814#define lpfc_mbx_rq_ftr_rq_fcpc_SHIFT 6
1815#define lpfc_mbx_rq_ftr_rq_fcpc_MASK 0x00000001
1816#define lpfc_mbx_rq_ftr_rq_fcpc_WORD word2
1817#define lpfc_mbx_rq_ftr_rq_ifip_SHIFT 7
1818#define lpfc_mbx_rq_ftr_rq_ifip_MASK 0x00000001
1819#define lpfc_mbx_rq_ftr_rq_ifip_WORD word2
1820 uint32_t word3;
1821#define lpfc_mbx_rq_ftr_rsp_iaab_SHIFT 0
1822#define lpfc_mbx_rq_ftr_rsp_iaab_MASK 0x00000001
1823#define lpfc_mbx_rq_ftr_rsp_iaab_WORD word3
1824#define lpfc_mbx_rq_ftr_rsp_npiv_SHIFT 1
1825#define lpfc_mbx_rq_ftr_rsp_npiv_MASK 0x00000001
1826#define lpfc_mbx_rq_ftr_rsp_npiv_WORD word3
1827#define lpfc_mbx_rq_ftr_rsp_dif_SHIFT 2
1828#define lpfc_mbx_rq_ftr_rsp_dif_MASK 0x00000001
1829#define lpfc_mbx_rq_ftr_rsp_dif_WORD word3
1830#define lpfc_mbx_rq_ftr_rsp_vf_SHIFT 3
1831#define lpfc_mbx_rq_ftr_rsp_vf__MASK 0x00000001
1832#define lpfc_mbx_rq_ftr_rsp_vf_WORD word3
1833#define lpfc_mbx_rq_ftr_rsp_fcpi_SHIFT 4
1834#define lpfc_mbx_rq_ftr_rsp_fcpi_MASK 0x00000001
1835#define lpfc_mbx_rq_ftr_rsp_fcpi_WORD word3
1836#define lpfc_mbx_rq_ftr_rsp_fcpt_SHIFT 5
1837#define lpfc_mbx_rq_ftr_rsp_fcpt_MASK 0x00000001
1838#define lpfc_mbx_rq_ftr_rsp_fcpt_WORD word3
1839#define lpfc_mbx_rq_ftr_rsp_fcpc_SHIFT 6
1840#define lpfc_mbx_rq_ftr_rsp_fcpc_MASK 0x00000001
1841#define lpfc_mbx_rq_ftr_rsp_fcpc_WORD word3
1842#define lpfc_mbx_rq_ftr_rsp_ifip_SHIFT 7
1843#define lpfc_mbx_rq_ftr_rsp_ifip_MASK 0x00000001
1844#define lpfc_mbx_rq_ftr_rsp_ifip_WORD word3
1845};
1846
1847/* Mailbox Completion Queue Error Messages */
1848#define MB_CQE_STATUS_SUCCESS 0x0
1849#define MB_CQE_STATUS_INSUFFICIENT_PRIVILEGES 0x1
1850#define MB_CQE_STATUS_INVALID_PARAMETER 0x2
1851#define MB_CQE_STATUS_INSUFFICIENT_RESOURCES 0x3
1852#define MB_CEQ_STATUS_QUEUE_FLUSHING 0x4
1853#define MB_CQE_STATUS_DMA_FAILED 0x5
1854
1855/* mailbox queue entry structure */
1856struct lpfc_mqe {
1857 uint32_t word0;
1858#define lpfc_mqe_status_SHIFT 16
1859#define lpfc_mqe_status_MASK 0x0000FFFF
1860#define lpfc_mqe_status_WORD word0
1861#define lpfc_mqe_command_SHIFT 8
1862#define lpfc_mqe_command_MASK 0x000000FF
1863#define lpfc_mqe_command_WORD word0
1864 union {
1865 uint32_t mb_words[LPFC_SLI4_MB_WORD_COUNT - 1];
1866 /* sli4 mailbox commands */
1867 struct lpfc_mbx_sli4_config sli4_config;
1868 struct lpfc_mbx_init_vfi init_vfi;
1869 struct lpfc_mbx_reg_vfi reg_vfi;
1870 struct lpfc_mbx_reg_vfi unreg_vfi;
1871 struct lpfc_mbx_init_vpi init_vpi;
1872 struct lpfc_mbx_resume_rpi resume_rpi;
1873 struct lpfc_mbx_read_fcf_tbl read_fcf_tbl;
1874 struct lpfc_mbx_add_fcf_tbl_entry add_fcf_entry;
1875 struct lpfc_mbx_del_fcf_tbl_entry del_fcf_entry;
James Smartecfd03c2010-02-12 14:41:27 -05001876 struct lpfc_mbx_redisc_fcf_tbl redisc_fcf_tbl;
James Smartda0436e2009-05-22 14:51:39 -04001877 struct lpfc_mbx_reg_fcfi reg_fcfi;
1878 struct lpfc_mbx_unreg_fcfi unreg_fcfi;
1879 struct lpfc_mbx_mq_create mq_create;
1880 struct lpfc_mbx_eq_create eq_create;
1881 struct lpfc_mbx_cq_create cq_create;
1882 struct lpfc_mbx_wq_create wq_create;
1883 struct lpfc_mbx_rq_create rq_create;
1884 struct lpfc_mbx_mq_destroy mq_destroy;
1885 struct lpfc_mbx_eq_destroy eq_destroy;
1886 struct lpfc_mbx_cq_destroy cq_destroy;
1887 struct lpfc_mbx_wq_destroy wq_destroy;
1888 struct lpfc_mbx_rq_destroy rq_destroy;
1889 struct lpfc_mbx_post_sgl_pages post_sgl_pages;
1890 struct lpfc_mbx_nembed_cmd nembed_cmd;
1891 struct lpfc_mbx_read_rev read_rev;
1892 struct lpfc_mbx_read_vpi read_vpi;
1893 struct lpfc_mbx_read_config rd_config;
1894 struct lpfc_mbx_request_features req_ftrs;
1895 struct lpfc_mbx_post_hdr_tmpl hdr_tmpl;
James Smart6669f9b2009-10-02 15:16:45 -04001896 struct lpfc_mbx_query_fw_cfg query_fw_cfg;
James Smartda0436e2009-05-22 14:51:39 -04001897 struct lpfc_mbx_nop nop;
1898 } un;
1899};
1900
1901struct lpfc_mcqe {
1902 uint32_t word0;
1903#define lpfc_mcqe_status_SHIFT 0
1904#define lpfc_mcqe_status_MASK 0x0000FFFF
1905#define lpfc_mcqe_status_WORD word0
1906#define lpfc_mcqe_ext_status_SHIFT 16
1907#define lpfc_mcqe_ext_status_MASK 0x0000FFFF
1908#define lpfc_mcqe_ext_status_WORD word0
1909 uint32_t mcqe_tag0;
1910 uint32_t mcqe_tag1;
1911 uint32_t trailer;
1912#define lpfc_trailer_valid_SHIFT 31
1913#define lpfc_trailer_valid_MASK 0x00000001
1914#define lpfc_trailer_valid_WORD trailer
1915#define lpfc_trailer_async_SHIFT 30
1916#define lpfc_trailer_async_MASK 0x00000001
1917#define lpfc_trailer_async_WORD trailer
1918#define lpfc_trailer_hpi_SHIFT 29
1919#define lpfc_trailer_hpi_MASK 0x00000001
1920#define lpfc_trailer_hpi_WORD trailer
1921#define lpfc_trailer_completed_SHIFT 28
1922#define lpfc_trailer_completed_MASK 0x00000001
1923#define lpfc_trailer_completed_WORD trailer
1924#define lpfc_trailer_consumed_SHIFT 27
1925#define lpfc_trailer_consumed_MASK 0x00000001
1926#define lpfc_trailer_consumed_WORD trailer
1927#define lpfc_trailer_type_SHIFT 16
1928#define lpfc_trailer_type_MASK 0x000000FF
1929#define lpfc_trailer_type_WORD trailer
1930#define lpfc_trailer_code_SHIFT 8
1931#define lpfc_trailer_code_MASK 0x000000FF
1932#define lpfc_trailer_code_WORD trailer
1933#define LPFC_TRAILER_CODE_LINK 0x1
1934#define LPFC_TRAILER_CODE_FCOE 0x2
1935#define LPFC_TRAILER_CODE_DCBX 0x3
1936};
1937
1938struct lpfc_acqe_link {
1939 uint32_t word0;
1940#define lpfc_acqe_link_speed_SHIFT 24
1941#define lpfc_acqe_link_speed_MASK 0x000000FF
1942#define lpfc_acqe_link_speed_WORD word0
1943#define LPFC_ASYNC_LINK_SPEED_ZERO 0x0
1944#define LPFC_ASYNC_LINK_SPEED_10MBPS 0x1
1945#define LPFC_ASYNC_LINK_SPEED_100MBPS 0x2
1946#define LPFC_ASYNC_LINK_SPEED_1GBPS 0x3
1947#define LPFC_ASYNC_LINK_SPEED_10GBPS 0x4
1948#define lpfc_acqe_link_duplex_SHIFT 16
1949#define lpfc_acqe_link_duplex_MASK 0x000000FF
1950#define lpfc_acqe_link_duplex_WORD word0
1951#define LPFC_ASYNC_LINK_DUPLEX_NONE 0x0
1952#define LPFC_ASYNC_LINK_DUPLEX_HALF 0x1
1953#define LPFC_ASYNC_LINK_DUPLEX_FULL 0x2
1954#define lpfc_acqe_link_status_SHIFT 8
1955#define lpfc_acqe_link_status_MASK 0x000000FF
1956#define lpfc_acqe_link_status_WORD word0
1957#define LPFC_ASYNC_LINK_STATUS_DOWN 0x0
1958#define LPFC_ASYNC_LINK_STATUS_UP 0x1
1959#define LPFC_ASYNC_LINK_STATUS_LOGICAL_DOWN 0x2
1960#define LPFC_ASYNC_LINK_STATUS_LOGICAL_UP 0x3
1961#define lpfc_acqe_link_physical_SHIFT 0
1962#define lpfc_acqe_link_physical_MASK 0x000000FF
1963#define lpfc_acqe_link_physical_WORD word0
1964#define LPFC_ASYNC_LINK_PORT_A 0x0
1965#define LPFC_ASYNC_LINK_PORT_B 0x1
1966 uint32_t word1;
1967#define lpfc_acqe_link_fault_SHIFT 0
1968#define lpfc_acqe_link_fault_MASK 0x000000FF
1969#define lpfc_acqe_link_fault_WORD word1
1970#define LPFC_ASYNC_LINK_FAULT_NONE 0x0
1971#define LPFC_ASYNC_LINK_FAULT_LOCAL 0x1
1972#define LPFC_ASYNC_LINK_FAULT_REMOTE 0x2
James Smart65467b62010-01-26 23:08:29 -05001973#define lpfc_acqe_qos_link_speed_SHIFT 16
1974#define lpfc_acqe_qos_link_speed_MASK 0x0000FFFF
1975#define lpfc_acqe_qos_link_speed_WORD word1
James Smartda0436e2009-05-22 14:51:39 -04001976 uint32_t event_tag;
1977 uint32_t trailer;
1978};
1979
1980struct lpfc_acqe_fcoe {
James Smart6669f9b2009-10-02 15:16:45 -04001981 uint32_t index;
James Smartda0436e2009-05-22 14:51:39 -04001982 uint32_t word1;
1983#define lpfc_acqe_fcoe_fcf_count_SHIFT 0
1984#define lpfc_acqe_fcoe_fcf_count_MASK 0x0000FFFF
1985#define lpfc_acqe_fcoe_fcf_count_WORD word1
1986#define lpfc_acqe_fcoe_event_type_SHIFT 16
1987#define lpfc_acqe_fcoe_event_type_MASK 0x0000FFFF
1988#define lpfc_acqe_fcoe_event_type_WORD word1
1989#define LPFC_FCOE_EVENT_TYPE_NEW_FCF 0x1
1990#define LPFC_FCOE_EVENT_TYPE_FCF_TABLE_FULL 0x2
1991#define LPFC_FCOE_EVENT_TYPE_FCF_DEAD 0x3
James Smart6669f9b2009-10-02 15:16:45 -04001992#define LPFC_FCOE_EVENT_TYPE_CVL 0x4
James Smartecfd03c2010-02-12 14:41:27 -05001993#define LPFC_FCOE_EVENT_TYPE_FCF_PARAM_MOD 0x5
James Smartda0436e2009-05-22 14:51:39 -04001994 uint32_t event_tag;
1995 uint32_t trailer;
1996};
1997
1998struct lpfc_acqe_dcbx {
1999 uint32_t tlv_ttl;
2000 uint32_t reserved;
2001 uint32_t event_tag;
2002 uint32_t trailer;
2003};
2004
2005/*
2006 * Define the bootstrap mailbox (bmbx) region used to communicate
2007 * mailbox command between the host and port. The mailbox consists
2008 * of a payload area of 256 bytes and a completion queue of length
2009 * 16 bytes.
2010 */
2011struct lpfc_bmbx_create {
2012 struct lpfc_mqe mqe;
2013 struct lpfc_mcqe mcqe;
2014};
2015
2016#define SGL_ALIGN_SZ 64
2017#define SGL_PAGE_SIZE 4096
2018/* align SGL addr on a size boundary - adjust address up */
James Smart5ffc2662009-11-18 15:39:44 -05002019#define NO_XRI ((uint16_t)-1)
2020
James Smartda0436e2009-05-22 14:51:39 -04002021struct wqe_common {
2022 uint32_t word6;
James Smart6669f9b2009-10-02 15:16:45 -04002023#define wqe_xri_tag_SHIFT 0
2024#define wqe_xri_tag_MASK 0x0000FFFF
2025#define wqe_xri_tag_WORD word6
James Smartda0436e2009-05-22 14:51:39 -04002026#define wqe_ctxt_tag_SHIFT 16
2027#define wqe_ctxt_tag_MASK 0x0000FFFF
2028#define wqe_ctxt_tag_WORD word6
2029 uint32_t word7;
2030#define wqe_ct_SHIFT 2
2031#define wqe_ct_MASK 0x00000003
2032#define wqe_ct_WORD word7
2033#define wqe_status_SHIFT 4
2034#define wqe_status_MASK 0x0000000f
2035#define wqe_status_WORD word7
2036#define wqe_cmnd_SHIFT 8
2037#define wqe_cmnd_MASK 0x000000ff
2038#define wqe_cmnd_WORD word7
2039#define wqe_class_SHIFT 16
2040#define wqe_class_MASK 0x00000007
2041#define wqe_class_WORD word7
2042#define wqe_pu_SHIFT 20
2043#define wqe_pu_MASK 0x00000003
2044#define wqe_pu_WORD word7
2045#define wqe_erp_SHIFT 22
2046#define wqe_erp_MASK 0x00000001
2047#define wqe_erp_WORD word7
2048#define wqe_lnk_SHIFT 23
2049#define wqe_lnk_MASK 0x00000001
2050#define wqe_lnk_WORD word7
2051#define wqe_tmo_SHIFT 24
2052#define wqe_tmo_MASK 0x000000ff
2053#define wqe_tmo_WORD word7
2054 uint32_t abort_tag; /* word 8 in WQE */
2055 uint32_t word9;
2056#define wqe_reqtag_SHIFT 0
2057#define wqe_reqtag_MASK 0x0000FFFF
2058#define wqe_reqtag_WORD word9
2059#define wqe_rcvoxid_SHIFT 16
2060#define wqe_rcvoxid_MASK 0x0000FFFF
2061#define wqe_rcvoxid_WORD word9
2062 uint32_t word10;
2063#define wqe_pri_SHIFT 16
2064#define wqe_pri_MASK 0x00000007
2065#define wqe_pri_WORD word10
2066#define wqe_pv_SHIFT 19
2067#define wqe_pv_MASK 0x00000001
2068#define wqe_pv_WORD word10
2069#define wqe_xc_SHIFT 21
2070#define wqe_xc_MASK 0x00000001
2071#define wqe_xc_WORD word10
2072#define wqe_ccpe_SHIFT 23
2073#define wqe_ccpe_MASK 0x00000001
2074#define wqe_ccpe_WORD word10
2075#define wqe_ccp_SHIFT 24
2076#define wqe_ccp_MASK 0x000000ff
2077#define wqe_ccp_WORD word10
2078 uint32_t word11;
2079#define wqe_cmd_type_SHIFT 0
2080#define wqe_cmd_type_MASK 0x0000000f
2081#define wqe_cmd_type_WORD word11
2082#define wqe_wqec_SHIFT 7
2083#define wqe_wqec_MASK 0x00000001
2084#define wqe_wqec_WORD word11
2085#define wqe_cqid_SHIFT 16
James Smart6669f9b2009-10-02 15:16:45 -04002086#define wqe_cqid_MASK 0x0000ffff
James Smartda0436e2009-05-22 14:51:39 -04002087#define wqe_cqid_WORD word11
2088};
2089
2090struct wqe_did {
2091 uint32_t word5;
2092#define wqe_els_did_SHIFT 0
2093#define wqe_els_did_MASK 0x00FFFFFF
2094#define wqe_els_did_WORD word5
James Smart6669f9b2009-10-02 15:16:45 -04002095#define wqe_xmit_bls_pt_SHIFT 28
2096#define wqe_xmit_bls_pt_MASK 0x00000003
2097#define wqe_xmit_bls_pt_WORD word5
James Smartda0436e2009-05-22 14:51:39 -04002098#define wqe_xmit_bls_ar_SHIFT 30
2099#define wqe_xmit_bls_ar_MASK 0x00000001
2100#define wqe_xmit_bls_ar_WORD word5
2101#define wqe_xmit_bls_xo_SHIFT 31
2102#define wqe_xmit_bls_xo_MASK 0x00000001
2103#define wqe_xmit_bls_xo_WORD word5
2104};
2105
2106struct els_request64_wqe {
2107 struct ulp_bde64 bde;
2108 uint32_t payload_len;
2109 uint32_t word4;
2110#define els_req64_sid_SHIFT 0
2111#define els_req64_sid_MASK 0x00FFFFFF
2112#define els_req64_sid_WORD word4
2113#define els_req64_sp_SHIFT 24
2114#define els_req64_sp_MASK 0x00000001
2115#define els_req64_sp_WORD word4
2116#define els_req64_vf_SHIFT 25
2117#define els_req64_vf_MASK 0x00000001
2118#define els_req64_vf_WORD word4
2119 struct wqe_did wqe_dest;
2120 struct wqe_common wqe_com; /* words 6-11 */
2121 uint32_t word12;
2122#define els_req64_vfid_SHIFT 1
2123#define els_req64_vfid_MASK 0x00000FFF
2124#define els_req64_vfid_WORD word12
2125#define els_req64_pri_SHIFT 13
2126#define els_req64_pri_MASK 0x00000007
2127#define els_req64_pri_WORD word12
2128 uint32_t word13;
2129#define els_req64_hopcnt_SHIFT 24
2130#define els_req64_hopcnt_MASK 0x000000ff
2131#define els_req64_hopcnt_WORD word13
2132 uint32_t reserved[2];
2133};
2134
2135struct xmit_els_rsp64_wqe {
2136 struct ulp_bde64 bde;
2137 uint32_t rsvd3;
2138 uint32_t rsvd4;
2139 struct wqe_did wqe_dest;
2140 struct wqe_common wqe_com; /* words 6-11 */
2141 uint32_t rsvd_12_15[4];
2142};
2143
2144struct xmit_bls_rsp64_wqe {
2145 uint32_t payload0;
James Smart6669f9b2009-10-02 15:16:45 -04002146/* Payload0 for BA_ACC */
2147#define xmit_bls_rsp64_acc_seq_id_SHIFT 16
2148#define xmit_bls_rsp64_acc_seq_id_MASK 0x000000ff
2149#define xmit_bls_rsp64_acc_seq_id_WORD payload0
2150#define xmit_bls_rsp64_acc_seq_id_vald_SHIFT 24
2151#define xmit_bls_rsp64_acc_seq_id_vald_MASK 0x000000ff
2152#define xmit_bls_rsp64_acc_seq_id_vald_WORD payload0
2153/* Payload0 for BA_RJT */
2154#define xmit_bls_rsp64_rjt_vspec_SHIFT 0
2155#define xmit_bls_rsp64_rjt_vspec_MASK 0x000000ff
2156#define xmit_bls_rsp64_rjt_vspec_WORD payload0
2157#define xmit_bls_rsp64_rjt_expc_SHIFT 8
2158#define xmit_bls_rsp64_rjt_expc_MASK 0x000000ff
2159#define xmit_bls_rsp64_rjt_expc_WORD payload0
2160#define xmit_bls_rsp64_rjt_rsnc_SHIFT 16
2161#define xmit_bls_rsp64_rjt_rsnc_MASK 0x000000ff
2162#define xmit_bls_rsp64_rjt_rsnc_WORD payload0
James Smartda0436e2009-05-22 14:51:39 -04002163 uint32_t word1;
2164#define xmit_bls_rsp64_rxid_SHIFT 0
2165#define xmit_bls_rsp64_rxid_MASK 0x0000ffff
2166#define xmit_bls_rsp64_rxid_WORD word1
2167#define xmit_bls_rsp64_oxid_SHIFT 16
2168#define xmit_bls_rsp64_oxid_MASK 0x0000ffff
2169#define xmit_bls_rsp64_oxid_WORD word1
2170 uint32_t word2;
James Smart6669f9b2009-10-02 15:16:45 -04002171#define xmit_bls_rsp64_seqcnthi_SHIFT 0
James Smartda0436e2009-05-22 14:51:39 -04002172#define xmit_bls_rsp64_seqcnthi_MASK 0x0000ffff
2173#define xmit_bls_rsp64_seqcnthi_WORD word2
James Smart6669f9b2009-10-02 15:16:45 -04002174#define xmit_bls_rsp64_seqcntlo_SHIFT 16
2175#define xmit_bls_rsp64_seqcntlo_MASK 0x0000ffff
2176#define xmit_bls_rsp64_seqcntlo_WORD word2
James Smartda0436e2009-05-22 14:51:39 -04002177 uint32_t rsrvd3;
2178 uint32_t rsrvd4;
2179 struct wqe_did wqe_dest;
2180 struct wqe_common wqe_com; /* words 6-11 */
2181 uint32_t rsvd_12_15[4];
2182};
James Smart6669f9b2009-10-02 15:16:45 -04002183
James Smartda0436e2009-05-22 14:51:39 -04002184struct wqe_rctl_dfctl {
2185 uint32_t word5;
2186#define wqe_si_SHIFT 2
2187#define wqe_si_MASK 0x000000001
2188#define wqe_si_WORD word5
2189#define wqe_la_SHIFT 3
2190#define wqe_la_MASK 0x000000001
2191#define wqe_la_WORD word5
2192#define wqe_ls_SHIFT 7
2193#define wqe_ls_MASK 0x000000001
2194#define wqe_ls_WORD word5
2195#define wqe_dfctl_SHIFT 8
2196#define wqe_dfctl_MASK 0x0000000ff
2197#define wqe_dfctl_WORD word5
2198#define wqe_type_SHIFT 16
2199#define wqe_type_MASK 0x0000000ff
2200#define wqe_type_WORD word5
2201#define wqe_rctl_SHIFT 24
2202#define wqe_rctl_MASK 0x0000000ff
2203#define wqe_rctl_WORD word5
2204};
2205
2206struct xmit_seq64_wqe {
2207 struct ulp_bde64 bde;
2208 uint32_t paylaod_offset;
2209 uint32_t relative_offset;
2210 struct wqe_rctl_dfctl wge_ctl;
2211 struct wqe_common wqe_com; /* words 6-11 */
2212 /* Note: word10 different REVISIT */
2213 uint32_t xmit_len;
2214 uint32_t rsvd_12_15[3];
2215};
2216struct xmit_bcast64_wqe {
2217 struct ulp_bde64 bde;
2218 uint32_t paylaod_len;
2219 uint32_t rsvd4;
2220 struct wqe_rctl_dfctl wge_ctl; /* word 5 */
2221 struct wqe_common wqe_com; /* words 6-11 */
2222 uint32_t rsvd_12_15[4];
2223};
2224
2225struct gen_req64_wqe {
2226 struct ulp_bde64 bde;
2227 uint32_t command_len;
2228 uint32_t payload_len;
2229 struct wqe_rctl_dfctl wge_ctl; /* word 5 */
2230 struct wqe_common wqe_com; /* words 6-11 */
2231 uint32_t rsvd_12_15[4];
2232};
2233
2234struct create_xri_wqe {
2235 uint32_t rsrvd[5]; /* words 0-4 */
2236 struct wqe_did wqe_dest; /* word 5 */
2237 struct wqe_common wqe_com; /* words 6-11 */
2238 uint32_t rsvd_12_15[4]; /* word 12-15 */
2239};
2240
2241#define T_REQUEST_TAG 3
2242#define T_XRI_TAG 1
2243
2244struct abort_cmd_wqe {
2245 uint32_t rsrvd[3];
2246 uint32_t word3;
2247#define abort_cmd_ia_SHIFT 0
2248#define abort_cmd_ia_MASK 0x000000001
2249#define abort_cmd_ia_WORD word3
2250#define abort_cmd_criteria_SHIFT 8
2251#define abort_cmd_criteria_MASK 0x0000000ff
2252#define abort_cmd_criteria_WORD word3
2253 uint32_t rsrvd4;
2254 uint32_t rsrvd5;
2255 struct wqe_common wqe_com; /* words 6-11 */
2256 uint32_t rsvd_12_15[4]; /* word 12-15 */
2257};
2258
2259struct fcp_iwrite64_wqe {
2260 struct ulp_bde64 bde;
2261 uint32_t payload_len;
2262 uint32_t total_xfer_len;
2263 uint32_t initial_xfer_len;
2264 struct wqe_common wqe_com; /* words 6-11 */
2265 uint32_t rsvd_12_15[4]; /* word 12-15 */
2266};
2267
2268struct fcp_iread64_wqe {
2269 struct ulp_bde64 bde;
2270 uint32_t payload_len; /* word 3 */
2271 uint32_t total_xfer_len; /* word 4 */
2272 uint32_t rsrvd5; /* word 5 */
2273 struct wqe_common wqe_com; /* words 6-11 */
2274 uint32_t rsvd_12_15[4]; /* word 12-15 */
2275};
2276
2277struct fcp_icmnd64_wqe {
2278 struct ulp_bde64 bde; /* words 0-2 */
2279 uint32_t rsrvd[3]; /* words 3-5 */
2280 struct wqe_common wqe_com; /* words 6-11 */
2281 uint32_t rsvd_12_15[4]; /* word 12-15 */
2282};
2283
2284
2285union lpfc_wqe {
2286 uint32_t words[16];
2287 struct lpfc_wqe_generic generic;
2288 struct fcp_icmnd64_wqe fcp_icmd;
2289 struct fcp_iread64_wqe fcp_iread;
2290 struct fcp_iwrite64_wqe fcp_iwrite;
2291 struct abort_cmd_wqe abort_cmd;
2292 struct create_xri_wqe create_xri;
2293 struct xmit_bcast64_wqe xmit_bcast64;
2294 struct xmit_seq64_wqe xmit_sequence;
2295 struct xmit_bls_rsp64_wqe xmit_bls_rsp;
2296 struct xmit_els_rsp64_wqe xmit_els_rsp;
2297 struct els_request64_wqe els_req;
2298 struct gen_req64_wqe gen_req;
2299};
2300
2301#define FCP_COMMAND 0x0
2302#define FCP_COMMAND_DATA_OUT 0x1
2303#define ELS_COMMAND_NON_FIP 0xC
2304#define ELS_COMMAND_FIP 0xD
2305#define OTHER_COMMAND 0x8
2306