nxge_txdma.h revision 6920a987a5562b1b71bcf972b76b8534eccd7b96
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_NXGE_NXGE_TXDMA_H
#define _SYS_NXGE_NXGE_TXDMA_H
#ifdef __cplusplus
extern "C" {
#endif
#include <npi_txdma.h>
#define TXDMA_RECLAIM_PENDING_DEFAULT 64
#define TX_FULL_MARK 3
/*
* Transmit load balancing definitions.
*/
#define NXGE_TX_LB_TCPUDP 0 /* default policy */
/*
* Descriptor ring empty:
* (1) head index is equal to tail index.
* (2) wrapped around bits are the same.
* Descriptor ring full:
* (1) head index is equal to tail index.
* (2) wrapped around bits are different.
*
*/
#define TXDMA_DRR_WEIGHT_DEFAULT 0x001f
typedef enum {
NXGE_USE_SERIAL = 0,
typedef struct _tx_msg_t {
int head;
int tail;
} tx_msg_t, *p_tx_msg_t;
/*
* TX Statistics.
*/
typedef struct _nxge_tx_ring_stats_t {
typedef struct _tx_ring_t {
#define NXGE_TX_RING_ONLINE 0x00
#define NXGE_TX_RING_OFFLINING 0x01
#define NXGE_TX_RING_OFFLINED 0x02
struct nxge_tdc_cfg *tdc_p;
#if defined(sun4v) && defined(NIU_LP_WORKAROUND)
#endif
} tx_ring_t, *p_tx_ring_t;
/* Transmit Mailbox */
typedef struct _tx_mbox_t {
} tx_mbox_t, *p_tx_mbox_t;
typedef struct _tx_rings_t {
} tx_rings_t, *p_tx_rings_t;
typedef struct _tx_mbox_areas_t {
/*
* Transmit prototypes.
*/
void nxge_uninit_txdma_channel(p_nxge_t, int);
uint64_t);
int nxge_tx_pkt_nmblocks(p_mblk_t, int *);
void nxge_hw_start_tx(p_nxge_t);
void nxge_txdma_stop(p_nxge_t);
void nxge_txdma_stop_start(p_nxge_t);
void nxge_fixup_txdma_rings(p_nxge_t);
void nxge_txdma_hw_kick(p_nxge_t);
uint16_t);
uint16_t);
void nxge_txdma_regs_dump(p_nxge_t, int);
void nxge_check_tx_hang(p_nxge_t);
void nxge_reclaim_rings(p_nxge_t);
int nxge_txdma_hung(p_nxge_t);
int nxge_txdma_stop_inj_err(p_nxge_t, int);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NXGE_NXGE_TXDMA_H */