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