Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sli4_fc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2018, Emulex
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 /**
34  * @file
35  * Define Fibre Channel SLI-4 structures and function prototypes.
36  */
37 
38 #ifndef _SLI4_FC_H
39 #define _SLI4_FC_H
40 
41 #include "sli4.h"
42 #include "ocs_fcp.h"
43 
44 /**
45  * @brief Maximum value for a FCFI
46  *
47  * Note that although most commands provide a 16 bit field for the FCFI,
48  * the FC/FCoE Asynchronous Recived CQE format only provides 6 bits for
49  * the returned FCFI. Then effectively, the FCFI cannot be larger than
50  * 1 << 6 or 64.
51  */
52 #define SLI4_MAX_FCFI 64
53 
54 /**
55  * @brief Maximum value for FCF index
56  *
57  * The SLI-4 specification uses a 16 bit field in most places for the FCF
58  * index, but practically, this value will be much smaller. Arbitrarily
59  * limit the max FCF index to match the max FCFI value.
60  */
61 #define SLI4_MAX_FCF_INDEX SLI4_MAX_FCFI
62 
63 /*************************************************************************
64  * SLI-4 FC/FCoE mailbox command formats and definitions.
65  */
66 
67 /**
68  * FC/FCoE opcode (OPC) values.
69  */
70 #define SLI4_OPC_FCOE_WQ_CREATE 0x1
71 #define SLI4_OPC_FCOE_WQ_DESTROY 0x2
72 #define SLI4_OPC_FCOE_POST_SGL_PAGES 0x3
73 #define SLI4_OPC_FCOE_RQ_CREATE 0x5
74 #define SLI4_OPC_FCOE_RQ_DESTROY 0x6
75 #define SLI4_OPC_FCOE_READ_FCF_TABLE 0x8
76 #define SLI4_OPC_FCOE_POST_HDR_TEMPLATES 0xb
77 #define SLI4_OPC_FCOE_REDISCOVER_FCF 0x10
78 
79 /* Use the default CQ associated with the WQ */
80 #define SLI4_CQ_DEFAULT 0xffff
81 
82 typedef struct sli4_physical_page_descriptor_s {
83  uint32_t low;
84  uint32_t high;
86 
87 /**
88  * @brief FCOE_WQ_CREATE
89  *
90  * Create a Work Queue for FC/FCoE use.
91  */
92 #define SLI4_FCOE_WQ_CREATE_V0_MAX_PAGES 4
93 
94 typedef struct sli4_req_fcoe_wq_create_s {
96 #if BYTE_ORDER == LITTLE_ENDIAN
97  uint32_t num_pages:8,
98  dua:1,
99  :7,
100  cq_id:16;
102  uint32_t bqu:1,
103  :7,
104  ulp:8,
105  :16;
106 #else
107 #error big endian version not defined
108 #endif
110 
111 /**
112  * @brief FCOE_WQ_CREATE_V1
113  *
114  * Create a version 1 Work Queue for FC/FCoE use.
115  */
116 typedef struct sli4_req_fcoe_wq_create_v1_s {
118 #if BYTE_ORDER == LITTLE_ENDIAN
119  uint32_t num_pages:16,
120  cq_id:16;
121  uint32_t page_size:8,
122  wqe_size:4,
123  :3,
124  dpp:1,
125  wqe_count:16;
126  uint32_t rsvd6;
127  sli4_physical_page_descriptor_t page_physical_address[8];
128 #else
129 #error big endian version not defined
130 #endif
132 
133 #define SLI4_FCOE_WQ_CREATE_V1_MAX_PAGES 8
134 
135 /**
136  * @brief FCOE_WQ_DESTROY
137  *
138  * Destroy an FC/FCoE Work Queue.
139  */
140 typedef struct sli4_req_fcoe_wq_destroy_s {
142 #if BYTE_ORDER == LITTLE_ENDIAN
143  uint32_t wq_id:16,
144  :16;
145 #else
146 #error big endian version not defined
147 #endif
149 
150 /**
151  * @brief FCOE_POST_SGL_PAGES
152  *
153  * Register the scatter gather list (SGL) memory and associate it with an XRI.
154  */
155 typedef struct sli4_fcoe_post_sgl_page_desc_s {
156  uint32_t page0_low;
157  uint32_t page0_high;
158  uint32_t page1_low;
159  uint32_t page1_high;
161 
162 typedef struct sli4_req_fcoe_post_sgl_pages_s {
164 #if BYTE_ORDER == LITTLE_ENDIAN
165  uint32_t xri_start:16,
166  xri_count:16;
168 #else
169 #error big endian version not defined
170 #endif
172 
173 /**
174  * @brief FCOE_RQ_CREATE
175  *
176  * Create a Receive Queue for FC/FCoE use.
177  */
178 typedef struct sli4_req_fcoe_rq_create_s {
180 #if BYTE_ORDER == LITTLE_ENDIAN
181  uint32_t num_pages:16,
182  dua:1,
183  bqu:1,
184  :6,
185  ulp:8;
186  uint32_t :16,
187  rqe_count:4,
188  :12;
189  uint32_t rsvd6;
190  uint32_t buffer_size:16,
191  cq_id:16;
192  uint32_t rsvd8;
193  sli4_physical_page_descriptor_t page_physical_address[8];
194 #else
195 #error big endian version not defined
196 #endif
198 
199 #define SLI4_FCOE_RQ_CREATE_V0_MAX_PAGES 8
200 #define SLI4_FCOE_RQ_CREATE_V0_MIN_BUF_SIZE 128
201 #define SLI4_FCOE_RQ_CREATE_V0_MAX_BUF_SIZE 2048
202 
203 /**
204  * @brief FCOE_RQ_CREATE_V1
205  *
206  * Create a version 1 Receive Queue for FC/FCoE use.
207  */
208 typedef struct sli4_req_fcoe_rq_create_v1_s {
210 #if BYTE_ORDER == LITTLE_ENDIAN
211  uint32_t num_pages:16,
212  :13,
213  dim:1,
214  dfd:1,
215  dnb:1;
216  uint32_t page_size:8,
217  rqe_size:4,
218  :4,
219  rqe_count:16;
220  uint32_t rsvd6;
221  uint32_t :16,
222  cq_id:16;
223  uint32_t buffer_size;
224  sli4_physical_page_descriptor_t page_physical_address[8];
225 #else
226 #error big endian version not defined
227 #endif
229 
230 
231 /**
232  * @brief FCOE_RQ_CREATE_V2
233  *
234  * Create a version 2 Receive Queue for FC/FCoE use.
235  */
236 typedef struct sli4_req_fcoe_rq_create_v2_s {
238 #if BYTE_ORDER == LITTLE_ENDIAN
239  uint32_t num_pages:16,
240  rq_count:8,
241  :5,
242  dim:1,
243  dfd:1,
244  dnb:1;
245  uint32_t page_size:8,
246  rqe_size:4,
247  :4,
248  rqe_count:16;
249  uint32_t hdr_buffer_size:16,
250  payload_buffer_size:16;
251  uint32_t base_cq_id:16,
252  :16;
253  uint32_t rsvd;
254  sli4_physical_page_descriptor_t page_physical_address[0];
255 #else
256 #error big endian version not defined
257 #endif
259 
260 
261 #define SLI4_FCOE_RQ_CREATE_V1_MAX_PAGES 8
262 #define SLI4_FCOE_RQ_CREATE_V1_MIN_BUF_SIZE 64
263 #define SLI4_FCOE_RQ_CREATE_V1_MAX_BUF_SIZE 2048
264 
265 #define SLI4_FCOE_RQE_SIZE_8 0x2
266 #define SLI4_FCOE_RQE_SIZE_16 0x3
267 #define SLI4_FCOE_RQE_SIZE_32 0x4
268 #define SLI4_FCOE_RQE_SIZE_64 0x5
269 #define SLI4_FCOE_RQE_SIZE_128 0x6
270 
271 #define SLI4_FCOE_RQ_PAGE_SIZE_4096 0x1
272 #define SLI4_FCOE_RQ_PAGE_SIZE_8192 0x2
273 #define SLI4_FCOE_RQ_PAGE_SIZE_16384 0x4
274 #define SLI4_FCOE_RQ_PAGE_SIZE_32768 0x8
275 #define SLI4_FCOE_RQ_PAGE_SIZE_64536 0x10
276 
277 #define SLI4_FCOE_RQE_SIZE 8
278 
279 /**
280  * @brief FCOE_RQ_DESTROY
281  *
282  * Destroy an FC/FCoE Receive Queue.
283  */
284 typedef struct sli4_req_fcoe_rq_destroy_s {
286 #if BYTE_ORDER == LITTLE_ENDIAN
287  uint32_t rq_id:16,
288  :16;
289 #else
290 #error big endian version not defined
291 #endif
293 
294 /**
295  * @brief FCOE_READ_FCF_TABLE
296  *
297  * Retrieve a FCF database (also known as a table) entry created by the SLI Port
298  * during FIP discovery.
299  */
300 typedef struct sli4_req_fcoe_read_fcf_table_s {
302 #if BYTE_ORDER == LITTLE_ENDIAN
303  uint32_t fcf_index:16,
304  :16;
305 #else
306 #error big endian version not defined
307 #endif
309 
310 /* A FCF index of -1 on the request means return the first valid entry */
311 #define SLI4_FCOE_FCF_TABLE_FIRST (UINT16_MAX)
312 
313 /**
314  * @brief FCF table entry
315  *
316  * This is the information returned by the FCOE_READ_FCF_TABLE command.
317  */
318 typedef struct sli4_fcf_entry_s {
319 #if BYTE_ORDER == LITTLE_ENDIAN
321  uint32_t fip_keep_alive;
322  uint32_t fip_priority;
323  uint8_t fcf_mac_address[6];
324  uint8_t fcf_available;
326  uint8_t fabric_name_id[8];
327  uint8_t fc_map[3];
328  uint8_t val:1,
329  fc:1,
330  :5,
331  sol:1;
332  uint32_t fcf_index:16,
333  fcf_state:16;
334  uint8_t vlan_bitmap[512];
335  uint8_t switch_name[8];
336 #else
337 #error big endian version not defined
338 #endif
340 
341 /**
342  * @brief FCOE_READ_FCF_TABLE response.
343  */
344 typedef struct sli4_res_fcoe_read_fcf_table_s {
346 #if BYTE_ORDER == LITTLE_ENDIAN
347  uint32_t event_tag;
348  uint32_t next_index:16,
349  :16;
350  sli4_fcf_entry_t fcf_entry;
351 #else
352 #error big endian version not defined
353 #endif
355 
356 /* A next FCF index of -1 in the response means this is the last valid entry */
357 #define SLI4_FCOE_FCF_TABLE_LAST (UINT16_MAX)
358 
359 
360 /**
361  * @brief FCOE_POST_HDR_TEMPLATES
362  */
363 typedef struct sli4_req_fcoe_post_hdr_templates_s {
365 #if BYTE_ORDER == LITTLE_ENDIAN
366  uint32_t rpi_offset:16,
367  page_count:16;
369 #else
370 #error big endian version not defined
371 #endif
373 
374 #define SLI4_FCOE_HDR_TEMPLATE_SIZE 64
375 
376 /**
377  * @brief FCOE_REDISCOVER_FCF
378  */
379 typedef struct sli4_req_fcoe_rediscover_fcf_s {
381 #if BYTE_ORDER == LITTLE_ENDIAN
382  uint32_t fcf_count:16,
383  :16;
384  uint32_t rsvd5;
385  uint16_t fcf_index[16];
386 #else
387 #error big endian version not defined
388 #endif
390 
391 
392 /**
393  * Work Queue Entry (WQE) types.
394  */
395 #define SLI4_WQE_ABORT 0x0f
396 #define SLI4_WQE_ELS_REQUEST64 0x8a
397 #define SLI4_WQE_FCP_IBIDIR64 0xac
398 #define SLI4_WQE_FCP_IREAD64 0x9a
399 #define SLI4_WQE_FCP_IWRITE64 0x98
400 #define SLI4_WQE_FCP_ICMND64 0x9c
401 #define SLI4_WQE_FCP_TRECEIVE64 0xa1
402 #define SLI4_WQE_FCP_CONT_TRECEIVE64 0xe5
403 #define SLI4_WQE_FCP_TRSP64 0xa3
404 #define SLI4_WQE_FCP_TSEND64 0x9f
405 #define SLI4_WQE_GEN_REQUEST64 0xc2
406 #define SLI4_WQE_SEND_FRAME 0xe1
407 #define SLI4_WQE_XMIT_BCAST64 0X84
408 #define SLI4_WQE_XMIT_BLS_RSP 0x97
409 #define SLI4_WQE_ELS_RSP64 0x95
410 #define SLI4_WQE_XMIT_SEQUENCE64 0x82
411 #define SLI4_WQE_REQUEUE_XRI 0x93
412 
413 /**
414  * WQE command types.
415  */
416 #define SLI4_CMD_FCP_IREAD64_WQE 0x00
417 #define SLI4_CMD_FCP_ICMND64_WQE 0x00
418 #define SLI4_CMD_FCP_IWRITE64_WQE 0x01
419 #define SLI4_CMD_FCP_TRECEIVE64_WQE 0x02
420 #define SLI4_CMD_FCP_TRSP64_WQE 0x03
421 #define SLI4_CMD_FCP_TSEND64_WQE 0x07
422 #define SLI4_CMD_GEN_REQUEST64_WQE 0x08
423 #define SLI4_CMD_XMIT_BCAST64_WQE 0x08
424 #define SLI4_CMD_XMIT_BLS_RSP64_WQE 0x08
425 #define SLI4_CMD_ABORT_WQE 0x08
426 #define SLI4_CMD_XMIT_SEQUENCE64_WQE 0x08
427 #define SLI4_CMD_REQUEUE_XRI_WQE 0x0A
428 #define SLI4_CMD_SEND_FRAME_WQE 0x0a
429 
430 #define SLI4_WQE_SIZE 0x05
431 #define SLI4_WQE_EXT_SIZE 0x06
432 
433 #define SLI4_WQE_BYTES (16 * sizeof(uint32_t))
434 #define SLI4_WQE_EXT_BYTES (32 * sizeof(uint32_t))
435 
436 /* Mask for ccp (CS_CTL) */
437 #define SLI4_MASK_CCP 0xff
438 
439 /**
440  * @brief Generic WQE
441  */
442 typedef struct sli4_generic_wqe_s {
443 #if BYTE_ORDER == LITTLE_ENDIAN
444  uint32_t cmd_spec0_5[6];
445  uint32_t xri_tag:16,
446  context_tag:16;
447  uint32_t :2,
448  ct:2,
449  :4,
450  command:8,
451  class:3,
452  :1,
453  pu:2,
454  :2,
455  timer:8;
456  uint32_t abort_tag;
457  uint32_t request_tag:16,
458  :16;
459  uint32_t ebde_cnt:4,
460  :3,
461  len_loc:2,
462  qosd:1,
463  :1,
464  xbl:1,
465  hlm:1,
466  iod:1,
467  dbde:1,
468  wqes:1,
469  pri:3,
470  pv:1,
471  eat:1,
472  xc:1,
473  :1,
474  ccpe:1,
475  ccp:8;
476  uint32_t cmd_type:4,
477  :3,
478  wqec:1,
479  :8,
480  cq_id:16;
481 #else
482 #error big endian version not defined
483 #endif
485 
486 /**
487  * @brief WQE used to abort exchanges.
488  */
489 typedef struct sli4_abort_wqe_s {
490 #if BYTE_ORDER == LITTLE_ENDIAN
491  uint32_t rsvd0;
492  uint32_t rsvd1;
493  uint32_t ext_t_tag;
494  uint32_t ia:1,
495  ir:1,
496  :6,
497  criteria:8,
498  :16;
499  uint32_t ext_t_mask;
500  uint32_t t_mask;
501  uint32_t xri_tag:16,
502  context_tag:16;
503  uint32_t :2,
504  ct:2,
505  :4,
506  command:8,
507  class:3,
508  :1,
509  pu:2,
510  :2,
511  timer:8;
512  uint32_t t_tag;
513  uint32_t request_tag:16,
514  :16;
515  uint32_t ebde_cnt:4,
516  :3,
517  len_loc:2,
518  qosd:1,
519  :1,
520  xbl:1,
521  :1,
522  iod:1,
523  dbde:1,
524  wqes:1,
525  pri:3,
526  pv:1,
527  eat:1,
528  xc:1,
529  :1,
530  ccpe:1,
531  ccp:8;
532  uint32_t cmd_type:4,
533  :3,
534  wqec:1,
535  :8,
536  cq_id:16;
537 #else
538 #error big endian version not defined
539 #endif
541 
542 #define SLI4_ABORT_CRITERIA_XRI_TAG 0x01
543 #define SLI4_ABORT_CRITERIA_ABORT_TAG 0x02
544 #define SLI4_ABORT_CRITERIA_REQUEST_TAG 0x03
545 #define SLI4_ABORT_CRITERIA_EXT_ABORT_TAG 0x04
546 
547 typedef enum {
551  SLI_ABORT_MAX, // must be last
553 
554 /**
555  * @brief WQE used to create an ELS request.
556  */
557 typedef struct sli4_els_request64_wqe_s {
559 #if BYTE_ORDER == LITTLE_ENDIAN
561  uint32_t sid:24,
562  sp:1,
563  :7;
564  uint32_t remote_id:24,
565  :8;
566  uint32_t xri_tag:16,
567  context_tag:16;
568  uint32_t :2,
569  ct:2,
570  :4,
571  command:8,
572  class:3,
573  ar:1,
574  pu:2,
575  :2,
576  timer:8;
577  uint32_t abort_tag;
578  uint32_t request_tag:16,
579  temporary_rpi:16;
580  uint32_t ebde_cnt:4,
581  :3,
582  len_loc:2,
583  qosd:1,
584  :1,
585  xbl:1,
586  hlm:1,
587  iod:1,
588  dbde:1,
589  wqes:1,
590  pri:3,
591  pv:1,
592  eat:1,
593  xc:1,
594  :1,
595  ccpe:1,
596  ccp:8;
597  uint32_t cmd_type:4,
598  els_id:3,
599  wqec:1,
600  :8,
601  cq_id:16;
604 #else
605 #error big endian version not defined
606 #endif
608 
609 #define SLI4_ELS_REQUEST64_CONTEXT_RPI 0x0
610 #define SLI4_ELS_REQUEST64_CONTEXT_VPI 0x1
611 #define SLI4_ELS_REQUEST64_CONTEXT_VFI 0x2
612 #define SLI4_ELS_REQUEST64_CONTEXT_FCFI 0x3
613 
614 #define SLI4_ELS_REQUEST64_CLASS_2 0x1
615 #define SLI4_ELS_REQUEST64_CLASS_3 0x2
616 
617 #define SLI4_ELS_REQUEST64_DIR_WRITE 0x0
618 #define SLI4_ELS_REQUEST64_DIR_READ 0x1
619 
620 #define SLI4_ELS_REQUEST64_OTHER 0x0
621 #define SLI4_ELS_REQUEST64_LOGO 0x1
622 #define SLI4_ELS_REQUEST64_FDISC 0x2
623 #define SLI4_ELS_REQUEST64_FLOGIN 0x3
624 #define SLI4_ELS_REQUEST64_PLOGI 0x4
625 
626 #define SLI4_ELS_REQUEST64_CMD_GEN 0x08
627 #define SLI4_ELS_REQUEST64_CMD_NON_FABRIC 0x0c
628 #define SLI4_ELS_REQUEST64_CMD_FABRIC 0x0d
629 
630 /**
631  * @brief WQE used to create an FCP initiator no data command.
632  */
633 typedef struct sli4_fcp_icmnd64_wqe_s {
635 #if BYTE_ORDER == LITTLE_ENDIAN
636  uint32_t payload_offset_length:16,
637  fcp_cmd_buffer_length:16;
638  uint32_t rsvd4;
639  uint32_t remote_n_port_id:24,
640  :8;
641  uint32_t xri_tag:16,
642  context_tag:16;
643  uint32_t dif:2,
644  ct:2,
645  bs:3,
646  :1,
647  command:8,
648  class:3,
649  :1,
650  pu:2,
651  erp:1,
652  lnk:1,
653  timer:8;
654  uint32_t abort_tag;
655  uint32_t request_tag:16,
656  :16;
657  uint32_t ebde_cnt:4,
658  :3,
659  len_loc:2,
660  qosd:1,
661  :1,
662  xbl:1,
663  hlm:1,
664  iod:1,
665  dbde:1,
666  wqes:1,
667  pri:3,
668  pv:1,
669  eat:1,
670  xc:1,
671  :1,
672  ccpe:1,
673  ccp:8;
674  uint32_t cmd_type:4,
675  :3,
676  wqec:1,
677  :8,
678  cq_id:16;
679  uint32_t rsvd12;
680  uint32_t rsvd13;
681  uint32_t rsvd14;
682  uint32_t rsvd15;
683 #else
684 #error big endian version not defined
685 #endif
687 
688 /**
689  * @brief WQE used to create an FCP initiator read.
690  */
691 typedef struct sli4_fcp_iread64_wqe_s {
693 #if BYTE_ORDER == LITTLE_ENDIAN
694  uint32_t payload_offset_length:16,
695  fcp_cmd_buffer_length:16;
697  uint32_t remote_n_port_id:24,
698  :8;
699  uint32_t xri_tag:16,
700  context_tag:16;
701  uint32_t dif:2,
702  ct:2,
703  bs:3,
704  :1,
705  command:8,
706  class:3,
707  :1,
708  pu:2,
709  erp:1,
710  lnk:1,
711  timer:8;
712  uint32_t abort_tag;
713  uint32_t request_tag:16,
714  :16;
715  uint32_t ebde_cnt:4,
716  :3,
717  len_loc:2,
718  qosd:1,
719  :1,
720  xbl:1,
721  hlm:1,
722  iod:1,
723  dbde:1,
724  wqes:1,
725  pri:3,
726  pv:1,
727  eat:1,
728  xc:1,
729  :1,
730  ccpe:1,
731  ccp:8;
732  uint32_t cmd_type:4,
733  :3,
734  wqec:1,
735  :8,
736  cq_id:16;
737  uint32_t rsvd12;
738 #else
739 #error big endian version not defined
740 #endif
741  sli4_bde_t first_data_bde; /* reserved if performance hints disabled */
743 
744 /**
745  * @brief WQE used to create an FCP initiator write.
746  */
747 typedef struct sli4_fcp_iwrite64_wqe_s {
749 #if BYTE_ORDER == LITTLE_ENDIAN
750  uint32_t payload_offset_length:16,
751  fcp_cmd_buffer_length:16;
754  uint32_t xri_tag:16,
755  context_tag:16;
756  uint32_t dif:2,
757  ct:2,
758  bs:3,
759  :1,
760  command:8,
761  class:3,
762  :1,
763  pu:2,
764  erp:1,
765  lnk:1,
766  timer:8;
767  uint32_t abort_tag;
768  uint32_t request_tag:16,
769  :16;
770  uint32_t ebde_cnt:4,
771  :3,
772  len_loc:2,
773  qosd:1,
774  :1,
775  xbl:1,
776  hlm:1,
777  iod:1,
778  dbde:1,
779  wqes:1,
780  pri:3,
781  pv:1,
782  eat:1,
783  xc:1,
784  :1,
785  ccpe:1,
786  ccp:8;
787  uint32_t cmd_type:4,
788  :3,
789  wqec:1,
790  :8,
791  cq_id:16;
792  uint32_t remote_n_port_id:24,
793  :8;
794 #else
795 #error big endian version not defined
796 #endif
797  sli4_bde_t first_data_bde;
799 
800 
801 typedef struct sli4_fcp_128byte_wqe_s {
802  uint32_t dw[32];
804 
805 /**
806  * @brief WQE used to create an FCP target receive, and FCP target
807  * receive continue.
808  */
809 typedef struct sli4_fcp_treceive64_wqe_s {
811 #if BYTE_ORDER == LITTLE_ENDIAN
813  uint32_t relative_offset;
814  /**
815  * DWord 5 can either be the task retry identifier (HLM=0) or
816  * the remote N_Port ID (HLM=1), or if implementing the Skyhawk
817  * T10-PI workaround, the secondary xri tag
818  */
819  union {
820  uint32_t sec_xri_tag:16,
821  :16;
822  uint32_t dword;
823  } dword5;
824  uint32_t xri_tag:16,
825  context_tag:16;
826  uint32_t dif:2,
827  ct:2,
828  bs:3,
829  :1,
830  command:8,
831  class:3,
832  ar:1,
833  pu:2,
834  conf:1,
835  lnk:1,
836  timer:8;
837  uint32_t abort_tag;
838  uint32_t request_tag:16,
839  remote_xid:16;
840  uint32_t ebde_cnt:4,
841  :1,
842  app_id_valid:1,
843  :1,
844  len_loc:2,
845  qosd:1,
846  wchn:1,
847  xbl:1,
848  hlm:1,
849  iod:1,
850  dbde:1,
851  wqes:1,
852  pri:3,
853  pv:1,
854  eat:1,
855  xc:1,
856  sr:1,
857  ccpe:1,
858  ccp:8;
859  uint32_t cmd_type:4,
860  irsp:1,
861  pbde:1,
862  :1,
863  wqec:1,
864  :8,
865  cq_id:16;
867 
868 #else
869 #error big endian version not defined
870 #endif
871  sli4_bde_t first_data_bde; /* For performance hints */
872 
874 
875 /**
876  * @brief WQE used to create an FCP target response.
877  */
878 typedef struct sli4_fcp_trsp64_wqe_s {
880 #if BYTE_ORDER == LITTLE_ENDIAN
882  uint32_t rsvd4;
883  /**
884  * DWord 5 can either be the task retry identifier (HLM=0) or
885  * the remote N_Port ID (HLM=1)
886  */
887  uint32_t dword5;
888  uint32_t xri_tag:16,
889  rpi:16;
890  uint32_t :2,
891  ct:2,
892  dnrx:1,
893  :3,
894  command:8,
895  class:3,
896  ag:1,
897  pu:2,
898  conf:1,
899  lnk:1,
900  timer:8;
901  uint32_t abort_tag;
902  uint32_t request_tag:16,
903  remote_xid:16;
904  uint32_t ebde_cnt:4,
905  :1,
906  app_id_valid:1,
907  :1,
908  len_loc:2,
909  qosd:1,
910  wchn:1,
911  xbl:1,
912  hlm:1,
913  iod:1,
914  dbde:1,
915  wqes:1,
916  pri:3,
917  pv:1,
918  eat:1,
919  xc:1,
920  sr:1,
921  ccpe:1,
922  ccp:8;
923  uint32_t cmd_type:4,
924  :3,
925  wqec:1,
926  :8,
927  cq_id:16;
928  uint32_t rsvd12;
929  uint32_t rsvd13;
930  uint32_t rsvd14;
931  uint32_t rsvd15;
932 #else
933 #error big endian version not defined
934 #endif
936 
937 /**
938  * @brief WQE used to create an FCP target send (DATA IN).
939  */
940 typedef struct sli4_fcp_tsend64_wqe_s {
942 #if BYTE_ORDER == LITTLE_ENDIAN
944  uint32_t relative_offset;
945  /**
946  * DWord 5 can either be the task retry identifier (HLM=0) or
947  * the remote N_Port ID (HLM=1)
948  */
949  uint32_t dword5;
950  uint32_t xri_tag:16,
951  rpi:16;
952  uint32_t dif:2,
953  ct:2,
954  bs:3,
955  :1,
956  command:8,
957  class:3,
958  ar:1,
959  pu:2,
960  conf:1,
961  lnk:1,
962  timer:8;
963  uint32_t abort_tag;
964  uint32_t request_tag:16,
965  remote_xid:16;
966  uint32_t ebde_cnt:4,
967  :1,
968  app_id_valid:1,
969  :1,
970  len_loc:2,
971  qosd:1,
972  wchn:1,
973  xbl:1,
974  hlm:1,
975  iod:1,
976  dbde:1,
977  wqes:1,
978  pri:3,
979  pv:1,
980  eat:1,
981  xc:1,
982  sr:1,
983  ccpe:1,
984  ccp:8;
985  uint32_t cmd_type:4,
986  :2,
987  suppress_rsp:1,
988  wqec:1,
989  :8,
990  cq_id:16;
992 
993 #else
994 #error big endian version not defined
995 #endif
996  sli4_bde_t first_data_bde; /* For performance hints */
998 
999 #define SLI4_IO_CONTINUATION BIT(0) /** The XRI associated with this IO is already active */
1000 #define SLI4_IO_AUTO_GOOD_RESPONSE BIT(1) /** Automatically generate a good RSP frame */
1001 #define SLI4_IO_NO_ABORT BIT(2)
1002 #define SLI4_IO_DNRX BIT(3) /** Set the DNRX bit because no auto xref rdy buffer is posted */
1003 #define SLI4_IO_SUPPRESS_RESPONSE BIT(4) /** Suppress resp is supported only when AutoResp is enabled */
1004 
1005 /* WQE DIF field contents */
1006 #define SLI4_DIF_DISABLED 0
1007 #define SLI4_DIF_PASS_THROUGH 1
1008 #define SLI4_DIF_STRIP 2
1009 #define SLI4_DIF_INSERT 3
1010 
1011 /**
1012  * @brief WQE used to create a general request.
1013  */
1014 typedef struct sli4_gen_request64_wqe_s {
1016 #if BYTE_ORDER == LITTLE_ENDIAN
1019  uint32_t :8,
1020  df_ctl:8,
1021  type:8,
1022  r_ctl:8;
1023  uint32_t xri_tag:16,
1024  context_tag:16;
1025  uint32_t :2,
1026  ct:2,
1027  :4,
1028  command:8,
1029  class:3,
1030  :1,
1031  pu:2,
1032  :2,
1033  timer:8;
1034  uint32_t abort_tag;
1035  uint32_t request_tag:16,
1036  :16;
1037  uint32_t ebde_cnt:4,
1038  :3,
1039  len_loc:2,
1040  qosd:1,
1041  :1,
1042  xbl:1,
1043  hlm:1,
1044  iod:1,
1045  dbde:1,
1046  wqes:1,
1047  pri:3,
1048  pv:1,
1049  eat:1,
1050  xc:1,
1051  :1,
1052  ccpe:1,
1053  ccp:8;
1054  uint32_t cmd_type:4,
1055  :3,
1056  wqec:1,
1057  :8,
1058  cq_id:16;
1059  uint32_t remote_n_port_id:24,
1060  :8;
1061  uint32_t rsvd13;
1062  uint32_t rsvd14;
1064 #else
1065 #error big endian version not defined
1066 #endif
1068 
1069 /**
1070  * @brief WQE used to create a send frame request.
1071  */
1072 typedef struct sli4_send_frame_wqe_s {
1074 #if BYTE_ORDER == LITTLE_ENDIAN
1075  uint32_t frame_length;
1076  uint32_t fc_header_0_1[2];
1077  uint32_t xri_tag:16,
1078  context_tag:16;
1079  uint32_t :2,
1080  ct:2,
1081  :4,
1082  command:8,
1083  class:3,
1084  :1,
1085  pu:2,
1086  :2,
1087  timer:8;
1088  uint32_t abort_tag;
1089  uint32_t request_tag:16,
1090  eof:8,
1091  sof:8;
1092  uint32_t ebde_cnt:4,
1093  :3,
1094  lenloc:2,
1095  qosd:1,
1096  wchn:1,
1097  xbl:1,
1098  hlm:1,
1099  iod:1,
1100  dbde:1,
1101  wqes:1,
1102  pri:3,
1103  pv:1,
1104  eat:1,
1105  xc:1,
1106  :1,
1107  ccpe:1,
1108  ccp:8;
1109  uint32_t cmd_type:4,
1110  :3,
1111  wqec:1,
1112  :8,
1113  cq_id:16;
1114  uint32_t fc_header_2_5[4];
1115 #else
1116 #error big endian version not defined
1117 #endif
1119 
1120 /**
1121  * @brief WQE used to create a transmit sequence.
1122  */
1123 typedef struct sli4_xmit_sequence64_wqe_s {
1125 #if BYTE_ORDER == LITTLE_ENDIAN
1126  uint32_t remote_n_port_id:24,
1127  :8;
1128  uint32_t relative_offset;
1129  uint32_t :2,
1130  si:1,
1131  ft:1,
1132  :2,
1133  xo:1,
1134  ls:1,
1135  df_ctl:8,
1136  type:8,
1137  r_ctl:8;
1138  uint32_t xri_tag:16,
1139  context_tag:16;
1140  uint32_t dif:2,
1141  ct:2,
1142  bs:3,
1143  :1,
1144  command:8,
1145  class:3,
1146  :1,
1147  pu:2,
1148  :2,
1149  timer:8;
1150  uint32_t abort_tag;
1151  uint32_t request_tag:16,
1152  remote_xid:16;
1153  uint32_t ebde_cnt:4,
1154  :3,
1155  len_loc:2,
1156  qosd:1,
1157  :1,
1158  xbl:1,
1159  hlm:1,
1160  iod:1,
1161  dbde:1,
1162  wqes:1,
1163  pri:3,
1164  pv:1,
1165  eat:1,
1166  xc:1,
1167  sr:1,
1168  ccpe:1,
1169  ccp:8;
1170  uint32_t cmd_type:4,
1171  :3,
1172  wqec:1,
1173  :8,
1174  cq_id:16;
1176  uint32_t rsvd13;
1177  uint32_t rsvd14;
1178  uint32_t rsvd15;
1179 #else
1180 #error big endian version not defined
1181 #endif
1183 
1184 /**
1185  * @brief WQE used unblock the specified XRI and to release it to the SLI Port's free pool.
1186  */
1187 typedef struct sli4_requeue_xri_wqe_s {
1188  uint32_t rsvd0;
1189  uint32_t rsvd1;
1190  uint32_t rsvd2;
1191  uint32_t rsvd3;
1192  uint32_t rsvd4;
1193  uint32_t rsvd5;
1194 #if BYTE_ORDER == LITTLE_ENDIAN
1195  uint32_t xri_tag:16,
1196  context_tag:16;
1197  uint32_t :2,
1198  ct:2,
1199  :4,
1200  command:8,
1201  class:3,
1202  :1,
1203  pu:2,
1204  :2,
1205  timer:8;
1206  uint32_t rsvd8;
1207  uint32_t request_tag:16,
1208  :16;
1209  uint32_t ebde_cnt:4,
1210  rsvd_w10b4:1,
1211  disable_cqe:1,
1212  oas:1,
1213  len_loc:2,
1214  qosd:1,
1215  wchn:1,
1216  xbl:1,
1217  hlm:1,
1218  iod:1,
1219  dbde:1,
1220  wqes:1,
1221  pri:3,
1222  pv:1,
1223  eat:1,
1224  xc:1,
1225  :1,
1226  ccpe:1,
1227  ccp:8;
1228  uint32_t cmd_type:4,
1229  :3,
1230  wqec:1,
1231  :8,
1232  cq_id:16;
1233  uint32_t rsvd12;
1234  uint32_t rsvd13;
1235  uint32_t rsvd14;
1236  uint32_t rsvd15;
1237 #else
1238 #error big endian version not defined
1239 #endif
1241 
1242 /**
1243  * @brief WQE used to send a single frame sequence to broadcast address
1244  */
1245 typedef struct sli4_xmit_bcast64_wqe_s {
1247 #if BYTE_ORDER == LITTLE_ENDIAN
1249  uint32_t rsvd4;
1250  uint32_t :8,
1251  df_ctl:8,
1252  type:8,
1253  r_ctl:8;
1254  uint32_t xri_tag:16,
1255  context_tag:16;
1256  uint32_t :2,
1257  ct:2,
1258  :4,
1259  command:8,
1260  class:3,
1261  :1,
1262  pu:2,
1263  :2,
1264  timer:8;
1265  uint32_t abort_tag;
1266  uint32_t request_tag:16,
1267  temporary_rpi:16;
1268  uint32_t ebde_cnt:4,
1269  :3,
1270  len_loc:2,
1271  qosd:1,
1272  :1,
1273  xbl:1,
1274  hlm:1,
1275  iod:1,
1276  dbde:1,
1277  wqes:1,
1278  pri:3,
1279  pv:1,
1280  eat:1,
1281  xc:1,
1282  :1,
1283  ccpe:1,
1284  ccp:8;
1285  uint32_t cmd_type:4,
1286  :3,
1287  wqec:1,
1288  :8,
1289  cq_id:16;
1290  uint32_t rsvd12;
1291  uint32_t rsvd13;
1292  uint32_t rsvd14;
1293  uint32_t rsvd15;
1294 #else
1295 #error big endian version not defined
1296 #endif
1298 
1299 /**
1300  * @brief WQE used to create a BLS response.
1301  */
1302 typedef struct sli4_xmit_bls_rsp_wqe_s {
1303 #if BYTE_ORDER == LITTLE_ENDIAN
1304  uint32_t payload_word0;
1305  uint32_t rx_id:16,
1306  ox_id:16;
1307  uint32_t high_seq_cnt:16,
1308  low_seq_cnt:16;
1309  uint32_t rsvd3;
1310  uint32_t local_n_port_id:24,
1311  :8;
1312  uint32_t remote_id:24,
1313  :6,
1314  ar:1,
1315  xo:1;
1316  uint32_t xri_tag:16,
1317  context_tag:16;
1318  uint32_t :2,
1319  ct:2,
1320  :4,
1321  command:8,
1322  class:3,
1323  :1,
1324  pu:2,
1325  :2,
1326  timer:8;
1327  uint32_t abort_tag;
1328  uint32_t request_tag:16,
1329  :16;
1330  uint32_t ebde_cnt:4,
1331  :3,
1332  len_loc:2,
1333  qosd:1,
1334  :1,
1335  xbl:1,
1336  hlm:1,
1337  iod:1,
1338  dbde:1,
1339  wqes:1,
1340  pri:3,
1341  pv:1,
1342  eat:1,
1343  xc:1,
1344  :1,
1345  ccpe:1,
1346  ccp:8;
1347  uint32_t cmd_type:4,
1348  :3,
1349  wqec:1,
1350  :8,
1351  cq_id:16;
1352  uint32_t temporary_rpi:16,
1353  :16;
1354  uint32_t rsvd13;
1355  uint32_t rsvd14;
1356  uint32_t rsvd15;
1357 #else
1358 #error big endian version not defined
1359 #endif
1361 
1362 typedef enum {
1366 } sli_bls_type_e;
1367 
1368 typedef struct sli_bls_payload_s {
1370  uint16_t ox_id;
1371  uint16_t rx_id;
1372  union {
1373  struct {
1374  uint32_t seq_id_validity:8,
1375  seq_id_last:8,
1376  :16;
1377  uint16_t ox_id;
1378  uint16_t rx_id;
1379  uint16_t low_seq_cnt;
1380  uint16_t high_seq_cnt;
1381  } acc;
1382  struct {
1383  uint32_t vendor_unique:8,
1384  reason_explanation:8,
1385  reason_code:8,
1386  :8;
1387  } rjt;
1388  } u;
1390 
1391 /**
1392  * @brief WQE used to create an ELS response.
1393  */
1394 typedef struct sli4_xmit_els_rsp64_wqe_s {
1396 #if BYTE_ORDER == LITTLE_ENDIAN
1398  uint32_t s_id:24,
1399  sp:1,
1400  :7;
1401  uint32_t remote_id:24,
1402  :8;
1403  uint32_t xri_tag:16,
1404  context_tag:16;
1405  uint32_t :2,
1406  ct:2,
1407  :4,
1408  command:8,
1409  class:3,
1410  :1,
1411  pu:2,
1412  :2,
1413  timer:8;
1414  uint32_t abort_tag;
1415  uint32_t request_tag:16,
1416  ox_id:16;
1417  uint32_t ebde_cnt:4,
1418  :3,
1419  len_loc:2,
1420  qosd:1,
1421  :1,
1422  xbl:1,
1423  hlm:1,
1424  iod:1,
1425  dbde:1,
1426  wqes:1,
1427  pri:3,
1428  pv:1,
1429  eat:1,
1430  xc:1,
1431  :1,
1432  ccpe:1,
1433  ccp:8;
1434  uint32_t cmd_type:4,
1435  :3,
1436  wqec:1,
1437  :8,
1438  cq_id:16;
1439  uint32_t temporary_rpi:16,
1440  :16;
1441  uint32_t rsvd13;
1442  uint32_t rsvd14;
1443  uint32_t rsvd15;
1444 #else
1445 #error big endian version not defined
1446 #endif
1448 
1449 /**
1450  * @brief Asynchronouse Event: Link State ACQE.
1451  */
1452 typedef struct sli4_link_state_s {
1453 #if BYTE_ORDER == LITTLE_ENDIAN
1454  uint32_t link_number:6,
1455  link_type:2,
1456  port_link_status:8,
1457  port_duplex:8,
1458  port_speed:8;
1459  uint32_t port_fault:8,
1460  :8,
1461  logical_link_speed:16;
1462  uint32_t event_tag;
1463  uint32_t :8,
1464  event_code:8,
1465  event_type:8, /** values are protocol specific */
1466  :6,
1467  ae:1, /** async event - this is an ACQE */
1468  val:1; /** valid - contents of CQE are valid */
1469 #else
1470 #error big endian version not defined
1471 #endif
1473 
1474 
1475 #define SLI4_LINK_ATTN_TYPE_LINK_UP 0x01
1476 #define SLI4_LINK_ATTN_TYPE_LINK_DOWN 0x02
1477 #define SLI4_LINK_ATTN_TYPE_NO_HARD_ALPA 0x03
1478 #define SLI4_LINK_ATTN_TYPE_TRUNK_EVENT 0x07
1479 
1480 #define SLI4_LINK_ATTN_P2P 0x01
1481 #define SLI4_LINK_ATTN_FC_AL 0x02
1482 #define SLI4_LINK_ATTN_INTERNAL_LOOPBACK 0x03
1483 #define SLI4_LINK_ATTN_SERDES_LOOPBACK 0x04
1484 
1485 #define SLI4_LINK_ATTN_1G 0x01
1486 #define SLI4_LINK_ATTN_2G 0x02
1487 #define SLI4_LINK_ATTN_4G 0x04
1488 #define SLI4_LINK_ATTN_8G 0x08
1489 #define SLI4_LINK_ATTN_10G 0x0a
1490 #define SLI4_LINK_ATTN_16G 0x10
1491 #define SLI4_LINK_ATTN_32G 0x20
1492 #define SLI4_LINK_ATTN_64G 0x21
1493 #define SLI4_LINK_ATTN_128G 0x22
1494 #define SLI4_LINK_ATTN_256G 0x23
1495 
1496 
1497 #define SLI4_LINK_TYPE_ETHERNET 0x0
1498 #define SLI4_LINK_TYPE_FC 0x1
1499 
1500 #define SLI4_FC_TRUNK_CONFIG_MASK 0xF0
1501 #define SLI4_FC_TRUNK_LINK_STATE_MASK 0x0F
1502 
1503 /* 2 links per trunk config, trunk incorporates either,
1504  * a) port 0/1 of a 4-port device
1505  * b) Both ports of a 2-port device
1506  */
1507 #define SLI4_FC_TRUNK_2_PORT_CONFIG 0x30
1508 
1509 /* 2 links per trunk config that incorporates port 2/3 of a 4-port device. */
1510 #define SLI4_FC_TRUNK_2_PORT_HI_CONFIG 0xC0
1511 
1512 /* 4 links per trunk config that incorporates all ports of a 4-port device. */
1513 #define SLI4_FC_TRUNK_4_PORT_CONFIG 0xF0
1514 
1515 
1516 /**
1517  * @brief Asynchronouse Event: FC Link Attention Event.
1518  */
1519 typedef struct sli4_link_attention_s {
1520 #if BYTE_ORDER == LITTLE_ENDIAN
1521  uint32_t link_number:8,
1522  attn_type:8,
1523  topology:8,
1524  port_speed:8;
1525  uint32_t port_fault:8,
1526  shared_link_status:8,
1527  logical_link_speed:16;
1528  uint32_t event_tag;
1529  uint32_t :8,
1530  event_code:8,
1531  event_type:8, /** values are protocol specific */
1532  :6,
1533  ae:1, /** async event - this is an ACQE */
1534  val:1; /** valid - contents of CQE are valid */
1535 #else
1536 #error big endian version not defined
1537 #endif
1539 
1540 /**
1541  * @brief FC/FCoE event types.
1542  */
1543 #define SLI4_LINK_STATE_PHYSICAL 0x00
1544 #define SLI4_LINK_STATE_LOGICAL 0x01
1545 
1546 #define SLI4_FCOE_FIP_FCF_DISCOVERED 0x01
1547 #define SLI4_FCOE_FIP_FCF_TABLE_FULL 0x02
1548 #define SLI4_FCOE_FIP_FCF_DEAD 0x03
1549 #define SLI4_FCOE_FIP_FCF_CLEAR_VLINK 0x04
1550 #define SLI4_FCOE_FIP_FCF_MODIFIED 0x05
1551 
1552 #define SLI4_GRP5_QOS_SPEED 0x01
1553 
1554 #define SLI4_FC_EVENT_LINK_ATTENTION 0x01
1555 #define SLI4_FC_EVENT_SHARED_LINK_ATTENTION 0x02
1556 
1557 #define SLI4_PORT_SPEED_NO_LINK 0x0
1558 #define SLI4_PORT_SPEED_10_MBPS 0x1
1559 #define SLI4_PORT_SPEED_100_MBPS 0x2
1560 #define SLI4_PORT_SPEED_1_GBPS 0x3
1561 #define SLI4_PORT_SPEED_10_GBPS 0x4
1562 
1563 #define SLI4_PORT_DUPLEX_NONE 0x0
1564 #define SLI4_PORT_DUPLEX_HALF 0x1
1565 #define SLI4_PORT_DUPLEX_FULL 0x2
1566 
1567 #define SLI4_PORT_LINK_STATUS_PHYSICAL_DOWN 0x0
1568 #define SLI4_PORT_LINK_STATUS_PHYSICAL_UP 0x1
1569 #define SLI4_PORT_LINK_STATUS_LOGICAL_DOWN 0x2
1570 #define SLI4_PORT_LINK_STATUS_LOGICAL_UP 0x3
1571 
1572 /**
1573  * @brief Asynchronouse Event: FCoE/FIP ACQE.
1574  */
1575 typedef struct sli4_fcoe_fip_s {
1576 #if BYTE_ORDER == LITTLE_ENDIAN
1578  uint32_t fcf_count:16,
1579  fcoe_event_type:16;
1580  uint32_t event_tag;
1581  uint32_t :8,
1582  event_code:8,
1583  event_type:8, /** values are protocol specific */
1584  :6,
1585  ae:1, /** async event - this is an ACQE */
1586  val:1; /** valid - contents of CQE are valid */
1587 #else
1588 #error big endian version not defined
1589 #endif
1590 } sli4_fcoe_fip_t;
1591 
1592 /**
1593  * @brief FC/FCoE WQ completion queue entry.
1594  */
1595 typedef struct sli4_fc_wcqe_s {
1596 #if BYTE_ORDER == LITTLE_ENDIAN
1597  uint32_t hw_status:8,
1598  status:8,
1599  request_tag:16;
1600  uint32_t wqe_specific_1;
1601  uint32_t wqe_specific_2;
1602  uint32_t :15,
1603  qx:1,
1604  code:8,
1605  pri:3,
1606  pv:1,
1607  xb:1,
1608  rha:1,
1609  :1,
1610  vld:1;
1611 #else
1612 #error big endian version not defined
1613 #endif
1614 } sli4_fc_wcqe_t;
1615 
1616 /**
1617  * @brief FC/FCoE WQ consumed CQ queue entry.
1618  */
1619 typedef struct sli4_fc_wqec_s {
1620 #if BYTE_ORDER == LITTLE_ENDIAN
1621  uint32_t :32;
1622  uint32_t :32;
1623  uint32_t wqe_index:16,
1624  wq_id:16;
1625  uint32_t :16,
1626  code:8,
1627  :7,
1628  vld:1;
1629 #else
1630 #error big endian version not defined
1631 #endif
1632 } sli4_fc_wqec_t;
1633 
1634 
1635 /**
1636  * @brief FC/FCoE Completion Status Codes.
1637  */
1638 #define SLI4_FC_WCQE_STATUS_SUCCESS 0x00
1639 #define SLI4_FC_WCQE_STATUS_FCP_RSP_FAILURE 0x01
1640 #define SLI4_FC_WCQE_STATUS_REMOTE_STOP 0x02
1641 #define SLI4_FC_WCQE_STATUS_LOCAL_REJECT 0x03
1642 #define SLI4_FC_WCQE_STATUS_NPORT_RJT 0x04
1643 #define SLI4_FC_WCQE_STATUS_FABRIC_RJT 0x05
1644 #define SLI4_FC_WCQE_STATUS_NPORT_BSY 0x06
1645 #define SLI4_FC_WCQE_STATUS_FABRIC_BSY 0x07
1646 #define SLI4_FC_WCQE_STATUS_LS_RJT 0x09
1647 #define SLI4_FC_WCQE_STATUS_CMD_REJECT 0x0b
1648 #define SLI4_FC_WCQE_STATUS_FCP_TGT_LENCHECK 0x0c
1649 #define SLI4_FC_WCQE_STATUS_RQ_BUF_LEN_EXCEEDED 0x11
1650 #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_BUF_NEEDED 0x12
1651 #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_FRM_DISC 0x13
1652 #define SLI4_FC_WCQE_STATUS_RQ_DMA_FAILURE 0x14
1653 #define SLI4_FC_WCQE_STATUS_FCP_RSP_TRUNCATE 0x15
1654 #define SLI4_FC_WCQE_STATUS_DI_ERROR 0x16
1655 #define SLI4_FC_WCQE_STATUS_BA_RJT 0x17
1656 #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_XRI_NEEDED 0x18
1657 #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_XRI_DISC 0x19
1658 #define SLI4_FC_WCQE_STATUS_RX_ERROR_DETECT 0x1a
1659 #define SLI4_FC_WCQE_STATUS_RX_ABORT_REQUEST 0x1b
1660 
1661 /* driver generated status codes; better not overlap with chip's status codes! */
1662 #define SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT 0xff
1663 #define SLI4_FC_WCQE_STATUS_SHUTDOWN 0xfe
1664 #define SLI4_FC_WCQE_STATUS_DISPATCH_ERROR 0xfd
1665 
1666 /**
1667  * @brief DI_ERROR Extended Status
1668  */
1669 #define SLI4_FC_DI_ERROR_GE (1 << 0) /* Guard Error */
1670 #define SLI4_FC_DI_ERROR_AE (1 << 1) /* Application Tag Error */
1671 #define SLI4_FC_DI_ERROR_RE (1 << 2) /* Reference Tag Error */
1672 #define SLI4_FC_DI_ERROR_TDPV (1 << 3) /* Total Data Placed Valid */
1673 #define SLI4_FC_DI_ERROR_UDB (1 << 4) /* Uninitialized DIF Block */
1674 #define SLI4_FC_DI_ERROR_EDIR (1 << 5) /* Error direction */
1675 
1676 /**
1677  * @brief Local Reject Reason Codes.
1678  */
1679 #define SLI4_FC_LOCAL_REJECT_MISSING_CONTINUE 0x01
1680 #define SLI4_FC_LOCAL_REJECT_SEQUENCE_TIMEOUT 0x02
1681 #define SLI4_FC_LOCAL_REJECT_INTERNAL_ERROR 0x03
1682 #define SLI4_FC_LOCAL_REJECT_INVALID_RPI 0x04
1683 #define SLI4_FC_LOCAL_REJECT_NO_XRI 0x05
1684 #define SLI4_FC_LOCAL_REJECT_ILLEGAL_COMMAND 0x06
1685 #define SLI4_FC_LOCAL_REJECT_XCHG_DROPPED 0x07
1686 #define SLI4_FC_LOCAL_REJECT_ILLEGAL_FIELD 0x08
1687 #define SLI4_FC_LOCAL_REJECT_RPI_SUSPENDED 0x09
1688 #define SLI4_FC_LOCAL_REJECT_NO_ABORT_MATCH 0x0c
1689 #define SLI4_FC_LOCAL_REJECT_TX_DMA_FAILED 0x0d
1690 #define SLI4_FC_LOCAL_REJECT_RX_DMA_FAILED 0x0e
1691 #define SLI4_FC_LOCAL_REJECT_ILLEGAL_FRAME 0x0f
1692 #define SLI4_FC_LOCAL_REJECT_NO_RESOURCES 0x11
1693 #define SLI4_FC_LOCAL_REJECT_FCP_CONF_FAILURE 0x12
1694 #define SLI4_FC_LOCAL_REJECT_ILLEGAL_LENGTH 0x13
1695 #define SLI4_FC_LOCAL_REJECT_UNSUPPORTED_FEATURE 0x14
1696 #define SLI4_FC_LOCAL_REJECT_ABORT_IN_PROGRESS 0x15
1697 #define SLI4_FC_LOCAL_REJECT_ABORT_REQUESTED 0x16
1698 #define SLI4_FC_LOCAL_REJECT_RCV_BUFFER_TIMEOUT 0x17
1699 #define SLI4_FC_LOCAL_REJECT_LOOP_OPEN_FAILURE 0x18
1700 #define SLI4_FC_LOCAL_REJECT_LINK_DOWN 0x1a
1701 #define SLI4_FC_LOCAL_REJECT_CORRUPTED_DATA 0x1b
1702 #define SLI4_FC_LOCAL_REJECT_CORRUPTED_RPI 0x1c
1703 #define SLI4_FC_LOCAL_REJECT_OUT_OF_ORDER_DATA 0x1d
1704 #define SLI4_FC_LOCAL_REJECT_OUT_OF_ORDER_ACK 0x1e
1705 #define SLI4_FC_LOCAL_REJECT_DUP_FRAME 0x1f
1706 #define SLI4_FC_LOCAL_REJECT_LINK_CONTROL_FRAME 0x20
1707 #define SLI4_FC_LOCAL_REJECT_BAD_HOST_ADDRESS 0x21
1708 #define SLI4_FC_LOCAL_REJECT_MISSING_HDR_BUFFER 0x23
1709 #define SLI4_FC_LOCAL_REJECT_MSEQ_CHAIN_CORRUPTED 0x24
1710 #define SLI4_FC_LOCAL_REJECT_ABORTMULT_REQUESTED 0x25
1711 #define SLI4_FC_LOCAL_REJECT_BUFFER_SHORTAGE 0x28
1712 #define SLI4_FC_LOCAL_REJECT_RCV_XRIBUF_WAITING 0x29
1713 #define SLI4_FC_LOCAL_REJECT_INVALID_VPI 0x2e
1714 #define SLI4_FC_LOCAL_REJECT_MISSING_XRIBUF 0x30
1715 #define SLI4_FC_LOCAL_REJECT_INVALID_RELOFFSET 0x40
1716 #define SLI4_FC_LOCAL_REJECT_MISSING_RELOFFSET 0x41
1717 #define SLI4_FC_LOCAL_REJECT_INSUFF_BUFFERSPACE 0x42
1718 #define SLI4_FC_LOCAL_REJECT_MISSING_SI 0x43
1719 #define SLI4_FC_LOCAL_REJECT_MISSING_ES 0x44
1720 #define SLI4_FC_LOCAL_REJECT_INCOMPLETE_XFER 0x45
1721 #define SLI4_FC_LOCAL_REJECT_SLER_FAILURE 0x46
1722 #define SLI4_FC_LOCAL_REJECT_SLER_CMD_RCV_FAILURE 0x47
1723 #define SLI4_FC_LOCAL_REJECT_SLER_REC_RJT_ERR 0x48
1724 #define SLI4_FC_LOCAL_REJECT_SLER_REC_SRR_RETRY_ERR 0x49
1725 #define SLI4_FC_LOCAL_REJECT_SLER_SRR_RJT_ERR 0x4a
1726 #define SLI4_FC_LOCAL_REJECT_SLER_RRQ_RJT_ERR 0x4c
1727 #define SLI4_FC_LOCAL_REJECT_SLER_RRQ_RETRY_ERR 0x4d
1728 #define SLI4_FC_LOCAL_REJECT_SLER_ABTS_ERR 0x4e
1729 
1730 typedef struct sli4_fc_async_rcqe_s {
1731 #if BYTE_ORDER == LITTLE_ENDIAN
1732  uint32_t :8,
1733  status:8,
1734  rq_element_index:12,
1735  :4;
1736  uint32_t rsvd1;
1737  uint32_t fcfi:6,
1738  rq_id:10,
1739  payload_data_placement_length:16;
1740  uint32_t sof_byte:8,
1741  eof_byte:8,
1742  code:8,
1743  header_data_placement_length:6,
1744  :1,
1745  vld:1;
1746 #else
1747 #error big endian version not defined
1748 #endif
1750 
1751 typedef struct sli4_fc_async_rcqe_v1_s {
1752 #if BYTE_ORDER == LITTLE_ENDIAN
1753  uint32_t :8,
1754  status:8,
1755  rq_element_index:15,
1756  :1;
1757  uint32_t fcfi:6,
1758  :26;
1759  uint32_t rq_id:16,
1760  payload_data_placement_length:16;
1761  uint32_t sof_byte:8,
1762  eof_byte:8,
1763  code:8,
1764  header_data_placement_length:6,
1765  :1,
1766  vld:1;
1767 #else
1768 #error big endian version not defined
1769 #endif
1771 
1772 typedef struct sli4_fc_marker_rcqe_s {
1773 #if BYTE_ORDER == LITTLE_ENDIAN
1774  uint32_t rsvd0: 8,
1775  status: 8,
1776  rq_element_index: 15,
1777  rsvd1: 1;
1778  uint32_t tag_lower;
1779  uint32_t tag_higher;
1780  uint32_t rq_id: 16,
1781  code: 8,
1782  : 6,
1783  : 1,
1784  vld: 1;
1785 #else
1786 #error big endian version not defined
1787 #endif
1789 
1790 #define SLI4_FC_ASYNC_RQ_SUCCESS 0x10
1791 #define SLI4_FC_ASYNC_RQ_BUF_LEN_EXCEEDED 0x11
1792 #define SLI4_FC_ASYNC_RQ_INSUFF_BUF_NEEDED 0x12
1793 #define SLI4_FC_ASYNC_RQ_INSUFF_BUF_FRM_DISC 0x13
1794 #define SLI4_FC_ASYNC_RQ_DMA_FAILURE 0x14
1795 
1796 typedef struct sli4_fc_coalescing_rcqe_s {
1797 #if BYTE_ORDER == LITTLE_ENDIAN
1798  uint32_t :8,
1799  status:8,
1800  rq_element_index:12,
1801  :4;
1802  uint32_t rsvd1;
1803  uint32_t rq_id:16,
1804  sequence_reporting_placement_length:16;
1805  uint32_t :16,
1806  code:8,
1807  :7,
1808  vld:1;
1809 #else
1810 #error big endian version not defined
1811 #endif
1813 
1814 #define SLI4_FC_COALESCE_RQ_SUCCESS 0x10
1815 #define SLI4_FC_COALESCE_RQ_INSUFF_XRI_NEEDED 0x18
1816 
1817 typedef struct sli4_fc_optimized_write_cmd_cqe_s {
1818 #if BYTE_ORDER == LITTLE_ENDIAN
1819  uint32_t :8,
1820  status:8,
1821  rq_element_index:15,
1822  iv:1;
1823  uint32_t fcfi:6,
1824  :8,
1825  oox:1,
1826  tow:1,
1827  xri:16;
1828  uint32_t rq_id:16,
1829  payload_data_placement_length:16;
1830  uint32_t rpi:16,
1831  code:8,
1832  header_data_placement_length:6,
1833  :1,
1834  vld:1;
1835 #else
1836 #error big endian version not defined
1837 #endif
1839 
1840 typedef struct sli4_fc_optimized_write_data_cqe_s {
1841 #if BYTE_ORDER == LITTLE_ENDIAN
1842  uint32_t hw_status:8,
1843  status:8,
1844  xri:16;
1847  uint32_t :16,
1848  code:8,
1849  pri:3,
1850  pv:1,
1851  xb:1,
1852  rha:1,
1853  :1,
1854  vld:1;
1855 #else
1856 #error big endian version not defined
1857 #endif
1859 
1860 typedef struct sli4_fc_xri_aborted_cqe_s {
1861 #if BYTE_ORDER == LITTLE_ENDIAN
1862  uint32_t :8,
1863  status:8,
1864  :16;
1865  uint32_t extended_status;
1866  uint32_t xri:16,
1867  remote_xid:16;
1868  uint32_t :16,
1869  code:8,
1870  xr:1,
1871  :3,
1872  eo:1,
1873  br:1,
1874  ia:1,
1875  vld:1;
1876 #else
1877 #error big endian version not defined
1878 #endif
1880 
1881 /**
1882  * Code definitions applicable to all FC/FCoE CQE types.
1883  */
1884 #define SLI4_CQE_CODE_OFFSET 14
1885 
1886 #define SLI4_CQE_CODE_WORK_REQUEST_COMPLETION 0x01
1887 #define SLI4_CQE_CODE_RELEASE_WQE 0x02
1888 #define SLI4_CQE_CODE_RQ_ASYNC 0x04
1889 #define SLI4_CQE_CODE_XRI_ABORTED 0x05
1890 #define SLI4_CQE_CODE_RQ_COALESCING 0x06
1891 #define SLI4_CQE_CODE_RQ_CONSUMPTION 0x07
1892 #define SLI4_CQE_CODE_MEASUREMENT_REPORTING 0x08
1893 #define SLI4_CQE_CODE_RQ_ASYNC_V1 0x09
1894 #define SLI4_CQE_CODE_OPTIMIZED_WRITE_CMD 0x0B
1895 #define SLI4_CQE_CODE_OPTIMIZED_WRITE_DATA 0x0C
1896 #define SLI4_CQE_CODE_MARKER 0x1D
1897 
1898 extern int32_t sli_fc_process_link_state(sli4_t *, void *);
1899 extern int32_t sli_fc_process_link_attention(sli4_t *, void *);
1900 extern int32_t sli_fc_process_sli_port_event(sli4_t *, void *);
1901 extern int32_t sli_fc_cqe_parse(sli4_t *, sli4_queue_t *, uint8_t *, sli4_qentry_e *, uint16_t *);
1902 extern uint32_t sli_fc_response_length(sli4_t *, uint8_t *);
1903 extern uint32_t sli_fc_io_length(sli4_t *, uint8_t *);
1904 extern int32_t sli_fc_els_did(sli4_t *, uint8_t *, uint32_t *);
1905 extern uint32_t sli_fc_ext_status(sli4_t *, uint8_t *);
1906 extern int32_t sli_fc_rqe_rqid_and_index(sli4_t *, uint8_t *, uint16_t *, uint32_t *);
1907 extern int32_t sli_fc_process_fcoe(sli4_t *, void *);
1908 extern int32_t sli_cmd_fcoe_wq_create(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t);
1909 extern int32_t sli_cmd_fcoe_wq_create_v1(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t);
1910 extern int32_t sli_cmd_fcoe_wq_destroy(sli4_t *, void *, size_t, uint16_t);
1911 extern int32_t sli_cmd_fcoe_post_sgl_pages(sli4_t *, void *, size_t, uint16_t, uint32_t, ocs_dma_t **, ocs_dma_t **,
1912 ocs_dma_t *);
1913 extern int32_t sli_cmd_fcoe_rq_create(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t, uint16_t);
1914 extern int32_t sli_cmd_fcoe_rq_create_v1(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t, uint16_t);
1915 extern int32_t sli_cmd_fcoe_rq_destroy(sli4_t *, void *, size_t, uint16_t);
1916 extern int32_t sli_cmd_fcoe_read_fcf_table(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t);
1917 extern int32_t sli_cmd_fcoe_post_hdr_templates(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, ocs_dma_t *);
1918 extern int32_t sli_cmd_fcoe_rediscover_fcf(sli4_t *, void *, size_t, uint16_t);
1919 extern int32_t sli_fc_rq_alloc(sli4_t *, sli4_queue_t *, uint32_t, uint32_t, sli4_queue_t *, uint16_t, uint8_t);
1920 extern int32_t sli_fc_rq_set_alloc(sli4_t *, uint32_t, sli4_queue_t *[], uint32_t, uint32_t, uint32_t, uint32_t, uint16_t);
1921 extern uint32_t sli_fc_get_rpi_requirements(sli4_t *, uint32_t);
1922 extern int32_t sli_abort_wqe(sli4_t *, void *, size_t, sli4_abort_type_e, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t);
1923 
1924 extern int32_t sli_els_request64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint8_t, uint32_t, uint32_t, uint8_t, uint16_t, uint16_t, uint16_t, ocs_remote_node_t *);
1925 extern int32_t sli_fcp_iread64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint32_t, uint32_t, uint16_t, uint16_t, uint16_t, uint32_t, ocs_remote_node_t *, uint8_t, uint8_t, uint8_t);
1926 extern int32_t sli_fcp_iwrite64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, uint16_t, uint32_t, ocs_remote_node_t *, uint8_t, uint8_t, uint8_t);
1927 extern int32_t sli_fcp_icmnd64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t, uint16_t, uint32_t, ocs_remote_node_t *, uint8_t);
1928 
1929 extern int32_t sli_fcp_treceive64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, ocs_remote_node_t *, uint32_t, uint8_t, uint8_t, uint8_t, uint32_t, uint8_t);
1930 extern int32_t sli_fcp_trsp64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, ocs_remote_node_t *, uint32_t, uint8_t, uint8_t, uint32_t);
1931 extern int32_t sli_fcp_tsend64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, ocs_remote_node_t *, uint32_t, uint8_t, uint8_t, uint8_t, uint32_t);
1932 extern int32_t sli_fcp_cont_treceive64_wqe(sli4_t *, void*, size_t, ocs_dma_t *, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, ocs_remote_node_t *, uint32_t, uint8_t, uint8_t, uint8_t, uint32_t, uint8_t);
1933 extern int32_t sli_gen_request64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint32_t, uint32_t,uint8_t, uint16_t, uint16_t, uint16_t, ocs_remote_node_t *, uint8_t, uint8_t, uint8_t);
1934 extern int32_t sli_send_frame_wqe(sli4_t *sli4, void *buf, size_t size, uint8_t sof, uint8_t eof, uint32_t *hdr,
1935  ocs_dma_t *payload, uint32_t req_len, uint8_t timeout,
1936  uint16_t xri, uint16_t req_tag);
1937 extern int32_t sli_xmit_sequence64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint32_t, uint8_t, uint16_t, uint16_t, uint16_t, ocs_remote_node_t *, uint8_t, uint8_t, uint8_t);
1938 extern int32_t sli_xmit_bcast64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint32_t, uint8_t, uint16_t, uint16_t, uint16_t, ocs_remote_node_t *, uint8_t, uint8_t, uint8_t);
1939 extern int32_t sli_xmit_bls_rsp64_wqe(sli4_t *, void *, size_t, sli_bls_payload_t *, uint16_t, uint16_t, uint16_t, ocs_remote_node_t *, uint32_t);
1940 extern int32_t sli_xmit_els_rsp64_wqe(sli4_t *, void *, size_t, ocs_dma_t *, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, ocs_remote_node_t *, uint32_t, uint32_t);
1941 extern int32_t sli_requeue_xri_wqe(sli4_t *, void *, size_t, uint16_t, uint16_t, uint16_t);
1942 extern void sli4_cmd_lowlevel_set_watchdog(sli4_t *sli4, void *buf, size_t size, uint16_t timeout);
1943 extern void sli4_cmd_lowlevel_enable_ras(sli4_t *sli4, void *buf, size_t size, int loglevel, uint32_t unit_size, int32_t buf_count, uint32_t *phys_addr, uintptr_t lwpd_phys_addr);
1944 extern void sli4_cmd_lowlevel_disable_ras(sli4_t *sli4, void *buf, size_t size);
1945 extern void sli4_cmd_lowlevel_get_itcm_parity_stats(sli4_t *sli4, void *buf, size_t size, bool clear_stats);
1946 
1947 /**
1948  * @ingroup sli_fc
1949  * @brief Retrieve the received header and payload length.
1950  *
1951  * @param sli4 SLI context.
1952  * @param cqe Pointer to the CQ entry.
1953  * @param len_hdr Pointer where the header length is written.
1954  * @param len_data Pointer where the payload length is written.
1955  *
1956  * @return Returns 0 on success, or a non-zero value on failure.
1957  */
1958 static inline int32_t
1959 sli_fc_rqe_length(sli4_t *sli4, void *cqe, uint32_t *len_hdr, uint32_t *len_data)
1960 {
1961  sli4_fc_async_rcqe_t *rcqe = cqe;
1962 
1963  *len_hdr = *len_data = 0;
1964 
1965  if (SLI4_FC_ASYNC_RQ_SUCCESS == rcqe->status) {
1966  *len_hdr = rcqe->header_data_placement_length;
1967  *len_data = rcqe->payload_data_placement_length;
1968  return 0;
1969  } else {
1970  return -1;
1971  }
1972 }
1973 
1974 /**
1975  * @ingroup sli_fc
1976  * @brief Retrieve the received FCFI.
1977  *
1978  * @param sli4 SLI context.
1979  * @param cqe Pointer to the CQ entry.
1980  *
1981  * @return Returns the FCFI in the CQE. or UINT8_MAX if invalid CQE code.
1982  */
1983 static inline uint8_t
1984 sli_fc_rqe_fcfi(sli4_t *sli4, void *cqe)
1985 {
1986  uint8_t code = ((uint8_t*)cqe)[SLI4_CQE_CODE_OFFSET];
1987  uint8_t fcfi = UINT8_MAX;
1988 
1989  switch(code) {
1990  case SLI4_CQE_CODE_RQ_ASYNC: {
1991  sli4_fc_async_rcqe_t *rcqe = cqe;
1992  fcfi = rcqe->fcfi;
1993  break;
1994  }
1996  sli4_fc_async_rcqe_v1_t *rcqev1 = cqe;
1997  fcfi = rcqev1->fcfi;
1998  break;
1999  }
2001  sli4_fc_optimized_write_cmd_cqe_t *opt_wr = cqe;
2002  fcfi = opt_wr->fcfi;
2003  break;
2004  }
2005  }
2006 
2007  return fcfi;
2008 }
2009 
2010 extern const char *sli_fc_get_status_string(uint32_t status);
2011 
2012 #endif /* !_SLI4_FC_H */
2013 
2014 /* vim: set noexpandtab textwidth=120: */
2015 
2016  /**
2017  * @page fc_sli4_api_overview SLI-4 APIs
2018  * - @ref sli
2019  * - @ref sli_fc
2020  *
2021  * <div class="overview">
2022  * <img src="elx_fc_sli4.jpg" alt="FC/FCoE SLI-4" title="FC/FCoE SLI-4" align="right"/>
2023  *
2024  * <h2>FC/FCoE SLI-4</h2>
2025  *
2026  * The FC/FCoE SLI-4 component implements the commands and processing defined by
2027  * the <i>SLI-4 Architecture Specification</i> and the <i>SLI-4 FC and FCoE Command Reference</i>
2028  * through a lightly-abstracted API. The primary objective of this component is to provide
2029  * a mechanism to access the Emulex SLI-4 hardware without enforcing a specific policy.
2030  * For example, this API provides a mechanism to unregister an RPI (sli_cmd_unreg_rpi()),
2031  * but does not provide details on when to invoke this function.<br><br>
2032  *
2033  * All meaningful communication between the driver and hardware occurs via queues. To
2034  * issue commands and work requests to the hardware, the driver writes work queue
2035  * entries (WQEs). Conversely, to get information about asynchronous events (for
2036  * example, link events or previously submitted commands), the driver reads queue
2037  * entries created by the hardware. The SLI component defines a set of common queue
2038  * operations used to interact with the hardware, simplifying some of the underlying
2039  * interface complexities. You can use the queue API to perform the following operations:
2040  *
2041  * <ul><li>Allocating a queue type with the given number of entries. Since most queues
2042  * are closely coupled to an associated queue (for example, a completion queue is
2043  * tied to an event queue), this interface allows specifying the associated queue.
2044  * <li>Freeing a previously allocated queue.</li>
2045  * <li>Determining if the next queue entry is valid (that is, the hardware has written a
2046  * new entry).</li>
2047  * <li>Reading the next valid entry from the queue to a supplied buffer.</li>
2048  * <li>Writing an entry from a supplied buffer to the next available queue location.</li></ul>
2049  *
2050  * The SLI-4 documentation defines registers that are predominantly used in conjunction
2051  * with the previously mentioned queue operations. One exception to this
2052  * characterization of SLI-4 registers is the bootstrap mailbox register (bmbx). The
2053  * bootstrap mailbox register allows the driver to send commands before any of the other
2054  * queues exist. Similar to the standard queue operations, the SLI component encapsulates
2055  * the standard mechanism used to communicate via the bootstrap mailbox.<br><br>
2056  *
2057  * The OneCore Storage driver writes two types of queue entries: commands and I/O
2058  * work requests. In both cases, the SLI-4 component provides helper functions to
2059  * correctly format these queue entries.<br><br>
2060  *
2061  * The basic format of the command helper functions includes:
2062  *
2063  * <ul><li>A name corresponding to the SLI-4 documentation. For example, the helper
2064  * function for the INIT_LINK command is sli_cmd_init_link().</li>
2065  * <li>A buffer to hold the formatted queue entry.</li>
2066  * <li>The size of the allocated buffer.</li>
2067  * <li>Parameter options, where appropriate. For example, the INIT_VPI command
2068  * requires values for the VPI and VFI. Therefore, the sli_cmd_init_vpi() function
2069  * provides two additional parameters to supply the VPI and VFI values.</li></ul>
2070  *
2071  * The basic format of the I/O work request helper functions follow a similar format, and
2072  * includes:
2073  *
2074  * <ul><li>A name corresponding to the SLI-4 documentation. For example, the helper
2075  * function to create an ELS_REQUEST64_WQE is sli_els_request64_wqe().</li>
2076  * <li>A buffer to hold the formatted queue entry.</li>
2077  * <li>The size of the allocated buffer.</li>
2078  * <li>Parameterized command options where appropriate. For example, the
2079  * ELS_REQUEST64_WQE work request requires values for the XRI and request
2080  * tag. Therefore, the sli_els_request64_wqe() function has additional parameters
2081  * for the XRI and tag.</li></ul>
2082  *
2083  * Once formatted with a helper function, the queue entry can be passed to
2084  * sli_queue_write() to post it to the hardware.<br><br>
2085  *
2086  * @b Note: The formatted command buffers may also be passed to the hardware through
2087  * the bootstrap mailbox interface (sli_bmbx_command()).<br><br>
2088  *
2089  * The SLI-4 component provides assistance in decoding entries created by the hardware
2090  * and read by the driver. In some cases, a SLI-4 function receives the raw buffer as input,
2091  * and then returns more relevant values. For example, the sli_cq_parse() function
2092  * receives the completion queue entry as input, and then returns the completion type and
2093  * queue ID. In other cases, the parsing function decodes the queue entry, and then
2094  * returns the results through registered callback functions. For example, the
2095  * sli_cqe_async() helper function decodes asynchronous events, such as FC link events
2096  * and FCoE FIP events. The drivers can register callback functions for each of these
2097  * events using the SLI component.<br><br>
2098  *
2099  * In contrast to SLI-2 and SLI-3 drivers, SLI-4 drivers play a greater role in the allocation
2100  * and assignment of hardware resources (for example, XRI, RPI, and VPI). However, the
2101  * inner workings of these resources differ between different hardware. The SLI-4
2102  * component encapsulates these differences and presents a common interface to upper
2103  * layers. The API presents a simple allocate or free interface.<br><br>
2104  *
2105  * The SLI-4 covers a range of hardware, each with different capabilities. The SLI
2106  * component API provides functions to manage these differences. These functions allow
2107  * drivers to query hardware capabilities (for example, the maximum SGL length), as well
2108  * as configure capabilities (for example, setting the FC topology to private loop).
2109  * <br><br>
2110  * </div><!-- overview -->
2111  */
sli4_req_hdr_t hdr
Definition: sli4_fc.h:163
int32_t sli_cmd_fcoe_wq_create_v1(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ignored)
Write an FCOE_WQ_CREATE_V1 command.
Definition: sli4_fc.c:131
const char * sli_fc_get_status_string(uint32_t status)
Return a text string corresponding to a CQE status value.
Definition: sli4_fc.c:3153
uint32_t page0_high
Definition: sli4_fc.h:157
int32_t sli_cmd_fcoe_post_hdr_templates(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma, uint16_t rpi, ocs_dma_t *payload_dma)
Write an FCOE_POST_HDR_TEMPLATES command.
Definition: sli4_fc.c:585
WQE used to create an FCP initiator no data command.
Definition: sli4_fc.h:633
WQE used to create an FCP initiator read.
Definition: sli4_fc.h:691
uint32_t page1_high
Definition: sli4_fc.h:159
sli4_bde_t sequence_payload
Definition: sli4_fc.h:1246
int32_t sli_fc_process_sli_port_event(sli4_t *sli4, void *acqe)
Process an asynchronous sli port event.
Definition: sli4_fc.c:2295
#define SLI4_CQE_CODE_OPTIMIZED_WRITE_CMD
Definition: sli4_fc.h:1894
uint8_t fcf_available
Definition: sli4_fc.h:324
FCOE_RQ_DESTROY.
Definition: sli4_fc.h:284
FCOE_REDISCOVER_FCF.
Definition: sli4_fc.h:379
uint32_t max_response_payload_length
Definition: sli4_fc.h:603
WQE used to create an FCP target send (DATA IN).
Definition: sli4_fc.h:940
uint32_t sequence_payload_length
Definition: sli4_fc.h:1248
FCOE_POST_HDR_TEMPLATES.
Definition: sli4_fc.h:363
int32_t sli_xmit_sequence64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *payload, uint32_t payload_len, uint8_t timeout, uint16_t ox_id, uint16_t xri, uint16_t tag, ocs_remote_node_t *rnode, uint8_t r_ctl, uint8_t type, uint8_t df_ctl)
Write a XMIT_SEQUENCE64 work queue entry.
Definition: sli4_fc.c:1799
uint32_t fcp_data_transmit_length
Definition: sli4_fc.h:991
WQE used to create a general request.
Definition: sli4_fc.h:1014
uint32_t event_information
Definition: sli4_fc.h:1577
sli4_qentry_e
Definition: sli4.h:3436
int32_t sli_cmd_fcoe_rq_destroy(sli4_t *sli4, void *buf, size_t size, uint16_t rq_id)
Write an FCOE_RQ_DESTROY command.
Definition: sli4_fc.c:504
uint32_t event_tag
Definition: sli4_fc.h:1580
void sli4_cmd_lowlevel_get_itcm_parity_stats(sli4_t *sli4, void *buf, size_t size, bool clear_stats)
Definition: sli4.c:2412
uint32_t relative_offset
Definition: sli4_fc.h:944
uint16_t low_seq_cnt
Definition: sli4_fc.h:1379
WQE used to create an ELS request.
Definition: sli4_fc.h:557
uint32_t header_data_placement_length
Definition: sli4_fc.h:1740
void sli4_cmd_lowlevel_set_watchdog(sli4_t *sli4, void *buf, size_t size, uint16_t timeout)
Write a LOWLEVEL_SET_WATCHDOG command.
Definition: sli4.c:2304
WQE used to create an ELS response.
Definition: sli4_fc.h:1394
FCOE_POST_SGL_PAGES.
Definition: sli4_fc.h:155
int32_t sli_xmit_bcast64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *payload, uint32_t payload_len, uint8_t timeout, uint16_t xri, uint16_t tag, uint16_t cq_id, ocs_remote_node_t *rnode, uint8_t r_ctl, uint8_t type, uint8_t df_ctl)
Definition: sli4_fc.c:1903
uint32_t uint32_t rsvd5
Definition: sli4_fc.h:382
sli4_bde_t first_data_bde
Definition: sli4_fc.h:996
WQE used to create an FCP target receive, and FCP target receive continue.
Definition: sli4_fc.h:809
uint32_t wqe_specific_2
Definition: sli4_fc.h:1601
Asynchronouse Event: FCoE/FIP ACQE.
Definition: sli4_fc.h:1575
uint32_t sli_fc_io_length(sli4_t *sli4, uint8_t *cqe)
Return the FCP IO length.
Definition: sli4_fc.c:2693
sli4_bde_t bde
Definition: sli4_fc.h:879
uint32_t frame_length
Definition: sli4_fc.h:1075
int32_t sli_fc_cqe_parse(sli4_t *sli4, sli4_queue_t *cq, uint8_t *cqe, sli4_qentry_e *etype, uint16_t *r_id)
Parse an FC/FCoE work queue CQ entry.
Definition: sli4_fc.c:2551
uint16_t high_seq_cnt
Definition: sli4_fc.h:1380
int32_t sli_xmit_els_rsp64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *rsp, uint32_t rsp_len, uint16_t xri, uint16_t tag, uint16_t cq_id, uint16_t ox_id, ocs_remote_node_t *rnode, uint32_t flags, uint32_t s_id)
Write a XMIT_ELS_RSP64_WQE work queue entry.
Definition: sli4_fc.c:2066
WQE used to create a transmit sequence.
Definition: sli4_fc.h:1123
WQE used to abort exchanges.
Definition: sli4_fc.h:489
uint32_t max_response_payload_length
Definition: sli4_fc.h:1063
uint32_t payload_offset_length
Definition: sli4_fc.h:943
uint32_t wqe_specific_1
Definition: sli4_fc.h:1600
uint32_t fip_priority
Definition: sli4_fc.h:322
FCOE_RQ_CREATE_V1.
Definition: sli4_fc.h:208
int32_t sli_fc_rq_alloc(sli4_t *sli4, sli4_queue_t *q, uint32_t n_entries, uint32_t buffer_size, sli4_queue_t *cq, uint16_t ulp, uint8_t is_hdr)
Allocate a receive queue.
Definition: sli4_fc.c:2948
uint32_t initial_transfer_length
Definition: sli4_fc.h:753
FCF table entry.
Definition: sli4_fc.h:318
uint32_t fcp_data_receive_length
Definition: sli4_fc.h:866
Definition: sli4.h:3601
uint32_t uint32_t rsvd6
Definition: sli4_fc.h:186
uint32_t sli_fc_get_rpi_requirements(sli4_t *sli4, uint32_t n_rpi)
Get the RPI resource requirements.
Definition: sli4_fc.c:3131
uint32_t uint32_t rsvd
Definition: sli4_fc.h:251
WQE used to create a send frame request.
Definition: sli4_fc.h:1072
int32_t sli_cmd_fcoe_rq_create_v1(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ulp, uint16_t buffer_size)
Write an FCOE_RQ_CREATE_V1 command.
Definition: sli4_fc.c:426
uint32_t payload_data_placement_length
Definition: sli4_fc.h:1737
FC/FCoE WQ completion queue entry.
Definition: sli4_fc.h:1595
Buffer Descriptor Entry (BDE)
Definition: sli4.h:467
uint32_t uint32_t fcfi
Definition: sli4_fc.h:1753
int32_t sli_requeue_xri_wqe(sli4_t *sli4, void *buf, size_t size, uint16_t xri, uint16_t tag, uint16_t cq_id)
Write a REQUEUE_XRI_WQE work queue entry.
Definition: sli4_fc.c:1885
int32_t sli_fc_els_did(sli4_t *sli4, uint8_t *cqe, uint32_t *d_id)
Retrieve the D_ID from the completion.
Definition: sli4_fc.c:2711
int32_t sli_fcp_treceive64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *sgl, uint32_t first_data_sge, uint32_t relative_off, uint32_t xfer_len, uint16_t xri, uint16_t tag, uint16_t cq_id, uint16_t xid, uint32_t rpi, ocs_remote_node_t *rnode, uint32_t flags, uint8_t dif, uint8_t bs, uint8_t csctl, uint32_t app_id, uint8_t timer)
Write an FCP_TRECEIVE64_WQE work queue entry.
Definition: sli4_fc.c:1204
FCOE_READ_FCF_TABLE.
Definition: sli4_fc.h:300
uint32_t page0_low
Definition: sli4_fc.h:156
int32_t sli_fc_rq_set_alloc(sli4_t *sli4, uint32_t num_rq_pairs, sli4_queue_t *qs[], uint32_t base_cq_id, uint32_t n_entries, uint32_t header_buffer_size, uint32_t payload_buffer_size, uint16_t ulp)
Allocate a receive queue set.
Definition: sli4_fc.c:3015
sli4_req_hdr_t hdr
Definition: sli4_fc.h:285
int32_t sli_send_frame_wqe(sli4_t *sli4, void *buf, size_t size, uint8_t sof, uint8_t eof, uint32_t *hdr, ocs_dma_t *payload, uint32_t req_len, uint8_t timeout, uint16_t xri, uint16_t req_tag)
Write a SEND_FRAME work queue entry.
Definition: sli4_fc.c:1724
uint8_t mac_address_provider
Definition: sli4_fc.h:325
sli4_bde_t first_data_bde
Definition: sli4_fc.h:741
int32_t sli_cmd_fcoe_read_fcf_table(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma, uint16_t index)
Write an FCOE_READ_FCF_TABLE command.
Definition: sli4_fc.c:549
uint32_t uint32_t rsvd13
Definition: sli4_fc.h:1059
#define SLI4_CQE_CODE_OFFSET
Definition: sli4_fc.h:1884
sli4_req_hdr_t hdr
Definition: sli4_fc.h:95
int32_t sli_fcp_iread64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *sgl, uint32_t first_data_sge, uint32_t xfer_len, uint16_t xri, uint16_t tag, uint16_t cq_id, uint32_t rpi, ocs_remote_node_t *rnode, uint8_t dif, uint8_t bs, uint8_t timeout)
Write an FCP_IREAD64_WQE work queue entry.
Definition: sli4_fc.c:996
sli4_abort_type_e
Definition: sli4_fc.h:547
uint32_t rsvd1
Definition: sli4_fc.h:492
WQE used unblock the specified XRI and to release it to the SLI Port&#39;s free pool. ...
Definition: sli4_fc.h:1187
int32_t sli_abort_wqe(sli4_t *sli4, void *buf, size_t size, sli4_abort_type_e type, uint32_t send_abts, uint32_t ids, uint32_t mask, uint16_t tag, uint16_t cq_id)
Write an ABORT_WQE work queue entry.
Definition: sli4_fc.c:682
FCOE_WQ_CREATE_V1.
Definition: sli4_fc.h:116
sli4_bde_t els_response_payload_bde
Definition: sli4_fc.h:602
#define SLI4_FCOE_WQ_CREATE_V0_MAX_PAGES
FCOE_WQ_CREATE.
Definition: sli4_fc.h:92
uint16_t ox_id
Definition: sli4_fc.h:1370
int32_t sli_fc_process_fcoe(sli4_t *sli4, void *acqe)
Process an asynchronous FCoE event entry.
Definition: sli4_fc.c:2880
WQE used to create an FCP initiator write.
Definition: sli4_fc.h:747
uint32_t sli_fc_ext_status(sli4_t *sli4, uint8_t *cqe)
Definition: sli4_fc.c:2726
Definition: sli4_fc.h:162
int32_t sli_cmd_fcoe_post_sgl_pages(sli4_t *sli4, void *buf, size_t size, uint16_t xri, uint32_t xri_count, ocs_dma_t *page0[], ocs_dma_t *page1[], ocs_dma_t *dma)
Write an FCOE_POST_SGL_PAGES command.
Definition: sli4_fc.c:276
FCOE_WQ_DESTROY.
Definition: sli4_fc.h:140
FCOE_READ_FCF_TABLE response.
Definition: sli4_fc.h:344
FCOE_RQ_CREATE_V2.
Definition: sli4_fc.h:236
uint16_t rx_id
Definition: sli4_fc.h:1371
#define SLI4_FC_ASYNC_RQ_SUCCESS
Definition: sli4_fc.h:1790
sli4_bde_t els_response_payload
Definition: sli4_fc.h:1395
int32_t sli_fcp_icmnd64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *sgl, uint16_t xri, uint16_t tag, uint16_t cq_id, uint32_t rpi, ocs_remote_node_t *rnode, uint8_t timeout)
Write an FCP_ICMND64_WQE work queue entry.
Definition: sli4_fc.c:915
int32_t sli_els_request64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *sgl, uint8_t req_type, uint32_t req_len, uint32_t max_rsp_len, uint8_t timeout, uint16_t xri, uint16_t tag, uint16_t cq_id, ocs_remote_node_t *rnode)
Write an ELS_REQUEST64_WQE work queue entry.
Definition: sli4_fc.c:744
WQE used to create an FCP target response.
Definition: sli4_fc.h:878
uint32_t total_transfer_length
Definition: sli4_fc.h:696
sli4_req_hdr_t hdr
Definition: sli4_fc.h:141
uint32_t request_payload_length
Definition: sli4_fc.h:1017
uint32_t els_response_payload_length
Definition: sli4_fc.h:1397
FC/FCoE WQ consumed CQ queue entry.
Definition: sli4_fc.h:1619
uint32_t sli_fc_response_length(sli4_t *sli4, uint8_t *cqe)
Return the ELS/CT response length.
Definition: sli4_fc.c:2676
static int32_t sli_fc_rqe_length(sli4_t *sli4, void *cqe, uint32_t *len_hdr, uint32_t *len_data)
Retrieve the received header and payload length.
Definition: sli4_fc.h:1959
uint32_t fip_keep_alive
Definition: sli4_fc.h:321
uint32_t abort_tag
Definition: sli4_fc.h:456
WQE used to create a BLS response.
Definition: sli4_fc.h:1302
int32_t sli_fc_process_link_attention(sli4_t *sli4, void *acqe)
Process an asynchronous Link Attention event entry.
Definition: sli4_fc.c:2485
int32_t sli_cmd_fcoe_rq_create(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ulp, uint16_t buffer_size)
Write an FCOE_RQ_CREATE command.
Definition: sli4_fc.c:345
sli_bls_type_e
Definition: sli4_fc.h:1362
uint32_t abort_tag
Definition: sli4_fc.h:901
WQE used to send a single frame sequence to broadcast address.
Definition: sli4_fc.h:1245
int32_t sli_cmd_fcoe_wq_destroy(sli4_t *sli4, void *buf, size_t size, uint16_t wq_id)
Write an FCOE_WQ_DESTROY command.
Definition: sli4_fc.c:231
void sli4_cmd_lowlevel_disable_ras(sli4_t *sli4, void *buf, size_t size)
Write a LOWLEVEL_SET_DIAG_LOG_OPTIONS command.
Definition: sli4.c:2389
sli_bls_type_e type
Definition: sli4_fc.h:1369
sli4_req_hdr_t hdr
Definition: sli4_fc.h:179
sli4_bde_t els_request_payload
Definition: sli4_fc.h:558
uint32_t rsvd0
Definition: sli4_fc.h:491
#define SLI4_CQE_CODE_RQ_ASYNC
Definition: sli4_fc.h:1888
static uint8_t sli_fc_rqe_fcfi(sli4_t *sli4, void *cqe)
Retrieve the received FCFI.
Definition: sli4_fc.h:1984
int32_t sli_gen_request64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *sgl, uint32_t req_len, uint32_t max_rsp_len, uint8_t timeout, uint16_t xri, uint16_t tag, uint16_t cq_id, ocs_remote_node_t *rnode, uint8_t r_ctl, uint8_t type, uint8_t df_ctl)
Write a GEN_REQUEST64 work queue entry.
Definition: sli4_fc.c:1633
uint32_t fcp_response_length
Definition: sli4_fc.h:881
int32_t sli_xmit_bls_rsp64_wqe(sli4_t *sli4, void *buf, size_t size, sli_bls_payload_t *payload, uint16_t xri, uint16_t tag, uint16_t cq_id, ocs_remote_node_t *rnode, uint32_t s_id)
Write an XMIT_BLS_RSP64_WQE work queue entry.
Definition: sli4_fc.c:1973
sli4_bde_t first_data_bde
Definition: sli4_fc.h:871
int32_t sli_fc_process_link_state(sli4_t *sli4, void *acqe)
Process an asynchronous Link State event entry.
Definition: sli4_fc.c:2145
int32_t sli_fcp_tsend64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *sgl, uint32_t first_data_sge, uint32_t relative_off, uint32_t xfer_len, uint16_t xri, uint16_t tag, uint16_t cq_id, uint16_t xid, uint32_t rpi, ocs_remote_node_t *rnode, uint32_t flags, uint8_t dif, uint8_t bs, uint8_t csctl, uint32_t app_id)
Write an FCP_TSEND64_WQE work queue entry.
Definition: sli4_fc.c:1500
uint32_t max_receive_size
Definition: sli4_fc.h:320
int32_t sli_fcp_iwrite64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *sgl, uint32_t first_data_sge, uint32_t xfer_len, uint32_t first_burst, uint16_t xri, uint16_t tag, uint16_t cq_id, uint32_t rpi, ocs_remote_node_t *rnode, uint8_t dif, uint8_t bs, uint8_t timeout)
Write an FCP_IWRITE64_WQE work queue entry.
Definition: sli4_fc.c:1098
void sli4_cmd_lowlevel_enable_ras(sli4_t *sli4, void *buf, size_t size, int log_level, uint32_t unit_size, int32_t buf_count, uint32_t *phys_addr, uintptr_t lwpd_phys_addr)
Write a LOWLEVEL_SET_DIAG_LOG_OPTIONS command.
Definition: sli4.c:2339
uint32_t els_request_payload_length
Definition: sli4_fc.h:560
uint32_t page1_low
Definition: sli4_fc.h:158
uint32_t ext_t_tag
Definition: sli4_fc.h:493
Generic Command Request header.
Definition: sli4.h:1666
Generic Command Response header.
Definition: sli4.h:1683
uint32_t total_transfer_length
Definition: sli4_fc.h:752
int32_t sli_fcp_cont_treceive64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *sgl, uint32_t first_data_sge, uint32_t relative_off, uint32_t xfer_len, uint16_t xri, uint16_t sec_xri, uint16_t tag, uint16_t cq_id, uint16_t xid, uint32_t rpi, ocs_remote_node_t *rnode, uint32_t flags, uint8_t dif, uint8_t bs, uint8_t csctl, uint32_t app_id, uint8_t timer)
Write an FCP_CONT_TRECEIVE64_WQE work queue entry.
Definition: sli4_fc.c:1357
int32_t sli_fcp_trsp64_wqe(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *sgl, uint32_t rsp_len, uint16_t xri, uint16_t tag, uint16_t cq_id, uint16_t xid, uint32_t rpi, ocs_remote_node_t *rnode, uint32_t flags, uint8_t csctl, uint8_t port_owned, uint32_t app_id)
Write an FCP_TRSP64_WQE work queue entry.
Definition: sli4_fc.c:1400
#define SLI4_CQE_CODE_RQ_ASYNC_V1
Definition: sli4_fc.h:1893
int32_t sli_fc_rqe_rqid_and_index(sli4_t *sli4, uint8_t *cqe, uint16_t *rq_id, uint32_t *index)
Retrieve the RQ index from the completion.
Definition: sli4_fc.c:2768
uint32_t t_mask
Definition: sli4_fc.h:500
uint32_t t_tag
Definition: sli4_fc.h:512
int32_t sli_cmd_fcoe_wq_create(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ulp)
Write an FCOE_WQ_CREATE command.
Definition: sli4_fc.c:68
FCOE_RQ_CREATE.
Definition: sli4_fc.h:178
Generic WQE.
Definition: sli4_fc.h:442
sli4_req_hdr_t hdr
Definition: sli4_fc.h:364
int32_t sli_cmd_fcoe_rediscover_fcf(sli4_t *sli4, void *buf, size_t size, uint16_t index)
Definition: sli4_fc.c:637
uint32_t payload_offset_length
Definition: sli4_fc.h:812