/******************************************************************************/
/*               Copyright 2001, 2002, 2003 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.                                                       */
/******************************************************************************/

/* $Id: bcm_hmiLcaMsg.c,v 1.15 2004/08/09 20:43:40 eduymeli Exp $ */

#include "bcm_hmiLcaMsg.h"
#include "bcm_hmiMsgDef.h"

typeLayout LcaDeviceConfigLayout[] = {
 { 1 , 1 }, /* keyId */
 { 1 , 1 }, /* keyValue */
 { 1 , 2 }, /* noOfKeys */
 { 1 , 1 }, /* filterMaxAge */
 { 1 , 1 }, /* ageTimeExponent */
 { 1 , 2 }, /* atmFwdEtherType */
 { 6 , 1 }, /* atmFwdDstMAC */
 { 6 , 1 }, /* atmFwdSrcMAC */
 { 1 , 2 }, /* flags */
 { 0 , 0 }
};

typeLayout LcaDeviceInfoLayout[] = {
 { 1 , 2 }, /* noOfKeys */
 { 1 , 2 }, /* dsMemorySize */
 { 0 , 0 }
};

typeLayout LcaMulticastGroupDefLayout[] = {
 { 1 , 1 }, /* number */
 { 3 , 1 }, /* reserved */
 { 1 , 4 }, /* subnet */
 { 1 , 4 }, /* netmask */
 { 1 , 1 }, /* aal5Group */
 { 1 , 1 }, /* atmHeader */
 { 1 , 1 }, /* atmPriority */
 { 1 , 1 }, /* atmRate */
 { 64 , 1 }, /* buffers */
 { 64 , 1 }, /* filters */
 { 48 , 1 }, /* portPairs */
 { 0 , 0 }
};

typeLayout LcaMcastGroupConfigLayout[] = {
 { 1 , 1 }, /* keyId */
 { 1 , 1 }, /* keyValue */
 { 2 , 1 }, /* reserved */
 { 1 , 1 }, /* number */
 { 3 , 1 }, /* reserved */
 { 1 , 4 }, /* subnet */
 { 1 , 4 }, /* netmask */
 { 1 , 1 }, /* aal5Group */
 { 1 , 1 }, /* atmHeader */
 { 1 , 1 }, /* atmPriority */
 { 1 , 1 }, /* reserved */
 { 1 , 1 }, /* atmSCR */
 { 1 , 1 }, /* atmMBS */
 { 64 , 1 }, /* buffers */
 { 64 , 1 }, /* filters */
 { 48 , 1 }, /* portPairs */
 { 0 , 0 }
};

typeLayout LcaStatusLayout[] = {
 { 2 , 1 }, /* status */
 { 2 , 1 }, /* reserved */
 { 64 , 1 }, /* usOverflows */
 { 64 , 1 }, /* dsOverflows */
 { 64 , 1 }, /* usAal5OrFcsErrorDrop */
 { 64 , 1 }, /* usLlcFormatErrorDrop */
 { 64 , 1 }, /* usCamRejectErrorDrop */
 { 64 , 1 }, /* newCamEntries */
 { 64 , 1 }, /* removedCamEntries */
 { 0 , 0 }
};

typeLayout LcaLinkCountersLayout[] = {
 { 1 , 4 }, /* usPackets */
 { 1 , 4 }, /* dsPackets */
 { 1 , 4 }, /* dsFcsErrors */
 { 0 , 0 }
};

typeLayout LcaXcvrReadSpecLayout[] = {
 { 1 , 2 }, /* link */
 { 1 , 2 }, /* registerID */
 { 0 , 0 }
};

typeLayout LcaXcvrWriteSpecLayout[] = {
 { 1 , 2 }, /* link */
 { 1 , 2 }, /* registerID */
 { 1 , 2 }, /* value */
 { 0 , 0 }
};

typeLayout LcaLocationLayout[] = {
 { 1 , 8 }, /* boardId */
 { 1 , 1 }, /* pos */
 { 7 , 1 }, /* reserved */
 { 0 , 0 }
};

typeLayout LcaUpstreamPortConfigLayout[] = {
 { 1 , 1 }, /* keyId */
 { 1 , 1 }, /* keyValue */
 { 1 , 2 }, /* filter */
 { 1 , 1 }, /* pos */
 { 1 , 1 }, /* line */
 { 1 , 1 }, /* port */
 { 1 , 1 }, /* atmHeader */
 { 1 , 1 }, /* scanLength */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* flags */
 { 0 , 0 }
};

typeLayout LcaDownstreamPortConfigLayout[] = {
 { 1 , 1 }, /* keyId */
 { 1 , 1 }, /* keyValue */
 { 1 , 1 }, /* pos */
 { 1 , 1 }, /* line */
 { 1 , 1 }, /* portPair */
 { 1 , 1 }, /* aal5Group */
 { 2 , 2 }, /* buffer */
 { 2 , 1 }, /* atmHeader */
 { 2 , 1 }, /* enable */
 { 1 , 2 }, /* atmSCR */
 { 1 , 2 }, /* atmMBS */
 { 1 , 1 }, /* atmPriority */
 { 1 , 1 }, /* flags */
 { 0 , 0 }
};

