hpi.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 _HPI_H
#define _HPI_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <hxge_common_impl.h>
#include <hxge_common.h>
typedef uint32_t hpi_status_t;
/* Common Block ID */
#define VMAC_BLK_ID 0x1
#define TXDMA_BLK_ID 0x2
#define RXDMA_BLK_ID 0x3
#define PFC_BLK_ID 0x4
#define VIR_BLK_ID 0x5
#define PEU_BLK_ID 0x6
/* Common HW error code */
/* HW unable to exit from reset state. */
#define RESET_FAILED 0x81
/* Write operation failed on indirect write. */
#define WRITE_FAILED 0x82
/* Read operation failed on indirect read. */
#define READ_FAILED 0x83
/* Common SW errors code */
#define HPI_SUCCESS 0 /* Operation succeed */
/*
* Block identifier starts at bit 8.
*/
#define HPI_BLOCK_ID_SHIFT 8
/*
* Port, channel and misc. information starts at bit 12.
*/
#define HPI_PORT_CHAN_SHIFT 12
/*
* Software Block specific error codes start at 0x50.
*/
#define HPI_BK_ERROR_START 0x50
/*
* Hardware block specific error codes start at 0x90.
*/
#define HPI_BK_HW_ER_START 0x90
/* Structures for register tracing */
typedef struct _rt_buf {
} rt_buf_t;
/*
* Control Address field format
*
* Bit 0 - 23: Address
* Bit 24 - 25: Function Number
* Bit 26 - 29: Instance Number
* Bit 31: Invalid bit
*/
#define MAX_RTRACE_ENTRIES 1024
#define MAX_RTRACE_IOC_ENTRIES 64
#define TRACE_ADDR_MASK 0x00FFFFFF
#define TRACE_FUNC_MASK 0x03000000
#define TRACE_INST_MASK 0x3C000000
#define TRACE_CTL_WR 0x40000000
#define TRACE_CTL_INVALID 0x80000000
#define TRACE_FUNC_SHIFT 24
#define TRACE_INST_SHIFT 26
#define MSG_BUF_SIZE 1024
typedef struct _rtrace {
} rtrace_t;
/* Configuration options */
typedef enum config_op {
DISABLE = 0,
} config_op_t;
/* I/O options */
typedef enum io_op {
OP_SET = 0,
} io_op_t;
/* HPI Handle */
typedef struct _hpi_handle_function {
/* HPI Handle */
typedef struct _hpi_handle {
void *hxgep;
} hpi_handle_t;
extern rtrace_t hpi_rtracebuf;
char *fmt, ...);
#ifdef HPI_DEBUG
#else
#define HPI_DEBUG_MSG(params)
#endif
#ifdef __cplusplus
}
#endif
#endif /* _HPI_H */