xref: /titanic_50/usr/src/uts/common/sys/nxge/nxge_ipp.h (revision 678453a8ed49104d8adad58f3ba591bdc39883e8)
16f45ec7bSml29623 /*
26f45ec7bSml29623  * CDDL HEADER START
36f45ec7bSml29623  *
46f45ec7bSml29623  * The contents of this file are subject to the terms of the
56f45ec7bSml29623  * Common Development and Distribution License (the "License").
66f45ec7bSml29623  * You may not use this file except in compliance with the License.
76f45ec7bSml29623  *
86f45ec7bSml29623  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96f45ec7bSml29623  * or http://www.opensolaris.org/os/licensing.
106f45ec7bSml29623  * See the License for the specific language governing permissions
116f45ec7bSml29623  * and limitations under the License.
126f45ec7bSml29623  *
136f45ec7bSml29623  * When distributing Covered Code, include this CDDL HEADER in each
146f45ec7bSml29623  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156f45ec7bSml29623  * If applicable, add the following below this CDDL HEADER, with the
166f45ec7bSml29623  * fields enclosed by brackets "[]" replaced with your own identifying
176f45ec7bSml29623  * information: Portions Copyright [yyyy] [name of copyright owner]
186f45ec7bSml29623  *
196f45ec7bSml29623  * CDDL HEADER END
206f45ec7bSml29623  */
216f45ec7bSml29623 /*
22*678453a8Sspeer  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
236f45ec7bSml29623  * Use is subject to license terms.
246f45ec7bSml29623  */
256f45ec7bSml29623 
266f45ec7bSml29623 #ifndef _SYS_NXGE_NXGE_IPP_H
276f45ec7bSml29623 #define	_SYS_NXGE_NXGE_IPP_H
286f45ec7bSml29623 
296f45ec7bSml29623 #pragma ident	"%Z%%M%	%I%	%E% SMI"
306f45ec7bSml29623 
316f45ec7bSml29623 #ifdef	__cplusplus
326f45ec7bSml29623 extern "C" {
336f45ec7bSml29623 #endif
346f45ec7bSml29623 
356f45ec7bSml29623 #include <nxge_ipp_hw.h>
366f45ec7bSml29623 #include <npi_ipp.h>
376f45ec7bSml29623 
386f45ec7bSml29623 #define	IPP_MAX_PKT_SIZE	0x1FFFF
396f45ec7bSml29623 #define	IPP_MAX_ERR_SHOW	10
406f45ec7bSml29623 
416f45ec7bSml29623 typedef	struct _ipp_errlog {
426f45ec7bSml29623 	boolean_t		multiple_err;
436f45ec7bSml29623 	uint16_t		dfifo_rd_ptr;
446f45ec7bSml29623 	uint32_t		state_mach;
456f45ec7bSml29623 	uint16_t		ecc_syndrome;
466f45ec7bSml29623 } ipp_errlog_t, *p_ipp_errlog_t;
476f45ec7bSml29623 
486f45ec7bSml29623 typedef struct _nxge_ipp_stats {
496f45ec7bSml29623 	uint32_t 		errors;
506f45ec7bSml29623 	uint32_t 		inits;
516f45ec7bSml29623 	uint32_t 		sop_miss;
526f45ec7bSml29623 	uint32_t 		eop_miss;
536f45ec7bSml29623 	uint32_t 		dfifo_ue;
546f45ec7bSml29623 	uint32_t 		ecc_err_cnt;
556f45ec7bSml29623 	uint32_t 		pfifo_perr;
566f45ec7bSml29623 	uint32_t 		pfifo_over;
576f45ec7bSml29623 	uint32_t 		pfifo_und;
586f45ec7bSml29623 	uint32_t 		bad_cs_cnt;
596f45ec7bSml29623 	uint32_t 		pkt_dis_cnt;
606f45ec7bSml29623 	ipp_errlog_t		errlog;
616f45ec7bSml29623 } nxge_ipp_stats_t, *p_nxge_ipp_stats_t;
626f45ec7bSml29623 
636f45ec7bSml29623 typedef	struct _nxge_ipp {
646f45ec7bSml29623 	uint32_t		config;
656f45ec7bSml29623 	uint32_t		iconfig;
666f45ec7bSml29623 	ipp_status_t		status;
676f45ec7bSml29623 	uint32_t		max_pkt_size;
686f45ec7bSml29623 	nxge_ipp_stats_t	*stat;
696f45ec7bSml29623 } nxge_ipp_t;
706f45ec7bSml29623 
716f45ec7bSml29623 /* IPP prototypes */
726f45ec7bSml29623 nxge_status_t nxge_ipp_reset(p_nxge_t);
736f45ec7bSml29623 nxge_status_t nxge_ipp_init(p_nxge_t);
746f45ec7bSml29623 nxge_status_t nxge_ipp_disable(p_nxge_t);
75*678453a8Sspeer nxge_status_t nxge_ipp_drain(p_nxge_t);
766f45ec7bSml29623 nxge_status_t nxge_ipp_handle_sys_errors(p_nxge_t);
776f45ec7bSml29623 nxge_status_t nxge_ipp_fatal_err_recover(p_nxge_t);
786f45ec7bSml29623 nxge_status_t nxge_ipp_eccue_valid_check(p_nxge_t, boolean_t *);
796f45ec7bSml29623 void nxge_ipp_inject_err(p_nxge_t, uint32_t);
806f45ec7bSml29623 
816f45ec7bSml29623 #ifdef	__cplusplus
826f45ec7bSml29623 }
836f45ec7bSml29623 #endif
846f45ec7bSml29623 
856f45ec7bSml29623 #endif	/* _SYS_NXGE_NXGE_IPP_H */
86