1ef270ab1SKenneth D. Merry /*-
2ef270ab1SKenneth D. Merry * Copyright (c) 2017 Broadcom. All rights reserved.
3ef270ab1SKenneth D. Merry * The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
4ef270ab1SKenneth D. Merry *
5ef270ab1SKenneth D. Merry * Redistribution and use in source and binary forms, with or without
6ef270ab1SKenneth D. Merry * modification, are permitted provided that the following conditions are met:
7ef270ab1SKenneth D. Merry *
8ef270ab1SKenneth D. Merry * 1. Redistributions of source code must retain the above copyright notice,
9ef270ab1SKenneth D. Merry * this list of conditions and the following disclaimer.
10ef270ab1SKenneth D. Merry *
11ef270ab1SKenneth D. Merry * 2. Redistributions in binary form must reproduce the above copyright notice,
12ef270ab1SKenneth D. Merry * this list of conditions and the following disclaimer in the documentation
13ef270ab1SKenneth D. Merry * and/or other materials provided with the distribution.
14ef270ab1SKenneth D. Merry *
15ef270ab1SKenneth D. Merry * 3. Neither the name of the copyright holder nor the names of its contributors
16ef270ab1SKenneth D. Merry * may be used to endorse or promote products derived from this software
17ef270ab1SKenneth D. Merry * without specific prior written permission.
18ef270ab1SKenneth D. Merry *
19ef270ab1SKenneth D. Merry * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20ef270ab1SKenneth D. Merry * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21ef270ab1SKenneth D. Merry * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22ef270ab1SKenneth D. Merry * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23ef270ab1SKenneth D. Merry * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24ef270ab1SKenneth D. Merry * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25ef270ab1SKenneth D. Merry * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26ef270ab1SKenneth D. Merry * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27ef270ab1SKenneth D. Merry * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28ef270ab1SKenneth D. Merry * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29ef270ab1SKenneth D. Merry * POSSIBILITY OF SUCH DAMAGE.
30ef270ab1SKenneth D. Merry */
31ef270ab1SKenneth D. Merry
32ef270ab1SKenneth D. Merry /**
33ef270ab1SKenneth D. Merry * @file
34ef270ab1SKenneth D. Merry * Define common SLI-4 structures and function prototypes.
35ef270ab1SKenneth D. Merry */
36ef270ab1SKenneth D. Merry
37ef270ab1SKenneth D. Merry #ifndef _SLI4_H
38ef270ab1SKenneth D. Merry #define _SLI4_H
39ef270ab1SKenneth D. Merry
40ef270ab1SKenneth D. Merry #include "ocs_os.h"
41ef270ab1SKenneth D. Merry
42ef270ab1SKenneth D. Merry #define SLI_PAGE_SIZE (4096)
43ef270ab1SKenneth D. Merry #define SLI_SUB_PAGE_MASK (SLI_PAGE_SIZE - 1)
44ef270ab1SKenneth D. Merry #define SLI_PAGE_SHIFT 12
45ef270ab1SKenneth D. Merry #define SLI_ROUND_PAGE(b) (((b) + SLI_SUB_PAGE_MASK) & ~SLI_SUB_PAGE_MASK)
46ef270ab1SKenneth D. Merry
47ef270ab1SKenneth D. Merry #define SLI4_BMBX_TIMEOUT_MSEC 30000
48ef270ab1SKenneth D. Merry #define SLI4_FW_READY_TIMEOUT_MSEC 30000
49ef270ab1SKenneth D. Merry
50ef270ab1SKenneth D. Merry static inline uint32_t
sli_page_count(size_t bytes,uint32_t page_size)51ef270ab1SKenneth D. Merry sli_page_count(size_t bytes, uint32_t page_size)
52ef270ab1SKenneth D. Merry {
53ef270ab1SKenneth D. Merry uint32_t mask = page_size - 1;
54ef270ab1SKenneth D. Merry uint32_t shift = 0;
55ef270ab1SKenneth D. Merry
56ef270ab1SKenneth D. Merry switch (page_size) {
57ef270ab1SKenneth D. Merry case 4096:
58ef270ab1SKenneth D. Merry shift = 12;
59ef270ab1SKenneth D. Merry break;
60ef270ab1SKenneth D. Merry case 8192:
61ef270ab1SKenneth D. Merry shift = 13;
62ef270ab1SKenneth D. Merry break;
63ef270ab1SKenneth D. Merry case 16384:
64ef270ab1SKenneth D. Merry shift = 14;
65ef270ab1SKenneth D. Merry break;
66ef270ab1SKenneth D. Merry case 32768:
67ef270ab1SKenneth D. Merry shift = 15;
68ef270ab1SKenneth D. Merry break;
69ef270ab1SKenneth D. Merry case 65536:
70ef270ab1SKenneth D. Merry shift = 16;
71ef270ab1SKenneth D. Merry break;
72ef270ab1SKenneth D. Merry default:
73ef270ab1SKenneth D. Merry return 0;
74ef270ab1SKenneth D. Merry }
75ef270ab1SKenneth D. Merry
76ef270ab1SKenneth D. Merry return (bytes + mask) >> shift;
77ef270ab1SKenneth D. Merry }
78ef270ab1SKenneth D. Merry
79ef270ab1SKenneth D. Merry /*************************************************************************
80ef270ab1SKenneth D. Merry * Common PCI configuration space register definitions
81ef270ab1SKenneth D. Merry */
82ef270ab1SKenneth D. Merry
83ef270ab1SKenneth D. Merry #define SLI4_PCI_CLASS_REVISION 0x0008 /** register offset */
84ef270ab1SKenneth D. Merry #define SLI4_PCI_REV_ID_SHIFT 0
85ef270ab1SKenneth D. Merry #define SLI4_PCI_REV_ID_MASK 0xff
86ef270ab1SKenneth D. Merry #define SLI4_PCI_CLASS_SHIFT 8
87ef270ab1SKenneth D. Merry #define SLI4_PCI_CLASS_MASK 0xfff
88ef270ab1SKenneth D. Merry
89ef270ab1SKenneth D. Merry #define SLI4_PCI_SOFT_RESET_CSR 0x005c /** register offset */
90ef270ab1SKenneth D. Merry #define SLI4_PCI_SOFT_RESET_MASK 0x0080
91ef270ab1SKenneth D. Merry
92ef270ab1SKenneth D. Merry /*************************************************************************
93ef270ab1SKenneth D. Merry * Common SLI-4 register offsets and field definitions
94ef270ab1SKenneth D. Merry */
95ef270ab1SKenneth D. Merry
96ef270ab1SKenneth D. Merry /**
97ef270ab1SKenneth D. Merry * @brief SLI_INTF - SLI Interface Definition Register
98ef270ab1SKenneth D. Merry */
99ef270ab1SKenneth D. Merry #define SLI4_INTF_REG 0x0058 /** register offset */
100ef270ab1SKenneth D. Merry #define SLI4_INTF_VALID_SHIFT 29
101ef270ab1SKenneth D. Merry #define SLI4_INTF_VALID_MASK 0x7
102ef270ab1SKenneth D. Merry #define SLI4_INTF_VALID 0x6
103ef270ab1SKenneth D. Merry #define SLI4_INTF_IF_TYPE_SHIFT 12
104ef270ab1SKenneth D. Merry #define SLI4_INTF_IF_TYPE_MASK 0xf
105ef270ab1SKenneth D. Merry #define SLI4_INTF_SLI_FAMILY_SHIFT 8
106ef270ab1SKenneth D. Merry #define SLI4_INTF_SLI_FAMILY_MASK 0xf
107ef270ab1SKenneth D. Merry #define SLI4_INTF_SLI_REVISION_SHIFT 4
108ef270ab1SKenneth D. Merry #define SLI4_INTF_SLI_REVISION_MASK 0xf
109ef270ab1SKenneth D. Merry #define SLI4_FAMILY_CHECK_ASIC_TYPE 0xf
110ef270ab1SKenneth D. Merry
111ef270ab1SKenneth D. Merry #define SLI4_IF_TYPE_BE3_SKH_PF 0
112ef270ab1SKenneth D. Merry #define SLI4_IF_TYPE_BE3_SKH_VF 1
113ef270ab1SKenneth D. Merry #define SLI4_IF_TYPE_LANCER_FC_ETH 2
114ef270ab1SKenneth D. Merry #define SLI4_IF_TYPE_LANCER_RDMA 3
1153bf42363SRam Kishore Vegesna #define SLI4_IF_TYPE_LANCER_G7 6
1163bf42363SRam Kishore Vegesna #define SLI4_MAX_IF_TYPES 7
117ef270ab1SKenneth D. Merry
118ef270ab1SKenneth D. Merry /**
119ef270ab1SKenneth D. Merry * @brief ASIC_ID - SLI ASIC Type and Revision Register
120ef270ab1SKenneth D. Merry */
121ef270ab1SKenneth D. Merry #define SLI4_ASIC_ID_REG 0x009c /* register offset */
122ef270ab1SKenneth D. Merry #define SLI4_ASIC_REV_SHIFT 0
123ef270ab1SKenneth D. Merry #define SLI4_ASIC_REV_MASK 0xf
124ef270ab1SKenneth D. Merry #define SLI4_ASIC_VER_SHIFT 4
125ef270ab1SKenneth D. Merry #define SLI4_ASIC_VER_MASK 0xf
126ef270ab1SKenneth D. Merry #define SLI4_ASIC_GEN_SHIFT 8
127ef270ab1SKenneth D. Merry #define SLI4_ASIC_GEN_MASK 0xff
128ef270ab1SKenneth D. Merry #define SLI4_ASIC_GEN_BE2 0x00
129ef270ab1SKenneth D. Merry #define SLI4_ASIC_GEN_BE3 0x03
130ef270ab1SKenneth D. Merry #define SLI4_ASIC_GEN_SKYHAWK 0x04
131ef270ab1SKenneth D. Merry #define SLI4_ASIC_GEN_CORSAIR 0x05
132ef270ab1SKenneth D. Merry #define SLI4_ASIC_GEN_LANCER 0x0b
133ef270ab1SKenneth D. Merry
134ef270ab1SKenneth D. Merry /**
135ef270ab1SKenneth D. Merry * @brief BMBX - Bootstrap Mailbox Register
136ef270ab1SKenneth D. Merry */
137ef270ab1SKenneth D. Merry #define SLI4_BMBX_REG 0x0160 /* register offset */
138ef270ab1SKenneth D. Merry #define SLI4_BMBX_MASK_HI 0x3
139ef270ab1SKenneth D. Merry #define SLI4_BMBX_MASK_LO 0xf
140ef270ab1SKenneth D. Merry #define SLI4_BMBX_RDY BIT(0)
141ef270ab1SKenneth D. Merry #define SLI4_BMBX_HI BIT(1)
142ef270ab1SKenneth D. Merry #define SLI4_BMBX_WRITE_HI(r) ((ocs_addr32_hi(r) & ~SLI4_BMBX_MASK_HI) | \
143ef270ab1SKenneth D. Merry SLI4_BMBX_HI)
144ef270ab1SKenneth D. Merry #define SLI4_BMBX_WRITE_LO(r) (((ocs_addr32_hi(r) & SLI4_BMBX_MASK_HI) << 30) | \
145ef270ab1SKenneth D. Merry (((r) & ~SLI4_BMBX_MASK_LO) >> 2))
146ef270ab1SKenneth D. Merry
147ef270ab1SKenneth D. Merry #define SLI4_BMBX_SIZE 256
148ef270ab1SKenneth D. Merry
149ef270ab1SKenneth D. Merry /**
150ef270ab1SKenneth D. Merry * @brief EQCQ_DOORBELL - EQ and CQ Doorbell Register
151ef270ab1SKenneth D. Merry */
152ef270ab1SKenneth D. Merry #define SLI4_EQCQ_DOORBELL_REG 0x120
153ef270ab1SKenneth D. Merry #define SLI4_EQCQ_DOORBELL_CI BIT(9)
154ef270ab1SKenneth D. Merry #define SLI4_EQCQ_DOORBELL_QT BIT(10)
155ef270ab1SKenneth D. Merry #define SLI4_EQCQ_DOORBELL_ARM BIT(29)
156ef270ab1SKenneth D. Merry #define SLI4_EQCQ_DOORBELL_SE BIT(31)
157ef270ab1SKenneth D. Merry #define SLI4_EQCQ_NUM_SHIFT 16
158ef270ab1SKenneth D. Merry #define SLI4_EQCQ_NUM_MASK 0x01ff
159ef270ab1SKenneth D. Merry #define SLI4_EQCQ_EQ_ID_MASK 0x3fff
160ef270ab1SKenneth D. Merry #define SLI4_EQCQ_CQ_ID_MASK 0x7fff
161ef270ab1SKenneth D. Merry #define SLI4_EQCQ_EQ_ID_MASK_LO 0x01ff
162ef270ab1SKenneth D. Merry #define SLI4_EQCQ_CQ_ID_MASK_LO 0x03ff
163ef270ab1SKenneth D. Merry #define SLI4_EQCQ_EQCQ_ID_MASK_HI 0xf800
1643bf42363SRam Kishore Vegesna #define SLI4_IF6_EQ_DOORBELL_REG 0x120
1653bf42363SRam Kishore Vegesna #define SLI4_IF6_CQ_DOORBELL_REG 0xC0
166ef270ab1SKenneth D. Merry
167ef270ab1SKenneth D. Merry /**
168ef270ab1SKenneth D. Merry * @brief SLIPORT_CONTROL - SLI Port Control Register
169ef270ab1SKenneth D. Merry */
170ef270ab1SKenneth D. Merry #define SLI4_SLIPORT_CONTROL_REG 0x0408
171ef270ab1SKenneth D. Merry #define SLI4_SLIPORT_CONTROL_END BIT(30)
172ef270ab1SKenneth D. Merry #define SLI4_SLIPORT_CONTROL_LITTLE_ENDIAN (0)
173ef270ab1SKenneth D. Merry #define SLI4_SLIPORT_CONTROL_BIG_ENDIAN BIT(30)
174ef270ab1SKenneth D. Merry #define SLI4_SLIPORT_CONTROL_IP BIT(27)
175ef270ab1SKenneth D. Merry #define SLI4_SLIPORT_CONTROL_IDIS BIT(22)
176ef270ab1SKenneth D. Merry #define SLI4_SLIPORT_CONTROL_FDD BIT(31)
177ef270ab1SKenneth D. Merry
178ef270ab1SKenneth D. Merry /**
179ef270ab1SKenneth D. Merry * @brief SLI4_SLIPORT_ERROR1 - SLI Port Error Register
180ef270ab1SKenneth D. Merry */
181ef270ab1SKenneth D. Merry #define SLI4_SLIPORT_ERROR1 0x040c
182ef270ab1SKenneth D. Merry
183ef270ab1SKenneth D. Merry /**
184ef270ab1SKenneth D. Merry * @brief SLI4_SLIPORT_ERROR2 - SLI Port Error Register
185ef270ab1SKenneth D. Merry */
186ef270ab1SKenneth D. Merry #define SLI4_SLIPORT_ERROR2 0x0410
187ef270ab1SKenneth D. Merry
188ef270ab1SKenneth D. Merry /**
189ef270ab1SKenneth D. Merry * @brief User error registers
190ef270ab1SKenneth D. Merry */
191ef270ab1SKenneth D. Merry #define SLI4_UERR_STATUS_LOW_REG 0xA0
192ef270ab1SKenneth D. Merry #define SLI4_UERR_STATUS_HIGH_REG 0xA4
193ef270ab1SKenneth D. Merry #define SLI4_UERR_MASK_LOW_REG 0xA8
194ef270ab1SKenneth D. Merry #define SLI4_UERR_MASK_HIGH_REG 0xAC
195ef270ab1SKenneth D. Merry
196ef270ab1SKenneth D. Merry /**
197ef270ab1SKenneth D. Merry * @brief Registers for generating software UE (BE3)
198ef270ab1SKenneth D. Merry */
199ef270ab1SKenneth D. Merry #define SLI4_SW_UE_CSR1 0x138
200ef270ab1SKenneth D. Merry #define SLI4_SW_UE_CSR2 0x1FFFC
201ef270ab1SKenneth D. Merry
202ef270ab1SKenneth D. Merry /**
203ef270ab1SKenneth D. Merry * @brief Registers for generating software UE (Skyhawk)
204ef270ab1SKenneth D. Merry */
205ef270ab1SKenneth D. Merry #define SLI4_SW_UE_REG 0x5C /* register offset */
206ef270ab1SKenneth D. Merry
sli_eq_doorbell(uint16_t n_popped,uint16_t id,uint8_t arm)207ef270ab1SKenneth D. Merry static inline uint32_t sli_eq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
208ef270ab1SKenneth D. Merry {
209ef270ab1SKenneth D. Merry uint32_t reg = 0;
210ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
211ef270ab1SKenneth D. Merry struct {
212ef270ab1SKenneth D. Merry uint32_t eq_id_lo:9,
213ef270ab1SKenneth D. Merry ci:1, /* clear interrupt */
214ef270ab1SKenneth D. Merry qt:1, /* queue type */
215ef270ab1SKenneth D. Merry eq_id_hi:5,
216ef270ab1SKenneth D. Merry number_popped:13,
217ef270ab1SKenneth D. Merry arm:1,
218ef270ab1SKenneth D. Merry :1,
219ef270ab1SKenneth D. Merry se:1;
220ef270ab1SKenneth D. Merry } * eq_doorbell = (void *)®
221ef270ab1SKenneth D. Merry #else
222ef270ab1SKenneth D. Merry #error big endian version not defined
223ef270ab1SKenneth D. Merry #endif
224ef270ab1SKenneth D. Merry
225ef270ab1SKenneth D. Merry eq_doorbell->eq_id_lo = id & SLI4_EQCQ_EQ_ID_MASK_LO;
226ef270ab1SKenneth D. Merry eq_doorbell->qt = 1; /* EQ is type 1 (section 2.2.3.3 SLI Arch) */
227ef270ab1SKenneth D. Merry eq_doorbell->eq_id_hi = (id >> 9) & 0x1f;
228ef270ab1SKenneth D. Merry eq_doorbell->number_popped = n_popped;
229ef270ab1SKenneth D. Merry eq_doorbell->arm = arm;
230ef270ab1SKenneth D. Merry eq_doorbell->ci = TRUE;
231ef270ab1SKenneth D. Merry
232ef270ab1SKenneth D. Merry return reg;
233ef270ab1SKenneth D. Merry }
234ef270ab1SKenneth D. Merry
sli_cq_doorbell(uint16_t n_popped,uint16_t id,uint8_t arm)235ef270ab1SKenneth D. Merry static inline uint32_t sli_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
236ef270ab1SKenneth D. Merry {
237ef270ab1SKenneth D. Merry uint32_t reg = 0;
238ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
239ef270ab1SKenneth D. Merry struct {
240ef270ab1SKenneth D. Merry uint32_t cq_id_lo:10,
241ef270ab1SKenneth D. Merry qt:1, /* queue type */
242ef270ab1SKenneth D. Merry cq_id_hi:5,
243ef270ab1SKenneth D. Merry number_popped:13,
244ef270ab1SKenneth D. Merry arm:1,
245ef270ab1SKenneth D. Merry :1,
246ef270ab1SKenneth D. Merry se:1;
247ef270ab1SKenneth D. Merry } * cq_doorbell = (void *)®
248ef270ab1SKenneth D. Merry #else
249ef270ab1SKenneth D. Merry #error big endian version not defined
250ef270ab1SKenneth D. Merry #endif
251ef270ab1SKenneth D. Merry
252ef270ab1SKenneth D. Merry cq_doorbell->cq_id_lo = id & SLI4_EQCQ_CQ_ID_MASK_LO;
253ef270ab1SKenneth D. Merry cq_doorbell->qt = 0; /* CQ is type 0 (section 2.2.3.3 SLI Arch) */
254ef270ab1SKenneth D. Merry cq_doorbell->cq_id_hi = (id >> 10) & 0x1f;
255ef270ab1SKenneth D. Merry cq_doorbell->number_popped = n_popped;
256ef270ab1SKenneth D. Merry cq_doorbell->arm = arm;
257ef270ab1SKenneth D. Merry
258ef270ab1SKenneth D. Merry return reg;
259ef270ab1SKenneth D. Merry }
260ef270ab1SKenneth D. Merry
sli_iftype6_eq_doorbell(uint16_t n_popped,uint16_t id,uint8_t arm)2613bf42363SRam Kishore Vegesna static inline uint32_t sli_iftype6_eq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
2623bf42363SRam Kishore Vegesna {
2633bf42363SRam Kishore Vegesna uint32_t reg = 0;
2643bf42363SRam Kishore Vegesna #if BYTE_ORDER == LITTLE_ENDIAN
2653bf42363SRam Kishore Vegesna struct {
2663bf42363SRam Kishore Vegesna uint32_t eq_id:12,
2673bf42363SRam Kishore Vegesna :4, /* clear interrupt */
2683bf42363SRam Kishore Vegesna number_popped:13,
2693bf42363SRam Kishore Vegesna arm:1,
2703bf42363SRam Kishore Vegesna :1,
2713bf42363SRam Kishore Vegesna io:1;
2723bf42363SRam Kishore Vegesna } * eq_doorbell = (void *)®
2733bf42363SRam Kishore Vegesna #else
2743bf42363SRam Kishore Vegesna #error big endian version not defined
2753bf42363SRam Kishore Vegesna #endif
2763bf42363SRam Kishore Vegesna
2773bf42363SRam Kishore Vegesna eq_doorbell->eq_id = id;
2783bf42363SRam Kishore Vegesna eq_doorbell->number_popped = n_popped;
2793bf42363SRam Kishore Vegesna eq_doorbell->arm = arm;
2803bf42363SRam Kishore Vegesna
2813bf42363SRam Kishore Vegesna return reg;
2823bf42363SRam Kishore Vegesna }
2833bf42363SRam Kishore Vegesna
sli_iftype6_cq_doorbell(uint16_t n_popped,uint16_t id,uint8_t arm)2843bf42363SRam Kishore Vegesna static inline uint32_t sli_iftype6_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
2853bf42363SRam Kishore Vegesna {
2863bf42363SRam Kishore Vegesna uint32_t reg = 0;
2873bf42363SRam Kishore Vegesna #if BYTE_ORDER == LITTLE_ENDIAN
2883bf42363SRam Kishore Vegesna struct {
2893bf42363SRam Kishore Vegesna uint32_t cq_id:16,
2903bf42363SRam Kishore Vegesna number_popped:13,
2913bf42363SRam Kishore Vegesna arm:1,
2923bf42363SRam Kishore Vegesna :1,
2933bf42363SRam Kishore Vegesna se:1;
2943bf42363SRam Kishore Vegesna } * cq_doorbell = (void *)®
2953bf42363SRam Kishore Vegesna #else
2963bf42363SRam Kishore Vegesna #error big endian version not defined
2973bf42363SRam Kishore Vegesna #endif
2983bf42363SRam Kishore Vegesna
2993bf42363SRam Kishore Vegesna cq_doorbell->cq_id = id;
3003bf42363SRam Kishore Vegesna cq_doorbell->number_popped = n_popped;
3013bf42363SRam Kishore Vegesna cq_doorbell->arm = arm;
3023bf42363SRam Kishore Vegesna
3033bf42363SRam Kishore Vegesna return reg;
3043bf42363SRam Kishore Vegesna }
3053bf42363SRam Kishore Vegesna
306ef270ab1SKenneth D. Merry /**
307ef270ab1SKenneth D. Merry * @brief MQ_DOORBELL - MQ Doorbell Register
308ef270ab1SKenneth D. Merry */
309ef270ab1SKenneth D. Merry #define SLI4_MQ_DOORBELL_REG 0x0140 /* register offset */
3103bf42363SRam Kishore Vegesna #define SLI4_IF6_MQ_DOORBELL_REG 0x0160 /* register offset if_type = 6 */
311ef270ab1SKenneth D. Merry #define SLI4_MQ_DOORBELL_NUM_SHIFT 16
312ef270ab1SKenneth D. Merry #define SLI4_MQ_DOORBELL_NUM_MASK 0x3fff
313ef270ab1SKenneth D. Merry #define SLI4_MQ_DOORBELL_ID_MASK 0xffff
314ef270ab1SKenneth D. Merry #define SLI4_MQ_DOORBELL(n, i) ((((n) & SLI4_MQ_DOORBELL_NUM_MASK) << SLI4_MQ_DOORBELL_NUM_SHIFT) | \
315ef270ab1SKenneth D. Merry ((i) & SLI4_MQ_DOORBELL_ID_MASK))
316ef270ab1SKenneth D. Merry
317ef270ab1SKenneth D. Merry /**
318ef270ab1SKenneth D. Merry * @brief RQ_DOORBELL - RQ Doorbell Register
319ef270ab1SKenneth D. Merry */
320ef270ab1SKenneth D. Merry #define SLI4_RQ_DOORBELL_REG 0x0a0 /* register offset */
3213bf42363SRam Kishore Vegesna #define SLI4_IF6_RQ_DOORBELL_REG 0x0080 /* register offset of if_type = 6 */
322ef270ab1SKenneth D. Merry #define SLI4_RQ_DOORBELL_NUM_SHIFT 16
323ef270ab1SKenneth D. Merry #define SLI4_RQ_DOORBELL_NUM_MASK 0x3fff
324ef270ab1SKenneth D. Merry #define SLI4_RQ_DOORBELL_ID_MASK 0xffff
325ef270ab1SKenneth D. Merry #define SLI4_RQ_DOORBELL(n, i) ((((n) & SLI4_RQ_DOORBELL_NUM_MASK) << SLI4_RQ_DOORBELL_NUM_SHIFT) | \
326ef270ab1SKenneth D. Merry ((i) & SLI4_RQ_DOORBELL_ID_MASK))
327ef270ab1SKenneth D. Merry
328ef270ab1SKenneth D. Merry /**
329ef270ab1SKenneth D. Merry * @brief WQ_DOORBELL - WQ Doorbell Register
330ef270ab1SKenneth D. Merry */
331ef270ab1SKenneth D. Merry #define SLI4_IO_WQ_DOORBELL_REG 0x040 /* register offset */
3323bf42363SRam Kishore Vegesna #define SLI4_IF6_WQ_DOORBELL_REG 0x040 /* register offset for if_type = 6 */
333ef270ab1SKenneth D. Merry #define SLI4_WQ_DOORBELL_IDX_SHIFT 16
334ef270ab1SKenneth D. Merry #define SLI4_WQ_DOORBELL_IDX_MASK 0x00ff
335ef270ab1SKenneth D. Merry #define SLI4_WQ_DOORBELL_NUM_SHIFT 24
336ef270ab1SKenneth D. Merry #define SLI4_WQ_DOORBELL_NUM_MASK 0x00ff
337ef270ab1SKenneth D. Merry #define SLI4_WQ_DOORBELL_ID_MASK 0xffff
338ef270ab1SKenneth D. Merry #define SLI4_WQ_DOORBELL(n, x, i) ((((n) & SLI4_WQ_DOORBELL_NUM_MASK) << SLI4_WQ_DOORBELL_NUM_SHIFT) | \
339ef270ab1SKenneth D. Merry (((x) & SLI4_WQ_DOORBELL_IDX_MASK) << SLI4_WQ_DOORBELL_IDX_SHIFT) | \
340ef270ab1SKenneth D. Merry ((i) & SLI4_WQ_DOORBELL_ID_MASK))
341ef270ab1SKenneth D. Merry
342ef270ab1SKenneth D. Merry /**
343ef270ab1SKenneth D. Merry * @brief SLIPORT_SEMAPHORE - SLI Port Host and Port Status Register
344ef270ab1SKenneth D. Merry */
345ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_REG_0 0x00ac /** register offset Interface Type 0 + 1 */
346ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_REG_1 0x0180 /** register offset Interface Type 0 + 1 */
3473bf42363SRam Kishore Vegesna #define SLI4_PORT_SEMAPHORE_REG_236 0x0400 /** register offset Interface Type 2 + 3 + 6*/
348ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_PORT_MASK 0x0000ffff
349ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_PORT(r) ((r) & SLI4_PORT_SEMAPHORE_PORT_MASK)
350ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_HOST_MASK 0x00ff0000
351ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_HOST_SHIFT 16
352ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_HOST(r) (((r) & SLI4_PORT_SEMAPHORE_HOST_MASK) >> \
353ef270ab1SKenneth D. Merry SLI4_PORT_SEMAPHORE_HOST_SHIFT)
354ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_SCR2 BIT(26) /** scratch area 2 */
355ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_SCR1 BIT(27) /** scratch area 1 */
356ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_IPC BIT(28) /** IP conflict */
357ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_NIP BIT(29) /** no IP address */
358ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_SFI BIT(30) /** secondary firmware image used */
359ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_PERR BIT(31) /** POST fatal error */
360ef270ab1SKenneth D. Merry
361ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_STATUS_POST_READY 0xc000
362ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_STATUS_UNRECOV_ERR 0xf000
363ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_STATUS_ERR_MASK 0xf000
364ef270ab1SKenneth D. Merry #define SLI4_PORT_SEMAPHORE_IN_ERR(r) (SLI4_PORT_SEMAPHORE_STATUS_UNRECOV_ERR == ((r) & \
365ef270ab1SKenneth D. Merry SLI4_PORT_SEMAPHORE_STATUS_ERR_MASK))
366ef270ab1SKenneth D. Merry
367ef270ab1SKenneth D. Merry /**
368ef270ab1SKenneth D. Merry * @brief SLIPORT_STATUS - SLI Port Status Register
369ef270ab1SKenneth D. Merry */
370ef270ab1SKenneth D. Merry
3713bf42363SRam Kishore Vegesna #define SLI4_PORT_STATUS_REG_236 0x0404 /** register offset Interface Type 2 + 3 + 6*/
372ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_FDP BIT(21) /** function specific dump present */
373ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_RDY BIT(23) /** ready */
374ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_RN BIT(24) /** reset needed */
375ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_DIP BIT(25) /** dump present */
376ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_OTI BIT(29) /** over temp indicator */
377ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_END BIT(30) /** endianness */
378ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_ERR BIT(31) /** SLI port error */
379ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_READY(r) ((r) & SLI4_PORT_STATUS_RDY)
380ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_ERROR(r) ((r) & SLI4_PORT_STATUS_ERR)
381ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_DUMP_PRESENT(r) ((r) & SLI4_PORT_STATUS_DIP)
382ef270ab1SKenneth D. Merry #define SLI4_PORT_STATUS_FDP_PRESENT(r) ((r) & SLI4_PORT_STATUS_FDP)
383ef270ab1SKenneth D. Merry
3843bf42363SRam Kishore Vegesna #define SLI4_PHSDEV_CONTROL_REG_236 0x0414 /** register offset Interface Type 2 + 3 + 6*/
385ef270ab1SKenneth D. Merry #define SLI4_PHYDEV_CONTROL_DRST BIT(0) /** physical device reset */
386ef270ab1SKenneth D. Merry #define SLI4_PHYDEV_CONTROL_FRST BIT(1) /** firmware reset */
387ef270ab1SKenneth D. Merry #define SLI4_PHYDEV_CONTROL_DD BIT(2) /** diagnostic dump */
388ef270ab1SKenneth D. Merry #define SLI4_PHYDEV_CONTROL_FRL_MASK 0x000000f0
389ef270ab1SKenneth D. Merry #define SLI4_PHYDEV_CONTROL_FRL_SHIFT 4
390ef270ab1SKenneth D. Merry #define SLI4_PHYDEV_CONTROL_FRL(r) (((r) & SLI4_PHYDEV_CONTROL_FRL_MASK) >> \
391ef270ab1SKenneth D. Merry SLI4_PHYDEV_CONTROL_FRL_SHIFT_SHIFT)
392ef270ab1SKenneth D. Merry
393ef270ab1SKenneth D. Merry /*************************************************************************
394ef270ab1SKenneth D. Merry * SLI-4 mailbox command formats and definitions
395ef270ab1SKenneth D. Merry */
396ef270ab1SKenneth D. Merry
397ef270ab1SKenneth D. Merry typedef struct sli4_mbox_command_header_s {
398ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
399ef270ab1SKenneth D. Merry uint32_t :8,
400ef270ab1SKenneth D. Merry command:8,
401ef270ab1SKenneth D. Merry status:16; /** Port writes to indicate success / fail */
402ef270ab1SKenneth D. Merry #else
403ef270ab1SKenneth D. Merry #error big endian version not defined
404ef270ab1SKenneth D. Merry #endif
405ef270ab1SKenneth D. Merry } sli4_mbox_command_header_t;
406ef270ab1SKenneth D. Merry
407ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_CONFIG_LINK 0x07
408ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_DUMP 0x17
409ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_DOWN_LINK 0x06
410ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_INIT_LINK 0x05
411ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_INIT_VFI 0xa3
412ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_INIT_VPI 0xa4
413ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_POST_XRI 0xa7
414ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_RELEASE_XRI 0xac
415ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_READ_CONFIG 0x0b
416ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_READ_STATUS 0x0e
417ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_READ_NVPARMS 0x02
418ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_READ_REV 0x11
419ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_READ_LNK_STAT 0x12
420ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_READ_SPARM64 0x8d
421ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_READ_TOPOLOGY 0x95
422ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_REG_FCFI 0xa0
423ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_REG_FCFI_MRQ 0xaf
424ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_REG_RPI 0x93
425ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_REG_RX_RQ 0xa6
426ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_REG_VFI 0x9f
427ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_REG_VPI 0x96
428ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_REQUEST_FEATURES 0x9d
429ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_SLI_CONFIG 0x9b
430ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_UNREG_FCFI 0xa2
431ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_UNREG_RPI 0x14
432ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_UNREG_VFI 0xa1
433ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_UNREG_VPI 0x97
434ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_WRITE_NVPARMS 0x03
435ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_CONFIG_AUTO_XFER_RDY 0xAD
436ef270ab1SKenneth D. Merry #define SLI4_MBOX_COMMAND_CONFIG_AUTO_XFER_RDY_HP 0xAE
437ef270ab1SKenneth D. Merry
438ef270ab1SKenneth D. Merry #define SLI4_MBOX_STATUS_SUCCESS 0x0000
439ef270ab1SKenneth D. Merry #define SLI4_MBOX_STATUS_FAILURE 0x0001
440ef270ab1SKenneth D. Merry #define SLI4_MBOX_STATUS_RPI_NOT_REG 0x1400
441ef270ab1SKenneth D. Merry
442ef270ab1SKenneth D. Merry /**
443ef270ab1SKenneth D. Merry * @brief Buffer Descriptor Entry (BDE)
444ef270ab1SKenneth D. Merry */
445ef270ab1SKenneth D. Merry typedef struct sli4_bde_s {
446ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
447ef270ab1SKenneth D. Merry uint32_t buffer_length:24,
448ef270ab1SKenneth D. Merry bde_type:8;
449ef270ab1SKenneth D. Merry union {
450ef270ab1SKenneth D. Merry struct {
451ef270ab1SKenneth D. Merry uint32_t buffer_address_low;
452ef270ab1SKenneth D. Merry uint32_t buffer_address_high;
453ef270ab1SKenneth D. Merry } data;
454ef270ab1SKenneth D. Merry struct {
455ef270ab1SKenneth D. Merry uint32_t offset;
456ef270ab1SKenneth D. Merry uint32_t rsvd2;
457ef270ab1SKenneth D. Merry } imm;
458ef270ab1SKenneth D. Merry struct {
459ef270ab1SKenneth D. Merry uint32_t sgl_segment_address_low;
460ef270ab1SKenneth D. Merry uint32_t sgl_segment_address_high;
461ef270ab1SKenneth D. Merry } blp;
462ef270ab1SKenneth D. Merry } u;
463ef270ab1SKenneth D. Merry #else
464ef270ab1SKenneth D. Merry #error big endian version not defined
465ef270ab1SKenneth D. Merry #endif
466ef270ab1SKenneth D. Merry } sli4_bde_t;
467ef270ab1SKenneth D. Merry
468ef270ab1SKenneth D. Merry #define SLI4_BDE_TYPE_BDE_64 0x00 /** Generic 64-bit data */
469ef270ab1SKenneth D. Merry #define SLI4_BDE_TYPE_BDE_IMM 0x01 /** Immediate data */
470ef270ab1SKenneth D. Merry #define SLI4_BDE_TYPE_BLP 0x40 /** Buffer List Pointer */
471ef270ab1SKenneth D. Merry
472ef270ab1SKenneth D. Merry /**
473ef270ab1SKenneth D. Merry * @brief Scatter-Gather Entry (SGE)
474ef270ab1SKenneth D. Merry */
475ef270ab1SKenneth D. Merry typedef struct sli4_sge_s {
476ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
477ef270ab1SKenneth D. Merry uint32_t buffer_address_high;
478ef270ab1SKenneth D. Merry uint32_t buffer_address_low;
479ef270ab1SKenneth D. Merry uint32_t data_offset:27,
480ef270ab1SKenneth D. Merry sge_type:4,
481ef270ab1SKenneth D. Merry last:1;
482ef270ab1SKenneth D. Merry uint32_t buffer_length;
483ef270ab1SKenneth D. Merry #else
484ef270ab1SKenneth D. Merry #error big endian version not defined
485ef270ab1SKenneth D. Merry #endif
486ef270ab1SKenneth D. Merry } sli4_sge_t;
487ef270ab1SKenneth D. Merry
488ef270ab1SKenneth D. Merry /**
489ef270ab1SKenneth D. Merry * @brief T10 DIF Scatter-Gather Entry (SGE)
490ef270ab1SKenneth D. Merry */
491ef270ab1SKenneth D. Merry typedef struct sli4_dif_sge_s {
492ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
493ef270ab1SKenneth D. Merry uint32_t buffer_address_high;
494ef270ab1SKenneth D. Merry uint32_t buffer_address_low;
495ef270ab1SKenneth D. Merry uint32_t :27,
496ef270ab1SKenneth D. Merry sge_type:4,
497ef270ab1SKenneth D. Merry last:1;
498ef270ab1SKenneth D. Merry uint32_t :32;
499ef270ab1SKenneth D. Merry #else
500ef270ab1SKenneth D. Merry #error big endian version not defined
501ef270ab1SKenneth D. Merry #endif
502ef270ab1SKenneth D. Merry } sli4_dif_sge_t;
503ef270ab1SKenneth D. Merry
504ef270ab1SKenneth D. Merry /**
505ef270ab1SKenneth D. Merry * @brief T10 DIF Seed Scatter-Gather Entry (SGE)
506ef270ab1SKenneth D. Merry */
507ef270ab1SKenneth D. Merry typedef struct sli4_diseed_sge_s {
508ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
509ef270ab1SKenneth D. Merry uint32_t ref_tag_cmp;
510ef270ab1SKenneth D. Merry uint32_t ref_tag_repl;
511ef270ab1SKenneth D. Merry uint32_t app_tag_repl:16,
512ef270ab1SKenneth D. Merry :2,
513ef270ab1SKenneth D. Merry hs:1,
514ef270ab1SKenneth D. Merry ws:1,
515ef270ab1SKenneth D. Merry ic:1,
516ef270ab1SKenneth D. Merry ics:1,
517ef270ab1SKenneth D. Merry atrt:1,
518ef270ab1SKenneth D. Merry at:1,
519ef270ab1SKenneth D. Merry fwd_app_tag:1,
520ef270ab1SKenneth D. Merry repl_app_tag:1,
521ef270ab1SKenneth D. Merry head_insert:1,
522ef270ab1SKenneth D. Merry sge_type:4,
523ef270ab1SKenneth D. Merry last:1;
524ef270ab1SKenneth D. Merry uint32_t app_tag_cmp:16,
525ef270ab1SKenneth D. Merry dif_blk_size:3,
526ef270ab1SKenneth D. Merry auto_incr_ref_tag:1,
527ef270ab1SKenneth D. Merry check_app_tag:1,
528ef270ab1SKenneth D. Merry check_ref_tag:1,
529ef270ab1SKenneth D. Merry check_crc:1,
530ef270ab1SKenneth D. Merry new_ref_tag:1,
531ef270ab1SKenneth D. Merry dif_op_rx:4,
532ef270ab1SKenneth D. Merry dif_op_tx:4;
533ef270ab1SKenneth D. Merry #else
534ef270ab1SKenneth D. Merry #error big endian version not defined
535ef270ab1SKenneth D. Merry #endif
536ef270ab1SKenneth D. Merry } sli4_diseed_sge_t;
537ef270ab1SKenneth D. Merry
538ef270ab1SKenneth D. Merry /**
539ef270ab1SKenneth D. Merry * @brief List Segment Pointer Scatter-Gather Entry (SGE)
540ef270ab1SKenneth D. Merry */
541ef270ab1SKenneth D. Merry typedef struct sli4_lsp_sge_s {
542ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
543ef270ab1SKenneth D. Merry uint32_t buffer_address_high;
544ef270ab1SKenneth D. Merry uint32_t buffer_address_low;
545ef270ab1SKenneth D. Merry uint32_t :27,
546ef270ab1SKenneth D. Merry sge_type:4,
547ef270ab1SKenneth D. Merry last:1;
548ef270ab1SKenneth D. Merry uint32_t segment_length:24,
549ef270ab1SKenneth D. Merry :8;
550ef270ab1SKenneth D. Merry #else
551ef270ab1SKenneth D. Merry #error big endian version not defined
552ef270ab1SKenneth D. Merry #endif
553ef270ab1SKenneth D. Merry } sli4_lsp_sge_t;
554ef270ab1SKenneth D. Merry
555ef270ab1SKenneth D. Merry #define SLI4_SGE_MAX_RESERVED 3
556ef270ab1SKenneth D. Merry
557ef270ab1SKenneth D. Merry #define SLI4_SGE_DIF_OP_IN_NODIF_OUT_CRC 0x00
558ef270ab1SKenneth D. Merry #define SLI4_SGE_DIF_OP_IN_CRC_OUT_NODIF 0x01
559ef270ab1SKenneth D. Merry #define SLI4_SGE_DIF_OP_IN_NODIF_OUT_CHKSUM 0x02
560ef270ab1SKenneth D. Merry #define SLI4_SGE_DIF_OP_IN_CHKSUM_OUT_NODIF 0x03
561ef270ab1SKenneth D. Merry #define SLI4_SGE_DIF_OP_IN_CRC_OUT_CRC 0x04
562ef270ab1SKenneth D. Merry #define SLI4_SGE_DIF_OP_IN_CHKSUM_OUT_CHKSUM 0x05
563ef270ab1SKenneth D. Merry #define SLI4_SGE_DIF_OP_IN_CRC_OUT_CHKSUM 0x06
564ef270ab1SKenneth D. Merry #define SLI4_SGE_DIF_OP_IN_CHKSUM_OUT_CRC 0x07
565ef270ab1SKenneth D. Merry #define SLI4_SGE_DIF_OP_IN_RAW_OUT_RAW 0x08
566ef270ab1SKenneth D. Merry
567ef270ab1SKenneth D. Merry #define SLI4_SGE_TYPE_DATA 0x00
568ef270ab1SKenneth D. Merry #define SLI4_SGE_TYPE_CHAIN 0x03 /** Skyhawk only */
569ef270ab1SKenneth D. Merry #define SLI4_SGE_TYPE_DIF 0x04 /** Data Integrity Field */
570ef270ab1SKenneth D. Merry #define SLI4_SGE_TYPE_LSP 0x05 /** List Segment Pointer */
571ef270ab1SKenneth D. Merry #define SLI4_SGE_TYPE_PEDIF 0x06 /** Post Encryption Engine DIF */
572ef270ab1SKenneth D. Merry #define SLI4_SGE_TYPE_PESEED 0x07 /** Post Encryption Engine DIF Seed */
573ef270ab1SKenneth D. Merry #define SLI4_SGE_TYPE_DISEED 0x08 /** DIF Seed */
574ef270ab1SKenneth D. Merry #define SLI4_SGE_TYPE_ENC 0x09 /** Encryption */
575ef270ab1SKenneth D. Merry #define SLI4_SGE_TYPE_ATM 0x0a /** DIF Application Tag Mask */
576ef270ab1SKenneth D. Merry #define SLI4_SGE_TYPE_SKIP 0x0c /** SKIP */
577ef270ab1SKenneth D. Merry
578ef270ab1SKenneth D. Merry #define OCS_MAX_SGE_SIZE 0x80000000 /* Maximum data allowed in a SGE */
579ef270ab1SKenneth D. Merry
580ef270ab1SKenneth D. Merry /**
581ef270ab1SKenneth D. Merry * @brief CONFIG_LINK
582ef270ab1SKenneth D. Merry */
583ef270ab1SKenneth D. Merry typedef struct sli4_cmd_config_link_s {
584ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
585ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
586ef270ab1SKenneth D. Merry uint32_t maxbbc:8, /** Max buffer-to-buffer credit */
587ef270ab1SKenneth D. Merry :24;
588ef270ab1SKenneth D. Merry uint32_t alpa:8,
589ef270ab1SKenneth D. Merry n_port_id:16,
590ef270ab1SKenneth D. Merry :8;
591ef270ab1SKenneth D. Merry uint32_t rsvd3;
592ef270ab1SKenneth D. Merry uint32_t e_d_tov;
593ef270ab1SKenneth D. Merry uint32_t lp_tov;
594ef270ab1SKenneth D. Merry uint32_t r_a_tov;
595ef270ab1SKenneth D. Merry uint32_t r_t_tov;
596ef270ab1SKenneth D. Merry uint32_t al_tov;
597ef270ab1SKenneth D. Merry uint32_t rsvd9;
598ef270ab1SKenneth D. Merry uint32_t :8,
599ef270ab1SKenneth D. Merry bbscn:4, /** buffer-to-buffer state change number */
600ef270ab1SKenneth D. Merry cscn:1, /** configure BBSCN */
601ef270ab1SKenneth D. Merry :19;
602ef270ab1SKenneth D. Merry #else
603ef270ab1SKenneth D. Merry #error big endian version not defined
604ef270ab1SKenneth D. Merry #endif
605ef270ab1SKenneth D. Merry } sli4_cmd_config_link_t;
606ef270ab1SKenneth D. Merry
607ef270ab1SKenneth D. Merry /**
608ef270ab1SKenneth D. Merry * @brief DUMP Type 4
609ef270ab1SKenneth D. Merry */
610ef270ab1SKenneth D. Merry #define SLI4_WKI_TAG_SAT_TEM 0x1040
611ef270ab1SKenneth D. Merry typedef struct sli4_cmd_dump4_s {
612ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
613ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
614ef270ab1SKenneth D. Merry uint32_t type:4,
615ef270ab1SKenneth D. Merry :28;
616ef270ab1SKenneth D. Merry uint32_t wki_selection:16,
617ef270ab1SKenneth D. Merry :16;
618ef270ab1SKenneth D. Merry uint32_t resv;
619ef270ab1SKenneth D. Merry uint32_t returned_byte_cnt;
620ef270ab1SKenneth D. Merry uint32_t resp_data[59];
621ef270ab1SKenneth D. Merry #else
622ef270ab1SKenneth D. Merry #error big endian version not defined
623ef270ab1SKenneth D. Merry #endif
624ef270ab1SKenneth D. Merry } sli4_cmd_dump4_t;
625ef270ab1SKenneth D. Merry
626ef270ab1SKenneth D. Merry /**
627ef270ab1SKenneth D. Merry * @brief FW_INITIALIZE - initialize a SLI port
628ef270ab1SKenneth D. Merry *
629ef270ab1SKenneth D. Merry * @note This command uses a different format than all others.
630ef270ab1SKenneth D. Merry */
631ef270ab1SKenneth D. Merry
632ef270ab1SKenneth D. Merry extern const uint8_t sli4_fw_initialize[8];
633ef270ab1SKenneth D. Merry
634ef270ab1SKenneth D. Merry /**
635ef270ab1SKenneth D. Merry * @brief FW_DEINITIALIZE - deinitialize a SLI port
636ef270ab1SKenneth D. Merry *
637ef270ab1SKenneth D. Merry * @note This command uses a different format than all others.
638ef270ab1SKenneth D. Merry */
639ef270ab1SKenneth D. Merry
640ef270ab1SKenneth D. Merry extern const uint8_t sli4_fw_deinitialize[8];
641ef270ab1SKenneth D. Merry
642ef270ab1SKenneth D. Merry /**
643ef270ab1SKenneth D. Merry * @brief INIT_LINK - initialize the link for a FC/FCoE port
644ef270ab1SKenneth D. Merry */
645ef270ab1SKenneth D. Merry typedef struct sli4_cmd_init_link_flags_s {
646ef270ab1SKenneth D. Merry uint32_t loopback:1,
647ef270ab1SKenneth D. Merry topology:2,
648ef270ab1SKenneth D. Merry #define FC_TOPOLOGY_FCAL 0
649ef270ab1SKenneth D. Merry #define FC_TOPOLOGY_P2P 1
650ef270ab1SKenneth D. Merry :3,
651ef270ab1SKenneth D. Merry unfair:1,
652ef270ab1SKenneth D. Merry skip_lirp_lilp:1,
653ef270ab1SKenneth D. Merry gen_loop_validity_check:1,
654ef270ab1SKenneth D. Merry skip_lisa:1,
655ef270ab1SKenneth D. Merry enable_topology_failover:1,
656ef270ab1SKenneth D. Merry fixed_speed:1,
657ef270ab1SKenneth D. Merry :3,
658ef270ab1SKenneth D. Merry select_hightest_al_pa:1,
659ef270ab1SKenneth D. Merry :16; /* pad to 32 bits */
660ef270ab1SKenneth D. Merry } sli4_cmd_init_link_flags_t;
661ef270ab1SKenneth D. Merry
662ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_LOOP_BACK BIT(0)
663ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_UNFAIR BIT(6)
664ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_NO_LIRP BIT(7)
665ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_LOOP_VALID_CHK BIT(8)
666ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_NO_LISA BIT(9)
667ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_FAIL_OVER BIT(10)
668ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_NO_AUTOSPEED BIT(11)
669ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_PICK_HI_ALPA BIT(15)
670ef270ab1SKenneth D. Merry
671ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_P2P_ONLY 1
672ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_FCAL_ONLY 2
673ef270ab1SKenneth D. Merry
674ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_FCAL_FAIL_OVER 0
675ef270ab1SKenneth D. Merry #define SLI4_INIT_LINK_F_P2P_FAIL_OVER 1
676ef270ab1SKenneth D. Merry
677ef270ab1SKenneth D. Merry typedef struct sli4_cmd_init_link_s {
678ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
679ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
680ef270ab1SKenneth D. Merry uint32_t selective_reset_al_pa:8,
681ef270ab1SKenneth D. Merry :24;
682ef270ab1SKenneth D. Merry sli4_cmd_init_link_flags_t link_flags;
683ef270ab1SKenneth D. Merry uint32_t link_speed_selection_code;
684ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_1G 1
685ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_2G 2
686ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_1_2 3
687ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_4G 4
688ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_4_1 5
689ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_4_2 6
690ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_4_2_1 7
691ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_8G 8
692ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_8_1 9
693ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_8_2 10
694ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_8_2_1 11
695ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_8_4 12
696ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_8_4_1 13
697ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_8_4_2 14
698ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_10G 16
699ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_16G 17
700ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_16_8_4 18
701ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_16_8 19
702ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_32G 20
703ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_32_16_8 21
704ef270ab1SKenneth D. Merry #define FC_LINK_SPEED_AUTO_32_16 22
705ef270ab1SKenneth D. Merry #else
706ef270ab1SKenneth D. Merry #error big endian version not defined
707ef270ab1SKenneth D. Merry #endif
708ef270ab1SKenneth D. Merry } sli4_cmd_init_link_t;
709ef270ab1SKenneth D. Merry
710ef270ab1SKenneth D. Merry /**
711ef270ab1SKenneth D. Merry * @brief INIT_VFI - initialize the VFI resource
712ef270ab1SKenneth D. Merry */
713ef270ab1SKenneth D. Merry typedef struct sli4_cmd_init_vfi_s {
714ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
715ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
716ef270ab1SKenneth D. Merry uint32_t vfi:16,
717ef270ab1SKenneth D. Merry :12,
718ef270ab1SKenneth D. Merry vp:1,
719ef270ab1SKenneth D. Merry vf:1,
720ef270ab1SKenneth D. Merry vt:1,
721ef270ab1SKenneth D. Merry vr:1;
722ef270ab1SKenneth D. Merry uint32_t fcfi:16,
723ef270ab1SKenneth D. Merry vpi:16;
724ef270ab1SKenneth D. Merry uint32_t vf_id:13,
725ef270ab1SKenneth D. Merry pri:3,
726ef270ab1SKenneth D. Merry :16;
727ef270ab1SKenneth D. Merry uint32_t :24,
728ef270ab1SKenneth D. Merry hop_count:8;
729ef270ab1SKenneth D. Merry #else
730ef270ab1SKenneth D. Merry #error big endian version not defined
731ef270ab1SKenneth D. Merry #endif
732ef270ab1SKenneth D. Merry } sli4_cmd_init_vfi_t;
733ef270ab1SKenneth D. Merry
734ef270ab1SKenneth D. Merry /**
735ef270ab1SKenneth D. Merry * @brief INIT_VPI - initialize the VPI resource
736ef270ab1SKenneth D. Merry */
737ef270ab1SKenneth D. Merry typedef struct sli4_cmd_init_vpi_s {
738ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
739ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
740ef270ab1SKenneth D. Merry uint32_t vpi:16,
741ef270ab1SKenneth D. Merry vfi:16;
742ef270ab1SKenneth D. Merry #else
743ef270ab1SKenneth D. Merry #error big endian version not defined
744ef270ab1SKenneth D. Merry #endif
745ef270ab1SKenneth D. Merry } sli4_cmd_init_vpi_t;
746ef270ab1SKenneth D. Merry
747ef270ab1SKenneth D. Merry /**
748ef270ab1SKenneth D. Merry * @brief POST_XRI - post XRI resources to the SLI Port
749ef270ab1SKenneth D. Merry */
750ef270ab1SKenneth D. Merry typedef struct sli4_cmd_post_xri_s {
751ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
752ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
753ef270ab1SKenneth D. Merry uint32_t xri_base:16,
754ef270ab1SKenneth D. Merry xri_count:12,
755ef270ab1SKenneth D. Merry enx:1,
756ef270ab1SKenneth D. Merry dl:1,
757ef270ab1SKenneth D. Merry di:1,
758ef270ab1SKenneth D. Merry val:1;
759ef270ab1SKenneth D. Merry #else
760ef270ab1SKenneth D. Merry #error big endian version not defined
761ef270ab1SKenneth D. Merry #endif
762ef270ab1SKenneth D. Merry } sli4_cmd_post_xri_t;
763ef270ab1SKenneth D. Merry
764ef270ab1SKenneth D. Merry /**
765ef270ab1SKenneth D. Merry * @brief RELEASE_XRI - Release XRI resources from the SLI Port
766ef270ab1SKenneth D. Merry */
767ef270ab1SKenneth D. Merry typedef struct sli4_cmd_release_xri_s {
768ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
769ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
770ef270ab1SKenneth D. Merry uint32_t released_xri_count:5,
771ef270ab1SKenneth D. Merry :11,
772ef270ab1SKenneth D. Merry xri_count:5,
773ef270ab1SKenneth D. Merry :11;
774ef270ab1SKenneth D. Merry struct {
775ef270ab1SKenneth D. Merry uint32_t xri_tag0:16,
776ef270ab1SKenneth D. Merry xri_tag1:16;
777ef270ab1SKenneth D. Merry } xri_tbl[62];
778ef270ab1SKenneth D. Merry #else
779ef270ab1SKenneth D. Merry #error big endian version not defined
780ef270ab1SKenneth D. Merry #endif
781ef270ab1SKenneth D. Merry } sli4_cmd_release_xri_t;
782ef270ab1SKenneth D. Merry
783ef270ab1SKenneth D. Merry /**
784ef270ab1SKenneth D. Merry * @brief READ_CONFIG - read SLI port configuration parameters
785ef270ab1SKenneth D. Merry */
786ef270ab1SKenneth D. Merry typedef struct sli4_cmd_read_config_s {
787ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
788ef270ab1SKenneth D. Merry } sli4_cmd_read_config_t;
789ef270ab1SKenneth D. Merry
790ef270ab1SKenneth D. Merry typedef struct sli4_res_read_config_s {
791ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
792ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
793ef270ab1SKenneth D. Merry uint32_t :31,
794ef270ab1SKenneth D. Merry ext:1; /** Resource Extents */
795965e2154SRam Kishore Vegesna uint32_t :20,
796965e2154SRam Kishore Vegesna pt:2,
797965e2154SRam Kishore Vegesna tf:1,
798965e2154SRam Kishore Vegesna ptv:1,
799ef270ab1SKenneth D. Merry topology:8;
800ef270ab1SKenneth D. Merry uint32_t rsvd3;
801ef270ab1SKenneth D. Merry uint32_t e_d_tov:16,
802ef270ab1SKenneth D. Merry :16;
803ef270ab1SKenneth D. Merry uint32_t rsvd5;
804ef270ab1SKenneth D. Merry uint32_t r_a_tov:16,
805ef270ab1SKenneth D. Merry :16;
806ef270ab1SKenneth D. Merry uint32_t rsvd7;
807ef270ab1SKenneth D. Merry uint32_t rsvd8;
808ef270ab1SKenneth D. Merry uint32_t lmt:16, /** Link Module Type */
809ef270ab1SKenneth D. Merry :16;
810ef270ab1SKenneth D. Merry uint32_t rsvd10;
811ef270ab1SKenneth D. Merry uint32_t rsvd11;
812ef270ab1SKenneth D. Merry uint32_t xri_base:16,
813ef270ab1SKenneth D. Merry xri_count:16;
814ef270ab1SKenneth D. Merry uint32_t rpi_base:16,
815ef270ab1SKenneth D. Merry rpi_count:16;
816ef270ab1SKenneth D. Merry uint32_t vpi_base:16,
817ef270ab1SKenneth D. Merry vpi_count:16;
818ef270ab1SKenneth D. Merry uint32_t vfi_base:16,
819ef270ab1SKenneth D. Merry vfi_count:16;
820ef270ab1SKenneth D. Merry uint32_t :16,
821ef270ab1SKenneth D. Merry fcfi_count:16;
822ef270ab1SKenneth D. Merry uint32_t rq_count:16,
823ef270ab1SKenneth D. Merry eq_count:16;
824ef270ab1SKenneth D. Merry uint32_t wq_count:16,
825ef270ab1SKenneth D. Merry cq_count:16;
826ef270ab1SKenneth D. Merry uint32_t pad[45];
827ef270ab1SKenneth D. Merry #else
828ef270ab1SKenneth D. Merry #error big endian version not defined
829ef270ab1SKenneth D. Merry #endif
830ef270ab1SKenneth D. Merry } sli4_res_read_config_t;
831ef270ab1SKenneth D. Merry
832ef270ab1SKenneth D. Merry #define SLI4_READ_CFG_TOPO_FCOE 0x0 /** FCoE topology */
833ef270ab1SKenneth D. Merry #define SLI4_READ_CFG_TOPO_FC 0x1 /** FC topology unknown */
834ef270ab1SKenneth D. Merry #define SLI4_READ_CFG_TOPO_FC_DA 0x2 /** FC Direct Attach (non FC-AL) topology */
835ef270ab1SKenneth D. Merry #define SLI4_READ_CFG_TOPO_FC_AL 0x3 /** FC-AL topology */
836ef270ab1SKenneth D. Merry
837ef270ab1SKenneth D. Merry /**
838ef270ab1SKenneth D. Merry * @brief READ_NVPARMS - read SLI port configuration parameters
839ef270ab1SKenneth D. Merry */
840ef270ab1SKenneth D. Merry typedef struct sli4_cmd_read_nvparms_s {
841ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
842ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
843ef270ab1SKenneth D. Merry uint32_t rsvd1;
844ef270ab1SKenneth D. Merry uint32_t rsvd2;
845ef270ab1SKenneth D. Merry uint32_t rsvd3;
846ef270ab1SKenneth D. Merry uint32_t rsvd4;
847ef270ab1SKenneth D. Merry uint8_t wwpn[8];
848ef270ab1SKenneth D. Merry uint8_t wwnn[8];
849ef270ab1SKenneth D. Merry uint32_t hard_alpa:8,
850ef270ab1SKenneth D. Merry preferred_d_id:24;
851ef270ab1SKenneth D. Merry #else
852ef270ab1SKenneth D. Merry #error big endian version not defined
853ef270ab1SKenneth D. Merry #endif
854ef270ab1SKenneth D. Merry } sli4_cmd_read_nvparms_t;
855ef270ab1SKenneth D. Merry
856ef270ab1SKenneth D. Merry /**
857ef270ab1SKenneth D. Merry * @brief WRITE_NVPARMS - write SLI port configuration parameters
858ef270ab1SKenneth D. Merry */
859ef270ab1SKenneth D. Merry typedef struct sli4_cmd_write_nvparms_s {
860ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
861ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
862ef270ab1SKenneth D. Merry uint32_t rsvd1;
863ef270ab1SKenneth D. Merry uint32_t rsvd2;
864ef270ab1SKenneth D. Merry uint32_t rsvd3;
865ef270ab1SKenneth D. Merry uint32_t rsvd4;
866ef270ab1SKenneth D. Merry uint8_t wwpn[8];
867ef270ab1SKenneth D. Merry uint8_t wwnn[8];
868ef270ab1SKenneth D. Merry uint32_t hard_alpa:8,
869ef270ab1SKenneth D. Merry preferred_d_id:24;
870ef270ab1SKenneth D. Merry #else
871ef270ab1SKenneth D. Merry #error big endian version not defined
872ef270ab1SKenneth D. Merry #endif
873ef270ab1SKenneth D. Merry } sli4_cmd_write_nvparms_t;
874ef270ab1SKenneth D. Merry
875ef270ab1SKenneth D. Merry /**
876ef270ab1SKenneth D. Merry * @brief READ_REV - read the Port revision levels
877ef270ab1SKenneth D. Merry */
878ef270ab1SKenneth D. Merry typedef struct sli4_cmd_read_rev_s {
879ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
880ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
881ef270ab1SKenneth D. Merry uint32_t :16,
882ef270ab1SKenneth D. Merry sli_level:4,
883ef270ab1SKenneth D. Merry fcoem:1,
884ef270ab1SKenneth D. Merry ceev:2,
885ef270ab1SKenneth D. Merry :6,
886ef270ab1SKenneth D. Merry vpd:1,
887ef270ab1SKenneth D. Merry :2;
888ef270ab1SKenneth D. Merry uint32_t first_hw_revision;
889ef270ab1SKenneth D. Merry uint32_t second_hw_revision;
890ef270ab1SKenneth D. Merry uint32_t rsvd4;
891ef270ab1SKenneth D. Merry uint32_t third_hw_revision;
892ef270ab1SKenneth D. Merry uint32_t fc_ph_low:8,
893ef270ab1SKenneth D. Merry fc_ph_high:8,
894ef270ab1SKenneth D. Merry feature_level_low:8,
895ef270ab1SKenneth D. Merry feature_level_high:8;
896ef270ab1SKenneth D. Merry uint32_t rsvd7;
897ef270ab1SKenneth D. Merry uint32_t first_fw_id;
898ef270ab1SKenneth D. Merry char first_fw_name[16];
899ef270ab1SKenneth D. Merry uint32_t second_fw_id;
900ef270ab1SKenneth D. Merry char second_fw_name[16];
901ef270ab1SKenneth D. Merry uint32_t rsvd18[30];
902ef270ab1SKenneth D. Merry uint32_t available_length:24,
903ef270ab1SKenneth D. Merry :8;
904ef270ab1SKenneth D. Merry uint32_t physical_address_low;
905ef270ab1SKenneth D. Merry uint32_t physical_address_high;
906ef270ab1SKenneth D. Merry uint32_t returned_vpd_length;
907ef270ab1SKenneth D. Merry uint32_t actual_vpd_length;
908ef270ab1SKenneth D. Merry #else
909ef270ab1SKenneth D. Merry #error big endian version not defined
910ef270ab1SKenneth D. Merry #endif
911ef270ab1SKenneth D. Merry } sli4_cmd_read_rev_t;
912ef270ab1SKenneth D. Merry
913ef270ab1SKenneth D. Merry /**
914ef270ab1SKenneth D. Merry * @brief READ_SPARM64 - read the Port service parameters
915ef270ab1SKenneth D. Merry */
916ef270ab1SKenneth D. Merry typedef struct sli4_cmd_read_sparm64_s {
917ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
918ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
919ef270ab1SKenneth D. Merry uint32_t rsvd1;
920ef270ab1SKenneth D. Merry uint32_t rsvd2;
921ef270ab1SKenneth D. Merry sli4_bde_t bde_64;
922ef270ab1SKenneth D. Merry uint32_t vpi:16,
923ef270ab1SKenneth D. Merry :16;
924ef270ab1SKenneth D. Merry uint32_t port_name_start:16,
925ef270ab1SKenneth D. Merry port_name_length:16;
926ef270ab1SKenneth D. Merry uint32_t node_name_start:16,
927ef270ab1SKenneth D. Merry node_name_length:16;
928ef270ab1SKenneth D. Merry #else
929ef270ab1SKenneth D. Merry #error big endian version not defined
930ef270ab1SKenneth D. Merry #endif
931ef270ab1SKenneth D. Merry } sli4_cmd_read_sparm64_t;
932ef270ab1SKenneth D. Merry
933ef270ab1SKenneth D. Merry #define SLI4_READ_SPARM64_VPI_DEFAULT 0
934ef270ab1SKenneth D. Merry #define SLI4_READ_SPARM64_VPI_SPECIAL UINT16_MAX
935ef270ab1SKenneth D. Merry
936ef270ab1SKenneth D. Merry #define SLI4_READ_SPARM64_WWPN_OFFSET (4 * sizeof(uint32_t))
937ef270ab1SKenneth D. Merry #define SLI4_READ_SPARM64_WWNN_OFFSET (SLI4_READ_SPARM64_WWPN_OFFSET + sizeof(uint64_t))
938ef270ab1SKenneth D. Merry
939ef270ab1SKenneth D. Merry typedef struct sli4_port_state_s {
940ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
941ef270ab1SKenneth D. Merry uint32_t nx_port_recv_state:2,
942ef270ab1SKenneth D. Merry nx_port_trans_state:2,
943ef270ab1SKenneth D. Merry nx_port_state_machine:4,
944ef270ab1SKenneth D. Merry link_speed:8,
945ef270ab1SKenneth D. Merry :14,
946ef270ab1SKenneth D. Merry tf:1,
947ef270ab1SKenneth D. Merry lu:1;
948ef270ab1SKenneth D. Merry #else
949ef270ab1SKenneth D. Merry #error big endian version not defined
950ef270ab1SKenneth D. Merry #endif
951ef270ab1SKenneth D. Merry } sli4_port_state_t;
952ef270ab1SKenneth D. Merry
953ef270ab1SKenneth D. Merry /**
954ef270ab1SKenneth D. Merry * @brief READ_TOPOLOGY - read the link event information
955ef270ab1SKenneth D. Merry */
956ef270ab1SKenneth D. Merry typedef struct sli4_cmd_read_topology_s {
957ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
958ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
959ef270ab1SKenneth D. Merry uint32_t event_tag;
960ef270ab1SKenneth D. Merry uint32_t attention_type:8,
961ef270ab1SKenneth D. Merry il:1,
962ef270ab1SKenneth D. Merry pb_recvd:1,
963ef270ab1SKenneth D. Merry :22;
964ef270ab1SKenneth D. Merry uint32_t topology:8,
965ef270ab1SKenneth D. Merry lip_type:8,
966ef270ab1SKenneth D. Merry lip_al_ps:8,
967ef270ab1SKenneth D. Merry al_pa_granted:8;
968ef270ab1SKenneth D. Merry sli4_bde_t bde_loop_map;
969ef270ab1SKenneth D. Merry sli4_port_state_t link_down;
970ef270ab1SKenneth D. Merry sli4_port_state_t link_current;
971ef270ab1SKenneth D. Merry uint32_t max_bbc:8,
972ef270ab1SKenneth D. Merry init_bbc:8,
973ef270ab1SKenneth D. Merry bbscn:4,
974ef270ab1SKenneth D. Merry cbbscn:4,
975ef270ab1SKenneth D. Merry :8;
976ef270ab1SKenneth D. Merry uint32_t r_t_tov:9,
977ef270ab1SKenneth D. Merry :3,
978ef270ab1SKenneth D. Merry al_tov:4,
979ef270ab1SKenneth D. Merry lp_tov:16;
980ef270ab1SKenneth D. Merry uint32_t acquired_al_pa:8,
981ef270ab1SKenneth D. Merry :7,
982ef270ab1SKenneth D. Merry pb:1,
983ef270ab1SKenneth D. Merry specified_al_pa:16;
984ef270ab1SKenneth D. Merry uint32_t initial_n_port_id:24,
985ef270ab1SKenneth D. Merry :8;
986ef270ab1SKenneth D. Merry #else
987ef270ab1SKenneth D. Merry #error big endian version not defined
988ef270ab1SKenneth D. Merry #endif
989ef270ab1SKenneth D. Merry } sli4_cmd_read_topology_t;
990ef270ab1SKenneth D. Merry
991ef270ab1SKenneth D. Merry #define SLI4_MIN_LOOP_MAP_BYTES 128
992ef270ab1SKenneth D. Merry
993ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_LINK_UP 0x1
994ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_LINK_DOWN 0x2
995ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_LINK_NO_ALPA 0x3
996ef270ab1SKenneth D. Merry
997ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_UNKNOWN 0x0
998ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_NPORT 0x1
999ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_FC_AL 0x2
1000ef270ab1SKenneth D. Merry
1001ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_SPEED_NONE 0x00
1002ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_SPEED_1G 0x04
1003ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_SPEED_2G 0x08
1004ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_SPEED_4G 0x10
1005ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_SPEED_8G 0x20
1006ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_SPEED_10G 0x40
1007ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_SPEED_16G 0x80
1008ef270ab1SKenneth D. Merry #define SLI4_READ_TOPOLOGY_SPEED_32G 0x90
1009ef270ab1SKenneth D. Merry
1010ef270ab1SKenneth D. Merry /**
1011ef270ab1SKenneth D. Merry * @brief REG_FCFI - activate a FC Forwarder
1012ef270ab1SKenneth D. Merry */
1013ef270ab1SKenneth D. Merry #define SLI4_CMD_REG_FCFI_NUM_RQ_CFG 4
1014ef270ab1SKenneth D. Merry typedef struct sli4_cmd_reg_fcfi_s {
1015ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1016ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1017ef270ab1SKenneth D. Merry uint32_t fcf_index:16,
1018ef270ab1SKenneth D. Merry fcfi:16;
1019ef270ab1SKenneth D. Merry uint32_t rq_id_1:16,
1020ef270ab1SKenneth D. Merry rq_id_0:16;
1021ef270ab1SKenneth D. Merry uint32_t rq_id_3:16,
1022ef270ab1SKenneth D. Merry rq_id_2:16;
1023ef270ab1SKenneth D. Merry struct {
1024ef270ab1SKenneth D. Merry uint32_t r_ctl_mask:8,
1025ef270ab1SKenneth D. Merry r_ctl_match:8,
1026ef270ab1SKenneth D. Merry type_mask:8,
1027ef270ab1SKenneth D. Merry type_match:8;
1028ef270ab1SKenneth D. Merry } rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG];
1029ef270ab1SKenneth D. Merry uint32_t vlan_tag:12,
1030ef270ab1SKenneth D. Merry vv:1,
1031ef270ab1SKenneth D. Merry :19;
1032ef270ab1SKenneth D. Merry #else
1033ef270ab1SKenneth D. Merry #error big endian version not defined
1034ef270ab1SKenneth D. Merry #endif
1035ef270ab1SKenneth D. Merry } sli4_cmd_reg_fcfi_t;
1036ef270ab1SKenneth D. Merry
1037ef270ab1SKenneth D. Merry #define SLI4_CMD_REG_FCFI_MRQ_NUM_RQ_CFG 4
1038ef270ab1SKenneth D. Merry #define SLI4_CMD_REG_FCFI_MRQ_MAX_NUM_RQ 32
1039ef270ab1SKenneth D. Merry #define SLI4_CMD_REG_FCFI_SET_FCFI_MODE 0
1040ef270ab1SKenneth D. Merry #define SLI4_CMD_REG_FCFI_SET_MRQ_MODE 1
1041ef270ab1SKenneth D. Merry
1042ef270ab1SKenneth D. Merry typedef struct sli4_cmd_reg_fcfi_mrq_s {
1043ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1044ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1045ef270ab1SKenneth D. Merry uint32_t fcf_index:16,
1046ef270ab1SKenneth D. Merry fcfi:16;
1047ef270ab1SKenneth D. Merry
1048ef270ab1SKenneth D. Merry uint32_t rq_id_1:16,
1049ef270ab1SKenneth D. Merry rq_id_0:16;
1050ef270ab1SKenneth D. Merry
1051ef270ab1SKenneth D. Merry uint32_t rq_id_3:16,
1052ef270ab1SKenneth D. Merry rq_id_2:16;
1053ef270ab1SKenneth D. Merry
1054ef270ab1SKenneth D. Merry struct {
1055ef270ab1SKenneth D. Merry uint32_t r_ctl_mask:8,
1056ef270ab1SKenneth D. Merry r_ctl_match:8,
1057ef270ab1SKenneth D. Merry type_mask:8,
1058ef270ab1SKenneth D. Merry type_match:8;
1059ef270ab1SKenneth D. Merry } rq_cfg[SLI4_CMD_REG_FCFI_MRQ_NUM_RQ_CFG];
1060ef270ab1SKenneth D. Merry
1061ef270ab1SKenneth D. Merry uint32_t vlan_tag:12,
1062ef270ab1SKenneth D. Merry vv:1,
1063ef270ab1SKenneth D. Merry mode:1,
1064ef270ab1SKenneth D. Merry :18;
1065ef270ab1SKenneth D. Merry
1066ef270ab1SKenneth D. Merry uint32_t num_mrq_pairs:8,
1067ef270ab1SKenneth D. Merry mrq_filter_bitmask:4,
1068ef270ab1SKenneth D. Merry rq_selection_policy:4,
1069ef270ab1SKenneth D. Merry :16;
1070ef270ab1SKenneth D. Merry #endif
1071ef270ab1SKenneth D. Merry } sli4_cmd_reg_fcfi_mrq_t;
1072ef270ab1SKenneth D. Merry
1073ef270ab1SKenneth D. Merry /**
1074ef270ab1SKenneth D. Merry * @brief REG_RPI - register a Remote Port Indicator
1075ef270ab1SKenneth D. Merry */
1076ef270ab1SKenneth D. Merry typedef struct sli4_cmd_reg_rpi_s {
1077ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1078ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1079ef270ab1SKenneth D. Merry uint32_t rpi:16,
1080ef270ab1SKenneth D. Merry :16;
1081ef270ab1SKenneth D. Merry uint32_t remote_n_port_id:24,
1082ef270ab1SKenneth D. Merry upd:1,
1083ef270ab1SKenneth D. Merry :2,
1084ef270ab1SKenneth D. Merry etow:1,
1085ef270ab1SKenneth D. Merry :1,
1086ef270ab1SKenneth D. Merry terp:1,
1087ef270ab1SKenneth D. Merry :1,
1088ef270ab1SKenneth D. Merry ci:1;
1089ef270ab1SKenneth D. Merry sli4_bde_t bde_64;
1090ef270ab1SKenneth D. Merry uint32_t vpi:16,
1091ef270ab1SKenneth D. Merry :16;
1092ef270ab1SKenneth D. Merry #else
1093ef270ab1SKenneth D. Merry #error big endian version not defined
1094ef270ab1SKenneth D. Merry #endif
1095ef270ab1SKenneth D. Merry } sli4_cmd_reg_rpi_t;
1096ef270ab1SKenneth D. Merry #define SLI4_REG_RPI_BUF_LEN 0x70
1097ef270ab1SKenneth D. Merry
1098ef270ab1SKenneth D. Merry /**
1099ef270ab1SKenneth D. Merry * @brief REG_VFI - register a Virtual Fabric Indicator
1100ef270ab1SKenneth D. Merry */
1101ef270ab1SKenneth D. Merry typedef struct sli4_cmd_reg_vfi_s {
1102ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1103ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1104ef270ab1SKenneth D. Merry uint32_t vfi:16,
1105ef270ab1SKenneth D. Merry :12,
1106ef270ab1SKenneth D. Merry vp:1,
1107ef270ab1SKenneth D. Merry upd:1,
1108ef270ab1SKenneth D. Merry :2;
1109ef270ab1SKenneth D. Merry uint32_t fcfi:16,
1110ef270ab1SKenneth D. Merry vpi:16; /* vp=TRUE */
1111ef270ab1SKenneth D. Merry uint8_t wwpn[8]; /* vp=TRUE */
1112ef270ab1SKenneth D. Merry sli4_bde_t sparm; /* either FLOGI or PLOGI */
1113ef270ab1SKenneth D. Merry uint32_t e_d_tov;
1114ef270ab1SKenneth D. Merry uint32_t r_a_tov;
1115ef270ab1SKenneth D. Merry uint32_t local_n_port_id:24, /* vp=TRUE */
1116ef270ab1SKenneth D. Merry :8;
1117ef270ab1SKenneth D. Merry #else
1118ef270ab1SKenneth D. Merry #error big endian version not defined
1119ef270ab1SKenneth D. Merry #endif
1120ef270ab1SKenneth D. Merry } sli4_cmd_reg_vfi_t;
1121ef270ab1SKenneth D. Merry
1122ef270ab1SKenneth D. Merry /**
1123ef270ab1SKenneth D. Merry * @brief REG_VPI - register a Virtual Port Indicator
1124ef270ab1SKenneth D. Merry */
1125ef270ab1SKenneth D. Merry typedef struct sli4_cmd_reg_vpi_s {
1126ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1127ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1128ef270ab1SKenneth D. Merry uint32_t rsvd1;
1129ef270ab1SKenneth D. Merry uint32_t local_n_port_id:24,
1130ef270ab1SKenneth D. Merry upd:1,
1131ef270ab1SKenneth D. Merry :7;
1132ef270ab1SKenneth D. Merry uint8_t wwpn[8];
1133ef270ab1SKenneth D. Merry uint32_t rsvd5;
1134ef270ab1SKenneth D. Merry uint32_t vpi:16,
1135ef270ab1SKenneth D. Merry vfi:16;
1136ef270ab1SKenneth D. Merry #else
1137ef270ab1SKenneth D. Merry #error big endian version not defined
1138ef270ab1SKenneth D. Merry #endif
1139ef270ab1SKenneth D. Merry } sli4_cmd_reg_vpi_t;
1140ef270ab1SKenneth D. Merry
1141ef270ab1SKenneth D. Merry /**
1142ef270ab1SKenneth D. Merry * @brief REQUEST_FEATURES - request / query SLI features
1143ef270ab1SKenneth D. Merry */
1144ef270ab1SKenneth D. Merry typedef union {
1145ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1146ef270ab1SKenneth D. Merry struct {
1147ef270ab1SKenneth D. Merry uint32_t iaab:1, /** inhibit auto-ABTS originator */
1148ef270ab1SKenneth D. Merry npiv:1, /** NPIV support */
1149ef270ab1SKenneth D. Merry dif:1, /** DIF/DIX support */
1150ef270ab1SKenneth D. Merry vf:1, /** virtual fabric support */
1151ef270ab1SKenneth D. Merry fcpi:1, /** FCP initiator support */
1152ef270ab1SKenneth D. Merry fcpt:1, /** FCP target support */
1153ef270ab1SKenneth D. Merry fcpc:1, /** combined FCP initiator/target */
1154ef270ab1SKenneth D. Merry :1,
1155ef270ab1SKenneth D. Merry rqd:1, /** recovery qualified delay */
1156ef270ab1SKenneth D. Merry iaar:1, /** inhibit auto-ABTS responder */
1157ef270ab1SKenneth D. Merry hlm:1, /** High Login Mode */
1158ef270ab1SKenneth D. Merry perfh:1, /** performance hints */
1159ef270ab1SKenneth D. Merry rxseq:1, /** RX Sequence Coalescing */
1160ef270ab1SKenneth D. Merry rxri:1, /** Release XRI variant of Coalescing */
1161ef270ab1SKenneth D. Merry dcl2:1, /** Disable Class 2 */
1162ef270ab1SKenneth D. Merry rsco:1, /** Receive Sequence Coalescing Optimizations */
1163ef270ab1SKenneth D. Merry mrqp:1, /** Multi RQ Pair Mode Support */
1164ef270ab1SKenneth D. Merry :15;
1165ef270ab1SKenneth D. Merry } flag;
1166ef270ab1SKenneth D. Merry uint32_t dword;
1167ef270ab1SKenneth D. Merry #else
1168ef270ab1SKenneth D. Merry #error big endian version not defined
1169ef270ab1SKenneth D. Merry #endif
1170ef270ab1SKenneth D. Merry } sli4_features_t;
1171ef270ab1SKenneth D. Merry
1172ef270ab1SKenneth D. Merry typedef struct sli4_cmd_request_features_s {
1173ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1174ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1175ef270ab1SKenneth D. Merry uint32_t qry:1,
1176ef270ab1SKenneth D. Merry :31;
1177ef270ab1SKenneth D. Merry #else
1178ef270ab1SKenneth D. Merry #error big endian version not defined
1179ef270ab1SKenneth D. Merry #endif
1180ef270ab1SKenneth D. Merry sli4_features_t command;
1181ef270ab1SKenneth D. Merry sli4_features_t response;
1182ef270ab1SKenneth D. Merry } sli4_cmd_request_features_t;
1183ef270ab1SKenneth D. Merry
1184ef270ab1SKenneth D. Merry /**
1185ef270ab1SKenneth D. Merry * @brief SLI_CONFIG - submit a configuration command to Port
1186ef270ab1SKenneth D. Merry *
1187ef270ab1SKenneth D. Merry * Command is either embedded as part of the payload (embed) or located
1188ef270ab1SKenneth D. Merry * in a separate memory buffer (mem)
1189ef270ab1SKenneth D. Merry */
1190ef270ab1SKenneth D. Merry
1191ef270ab1SKenneth D. Merry typedef struct sli4_sli_config_pmd_s {
1192ef270ab1SKenneth D. Merry uint32_t address_low;
1193ef270ab1SKenneth D. Merry uint32_t address_high;
1194ef270ab1SKenneth D. Merry uint32_t length:24,
1195ef270ab1SKenneth D. Merry :8;
1196ef270ab1SKenneth D. Merry } sli4_sli_config_pmd_t;
1197ef270ab1SKenneth D. Merry
1198ef270ab1SKenneth D. Merry typedef struct sli4_cmd_sli_config_s {
1199ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1200ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1201ef270ab1SKenneth D. Merry uint32_t emb:1,
1202ef270ab1SKenneth D. Merry :2,
1203ef270ab1SKenneth D. Merry pmd_count:5,
1204ef270ab1SKenneth D. Merry :24;
1205ef270ab1SKenneth D. Merry uint32_t payload_length;
1206ef270ab1SKenneth D. Merry uint32_t rsvd3;
1207ef270ab1SKenneth D. Merry uint32_t rsvd4;
1208ef270ab1SKenneth D. Merry uint32_t rsvd5;
1209ef270ab1SKenneth D. Merry union {
1210ef270ab1SKenneth D. Merry uint8_t embed[58 * sizeof(uint32_t)];
1211ef270ab1SKenneth D. Merry sli4_sli_config_pmd_t mem;
1212ef270ab1SKenneth D. Merry } payload;
1213ef270ab1SKenneth D. Merry #else
1214ef270ab1SKenneth D. Merry #error big endian version not defined
1215ef270ab1SKenneth D. Merry #endif
1216ef270ab1SKenneth D. Merry } sli4_cmd_sli_config_t;
1217ef270ab1SKenneth D. Merry
1218ef270ab1SKenneth D. Merry /**
1219ef270ab1SKenneth D. Merry * @brief READ_STATUS - read tx/rx status of a particular port
1220ef270ab1SKenneth D. Merry *
1221ef270ab1SKenneth D. Merry */
1222ef270ab1SKenneth D. Merry
1223ef270ab1SKenneth D. Merry typedef struct sli4_cmd_read_status_s {
1224ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1225ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1226ef270ab1SKenneth D. Merry uint32_t cc:1,
1227ef270ab1SKenneth D. Merry :31;
1228ef270ab1SKenneth D. Merry uint32_t rsvd2;
1229ef270ab1SKenneth D. Merry uint32_t transmit_kbyte_count;
1230ef270ab1SKenneth D. Merry uint32_t receive_kbyte_count;
1231ef270ab1SKenneth D. Merry uint32_t transmit_frame_count;
1232ef270ab1SKenneth D. Merry uint32_t receive_frame_count;
1233ef270ab1SKenneth D. Merry uint32_t transmit_sequence_count;
1234ef270ab1SKenneth D. Merry uint32_t receive_sequence_count;
1235ef270ab1SKenneth D. Merry uint32_t total_exchanges_originator;
1236ef270ab1SKenneth D. Merry uint32_t total_exchanges_responder;
1237ef270ab1SKenneth D. Merry uint32_t receive_p_bsy_count;
1238ef270ab1SKenneth D. Merry uint32_t receive_f_bsy_count;
1239ef270ab1SKenneth D. Merry uint32_t dropped_frames_due_to_no_rq_buffer_count;
1240ef270ab1SKenneth D. Merry uint32_t empty_rq_timeout_count;
1241ef270ab1SKenneth D. Merry uint32_t dropped_frames_due_to_no_xri_count;
1242ef270ab1SKenneth D. Merry uint32_t empty_xri_pool_count;
1243ef270ab1SKenneth D. Merry
1244ef270ab1SKenneth D. Merry #else
1245ef270ab1SKenneth D. Merry #error big endian version not defined
1246ef270ab1SKenneth D. Merry #endif
1247ef270ab1SKenneth D. Merry } sli4_cmd_read_status_t;
1248ef270ab1SKenneth D. Merry
1249ef270ab1SKenneth D. Merry /**
1250ef270ab1SKenneth D. Merry * @brief READ_LNK_STAT - read link status of a particular port
1251ef270ab1SKenneth D. Merry *
1252ef270ab1SKenneth D. Merry */
1253ef270ab1SKenneth D. Merry
1254ef270ab1SKenneth D. Merry typedef struct sli4_cmd_read_link_stats_s {
1255ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1256ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1257ef270ab1SKenneth D. Merry uint32_t rec:1,
1258ef270ab1SKenneth D. Merry gec:1,
1259ef270ab1SKenneth D. Merry w02of:1,
1260ef270ab1SKenneth D. Merry w03of:1,
1261ef270ab1SKenneth D. Merry w04of:1,
1262ef270ab1SKenneth D. Merry w05of:1,
1263ef270ab1SKenneth D. Merry w06of:1,
1264ef270ab1SKenneth D. Merry w07of:1,
1265ef270ab1SKenneth D. Merry w08of:1,
1266ef270ab1SKenneth D. Merry w09of:1,
1267ef270ab1SKenneth D. Merry w10of:1,
1268ef270ab1SKenneth D. Merry w11of:1,
1269ef270ab1SKenneth D. Merry w12of:1,
1270ef270ab1SKenneth D. Merry w13of:1,
1271ef270ab1SKenneth D. Merry w14of:1,
1272ef270ab1SKenneth D. Merry w15of:1,
1273ef270ab1SKenneth D. Merry w16of:1,
1274ef270ab1SKenneth D. Merry w17of:1,
1275ef270ab1SKenneth D. Merry w18of:1,
1276ef270ab1SKenneth D. Merry w19of:1,
1277ef270ab1SKenneth D. Merry w20of:1,
1278ef270ab1SKenneth D. Merry w21of:1,
1279ef270ab1SKenneth D. Merry resv0:8,
1280ef270ab1SKenneth D. Merry clrc:1,
1281ef270ab1SKenneth D. Merry clof:1;
1282ef270ab1SKenneth D. Merry uint32_t link_failure_error_count;
1283ef270ab1SKenneth D. Merry uint32_t loss_of_sync_error_count;
1284ef270ab1SKenneth D. Merry uint32_t loss_of_signal_error_count;
1285ef270ab1SKenneth D. Merry uint32_t primitive_sequence_error_count;
1286ef270ab1SKenneth D. Merry uint32_t invalid_transmission_word_error_count;
1287ef270ab1SKenneth D. Merry uint32_t crc_error_count;
1288ef270ab1SKenneth D. Merry uint32_t primitive_sequence_event_timeout_count;
1289ef270ab1SKenneth D. Merry uint32_t elastic_buffer_overrun_error_count;
1290ef270ab1SKenneth D. Merry uint32_t arbitration_fc_al_timout_count;
1291ef270ab1SKenneth D. Merry uint32_t advertised_receive_bufftor_to_buffer_credit;
1292ef270ab1SKenneth D. Merry uint32_t current_receive_buffer_to_buffer_credit;
1293ef270ab1SKenneth D. Merry uint32_t advertised_transmit_buffer_to_buffer_credit;
1294ef270ab1SKenneth D. Merry uint32_t current_transmit_buffer_to_buffer_credit;
1295ef270ab1SKenneth D. Merry uint32_t received_eofa_count;
1296ef270ab1SKenneth D. Merry uint32_t received_eofdti_count;
1297ef270ab1SKenneth D. Merry uint32_t received_eofni_count;
1298ef270ab1SKenneth D. Merry uint32_t received_soff_count;
1299ef270ab1SKenneth D. Merry uint32_t received_dropped_no_aer_count;
1300ef270ab1SKenneth D. Merry uint32_t received_dropped_no_available_rpi_resources_count;
1301ef270ab1SKenneth D. Merry uint32_t received_dropped_no_available_xri_resources_count;
1302ef270ab1SKenneth D. Merry
1303ef270ab1SKenneth D. Merry #else
1304ef270ab1SKenneth D. Merry #error big endian version not defined
1305ef270ab1SKenneth D. Merry #endif
1306ef270ab1SKenneth D. Merry } sli4_cmd_read_link_stats_t;
1307ef270ab1SKenneth D. Merry
1308ef270ab1SKenneth D. Merry /**
1309ef270ab1SKenneth D. Merry * @brief Format a WQE with WQ_ID Association performance hint
1310ef270ab1SKenneth D. Merry *
1311ef270ab1SKenneth D. Merry * @par Description
1312ef270ab1SKenneth D. Merry * PHWQ works by over-writing part of Word 10 in the WQE with the WQ ID.
1313ef270ab1SKenneth D. Merry *
1314ef270ab1SKenneth D. Merry * @param entry Pointer to the WQE.
1315ef270ab1SKenneth D. Merry * @param q_id Queue ID.
1316ef270ab1SKenneth D. Merry *
1317ef270ab1SKenneth D. Merry * @return None.
1318ef270ab1SKenneth D. Merry */
1319ef270ab1SKenneth D. Merry static inline void
sli_set_wq_id_association(void * entry,uint16_t q_id)1320ef270ab1SKenneth D. Merry sli_set_wq_id_association(void *entry, uint16_t q_id)
1321ef270ab1SKenneth D. Merry {
1322ef270ab1SKenneth D. Merry uint32_t *wqe = entry;
1323ef270ab1SKenneth D. Merry
1324ef270ab1SKenneth D. Merry /*
1325ef270ab1SKenneth D. Merry * Set Word 10, bit 0 to zero
1326ef270ab1SKenneth D. Merry * Set Word 10, bits 15:1 to the WQ ID
1327ef270ab1SKenneth D. Merry */
1328ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1329ef270ab1SKenneth D. Merry wqe[10] &= ~0xffff;
1330ef270ab1SKenneth D. Merry wqe[10] |= q_id << 1;
1331ef270ab1SKenneth D. Merry #else
1332ef270ab1SKenneth D. Merry #error big endian version not defined
1333ef270ab1SKenneth D. Merry #endif
1334ef270ab1SKenneth D. Merry }
1335ef270ab1SKenneth D. Merry
1336ef270ab1SKenneth D. Merry /**
1337ef270ab1SKenneth D. Merry * @brief UNREG_FCFI - unregister a FCFI
1338ef270ab1SKenneth D. Merry */
1339ef270ab1SKenneth D. Merry typedef struct sli4_cmd_unreg_fcfi_s {
1340ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1341ef270ab1SKenneth D. Merry uint32_t rsvd1;
1342ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1343ef270ab1SKenneth D. Merry uint32_t fcfi:16,
1344ef270ab1SKenneth D. Merry :16;
1345ef270ab1SKenneth D. Merry #else
1346ef270ab1SKenneth D. Merry #error big endian version not defined
1347ef270ab1SKenneth D. Merry #endif
1348ef270ab1SKenneth D. Merry } sli4_cmd_unreg_fcfi_t;
1349ef270ab1SKenneth D. Merry
1350ef270ab1SKenneth D. Merry /**
1351ef270ab1SKenneth D. Merry * @brief UNREG_RPI - unregister one or more RPI
1352ef270ab1SKenneth D. Merry */
1353ef270ab1SKenneth D. Merry typedef struct sli4_cmd_unreg_rpi_s {
1354ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1355ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1356ef270ab1SKenneth D. Merry uint32_t index:16,
1357ef270ab1SKenneth D. Merry :13,
1358ef270ab1SKenneth D. Merry dp:1,
1359ef270ab1SKenneth D. Merry ii:2;
1360ef270ab1SKenneth D. Merry uint32_t destination_n_port_id:24,
1361ef270ab1SKenneth D. Merry :8;
1362ef270ab1SKenneth D. Merry #else
1363ef270ab1SKenneth D. Merry #error big endian version not defined
1364ef270ab1SKenneth D. Merry #endif
1365ef270ab1SKenneth D. Merry } sli4_cmd_unreg_rpi_t;
1366ef270ab1SKenneth D. Merry
1367ef270ab1SKenneth D. Merry #define SLI4_UNREG_RPI_II_RPI 0x0
1368ef270ab1SKenneth D. Merry #define SLI4_UNREG_RPI_II_VPI 0x1
1369ef270ab1SKenneth D. Merry #define SLI4_UNREG_RPI_II_VFI 0x2
1370ef270ab1SKenneth D. Merry #define SLI4_UNREG_RPI_II_FCFI 0x3
1371ef270ab1SKenneth D. Merry
1372ef270ab1SKenneth D. Merry /**
1373ef270ab1SKenneth D. Merry * @brief UNREG_VFI - unregister one or more VFI
1374ef270ab1SKenneth D. Merry */
1375ef270ab1SKenneth D. Merry typedef struct sli4_cmd_unreg_vfi_s {
1376ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1377ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1378ef270ab1SKenneth D. Merry uint32_t rsvd1;
1379ef270ab1SKenneth D. Merry uint32_t index:16,
1380ef270ab1SKenneth D. Merry :14,
1381ef270ab1SKenneth D. Merry ii:2;
1382ef270ab1SKenneth D. Merry #else
1383ef270ab1SKenneth D. Merry #error big endian version not defined
1384ef270ab1SKenneth D. Merry #endif
1385ef270ab1SKenneth D. Merry } sli4_cmd_unreg_vfi_t;
1386ef270ab1SKenneth D. Merry
1387ef270ab1SKenneth D. Merry #define SLI4_UNREG_VFI_II_VFI 0x0
1388ef270ab1SKenneth D. Merry #define SLI4_UNREG_VFI_II_FCFI 0x3
1389ef270ab1SKenneth D. Merry
1390ef270ab1SKenneth D. Merry enum {
1391ef270ab1SKenneth D. Merry SLI4_UNREG_TYPE_PORT,
1392ef270ab1SKenneth D. Merry SLI4_UNREG_TYPE_DOMAIN,
1393ef270ab1SKenneth D. Merry SLI4_UNREG_TYPE_FCF,
1394ef270ab1SKenneth D. Merry SLI4_UNREG_TYPE_ALL
1395ef270ab1SKenneth D. Merry };
1396ef270ab1SKenneth D. Merry
1397ef270ab1SKenneth D. Merry /**
1398ef270ab1SKenneth D. Merry * @brief UNREG_VPI - unregister one or more VPI
1399ef270ab1SKenneth D. Merry */
1400ef270ab1SKenneth D. Merry typedef struct sli4_cmd_unreg_vpi_s {
1401ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1402ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1403ef270ab1SKenneth D. Merry uint32_t rsvd1;
1404ef270ab1SKenneth D. Merry uint32_t index:16,
1405ef270ab1SKenneth D. Merry :14,
1406ef270ab1SKenneth D. Merry ii:2;
1407ef270ab1SKenneth D. Merry #else
1408ef270ab1SKenneth D. Merry #error big endian version not defined
1409ef270ab1SKenneth D. Merry #endif
1410ef270ab1SKenneth D. Merry } sli4_cmd_unreg_vpi_t;
1411ef270ab1SKenneth D. Merry
1412ef270ab1SKenneth D. Merry #define SLI4_UNREG_VPI_II_VPI 0x0
1413ef270ab1SKenneth D. Merry #define SLI4_UNREG_VPI_II_VFI 0x2
1414ef270ab1SKenneth D. Merry #define SLI4_UNREG_VPI_II_FCFI 0x3
1415ef270ab1SKenneth D. Merry
1416ef270ab1SKenneth D. Merry /**
1417ef270ab1SKenneth D. Merry * @brief AUTO_XFER_RDY - Configure the auto-generate XFER-RDY feature.
1418ef270ab1SKenneth D. Merry */
1419ef270ab1SKenneth D. Merry typedef struct sli4_cmd_config_auto_xfer_rdy_s {
1420ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1421ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1422ef270ab1SKenneth D. Merry uint32_t resv;
1423ef270ab1SKenneth D. Merry uint32_t max_burst_len;
1424ef270ab1SKenneth D. Merry #else
1425ef270ab1SKenneth D. Merry #error big endian version not defined
1426ef270ab1SKenneth D. Merry #endif
1427ef270ab1SKenneth D. Merry } sli4_cmd_config_auto_xfer_rdy_t;
1428ef270ab1SKenneth D. Merry
1429ef270ab1SKenneth D. Merry typedef struct sli4_cmd_config_auto_xfer_rdy_hp_s {
1430ef270ab1SKenneth D. Merry sli4_mbox_command_header_t hdr;
1431ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1432ef270ab1SKenneth D. Merry uint32_t resv;
1433ef270ab1SKenneth D. Merry uint32_t max_burst_len;
1434ef270ab1SKenneth D. Merry uint32_t esoc:1,
1435ef270ab1SKenneth D. Merry :31;
1436ef270ab1SKenneth D. Merry uint32_t block_size:16,
1437ef270ab1SKenneth D. Merry :16;
1438ef270ab1SKenneth D. Merry #else
1439ef270ab1SKenneth D. Merry #error big endian version not defined
1440ef270ab1SKenneth D. Merry #endif
1441ef270ab1SKenneth D. Merry } sli4_cmd_config_auto_xfer_rdy_hp_t;
1442ef270ab1SKenneth D. Merry
1443ef270ab1SKenneth D. Merry /*************************************************************************
1444ef270ab1SKenneth D. Merry * SLI-4 common configuration command formats and definitions
1445ef270ab1SKenneth D. Merry */
1446ef270ab1SKenneth D. Merry
1447ef270ab1SKenneth D. Merry #define SLI4_CFG_STATUS_SUCCESS 0x00
1448ef270ab1SKenneth D. Merry #define SLI4_CFG_STATUS_FAILED 0x01
1449ef270ab1SKenneth D. Merry #define SLI4_CFG_STATUS_ILLEGAL_REQUEST 0x02
1450ef270ab1SKenneth D. Merry #define SLI4_CFG_STATUS_ILLEGAL_FIELD 0x03
1451ef270ab1SKenneth D. Merry
1452ef270ab1SKenneth D. Merry #define SLI4_MGMT_STATUS_FLASHROM_READ_FAILED 0xcb
1453ef270ab1SKenneth D. Merry
1454ef270ab1SKenneth D. Merry #define SLI4_CFG_ADD_STATUS_NO_STATUS 0x00
1455ef270ab1SKenneth D. Merry #define SLI4_CFG_ADD_STATUS_INVALID_OPCODE 0x1e
1456ef270ab1SKenneth D. Merry
1457ef270ab1SKenneth D. Merry /**
1458ef270ab1SKenneth D. Merry * Subsystem values.
1459ef270ab1SKenneth D. Merry */
1460ef270ab1SKenneth D. Merry #define SLI4_SUBSYSTEM_COMMON 0x01
1461ef270ab1SKenneth D. Merry #define SLI4_SUBSYSTEM_LOWLEVEL 0x0B
1462ef270ab1SKenneth D. Merry #define SLI4_SUBSYSTEM_FCFCOE 0x0c
1463ef270ab1SKenneth D. Merry #define SLI4_SUBSYSTEM_DMTF 0x11
1464ef270ab1SKenneth D. Merry
1465ef270ab1SKenneth D. Merry #define SLI4_OPC_LOWLEVEL_SET_WATCHDOG 0X36
1466ef270ab1SKenneth D. Merry
1467ef270ab1SKenneth D. Merry /**
1468ef270ab1SKenneth D. Merry * Common opcode (OPC) values.
1469ef270ab1SKenneth D. Merry */
1470ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_FUNCTION_RESET 0x3d
1471ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_CREATE_CQ 0x0c
1472ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_CREATE_CQ_SET 0x1d
1473ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_DESTROY_CQ 0x36
1474ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_MODIFY_EQ_DELAY 0x29
1475ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_CREATE_EQ 0x0d
1476ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_DESTROY_EQ 0x37
1477ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_CREATE_MQ_EXT 0x5a
1478ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_DESTROY_MQ 0x35
1479ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_CNTL_ATTRIBUTES 0x20
1480ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_NOP 0x21
1481ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_RESOURCE_EXTENT_INFO 0x9a
1482ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_SLI4_PARAMETERS 0xb5
1483ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_QUERY_FW_CONFIG 0x3a
1484ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_PORT_NAME 0x4d
1485ef270ab1SKenneth D. Merry
1486ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_WRITE_FLASHROM 0x07
1487ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_MANAGE_FAT 0x44
1488ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_READ_TRANSCEIVER_DATA 0x49
1489ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_CNTL_ADDL_ATTRIBUTES 0x79
1490ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_EXT_FAT_CAPABILITIES 0x7d
1491ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_SET_EXT_FAT_CAPABILITIES 0x7e
1492ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_EXT_FAT_CONFIGURE_SNAPSHOT 0x7f
1493ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_EXT_FAT_RETRIEVE_SNAPSHOT 0x80
1494ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_EXT_FAT_READ_STRING_TABLE 0x82
1495ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_FUNCTION_CONFIG 0xa0
1496ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_PROFILE_CONFIG 0xa4
1497ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_SET_PROFILE_CONFIG 0xa5
1498ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_PROFILE_LIST 0xa6
1499ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_ACTIVE_PROFILE 0xa7
1500ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_SET_ACTIVE_PROFILE 0xa8
1501ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_READ_OBJECT 0xab
1502ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_WRITE_OBJECT 0xac
1503ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_DELETE_OBJECT 0xae
1504ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_READ_OBJECT_LIST 0xad
1505ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_SET_DUMP_LOCATION 0xb8
1506ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_SET_FEATURES 0xbf
1507ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_GET_RECONFIG_LINK_INFO 0xc9
1508ef270ab1SKenneth D. Merry #define SLI4_OPC_COMMON_SET_RECONFIG_LINK_ID 0xca
1509ef270ab1SKenneth D. Merry
1510ef270ab1SKenneth D. Merry /**
1511ef270ab1SKenneth D. Merry * DMTF opcode (OPC) values.
1512ef270ab1SKenneth D. Merry */
1513ef270ab1SKenneth D. Merry #define SLI4_OPC_DMTF_EXEC_CLP_CMD 0x01
1514ef270ab1SKenneth D. Merry
1515ef270ab1SKenneth D. Merry /**
1516ef270ab1SKenneth D. Merry * @brief Generic Command Request header
1517ef270ab1SKenneth D. Merry */
1518ef270ab1SKenneth D. Merry typedef struct sli4_req_hdr_s {
1519ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1520ef270ab1SKenneth D. Merry uint32_t opcode:8,
1521ef270ab1SKenneth D. Merry subsystem:8,
1522ef270ab1SKenneth D. Merry :16;
1523ef270ab1SKenneth D. Merry uint32_t timeout;
1524ef270ab1SKenneth D. Merry uint32_t request_length;
1525ef270ab1SKenneth D. Merry uint32_t version:8,
1526ef270ab1SKenneth D. Merry :24;
1527ef270ab1SKenneth D. Merry #else
1528ef270ab1SKenneth D. Merry #error big endian version not defined
1529ef270ab1SKenneth D. Merry #endif
1530ef270ab1SKenneth D. Merry } sli4_req_hdr_t;
1531ef270ab1SKenneth D. Merry
1532ef270ab1SKenneth D. Merry /**
1533ef270ab1SKenneth D. Merry * @brief Generic Command Response header
1534ef270ab1SKenneth D. Merry */
1535ef270ab1SKenneth D. Merry typedef struct sli4_res_hdr_s {
1536ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1537ef270ab1SKenneth D. Merry uint32_t opcode:8,
1538ef270ab1SKenneth D. Merry subsystem:8,
1539ef270ab1SKenneth D. Merry :16;
1540ef270ab1SKenneth D. Merry uint32_t status:8,
1541ef270ab1SKenneth D. Merry additional_status:8,
1542ef270ab1SKenneth D. Merry :16;
1543ef270ab1SKenneth D. Merry uint32_t response_length;
1544ef270ab1SKenneth D. Merry uint32_t actual_response_length;
1545ef270ab1SKenneth D. Merry #else
1546ef270ab1SKenneth D. Merry #error big endian version not defined
1547ef270ab1SKenneth D. Merry #endif
1548ef270ab1SKenneth D. Merry } sli4_res_hdr_t;
1549ef270ab1SKenneth D. Merry
1550ef270ab1SKenneth D. Merry /**
1551ef270ab1SKenneth D. Merry * @brief COMMON_FUNCTION_RESET
1552ef270ab1SKenneth D. Merry *
1553ef270ab1SKenneth D. Merry * Resets the Port, returning it to a power-on state. This configuration
1554ef270ab1SKenneth D. Merry * command does not have a payload and should set/expect the lengths to
1555ef270ab1SKenneth D. Merry * be zero.
1556ef270ab1SKenneth D. Merry */
1557ef270ab1SKenneth D. Merry typedef struct sli4_req_common_function_reset_s {
1558ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1559ef270ab1SKenneth D. Merry } sli4_req_common_function_reset_t;
1560ef270ab1SKenneth D. Merry
1561ef270ab1SKenneth D. Merry typedef struct sli4_res_common_function_reset_s {
1562ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
1563ef270ab1SKenneth D. Merry } sli4_res_common_function_reset_t;
1564ef270ab1SKenneth D. Merry
1565ef270ab1SKenneth D. Merry /**
1566ef270ab1SKenneth D. Merry * @brief COMMON_CREATE_CQ_V0
1567ef270ab1SKenneth D. Merry *
1568ef270ab1SKenneth D. Merry * Create a Completion Queue.
1569ef270ab1SKenneth D. Merry */
1570ef270ab1SKenneth D. Merry typedef struct sli4_req_common_create_cq_v0_s {
1571ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1572ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1573ef270ab1SKenneth D. Merry uint32_t num_pages:16,
1574ef270ab1SKenneth D. Merry :16;
1575ef270ab1SKenneth D. Merry uint32_t :12,
1576ef270ab1SKenneth D. Merry clswm:2,
1577ef270ab1SKenneth D. Merry nodelay:1,
1578ef270ab1SKenneth D. Merry :12,
1579ef270ab1SKenneth D. Merry cqecnt:2,
1580ef270ab1SKenneth D. Merry valid:1,
1581ef270ab1SKenneth D. Merry :1,
1582ef270ab1SKenneth D. Merry evt:1;
1583ef270ab1SKenneth D. Merry uint32_t :22,
1584ef270ab1SKenneth D. Merry eq_id:8,
1585ef270ab1SKenneth D. Merry :1,
1586ef270ab1SKenneth D. Merry arm:1;
1587ef270ab1SKenneth D. Merry uint32_t rsvd[2];
1588ef270ab1SKenneth D. Merry struct {
1589ef270ab1SKenneth D. Merry uint32_t low;
1590ef270ab1SKenneth D. Merry uint32_t high;
1591ef270ab1SKenneth D. Merry } page_physical_address[0];
1592ef270ab1SKenneth D. Merry #else
1593ef270ab1SKenneth D. Merry #error big endian version not defined
1594ef270ab1SKenneth D. Merry #endif
1595ef270ab1SKenneth D. Merry } sli4_req_common_create_cq_v0_t;
1596ef270ab1SKenneth D. Merry
1597ef270ab1SKenneth D. Merry /**
1598ef270ab1SKenneth D. Merry * @brief COMMON_CREATE_CQ_V2
1599ef270ab1SKenneth D. Merry *
1600ef270ab1SKenneth D. Merry * Create a Completion Queue.
1601ef270ab1SKenneth D. Merry */
1602ef270ab1SKenneth D. Merry typedef struct sli4_req_common_create_cq_v2_s {
1603ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1604ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1605ef270ab1SKenneth D. Merry uint32_t num_pages:16,
1606ef270ab1SKenneth D. Merry page_size:8,
1607ef270ab1SKenneth D. Merry :8,
1608ef270ab1SKenneth D. Merry uint32_t :12,
1609ef270ab1SKenneth D. Merry clswm:2,
1610ef270ab1SKenneth D. Merry nodelay:1,
1611ef270ab1SKenneth D. Merry autovalid:1,
16123bf42363SRam Kishore Vegesna :9,
16133bf42363SRam Kishore Vegesna cqe_size:2,
1614ef270ab1SKenneth D. Merry cqecnt:2,
1615ef270ab1SKenneth D. Merry valid:1,
1616ef270ab1SKenneth D. Merry :1,
1617ef270ab1SKenneth D. Merry evt:1;
1618ef270ab1SKenneth D. Merry uint32_t eq_id:16,
1619ef270ab1SKenneth D. Merry :15,
1620ef270ab1SKenneth D. Merry arm:1;
1621ef270ab1SKenneth D. Merry uint32_t cqe_count:16,
1622ef270ab1SKenneth D. Merry :16;
1623ef270ab1SKenneth D. Merry uint32_t rsvd[1];
1624ef270ab1SKenneth D. Merry struct {
1625ef270ab1SKenneth D. Merry uint32_t low;
1626ef270ab1SKenneth D. Merry uint32_t high;
1627ef270ab1SKenneth D. Merry } page_physical_address[0];
1628ef270ab1SKenneth D. Merry #else
1629ef270ab1SKenneth D. Merry #error big endian version not defined
1630ef270ab1SKenneth D. Merry #endif
1631ef270ab1SKenneth D. Merry } sli4_req_common_create_cq_v2_t;
1632ef270ab1SKenneth D. Merry
1633ef270ab1SKenneth D. Merry /**
1634ef270ab1SKenneth D. Merry * @brief COMMON_CREATE_CQ_SET_V0
1635ef270ab1SKenneth D. Merry *
1636ef270ab1SKenneth D. Merry * Create a set of Completion Queues.
1637ef270ab1SKenneth D. Merry */
1638ef270ab1SKenneth D. Merry typedef struct sli4_req_common_create_cq_set_v0_s {
1639ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1640ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1641ef270ab1SKenneth D. Merry uint32_t num_pages:16,
1642ef270ab1SKenneth D. Merry page_size:8,
1643ef270ab1SKenneth D. Merry :8;
1644ef270ab1SKenneth D. Merry uint32_t :12,
1645ef270ab1SKenneth D. Merry clswm:2,
1646ef270ab1SKenneth D. Merry nodelay:1,
1647ef270ab1SKenneth D. Merry autovalid:1,
1648ef270ab1SKenneth D. Merry rsvd:11,
1649ef270ab1SKenneth D. Merry cqecnt:2,
1650ef270ab1SKenneth D. Merry valid:1,
1651ef270ab1SKenneth D. Merry :1,
1652ef270ab1SKenneth D. Merry evt:1;
1653ef270ab1SKenneth D. Merry uint32_t num_cq_req:16,
1654ef270ab1SKenneth D. Merry cqe_count:15,
1655ef270ab1SKenneth D. Merry arm:1;
1656ef270ab1SKenneth D. Merry uint16_t eq_id[16];
1657ef270ab1SKenneth D. Merry struct {
1658ef270ab1SKenneth D. Merry uint32_t low;
1659ef270ab1SKenneth D. Merry uint32_t high;
1660ef270ab1SKenneth D. Merry } page_physical_address[0];
1661ef270ab1SKenneth D. Merry #else
1662ef270ab1SKenneth D. Merry #error big endian version not defined
1663ef270ab1SKenneth D. Merry #endif
1664ef270ab1SKenneth D. Merry } sli4_req_common_create_cq_set_v0_t;
1665ef270ab1SKenneth D. Merry
1666ef270ab1SKenneth D. Merry /**
1667ef270ab1SKenneth D. Merry * CQE count.
1668ef270ab1SKenneth D. Merry */
1669ef270ab1SKenneth D. Merry #define SLI4_CQ_CNT_256 0
1670ef270ab1SKenneth D. Merry #define SLI4_CQ_CNT_512 1
1671ef270ab1SKenneth D. Merry #define SLI4_CQ_CNT_1024 2
1672ef270ab1SKenneth D. Merry #define SLI4_CQ_CNT_LARGE 3
1673ef270ab1SKenneth D. Merry
1674ef270ab1SKenneth D. Merry #define SLI4_CQE_BYTES (4 * sizeof(uint32_t))
1675ef270ab1SKenneth D. Merry
1676ef270ab1SKenneth D. Merry #define SLI4_COMMON_CREATE_CQ_V2_MAX_PAGES 8
1677ef270ab1SKenneth D. Merry
1678ef270ab1SKenneth D. Merry /**
1679ef270ab1SKenneth D. Merry * @brief Generic Common Create EQ/CQ/MQ/WQ/RQ Queue completion
1680ef270ab1SKenneth D. Merry */
1681ef270ab1SKenneth D. Merry typedef struct sli4_res_common_create_queue_s {
1682ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
1683ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1684ef270ab1SKenneth D. Merry uint32_t q_id:16,
1685ef270ab1SKenneth D. Merry :8,
1686ef270ab1SKenneth D. Merry ulp:8;
1687ef270ab1SKenneth D. Merry uint32_t db_offset;
1688ef270ab1SKenneth D. Merry uint32_t db_rs:16,
1689ef270ab1SKenneth D. Merry db_fmt:16;
1690ef270ab1SKenneth D. Merry #else
1691ef270ab1SKenneth D. Merry #error big endian version not defined
1692ef270ab1SKenneth D. Merry #endif
1693ef270ab1SKenneth D. Merry } sli4_res_common_create_queue_t;
1694ef270ab1SKenneth D. Merry
1695ef270ab1SKenneth D. Merry typedef struct sli4_res_common_create_queue_set_s {
1696ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
1697ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1698ef270ab1SKenneth D. Merry uint32_t q_id:16,
1699ef270ab1SKenneth D. Merry num_q_allocated:16;
1700ef270ab1SKenneth D. Merry #else
1701ef270ab1SKenneth D. Merry #error big endian version not defined
1702ef270ab1SKenneth D. Merry #endif
1703ef270ab1SKenneth D. Merry } sli4_res_common_create_queue_set_t;
1704ef270ab1SKenneth D. Merry
1705ef270ab1SKenneth D. Merry /**
1706ef270ab1SKenneth D. Merry * @brief Common Destroy CQ
1707ef270ab1SKenneth D. Merry */
1708ef270ab1SKenneth D. Merry typedef struct sli4_req_common_destroy_cq_s {
1709ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1710ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1711ef270ab1SKenneth D. Merry uint32_t cq_id:16,
1712ef270ab1SKenneth D. Merry :16;
1713ef270ab1SKenneth D. Merry #else
1714ef270ab1SKenneth D. Merry #error big endian version not defined
1715ef270ab1SKenneth D. Merry #endif
1716ef270ab1SKenneth D. Merry } sli4_req_common_destroy_cq_t;
1717ef270ab1SKenneth D. Merry
1718ef270ab1SKenneth D. Merry /**
1719ef270ab1SKenneth D. Merry * @brief COMMON_MODIFY_EQ_DELAY
1720ef270ab1SKenneth D. Merry *
1721ef270ab1SKenneth D. Merry * Modify the delay multiplier for EQs
1722ef270ab1SKenneth D. Merry */
1723ef270ab1SKenneth D. Merry typedef struct sli4_req_common_modify_eq_delay_s {
1724ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1725ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1726ef270ab1SKenneth D. Merry uint32_t num_eq;
1727ef270ab1SKenneth D. Merry struct {
1728ef270ab1SKenneth D. Merry uint32_t eq_id;
1729ef270ab1SKenneth D. Merry uint32_t phase;
1730ef270ab1SKenneth D. Merry uint32_t delay_multiplier;
1731ef270ab1SKenneth D. Merry } eq_delay_record[8];
1732ef270ab1SKenneth D. Merry #else
1733ef270ab1SKenneth D. Merry #error big endian version not defined
1734ef270ab1SKenneth D. Merry #endif
1735ef270ab1SKenneth D. Merry } sli4_req_common_modify_eq_delay_t;
1736ef270ab1SKenneth D. Merry
1737ef270ab1SKenneth D. Merry /**
1738ef270ab1SKenneth D. Merry * @brief COMMON_CREATE_EQ
1739ef270ab1SKenneth D. Merry *
1740ef270ab1SKenneth D. Merry * Create an Event Queue.
1741ef270ab1SKenneth D. Merry */
1742ef270ab1SKenneth D. Merry typedef struct sli4_req_common_create_eq_s {
1743ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1744ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1745ef270ab1SKenneth D. Merry uint32_t num_pages:16,
1746ef270ab1SKenneth D. Merry :16;
17473bf42363SRam Kishore Vegesna uint32_t :28,
17483bf42363SRam Kishore Vegesna autovalid:1,
1749ef270ab1SKenneth D. Merry valid:1,
1750ef270ab1SKenneth D. Merry :1,
1751ef270ab1SKenneth D. Merry eqesz:1;
1752ef270ab1SKenneth D. Merry uint32_t :26,
1753ef270ab1SKenneth D. Merry count:3,
1754ef270ab1SKenneth D. Merry :2,
1755ef270ab1SKenneth D. Merry arm:1;
1756ef270ab1SKenneth D. Merry uint32_t :13,
1757ef270ab1SKenneth D. Merry delay_multiplier:10,
1758ef270ab1SKenneth D. Merry :9;
1759ef270ab1SKenneth D. Merry uint32_t rsvd;
1760ef270ab1SKenneth D. Merry struct {
1761ef270ab1SKenneth D. Merry uint32_t low;
1762ef270ab1SKenneth D. Merry uint32_t high;
1763ef270ab1SKenneth D. Merry } page_address[8];
1764ef270ab1SKenneth D. Merry #else
1765ef270ab1SKenneth D. Merry #error big endian version not defined
1766ef270ab1SKenneth D. Merry #endif
1767ef270ab1SKenneth D. Merry } sli4_req_common_create_eq_t;
1768ef270ab1SKenneth D. Merry
1769ef270ab1SKenneth D. Merry #define SLI4_EQ_CNT_256 0
1770ef270ab1SKenneth D. Merry #define SLI4_EQ_CNT_512 1
1771ef270ab1SKenneth D. Merry #define SLI4_EQ_CNT_1024 2
1772ef270ab1SKenneth D. Merry #define SLI4_EQ_CNT_2048 3
1773ef270ab1SKenneth D. Merry #define SLI4_EQ_CNT_4096 4
1774ef270ab1SKenneth D. Merry
1775ef270ab1SKenneth D. Merry #define SLI4_EQE_SIZE_4 0
1776ef270ab1SKenneth D. Merry #define SLI4_EQE_SIZE_16 1
1777ef270ab1SKenneth D. Merry
1778ef270ab1SKenneth D. Merry /**
1779ef270ab1SKenneth D. Merry * @brief Common Destroy EQ
1780ef270ab1SKenneth D. Merry */
1781ef270ab1SKenneth D. Merry typedef struct sli4_req_common_destroy_eq_s {
1782ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1783ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1784ef270ab1SKenneth D. Merry uint32_t eq_id:16,
1785ef270ab1SKenneth D. Merry :16;
1786ef270ab1SKenneth D. Merry #else
1787ef270ab1SKenneth D. Merry #error big endian version not defined
1788ef270ab1SKenneth D. Merry #endif
1789ef270ab1SKenneth D. Merry } sli4_req_common_destroy_eq_t;
1790ef270ab1SKenneth D. Merry
1791ef270ab1SKenneth D. Merry /**
1792ef270ab1SKenneth D. Merry * @brief COMMON_CREATE_MQ_EXT
1793ef270ab1SKenneth D. Merry *
1794ef270ab1SKenneth D. Merry * Create a Mailbox Queue; accommodate v0 and v1 forms.
1795ef270ab1SKenneth D. Merry */
1796ef270ab1SKenneth D. Merry typedef struct sli4_req_common_create_mq_ext_s {
1797ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1798ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1799ef270ab1SKenneth D. Merry uint32_t num_pages:16,
1800ef270ab1SKenneth D. Merry cq_id_v1:16;
1801ef270ab1SKenneth D. Merry uint32_t async_event_bitmap;
1802ef270ab1SKenneth D. Merry uint32_t async_cq_id_v1:16,
1803ef270ab1SKenneth D. Merry ring_size:4,
1804ef270ab1SKenneth D. Merry :2,
1805ef270ab1SKenneth D. Merry cq_id_v0:10;
1806ef270ab1SKenneth D. Merry uint32_t :31,
1807ef270ab1SKenneth D. Merry val:1;
1808ef270ab1SKenneth D. Merry uint32_t acqv:1,
1809ef270ab1SKenneth D. Merry async_cq_id_v0:10,
1810ef270ab1SKenneth D. Merry :21;
1811ef270ab1SKenneth D. Merry uint32_t rsvd9;
1812ef270ab1SKenneth D. Merry struct {
1813ef270ab1SKenneth D. Merry uint32_t low;
1814ef270ab1SKenneth D. Merry uint32_t high;
1815ef270ab1SKenneth D. Merry } page_physical_address[8];
1816ef270ab1SKenneth D. Merry #else
1817ef270ab1SKenneth D. Merry #error big endian version not defined
1818ef270ab1SKenneth D. Merry #endif
1819ef270ab1SKenneth D. Merry } sli4_req_common_create_mq_ext_t;
1820ef270ab1SKenneth D. Merry
1821ef270ab1SKenneth D. Merry #define SLI4_MQE_SIZE_16 0x05
1822ef270ab1SKenneth D. Merry #define SLI4_MQE_SIZE_32 0x06
1823ef270ab1SKenneth D. Merry #define SLI4_MQE_SIZE_64 0x07
1824ef270ab1SKenneth D. Merry #define SLI4_MQE_SIZE_128 0x08
1825ef270ab1SKenneth D. Merry
1826ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_LINK_STATE BIT(1)
1827ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_FCOE_FIP BIT(2)
1828ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_DCBX BIT(3)
1829ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_ISCSI BIT(4)
1830ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_GRP5 BIT(5)
1831ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_FC BIT(16)
1832ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_SLI_PORT BIT(17)
1833ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_VF BIT(18)
1834ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_MR BIT(19)
1835ef270ab1SKenneth D. Merry
1836ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_ALL \
1837ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_LINK_STATE | \
1838ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_FCOE_FIP | \
1839ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_DCBX | \
1840ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_ISCSI | \
1841ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_GRP5 | \
1842ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_FC | \
1843ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_SLI_PORT | \
1844ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_VF |\
1845ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_MR
1846ef270ab1SKenneth D. Merry
1847ef270ab1SKenneth D. Merry #define SLI4_ASYNC_EVT_FC_FCOE \
1848ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_LINK_STATE | \
1849ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_FCOE_FIP | \
1850ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_GRP5 | \
1851ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_FC | \
1852ef270ab1SKenneth D. Merry SLI4_ASYNC_EVT_SLI_PORT
1853ef270ab1SKenneth D. Merry
1854ef270ab1SKenneth D. Merry /**
1855ef270ab1SKenneth D. Merry * @brief Common Destroy MQ
1856ef270ab1SKenneth D. Merry */
1857ef270ab1SKenneth D. Merry typedef struct sli4_req_common_destroy_mq_s {
1858ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1859ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1860ef270ab1SKenneth D. Merry uint32_t mq_id:16,
1861ef270ab1SKenneth D. Merry :16;
1862ef270ab1SKenneth D. Merry #else
1863ef270ab1SKenneth D. Merry #error big endian version not defined
1864ef270ab1SKenneth D. Merry #endif
1865ef270ab1SKenneth D. Merry } sli4_req_common_destroy_mq_t;
1866ef270ab1SKenneth D. Merry
1867ef270ab1SKenneth D. Merry /**
1868ef270ab1SKenneth D. Merry * @brief COMMON_GET_CNTL_ATTRIBUTES
1869ef270ab1SKenneth D. Merry *
1870ef270ab1SKenneth D. Merry * Query for information about the SLI Port
1871ef270ab1SKenneth D. Merry */
1872ef270ab1SKenneth D. Merry typedef struct sli4_res_common_get_cntl_attributes_s {
1873ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
1874ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1875ef270ab1SKenneth D. Merry uint8_t version_string[32];
1876ef270ab1SKenneth D. Merry uint8_t manufacturer_name[32];
1877ef270ab1SKenneth D. Merry uint32_t supported_modes;
1878ef270ab1SKenneth D. Merry uint32_t eprom_version_lo:8,
1879ef270ab1SKenneth D. Merry eprom_version_hi:8,
1880ef270ab1SKenneth D. Merry :16;
1881ef270ab1SKenneth D. Merry uint32_t mbx_data_structure_version;
1882ef270ab1SKenneth D. Merry uint32_t ep_firmware_data_structure_version;
1883ef270ab1SKenneth D. Merry uint8_t ncsi_version_string[12];
1884ef270ab1SKenneth D. Merry uint32_t default_extended_timeout;
1885ef270ab1SKenneth D. Merry uint8_t model_number[32];
1886ef270ab1SKenneth D. Merry uint8_t description[64];
1887ef270ab1SKenneth D. Merry uint8_t serial_number[32];
1888ef270ab1SKenneth D. Merry uint8_t ip_version_string[32];
1889ef270ab1SKenneth D. Merry uint8_t fw_version_string[32];
1890ef270ab1SKenneth D. Merry uint8_t bios_version_string[32];
1891ef270ab1SKenneth D. Merry uint8_t redboot_version_string[32];
1892ef270ab1SKenneth D. Merry uint8_t driver_version_string[32];
1893ef270ab1SKenneth D. Merry uint8_t fw_on_flash_version_string[32];
1894ef270ab1SKenneth D. Merry uint32_t functionalities_supported;
1895ef270ab1SKenneth D. Merry uint32_t max_cdb_length:16,
1896ef270ab1SKenneth D. Merry asic_revision:8,
1897ef270ab1SKenneth D. Merry generational_guid0:8;
1898ef270ab1SKenneth D. Merry uint32_t generational_guid1_12[3];
1899ef270ab1SKenneth D. Merry uint32_t generational_guid13:24,
1900ef270ab1SKenneth D. Merry hba_port_count:8;
1901ef270ab1SKenneth D. Merry uint32_t default_link_down_timeout:16,
1902ef270ab1SKenneth D. Merry iscsi_version_min_max:8,
1903ef270ab1SKenneth D. Merry multifunctional_device:8;
1904ef270ab1SKenneth D. Merry uint32_t cache_valid:8,
1905ef270ab1SKenneth D. Merry hba_status:8,
1906ef270ab1SKenneth D. Merry max_domains_supported:8,
1907ef270ab1SKenneth D. Merry port_number:6,
1908ef270ab1SKenneth D. Merry port_type:2;
1909ef270ab1SKenneth D. Merry uint32_t firmware_post_status;
1910ef270ab1SKenneth D. Merry uint32_t hba_mtu;
1911ef270ab1SKenneth D. Merry uint32_t iscsi_features:8,
1912ef270ab1SKenneth D. Merry rsvd121:24;
1913ef270ab1SKenneth D. Merry uint32_t pci_vendor_id:16,
1914ef270ab1SKenneth D. Merry pci_device_id:16;
1915ef270ab1SKenneth D. Merry uint32_t pci_sub_vendor_id:16,
1916ef270ab1SKenneth D. Merry pci_sub_system_id:16;
1917ef270ab1SKenneth D. Merry uint32_t pci_bus_number:8,
1918ef270ab1SKenneth D. Merry pci_device_number:8,
1919ef270ab1SKenneth D. Merry pci_function_number:8,
1920ef270ab1SKenneth D. Merry interface_type:8;
1921ef270ab1SKenneth D. Merry uint64_t unique_identifier;
1922ef270ab1SKenneth D. Merry uint32_t number_of_netfilters:8,
1923ef270ab1SKenneth D. Merry rsvd130:24;
1924ef270ab1SKenneth D. Merry #else
1925ef270ab1SKenneth D. Merry #error big endian version not defined
1926ef270ab1SKenneth D. Merry #endif
1927ef270ab1SKenneth D. Merry } sli4_res_common_get_cntl_attributes_t;
1928ef270ab1SKenneth D. Merry
1929ef270ab1SKenneth D. Merry /**
1930ef270ab1SKenneth D. Merry * @brief COMMON_GET_CNTL_ATTRIBUTES
1931ef270ab1SKenneth D. Merry *
1932ef270ab1SKenneth D. Merry * This command queries the controller information from the Flash ROM.
1933ef270ab1SKenneth D. Merry */
1934ef270ab1SKenneth D. Merry typedef struct sli4_req_common_get_cntl_addl_attributes_s {
1935ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1936ef270ab1SKenneth D. Merry } sli4_req_common_get_cntl_addl_attributes_t;
1937ef270ab1SKenneth D. Merry
1938ef270ab1SKenneth D. Merry typedef struct sli4_res_common_get_cntl_addl_attributes_s {
1939ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
1940ef270ab1SKenneth D. Merry uint16_t ipl_file_number;
1941ef270ab1SKenneth D. Merry uint8_t ipl_file_version;
1942ef270ab1SKenneth D. Merry uint8_t rsvd0;
1943ef270ab1SKenneth D. Merry uint8_t on_die_temperature;
1944ef270ab1SKenneth D. Merry uint8_t rsvd1[3];
1945ef270ab1SKenneth D. Merry uint32_t driver_advanced_features_supported;
1946ef270ab1SKenneth D. Merry uint32_t rsvd2[4];
1947ef270ab1SKenneth D. Merry char fcoe_universal_bios_version[32];
1948ef270ab1SKenneth D. Merry char fcoe_x86_bios_version[32];
1949ef270ab1SKenneth D. Merry char fcoe_efi_bios_version[32];
1950ef270ab1SKenneth D. Merry char fcoe_fcode_version[32];
1951ef270ab1SKenneth D. Merry char uefi_bios_version[32];
1952ef270ab1SKenneth D. Merry char uefi_nic_version[32];
1953ef270ab1SKenneth D. Merry char uefi_fcode_version[32];
1954ef270ab1SKenneth D. Merry char uefi_iscsi_version[32];
1955ef270ab1SKenneth D. Merry char iscsi_x86_bios_version[32];
1956ef270ab1SKenneth D. Merry char pxe_x86_bios_version[32];
1957ef270ab1SKenneth D. Merry uint8_t fcoe_default_wwpn[8];
1958ef270ab1SKenneth D. Merry uint8_t ext_phy_version[32];
1959ef270ab1SKenneth D. Merry uint8_t fc_universal_bios_version[32];
1960ef270ab1SKenneth D. Merry uint8_t fc_x86_bios_version[32];
1961ef270ab1SKenneth D. Merry uint8_t fc_efi_bios_version[32];
1962ef270ab1SKenneth D. Merry uint8_t fc_fcode_version[32];
1963ef270ab1SKenneth D. Merry uint8_t ext_phy_crc_label[8];
1964ef270ab1SKenneth D. Merry uint8_t ipl_file_name[16];
1965ef270ab1SKenneth D. Merry uint8_t rsvd3[72];
1966ef270ab1SKenneth D. Merry } sli4_res_common_get_cntl_addl_attributes_t;
1967ef270ab1SKenneth D. Merry
1968ef270ab1SKenneth D. Merry /**
1969ef270ab1SKenneth D. Merry * @brief COMMON_NOP
1970ef270ab1SKenneth D. Merry *
1971ef270ab1SKenneth D. Merry * This command does not do anything; it only returns the payload in the completion.
1972ef270ab1SKenneth D. Merry */
1973ef270ab1SKenneth D. Merry typedef struct sli4_req_common_nop_s {
1974ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1975ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1976ef270ab1SKenneth D. Merry uint32_t context[2];
1977ef270ab1SKenneth D. Merry #else
1978ef270ab1SKenneth D. Merry #error big endian version not defined
1979ef270ab1SKenneth D. Merry #endif
1980ef270ab1SKenneth D. Merry } sli4_req_common_nop_t;
1981ef270ab1SKenneth D. Merry
1982ef270ab1SKenneth D. Merry typedef struct sli4_res_common_nop_s {
1983ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
1984ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1985ef270ab1SKenneth D. Merry uint32_t context[2];
1986ef270ab1SKenneth D. Merry #else
1987ef270ab1SKenneth D. Merry #error big endian version not defined
1988ef270ab1SKenneth D. Merry #endif
1989ef270ab1SKenneth D. Merry } sli4_res_common_nop_t;
1990ef270ab1SKenneth D. Merry
1991ef270ab1SKenneth D. Merry /**
1992ef270ab1SKenneth D. Merry * @brief COMMON_GET_RESOURCE_EXTENT_INFO
1993ef270ab1SKenneth D. Merry */
1994ef270ab1SKenneth D. Merry typedef struct sli4_req_common_get_resource_extent_info_s {
1995ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
1996ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
1997ef270ab1SKenneth D. Merry uint32_t resource_type:16,
1998ef270ab1SKenneth D. Merry :16;
1999ef270ab1SKenneth D. Merry #else
2000ef270ab1SKenneth D. Merry #error big endian version not defined
2001ef270ab1SKenneth D. Merry #endif
2002ef270ab1SKenneth D. Merry } sli4_req_common_get_resource_extent_info_t;
2003ef270ab1SKenneth D. Merry
2004ef270ab1SKenneth D. Merry #define SLI4_RSC_TYPE_ISCSI_INI_XRI 0x0c
2005ef270ab1SKenneth D. Merry #define SLI4_RSC_TYPE_FCOE_VFI 0x20
2006ef270ab1SKenneth D. Merry #define SLI4_RSC_TYPE_FCOE_VPI 0x21
2007ef270ab1SKenneth D. Merry #define SLI4_RSC_TYPE_FCOE_RPI 0x22
2008ef270ab1SKenneth D. Merry #define SLI4_RSC_TYPE_FCOE_XRI 0x23
2009ef270ab1SKenneth D. Merry
2010ef270ab1SKenneth D. Merry typedef struct sli4_res_common_get_resource_extent_info_s {
2011ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2012ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2013ef270ab1SKenneth D. Merry uint32_t resource_extent_count:16,
2014ef270ab1SKenneth D. Merry resource_extent_size:16;
2015ef270ab1SKenneth D. Merry #else
2016ef270ab1SKenneth D. Merry #error big endian version not defined
2017ef270ab1SKenneth D. Merry #endif
2018ef270ab1SKenneth D. Merry } sli4_res_common_get_resource_extent_info_t;
2019ef270ab1SKenneth D. Merry
2020ef270ab1SKenneth D. Merry #define SLI4_128BYTE_WQE_SUPPORT 0x02
2021ef270ab1SKenneth D. Merry /**
2022ef270ab1SKenneth D. Merry * @brief COMMON_GET_SLI4_PARAMETERS
2023ef270ab1SKenneth D. Merry */
2024ef270ab1SKenneth D. Merry typedef struct sli4_res_common_get_sli4_parameters_s {
2025ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2026ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2027ef270ab1SKenneth D. Merry uint32_t protocol_type:8,
2028ef270ab1SKenneth D. Merry :24;
2029ef270ab1SKenneth D. Merry uint32_t ft:1,
2030ef270ab1SKenneth D. Merry :3,
2031ef270ab1SKenneth D. Merry sli_revision:4,
2032ef270ab1SKenneth D. Merry sli_family:4,
2033ef270ab1SKenneth D. Merry if_type:4,
2034ef270ab1SKenneth D. Merry sli_hint_1:8,
2035ef270ab1SKenneth D. Merry sli_hint_2:5,
2036ef270ab1SKenneth D. Merry :3;
2037ef270ab1SKenneth D. Merry uint32_t eq_page_cnt:4,
2038ef270ab1SKenneth D. Merry :4,
2039ef270ab1SKenneth D. Merry eqe_sizes:4,
2040ef270ab1SKenneth D. Merry :4,
2041ef270ab1SKenneth D. Merry eq_page_sizes:8,
2042ef270ab1SKenneth D. Merry eqe_count_method:4,
2043ef270ab1SKenneth D. Merry :4;
2044ef270ab1SKenneth D. Merry uint32_t eqe_count_mask:16,
2045ef270ab1SKenneth D. Merry :16;
2046ef270ab1SKenneth D. Merry uint32_t cq_page_cnt:4,
2047ef270ab1SKenneth D. Merry :4,
2048ef270ab1SKenneth D. Merry cqe_sizes:4,
2049ef270ab1SKenneth D. Merry :2,
2050ef270ab1SKenneth D. Merry cqv:2,
2051ef270ab1SKenneth D. Merry cq_page_sizes:8,
2052ef270ab1SKenneth D. Merry cqe_count_method:4,
2053ef270ab1SKenneth D. Merry :4;
2054ef270ab1SKenneth D. Merry uint32_t cqe_count_mask:16,
2055ef270ab1SKenneth D. Merry :16;
2056ef270ab1SKenneth D. Merry uint32_t mq_page_cnt:4,
2057ef270ab1SKenneth D. Merry :10,
2058ef270ab1SKenneth D. Merry mqv:2,
2059ef270ab1SKenneth D. Merry mq_page_sizes:8,
2060ef270ab1SKenneth D. Merry mqe_count_method:4,
2061ef270ab1SKenneth D. Merry :4;
2062ef270ab1SKenneth D. Merry uint32_t mqe_count_mask:16,
2063ef270ab1SKenneth D. Merry :16;
2064ef270ab1SKenneth D. Merry uint32_t wq_page_cnt:4,
2065ef270ab1SKenneth D. Merry :4,
2066ef270ab1SKenneth D. Merry wqe_sizes:4,
2067ef270ab1SKenneth D. Merry :2,
2068ef270ab1SKenneth D. Merry wqv:2,
2069ef270ab1SKenneth D. Merry wq_page_sizes:8,
2070ef270ab1SKenneth D. Merry wqe_count_method:4,
2071ef270ab1SKenneth D. Merry :4;
2072ef270ab1SKenneth D. Merry uint32_t wqe_count_mask:16,
2073ef270ab1SKenneth D. Merry :16;
2074ef270ab1SKenneth D. Merry uint32_t rq_page_cnt:4,
2075ef270ab1SKenneth D. Merry :4,
2076ef270ab1SKenneth D. Merry rqe_sizes:4,
2077ef270ab1SKenneth D. Merry :2,
2078ef270ab1SKenneth D. Merry rqv:2,
2079ef270ab1SKenneth D. Merry rq_page_sizes:8,
2080ef270ab1SKenneth D. Merry rqe_count_method:4,
2081ef270ab1SKenneth D. Merry :4;
2082ef270ab1SKenneth D. Merry uint32_t rqe_count_mask:16,
2083ef270ab1SKenneth D. Merry :12,
2084ef270ab1SKenneth D. Merry rq_db_window:4;
2085ef270ab1SKenneth D. Merry uint32_t fcoe:1,
2086ef270ab1SKenneth D. Merry ext:1,
2087ef270ab1SKenneth D. Merry hdrr:1,
2088ef270ab1SKenneth D. Merry sglr:1,
2089ef270ab1SKenneth D. Merry fbrr:1,
2090ef270ab1SKenneth D. Merry areg:1,
2091ef270ab1SKenneth D. Merry tgt:1,
2092ef270ab1SKenneth D. Merry terp:1,
2093ef270ab1SKenneth D. Merry assi:1,
2094ef270ab1SKenneth D. Merry wchn:1,
2095ef270ab1SKenneth D. Merry tcca:1,
2096ef270ab1SKenneth D. Merry trty:1,
2097ef270ab1SKenneth D. Merry trir:1,
2098ef270ab1SKenneth D. Merry phoff:1,
2099ef270ab1SKenneth D. Merry phon:1,
2100ef270ab1SKenneth D. Merry phwq:1, /** Performance Hint WQ_ID Association */
2101ef270ab1SKenneth D. Merry boundary_4ga:1,
2102ef270ab1SKenneth D. Merry rxc:1,
2103ef270ab1SKenneth D. Merry hlm:1,
2104ef270ab1SKenneth D. Merry ipr:1,
2105ef270ab1SKenneth D. Merry rxri:1,
2106ef270ab1SKenneth D. Merry sglc:1,
2107ef270ab1SKenneth D. Merry timm:1,
2108ef270ab1SKenneth D. Merry tsmm:1,
2109ef270ab1SKenneth D. Merry :1,
2110ef270ab1SKenneth D. Merry oas:1,
2111ef270ab1SKenneth D. Merry lc:1,
2112ef270ab1SKenneth D. Merry agxf:1,
2113ef270ab1SKenneth D. Merry loopback_scope:4;
2114ef270ab1SKenneth D. Merry uint32_t sge_supported_length;
2115ef270ab1SKenneth D. Merry uint32_t sgl_page_cnt:4,
2116ef270ab1SKenneth D. Merry :4,
2117ef270ab1SKenneth D. Merry sgl_page_sizes:8,
2118ef270ab1SKenneth D. Merry sgl_pp_align:8,
2119ef270ab1SKenneth D. Merry :8;
2120ef270ab1SKenneth D. Merry uint32_t min_rq_buffer_size:16,
2121ef270ab1SKenneth D. Merry :16;
2122ef270ab1SKenneth D. Merry uint32_t max_rq_buffer_size;
2123ef270ab1SKenneth D. Merry uint32_t physical_xri_max:16,
2124ef270ab1SKenneth D. Merry physical_rpi_max:16;
2125ef270ab1SKenneth D. Merry uint32_t physical_vpi_max:16,
2126ef270ab1SKenneth D. Merry physical_vfi_max:16;
2127ef270ab1SKenneth D. Merry uint32_t rsvd19;
2128ef270ab1SKenneth D. Merry uint32_t frag_num_field_offset:16, /* dword 20 */
2129ef270ab1SKenneth D. Merry frag_num_field_size:16;
2130ef270ab1SKenneth D. Merry uint32_t sgl_index_field_offset:16, /* dword 21 */
2131ef270ab1SKenneth D. Merry sgl_index_field_size:16;
2132ef270ab1SKenneth D. Merry uint32_t chain_sge_initial_value_lo; /* dword 22 */
2133ef270ab1SKenneth D. Merry uint32_t chain_sge_initial_value_hi; /* dword 23 */
2134ef270ab1SKenneth D. Merry #else
2135ef270ab1SKenneth D. Merry #error big endian version not defined
2136ef270ab1SKenneth D. Merry #endif
2137ef270ab1SKenneth D. Merry } sli4_res_common_get_sli4_parameters_t;
2138ef270ab1SKenneth D. Merry
2139ef270ab1SKenneth D. Merry /**
2140ef270ab1SKenneth D. Merry * @brief COMMON_QUERY_FW_CONFIG
2141ef270ab1SKenneth D. Merry *
2142ef270ab1SKenneth D. Merry * This command retrieves firmware configuration parameters and adapter
2143ef270ab1SKenneth D. Merry * resources available to the driver.
2144ef270ab1SKenneth D. Merry */
2145ef270ab1SKenneth D. Merry typedef struct sli4_req_common_query_fw_config_s {
2146ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2147ef270ab1SKenneth D. Merry } sli4_req_common_query_fw_config_t;
2148ef270ab1SKenneth D. Merry
2149ef270ab1SKenneth D. Merry #define SLI4_FUNCTION_MODE_FCOE_INI_MODE 0x40
2150ef270ab1SKenneth D. Merry #define SLI4_FUNCTION_MODE_FCOE_TGT_MODE 0x80
2151ef270ab1SKenneth D. Merry #define SLI4_FUNCTION_MODE_DUA_MODE 0x800
2152ef270ab1SKenneth D. Merry
2153ef270ab1SKenneth D. Merry #define SLI4_ULP_MODE_FCOE_INI 0x40
2154ef270ab1SKenneth D. Merry #define SLI4_ULP_MODE_FCOE_TGT 0x80
2155ef270ab1SKenneth D. Merry
2156ef270ab1SKenneth D. Merry typedef struct sli4_res_common_query_fw_config_s {
2157ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2158ef270ab1SKenneth D. Merry uint32_t config_number;
2159ef270ab1SKenneth D. Merry uint32_t asic_rev;
2160ef270ab1SKenneth D. Merry uint32_t physical_port;
2161ef270ab1SKenneth D. Merry uint32_t function_mode;
2162ef270ab1SKenneth D. Merry uint32_t ulp0_mode;
2163ef270ab1SKenneth D. Merry uint32_t ulp0_nic_wqid_base;
2164ef270ab1SKenneth D. Merry uint32_t ulp0_nic_wq_total; /* Dword 10 */
2165ef270ab1SKenneth D. Merry uint32_t ulp0_toe_wqid_base;
2166ef270ab1SKenneth D. Merry uint32_t ulp0_toe_wq_total;
2167ef270ab1SKenneth D. Merry uint32_t ulp0_toe_rqid_base;
2168ef270ab1SKenneth D. Merry uint32_t ulp0_toe_rq_total;
2169ef270ab1SKenneth D. Merry uint32_t ulp0_toe_defrqid_base;
2170ef270ab1SKenneth D. Merry uint32_t ulp0_toe_defrq_total;
2171ef270ab1SKenneth D. Merry uint32_t ulp0_lro_rqid_base;
2172ef270ab1SKenneth D. Merry uint32_t ulp0_lro_rq_total;
2173ef270ab1SKenneth D. Merry uint32_t ulp0_iscsi_icd_base;
2174ef270ab1SKenneth D. Merry uint32_t ulp0_iscsi_icd_total; /* Dword 20 */
2175ef270ab1SKenneth D. Merry uint32_t ulp1_mode;
2176ef270ab1SKenneth D. Merry uint32_t ulp1_nic_wqid_base;
2177ef270ab1SKenneth D. Merry uint32_t ulp1_nic_wq_total;
2178ef270ab1SKenneth D. Merry uint32_t ulp1_toe_wqid_base;
2179ef270ab1SKenneth D. Merry uint32_t ulp1_toe_wq_total;
2180ef270ab1SKenneth D. Merry uint32_t ulp1_toe_rqid_base;
2181ef270ab1SKenneth D. Merry uint32_t ulp1_toe_rq_total;
2182ef270ab1SKenneth D. Merry uint32_t ulp1_toe_defrqid_base;
2183ef270ab1SKenneth D. Merry uint32_t ulp1_toe_defrq_total;
2184ef270ab1SKenneth D. Merry uint32_t ulp1_lro_rqid_base; /* Dword 30 */
2185ef270ab1SKenneth D. Merry uint32_t ulp1_lro_rq_total;
2186ef270ab1SKenneth D. Merry uint32_t ulp1_iscsi_icd_base;
2187ef270ab1SKenneth D. Merry uint32_t ulp1_iscsi_icd_total;
2188ef270ab1SKenneth D. Merry uint32_t function_capabilities;
2189ef270ab1SKenneth D. Merry uint32_t ulp0_cq_base;
2190ef270ab1SKenneth D. Merry uint32_t ulp0_cq_total;
2191ef270ab1SKenneth D. Merry uint32_t ulp0_eq_base;
2192ef270ab1SKenneth D. Merry uint32_t ulp0_eq_total;
2193ef270ab1SKenneth D. Merry uint32_t ulp0_iscsi_chain_icd_base;
2194ef270ab1SKenneth D. Merry uint32_t ulp0_iscsi_chain_icd_total; /* Dword 40 */
2195ef270ab1SKenneth D. Merry uint32_t ulp1_iscsi_chain_icd_base;
2196ef270ab1SKenneth D. Merry uint32_t ulp1_iscsi_chain_icd_total;
2197ef270ab1SKenneth D. Merry } sli4_res_common_query_fw_config_t;
2198ef270ab1SKenneth D. Merry
2199ef270ab1SKenneth D. Merry /**
2200ef270ab1SKenneth D. Merry * @brief COMMON_GET_PORT_NAME
2201ef270ab1SKenneth D. Merry */
2202ef270ab1SKenneth D. Merry typedef struct sli4_req_common_get_port_name_s {
2203ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2204ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2205ef270ab1SKenneth D. Merry uint32_t pt:2, /* only COMMON_GET_PORT_NAME_V1 */
2206ef270ab1SKenneth D. Merry :30;
2207ef270ab1SKenneth D. Merry #else
2208ef270ab1SKenneth D. Merry #error big endian version not defined
2209ef270ab1SKenneth D. Merry #endif
2210ef270ab1SKenneth D. Merry } sli4_req_common_get_port_name_t;
2211ef270ab1SKenneth D. Merry
2212ef270ab1SKenneth D. Merry typedef struct sli4_res_common_get_port_name_s {
2213ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2214ef270ab1SKenneth D. Merry char port_name[4];
2215ef270ab1SKenneth D. Merry } sli4_res_common_get_port_name_t;
2216ef270ab1SKenneth D. Merry
2217ef270ab1SKenneth D. Merry /**
2218ef270ab1SKenneth D. Merry * @brief COMMON_WRITE_FLASHROM
2219ef270ab1SKenneth D. Merry */
2220ef270ab1SKenneth D. Merry typedef struct sli4_req_common_write_flashrom_s {
2221ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2222ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2223ef270ab1SKenneth D. Merry uint32_t flash_rom_access_opcode;
2224ef270ab1SKenneth D. Merry uint32_t flash_rom_access_operation_type;
2225ef270ab1SKenneth D. Merry uint32_t data_buffer_size;
2226ef270ab1SKenneth D. Merry uint32_t offset;
2227ef270ab1SKenneth D. Merry uint8_t data_buffer[4];
2228ef270ab1SKenneth D. Merry #else
2229ef270ab1SKenneth D. Merry #error big endian version not defined
2230ef270ab1SKenneth D. Merry #endif
2231ef270ab1SKenneth D. Merry } sli4_req_common_write_flashrom_t;
2232ef270ab1SKenneth D. Merry
2233ef270ab1SKenneth D. Merry #define SLI4_MGMT_FLASHROM_OPCODE_FLASH 0x01
2234ef270ab1SKenneth D. Merry #define SLI4_MGMT_FLASHROM_OPCODE_SAVE 0x02
2235ef270ab1SKenneth D. Merry #define SLI4_MGMT_FLASHROM_OPCODE_CLEAR 0x03
2236ef270ab1SKenneth D. Merry #define SLI4_MGMT_FLASHROM_OPCODE_REPORT 0x04
2237ef270ab1SKenneth D. Merry #define SLI4_MGMT_FLASHROM_OPCODE_IMAGE_INFO 0x05
2238ef270ab1SKenneth D. Merry #define SLI4_MGMT_FLASHROM_OPCODE_IMAGE_CRC 0x06
2239ef270ab1SKenneth D. Merry #define SLI4_MGMT_FLASHROM_OPCODE_OFFSET_BASED_FLASH 0x07
2240ef270ab1SKenneth D. Merry #define SLI4_MGMT_FLASHROM_OPCODE_OFFSET_BASED_SAVE 0x08
2241ef270ab1SKenneth D. Merry #define SLI4_MGMT_PHY_FLASHROM_OPCODE_FLASH 0x09
2242ef270ab1SKenneth D. Merry #define SLI4_MGMT_PHY_FLASHROM_OPCODE_SAVE 0x0a
2243ef270ab1SKenneth D. Merry
2244ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_ISCSI 0x00
2245ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_REDBOOT 0x01
2246ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_BIOS 0x02
2247ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_PXE_BIOS 0x03
2248ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_CODE_CONTROL 0x04
2249ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_IPSEC_CFG 0x05
2250ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_INIT_DATA 0x06
2251ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_ROM_OFFSET 0x07
2252ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_FCOE_BIOS 0x08
2253ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_ISCSI_BAK 0x09
2254ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_FCOE_ACT 0x0a
2255ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_FCOE_BAK 0x0b
2256ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_CODE_CTRL_P 0x0c
2257ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_NCSI 0x0d
2258ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_NIC 0x0e
2259ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_DCBX 0x0f
2260ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_PXE_BIOS_CFG 0x10
2261ef270ab1SKenneth D. Merry #define SLI4_FLASH_ROM_ACCESS_OP_TYPE_ALL_CFG_DATA 0x11
2262ef270ab1SKenneth D. Merry
2263ef270ab1SKenneth D. Merry /**
2264ef270ab1SKenneth D. Merry * @brief COMMON_MANAGE_FAT
2265ef270ab1SKenneth D. Merry */
2266ef270ab1SKenneth D. Merry typedef struct sli4_req_common_manage_fat_s {
2267ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2268ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2269ef270ab1SKenneth D. Merry uint32_t fat_operation;
2270ef270ab1SKenneth D. Merry uint32_t read_log_offset;
2271ef270ab1SKenneth D. Merry uint32_t read_log_length;
2272ef270ab1SKenneth D. Merry uint32_t data_buffer_size;
2273ef270ab1SKenneth D. Merry uint32_t data_buffer; /* response only */
2274ef270ab1SKenneth D. Merry #else
2275ef270ab1SKenneth D. Merry #error big endian version not defined
2276ef270ab1SKenneth D. Merry #endif
2277ef270ab1SKenneth D. Merry } sli4_req_common_manage_fat_t;
2278ef270ab1SKenneth D. Merry
2279ef270ab1SKenneth D. Merry /**
2280ef270ab1SKenneth D. Merry * @brief COMMON_GET_EXT_FAT_CAPABILITIES
2281ef270ab1SKenneth D. Merry */
2282ef270ab1SKenneth D. Merry typedef struct sli4_req_common_get_ext_fat_capabilities_s {
2283ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2284ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2285ef270ab1SKenneth D. Merry uint32_t parameter_type;
2286ef270ab1SKenneth D. Merry #else
2287ef270ab1SKenneth D. Merry #error big endian version not defined
2288ef270ab1SKenneth D. Merry #endif
2289ef270ab1SKenneth D. Merry } sli4_req_common_get_ext_fat_capabilities_t;
2290ef270ab1SKenneth D. Merry
2291ef270ab1SKenneth D. Merry /**
2292ef270ab1SKenneth D. Merry * @brief COMMON_SET_EXT_FAT_CAPABILITIES
2293ef270ab1SKenneth D. Merry */
2294ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_ext_fat_capabilities_s {
2295ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2296ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2297ef270ab1SKenneth D. Merry uint32_t maximum_log_entries;
2298ef270ab1SKenneth D. Merry uint32_t log_entry_size;
2299ef270ab1SKenneth D. Merry uint32_t logging_type:8,
2300ef270ab1SKenneth D. Merry maximum_logging_functions:8,
2301ef270ab1SKenneth D. Merry maximum_logging_ports:8,
2302ef270ab1SKenneth D. Merry :8;
2303ef270ab1SKenneth D. Merry uint32_t supported_modes;
2304ef270ab1SKenneth D. Merry uint32_t number_modules;
2305ef270ab1SKenneth D. Merry uint32_t debug_module[14];
2306ef270ab1SKenneth D. Merry #else
2307ef270ab1SKenneth D. Merry #error big endian version not defined
2308ef270ab1SKenneth D. Merry #endif
2309ef270ab1SKenneth D. Merry } sli4_req_common_set_ext_fat_capabilities_t;
2310ef270ab1SKenneth D. Merry
2311ef270ab1SKenneth D. Merry /**
2312ef270ab1SKenneth D. Merry * @brief COMMON_EXT_FAT_CONFIGURE_SNAPSHOT
2313ef270ab1SKenneth D. Merry */
2314ef270ab1SKenneth D. Merry typedef struct sli4_req_common_ext_fat_configure_snapshot_s {
2315ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2316ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2317ef270ab1SKenneth D. Merry uint32_t total_log_entries;
2318ef270ab1SKenneth D. Merry #else
2319ef270ab1SKenneth D. Merry #error big endian version not defined
2320ef270ab1SKenneth D. Merry #endif
2321ef270ab1SKenneth D. Merry } sli4_req_common_ext_fat_configure_snapshot_t;
2322ef270ab1SKenneth D. Merry
2323ef270ab1SKenneth D. Merry /**
2324ef270ab1SKenneth D. Merry * @brief COMMON_EXT_FAT_RETRIEVE_SNAPSHOT
2325ef270ab1SKenneth D. Merry */
2326ef270ab1SKenneth D. Merry typedef struct sli4_req_common_ext_fat_retrieve_snapshot_s {
2327ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2328ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2329ef270ab1SKenneth D. Merry uint32_t snapshot_mode;
2330ef270ab1SKenneth D. Merry uint32_t start_index;
2331ef270ab1SKenneth D. Merry uint32_t number_log_entries;
2332ef270ab1SKenneth D. Merry #else
2333ef270ab1SKenneth D. Merry #error big endian version not defined
2334ef270ab1SKenneth D. Merry #endif
2335ef270ab1SKenneth D. Merry } sli4_req_common_ext_fat_retrieve_snapshot_t;
2336ef270ab1SKenneth D. Merry
2337ef270ab1SKenneth D. Merry typedef struct sli4_res_common_ext_fat_retrieve_snapshot_s {
2338ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2339ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2340ef270ab1SKenneth D. Merry uint32_t number_log_entries;
2341ef270ab1SKenneth D. Merry uint32_t version:8,
2342ef270ab1SKenneth D. Merry physical_port:8,
2343ef270ab1SKenneth D. Merry function_id:16;
2344ef270ab1SKenneth D. Merry uint32_t trace_level;
2345ef270ab1SKenneth D. Merry uint32_t module_mask[2];
2346ef270ab1SKenneth D. Merry uint32_t trace_table_index;
2347ef270ab1SKenneth D. Merry uint32_t timestamp;
2348ef270ab1SKenneth D. Merry uint8_t string_data[16];
2349ef270ab1SKenneth D. Merry uint32_t data[6];
2350ef270ab1SKenneth D. Merry #else
2351ef270ab1SKenneth D. Merry #error big endian version not defined
2352ef270ab1SKenneth D. Merry #endif
2353ef270ab1SKenneth D. Merry } sli4_res_common_ext_fat_retrieve_snapshot_t;
2354ef270ab1SKenneth D. Merry
2355ef270ab1SKenneth D. Merry /**
2356ef270ab1SKenneth D. Merry * @brief COMMON_EXT_FAT_READ_STRING_TABLE
2357ef270ab1SKenneth D. Merry */
2358ef270ab1SKenneth D. Merry typedef struct sli4_req_common_ext_fat_read_string_table_s {
2359ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2360ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2361ef270ab1SKenneth D. Merry uint32_t byte_offset;
2362ef270ab1SKenneth D. Merry uint32_t number_bytes;
2363ef270ab1SKenneth D. Merry #else
2364ef270ab1SKenneth D. Merry #error big endian version not defined
2365ef270ab1SKenneth D. Merry #endif
2366ef270ab1SKenneth D. Merry } sli4_req_common_ext_fat_read_string_table_t;
2367ef270ab1SKenneth D. Merry
2368ef270ab1SKenneth D. Merry typedef struct sli4_res_common_ext_fat_read_string_table_s {
2369ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2370ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2371ef270ab1SKenneth D. Merry uint32_t number_returned_bytes;
2372ef270ab1SKenneth D. Merry uint32_t number_remaining_bytes;
2373ef270ab1SKenneth D. Merry uint32_t table_data0:8,
2374ef270ab1SKenneth D. Merry :24;
2375ef270ab1SKenneth D. Merry uint8_t table_data[0];
2376ef270ab1SKenneth D. Merry #else
2377ef270ab1SKenneth D. Merry #error big endian version not defined
2378ef270ab1SKenneth D. Merry #endif
2379ef270ab1SKenneth D. Merry } sli4_res_common_ext_fat_read_string_table_t;
2380ef270ab1SKenneth D. Merry
2381ef270ab1SKenneth D. Merry /**
2382ef270ab1SKenneth D. Merry * @brief COMMON_READ_TRANSCEIVER_DATA
2383ef270ab1SKenneth D. Merry *
2384ef270ab1SKenneth D. Merry * This command reads SFF transceiver data(Format is defined
2385ef270ab1SKenneth D. Merry * by the SFF-8472 specification).
2386ef270ab1SKenneth D. Merry */
2387ef270ab1SKenneth D. Merry typedef struct sli4_req_common_read_transceiver_data_s {
2388ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2389ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2390ef270ab1SKenneth D. Merry uint32_t page_number;
2391ef270ab1SKenneth D. Merry uint32_t port;
2392ef270ab1SKenneth D. Merry #else
2393ef270ab1SKenneth D. Merry #error big endian version not defined
2394ef270ab1SKenneth D. Merry #endif
2395ef270ab1SKenneth D. Merry } sli4_req_common_read_transceiver_data_t;
2396ef270ab1SKenneth D. Merry
2397ef270ab1SKenneth D. Merry typedef struct sli4_res_common_read_transceiver_data_s {
2398ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2399ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2400ef270ab1SKenneth D. Merry uint32_t page_number;
2401ef270ab1SKenneth D. Merry uint32_t port;
2402ef270ab1SKenneth D. Merry uint32_t page_data[32];
2403ef270ab1SKenneth D. Merry uint32_t page_data_2[32];
2404ef270ab1SKenneth D. Merry #else
2405ef270ab1SKenneth D. Merry #error big endian version not defined
2406ef270ab1SKenneth D. Merry #endif
2407ef270ab1SKenneth D. Merry } sli4_res_common_read_transceiver_data_t;
2408ef270ab1SKenneth D. Merry
2409ef270ab1SKenneth D. Merry /**
2410ef270ab1SKenneth D. Merry * @brief COMMON_READ_OBJECT
2411ef270ab1SKenneth D. Merry */
2412ef270ab1SKenneth D. Merry typedef struct sli4_req_common_read_object_s {
2413ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2414ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2415ef270ab1SKenneth D. Merry uint32_t desired_read_length:24,
2416ef270ab1SKenneth D. Merry :8;
2417ef270ab1SKenneth D. Merry uint32_t read_offset;
2418ef270ab1SKenneth D. Merry uint8_t object_name[104];
2419ef270ab1SKenneth D. Merry uint32_t host_buffer_descriptor_count;
2420ef270ab1SKenneth D. Merry sli4_bde_t host_buffer_descriptor[0];
2421ef270ab1SKenneth D. Merry #else
2422ef270ab1SKenneth D. Merry #error big endian version not defined
2423ef270ab1SKenneth D. Merry #endif
2424ef270ab1SKenneth D. Merry } sli4_req_common_read_object_t;
2425ef270ab1SKenneth D. Merry
2426ef270ab1SKenneth D. Merry typedef struct sli4_res_common_read_object_s {
2427ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2428ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2429ef270ab1SKenneth D. Merry uint32_t actual_read_length;
2430ef270ab1SKenneth D. Merry uint32_t resv:31,
2431ef270ab1SKenneth D. Merry eof:1;
2432ef270ab1SKenneth D. Merry #else
2433ef270ab1SKenneth D. Merry #error big endian version not defined
2434ef270ab1SKenneth D. Merry #endif
2435ef270ab1SKenneth D. Merry } sli4_res_common_read_object_t;
2436ef270ab1SKenneth D. Merry
2437ef270ab1SKenneth D. Merry /**
2438ef270ab1SKenneth D. Merry * @brief COMMON_WRITE_OBJECT
2439ef270ab1SKenneth D. Merry */
2440ef270ab1SKenneth D. Merry typedef struct sli4_req_common_write_object_s {
2441ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2442ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2443ef270ab1SKenneth D. Merry uint32_t desired_write_length:24,
2444ef270ab1SKenneth D. Merry :6,
2445ef270ab1SKenneth D. Merry noc:1,
2446ef270ab1SKenneth D. Merry eof:1;
2447ef270ab1SKenneth D. Merry uint32_t write_offset;
2448ef270ab1SKenneth D. Merry uint8_t object_name[104];
2449ef270ab1SKenneth D. Merry uint32_t host_buffer_descriptor_count;
2450ef270ab1SKenneth D. Merry sli4_bde_t host_buffer_descriptor[0];
2451ef270ab1SKenneth D. Merry #else
2452ef270ab1SKenneth D. Merry #error big endian version not defined
2453ef270ab1SKenneth D. Merry #endif
2454ef270ab1SKenneth D. Merry } sli4_req_common_write_object_t;
2455ef270ab1SKenneth D. Merry
2456ef270ab1SKenneth D. Merry typedef struct sli4_res_common_write_object_s {
2457ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2458ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2459ef270ab1SKenneth D. Merry uint32_t actual_write_length;
2460ef270ab1SKenneth D. Merry uint32_t change_status:8,
2461ef270ab1SKenneth D. Merry :24;
2462ef270ab1SKenneth D. Merry #else
2463ef270ab1SKenneth D. Merry #error big endian version not defined
2464ef270ab1SKenneth D. Merry #endif
2465ef270ab1SKenneth D. Merry } sli4_res_common_write_object_t;
2466ef270ab1SKenneth D. Merry
2467ef270ab1SKenneth D. Merry /**
2468ef270ab1SKenneth D. Merry * @brief COMMON_DELETE_OBJECT
2469ef270ab1SKenneth D. Merry */
2470ef270ab1SKenneth D. Merry typedef struct sli4_req_common_delete_object_s {
2471ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2472ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2473ef270ab1SKenneth D. Merry uint32_t rsvd4;
2474ef270ab1SKenneth D. Merry uint32_t rsvd5;
2475ef270ab1SKenneth D. Merry uint8_t object_name[104];
2476ef270ab1SKenneth D. Merry #else
2477ef270ab1SKenneth D. Merry #error big endian version not defined
2478ef270ab1SKenneth D. Merry #endif
2479ef270ab1SKenneth D. Merry } sli4_req_common_delete_object_t;
2480ef270ab1SKenneth D. Merry
2481ef270ab1SKenneth D. Merry /**
2482ef270ab1SKenneth D. Merry * @brief COMMON_READ_OBJECT_LIST
2483ef270ab1SKenneth D. Merry */
2484ef270ab1SKenneth D. Merry typedef struct sli4_req_common_read_object_list_s {
2485ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2486ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2487ef270ab1SKenneth D. Merry uint32_t desired_read_length:24,
2488ef270ab1SKenneth D. Merry :8;
2489ef270ab1SKenneth D. Merry uint32_t read_offset;
2490ef270ab1SKenneth D. Merry uint8_t object_name[104];
2491ef270ab1SKenneth D. Merry uint32_t host_buffer_descriptor_count;
2492ef270ab1SKenneth D. Merry sli4_bde_t host_buffer_descriptor[0];
2493ef270ab1SKenneth D. Merry #else
2494ef270ab1SKenneth D. Merry #error big endian version not defined
2495ef270ab1SKenneth D. Merry #endif
2496ef270ab1SKenneth D. Merry } sli4_req_common_read_object_list_t;
2497ef270ab1SKenneth D. Merry
2498ef270ab1SKenneth D. Merry /**
2499ef270ab1SKenneth D. Merry * @brief COMMON_SET_DUMP_LOCATION
2500ef270ab1SKenneth D. Merry */
2501ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_dump_location_s {
2502ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2503ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2504ef270ab1SKenneth D. Merry uint32_t buffer_length:24,
2505ef270ab1SKenneth D. Merry :5,
2506ef270ab1SKenneth D. Merry fdb:1,
2507ef270ab1SKenneth D. Merry blp:1,
2508ef270ab1SKenneth D. Merry qry:1;
2509ef270ab1SKenneth D. Merry uint32_t buf_addr_low;
2510ef270ab1SKenneth D. Merry uint32_t buf_addr_high;
2511ef270ab1SKenneth D. Merry #else
2512ef270ab1SKenneth D. Merry #error big endian version not defined
2513ef270ab1SKenneth D. Merry #endif
2514ef270ab1SKenneth D. Merry } sli4_req_common_set_dump_location_t;
2515ef270ab1SKenneth D. Merry
2516ef270ab1SKenneth D. Merry typedef struct sli4_res_common_set_dump_location_s {
2517ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2518ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2519ef270ab1SKenneth D. Merry uint32_t buffer_length:24,
2520ef270ab1SKenneth D. Merry :8;
2521ef270ab1SKenneth D. Merry #else
2522ef270ab1SKenneth D. Merry #error big endian version not defined
2523ef270ab1SKenneth D. Merry #endif
2524ef270ab1SKenneth D. Merry }sli4_res_common_set_dump_location_t;
2525ef270ab1SKenneth D. Merry
2526ef270ab1SKenneth D. Merry /**
2527ef270ab1SKenneth D. Merry * @brief COMMON_SET_SET_FEATURES
2528ef270ab1SKenneth D. Merry */
2529ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_DIF_SEED 0x01
2530ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_XRI_TIMER 0x03
2531ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_MAX_PCIE_SPEED 0x04
2532ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_FCTL_CHECK 0x05
2533ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_FEC 0x06
2534ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_PCIE_RECV_DETECT 0x07
2535ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_DIF_MEMORY_MODE 0x08
2536ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_DISABLE_SLI_PORT_PAUSE_STATE 0x09
2537ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_ENABLE_PCIE_OPTIONS 0x0A
2538ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_SET_CONFIG_AUTO_XFER_RDY_T10PI 0x0C
2539ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_ENABLE_MULTI_RECEIVE_QUEUE 0x0D
2540ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_SET_FTD_XFER_HINT 0x0F
2541ef270ab1SKenneth D. Merry #define SLI4_SET_FEATURES_SLI_PORT_HEALTH_CHECK 0x11
2542965e2154SRam Kishore Vegesna #define SLI4_SET_FEATURES_PERSISTENT_TOPOLOGY 0x20
2543ef270ab1SKenneth D. Merry
2544ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_features_s {
2545ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2546ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2547ef270ab1SKenneth D. Merry uint32_t feature;
2548ef270ab1SKenneth D. Merry uint32_t param_len;
2549ef270ab1SKenneth D. Merry uint32_t params[8];
2550ef270ab1SKenneth D. Merry #else
2551ef270ab1SKenneth D. Merry #error big endian version not defined
2552ef270ab1SKenneth D. Merry #endif
2553ef270ab1SKenneth D. Merry } sli4_req_common_set_features_t;
2554ef270ab1SKenneth D. Merry
2555ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_features_dif_seed_s {
2556ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2557ef270ab1SKenneth D. Merry uint32_t seed:16,
2558ef270ab1SKenneth D. Merry :16;
2559ef270ab1SKenneth D. Merry #else
2560ef270ab1SKenneth D. Merry #error big endian version not defined
2561ef270ab1SKenneth D. Merry #endif
2562ef270ab1SKenneth D. Merry } sli4_req_common_set_features_dif_seed_t;
2563ef270ab1SKenneth D. Merry
2564ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_features_t10_pi_mem_model_s {
2565ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2566ef270ab1SKenneth D. Merry uint32_t tmm:1,
2567ef270ab1SKenneth D. Merry :31;
2568ef270ab1SKenneth D. Merry #else
2569ef270ab1SKenneth D. Merry #error big endian version not defined
2570ef270ab1SKenneth D. Merry #endif
2571ef270ab1SKenneth D. Merry } sli4_req_common_set_features_t10_pi_mem_model_t;
2572ef270ab1SKenneth D. Merry
2573ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_features_multirq_s {
2574ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2575ef270ab1SKenneth D. Merry uint32_t isr:1, /*<< Include Sequence Reporting */
2576ef270ab1SKenneth D. Merry agxfe:1, /*<< Auto Generate XFER-RDY Feature Enabled */
2577ef270ab1SKenneth D. Merry :30;
2578ef270ab1SKenneth D. Merry uint32_t num_rqs:8,
2579ef270ab1SKenneth D. Merry rq_select_policy:4,
2580ef270ab1SKenneth D. Merry :20;
2581ef270ab1SKenneth D. Merry #else
2582ef270ab1SKenneth D. Merry #error big endian version not defined
2583ef270ab1SKenneth D. Merry #endif
2584ef270ab1SKenneth D. Merry } sli4_req_common_set_features_multirq_t;
2585ef270ab1SKenneth D. Merry
2586ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_features_xfer_rdy_t10pi_s {
2587ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2588ef270ab1SKenneth D. Merry uint32_t rtc:1,
2589ef270ab1SKenneth D. Merry atv:1,
2590ef270ab1SKenneth D. Merry tmm:1,
2591ef270ab1SKenneth D. Merry :1,
2592ef270ab1SKenneth D. Merry p_type:3,
2593ef270ab1SKenneth D. Merry blk_size:3,
2594ef270ab1SKenneth D. Merry :22;
2595ef270ab1SKenneth D. Merry uint32_t app_tag:16,
2596ef270ab1SKenneth D. Merry :16;
2597ef270ab1SKenneth D. Merry #else
2598ef270ab1SKenneth D. Merry #error big endian version not defined
2599ef270ab1SKenneth D. Merry #endif
2600ef270ab1SKenneth D. Merry } sli4_req_common_set_features_xfer_rdy_t10pi_t;
2601ef270ab1SKenneth D. Merry
2602ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_features_health_check_s {
2603ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2604ef270ab1SKenneth D. Merry uint32_t hck:1,
2605ef270ab1SKenneth D. Merry qry:1,
2606ef270ab1SKenneth D. Merry :30;
2607ef270ab1SKenneth D. Merry #else
2608ef270ab1SKenneth D. Merry #error big endian version not defined
2609ef270ab1SKenneth D. Merry #endif
2610ef270ab1SKenneth D. Merry } sli4_req_common_set_features_health_check_t;
2611ef270ab1SKenneth D. Merry
2612ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_features_set_fdt_xfer_hint_s {
2613ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2614ef270ab1SKenneth D. Merry uint32_t fdt_xfer_hint;
2615ef270ab1SKenneth D. Merry #else
2616ef270ab1SKenneth D. Merry #error big endian version not defined
2617ef270ab1SKenneth D. Merry #endif
2618ef270ab1SKenneth D. Merry } sli4_req_common_set_features_set_fdt_xfer_hint_t;
2619ef270ab1SKenneth D. Merry
2620965e2154SRam Kishore Vegesna typedef struct sli4_req_common_set_features_persistent_topo_param_s {
2621965e2154SRam Kishore Vegesna #if BYTE_ORDER == LITTLE_ENDIAN
2622965e2154SRam Kishore Vegesna uint32_t persistent_topo:2,
2623965e2154SRam Kishore Vegesna topo_failover:1,
2624965e2154SRam Kishore Vegesna :29;
2625965e2154SRam Kishore Vegesna #else
2626965e2154SRam Kishore Vegesna #error big endian version not defined
2627965e2154SRam Kishore Vegesna #endif
2628965e2154SRam Kishore Vegesna } sli4_req_common_set_features_persistent_topo_param_t;
2629965e2154SRam Kishore Vegesna
2630ef270ab1SKenneth D. Merry /**
2631ef270ab1SKenneth D. Merry * @brief DMTF_EXEC_CLP_CMD
2632ef270ab1SKenneth D. Merry */
2633ef270ab1SKenneth D. Merry typedef struct sli4_req_dmtf_exec_clp_cmd_s {
2634ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2635ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2636ef270ab1SKenneth D. Merry uint32_t cmd_buf_length;
2637ef270ab1SKenneth D. Merry uint32_t resp_buf_length;
2638ef270ab1SKenneth D. Merry uint32_t cmd_buf_addr_low;
2639ef270ab1SKenneth D. Merry uint32_t cmd_buf_addr_high;
2640ef270ab1SKenneth D. Merry uint32_t resp_buf_addr_low;
2641ef270ab1SKenneth D. Merry uint32_t resp_buf_addr_high;
2642ef270ab1SKenneth D. Merry #else
2643ef270ab1SKenneth D. Merry #error big endian version not defined
2644ef270ab1SKenneth D. Merry #endif
2645ef270ab1SKenneth D. Merry } sli4_req_dmtf_exec_clp_cmd_t;
2646ef270ab1SKenneth D. Merry
2647ef270ab1SKenneth D. Merry typedef struct sli4_res_dmtf_exec_clp_cmd_s {
2648ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2649ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2650ef270ab1SKenneth D. Merry uint32_t :32;
2651ef270ab1SKenneth D. Merry uint32_t resp_length;
2652ef270ab1SKenneth D. Merry uint32_t :32;
2653ef270ab1SKenneth D. Merry uint32_t :32;
2654ef270ab1SKenneth D. Merry uint32_t :32;
2655ef270ab1SKenneth D. Merry uint32_t :32;
2656ef270ab1SKenneth D. Merry uint32_t clp_status;
2657ef270ab1SKenneth D. Merry uint32_t clp_detailed_status;
2658ef270ab1SKenneth D. Merry #else
2659ef270ab1SKenneth D. Merry #error big endian version not defined
2660ef270ab1SKenneth D. Merry #endif
2661ef270ab1SKenneth D. Merry } sli4_res_dmtf_exec_clp_cmd_t;
2662ef270ab1SKenneth D. Merry
2663ef270ab1SKenneth D. Merry /**
2664ef270ab1SKenneth D. Merry * @brief Resource descriptor
2665ef270ab1SKenneth D. Merry */
2666ef270ab1SKenneth D. Merry
2667ef270ab1SKenneth D. Merry #define SLI4_RESOURCE_DESCRIPTOR_TYPE_PCIE 0x50
2668ef270ab1SKenneth D. Merry #define SLI4_RESOURCE_DESCRIPTOR_TYPE_NIC 0x51
2669ef270ab1SKenneth D. Merry #define SLI4_RESOURCE_DESCRIPTOR_TYPE_ISCSI 0x52
2670ef270ab1SKenneth D. Merry #define SLI4_RESOURCE_DESCRIPTOR_TYPE_FCFCOE 0x53
2671ef270ab1SKenneth D. Merry #define SLI4_RESOURCE_DESCRIPTOR_TYPE_RDMA 0x54
2672ef270ab1SKenneth D. Merry #define SLI4_RESOURCE_DESCRIPTOR_TYPE_PORT 0x55
2673ef270ab1SKenneth D. Merry #define SLI4_RESOURCE_DESCRIPTOR_TYPE_ISAP 0x56
2674ef270ab1SKenneth D. Merry
2675ef270ab1SKenneth D. Merry #define SLI4_PROTOCOL_NIC_TOE 0x01
2676ef270ab1SKenneth D. Merry #define SLI4_PROTOCOL_ISCSI 0x02
2677ef270ab1SKenneth D. Merry #define SLI4_PROTOCOL_FCOE 0x04
2678ef270ab1SKenneth D. Merry #define SLI4_PROTOCOL_NIC_TOE_RDMA 0x08
2679ef270ab1SKenneth D. Merry #define SLI4_PROTOCOL_FC 0x10
2680ef270ab1SKenneth D. Merry #define SLI4_PROTOCOL_DEFAULT 0xff
2681ef270ab1SKenneth D. Merry
2682ef270ab1SKenneth D. Merry typedef struct sli4_resource_descriptor_v1_s {
2683ef270ab1SKenneth D. Merry uint32_t descriptor_type:8,
2684ef270ab1SKenneth D. Merry descriptor_length:8,
2685ef270ab1SKenneth D. Merry :16;
2686ef270ab1SKenneth D. Merry uint32_t type_specific[0];
2687ef270ab1SKenneth D. Merry } sli4_resource_descriptor_v1_t;
2688ef270ab1SKenneth D. Merry
2689ef270ab1SKenneth D. Merry typedef struct sli4_pcie_resource_descriptor_v1_s {
2690ef270ab1SKenneth D. Merry uint32_t descriptor_type:8,
2691ef270ab1SKenneth D. Merry descriptor_length:8,
2692ef270ab1SKenneth D. Merry :14,
2693ef270ab1SKenneth D. Merry imm:1,
2694ef270ab1SKenneth D. Merry nosv:1;
2695ef270ab1SKenneth D. Merry uint32_t :16,
2696ef270ab1SKenneth D. Merry pf_number:10,
2697ef270ab1SKenneth D. Merry :6;
2698ef270ab1SKenneth D. Merry uint32_t rsvd1;
2699ef270ab1SKenneth D. Merry uint32_t sriov_state:8,
2700ef270ab1SKenneth D. Merry pf_state:8,
2701ef270ab1SKenneth D. Merry pf_type:8,
2702ef270ab1SKenneth D. Merry :8;
2703ef270ab1SKenneth D. Merry uint32_t number_of_vfs:16,
2704ef270ab1SKenneth D. Merry :16;
2705ef270ab1SKenneth D. Merry uint32_t mission_roles:8,
2706ef270ab1SKenneth D. Merry :19,
2707ef270ab1SKenneth D. Merry pchg:1,
2708ef270ab1SKenneth D. Merry schg:1,
2709ef270ab1SKenneth D. Merry xchg:1,
2710ef270ab1SKenneth D. Merry xrom:2;
2711ef270ab1SKenneth D. Merry uint32_t rsvd2[16];
2712ef270ab1SKenneth D. Merry } sli4_pcie_resource_descriptor_v1_t;
2713ef270ab1SKenneth D. Merry
2714ef270ab1SKenneth D. Merry typedef struct sli4_isap_resource_descriptor_v1_s {
2715ef270ab1SKenneth D. Merry uint32_t descriptor_type:8,
2716ef270ab1SKenneth D. Merry descriptor_length:8,
2717ef270ab1SKenneth D. Merry :16;
2718ef270ab1SKenneth D. Merry uint32_t iscsi_tgt:1,
2719ef270ab1SKenneth D. Merry iscsi_ini:1,
2720ef270ab1SKenneth D. Merry iscsi_dif:1,
2721ef270ab1SKenneth D. Merry :29;
2722ef270ab1SKenneth D. Merry uint32_t rsvd1[3];
2723ef270ab1SKenneth D. Merry uint32_t fcoe_tgt:1,
2724ef270ab1SKenneth D. Merry fcoe_ini:1,
2725ef270ab1SKenneth D. Merry fcoe_dif:1,
2726ef270ab1SKenneth D. Merry :29;
2727ef270ab1SKenneth D. Merry uint32_t rsvd2[7];
2728ef270ab1SKenneth D. Merry uint32_t mc_type0:8,
2729ef270ab1SKenneth D. Merry mc_type1:8,
2730ef270ab1SKenneth D. Merry mc_type2:8,
2731ef270ab1SKenneth D. Merry mc_type3:8;
2732ef270ab1SKenneth D. Merry uint32_t rsvd3[3];
2733ef270ab1SKenneth D. Merry } sli4_isap_resouce_descriptor_v1_t;
2734ef270ab1SKenneth D. Merry
2735ef270ab1SKenneth D. Merry /**
2736ef270ab1SKenneth D. Merry * @brief COMMON_GET_FUNCTION_CONFIG
2737ef270ab1SKenneth D. Merry */
2738ef270ab1SKenneth D. Merry typedef struct sli4_req_common_get_function_config_s {
2739ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2740ef270ab1SKenneth D. Merry } sli4_req_common_get_function_config_t;
2741ef270ab1SKenneth D. Merry
2742ef270ab1SKenneth D. Merry typedef struct sli4_res_common_get_function_config_s {
2743ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2744ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2745ef270ab1SKenneth D. Merry uint32_t desc_count;
2746ef270ab1SKenneth D. Merry uint32_t desc[54];
2747ef270ab1SKenneth D. Merry #else
2748ef270ab1SKenneth D. Merry #error big endian version not defined
2749ef270ab1SKenneth D. Merry #endif
2750ef270ab1SKenneth D. Merry } sli4_res_common_get_function_config_t;
2751ef270ab1SKenneth D. Merry
2752ef270ab1SKenneth D. Merry /**
2753ef270ab1SKenneth D. Merry * @brief COMMON_GET_PROFILE_CONFIG
2754ef270ab1SKenneth D. Merry */
2755ef270ab1SKenneth D. Merry typedef struct sli4_req_common_get_profile_config_s {
2756ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2757ef270ab1SKenneth D. Merry uint32_t profile_id:8,
2758ef270ab1SKenneth D. Merry typ:2,
2759ef270ab1SKenneth D. Merry :22;
2760ef270ab1SKenneth D. Merry } sli4_req_common_get_profile_config_t;
2761ef270ab1SKenneth D. Merry
2762ef270ab1SKenneth D. Merry typedef struct sli4_res_common_get_profile_config_s {
2763ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2764ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2765ef270ab1SKenneth D. Merry uint32_t desc_count;
2766ef270ab1SKenneth D. Merry uint32_t desc[0];
2767ef270ab1SKenneth D. Merry #else
2768ef270ab1SKenneth D. Merry #error big endian version not defined
2769ef270ab1SKenneth D. Merry #endif
2770ef270ab1SKenneth D. Merry } sli4_res_common_get_profile_config_t;
2771ef270ab1SKenneth D. Merry
2772ef270ab1SKenneth D. Merry /**
2773ef270ab1SKenneth D. Merry * @brief COMMON_SET_PROFILE_CONFIG
2774ef270ab1SKenneth D. Merry */
2775ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_profile_config_s {
2776ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2777ef270ab1SKenneth D. Merry uint32_t profile_id:8,
2778ef270ab1SKenneth D. Merry :23,
2779ef270ab1SKenneth D. Merry isap:1;
2780ef270ab1SKenneth D. Merry uint32_t desc_count;
2781ef270ab1SKenneth D. Merry uint32_t desc[0];
2782ef270ab1SKenneth D. Merry } sli4_req_common_set_profile_config_t;
2783ef270ab1SKenneth D. Merry
2784ef270ab1SKenneth D. Merry typedef struct sli4_res_common_set_profile_config_s {
2785ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2786ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2787ef270ab1SKenneth D. Merry #else
2788ef270ab1SKenneth D. Merry #error big endian version not defined
2789ef270ab1SKenneth D. Merry #endif
2790ef270ab1SKenneth D. Merry } sli4_res_common_set_profile_config_t;
2791ef270ab1SKenneth D. Merry
2792ef270ab1SKenneth D. Merry /**
2793ef270ab1SKenneth D. Merry * @brief Profile Descriptor for profile functions
2794ef270ab1SKenneth D. Merry */
2795ef270ab1SKenneth D. Merry typedef struct sli4_profile_descriptor_s {
2796ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2797ef270ab1SKenneth D. Merry uint32_t profile_id:8,
2798ef270ab1SKenneth D. Merry :8,
2799ef270ab1SKenneth D. Merry profile_index:8,
2800ef270ab1SKenneth D. Merry :8;
2801ef270ab1SKenneth D. Merry uint32_t profile_description[128];
2802ef270ab1SKenneth D. Merry #else
2803ef270ab1SKenneth D. Merry #error big endian version not defined
2804ef270ab1SKenneth D. Merry #endif
2805ef270ab1SKenneth D. Merry } sli4_profile_descriptor_t;
2806ef270ab1SKenneth D. Merry
2807ef270ab1SKenneth D. Merry /* We don't know in advance how many descriptors there are. We have
2808ef270ab1SKenneth D. Merry to pick a number that we think will be big enough and ask for that
2809ef270ab1SKenneth D. Merry many. */
2810ef270ab1SKenneth D. Merry
2811ef270ab1SKenneth D. Merry #define MAX_PRODUCT_DESCRIPTORS 40
2812ef270ab1SKenneth D. Merry
2813ef270ab1SKenneth D. Merry /**
2814ef270ab1SKenneth D. Merry * @brief COMMON_GET_PROFILE_LIST
2815ef270ab1SKenneth D. Merry */
2816ef270ab1SKenneth D. Merry typedef struct sli4_req_common_get_profile_list_s {
2817ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2818ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2819ef270ab1SKenneth D. Merry uint32_t start_profile_index:8,
2820ef270ab1SKenneth D. Merry :24;
2821ef270ab1SKenneth D. Merry #else
2822ef270ab1SKenneth D. Merry #error big endian version not defined
2823ef270ab1SKenneth D. Merry #endif
2824ef270ab1SKenneth D. Merry } sli4_req_common_get_profile_list_t;
2825ef270ab1SKenneth D. Merry
2826ef270ab1SKenneth D. Merry typedef struct sli4_res_common_get_profile_list_s {
2827ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2828ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2829ef270ab1SKenneth D. Merry uint32_t profile_descriptor_count;
2830ef270ab1SKenneth D. Merry sli4_profile_descriptor_t profile_descriptor[MAX_PRODUCT_DESCRIPTORS];
2831ef270ab1SKenneth D. Merry #else
2832ef270ab1SKenneth D. Merry #error big endian version not defined
2833ef270ab1SKenneth D. Merry #endif
2834ef270ab1SKenneth D. Merry } sli4_res_common_get_profile_list_t;
2835ef270ab1SKenneth D. Merry
2836ef270ab1SKenneth D. Merry /**
2837ef270ab1SKenneth D. Merry * @brief COMMON_GET_ACTIVE_PROFILE
2838ef270ab1SKenneth D. Merry */
2839ef270ab1SKenneth D. Merry typedef struct sli4_req_common_get_active_profile_s {
2840ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2841ef270ab1SKenneth D. Merry } sli4_req_common_get_active_profile_t;
2842ef270ab1SKenneth D. Merry
2843ef270ab1SKenneth D. Merry typedef struct sli4_res_common_get_active_profile_s {
2844ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2845ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2846ef270ab1SKenneth D. Merry uint32_t active_profile_id:8,
2847ef270ab1SKenneth D. Merry :8,
2848ef270ab1SKenneth D. Merry next_profile_id:8,
2849ef270ab1SKenneth D. Merry :8;
2850ef270ab1SKenneth D. Merry #else
2851ef270ab1SKenneth D. Merry #error big endian version not defined
2852ef270ab1SKenneth D. Merry #endif
2853ef270ab1SKenneth D. Merry } sli4_res_common_get_active_profile_t;
2854ef270ab1SKenneth D. Merry
2855ef270ab1SKenneth D. Merry /**
2856ef270ab1SKenneth D. Merry * @brief COMMON_SET_ACTIVE_PROFILE
2857ef270ab1SKenneth D. Merry */
2858ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_active_profile_s {
2859ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2860ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2861ef270ab1SKenneth D. Merry uint32_t active_profile_id:8,
2862ef270ab1SKenneth D. Merry :23,
2863ef270ab1SKenneth D. Merry fd:1;
2864ef270ab1SKenneth D. Merry #else
2865ef270ab1SKenneth D. Merry #error big endian version not defined
2866ef270ab1SKenneth D. Merry #endif
2867ef270ab1SKenneth D. Merry } sli4_req_common_set_active_profile_t;
2868ef270ab1SKenneth D. Merry
2869ef270ab1SKenneth D. Merry typedef struct sli4_res_common_set_active_profile_s {
2870ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2871ef270ab1SKenneth D. Merry } sli4_res_common_set_active_profile_t;
2872ef270ab1SKenneth D. Merry
2873ef270ab1SKenneth D. Merry /**
2874ef270ab1SKenneth D. Merry * @brief Link Config Descriptor for link config functions
2875ef270ab1SKenneth D. Merry */
2876ef270ab1SKenneth D. Merry typedef struct sli4_link_config_descriptor_s {
2877ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2878ef270ab1SKenneth D. Merry uint32_t link_config_id:8,
2879ef270ab1SKenneth D. Merry :24;
2880ef270ab1SKenneth D. Merry uint32_t config_description[8];
2881ef270ab1SKenneth D. Merry #else
2882ef270ab1SKenneth D. Merry #error big endian version not defined
2883ef270ab1SKenneth D. Merry #endif
2884ef270ab1SKenneth D. Merry } sli4_link_config_descriptor_t;
2885ef270ab1SKenneth D. Merry
2886ef270ab1SKenneth D. Merry #define MAX_LINK_CONFIG_DESCRIPTORS 10
2887ef270ab1SKenneth D. Merry
2888ef270ab1SKenneth D. Merry /**
2889ef270ab1SKenneth D. Merry * @brief COMMON_GET_RECONFIG_LINK_INFO
2890ef270ab1SKenneth D. Merry */
2891ef270ab1SKenneth D. Merry typedef struct sli4_req_common_get_reconfig_link_info_s {
2892ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2893ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2894ef270ab1SKenneth D. Merry #else
2895ef270ab1SKenneth D. Merry #error big endian version not defined
2896ef270ab1SKenneth D. Merry #endif
2897ef270ab1SKenneth D. Merry } sli4_req_common_get_reconfig_link_info_t;
2898ef270ab1SKenneth D. Merry
2899ef270ab1SKenneth D. Merry typedef struct sli4_res_common_get_reconfig_link_info_s {
2900ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2901ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2902ef270ab1SKenneth D. Merry uint32_t active_link_config_id:8,
2903ef270ab1SKenneth D. Merry :8,
2904ef270ab1SKenneth D. Merry next_link_config_id:8,
2905ef270ab1SKenneth D. Merry :8;
2906ef270ab1SKenneth D. Merry uint32_t link_configuration_descriptor_count;
2907ef270ab1SKenneth D. Merry sli4_link_config_descriptor_t desc[MAX_LINK_CONFIG_DESCRIPTORS];
2908ef270ab1SKenneth D. Merry #else
2909ef270ab1SKenneth D. Merry #error big endian version not defined
2910ef270ab1SKenneth D. Merry #endif
2911ef270ab1SKenneth D. Merry } sli4_res_common_get_reconfig_link_info_t;
2912ef270ab1SKenneth D. Merry
2913ef270ab1SKenneth D. Merry /**
2914ef270ab1SKenneth D. Merry * @brief COMMON_SET_RECONFIG_LINK_ID
2915ef270ab1SKenneth D. Merry */
2916ef270ab1SKenneth D. Merry typedef struct sli4_req_common_set_reconfig_link_id_s {
2917ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2918ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2919ef270ab1SKenneth D. Merry uint32_t next_link_config_id:8,
2920ef270ab1SKenneth D. Merry :23,
2921ef270ab1SKenneth D. Merry fd:1;
2922ef270ab1SKenneth D. Merry #else
2923ef270ab1SKenneth D. Merry #error big endian version not defined
2924ef270ab1SKenneth D. Merry #endif
2925ef270ab1SKenneth D. Merry } sli4_req_common_set_reconfig_link_id_t;
2926ef270ab1SKenneth D. Merry
2927ef270ab1SKenneth D. Merry typedef struct sli4_res_common_set_reconfig_link_id_s {
2928ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2929ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2930ef270ab1SKenneth D. Merry #else
2931ef270ab1SKenneth D. Merry #error big endian version not defined
2932ef270ab1SKenneth D. Merry #endif
2933ef270ab1SKenneth D. Merry } sli4_res_common_set_reconfig_link_id_t;
2934ef270ab1SKenneth D. Merry
2935ef270ab1SKenneth D. Merry typedef struct sli4_req_lowlevel_set_watchdog_s {
2936ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
2937ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2938ef270ab1SKenneth D. Merry uint32_t watchdog_timeout:16,
2939ef270ab1SKenneth D. Merry :16;
2940ef270ab1SKenneth D. Merry #else
2941ef270ab1SKenneth D. Merry #error big endian version not defined
2942ef270ab1SKenneth D. Merry #endif
2943ef270ab1SKenneth D. Merry
2944ef270ab1SKenneth D. Merry } sli4_req_lowlevel_set_watchdog_t;
2945ef270ab1SKenneth D. Merry
2946ef270ab1SKenneth D. Merry typedef struct sli4_res_lowlevel_set_watchdog_s {
2947ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
2948ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2949ef270ab1SKenneth D. Merry uint32_t rsvd;
2950ef270ab1SKenneth D. Merry #else
2951ef270ab1SKenneth D. Merry #error big endian version not defined
2952ef270ab1SKenneth D. Merry #endif
2953ef270ab1SKenneth D. Merry } sli4_res_lowlevel_set_watchdog_t;
2954ef270ab1SKenneth D. Merry
2955ef270ab1SKenneth D. Merry /**
2956ef270ab1SKenneth D. Merry * @brief Event Queue Entry
2957ef270ab1SKenneth D. Merry */
2958ef270ab1SKenneth D. Merry typedef struct sli4_eqe_s {
2959ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2960ef270ab1SKenneth D. Merry uint32_t vld:1, /** valid */
2961ef270ab1SKenneth D. Merry major_code:3,
2962ef270ab1SKenneth D. Merry minor_code:12,
2963ef270ab1SKenneth D. Merry resource_id:16;
2964ef270ab1SKenneth D. Merry #else
2965ef270ab1SKenneth D. Merry #error big endian version not defined
2966ef270ab1SKenneth D. Merry #endif
2967ef270ab1SKenneth D. Merry } sli4_eqe_t;
2968ef270ab1SKenneth D. Merry
2969ef270ab1SKenneth D. Merry #define SLI4_MAJOR_CODE_STANDARD 0
2970ef270ab1SKenneth D. Merry #define SLI4_MAJOR_CODE_SENTINEL 1
2971ef270ab1SKenneth D. Merry
2972ef270ab1SKenneth D. Merry /**
2973ef270ab1SKenneth D. Merry * @brief Mailbox Completion Queue Entry
2974ef270ab1SKenneth D. Merry *
2975ef270ab1SKenneth D. Merry * A CQE generated on the completion of a MQE from a MQ.
2976ef270ab1SKenneth D. Merry */
2977ef270ab1SKenneth D. Merry typedef struct sli4_mcqe_s {
2978ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
2979ef270ab1SKenneth D. Merry uint32_t completion_status:16, /** values are protocol specific */
2980ef270ab1SKenneth D. Merry extended_status:16;
2981ef270ab1SKenneth D. Merry uint32_t mqe_tag_low;
2982ef270ab1SKenneth D. Merry uint32_t mqe_tag_high;
2983ef270ab1SKenneth D. Merry uint32_t :27,
2984ef270ab1SKenneth D. Merry con:1, /** consumed - command now being executed */
2985ef270ab1SKenneth D. Merry cmp:1, /** completed - command still executing if clear */
2986ef270ab1SKenneth D. Merry :1,
2987ef270ab1SKenneth D. Merry ae:1, /** async event - this is an ACQE */
2988ef270ab1SKenneth D. Merry val:1; /** valid - contents of CQE are valid */
2989ef270ab1SKenneth D. Merry #else
2990ef270ab1SKenneth D. Merry #error big endian version not defined
2991ef270ab1SKenneth D. Merry #endif
2992ef270ab1SKenneth D. Merry } sli4_mcqe_t;
2993ef270ab1SKenneth D. Merry
2994ef270ab1SKenneth D. Merry /**
2995ef270ab1SKenneth D. Merry * @brief Asynchronous Completion Queue Entry
2996ef270ab1SKenneth D. Merry *
2997ef270ab1SKenneth D. Merry * A CQE generated asynchronously in response to the link or other internal events.
2998ef270ab1SKenneth D. Merry */
2999ef270ab1SKenneth D. Merry typedef struct sli4_acqe_s {
3000ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
3001ef270ab1SKenneth D. Merry uint32_t event_data[3];
3002ef270ab1SKenneth D. Merry uint32_t :8,
3003ef270ab1SKenneth D. Merry event_code:8,
3004ef270ab1SKenneth D. Merry event_type:8, /** values are protocol specific */
3005ef270ab1SKenneth D. Merry :6,
3006ef270ab1SKenneth D. Merry ae:1, /** async event - this is an ACQE */
3007ef270ab1SKenneth D. Merry val:1; /** valid - contents of CQE are valid */
3008ef270ab1SKenneth D. Merry #else
3009ef270ab1SKenneth D. Merry #error big endian version not defined
3010ef270ab1SKenneth D. Merry #endif
3011ef270ab1SKenneth D. Merry } sli4_acqe_t;
3012ef270ab1SKenneth D. Merry
3013ef270ab1SKenneth D. Merry #define SLI4_ACQE_EVENT_CODE_LINK_STATE 0x01
3014ef270ab1SKenneth D. Merry #define SLI4_ACQE_EVENT_CODE_FCOE_FIP 0x02
3015ef270ab1SKenneth D. Merry #define SLI4_ACQE_EVENT_CODE_DCBX 0x03
3016ef270ab1SKenneth D. Merry #define SLI4_ACQE_EVENT_CODE_ISCSI 0x04
3017ef270ab1SKenneth D. Merry #define SLI4_ACQE_EVENT_CODE_GRP_5 0x05
3018ef270ab1SKenneth D. Merry #define SLI4_ACQE_EVENT_CODE_FC_LINK_EVENT 0x10
3019ef270ab1SKenneth D. Merry #define SLI4_ACQE_EVENT_CODE_SLI_PORT_EVENT 0x11
3020ef270ab1SKenneth D. Merry #define SLI4_ACQE_EVENT_CODE_VF_EVENT 0x12
3021ef270ab1SKenneth D. Merry #define SLI4_ACQE_EVENT_CODE_MR_EVENT 0x13
3022ef270ab1SKenneth D. Merry
3023ef270ab1SKenneth D. Merry /**
3024ef270ab1SKenneth D. Merry * @brief Register name enums
3025ef270ab1SKenneth D. Merry */
3026ef270ab1SKenneth D. Merry typedef enum {
3027ef270ab1SKenneth D. Merry SLI4_REG_BMBX,
30283bf42363SRam Kishore Vegesna SLI4_REG_EQ_DOORBELL,
30293bf42363SRam Kishore Vegesna SLI4_REG_CQ_DOORBELL,
3030ef270ab1SKenneth D. Merry SLI4_REG_FCOE_RQ_DOORBELL,
3031ef270ab1SKenneth D. Merry SLI4_REG_IO_WQ_DOORBELL,
3032ef270ab1SKenneth D. Merry SLI4_REG_MQ_DOORBELL,
3033ef270ab1SKenneth D. Merry SLI4_REG_PHYSDEV_CONTROL,
3034ef270ab1SKenneth D. Merry SLI4_REG_SLIPORT_CONTROL,
3035ef270ab1SKenneth D. Merry SLI4_REG_SLIPORT_ERROR1,
3036ef270ab1SKenneth D. Merry SLI4_REG_SLIPORT_ERROR2,
3037ef270ab1SKenneth D. Merry SLI4_REG_SLIPORT_SEMAPHORE,
3038ef270ab1SKenneth D. Merry SLI4_REG_SLIPORT_STATUS,
3039ef270ab1SKenneth D. Merry SLI4_REG_UERR_MASK_HI,
3040ef270ab1SKenneth D. Merry SLI4_REG_UERR_MASK_LO,
3041ef270ab1SKenneth D. Merry SLI4_REG_UERR_STATUS_HI,
3042ef270ab1SKenneth D. Merry SLI4_REG_UERR_STATUS_LO,
3043ef270ab1SKenneth D. Merry SLI4_REG_SW_UE_CSR1,
3044ef270ab1SKenneth D. Merry SLI4_REG_SW_UE_CSR2,
3045ef270ab1SKenneth D. Merry SLI4_REG_MAX /* must be last */
3046ef270ab1SKenneth D. Merry } sli4_regname_e;
3047ef270ab1SKenneth D. Merry
3048ef270ab1SKenneth D. Merry typedef struct sli4_reg_s {
3049ef270ab1SKenneth D. Merry uint32_t rset;
3050ef270ab1SKenneth D. Merry uint32_t off;
3051ef270ab1SKenneth D. Merry } sli4_reg_t;
3052ef270ab1SKenneth D. Merry
3053ef270ab1SKenneth D. Merry typedef enum {
3054ef270ab1SKenneth D. Merry SLI_QTYPE_EQ,
3055ef270ab1SKenneth D. Merry SLI_QTYPE_CQ,
3056ef270ab1SKenneth D. Merry SLI_QTYPE_MQ,
3057ef270ab1SKenneth D. Merry SLI_QTYPE_WQ,
3058ef270ab1SKenneth D. Merry SLI_QTYPE_RQ,
3059ef270ab1SKenneth D. Merry SLI_QTYPE_MAX, /* must be last */
3060ef270ab1SKenneth D. Merry } sli4_qtype_e;
3061ef270ab1SKenneth D. Merry
3062ef270ab1SKenneth D. Merry #define SLI_USER_MQ_COUNT 1 /** User specified max mail queues */
3063ef270ab1SKenneth D. Merry #define SLI_MAX_CQ_SET_COUNT 16
3064ef270ab1SKenneth D. Merry #define SLI_MAX_RQ_SET_COUNT 16
3065ef270ab1SKenneth D. Merry
3066ef270ab1SKenneth D. Merry typedef enum {
3067ef270ab1SKenneth D. Merry SLI_QENTRY_ASYNC,
3068ef270ab1SKenneth D. Merry SLI_QENTRY_MQ,
3069ef270ab1SKenneth D. Merry SLI_QENTRY_RQ,
3070ef270ab1SKenneth D. Merry SLI_QENTRY_WQ,
3071ef270ab1SKenneth D. Merry SLI_QENTRY_WQ_RELEASE,
3072ef270ab1SKenneth D. Merry SLI_QENTRY_OPT_WRITE_CMD,
3073ef270ab1SKenneth D. Merry SLI_QENTRY_OPT_WRITE_DATA,
3074ef270ab1SKenneth D. Merry SLI_QENTRY_XABT,
3075ef270ab1SKenneth D. Merry SLI_QENTRY_MAX /* must be last */
3076ef270ab1SKenneth D. Merry } sli4_qentry_e;
3077ef270ab1SKenneth D. Merry
3078ef270ab1SKenneth D. Merry typedef struct sli4_queue_s {
3079ef270ab1SKenneth D. Merry /* Common to all queue types */
3080ef270ab1SKenneth D. Merry ocs_dma_t dma;
3081ef270ab1SKenneth D. Merry ocs_lock_t lock;
3082ef270ab1SKenneth D. Merry uint32_t index; /** current host entry index */
3083ef270ab1SKenneth D. Merry uint16_t size; /** entry size */
3084ef270ab1SKenneth D. Merry uint16_t length; /** number of entries */
3085ef270ab1SKenneth D. Merry uint16_t n_posted; /** number entries posted */
3086ef270ab1SKenneth D. Merry uint16_t id; /** Port assigned xQ_ID */
3087ef270ab1SKenneth D. Merry uint16_t ulp; /** ULP assigned to this queue */
3088ef270ab1SKenneth D. Merry uint32_t doorbell_offset;/** The offset for the doorbell */
3089ef270ab1SKenneth D. Merry uint16_t doorbell_rset; /** register set for the doorbell */
3090ef270ab1SKenneth D. Merry uint8_t type; /** queue type ie EQ, CQ, ... */
3091ef270ab1SKenneth D. Merry uint32_t proc_limit; /** limit number of CQE processed per iteration */
3092ef270ab1SKenneth D. Merry uint32_t posted_limit; /** number of CQE/EQE to process before ringing doorbell */
3093ef270ab1SKenneth D. Merry uint32_t max_num_processed;
3094ef270ab1SKenneth D. Merry time_t max_process_time;
3095ef270ab1SKenneth D. Merry
30963bf42363SRam Kishore Vegesna uint16_t phase; /** For if_type = 6, this value toggle for each iteration
30973bf42363SRam Kishore Vegesna of the queue, a queue entry is valid when a cqe valid
30983bf42363SRam Kishore Vegesna bit matches this value */
3099ef270ab1SKenneth D. Merry /* Type specific gunk */
3100ef270ab1SKenneth D. Merry union {
3101ef270ab1SKenneth D. Merry uint32_t r_idx; /** "read" index (MQ only) */
3102ef270ab1SKenneth D. Merry struct {
3103ef270ab1SKenneth D. Merry uint32_t is_mq:1,/** CQ contains MQ/Async completions */
3104ef270ab1SKenneth D. Merry is_hdr:1,/** is a RQ for packet headers */
3105ef270ab1SKenneth D. Merry rq_batch:1;/** RQ index incremented by 8 */
3106ef270ab1SKenneth D. Merry } flag;
3107ef270ab1SKenneth D. Merry } u;
3108ef270ab1SKenneth D. Merry } sli4_queue_t;
3109ef270ab1SKenneth D. Merry
3110ef270ab1SKenneth D. Merry static inline void
sli_queue_lock(sli4_queue_t * q)3111ef270ab1SKenneth D. Merry sli_queue_lock(sli4_queue_t *q)
3112ef270ab1SKenneth D. Merry {
3113ef270ab1SKenneth D. Merry ocs_lock(&q->lock);
3114ef270ab1SKenneth D. Merry }
3115ef270ab1SKenneth D. Merry
3116ef270ab1SKenneth D. Merry static inline void
sli_queue_unlock(sli4_queue_t * q)3117ef270ab1SKenneth D. Merry sli_queue_unlock(sli4_queue_t *q)
3118ef270ab1SKenneth D. Merry {
3119ef270ab1SKenneth D. Merry ocs_unlock(&q->lock);
3120ef270ab1SKenneth D. Merry }
3121ef270ab1SKenneth D. Merry
3122ef270ab1SKenneth D. Merry #define SLI4_QUEUE_DEFAULT_CQ UINT16_MAX /** Use the default CQ */
3123ef270ab1SKenneth D. Merry
3124ef270ab1SKenneth D. Merry #define SLI4_QUEUE_RQ_BATCH 8
3125ef270ab1SKenneth D. Merry
3126ef270ab1SKenneth D. Merry typedef enum {
3127ef270ab1SKenneth D. Merry SLI4_CB_LINK,
3128ef270ab1SKenneth D. Merry SLI4_CB_FIP,
3129ef270ab1SKenneth D. Merry SLI4_CB_MAX /* must be last */
3130ef270ab1SKenneth D. Merry } sli4_callback_e;
3131ef270ab1SKenneth D. Merry
3132ef270ab1SKenneth D. Merry typedef enum {
3133ef270ab1SKenneth D. Merry SLI_LINK_STATUS_UP,
3134ef270ab1SKenneth D. Merry SLI_LINK_STATUS_DOWN,
3135ef270ab1SKenneth D. Merry SLI_LINK_STATUS_NO_ALPA,
3136ef270ab1SKenneth D. Merry SLI_LINK_STATUS_MAX,
3137ef270ab1SKenneth D. Merry } sli4_link_status_e;
3138ef270ab1SKenneth D. Merry
3139ef270ab1SKenneth D. Merry typedef enum {
3140ef270ab1SKenneth D. Merry SLI_LINK_TOPO_NPORT = 1, /** fabric or point-to-point */
3141ef270ab1SKenneth D. Merry SLI_LINK_TOPO_LOOP,
3142ef270ab1SKenneth D. Merry SLI_LINK_TOPO_LOOPBACK_INTERNAL,
3143ef270ab1SKenneth D. Merry SLI_LINK_TOPO_LOOPBACK_EXTERNAL,
3144ef270ab1SKenneth D. Merry SLI_LINK_TOPO_NONE,
3145ef270ab1SKenneth D. Merry SLI_LINK_TOPO_MAX,
3146ef270ab1SKenneth D. Merry } sli4_link_topology_e;
3147ef270ab1SKenneth D. Merry
3148ef270ab1SKenneth D. Merry /* TODO do we need both sli4_port_type_e & sli4_link_medium_e */
3149ef270ab1SKenneth D. Merry typedef enum {
3150ef270ab1SKenneth D. Merry SLI_LINK_MEDIUM_ETHERNET,
3151ef270ab1SKenneth D. Merry SLI_LINK_MEDIUM_FC,
3152ef270ab1SKenneth D. Merry SLI_LINK_MEDIUM_MAX,
3153ef270ab1SKenneth D. Merry } sli4_link_medium_e;
3154ef270ab1SKenneth D. Merry
3155ef270ab1SKenneth D. Merry typedef struct sli4_link_event_s {
3156ef270ab1SKenneth D. Merry sli4_link_status_e status; /* link up/down */
3157ef270ab1SKenneth D. Merry sli4_link_topology_e topology;
3158ef270ab1SKenneth D. Merry sli4_link_medium_e medium; /* Ethernet / FC */
3159ef270ab1SKenneth D. Merry uint32_t speed; /* Mbps */
3160ef270ab1SKenneth D. Merry uint8_t *loop_map;
3161ef270ab1SKenneth D. Merry uint32_t fc_id;
3162ef270ab1SKenneth D. Merry } sli4_link_event_t;
3163ef270ab1SKenneth D. Merry
3164ef270ab1SKenneth D. Merry /**
3165ef270ab1SKenneth D. Merry * @brief Fields retrieved from skyhawk that used used to build chained SGL
3166ef270ab1SKenneth D. Merry */
3167ef270ab1SKenneth D. Merry typedef struct sli4_sgl_chaining_params_s {
3168ef270ab1SKenneth D. Merry uint8_t chaining_capable;
3169ef270ab1SKenneth D. Merry uint16_t frag_num_field_offset;
3170ef270ab1SKenneth D. Merry uint16_t sgl_index_field_offset;
3171ef270ab1SKenneth D. Merry uint64_t frag_num_field_mask;
3172ef270ab1SKenneth D. Merry uint64_t sgl_index_field_mask;
3173ef270ab1SKenneth D. Merry uint32_t chain_sge_initial_value_lo;
3174ef270ab1SKenneth D. Merry uint32_t chain_sge_initial_value_hi;
3175ef270ab1SKenneth D. Merry } sli4_sgl_chaining_params_t;
3176ef270ab1SKenneth D. Merry
3177ef270ab1SKenneth D. Merry typedef struct sli4_fip_event_s {
3178ef270ab1SKenneth D. Merry uint32_t type;
3179ef270ab1SKenneth D. Merry uint32_t index; /* FCF index or UINT32_MAX if invalid */
3180ef270ab1SKenneth D. Merry } sli4_fip_event_t;
3181ef270ab1SKenneth D. Merry
3182ef270ab1SKenneth D. Merry typedef enum {
3183ef270ab1SKenneth D. Merry SLI_RSRC_FCOE_VFI,
3184ef270ab1SKenneth D. Merry SLI_RSRC_FCOE_VPI,
3185ef270ab1SKenneth D. Merry SLI_RSRC_FCOE_RPI,
3186ef270ab1SKenneth D. Merry SLI_RSRC_FCOE_XRI,
3187ef270ab1SKenneth D. Merry SLI_RSRC_FCOE_FCFI,
3188ef270ab1SKenneth D. Merry SLI_RSRC_MAX /* must be last */
3189ef270ab1SKenneth D. Merry } sli4_resource_e;
3190ef270ab1SKenneth D. Merry
3191ef270ab1SKenneth D. Merry typedef enum {
3192ef270ab1SKenneth D. Merry SLI4_PORT_TYPE_FC,
3193ef270ab1SKenneth D. Merry SLI4_PORT_TYPE_NIC,
3194ef270ab1SKenneth D. Merry SLI4_PORT_TYPE_MAX /* must be last */
3195ef270ab1SKenneth D. Merry } sli4_port_type_e;
3196ef270ab1SKenneth D. Merry
3197ef270ab1SKenneth D. Merry typedef enum {
3198ef270ab1SKenneth D. Merry SLI4_ASIC_TYPE_BE3 = 1,
3199ef270ab1SKenneth D. Merry SLI4_ASIC_TYPE_SKYHAWK,
3200ef270ab1SKenneth D. Merry SLI4_ASIC_TYPE_LANCER,
3201ef270ab1SKenneth D. Merry SLI4_ASIC_TYPE_CORSAIR,
3202ef270ab1SKenneth D. Merry SLI4_ASIC_TYPE_LANCERG6,
32033bf42363SRam Kishore Vegesna SLI4_ASIC_TYPE_LANCERG7
3204ef270ab1SKenneth D. Merry } sli4_asic_type_e;
3205ef270ab1SKenneth D. Merry
3206ef270ab1SKenneth D. Merry typedef enum {
3207ef270ab1SKenneth D. Merry SLI4_ASIC_REV_FPGA = 1,
3208ef270ab1SKenneth D. Merry SLI4_ASIC_REV_A0,
3209ef270ab1SKenneth D. Merry SLI4_ASIC_REV_A1,
3210ef270ab1SKenneth D. Merry SLI4_ASIC_REV_A2,
3211ef270ab1SKenneth D. Merry SLI4_ASIC_REV_A3,
3212ef270ab1SKenneth D. Merry SLI4_ASIC_REV_B0,
3213ef270ab1SKenneth D. Merry SLI4_ASIC_REV_B1,
3214ef270ab1SKenneth D. Merry SLI4_ASIC_REV_C0,
3215ef270ab1SKenneth D. Merry SLI4_ASIC_REV_D0,
3216ef270ab1SKenneth D. Merry } sli4_asic_rev_e;
3217ef270ab1SKenneth D. Merry
3218ef270ab1SKenneth D. Merry typedef struct sli4_s {
3219ef270ab1SKenneth D. Merry ocs_os_handle_t os;
3220ef270ab1SKenneth D. Merry sli4_port_type_e port_type;
3221ef270ab1SKenneth D. Merry
3222ef270ab1SKenneth D. Merry uint32_t sli_rev; /* SLI revision number */
3223ef270ab1SKenneth D. Merry uint32_t sli_family;
3224ef270ab1SKenneth D. Merry uint32_t if_type; /* SLI Interface type */
3225ef270ab1SKenneth D. Merry
3226ef270ab1SKenneth D. Merry sli4_asic_type_e asic_type; /*<< ASIC type */
3227ef270ab1SKenneth D. Merry sli4_asic_rev_e asic_rev; /*<< ASIC revision */
3228ef270ab1SKenneth D. Merry uint32_t physical_port;
3229ef270ab1SKenneth D. Merry
3230ef270ab1SKenneth D. Merry struct {
3231ef270ab1SKenneth D. Merry uint16_t e_d_tov;
3232ef270ab1SKenneth D. Merry uint16_t r_a_tov;
3233ef270ab1SKenneth D. Merry uint16_t max_qcount[SLI_QTYPE_MAX];
3234ef270ab1SKenneth D. Merry uint32_t max_qentries[SLI_QTYPE_MAX];
3235ef270ab1SKenneth D. Merry uint16_t count_mask[SLI_QTYPE_MAX];
3236ef270ab1SKenneth D. Merry uint16_t count_method[SLI_QTYPE_MAX];
3237ef270ab1SKenneth D. Merry uint32_t qpage_count[SLI_QTYPE_MAX];
3238ef270ab1SKenneth D. Merry uint16_t link_module_type;
3239ef270ab1SKenneth D. Merry uint8_t rq_batch;
3240ef270ab1SKenneth D. Merry uint16_t rq_min_buf_size;
3241ef270ab1SKenneth D. Merry uint32_t rq_max_buf_size;
3242ef270ab1SKenneth D. Merry uint8_t topology;
3243965e2154SRam Kishore Vegesna uint8_t pt:4,
3244965e2154SRam Kishore Vegesna tf:1,
3245965e2154SRam Kishore Vegesna ptv:1,
3246965e2154SRam Kishore Vegesna :2;
3247ef270ab1SKenneth D. Merry uint8_t wwpn[8];
3248ef270ab1SKenneth D. Merry uint8_t wwnn[8];
3249ef270ab1SKenneth D. Merry uint32_t fw_rev[2];
3250ef270ab1SKenneth D. Merry uint8_t fw_name[2][16];
3251ef270ab1SKenneth D. Merry char ipl_name[16];
3252ef270ab1SKenneth D. Merry uint32_t hw_rev[3];
3253ef270ab1SKenneth D. Merry uint8_t port_number;
3254ef270ab1SKenneth D. Merry char port_name[2];
3255ef270ab1SKenneth D. Merry char bios_version_string[32];
3256ef270ab1SKenneth D. Merry uint8_t dual_ulp_capable;
3257ef270ab1SKenneth D. Merry uint8_t is_ulp_fc[2];
3258ef270ab1SKenneth D. Merry /*
3259ef270ab1SKenneth D. Merry * Tracks the port resources using extents metaphor. For
3260ef270ab1SKenneth D. Merry * devices that don't implement extents (i.e.
3261ef270ab1SKenneth D. Merry * has_extents == FALSE), the code models each resource as
3262ef270ab1SKenneth D. Merry * a single large extent.
3263ef270ab1SKenneth D. Merry */
3264ef270ab1SKenneth D. Merry struct {
3265ef270ab1SKenneth D. Merry uint32_t number; /* number of extents */
3266ef270ab1SKenneth D. Merry uint32_t size; /* number of elements in each extent */
3267ef270ab1SKenneth D. Merry uint32_t n_alloc;/* number of elements allocated */
3268ef270ab1SKenneth D. Merry uint32_t *base;
3269ef270ab1SKenneth D. Merry ocs_bitmap_t *use_map;/* bitmap showing resources in use */
3270ef270ab1SKenneth D. Merry uint32_t map_size;/* number of bits in bitmap */
3271ef270ab1SKenneth D. Merry } extent[SLI_RSRC_MAX];
3272ef270ab1SKenneth D. Merry sli4_features_t features;
3273ef270ab1SKenneth D. Merry uint32_t has_extents:1,
3274ef270ab1SKenneth D. Merry auto_reg:1,
3275ef270ab1SKenneth D. Merry auto_xfer_rdy:1,
3276ef270ab1SKenneth D. Merry hdr_template_req:1,
3277ef270ab1SKenneth D. Merry perf_hint:1,
3278ef270ab1SKenneth D. Merry perf_wq_id_association:1,
3279ef270ab1SKenneth D. Merry cq_create_version:2,
3280ef270ab1SKenneth D. Merry mq_create_version:2,
3281ef270ab1SKenneth D. Merry high_login_mode:1,
3282ef270ab1SKenneth D. Merry sgl_pre_registered:1,
3283ef270ab1SKenneth D. Merry sgl_pre_registration_required:1,
3284ef270ab1SKenneth D. Merry t10_dif_inline_capable:1,
3285ef270ab1SKenneth D. Merry t10_dif_separate_capable:1;
3286ef270ab1SKenneth D. Merry uint32_t sge_supported_length;
3287ef270ab1SKenneth D. Merry uint32_t sgl_page_sizes;
3288ef270ab1SKenneth D. Merry uint32_t max_sgl_pages;
3289ef270ab1SKenneth D. Merry sli4_sgl_chaining_params_t sgl_chaining_params;
3290ef270ab1SKenneth D. Merry size_t wqe_size;
3291ef270ab1SKenneth D. Merry } config;
3292ef270ab1SKenneth D. Merry
3293ef270ab1SKenneth D. Merry /*
3294ef270ab1SKenneth D. Merry * Callback functions
3295ef270ab1SKenneth D. Merry */
3296ef270ab1SKenneth D. Merry int32_t (*link)(void *, void *);
3297ef270ab1SKenneth D. Merry void *link_arg;
3298ef270ab1SKenneth D. Merry int32_t (*fip)(void *, void *);
3299ef270ab1SKenneth D. Merry void *fip_arg;
3300ef270ab1SKenneth D. Merry
3301ef270ab1SKenneth D. Merry ocs_dma_t bmbx;
3302ef270ab1SKenneth D. Merry #if defined(OCS_INCLUDE_DEBUG)
3303ef270ab1SKenneth D. Merry /* Save pointer to physical memory descriptor for non-embedded SLI_CONFIG
3304ef270ab1SKenneth D. Merry * commands for BMBX dumping purposes */
3305ef270ab1SKenneth D. Merry ocs_dma_t *bmbx_non_emb_pmd;
3306ef270ab1SKenneth D. Merry #endif
3307ef270ab1SKenneth D. Merry
3308ef270ab1SKenneth D. Merry struct {
3309ef270ab1SKenneth D. Merry ocs_dma_t data;
3310ef270ab1SKenneth D. Merry uint32_t length;
3311ef270ab1SKenneth D. Merry } vpd;
3312ef270ab1SKenneth D. Merry } sli4_t;
3313ef270ab1SKenneth D. Merry
3314ef270ab1SKenneth D. Merry /**
3315ef270ab1SKenneth D. Merry * Get / set parameter functions
3316ef270ab1SKenneth D. Merry */
3317ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_max_rsrc(sli4_t * sli4,sli4_resource_e rsrc)3318ef270ab1SKenneth D. Merry sli_get_max_rsrc(sli4_t *sli4, sli4_resource_e rsrc)
3319ef270ab1SKenneth D. Merry {
3320ef270ab1SKenneth D. Merry if (rsrc >= SLI_RSRC_MAX) {
3321ef270ab1SKenneth D. Merry return 0;
3322ef270ab1SKenneth D. Merry }
3323ef270ab1SKenneth D. Merry
3324ef270ab1SKenneth D. Merry return sli4->config.extent[rsrc].size;
3325ef270ab1SKenneth D. Merry }
3326ef270ab1SKenneth D. Merry
3327ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_max_queue(sli4_t * sli4,sli4_qtype_e qtype)3328ef270ab1SKenneth D. Merry sli_get_max_queue(sli4_t *sli4, sli4_qtype_e qtype)
3329ef270ab1SKenneth D. Merry {
3330ef270ab1SKenneth D. Merry if (qtype >= SLI_QTYPE_MAX) {
3331ef270ab1SKenneth D. Merry return 0;
3332ef270ab1SKenneth D. Merry }
3333ef270ab1SKenneth D. Merry return sli4->config.max_qcount[qtype];
3334ef270ab1SKenneth D. Merry }
3335ef270ab1SKenneth D. Merry
3336ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_max_qentries(sli4_t * sli4,sli4_qtype_e qtype)3337ef270ab1SKenneth D. Merry sli_get_max_qentries(sli4_t *sli4, sli4_qtype_e qtype)
3338ef270ab1SKenneth D. Merry {
3339ef270ab1SKenneth D. Merry
3340ef270ab1SKenneth D. Merry return sli4->config.max_qentries[qtype];
3341ef270ab1SKenneth D. Merry }
3342ef270ab1SKenneth D. Merry
3343ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_max_sge(sli4_t * sli4)3344ef270ab1SKenneth D. Merry sli_get_max_sge(sli4_t *sli4)
3345ef270ab1SKenneth D. Merry {
3346ef270ab1SKenneth D. Merry return sli4->config.sge_supported_length;
3347ef270ab1SKenneth D. Merry }
3348ef270ab1SKenneth D. Merry
3349ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_max_sgl(sli4_t * sli4)3350ef270ab1SKenneth D. Merry sli_get_max_sgl(sli4_t *sli4)
3351ef270ab1SKenneth D. Merry {
3352ef270ab1SKenneth D. Merry
3353ef270ab1SKenneth D. Merry if (sli4->config.sgl_page_sizes != 1) {
3354ef270ab1SKenneth D. Merry ocs_log_test(sli4->os, "unsupported SGL page sizes %#x\n",
3355ef270ab1SKenneth D. Merry sli4->config.sgl_page_sizes);
3356ef270ab1SKenneth D. Merry return 0;
3357ef270ab1SKenneth D. Merry }
3358ef270ab1SKenneth D. Merry
3359ef270ab1SKenneth D. Merry return ((sli4->config.max_sgl_pages * SLI_PAGE_SIZE) / sizeof(sli4_sge_t));
3360ef270ab1SKenneth D. Merry }
3361ef270ab1SKenneth D. Merry
3362ef270ab1SKenneth D. Merry static inline sli4_link_medium_e
sli_get_medium(sli4_t * sli4)3363ef270ab1SKenneth D. Merry sli_get_medium(sli4_t *sli4)
3364ef270ab1SKenneth D. Merry {
3365ef270ab1SKenneth D. Merry switch (sli4->config.topology) {
3366ef270ab1SKenneth D. Merry case SLI4_READ_CFG_TOPO_FCOE:
3367ef270ab1SKenneth D. Merry return SLI_LINK_MEDIUM_ETHERNET;
3368ef270ab1SKenneth D. Merry case SLI4_READ_CFG_TOPO_FC:
3369ef270ab1SKenneth D. Merry case SLI4_READ_CFG_TOPO_FC_DA:
3370ef270ab1SKenneth D. Merry case SLI4_READ_CFG_TOPO_FC_AL:
3371ef270ab1SKenneth D. Merry return SLI_LINK_MEDIUM_FC;
3372ef270ab1SKenneth D. Merry default:
3373ef270ab1SKenneth D. Merry return SLI_LINK_MEDIUM_MAX;
3374ef270ab1SKenneth D. Merry }
3375ef270ab1SKenneth D. Merry }
3376ef270ab1SKenneth D. Merry
3377ef270ab1SKenneth D. Merry static inline void
sli_skh_chain_sge_build(sli4_t * sli4,sli4_sge_t * sge,uint32_t xri_index,uint32_t frag_num,uint32_t offset)3378ef270ab1SKenneth D. Merry sli_skh_chain_sge_build(sli4_t *sli4, sli4_sge_t *sge, uint32_t xri_index, uint32_t frag_num, uint32_t offset)
3379ef270ab1SKenneth D. Merry {
3380ef270ab1SKenneth D. Merry sli4_sgl_chaining_params_t *cparms = &sli4->config.sgl_chaining_params;
3381ef270ab1SKenneth D. Merry
3382ef270ab1SKenneth D. Merry ocs_memset(sge, 0, sizeof(*sge));
3383ef270ab1SKenneth D. Merry sge->sge_type = SLI4_SGE_TYPE_CHAIN;
3384ef270ab1SKenneth D. Merry sge->buffer_address_high = (uint32_t)cparms->chain_sge_initial_value_hi;
3385ef270ab1SKenneth D. Merry sge->buffer_address_low =
3386ef270ab1SKenneth D. Merry (uint32_t)((cparms->chain_sge_initial_value_lo |
3387ef270ab1SKenneth D. Merry (((uintptr_t)(xri_index & cparms->sgl_index_field_mask)) <<
3388ef270ab1SKenneth D. Merry cparms->sgl_index_field_offset) |
3389ef270ab1SKenneth D. Merry (((uintptr_t)(frag_num & cparms->frag_num_field_mask)) <<
3390ef270ab1SKenneth D. Merry cparms->frag_num_field_offset) |
3391ef270ab1SKenneth D. Merry offset) >> 3);
3392ef270ab1SKenneth D. Merry }
3393ef270ab1SKenneth D. Merry
3394ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_sli_rev(sli4_t * sli4)3395ef270ab1SKenneth D. Merry sli_get_sli_rev(sli4_t *sli4)
3396ef270ab1SKenneth D. Merry {
3397ef270ab1SKenneth D. Merry return sli4->sli_rev;
3398ef270ab1SKenneth D. Merry }
3399ef270ab1SKenneth D. Merry
3400ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_sli_family(sli4_t * sli4)3401ef270ab1SKenneth D. Merry sli_get_sli_family(sli4_t *sli4)
3402ef270ab1SKenneth D. Merry {
3403ef270ab1SKenneth D. Merry return sli4->sli_family;
3404ef270ab1SKenneth D. Merry }
3405ef270ab1SKenneth D. Merry
3406ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_if_type(sli4_t * sli4)3407ef270ab1SKenneth D. Merry sli_get_if_type(sli4_t *sli4)
3408ef270ab1SKenneth D. Merry {
3409ef270ab1SKenneth D. Merry return sli4->if_type;
3410ef270ab1SKenneth D. Merry }
3411ef270ab1SKenneth D. Merry
3412ef270ab1SKenneth D. Merry static inline void *
sli_get_wwn_port(sli4_t * sli4)3413ef270ab1SKenneth D. Merry sli_get_wwn_port(sli4_t *sli4)
3414ef270ab1SKenneth D. Merry {
3415ef270ab1SKenneth D. Merry return sli4->config.wwpn;
3416ef270ab1SKenneth D. Merry }
3417ef270ab1SKenneth D. Merry
3418ef270ab1SKenneth D. Merry static inline void *
sli_get_wwn_node(sli4_t * sli4)3419ef270ab1SKenneth D. Merry sli_get_wwn_node(sli4_t *sli4)
3420ef270ab1SKenneth D. Merry {
3421ef270ab1SKenneth D. Merry return sli4->config.wwnn;
3422ef270ab1SKenneth D. Merry }
3423ef270ab1SKenneth D. Merry
3424ef270ab1SKenneth D. Merry static inline void *
sli_get_vpd(sli4_t * sli4)3425ef270ab1SKenneth D. Merry sli_get_vpd(sli4_t *sli4)
3426ef270ab1SKenneth D. Merry {
3427ef270ab1SKenneth D. Merry return sli4->vpd.data.virt;
3428ef270ab1SKenneth D. Merry }
3429ef270ab1SKenneth D. Merry
3430ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_vpd_len(sli4_t * sli4)3431ef270ab1SKenneth D. Merry sli_get_vpd_len(sli4_t *sli4)
3432ef270ab1SKenneth D. Merry {
3433ef270ab1SKenneth D. Merry return sli4->vpd.length;
3434ef270ab1SKenneth D. Merry }
3435ef270ab1SKenneth D. Merry
3436ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_fw_revision(sli4_t * sli4,uint32_t which)3437ef270ab1SKenneth D. Merry sli_get_fw_revision(sli4_t *sli4, uint32_t which)
3438ef270ab1SKenneth D. Merry {
3439ef270ab1SKenneth D. Merry return sli4->config.fw_rev[which];
3440ef270ab1SKenneth D. Merry }
3441ef270ab1SKenneth D. Merry
3442ef270ab1SKenneth D. Merry static inline void *
sli_get_fw_name(sli4_t * sli4,uint32_t which)3443ef270ab1SKenneth D. Merry sli_get_fw_name(sli4_t *sli4, uint32_t which)
3444ef270ab1SKenneth D. Merry {
3445ef270ab1SKenneth D. Merry return sli4->config.fw_name[which];
3446ef270ab1SKenneth D. Merry }
3447ef270ab1SKenneth D. Merry
3448ef270ab1SKenneth D. Merry static inline char *
sli_get_ipl_name(sli4_t * sli4)3449ef270ab1SKenneth D. Merry sli_get_ipl_name(sli4_t *sli4)
3450ef270ab1SKenneth D. Merry {
3451ef270ab1SKenneth D. Merry return sli4->config.ipl_name;
3452ef270ab1SKenneth D. Merry }
3453ef270ab1SKenneth D. Merry
3454ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_hw_revision(sli4_t * sli4,uint32_t which)3455ef270ab1SKenneth D. Merry sli_get_hw_revision(sli4_t *sli4, uint32_t which)
3456ef270ab1SKenneth D. Merry {
3457ef270ab1SKenneth D. Merry return sli4->config.hw_rev[which];
3458ef270ab1SKenneth D. Merry }
3459ef270ab1SKenneth D. Merry
3460ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_auto_xfer_rdy_capable(sli4_t * sli4)3461ef270ab1SKenneth D. Merry sli_get_auto_xfer_rdy_capable(sli4_t *sli4)
3462ef270ab1SKenneth D. Merry {
3463ef270ab1SKenneth D. Merry return sli4->config.auto_xfer_rdy;
3464ef270ab1SKenneth D. Merry }
3465ef270ab1SKenneth D. Merry
3466ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_dif_capable(sli4_t * sli4)3467ef270ab1SKenneth D. Merry sli_get_dif_capable(sli4_t *sli4)
3468ef270ab1SKenneth D. Merry {
3469ef270ab1SKenneth D. Merry return sli4->config.features.flag.dif;
3470ef270ab1SKenneth D. Merry }
3471ef270ab1SKenneth D. Merry
3472ef270ab1SKenneth D. Merry static inline uint32_t
sli_is_dif_inline_capable(sli4_t * sli4)3473ef270ab1SKenneth D. Merry sli_is_dif_inline_capable(sli4_t *sli4)
3474ef270ab1SKenneth D. Merry {
3475ef270ab1SKenneth D. Merry return sli_get_dif_capable(sli4) && sli4->config.t10_dif_inline_capable;
3476ef270ab1SKenneth D. Merry }
3477ef270ab1SKenneth D. Merry
3478ef270ab1SKenneth D. Merry static inline uint32_t
sli_is_dif_separate_capable(sli4_t * sli4)3479ef270ab1SKenneth D. Merry sli_is_dif_separate_capable(sli4_t *sli4)
3480ef270ab1SKenneth D. Merry {
3481ef270ab1SKenneth D. Merry return sli_get_dif_capable(sli4) && sli4->config.t10_dif_separate_capable;
3482ef270ab1SKenneth D. Merry }
3483ef270ab1SKenneth D. Merry
3484ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_is_dual_ulp_capable(sli4_t * sli4)3485ef270ab1SKenneth D. Merry sli_get_is_dual_ulp_capable(sli4_t *sli4)
3486ef270ab1SKenneth D. Merry {
3487ef270ab1SKenneth D. Merry return sli4->config.dual_ulp_capable;
3488ef270ab1SKenneth D. Merry }
3489ef270ab1SKenneth D. Merry
3490ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_is_sgl_chaining_capable(sli4_t * sli4)3491ef270ab1SKenneth D. Merry sli_get_is_sgl_chaining_capable(sli4_t *sli4)
3492ef270ab1SKenneth D. Merry {
3493ef270ab1SKenneth D. Merry return sli4->config.sgl_chaining_params.chaining_capable;
3494ef270ab1SKenneth D. Merry }
3495ef270ab1SKenneth D. Merry
3496ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_is_ulp_enabled(sli4_t * sli4,uint16_t ulp)3497ef270ab1SKenneth D. Merry sli_get_is_ulp_enabled(sli4_t *sli4, uint16_t ulp)
3498ef270ab1SKenneth D. Merry {
3499ef270ab1SKenneth D. Merry return sli4->config.is_ulp_fc[ulp];
3500ef270ab1SKenneth D. Merry }
3501ef270ab1SKenneth D. Merry
3502ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_hlm_capable(sli4_t * sli4)3503ef270ab1SKenneth D. Merry sli_get_hlm_capable(sli4_t *sli4)
3504ef270ab1SKenneth D. Merry {
3505ef270ab1SKenneth D. Merry return sli4->config.features.flag.hlm;
3506ef270ab1SKenneth D. Merry }
3507ef270ab1SKenneth D. Merry
3508ef270ab1SKenneth D. Merry static inline int32_t
sli_set_hlm(sli4_t * sli4,uint32_t value)3509ef270ab1SKenneth D. Merry sli_set_hlm(sli4_t *sli4, uint32_t value)
3510ef270ab1SKenneth D. Merry {
3511ef270ab1SKenneth D. Merry if (value && !sli4->config.features.flag.hlm) {
3512ef270ab1SKenneth D. Merry ocs_log_test(sli4->os, "HLM not supported\n");
3513ef270ab1SKenneth D. Merry return -1;
3514ef270ab1SKenneth D. Merry }
3515ef270ab1SKenneth D. Merry
3516ef270ab1SKenneth D. Merry sli4->config.high_login_mode = value != 0 ? TRUE : FALSE;
3517ef270ab1SKenneth D. Merry
3518ef270ab1SKenneth D. Merry return 0;
3519ef270ab1SKenneth D. Merry }
3520ef270ab1SKenneth D. Merry
3521ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_hlm(sli4_t * sli4)3522ef270ab1SKenneth D. Merry sli_get_hlm(sli4_t *sli4)
3523ef270ab1SKenneth D. Merry {
3524ef270ab1SKenneth D. Merry return sli4->config.high_login_mode;
3525ef270ab1SKenneth D. Merry }
3526ef270ab1SKenneth D. Merry
3527ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_sgl_preregister_required(sli4_t * sli4)3528ef270ab1SKenneth D. Merry sli_get_sgl_preregister_required(sli4_t *sli4)
3529ef270ab1SKenneth D. Merry {
3530ef270ab1SKenneth D. Merry return sli4->config.sgl_pre_registration_required;
3531ef270ab1SKenneth D. Merry }
3532ef270ab1SKenneth D. Merry
3533ef270ab1SKenneth D. Merry static inline uint32_t
sli_get_sgl_preregister(sli4_t * sli4)3534ef270ab1SKenneth D. Merry sli_get_sgl_preregister(sli4_t *sli4)
3535ef270ab1SKenneth D. Merry {
3536ef270ab1SKenneth D. Merry return sli4->config.sgl_pre_registered;
3537ef270ab1SKenneth D. Merry }
3538ef270ab1SKenneth D. Merry
3539ef270ab1SKenneth D. Merry static inline int32_t
sli_set_sgl_preregister(sli4_t * sli4,uint32_t value)3540ef270ab1SKenneth D. Merry sli_set_sgl_preregister(sli4_t *sli4, uint32_t value)
3541ef270ab1SKenneth D. Merry {
3542ef270ab1SKenneth D. Merry if ((value == 0) && sli4->config.sgl_pre_registration_required) {
3543ef270ab1SKenneth D. Merry ocs_log_test(sli4->os, "SGL pre-registration required\n");
3544ef270ab1SKenneth D. Merry return -1;
3545ef270ab1SKenneth D. Merry }
3546ef270ab1SKenneth D. Merry
3547ef270ab1SKenneth D. Merry sli4->config.sgl_pre_registered = value != 0 ? TRUE : FALSE;
3548ef270ab1SKenneth D. Merry
3549ef270ab1SKenneth D. Merry return 0;
3550ef270ab1SKenneth D. Merry }
3551ef270ab1SKenneth D. Merry
3552ef270ab1SKenneth D. Merry static inline sli4_asic_type_e
sli_get_asic_type(sli4_t * sli4)3553ef270ab1SKenneth D. Merry sli_get_asic_type(sli4_t *sli4)
3554ef270ab1SKenneth D. Merry {
3555ef270ab1SKenneth D. Merry return sli4->asic_type;
3556ef270ab1SKenneth D. Merry }
3557ef270ab1SKenneth D. Merry
3558ef270ab1SKenneth D. Merry static inline sli4_asic_rev_e
sli_get_asic_rev(sli4_t * sli4)3559ef270ab1SKenneth D. Merry sli_get_asic_rev(sli4_t *sli4)
3560ef270ab1SKenneth D. Merry {
3561ef270ab1SKenneth D. Merry return sli4->asic_rev;
3562ef270ab1SKenneth D. Merry }
3563ef270ab1SKenneth D. Merry
3564ef270ab1SKenneth D. Merry static inline int32_t
sli_set_topology(sli4_t * sli4,uint32_t value)3565ef270ab1SKenneth D. Merry sli_set_topology(sli4_t *sli4, uint32_t value)
3566ef270ab1SKenneth D. Merry {
3567ef270ab1SKenneth D. Merry int32_t rc = 0;
3568ef270ab1SKenneth D. Merry
3569ef270ab1SKenneth D. Merry switch (value) {
3570ef270ab1SKenneth D. Merry case SLI4_READ_CFG_TOPO_FCOE:
3571ef270ab1SKenneth D. Merry case SLI4_READ_CFG_TOPO_FC:
3572ef270ab1SKenneth D. Merry case SLI4_READ_CFG_TOPO_FC_DA:
3573ef270ab1SKenneth D. Merry case SLI4_READ_CFG_TOPO_FC_AL:
3574ef270ab1SKenneth D. Merry sli4->config.topology = value;
3575ef270ab1SKenneth D. Merry break;
3576ef270ab1SKenneth D. Merry default:
3577ef270ab1SKenneth D. Merry ocs_log_test(sli4->os, "unsupported topology %#x\n", value);
3578ef270ab1SKenneth D. Merry rc = -1;
3579ef270ab1SKenneth D. Merry }
3580ef270ab1SKenneth D. Merry
3581ef270ab1SKenneth D. Merry return rc;
3582ef270ab1SKenneth D. Merry }
3583ef270ab1SKenneth D. Merry
3584965e2154SRam Kishore Vegesna static inline void
sli_config_persistent_topology(sli4_t * sli4,sli4_req_common_set_features_persistent_topo_param_t * req)3585965e2154SRam Kishore Vegesna sli_config_persistent_topology(sli4_t *sli4, sli4_req_common_set_features_persistent_topo_param_t *req)
3586965e2154SRam Kishore Vegesna {
3587965e2154SRam Kishore Vegesna sli4->config.pt = req->persistent_topo;
3588965e2154SRam Kishore Vegesna sli4->config.tf = req->topo_failover;
3589965e2154SRam Kishore Vegesna }
3590965e2154SRam Kishore Vegesna
3591ef270ab1SKenneth D. Merry static inline uint16_t
sli_get_link_module_type(sli4_t * sli4)3592ef270ab1SKenneth D. Merry sli_get_link_module_type(sli4_t *sli4)
3593ef270ab1SKenneth D. Merry {
3594ef270ab1SKenneth D. Merry return sli4->config.link_module_type;
3595ef270ab1SKenneth D. Merry }
3596ef270ab1SKenneth D. Merry
3597ef270ab1SKenneth D. Merry static inline char *
sli_get_portnum(sli4_t * sli4)3598ef270ab1SKenneth D. Merry sli_get_portnum(sli4_t *sli4)
3599ef270ab1SKenneth D. Merry {
3600ef270ab1SKenneth D. Merry return sli4->config.port_name;
3601ef270ab1SKenneth D. Merry }
3602ef270ab1SKenneth D. Merry
3603ef270ab1SKenneth D. Merry static inline char *
sli_get_bios_version_string(sli4_t * sli4)3604ef270ab1SKenneth D. Merry sli_get_bios_version_string(sli4_t *sli4)
3605ef270ab1SKenneth D. Merry {
3606ef270ab1SKenneth D. Merry return sli4->config.bios_version_string;
3607ef270ab1SKenneth D. Merry }
3608ef270ab1SKenneth D. Merry
3609ef270ab1SKenneth D. Merry static inline uint32_t
sli_convert_mask_to_count(uint32_t method,uint32_t mask)3610ef270ab1SKenneth D. Merry sli_convert_mask_to_count(uint32_t method, uint32_t mask)
3611ef270ab1SKenneth D. Merry {
3612ef270ab1SKenneth D. Merry uint32_t count = 0;
3613ef270ab1SKenneth D. Merry
3614ef270ab1SKenneth D. Merry if (method) {
3615ef270ab1SKenneth D. Merry count = 1 << ocs_lg2(mask);
3616ef270ab1SKenneth D. Merry count *= 16;
3617ef270ab1SKenneth D. Merry } else {
3618ef270ab1SKenneth D. Merry count = mask;
3619ef270ab1SKenneth D. Merry }
3620ef270ab1SKenneth D. Merry
3621ef270ab1SKenneth D. Merry return count;
3622ef270ab1SKenneth D. Merry }
3623ef270ab1SKenneth D. Merry
3624965e2154SRam Kishore Vegesna static inline bool
sli_fcal_is_speed_supported(uint32_t link_speed)3625965e2154SRam Kishore Vegesna sli_fcal_is_speed_supported(uint32_t link_speed)
3626965e2154SRam Kishore Vegesna {
3627965e2154SRam Kishore Vegesna if ((link_speed == FC_LINK_SPEED_16G) ||
3628965e2154SRam Kishore Vegesna (link_speed == FC_LINK_SPEED_32G) ||
3629965e2154SRam Kishore Vegesna (link_speed >= FC_LINK_SPEED_AUTO_32_16)) {
3630965e2154SRam Kishore Vegesna ocs_log_err(NULL, "unsupported FC-AL speed (speed_code: %d)\n", link_speed);
3631965e2154SRam Kishore Vegesna return FALSE;
3632965e2154SRam Kishore Vegesna }
3633965e2154SRam Kishore Vegesna
3634965e2154SRam Kishore Vegesna return TRUE;
3635965e2154SRam Kishore Vegesna }
3636965e2154SRam Kishore Vegesna
3637ef270ab1SKenneth D. Merry /**
3638ef270ab1SKenneth D. Merry * @brief Common Create Queue function prototype
3639ef270ab1SKenneth D. Merry */
3640ef270ab1SKenneth D. Merry typedef int32_t (*sli4_create_q_fn_t)(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t);
3641ef270ab1SKenneth D. Merry
3642ef270ab1SKenneth D. Merry /**
3643ef270ab1SKenneth D. Merry * @brief Common Destroy Queue function prototype
3644ef270ab1SKenneth D. Merry */
3645ef270ab1SKenneth D. Merry typedef int32_t (*sli4_destroy_q_fn_t)(sli4_t *, void *, size_t, uint16_t);
3646ef270ab1SKenneth D. Merry
3647ef270ab1SKenneth D. Merry /****************************************************************************
3648ef270ab1SKenneth D. Merry * Function prototypes
3649ef270ab1SKenneth D. Merry */
3650ef270ab1SKenneth D. Merry extern int32_t sli_cmd_config_auto_xfer_rdy(sli4_t *, void *, size_t, uint32_t);
3651ef270ab1SKenneth D. Merry extern int32_t sli_cmd_config_auto_xfer_rdy_hp(sli4_t *, void *, size_t, uint32_t, uint32_t, uint32_t);
3652ef270ab1SKenneth D. Merry extern int32_t sli_cmd_config_link(sli4_t *, void *, size_t);
3653ef270ab1SKenneth D. Merry extern int32_t sli_cmd_down_link(sli4_t *, void *, size_t);
3654ef270ab1SKenneth D. Merry extern int32_t sli_cmd_dump_type4(sli4_t *, void *, size_t, uint16_t);
3655ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_read_transceiver_data(sli4_t *, void *, size_t, uint32_t, ocs_dma_t *);
3656ef270ab1SKenneth D. Merry extern int32_t sli_cmd_read_link_stats(sli4_t *, void *, size_t,uint8_t, uint8_t, uint8_t);
3657ef270ab1SKenneth D. Merry extern int32_t sli_cmd_read_status(sli4_t *sli4, void *buf, size_t size, uint8_t clear_counters);
3658ef270ab1SKenneth D. Merry extern int32_t sli_cmd_init_link(sli4_t *, void *, size_t, uint32_t, uint8_t);
3659ef270ab1SKenneth D. Merry extern int32_t sli_cmd_init_vfi(sli4_t *, void *, size_t, uint16_t, uint16_t, uint16_t);
3660ef270ab1SKenneth D. Merry extern int32_t sli_cmd_init_vpi(sli4_t *, void *, size_t, uint16_t, uint16_t);
3661ef270ab1SKenneth D. Merry extern int32_t sli_cmd_post_xri(sli4_t *, void *, size_t, uint16_t, uint16_t);
3662ef270ab1SKenneth D. Merry extern int32_t sli_cmd_release_xri(sli4_t *, void *, size_t, uint8_t);
3663ef270ab1SKenneth D. Merry extern int32_t sli_cmd_read_sparm64(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t);
3664ef270ab1SKenneth D. Merry extern int32_t sli_cmd_read_topology(sli4_t *, void *, size_t, ocs_dma_t *);
3665ef270ab1SKenneth D. Merry extern int32_t sli_cmd_read_nvparms(sli4_t *, void *, size_t);
3666ef270ab1SKenneth D. Merry extern int32_t sli_cmd_write_nvparms(sli4_t *, void *, size_t, uint8_t *, uint8_t *, uint8_t, uint32_t);
3667ef270ab1SKenneth D. Merry typedef struct {
3668ef270ab1SKenneth D. Merry uint16_t rq_id;
3669ef270ab1SKenneth D. Merry uint8_t r_ctl_mask;
3670ef270ab1SKenneth D. Merry uint8_t r_ctl_match;
3671ef270ab1SKenneth D. Merry uint8_t type_mask;
3672ef270ab1SKenneth D. Merry uint8_t type_match;
3673ef270ab1SKenneth D. Merry } sli4_cmd_rq_cfg_t;
3674ef270ab1SKenneth D. Merry extern int32_t sli_cmd_reg_fcfi(sli4_t *, void *, size_t, uint16_t,
3675ef270ab1SKenneth D. Merry sli4_cmd_rq_cfg_t rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG], uint16_t);
3676fb4a8616SJohn Baldwin 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 rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG]);
3677ef270ab1SKenneth D. Merry
3678ef270ab1SKenneth D. Merry 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);
3679ef270ab1SKenneth D. Merry extern int32_t sli_cmd_reg_vfi(sli4_t *, void *, size_t, ocs_domain_t *);
3680ef270ab1SKenneth D. Merry extern int32_t sli_cmd_reg_vpi(sli4_t *, void *, size_t, ocs_sli_port_t *, uint8_t);
3681ef270ab1SKenneth D. Merry extern int32_t sli_cmd_sli_config(sli4_t *, void *, size_t, uint32_t, ocs_dma_t *);
3682ef270ab1SKenneth D. Merry extern int32_t sli_cmd_unreg_fcfi(sli4_t *, void *, size_t, uint16_t);
3683ef270ab1SKenneth D. Merry extern int32_t sli_cmd_unreg_rpi(sli4_t *, void *, size_t, uint16_t, sli4_resource_e, uint32_t);
3684ef270ab1SKenneth D. Merry extern int32_t sli_cmd_unreg_vfi(sli4_t *, void *, size_t, ocs_domain_t *, uint32_t);
3685ef270ab1SKenneth D. Merry extern int32_t sli_cmd_unreg_vpi(sli4_t *, void *, size_t, uint16_t, uint32_t);
3686ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_nop(sli4_t *, void *, size_t, uint64_t);
3687ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_get_resource_extent_info(sli4_t *, void *, size_t, uint16_t);
3688ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_get_sli4_parameters(sli4_t *, void *, size_t);
3689ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_write_object(sli4_t *, void *, size_t,
3690ef270ab1SKenneth D. Merry uint16_t, uint16_t, uint32_t, uint32_t, char *, ocs_dma_t *);
3691ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_delete_object(sli4_t *, void *, size_t, char *);
3692ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_read_object(sli4_t *, void *, size_t, uint32_t,
3693ef270ab1SKenneth D. Merry uint32_t, char *, ocs_dma_t *);
3694ef270ab1SKenneth D. Merry extern int32_t sli_cmd_dmtf_exec_clp_cmd(sli4_t *sli4, void *buf, size_t size,
3695ef270ab1SKenneth D. Merry ocs_dma_t *cmd,
3696ef270ab1SKenneth D. Merry ocs_dma_t *resp);
3697ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_set_dump_location(sli4_t *sli4, void *buf, size_t size,
3698ef270ab1SKenneth D. Merry uint8_t query, uint8_t is_buffer_list,
3699ef270ab1SKenneth D. Merry ocs_dma_t *buffer, uint8_t fdb);
3700ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_set_features(sli4_t *, void *, size_t, uint32_t, uint32_t, void*);
3701ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_get_profile_list(sli4_t *sli4, void *buf,
3702ef270ab1SKenneth D. Merry size_t size, uint32_t start_profile_index, ocs_dma_t *dma);
3703ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_get_active_profile(sli4_t *sli4, void *buf,
3704ef270ab1SKenneth D. Merry size_t size);
3705ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_set_active_profile(sli4_t *sli4, void *buf,
3706ef270ab1SKenneth D. Merry size_t size,
3707ef270ab1SKenneth D. Merry uint32_t fd,
3708ef270ab1SKenneth D. Merry uint32_t active_profile_id);
3709ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_get_reconfig_link_info(sli4_t *sli4, void *buf,
3710ef270ab1SKenneth D. Merry size_t size, ocs_dma_t *dma);
3711ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_set_reconfig_link_id(sli4_t *sli4, void *buf,
3712ef270ab1SKenneth D. Merry size_t size, ocs_dma_t *dma,
3713ef270ab1SKenneth D. Merry uint32_t fd, uint32_t active_link_config_id);
3714ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_get_function_config(sli4_t *sli4, void *buf,
3715ef270ab1SKenneth D. Merry size_t size);
3716ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_get_profile_config(sli4_t *sli4, void *buf,
3717ef270ab1SKenneth D. Merry size_t size, ocs_dma_t *dma);
3718ef270ab1SKenneth D. Merry extern int32_t sli_cmd_common_set_profile_config(sli4_t *sli4, void *buf,
3719ef270ab1SKenneth D. Merry size_t size, ocs_dma_t *dma,
3720ef270ab1SKenneth D. Merry uint8_t profile_id, uint32_t descriptor_count,
3721ef270ab1SKenneth D. Merry uint8_t isap);
3722ef270ab1SKenneth D. Merry
3723ef270ab1SKenneth D. Merry extern int32_t sli_cqe_mq(void *);
3724ef270ab1SKenneth D. Merry extern int32_t sli_cqe_async(sli4_t *, void *);
3725ef270ab1SKenneth D. Merry
3726ef270ab1SKenneth D. Merry extern int32_t sli_setup(sli4_t *, ocs_os_handle_t, sli4_port_type_e);
3727ef270ab1SKenneth D. Merry extern void sli_calc_max_qentries(sli4_t *sli4);
3728ef270ab1SKenneth D. Merry extern int32_t sli_init(sli4_t *);
3729ef270ab1SKenneth D. Merry extern int32_t sli_reset(sli4_t *);
3730ef270ab1SKenneth D. Merry extern int32_t sli_fw_reset(sli4_t *);
3731ef270ab1SKenneth D. Merry extern int32_t sli_teardown(sli4_t *);
3732ef270ab1SKenneth D. Merry extern int32_t sli_callback(sli4_t *, sli4_callback_e, void *, void *);
3733ef270ab1SKenneth D. Merry extern int32_t sli_bmbx_command(sli4_t *);
3734ef270ab1SKenneth D. Merry extern int32_t __sli_queue_init(sli4_t *, sli4_queue_t *, uint32_t, size_t, uint32_t, uint32_t);
3735ef270ab1SKenneth D. Merry extern int32_t __sli_create_queue(sli4_t *, sli4_queue_t *);
3736ef270ab1SKenneth D. Merry 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);
3737ef270ab1SKenneth D. Merry extern int32_t sli_queue_alloc(sli4_t *, uint32_t, sli4_queue_t *, uint32_t, sli4_queue_t *, uint16_t);
3738ef270ab1SKenneth D. Merry extern int32_t sli_cq_alloc_set(sli4_t *, sli4_queue_t *qs[], uint32_t, uint32_t, sli4_queue_t *eqs[]);
3739ef270ab1SKenneth D. Merry extern int32_t sli_get_queue_entry_size(sli4_t *, uint32_t);
3740ef270ab1SKenneth D. Merry extern int32_t sli_queue_free(sli4_t *, sli4_queue_t *, uint32_t, uint32_t);
3741ef270ab1SKenneth D. Merry extern int32_t sli_queue_reset(sli4_t *, sli4_queue_t *);
3742ef270ab1SKenneth D. Merry extern int32_t sli_queue_is_empty(sli4_t *, sli4_queue_t *);
3743ef270ab1SKenneth D. Merry extern int32_t sli_queue_eq_arm(sli4_t *, sli4_queue_t *, uint8_t);
3744ef270ab1SKenneth D. Merry extern int32_t sli_queue_arm(sli4_t *, sli4_queue_t *, uint8_t);
3745ef270ab1SKenneth D. Merry extern int32_t _sli_queue_write(sli4_t *, sli4_queue_t *, uint8_t *);
3746ef270ab1SKenneth D. Merry extern int32_t sli_queue_write(sli4_t *, sli4_queue_t *, uint8_t *);
3747ef270ab1SKenneth D. Merry extern int32_t sli_queue_read(sli4_t *, sli4_queue_t *, uint8_t *);
3748ef270ab1SKenneth D. Merry extern int32_t sli_queue_index(sli4_t *, sli4_queue_t *);
3749ef270ab1SKenneth D. Merry extern int32_t _sli_queue_poke(sli4_t *, sli4_queue_t *, uint32_t, uint8_t *);
3750ef270ab1SKenneth D. Merry extern int32_t sli_queue_poke(sli4_t *, sli4_queue_t *, uint32_t, uint8_t *);
3751ef270ab1SKenneth D. Merry extern int32_t sli_resource_alloc(sli4_t *, sli4_resource_e, uint32_t *, uint32_t *);
3752ef270ab1SKenneth D. Merry extern int32_t sli_resource_free(sli4_t *, sli4_resource_e, uint32_t);
3753ef270ab1SKenneth D. Merry extern int32_t sli_resource_reset(sli4_t *, sli4_resource_e);
3754ef270ab1SKenneth D. Merry extern int32_t sli_eq_parse(sli4_t *, uint8_t *, uint16_t *);
3755ef270ab1SKenneth D. Merry extern int32_t sli_cq_parse(sli4_t *, sli4_queue_t *, uint8_t *, sli4_qentry_e *, uint16_t *);
3756ef270ab1SKenneth D. Merry
3757ef270ab1SKenneth D. Merry extern int32_t sli_raise_ue(sli4_t *, uint8_t);
3758ef270ab1SKenneth D. Merry extern int32_t sli_dump_is_ready(sli4_t *);
3759ef270ab1SKenneth D. Merry extern int32_t sli_dump_is_present(sli4_t *);
3760ef270ab1SKenneth D. Merry extern int32_t sli_reset_required(sli4_t *);
3761ef270ab1SKenneth D. Merry extern int32_t sli_fw_error_status(sli4_t *);
3762ef270ab1SKenneth D. Merry extern int32_t sli_fw_ready(sli4_t *);
3763ef270ab1SKenneth D. Merry extern uint32_t sli_reg_read(sli4_t *, sli4_regname_e);
3764ef270ab1SKenneth D. Merry extern void sli_reg_write(sli4_t *, sli4_regname_e, uint32_t);
3765ef270ab1SKenneth D. Merry extern int32_t sli_link_is_configurable(sli4_t *);
3766ef270ab1SKenneth D. Merry
3767ef270ab1SKenneth D. Merry #include "ocs_fcp.h"
3768ef270ab1SKenneth D. Merry
3769ef270ab1SKenneth D. Merry /**
3770ef270ab1SKenneth D. Merry * @brief Maximum value for a FCFI
3771ef270ab1SKenneth D. Merry *
3772ef270ab1SKenneth D. Merry * Note that although most commands provide a 16 bit field for the FCFI,
3773ef270ab1SKenneth D. Merry * the FC/FCoE Asynchronous Recived CQE format only provides 6 bits for
3774ef270ab1SKenneth D. Merry * the returned FCFI. Then effectively, the FCFI cannot be larger than
3775ef270ab1SKenneth D. Merry * 1 << 6 or 64.
3776ef270ab1SKenneth D. Merry */
3777ef270ab1SKenneth D. Merry #define SLI4_MAX_FCFI 64
3778ef270ab1SKenneth D. Merry
3779ef270ab1SKenneth D. Merry /**
3780ef270ab1SKenneth D. Merry * @brief Maximum value for FCF index
3781ef270ab1SKenneth D. Merry *
3782ef270ab1SKenneth D. Merry * The SLI-4 specification uses a 16 bit field in most places for the FCF
3783ef270ab1SKenneth D. Merry * index, but practically, this value will be much smaller. Arbitrarily
3784ef270ab1SKenneth D. Merry * limit the max FCF index to match the max FCFI value.
3785ef270ab1SKenneth D. Merry */
3786ef270ab1SKenneth D. Merry #define SLI4_MAX_FCF_INDEX SLI4_MAX_FCFI
3787ef270ab1SKenneth D. Merry
3788ef270ab1SKenneth D. Merry /*************************************************************************
3789ef270ab1SKenneth D. Merry * SLI-4 FC/FCoE mailbox command formats and definitions.
3790ef270ab1SKenneth D. Merry */
3791ef270ab1SKenneth D. Merry
3792ef270ab1SKenneth D. Merry /**
3793ef270ab1SKenneth D. Merry * FC/FCoE opcode (OPC) values.
3794ef270ab1SKenneth D. Merry */
3795ef270ab1SKenneth D. Merry #define SLI4_OPC_FCOE_WQ_CREATE 0x1
3796ef270ab1SKenneth D. Merry #define SLI4_OPC_FCOE_WQ_DESTROY 0x2
3797ef270ab1SKenneth D. Merry #define SLI4_OPC_FCOE_POST_SGL_PAGES 0x3
3798ef270ab1SKenneth D. Merry #define SLI4_OPC_FCOE_RQ_CREATE 0x5
3799ef270ab1SKenneth D. Merry #define SLI4_OPC_FCOE_RQ_DESTROY 0x6
3800ef270ab1SKenneth D. Merry #define SLI4_OPC_FCOE_READ_FCF_TABLE 0x8
3801ef270ab1SKenneth D. Merry #define SLI4_OPC_FCOE_POST_HDR_TEMPLATES 0xb
3802ef270ab1SKenneth D. Merry #define SLI4_OPC_FCOE_REDISCOVER_FCF 0x10
3803ef270ab1SKenneth D. Merry
3804ef270ab1SKenneth D. Merry /* Use the default CQ associated with the WQ */
3805ef270ab1SKenneth D. Merry #define SLI4_CQ_DEFAULT 0xffff
3806ef270ab1SKenneth D. Merry
3807ef270ab1SKenneth D. Merry typedef struct sli4_physical_page_descriptor_s {
3808ef270ab1SKenneth D. Merry uint32_t low;
3809ef270ab1SKenneth D. Merry uint32_t high;
3810ef270ab1SKenneth D. Merry } sli4_physical_page_descriptor_t;
3811ef270ab1SKenneth D. Merry
3812ef270ab1SKenneth D. Merry /**
3813ef270ab1SKenneth D. Merry * @brief FCOE_WQ_CREATE
3814ef270ab1SKenneth D. Merry *
3815ef270ab1SKenneth D. Merry * Create a Work Queue for FC/FCoE use.
3816ef270ab1SKenneth D. Merry */
3817ef270ab1SKenneth D. Merry #define SLI4_FCOE_WQ_CREATE_V0_MAX_PAGES 4
3818ef270ab1SKenneth D. Merry
3819ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_wq_create_s {
3820ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
3821ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
3822ef270ab1SKenneth D. Merry uint32_t num_pages:8,
3823ef270ab1SKenneth D. Merry dua:1,
3824ef270ab1SKenneth D. Merry :7,
3825ef270ab1SKenneth D. Merry cq_id:16;
3826ef270ab1SKenneth D. Merry sli4_physical_page_descriptor_t page_physical_address[SLI4_FCOE_WQ_CREATE_V0_MAX_PAGES];
3827ef270ab1SKenneth D. Merry uint32_t bqu:1,
3828ef270ab1SKenneth D. Merry :7,
3829ef270ab1SKenneth D. Merry ulp:8,
3830ef270ab1SKenneth D. Merry :16;
3831ef270ab1SKenneth D. Merry #else
3832ef270ab1SKenneth D. Merry #error big endian version not defined
3833ef270ab1SKenneth D. Merry #endif
3834ef270ab1SKenneth D. Merry } sli4_req_fcoe_wq_create_t;
3835ef270ab1SKenneth D. Merry
3836ef270ab1SKenneth D. Merry /**
3837ef270ab1SKenneth D. Merry * @brief FCOE_WQ_CREATE_V1
3838ef270ab1SKenneth D. Merry *
3839ef270ab1SKenneth D. Merry * Create a version 1 Work Queue for FC/FCoE use.
3840ef270ab1SKenneth D. Merry */
3841ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_wq_create_v1_s {
3842ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
3843ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
3844ef270ab1SKenneth D. Merry uint32_t num_pages:16,
3845ef270ab1SKenneth D. Merry cq_id:16;
3846ef270ab1SKenneth D. Merry uint32_t page_size:8,
3847ef270ab1SKenneth D. Merry wqe_size:4,
3848ef270ab1SKenneth D. Merry :4,
3849ef270ab1SKenneth D. Merry wqe_count:16;
3850ef270ab1SKenneth D. Merry uint32_t rsvd6;
3851ef270ab1SKenneth D. Merry sli4_physical_page_descriptor_t page_physical_address[8];
3852ef270ab1SKenneth D. Merry #else
3853ef270ab1SKenneth D. Merry #error big endian version not defined
3854ef270ab1SKenneth D. Merry #endif
3855ef270ab1SKenneth D. Merry } sli4_req_fcoe_wq_create_v1_t;
3856ef270ab1SKenneth D. Merry
3857ef270ab1SKenneth D. Merry #define SLI4_FCOE_WQ_CREATE_V1_MAX_PAGES 8
3858ef270ab1SKenneth D. Merry
3859ef270ab1SKenneth D. Merry /**
3860ef270ab1SKenneth D. Merry * @brief FCOE_WQ_DESTROY
3861ef270ab1SKenneth D. Merry *
3862ef270ab1SKenneth D. Merry * Destroy an FC/FCoE Work Queue.
3863ef270ab1SKenneth D. Merry */
3864ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_wq_destroy_s {
3865ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
3866ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
3867ef270ab1SKenneth D. Merry uint32_t wq_id:16,
3868ef270ab1SKenneth D. Merry :16;
3869ef270ab1SKenneth D. Merry #else
3870ef270ab1SKenneth D. Merry #error big endian version not defined
3871ef270ab1SKenneth D. Merry #endif
3872ef270ab1SKenneth D. Merry } sli4_req_fcoe_wq_destroy_t;
3873ef270ab1SKenneth D. Merry
3874ef270ab1SKenneth D. Merry /**
3875ef270ab1SKenneth D. Merry * @brief FCOE_POST_SGL_PAGES
3876ef270ab1SKenneth D. Merry *
3877ef270ab1SKenneth D. Merry * Register the scatter gather list (SGL) memory and associate it with an XRI.
3878ef270ab1SKenneth D. Merry */
3879ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_post_sgl_pages_s {
3880ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
3881ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
3882ef270ab1SKenneth D. Merry uint32_t xri_start:16,
3883ef270ab1SKenneth D. Merry xri_count:16;
3884ef270ab1SKenneth D. Merry struct {
3885ef270ab1SKenneth D. Merry uint32_t page0_low;
3886ef270ab1SKenneth D. Merry uint32_t page0_high;
3887ef270ab1SKenneth D. Merry uint32_t page1_low;
3888ef270ab1SKenneth D. Merry uint32_t page1_high;
3889ef270ab1SKenneth D. Merry } page_set[10];
3890ef270ab1SKenneth D. Merry #else
3891ef270ab1SKenneth D. Merry #error big endian version not defined
3892ef270ab1SKenneth D. Merry #endif
3893ef270ab1SKenneth D. Merry } sli4_req_fcoe_post_sgl_pages_t;
3894ef270ab1SKenneth D. Merry
3895ef270ab1SKenneth D. Merry /**
3896ef270ab1SKenneth D. Merry * @brief FCOE_RQ_CREATE
3897ef270ab1SKenneth D. Merry *
3898ef270ab1SKenneth D. Merry * Create a Receive Queue for FC/FCoE use.
3899ef270ab1SKenneth D. Merry */
3900ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_rq_create_s {
3901ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
3902ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
3903ef270ab1SKenneth D. Merry uint32_t num_pages:16,
3904ef270ab1SKenneth D. Merry dua:1,
3905ef270ab1SKenneth D. Merry bqu:1,
3906ef270ab1SKenneth D. Merry :6,
3907ef270ab1SKenneth D. Merry ulp:8;
3908ef270ab1SKenneth D. Merry uint32_t :16,
3909ef270ab1SKenneth D. Merry rqe_count:4,
3910ef270ab1SKenneth D. Merry :12;
3911ef270ab1SKenneth D. Merry uint32_t rsvd6;
3912ef270ab1SKenneth D. Merry uint32_t buffer_size:16,
3913ef270ab1SKenneth D. Merry cq_id:16;
3914ef270ab1SKenneth D. Merry uint32_t rsvd8;
3915ef270ab1SKenneth D. Merry sli4_physical_page_descriptor_t page_physical_address[8];
3916ef270ab1SKenneth D. Merry #else
3917ef270ab1SKenneth D. Merry #error big endian version not defined
3918ef270ab1SKenneth D. Merry #endif
3919ef270ab1SKenneth D. Merry } sli4_req_fcoe_rq_create_t;
3920ef270ab1SKenneth D. Merry
3921ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_CREATE_V0_MAX_PAGES 8
3922ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_CREATE_V0_MIN_BUF_SIZE 128
3923ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_CREATE_V0_MAX_BUF_SIZE 2048
3924ef270ab1SKenneth D. Merry
3925ef270ab1SKenneth D. Merry /**
3926ef270ab1SKenneth D. Merry * @brief FCOE_RQ_CREATE_V1
3927ef270ab1SKenneth D. Merry *
3928ef270ab1SKenneth D. Merry * Create a version 1 Receive Queue for FC/FCoE use.
3929ef270ab1SKenneth D. Merry */
3930ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_rq_create_v1_s {
3931ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
3932ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
3933ef270ab1SKenneth D. Merry uint32_t num_pages:16,
3934ef270ab1SKenneth D. Merry :13,
3935ef270ab1SKenneth D. Merry dim:1,
3936ef270ab1SKenneth D. Merry dfd:1,
3937ef270ab1SKenneth D. Merry dnb:1;
3938ef270ab1SKenneth D. Merry uint32_t page_size:8,
3939ef270ab1SKenneth D. Merry rqe_size:4,
3940ef270ab1SKenneth D. Merry :4,
3941ef270ab1SKenneth D. Merry rqe_count:16;
3942ef270ab1SKenneth D. Merry uint32_t rsvd6;
3943ef270ab1SKenneth D. Merry uint32_t :16,
3944ef270ab1SKenneth D. Merry cq_id:16;
3945ef270ab1SKenneth D. Merry uint32_t buffer_size;
3946ef270ab1SKenneth D. Merry sli4_physical_page_descriptor_t page_physical_address[8];
3947ef270ab1SKenneth D. Merry #else
3948ef270ab1SKenneth D. Merry #error big endian version not defined
3949ef270ab1SKenneth D. Merry #endif
3950ef270ab1SKenneth D. Merry } sli4_req_fcoe_rq_create_v1_t;
3951ef270ab1SKenneth D. Merry
3952ef270ab1SKenneth D. Merry /**
3953ef270ab1SKenneth D. Merry * @brief FCOE_RQ_CREATE_V2
3954ef270ab1SKenneth D. Merry *
3955ef270ab1SKenneth D. Merry * Create a version 2 Receive Queue for FC/FCoE use.
3956ef270ab1SKenneth D. Merry */
3957ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_rq_create_v2_s {
3958ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
3959ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
3960ef270ab1SKenneth D. Merry uint32_t num_pages:16,
3961ef270ab1SKenneth D. Merry rq_count:8,
3962ef270ab1SKenneth D. Merry :5,
3963ef270ab1SKenneth D. Merry dim:1,
3964ef270ab1SKenneth D. Merry dfd:1,
3965ef270ab1SKenneth D. Merry dnb:1;
3966ef270ab1SKenneth D. Merry uint32_t page_size:8,
3967ef270ab1SKenneth D. Merry rqe_size:4,
3968ef270ab1SKenneth D. Merry :4,
3969ef270ab1SKenneth D. Merry rqe_count:16;
3970ef270ab1SKenneth D. Merry uint32_t hdr_buffer_size:16,
3971ef270ab1SKenneth D. Merry payload_buffer_size:16;
3972ef270ab1SKenneth D. Merry uint32_t base_cq_id:16,
3973ef270ab1SKenneth D. Merry :16;
3974ef270ab1SKenneth D. Merry uint32_t rsvd;
3975ef270ab1SKenneth D. Merry sli4_physical_page_descriptor_t page_physical_address[0];
3976ef270ab1SKenneth D. Merry #else
3977ef270ab1SKenneth D. Merry #error big endian version not defined
3978ef270ab1SKenneth D. Merry #endif
3979ef270ab1SKenneth D. Merry } sli4_req_fcoe_rq_create_v2_t;
3980ef270ab1SKenneth D. Merry
3981ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_CREATE_V1_MAX_PAGES 8
3982ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_CREATE_V1_MIN_BUF_SIZE 64
3983ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_CREATE_V1_MAX_BUF_SIZE 2048
3984ef270ab1SKenneth D. Merry
3985ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQE_SIZE_8 0x2
3986ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQE_SIZE_16 0x3
3987ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQE_SIZE_32 0x4
3988ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQE_SIZE_64 0x5
3989ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQE_SIZE_128 0x6
3990ef270ab1SKenneth D. Merry
3991ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_PAGE_SIZE_4096 0x1
3992ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_PAGE_SIZE_8192 0x2
3993ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_PAGE_SIZE_16384 0x4
3994ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_PAGE_SIZE_32768 0x8
3995ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQ_PAGE_SIZE_64536 0x10
3996ef270ab1SKenneth D. Merry
3997ef270ab1SKenneth D. Merry #define SLI4_FCOE_RQE_SIZE 8
3998ef270ab1SKenneth D. Merry
3999ef270ab1SKenneth D. Merry /**
4000ef270ab1SKenneth D. Merry * @brief FCOE_RQ_DESTROY
4001ef270ab1SKenneth D. Merry *
4002ef270ab1SKenneth D. Merry * Destroy an FC/FCoE Receive Queue.
4003ef270ab1SKenneth D. Merry */
4004ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_rq_destroy_s {
4005ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
4006ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4007ef270ab1SKenneth D. Merry uint32_t rq_id:16,
4008ef270ab1SKenneth D. Merry :16;
4009ef270ab1SKenneth D. Merry #else
4010ef270ab1SKenneth D. Merry #error big endian version not defined
4011ef270ab1SKenneth D. Merry #endif
4012ef270ab1SKenneth D. Merry } sli4_req_fcoe_rq_destroy_t;
4013ef270ab1SKenneth D. Merry
4014ef270ab1SKenneth D. Merry /**
4015ef270ab1SKenneth D. Merry * @brief FCOE_READ_FCF_TABLE
4016ef270ab1SKenneth D. Merry *
4017ef270ab1SKenneth D. Merry * Retrieve a FCF database (also known as a table) entry created by the SLI Port
4018ef270ab1SKenneth D. Merry * during FIP discovery.
4019ef270ab1SKenneth D. Merry */
4020ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_read_fcf_table_s {
4021ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
4022ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4023ef270ab1SKenneth D. Merry uint32_t fcf_index:16,
4024ef270ab1SKenneth D. Merry :16;
4025ef270ab1SKenneth D. Merry #else
4026ef270ab1SKenneth D. Merry #error big endian version not defined
4027ef270ab1SKenneth D. Merry #endif
4028ef270ab1SKenneth D. Merry } sli4_req_fcoe_read_fcf_table_t;
4029ef270ab1SKenneth D. Merry
4030ef270ab1SKenneth D. Merry /* A FCF index of -1 on the request means return the first valid entry */
4031ef270ab1SKenneth D. Merry #define SLI4_FCOE_FCF_TABLE_FIRST (UINT16_MAX)
4032ef270ab1SKenneth D. Merry
4033ef270ab1SKenneth D. Merry /**
4034ef270ab1SKenneth D. Merry * @brief FCF table entry
4035ef270ab1SKenneth D. Merry *
4036ef270ab1SKenneth D. Merry * This is the information returned by the FCOE_READ_FCF_TABLE command.
4037ef270ab1SKenneth D. Merry */
4038ef270ab1SKenneth D. Merry typedef struct sli4_fcf_entry_s {
4039ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4040ef270ab1SKenneth D. Merry uint32_t max_receive_size;
4041ef270ab1SKenneth D. Merry uint32_t fip_keep_alive;
4042ef270ab1SKenneth D. Merry uint32_t fip_priority;
4043ef270ab1SKenneth D. Merry uint8_t fcf_mac_address[6];
4044ef270ab1SKenneth D. Merry uint8_t fcf_available;
4045ef270ab1SKenneth D. Merry uint8_t mac_address_provider;
4046ef270ab1SKenneth D. Merry uint8_t fabric_name_id[8];
4047ef270ab1SKenneth D. Merry uint8_t fc_map[3];
4048ef270ab1SKenneth D. Merry uint8_t val:1,
4049ef270ab1SKenneth D. Merry fc:1,
4050ef270ab1SKenneth D. Merry :5,
4051ef270ab1SKenneth D. Merry sol:1;
4052ef270ab1SKenneth D. Merry uint32_t fcf_index:16,
4053ef270ab1SKenneth D. Merry fcf_state:16;
4054ef270ab1SKenneth D. Merry uint8_t vlan_bitmap[512];
4055ef270ab1SKenneth D. Merry uint8_t switch_name[8];
4056ef270ab1SKenneth D. Merry #else
4057ef270ab1SKenneth D. Merry #error big endian version not defined
4058ef270ab1SKenneth D. Merry #endif
4059ef270ab1SKenneth D. Merry } sli4_fcf_entry_t;
4060ef270ab1SKenneth D. Merry
4061ef270ab1SKenneth D. Merry /**
4062ef270ab1SKenneth D. Merry * @brief FCOE_READ_FCF_TABLE response.
4063ef270ab1SKenneth D. Merry */
4064ef270ab1SKenneth D. Merry typedef struct sli4_res_fcoe_read_fcf_table_s {
4065ef270ab1SKenneth D. Merry sli4_res_hdr_t hdr;
4066ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4067ef270ab1SKenneth D. Merry uint32_t event_tag;
4068ef270ab1SKenneth D. Merry uint32_t next_index:16,
4069ef270ab1SKenneth D. Merry :16;
4070ef270ab1SKenneth D. Merry sli4_fcf_entry_t fcf_entry;
4071ef270ab1SKenneth D. Merry #else
4072ef270ab1SKenneth D. Merry #error big endian version not defined
4073ef270ab1SKenneth D. Merry #endif
4074ef270ab1SKenneth D. Merry } sli4_res_fcoe_read_fcf_table_t;
4075ef270ab1SKenneth D. Merry
4076ef270ab1SKenneth D. Merry /* A next FCF index of -1 in the response means this is the last valid entry */
4077ef270ab1SKenneth D. Merry #define SLI4_FCOE_FCF_TABLE_LAST (UINT16_MAX)
4078ef270ab1SKenneth D. Merry
4079ef270ab1SKenneth D. Merry /**
4080ef270ab1SKenneth D. Merry * @brief FCOE_POST_HDR_TEMPLATES
4081ef270ab1SKenneth D. Merry */
4082ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_post_hdr_templates_s {
4083ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
4084ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4085ef270ab1SKenneth D. Merry uint32_t rpi_offset:16,
4086ef270ab1SKenneth D. Merry page_count:16;
4087ef270ab1SKenneth D. Merry sli4_physical_page_descriptor_t page_descriptor[0];
4088ef270ab1SKenneth D. Merry #else
4089ef270ab1SKenneth D. Merry #error big endian version not defined
4090ef270ab1SKenneth D. Merry #endif
4091ef270ab1SKenneth D. Merry } sli4_req_fcoe_post_hdr_templates_t;
4092ef270ab1SKenneth D. Merry
4093ef270ab1SKenneth D. Merry #define SLI4_FCOE_HDR_TEMPLATE_SIZE 64
4094ef270ab1SKenneth D. Merry
4095ef270ab1SKenneth D. Merry /**
4096ef270ab1SKenneth D. Merry * @brief FCOE_REDISCOVER_FCF
4097ef270ab1SKenneth D. Merry */
4098ef270ab1SKenneth D. Merry typedef struct sli4_req_fcoe_rediscover_fcf_s {
4099ef270ab1SKenneth D. Merry sli4_req_hdr_t hdr;
4100ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4101ef270ab1SKenneth D. Merry uint32_t fcf_count:16,
4102ef270ab1SKenneth D. Merry :16;
4103ef270ab1SKenneth D. Merry uint32_t rsvd5;
4104ef270ab1SKenneth D. Merry uint16_t fcf_index[16];
4105ef270ab1SKenneth D. Merry #else
4106ef270ab1SKenneth D. Merry #error big endian version not defined
4107ef270ab1SKenneth D. Merry #endif
4108ef270ab1SKenneth D. Merry } sli4_req_fcoe_rediscover_fcf_t;
4109ef270ab1SKenneth D. Merry
4110ef270ab1SKenneth D. Merry /**
4111ef270ab1SKenneth D. Merry * Work Queue Entry (WQE) types.
4112ef270ab1SKenneth D. Merry */
4113ef270ab1SKenneth D. Merry #define SLI4_WQE_ABORT 0x0f
4114ef270ab1SKenneth D. Merry #define SLI4_WQE_ELS_REQUEST64 0x8a
4115ef270ab1SKenneth D. Merry #define SLI4_WQE_FCP_IBIDIR64 0xac
4116ef270ab1SKenneth D. Merry #define SLI4_WQE_FCP_IREAD64 0x9a
4117ef270ab1SKenneth D. Merry #define SLI4_WQE_FCP_IWRITE64 0x98
4118ef270ab1SKenneth D. Merry #define SLI4_WQE_FCP_ICMND64 0x9c
4119ef270ab1SKenneth D. Merry #define SLI4_WQE_FCP_TRECEIVE64 0xa1
4120ef270ab1SKenneth D. Merry #define SLI4_WQE_FCP_CONT_TRECEIVE64 0xe5
4121ef270ab1SKenneth D. Merry #define SLI4_WQE_FCP_TRSP64 0xa3
4122ef270ab1SKenneth D. Merry #define SLI4_WQE_FCP_TSEND64 0x9f
4123ef270ab1SKenneth D. Merry #define SLI4_WQE_GEN_REQUEST64 0xc2
4124ef270ab1SKenneth D. Merry #define SLI4_WQE_SEND_FRAME 0xe1
4125ef270ab1SKenneth D. Merry #define SLI4_WQE_XMIT_BCAST64 0X84
4126ef270ab1SKenneth D. Merry #define SLI4_WQE_XMIT_BLS_RSP 0x97
4127ef270ab1SKenneth D. Merry #define SLI4_WQE_ELS_RSP64 0x95
4128ef270ab1SKenneth D. Merry #define SLI4_WQE_XMIT_SEQUENCE64 0x82
4129ef270ab1SKenneth D. Merry #define SLI4_WQE_REQUEUE_XRI 0x93
4130ef270ab1SKenneth D. Merry
4131ef270ab1SKenneth D. Merry /**
4132ef270ab1SKenneth D. Merry * WQE command types.
4133ef270ab1SKenneth D. Merry */
4134ef270ab1SKenneth D. Merry #define SLI4_CMD_FCP_IREAD64_WQE 0x00
4135ef270ab1SKenneth D. Merry #define SLI4_CMD_FCP_ICMND64_WQE 0x00
4136ef270ab1SKenneth D. Merry #define SLI4_CMD_FCP_IWRITE64_WQE 0x01
4137ef270ab1SKenneth D. Merry #define SLI4_CMD_FCP_TRECEIVE64_WQE 0x02
4138ef270ab1SKenneth D. Merry #define SLI4_CMD_FCP_TRSP64_WQE 0x03
4139ef270ab1SKenneth D. Merry #define SLI4_CMD_FCP_TSEND64_WQE 0x07
4140ef270ab1SKenneth D. Merry #define SLI4_CMD_GEN_REQUEST64_WQE 0x08
4141ef270ab1SKenneth D. Merry #define SLI4_CMD_XMIT_BCAST64_WQE 0x08
4142ef270ab1SKenneth D. Merry #define SLI4_CMD_XMIT_BLS_RSP64_WQE 0x08
4143ef270ab1SKenneth D. Merry #define SLI4_CMD_ABORT_WQE 0x08
4144ef270ab1SKenneth D. Merry #define SLI4_CMD_XMIT_SEQUENCE64_WQE 0x08
4145ef270ab1SKenneth D. Merry #define SLI4_CMD_REQUEUE_XRI_WQE 0x0A
4146ef270ab1SKenneth D. Merry #define SLI4_CMD_SEND_FRAME_WQE 0x0a
4147ef270ab1SKenneth D. Merry
4148ef270ab1SKenneth D. Merry #define SLI4_WQE_SIZE 0x05
4149ef270ab1SKenneth D. Merry #define SLI4_WQE_EXT_SIZE 0x06
4150ef270ab1SKenneth D. Merry
4151ef270ab1SKenneth D. Merry #define SLI4_WQE_BYTES (16 * sizeof(uint32_t))
4152ef270ab1SKenneth D. Merry #define SLI4_WQE_EXT_BYTES (32 * sizeof(uint32_t))
4153ef270ab1SKenneth D. Merry
4154ef270ab1SKenneth D. Merry /* Mask for ccp (CS_CTL) */
4155ef270ab1SKenneth D. Merry #define SLI4_MASK_CCP 0xfe /* Upper 7 bits of CS_CTL is priority */
4156ef270ab1SKenneth D. Merry
4157ef270ab1SKenneth D. Merry /**
4158ef270ab1SKenneth D. Merry * @brief Generic WQE
4159ef270ab1SKenneth D. Merry */
4160ef270ab1SKenneth D. Merry typedef struct sli4_generic_wqe_s {
4161ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4162ef270ab1SKenneth D. Merry uint32_t cmd_spec0_5[6];
4163ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4164ef270ab1SKenneth D. Merry context_tag:16;
4165ef270ab1SKenneth D. Merry uint32_t :2,
4166ef270ab1SKenneth D. Merry ct:2,
4167ef270ab1SKenneth D. Merry :4,
4168ef270ab1SKenneth D. Merry command:8,
4169ef270ab1SKenneth D. Merry class:3,
4170ef270ab1SKenneth D. Merry :1,
4171ef270ab1SKenneth D. Merry pu:2,
4172ef270ab1SKenneth D. Merry :2,
4173ef270ab1SKenneth D. Merry timer:8;
4174ef270ab1SKenneth D. Merry uint32_t abort_tag;
4175ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4176ef270ab1SKenneth D. Merry :16;
4177ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4178ef270ab1SKenneth D. Merry :3,
4179ef270ab1SKenneth D. Merry len_loc:2,
4180ef270ab1SKenneth D. Merry qosd:1,
4181ef270ab1SKenneth D. Merry :1,
4182ef270ab1SKenneth D. Merry xbl:1,
4183ef270ab1SKenneth D. Merry hlm:1,
4184ef270ab1SKenneth D. Merry iod:1,
4185ef270ab1SKenneth D. Merry dbde:1,
4186ef270ab1SKenneth D. Merry wqes:1,
4187ef270ab1SKenneth D. Merry pri:3,
4188ef270ab1SKenneth D. Merry pv:1,
4189ef270ab1SKenneth D. Merry eat:1,
4190ef270ab1SKenneth D. Merry xc:1,
4191ef270ab1SKenneth D. Merry :1,
4192ef270ab1SKenneth D. Merry ccpe:1,
4193ef270ab1SKenneth D. Merry ccp:8;
4194ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4195ef270ab1SKenneth D. Merry :3,
4196ef270ab1SKenneth D. Merry wqec:1,
4197ef270ab1SKenneth D. Merry :8,
4198ef270ab1SKenneth D. Merry cq_id:16;
4199ef270ab1SKenneth D. Merry #else
4200ef270ab1SKenneth D. Merry #error big endian version not defined
4201ef270ab1SKenneth D. Merry #endif
4202ef270ab1SKenneth D. Merry } sli4_generic_wqe_t;
4203ef270ab1SKenneth D. Merry
4204ef270ab1SKenneth D. Merry /**
4205ef270ab1SKenneth D. Merry * @brief WQE used to abort exchanges.
4206ef270ab1SKenneth D. Merry */
4207ef270ab1SKenneth D. Merry typedef struct sli4_abort_wqe_s {
4208ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4209ef270ab1SKenneth D. Merry uint32_t rsvd0;
4210ef270ab1SKenneth D. Merry uint32_t rsvd1;
4211ef270ab1SKenneth D. Merry uint32_t ext_t_tag;
4212ef270ab1SKenneth D. Merry uint32_t ia:1,
4213ef270ab1SKenneth D. Merry ir:1,
4214ef270ab1SKenneth D. Merry :6,
4215ef270ab1SKenneth D. Merry criteria:8,
4216ef270ab1SKenneth D. Merry :16;
4217ef270ab1SKenneth D. Merry uint32_t ext_t_mask;
4218ef270ab1SKenneth D. Merry uint32_t t_mask;
4219ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4220ef270ab1SKenneth D. Merry context_tag:16;
4221ef270ab1SKenneth D. Merry uint32_t :2,
4222ef270ab1SKenneth D. Merry ct:2,
4223ef270ab1SKenneth D. Merry :4,
4224ef270ab1SKenneth D. Merry command:8,
4225ef270ab1SKenneth D. Merry class:3,
4226ef270ab1SKenneth D. Merry :1,
4227ef270ab1SKenneth D. Merry pu:2,
4228ef270ab1SKenneth D. Merry :2,
4229ef270ab1SKenneth D. Merry timer:8;
4230ef270ab1SKenneth D. Merry uint32_t t_tag;
4231ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4232ef270ab1SKenneth D. Merry :16;
4233ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4234ef270ab1SKenneth D. Merry :3,
4235ef270ab1SKenneth D. Merry len_loc:2,
4236ef270ab1SKenneth D. Merry qosd:1,
4237ef270ab1SKenneth D. Merry :1,
4238ef270ab1SKenneth D. Merry xbl:1,
4239ef270ab1SKenneth D. Merry :1,
4240ef270ab1SKenneth D. Merry iod:1,
4241ef270ab1SKenneth D. Merry dbde:1,
4242ef270ab1SKenneth D. Merry wqes:1,
4243ef270ab1SKenneth D. Merry pri:3,
4244ef270ab1SKenneth D. Merry pv:1,
4245ef270ab1SKenneth D. Merry eat:1,
4246ef270ab1SKenneth D. Merry xc:1,
4247ef270ab1SKenneth D. Merry :1,
4248ef270ab1SKenneth D. Merry ccpe:1,
4249ef270ab1SKenneth D. Merry ccp:8;
4250ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4251ef270ab1SKenneth D. Merry :3,
4252ef270ab1SKenneth D. Merry wqec:1,
4253ef270ab1SKenneth D. Merry :8,
4254ef270ab1SKenneth D. Merry cq_id:16;
4255ef270ab1SKenneth D. Merry #else
4256ef270ab1SKenneth D. Merry #error big endian version not defined
4257ef270ab1SKenneth D. Merry #endif
4258ef270ab1SKenneth D. Merry } sli4_abort_wqe_t;
4259ef270ab1SKenneth D. Merry
4260ef270ab1SKenneth D. Merry #define SLI4_ABORT_CRITERIA_XRI_TAG 0x01
4261ef270ab1SKenneth D. Merry #define SLI4_ABORT_CRITERIA_ABORT_TAG 0x02
4262ef270ab1SKenneth D. Merry #define SLI4_ABORT_CRITERIA_REQUEST_TAG 0x03
4263ef270ab1SKenneth D. Merry #define SLI4_ABORT_CRITERIA_EXT_ABORT_TAG 0x04
4264ef270ab1SKenneth D. Merry
4265ef270ab1SKenneth D. Merry typedef enum {
4266ef270ab1SKenneth D. Merry SLI_ABORT_XRI,
4267ef270ab1SKenneth D. Merry SLI_ABORT_ABORT_ID,
4268ef270ab1SKenneth D. Merry SLI_ABORT_REQUEST_ID,
4269ef270ab1SKenneth D. Merry SLI_ABORT_MAX, /* must be last */
4270ef270ab1SKenneth D. Merry } sli4_abort_type_e;
4271ef270ab1SKenneth D. Merry
4272ef270ab1SKenneth D. Merry /**
4273ef270ab1SKenneth D. Merry * @brief WQE used to create an ELS request.
4274ef270ab1SKenneth D. Merry */
4275ef270ab1SKenneth D. Merry typedef struct sli4_els_request64_wqe_s {
4276ef270ab1SKenneth D. Merry sli4_bde_t els_request_payload;
4277ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4278ef270ab1SKenneth D. Merry uint32_t els_request_payload_length;
4279ef270ab1SKenneth D. Merry uint32_t sid:24,
4280ef270ab1SKenneth D. Merry sp:1,
4281ef270ab1SKenneth D. Merry :7;
4282ef270ab1SKenneth D. Merry uint32_t remote_id:24,
4283ef270ab1SKenneth D. Merry :8;
4284ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4285ef270ab1SKenneth D. Merry context_tag:16;
4286ef270ab1SKenneth D. Merry uint32_t :2,
4287ef270ab1SKenneth D. Merry ct:2,
4288ef270ab1SKenneth D. Merry :4,
4289ef270ab1SKenneth D. Merry command:8,
4290ef270ab1SKenneth D. Merry class:3,
4291ef270ab1SKenneth D. Merry ar:1,
4292ef270ab1SKenneth D. Merry pu:2,
4293ef270ab1SKenneth D. Merry :2,
4294ef270ab1SKenneth D. Merry timer:8;
4295ef270ab1SKenneth D. Merry uint32_t abort_tag;
4296ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4297ef270ab1SKenneth D. Merry temporary_rpi:16;
4298ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4299ef270ab1SKenneth D. Merry :3,
4300ef270ab1SKenneth D. Merry len_loc:2,
4301ef270ab1SKenneth D. Merry qosd:1,
4302ef270ab1SKenneth D. Merry :1,
4303ef270ab1SKenneth D. Merry xbl:1,
4304ef270ab1SKenneth D. Merry hlm:1,
4305ef270ab1SKenneth D. Merry iod:1,
4306ef270ab1SKenneth D. Merry dbde:1,
4307ef270ab1SKenneth D. Merry wqes:1,
4308ef270ab1SKenneth D. Merry pri:3,
4309ef270ab1SKenneth D. Merry pv:1,
4310ef270ab1SKenneth D. Merry eat:1,
4311ef270ab1SKenneth D. Merry xc:1,
4312ef270ab1SKenneth D. Merry :1,
4313ef270ab1SKenneth D. Merry ccpe:1,
4314ef270ab1SKenneth D. Merry ccp:8;
4315ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4316ef270ab1SKenneth D. Merry els_id:3,
4317ef270ab1SKenneth D. Merry wqec:1,
4318ef270ab1SKenneth D. Merry :8,
4319ef270ab1SKenneth D. Merry cq_id:16;
4320ef270ab1SKenneth D. Merry sli4_bde_t els_response_payload_bde;
4321ef270ab1SKenneth D. Merry uint32_t max_response_payload_length;
4322ef270ab1SKenneth D. Merry #else
4323ef270ab1SKenneth D. Merry #error big endian version not defined
4324ef270ab1SKenneth D. Merry #endif
4325ef270ab1SKenneth D. Merry } sli4_els_request64_wqe_t;
4326ef270ab1SKenneth D. Merry
4327ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_CONTEXT_RPI 0x0
4328ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_CONTEXT_VPI 0x1
4329ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_CONTEXT_VFI 0x2
4330ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_CONTEXT_FCFI 0x3
4331ef270ab1SKenneth D. Merry
4332ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_CLASS_2 0x1
4333ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_CLASS_3 0x2
4334ef270ab1SKenneth D. Merry
4335ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_DIR_WRITE 0x0
4336ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_DIR_READ 0x1
4337ef270ab1SKenneth D. Merry
4338ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_OTHER 0x0
4339ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_LOGO 0x1
4340ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_FDISC 0x2
4341ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_FLOGIN 0x3
4342ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_PLOGI 0x4
4343ef270ab1SKenneth D. Merry
4344ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_CMD_GEN 0x08
4345ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_CMD_NON_FABRIC 0x0c
4346ef270ab1SKenneth D. Merry #define SLI4_ELS_REQUEST64_CMD_FABRIC 0x0d
4347ef270ab1SKenneth D. Merry
4348ef270ab1SKenneth D. Merry /**
4349ef270ab1SKenneth D. Merry * @brief WQE used to create an FCP initiator no data command.
4350ef270ab1SKenneth D. Merry */
4351ef270ab1SKenneth D. Merry typedef struct sli4_fcp_icmnd64_wqe_s {
4352ef270ab1SKenneth D. Merry sli4_bde_t bde;
4353ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4354ef270ab1SKenneth D. Merry uint32_t payload_offset_length:16,
4355ef270ab1SKenneth D. Merry fcp_cmd_buffer_length:16;
4356ef270ab1SKenneth D. Merry uint32_t rsvd4;
4357ef270ab1SKenneth D. Merry uint32_t remote_n_port_id:24,
4358ef270ab1SKenneth D. Merry :8;
4359ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4360ef270ab1SKenneth D. Merry context_tag:16;
4361ef270ab1SKenneth D. Merry uint32_t dif:2,
4362ef270ab1SKenneth D. Merry ct:2,
4363ef270ab1SKenneth D. Merry bs:3,
4364ef270ab1SKenneth D. Merry :1,
4365ef270ab1SKenneth D. Merry command:8,
4366ef270ab1SKenneth D. Merry class:3,
4367ef270ab1SKenneth D. Merry :1,
4368ef270ab1SKenneth D. Merry pu:2,
4369ef270ab1SKenneth D. Merry erp:1,
4370ef270ab1SKenneth D. Merry lnk:1,
4371ef270ab1SKenneth D. Merry timer:8;
4372ef270ab1SKenneth D. Merry uint32_t abort_tag;
4373ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4374ef270ab1SKenneth D. Merry :16;
4375ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4376ef270ab1SKenneth D. Merry :3,
4377ef270ab1SKenneth D. Merry len_loc:2,
4378ef270ab1SKenneth D. Merry qosd:1,
4379ef270ab1SKenneth D. Merry :1,
4380ef270ab1SKenneth D. Merry xbl:1,
4381ef270ab1SKenneth D. Merry hlm:1,
4382ef270ab1SKenneth D. Merry iod:1,
4383ef270ab1SKenneth D. Merry dbde:1,
4384ef270ab1SKenneth D. Merry wqes:1,
4385ef270ab1SKenneth D. Merry pri:3,
4386ef270ab1SKenneth D. Merry pv:1,
4387ef270ab1SKenneth D. Merry eat:1,
4388ef270ab1SKenneth D. Merry xc:1,
4389ef270ab1SKenneth D. Merry :1,
4390ef270ab1SKenneth D. Merry ccpe:1,
4391ef270ab1SKenneth D. Merry ccp:8;
4392ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4393ef270ab1SKenneth D. Merry :3,
4394ef270ab1SKenneth D. Merry wqec:1,
4395ef270ab1SKenneth D. Merry :8,
4396ef270ab1SKenneth D. Merry cq_id:16;
4397ef270ab1SKenneth D. Merry uint32_t rsvd12;
4398ef270ab1SKenneth D. Merry uint32_t rsvd13;
4399ef270ab1SKenneth D. Merry uint32_t rsvd14;
4400ef270ab1SKenneth D. Merry uint32_t rsvd15;
4401ef270ab1SKenneth D. Merry #else
4402ef270ab1SKenneth D. Merry #error big endian version not defined
4403ef270ab1SKenneth D. Merry #endif
4404ef270ab1SKenneth D. Merry } sli4_fcp_icmnd64_wqe_t;
4405ef270ab1SKenneth D. Merry
4406ef270ab1SKenneth D. Merry /**
4407ef270ab1SKenneth D. Merry * @brief WQE used to create an FCP initiator read.
4408ef270ab1SKenneth D. Merry */
4409ef270ab1SKenneth D. Merry typedef struct sli4_fcp_iread64_wqe_s {
4410ef270ab1SKenneth D. Merry sli4_bde_t bde;
4411ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4412ef270ab1SKenneth D. Merry uint32_t payload_offset_length:16,
4413ef270ab1SKenneth D. Merry fcp_cmd_buffer_length:16;
4414ef270ab1SKenneth D. Merry uint32_t total_transfer_length;
4415ef270ab1SKenneth D. Merry uint32_t remote_n_port_id:24,
4416ef270ab1SKenneth D. Merry :8;
4417ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4418ef270ab1SKenneth D. Merry context_tag:16;
4419ef270ab1SKenneth D. Merry uint32_t dif:2,
4420ef270ab1SKenneth D. Merry ct:2,
4421ef270ab1SKenneth D. Merry bs:3,
4422ef270ab1SKenneth D. Merry :1,
4423ef270ab1SKenneth D. Merry command:8,
4424ef270ab1SKenneth D. Merry class:3,
4425ef270ab1SKenneth D. Merry :1,
4426ef270ab1SKenneth D. Merry pu:2,
4427ef270ab1SKenneth D. Merry erp:1,
4428ef270ab1SKenneth D. Merry lnk:1,
4429ef270ab1SKenneth D. Merry timer:8;
4430ef270ab1SKenneth D. Merry uint32_t abort_tag;
4431ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4432ef270ab1SKenneth D. Merry :16;
4433ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4434ef270ab1SKenneth D. Merry :3,
4435ef270ab1SKenneth D. Merry len_loc:2,
4436ef270ab1SKenneth D. Merry qosd:1,
4437ef270ab1SKenneth D. Merry :1,
4438ef270ab1SKenneth D. Merry xbl:1,
4439ef270ab1SKenneth D. Merry hlm:1,
4440ef270ab1SKenneth D. Merry iod:1,
4441ef270ab1SKenneth D. Merry dbde:1,
4442ef270ab1SKenneth D. Merry wqes:1,
4443ef270ab1SKenneth D. Merry pri:3,
4444ef270ab1SKenneth D. Merry pv:1,
4445ef270ab1SKenneth D. Merry eat:1,
4446ef270ab1SKenneth D. Merry xc:1,
4447ef270ab1SKenneth D. Merry :1,
4448ef270ab1SKenneth D. Merry ccpe:1,
4449ef270ab1SKenneth D. Merry ccp:8;
4450ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4451ef270ab1SKenneth D. Merry :3,
4452ef270ab1SKenneth D. Merry wqec:1,
4453ef270ab1SKenneth D. Merry :8,
4454ef270ab1SKenneth D. Merry cq_id:16;
4455ef270ab1SKenneth D. Merry uint32_t rsvd12;
4456ef270ab1SKenneth D. Merry #else
4457ef270ab1SKenneth D. Merry #error big endian version not defined
4458ef270ab1SKenneth D. Merry #endif
4459ef270ab1SKenneth D. Merry sli4_bde_t first_data_bde; /* reserved if performance hints disabled */
4460ef270ab1SKenneth D. Merry } sli4_fcp_iread64_wqe_t;
4461ef270ab1SKenneth D. Merry
4462ef270ab1SKenneth D. Merry /**
4463ef270ab1SKenneth D. Merry * @brief WQE used to create an FCP initiator write.
4464ef270ab1SKenneth D. Merry */
4465ef270ab1SKenneth D. Merry typedef struct sli4_fcp_iwrite64_wqe_s {
4466ef270ab1SKenneth D. Merry sli4_bde_t bde;
4467ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4468ef270ab1SKenneth D. Merry uint32_t payload_offset_length:16,
4469ef270ab1SKenneth D. Merry fcp_cmd_buffer_length:16;
4470ef270ab1SKenneth D. Merry uint32_t total_transfer_length;
4471ef270ab1SKenneth D. Merry uint32_t initial_transfer_length;
4472ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4473ef270ab1SKenneth D. Merry context_tag:16;
4474ef270ab1SKenneth D. Merry uint32_t dif:2,
4475ef270ab1SKenneth D. Merry ct:2,
4476ef270ab1SKenneth D. Merry bs:3,
4477ef270ab1SKenneth D. Merry :1,
4478ef270ab1SKenneth D. Merry command:8,
4479ef270ab1SKenneth D. Merry class:3,
4480ef270ab1SKenneth D. Merry :1,
4481ef270ab1SKenneth D. Merry pu:2,
4482ef270ab1SKenneth D. Merry erp:1,
4483ef270ab1SKenneth D. Merry lnk:1,
4484ef270ab1SKenneth D. Merry timer:8;
4485ef270ab1SKenneth D. Merry uint32_t abort_tag;
4486ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4487ef270ab1SKenneth D. Merry :16;
4488ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4489ef270ab1SKenneth D. Merry :3,
4490ef270ab1SKenneth D. Merry len_loc:2,
4491ef270ab1SKenneth D. Merry qosd:1,
4492ef270ab1SKenneth D. Merry :1,
4493ef270ab1SKenneth D. Merry xbl:1,
4494ef270ab1SKenneth D. Merry hlm:1,
4495ef270ab1SKenneth D. Merry iod:1,
4496ef270ab1SKenneth D. Merry dbde:1,
4497ef270ab1SKenneth D. Merry wqes:1,
4498ef270ab1SKenneth D. Merry pri:3,
4499ef270ab1SKenneth D. Merry pv:1,
4500ef270ab1SKenneth D. Merry eat:1,
4501ef270ab1SKenneth D. Merry xc:1,
4502ef270ab1SKenneth D. Merry :1,
4503ef270ab1SKenneth D. Merry ccpe:1,
4504ef270ab1SKenneth D. Merry ccp:8;
4505ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4506ef270ab1SKenneth D. Merry :3,
4507ef270ab1SKenneth D. Merry wqec:1,
4508ef270ab1SKenneth D. Merry :8,
4509ef270ab1SKenneth D. Merry cq_id:16;
4510ef270ab1SKenneth D. Merry uint32_t remote_n_port_id:24,
4511ef270ab1SKenneth D. Merry :8;
4512ef270ab1SKenneth D. Merry #else
4513ef270ab1SKenneth D. Merry #error big endian version not defined
4514ef270ab1SKenneth D. Merry #endif
4515ef270ab1SKenneth D. Merry sli4_bde_t first_data_bde;
4516ef270ab1SKenneth D. Merry } sli4_fcp_iwrite64_wqe_t;
4517ef270ab1SKenneth D. Merry
4518ef270ab1SKenneth D. Merry typedef struct sli4_fcp_128byte_wqe_s {
4519ef270ab1SKenneth D. Merry uint32_t dw[32];
4520ef270ab1SKenneth D. Merry } sli4_fcp_128byte_wqe_t;
4521ef270ab1SKenneth D. Merry
4522ef270ab1SKenneth D. Merry /**
4523ef270ab1SKenneth D. Merry * @brief WQE used to create an FCP target receive, and FCP target
4524ef270ab1SKenneth D. Merry * receive continue.
4525ef270ab1SKenneth D. Merry */
4526ef270ab1SKenneth D. Merry typedef struct sli4_fcp_treceive64_wqe_s {
4527ef270ab1SKenneth D. Merry sli4_bde_t bde;
4528ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4529ef270ab1SKenneth D. Merry uint32_t payload_offset_length;
4530ef270ab1SKenneth D. Merry uint32_t relative_offset;
4531ef270ab1SKenneth D. Merry /**
4532ef270ab1SKenneth D. Merry * DWord 5 can either be the task retry identifier (HLM=0) or
4533ef270ab1SKenneth D. Merry * the remote N_Port ID (HLM=1), or if implementing the Skyhawk
4534ef270ab1SKenneth D. Merry * T10-PI workaround, the secondary xri tag
4535ef270ab1SKenneth D. Merry */
4536ef270ab1SKenneth D. Merry union {
4537ef270ab1SKenneth D. Merry uint32_t sec_xri_tag:16,
4538ef270ab1SKenneth D. Merry :16;
4539ef270ab1SKenneth D. Merry uint32_t dword;
4540ef270ab1SKenneth D. Merry } dword5;
4541ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4542ef270ab1SKenneth D. Merry context_tag:16;
4543ef270ab1SKenneth D. Merry uint32_t dif:2,
4544ef270ab1SKenneth D. Merry ct:2,
4545ef270ab1SKenneth D. Merry bs:3,
4546ef270ab1SKenneth D. Merry :1,
4547ef270ab1SKenneth D. Merry command:8,
4548ef270ab1SKenneth D. Merry class:3,
4549ef270ab1SKenneth D. Merry ar:1,
4550ef270ab1SKenneth D. Merry pu:2,
4551ef270ab1SKenneth D. Merry conf:1,
4552ef270ab1SKenneth D. Merry lnk:1,
4553ef270ab1SKenneth D. Merry timer:8;
4554ef270ab1SKenneth D. Merry uint32_t abort_tag;
4555ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4556ef270ab1SKenneth D. Merry remote_xid:16;
4557ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4558ef270ab1SKenneth D. Merry :1,
4559ef270ab1SKenneth D. Merry app_id_valid:1,
4560ef270ab1SKenneth D. Merry :1,
4561ef270ab1SKenneth D. Merry len_loc:2,
4562ef270ab1SKenneth D. Merry qosd:1,
4563ef270ab1SKenneth D. Merry wchn:1,
4564ef270ab1SKenneth D. Merry xbl:1,
4565ef270ab1SKenneth D. Merry hlm:1,
4566ef270ab1SKenneth D. Merry iod:1,
4567ef270ab1SKenneth D. Merry dbde:1,
4568ef270ab1SKenneth D. Merry wqes:1,
4569ef270ab1SKenneth D. Merry pri:3,
4570ef270ab1SKenneth D. Merry pv:1,
4571ef270ab1SKenneth D. Merry eat:1,
4572ef270ab1SKenneth D. Merry xc:1,
4573ef270ab1SKenneth D. Merry sr:1,
4574ef270ab1SKenneth D. Merry ccpe:1,
4575ef270ab1SKenneth D. Merry ccp:8;
4576ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4577ef270ab1SKenneth D. Merry :3,
4578ef270ab1SKenneth D. Merry wqec:1,
4579ef270ab1SKenneth D. Merry :8,
4580ef270ab1SKenneth D. Merry cq_id:16;
4581ef270ab1SKenneth D. Merry uint32_t fcp_data_receive_length;
4582ef270ab1SKenneth D. Merry
4583ef270ab1SKenneth D. Merry #else
4584ef270ab1SKenneth D. Merry #error big endian version not defined
4585ef270ab1SKenneth D. Merry #endif
4586ef270ab1SKenneth D. Merry sli4_bde_t first_data_bde; /* For performance hints */
4587ef270ab1SKenneth D. Merry
4588ef270ab1SKenneth D. Merry } sli4_fcp_treceive64_wqe_t;
4589ef270ab1SKenneth D. Merry
4590ef270ab1SKenneth D. Merry /**
4591ef270ab1SKenneth D. Merry * @brief WQE used to create an FCP target response.
4592ef270ab1SKenneth D. Merry */
4593ef270ab1SKenneth D. Merry typedef struct sli4_fcp_trsp64_wqe_s {
4594ef270ab1SKenneth D. Merry sli4_bde_t bde;
4595ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4596ef270ab1SKenneth D. Merry uint32_t fcp_response_length;
4597ef270ab1SKenneth D. Merry uint32_t rsvd4;
4598ef270ab1SKenneth D. Merry /**
4599ef270ab1SKenneth D. Merry * DWord 5 can either be the task retry identifier (HLM=0) or
4600ef270ab1SKenneth D. Merry * the remote N_Port ID (HLM=1)
4601ef270ab1SKenneth D. Merry */
4602ef270ab1SKenneth D. Merry uint32_t dword5;
4603ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4604ef270ab1SKenneth D. Merry rpi:16;
4605ef270ab1SKenneth D. Merry uint32_t :2,
4606ef270ab1SKenneth D. Merry ct:2,
4607ef270ab1SKenneth D. Merry dnrx:1,
4608ef270ab1SKenneth D. Merry :3,
4609ef270ab1SKenneth D. Merry command:8,
4610ef270ab1SKenneth D. Merry class:3,
4611ef270ab1SKenneth D. Merry ag:1,
4612ef270ab1SKenneth D. Merry pu:2,
4613ef270ab1SKenneth D. Merry conf:1,
4614ef270ab1SKenneth D. Merry lnk:1,
4615ef270ab1SKenneth D. Merry timer:8;
4616ef270ab1SKenneth D. Merry uint32_t abort_tag;
4617ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4618ef270ab1SKenneth D. Merry remote_xid:16;
4619ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4620ef270ab1SKenneth D. Merry :1,
4621ef270ab1SKenneth D. Merry app_id_valid:1,
4622ef270ab1SKenneth D. Merry :1,
4623ef270ab1SKenneth D. Merry len_loc:2,
4624ef270ab1SKenneth D. Merry qosd:1,
4625ef270ab1SKenneth D. Merry wchn:1,
4626ef270ab1SKenneth D. Merry xbl:1,
4627ef270ab1SKenneth D. Merry hlm:1,
4628ef270ab1SKenneth D. Merry iod:1,
4629ef270ab1SKenneth D. Merry dbde:1,
4630ef270ab1SKenneth D. Merry wqes:1,
4631ef270ab1SKenneth D. Merry pri:3,
4632ef270ab1SKenneth D. Merry pv:1,
4633ef270ab1SKenneth D. Merry eat:1,
4634ef270ab1SKenneth D. Merry xc:1,
4635ef270ab1SKenneth D. Merry sr:1,
4636ef270ab1SKenneth D. Merry ccpe:1,
4637ef270ab1SKenneth D. Merry ccp:8;
4638ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4639ef270ab1SKenneth D. Merry :3,
4640ef270ab1SKenneth D. Merry wqec:1,
4641ef270ab1SKenneth D. Merry :8,
4642ef270ab1SKenneth D. Merry cq_id:16;
4643ef270ab1SKenneth D. Merry uint32_t rsvd12;
4644ef270ab1SKenneth D. Merry uint32_t rsvd13;
4645ef270ab1SKenneth D. Merry uint32_t rsvd14;
4646ef270ab1SKenneth D. Merry uint32_t rsvd15;
4647ef270ab1SKenneth D. Merry #else
4648ef270ab1SKenneth D. Merry #error big endian version not defined
4649ef270ab1SKenneth D. Merry #endif
4650ef270ab1SKenneth D. Merry } sli4_fcp_trsp64_wqe_t;
4651ef270ab1SKenneth D. Merry
4652ef270ab1SKenneth D. Merry /**
4653ef270ab1SKenneth D. Merry * @brief WQE used to create an FCP target send (DATA IN).
4654ef270ab1SKenneth D. Merry */
4655ef270ab1SKenneth D. Merry typedef struct sli4_fcp_tsend64_wqe_s {
4656ef270ab1SKenneth D. Merry sli4_bde_t bde;
4657ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4658ef270ab1SKenneth D. Merry uint32_t payload_offset_length;
4659ef270ab1SKenneth D. Merry uint32_t relative_offset;
4660ef270ab1SKenneth D. Merry /**
4661ef270ab1SKenneth D. Merry * DWord 5 can either be the task retry identifier (HLM=0) or
4662ef270ab1SKenneth D. Merry * the remote N_Port ID (HLM=1)
4663ef270ab1SKenneth D. Merry */
4664ef270ab1SKenneth D. Merry uint32_t dword5;
4665ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4666ef270ab1SKenneth D. Merry rpi:16;
4667ef270ab1SKenneth D. Merry uint32_t dif:2,
4668ef270ab1SKenneth D. Merry ct:2,
4669ef270ab1SKenneth D. Merry bs:3,
4670ef270ab1SKenneth D. Merry :1,
4671ef270ab1SKenneth D. Merry command:8,
4672ef270ab1SKenneth D. Merry class:3,
4673ef270ab1SKenneth D. Merry ar:1,
4674ef270ab1SKenneth D. Merry pu:2,
4675ef270ab1SKenneth D. Merry conf:1,
4676ef270ab1SKenneth D. Merry lnk:1,
4677ef270ab1SKenneth D. Merry timer:8;
4678ef270ab1SKenneth D. Merry uint32_t abort_tag;
4679ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4680ef270ab1SKenneth D. Merry remote_xid:16;
4681ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4682ef270ab1SKenneth D. Merry :1,
4683ef270ab1SKenneth D. Merry app_id_valid:1,
4684ef270ab1SKenneth D. Merry :1,
4685ef270ab1SKenneth D. Merry len_loc:2,
4686ef270ab1SKenneth D. Merry qosd:1,
4687ef270ab1SKenneth D. Merry wchn:1,
4688ef270ab1SKenneth D. Merry xbl:1,
4689ef270ab1SKenneth D. Merry hlm:1,
4690ef270ab1SKenneth D. Merry iod:1,
4691ef270ab1SKenneth D. Merry dbde:1,
4692ef270ab1SKenneth D. Merry wqes:1,
4693ef270ab1SKenneth D. Merry pri:3,
4694ef270ab1SKenneth D. Merry pv:1,
4695ef270ab1SKenneth D. Merry eat:1,
4696ef270ab1SKenneth D. Merry xc:1,
4697ef270ab1SKenneth D. Merry sr:1,
4698ef270ab1SKenneth D. Merry ccpe:1,
4699ef270ab1SKenneth D. Merry ccp:8;
4700ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4701ef270ab1SKenneth D. Merry :3,
4702ef270ab1SKenneth D. Merry wqec:1,
4703ef270ab1SKenneth D. Merry :8,
4704ef270ab1SKenneth D. Merry cq_id:16;
4705ef270ab1SKenneth D. Merry uint32_t fcp_data_transmit_length;
4706ef270ab1SKenneth D. Merry
4707ef270ab1SKenneth D. Merry #else
4708ef270ab1SKenneth D. Merry #error big endian version not defined
4709ef270ab1SKenneth D. Merry #endif
4710ef270ab1SKenneth D. Merry sli4_bde_t first_data_bde; /* For performance hints */
4711ef270ab1SKenneth D. Merry } sli4_fcp_tsend64_wqe_t;
4712ef270ab1SKenneth D. Merry
4713ef270ab1SKenneth D. Merry #define SLI4_IO_CONTINUATION BIT(0) /** The XRI associated with this IO is already active */
4714ef270ab1SKenneth D. Merry #define SLI4_IO_AUTO_GOOD_RESPONSE BIT(1) /** Automatically generate a good RSP frame */
4715ef270ab1SKenneth D. Merry #define SLI4_IO_NO_ABORT BIT(2)
4716ef270ab1SKenneth D. Merry #define SLI4_IO_DNRX BIT(3) /** Set the DNRX bit because no auto xref rdy buffer is posted */
4717ef270ab1SKenneth D. Merry
4718ef270ab1SKenneth D. Merry /* WQE DIF field contents */
4719ef270ab1SKenneth D. Merry #define SLI4_DIF_DISABLED 0
4720ef270ab1SKenneth D. Merry #define SLI4_DIF_PASS_THROUGH 1
4721ef270ab1SKenneth D. Merry #define SLI4_DIF_STRIP 2
4722ef270ab1SKenneth D. Merry #define SLI4_DIF_INSERT 3
4723ef270ab1SKenneth D. Merry
4724ef270ab1SKenneth D. Merry /**
4725ef270ab1SKenneth D. Merry * @brief WQE used to create a general request.
4726ef270ab1SKenneth D. Merry */
4727ef270ab1SKenneth D. Merry typedef struct sli4_gen_request64_wqe_s {
4728ef270ab1SKenneth D. Merry sli4_bde_t bde;
4729ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4730ef270ab1SKenneth D. Merry uint32_t request_payload_length;
4731ef270ab1SKenneth D. Merry uint32_t relative_offset;
4732ef270ab1SKenneth D. Merry uint32_t :8,
4733ef270ab1SKenneth D. Merry df_ctl:8,
4734ef270ab1SKenneth D. Merry type:8,
4735ef270ab1SKenneth D. Merry r_ctl:8;
4736ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4737ef270ab1SKenneth D. Merry context_tag:16;
4738ef270ab1SKenneth D. Merry uint32_t :2,
4739ef270ab1SKenneth D. Merry ct:2,
4740ef270ab1SKenneth D. Merry :4,
4741ef270ab1SKenneth D. Merry command:8,
4742ef270ab1SKenneth D. Merry class:3,
4743ef270ab1SKenneth D. Merry :1,
4744ef270ab1SKenneth D. Merry pu:2,
4745ef270ab1SKenneth D. Merry :2,
4746ef270ab1SKenneth D. Merry timer:8;
4747ef270ab1SKenneth D. Merry uint32_t abort_tag;
4748ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4749ef270ab1SKenneth D. Merry :16;
4750ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4751ef270ab1SKenneth D. Merry :3,
4752ef270ab1SKenneth D. Merry len_loc:2,
4753ef270ab1SKenneth D. Merry qosd:1,
4754ef270ab1SKenneth D. Merry :1,
4755ef270ab1SKenneth D. Merry xbl:1,
4756ef270ab1SKenneth D. Merry hlm:1,
4757ef270ab1SKenneth D. Merry iod:1,
4758ef270ab1SKenneth D. Merry dbde:1,
4759ef270ab1SKenneth D. Merry wqes:1,
4760ef270ab1SKenneth D. Merry pri:3,
4761ef270ab1SKenneth D. Merry pv:1,
4762ef270ab1SKenneth D. Merry eat:1,
4763ef270ab1SKenneth D. Merry xc:1,
4764ef270ab1SKenneth D. Merry :1,
4765ef270ab1SKenneth D. Merry ccpe:1,
4766ef270ab1SKenneth D. Merry ccp:8;
4767ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4768ef270ab1SKenneth D. Merry :3,
4769ef270ab1SKenneth D. Merry wqec:1,
4770ef270ab1SKenneth D. Merry :8,
4771ef270ab1SKenneth D. Merry cq_id:16;
4772ef270ab1SKenneth D. Merry uint32_t remote_n_port_id:24,
4773ef270ab1SKenneth D. Merry :8;
4774ef270ab1SKenneth D. Merry uint32_t rsvd13;
4775ef270ab1SKenneth D. Merry uint32_t rsvd14;
4776ef270ab1SKenneth D. Merry uint32_t max_response_payload_length;
4777ef270ab1SKenneth D. Merry #else
4778ef270ab1SKenneth D. Merry #error big endian version not defined
4779ef270ab1SKenneth D. Merry #endif
4780ef270ab1SKenneth D. Merry } sli4_gen_request64_wqe_t;
4781ef270ab1SKenneth D. Merry
4782ef270ab1SKenneth D. Merry /**
4783ef270ab1SKenneth D. Merry * @brief WQE used to create a send frame request.
4784ef270ab1SKenneth D. Merry */
4785ef270ab1SKenneth D. Merry typedef struct sli4_send_frame_wqe_s {
4786ef270ab1SKenneth D. Merry sli4_bde_t bde;
4787ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4788ef270ab1SKenneth D. Merry uint32_t frame_length;
4789ef270ab1SKenneth D. Merry uint32_t fc_header_0_1[2];
4790ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4791ef270ab1SKenneth D. Merry context_tag:16;
4792ef270ab1SKenneth D. Merry uint32_t :2,
4793ef270ab1SKenneth D. Merry ct:2,
4794ef270ab1SKenneth D. Merry :4,
4795ef270ab1SKenneth D. Merry command:8,
4796ef270ab1SKenneth D. Merry class:3,
4797ef270ab1SKenneth D. Merry :1,
4798ef270ab1SKenneth D. Merry pu:2,
4799ef270ab1SKenneth D. Merry :2,
4800ef270ab1SKenneth D. Merry timer:8;
4801ef270ab1SKenneth D. Merry uint32_t abort_tag;
4802ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4803ef270ab1SKenneth D. Merry eof:8,
4804ef270ab1SKenneth D. Merry sof:8;
4805ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4806ef270ab1SKenneth D. Merry :3,
4807ef270ab1SKenneth D. Merry lenloc:2,
4808ef270ab1SKenneth D. Merry qosd:1,
4809ef270ab1SKenneth D. Merry wchn:1,
4810ef270ab1SKenneth D. Merry xbl:1,
4811ef270ab1SKenneth D. Merry hlm:1,
4812ef270ab1SKenneth D. Merry iod:1,
4813ef270ab1SKenneth D. Merry dbde:1,
4814ef270ab1SKenneth D. Merry wqes:1,
4815ef270ab1SKenneth D. Merry pri:3,
4816ef270ab1SKenneth D. Merry pv:1,
4817ef270ab1SKenneth D. Merry eat:1,
4818ef270ab1SKenneth D. Merry xc:1,
4819ef270ab1SKenneth D. Merry :1,
4820ef270ab1SKenneth D. Merry ccpe:1,
4821ef270ab1SKenneth D. Merry ccp:8;
4822ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4823ef270ab1SKenneth D. Merry :3,
4824ef270ab1SKenneth D. Merry wqec:1,
4825ef270ab1SKenneth D. Merry :8,
4826ef270ab1SKenneth D. Merry cq_id:16;
4827ef270ab1SKenneth D. Merry uint32_t fc_header_2_5[4];
4828ef270ab1SKenneth D. Merry #else
4829ef270ab1SKenneth D. Merry #error big endian version not defined
4830ef270ab1SKenneth D. Merry #endif
4831ef270ab1SKenneth D. Merry } sli4_send_frame_wqe_t;
4832ef270ab1SKenneth D. Merry
4833ef270ab1SKenneth D. Merry /**
4834ef270ab1SKenneth D. Merry * @brief WQE used to create a transmit sequence.
4835ef270ab1SKenneth D. Merry */
4836ef270ab1SKenneth D. Merry typedef struct sli4_xmit_sequence64_wqe_s {
4837ef270ab1SKenneth D. Merry sli4_bde_t bde;
4838ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4839ef270ab1SKenneth D. Merry uint32_t remote_n_port_id:24,
4840ef270ab1SKenneth D. Merry :8;
4841ef270ab1SKenneth D. Merry uint32_t relative_offset;
4842ef270ab1SKenneth D. Merry uint32_t :2,
4843ef270ab1SKenneth D. Merry si:1,
4844ef270ab1SKenneth D. Merry ft:1,
4845ef270ab1SKenneth D. Merry :2,
4846ef270ab1SKenneth D. Merry xo:1,
4847ef270ab1SKenneth D. Merry ls:1,
4848ef270ab1SKenneth D. Merry df_ctl:8,
4849ef270ab1SKenneth D. Merry type:8,
4850ef270ab1SKenneth D. Merry r_ctl:8;
4851ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4852ef270ab1SKenneth D. Merry context_tag:16;
4853ef270ab1SKenneth D. Merry uint32_t dif:2,
4854ef270ab1SKenneth D. Merry ct:2,
4855ef270ab1SKenneth D. Merry bs:3,
4856ef270ab1SKenneth D. Merry :1,
4857ef270ab1SKenneth D. Merry command:8,
4858ef270ab1SKenneth D. Merry class:3,
4859ef270ab1SKenneth D. Merry :1,
4860ef270ab1SKenneth D. Merry pu:2,
4861ef270ab1SKenneth D. Merry :2,
4862ef270ab1SKenneth D. Merry timer:8;
4863ef270ab1SKenneth D. Merry uint32_t abort_tag;
4864ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4865ef270ab1SKenneth D. Merry remote_xid:16;
4866ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4867ef270ab1SKenneth D. Merry :3,
4868ef270ab1SKenneth D. Merry len_loc:2,
4869ef270ab1SKenneth D. Merry qosd:1,
4870ef270ab1SKenneth D. Merry :1,
4871ef270ab1SKenneth D. Merry xbl:1,
4872ef270ab1SKenneth D. Merry hlm:1,
4873ef270ab1SKenneth D. Merry iod:1,
4874ef270ab1SKenneth D. Merry dbde:1,
4875ef270ab1SKenneth D. Merry wqes:1,
4876ef270ab1SKenneth D. Merry pri:3,
4877ef270ab1SKenneth D. Merry pv:1,
4878ef270ab1SKenneth D. Merry eat:1,
4879ef270ab1SKenneth D. Merry xc:1,
4880ef270ab1SKenneth D. Merry sr:1,
4881ef270ab1SKenneth D. Merry ccpe:1,
4882ef270ab1SKenneth D. Merry ccp:8;
4883ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4884ef270ab1SKenneth D. Merry :3,
4885ef270ab1SKenneth D. Merry wqec:1,
4886ef270ab1SKenneth D. Merry :8,
4887ef270ab1SKenneth D. Merry cq_id:16;
4888ef270ab1SKenneth D. Merry uint32_t sequence_payload_len;
4889ef270ab1SKenneth D. Merry uint32_t rsvd13;
4890ef270ab1SKenneth D. Merry uint32_t rsvd14;
4891ef270ab1SKenneth D. Merry uint32_t rsvd15;
4892ef270ab1SKenneth D. Merry #else
4893ef270ab1SKenneth D. Merry #error big endian version not defined
4894ef270ab1SKenneth D. Merry #endif
4895ef270ab1SKenneth D. Merry } sli4_xmit_sequence64_wqe_t;
4896ef270ab1SKenneth D. Merry
4897ef270ab1SKenneth D. Merry /**
4898ef270ab1SKenneth D. Merry * @brief WQE used unblock the specified XRI and to release it to the SLI Port's free pool.
4899ef270ab1SKenneth D. Merry */
4900ef270ab1SKenneth D. Merry typedef struct sli4_requeue_xri_wqe_s {
4901ef270ab1SKenneth D. Merry uint32_t rsvd0;
4902ef270ab1SKenneth D. Merry uint32_t rsvd1;
4903ef270ab1SKenneth D. Merry uint32_t rsvd2;
4904ef270ab1SKenneth D. Merry uint32_t rsvd3;
4905ef270ab1SKenneth D. Merry uint32_t rsvd4;
4906ef270ab1SKenneth D. Merry uint32_t rsvd5;
4907ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4908ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4909ef270ab1SKenneth D. Merry context_tag:16;
4910ef270ab1SKenneth D. Merry uint32_t :2,
4911ef270ab1SKenneth D. Merry ct:2,
4912ef270ab1SKenneth D. Merry :4,
4913ef270ab1SKenneth D. Merry command:8,
4914ef270ab1SKenneth D. Merry class:3,
4915ef270ab1SKenneth D. Merry :1,
4916ef270ab1SKenneth D. Merry pu:2,
4917ef270ab1SKenneth D. Merry :2,
4918ef270ab1SKenneth D. Merry timer:8;
4919ef270ab1SKenneth D. Merry uint32_t rsvd8;
4920ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4921ef270ab1SKenneth D. Merry :16;
4922ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4923ef270ab1SKenneth D. Merry :3,
4924ef270ab1SKenneth D. Merry len_loc:2,
4925ef270ab1SKenneth D. Merry qosd:1,
4926ef270ab1SKenneth D. Merry wchn:1,
4927ef270ab1SKenneth D. Merry xbl:1,
4928ef270ab1SKenneth D. Merry hlm:1,
4929ef270ab1SKenneth D. Merry iod:1,
4930ef270ab1SKenneth D. Merry dbde:1,
4931ef270ab1SKenneth D. Merry wqes:1,
4932ef270ab1SKenneth D. Merry pri:3,
4933ef270ab1SKenneth D. Merry pv:1,
4934ef270ab1SKenneth D. Merry eat:1,
4935ef270ab1SKenneth D. Merry xc:1,
4936ef270ab1SKenneth D. Merry :1,
4937ef270ab1SKenneth D. Merry ccpe:1,
4938ef270ab1SKenneth D. Merry ccp:8;
4939ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4940ef270ab1SKenneth D. Merry :3,
4941ef270ab1SKenneth D. Merry wqec:1,
4942ef270ab1SKenneth D. Merry :8,
4943ef270ab1SKenneth D. Merry cq_id:16;
4944ef270ab1SKenneth D. Merry uint32_t rsvd12;
4945ef270ab1SKenneth D. Merry uint32_t rsvd13;
4946ef270ab1SKenneth D. Merry uint32_t rsvd14;
4947ef270ab1SKenneth D. Merry uint32_t rsvd15;
4948ef270ab1SKenneth D. Merry #else
4949ef270ab1SKenneth D. Merry #error big endian version not defined
4950ef270ab1SKenneth D. Merry #endif
4951ef270ab1SKenneth D. Merry } sli4_requeue_xri_wqe_t;
4952ef270ab1SKenneth D. Merry
4953ef270ab1SKenneth D. Merry /**
4954ef270ab1SKenneth D. Merry * @brief WQE used to send a single frame sequence to broadcast address
4955ef270ab1SKenneth D. Merry */
4956ef270ab1SKenneth D. Merry typedef struct sli4_xmit_bcast64_wqe_s {
4957ef270ab1SKenneth D. Merry sli4_bde_t sequence_payload;
4958ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
4959ef270ab1SKenneth D. Merry uint32_t sequence_payload_length;
4960ef270ab1SKenneth D. Merry uint32_t rsvd4;
4961ef270ab1SKenneth D. Merry uint32_t :8,
4962ef270ab1SKenneth D. Merry df_ctl:8,
4963ef270ab1SKenneth D. Merry type:8,
4964ef270ab1SKenneth D. Merry r_ctl:8;
4965ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
4966ef270ab1SKenneth D. Merry context_tag:16;
4967ef270ab1SKenneth D. Merry uint32_t :2,
4968ef270ab1SKenneth D. Merry ct:2,
4969ef270ab1SKenneth D. Merry :4,
4970ef270ab1SKenneth D. Merry command:8,
4971ef270ab1SKenneth D. Merry class:3,
4972ef270ab1SKenneth D. Merry :1,
4973ef270ab1SKenneth D. Merry pu:2,
4974ef270ab1SKenneth D. Merry :2,
4975ef270ab1SKenneth D. Merry timer:8;
4976ef270ab1SKenneth D. Merry uint32_t abort_tag;
4977ef270ab1SKenneth D. Merry uint32_t request_tag:16,
4978ef270ab1SKenneth D. Merry temporary_rpi:16;
4979ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
4980ef270ab1SKenneth D. Merry :3,
4981ef270ab1SKenneth D. Merry len_loc:2,
4982ef270ab1SKenneth D. Merry qosd:1,
4983ef270ab1SKenneth D. Merry :1,
4984ef270ab1SKenneth D. Merry xbl:1,
4985ef270ab1SKenneth D. Merry hlm:1,
4986ef270ab1SKenneth D. Merry iod:1,
4987ef270ab1SKenneth D. Merry dbde:1,
4988ef270ab1SKenneth D. Merry wqes:1,
4989ef270ab1SKenneth D. Merry pri:3,
4990ef270ab1SKenneth D. Merry pv:1,
4991ef270ab1SKenneth D. Merry eat:1,
4992ef270ab1SKenneth D. Merry xc:1,
4993ef270ab1SKenneth D. Merry :1,
4994ef270ab1SKenneth D. Merry ccpe:1,
4995ef270ab1SKenneth D. Merry ccp:8;
4996ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
4997ef270ab1SKenneth D. Merry :3,
4998ef270ab1SKenneth D. Merry wqec:1,
4999ef270ab1SKenneth D. Merry :8,
5000ef270ab1SKenneth D. Merry cq_id:16;
5001ef270ab1SKenneth D. Merry uint32_t rsvd12;
5002ef270ab1SKenneth D. Merry uint32_t rsvd13;
5003ef270ab1SKenneth D. Merry uint32_t rsvd14;
5004ef270ab1SKenneth D. Merry uint32_t rsvd15;
5005ef270ab1SKenneth D. Merry #else
5006ef270ab1SKenneth D. Merry #error big endian version not defined
5007ef270ab1SKenneth D. Merry #endif
5008ef270ab1SKenneth D. Merry } sli4_xmit_bcast64_wqe_t;
5009ef270ab1SKenneth D. Merry
5010ef270ab1SKenneth D. Merry /**
5011ef270ab1SKenneth D. Merry * @brief WQE used to create a BLS response.
5012ef270ab1SKenneth D. Merry */
5013ef270ab1SKenneth D. Merry typedef struct sli4_xmit_bls_rsp_wqe_s {
5014ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5015ef270ab1SKenneth D. Merry uint32_t payload_word0;
5016ef270ab1SKenneth D. Merry uint32_t rx_id:16,
5017ef270ab1SKenneth D. Merry ox_id:16;
5018ef270ab1SKenneth D. Merry uint32_t high_seq_cnt:16,
5019ef270ab1SKenneth D. Merry low_seq_cnt:16;
5020ef270ab1SKenneth D. Merry uint32_t rsvd3;
5021ef270ab1SKenneth D. Merry uint32_t local_n_port_id:24,
5022ef270ab1SKenneth D. Merry :8;
5023ef270ab1SKenneth D. Merry uint32_t remote_id:24,
5024ef270ab1SKenneth D. Merry :6,
5025ef270ab1SKenneth D. Merry ar:1,
5026ef270ab1SKenneth D. Merry xo:1;
5027ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
5028ef270ab1SKenneth D. Merry context_tag:16;
5029ef270ab1SKenneth D. Merry uint32_t :2,
5030ef270ab1SKenneth D. Merry ct:2,
5031ef270ab1SKenneth D. Merry :4,
5032ef270ab1SKenneth D. Merry command:8,
5033ef270ab1SKenneth D. Merry class:3,
5034ef270ab1SKenneth D. Merry :1,
5035ef270ab1SKenneth D. Merry pu:2,
5036ef270ab1SKenneth D. Merry :2,
5037ef270ab1SKenneth D. Merry timer:8;
5038ef270ab1SKenneth D. Merry uint32_t abort_tag;
5039ef270ab1SKenneth D. Merry uint32_t request_tag:16,
5040ef270ab1SKenneth D. Merry :16;
5041ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
5042ef270ab1SKenneth D. Merry :3,
5043ef270ab1SKenneth D. Merry len_loc:2,
5044ef270ab1SKenneth D. Merry qosd:1,
5045ef270ab1SKenneth D. Merry :1,
5046ef270ab1SKenneth D. Merry xbl:1,
5047ef270ab1SKenneth D. Merry hlm:1,
5048ef270ab1SKenneth D. Merry iod:1,
5049ef270ab1SKenneth D. Merry dbde:1,
5050ef270ab1SKenneth D. Merry wqes:1,
5051ef270ab1SKenneth D. Merry pri:3,
5052ef270ab1SKenneth D. Merry pv:1,
5053ef270ab1SKenneth D. Merry eat:1,
5054ef270ab1SKenneth D. Merry xc:1,
5055ef270ab1SKenneth D. Merry :1,
5056ef270ab1SKenneth D. Merry ccpe:1,
5057ef270ab1SKenneth D. Merry ccp:8;
5058ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
5059ef270ab1SKenneth D. Merry :3,
5060ef270ab1SKenneth D. Merry wqec:1,
5061ef270ab1SKenneth D. Merry :8,
5062ef270ab1SKenneth D. Merry cq_id:16;
5063ef270ab1SKenneth D. Merry uint32_t temporary_rpi:16,
5064ef270ab1SKenneth D. Merry :16;
5065ef270ab1SKenneth D. Merry uint32_t rsvd13;
5066ef270ab1SKenneth D. Merry uint32_t rsvd14;
5067ef270ab1SKenneth D. Merry uint32_t rsvd15;
5068ef270ab1SKenneth D. Merry #else
5069ef270ab1SKenneth D. Merry #error big endian version not defined
5070ef270ab1SKenneth D. Merry #endif
5071ef270ab1SKenneth D. Merry } sli4_xmit_bls_rsp_wqe_t;
5072ef270ab1SKenneth D. Merry
5073ef270ab1SKenneth D. Merry typedef enum {
5074ef270ab1SKenneth D. Merry SLI_BLS_ACC,
5075ef270ab1SKenneth D. Merry SLI_BLS_RJT,
5076ef270ab1SKenneth D. Merry SLI_BLS_MAX
5077ef270ab1SKenneth D. Merry } sli_bls_type_e;
5078ef270ab1SKenneth D. Merry
5079ef270ab1SKenneth D. Merry typedef struct sli_bls_payload_s {
5080ef270ab1SKenneth D. Merry sli_bls_type_e type;
5081ef270ab1SKenneth D. Merry uint16_t ox_id;
5082ef270ab1SKenneth D. Merry uint16_t rx_id;
5083ef270ab1SKenneth D. Merry union {
5084ef270ab1SKenneth D. Merry struct {
5085ef270ab1SKenneth D. Merry uint32_t seq_id_validity:8,
5086ef270ab1SKenneth D. Merry seq_id_last:8,
5087ef270ab1SKenneth D. Merry :16;
5088ef270ab1SKenneth D. Merry uint16_t ox_id;
5089ef270ab1SKenneth D. Merry uint16_t rx_id;
5090ef270ab1SKenneth D. Merry uint16_t low_seq_cnt;
5091ef270ab1SKenneth D. Merry uint16_t high_seq_cnt;
5092ef270ab1SKenneth D. Merry } acc;
5093ef270ab1SKenneth D. Merry struct {
5094ef270ab1SKenneth D. Merry uint32_t vendor_unique:8,
5095ef270ab1SKenneth D. Merry reason_explanation:8,
5096ef270ab1SKenneth D. Merry reason_code:8,
5097ef270ab1SKenneth D. Merry :8;
5098ef270ab1SKenneth D. Merry } rjt;
5099ef270ab1SKenneth D. Merry } u;
5100ef270ab1SKenneth D. Merry } sli_bls_payload_t;
5101ef270ab1SKenneth D. Merry
5102ef270ab1SKenneth D. Merry /**
5103ef270ab1SKenneth D. Merry * @brief WQE used to create an ELS response.
5104ef270ab1SKenneth D. Merry */
5105ef270ab1SKenneth D. Merry typedef struct sli4_xmit_els_rsp64_wqe_s {
5106ef270ab1SKenneth D. Merry sli4_bde_t els_response_payload;
5107ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5108ef270ab1SKenneth D. Merry uint32_t els_response_payload_length;
5109ef270ab1SKenneth D. Merry uint32_t s_id:24,
5110ef270ab1SKenneth D. Merry sp:1,
5111ef270ab1SKenneth D. Merry :7;
5112ef270ab1SKenneth D. Merry uint32_t remote_id:24,
5113ef270ab1SKenneth D. Merry :8;
5114ef270ab1SKenneth D. Merry uint32_t xri_tag:16,
5115ef270ab1SKenneth D. Merry context_tag:16;
5116ef270ab1SKenneth D. Merry uint32_t :2,
5117ef270ab1SKenneth D. Merry ct:2,
5118ef270ab1SKenneth D. Merry :4,
5119ef270ab1SKenneth D. Merry command:8,
5120ef270ab1SKenneth D. Merry class:3,
5121ef270ab1SKenneth D. Merry :1,
5122ef270ab1SKenneth D. Merry pu:2,
5123ef270ab1SKenneth D. Merry :2,
5124ef270ab1SKenneth D. Merry timer:8;
5125ef270ab1SKenneth D. Merry uint32_t abort_tag;
5126ef270ab1SKenneth D. Merry uint32_t request_tag:16,
5127ef270ab1SKenneth D. Merry ox_id:16;
5128ef270ab1SKenneth D. Merry uint32_t ebde_cnt:4,
5129ef270ab1SKenneth D. Merry :3,
5130ef270ab1SKenneth D. Merry len_loc:2,
5131ef270ab1SKenneth D. Merry qosd:1,
5132ef270ab1SKenneth D. Merry :1,
5133ef270ab1SKenneth D. Merry xbl:1,
5134ef270ab1SKenneth D. Merry hlm:1,
5135ef270ab1SKenneth D. Merry iod:1,
5136ef270ab1SKenneth D. Merry dbde:1,
5137ef270ab1SKenneth D. Merry wqes:1,
5138ef270ab1SKenneth D. Merry pri:3,
5139ef270ab1SKenneth D. Merry pv:1,
5140ef270ab1SKenneth D. Merry eat:1,
5141ef270ab1SKenneth D. Merry xc:1,
5142ef270ab1SKenneth D. Merry :1,
5143ef270ab1SKenneth D. Merry ccpe:1,
5144ef270ab1SKenneth D. Merry ccp:8;
5145ef270ab1SKenneth D. Merry uint32_t cmd_type:4,
5146ef270ab1SKenneth D. Merry :3,
5147ef270ab1SKenneth D. Merry wqec:1,
5148ef270ab1SKenneth D. Merry :8,
5149ef270ab1SKenneth D. Merry cq_id:16;
5150ef270ab1SKenneth D. Merry uint32_t temporary_rpi:16,
5151ef270ab1SKenneth D. Merry :16;
5152ef270ab1SKenneth D. Merry uint32_t rsvd13;
5153ef270ab1SKenneth D. Merry uint32_t rsvd14;
5154ef270ab1SKenneth D. Merry uint32_t rsvd15;
5155ef270ab1SKenneth D. Merry #else
5156ef270ab1SKenneth D. Merry #error big endian version not defined
5157ef270ab1SKenneth D. Merry #endif
5158ef270ab1SKenneth D. Merry } sli4_xmit_els_rsp64_wqe_t;
5159ef270ab1SKenneth D. Merry
5160ef270ab1SKenneth D. Merry /**
5161ef270ab1SKenneth D. Merry * @brief Asynchronouse Event: Link State ACQE.
5162ef270ab1SKenneth D. Merry */
5163ef270ab1SKenneth D. Merry typedef struct sli4_link_state_s {
5164ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5165ef270ab1SKenneth D. Merry uint32_t link_number:6,
5166ef270ab1SKenneth D. Merry link_type:2,
5167ef270ab1SKenneth D. Merry port_link_status:8,
5168ef270ab1SKenneth D. Merry port_duplex:8,
5169ef270ab1SKenneth D. Merry port_speed:8;
5170ef270ab1SKenneth D. Merry uint32_t port_fault:8,
5171ef270ab1SKenneth D. Merry :8,
5172ef270ab1SKenneth D. Merry logical_link_speed:16;
5173ef270ab1SKenneth D. Merry uint32_t event_tag;
5174ef270ab1SKenneth D. Merry uint32_t :8,
5175ef270ab1SKenneth D. Merry event_code:8,
5176ef270ab1SKenneth D. Merry event_type:8, /** values are protocol specific */
5177ef270ab1SKenneth D. Merry :6,
5178ef270ab1SKenneth D. Merry ae:1, /** async event - this is an ACQE */
5179ef270ab1SKenneth D. Merry val:1; /** valid - contents of CQE are valid */
5180ef270ab1SKenneth D. Merry #else
5181ef270ab1SKenneth D. Merry #error big endian version not defined
5182ef270ab1SKenneth D. Merry #endif
5183ef270ab1SKenneth D. Merry } sli4_link_state_t;
5184ef270ab1SKenneth D. Merry
5185ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_TYPE_LINK_UP 0x01
5186ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_TYPE_LINK_DOWN 0x02
5187ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_TYPE_NO_HARD_ALPA 0x03
5188ef270ab1SKenneth D. Merry
5189ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_P2P 0x01
5190ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_FC_AL 0x02
5191ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_INTERNAL_LOOPBACK 0x03
5192ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_SERDES_LOOPBACK 0x04
5193ef270ab1SKenneth D. Merry
5194ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_1G 0x01
5195ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_2G 0x02
5196ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_4G 0x04
5197ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_8G 0x08
5198ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_10G 0x0a
5199ef270ab1SKenneth D. Merry #define SLI4_LINK_ATTN_16G 0x10
5200ef270ab1SKenneth D. Merry
5201ef270ab1SKenneth D. Merry #define SLI4_LINK_TYPE_ETHERNET 0x0
5202ef270ab1SKenneth D. Merry #define SLI4_LINK_TYPE_FC 0x1
5203ef270ab1SKenneth D. Merry
5204ef270ab1SKenneth D. Merry /**
5205ef270ab1SKenneth D. Merry * @brief Asynchronouse Event: FC Link Attention Event.
5206ef270ab1SKenneth D. Merry */
5207ef270ab1SKenneth D. Merry typedef struct sli4_link_attention_s {
5208ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5209ef270ab1SKenneth D. Merry uint32_t link_number:8,
5210ef270ab1SKenneth D. Merry attn_type:8,
5211ef270ab1SKenneth D. Merry topology:8,
5212ef270ab1SKenneth D. Merry port_speed:8;
5213ef270ab1SKenneth D. Merry uint32_t port_fault:8,
5214ef270ab1SKenneth D. Merry shared_link_status:8,
5215ef270ab1SKenneth D. Merry logical_link_speed:16;
5216ef270ab1SKenneth D. Merry uint32_t event_tag;
5217ef270ab1SKenneth D. Merry uint32_t :8,
5218ef270ab1SKenneth D. Merry event_code:8,
5219ef270ab1SKenneth D. Merry event_type:8, /** values are protocol specific */
5220ef270ab1SKenneth D. Merry :6,
5221ef270ab1SKenneth D. Merry ae:1, /** async event - this is an ACQE */
5222ef270ab1SKenneth D. Merry val:1; /** valid - contents of CQE are valid */
5223ef270ab1SKenneth D. Merry #else
5224ef270ab1SKenneth D. Merry #error big endian version not defined
5225ef270ab1SKenneth D. Merry #endif
5226ef270ab1SKenneth D. Merry } sli4_link_attention_t;
5227ef270ab1SKenneth D. Merry
5228ef270ab1SKenneth D. Merry /**
5229ef270ab1SKenneth D. Merry * @brief FC/FCoE event types.
5230ef270ab1SKenneth D. Merry */
5231ef270ab1SKenneth D. Merry #define SLI4_LINK_STATE_PHYSICAL 0x00
5232ef270ab1SKenneth D. Merry #define SLI4_LINK_STATE_LOGICAL 0x01
5233ef270ab1SKenneth D. Merry
5234ef270ab1SKenneth D. Merry #define SLI4_FCOE_FIP_FCF_DISCOVERED 0x01
5235ef270ab1SKenneth D. Merry #define SLI4_FCOE_FIP_FCF_TABLE_FULL 0x02
5236ef270ab1SKenneth D. Merry #define SLI4_FCOE_FIP_FCF_DEAD 0x03
5237ef270ab1SKenneth D. Merry #define SLI4_FCOE_FIP_FCF_CLEAR_VLINK 0x04
5238ef270ab1SKenneth D. Merry #define SLI4_FCOE_FIP_FCF_MODIFIED 0x05
5239ef270ab1SKenneth D. Merry
5240ef270ab1SKenneth D. Merry #define SLI4_GRP5_QOS_SPEED 0x01
5241ef270ab1SKenneth D. Merry
5242ef270ab1SKenneth D. Merry #define SLI4_FC_EVENT_LINK_ATTENTION 0x01
5243ef270ab1SKenneth D. Merry #define SLI4_FC_EVENT_SHARED_LINK_ATTENTION 0x02
5244ef270ab1SKenneth D. Merry
5245ef270ab1SKenneth D. Merry #define SLI4_PORT_SPEED_NO_LINK 0x0
5246ef270ab1SKenneth D. Merry #define SLI4_PORT_SPEED_10_MBPS 0x1
5247ef270ab1SKenneth D. Merry #define SLI4_PORT_SPEED_100_MBPS 0x2
5248ef270ab1SKenneth D. Merry #define SLI4_PORT_SPEED_1_GBPS 0x3
5249ef270ab1SKenneth D. Merry #define SLI4_PORT_SPEED_10_GBPS 0x4
5250ef270ab1SKenneth D. Merry
5251ef270ab1SKenneth D. Merry #define SLI4_PORT_DUPLEX_NONE 0x0
5252ef270ab1SKenneth D. Merry #define SLI4_PORT_DUPLEX_HWF 0x1
5253ef270ab1SKenneth D. Merry #define SLI4_PORT_DUPLEX_FULL 0x2
5254ef270ab1SKenneth D. Merry
5255ef270ab1SKenneth D. Merry #define SLI4_PORT_LINK_STATUS_PHYSICAL_DOWN 0x0
5256ef270ab1SKenneth D. Merry #define SLI4_PORT_LINK_STATUS_PHYSICAL_UP 0x1
5257ef270ab1SKenneth D. Merry #define SLI4_PORT_LINK_STATUS_LOGICAL_DOWN 0x2
5258ef270ab1SKenneth D. Merry #define SLI4_PORT_LINK_STATUS_LOGICAL_UP 0x3
5259ef270ab1SKenneth D. Merry
5260ef270ab1SKenneth D. Merry /**
5261ef270ab1SKenneth D. Merry * @brief Asynchronouse Event: FCoE/FIP ACQE.
5262ef270ab1SKenneth D. Merry */
5263ef270ab1SKenneth D. Merry typedef struct sli4_fcoe_fip_s {
5264ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5265ef270ab1SKenneth D. Merry uint32_t event_information;
5266ef270ab1SKenneth D. Merry uint32_t fcf_count:16,
5267ef270ab1SKenneth D. Merry fcoe_event_type:16;
5268ef270ab1SKenneth D. Merry uint32_t event_tag;
5269ef270ab1SKenneth D. Merry uint32_t :8,
5270ef270ab1SKenneth D. Merry event_code:8,
5271ef270ab1SKenneth D. Merry event_type:8, /** values are protocol specific */
5272ef270ab1SKenneth D. Merry :6,
5273ef270ab1SKenneth D. Merry ae:1, /** async event - this is an ACQE */
5274ef270ab1SKenneth D. Merry val:1; /** valid - contents of CQE are valid */
5275ef270ab1SKenneth D. Merry #else
5276ef270ab1SKenneth D. Merry #error big endian version not defined
5277ef270ab1SKenneth D. Merry #endif
5278ef270ab1SKenneth D. Merry } sli4_fcoe_fip_t;
5279ef270ab1SKenneth D. Merry
5280ef270ab1SKenneth D. Merry /**
5281ef270ab1SKenneth D. Merry * @brief FC/FCoE WQ completion queue entry.
5282ef270ab1SKenneth D. Merry */
5283ef270ab1SKenneth D. Merry typedef struct sli4_fc_wcqe_s {
5284ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5285ef270ab1SKenneth D. Merry uint32_t hw_status:8,
5286ef270ab1SKenneth D. Merry status:8,
5287ef270ab1SKenneth D. Merry request_tag:16;
5288ef270ab1SKenneth D. Merry uint32_t wqe_specific_1;
5289ef270ab1SKenneth D. Merry uint32_t wqe_specific_2;
5290ef270ab1SKenneth D. Merry uint32_t :15,
5291ef270ab1SKenneth D. Merry qx:1,
5292ef270ab1SKenneth D. Merry code:8,
5293ef270ab1SKenneth D. Merry pri:3,
5294ef270ab1SKenneth D. Merry pv:1,
5295ef270ab1SKenneth D. Merry xb:1,
5296ef270ab1SKenneth D. Merry :2,
5297ef270ab1SKenneth D. Merry vld:1;
5298ef270ab1SKenneth D. Merry #else
5299ef270ab1SKenneth D. Merry #error big endian version not defined
5300ef270ab1SKenneth D. Merry #endif
5301ef270ab1SKenneth D. Merry } sli4_fc_wcqe_t;
5302ef270ab1SKenneth D. Merry
5303ef270ab1SKenneth D. Merry /**
5304ef270ab1SKenneth D. Merry * @brief FC/FCoE WQ consumed CQ queue entry.
5305ef270ab1SKenneth D. Merry */
5306ef270ab1SKenneth D. Merry typedef struct sli4_fc_wqec_s {
5307ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5308ef270ab1SKenneth D. Merry uint32_t :32;
5309ef270ab1SKenneth D. Merry uint32_t :32;
5310ef270ab1SKenneth D. Merry uint32_t wqe_index:16,
5311ef270ab1SKenneth D. Merry wq_id:16;
5312ef270ab1SKenneth D. Merry uint32_t :16,
5313ef270ab1SKenneth D. Merry code:8,
5314ef270ab1SKenneth D. Merry :7,
5315ef270ab1SKenneth D. Merry vld:1;
5316ef270ab1SKenneth D. Merry #else
5317ef270ab1SKenneth D. Merry #error big endian version not defined
5318ef270ab1SKenneth D. Merry #endif
5319ef270ab1SKenneth D. Merry } sli4_fc_wqec_t;
5320ef270ab1SKenneth D. Merry
5321ef270ab1SKenneth D. Merry /**
5322ef270ab1SKenneth D. Merry * @brief FC/FCoE Completion Status Codes.
5323ef270ab1SKenneth D. Merry */
5324ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_SUCCESS 0x00
5325ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_FCP_RSP_FAILURE 0x01
5326ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_REMOTE_STOP 0x02
5327ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_LOCAL_REJECT 0x03
5328ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_NPORT_RJT 0x04
5329ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_FABRIC_RJT 0x05
5330ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_NPORT_BSY 0x06
5331ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_FABRIC_BSY 0x07
5332ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_LS_RJT 0x09
5333ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_CMD_REJECT 0x0b
5334ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_FCP_TGT_LENCHECK 0x0c
5335ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_RQ_BUF_LEN_EXCEEDED 0x11
5336ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_BUF_NEEDED 0x12
5337ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_FRM_DISC 0x13
5338ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_RQ_DMA_FAILURE 0x14
5339ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_FCP_RSP_TRUNCATE 0x15
5340ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_DI_ERROR 0x16
5341ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_BA_RJT 0x17
5342ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_XRI_NEEDED 0x18
5343ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_RQ_INSUFF_XRI_DISC 0x19
5344ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_RX_ERROR_DETECT 0x1a
5345ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_RX_ABORT_REQUEST 0x1b
5346ef270ab1SKenneth D. Merry
5347ef270ab1SKenneth D. Merry /* driver generated status codes; better not overlap with chip's status codes! */
5348*70547544SRam Kishore Vegesna #define SLI4_FC_WCQE_STATUS_WQE_TIMEOUT 0xff
5349ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_SHUTDOWN 0xfe
5350ef270ab1SKenneth D. Merry #define SLI4_FC_WCQE_STATUS_DISPATCH_ERROR 0xfd
5351ef270ab1SKenneth D. Merry
5352ef270ab1SKenneth D. Merry /**
5353ef270ab1SKenneth D. Merry * @brief DI_ERROR Extended Status
5354ef270ab1SKenneth D. Merry */
5355ef270ab1SKenneth D. Merry #define SLI4_FC_DI_ERROR_GE (1 << 0) /* Guard Error */
5356ef270ab1SKenneth D. Merry #define SLI4_FC_DI_ERROR_AE (1 << 1) /* Application Tag Error */
5357ef270ab1SKenneth D. Merry #define SLI4_FC_DI_ERROR_RE (1 << 2) /* Reference Tag Error */
5358ef270ab1SKenneth D. Merry #define SLI4_FC_DI_ERROR_TDPV (1 << 3) /* Total Data Placed Valid */
5359ef270ab1SKenneth D. Merry #define SLI4_FC_DI_ERROR_UDB (1 << 4) /* Uninitialized DIF Block */
5360ef270ab1SKenneth D. Merry #define SLI4_FC_DI_ERROR_EDIR (1 << 5) /* Error direction */
5361ef270ab1SKenneth D. Merry
5362ef270ab1SKenneth D. Merry /**
5363ef270ab1SKenneth D. Merry * @brief Local Reject Reason Codes.
5364ef270ab1SKenneth D. Merry */
5365ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_MISSING_CONTINUE 0x01
5366ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_SEQUENCE_TIMEOUT 0x02
5367ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_INTERNAL_ERROR 0x03
5368ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_INVALID_RPI 0x04
5369ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_NO_XRI 0x05
5370ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_ILLEGAL_COMMAND 0x06
5371ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_XCHG_DROPPED 0x07
5372ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_ILLEGAL_FIELD 0x08
5373ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_NO_ABORT_MATCH 0x0c
5374ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_TX_DMA_FAILED 0x0d
5375ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_RX_DMA_FAILED 0x0e
5376ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_ILLEGAL_FRAME 0x0f
5377ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_NO_RESOURCES 0x11
5378ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_FCP_CONF_FAILURE 0x12
5379ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_ILLEGAL_LENGTH 0x13
5380ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_UNSUPPORTED_FEATURE 0x14
5381ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_ABORT_IN_PROGRESS 0x15
5382ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_ABORT_REQUESTED 0x16
5383ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_RCV_BUFFER_TIMEOUT 0x17
5384ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_LOOP_OPEN_FAILURE 0x18
5385ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_LINK_DOWN 0x1a
5386ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_CORRUPTED_DATA 0x1b
5387ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_CORRUPTED_RPI 0x1c
5388ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_OUT_OF_ORDER_DATA 0x1d
5389ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_OUT_OF_ORDER_ACK 0x1e
5390ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_DUP_FRAME 0x1f
5391ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_LINK_CONTROL_FRAME 0x20
5392ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_BAD_HOST_ADDRESS 0x21
5393ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_MISSING_HDR_BUFFER 0x23
5394ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_MSEQ_CHAIN_CORRUPTED 0x24
5395ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_ABORTMULT_REQUESTED 0x25
5396ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_BUFFER_SHORTAGE 0x28
5397ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_RCV_XRIBUF_WAITING 0x29
5398ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_INVALID_VPI 0x2e
5399ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_MISSING_XRIBUF 0x30
5400ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_INVALID_RELOFFSET 0x40
5401ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_MISSING_RELOFFSET 0x41
5402ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_INSUFF_BUFFERSPACE 0x42
5403ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_MISSING_SI 0x43
5404ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_MISSING_ES 0x44
5405ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_INCOMPLETE_XFER 0x45
5406ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_SLER_FAILURE 0x46
5407ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_SLER_CMD_RCV_FAILURE 0x47
5408ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_SLER_REC_RJT_ERR 0x48
5409ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_SLER_REC_SRR_RETRY_ERR 0x49
5410ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_SLER_SRR_RJT_ERR 0x4a
5411ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_SLER_RRQ_RJT_ERR 0x4c
5412ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_SLER_RRQ_RETRY_ERR 0x4d
5413ef270ab1SKenneth D. Merry #define SLI4_FC_LOCAL_REJECT_SLER_ABTS_ERR 0x4e
5414ef270ab1SKenneth D. Merry
5415ef270ab1SKenneth D. Merry typedef struct sli4_fc_async_rcqe_s {
5416ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5417ef270ab1SKenneth D. Merry uint32_t :8,
5418ef270ab1SKenneth D. Merry status:8,
5419ef270ab1SKenneth D. Merry rq_element_index:12,
5420ef270ab1SKenneth D. Merry :4;
5421ef270ab1SKenneth D. Merry uint32_t rsvd1;
5422ef270ab1SKenneth D. Merry uint32_t fcfi:6,
5423ef270ab1SKenneth D. Merry rq_id:10,
5424ef270ab1SKenneth D. Merry payload_data_placement_length:16;
5425ef270ab1SKenneth D. Merry uint32_t sof_byte:8,
5426ef270ab1SKenneth D. Merry eof_byte:8,
5427ef270ab1SKenneth D. Merry code:8,
5428ef270ab1SKenneth D. Merry header_data_placement_length:6,
5429ef270ab1SKenneth D. Merry :1,
5430ef270ab1SKenneth D. Merry vld:1;
5431ef270ab1SKenneth D. Merry #else
5432ef270ab1SKenneth D. Merry #error big endian version not defined
5433ef270ab1SKenneth D. Merry #endif
5434ef270ab1SKenneth D. Merry } sli4_fc_async_rcqe_t;
5435ef270ab1SKenneth D. Merry
5436ef270ab1SKenneth D. Merry typedef struct sli4_fc_async_rcqe_v1_s {
5437ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5438ef270ab1SKenneth D. Merry uint32_t :8,
5439ef270ab1SKenneth D. Merry status:8,
5440ef270ab1SKenneth D. Merry rq_element_index:12,
5441ef270ab1SKenneth D. Merry :4;
5442ef270ab1SKenneth D. Merry uint32_t fcfi:6,
5443ef270ab1SKenneth D. Merry :26;
5444ef270ab1SKenneth D. Merry uint32_t rq_id:16,
5445ef270ab1SKenneth D. Merry payload_data_placement_length:16;
5446ef270ab1SKenneth D. Merry uint32_t sof_byte:8,
5447ef270ab1SKenneth D. Merry eof_byte:8,
5448ef270ab1SKenneth D. Merry code:8,
5449ef270ab1SKenneth D. Merry header_data_placement_length:6,
5450ef270ab1SKenneth D. Merry :1,
5451ef270ab1SKenneth D. Merry vld:1;
5452ef270ab1SKenneth D. Merry #else
5453ef270ab1SKenneth D. Merry #error big endian version not defined
5454ef270ab1SKenneth D. Merry #endif
5455ef270ab1SKenneth D. Merry } sli4_fc_async_rcqe_v1_t;
5456ef270ab1SKenneth D. Merry
5457ef270ab1SKenneth D. Merry #define SLI4_FC_ASYNC_RQ_SUCCESS 0x10
5458ef270ab1SKenneth D. Merry #define SLI4_FC_ASYNC_RQ_BUF_LEN_EXCEEDED 0x11
5459ef270ab1SKenneth D. Merry #define SLI4_FC_ASYNC_RQ_INSUFF_BUF_NEEDED 0x12
5460ef270ab1SKenneth D. Merry #define SLI4_FC_ASYNC_RQ_INSUFF_BUF_FRM_DISC 0x13
5461ef270ab1SKenneth D. Merry #define SLI4_FC_ASYNC_RQ_DMA_FAILURE 0x14
5462ef270ab1SKenneth D. Merry
5463ef270ab1SKenneth D. Merry typedef struct sli4_fc_coalescing_rcqe_s {
5464ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5465ef270ab1SKenneth D. Merry uint32_t :8,
5466ef270ab1SKenneth D. Merry status:8,
5467ef270ab1SKenneth D. Merry rq_element_index:12,
5468ef270ab1SKenneth D. Merry :4;
5469ef270ab1SKenneth D. Merry uint32_t rsvd1;
5470ef270ab1SKenneth D. Merry uint32_t rq_id:16,
5471ef270ab1SKenneth D. Merry sequence_reporting_placement_length:16;
5472ef270ab1SKenneth D. Merry uint32_t :16,
5473ef270ab1SKenneth D. Merry code:8,
5474ef270ab1SKenneth D. Merry :7,
5475ef270ab1SKenneth D. Merry vld:1;
5476ef270ab1SKenneth D. Merry #else
5477ef270ab1SKenneth D. Merry #error big endian version not defined
5478ef270ab1SKenneth D. Merry #endif
5479ef270ab1SKenneth D. Merry } sli4_fc_coalescing_rcqe_t;
5480ef270ab1SKenneth D. Merry
5481ef270ab1SKenneth D. Merry #define SLI4_FC_COALESCE_RQ_SUCCESS 0x10
5482ef270ab1SKenneth D. Merry #define SLI4_FC_COALESCE_RQ_INSUFF_XRI_NEEDED 0x18
5483ef270ab1SKenneth D. Merry
5484ef270ab1SKenneth D. Merry typedef struct sli4_fc_optimized_write_cmd_cqe_s {
5485ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5486ef270ab1SKenneth D. Merry uint32_t :8,
5487ef270ab1SKenneth D. Merry status:8,
5488ef270ab1SKenneth D. Merry rq_element_index:15,
5489ef270ab1SKenneth D. Merry iv:1;
5490ef270ab1SKenneth D. Merry uint32_t fcfi:6,
5491ef270ab1SKenneth D. Merry :8,
5492ef270ab1SKenneth D. Merry oox:1,
5493ef270ab1SKenneth D. Merry agxr:1,
5494ef270ab1SKenneth D. Merry xri:16;
5495ef270ab1SKenneth D. Merry uint32_t rq_id:16,
5496ef270ab1SKenneth D. Merry payload_data_placement_length:16;
5497ef270ab1SKenneth D. Merry uint32_t rpi:16,
5498ef270ab1SKenneth D. Merry code:8,
5499ef270ab1SKenneth D. Merry header_data_placement_length:6,
5500ef270ab1SKenneth D. Merry :1,
5501ef270ab1SKenneth D. Merry vld:1;
5502ef270ab1SKenneth D. Merry #else
5503ef270ab1SKenneth D. Merry #error big endian version not defined
5504ef270ab1SKenneth D. Merry #endif
5505ef270ab1SKenneth D. Merry } sli4_fc_optimized_write_cmd_cqe_t;
5506ef270ab1SKenneth D. Merry
5507ef270ab1SKenneth D. Merry typedef struct sli4_fc_optimized_write_data_cqe_s {
5508ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5509ef270ab1SKenneth D. Merry uint32_t hw_status:8,
5510ef270ab1SKenneth D. Merry status:8,
5511ef270ab1SKenneth D. Merry xri:16;
5512ef270ab1SKenneth D. Merry uint32_t total_data_placed;
5513ef270ab1SKenneth D. Merry uint32_t extended_status;
5514ef270ab1SKenneth D. Merry uint32_t :16,
5515ef270ab1SKenneth D. Merry code:8,
5516ef270ab1SKenneth D. Merry pri:3,
5517ef270ab1SKenneth D. Merry pv:1,
5518ef270ab1SKenneth D. Merry xb:1,
5519ef270ab1SKenneth D. Merry rha:1,
5520ef270ab1SKenneth D. Merry :1,
5521ef270ab1SKenneth D. Merry vld:1;
5522ef270ab1SKenneth D. Merry #else
5523ef270ab1SKenneth D. Merry #error big endian version not defined
5524ef270ab1SKenneth D. Merry #endif
5525ef270ab1SKenneth D. Merry } sli4_fc_optimized_write_data_cqe_t;
5526ef270ab1SKenneth D. Merry
5527ef270ab1SKenneth D. Merry typedef struct sli4_fc_xri_aborted_cqe_s {
5528ef270ab1SKenneth D. Merry #if BYTE_ORDER == LITTLE_ENDIAN
5529ef270ab1SKenneth D. Merry uint32_t :8,
5530ef270ab1SKenneth D. Merry status:8,
5531ef270ab1SKenneth D. Merry :16;
5532ef270ab1SKenneth D. Merry uint32_t extended_status;
5533ef270ab1SKenneth D. Merry uint32_t xri:16,
5534ef270ab1SKenneth D. Merry remote_xid:16;
5535ef270ab1SKenneth D. Merry uint32_t :16,
5536ef270ab1SKenneth D. Merry code:8,
5537ef270ab1SKenneth D. Merry xr:1,
5538ef270ab1SKenneth D. Merry :3,
5539ef270ab1SKenneth D. Merry eo:1,
5540ef270ab1SKenneth D. Merry br:1,
5541ef270ab1SKenneth D. Merry ia:1,
5542ef270ab1SKenneth D. Merry vld:1;
5543ef270ab1SKenneth D. Merry #else
5544ef270ab1SKenneth D. Merry #error big endian version not defined
5545ef270ab1SKenneth D. Merry #endif
5546ef270ab1SKenneth D. Merry } sli4_fc_xri_aborted_cqe_t;
5547ef270ab1SKenneth D. Merry
5548ef270ab1SKenneth D. Merry /**
5549ef270ab1SKenneth D. Merry * Code definitions applicable to all FC/FCoE CQE types.
5550ef270ab1SKenneth D. Merry */
5551ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_OFFSET 14
5552ef270ab1SKenneth D. Merry
5553ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_WORK_REQUEST_COMPLETION 0x01
5554ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_RELEASE_WQE 0x02
5555ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_RQ_ASYNC 0x04
5556ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_XRI_ABORTED 0x05
5557ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_RQ_COALESCING 0x06
5558ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_RQ_CONSUMPTION 0x07
5559ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_MEASUREMENT_REPORTING 0x08
5560ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_RQ_ASYNC_V1 0x09
5561ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_OPTIMIZED_WRITE_CMD 0x0B
5562ef270ab1SKenneth D. Merry #define SLI4_CQE_CODE_OPTIMIZED_WRITE_DATA 0x0C
5563ef270ab1SKenneth D. Merry
5564ef270ab1SKenneth D. Merry extern int32_t sli_fc_process_link_state(sli4_t *, void *);
5565ef270ab1SKenneth D. Merry extern int32_t sli_fc_process_link_attention(sli4_t *, void *);
5566ef270ab1SKenneth D. Merry extern int32_t sli_fc_cqe_parse(sli4_t *, sli4_queue_t *, uint8_t *, sli4_qentry_e *, uint16_t *);
5567ef270ab1SKenneth D. Merry extern uint32_t sli_fc_response_length(sli4_t *, uint8_t *);
5568ef270ab1SKenneth D. Merry extern uint32_t sli_fc_io_length(sli4_t *, uint8_t *);
5569ef270ab1SKenneth D. Merry extern int32_t sli_fc_els_did(sli4_t *, uint8_t *, uint32_t *);
5570ef270ab1SKenneth D. Merry extern uint32_t sli_fc_ext_status(sli4_t *, uint8_t *);
5571ef270ab1SKenneth D. Merry extern int32_t sli_fc_rqe_rqid_and_index(sli4_t *, uint8_t *, uint16_t *, uint32_t *);
5572ef270ab1SKenneth D. Merry extern int32_t sli_fc_process_fcoe(sli4_t *, void *);
5573ef270ab1SKenneth D. Merry extern int32_t sli_cmd_fcoe_wq_create(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t);
5574ef270ab1SKenneth D. Merry extern int32_t sli_cmd_fcoe_wq_create_v1(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t);
5575ef270ab1SKenneth D. Merry extern int32_t sli_cmd_fcoe_wq_destroy(sli4_t *, void *, size_t, uint16_t);
5576ef270ab1SKenneth D. Merry extern int32_t sli_cmd_fcoe_post_sgl_pages(sli4_t *, void *, size_t, uint16_t, uint32_t, ocs_dma_t **, ocs_dma_t **,
5577ef270ab1SKenneth D. Merry ocs_dma_t *);
5578ef270ab1SKenneth D. Merry extern int32_t sli_cmd_fcoe_rq_create(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t, uint16_t);
5579ef270ab1SKenneth D. Merry extern int32_t sli_cmd_fcoe_rq_create_v1(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t, uint16_t);
5580ef270ab1SKenneth D. Merry extern int32_t sli_cmd_fcoe_rq_destroy(sli4_t *, void *, size_t, uint16_t);
5581ef270ab1SKenneth D. Merry extern int32_t sli_cmd_fcoe_read_fcf_table(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t);
5582ef270ab1SKenneth D. Merry extern int32_t sli_cmd_fcoe_post_hdr_templates(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, ocs_dma_t *);
5583ef270ab1SKenneth D. Merry extern int32_t sli_cmd_fcoe_rediscover_fcf(sli4_t *, void *, size_t, uint16_t);
5584ef270ab1SKenneth D. Merry extern int32_t sli_fc_rq_alloc(sli4_t *, sli4_queue_t *, uint32_t, uint32_t, sli4_queue_t *, uint16_t, uint8_t);
5585ef270ab1SKenneth D. Merry 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);
5586ef270ab1SKenneth D. Merry extern uint32_t sli_fc_get_rpi_requirements(sli4_t *, uint32_t);
5587ef270ab1SKenneth D. Merry 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);
5588ef270ab1SKenneth D. Merry
5589ef270ab1SKenneth D. Merry 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 *);
5590ef270ab1SKenneth D. Merry 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);
5591ef270ab1SKenneth D. Merry 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);
5592ef270ab1SKenneth D. Merry 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);
5593ef270ab1SKenneth D. Merry
5594ef270ab1SKenneth D. Merry 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);
5595ef270ab1SKenneth D. Merry 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);
5596ef270ab1SKenneth D. Merry 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);
5597ef270ab1SKenneth D. Merry 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);
5598ef270ab1SKenneth D. Merry 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);
5599ef270ab1SKenneth D. Merry extern int32_t sli_send_frame_wqe(sli4_t *sli4, void *buf, size_t size, uint8_t sof, uint8_t eof, uint32_t *hdr,
5600ef270ab1SKenneth D. Merry ocs_dma_t *payload, uint32_t req_len, uint8_t timeout,
5601ef270ab1SKenneth D. Merry uint16_t xri, uint16_t req_tag);
5602ef270ab1SKenneth D. Merry 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);
5603ef270ab1SKenneth D. Merry 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);
5604ef270ab1SKenneth D. Merry 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);
5605ef270ab1SKenneth D. Merry 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);
5606ef270ab1SKenneth D. Merry extern int32_t sli_requeue_xri_wqe(sli4_t *, void *, size_t, uint16_t, uint16_t, uint16_t);
5607ef270ab1SKenneth D. Merry extern void sli4_cmd_lowlevel_set_watchdog(sli4_t *sli4, void *buf, size_t size, uint16_t timeout);
5608965e2154SRam Kishore Vegesna extern bool sli_persist_topology_enabled(sli4_t *sli4);
5609965e2154SRam Kishore Vegesna
5610ef270ab1SKenneth D. Merry
5611ef270ab1SKenneth D. Merry /**
5612ef270ab1SKenneth D. Merry * @ingroup sli_fc
5613ef270ab1SKenneth D. Merry * @brief Retrieve the received header and payload length.
5614ef270ab1SKenneth D. Merry *
5615ef270ab1SKenneth D. Merry * @param sli4 SLI context.
5616ef270ab1SKenneth D. Merry * @param cqe Pointer to the CQ entry.
5617ef270ab1SKenneth D. Merry * @param len_hdr Pointer where the header length is written.
5618ef270ab1SKenneth D. Merry * @param len_data Pointer where the payload length is written.
5619ef270ab1SKenneth D. Merry *
5620ef270ab1SKenneth D. Merry * @return Returns 0 on success, or a non-zero value on failure.
5621ef270ab1SKenneth D. Merry */
5622ef270ab1SKenneth D. Merry static inline int32_t
sli_fc_rqe_length(sli4_t * sli4,void * cqe,uint32_t * len_hdr,uint32_t * len_data)5623ef270ab1SKenneth D. Merry sli_fc_rqe_length(sli4_t *sli4, void *cqe, uint32_t *len_hdr, uint32_t *len_data)
5624ef270ab1SKenneth D. Merry {
5625ef270ab1SKenneth D. Merry sli4_fc_async_rcqe_t *rcqe = cqe;
5626ef270ab1SKenneth D. Merry
5627ef270ab1SKenneth D. Merry *len_hdr = *len_data = 0;
5628ef270ab1SKenneth D. Merry
5629ef270ab1SKenneth D. Merry if (SLI4_FC_ASYNC_RQ_SUCCESS == rcqe->status) {
5630ef270ab1SKenneth D. Merry *len_hdr = rcqe->header_data_placement_length;
5631ef270ab1SKenneth D. Merry *len_data = rcqe->payload_data_placement_length;
5632ef270ab1SKenneth D. Merry return 0;
5633ef270ab1SKenneth D. Merry } else {
5634ef270ab1SKenneth D. Merry return -1;
5635ef270ab1SKenneth D. Merry }
5636ef270ab1SKenneth D. Merry }
5637ef270ab1SKenneth D. Merry
5638ef270ab1SKenneth D. Merry /**
5639ef270ab1SKenneth D. Merry * @ingroup sli_fc
5640ef270ab1SKenneth D. Merry * @brief Retrieve the received FCFI.
5641ef270ab1SKenneth D. Merry *
5642ef270ab1SKenneth D. Merry * @param sli4 SLI context.
5643ef270ab1SKenneth D. Merry * @param cqe Pointer to the CQ entry.
5644ef270ab1SKenneth D. Merry *
5645ef270ab1SKenneth D. Merry * @return Returns the FCFI in the CQE. or UINT8_MAX if invalid CQE code.
5646ef270ab1SKenneth D. Merry */
5647ef270ab1SKenneth D. Merry static inline uint8_t
sli_fc_rqe_fcfi(sli4_t * sli4,void * cqe)5648ef270ab1SKenneth D. Merry sli_fc_rqe_fcfi(sli4_t *sli4, void *cqe)
5649ef270ab1SKenneth D. Merry {
5650ef270ab1SKenneth D. Merry uint8_t code = ((uint8_t*)cqe)[SLI4_CQE_CODE_OFFSET];
5651ef270ab1SKenneth D. Merry uint8_t fcfi = UINT8_MAX;
5652ef270ab1SKenneth D. Merry
5653ef270ab1SKenneth D. Merry switch(code) {
5654ef270ab1SKenneth D. Merry case SLI4_CQE_CODE_RQ_ASYNC: {
5655ef270ab1SKenneth D. Merry sli4_fc_async_rcqe_t *rcqe = cqe;
5656ef270ab1SKenneth D. Merry fcfi = rcqe->fcfi;
5657ef270ab1SKenneth D. Merry break;
5658ef270ab1SKenneth D. Merry }
5659ef270ab1SKenneth D. Merry case SLI4_CQE_CODE_RQ_ASYNC_V1: {
5660ef270ab1SKenneth D. Merry sli4_fc_async_rcqe_v1_t *rcqev1 = cqe;
5661ef270ab1SKenneth D. Merry fcfi = rcqev1->fcfi;
5662ef270ab1SKenneth D. Merry break;
5663ef270ab1SKenneth D. Merry }
5664ef270ab1SKenneth D. Merry case SLI4_CQE_CODE_OPTIMIZED_WRITE_CMD: {
5665ef270ab1SKenneth D. Merry sli4_fc_optimized_write_cmd_cqe_t *opt_wr = cqe;
5666ef270ab1SKenneth D. Merry fcfi = opt_wr->fcfi;
5667ef270ab1SKenneth D. Merry break;
5668ef270ab1SKenneth D. Merry }
5669ef270ab1SKenneth D. Merry }
5670ef270ab1SKenneth D. Merry
5671ef270ab1SKenneth D. Merry return fcfi;
5672ef270ab1SKenneth D. Merry }
5673ef270ab1SKenneth D. Merry
5674ef270ab1SKenneth D. Merry extern const char *sli_fc_get_status_string(uint32_t status);
5675ef270ab1SKenneth D. Merry
5676ef270ab1SKenneth D. Merry #endif /* !_SLI4_H */
5677