niumx_var.h revision 500b1e787b108592a37e3d54dc9b5e676de5386d
/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_NIUMX_VAR_H
#define _SYS_NIUMX_VAR_H
#ifdef __cplusplus
extern "C" {
#endif
typedef enum { /* same sequence as niumx_debug_sym[] */
/* 0 */ NIUMX_DBG_ATTACH,
/* 1 */ NIUMX_DBG_MAP,
/* 2 */ NIUMX_DBG_CTLOPS,
/* 3 */ NIUMX_DBG_INTROPS,
/* 4 */ NIUMX_DBG_A_INTX,
/* 5 */ NIUMX_DBG_R_INTX,
/* 6 */ NIUMX_DBG_INTR,
/* 7 */ NIUMX_DBG_DMA_ALLOCH,
/* 8 */ NIUMX_DBG_DMA_BINDH,
/* 9 */ NIUMX_DBG_DMA_UNBINDH,
/* 10 */ NIUMX_DBG_CHK_MOD
#if defined(DEBUG)
#else
#define DBG 0 &&
#endif /* DEBUG */
typedef uint64_t niudevhandle_t;
#define NIUMX_DEVHDLE_MASK 0xFFFFFFF
typedef uint32_t niucpuid_t;
typedef uint32_t niudevino_t;
typedef uint64_t niusysino_t;
/*
* The following structure represents an interrupt handler control block for
* each interrupt added via ddi_intr_add_handler().
*/
typedef struct niumx_ih {
int ih_state; /* interrupt valid state */
int ih_pri; /* interrupt priority */
} niumx_ih_t;
#define NIUMX_MAX_INTRS 64
#define NIUMX_SOFT_STATE_OPEN 1
#define NIUMX_SOFT_STATE_OPEN_EXCL 2
#define NIUMX_SOFT_STATE_CLOSED 4
typedef struct niumx_devstate {
int niumx_soft_state;
int niumx_open_count;
int niumx_fm_cap;
/*
* flags for overloading dmai_inuse field of the dma request structure:
*/
#define dmai_pfnlst dmai_iopte
#define dmai_roffset dmai_pool
#define NIUMX_PAGE_SHIFT 13
/* for "ranges" property */
typedef struct niumx_ranges {
/* IPL of 6 for networking devices */
#define NIUMX_DEFAULT_PIL 6
typedef struct {
/*
* HV INTR API versioning.
*
* Currently NIU nexus driver supports version 1.0
*/
#define NIUMX_INTR_MAJOR_VER_1 0x1ull
#define NIUMX_INTR_MINOR_VER_0 0x0ull
#define NIUMX_DIP_TO_HANDLE(dip) \
#define NIUMX_DEV_TO_SOFTSTATE(dev) \
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NIUMX_VAR_H */