ncsi_basic_types.h revision d14abf155341d55053c76eeec58b787a456b753b
/****************************************************************************
* 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 2014 QLogic Corporation
* The contents of this file are subject to the terms of the
* QLogic End User License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing permissions
* and limitations under the License.
*
*
* FILE NAME: ncsi_types.h
*
* DESCRIPTION:
*
* CONVENTIONS:
*
* AUTHOR: Tim Sharp
*
* CREATION DATE:
*
* REVISION HISTORY
*
* When Who What
* -------------------------------------------------------------------------
****************************************************************************/
#ifndef NCSI_BASIC_TYPES_H
#define NCSI_BASIC_TYPES_H
#include "bcmtype.h"
#include "mcp_shmem.h"
#define NCSI_TYPES_INTERFACE_REV 0x0010
/*----------------------------------------------------------------------------
------------------------------ include files ---------------------------------
----------------------------------------------------------------------------*/
// Currently only E2 support 2 PATH. To make data structure same for all chips,
// we make sure data structure fit all 2 paths regardless of the chips
#define PATH_SUPPORTED 2
#define NCSI_MAC_ADDRESS_MAX 4
#define NCSI_VLAN_TAG_COUNT 2
#define NCSI_HEADER_REV (0x01)
/*----------------------------------------------------------------------------
------------------------------ local definitions -----------------------------
structs, unions, typedefs, #defines, etc belong here...
----------------------------------------------------------------------------*/
#define INTEGRATED_WITH_BOOTCODE
typedef void* pVoid_t;
#define NCSI_TYPES_MILLISEC_TO_MICROSEC_MULTIPLIER 1000
#define NCSI_TYPES_CHANNEL_ID_MASK 0x000000C0
#define NCSI_TYPES_MAGIC_NUMBER 0xA5A5A5A5
#define NCSI_LANDMARK_SIGNATURE 0x01234567
rounding and 2 more for
the +2 alignment. The
CRC is not included here */
#define SIZEOF_CRC 4
#define SIZEOF_MAC_ADDRESS 6
#define SUCCESS 0
#define FAILURE 1
#define STATUS_OK 0
#define STATUS_ERROR 1
#define NCSI_TYPES_MIN_UMP_CMD_RSP_FRAME_SIZE 60
/*****************************************************************************
The NCSI version type is based on the format used in the get version
command, and is intended to allow the struct value to be copied directly
into the packet structure byte for byte without processing.
*****************************************************************************/
typedef struct NcsiVersion
#if defined (BIG_ENDIAN)
{
#elif defined (LITTLE_ENDIAN)
{
#endif // ENDIAN
/*****************************************************************************
*****************************************************************************/
typedef struct NcsiMacAddr
#if defined (BIG_ENDIAN)
{
#elif defined (LITTLE_ENDIAN)
{
#endif // ENDIAN
typedef struct UmpMacAddr
{
} UmpMacAddr_t; // 8 bytes total
typedef UmpMacAddr_t* pUmpMacAddr_t;
typedef struct MacAddrConfig
{
} MacAddrConfig_t; //12 bytes total
/*****************************************************************************
UmpVlan_t
Structure definition for vlan tag
*****************************************************************************/
typedef struct UmpVlan
#if defined (BIG_ENDIAN)
{
#define VLAN_TAG_VID_FIELD_MASK (0x0FFF << 0)
#define VLAN_TAG_PRI_FIELD_MASK (0xE000 << 0)
#define VLAN_TAG_CFI_FIELD_MASK (0x1000 << 0)
} UmpVlan_t; // 4 bytes total
#elif defined (LITTLE_ENDIAN)
{
#define VLAN_TAG_VID_FIELD_MASK (0x0FFF << 0)
#define VLAN_TAG_PRI_FIELD_MASK (0xE000 << 0)
#define VLAN_TAG_CFI_FIELD_MASK (0x1000 << 0)
} UmpVlan_t; // 4 bytes total
#endif // ENDIAN
typedef UmpVlan_t* pVlanTag_t;
/*****************************************************************************
*****************************************************************************/
typedef struct PktErrorStat_t
{
typedef struct UmpDebugData
#if defined (BIG_ENDIAN)
{
#elif defined (LITTLE_ENDIAN)
{
#endif // ENDIAN
typedef UmpDebugData_t * UmpDebugDataPtr_t;
/*****************************************************************************
*****************************************************************************/
typedef struct CmdPktCnt
{
} CmdPktCnt_t;
typedef struct EgressPktCnt
{
typedef struct IngressPktCnt
{
typedef struct SmbusErrCnt
#if defined (BIG_ENDIAN)
{
#elif defined (LITTLE_ENDIAN)
{
#endif // ENDIAN
typedef struct UmpStatistics
{
union
{
};
typedef struct ChannelState
{
/*****************************************************************************
UmpPortConfig_t
this structure definition is for the container of IMD configured data that
is saved and used in recovery from soft reset, and is returned in response
to the get parameters ump cmd. This struct also stores the pointer to the
saved rsp frm also used in error recovery.
Note that this definition is using the cmd pkt desc ptr for the prev rsp
frm. This is valid.
*****************************************************************************/
typedef struct UmpPortConfigFlag
#if defined (BIG_ENDIAN)
{
u32_t :11;
u32_t PerformReset :1; //#define UMPTX_FLAG_CHANNEL_RESET_PENDING (1<<4) // IMD channel reset has been rx
u32_t DriverStateChange :1; // indicates change in driver state was detected while processing port reset
#elif defined (LITTLE_ENDIAN)
{
u32_t DriverStateChange :1; // indicates change in driver state was detected while processing port reset
u32_t PerformReset :1; //#define UMPTX_FLAG_CHANNEL_RESET_PENDING (1<<4) // IMD channel reset has been rx
u32_t :11;
#endif // ENDIAN
typedef struct UmpPortConfig
#if defined (BIG_ENDIAN)
{
} UmpPortConfig_t; //72 bytes total
#elif defined (LITTLE_ENDIAN)
{
} UmpPortConfig_t; //72 bytes total
#endif // ENDIAN
typedef struct
#if defined (BIG_ENDIAN)
{
#elif defined (LITTLE_ENDIAN)
{
#endif
/*****************************************************************************
This data structure is intended to encapsulate runtime debug data that
could be accessed from a host based diagnostics program, as well as an
embedded debug ump command.
*****************************************************************************/
typedef struct NcsiChannelData
{
} NcsiChannelData_t; // 152 bytes total
typedef struct SrcMacAddr
{
} SrcMacAddr_t;
#define HOST_SRC_ADDR_HIST_SIZE 8
typedef struct HostSrcMacBuff
{
#if defined (BIG_ENDIAN)
typedef NcsiChannelData_t* pNcsiChannelData_t;
#else
// define pointer as 32-bit value to ease diag encoding
typedef u32_t pNcsiChannelData_t;
#endif
typedef struct PackageState
#if defined (BIG_ENDIAN)
{
u32_t :12;
u32_t :1;
#define NCSI_RESET_TYPE_CHANNEL0_RESET 0 // driver events D0
#elif defined (LITTLE_ENDIAN)
{
#define NCSI_RESET_TYPE_CHANNEL0_RESET 0 // driver events D0
u32_t :1;
u32_t :12;
#endif // ENDIAN
/*****************************************************************************
*****************************************************************************/
#define UMP_SELECTION_STATE_DESELECTED FALSE
#define UMP_SELECTION_STATE_SELECTED TRUE
typedef struct NcsiPersistentData
{
} NcsiPersistentData_t; // 284 bytes total
#if defined (BIG_ENDIAN)
typedef NcsiPersistentData_t* pNcsiPersistentData_t;
#else
// define pointer as 32-bit value to ease diag encoding
typedef u32_t pNcsiPersistentData_t;
#endif
typedef enum NcsiLibraryEntryType
{
#if 0
#else
#endif
extern void NcsiMain_Delay_Usec (u32_t);
#endif