2 * Copyright (c) 2017 Broadcom. All rights reserved.
3 * The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
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.
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.
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.
36 * Define common SLI-4 structures and function prototypes.
44 #define SLI_PAGE_SIZE (4096)
45 #define SLI_SUB_PAGE_MASK (SLI_PAGE_SIZE - 1)
46 #define SLI_PAGE_SHIFT 12
47 #define SLI_ROUND_PAGE(b) (((b) + SLI_SUB_PAGE_MASK) & ~SLI_SUB_PAGE_MASK)
49 #define SLI4_BMBX_TIMEOUT_MSEC 30000
50 #define SLI4_FW_READY_TIMEOUT_MSEC 30000
52 static inline uint32_t
53 sli_page_count(size_t bytes, uint32_t page_size)
55 uint32_t mask = page_size - 1;
78 return (bytes + mask) >> shift;
81 /*************************************************************************
82 * Common PCI configuration space register definitions
85 #define SLI4_PCI_CLASS_REVISION 0x0008 /** register offset */
86 #define SLI4_PCI_REV_ID_SHIFT 0
87 #define SLI4_PCI_REV_ID_MASK 0xff
88 #define SLI4_PCI_CLASS_SHIFT 8
89 #define SLI4_PCI_CLASS_MASK 0xfff
91 #define SLI4_PCI_SOFT_RESET_CSR 0x005c /** register offset */
92 #define SLI4_PCI_SOFT_RESET_MASK 0x0080
94 /*************************************************************************
95 * Common SLI-4 register offsets and field definitions
99 * @brief SLI_INTF - SLI Interface Definition Register
101 #define SLI4_INTF_REG 0x0058 /** register offset */
102 #define SLI4_INTF_VALID_SHIFT 29
103 #define SLI4_INTF_VALID_MASK 0x7
104 #define SLI4_INTF_VALID 0x6
105 #define SLI4_INTF_IF_TYPE_SHIFT 12
106 #define SLI4_INTF_IF_TYPE_MASK 0xf
107 #define SLI4_INTF_SLI_FAMILY_SHIFT 8
108 #define SLI4_INTF_SLI_FAMILY_MASK 0xf
109 #define SLI4_INTF_SLI_REVISION_SHIFT 4
110 #define SLI4_INTF_SLI_REVISION_MASK 0xf
111 #define SLI4_FAMILY_CHECK_ASIC_TYPE 0xf
113 #define SLI4_IF_TYPE_BE3_SKH_PF 0
114 #define SLI4_IF_TYPE_BE3_SKH_VF 1
115 #define SLI4_IF_TYPE_LANCER_FC_ETH 2
116 #define SLI4_IF_TYPE_LANCER_RDMA 3
117 #define SLI4_IF_TYPE_LANCER_G7 6
118 #define SLI4_MAX_IF_TYPES 7
121 * @brief ASIC_ID - SLI ASIC Type and Revision Register
123 #define SLI4_ASIC_ID_REG 0x009c /* register offset */
124 #define SLI4_ASIC_REV_SHIFT 0
125 #define SLI4_ASIC_REV_MASK 0xf
126 #define SLI4_ASIC_VER_SHIFT 4
127 #define SLI4_ASIC_VER_MASK 0xf
128 #define SLI4_ASIC_GEN_SHIFT 8
129 #define SLI4_ASIC_GEN_MASK 0xff
130 #define SLI4_ASIC_GEN_BE2 0x00
131 #define SLI4_ASIC_GEN_BE3 0x03
132 #define SLI4_ASIC_GEN_SKYHAWK 0x04
133 #define SLI4_ASIC_GEN_CORSAIR 0x05
134 #define SLI4_ASIC_GEN_LANCER 0x0b
137 * @brief BMBX - Bootstrap Mailbox Register
139 #define SLI4_BMBX_REG 0x0160 /* register offset */
140 #define SLI4_BMBX_MASK_HI 0x3
141 #define SLI4_BMBX_MASK_LO 0xf
142 #define SLI4_BMBX_RDY BIT(0)
143 #define SLI4_BMBX_HI BIT(1)
144 #define SLI4_BMBX_WRITE_HI(r) ((ocs_addr32_hi(r) & ~SLI4_BMBX_MASK_HI) | \
146 #define SLI4_BMBX_WRITE_LO(r) (((ocs_addr32_hi(r) & SLI4_BMBX_MASK_HI) << 30) | \
147 (((r) & ~SLI4_BMBX_MASK_LO) >> 2))
149 #define SLI4_BMBX_SIZE 256
152 * @brief EQCQ_DOORBELL - EQ and CQ Doorbell Register
154 #define SLI4_EQCQ_DOORBELL_REG 0x120
155 #define SLI4_EQCQ_DOORBELL_CI BIT(9)
156 #define SLI4_EQCQ_DOORBELL_QT BIT(10)
157 #define SLI4_EQCQ_DOORBELL_ARM BIT(29)
158 #define SLI4_EQCQ_DOORBELL_SE BIT(31)
159 #define SLI4_EQCQ_NUM_SHIFT 16
160 #define SLI4_EQCQ_NUM_MASK 0x01ff
161 #define SLI4_EQCQ_EQ_ID_MASK 0x3fff
162 #define SLI4_EQCQ_CQ_ID_MASK 0x7fff
163 #define SLI4_EQCQ_EQ_ID_MASK_LO 0x01ff
164 #define SLI4_EQCQ_CQ_ID_MASK_LO 0x03ff
165 #define SLI4_EQCQ_EQCQ_ID_MASK_HI 0xf800
166 #define SLI4_IF6_EQ_DOORBELL_REG 0x120
167 #define SLI4_IF6_CQ_DOORBELL_REG 0xC0
170 * @brief SLIPORT_CONTROL - SLI Port Control Register
172 #define SLI4_SLIPORT_CONTROL_REG 0x0408
173 #define SLI4_SLIPORT_CONTROL_END BIT(30)
174 #define SLI4_SLIPORT_CONTROL_LITTLE_ENDIAN (0)
175 #define SLI4_SLIPORT_CONTROL_BIG_ENDIAN BIT(30)
176 #define SLI4_SLIPORT_CONTROL_IP BIT(27)
177 #define SLI4_SLIPORT_CONTROL_IDIS BIT(22)
178 #define SLI4_SLIPORT_CONTROL_FDD BIT(31)
181 * @brief SLI4_SLIPORT_ERROR1 - SLI Port Error Register
183 #define SLI4_SLIPORT_ERROR1 0x040c
186 * @brief SLI4_SLIPORT_ERROR2 - SLI Port Error Register
188 #define SLI4_SLIPORT_ERROR2 0x0410
191 * @brief User error registers
193 #define SLI4_UERR_STATUS_LOW_REG 0xA0
194 #define SLI4_UERR_STATUS_HIGH_REG 0xA4
195 #define SLI4_UERR_MASK_LOW_REG 0xA8
196 #define SLI4_UERR_MASK_HIGH_REG 0xAC
199 * @brief Registers for generating software UE (BE3)
201 #define SLI4_SW_UE_CSR1 0x138
202 #define SLI4_SW_UE_CSR2 0x1FFFC
205 * @brief Registers for generating software UE (Skyhawk)
207 #define SLI4_SW_UE_REG 0x5C /* register offset */
209 static inline uint32_t sli_eq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
212 #if BYTE_ORDER == LITTLE_ENDIAN
215 ci:1, /* clear interrupt */
216 qt:1, /* queue type */
222 } * eq_doorbell = (void *)®
224 #error big endian version not defined
227 eq_doorbell->eq_id_lo = id & SLI4_EQCQ_EQ_ID_MASK_LO;
228 eq_doorbell->qt = 1; /* EQ is type 1 (section 2.2.3.3 SLI Arch) */
229 eq_doorbell->eq_id_hi = (id >> 9) & 0x1f;
230 eq_doorbell->number_popped = n_popped;
231 eq_doorbell->arm = arm;
232 eq_doorbell->ci = TRUE;
237 static inline uint32_t sli_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
240 #if BYTE_ORDER == LITTLE_ENDIAN
242 uint32_t cq_id_lo:10,
243 qt:1, /* queue type */
249 } * cq_doorbell = (void *)®
251 #error big endian version not defined
254 cq_doorbell->cq_id_lo = id & SLI4_EQCQ_CQ_ID_MASK_LO;
255 cq_doorbell->qt = 0; /* CQ is type 0 (section 2.2.3.3 SLI Arch) */
256 cq_doorbell->cq_id_hi = (id >> 10) & 0x1f;
257 cq_doorbell->number_popped = n_popped;
258 cq_doorbell->arm = arm;
263 static inline uint32_t sli_iftype6_eq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
266 #if BYTE_ORDER == LITTLE_ENDIAN
269 :4, /* clear interrupt */
274 } * eq_doorbell = (void *)®
276 #error big endian version not defined
279 eq_doorbell->eq_id = id;
280 eq_doorbell->number_popped = n_popped;
281 eq_doorbell->arm = arm;
286 static inline uint32_t sli_iftype6_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
289 #if BYTE_ORDER == LITTLE_ENDIAN
296 } * cq_doorbell = (void *)®
298 #error big endian version not defined
301 cq_doorbell->cq_id = id;
302 cq_doorbell->number_popped = n_popped;
303 cq_doorbell->arm = arm;
309 * @brief MQ_DOORBELL - MQ Doorbell Register
311 #define SLI4_MQ_DOORBELL_REG 0x0140 /* register offset */
312 #define SLI4_IF6_MQ_DOORBELL_REG 0x0160 /* register offset if_type = 6 */
313 #define SLI4_MQ_DOORBELL_NUM_SHIFT 16
314 #define SLI4_MQ_DOORBELL_NUM_MASK 0x3fff
315 #define SLI4_MQ_DOORBELL_ID_MASK 0xffff
316 #define SLI4_MQ_DOORBELL(n, i) ((((n) & SLI4_MQ_DOORBELL_NUM_MASK) << SLI4_MQ_DOORBELL_NUM_SHIFT) | \
317 ((i) & SLI4_MQ_DOORBELL_ID_MASK))
320 * @brief RQ_DOORBELL - RQ Doorbell Register
322 #define SLI4_RQ_DOORBELL_REG 0x0a0 /* register offset */
323 #define SLI4_IF6_RQ_DOORBELL_REG 0x0080 /* register offset of if_type = 6 */
324 #define SLI4_RQ_DOORBELL_NUM_SHIFT 16
325 #define SLI4_RQ_DOORBELL_NUM_MASK 0x3fff
326 #define SLI4_RQ_DOORBELL_ID_MASK 0xffff
327 #define SLI4_RQ_DOORBELL(n, i) ((((n) & SLI4_RQ_DOORBELL_NUM_MASK) << SLI4_RQ_DOORBELL_NUM_SHIFT) | \
328 ((i) & SLI4_RQ_DOORBELL_ID_MASK))
331 * @brief WQ_DOORBELL - WQ Doorbell Register
333 #define SLI4_IO_WQ_DOORBELL_REG 0x040 /* register offset */
334 #define SLI4_IF6_WQ_DOORBELL_REG 0x040 /* register offset for if_type = 6 */
335 #define SLI4_WQ_DOORBELL_IDX_SHIFT 16
336 #define SLI4_WQ_DOORBELL_IDX_MASK 0x00ff
337 #define SLI4_WQ_DOORBELL_NUM_SHIFT 24
338 #define SLI4_WQ_DOORBELL_NUM_MASK 0x00ff
339 #define SLI4_WQ_DOORBELL_ID_MASK 0xffff
340 #define SLI4_WQ_DOORBELL(n, x, i) ((((n) & SLI4_WQ_DOORBELL_NUM_MASK) << SLI4_WQ_DOORBELL_NUM_SHIFT) | \
341 (((x) & SLI4_WQ_DOORBELL_IDX_MASK) << SLI4_WQ_DOORBELL_IDX_SHIFT) | \
342 ((i) & SLI4_WQ_DOORBELL_ID_MASK))
345 * @brief SLIPORT_SEMAPHORE - SLI Port Host and Port Status Register
347 #define SLI4_PORT_SEMAPHORE_REG_0 0x00ac /** register offset Interface Type 0 + 1 */
348 #define SLI4_PORT_SEMAPHORE_REG_1 0x0180 /** register offset Interface Type 0 + 1 */
349 #define SLI4_PORT_SEMAPHORE_REG_236 0x0400 /** register offset Interface Type 2 + 3 + 6*/
350 #define SLI4_PORT_SEMAPHORE_PORT_MASK 0x0000ffff
351 #define SLI4_PORT_SEMAPHORE_PORT(r) ((r) & SLI4_PORT_SEMAPHORE_PORT_MASK)
352 #define SLI4_PORT_SEMAPHORE_HOST_MASK 0x00ff0000
353 #define SLI4_PORT_SEMAPHORE_HOST_SHIFT 16
354 #define SLI4_PORT_SEMAPHORE_HOST(r) (((r) & SLI4_PORT_SEMAPHORE_HOST_MASK) >> \
355 SLI4_PORT_SEMAPHORE_HOST_SHIFT)
356 #define SLI4_PORT_SEMAPHORE_SCR2 BIT(26) /** scratch area 2 */
357 #define SLI4_PORT_SEMAPHORE_SCR1 BIT(27) /** scratch area 1 */
358 #define SLI4_PORT_SEMAPHORE_IPC BIT(28) /** IP conflict */
359 #define SLI4_PORT_SEMAPHORE_NIP BIT(29) /** no IP address */
360 #define SLI4_PORT_SEMAPHORE_SFI BIT(30) /** secondary firmware image used */
361 #define SLI4_PORT_SEMAPHORE_PERR BIT(31) /** POST fatal error */
363 #define SLI4_PORT_SEMAPHORE_STATUS_POST_READY 0xc000
364 #define SLI4_PORT_SEMAPHORE_STATUS_UNRECOV_ERR 0xf000
365 #define SLI4_PORT_SEMAPHORE_STATUS_ERR_MASK 0xf000
366 #define SLI4_PORT_SEMAPHORE_IN_ERR(r) (SLI4_PORT_SEMAPHORE_STATUS_UNRECOV_ERR == ((r) & \
367 SLI4_PORT_SEMAPHORE_STATUS_ERR_MASK))
370 * @brief SLIPORT_STATUS - SLI Port Status Register
373 #define SLI4_PORT_STATUS_REG_236 0x0404 /** register offset Interface Type 2 + 3 + 6*/
374 #define SLI4_PORT_STATUS_FDP BIT(21) /** function specific dump present */
375 #define SLI4_PORT_STATUS_RDY BIT(23) /** ready */
376 #define SLI4_PORT_STATUS_RN BIT(24) /** reset needed */
377 #define SLI4_PORT_STATUS_DIP BIT(25) /** dump present */
378 #define SLI4_PORT_STATUS_OTI BIT(29) /** over temp indicator */
379 #define SLI4_PORT_STATUS_END BIT(30) /** endianness */
380 #define SLI4_PORT_STATUS_ERR BIT(31) /** SLI port error */
381 #define SLI4_PORT_STATUS_READY(r) ((r) & SLI4_PORT_STATUS_RDY)
382 #define SLI4_PORT_STATUS_ERROR(r) ((r) & SLI4_PORT_STATUS_ERR)
383 #define SLI4_PORT_STATUS_DUMP_PRESENT(r) ((r) & SLI4_PORT_STATUS_DIP)
384 #define SLI4_PORT_STATUS_FDP_PRESENT(r) ((r) & SLI4_PORT_STATUS_FDP)
386 #define SLI4_PHSDEV_CONTROL_REG_236 0x0414 /** register offset Interface Type 2 + 3 + 6*/
387 #define SLI4_PHYDEV_CONTROL_DRST BIT(0) /** physical device reset */
388 #define SLI4_PHYDEV_CONTROL_FRST BIT(1) /** firmware reset */
389 #define SLI4_PHYDEV_CONTROL_DD BIT(2) /** diagnostic dump */
390 #define SLI4_PHYDEV_CONTROL_FRL_MASK 0x000000f0
391 #define SLI4_PHYDEV_CONTROL_FRL_SHIFT 4
392 #define SLI4_PHYDEV_CONTROL_FRL(r) (((r) & SLI4_PHYDEV_CONTROL_FRL_MASK) >> \
393 SLI4_PHYDEV_CONTROL_FRL_SHIFT_SHIFT)
395 /*************************************************************************
396 * SLI-4 mailbox command formats and definitions
399 typedef struct sli4_mbox_command_header_s {
400 #if BYTE_ORDER == LITTLE_ENDIAN
403 status:16; /** Port writes to indicate success / fail */
405 #error big endian version not defined
407 } sli4_mbox_command_header_t;
409 #define SLI4_MBOX_COMMAND_CONFIG_LINK 0x07
410 #define SLI4_MBOX_COMMAND_DUMP 0x17
411 #define SLI4_MBOX_COMMAND_DOWN_LINK 0x06
412 #define SLI4_MBOX_COMMAND_INIT_LINK 0x05
413 #define SLI4_MBOX_COMMAND_INIT_VFI 0xa3
414 #define SLI4_MBOX_COMMAND_INIT_VPI 0xa4
415 #define SLI4_MBOX_COMMAND_POST_XRI 0xa7
416 #define SLI4_MBOX_COMMAND_RELEASE_XRI 0xac
417 #define SLI4_MBOX_COMMAND_READ_CONFIG 0x0b
418 #define SLI4_MBOX_COMMAND_READ_STATUS 0x0e
419 #define SLI4_MBOX_COMMAND_READ_NVPARMS 0x02
420 #define SLI4_MBOX_COMMAND_READ_REV 0x11
421 #define SLI4_MBOX_COMMAND_READ_LNK_STAT 0x12
422 #define SLI4_MBOX_COMMAND_READ_SPARM64 0x8d
423 #define SLI4_MBOX_COMMAND_READ_TOPOLOGY 0x95
424 #define SLI4_MBOX_COMMAND_REG_FCFI 0xa0
425 #define SLI4_MBOX_COMMAND_REG_FCFI_MRQ 0xaf
426 #define SLI4_MBOX_COMMAND_REG_RPI 0x93
427 #define SLI4_MBOX_COMMAND_REG_RX_RQ 0xa6
428 #define SLI4_MBOX_COMMAND_REG_VFI 0x9f
429 #define SLI4_MBOX_COMMAND_REG_VPI 0x96
430 #define SLI4_MBOX_COMMAND_REQUEST_FEATURES 0x9d
431 #define SLI4_MBOX_COMMAND_SLI_CONFIG 0x9b
432 #define SLI4_MBOX_COMMAND_UNREG_FCFI 0xa2
433 #define SLI4_MBOX_COMMAND_UNREG_RPI 0x14
434 #define SLI4_MBOX_COMMAND_UNREG_VFI 0xa1
435 #define SLI4_MBOX_COMMAND_UNREG_VPI 0x97
436 #define SLI4_MBOX_COMMAND_WRITE_NVPARMS 0x03
437 #define SLI4_MBOX_COMMAND_CONFIG_AUTO_XFER_RDY 0xAD
438 #define SLI4_MBOX_COMMAND_CONFIG_AUTO_XFER_RDY_HP 0xAE
440 #define SLI4_MBOX_STATUS_SUCCESS 0x0000
441 #define SLI4_MBOX_STATUS_FAILURE 0x0001
442 #define SLI4_MBOX_STATUS_RPI_NOT_REG 0x1400
445 * @brief Buffer Descriptor Entry (BDE)
447 typedef struct sli4_bde_s {
448 #if BYTE_ORDER == LITTLE_ENDIAN
449 uint32_t buffer_length:24,
453 uint32_t buffer_address_low;
454 uint32_t buffer_address_high;
461 uint32_t sgl_segment_address_low;
462 uint32_t sgl_segment_address_high;
466 #error big endian version not defined
470 #define SLI4_BDE_TYPE_BDE_64 0x00 /** Generic 64-bit data */
471 #define SLI4_BDE_TYPE_BDE_IMM 0x01 /** Immediate data */
472 #define SLI4_BDE_TYPE_BLP 0x40 /** Buffer List Pointer */
475 * @brief Scatter-Gather Entry (SGE)
477 typedef struct sli4_sge_s {
478 #if BYTE_ORDER == LITTLE_ENDIAN
479 uint32_t buffer_address_high;
480 uint32_t buffer_address_low;
481 uint32_t data_offset:27,
484 uint32_t buffer_length;
486 #error big endian version not defined
491 * @brief T10 DIF Scatter-Gather Entry (SGE)
493 typedef struct sli4_dif_sge_s {
494 #if BYTE_ORDER == LITTLE_ENDIAN
495 uint32_t buffer_address_high;
496 uint32_t buffer_address_low;
502 #error big endian version not defined
507 * @brief T10 DIF Seed Scatter-Gather Entry (SGE)
509 typedef struct sli4_diseed_sge_s {
510 #if BYTE_ORDER == LITTLE_ENDIAN
511 uint32_t ref_tag_cmp;
512 uint32_t ref_tag_repl;
513 uint32_t app_tag_repl:16,
526 uint32_t app_tag_cmp:16,
536 #error big endian version not defined
541 * @brief List Segment Pointer Scatter-Gather Entry (SGE)
543 typedef struct sli4_lsp_sge_s {
544 #if BYTE_ORDER == LITTLE_ENDIAN
545 uint32_t buffer_address_high;
546 uint32_t buffer_address_low;
550 uint32_t segment_length:24,
553 #error big endian version not defined
557 #define SLI4_SGE_MAX_RESERVED 3
559 #define SLI4_SGE_DIF_OP_IN_NODIF_OUT_CRC 0x00
560 #define SLI4_SGE_DIF_OP_IN_CRC_OUT_NODIF 0x01
561 #define SLI4_SGE_DIF_OP_IN_NODIF_OUT_CHKSUM 0x02
562 #define SLI4_SGE_DIF_OP_IN_CHKSUM_OUT_NODIF 0x03
563 #define SLI4_SGE_DIF_OP_IN_CRC_OUT_CRC 0x04
564 #define SLI4_SGE_DIF_OP_IN_CHKSUM_OUT_CHKSUM 0x05
565 #define SLI4_SGE_DIF_OP_IN_CRC_OUT_CHKSUM 0x06
566 #define SLI4_SGE_DIF_OP_IN_CHKSUM_OUT_CRC 0x07
567 #define SLI4_SGE_DIF_OP_IN_RAW_OUT_RAW 0x08
569 #define SLI4_SGE_TYPE_DATA 0x00
570 #define SLI4_SGE_TYPE_CHAIN 0x03 /** Skyhawk only */
571 #define SLI4_SGE_TYPE_DIF 0x04 /** Data Integrity Field */
572 #define SLI4_SGE_TYPE_LSP 0x05 /** List Segment Pointer */
573 #define SLI4_SGE_TYPE_PEDIF 0x06 /** Post Encryption Engine DIF */
574 #define SLI4_SGE_TYPE_PESEED 0x07 /** Post Encryption Engine DIF Seed */
575 #define SLI4_SGE_TYPE_DISEED 0x08 /** DIF Seed */
576 #define SLI4_SGE_TYPE_ENC 0x09 /** Encryption */
577 #define SLI4_SGE_TYPE_ATM 0x0a /** DIF Application Tag Mask */
578 #define SLI4_SGE_TYPE_SKIP 0x0c /** SKIP */
580 #define OCS_MAX_SGE_SIZE 0x80000000 /* Maximum data allowed in a SGE */
585 typedef struct sli4_cmd_config_link_s {
586 sli4_mbox_command_header_t hdr;
587 #if BYTE_ORDER == LITTLE_ENDIAN
588 uint32_t maxbbc:8, /** Max buffer-to-buffer credit */
601 bbscn:4, /** buffer-to-buffer state change number */
602 cscn:1, /** configure BBSCN */
605 #error big endian version not defined
607 } sli4_cmd_config_link_t;
612 #define SLI4_WKI_TAG_SAT_TEM 0x1040
613 typedef struct sli4_cmd_dump4_s {
614 sli4_mbox_command_header_t hdr;
615 #if BYTE_ORDER == LITTLE_ENDIAN
618 uint32_t wki_selection:16,
621 uint32_t returned_byte_cnt;
622 uint32_t resp_data[59];
624 #error big endian version not defined
629 * @brief FW_INITIALIZE - initialize a SLI port
631 * @note This command uses a different format than all others.
634 extern const uint8_t sli4_fw_initialize[8];
637 * @brief FW_DEINITIALIZE - deinitialize a SLI port
639 * @note This command uses a different format than all others.
642 extern const uint8_t sli4_fw_deinitialize[8];
645 * @brief INIT_LINK - initialize the link for a FC/FCoE port
647 typedef struct sli4_cmd_init_link_flags_s {
650 #define FC_TOPOLOGY_FCAL 0
651 #define FC_TOPOLOGY_P2P 1
655 gen_loop_validity_check:1,
657 enable_topology_failover:1,
660 select_hightest_al_pa:1,
661 :16; /* pad to 32 bits */
662 } sli4_cmd_init_link_flags_t;
664 #define SLI4_INIT_LINK_F_LOOP_BACK BIT(0)
665 #define SLI4_INIT_LINK_F_UNFAIR BIT(6)
666 #define SLI4_INIT_LINK_F_NO_LIRP BIT(7)
667 #define SLI4_INIT_LINK_F_LOOP_VALID_CHK BIT(8)
668 #define SLI4_INIT_LINK_F_NO_LISA BIT(9)
669 #define SLI4_INIT_LINK_F_FAIL_OVER BIT(10)
670 #define SLI4_INIT_LINK_F_NO_AUTOSPEED BIT(11)
671 #define SLI4_INIT_LINK_F_PICK_HI_ALPA BIT(15)
673 #define SLI4_INIT_LINK_F_P2P_ONLY 1
674 #define SLI4_INIT_LINK_F_FCAL_ONLY 2
676 #define SLI4_INIT_LINK_F_FCAL_FAIL_OVER 0
677 #define SLI4_INIT_LINK_F_P2P_FAIL_OVER 1
679 typedef struct sli4_cmd_init_link_s {
680 sli4_mbox_command_header_t hdr;
681 #if BYTE_ORDER == LITTLE_ENDIAN
682 uint32_t selective_reset_al_pa:8,
684 sli4_cmd_init_link_flags_t link_flags;
685 uint32_t link_speed_selection_code;
686 #define FC_LINK_SPEED_1G 1
687 #define FC_LINK_SPEED_2G 2
688 #define FC_LINK_SPEED_AUTO_1_2 3
689 #define FC_LINK_SPEED_4G 4
690 #define FC_LINK_SPEED_AUTO_4_1 5
691 #define FC_LINK_SPEED_AUTO_4_2 6
692 #define FC_LINK_SPEED_AUTO_4_2_1 7
693 #define FC_LINK_SPEED_8G 8
694 #define FC_LINK_SPEED_AUTO_8_1 9
695 #define FC_LINK_SPEED_AUTO_8_2 10
696 #define FC_LINK_SPEED_AUTO_8_2_1 11
697 #define FC_LINK_SPEED_AUTO_8_4 12
698 #define FC_LINK_SPEED_AUTO_8_4_1 13
699 #define FC_LINK_SPEED_AUTO_8_4_2 14
700 #define FC_LINK_SPEED_10G 16
701 #define FC_LINK_SPEED_16G 17
702 #define FC_LINK_SPEED_AUTO_16_8_4 18
703 #define FC_LINK_SPEED_AUTO_16_8 19
704 #define FC_LINK_SPEED_32G 20
705 #define FC_LINK_SPEED_AUTO_32_16_8 21
706 #define FC_LINK_SPEED_AUTO_32_16 22
708 #error big endian version not defined
710 } sli4_cmd_init_link_t;
713 * @brief INIT_VFI - initialize the VFI resource
715 typedef struct sli4_cmd_init_vfi_s {
716 sli4_mbox_command_header_t hdr;
717 #if BYTE_ORDER == LITTLE_ENDIAN
732 #error big endian version not defined
734 } sli4_cmd_init_vfi_t;
737 * @brief INIT_VPI - initialize the VPI resource
739 typedef struct sli4_cmd_init_vpi_s {
740 sli4_mbox_command_header_t hdr;
741 #if BYTE_ORDER == LITTLE_ENDIAN
745 #error big endian version not defined
747 } sli4_cmd_init_vpi_t;
750 * @brief POST_XRI - post XRI resources to the SLI Port
752 typedef struct sli4_cmd_post_xri_s {
753 sli4_mbox_command_header_t hdr;
754 #if BYTE_ORDER == LITTLE_ENDIAN
755 uint32_t xri_base:16,
762 #error big endian version not defined
764 } sli4_cmd_post_xri_t;
767 * @brief RELEASE_XRI - Release XRI resources from the SLI Port
769 typedef struct sli4_cmd_release_xri_s {
770 sli4_mbox_command_header_t hdr;
771 #if BYTE_ORDER == LITTLE_ENDIAN
772 uint32_t released_xri_count:5,
777 uint32_t xri_tag0:16,
781 #error big endian version not defined
783 } sli4_cmd_release_xri_t;
786 * @brief READ_CONFIG - read SLI port configuration parameters
788 typedef struct sli4_cmd_read_config_s {
789 sli4_mbox_command_header_t hdr;
790 } sli4_cmd_read_config_t;
792 typedef struct sli4_res_read_config_s {
793 sli4_mbox_command_header_t hdr;
794 #if BYTE_ORDER == LITTLE_ENDIAN
796 ext:1; /** Resource Extents */
810 uint32_t lmt:16, /** Link Module Type */
814 uint32_t xri_base:16,
816 uint32_t rpi_base:16,
818 uint32_t vpi_base:16,
820 uint32_t vfi_base:16,
824 uint32_t rq_count:16,
826 uint32_t wq_count:16,
830 #error big endian version not defined
832 } sli4_res_read_config_t;
834 #define SLI4_READ_CFG_TOPO_FCOE 0x0 /** FCoE topology */
835 #define SLI4_READ_CFG_TOPO_FC 0x1 /** FC topology unknown */
836 #define SLI4_READ_CFG_TOPO_FC_DA 0x2 /** FC Direct Attach (non FC-AL) topology */
837 #define SLI4_READ_CFG_TOPO_FC_AL 0x3 /** FC-AL topology */
840 * @brief READ_NVPARMS - read SLI port configuration parameters
842 typedef struct sli4_cmd_read_nvparms_s {
843 sli4_mbox_command_header_t hdr;
844 #if BYTE_ORDER == LITTLE_ENDIAN
851 uint32_t hard_alpa:8,
854 #error big endian version not defined
856 } sli4_cmd_read_nvparms_t;
859 * @brief WRITE_NVPARMS - write SLI port configuration parameters
861 typedef struct sli4_cmd_write_nvparms_s {
862 sli4_mbox_command_header_t hdr;
863 #if BYTE_ORDER == LITTLE_ENDIAN
870 uint32_t hard_alpa:8,
873 #error big endian version not defined
875 } sli4_cmd_write_nvparms_t;
878 * @brief READ_REV - read the Port revision levels
880 typedef struct sli4_cmd_read_rev_s {
881 sli4_mbox_command_header_t hdr;
882 #if BYTE_ORDER == LITTLE_ENDIAN
890 uint32_t first_hw_revision;
891 uint32_t second_hw_revision;
893 uint32_t third_hw_revision;
894 uint32_t fc_ph_low:8,
897 feature_level_high:8;
899 uint32_t first_fw_id;
900 char first_fw_name[16];
901 uint32_t second_fw_id;
902 char second_fw_name[16];
904 uint32_t available_length:24,
906 uint32_t physical_address_low;
907 uint32_t physical_address_high;
908 uint32_t returned_vpd_length;
909 uint32_t actual_vpd_length;
911 #error big endian version not defined
913 } sli4_cmd_read_rev_t;
916 * @brief READ_SPARM64 - read the Port service parameters
918 typedef struct sli4_cmd_read_sparm64_s {
919 sli4_mbox_command_header_t hdr;
920 #if BYTE_ORDER == LITTLE_ENDIAN
926 uint32_t port_name_start:16,
928 uint32_t node_name_start:16,
931 #error big endian version not defined
933 } sli4_cmd_read_sparm64_t;
935 #define SLI4_READ_SPARM64_VPI_DEFAULT 0
936 #define SLI4_READ_SPARM64_VPI_SPECIAL UINT16_MAX
938 #define SLI4_READ_SPARM64_WWPN_OFFSET (4 * sizeof(uint32_t))
939 #define SLI4_READ_SPARM64_WWNN_OFFSET (SLI4_READ_SPARM64_WWPN_OFFSET + sizeof(uint64_t))
941 typedef struct sli4_port_state_s {
942 #if BYTE_ORDER == LITTLE_ENDIAN
943 uint32_t nx_port_recv_state:2,
944 nx_port_trans_state:2,
945 nx_port_state_machine:4,
951 #error big endian version not defined
956 * @brief READ_TOPOLOGY - read the link event information
958 typedef struct sli4_cmd_read_topology_s {
959 sli4_mbox_command_header_t hdr;
960 #if BYTE_ORDER == LITTLE_ENDIAN
962 uint32_t attention_type:8,
970 sli4_bde_t bde_loop_map;
971 sli4_port_state_t link_down;
972 sli4_port_state_t link_current;
982 uint32_t acquired_al_pa:8,
986 uint32_t initial_n_port_id:24,
989 #error big endian version not defined
991 } sli4_cmd_read_topology_t;
993 #define SLI4_MIN_LOOP_MAP_BYTES 128
995 #define SLI4_READ_TOPOLOGY_LINK_UP 0x1
996 #define SLI4_READ_TOPOLOGY_LINK_DOWN 0x2
997 #define SLI4_READ_TOPOLOGY_LINK_NO_ALPA 0x3
999 #define SLI4_READ_TOPOLOGY_UNKNOWN 0x0
1000 #define SLI4_READ_TOPOLOGY_NPORT 0x1
1001 #define SLI4_READ_TOPOLOGY_FC_AL 0x2
1003 #define SLI4_READ_TOPOLOGY_SPEED_NONE 0x00
1004 #define SLI4_READ_TOPOLOGY_SPEED_1G 0x04
1005 #define SLI4_READ_TOPOLOGY_SPEED_2G 0x08
1006 #define SLI4_READ_TOPOLOGY_SPEED_4G 0x10
1007 #define SLI4_READ_TOPOLOGY_SPEED_8G 0x20
1008 #define SLI4_READ_TOPOLOGY_SPEED_10G 0x40
1009 #define SLI4_READ_TOPOLOGY_SPEED_16G 0x80
1010 #define SLI4_READ_TOPOLOGY_SPEED_32G 0x90
1013 * @brief REG_FCFI - activate a FC Forwarder
1015 #define SLI4_CMD_REG_FCFI_NUM_RQ_CFG 4
1016 typedef struct sli4_cmd_reg_fcfi_s {
1017 sli4_mbox_command_header_t hdr;
1018 #if BYTE_ORDER == LITTLE_ENDIAN
1019 uint32_t fcf_index:16,
1021 uint32_t rq_id_1:16,
1023 uint32_t rq_id_3:16,
1026 uint32_t r_ctl_mask:8,
1030 } rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG];
1031 uint32_t vlan_tag:12,
1035 #error big endian version not defined
1037 } sli4_cmd_reg_fcfi_t;
1039 #define SLI4_CMD_REG_FCFI_MRQ_NUM_RQ_CFG 4
1040 #define SLI4_CMD_REG_FCFI_MRQ_MAX_NUM_RQ 32
1041 #define SLI4_CMD_REG_FCFI_SET_FCFI_MODE 0
1042 #define SLI4_CMD_REG_FCFI_SET_MRQ_MODE 1
1044 typedef struct sli4_cmd_reg_fcfi_mrq_s {
1045 sli4_mbox_command_header_t hdr;
1046 #if BYTE_ORDER == LITTLE_ENDIAN
1047 uint32_t fcf_index:16,
1050 uint32_t rq_id_1:16,
1053 uint32_t rq_id_3:16,
1057 uint32_t r_ctl_mask:8,
1061 } rq_cfg[SLI4_CMD_REG_FCFI_MRQ_NUM_RQ_CFG];
1063 uint32_t vlan_tag:12,
1068 uint32_t num_mrq_pairs:8,
1069 mrq_filter_bitmask:4,
1070 rq_selection_policy:4,
1073 } sli4_cmd_reg_fcfi_mrq_t;
1076 * @brief REG_RPI - register a Remote Port Indicator
1078 typedef struct sli4_cmd_reg_rpi_s {
1079 sli4_mbox_command_header_t hdr;
1080 #if BYTE_ORDER == LITTLE_ENDIAN
1083 uint32_t remote_n_port_id:24,
1095 #error big endian version not defined
1097 } sli4_cmd_reg_rpi_t;
1098 #define SLI4_REG_RPI_BUF_LEN 0x70
1101 * @brief REG_VFI - register a Virtual Fabric Indicator
1103 typedef struct sli4_cmd_reg_vfi_s {
1104 sli4_mbox_command_header_t hdr;
1105 #if BYTE_ORDER == LITTLE_ENDIAN
1112 vpi:16; /* vp=TRUE */
1113 uint8_t wwpn[8]; /* vp=TRUE */
1114 sli4_bde_t sparm; /* either FLOGI or PLOGI */
1117 uint32_t local_n_port_id:24, /* vp=TRUE */
1120 #error big endian version not defined
1122 } sli4_cmd_reg_vfi_t;
1125 * @brief REG_VPI - register a Virtual Port Indicator
1127 typedef struct sli4_cmd_reg_vpi_s {
1128 sli4_mbox_command_header_t hdr;
1129 #if BYTE_ORDER == LITTLE_ENDIAN
1131 uint32_t local_n_port_id:24,
1139 #error big endian version not defined
1141 } sli4_cmd_reg_vpi_t;
1144 * @brief REQUEST_FEATURES - request / query SLI features
1147 #if BYTE_ORDER == LITTLE_ENDIAN
1149 uint32_t iaab:1, /** inhibit auto-ABTS originator */
1150 npiv:1, /** NPIV support */
1151 dif:1, /** DIF/DIX support */
1152 vf:1, /** virtual fabric support */
1153 fcpi:1, /** FCP initiator support */
1154 fcpt:1, /** FCP target support */
1155 fcpc:1, /** combined FCP initiator/target */
1157 rqd:1, /** recovery qualified delay */
1158 iaar:1, /** inhibit auto-ABTS responder */
1159 hlm:1, /** High Login Mode */
1160 perfh:1, /** performance hints */
1161 rxseq:1, /** RX Sequence Coalescing */
1162 rxri:1, /** Release XRI variant of Coalescing */
1163 dcl2:1, /** Disable Class 2 */
1164 rsco:1, /** Receive Sequence Coalescing Optimizations */
1165 mrqp:1, /** Multi RQ Pair Mode Support */
1170 #error big endian version not defined
1174 typedef struct sli4_cmd_request_features_s {
1175 sli4_mbox_command_header_t hdr;
1176 #if BYTE_ORDER == LITTLE_ENDIAN
1180 #error big endian version not defined
1182 sli4_features_t command;
1183 sli4_features_t response;
1184 } sli4_cmd_request_features_t;
1187 * @brief SLI_CONFIG - submit a configuration command to Port
1189 * Command is either embedded as part of the payload (embed) or located
1190 * in a separate memory buffer (mem)
1193 typedef struct sli4_sli_config_pmd_s {
1194 uint32_t address_low;
1195 uint32_t address_high;
1198 } sli4_sli_config_pmd_t;
1200 typedef struct sli4_cmd_sli_config_s {
1201 sli4_mbox_command_header_t hdr;
1202 #if BYTE_ORDER == LITTLE_ENDIAN
1207 uint32_t payload_length;
1212 uint8_t embed[58 * sizeof(uint32_t)];
1213 sli4_sli_config_pmd_t mem;
1216 #error big endian version not defined
1218 } sli4_cmd_sli_config_t;
1221 * @brief READ_STATUS - read tx/rx status of a particular port
1225 typedef struct sli4_cmd_read_status_s {
1226 sli4_mbox_command_header_t hdr;
1227 #if BYTE_ORDER == LITTLE_ENDIAN
1231 uint32_t transmit_kbyte_count;
1232 uint32_t receive_kbyte_count;
1233 uint32_t transmit_frame_count;
1234 uint32_t receive_frame_count;
1235 uint32_t transmit_sequence_count;
1236 uint32_t receive_sequence_count;
1237 uint32_t total_exchanges_originator;
1238 uint32_t total_exchanges_responder;
1239 uint32_t receive_p_bsy_count;
1240 uint32_t receive_f_bsy_count;
1241 uint32_t dropped_frames_due_to_no_rq_buffer_count;
1242 uint32_t empty_rq_timeout_count;
1243 uint32_t dropped_frames_due_to_no_xri_count;
1244 uint32_t empty_xri_pool_count;
1247 #error big endian version not defined
1249 } sli4_cmd_read_status_t;
1252 * @brief READ_LNK_STAT - read link status of a particular port
1256 typedef struct sli4_cmd_read_link_stats_s {
1257 sli4_mbox_command_header_t hdr;
1258 #if BYTE_ORDER == LITTLE_ENDIAN
1284 uint32_t link_failure_error_count;
1285 uint32_t loss_of_sync_error_count;
1286 uint32_t loss_of_signal_error_count;
1287 uint32_t primitive_sequence_error_count;
1288 uint32_t invalid_transmission_word_error_count;
1289 uint32_t crc_error_count;
1290 uint32_t primitive_sequence_event_timeout_count;
1291 uint32_t elastic_buffer_overrun_error_count;
1292 uint32_t arbitration_fc_al_timout_count;
1293 uint32_t advertised_receive_bufftor_to_buffer_credit;
1294 uint32_t current_receive_buffer_to_buffer_credit;
1295 uint32_t advertised_transmit_buffer_to_buffer_credit;
1296 uint32_t current_transmit_buffer_to_buffer_credit;
1297 uint32_t received_eofa_count;
1298 uint32_t received_eofdti_count;
1299 uint32_t received_eofni_count;
1300 uint32_t received_soff_count;
1301 uint32_t received_dropped_no_aer_count;
1302 uint32_t received_dropped_no_available_rpi_resources_count;
1303 uint32_t received_dropped_no_available_xri_resources_count;
1306 #error big endian version not defined
1308 } sli4_cmd_read_link_stats_t;
1311 * @brief Format a WQE with WQ_ID Association performance hint
1314 * PHWQ works by over-writing part of Word 10 in the WQE with the WQ ID.
1316 * @param entry Pointer to the WQE.
1317 * @param q_id Queue ID.
1322 sli_set_wq_id_association(void *entry, uint16_t q_id)
1324 uint32_t *wqe = entry;
1327 * Set Word 10, bit 0 to zero
1328 * Set Word 10, bits 15:1 to the WQ ID
1330 #if BYTE_ORDER == LITTLE_ENDIAN
1332 wqe[10] |= q_id << 1;
1334 #error big endian version not defined
1339 * @brief UNREG_FCFI - unregister a FCFI
1341 typedef struct sli4_cmd_unreg_fcfi_s {
1342 sli4_mbox_command_header_t hdr;
1344 #if BYTE_ORDER == LITTLE_ENDIAN
1348 #error big endian version not defined
1350 } sli4_cmd_unreg_fcfi_t;
1353 * @brief UNREG_RPI - unregister one or more RPI
1355 typedef struct sli4_cmd_unreg_rpi_s {
1356 sli4_mbox_command_header_t hdr;
1357 #if BYTE_ORDER == LITTLE_ENDIAN
1362 uint32_t destination_n_port_id:24,
1365 #error big endian version not defined
1367 } sli4_cmd_unreg_rpi_t;
1369 #define SLI4_UNREG_RPI_II_RPI 0x0
1370 #define SLI4_UNREG_RPI_II_VPI 0x1
1371 #define SLI4_UNREG_RPI_II_VFI 0x2
1372 #define SLI4_UNREG_RPI_II_FCFI 0x3
1375 * @brief UNREG_VFI - unregister one or more VFI
1377 typedef struct sli4_cmd_unreg_vfi_s {
1378 sli4_mbox_command_header_t hdr;
1379 #if BYTE_ORDER == LITTLE_ENDIAN
1385 #error big endian version not defined
1387 } sli4_cmd_unreg_vfi_t;
1389 #define SLI4_UNREG_VFI_II_VFI 0x0
1390 #define SLI4_UNREG_VFI_II_FCFI 0x3
1393 SLI4_UNREG_TYPE_PORT,
1394 SLI4_UNREG_TYPE_DOMAIN,
1395 SLI4_UNREG_TYPE_FCF,
1400 * @brief UNREG_VPI - unregister one or more VPI
1402 typedef struct sli4_cmd_unreg_vpi_s {
1403 sli4_mbox_command_header_t hdr;
1404 #if BYTE_ORDER == LITTLE_ENDIAN
1410 #error big endian version not defined
1412 } sli4_cmd_unreg_vpi_t;
1414 #define SLI4_UNREG_VPI_II_VPI 0x0
1415 #define SLI4_UNREG_VPI_II_VFI 0x2
1416 #define SLI4_UNREG_VPI_II_FCFI 0x3
1419 * @brief AUTO_XFER_RDY - Configure the auto-generate XFER-RDY feature.
1421 typedef struct sli4_cmd_config_auto_xfer_rdy_s {
1422 sli4_mbox_command_header_t hdr;
1423 #if BYTE_ORDER == LITTLE_ENDIAN
1425 uint32_t max_burst_len;
1427 #error big endian version not defined
1429 } sli4_cmd_config_auto_xfer_rdy_t;
1431 typedef struct sli4_cmd_config_auto_xfer_rdy_hp_s {
1432 sli4_mbox_command_header_t hdr;
1433 #if BYTE_ORDER == LITTLE_ENDIAN
1435 uint32_t max_burst_len;
1438 uint32_t block_size:16,
1441 #error big endian version not defined
1443 } sli4_cmd_config_auto_xfer_rdy_hp_t;
1445 /*************************************************************************
1446 * SLI-4 common configuration command formats and definitions
1449 #define SLI4_CFG_STATUS_SUCCESS 0x00
1450 #define SLI4_CFG_STATUS_FAILED 0x01
1451 #define SLI4_CFG_STATUS_ILLEGAL_REQUEST 0x02
1452 #define SLI4_CFG_STATUS_ILLEGAL_FIELD 0x03
1454 #define SLI4_MGMT_STATUS_FLASHROM_READ_FAILED 0xcb
1456 #define SLI4_CFG_ADD_STATUS_NO_STATUS 0x00
1457 #define SLI4_CFG_ADD_STATUS_INVALID_OPCODE 0x1e
1462 #define SLI4_SUBSYSTEM_COMMON 0x01
1463 #define SLI4_SUBSYSTEM_LOWLEVEL 0x0B
1464 #define SLI4_SUBSYSTEM_FCFCOE 0x0c
1465 #define SLI4_SUBSYSTEM_DMTF 0x11
1467 #define SLI4_OPC_LOWLEVEL_SET_WATCHDOG 0X36
1470 * Common opcode (OPC) values.
1472 #define SLI4_OPC_COMMON_FUNCTION_RESET 0x3d
1473 #define SLI4_OPC_COMMON_CREATE_CQ 0x0c
1474 #define SLI4_OPC_COMMON_CREATE_CQ_SET 0x1d
1475 #define SLI4_OPC_COMMON_DESTROY_CQ 0x36
1476 #define SLI4_OPC_COMMON_MODIFY_EQ_DELAY 0x29
1477 #define SLI4_OPC_COMMON_CREATE_EQ 0x0d
1478 #define SLI4_OPC_COMMON_DESTROY_EQ 0x37
1479 #define SLI4_OPC_COMMON_CREATE_MQ_EXT 0x5a
1480 #define SLI4_OPC_COMMON_DESTROY_MQ 0x35
1481 #define SLI4_OPC_COMMON_GET_CNTL_ATTRIBUTES 0x20
1482 #define SLI4_OPC_COMMON_NOP 0x21
1483 #define SLI4_OPC_COMMON_GET_RESOURCE_EXTENT_INFO 0x9a
1484 #define SLI4_OPC_COMMON_GET_SLI4_PARAMETERS 0xb5
1485 #define SLI4_OPC_COMMON_QUERY_FW_CONFIG 0x3a
1486 #define SLI4_OPC_COMMON_GET_PORT_NAME 0x4d
1488 #define SLI4_OPC_COMMON_WRITE_FLASHROM 0x07
1489 #define SLI4_OPC_COMMON_MANAGE_FAT 0x44
1490 #define SLI4_OPC_COMMON_READ_TRANSCEIVER_DATA 0x49
1491 #define SLI4_OPC_COMMON_GET_CNTL_ADDL_ATTRIBUTES 0x79
1492 #define SLI4_OPC_COMMON_GET_EXT_FAT_CAPABILITIES 0x7d
1493 #define SLI4_OPC_COMMON_SET_EXT_FAT_CAPABILITIES 0x7e
1494 #define SLI4_OPC_COMMON_EXT_FAT_CONFIGURE_SNAPSHOT 0x7f
1495 #define SLI4_OPC_COMMON_EXT_FAT_RETRIEVE_SNAPSHOT 0x80
1496 #define SLI4_OPC_COMMON_EXT_FAT_READ_STRING_TABLE 0x82
1497 #define SLI4_OPC_COMMON_GET_FUNCTION_CONFIG 0xa0
1498 #define SLI4_OPC_COMMON_GET_PROFILE_CONFIG 0xa4
1499 #define SLI4_OPC_COMMON_SET_PROFILE_CONFIG 0xa5
1500 #define SLI4_OPC_COMMON_GET_PROFILE_LIST 0xa6
1501 #define SLI4_OPC_COMMON_GET_ACTIVE_PROFILE 0xa7
1502 #define SLI4_OPC_COMMON_SET_ACTIVE_PROFILE 0xa8
1503 #define SLI4_OPC_COMMON_READ_OBJECT 0xab
1504 #define SLI4_OPC_COMMON_WRITE_OBJECT 0xac
1505 #define SLI4_OPC_COMMON_DELETE_OBJECT 0xae
1506 #define SLI4_OPC_COMMON_READ_OBJECT_LIST 0xad
1507 #define SLI4_OPC_COMMON_SET_DUMP_LOCATION 0xb8
1508 #define SLI4_OPC_COMMON_SET_FEATURES 0xbf
1509 #define SLI4_OPC_COMMON_GET_RECONFIG_LINK_INFO 0xc9
1510 #define SLI4_OPC_COMMON_SET_RECONFIG_LINK_ID 0xca
1513 * DMTF opcode (OPC) values.
1515 #define SLI4_OPC_DMTF_EXEC_CLP_CMD 0x01
1518 * @brief Generic Command Request header
1520 typedef struct sli4_req_hdr_s {
1521 #if BYTE_ORDER == LITTLE_ENDIAN
1526 uint32_t request_length;
1530 #error big endian version not defined
1535 * @brief Generic Command Response header
1537 typedef struct sli4_res_hdr_s {
1538 #if BYTE_ORDER == LITTLE_ENDIAN
1543 additional_status:8,
1545 uint32_t response_length;
1546 uint32_t actual_response_length;
1548 #error big endian version not defined
1553 * @brief COMMON_FUNCTION_RESET
1555 * Resets the Port, returning it to a power-on state. This configuration
1556 * command does not have a payload and should set/expect the lengths to
1559 typedef struct sli4_req_common_function_reset_s {
1561 } sli4_req_common_function_reset_t;
1563 typedef struct sli4_res_common_function_reset_s {
1565 } sli4_res_common_function_reset_t;
1568 * @brief COMMON_CREATE_CQ_V0
1570 * Create a Completion Queue.
1572 typedef struct sli4_req_common_create_cq_v0_s {
1574 #if BYTE_ORDER == LITTLE_ENDIAN
1575 uint32_t num_pages:16,
1593 } page_physical_address[0];
1595 #error big endian version not defined
1597 } sli4_req_common_create_cq_v0_t;
1600 * @brief COMMON_CREATE_CQ_V2
1602 * Create a Completion Queue.
1604 typedef struct sli4_req_common_create_cq_v2_s {
1606 #if BYTE_ORDER == LITTLE_ENDIAN
1607 uint32_t num_pages:16,
1623 uint32_t cqe_count:16,
1629 } page_physical_address[0];
1631 #error big endian version not defined
1633 } sli4_req_common_create_cq_v2_t;
1636 * @brief COMMON_CREATE_CQ_SET_V0
1638 * Create a set of Completion Queues.
1640 typedef struct sli4_req_common_create_cq_set_v0_s {
1642 #if BYTE_ORDER == LITTLE_ENDIAN
1643 uint32_t num_pages:16,
1655 uint32_t num_cq_req:16,
1662 } page_physical_address[0];
1664 #error big endian version not defined
1666 } sli4_req_common_create_cq_set_v0_t;
1671 #define SLI4_CQ_CNT_256 0
1672 #define SLI4_CQ_CNT_512 1
1673 #define SLI4_CQ_CNT_1024 2
1674 #define SLI4_CQ_CNT_LARGE 3
1676 #define SLI4_CQE_BYTES (4 * sizeof(uint32_t))
1678 #define SLI4_COMMON_CREATE_CQ_V2_MAX_PAGES 8
1681 * @brief Generic Common Create EQ/CQ/MQ/WQ/RQ Queue completion
1683 typedef struct sli4_res_common_create_queue_s {
1685 #if BYTE_ORDER == LITTLE_ENDIAN
1693 #error big endian version not defined
1695 } sli4_res_common_create_queue_t;
1697 typedef struct sli4_res_common_create_queue_set_s {
1699 #if BYTE_ORDER == LITTLE_ENDIAN
1703 #error big endian version not defined
1705 } sli4_res_common_create_queue_set_t;
1708 * @brief Common Destroy CQ
1710 typedef struct sli4_req_common_destroy_cq_s {
1712 #if BYTE_ORDER == LITTLE_ENDIAN
1716 #error big endian version not defined
1718 } sli4_req_common_destroy_cq_t;
1721 * @brief COMMON_MODIFY_EQ_DELAY
1723 * Modify the delay multiplier for EQs
1725 typedef struct sli4_req_common_modify_eq_delay_s {
1727 #if BYTE_ORDER == LITTLE_ENDIAN
1732 uint32_t delay_multiplier;
1733 } eq_delay_record[8];
1735 #error big endian version not defined
1737 } sli4_req_common_modify_eq_delay_t;
1740 * @brief COMMON_CREATE_EQ
1742 * Create an Event Queue.
1744 typedef struct sli4_req_common_create_eq_s {
1746 #if BYTE_ORDER == LITTLE_ENDIAN
1747 uint32_t num_pages:16,
1759 delay_multiplier:10,
1767 #error big endian version not defined
1769 } sli4_req_common_create_eq_t;
1771 #define SLI4_EQ_CNT_256 0
1772 #define SLI4_EQ_CNT_512 1
1773 #define SLI4_EQ_CNT_1024 2
1774 #define SLI4_EQ_CNT_2048 3
1775 #define SLI4_EQ_CNT_4096 4
1777 #define SLI4_EQE_SIZE_4 0
1778 #define SLI4_EQE_SIZE_16 1
1781 * @brief Common Destroy EQ
1783 typedef struct sli4_req_common_destroy_eq_s {
1785 #if BYTE_ORDER == LITTLE_ENDIAN
1789 #error big endian version not defined
1791 } sli4_req_common_destroy_eq_t;
1794 * @brief COMMON_CREATE_MQ_EXT
1796 * Create a Mailbox Queue; accommodate v0 and v1 forms.
1798 typedef struct sli4_req_common_create_mq_ext_s {
1800 #if BYTE_ORDER == LITTLE_ENDIAN
1801 uint32_t num_pages:16,
1803 uint32_t async_event_bitmap;
1804 uint32_t async_cq_id_v1:16,
1817 } page_physical_address[8];
1819 #error big endian version not defined
1821 } sli4_req_common_create_mq_ext_t;
1823 #define SLI4_MQE_SIZE_16 0x05
1824 #define SLI4_MQE_SIZE_32 0x06
1825 #define SLI4_MQE_SIZE_64 0x07
1826 #define SLI4_MQE_SIZE_128 0x08
1828 #define SLI4_ASYNC_EVT_LINK_STATE BIT(1)
1829 #define SLI4_ASYNC_EVT_FCOE_FIP BIT(2)
1830 #define SLI4_ASYNC_EVT_DCBX BIT(3)
1831 #define SLI4_ASYNC_EVT_ISCSI BIT(4)
1832 #define SLI4_ASYNC_EVT_GRP5 BIT(5)
1833 #define SLI4_ASYNC_EVT_FC BIT(16)
1834 #define SLI4_ASYNC_EVT_SLI_PORT BIT(17)
1835 #define SLI4_ASYNC_EVT_VF BIT(18)
1836 #define SLI4_ASYNC_EVT_MR BIT(19)
1838 #define SLI4_ASYNC_EVT_ALL \
1839 SLI4_ASYNC_EVT_LINK_STATE | \
1840 SLI4_ASYNC_EVT_FCOE_FIP | \
1841 SLI4_ASYNC_EVT_DCBX | \
1842 SLI4_ASYNC_EVT_ISCSI | \
1843 SLI4_ASYNC_EVT_GRP5 | \
1844 SLI4_ASYNC_EVT_FC | \
1845 SLI4_ASYNC_EVT_SLI_PORT | \
1846 SLI4_ASYNC_EVT_VF |\
1849 #define SLI4_ASYNC_EVT_FC_FCOE \
1850 SLI4_ASYNC_EVT_LINK_STATE | \
1851 SLI4_ASYNC_EVT_FCOE_FIP | \
1852 SLI4_ASYNC_EVT_GRP5 | \
1853 SLI4_ASYNC_EVT_FC | \
1854 SLI4_ASYNC_EVT_SLI_PORT
1857 * @brief Common Destroy MQ
1859 typedef struct sli4_req_common_destroy_mq_s {
1861 #if BYTE_ORDER == LITTLE_ENDIAN
1865 #error big endian version not defined
1867 } sli4_req_common_destroy_mq_t;
1870 * @brief COMMON_GET_CNTL_ATTRIBUTES
1872 * Query for information about the SLI Port
1874 typedef struct sli4_res_common_get_cntl_attributes_s {
1876 #if BYTE_ORDER == LITTLE_ENDIAN
1877 uint8_t version_string[32];
1878 uint8_t manufacturer_name[32];
1879 uint32_t supported_modes;
1880 uint32_t eprom_version_lo:8,
1883 uint32_t mbx_data_structure_version;
1884 uint32_t ep_firmware_data_structure_version;
1885 uint8_t ncsi_version_string[12];
1886 uint32_t default_extended_timeout;
1887 uint8_t model_number[32];
1888 uint8_t description[64];
1889 uint8_t serial_number[32];
1890 uint8_t ip_version_string[32];
1891 uint8_t fw_version_string[32];
1892 uint8_t bios_version_string[32];
1893 uint8_t redboot_version_string[32];
1894 uint8_t driver_version_string[32];
1895 uint8_t fw_on_flash_version_string[32];
1896 uint32_t functionalities_supported;
1897 uint32_t max_cdb_length:16,
1899 generational_guid0:8;
1900 uint32_t generational_guid1_12[3];
1901 uint32_t generational_guid13:24,
1903 uint32_t default_link_down_timeout:16,
1904 iscsi_version_min_max:8,
1905 multifunctional_device:8;
1906 uint32_t cache_valid:8,
1908 max_domains_supported:8,
1911 uint32_t firmware_post_status;
1913 uint32_t iscsi_features:8,
1915 uint32_t pci_vendor_id:16,
1917 uint32_t pci_sub_vendor_id:16,
1918 pci_sub_system_id:16;
1919 uint32_t pci_bus_number:8,
1920 pci_device_number:8,
1921 pci_function_number:8,
1923 uint64_t unique_identifier;
1924 uint32_t number_of_netfilters:8,
1927 #error big endian version not defined
1929 } sli4_res_common_get_cntl_attributes_t;
1932 * @brief COMMON_GET_CNTL_ATTRIBUTES
1934 * This command queries the controller information from the Flash ROM.
1936 typedef struct sli4_req_common_get_cntl_addl_attributes_s {
1938 } sli4_req_common_get_cntl_addl_attributes_t;
1940 typedef struct sli4_res_common_get_cntl_addl_attributes_s {
1942 uint16_t ipl_file_number;
1943 uint8_t ipl_file_version;
1945 uint8_t on_die_temperature;
1947 uint32_t driver_advanced_features_supported;
1949 char fcoe_universal_bios_version[32];
1950 char fcoe_x86_bios_version[32];
1951 char fcoe_efi_bios_version[32];
1952 char fcoe_fcode_version[32];
1953 char uefi_bios_version[32];
1954 char uefi_nic_version[32];
1955 char uefi_fcode_version[32];
1956 char uefi_iscsi_version[32];
1957 char iscsi_x86_bios_version[32];
1958 char pxe_x86_bios_version[32];
1959 uint8_t fcoe_default_wwpn[8];
1960 uint8_t ext_phy_version[32];
1961 uint8_t fc_universal_bios_version[32];
1962 uint8_t fc_x86_bios_version[32];
1963 uint8_t fc_efi_bios_version[32];
1964 uint8_t fc_fcode_version[32];
1965 uint8_t ext_phy_crc_label[8];
1966 uint8_t ipl_file_name[16];
1968 } sli4_res_common_get_cntl_addl_attributes_t;
1973 * This command does not do anything; it only returns the payload in the completion.
1975 typedef struct sli4_req_common_nop_s {
1977 #if BYTE_ORDER == LITTLE_ENDIAN
1978 uint32_t context[2];
1980 #error big endian version not defined
1982 } sli4_req_common_nop_t;
1984 typedef struct sli4_res_common_nop_s {
1986 #if BYTE_ORDER == LITTLE_ENDIAN
1987 uint32_t context[2];
1989 #error big endian version not defined
1991 } sli4_res_common_nop_t;
1994 * @brief COMMON_GET_RESOURCE_EXTENT_INFO
1996 typedef struct sli4_req_common_get_resource_extent_info_s {
1998 #if BYTE_ORDER == LITTLE_ENDIAN
1999 uint32_t resource_type:16,
2002 #error big endian version not defined
2004 } sli4_req_common_get_resource_extent_info_t;
2006 #define SLI4_RSC_TYPE_ISCSI_INI_XRI 0x0c
2007 #define SLI4_RSC_TYPE_FCOE_VFI 0x20
2008 #define SLI4_RSC_TYPE_FCOE_VPI 0x21
2009 #define SLI4_RSC_TYPE_FCOE_RPI 0x22
2010 #define SLI4_RSC_TYPE_FCOE_XRI 0x23
2012 typedef struct sli4_res_common_get_resource_extent_info_s {
2014 #if BYTE_ORDER == LITTLE_ENDIAN
2015 uint32_t resource_extent_count:16,
2016 resource_extent_size:16;
2018 #error big endian version not defined
2020 } sli4_res_common_get_resource_extent_info_t;
2022 #define SLI4_128BYTE_WQE_SUPPORT 0x02
2024 * @brief COMMON_GET_SLI4_PARAMETERS
2026 typedef struct sli4_res_common_get_sli4_parameters_s {
2028 #if BYTE_ORDER == LITTLE_ENDIAN
2029 uint32_t protocol_type:8,
2039 uint32_t eq_page_cnt:4,
2046 uint32_t eqe_count_mask:16,
2048 uint32_t cq_page_cnt:4,
2056 uint32_t cqe_count_mask:16,
2058 uint32_t mq_page_cnt:4,
2064 uint32_t mqe_count_mask:16,
2066 uint32_t wq_page_cnt:4,
2074 uint32_t wqe_count_mask:16,
2076 uint32_t rq_page_cnt:4,
2084 uint32_t rqe_count_mask:16,
2102 phwq:1, /** Performance Hint WQ_ID Association */
2116 uint32_t sge_supported_length;
2117 uint32_t sgl_page_cnt:4,
2122 uint32_t min_rq_buffer_size:16,
2124 uint32_t max_rq_buffer_size;
2125 uint32_t physical_xri_max:16,
2126 physical_rpi_max:16;
2127 uint32_t physical_vpi_max:16,
2128 physical_vfi_max:16;
2130 uint32_t frag_num_field_offset:16, /* dword 20 */
2131 frag_num_field_size:16;
2132 uint32_t sgl_index_field_offset:16, /* dword 21 */
2133 sgl_index_field_size:16;
2134 uint32_t chain_sge_initial_value_lo; /* dword 22 */
2135 uint32_t chain_sge_initial_value_hi; /* dword 23 */
2137 #error big endian version not defined
2139 } sli4_res_common_get_sli4_parameters_t;
2142 * @brief COMMON_QUERY_FW_CONFIG
2144 * This command retrieves firmware configuration parameters and adapter
2145 * resources available to the driver.
2147 typedef struct sli4_req_common_query_fw_config_s {
2149 } sli4_req_common_query_fw_config_t;
2151 #define SLI4_FUNCTION_MODE_FCOE_INI_MODE 0x40
2152 #define SLI4_FUNCTION_MODE_FCOE_TGT_MODE 0x80
2153 #define SLI4_FUNCTION_MODE_DUA_MODE 0x800
2155 #define SLI4_ULP_MODE_FCOE_INI 0x40
2156 #define SLI4_ULP_MODE_FCOE_TGT 0x80
2158 typedef struct sli4_res_common_query_fw_config_s {
2160 uint32_t config_number;
2162 uint32_t physical_port;
2163 uint32_t function_mode;
2165 uint32_t ulp0_nic_wqid_base;
2166 uint32_t ulp0_nic_wq_total; /* Dword 10 */
2167 uint32_t ulp0_toe_wqid_base;
2168 uint32_t ulp0_toe_wq_total;
2169 uint32_t ulp0_toe_rqid_base;
2170 uint32_t ulp0_toe_rq_total;
2171 uint32_t ulp0_toe_defrqid_base;
2172 uint32_t ulp0_toe_defrq_total;
2173 uint32_t ulp0_lro_rqid_base;
2174 uint32_t ulp0_lro_rq_total;
2175 uint32_t ulp0_iscsi_icd_base;
2176 uint32_t ulp0_iscsi_icd_total; /* Dword 20 */
2178 uint32_t ulp1_nic_wqid_base;
2179 uint32_t ulp1_nic_wq_total;
2180 uint32_t ulp1_toe_wqid_base;
2181 uint32_t ulp1_toe_wq_total;
2182 uint32_t ulp1_toe_rqid_base;
2183 uint32_t ulp1_toe_rq_total;
2184 uint32_t ulp1_toe_defrqid_base;
2185 uint32_t ulp1_toe_defrq_total;
2186 uint32_t ulp1_lro_rqid_base; /* Dword 30 */
2187 uint32_t ulp1_lro_rq_total;
2188 uint32_t ulp1_iscsi_icd_base;
2189 uint32_t ulp1_iscsi_icd_total;
2190 uint32_t function_capabilities;
2191 uint32_t ulp0_cq_base;
2192 uint32_t ulp0_cq_total;
2193 uint32_t ulp0_eq_base;
2194 uint32_t ulp0_eq_total;
2195 uint32_t ulp0_iscsi_chain_icd_base;
2196 uint32_t ulp0_iscsi_chain_icd_total; /* Dword 40 */
2197 uint32_t ulp1_iscsi_chain_icd_base;
2198 uint32_t ulp1_iscsi_chain_icd_total;
2199 } sli4_res_common_query_fw_config_t;
2202 * @brief COMMON_GET_PORT_NAME
2204 typedef struct sli4_req_common_get_port_name_s {
2206 #if BYTE_ORDER == LITTLE_ENDIAN
2207 uint32_t pt:2, /* only COMMON_GET_PORT_NAME_V1 */
2210 #error big endian version not defined
2212 } sli4_req_common_get_port_name_t;
2214 typedef struct sli4_res_common_get_port_name_s {
2217 } sli4_res_common_get_port_name_t;
2220 * @brief COMMON_WRITE_FLASHROM
2222 typedef struct sli4_req_common_write_flashrom_s {
2224 #if BYTE_ORDER == LITTLE_ENDIAN
2225 uint32_t flash_rom_access_opcode;
2226 uint32_t flash_rom_access_operation_type;
2227 uint32_t data_buffer_size;
2229 uint8_t data_buffer[4];
2231 #error big endian version not defined
2233 } sli4_req_common_write_flashrom_t;
2235 #define SLI4_MGMT_FLASHROM_OPCODE_FLASH 0x01
2236 #define SLI4_MGMT_FLASHROM_OPCODE_SAVE 0x02
2237 #define SLI4_MGMT_FLASHROM_OPCODE_CLEAR 0x03
2238 #define SLI4_MGMT_FLASHROM_OPCODE_REPORT 0x04
2239 #define SLI4_MGMT_FLASHROM_OPCODE_IMAGE_INFO 0x05
2240 #define SLI4_MGMT_FLASHROM_OPCODE_IMAGE_CRC 0x06
2241 #define SLI4_MGMT_FLASHROM_OPCODE_OFFSET_BASED_FLASH 0x07
2242 #define SLI4_MGMT_FLASHROM_OPCODE_OFFSET_BASED_SAVE 0x08
2243 #define SLI4_MGMT_PHY_FLASHROM_OPCODE_FLASH 0x09
2244 #define SLI4_MGMT_PHY_FLASHROM_OPCODE_SAVE 0x0a
2246 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_ISCSI 0x00
2247 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_REDBOOT 0x01
2248 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_BIOS 0x02
2249 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_PXE_BIOS 0x03
2250 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_CODE_CONTROL 0x04
2251 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_IPSEC_CFG 0x05
2252 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_INIT_DATA 0x06
2253 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_ROM_OFFSET 0x07
2254 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_FCOE_BIOS 0x08
2255 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_ISCSI_BAK 0x09
2256 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_FCOE_ACT 0x0a
2257 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_FCOE_BAK 0x0b
2258 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_CODE_CTRL_P 0x0c
2259 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_NCSI 0x0d
2260 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_NIC 0x0e
2261 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_DCBX 0x0f
2262 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_PXE_BIOS_CFG 0x10
2263 #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_ALL_CFG_DATA 0x11
2266 * @brief COMMON_MANAGE_FAT
2268 typedef struct sli4_req_common_manage_fat_s {
2270 #if BYTE_ORDER == LITTLE_ENDIAN
2271 uint32_t fat_operation;
2272 uint32_t read_log_offset;
2273 uint32_t read_log_length;
2274 uint32_t data_buffer_size;
2275 uint32_t data_buffer; /* response only */
2277 #error big endian version not defined
2279 } sli4_req_common_manage_fat_t;
2282 * @brief COMMON_GET_EXT_FAT_CAPABILITIES
2284 typedef struct sli4_req_common_get_ext_fat_capabilities_s {
2286 #if BYTE_ORDER == LITTLE_ENDIAN
2287 uint32_t parameter_type;
2289 #error big endian version not defined
2291 } sli4_req_common_get_ext_fat_capabilities_t;
2294 * @brief COMMON_SET_EXT_FAT_CAPABILITIES
2296 typedef struct sli4_req_common_set_ext_fat_capabilities_s {
2298 #if BYTE_ORDER == LITTLE_ENDIAN
2299 uint32_t maximum_log_entries;
2300 uint32_t log_entry_size;
2301 uint32_t logging_type:8,
2302 maximum_logging_functions:8,
2303 maximum_logging_ports:8,
2305 uint32_t supported_modes;
2306 uint32_t number_modules;
2307 uint32_t debug_module[14];
2309 #error big endian version not defined
2311 } sli4_req_common_set_ext_fat_capabilities_t;
2314 * @brief COMMON_EXT_FAT_CONFIGURE_SNAPSHOT
2316 typedef struct sli4_req_common_ext_fat_configure_snapshot_s {
2318 #if BYTE_ORDER == LITTLE_ENDIAN
2319 uint32_t total_log_entries;
2321 #error big endian version not defined
2323 } sli4_req_common_ext_fat_configure_snapshot_t;
2326 * @brief COMMON_EXT_FAT_RETRIEVE_SNAPSHOT
2328 typedef struct sli4_req_common_ext_fat_retrieve_snapshot_s {
2330 #if BYTE_ORDER == LITTLE_ENDIAN
2331 uint32_t snapshot_mode;
2332 uint32_t start_index;
2333 uint32_t number_log_entries;
2335 #error big endian version not defined
2337 } sli4_req_common_ext_fat_retrieve_snapshot_t;
2339 typedef struct sli4_res_common_ext_fat_retrieve_snapshot_s {
2341 #if BYTE_ORDER == LITTLE_ENDIAN
2342 uint32_t number_log_entries;
2346 uint32_t trace_level;
2347 uint32_t module_mask[2];
2348 uint32_t trace_table_index;
2350 uint8_t string_data[16];
2353 #error big endian version not defined
2355 } sli4_res_common_ext_fat_retrieve_snapshot_t;
2358 * @brief COMMON_EXT_FAT_READ_STRING_TABLE
2360 typedef struct sli4_req_common_ext_fat_read_string_table_s {
2362 #if BYTE_ORDER == LITTLE_ENDIAN
2363 uint32_t byte_offset;
2364 uint32_t number_bytes;
2366 #error big endian version not defined
2368 } sli4_req_common_ext_fat_read_string_table_t;
2370 typedef struct sli4_res_common_ext_fat_read_string_table_s {
2372 #if BYTE_ORDER == LITTLE_ENDIAN
2373 uint32_t number_returned_bytes;
2374 uint32_t number_remaining_bytes;
2375 uint32_t table_data0:8,
2377 uint8_t table_data[0];
2379 #error big endian version not defined
2381 } sli4_res_common_ext_fat_read_string_table_t;
2384 * @brief COMMON_READ_TRANSCEIVER_DATA
2386 * This command reads SFF transceiver data(Format is defined
2387 * by the SFF-8472 specification).
2389 typedef struct sli4_req_common_read_transceiver_data_s {
2391 #if BYTE_ORDER == LITTLE_ENDIAN
2392 uint32_t page_number;
2395 #error big endian version not defined
2397 } sli4_req_common_read_transceiver_data_t;
2399 typedef struct sli4_res_common_read_transceiver_data_s {
2401 #if BYTE_ORDER == LITTLE_ENDIAN
2402 uint32_t page_number;
2404 uint32_t page_data[32];
2405 uint32_t page_data_2[32];
2407 #error big endian version not defined
2409 } sli4_res_common_read_transceiver_data_t;
2412 * @brief COMMON_READ_OBJECT
2414 typedef struct sli4_req_common_read_object_s {
2416 #if BYTE_ORDER == LITTLE_ENDIAN
2417 uint32_t desired_read_length:24,
2419 uint32_t read_offset;
2420 uint8_t object_name[104];
2421 uint32_t host_buffer_descriptor_count;
2422 sli4_bde_t host_buffer_descriptor[0];
2424 #error big endian version not defined
2426 } sli4_req_common_read_object_t;
2428 typedef struct sli4_res_common_read_object_s {
2430 #if BYTE_ORDER == LITTLE_ENDIAN
2431 uint32_t actual_read_length;
2435 #error big endian version not defined
2437 } sli4_res_common_read_object_t;
2440 * @brief COMMON_WRITE_OBJECT
2442 typedef struct sli4_req_common_write_object_s {
2444 #if BYTE_ORDER == LITTLE_ENDIAN
2445 uint32_t desired_write_length:24,
2449 uint32_t write_offset;
2450 uint8_t object_name[104];
2451 uint32_t host_buffer_descriptor_count;
2452 sli4_bde_t host_buffer_descriptor[0];
2454 #error big endian version not defined
2456 } sli4_req_common_write_object_t;
2458 typedef struct sli4_res_common_write_object_s {
2460 #if BYTE_ORDER == LITTLE_ENDIAN
2461 uint32_t actual_write_length;
2462 uint32_t change_status:8,
2465 #error big endian version not defined
2467 } sli4_res_common_write_object_t;
2470 * @brief COMMON_DELETE_OBJECT
2472 typedef struct sli4_req_common_delete_object_s {
2474 #if BYTE_ORDER == LITTLE_ENDIAN
2477 uint8_t object_name[104];
2479 #error big endian version not defined
2481 } sli4_req_common_delete_object_t;
2484 * @brief COMMON_READ_OBJECT_LIST
2486 typedef struct sli4_req_common_read_object_list_s {
2488 #if BYTE_ORDER == LITTLE_ENDIAN
2489 uint32_t desired_read_length:24,
2491 uint32_t read_offset;
2492 uint8_t object_name[104];
2493 uint32_t host_buffer_descriptor_count;
2494 sli4_bde_t host_buffer_descriptor[0];
2496 #error big endian version not defined
2498 } sli4_req_common_read_object_list_t;
2501 * @brief COMMON_SET_DUMP_LOCATION
2503 typedef struct sli4_req_common_set_dump_location_s {
2505 #if BYTE_ORDER == LITTLE_ENDIAN
2506 uint32_t buffer_length:24,
2511 uint32_t buf_addr_low;
2512 uint32_t buf_addr_high;
2514 #error big endian version not defined
2516 } sli4_req_common_set_dump_location_t;
2518 typedef struct sli4_res_common_set_dump_location_s {
2520 #if BYTE_ORDER == LITTLE_ENDIAN
2521 uint32_t buffer_length:24,
2524 #error big endian version not defined
2526 }sli4_res_common_set_dump_location_t;
2529 * @brief COMMON_SET_SET_FEATURES
2531 #define SLI4_SET_FEATURES_DIF_SEED 0x01
2532 #define SLI4_SET_FEATURES_XRI_TIMER 0x03
2533 #define SLI4_SET_FEATURES_MAX_PCIE_SPEED 0x04
2534 #define SLI4_SET_FEATURES_FCTL_CHECK 0x05
2535 #define SLI4_SET_FEATURES_FEC 0x06
2536 #define SLI4_SET_FEATURES_PCIE_RECV_DETECT 0x07
2537 #define SLI4_SET_FEATURES_DIF_MEMORY_MODE 0x08
2538 #define SLI4_SET_FEATURES_DISABLE_SLI_PORT_PAUSE_STATE 0x09
2539 #define SLI4_SET_FEATURES_ENABLE_PCIE_OPTIONS 0x0A
2540 #define SLI4_SET_FEATURES_SET_CONFIG_AUTO_XFER_RDY_T10PI 0x0C
2541 #define SLI4_SET_FEATURES_ENABLE_MULTI_RECEIVE_QUEUE 0x0D
2542 #define SLI4_SET_FEATURES_SET_FTD_XFER_HINT 0x0F
2543 #define SLI4_SET_FEATURES_SLI_PORT_HEALTH_CHECK 0x11
2544 #define SLI4_SET_FEATURES_PERSISTENT_TOPOLOGY 0x20
2546 typedef struct sli4_req_common_set_features_s {
2548 #if BYTE_ORDER == LITTLE_ENDIAN
2553 #error big endian version not defined
2555 } sli4_req_common_set_features_t;
2557 typedef struct sli4_req_common_set_features_dif_seed_s {
2558 #if BYTE_ORDER == LITTLE_ENDIAN
2562 #error big endian version not defined
2564 } sli4_req_common_set_features_dif_seed_t;
2566 typedef struct sli4_req_common_set_features_t10_pi_mem_model_s {
2567 #if BYTE_ORDER == LITTLE_ENDIAN
2571 #error big endian version not defined
2573 } sli4_req_common_set_features_t10_pi_mem_model_t;
2575 typedef struct sli4_req_common_set_features_multirq_s {
2576 #if BYTE_ORDER == LITTLE_ENDIAN
2577 uint32_t isr:1, /*<< Include Sequence Reporting */
2578 agxfe:1, /*<< Auto Generate XFER-RDY Feature Enabled */
2584 #error big endian version not defined
2586 } sli4_req_common_set_features_multirq_t;
2588 typedef struct sli4_req_common_set_features_xfer_rdy_t10pi_s {
2589 #if BYTE_ORDER == LITTLE_ENDIAN
2597 uint32_t app_tag:16,
2600 #error big endian version not defined
2602 } sli4_req_common_set_features_xfer_rdy_t10pi_t;
2604 typedef struct sli4_req_common_set_features_health_check_s {
2605 #if BYTE_ORDER == LITTLE_ENDIAN
2610 #error big endian version not defined
2612 } sli4_req_common_set_features_health_check_t;
2614 typedef struct sli4_req_common_set_features_set_fdt_xfer_hint_s {
2615 #if BYTE_ORDER == LITTLE_ENDIAN
2616 uint32_t fdt_xfer_hint;
2618 #error big endian version not defined
2620 } sli4_req_common_set_features_set_fdt_xfer_hint_t;
2622 typedef struct sli4_req_common_set_features_persistent_topo_param_s {
2623 #if BYTE_ORDER == LITTLE_ENDIAN
2624 uint32_t persistent_topo:2,
2628 #error big endian version not defined
2630 } sli4_req_common_set_features_persistent_topo_param_t;
2633 * @brief DMTF_EXEC_CLP_CMD
2635 typedef struct sli4_req_dmtf_exec_clp_cmd_s {
2637 #if BYTE_ORDER == LITTLE_ENDIAN
2638 uint32_t cmd_buf_length;
2639 uint32_t resp_buf_length;
2640 uint32_t cmd_buf_addr_low;
2641 uint32_t cmd_buf_addr_high;
2642 uint32_t resp_buf_addr_low;
2643 uint32_t resp_buf_addr_high;
2645 #error big endian version not defined
2647 } sli4_req_dmtf_exec_clp_cmd_t;
2649 typedef struct sli4_res_dmtf_exec_clp_cmd_s {
2651 #if BYTE_ORDER == LITTLE_ENDIAN
2653 uint32_t resp_length;
2658 uint32_t clp_status;
2659 uint32_t clp_detailed_status;
2661 #error big endian version not defined
2663 } sli4_res_dmtf_exec_clp_cmd_t;
2666 * @brief Resource descriptor
2669 #define SLI4_RESOURCE_DESCRIPTOR_TYPE_PCIE 0x50
2670 #define SLI4_RESOURCE_DESCRIPTOR_TYPE_NIC 0x51
2671 #define SLI4_RESOURCE_DESCRIPTOR_TYPE_ISCSI 0x52
2672 #define SLI4_RESOURCE_DESCRIPTOR_TYPE_FCFCOE 0x53
2673 #define SLI4_RESOURCE_DESCRIPTOR_TYPE_RDMA 0x54
2674 #define SLI4_RESOURCE_DESCRIPTOR_TYPE_PORT 0x55
2675 #define SLI4_RESOURCE_DESCRIPTOR_TYPE_ISAP 0x56
2677 #define SLI4_PROTOCOL_NIC_TOE 0x01
2678 #define SLI4_PROTOCOL_ISCSI 0x02
2679 #define SLI4_PROTOCOL_FCOE 0x04
2680 #define SLI4_PROTOCOL_NIC_TOE_RDMA 0x08
2681 #define SLI4_PROTOCOL_FC 0x10
2682 #define SLI4_PROTOCOL_DEFAULT 0xff
2684 typedef struct sli4_resource_descriptor_v1_s {
2685 uint32_t descriptor_type:8,
2686 descriptor_length:8,
2688 uint32_t type_specific[0];
2689 } sli4_resource_descriptor_v1_t;
2691 typedef struct sli4_pcie_resource_descriptor_v1_s {
2692 uint32_t descriptor_type:8,
2693 descriptor_length:8,
2701 uint32_t sriov_state:8,
2705 uint32_t number_of_vfs:16,
2707 uint32_t mission_roles:8,
2714 } sli4_pcie_resource_descriptor_v1_t;
2716 typedef struct sli4_isap_resource_descriptor_v1_s {
2717 uint32_t descriptor_type:8,
2718 descriptor_length:8,
2720 uint32_t iscsi_tgt:1,
2725 uint32_t fcoe_tgt:1,
2730 uint32_t mc_type0:8,
2735 } sli4_isap_resouce_descriptor_v1_t;
2738 * @brief COMMON_GET_FUNCTION_CONFIG
2740 typedef struct sli4_req_common_get_function_config_s {
2742 } sli4_req_common_get_function_config_t;
2744 typedef struct sli4_res_common_get_function_config_s {
2746 #if BYTE_ORDER == LITTLE_ENDIAN
2747 uint32_t desc_count;
2750 #error big endian version not defined
2752 } sli4_res_common_get_function_config_t;
2755 * @brief COMMON_GET_PROFILE_CONFIG
2757 typedef struct sli4_req_common_get_profile_config_s {
2759 uint32_t profile_id:8,
2762 } sli4_req_common_get_profile_config_t;
2764 typedef struct sli4_res_common_get_profile_config_s {
2766 #if BYTE_ORDER == LITTLE_ENDIAN
2767 uint32_t desc_count;
2770 #error big endian version not defined
2772 } sli4_res_common_get_profile_config_t;
2775 * @brief COMMON_SET_PROFILE_CONFIG
2777 typedef struct sli4_req_common_set_profile_config_s {
2779 uint32_t profile_id:8,
2782 uint32_t desc_count;
2784 } sli4_req_common_set_profile_config_t;
2786 typedef struct sli4_res_common_set_profile_config_s {
2788 #if BYTE_ORDER == LITTLE_ENDIAN
2790 #error big endian version not defined
2792 } sli4_res_common_set_profile_config_t;
2795 * @brief Profile Descriptor for profile functions
2797 typedef struct sli4_profile_descriptor_s {
2798 #if BYTE_ORDER == LITTLE_ENDIAN
2799 uint32_t profile_id:8,
2803 uint32_t profile_description[128];
2805 #error big endian version not defined
2807 } sli4_profile_descriptor_t;
2809 /* We don't know in advance how many descriptors there are. We have
2810 to pick a number that we think will be big enough and ask for that
2813 #define MAX_PRODUCT_DESCRIPTORS 40
2816 * @brief COMMON_GET_PROFILE_LIST
2818 typedef struct sli4_req_common_get_profile_list_s {
2820 #if BYTE_ORDER == LITTLE_ENDIAN
2821 uint32_t start_profile_index:8,
2824 #error big endian version not defined
2826 } sli4_req_common_get_profile_list_t;
2828 typedef struct sli4_res_common_get_profile_list_s {
2830 #if BYTE_ORDER == LITTLE_ENDIAN
2831 uint32_t profile_descriptor_count;
2832 sli4_profile_descriptor_t profile_descriptor[MAX_PRODUCT_DESCRIPTORS];
2834 #error big endian version not defined
2836 } sli4_res_common_get_profile_list_t;
2839 * @brief COMMON_GET_ACTIVE_PROFILE
2841 typedef struct sli4_req_common_get_active_profile_s {
2843 } sli4_req_common_get_active_profile_t;
2845 typedef struct sli4_res_common_get_active_profile_s {
2847 #if BYTE_ORDER == LITTLE_ENDIAN
2848 uint32_t active_profile_id:8,
2853 #error big endian version not defined
2855 } sli4_res_common_get_active_profile_t;
2858 * @brief COMMON_SET_ACTIVE_PROFILE
2860 typedef struct sli4_req_common_set_active_profile_s {
2862 #if BYTE_ORDER == LITTLE_ENDIAN
2863 uint32_t active_profile_id:8,
2867 #error big endian version not defined
2869 } sli4_req_common_set_active_profile_t;
2871 typedef struct sli4_res_common_set_active_profile_s {
2873 } sli4_res_common_set_active_profile_t;
2876 * @brief Link Config Descriptor for link config functions
2878 typedef struct sli4_link_config_descriptor_s {
2879 #if BYTE_ORDER == LITTLE_ENDIAN
2880 uint32_t link_config_id:8,
2882 uint32_t config_description[8];
2884 #error big endian version not defined
2886 } sli4_link_config_descriptor_t;
2888 #define MAX_LINK_CONFIG_DESCRIPTORS 10
2891 * @brief COMMON_GET_RECONFIG_LINK_INFO
2893 typedef struct sli4_req_common_get_reconfig_link_info_s {
2895 #if BYTE_ORDER == LITTLE_ENDIAN
2897 #error big endian version not defined
2899 } sli4_req_common_get_reconfig_link_info_t;
2901 typedef struct sli4_res_common_get_reconfig_link_info_s {
2903 #if BYTE_ORDER == LITTLE_ENDIAN
2904 uint32_t active_link_config_id:8,
2906 next_link_config_id:8,
2908 uint32_t link_configuration_descriptor_count;
2909 sli4_link_config_descriptor_t desc[MAX_LINK_CONFIG_DESCRIPTORS];
2911 #error big endian version not defined
2913 } sli4_res_common_get_reconfig_link_info_t;
2916 * @brief COMMON_SET_RECONFIG_LINK_ID
2918 typedef struct sli4_req_common_set_reconfig_link_id_s {
2920 #if BYTE_ORDER == LITTLE_ENDIAN
2921 uint32_t next_link_config_id:8,
2925 #error big endian version not defined
2927 } sli4_req_common_set_reconfig_link_id_t;
2929 typedef struct sli4_res_common_set_reconfig_link_id_s {
2931 #if BYTE_ORDER == LITTLE_ENDIAN
2933 #error big endian version not defined
2935 } sli4_res_common_set_reconfig_link_id_t;
2937 typedef struct sli4_req_lowlevel_set_watchdog_s {
2939 #if BYTE_ORDER == LITTLE_ENDIAN
2940 uint32_t watchdog_timeout:16,
2943 #error big endian version not defined
2946 } sli4_req_lowlevel_set_watchdog_t;
2948 typedef struct sli4_res_lowlevel_set_watchdog_s {
2950 #if BYTE_ORDER == LITTLE_ENDIAN
2953 #error big endian version not defined
2955 } sli4_res_lowlevel_set_watchdog_t;
2958 * @brief Event Queue Entry
2960 typedef struct sli4_eqe_s {
2961 #if BYTE_ORDER == LITTLE_ENDIAN
2962 uint32_t vld:1, /** valid */
2967 #error big endian version not defined
2971 #define SLI4_MAJOR_CODE_STANDARD 0
2972 #define SLI4_MAJOR_CODE_SENTINEL 1
2975 * @brief Mailbox Completion Queue Entry
2977 * A CQE generated on the completion of a MQE from a MQ.
2979 typedef struct sli4_mcqe_s {
2980 #if BYTE_ORDER == LITTLE_ENDIAN
2981 uint32_t completion_status:16, /** values are protocol specific */
2983 uint32_t mqe_tag_low;
2984 uint32_t mqe_tag_high;
2986 con:1, /** consumed - command now being executed */
2987 cmp:1, /** completed - command still executing if clear */
2989 ae:1, /** async event - this is an ACQE */
2990 val:1; /** valid - contents of CQE are valid */
2992 #error big endian version not defined
2997 * @brief Asynchronous Completion Queue Entry
2999 * A CQE generated asynchronously in response to the link or other internal events.
3001 typedef struct sli4_acqe_s {
3002 #if BYTE_ORDER == LITTLE_ENDIAN
3003 uint32_t event_data[3];
3006 event_type:8, /** values are protocol specific */
3008 ae:1, /** async event - this is an ACQE */
3009 val:1; /** valid - contents of CQE are valid */
3011 #error big endian version not defined
3015 #define SLI4_ACQE_EVENT_CODE_LINK_STATE 0x01
3016 #define SLI4_ACQE_EVENT_CODE_FCOE_FIP 0x02
3017 #define SLI4_ACQE_EVENT_CODE_DCBX 0x03
3018 #define SLI4_ACQE_EVENT_CODE_ISCSI 0x04
3019 #define SLI4_ACQE_EVENT_CODE_GRP_5 0x05
3020 #define SLI4_ACQE_EVENT_CODE_FC_LINK_EVENT 0x10
3021 #define SLI4_ACQE_EVENT_CODE_SLI_PORT_EVENT 0x11
3022 #define SLI4_ACQE_EVENT_CODE_VF_EVENT 0x12
3023 #define SLI4_ACQE_EVENT_CODE_MR_EVENT 0x13
3026 * @brief Register name enums
3030 SLI4_REG_EQ_DOORBELL,
3031 SLI4_REG_CQ_DOORBELL,
3032 SLI4_REG_FCOE_RQ_DOORBELL,
3033 SLI4_REG_IO_WQ_DOORBELL,
3034 SLI4_REG_MQ_DOORBELL,
3035 SLI4_REG_PHYSDEV_CONTROL,
3036 SLI4_REG_SLIPORT_CONTROL,
3037 SLI4_REG_SLIPORT_ERROR1,
3038 SLI4_REG_SLIPORT_ERROR2,
3039 SLI4_REG_SLIPORT_SEMAPHORE,
3040 SLI4_REG_SLIPORT_STATUS,
3041 SLI4_REG_UERR_MASK_HI,
3042 SLI4_REG_UERR_MASK_LO,
3043 SLI4_REG_UERR_STATUS_HI,
3044 SLI4_REG_UERR_STATUS_LO,
3045 SLI4_REG_SW_UE_CSR1,
3046 SLI4_REG_SW_UE_CSR2,
3047 SLI4_REG_MAX /* must be last */
3050 typedef struct sli4_reg_s {
3061 SLI_QTYPE_MAX, /* must be last */
3064 #define SLI_USER_MQ_COUNT 1 /** User specified max mail queues */
3065 #define SLI_MAX_CQ_SET_COUNT 16
3066 #define SLI_MAX_RQ_SET_COUNT 16
3073 SLI_QENTRY_WQ_RELEASE,
3074 SLI_QENTRY_OPT_WRITE_CMD,
3075 SLI_QENTRY_OPT_WRITE_DATA,
3077 SLI_QENTRY_MAX /* must be last */
3080 typedef struct sli4_queue_s {
3081 /* Common to all queue types */
3084 uint32_t index; /** current host entry index */
3085 uint16_t size; /** entry size */
3086 uint16_t length; /** number of entries */
3087 uint16_t n_posted; /** number entries posted */
3088 uint16_t id; /** Port assigned xQ_ID */
3089 uint16_t ulp; /** ULP assigned to this queue */
3090 uint32_t doorbell_offset;/** The offset for the doorbell */
3091 uint16_t doorbell_rset; /** register set for the doorbell */
3092 uint8_t type; /** queue type ie EQ, CQ, ... */
3093 uint32_t proc_limit; /** limit number of CQE processed per iteration */
3094 uint32_t posted_limit; /** number of CQE/EQE to process before ringing doorbell */
3095 uint32_t max_num_processed;
3096 time_t max_process_time;
3098 uint16_t phase; /** For if_type = 6, this value toggle for each iteration
3099 of the queue, a queue entry is valid when a cqe valid
3100 bit matches this value */
3101 /* Type specific gunk */
3103 uint32_t r_idx; /** "read" index (MQ only) */
3105 uint32_t is_mq:1,/** CQ contains MQ/Async completions */
3106 is_hdr:1,/** is a RQ for packet headers */
3107 rq_batch:1;/** RQ index incremented by 8 */
3113 sli_queue_lock(sli4_queue_t *q)
3119 sli_queue_unlock(sli4_queue_t *q)
3121 ocs_unlock(&q->lock);
3124 #define SLI4_QUEUE_DEFAULT_CQ UINT16_MAX /** Use the default CQ */
3126 #define SLI4_QUEUE_RQ_BATCH 8
3131 SLI4_CB_MAX /* must be last */
3136 SLI_LINK_STATUS_DOWN,
3137 SLI_LINK_STATUS_NO_ALPA,
3138 SLI_LINK_STATUS_MAX,
3139 } sli4_link_status_e;
3142 SLI_LINK_TOPO_NPORT = 1, /** fabric or point-to-point */
3144 SLI_LINK_TOPO_LOOPBACK_INTERNAL,
3145 SLI_LINK_TOPO_LOOPBACK_EXTERNAL,
3148 } sli4_link_topology_e;
3150 /* TODO do we need both sli4_port_type_e & sli4_link_medium_e */
3152 SLI_LINK_MEDIUM_ETHERNET,
3154 SLI_LINK_MEDIUM_MAX,
3155 } sli4_link_medium_e;
3157 typedef struct sli4_link_event_s {
3158 sli4_link_status_e status; /* link up/down */
3159 sli4_link_topology_e topology;
3160 sli4_link_medium_e medium; /* Ethernet / FC */
3161 uint32_t speed; /* Mbps */
3164 } sli4_link_event_t;
3167 * @brief Fields retrieved from skyhawk that used used to build chained SGL
3169 typedef struct sli4_sgl_chaining_params_s {
3170 uint8_t chaining_capable;
3171 uint16_t frag_num_field_offset;
3172 uint16_t sgl_index_field_offset;
3173 uint64_t frag_num_field_mask;
3174 uint64_t sgl_index_field_mask;
3175 uint32_t chain_sge_initial_value_lo;
3176 uint32_t chain_sge_initial_value_hi;
3177 } sli4_sgl_chaining_params_t;
3179 typedef struct sli4_fip_event_s {
3181 uint32_t index; /* FCF index or UINT32_MAX if invalid */
3190 SLI_RSRC_MAX /* must be last */
3196 SLI4_PORT_TYPE_MAX /* must be last */
3200 SLI4_ASIC_TYPE_BE3 = 1,
3201 SLI4_ASIC_TYPE_SKYHAWK,
3202 SLI4_ASIC_TYPE_LANCER,
3203 SLI4_ASIC_TYPE_CORSAIR,
3204 SLI4_ASIC_TYPE_LANCERG6,
3205 SLI4_ASIC_TYPE_LANCERG7
3209 SLI4_ASIC_REV_FPGA = 1,
3220 typedef struct sli4_s {
3222 sli4_port_type_e port_type;
3224 uint32_t sli_rev; /* SLI revision number */
3225 uint32_t sli_family;
3226 uint32_t if_type; /* SLI Interface type */
3228 sli4_asic_type_e asic_type; /*<< ASIC type */
3229 sli4_asic_rev_e asic_rev; /*<< ASIC revision */
3230 uint32_t physical_port;
3235 uint16_t max_qcount[SLI_QTYPE_MAX];
3236 uint32_t max_qentries[SLI_QTYPE_MAX];
3237 uint16_t count_mask[SLI_QTYPE_MAX];
3238 uint16_t count_method[SLI_QTYPE_MAX];
3239 uint32_t qpage_count[SLI_QTYPE_MAX];
3240 uint16_t link_module_type;
3242 uint16_t rq_min_buf_size;
3243 uint32_t rq_max_buf_size;
3252 uint8_t fw_name[2][16];
3255 uint8_t port_number;
3257 char bios_version_string[32];
3258 uint8_t dual_ulp_capable;
3259 uint8_t is_ulp_fc[2];
3261 * Tracks the port resources using extents metaphor. For
3262 * devices that don't implement extents (i.e.
3263 * has_extents == FALSE), the code models each resource as
3264 * a single large extent.
3267 uint32_t number; /* number of extents */
3268 uint32_t size; /* number of elements in each extent */
3269 uint32_t n_alloc;/* number of elements allocated */
3271 ocs_bitmap_t *use_map;/* bitmap showing resources in use */
3272 uint32_t map_size;/* number of bits in bitmap */
3273 } extent[SLI_RSRC_MAX];
3274 sli4_features_t features;
3275 uint32_t has_extents:1,
3280 perf_wq_id_association:1,
3281 cq_create_version:2,
3282 mq_create_version:2,
3284 sgl_pre_registered:1,
3285 sgl_pre_registration_required:1,
3286 t10_dif_inline_capable:1,
3287 t10_dif_separate_capable:1;
3288 uint32_t sge_supported_length;
3289 uint32_t sgl_page_sizes;
3290 uint32_t max_sgl_pages;
3291 sli4_sgl_chaining_params_t sgl_chaining_params;
3296 * Callback functions
3298 int32_t (*link)(void *, void *);
3300 int32_t (*fip)(void *, void *);
3304 #if defined(OCS_INCLUDE_DEBUG)
3305 /* Save pointer to physical memory descriptor for non-embedded SLI_CONFIG
3306 * commands for BMBX dumping purposes */
3307 ocs_dma_t *bmbx_non_emb_pmd;
3317 * Get / set parameter functions
3319 static inline uint32_t
3320 sli_get_max_rsrc(sli4_t *sli4, sli4_resource_e rsrc)
3322 if (rsrc >= SLI_RSRC_MAX) {
3326 return sli4->config.extent[rsrc].size;
3329 static inline uint32_t
3330 sli_get_max_queue(sli4_t *sli4, sli4_qtype_e qtype)
3332 if (qtype >= SLI_QTYPE_MAX) {
3335 return sli4->config.max_qcount[qtype];
3338 static inline uint32_t
3339 sli_get_max_qentries(sli4_t *sli4, sli4_qtype_e qtype)
3342 return sli4->config.max_qentries[qtype];
3345 static inline uint32_t
3346 sli_get_max_sge(sli4_t *sli4)
3348 return sli4->config.sge_supported_length;
3351 static inline uint32_t
3352 sli_get_max_sgl(sli4_t *sli4)
3355 if (sli4->config.sgl_page_sizes != 1) {
3356 ocs_log_test(sli4->os, "unsupported SGL page sizes %#x\n",
3357 sli4->config.sgl_page_sizes);
3361 return ((sli4->config.max_sgl_pages * SLI_PAGE_SIZE) / sizeof(sli4_sge_t));
3364 static inline sli4_link_medium_e
3365 sli_get_medium(sli4_t *sli4)
3367 switch (sli4->config.topology) {
3368 case SLI4_READ_CFG_TOPO_FCOE:
3369 return SLI_LINK_MEDIUM_ETHERNET;
3370 case SLI4_READ_CFG_TOPO_FC:
3371 case SLI4_READ_CFG_TOPO_FC_DA:
3372 case SLI4_READ_CFG_TOPO_FC_AL:
3373 return SLI_LINK_MEDIUM_FC;
3375 return SLI_LINK_MEDIUM_MAX;
3380 sli_skh_chain_sge_build(sli4_t *sli4, sli4_sge_t *sge, uint32_t xri_index, uint32_t frag_num, uint32_t offset)
3382 sli4_sgl_chaining_params_t *cparms = &sli4->config.sgl_chaining_params;
3384 ocs_memset(sge, 0, sizeof(*sge));
3385 sge->sge_type = SLI4_SGE_TYPE_CHAIN;
3386 sge->buffer_address_high = (uint32_t)cparms->chain_sge_initial_value_hi;
3387 sge->buffer_address_low =
3388 (uint32_t)((cparms->chain_sge_initial_value_lo |
3389 (((uintptr_t)(xri_index & cparms->sgl_index_field_mask)) <<
3390 cparms->sgl_index_field_offset) |
3391 (((uintptr_t)(frag_num & cparms->frag_num_field_mask)) <<
3392 cparms->frag_num_field_offset) |
3396 static inline uint32_t
3397 sli_get_sli_rev(sli4_t *sli4)
3399 return sli4->sli_rev;
3402 static inline uint32_t
3403 sli_get_sli_family(sli4_t *sli4)
3405 return sli4->sli_family;
3408 static inline uint32_t
3409 sli_get_if_type(sli4_t *sli4)
3411 return sli4->if_type;
3414 static inline void *
3415 sli_get_wwn_port(sli4_t *sli4)
3417 return sli4->config.wwpn;
3420 static inline void *
3421 sli_get_wwn_node(sli4_t *sli4)
3423 return sli4->config.wwnn;
3426 static inline void *
3427 sli_get_vpd(sli4_t *sli4)
3429 return sli4->vpd.data.virt;
3432 static inline uint32_t
3433 sli_get_vpd_len(sli4_t *sli4)
3435 return sli4->vpd.length;
3438 static inline uint32_t
3439 sli_get_fw_revision(sli4_t *sli4, uint32_t which)
3441 return sli4->config.fw_rev[which];
3444 static inline void *
3445 sli_get_fw_name(sli4_t *sli4, uint32_t which)
3447 return sli4->config.fw_name[which];
3450 static inline char *
3451 sli_get_ipl_name(sli4_t *sli4)
3453 return sli4->config.ipl_name;
3456 static inline uint32_t
3457 sli_get_hw_revision(sli4_t *sli4, uint32_t which)
3459 return sli4->config.hw_rev[which];
3462 static inline uint32_t
3463 sli_get_auto_xfer_rdy_capable(sli4_t *sli4)
3465 return sli4->config.auto_xfer_rdy;
3468 static inline uint32_t
3469 sli_get_dif_capable(sli4_t *sli4)
3471 return sli4->config.features.flag.dif;
3474 static inline uint32_t
3475 sli_is_dif_inline_capable(sli4_t *sli4)
3477 return sli_get_dif_capable(sli4) && sli4->config.t10_dif_inline_capable;
3480 static inline uint32_t
3481 sli_is_dif_separate_capable(sli4_t *sli4)
3483 return sli_get_dif_capable(sli4) && sli4->config.t10_dif_separate_capable;
3486 static inline uint32_t
3487 sli_get_is_dual_ulp_capable(sli4_t *sli4)
3489 return sli4->config.dual_ulp_capable;
3492 static inline uint32_t
3493 sli_get_is_sgl_chaining_capable(sli4_t *sli4)
3495 return sli4->config.sgl_chaining_params.chaining_capable;
3498 static inline uint32_t
3499 sli_get_is_ulp_enabled(sli4_t *sli4, uint16_t ulp)
3501 return sli4->config.is_ulp_fc[ulp];
3504 static inline uint32_t
3505 sli_get_hlm_capable(sli4_t *sli4)
3507 return sli4->config.features.flag.hlm;
3510 static inline int32_t
3511 sli_set_hlm(sli4_t *sli4, uint32_t value)
3513 if (value && !sli4->config.features.flag.hlm) {
3514 ocs_log_test(sli4->os, "HLM not supported\n");
3518 sli4->config.high_login_mode = value != 0 ? TRUE : FALSE;
3523 static inline uint32_t
3524 sli_get_hlm(sli4_t *sli4)
3526 return sli4->config.high_login_mode;
3529 static inline uint32_t
3530 sli_get_sgl_preregister_required(sli4_t *sli4)
3532 return sli4->config.sgl_pre_registration_required;
3535 static inline uint32_t
3536 sli_get_sgl_preregister(sli4_t *sli4)
3538 return sli4->config.sgl_pre_registered;
3541 static inline int32_t
3542 sli_set_sgl_preregister(sli4_t *sli4, uint32_t value)
3544 if ((value == 0) && sli4->config.sgl_pre_registration_required) {
3545 ocs_log_test(sli4->os, "SGL pre-registration required\n");
3549 sli4->config.sgl_pre_registered = value != 0 ? TRUE : FALSE;
3554 static inline sli4_asic_type_e
3555 sli_get_asic_type(sli4_t *sli4)
3557 return sli4->asic_type;
3560 static inline sli4_asic_rev_e
3561 sli_get_asic_rev(sli4_t *sli4)
3563 return sli4->asic_rev;
3566 static inline int32_t
3567 sli_set_topology(sli4_t *sli4, uint32_t value)
3572 case SLI4_READ_CFG_TOPO_FCOE:
3573 case SLI4_READ_CFG_TOPO_FC:
3574 case SLI4_READ_CFG_TOPO_FC_DA:
3575 case SLI4_READ_CFG_TOPO_FC_AL:
3576 sli4->config.topology = value;
3579 ocs_log_test(sli4->os, "unsupported topology %#x\n", value);
3587 sli_config_persistent_topology(sli4_t *sli4, sli4_req_common_set_features_persistent_topo_param_t *req)
3589 sli4->config.pt = req->persistent_topo;
3590 sli4->config.tf = req->topo_failover;
3593 static inline uint16_t
3594 sli_get_link_module_type(sli4_t *sli4)
3596 return sli4->config.link_module_type;
3599 static inline char *
3600 sli_get_portnum(sli4_t *sli4)
3602 return sli4->config.port_name;
3605 static inline char *
3606 sli_get_bios_version_string(sli4_t *sli4)
3608 return sli4->config.bios_version_string;
3611 static inline uint32_t
3612 sli_convert_mask_to_count(uint32_t method, uint32_t mask)
3617 count = 1 << ocs_lg2(mask);
3627 sli_fcal_is_speed_supported(uint32_t link_speed)
3629 if ((link_speed == FC_LINK_SPEED_16G) ||
3630 (link_speed == FC_LINK_SPEED_32G) ||
3631 (link_speed >= FC_LINK_SPEED_AUTO_32_16)) {
3632 ocs_log_err(NULL, "unsupported FC-AL speed (speed_code: %d)\n", link_speed);
3640 * @brief Common Create Queue function prototype
3642 typedef int32_t (*sli4_create_q_fn_t)(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t);
3645 * @brief Common Destroy Queue function prototype
3647 typedef int32_t (*sli4_destroy_q_fn_t)(sli4_t *, void *, size_t, uint16_t);
3649 /****************************************************************************
3650 * Function prototypes
3652 extern int32_t sli_cmd_config_auto_xfer_rdy(sli4_t *, void *, size_t, uint32_t);
3653 extern int32_t sli_cmd_config_auto_xfer_rdy_hp(sli4_t *, void *, size_t, uint32_t, uint32_t, uint32_t);
3654 extern int32_t sli_cmd_config_link(sli4_t *, void *, size_t);
3655 extern int32_t sli_cmd_down_link(sli4_t *, void *, size_t);
3656 extern int32_t sli_cmd_dump_type4(sli4_t *, void *, size_t, uint16_t);
3657 extern int32_t sli_cmd_common_read_transceiver_data(sli4_t *, void *, size_t, uint32_t, ocs_dma_t *);
3658 extern int32_t sli_cmd_read_link_stats(sli4_t *, void *, size_t,uint8_t, uint8_t, uint8_t);
3659 extern int32_t sli_cmd_read_status(sli4_t *sli4, void *buf, size_t size, uint8_t clear_counters);
3660 extern int32_t sli_cmd_init_link(sli4_t *, void *, size_t, uint32_t, uint8_t);
3661 extern int32_t sli_cmd_init_vfi(sli4_t *, void *, size_t, uint16_t, uint16_t, uint16_t);
3662 extern int32_t sli_cmd_init_vpi(sli4_t *, void *, size_t, uint16_t, uint16_t);
3663 extern int32_t sli_cmd_post_xri(sli4_t *, void *, size_t, uint16_t, uint16_t);
3664 extern int32_t sli_cmd_release_xri(sli4_t *, void *, size_t, uint8_t);
3665 extern int32_t sli_cmd_read_sparm64(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t);
3666 extern int32_t sli_cmd_read_topology(sli4_t *, void *, size_t, ocs_dma_t *);
3667 extern int32_t sli_cmd_read_nvparms(sli4_t *, void *, size_t);
3668 extern int32_t sli_cmd_write_nvparms(sli4_t *, void *, size_t, uint8_t *, uint8_t *, uint8_t, uint32_t);
3672 uint8_t r_ctl_match;
3675 } sli4_cmd_rq_cfg_t;
3676 extern int32_t sli_cmd_reg_fcfi(sli4_t *, void *, size_t, uint16_t,
3677 sli4_cmd_rq_cfg_t rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG], uint16_t);
3678 extern int32_t sli_cmd_reg_fcfi_mrq(sli4_t *, void *, size_t, uint8_t, uint16_t, uint16_t, uint8_t, uint8_t , uint16_t, sli4_cmd_rq_cfg_t *);
3680 extern int32_t sli_cmd_reg_rpi(sli4_t *, void *, size_t, uint32_t, uint16_t, uint16_t, ocs_dma_t *, uint8_t, uint8_t);
3681 extern int32_t sli_cmd_reg_vfi(sli4_t *, void *, size_t, ocs_domain_t *);
3682 extern int32_t sli_cmd_reg_vpi(sli4_t *, void *, size_t, ocs_sli_port_t *, uint8_t);
3683 extern int32_t sli_cmd_sli_config(sli4_t *, void *, size_t, uint32_t, ocs_dma_t *);
3684 extern int32_t sli_cmd_unreg_fcfi(sli4_t *, void *, size_t, uint16_t);
3685 extern int32_t sli_cmd_unreg_rpi(sli4_t *, void *, size_t, uint16_t, sli4_resource_e, uint32_t);
3686 extern int32_t sli_cmd_unreg_vfi(sli4_t *, void *, size_t, ocs_domain_t *, uint32_t);
3687 extern int32_t sli_cmd_unreg_vpi(sli4_t *, void *, size_t, uint16_t, uint32_t);
3688 extern int32_t sli_cmd_common_nop(sli4_t *, void *, size_t, uint64_t);
3689 extern int32_t sli_cmd_common_get_resource_extent_info(sli4_t *, void *, size_t, uint16_t);
3690 extern int32_t sli_cmd_common_get_sli4_parameters(sli4_t *, void *, size_t);
3691 extern int32_t sli_cmd_common_write_object(sli4_t *, void *, size_t,
3692 uint16_t, uint16_t, uint32_t, uint32_t, char *, ocs_dma_t *);
3693 extern int32_t sli_cmd_common_delete_object(sli4_t *, void *, size_t, char *);
3694 extern int32_t sli_cmd_common_read_object(sli4_t *, void *, size_t, uint32_t,
3695 uint32_t, char *, ocs_dma_t *);
3696 extern int32_t sli_cmd_dmtf_exec_clp_cmd(sli4_t *sli4, void *buf, size_t size,
3699 extern int32_t sli_cmd_common_set_dump_location(sli4_t *sli4, void *buf, size_t size,
3700 uint8_t query, uint8_t is_buffer_list,
3701 ocs_dma_t *buffer, uint8_t fdb);
3702 extern int32_t sli_cmd_common_set_features(sli4_t *, void *, size_t, uint32_t, uint32_t, void*);
3703 extern int32_t sli_cmd_common_get_profile_list(sli4_t *sli4, void *buf,
3704 size_t size, uint32_t start_profile_index, ocs_dma_t *dma);
3705 extern int32_t sli_cmd_common_get_active_profile(sli4_t *sli4, void *buf,
3707 extern int32_t sli_cmd_common_set_active_profile(sli4_t *sli4, void *buf,
3710 uint32_t active_profile_id);
3711 extern int32_t sli_cmd_common_get_reconfig_link_info(sli4_t *sli4, void *buf,
3712 size_t size, ocs_dma_t *dma);
3713 extern int32_t sli_cmd_common_set_reconfig_link_id(sli4_t *sli4, void *buf,
3714 size_t size, ocs_dma_t *dma,
3715 uint32_t fd, uint32_t active_link_config_id);
3716 extern int32_t sli_cmd_common_get_function_config(sli4_t *sli4, void *buf,
3718 extern int32_t sli_cmd_common_get_profile_config(sli4_t *sli4, void *buf,
3719 size_t size, ocs_dma_t *dma);
3720 extern int32_t sli_cmd_common_set_profile_config(sli4_t *sli4, void *buf,
3721 size_t size, ocs_dma_t *dma,
3722 uint8_t profile_id, uint32_t descriptor_count,
3725 extern int32_t sli_cqe_mq(void *);
3726 extern int32_t sli_cqe_async(sli4_t *, void *);
3728 extern int32_t sli_setup(sli4_t *, ocs_os_handle_t, sli4_port_type_e);
3729 extern void sli_calc_max_qentries(sli4_t *sli4);
3730 extern int32_t sli_init(sli4_t *);
3731 extern int32_t sli_reset(sli4_t *);
3732 extern int32_t sli_fw_reset(sli4_t *);
3733 extern int32_t sli_teardown(sli4_t *);
3734 extern int32_t sli_callback(sli4_t *, sli4_callback_e, void *, void *);
3735 extern int32_t sli_bmbx_command(sli4_t *);
3736 extern int32_t __sli_queue_init(sli4_t *, sli4_queue_t *, uint32_t, size_t, uint32_t, uint32_t);
3737 extern int32_t __sli_create_queue(sli4_t *, sli4_queue_t *);
3738 extern int32_t sli_eq_modify_delay(sli4_t *sli4, sli4_queue_t *eq, uint32_t num_eq, uint32_t shift, uint32_t delay_mult);
3739 extern int32_t sli_queue_alloc(sli4_t *, uint32_t, sli4_queue_t *, uint32_t, sli4_queue_t *, uint16_t);
3740 extern int32_t sli_cq_alloc_set(sli4_t *, sli4_queue_t *qs[], uint32_t, uint32_t, sli4_queue_t *eqs[]);
3741 extern int32_t sli_get_queue_entry_size(sli4_t *, uint32_t);
3742 extern int32_t sli_queue_free(sli4_t *, sli4_queue_t *, uint32_t, uint32_t);
3743 extern int32_t sli_queue_reset(sli4_t *, sli4_queue_t *);
3744 extern int32_t sli_queue_is_empty(sli4_t *, sli4_queue_t *);
3745 extern int32_t sli_queue_eq_arm(sli4_t *, sli4_queue_t *, uint8_t);
3746 extern int32_t sli_queue_arm(sli4_t *, sli4_queue_t *, uint8_t);
3747 extern int32_t _sli_queue_write(sli4_t *, sli4_queue_t *, uint8_t *);
3748 extern int32_t sli_queue_write(sli4_t *, sli4_queue_t *, uint8_t *);
3749 extern int32_t sli_queue_read(sli4_t *, sli4_queue_t *, uint8_t *);
3750 extern int32_t sli_queue_index(sli4_t *, sli4_queue_t *);
3751 extern int32_t _sli_queue_poke(sli4_t *, sli4_queue_t *, uint32_t, uint8_t *);
3752 extern int32_t sli_queue_poke(sli4_t *, sli4_queue_t *, uint32_t, uint8_t *);
3753 extern int32_t sli_resource_alloc(sli4_t *, sli4_resource_e, uint32_t *, uint32_t *);
3754 extern int32_t sli_resource_free(sli4_t *, sli4_resource_e, uint32_t);
3755 extern int32_t sli_resource_reset(sli4_t *, sli4_resource_e);
3756 extern int32_t sli_eq_parse(sli4_t *, uint8_t *, uint16_t *);
3757 extern int32_t sli_cq_parse(sli4_t *, sli4_queue_t *, uint8_t *, sli4_qentry_e *, uint16_t *);
3759 extern int32_t sli_raise_ue(sli4_t *, uint8_t);
3760 extern int32_t sli_dump_is_ready(sli4_t *);
3761 extern int32_t sli_dump_is_present(sli4_t *);
3762 extern int32_t sli_reset_required(sli4_t *);
3763 extern int32_t sli_fw_error_status(sli4_t *);
3764 extern int32_t sli_fw_ready(sli4_t *);
3765 extern uint32_t sli_reg_read(sli4_t *, sli4_regname_e);
3766 extern void sli_reg_write(sli4_t *, sli4_regname_e, uint32_t);
3767 extern int32_t sli_link_is_configurable(sli4_t *);
3769 #include "ocs_fcp.h"
3772 * @brief Maximum value for a FCFI
3774 * Note that although most commands provide a 16 bit field for the FCFI,
3775 * the FC/FCoE Asynchronous Recived CQE format only provides 6 bits for
3776 * the returned FCFI. Then effectively, the FCFI cannot be larger than
3779 #define SLI4_MAX_FCFI 64
3782 * @brief Maximum value for FCF index
3784 * The SLI-4 specification uses a 16 bit field in most places for the FCF
3785 * index, but practically, this value will be much smaller. Arbitrarily
3786 * limit the max FCF index to match the max FCFI value.
3788 #define SLI4_MAX_FCF_INDEX SLI4_MAX_FCFI
3790 /*************************************************************************
3791 * SLI-4 FC/FCoE mailbox command formats and definitions.
3795 * FC/FCoE opcode (OPC) values.
3797 #define SLI4_OPC_FCOE_WQ_CREATE 0x1
3798 #define SLI4_OPC_FCOE_WQ_DESTROY 0x2
3799 #define SLI4_OPC_FCOE_POST_SGL_PAGES 0x3
3800 #define SLI4_OPC_FCOE_RQ_CREATE 0x5
3801 #define SLI4_OPC_FCOE_RQ_DESTROY 0x6
3802 #define SLI4_OPC_FCOE_READ_FCF_TABLE 0x8
3803 #define SLI4_OPC_FCOE_POST_HDR_TEMPLATES 0xb
3804 #define SLI4_OPC_FCOE_REDISCOVER_FCF 0x10
3806 /* Use the default CQ associated with the WQ */
3807 #define SLI4_CQ_DEFAULT 0xffff
3809 typedef struct sli4_physical_page_descriptor_s {
3812 } sli4_physical_page_descriptor_t;
3815 * @brief FCOE_WQ_CREATE
3817 * Create a Work Queue for FC/FCoE use.
3819 #define SLI4_FCOE_WQ_CREATE_V0_MAX_PAGES 4
3821 typedef struct sli4_req_fcoe_wq_create_s {
3823 #if BYTE_ORDER == LITTLE_ENDIAN
3824 uint32_t num_pages:8,
3828 sli4_physical_page_descriptor_t page_physical_address[SLI4_FCOE_WQ_CREATE_V0_MAX_PAGES];
3834 #error big endian version not defined
3836 } sli4_req_fcoe_wq_create_t;
3839 * @brief FCOE_WQ_CREATE_V1
3841 * Create a version 1 Work Queue for FC/FCoE use.
3843 typedef struct sli4_req_fcoe_wq_create_v1_s {
3845 #if BYTE_ORDER == LITTLE_ENDIAN
3846 uint32_t num_pages:16,
3848 uint32_t page_size:8,
3853 sli4_physical_page_descriptor_t page_physical_address[8];
3855 #error big endian version not defined
3857 } sli4_req_fcoe_wq_create_v1_t;
3859 #define SLI4_FCOE_WQ_CREATE_V1_MAX_PAGES 8
3862 * @brief FCOE_WQ_DESTROY
3864 * Destroy an FC/FCoE Work Queue.
3866 typedef struct sli4_req_fcoe_wq_destroy_s {
3868 #if BYTE_ORDER == LITTLE_ENDIAN
3872 #error big endian version not defined
3874 } sli4_req_fcoe_wq_destroy_t;
3877 * @brief FCOE_POST_SGL_PAGES
3879 * Register the scatter gather list (SGL) memory and associate it with an XRI.
3881 typedef struct sli4_req_fcoe_post_sgl_pages_s {
3883 #if BYTE_ORDER == LITTLE_ENDIAN
3884 uint32_t xri_start:16,
3888 uint32_t page0_high;
3890 uint32_t page1_high;
3893 #error big endian version not defined
3895 } sli4_req_fcoe_post_sgl_pages_t;
3898 * @brief FCOE_RQ_CREATE
3900 * Create a Receive Queue for FC/FCoE use.
3902 typedef struct sli4_req_fcoe_rq_create_s {
3904 #if BYTE_ORDER == LITTLE_ENDIAN
3905 uint32_t num_pages:16,
3914 uint32_t buffer_size:16,
3917 sli4_physical_page_descriptor_t page_physical_address[8];
3919 #error big endian version not defined
3921 } sli4_req_fcoe_rq_create_t;
3923 #define SLI4_FCOE_RQ_CREATE_V0_MAX_PAGES 8
3924 #define SLI4_FCOE_RQ_CREATE_V0_MIN_BUF_SIZE 128
3925 #define SLI4_FCOE_RQ_CREATE_V0_MAX_BUF_SIZE 2048
3928 * @brief FCOE_RQ_CREATE_V1
3930 * Create a version 1 Receive Queue for FC/FCoE use.
3932 typedef struct sli4_req_fcoe_rq_create_v1_s {
3934 #if BYTE_ORDER == LITTLE_ENDIAN
3935 uint32_t num_pages:16,
3940 uint32_t page_size:8,
3947 uint32_t buffer_size;
3948 sli4_physical_page_descriptor_t page_physical_address[8];
3950 #error big endian version not defined
3952 } sli4_req_fcoe_rq_create_v1_t;
3955 * @brief FCOE_RQ_CREATE_V2
3957 * Create a version 2 Receive Queue for FC/FCoE use.
3959 typedef struct sli4_req_fcoe_rq_create_v2_s {
3961 #if BYTE_ORDER == LITTLE_ENDIAN
3962 uint32_t num_pages:16,
3968 uint32_t page_size:8,
3972 uint32_t hdr_buffer_size:16,
3973 payload_buffer_size:16;
3974 uint32_t base_cq_id:16,
3977 sli4_physical_page_descriptor_t page_physical_address[0];
3979 #error big endian version not defined
3981 } sli4_req_fcoe_rq_create_v2_t;
3983 #define SLI4_FCOE_RQ_CREATE_V1_MAX_PAGES 8
3984 #define SLI4_FCOE_RQ_CREATE_V1_MIN_BUF_SIZE 64
3985 #define SLI4_FCOE_RQ_CREATE_V1_MAX_BUF_SIZE 2048
3987 #define SLI4_FCOE_RQE_SIZE_8 0x2
3988 #define SLI4_FCOE_RQE_SIZE_16 0x3
3989 #define SLI4_FCOE_RQE_SIZE_32 0x4
3990 #define SLI4_FCOE_RQE_SIZE_64 0x5
3991 #define SLI4_FCOE_RQE_SIZE_128 0x6
3993 #define SLI4_FCOE_RQ_PAGE_SIZE_4096 0x1
3994 #define SLI4_FCOE_RQ_PAGE_SIZE_8192 0x2
3995 #define SLI4_FCOE_RQ_PAGE_SIZE_16384 0x4
3996 #define SLI4_FCOE_RQ_PAGE_SIZE_32768 0x8
3997 #define SLI4_FCOE_RQ_PAGE_SIZE_64536 0x10
3999 #define SLI4_FCOE_RQE_SIZE 8
4002 * @brief FCOE_RQ_DESTROY
4004 * Destroy an FC/FCoE Receive Queue.
4006 typedef struct sli4_req_fcoe_rq_destroy_s {
4008 #if BYTE_ORDER == LITTLE_ENDIAN
4012 #error big endian version not defined
4014 } sli4_req_fcoe_rq_destroy_t;
4017 * @brief FCOE_READ_FCF_TABLE
4019 * Retrieve a FCF database (also known as a table) entry created by the SLI Port
4020 * during FIP discovery.
4022 typedef struct sli4_req_fcoe_read_fcf_table_s {
4024 #if BYTE_ORDER == LITTLE_ENDIAN
4025 uint32_t fcf_index:16,
4028 #error big endian version not defined
4030 } sli4_req_fcoe_read_fcf_table_t;
4032 /* A FCF index of -1 on the request means return the first valid entry */
4033 #define SLI4_FCOE_FCF_TABLE_FIRST (UINT16_MAX)
4036 * @brief FCF table entry
4038 * This is the information returned by the FCOE_READ_FCF_TABLE command.
4040 typedef struct sli4_fcf_entry_s {
4041 #if BYTE_ORDER == LITTLE_ENDIAN
4042 uint32_t max_receive_size;
4043 uint32_t fip_keep_alive;
4044 uint32_t fip_priority;
4045 uint8_t fcf_mac_address[6];
4046 uint8_t fcf_available;
4047 uint8_t mac_address_provider;
4048 uint8_t fabric_name_id[8];
4054 uint32_t fcf_index:16,
4056 uint8_t vlan_bitmap[512];
4057 uint8_t switch_name[8];
4059 #error big endian version not defined
4064 * @brief FCOE_READ_FCF_TABLE response.
4066 typedef struct sli4_res_fcoe_read_fcf_table_s {
4068 #if BYTE_ORDER == LITTLE_ENDIAN
4070 uint32_t next_index:16,
4072 sli4_fcf_entry_t fcf_entry;
4074 #error big endian version not defined
4076 } sli4_res_fcoe_read_fcf_table_t;
4078 /* A next FCF index of -1 in the response means this is the last valid entry */
4079 #define SLI4_FCOE_FCF_TABLE_LAST (UINT16_MAX)
4082 * @brief FCOE_POST_HDR_TEMPLATES
4084 typedef struct sli4_req_fcoe_post_hdr_templates_s {
4086 #if BYTE_ORDER == LITTLE_ENDIAN
4087 uint32_t rpi_offset:16,
4089 sli4_physical_page_descriptor_t page_descriptor[0];
4091 #error big endian version not defined
4093 } sli4_req_fcoe_post_hdr_templates_t;
4095 #define SLI4_FCOE_HDR_TEMPLATE_SIZE 64
4098 * @brief FCOE_REDISCOVER_FCF
4100 typedef struct sli4_req_fcoe_rediscover_fcf_s {
4102 #if BYTE_ORDER == LITTLE_ENDIAN
4103 uint32_t fcf_count:16,
4106 uint16_t fcf_index[16];
4108 #error big endian version not defined
4110 } sli4_req_fcoe_rediscover_fcf_t;
4113 * Work Queue Entry (WQE) types.
4115 #define SLI4_WQE_ABORT 0x0f
4116 #define SLI4_WQE_ELS_REQUEST64 0x8a
4117 #define SLI4_WQE_FCP_IBIDIR64 0xac
4118 #define SLI4_WQE_FCP_IREAD64 0x9a
4119 #define SLI4_WQE_FCP_IWRITE64 0x98
4120 #define SLI4_WQE_FCP_ICMND64 0x9c
4121 #define SLI4_WQE_FCP_TRECEIVE64 0xa1
4122 #define SLI4_WQE_FCP_CONT_TRECEIVE64 0xe5
4123 #define SLI4_WQE_FCP_TRSP64 0xa3
4124 #define SLI4_WQE_FCP_TSEND64 0x9f
4125 #define SLI4_WQE_GEN_REQUEST64 0xc2
4126 #define SLI4_WQE_SEND_FRAME 0xe1
4127 #define SLI4_WQE_XMIT_BCAST64 0X84
4128 #define SLI4_WQE_XMIT_BLS_RSP 0x97
4129 #define SLI4_WQE_ELS_RSP64 0x95
4130 #define SLI4_WQE_XMIT_SEQUENCE64 0x82
4131 #define SLI4_WQE_REQUEUE_XRI 0x93
4134 * WQE command types.
4136 #define SLI4_CMD_FCP_IREAD64_WQE 0x00
4137 #define SLI4_CMD_FCP_ICMND64_WQE 0x00
4138 #define SLI4_CMD_FCP_IWRITE64_WQE 0x01
4139 #define SLI4_CMD_FCP_TRECEIVE64_WQE 0x02
4140 #define SLI4_CMD_FCP_TRSP64_WQE 0x03
4141 #define SLI4_CMD_FCP_TSEND64_WQE 0x07
4142 #define SLI4_CMD_GEN_REQUEST64_WQE 0x08
4143 #define SLI4_CMD_XMIT_BCAST64_WQE 0x08
4144 #define SLI4_CMD_XMIT_BLS_RSP64_WQE 0x08
4145 #define SLI4_CMD_ABORT_WQE 0x08
4146 #define SLI4_CMD_XMIT_SEQUENCE64_WQE 0x08
4147 #define SLI4_CMD_REQUEUE_XRI_WQE 0x0A
4148 #define SLI4_CMD_SEND_FRAME_WQE 0x0a
4150 #define SLI4_WQE_SIZE 0x05
4151 #define SLI4_WQE_EXT_SIZE 0x06
4153 #define SLI4_WQE_BYTES (16 * sizeof(uint32_t))
4154 #define SLI4_WQE_EXT_BYTES (32 * sizeof(uint32_t))
4156 /* Mask for ccp (CS_CTL) */
4157 #define SLI4_MASK_CCP 0xfe /* Upper 7 bits of CS_CTL is priority */
4160 * @brief Generic WQE
4162 typedef struct sli4_generic_wqe_s {
4163 #if BYTE_ORDER == LITTLE_ENDIAN
4164 uint32_t cmd_spec0_5[6];
4165 uint32_t xri_tag:16,
4177 uint32_t request_tag:16,
4179 uint32_t ebde_cnt:4,
4196 uint32_t cmd_type:4,
4202 #error big endian version not defined
4204 } sli4_generic_wqe_t;
4207 * @brief WQE used to abort exchanges.
4209 typedef struct sli4_abort_wqe_s {
4210 #if BYTE_ORDER == LITTLE_ENDIAN
4219 uint32_t ext_t_mask;
4221 uint32_t xri_tag:16,
4233 uint32_t request_tag:16,
4235 uint32_t ebde_cnt:4,
4252 uint32_t cmd_type:4,
4258 #error big endian version not defined
4262 #define SLI4_ABORT_CRITERIA_XRI_TAG 0x01
4263 #define SLI4_ABORT_CRITERIA_ABORT_TAG 0x02
4264 #define SLI4_ABORT_CRITERIA_REQUEST_TAG 0x03
4265 #define SLI4_ABORT_CRITERIA_EXT_ABORT_TAG 0x04
4270 SLI_ABORT_REQUEST_ID,
4271 SLI_ABORT_MAX, /* must be last */
4272 } sli4_abort_type_e;
4275 * @brief WQE used to create an ELS request.
4277 typedef struct sli4_els_request64_wqe_s {
4278 sli4_bde_t els_request_payload;
4279 #if BYTE_ORDER == LITTLE_ENDIAN
4280 uint32_t els_request_payload_length;
4284 uint32_t remote_id:24,
4286 uint32_t xri_tag:16,
4298 uint32_t request_tag:16,
4300 uint32_t ebde_cnt:4,
4317 uint32_t cmd_type:4,
4322 sli4_bde_t els_response_payload_bde;
4323 uint32_t max_response_payload_length;
4325 #error big endian version not defined
4327 } sli4_els_request64_wqe_t;
4329 #define SLI4_ELS_REQUEST64_CONTEXT_RPI 0x0
4330 #define SLI4_ELS_REQUEST64_CONTEXT_VPI 0x1
4331 #define SLI4_ELS_REQUEST64_CONTEXT_VFI 0x2
4332 #define SLI4_ELS_REQUEST64_CONTEXT_FCFI 0x3
4334 #define SLI4_ELS_REQUEST64_CLASS_2 0x1
4335 #define SLI4_ELS_REQUEST64_CLASS_3 0x2
4337 #define SLI4_ELS_REQUEST64_DIR_WRITE 0x0
4338 #define SLI4_ELS_REQUEST64_DIR_READ 0x1
4340 #define SLI4_ELS_REQUEST64_OTHER 0x0
4341 #define SLI4_ELS_REQUEST64_LOGO 0x1
4342 #define SLI4_ELS_REQUEST64_FDISC 0x2
4343 #define SLI4_ELS_REQUEST64_FLOGIN 0x3
4344 #define SLI4_ELS_REQUEST64_PLOGI 0x4
4346 #define SLI4_ELS_REQUEST64_CMD_GEN 0x08
4347 #define SLI4_ELS_REQUEST64_CMD_NON_FABRIC 0x0c
4348 #define SLI4_ELS_REQUEST64_CMD_FABRIC 0x0d
4351 * @brief WQE used to create an FCP initiator no data command.
4353 typedef struct sli4_fcp_icmnd64_wqe_s {
4355 #if BYTE_ORDER == LITTLE_ENDIAN
4356 uint32_t payload_offset_length:16,
4357 fcp_cmd_buffer_length:16;
4359 uint32_t remote_n_port_id:24,
4361 uint32_t xri_tag:16,
4375 uint32_t request_tag:16,
4377 uint32_t ebde_cnt:4,
4394 uint32_t cmd_type:4,
4404 #error big endian version not defined
4406 } sli4_fcp_icmnd64_wqe_t;
4409 * @brief WQE used to create an FCP initiator read.
4411 typedef struct sli4_fcp_iread64_wqe_s {
4413 #if BYTE_ORDER == LITTLE_ENDIAN
4414 uint32_t payload_offset_length:16,
4415 fcp_cmd_buffer_length:16;
4416 uint32_t total_transfer_length;
4417 uint32_t remote_n_port_id:24,
4419 uint32_t xri_tag:16,
4433 uint32_t request_tag:16,
4435 uint32_t ebde_cnt:4,
4452 uint32_t cmd_type:4,
4459 #error big endian version not defined
4461 sli4_bde_t first_data_bde; /* reserved if performance hints disabled */
4462 } sli4_fcp_iread64_wqe_t;
4465 * @brief WQE used to create an FCP initiator write.
4467 typedef struct sli4_fcp_iwrite64_wqe_s {
4469 #if BYTE_ORDER == LITTLE_ENDIAN
4470 uint32_t payload_offset_length:16,
4471 fcp_cmd_buffer_length:16;
4472 uint32_t total_transfer_length;
4473 uint32_t initial_transfer_length;
4474 uint32_t xri_tag:16,
4488 uint32_t request_tag:16,
4490 uint32_t ebde_cnt:4,
4507 uint32_t cmd_type:4,
4512 uint32_t remote_n_port_id:24,
4515 #error big endian version not defined
4517 sli4_bde_t first_data_bde;
4518 } sli4_fcp_iwrite64_wqe_t;
4520 typedef struct sli4_fcp_128byte_wqe_s {
4522 } sli4_fcp_128byte_wqe_t;
4525 * @brief WQE used to create an FCP target receive, and FCP target
4528 typedef struct sli4_fcp_treceive64_wqe_s {
4530 #if BYTE_ORDER == LITTLE_ENDIAN
4531 uint32_t payload_offset_length;
4532 uint32_t relative_offset;
4534 * DWord 5 can either be the task retry identifier (HLM=0) or
4535 * the remote N_Port ID (HLM=1), or if implementing the Skyhawk
4536 * T10-PI workaround, the secondary xri tag
4539 uint32_t sec_xri_tag:16,
4543 uint32_t xri_tag:16,
4557 uint32_t request_tag:16,
4559 uint32_t ebde_cnt:4,
4578 uint32_t cmd_type:4,
4583 uint32_t fcp_data_receive_length;
4586 #error big endian version not defined
4588 sli4_bde_t first_data_bde; /* For performance hints */
4590 } sli4_fcp_treceive64_wqe_t;
4593 * @brief WQE used to create an FCP target response.
4595 typedef struct sli4_fcp_trsp64_wqe_s {
4597 #if BYTE_ORDER == LITTLE_ENDIAN
4598 uint32_t fcp_response_length;
4601 * DWord 5 can either be the task retry identifier (HLM=0) or
4602 * the remote N_Port ID (HLM=1)
4605 uint32_t xri_tag:16,
4619 uint32_t request_tag:16,
4621 uint32_t ebde_cnt:4,
4640 uint32_t cmd_type:4,
4650 #error big endian version not defined
4652 } sli4_fcp_trsp64_wqe_t;
4655 * @brief WQE used to create an FCP target send (DATA IN).
4657 typedef struct sli4_fcp_tsend64_wqe_s {
4659 #if BYTE_ORDER == LITTLE_ENDIAN
4660 uint32_t payload_offset_length;
4661 uint32_t relative_offset;
4663 * DWord 5 can either be the task retry identifier (HLM=0) or
4664 * the remote N_Port ID (HLM=1)
4667 uint32_t xri_tag:16,
4681 uint32_t request_tag:16,
4683 uint32_t ebde_cnt:4,
4702 uint32_t cmd_type:4,
4707 uint32_t fcp_data_transmit_length;
4710 #error big endian version not defined
4712 sli4_bde_t first_data_bde; /* For performance hints */
4713 } sli4_fcp_tsend64_wqe_t;
4715 #define SLI4_IO_CONTINUATION BIT(0) /** The XRI associated with this IO is already active */
4716 #define SLI4_IO_AUTO_GOOD_RESPONSE BIT(1) /** Automatically generate a good RSP frame */
4717 #define SLI4_IO_NO_ABORT BIT(2)
4718 #define SLI4_IO_DNRX BIT(3) /** Set the DNRX bit because no auto xref rdy buffer is posted */
4720 /* WQE DIF field contents */
4721 #define SLI4_DIF_DISABLED 0
4722 #define SLI4_DIF_PASS_THROUGH 1
4723 #define SLI4_DIF_STRIP 2
4724 #define SLI4_DIF_INSERT 3
4727 * @brief WQE used to create a general request.
4729 typedef struct sli4_gen_request64_wqe_s {
4731 #if BYTE_ORDER == LITTLE_ENDIAN
4732 uint32_t request_payload_length;
4733 uint32_t relative_offset;
4738 uint32_t xri_tag:16,
4750 uint32_t request_tag:16,
4752 uint32_t ebde_cnt:4,
4769 uint32_t cmd_type:4,
4774 uint32_t remote_n_port_id:24,
4778 uint32_t max_response_payload_length;
4780 #error big endian version not defined
4782 } sli4_gen_request64_wqe_t;
4785 * @brief WQE used to create a send frame request.
4787 typedef struct sli4_send_frame_wqe_s {
4789 #if BYTE_ORDER == LITTLE_ENDIAN
4790 uint32_t frame_length;
4791 uint32_t fc_header_0_1[2];
4792 uint32_t xri_tag:16,
4804 uint32_t request_tag:16,
4807 uint32_t ebde_cnt:4,
4824 uint32_t cmd_type:4,
4829 uint32_t fc_header_2_5[4];
4831 #error big endian version not defined
4833 } sli4_send_frame_wqe_t;
4836 * @brief WQE used to create a transmit sequence.
4838 typedef struct sli4_xmit_sequence64_wqe_s {
4840 #if BYTE_ORDER == LITTLE_ENDIAN
4841 uint32_t remote_n_port_id:24,
4843 uint32_t relative_offset;
4853 uint32_t xri_tag:16,
4866 uint32_t request_tag:16,
4868 uint32_t ebde_cnt:4,
4885 uint32_t cmd_type:4,
4890 uint32_t sequence_payload_len;
4895 #error big endian version not defined
4897 } sli4_xmit_sequence64_wqe_t;
4900 * @brief WQE used unblock the specified XRI and to release it to the SLI Port's free pool.
4902 typedef struct sli4_requeue_xri_wqe_s {
4909 #if BYTE_ORDER == LITTLE_ENDIAN
4910 uint32_t xri_tag:16,
4922 uint32_t request_tag:16,
4924 uint32_t ebde_cnt:4,
4941 uint32_t cmd_type:4,
4951 #error big endian version not defined
4953 } sli4_requeue_xri_wqe_t;
4956 * @brief WQE used to send a single frame sequence to broadcast address
4958 typedef struct sli4_xmit_bcast64_wqe_s {
4959 sli4_bde_t sequence_payload;
4960 #if BYTE_ORDER == LITTLE_ENDIAN
4961 uint32_t sequence_payload_length;
4967 uint32_t xri_tag:16,
4979 uint32_t request_tag:16,
4981 uint32_t ebde_cnt:4,
4998 uint32_t cmd_type:4,
5008 #error big endian version not defined
5010 } sli4_xmit_bcast64_wqe_t;
5013 * @brief WQE used to create a BLS response.
5015 typedef struct sli4_xmit_bls_rsp_wqe_s {
5016 #if BYTE_ORDER == LITTLE_ENDIAN
5017 uint32_t payload_word0;
5020 uint32_t high_seq_cnt:16,
5023 uint32_t local_n_port_id:24,
5025 uint32_t remote_id:24,
5029 uint32_t xri_tag:16,
5041 uint32_t request_tag:16,
5043 uint32_t ebde_cnt:4,
5060 uint32_t cmd_type:4,
5065 uint32_t temporary_rpi:16,
5071 #error big endian version not defined
5073 } sli4_xmit_bls_rsp_wqe_t;
5081 typedef struct sli_bls_payload_s {
5082 sli_bls_type_e type;
5087 uint32_t seq_id_validity:8,
5092 uint16_t low_seq_cnt;
5093 uint16_t high_seq_cnt;
5096 uint32_t vendor_unique:8,
5097 reason_explanation:8,
5102 } sli_bls_payload_t;
5105 * @brief WQE used to create an ELS response.
5107 typedef struct sli4_xmit_els_rsp64_wqe_s {
5108 sli4_bde_t els_response_payload;
5109 #if BYTE_ORDER == LITTLE_ENDIAN
5110 uint32_t els_response_payload_length;
5114 uint32_t remote_id:24,
5116 uint32_t xri_tag:16,
5128 uint32_t request_tag:16,
5130 uint32_t ebde_cnt:4,
5147 uint32_t cmd_type:4,
5152 uint32_t temporary_rpi:16,
5158 #error big endian version not defined
5160 } sli4_xmit_els_rsp64_wqe_t;
5163 * @brief Asynchronouse Event: Link State ACQE.
5165 typedef struct sli4_link_state_s {
5166 #if BYTE_ORDER == LITTLE_ENDIAN
5167 uint32_t link_number:6,
5172 uint32_t port_fault:8,
5174 logical_link_speed:16;
5178 event_type:8, /** values are protocol specific */
5180 ae:1, /** async event - this is an ACQE */
5181 val:1; /** valid - contents of CQE are valid */
5183 #error big endian version not defined
5185 } sli4_link_state_t;
5187 #define SLI4_LINK_ATTN_TYPE_LINK_UP 0x01
5188 #define SLI4_LINK_ATTN_TYPE_LINK_DOWN 0x02
5189 #define SLI4_LINK_ATTN_TYPE_NO_HARD_ALPA 0x03
5191 #define SLI4_LINK_ATTN_P2P 0x01
5192 #define SLI4_LINK_ATTN_FC_AL 0x02
5193 #define SLI4_LINK_ATTN_INTERNAL_LOOPBACK 0x03
5194 #define SLI4_LINK_ATTN_SERDES_LOOPBACK 0x04
5196 #define SLI4_LINK_ATTN_1G 0x01
5197 #define SLI4_LINK_ATTN_2G 0x02
5198 #define SLI4_LINK_ATTN_4G 0x04
5199 #define SLI4_LINK_ATTN_8G 0x08
5200 #define SLI4_LINK_ATTN_10G 0x0a
5201 #define SLI4_LINK_ATTN_16G 0x10
5203 #define SLI4_LINK_TYPE_ETHERNET 0x0
5204 #define SLI4_LINK_TYPE_FC 0x1
5207 * @brief Asynchronouse Event: FC Link Attention Event.
5209 typedef struct sli4_link_attention_s {
5210 #if BYTE_ORDER == LITTLE_ENDIAN
5211 uint32_t link_number:8,
5215 uint32_t port_fault:8,
5216 shared_link_status:8,
5217 logical_link_speed:16;
5221 event_type:8, /** values are protocol specific */
5223 ae:1, /** async event - this is an ACQE */
5224 val:1; /** valid - contents of CQE are valid */
5226 #error big endian version not defined
5228 } sli4_link_attention_t;
5231 * @brief FC/FCoE event types.
5233 #define SLI4_LINK_STATE_PHYSICAL 0x00
5234 #define SLI4_LINK_STATE_LOGICAL 0x01
5236 #define SLI4_FCOE_FIP_FCF_DISCOVERED 0x01
5237 #define SLI4_FCOE_FIP_FCF_TABLE_FULL 0x02
5238 #define SLI4_FCOE_FIP_FCF_DEAD 0x03
5239 #define SLI4_FCOE_FIP_FCF_CLEAR_VLINK 0x04
5240 #define SLI4_FCOE_FIP_FCF_MODIFIED 0x05
5242 #define SLI4_GRP5_QOS_SPEED 0x01
5244 #define SLI4_FC_EVENT_LINK_ATTENTION 0x01
5245 #define SLI4_FC_EVENT_SHARED_LINK_ATTENTION 0x02
5247 #define SLI4_PORT_SPEED_NO_LINK 0x0
5248 #define SLI4_PORT_SPEED_10_MBPS 0x1
5249 #define SLI4_PORT_SPEED_100_MBPS 0x2
5250 #define SLI4_PORT_SPEED_1_GBPS 0x3
5251 #define SLI4_PORT_SPEED_10_GBPS 0x4
5253 #define SLI4_PORT_DUPLEX_NONE 0x0
5254 #define SLI4_PORT_DUPLEX_HWF 0x1
5255 #define SLI4_PORT_DUPLEX_FULL 0x2
5257 #define SLI4_PORT_LINK_STATUS_PHYSICAL_DOWN 0x0
5258 #define SLI4_PORT_LINK_STATUS_PHYSICAL_UP 0x1
5259 #define SLI4_PORT_LINK_STATUS_LOGICAL_DOWN 0x2
5260 #define SLI4_PORT_LINK_STATUS_LOGICAL_UP 0x3
5263 * @brief Asynchronouse Event: FCoE/FIP ACQE.
5265 typedef struct sli4_fcoe_fip_s {
5266 #if BYTE_ORDER == LITTLE_ENDIAN
5267 uint32_t event_information;
5268 uint32_t fcf_count:16,
5273 event_type:8, /** values are protocol specific */
5275 ae:1, /** async event - this is an ACQE */
5276 val:1; /** valid - contents of CQE are valid */
5278 #error big endian version not defined
5283 * @brief FC/FCoE WQ completion queue entry.
5285 typedef struct sli4_fc_wcqe_s {
5286 #if BYTE_ORDER == LITTLE_ENDIAN
5287 uint32_t hw_status:8,
5290 uint32_t wqe_specific_1;
5291 uint32_t wqe_specific_2;
5301 #error big endian version not defined
5306 * @brief FC/FCoE WQ consumed CQ queue entry.
5308 typedef struct sli4_fc_wqec_s {
5309 #if BYTE_ORDER == LITTLE_ENDIAN
5312 uint32_t wqe_index:16,
5319 #error big endian version not defined
5324 * @brief FC/FCoE Completion Status Codes.
5326 #define SLI4_FC_WCQE_STATUS_SUCCESS 0x00
5327 #define SLI4_FC_WCQE_STATUS_FCP_RSP_FAILURE 0x01
5328 #define SLI4_FC_WCQE_STATUS_REMOTE_STOP 0x02
5329 #define SLI4_FC_WCQE_STATUS_LOCAL_REJECT 0x03
5330 #define SLI4_FC_WCQE_STATUS_NPORT_RJT 0x04
5331 #define SLI4_FC_WCQE_STATUS_FABRIC_RJT 0x05
5332 #define SLI4_FC_WCQE_STATUS_NPORT_BSY 0x06
5333 #define SLI4_FC_WCQE_STATUS_FABRIC_BSY 0x07
5334 #define SLI4_FC_WCQE_STATUS_LS_RJT 0x09
5335 #define SLI4_FC_WCQE_STATUS_CMD_REJECT 0x0b
5336 #define SLI4_FC_WCQE_STATUS_FCP_TGT_LENCHECK 0x0c
5337 #define SLI4_FC_WCQE_STATUS_RQ_BUF_LEN_EXCEEDED 0x11
5338 #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_BUF_NEEDED 0x12
5339 #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_FRM_DISC 0x13
5340 #define SLI4_FC_WCQE_STATUS_RQ_DMA_FAILURE 0x14
5341 #define SLI4_FC_WCQE_STATUS_FCP_RSP_TRUNCATE 0x15
5342 #define SLI4_FC_WCQE_STATUS_DI_ERROR 0x16
5343 #define SLI4_FC_WCQE_STATUS_BA_RJT 0x17
5344 #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_XRI_NEEDED 0x18
5345 #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_XRI_DISC 0x19
5346 #define SLI4_FC_WCQE_STATUS_RX_ERROR_DETECT 0x1a
5347 #define SLI4_FC_WCQE_STATUS_RX_ABORT_REQUEST 0x1b
5349 /* driver generated status codes; better not overlap with chip's status codes! */
5350 #define SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT 0xff
5351 #define SLI4_FC_WCQE_STATUS_SHUTDOWN 0xfe
5352 #define SLI4_FC_WCQE_STATUS_DISPATCH_ERROR 0xfd
5355 * @brief DI_ERROR Extended Status
5357 #define SLI4_FC_DI_ERROR_GE (1 << 0) /* Guard Error */
5358 #define SLI4_FC_DI_ERROR_AE (1 << 1) /* Application Tag Error */
5359 #define SLI4_FC_DI_ERROR_RE (1 << 2) /* Reference Tag Error */
5360 #define SLI4_FC_DI_ERROR_TDPV (1 << 3) /* Total Data Placed Valid */
5361 #define SLI4_FC_DI_ERROR_UDB (1 << 4) /* Uninitialized DIF Block */
5362 #define SLI4_FC_DI_ERROR_EDIR (1 << 5) /* Error direction */
5365 * @brief Local Reject Reason Codes.
5367 #define SLI4_FC_LOCAL_REJECT_MISSING_CONTINUE 0x01
5368 #define SLI4_FC_LOCAL_REJECT_SEQUENCE_TIMEOUT 0x02
5369 #define SLI4_FC_LOCAL_REJECT_INTERNAL_ERROR 0x03
5370 #define SLI4_FC_LOCAL_REJECT_INVALID_RPI 0x04
5371 #define SLI4_FC_LOCAL_REJECT_NO_XRI 0x05
5372 #define SLI4_FC_LOCAL_REJECT_ILLEGAL_COMMAND 0x06
5373 #define SLI4_FC_LOCAL_REJECT_XCHG_DROPPED 0x07
5374 #define SLI4_FC_LOCAL_REJECT_ILLEGAL_FIELD 0x08
5375 #define SLI4_FC_LOCAL_REJECT_NO_ABORT_MATCH 0x0c
5376 #define SLI4_FC_LOCAL_REJECT_TX_DMA_FAILED 0x0d
5377 #define SLI4_FC_LOCAL_REJECT_RX_DMA_FAILED 0x0e
5378 #define SLI4_FC_LOCAL_REJECT_ILLEGAL_FRAME 0x0f
5379 #define SLI4_FC_LOCAL_REJECT_NO_RESOURCES 0x11
5380 #define SLI4_FC_LOCAL_REJECT_FCP_CONF_FAILURE 0x12
5381 #define SLI4_FC_LOCAL_REJECT_ILLEGAL_LENGTH 0x13
5382 #define SLI4_FC_LOCAL_REJECT_UNSUPPORTED_FEATURE 0x14
5383 #define SLI4_FC_LOCAL_REJECT_ABORT_IN_PROGRESS 0x15
5384 #define SLI4_FC_LOCAL_REJECT_ABORT_REQUESTED 0x16
5385 #define SLI4_FC_LOCAL_REJECT_RCV_BUFFER_TIMEOUT 0x17
5386 #define SLI4_FC_LOCAL_REJECT_LOOP_OPEN_FAILURE 0x18
5387 #define SLI4_FC_LOCAL_REJECT_LINK_DOWN 0x1a
5388 #define SLI4_FC_LOCAL_REJECT_CORRUPTED_DATA 0x1b
5389 #define SLI4_FC_LOCAL_REJECT_CORRUPTED_RPI 0x1c
5390 #define SLI4_FC_LOCAL_REJECT_OUT_OF_ORDER_DATA 0x1d
5391 #define SLI4_FC_LOCAL_REJECT_OUT_OF_ORDER_ACK 0x1e
5392 #define SLI4_FC_LOCAL_REJECT_DUP_FRAME 0x1f
5393 #define SLI4_FC_LOCAL_REJECT_LINK_CONTROL_FRAME 0x20
5394 #define SLI4_FC_LOCAL_REJECT_BAD_HOST_ADDRESS 0x21
5395 #define SLI4_FC_LOCAL_REJECT_MISSING_HDR_BUFFER 0x23
5396 #define SLI4_FC_LOCAL_REJECT_MSEQ_CHAIN_CORRUPTED 0x24
5397 #define SLI4_FC_LOCAL_REJECT_ABORTMULT_REQUESTED 0x25
5398 #define SLI4_FC_LOCAL_REJECT_BUFFER_SHORTAGE 0x28
5399 #define SLI4_FC_LOCAL_REJECT_RCV_XRIBUF_WAITING 0x29
5400 #define SLI4_FC_LOCAL_REJECT_INVALID_VPI 0x2e
5401 #define SLI4_FC_LOCAL_REJECT_MISSING_XRIBUF 0x30
5402 #define SLI4_FC_LOCAL_REJECT_INVALID_RELOFFSET 0x40
5403 #define SLI4_FC_LOCAL_REJECT_MISSING_RELOFFSET 0x41
5404 #define SLI4_FC_LOCAL_REJECT_INSUFF_BUFFERSPACE 0x42
5405 #define SLI4_FC_LOCAL_REJECT_MISSING_SI 0x43
5406 #define SLI4_FC_LOCAL_REJECT_MISSING_ES 0x44
5407 #define SLI4_FC_LOCAL_REJECT_INCOMPLETE_XFER 0x45
5408 #define SLI4_FC_LOCAL_REJECT_SLER_FAILURE 0x46
5409 #define SLI4_FC_LOCAL_REJECT_SLER_CMD_RCV_FAILURE 0x47
5410 #define SLI4_FC_LOCAL_REJECT_SLER_REC_RJT_ERR 0x48
5411 #define SLI4_FC_LOCAL_REJECT_SLER_REC_SRR_RETRY_ERR 0x49
5412 #define SLI4_FC_LOCAL_REJECT_SLER_SRR_RJT_ERR 0x4a
5413 #define SLI4_FC_LOCAL_REJECT_SLER_RRQ_RJT_ERR 0x4c
5414 #define SLI4_FC_LOCAL_REJECT_SLER_RRQ_RETRY_ERR 0x4d
5415 #define SLI4_FC_LOCAL_REJECT_SLER_ABTS_ERR 0x4e
5417 typedef struct sli4_fc_async_rcqe_s {
5418 #if BYTE_ORDER == LITTLE_ENDIAN
5421 rq_element_index:12,
5426 payload_data_placement_length:16;
5427 uint32_t sof_byte:8,
5430 header_data_placement_length:6,
5434 #error big endian version not defined
5436 } sli4_fc_async_rcqe_t;
5438 typedef struct sli4_fc_async_rcqe_v1_s {
5439 #if BYTE_ORDER == LITTLE_ENDIAN
5442 rq_element_index:12,
5447 payload_data_placement_length:16;
5448 uint32_t sof_byte:8,
5451 header_data_placement_length:6,
5455 #error big endian version not defined
5457 } sli4_fc_async_rcqe_v1_t;
5459 #define SLI4_FC_ASYNC_RQ_SUCCESS 0x10
5460 #define SLI4_FC_ASYNC_RQ_BUF_LEN_EXCEEDED 0x11
5461 #define SLI4_FC_ASYNC_RQ_INSUFF_BUF_NEEDED 0x12
5462 #define SLI4_FC_ASYNC_RQ_INSUFF_BUF_FRM_DISC 0x13
5463 #define SLI4_FC_ASYNC_RQ_DMA_FAILURE 0x14
5465 typedef struct sli4_fc_coalescing_rcqe_s {
5466 #if BYTE_ORDER == LITTLE_ENDIAN
5469 rq_element_index:12,
5473 sequence_reporting_placement_length:16;
5479 #error big endian version not defined
5481 } sli4_fc_coalescing_rcqe_t;
5483 #define SLI4_FC_COALESCE_RQ_SUCCESS 0x10
5484 #define SLI4_FC_COALESCE_RQ_INSUFF_XRI_NEEDED 0x18
5486 typedef struct sli4_fc_optimized_write_cmd_cqe_s {
5487 #if BYTE_ORDER == LITTLE_ENDIAN
5490 rq_element_index:15,
5498 payload_data_placement_length:16;
5501 header_data_placement_length:6,
5505 #error big endian version not defined
5507 } sli4_fc_optimized_write_cmd_cqe_t;
5509 typedef struct sli4_fc_optimized_write_data_cqe_s {
5510 #if BYTE_ORDER == LITTLE_ENDIAN
5511 uint32_t hw_status:8,
5514 uint32_t total_data_placed;
5515 uint32_t extended_status;
5525 #error big endian version not defined
5527 } sli4_fc_optimized_write_data_cqe_t;
5529 typedef struct sli4_fc_xri_aborted_cqe_s {
5530 #if BYTE_ORDER == LITTLE_ENDIAN
5534 uint32_t extended_status;
5546 #error big endian version not defined
5548 } sli4_fc_xri_aborted_cqe_t;
5551 * Code definitions applicable to all FC/FCoE CQE types.
5553 #define SLI4_CQE_CODE_OFFSET 14
5555 #define SLI4_CQE_CODE_WORK_REQUEST_COMPLETION 0x01
5556 #define SLI4_CQE_CODE_RELEASE_WQE 0x02
5557 #define SLI4_CQE_CODE_RQ_ASYNC 0x04
5558 #define SLI4_CQE_CODE_XRI_ABORTED 0x05
5559 #define SLI4_CQE_CODE_RQ_COALESCING 0x06
5560 #define SLI4_CQE_CODE_RQ_CONSUMPTION 0x07
5561 #define SLI4_CQE_CODE_MEASUREMENT_REPORTING 0x08
5562 #define SLI4_CQE_CODE_RQ_ASYNC_V1 0x09
5563 #define SLI4_CQE_CODE_OPTIMIZED_WRITE_CMD 0x0B
5564 #define SLI4_CQE_CODE_OPTIMIZED_WRITE_DATA 0x0C
5566 extern int32_t sli_fc_process_link_state(sli4_t *, void *);
5567 extern int32_t sli_fc_process_link_attention(sli4_t *, void *);
5568 extern int32_t sli_fc_cqe_parse(sli4_t *, sli4_queue_t *, uint8_t *, sli4_qentry_e *, uint16_t *);
5569 extern uint32_t sli_fc_response_length(sli4_t *, uint8_t *);
5570 extern uint32_t sli_fc_io_length(sli4_t *, uint8_t *);
5571 extern int32_t sli_fc_els_did(sli4_t *, uint8_t *, uint32_t *);
5572 extern uint32_t sli_fc_ext_status(sli4_t *, uint8_t *);
5573 extern int32_t sli_fc_rqe_rqid_and_index(sli4_t *, uint8_t *, uint16_t *, uint32_t *);
5574 extern int32_t sli_fc_process_fcoe(sli4_t *, void *);
5575 extern int32_t sli_cmd_fcoe_wq_create(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t);
5576 extern int32_t sli_cmd_fcoe_wq_create_v1(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t);
5577 extern int32_t sli_cmd_fcoe_wq_destroy(sli4_t *, void *, size_t, uint16_t);
5578 extern int32_t sli_cmd_fcoe_post_sgl_pages(sli4_t *, void *, size_t, uint16_t, uint32_t, ocs_dma_t **, ocs_dma_t **,
5580 extern int32_t sli_cmd_fcoe_rq_create(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t, uint16_t);
5581 extern int32_t sli_cmd_fcoe_rq_create_v1(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t, uint16_t);
5582 extern int32_t sli_cmd_fcoe_rq_destroy(sli4_t *, void *, size_t, uint16_t);
5583 extern int32_t sli_cmd_fcoe_read_fcf_table(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t);
5584 extern int32_t sli_cmd_fcoe_post_hdr_templates(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, ocs_dma_t *);
5585 extern int32_t sli_cmd_fcoe_rediscover_fcf(sli4_t *, void *, size_t, uint16_t);
5586 extern int32_t sli_fc_rq_alloc(sli4_t *, sli4_queue_t *, uint32_t, uint32_t, sli4_queue_t *, uint16_t, uint8_t);
5587 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);
5588 extern uint32_t sli_fc_get_rpi_requirements(sli4_t *, uint32_t);
5589 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);
5591 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 *);
5592 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);
5593 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);
5594 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);
5596 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);
5597 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);
5598 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);
5599 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);
5600 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);
5601 extern int32_t sli_send_frame_wqe(sli4_t *sli4, void *buf, size_t size, uint8_t sof, uint8_t eof, uint32_t *hdr,
5602 ocs_dma_t *payload, uint32_t req_len, uint8_t timeout,
5603 uint16_t xri, uint16_t req_tag);
5604 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);
5605 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);
5606 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);
5607 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);
5608 extern int32_t sli_requeue_xri_wqe(sli4_t *, void *, size_t, uint16_t, uint16_t, uint16_t);
5609 extern void sli4_cmd_lowlevel_set_watchdog(sli4_t *sli4, void *buf, size_t size, uint16_t timeout);
5610 extern bool sli_persist_topology_enabled(sli4_t *sli4);
5615 * @brief Retrieve the received header and payload length.
5617 * @param sli4 SLI context.
5618 * @param cqe Pointer to the CQ entry.
5619 * @param len_hdr Pointer where the header length is written.
5620 * @param len_data Pointer where the payload length is written.
5622 * @return Returns 0 on success, or a non-zero value on failure.
5624 static inline int32_t
5625 sli_fc_rqe_length(sli4_t *sli4, void *cqe, uint32_t *len_hdr, uint32_t *len_data)
5627 sli4_fc_async_rcqe_t *rcqe = cqe;
5629 *len_hdr = *len_data = 0;
5631 if (SLI4_FC_ASYNC_RQ_SUCCESS == rcqe->status) {
5632 *len_hdr = rcqe->header_data_placement_length;
5633 *len_data = rcqe->payload_data_placement_length;
5642 * @brief Retrieve the received FCFI.
5644 * @param sli4 SLI context.
5645 * @param cqe Pointer to the CQ entry.
5647 * @return Returns the FCFI in the CQE. or UINT8_MAX if invalid CQE code.
5649 static inline uint8_t
5650 sli_fc_rqe_fcfi(sli4_t *sli4, void *cqe)
5652 uint8_t code = ((uint8_t*)cqe)[SLI4_CQE_CODE_OFFSET];
5653 uint8_t fcfi = UINT8_MAX;
5656 case SLI4_CQE_CODE_RQ_ASYNC: {
5657 sli4_fc_async_rcqe_t *rcqe = cqe;
5661 case SLI4_CQE_CODE_RQ_ASYNC_V1: {
5662 sli4_fc_async_rcqe_v1_t *rcqev1 = cqe;
5663 fcfi = rcqev1->fcfi;
5666 case SLI4_CQE_CODE_OPTIMIZED_WRITE_CMD: {
5667 sli4_fc_optimized_write_cmd_cqe_t *opt_wr = cqe;
5668 fcfi = opt_wr->fcfi;
5676 extern const char *sli_fc_get_status_string(uint32_t status);
5678 #endif /* !_SLI4_H */