xref: /titanic_50/usr/src/uts/common/io/hxge/hxge_fm.h (revision ff3124eff995e6cd8ebd8c6543648e0670920034)
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 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_HXGE_HXGE_FM_H
27 #define	_SYS_HXGE_HXGE_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_DCHAN		"dma channel number"
39 #define	ERNAME_PFC_TCAM_ERR		"pfc tcam error"
40 #define	ERNAME_PFC_VLAN_ERR		"pfc vlan table error"
41 #define	ERNAME_PFC_PKT_DROP		"pfc pkt drop error"
42 #define	ERNAME_RDMC_PAR_ERR_LOG		"rdmc parity error log"
43 #define	ERNAME_RDC_ERR_TYPE		"completion error type"
44 #define	ERNAME_TDC_PREF_PAR_LOG		"tdc pref par log"
45 
46 #define	EREPORT_FM_ID_SHIFT		16
47 #define	EREPORT_FM_ID_MASK		0xFF
48 #define	EREPORT_INDEX_MASK		0xFF
49 #define	HXGE_FM_EREPORT_UNKNOWN		0
50 
51 #define	FM_SW_ID			0xFF
52 #define	FM_VMAC_ID			VMAC_BLK_ID
53 #define	FM_TXDMA_ID			TXDMA_BLK_ID
54 #define	FM_RXDMA_ID			RXDMA_BLK_ID
55 #define	FM_PFC_ID			PFC_BLK_ID
56 #define	FM_PEU_ID			PEU_BLK_ID
57 
58 typedef	uint32_t hxge_fm_ereport_id_t;
59 
60 typedef	struct _hxge_fm_ereport_attr {
61 	uint32_t		index;
62 	char			*str;
63 	char			*eclass;
64 	ddi_fault_impact_t	impact;
65 } hxge_fm_ereport_attr_t;
66 
67 /* VMAC ereports */
68 typedef	enum {
69 	HXGE_FM_EREPORT_VMAC_LINK_DOWN = (FM_VMAC_ID << EREPORT_FM_ID_SHIFT),
70 } hxge_fm_ereport_vmac_t;
71 
72 /* PFC ereports */
73 typedef	enum {
74 	HXGE_FM_EREPORT_PFC_TCAM_PAR_ERR = (FM_PFC_ID << EREPORT_FM_ID_SHIFT),
75 	HXGE_FM_EREPORT_PFC_VLAN_PAR_ERR,
76 	HXGE_FM_EREPORT_PFC_PKT_DROP
77 } hxge_fm_ereport_pfc_t;
78 
79 /* RDMC ereports */
80 typedef	enum {
81 	HXGE_FM_EREPORT_RDMC_RBR_CPL_TO = (FM_RXDMA_ID << EREPORT_FM_ID_SHIFT),
82 	HXGE_FM_EREPORT_RDMC_PEU_RESP_ERR,
83 	HXGE_FM_EREPORT_RDMC_RCR_SHA_PAR,
84 	HXGE_FM_EREPORT_RDMC_RBR_PRE_PAR,
85 	HXGE_FM_EREPORT_RDMC_RBR_PRE_EMPTY,
86 	HXGE_FM_EREPORT_RDMC_RCR_SHA_FULL,
87 	HXGE_FM_EREPORT_RDMC_RCRFULL,
88 	HXGE_FM_EREPORT_RDMC_RBR_EMPTY,
89 	HXGE_FM_EREPORT_RDMC_RBRFULL,
90 	HXGE_FM_EREPORT_RDMC_RCR_ERR,
91 	HXGE_FM_EREPORT_RDMC_CTRL_FIFO_DED,
92 	HXGE_FM_EREPORT_RDMC_DATA_FIFO_DED,
93 	HXGE_FM_EREPORT_RDMC_CTRL_FIFO_SEC,
94 	HXGE_FM_EREPORT_RDMC_DATA_FIFO_SEC
95 } hxge_fm_ereport_rdmc_t;
96 
97 typedef	enum {
98 	HXGE_FM_EREPORT_TDMC_PEU_RESP_ERR =
99 		(FM_TXDMA_ID << EREPORT_FM_ID_SHIFT),
100 	HXGE_FM_EREPORT_TDMC_PKT_SIZE_HDR_ERR,
101 	HXGE_FM_EREPORT_TDMC_RUNT_PKT_DROP_ERR,
102 	HXGE_FM_EREPORT_TDMC_PKT_SIZE_ERR,
103 	HXGE_FM_EREPORT_TDMC_TX_RNG_OFLOW,
104 	HXGE_FM_EREPORT_TDMC_PREF_PAR_ERR,
105 	HXGE_FM_EREPORT_TDMC_TDR_PREF_CPL_TO,
106 	HXGE_FM_EREPORT_TDMC_PKT_CPL_TO,
107 	HXGE_FM_EREPORT_TDMC_INVALID_SOP,
108 	HXGE_FM_EREPORT_TDMC_UNEXPECTED_SOP,
109 	HXGE_FM_EREPORT_TDMC_REORD_TBL_PAR,
110 	HXGE_FM_EREPORT_TDMC_REORD_BUF_DED
111 } hxge_fm_ereport_attr_tdmc_t;
112 
113 /* PEU ereports */
114 typedef	enum {
115 	HXGE_FM_EREPORT_PEU_ERR = (FM_PEU_ID << EREPORT_FM_ID_SHIFT),
116 	HXGE_FM_EREPORT_PEU_VNM_PIO_ERR
117 } hxge_fm_ereport_peu_t;
118 
119 typedef	enum {
120 	HXGE_FM_EREPORT_SW_INVALID_CHAN_NUM = (FM_SW_ID << EREPORT_FM_ID_SHIFT),
121 	HXGE_FM_EREPORT_SW_INVALID_PARAM
122 } hxge_fm_ereport_sw_t;
123 
124 
125 #ifdef	__cplusplus
126 }
127 #endif
128 
129 #endif	/* _SYS_HXGE_HXGE_FM_H */
130