/******************************************************************************/
/*                       Copyright 2001 Broadcom Corporation                  */
/*                                                                            */
/* This material is the confidential trade secret and proprietary information */
/* of Broadcom Corp.  It may not be reproduced, used, sold or transferred to  */
/* any third party without the prior written consent of Broadcom Corp.        */
/* All rights reserved.                                                       */
/******************************************************************************/
/*   FileName        : bcm_hmiCoreMsg.c                                       */
/*   Purpose         : Definition of layout variables for all core manager    */
/*                     HMI message types and related principal types          */
/*   Limitations     : None                                                   */
/*   Author          : Emmanuel Hanssens                                      */
/*   Creation Date   : 17-Sep-2001                                            */
/*   History         : Compiled by CVS                                        */
/******************************************************************************/
/*   $Id: bcm_hmiCoreMsg.c,v 1.21 2004/11/18 15:34:32 hanssens Exp $  */
/******************************************************************************/

#include "bcm_userdef.h"
#include "bcm_hmiCoreMsg.h"
#include "bcm_hmiMsgDef.h"

/* {{{ static BCM6510 configurations */
#ifdef BCM_USE_BCM6510

const SetBCM6510afeConnectMsgReq defaultBCM6510afeConfig[8] =
{ {{5, 0,2, 9, 8,2, 9,0,0,0,0,0,0,0,0,0}}, /* BCM6510_AFE_CONFIG_16 */
  {{5, 0,0,11,12,2, 5,0,0,0,0,0,0,0,0,0}}, /* BCM6510_AFE_CONFIG_32A(0) */
  {{5, 0,6, 9,4, 0,11,0,0,0,0,0,0,0,0,0}}, /* BCM6510_AFE_CONFIG_32A(1) */
  {{5, 2,0,11,14,2, 5,0,0,0,0,0,0,0,0,0}}, /* BCM6510_AFE_CONFIG_32B(0) */
  {{5,14,6, 9, 2,0,11,0,0,0,0,0,0,0,0,0}}, /* BCM6510_AFE_CONFIG_32B(1) */
  {{5, 0,0,11,12,0, 3,0,0,0,0,0,0,0,0,0}}, /* BCM6510_AFE_CONFIG_48(0) */
  {{5, 0,4,11, 8,0, 7,0,0,0,0,0,0,0,0,0}}, /* BCM6510_AFE_CONFIG_48(1) */
  {{5, 0,8,11, 4,0,11,0,0,0,0,0,0,0,0,0}}, /* BCM6510_AFE_CONFIG_48(2) */
};

#endif
/* }}} */
/* {{{ layout variable of principal types */

typeLayout SantoriniConfigLayout[] =
{
  { BCM_DEV_NB_LINES*2*2, sizeof(int32)},
  { 10, sizeof(uint8)  },
  { 2,  sizeof(uint16) },
  { 6,  sizeof(uint8)  },
  { 1,  sizeof(uint16) },
  { 8,  sizeof(uint8)  },
  { 1,  sizeof(uint16) },
  { 2,  sizeof(uint8)  },
  { 1,  sizeof(uint16) },
  { 2,  sizeof(int32)  },   /* uint32 and int32 have same size */
  { 8,  sizeof(uint8)  },
  { 1,  sizeof(uint32) },
  { 0,  0              }
};

typeLayout LineInterruptLayout[] =
{
  { BCM_DEV_NB_LINES*2+2, sizeof(uint32) },
  { 0,      0 }
};

typeLayout SantChangeLineIMRLayout[] =
{
  { BCM_DEV_NB_LINES*2, sizeof(uint32) },
  { 0,    0 }
};

typeLayout FirmwareVersionInfoLayout[] =
{
  { 1,  sizeof(uint32) },
  { 1,  sizeof(uint16) },
  { 2,  sizeof(uint8)  },
  { 2,  sizeof(uint16) },
  { 64, sizeof(uint8)  },
  { 4,  sizeof(uint8)  },
  { 0,  0              }
};

typeLayout GPoutDataLayout[] =
{
  { 2,  sizeof(uint32) },
  { 0,  0              }
};

typeLayout GPinDataLayout[] =
{
  { 1,  sizeof(uint32) },
  { 0,  0              }
};

typeLayout TimingCalibrationResultLayout[] =
{
  { 1,  sizeof(uint32) },
  { 0,  0              }
};

