xref: /onnv-gate/usr/src/uts/common/sys/nxge/nxge_ipp.h (revision 6495:1a95fa8c7c94)
13859Sml29623 /*
23859Sml29623  * CDDL HEADER START
33859Sml29623  *
43859Sml29623  * The contents of this file are subject to the terms of the
53859Sml29623  * Common Development and Distribution License (the "License").
63859Sml29623  * You may not use this file except in compliance with the License.
73859Sml29623  *
83859Sml29623  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93859Sml29623  * or http://www.opensolaris.org/os/licensing.
103859Sml29623  * See the License for the specific language governing permissions
113859Sml29623  * and limitations under the License.
123859Sml29623  *
133859Sml29623  * When distributing Covered Code, include this CDDL HEADER in each
143859Sml29623  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153859Sml29623  * If applicable, add the following below this CDDL HEADER, with the
163859Sml29623  * fields enclosed by brackets "[]" replaced with your own identifying
173859Sml29623  * information: Portions Copyright [yyyy] [name of copyright owner]
183859Sml29623  *
193859Sml29623  * CDDL HEADER END
203859Sml29623  */
213859Sml29623 /*
22*6495Sspeer  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
233859Sml29623  * Use is subject to license terms.
243859Sml29623  */
253859Sml29623 
263859Sml29623 #ifndef _SYS_NXGE_NXGE_IPP_H
273859Sml29623 #define	_SYS_NXGE_NXGE_IPP_H
283859Sml29623 
293859Sml29623 #pragma ident	"%Z%%M%	%I%	%E% SMI"
303859Sml29623 
313859Sml29623 #ifdef	__cplusplus
323859Sml29623 extern "C" {
333859Sml29623 #endif
343859Sml29623 
353859Sml29623 #include <nxge_ipp_hw.h>
363859Sml29623 #include <npi_ipp.h>
373859Sml29623 
383859Sml29623 #define	IPP_MAX_PKT_SIZE	0x1FFFF
393859Sml29623 #define	IPP_MAX_ERR_SHOW	10
403859Sml29623 
413859Sml29623 typedef	struct _ipp_errlog {
423859Sml29623 	boolean_t		multiple_err;
433859Sml29623 	uint16_t		dfifo_rd_ptr;
443859Sml29623 	uint32_t		state_mach;
453859Sml29623 	uint16_t		ecc_syndrome;
463859Sml29623 } ipp_errlog_t, *p_ipp_errlog_t;
473859Sml29623 
483859Sml29623 typedef struct _nxge_ipp_stats {
493859Sml29623 	uint32_t 		errors;
503859Sml29623 	uint32_t 		inits;
513859Sml29623 	uint32_t 		sop_miss;
523859Sml29623 	uint32_t 		eop_miss;
533859Sml29623 	uint32_t 		dfifo_ue;
543859Sml29623 	uint32_t 		ecc_err_cnt;
553859Sml29623 	uint32_t 		pfifo_perr;
563859Sml29623 	uint32_t 		pfifo_over;
573859Sml29623 	uint32_t 		pfifo_und;
583859Sml29623 	uint32_t 		bad_cs_cnt;
593859Sml29623 	uint32_t 		pkt_dis_cnt;
603859Sml29623 	ipp_errlog_t		errlog;
613859Sml29623 } nxge_ipp_stats_t, *p_nxge_ipp_stats_t;
623859Sml29623 
633859Sml29623 typedef	struct _nxge_ipp {
643859Sml29623 	uint32_t		config;
653859Sml29623 	uint32_t		iconfig;
663859Sml29623 	ipp_status_t		status;
673859Sml29623 	uint32_t		max_pkt_size;
683859Sml29623 	nxge_ipp_stats_t	*stat;
693859Sml29623 } nxge_ipp_t;
703859Sml29623 
713859Sml29623 /* IPP prototypes */
723859Sml29623 nxge_status_t nxge_ipp_reset(p_nxge_t);
733859Sml29623 nxge_status_t nxge_ipp_init(p_nxge_t);
743859Sml29623 nxge_status_t nxge_ipp_disable(p_nxge_t);
75*6495Sspeer nxge_status_t nxge_ipp_drain(p_nxge_t);
763859Sml29623 nxge_status_t nxge_ipp_handle_sys_errors(p_nxge_t);
773859Sml29623 nxge_status_t nxge_ipp_fatal_err_recover(p_nxge_t);
783859Sml29623 nxge_status_t nxge_ipp_eccue_valid_check(p_nxge_t, boolean_t *);
793859Sml29623 void nxge_ipp_inject_err(p_nxge_t, uint32_t);
803859Sml29623 
813859Sml29623 #ifdef	__cplusplus
823859Sml29623 }
833859Sml29623 #endif
843859Sml29623 
853859Sml29623 #endif	/* _SYS_NXGE_NXGE_IPP_H */
86