xref: /onnv-gate/usr/src/uts/common/sys/nxge/nxge_txc.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_TXC_H
273859Sml29623 #define	_SYS_NXGE_NXGE_TXC_H
283859Sml29623 
293859Sml29623 #pragma ident	"%Z%%M%	%I%	%E% SMI"
303859Sml29623 
313859Sml29623 #ifdef	__cplusplus
323859Sml29623 extern "C" {
333859Sml29623 #endif
343859Sml29623 
353859Sml29623 #include <sys/nxge/nxge_txc_hw.h>
363859Sml29623 #include <npi_txc.h>
373859Sml29623 
383859Sml29623 /* Suggested by hardware team 7/19/2006 */
393859Sml29623 #define	TXC_DMA_MAX_BURST_DEFAULT	1530	/* Max burst used by DRR */
403859Sml29623 
413859Sml29623 typedef	struct _txc_errlog {
423859Sml29623 	txc_ro_states_t		ro_st;
433859Sml29623 	txc_sf_states_t		sf_st;
443859Sml29623 } txc_errlog_t;
453859Sml29623 
463859Sml29623 typedef struct _nxge_txc_stats {
473859Sml29623 	uint32_t		pkt_stuffed;
483859Sml29623 	uint32_t		pkt_xmit;
493859Sml29623 	uint32_t		ro_correct_err;
503859Sml29623 	uint32_t		ro_uncorrect_err;
513859Sml29623 	uint32_t		sf_correct_err;
523859Sml29623 	uint32_t		sf_uncorrect_err;
533859Sml29623 	uint32_t		address_failed;
543859Sml29623 	uint32_t		dma_failed;
553859Sml29623 	uint32_t		length_failed;
563859Sml29623 	uint32_t		pkt_assy_dead;
573859Sml29623 	uint32_t		reorder_err;
583859Sml29623 	txc_errlog_t		errlog;
593859Sml29623 } nxge_txc_stats_t, *p_nxge_txc_stats_t;
603859Sml29623 
613859Sml29623 typedef struct _nxge_txc {
623859Sml29623 	uint32_t		dma_max_burst;
633859Sml29623 	uint32_t		dma_length;
643859Sml29623 	uint32_t		training;
653859Sml29623 	uint8_t			debug_select;
663859Sml29623 	uint64_t		control_status;
673859Sml29623 	uint64_t		port_dma_list;
683859Sml29623 	nxge_txc_stats_t	*txc_stats;
693859Sml29623 } nxge_txc_t, *p_nxge_txc_t;
703859Sml29623 
713859Sml29623 /*
723859Sml29623  * Transmit Controller (TXC) prototypes.
733859Sml29623  */
743859Sml29623 nxge_status_t nxge_txc_init(p_nxge_t);
753859Sml29623 nxge_status_t nxge_txc_uninit(p_nxge_t);
76*6495Sspeer nxge_status_t nxge_txc_tdc_bind(p_nxge_t, int);
77*6495Sspeer nxge_status_t nxge_txc_tdc_unbind(p_nxge_t, int);
783859Sml29623 nxge_status_t nxge_txc_handle_sys_errors(p_nxge_t);
793859Sml29623 void nxge_txc_inject_err(p_nxge_t, uint32_t);
803859Sml29623 
813859Sml29623 #ifdef	__cplusplus
823859Sml29623 }
833859Sml29623 #endif
843859Sml29623 
853859Sml29623 #endif	/* _SYS_NXGE_NXGE_TXC_H */
86