nxge_rxdma.h revision 4202ea4b139fb1fab45cd14d9d03a81b86902341
/*
* 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_RXDMA_H
#define _SYS_NXGE_NXGE_RXDMA_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <npi_rxdma.h>
/*
* Hardware RDC designer: 8 cache lines during Atlas bringup.
*/
#define RXDMA_RED_WINDOW_DEFAULT 0
#define RXDMA_RED_THRES_DEFAULT 0
#define RXDMA_RCR_PTHRES_DEFAULT 0x20
#define RXDMA_RCR_TO_DEFAULT 0x8
/*
* hardware workarounds: kick 16 (was 8 before)
*/
#define NXGE_RXDMA_POST_BATCH 16
#define RXBUF_64B_ALIGNED 64
#define NXGE_RXBUF_EXTRA 34
/*
* Receive buffer thresholds and buffer types
*/
typedef enum {
NXGE_RX_COPY_ALL = 0, /* do bcopy on every packet */
NXGE_RX_COPY_1, /* bcopy on 1/8 of buffer posted */
NXGE_RX_COPY_2, /* bcopy on 2/8 of buffer posted */
NXGE_RX_COPY_3, /* bcopy on 3/8 of buffer posted */
NXGE_RX_COPY_4, /* bcopy on 4/8 of buffer posted */
NXGE_RX_COPY_5, /* bcopy on 5/8 of buffer posted */
NXGE_RX_COPY_6, /* bcopy on 6/8 of buffer posted */
NXGE_RX_COPY_7, /* bcopy on 7/8 of buffer posted */
NXGE_RX_COPY_NONE /* don't do bcopy at all */
typedef enum {
typedef struct _rdc_errlog {
} rdc_errlog_t;
/*
* Receive Statistics.
*/
typedef struct _nxge_rx_ring_stats_t {
/*
* Receive buffer management statistics.
*/
/*
* Error event stats.
*/
typedef struct _nxge_rdc_sys_stats {
/*
* Software reserved buffer offset
*/
typedef struct _nxge_rxbuf_off_hdr_t {
/*
* Definitions for each receive buffer block.
*/
typedef struct _nxge_rbb_t {
} nxge_rbb_t, *p_nxge_rbb_t;
typedef struct _rx_tx_param_t {
typedef struct _rx_tx_params {
struct _tx_param_t *tx_param_p;
typedef struct _rx_msg_t {
struct _rx_rbr_ring_t *rx_rbr_p;
#ifdef RXBUFF_USE_SEPARATE_UP_CNTR
#endif
} rx_msg_t, *p_rx_msg_t;
typedef struct _rx_dma_handle_t {
#define RXCOMP_HIST_ELEMENTS 100000
typedef struct _nxge_rxcomphist_t {
/* Receive Completion Ring */
typedef struct _rx_rcr_ring_t {
struct _rx_rbr_ring_t *rx_rbr_p;
/* Buffer index information */
typedef struct _rxbuf_index_info_t {
/* Buffer index information */
typedef struct _rxring_info_t {
typedef enum {
RBR_UNMAPPING, /* We are in the process of unmapping. */
RBR_UNMAPPED /* The ring is unmapped. */
} rbr_state_t;
/* Receive Buffer Block Ring */
typedef struct _rx_rbr_ring_t {
/* may not be needed */
#ifdef RX_USE_RECLAIM_POST
#endif
#if defined(sun4v) && defined(NIU_LP_WORKAROUND)
#endif
/*
* <rbr_ref_cnt> is a count of those receive buffers which
* have been loaned to the kernel. We will not free this
* ring until the reference count reaches zero (0).
*/
/* Receive Mailbox */
typedef struct _rx_mbox_t {
} rx_mbox_t, *p_rx_mbox_t;
typedef struct _rx_rbr_rings_t {
typedef struct _rx_rcr_rings_t {
typedef struct _rx_mbox_areas_t {
/*
* Global register definitions per chip and they are initialized
* using the function zero control registers.
* .
*/
typedef struct _rxdma_globals {
/*
* Receive DMA Prototypes.
*/
void nxge_hw_start_rx(p_nxge_t);
void nxge_fixup_rxdma_rings(p_nxge_t);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NXGE_NXGE_RXDMA_H */