hxge_defs.h revision a512c5d1f2908d965887ad5494954ba2cf904bd2
/*
* 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_HXGE_HXGE_DEFS_H
#define _SYS_HXGE_HXGE_DEFS_H
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) && \
!defined(__BIG_ENDIAN) && !defined(__LITTLE_ENDIAN)
#endif
#if !defined(_BIT_FIELDS_HTOL) && !defined(_BIT_FIELDS_LTOH) && \
!defined(__BIT_FIELDS_HTOL) && !defined(__BIT_FIELDS_LTOH)
#endif
#define DMA_CSR_SIZE 2048
/*
* Define the Default RBR, RCR
*/
#define SW_OFFSET_NO_OFFSET 0
#define SW_OFFSET_INVALID 3
/*
* RBR block descriptor is 32 bits (bits [43:12]
*/
#define RBR_BKADDR_SHIFT 12
#define RCR_DEFAULT_MAX_LEN (RCR_DEFAULT_MAX_BLKS)
#define RCR_DEFAULT_MIN_LEN 32
/* DMA Channels. */
#define HXGE_MAX_RDCS 4
#define HXGE_MAX_TDCS 4
#define VLAN_ETHERTYPE (0x8100)
/* 256 total, each blade gets 42 */
#define TCAM_HXGE_TCAM_MAX_ENTRY 42
/*
* Locate the DMA channel start offset (PIO_VADDR)
* (DMA virtual address space of the PIO block)
*/
/* TX_RNG_CFIG is not used since we are not using VADDR. */
#define TX_RNG_CFIG 0x1000000
/*
* PIO access using the DMC block directly (DMC)
*/
#ifdef SOLARIS
#ifndef i386
#else
#endif
#else
#endif
/*
* The following macros expect unsigned input values.
*/
/*
* Logical device definitions.
*/
#define HXGE_INT_MAX_LD 32
#define HXGE_INT_MAX_LDG 32
#define HXGE_RDMA_LD_START 0 /* 0 - 3 with 4 - 7 reserved */
#define HXGE_VMAC_LD 16
#define HXGE_PFC_LD 17
#define HXGE_NMAC_LD 18
#define HXGE_SYS_ERROR_LD 31
#define LDG_VALID(n) (n < HXGE_INT_MAX_LDG)
#define LD_VALID(n) (n < HXGE_INT_MAX_LD)
#define LD_RXDMA_LD_VALID(n) (n < HXGE_MAX_RDCS)
#define LD_TXDMA_LD_VALID(n) (n >= HXGE_MAX_RDCS && \
((n - HXGE_MAX_RDCS) < HXGE_MAX_TDCS)))
#define LD_TIMER_MAX 0x3f
#define LD_INTTIMER_VALID(n) (n <= LD_TIMER_MAX)
/* System Interrupt Data */
#define SID_VECTOR_MAX 0x1f
#define SID_VECTOR_VALID(n) (n <= SID_VECTOR_MAX)
#define LD_IM_MASK 0x00000003ULL
#define LDGTITMRES_RES_MASK 0x000FFFFFULL
#define MAX_FRAME_SIZE 9216
#define HXGE_DEFAULT_MTU 1500
/*
* sizeof (struct ether_header) + ETHERFCSL + 4 + TX_PKT_HEADER_SIZE
* 12 + 6 + 4 + 16
*/
#define MTU_TO_FRAME_SIZE 38
#ifdef __cplusplus
}
#endif
#endif /* _SYS_HXGE_HXGE_DEFS_H */