hxge_impl.h revision 3dec9fcdd56adf1b4a563137b4915c8f2d83b881
/*
* 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_IMPL_H
#define _SYS_HXGE_HXGE_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
#include <sys/byteorder.h>
#include <sys/ethernet.h>
#include <hxge_defs.h>
#include <hxge_peu.h>
#include <hxge_pfc.h>
#include <hxge_pfc_hw.h>
#include <hxge_vmac.h>
#include <hxge_fm.h>
#include <sys/ddi_intr.h>
#include <sys/mac_impl.h>
#include <sys/mac_ether.h>
/*
* Handy macros (taken from bge driver)
*/
#define RBR_SIZE 4
(flag)))
(flag)))
/*
* HPI related macros
*/
typedef uint32_t hxge_status_t;
typedef enum {
DVMA,
DMA,
} dma_method_t;
typedef enum {
#ifdef TX_ONE_BUF
#define TX_BCOPY_MAX 1514
#else
#define TX_BCOPY_MAX 2048
#define TX_BCOPY_SIZE 2048
#endif
#define TX_STREAM_MIN 512
#define TX_FASTDVMA_MIN 1024
#define HXGE_RDC_RCR_THRESHOLD_MAX 256
#define HXGE_RDC_RCR_TIMEOUT_MAX 64
#define HXGE_RDC_RCR_THRESHOLD_MIN 1
#define HXGE_RDC_RCR_TIMEOUT_MIN 1
#define HXGE_IS_VLAN_PACKET(ptr) \
typedef enum {
} dma_type_t;
struct _hxge_block_mv_t {
};
/*
* Common DMA data elements.
*/
struct _hxge_dma_common_t {
void *kaddrp;
void *ioaddr_pp;
void *orig_ioaddr_pp;
void *orig_kaddrp;
};
typedef struct _hxge_dma_pool_t {
/*
* Each logical device (69):
* - LDG #
* - flag bits
* - masks.
* - interrupt handler function.
*
* Generic system interrupt handler with two arguments:
* (hxge_sys_intr_t)
* Per device instance data structure
* Logical group data structure.
*
* Logical device interrupt handler with two arguments:
* (hxge_ldv_intr_t)
* Per device instance data structure
* Logical device number
*/
/*
* Each logical device Group (64) needs to have the following
* configurations:
* - timer counter (6 bits)
* - timer resolution (20 bits, number of system clocks)
* - system data (7 bits)
*/
struct _hxge_ldg_t {
};
struct _hxge_ldv_t {
};
typedef struct _pci_cfg_t {
} pci_cfg_t, *p_pci_cfg_t;
typedef struct _dev_regs_t {
void *hxge_regp; /* mapped device registers */
void *hxge_msix_regp; /* MSI/X register */
unsigned char *hxge_romp; /* fcode pointer */
} dev_regs_t, *p_dev_regs_t;
typedef struct _nxge_mac_addr_t {
/*
* Driver alternate mac address structure.
*/
typedef struct _hxge_mmac_t {
} hxge_mmac_t;
/*
* mmac stats structure
*/
typedef struct _hxge_mmac_stats_t {
#include <hxge_common_impl.h>
#include <hxge_common.h>
#include <hxge_rxdma.h>
#include <hxge_txdma.h>
#include <hxge_fzc.h>
#include <hxge_flow.h>
#include <hxge_virtual.h>
#include <hxge.h>
#include <hpi_vir.h>
/*
* Reconfiguring the network devices requires the net_config privilege
* in Solaris 10+. Prior to this, root privilege is required. In order
* that the driver binary can run on both S10+ and earlier versions, we
* make the decisiion as to which to use at runtime. These declarations
* allow for either (or both) to exist ...
*/
extern int fm_check_acc_handle(ddi_acc_handle_t);
extern int fm_check_dma_handle(ddi_dma_handle_t);
#pragma weak secpolicy_net_config
/* hxge_kstats.c */
void hxge_init_statsp(p_hxge_t);
void hxge_setup_kstats(p_hxge_t);
void hxge_destroy_kstats(p_hxge_t);
int hxge_port_kstat_update(kstat_t *, int);
/* hxge_hw.c */
void
void hxge_global_reset(p_hxge_t);
/* hxge_send.c. */
/* hxge_ndd.c */
void hxge_setup_param(p_hxge_t);
void hxge_init_param(p_hxge_t);
void hxge_destroy_param(p_hxge_t);
void hxge_nd_free(caddr_t *);
/* hxge_virtual.c */
/* MAC functions */
#ifdef HXGE_DEBUG
#endif
#endif /* !_ASM */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_HXGE_HXGE_IMPL_H */