npi_txdma.h revision 4496171313bed39e96f21bc2f9faf2868e267ae3
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _NPI_TXDMA_H
#define _NPI_TXDMA_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <npi.h>
#include <nxge_txdma_hw.h>
{ \
status = NPI_SUCCESS; \
if (!TXDMA_CHANNEL_VALID(channel)) { \
} else if (!TXDMA_PAGE_VALID(pn)) { \
} else if (!TXDMA_FUNC_VALID(fn)) { \
} \
}
{ \
status = NPI_SUCCESS; \
if (!TXDMA_CHANNEL_VALID(channel)) { \
} else if (!TXDMA_PAGE_VALID(pn)) { \
} \
}
typedef enum _txdma_cs_cntl_e {
TXDMA_INIT_RESET = 0x1,
TXDMA_INIT_START = 0x2,
TXDMA_START = 0x3,
TXDMA_RESET = 0x4,
TXDMA_STOP = 0x5,
TXDMA_RESUME = 0x6,
TXDMA_CLEAR_MMK = 0x7,
TXDMA_MBOX_ENABLE = 0x8
typedef enum _txdma_log_cfg_e {
TXDMA_LOG_PAGE_MASK = 0x01,
TXDMA_LOG_PAGE_VALUE = 0x02,
TXDMA_LOG_PAGE_RELOC = 0x04,
TXDMA_LOG_PAGE_VALID = 0x08,
typedef enum _txdma_ent_msk_cfg_e {
typedef struct _txdma_ring_errlog {
/*
* Register offset (0x200 bytes for each channel) for logical pages registers.
*/
/*
* Register offset (0x200 bytes for each channel) for transmit ring registers.
* (Ring configuration, kick register, event mask, control and status,
* mailbox, prefetch, ring errors).
*/
#define NXGE_TXDMA_OFFSET(x, v, channel) (x + \
/*
* Register offset (0x8 bytes for each port) for transmit mapping registers.
*/
/*
* Register offset (0x10 bytes for each channel) for transmit DRR and ring
* usage registers.
*/
#define NXGE_TXDMA_DRR_OFFSET(x, channel) (x + \
/*
* PIO macros to read and write the transmit registers.
*/
/*
* Transmit Descriptor Definitions.
*/
#define TXDMA_DESC_SIZE (sizeof (tx_desc_t))
#define NPI_TXDMA_GATHER_INDEX(index) \
/*
* Transmit NPI error codes
*/
#define TXDMA_ID_SHIFT(n) (n << NPI_PORT_CHAN_SHIFT)
#define NPI_TXDMA_OPCODE_INVALID(n) (TXDMA_ID_SHIFT(n) | \
#define NPI_TXDMA_FUNC_INVALID(n) (TXDMA_ID_SHIFT(n) | \
#define NPI_TXDMA_CHANNEL_INVALID(n) (TXDMA_ID_SHIFT(n) | \
#define NPI_TXDMA_PAGE_INVALID(n) (TXDMA_ID_SHIFT(n) | \
/*
* Transmit DMA Channel NPI Prototypes.
*/
uint32_t);
uint8_t);
uint32_t);
uint32_t);
uint32_t);
uint32_t *);
uint32_t);
int);
#ifdef __cplusplus
}
#endif
#endif /* _NPI_TXDMA_H */