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