xref: /illumos-gate/usr/src/uts/common/sys/nxge/nxge_fm.h (revision ee5416c9d7e449233197d5d20bc6b81e4ff091b2)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_NXGE_NXGE_FM_H
27 #define	_SYS_NXGE_NXGE_FM_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 #include <sys/ddi.h>
36 
37 #define	ERNAME_DETAILED_ERR_TYPE	"detailed error type"
38 #define	ERNAME_ERR_PORTN		"port number"
39 #define	ERNAME_ERR_DCHAN		"dma channel number"
40 #define	ERNAME_TCAM_ERR_LOG		"tcam error log"
41 #define	ERNAME_VLANTAB_ERR_LOG		"vlan table error log"
42 #define	ERNAME_HASHTAB_ERR_LOG		"hash table error log"
43 #define	ERNAME_HASHT_LOOKUP_ERR_LOG0	"hash table lookup error log0"
44 #define	ERNAME_HASHT_LOOKUP_ERR_LOG1	"hash table lookup error log1"
45 #define	ERNAME_RDMC_PAR_ERR_LOG		"rdmc parity error log"
46 #define	ERNAME_DFIFO_RD_PTR		"dfifo read pointer"
47 #define	ERNAME_IPP_STATE_MACH		"ipp state machine"
48 #define	ERNAME_DFIFO_ENTRY		"dfifo entry"
49 #define	ERNAME_DFIFO_SYNDROME		"dfifo syndrome"
50 #define	ERNAME_PFIFO_ENTRY		"pfifo entry"
51 #define	ERNAME_ZCP_STATE_MACH		"zcp state machine"
52 #define	ERNAME_CFIFO_PORT_NUM		"cfifo port number"
53 #define	ERNAME_RDC_ERR_TYPE		"completion error type"
54 #define	ERNAME_TDMC_ERR_LOG0		"tdmc error log0"
55 #define	ERNAME_TDMC_ERR_LOG1		"tdmc error log1"
56 #define	ERNAME_TXC_ROECC_ADDR		"txc reorder FIFO ECC error address"
57 #define	ERNAME_TXC_ROECC_DATA0		"txc reorder FIFO data0"
58 #define	ERNAME_TXC_ROECC_DATA1		"txc reorder FIFO data1"
59 #define	ERNAME_TXC_ROECC_DATA2		"txc reorder FIFO data2"
60 #define	ERNAME_TXC_ROECC_DATA3		"txc reorder FIFO data3"
61 #define	ERNAME_TXC_ROECC_DATA4		"txc reorder FIFO data4"
62 #define	ERNAME_TXC_RO_STATE0		"txc reorder FIFO error state0" \
63 					"(duplicate TID)"
64 #define	ERNAME_TXC_RO_STATE1		"txc reorder FIFO error state1" \
65 					"(uninitialized TID)"
66 #define	ERNAME_TXC_RO_STATE2		"txc reorder FIFO error state2" \
67 					"(timed out TIDs)"
68 #define	ERNAME_TXC_RO_STATE3		"txc reorder FIFO error state3"
69 #define	ERNAME_TXC_RO_STATE_CTL		"txc reorder FIFO error control"
70 #define	ERNAME_TXC_RO_TIDS		"txc reorder tids"
71 #define	ERNAME_TXC_SFECC_ADDR		"txc store forward FIFO ECC error "\
72 					"address"
73 #define	ERNAME_TXC_SFECC_DATA0		"txc store forward FIFO data0"
74 #define	ERNAME_TXC_SFECC_DATA1		"txc store forward FIFO data1"
75 #define	ERNAME_TXC_SFECC_DATA2		"txc store forward FIFO data2"
76 #define	ERNAME_TXC_SFECC_DATA3		"txc store forward FIFO data3"
77 #define	ERNAME_TXC_SFECC_DATA4		"txc store forward FIFO data4"
78 
79 #define	EREPORT_FM_ID_SHIFT		16
80 #define	EREPORT_FM_ID_MASK		0xFF
81 #define	EREPORT_INDEX_MASK		0xFF
82 #define	NXGE_FM_EREPORT_UNKNOWN		0
83 
84 /* xaui and xfp ereport definitions */
85 #define	NXGE_FM_DEVICE_XAUI_ERR		"nxge.xaui-err"
86 #define	NXGE_FM_DEVICE_XFP_ERR		"nxge.xfp-err"
87 
88 #define	FM_SW_ID			0xFF
89 #define	FM_PCS_ID			MAC_BLK_ID
90 #define	FM_TXMAC_ID			TXMAC_BLK_ID
91 #define	FM_RXMAC_ID			RXMAC_BLK_ID
92 #define	FM_MIF_ID			MIF_BLK_ID
93 #define	FM_IPP_ID			IPP_BLK_ID
94 #define	FM_TXC_ID			TXC_BLK_ID
95 #define	FM_TXDMA_ID			TXDMA_BLK_ID
96 #define	FM_RXDMA_ID			RXDMA_BLK_ID
97 #define	FM_ZCP_ID			ZCP_BLK_ID
98 #define	FM_ESPC_ID			ESPC_BLK_ID
99 #define	FM_FFLP_ID			FFLP_BLK_ID
100 #define	FM_PCIE_ID			PCIE_BLK_ID
101 #define	FM_ETHER_SERDES_ID		ETHER_SERDES_BLK_ID
102 #define	FM_PCIE_SERDES_ID		PCIE_SERDES_BLK_ID
103 #define	FM_VIR_ID			VIR_BLK_ID
104 #define	FM_XAUI_ID			XAUI_BLK_ID
105 #define	FM_XFP_ID			XFP_BLK_ID
106 
107 typedef	uint32_t nxge_fm_ereport_id_t;
108 
109 typedef	struct _nxge_fm_ereport_attr {
110 	uint32_t		index;
111 	char			*str;
112 	char			*eclass;
113 	ddi_fault_impact_t	impact;
114 } nxge_fm_ereport_attr_t;
115 
116 /* General MAC ereports */
117 typedef	enum {
118 	NXGE_FM_EREPORT_XPCS_LINK_DOWN = (FM_PCS_ID << EREPORT_FM_ID_SHIFT),
119 	NXGE_FM_EREPORT_XPCS_TX_LINK_FAULT,
120 	NXGE_FM_EREPORT_XPCS_RX_LINK_FAULT,
121 	NXGE_FM_EREPORT_PCS_LINK_DOWN,
122 	NXGE_FM_EREPORT_PCS_REMOTE_FAULT
123 } nxge_fm_ereport_pcs_t;
124 
125 /* MIF ereports */
126 typedef	enum {
127 	NXGE_FM_EREPORT_MIF_ACCESS_FAIL = (FM_MIF_ID << EREPORT_FM_ID_SHIFT)
128 } nxge_fm_ereport_mif_t;
129 
130 /* FFLP ereports */
131 typedef	enum {
132 	NXGE_FM_EREPORT_FFLP_TCAM_ERR = (FM_FFLP_ID << EREPORT_FM_ID_SHIFT),
133 	NXGE_FM_EREPORT_FFLP_VLAN_PAR_ERR,
134 	NXGE_FM_EREPORT_FFLP_HASHT_DATA_ERR,
135 	NXGE_FM_EREPORT_FFLP_HASHT_LOOKUP_ERR,
136 	NXGE_FM_EREPORT_FFLP_ACCESS_FAIL
137 } nxge_fm_ereport_fflp_t;
138 
139 /* IPP ereports */
140 typedef	enum {
141 	NXGE_FM_EREPORT_IPP_EOP_MISS = (FM_IPP_ID << EREPORT_FM_ID_SHIFT),
142 	NXGE_FM_EREPORT_IPP_SOP_MISS,
143 	NXGE_FM_EREPORT_IPP_DFIFO_UE,
144 	NXGE_FM_EREPORT_IPP_DFIFO_CE,
145 	NXGE_FM_EREPORT_IPP_PFIFO_PERR,
146 	NXGE_FM_EREPORT_IPP_ECC_ERR_MAX,
147 	NXGE_FM_EREPORT_IPP_PFIFO_OVER,
148 	NXGE_FM_EREPORT_IPP_PFIFO_UND,
149 	NXGE_FM_EREPORT_IPP_BAD_CS_MX,
150 	NXGE_FM_EREPORT_IPP_PKT_DIS_MX,
151 	NXGE_FM_EREPORT_IPP_RESET_FAIL
152 } nxge_fm_ereport_ipp_t;
153 
154 /* RDMC ereports */
155 typedef	enum {
156 	NXGE_FM_EREPORT_RDMC_DCF_ERR = (FM_RXDMA_ID << EREPORT_FM_ID_SHIFT),
157 	NXGE_FM_EREPORT_RDMC_RCR_ACK_ERR,
158 	NXGE_FM_EREPORT_RDMC_DC_FIFO_ERR,
159 	NXGE_FM_EREPORT_RDMC_RCR_SHA_PAR,
160 	NXGE_FM_EREPORT_RDMC_RBR_PRE_PAR,
161 	NXGE_FM_EREPORT_RDMC_RBR_TMOUT,
162 	NXGE_FM_EREPORT_RDMC_RSP_CNT_ERR,
163 	NXGE_FM_EREPORT_RDMC_BYTE_EN_BUS,
164 	NXGE_FM_EREPORT_RDMC_RSP_DAT_ERR,
165 	NXGE_FM_EREPORT_RDMC_ID_MISMATCH,
166 	NXGE_FM_EREPORT_RDMC_ZCP_EOP_ERR,
167 	NXGE_FM_EREPORT_RDMC_IPP_EOP_ERR,
168 	NXGE_FM_EREPORT_RDMC_COMPLETION_ERR,
169 	NXGE_FM_EREPORT_RDMC_CONFIG_ERR,
170 	NXGE_FM_EREPORT_RDMC_RCRINCON,
171 	NXGE_FM_EREPORT_RDMC_RCRFULL,
172 	NXGE_FM_EREPORT_RDMC_RBRFULL,
173 	NXGE_FM_EREPORT_RDMC_RBRLOGPAGE,
174 	NXGE_FM_EREPORT_RDMC_CFIGLOGPAGE
175 } nxge_fm_ereport_rdmc_t;
176 
177 /* ZCP ereports */
178 typedef	enum {
179 	NXGE_FM_EREPORT_ZCP_RRFIFO_UNDERRUN =
180 					(FM_ZCP_ID << EREPORT_FM_ID_SHIFT),
181 	NXGE_FM_EREPORT_ZCP_RSPFIFO_UNCORR_ERR,
182 	NXGE_FM_EREPORT_ZCP_STAT_TBL_PERR,
183 	NXGE_FM_EREPORT_ZCP_DYN_TBL_PERR,
184 	NXGE_FM_EREPORT_ZCP_BUF_TBL_PERR,
185 	NXGE_FM_EREPORT_ZCP_CFIFO_ECC,
186 	NXGE_FM_EREPORT_ZCP_RRFIFO_OVERRUN,
187 	NXGE_FM_EREPORT_ZCP_BUFFER_OVERFLOW,
188 	NXGE_FM_EREPORT_ZCP_TT_PROGRAM_ERR,
189 	NXGE_FM_EREPORT_ZCP_RSP_TT_INDEX_ERR,
190 	NXGE_FM_EREPORT_ZCP_SLV_TT_INDEX_ERR,
191 	NXGE_FM_EREPORT_ZCP_TT_INDEX_ERR,
192 	NXGE_FM_EREPORT_ZCP_ACCESS_FAIL
193 } nxge_fm_ereport_zcp_t;
194 
195 typedef enum {
196 	NXGE_FM_EREPORT_RXMAC_UNDERFLOW = (FM_RXMAC_ID << EREPORT_FM_ID_SHIFT),
197 	NXGE_FM_EREPORT_RXMAC_CRC_ERRCNT_EXP,
198 	NXGE_FM_EREPORT_RXMAC_LENGTH_ERRCNT_EXP,
199 	NXGE_FM_EREPORT_RXMAC_VIOL_ERRCNT_EXP,
200 	NXGE_FM_EREPORT_RXMAC_RXFRAG_CNT_EXP,
201 	NXGE_FM_EREPORT_RXMAC_ALIGN_ECNT_EXP,
202 	NXGE_FM_EREPORT_RXMAC_LINKFAULT_CNT_EXP,
203 	NXGE_FM_EREPORT_RXMAC_RESET_FAIL
204 } nxge_fm_ereport_rxmac_t;
205 
206 typedef	enum {
207 	NXGE_FM_EREPORT_TDMC_PREF_BUF_PAR_ERR =
208 				(FM_TXDMA_ID << EREPORT_FM_ID_SHIFT),
209 	NXGE_FM_EREPORT_TDMC_MBOX_ERR,
210 	NXGE_FM_EREPORT_TDMC_NACK_PREF,
211 	NXGE_FM_EREPORT_TDMC_NACK_PKT_RD,
212 	NXGE_FM_EREPORT_TDMC_PKT_SIZE_ERR,
213 	NXGE_FM_EREPORT_TDMC_TX_RING_OFLOW,
214 	NXGE_FM_EREPORT_TDMC_CONF_PART_ERR,
215 	NXGE_FM_EREPORT_TDMC_PKT_PRT_ERR,
216 	NXGE_FM_EREPORT_TDMC_RESET_FAIL
217 } nxge_fm_ereport_attr_tdmc_t;
218 
219 typedef	enum {
220 	NXGE_FM_EREPORT_TXC_RO_CORRECT_ERR =
221 				(FM_TXC_ID << EREPORT_FM_ID_SHIFT),
222 	NXGE_FM_EREPORT_TXC_RO_UNCORRECT_ERR,
223 	NXGE_FM_EREPORT_TXC_SF_CORRECT_ERR,
224 	NXGE_FM_EREPORT_TXC_SF_UNCORRECT_ERR,
225 	NXGE_FM_EREPORT_TXC_ASSY_DEAD,
226 	NXGE_FM_EREPORT_TXC_REORDER_ERR
227 } nxge_fm_ereport_attr_txc_t;
228 
229 typedef	enum {
230 	NXGE_FM_EREPORT_TXMAC_UNDERFLOW =
231 				(FM_TXMAC_ID << EREPORT_FM_ID_SHIFT),
232 	NXGE_FM_EREPORT_TXMAC_OVERFLOW,
233 	NXGE_FM_EREPORT_TXMAC_TXFIFO_XFR_ERR,
234 	NXGE_FM_EREPORT_TXMAC_MAX_PKT_ERR,
235 	NXGE_FM_EREPORT_TXMAC_RESET_FAIL
236 } nxge_fm_ereport_attr_txmac_t;
237 
238 typedef	enum {
239 	NXGE_FM_EREPORT_ESPC_ACCESS_FAIL = (FM_ESPC_ID << EREPORT_FM_ID_SHIFT)
240 } nxge_fm_ereport_espc_t;
241 
242 typedef	enum {
243 	NXGE_FM_EREPORT_SW_INVALID_PORT_NUM = (FM_SW_ID << EREPORT_FM_ID_SHIFT),
244 	NXGE_FM_EREPORT_SW_INVALID_CHAN_NUM,
245 	NXGE_FM_EREPORT_SW_INVALID_PARAM
246 } nxge_fm_ereport_sw_t;
247 
248 /* XAUI is broken or missing */
249 typedef	enum {
250 	NXGE_FM_EREPORT_XAUI_ERR = (FM_XAUI_ID << EREPORT_FM_ID_SHIFT)
251 } nxge_fm_ereport_xaui_t;
252 
253 /* XFP optical module is broken or missing */
254 typedef	enum {
255 	NXGE_FM_EREPORT_XFP_ERR = (FM_XFP_ID << EREPORT_FM_ID_SHIFT)
256 } nxge_fm_ereport_xfp_t;
257 
258 #define	NXGE_FM_EREPORT_UNKNOWN			0
259 #define	NXGE_FM_EREPORT_UNKNOWN_NAME		""
260 
261 #ifdef	__cplusplus
262 }
263 #endif
264 
265 #endif	/* _SYS_NXGE_NXGE_FM_H */
266