xref: /titanic_51/usr/src/uts/common/sys/nxge/nxge_ipp.h (revision 613a2f6ba31e891e3d947a356daf5e563d43c1ce)
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_NXGE_NXGE_IPP_H
27 #define	_SYS_NXGE_NXGE_IPP_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 #include <nxge_ipp_hw.h>
36 #include <npi_ipp.h>
37 
38 #define	IPP_MAX_PKT_SIZE	0x1FFFF
39 #define	IPP_MAX_ERR_SHOW	10
40 
41 typedef	struct _ipp_errlog {
42 	boolean_t		multiple_err;
43 	uint16_t		dfifo_rd_ptr;
44 	uint32_t		state_mach;
45 	uint16_t		ecc_syndrome;
46 } ipp_errlog_t, *p_ipp_errlog_t;
47 
48 typedef struct _nxge_ipp_stats {
49 	uint32_t 		errors;
50 	uint32_t 		inits;
51 	uint32_t 		sop_miss;
52 	uint32_t 		eop_miss;
53 	uint32_t 		dfifo_ue;
54 	uint32_t 		ecc_err_cnt;
55 	uint32_t 		pfifo_perr;
56 	uint32_t 		pfifo_over;
57 	uint32_t 		pfifo_und;
58 	uint32_t 		bad_cs_cnt;
59 	uint32_t 		pkt_dis_cnt;
60 	ipp_errlog_t		errlog;
61 } nxge_ipp_stats_t, *p_nxge_ipp_stats_t;
62 
63 typedef	struct _nxge_ipp {
64 	uint32_t		config;
65 	uint32_t		iconfig;
66 	ipp_status_t		status;
67 	uint32_t		max_pkt_size;
68 	nxge_ipp_stats_t	*stat;
69 } nxge_ipp_t;
70 
71 /* IPP prototypes */
72 nxge_status_t nxge_ipp_reset(p_nxge_t);
73 nxge_status_t nxge_ipp_init(p_nxge_t);
74 nxge_status_t nxge_ipp_disable(p_nxge_t);
75 nxge_status_t nxge_ipp_drain(p_nxge_t);
76 nxge_status_t nxge_ipp_handle_sys_errors(p_nxge_t);
77 nxge_status_t nxge_ipp_fatal_err_recover(p_nxge_t);
78 nxge_status_t nxge_ipp_eccue_valid_check(p_nxge_t, boolean_t *);
79 void nxge_ipp_inject_err(p_nxge_t, uint32_t);
80 
81 #ifdef	__cplusplus
82 }
83 #endif
84 
85 #endif	/* _SYS_NXGE_NXGE_IPP_H */
86