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_TXC_H 276f45ec7bSml29623 #define _SYS_NXGE_NXGE_TXC_H 286f45ec7bSml29623 296f45ec7bSml29623 #pragma ident "%Z%%M% %I% %E% SMI" 306f45ec7bSml29623 316f45ec7bSml29623 #ifdef __cplusplus 326f45ec7bSml29623 extern "C" { 336f45ec7bSml29623 #endif 346f45ec7bSml29623 356f45ec7bSml29623 #include <sys/nxge/nxge_txc_hw.h> 366f45ec7bSml29623 #include <npi_txc.h> 376f45ec7bSml29623 386f45ec7bSml29623 /* Suggested by hardware team 7/19/2006 */ 396f45ec7bSml29623 #define TXC_DMA_MAX_BURST_DEFAULT 1530 /* Max burst used by DRR */ 406f45ec7bSml29623 416f45ec7bSml29623 typedef struct _txc_errlog { 426f45ec7bSml29623 txc_ro_states_t ro_st; 436f45ec7bSml29623 txc_sf_states_t sf_st; 446f45ec7bSml29623 } txc_errlog_t; 456f45ec7bSml29623 466f45ec7bSml29623 typedef struct _nxge_txc_stats { 476f45ec7bSml29623 uint32_t pkt_stuffed; 486f45ec7bSml29623 uint32_t pkt_xmit; 496f45ec7bSml29623 uint32_t ro_correct_err; 506f45ec7bSml29623 uint32_t ro_uncorrect_err; 516f45ec7bSml29623 uint32_t sf_correct_err; 526f45ec7bSml29623 uint32_t sf_uncorrect_err; 536f45ec7bSml29623 uint32_t address_failed; 546f45ec7bSml29623 uint32_t dma_failed; 556f45ec7bSml29623 uint32_t length_failed; 566f45ec7bSml29623 uint32_t pkt_assy_dead; 576f45ec7bSml29623 uint32_t reorder_err; 586f45ec7bSml29623 txc_errlog_t errlog; 596f45ec7bSml29623 } nxge_txc_stats_t, *p_nxge_txc_stats_t; 606f45ec7bSml29623 616f45ec7bSml29623 typedef struct _nxge_txc { 626f45ec7bSml29623 uint32_t dma_max_burst; 636f45ec7bSml29623 uint32_t dma_length; 646f45ec7bSml29623 uint32_t training; 656f45ec7bSml29623 uint8_t debug_select; 666f45ec7bSml29623 uint64_t control_status; 676f45ec7bSml29623 uint64_t port_dma_list; 686f45ec7bSml29623 nxge_txc_stats_t *txc_stats; 696f45ec7bSml29623 } nxge_txc_t, *p_nxge_txc_t; 706f45ec7bSml29623 716f45ec7bSml29623 /* 726f45ec7bSml29623 * Transmit Controller (TXC) prototypes. 736f45ec7bSml29623 */ 746f45ec7bSml29623 nxge_status_t nxge_txc_init(p_nxge_t); 756f45ec7bSml29623 nxge_status_t nxge_txc_uninit(p_nxge_t); 76*678453a8Sspeer nxge_status_t nxge_txc_tdc_bind(p_nxge_t, int); 77*678453a8Sspeer nxge_status_t nxge_txc_tdc_unbind(p_nxge_t, int); 786f45ec7bSml29623 nxge_status_t nxge_txc_handle_sys_errors(p_nxge_t); 796f45ec7bSml29623 void nxge_txc_inject_err(p_nxge_t, uint32_t); 806f45ec7bSml29623 816f45ec7bSml29623 #ifdef __cplusplus 826f45ec7bSml29623 } 836f45ec7bSml29623 #endif 846f45ec7bSml29623 856f45ec7bSml29623 #endif /* _SYS_NXGE_NXGE_TXC_H */ 86