hxge.h revision fd9489cef0e9b7d8a708339e560d453f230af2cf
/*
* 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_H
#define _SYS_HXGE_HXGE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <hxge_vmac.h>
#include <hxge_pfc.h>
#include <hxge_classify.h>
/*
* HXGE diagnostics IOCTLS.
*/
#define HXGE_OK 0
#define HXGE_ERROR 0x40000000
#define HXGE_DDI_FAILED 0x20000000
/*
* Definitions for module_info.
*/
#define HXGE_CHECK_TIMER (5000)
typedef enum {
#define HXGE_PARAM_READ 0x00000001ULL
#define HXGE_PARAM_WRITE 0x00000002ULL
#define HXGE_PARAM_SHARED 0x00000004ULL
#define HXGE_PARAM_PRIV 0x00000008ULL
#define HXGE_PARAM_RXDMA 0x00000010ULL
#define HXGE_PARAM_TXDMA 0x00000020ULL
#define HXGE_PARAM_MAC 0x00000040ULL
#define HXGE_PARAM_CMPLX 0x00010000ULL
#define HXGE_PARAM_NDD_WR_OK 0x00020000ULL
#define HXGE_PARAM_INIT_ONLY 0x00040000ULL
#define HXGE_PARAM_INIT_CONFIG 0x00080000ULL
#define HXGE_PARAM_READ_PROP 0x00100000ULL
#define HXGE_PARAM_PROP_ARR32 0x00200000ULL
#define HXGE_PARAM_PROP_ARR64 0x00400000ULL
#define HXGE_PARAM_PROP_STR 0x00800000ULL
#define HXGE_PARAM_DONT_SHOW 0x80000000ULL
#define HXGE_PARAM_ARRAY_CNT_MASK 0x0000ffff00000000ULL
#define HXGE_PARAM_ARRAY_CNT_SHIFT 32ULL
#define HXGE_PARAM_ARRAY_ALLOC_MASK 0xffff000000000000ULL
#define HXGE_PARAM_ARRAY_ALLOC_SHIFT 48ULL
typedef struct _hxge_param_t {
int (*getf)();
int (*setf)(); /* null for read only */
char *fcode_name;
char *name;
typedef enum {
} hxge_lb_t;
enum hxge_mac_state {
HXGE_MAC_STOPPED = 0,
};
typedef struct _filter_t {
} filter_t, *p_filter_t;
typedef struct _hxge_port_stats_t {
typedef struct _hxge_peu_sys_stats {
typedef struct _hxge_stats_t {
/*
* Overall structure size
*/
typedef struct _hxge_intr_t {
int intr_types; /* interrupt types supported */
int intr_type; /* interrupt type to add */
int msi_intx_cnt; /* # msi/intx ints returned */
int intr_added; /* # ints actually needed */
int intr_cap; /* interrupt capabilities */
/* Add interrupt number for each interrupt vector */
int pri;
} hxge_intr_t, *p_hxge_intr_t;
typedef struct _hxge_ldgv_t {
} hxge_ldgv_t, *p_hxge_ldgv_t;
typedef struct _hxge_timeout {
} hxge_timeout;
/*
* Hydra Device instance state information.
* Each instance is dynamically allocated on first attach.
*/
struct _hxge_t {
int instance; /* instance number */
enum hxge_mac_state hxge_mac_state;
/* Logical device and group data structures. */
/*
* Blocks of memory may be pre-allocated by the
* partition manager or the driver. They may include
* blocks for configuration and buffers. The idea is
* to preallocate big blocks of contiguous areas in
* system memory (i.e. with IOMMU). These blocks then
* will be broken up to a fixed number of blocks with
* each block having the same block size (4K, 8K, 16K or
* 32K) in the case of buffer blocks. For systems that
* do not support DVMA, more than one big block will be
* allocated.
*/
/* Receive buffer block ring and completion ring. */
/* Transmit descriptors rings */
int suspended;
int fm_capabilities; /* FMA capabilities */
};
/*
* Driver state flags.
*/
typedef struct _hxge_port_kstat_t {
/*
* Transciever state informations.
*/
/*
* Link partner capabilities.
*/
/*
* Shared link setup.
*/
/*
* Lets the user know the MTU currently in use by
* the physical MAC port.
*/
/*
* Misc MAC statistics.
*/
typedef struct _hxge_rdc_kstat {
/*
* Receive DMA channel statistics.
* This structure needs to be consistent with hxge_rdc_stat_index_t
* in hxge_kstat.c
*/
typedef struct _hxge_rdc_sys_kstat {
/*
* Receive DMA system statistics.
* This structure needs to be consistent with hxge_rdc_sys_stat_idx_t
* in hxge_kstat.c
*/
typedef struct _hxge_tdc_kstat {
/*
* Transmit DMA channel statistics.
* This structure needs to be consistent with hxge_tdc_stats_index_t
* in hxge_kstat.c
*/
typedef struct _hxge_tdc_sys_kstat {
/*
* Transmit DMA system statistics.
* This structure needs to be consistent with hxge_tdc_sys_stat_idx_t
* in hxge_kstat.c
*/
typedef struct _hxge_vmac_kstat {
/*
* VMAC statistics.
* This structure needs to be consistent with hxge_vmac_stat_index_t
* in hxge_kstat.c
*/
typedef struct _hxge_pfc_kstat {
/*
* This structure needs to be consistent with hxge_pfc_stat_index_t
* in hxge_kstat.c
*/
typedef struct _hxge_mmac_kstat {
/*
* This structure needs to be consistent with hxge_mmac_stat_index_t
* in hxge_kstat.c
*/
typedef struct _hxge_peu_sys_kstat {
/*
* This structure needs to be consistent with hxge_peu_sys_stat_idx_t
* in hxge_kstat.c
*/
/*
* Prototype definitions.
*/
void hxge_uninit(p_hxge_t);
typedef void (*fptrv_t)();
#ifdef __cplusplus
}
#endif
#endif /* _SYS_HXGE_HXGE_H */