typeLayout LcaMacFilterConfigLayout[] = {
 { 1 , 1 }, /* keyId */
 { 1 , 1 }, /* keyValue */
 { 1 , 2 }, /* filter */
 { 1 , 2 }, /* buffer */
 { 6 , 1 }, /* macAddress */
 { 1 , 2 }, /* vlan */
 { 1 , 1 }, /* reserved */
 { 1 , 1 }, /* ageTime */
 { 1 , 2 }, /* flags */
 { 0 , 0 }
};

typeLayout LcaVpVcLayout[] = {
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 0 , 0 }
};

typeLayout LcaAtmHeadersLayout[] = {
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 1 , 1 }, /* vp */
 { 1 , 1 }, /* reserved */
 { 1 , 2 }, /* vc */
 { 0 , 0 }
};

typeLayout LcaCountersLayout[] = {
 { 1 , 4 }, /* usPackets */
 { 1 , 4 }, /* dsPackets */
 { 1 , 4 }, /* dsFcsErrors */
 { 1 , 4 }, /* usPackets */
 { 1 , 4 }, /* dsPackets */
 { 1 , 4 }, /* dsFcsErrors */
 { 0 , 0 }
};

typeLayout LcaSnoopedCellsLayout[] = {
 { 9 , 4 }, /* sources */
 { 432 , 1 }, /* cells */
 { 0 , 0 }
};

typeLayout LcaSnoopIdLayout[] = {
 { 1 , 1 }, /* direction */
 { 1 , 1 }, /* priority */
 { 0 , 0 }
};

typeLayout LcaVersionLayout[] = {
 { 1 , 2 }, /* majorSoftwareVersion */
 { 1 , 1 }, /* minorSoftwareVersion */
 { 1 , 1 }, /* fixSoftwareVersion */
 { 1 , 2 }, /* reserved */
 { 1 , 1 }, /* hmiMajorVersion */
 { 1 , 1 }, /* hmiMinorVersion */
 { 0 , 0 }
};

typeLayout LcaDownstreamBufferConfigLayout[] = {
 { 8 , 2 }, /* noOfBuffers */
 { 0 , 0 }
};

typeLayout LcaInterruptStatusLayout[] = {
 { 2 , 4 }, /* status */
 { 2 , 4 }, /* mask */
 { 0 , 0 }
};

typeLayout LcaInterruptMaskLayout[] = {
 { 2 , 4 }, /* affectedInterrupts */
 { 2 , 4 }, /* newMask */
 { 0 , 0 }
};

typeLayout LcaMacEntryLayout[] = {
 { 6 , 1 }, /* mac */
 { 1 , 1 }, /* enabled */
 { 0 , 0 }
};

typeLayout LcaProtocolFilterSettingLayout[] = {
 { 1 , 1 }, /* filter */
 { 1 , 1 }, /* reserved1 */
 { 1 , 2 }, /* etherType */
 { 1 , 1 }, /* ipProtocol */
 { 1 , 1 }, /* reserved2 */
 { 1 , 2 }, /* srcPort */
 { 1 , 2 }, /* dstPort */
 { 1 , 1 }, /* srcPortMask */
 { 1 , 1 }, /* dstPortMask */
 { 1 , 2 }, /* flags */
 { 1 , 1 }, /* grouping */
 { 1 , 1 }, /* reserved3 */
 { 0 , 0 }
};

typeLayout LcaF4F5Layout[] = {
 { 1 , 1 }, /* noOfCells */
 { 424 , 1 }, /* data */
 { 0 , 0 }
};

typeLayout LcaInjectedCellLayout[] = {
 { 1 , 1 }, /* buffer */
 { 1 , 1 }, /* overrideVpvc */
 { 1 , 1 }, /* endOfFrame */
 { 1 , 1 }, /* direction */
 { 53 , 1 }, /* data */
 { 0 , 0 }
};

