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