typeLayout OAMperiodElapsedTimeLayout[] =
{
  { 3, sizeof(uint32) },
  { 0, 0              }
};

typeLayout LineDriverPowerModesLayout[] =
{
  { 2, sizeof(uint8) },
  { 2, sizeof(int16) },
  { 4, sizeof(uint8) },
  { 2, sizeof(int16) },
  { 4, sizeof(uint8) },
  { 0, 0             }
};

typeLayout SNMPdetectLayout[] =
{
  { 2,  sizeof(uint32) },
  { 0,  0              }
};

typeLayout PstackIPconfigLayout[] =
{
  { 3,  sizeof(uint32) },
  { 4,  sizeof(uint8)  },
  { 0,  0              }
};

typeLayout PstackL2configLayout[] =
{
  { 5,  sizeof(uint16) },
  { 8,  sizeof(uint8)  },
  { 0,  0              }
};

typeLayout StackStatusLayout[] =
{
  { 1,  sizeof(int32)  },
  { 0,  0              }
};

typeLayout LedPatternLayout[] =
{
  { 8*4, sizeof(uint8)  },
  { 1,   sizeof(uint32) },
  { 4,   sizeof(uint8)  },
  { 0,   0              }
};

typeLayout SetTxFilterMsgReqLayout[] =
{
  { BCM_TX_FILTER_LEN+1, sizeof(uint8)},
  { 0, 0 }
};

typeLayout SetBCM6510afeConnectMsgReqLayout[] =
{
  { 16, sizeof(uint8)  },
  { 0, 0 }
};

/* }}} */
/* {{{ message layout using the macros in hmiMsgDef.h */

HMI_MSG_REQ_LAYOUT(SetDeviceConfiguration, SET_DEVICE_CONFIGURATION,
                   SantoriniConfig)

HMI_MSG_REP_LAYOUT(GetDeviceConfiguration, GET_DEVICE_CONFIGURATION,
                   SantoriniConfig)

HMI_MSG_REP_LAYOUT(GetLineInterruptStatus, GET_LINE_INTERRUPT_STATUS,
                   LineInterrupt)

HMI_MSG_REQ_LAYOUT(ChangeLineInterruptMask, CHANGE_LINE_INTERRUPT_MASK,
                   SantChangeLineIMR)

HMI_MSG_NPL_LAYOUT(ResetDevice, RESET_DEVICE)

HMI_MSG_REP_LAYOUT(GetFirmwareVersionInfo, GET_FIRMWARE_VERSION_INFO,
                   FirmwareVersionInfo)

HMI_MSG_REQ_LAYOUT(WriteGPIO, WRITE_GPIO, GPoutData)

HMI_MSG_REP_LAYOUT(ReadGPIO, READ_GPIO, GPinData)

HMI_MSG_REQ_LAYOUT(SetOAMperiodElapsedTime, SET_OAM_PERIOD_ELAPSED_TIME,
                   OAMperiodElapsedTime)

HMI_MSG_REQ_LAYOUT(SetLineDriverPowerModes, SET_LINE_DRIVER_POWER_MODES,
                   LineDriverPowerModes)

HMI_MSG_ALL_LAYOUT(DetectModem, DETECT_MODEM, SNMPdetect, SNMPdetect)

HMI_MSG_REQ_LAYOUT(SetInBandIPconfiguration, SET_IN_BAND_IP_CONFIGURATION,
                   PstackIPconfig)

HMI_MSG_REP_LAYOUT(GetInBandIPconfiguration, GET_IN_BAND_IP_CONFIGURATION,
                   PstackIPconfig)

HMI_MSG_REP_LAYOUT(GetInBandLayer2Config, GET_IN_BAND_LAYER_2_CONFIG,
                   PstackL2config)

HMI_MSG_REP_LAYOUT(GetInBandStackStatus, GET_IN_BAND_STACK_STATUS,
                   StackStatus)

HMI_MSG_REQ_LAYOUT(SetLedPattern, SET_LED_PATTERN, LedPattern)

HMI_MSG_REQ_LAYOUT(SetTxFilter, SET_TX_FILTER, SetTxFilterMsgReq)

#ifdef BCM_USE_BCM6510
HMI_MSG_REQ_LAYOUT(SetBCM6510afeConnect, SET_BCM6510_AFE_CONNECT,
                   SetBCM6510afeConnectMsgReq)
#endif

/* }}} */