typeLayout LcaInjectedFrameLayout[] = {
 { 1 , 1 }, /* noOfCells */
 { 1 , 1 }, /* buffer */
 { 1 , 1 }, /* overrideVpvc */
 { 1 , 1 }, /* endOfFrame */
 { 1 , 1 }, /* direction */
 { 53 , 1 }, /* data */
 { 1 , 1 }, /* buffer */
 { 1 , 1 }, /* overrideVpvc */
 { 1 , 1 }, /* endOfFrame */
 { 1 , 1 }, /* direction */
 { 53 , 1 }, /* data */
 { 1 , 1 }, /* buffer */
 { 1 , 1 }, /* overrideVpvc */
 { 1 , 1 }, /* endOfFrame */
 { 1 , 1 }, /* direction */
 { 53 , 1 }, /* data */
 { 1 , 1 }, /* buffer */
 { 1 , 1 }, /* overrideVpvc */
 { 1 , 1 }, /* endOfFrame */
 { 1 , 1 }, /* direction */
 { 53 , 1 }, /* data */
 { 1 , 1 }, /* buffer */
 { 1 , 1 }, /* overrideVpvc */
 { 1 , 1 }, /* endOfFrame */
 { 1 , 1 }, /* direction */
 { 53 , 1 }, /* data */
 { 1 , 1 }, /* buffer */
 { 1 , 1 }, /* overrideVpvc */
 { 1 , 1 }, /* endOfFrame */
 { 1 , 1 }, /* direction */
 { 53 , 1 }, /* data */
 { 1 , 1 }, /* buffer */
 { 1 , 1 }, /* overrideVpvc */
 { 1 , 1 }, /* endOfFrame */
 { 1 , 1 }, /* direction */
 { 53 , 1 }, /* data */
 { 1 , 1 }, /* buffer */
 { 1 , 1 }, /* overrideVpvc */
 { 1 , 1 }, /* endOfFrame */
 { 1 , 1 }, /* direction */
 { 53 , 1 }, /* data */
 { 0 , 0 }
};

typeLayout LcaOamCellLayout[] = {
 { 12, 4 }, /* cells */
 { 0 , 0 }
};

typeLayout LcaMonitoredPortLayout[] = {
 { 1, 1 }, /* enable */
 { 1, 1 }, /* pos */
 { 1, 1 }, /* line */
 { 1, 1 }, /* port */
 { 1, 2 }, /* buffer */
 { 0, 0 }
};


HMI_MSG_ALL_LAYOUT(LcaGetCounters, LCA_GET_COUNTERS, uint8, LcaCounters)
HMI_MSG_ALL_LAYOUT(LcaGetMacEntry, LCA_GET_MAC_ENTRY, uint16, LcaMacEntry)
HMI_MSG_ALL_LAYOUT(LcaGetSnoopedCells, LCA_GET_SNOOPED_CELLS, LcaSnoopId, LcaSnoopedCells)
HMI_MSG_ALL_LAYOUT(LcaGetStatus, LCA_GET_STATUS, uint8, LcaStatus)
HMI_MSG_ALL_LAYOUT(LcaTransceiverRead, LCA_TRANSCEIVER_READ, LcaXcvrReadSpec, uint16)
HMI_MSG_REP_LAYOUT(LcaGetDeviceInfo, LCA_GET_DEVICE_INFO, LcaDeviceInfo)
HMI_MSG_REP_LAYOUT(LcaGetF4F5, LCA_GET_F4F5, LcaF4F5)
HMI_MSG_REP_LAYOUT(LcaGetInterruptStatus, LCA_GET_INTERRUPT_STATUS, LcaInterruptStatus)
HMI_MSG_REP_LAYOUT(LcaGetKeys, LCA_GET_KEYS, uint8)
HMI_MSG_REP_LAYOUT(LcaGetLocation, LCA_GET_LOCATION, LcaLocation)
HMI_MSG_REP_LAYOUT(LcaGetVersion, LCA_GET_VERSION, LcaVersion)
HMI_MSG_REQ_LAYOUT(LcaConfigDevice, LCA_CONFIG_DEVICE, LcaDeviceConfig)
HMI_MSG_REQ_LAYOUT(LcaConfigDownstreamBuffers, LCA_CONFIG_DS_BUFFERS, LcaDownstreamBufferConfig)
HMI_MSG_REQ_LAYOUT(LcaConfigDownstreamPort, LCA_CONFIG_DSPORT, LcaDownstreamPortConfig)
HMI_MSG_REQ_LAYOUT(LcaConfigMacFilter, LCA_CONFIG_MAC_FILTER, LcaMacFilterConfig)
HMI_MSG_REQ_LAYOUT(LcaConfigUpstreamPort, LCA_CONFIG_USPORT, LcaUpstreamPortConfig)
HMI_MSG_REQ_LAYOUT(LcaDefineAtmHeaders, LCA_DEFINE_ATM_HEADERS, LcaAtmHeaders)
HMI_MSG_REQ_LAYOUT(LcaDefineMulticastGroup, LCA_DEFINE_MULTICAST_GROUP, LcaMcastGroupConfig)
HMI_MSG_REQ_LAYOUT(LcaInjectFrame, LCA_INJECT_FRAME, LcaInjectedFrame)
HMI_MSG_REQ_LAYOUT(LcaSetInterruptMask, LCA_SET_INTERRUPT_MASK, LcaInterruptMask)
HMI_MSG_REQ_LAYOUT(LcaSetProtocolFilter, LCA_SET_PROTOCOL_FILTER, LcaProtocolFilterSetting)
HMI_MSG_REQ_LAYOUT(LcaTransceiverWrite, LCA_TRANSCEIVER_WRITE, LcaXcvrWriteSpec)
HMI_MSG_REQ_LAYOUT(LcaWriteOam, LCA_WRITE_OAM, LcaOamCell)
HMI_MSG_REQ_LAYOUT(LcaMonitorMulticast, LCA_MONITOR_MULTICAST, LcaMonitoredPort)
