144961713Sgirish /* 244961713Sgirish * CDDL HEADER START 344961713Sgirish * 444961713Sgirish * The contents of this file are subject to the terms of the 544961713Sgirish * Common Development and Distribution License (the "License"). 644961713Sgirish * You may not use this file except in compliance with the License. 744961713Sgirish * 844961713Sgirish * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 944961713Sgirish * or http://www.opensolaris.org/os/licensing. 1044961713Sgirish * See the License for the specific language governing permissions 1144961713Sgirish * and limitations under the License. 1244961713Sgirish * 1344961713Sgirish * When distributing Covered Code, include this CDDL HEADER in each 1444961713Sgirish * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1544961713Sgirish * If applicable, add the following below this CDDL HEADER, with the 1644961713Sgirish * fields enclosed by brackets "[]" replaced with your own identifying 1744961713Sgirish * information: Portions Copyright [yyyy] [name of copyright owner] 1844961713Sgirish * 1944961713Sgirish * CDDL HEADER END 2044961713Sgirish */ 2144961713Sgirish /* 22*678453a8Sspeer * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2344961713Sgirish * Use is subject to license terms. 2444961713Sgirish */ 2544961713Sgirish 2644961713Sgirish #ifndef _SYS_NXGE_NXGE_TXC_H 2744961713Sgirish #define _SYS_NXGE_NXGE_TXC_H 2844961713Sgirish 2944961713Sgirish #ifdef __cplusplus 3044961713Sgirish extern "C" { 3144961713Sgirish #endif 3244961713Sgirish 3344961713Sgirish #include <sys/nxge/nxge_txc_hw.h> 3444961713Sgirish #include <npi_txc.h> 3544961713Sgirish 3644961713Sgirish /* Suggested by hardware team 7/19/2006 */ 3744961713Sgirish #define TXC_DMA_MAX_BURST_DEFAULT 1530 /* Max burst used by DRR */ 3844961713Sgirish 3944961713Sgirish typedef struct _txc_errlog { 4044961713Sgirish txc_ro_states_t ro_st; 4144961713Sgirish txc_sf_states_t sf_st; 4244961713Sgirish } txc_errlog_t; 4344961713Sgirish 4444961713Sgirish typedef struct _nxge_txc_stats { 4544961713Sgirish uint32_t pkt_stuffed; 4644961713Sgirish uint32_t pkt_xmit; 4744961713Sgirish uint32_t ro_correct_err; 4844961713Sgirish uint32_t ro_uncorrect_err; 4944961713Sgirish uint32_t sf_correct_err; 5044961713Sgirish uint32_t sf_uncorrect_err; 5144961713Sgirish uint32_t address_failed; 5244961713Sgirish uint32_t dma_failed; 5344961713Sgirish uint32_t length_failed; 5444961713Sgirish uint32_t pkt_assy_dead; 5544961713Sgirish uint32_t reorder_err; 5644961713Sgirish txc_errlog_t errlog; 5744961713Sgirish } nxge_txc_stats_t, *p_nxge_txc_stats_t; 5844961713Sgirish 5944961713Sgirish typedef struct _nxge_txc { 6044961713Sgirish uint32_t dma_max_burst; 6144961713Sgirish uint32_t dma_length; 6244961713Sgirish uint32_t training; 6344961713Sgirish uint8_t debug_select; 6444961713Sgirish uint64_t control_status; 6544961713Sgirish uint64_t port_dma_list; 6644961713Sgirish nxge_txc_stats_t *txc_stats; 6744961713Sgirish } nxge_txc_t, *p_nxge_txc_t; 6844961713Sgirish 6944961713Sgirish /* 7044961713Sgirish * Transmit Controller (TXC) prototypes. 7144961713Sgirish */ 7244961713Sgirish nxge_status_t nxge_txc_init(p_nxge_t); 7344961713Sgirish 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); 7644961713Sgirish nxge_status_t nxge_txc_handle_sys_errors(p_nxge_t); 7744961713Sgirish void nxge_txc_inject_err(p_nxge_t, uint32_t); 7844961713Sgirish 7944961713Sgirish #ifdef __cplusplus 8044961713Sgirish } 8144961713Sgirish #endif 8244961713Sgirish 8344961713Sgirish #endif /* _SYS_NXGE_NXGE_TXC_H */ 84