xref: /illumos-gate/usr/src/uts/common/sys/nxge/nxge_ipp.h (revision 2d6eb4a5)
144961713Sgirish /*
244961713Sgirish  * CDDL HEADER START
344961713Sgirish  *
444961713Sgirish  * The contents of this file are subject to the terms of the
544961713Sgirish  * Common Development and Distribution License (the "License").
644961713Sgirish  * You may not use this file except in compliance with the License.
744961713Sgirish  *
844961713Sgirish  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
944961713Sgirish  * or http://www.opensolaris.org/os/licensing.
1044961713Sgirish  * See the License for the specific language governing permissions
1144961713Sgirish  * and limitations under the License.
1244961713Sgirish  *
1344961713Sgirish  * When distributing Covered Code, include this CDDL HEADER in each
1444961713Sgirish  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1544961713Sgirish  * If applicable, add the following below this CDDL HEADER, with the
1644961713Sgirish  * fields enclosed by brackets "[]" replaced with your own identifying
1744961713Sgirish  * information: Portions Copyright [yyyy] [name of copyright owner]
1844961713Sgirish  *
1944961713Sgirish  * CDDL HEADER END
2044961713Sgirish  */
2144961713Sgirish /*
22*678453a8Sspeer  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
2344961713Sgirish  * Use is subject to license terms.
2444961713Sgirish  */
2544961713Sgirish 
2644961713Sgirish #ifndef _SYS_NXGE_NXGE_IPP_H
2744961713Sgirish #define	_SYS_NXGE_NXGE_IPP_H
2844961713Sgirish 
2944961713Sgirish #ifdef	__cplusplus
3044961713Sgirish extern "C" {
3144961713Sgirish #endif
3244961713Sgirish 
3344961713Sgirish #include <nxge_ipp_hw.h>
3444961713Sgirish #include <npi_ipp.h>
3544961713Sgirish 
3644961713Sgirish #define	IPP_MAX_PKT_SIZE	0x1FFFF
3744961713Sgirish #define	IPP_MAX_ERR_SHOW	10
3844961713Sgirish 
3944961713Sgirish typedef	struct _ipp_errlog {
4044961713Sgirish 	boolean_t		multiple_err;
4144961713Sgirish 	uint16_t		dfifo_rd_ptr;
4244961713Sgirish 	uint32_t		state_mach;
4344961713Sgirish 	uint16_t		ecc_syndrome;
4444961713Sgirish } ipp_errlog_t, *p_ipp_errlog_t;
4544961713Sgirish 
4644961713Sgirish typedef struct _nxge_ipp_stats {
4744961713Sgirish 	uint32_t 		errors;
4844961713Sgirish 	uint32_t 		inits;
4944961713Sgirish 	uint32_t 		sop_miss;
5044961713Sgirish 	uint32_t 		eop_miss;
5144961713Sgirish 	uint32_t 		dfifo_ue;
5244961713Sgirish 	uint32_t 		ecc_err_cnt;
5344961713Sgirish 	uint32_t 		pfifo_perr;
5444961713Sgirish 	uint32_t 		pfifo_over;
5544961713Sgirish 	uint32_t 		pfifo_und;
5644961713Sgirish 	uint32_t 		bad_cs_cnt;
5744961713Sgirish 	uint32_t 		pkt_dis_cnt;
5844961713Sgirish 	ipp_errlog_t		errlog;
5944961713Sgirish } nxge_ipp_stats_t, *p_nxge_ipp_stats_t;
6044961713Sgirish 
6144961713Sgirish typedef	struct _nxge_ipp {
6244961713Sgirish 	uint32_t		config;
6344961713Sgirish 	uint32_t		iconfig;
6444961713Sgirish 	ipp_status_t		status;
6544961713Sgirish 	uint32_t		max_pkt_size;
6644961713Sgirish 	nxge_ipp_stats_t	*stat;
6744961713Sgirish } nxge_ipp_t;
6844961713Sgirish 
6944961713Sgirish /* IPP prototypes */
7044961713Sgirish nxge_status_t nxge_ipp_reset(p_nxge_t);
7144961713Sgirish nxge_status_t nxge_ipp_init(p_nxge_t);
7244961713Sgirish nxge_status_t nxge_ipp_disable(p_nxge_t);
73*678453a8Sspeer nxge_status_t nxge_ipp_drain(p_nxge_t);
7444961713Sgirish nxge_status_t nxge_ipp_handle_sys_errors(p_nxge_t);
7544961713Sgirish nxge_status_t nxge_ipp_fatal_err_recover(p_nxge_t);
7614ea4bb7Ssd nxge_status_t nxge_ipp_eccue_valid_check(p_nxge_t, boolean_t *);
7744961713Sgirish void nxge_ipp_inject_err(p_nxge_t, uint32_t);
7844961713Sgirish 
7944961713Sgirish #ifdef	__cplusplus
8044961713Sgirish }
8144961713Sgirish #endif
8244961713Sgirish 
8344961713Sgirish #endif	/* _SYS_NXGE_NXGE_IPP_H */
84