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