/******************************************************************************/
/*                 Copyright C 1998-2002 Broadcom Corporation                 */
/*                                                                            */
/* This material is the confidential trade secret and proprietary information */
/* of Broadcom Corporation.  It may not be reproduced, used, sold or          */
/* transferred to any third party without the prior written consent of        */
/* Broadcom Corporation.   All rights reserved.                               */
/******************************************************************************/
/*   FileName        : bcm_hmiDebugMsg.c                                      */
/*   Purpose         : Definition of layout variables for all supported       */
/*                     debug messages types                                   */
/*   Limitations     : None                                                   */
/*   Author          : Emmanuel Hanssens                                      */
/*   Creation Date   : 27-Jun-2002                                            */
/*   History         : Compiled by CVS                                        */
/******************************************************************************/
/*   $Id: bcm_hmiDebugMsg.c,v 1.4 2004/09/29 08:10:14 hanssens Exp $  */
/******************************************************************************/

#include "bcm_userdef.h"
#include "bcm_hmiDebugMsg.h"
#include "bcm_hmiMsgDef.h"

/* {{{ layout variable of principal types */

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

typeLayout LogAndDebugPacketLayout[] =
{
  { 2, sizeof(uint32) },
  { 2, sizeof(uint16) },
  { 5, sizeof(uint32) },
  { 0, 0              }
};

/* we define the answer as an array of bytes, so that no byte swap is done */
/* at time of message transfer, but will be done on each debug packet */
/* afterwards */
typeLayout GetLogAndDebugInfoMsgRepLayout[] =
{
  { MAX_LOG_AND_DEBUG_PACKETS*sizeof(LogAndDebugPacket), sizeof(uint8) },
  { 0,                                                   0             }
};

typeLayout GetDebugPrintLevelMsgReqLayout[] =
{
  { 1, sizeof(uint16) },
  { 0, 0              }
};

typeLayout GetDebugPrintLevelMsgRepLayout[] =
{
  { 1, sizeof(uint8) },
  { 0, 0             }
};

typeLayout SetDebugPrintLevelMsgReqLayout[] =
{
  { 1, sizeof(uint16) },
  { 2, sizeof(uint8)  },
  { 0, 0              }
};

typeLayout GetDebugDataDumpMsgReqLayout[] =
{
  { 1, sizeof(uint32) },
  { 0, 0              }
};
  
typeLayout GetDebugDataDumpMsgRepLayout[] =
{
  { 2, sizeof(uint32) },
  { 1, sizeof(uint8)  },
  { 0, 0              }
};
    
typeLayout GetDebugDumpMaskMsgReqLayout[] =
{
  { 1, sizeof(uint8) },
  { 0, 0             }
};

typeLayout GetDebugDumpMaskMsgRepLayout[] =
{
  { ((BCM_NBR_OF_DUMPS-1)>>3) + 1, sizeof(uint8) },
  { 0, 0                                         }
};
  
typeLayout SetDebugDumpMaskMsgReqLayout[] =
{
  { ((BCM_NBR_OF_DUMPS-1)>>3) + 2, sizeof(uint8) },
  { 0, 0                                         }
};

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

HMI_MSG_ALL_LAYOUT(GetLogAndDebugInfo, GET_LOG_AND_DEBUG_INFO,
                   GetLogAndDebugInfoMsgReq, GetLogAndDebugInfoMsgRep)

HMI_MSG_ALL_LAYOUT(GetDebugPrintLevel, GET_DEBUG_PRINT_LEVEL,
                   GetDebugPrintLevelMsgReq, GetDebugPrintLevelMsgRep)

HMI_MSG_REQ_LAYOUT(SetDebugPrintLevel, SET_DEBUG_PRINT_LEVEL,
                   SetDebugPrintLevelMsgReq)

HMI_MSG_ALL_LAYOUT(GetDebugDataDump, GET_DEBUG_DATA_DUMP,
                   GetDebugDataDumpMsgReq, GetDebugDataDumpMsgRep)

HMI_MSG_ALL_LAYOUT(GetDebugDumpMask, GET_DEBUG_DUMP_MASK,
                   GetDebugDumpMaskMsgReq, GetDebugDumpMaskMsgRep)

HMI_MSG_REQ_LAYOUT(SetDebugDumpMask, SET_DEBUG_DUMP_MASK,
                   SetDebugDumpMaskMsgReq)

/* }}} */
