[Feature]Upload Modem source code

Change-Id: Id4294f30faced84d3e6fd6d5e61e1111bf287a37
diff --git a/mcu/interface/protocol/l2_c2k/1xrtt/lmddefs.h b/mcu/interface/protocol/l2_c2k/1xrtt/lmddefs.h
new file mode 100644
index 0000000..79e5a03
--- /dev/null
+++ b/mcu/interface/protocol/l2_c2k/1xrtt/lmddefs.h
@@ -0,0 +1,1297 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2016
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS (""MEDIATEK SOFTWARE"")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN ""AS-IS"" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*************************************************************
+*
+* This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc.  
+* 
+* Any unauthorized use inconsistent with the terms of such license is strictly prohibited.
+* 
+* Copyright (c) 1998-2010 VIA Telecom, Inc.  All rights reserved.
+*
+*************************************************************/
+#ifndef _LMDDEFS_H_
+#define _LMDDEFS_H_
+/*****************************************************************************
+* 
+* FILE NAME   : lmddefs.h
+*
+* DESCRIPTION : LMD unit definitions
+*
+* HISTORY     :
+*     See Log at end of file
+*
+*****************************************************************************/
+/*----------------------------------------------------------------------------
+ Include Files
+----------------------------------------------------------------------------*/
+
+#include "lmdapi.h"
+#include "lmdsapi.h"
+#include "sysapi.h"
+#include "pswapi.h"
+#include "l1dapi.h"
+#include "rlpwapi.h"
+#include "cpbuf.h"
+#include "lmderr.h"
+#include "xl2_em.h"
+#include "lmd_audio.h"
+
+/* Bit maps for the Physical channel type */
+#define     PHY_RES_NULL             0x00
+#define     PHY_RES_FCH              0x01
+#define     PHY_RES_DCCH             0x02
+#define     PHY_RES_SCH0             0x04
+#define     PHY_RES_SCH1             0x08
+
+/* MUX Pdu Types */
+#define MUXPDUTYPE1                1
+#define MUXPDUTYPE2                2
+#define MUXPUDTYPE3                3
+#define MUXPDUTYPE4                4
+#define MUXPDUTYPE5                5
+#define MUXPDUTYPE6                6
+
+#define MUX_PDU_TYPE_5_SIGNALING_LIM 10
+
+#ifdef MTK_CBP_ENCRYPT_VOICE
+/*Used for VoiceEncryption in so32944*/
+#define PLAINT_LEN    171
+#define PLAINT_LEN_IN_SIZE 22
+#define PLAINT_LEN_IN_WORD 11
+#endif
+
+/*---------------------------------------------------------------
+*  IPC Direct Buffer Mailbox Interface
+*---------------------------------------------------------------*/
+
+/* Direct buffer maximum sizes */
+#define  REV_EACH_MBX_SIZE      47
+
+#define  REV_FCH_MBX_SIZE       IPC_DTA_MBOX_C2M_CH0_SIZE 
+#define  REV_DCCH_MBX_SIZE      IPC_DTA_MBOX_C2M_CH1_SIZE
+#define  REV_SCH_MBX_SIZE       IPC_DTA_MBOX_C2M_CH2_SIZE
+#define  REV_FCH_MBX_SIZE_IN_DB_WORD  IPC_DTA_MBOX_C2M_CH0_SIZE_IN_DB_WORDS
+#define  REV_SCH_MBX_SIZE_IN_DB_WORD  IPC_DTA_MBOX_C2M_CH2_SIZE_IN_DB_WORDS
+
+/*  FCH MUXPDU1 number of bits definition */
+#define   FCH_MUX_PDU1_9600        0x0080
+#define   FCH_MUX_PDU1_4800        0x0040
+#define   FCH_MUX_PDU1_2400        0x0020
+#define   FCH_MUX_PDU1_1200        0x0010
+
+/*  FCH MUXPDU2 number of bits definition */
+#define   FCH_MUX_PDU2_14400       0x0080
+#define   FCH_MUX_PDU2_7200        0x0040
+#define   FCH_MUX_PDU2_3600        0x0020
+#define   FCH_MUX_PDU2_1800        0x0010
+
+#define   FCH_MUX_PDU_ALL_RATE     0x00F0
+
+/* Channel type used by the reverse traffic channel carrier type data struct */
+#define  LMD_REV_FCH            0x01
+#define  LMD_REV_DCCH           0x02
+#define  LMD_REV_SCH            0x04
+
+#define  LMD_FRAME_DELAY_TRAFFIC_CHAN 1
+#define  MUX_PDU_NO_HEADER         0x07
+
+/* the rate type of the PT data */
+/* The DSPV packet Rate representation, using IpcSpchSrvcOptRateT */
+/*  The DSPM will use the LmdFrameRateFwdT, which Full = 0 */
+#define  PT_BLANK        IPC_SPCH_BLANK      /* 0 */
+#define  PT_EIGHTH       IPC_SPCH_EIGHTH
+#define  PT_QUARTER      IPC_SPCH_QUARTER   /* not used for SSO 3 */
+#define  PT_HALF         IPC_SPCH_HALF
+#define  PT_FULL         IPC_SPCH_FULL
+#define  PT_ERASURE      IPC_SPCH_ERASURE
+#define  PT_FULL_LIKELY  IPC_SPCH_FULL_LIKELY
+#define  PT_NON_CRITICAL IPC_SPCH_NON_CRITICAL
+
+
+#define  RLP_FRAME_TYPE_BITS           2 /* RLP request LMD to read FRAME Type*/   
+
+/* Static Tdso Data Buffer count and size in bytes
+   The size is derived from the largest size of a PDU block.
+   The count is (NumPdus for Fch/Dcch + NumPdus for Sch) * 4 = (1+8) * 4 = 36.
+   We quadruble the count to have some cushion in case Tdso generates more
+   data than LmdRevch.c can handle */
+#define TDSO_BUFFER_SIZE         68
+#define TDSO_BUFFER_COUNT        36
+
+
+#define SCH_INFINITE_DURATION     0xFFFF
+#define SCH_INFINITE_DTX_DURATION 0x000F
+
+
+/* LSO counters */
+#define RECEIVE_ACK_NAK_COUNTERS_MAX  4
+extern kal_uint32 LsoFAckChCounters[RECEIVE_ACK_NAK_COUNTERS_MAX];
+typedef enum
+{
+   LSO_FACKCH_EACK_RACK   = 0,
+   LSO_FACKCH_EACK_RNAK   = 1,
+   LSO_FACKCH_ENAK_RNAK   = 2,
+   LSO_FACKCH_ENAK_RACK   = 3
+} LsoReceiveAckNakCountersT;
+/*the amount of counters*/
+
+/*---------------------------------------------------------------
+* Task Id definitions used for primary traffic routing
+*---------------------------------------------------------------*/
+
+#define   MARKOV_TASK      (MOD_LMD|0x8000)
+/* EACH Frame Size limitation...*/
+
+/* 
+   Each of the following data structures are passed as parameters to
+   functions which write various LMD channel data to the IPC direct
+   buffer mailbox.
+*/
+
+/* Access channel data structure */
+typedef struct
+{
+   kal_uint8   DataLength; /* Number of bytes in access channel data */
+   kal_uint8*  AccessData; /* Pointer to access channel data */
+} LmdAccessDataCarrierT;
+
+/* Fch data structure */
+typedef struct
+{
+   kal_uint16  RevFchRate;                   /* Fch rate */
+   kal_uint16  RevFchLength;                 /* Number of fch bytes */
+   kal_uint16  RevFchData[REV_FCH_MBX_SIZE]; /* Array of fch data */
+} LmdRevFchCarrierT;
+
+/* Dcch data structure */
+typedef struct
+{
+   kal_uint16  RevDcchLength;                  /* Number of dcch bytes */
+   kal_uint16  RevDcchData[REV_DCCH_MBX_SIZE]; /* Array of fch data */
+} LmdRevDcchCarrierT;
+
+/* Sch data structure */
+typedef struct
+{
+   kal_uint16  RevSchLength;                 /* Number of sch bytes */
+   kal_uint16  RevSchData[REV_SCH_MBX_SIZE]; /* Array of sch data */
+} LmdRevSchCarrierT;
+
+/* Traffic channel data structure */
+typedef struct
+{
+   kal_uint8             ChannelType; /* FCH, DCCH, SCH */
+   LmdRevFchCarrierT    *FchCarrierP; /* Pointer to fch data struct */
+   LmdRevDcchCarrierT   *DcchCarrierP;/* Pointer to dcch data struct */
+   LmdRevSchCarrierT    *SchCarrierP; /* Pointer to sch data struct */
+} LmdReverseTchCarrierT;
+
+typedef struct
+{
+   kal_uint16 NumBits;
+   kal_uint8  *DataP;
+} LmdDataTypeT;
+
+/* Data structures used to communicate service configurations to the reverse object */
+
+/* The FCH rev mux format */
+typedef struct
+{
+   kal_uint8  FchHeader;      /* The header to use for fch */
+   kal_uint8  FchHeaderBits;  /* The number of bits in the fch header */
+   kal_uint16 FchPtBits;      /* The number of primary traffic bits in fch */
+   kal_uint16 FchSigBits;     /* The number of signaling bits in fch */
+   kal_uint8  FchSigNumInsertBits;/* The number of signaling insert bits in fch */
+   kal_uint16 FchSecBits;     /* The number of secondary traffic bits in fch */
+   kal_bool   CreateNullFrame;/* Boolean indicating the frame should be null */
+   LmdRevFundRateTypeT  FchRate;     /* The FCH rate information used for DSPM. */
+   SysMultiplexOptionT MuxOpt; /* The current FCH mux option */
+   kal_uint16 NumBits;             /* Number of bits per second */
+   PswFrameCatagoryT Category; /* Frame category */
+   kal_bool NonCritical;
+}FchRevMuxFormatT;
+
+/* The DCCH rev mux format */
+typedef struct
+{
+   kal_uint8  DcchHeader;      /* The header to use for dcch */
+   kal_uint8  DcchHeaderBits;  /* The number of bits in the dcch header */
+   kal_uint16 DcchPtBits;      /* The number of primary traffic bits in dcch */
+   kal_uint16 DcchSigBits;     /* The number of signaling bits in dcch */
+   kal_uint8  DcchSigNumInsertBits;/* The number of signaling insert bits in dcch */
+   kal_uint16 DcchSecBits;     /* The number of secondary traffic bits in dcch */
+   kal_bool   CreateNullFrame;/* Boolean indicating the frame should be null */
+   SysMultiplexOptionT MuxOpt; /* The current DCCH mux option */
+   kal_uint16 NumBits;             /* Number of bits per second */
+   PswFrameCatagoryT Category; /* Frame category */
+}DcchRevMuxFormatT;
+
+typedef struct
+{
+  kal_uint8 SrId;
+  kal_uint8 FrameFormat;
+}LmdSvcRevDsSchInfoT;
+
+typedef struct
+{
+  kal_uint8                NumberOfSchPdu; /* Getting it from the RLP Msg*/
+  LmdSvcRevDsSchInfoT  PduInfo[MAX_PDU_NUM];
+} LmdSvcDsSchT;
+
+/* The SCH rev mux format */
+typedef struct
+{
+   kal_uint8     sch_id;
+   kal_bool      Coding;      /* True-- Turbo is On */
+   kal_uint8     NumLtu;      /* Number of LTU */
+   kal_uint16    LtuBits;
+   kal_uint8     NumPdu;      /* Number of PDU: in case LTU = 0: total
+                          PDU num in a frame; LTU >=2, PDU num
+                          per LTU.*/
+   kal_uint8     PduHeader;   /* The header of each Pdu:  Only for
+                          MuxPdu Type 1 and 2. in the MuxPdu
+                          Type3, the Header is sr_id + '0000'
+                          for Mux PDu3 Filled PDU:
+                          Header = '111' + '0000'
+                       */
+   kal_uint8     MuxPduType;
+   kal_uint8     NumFilledPdu;/* LTU >0 only */
+   kal_uint8     HeaderBits;  /* the number of header in each PDU */
+   kal_uint16    PduBits;
+   SysMultiplexOptionT   MuxOpt; /* reverse Mux Option*/
+   LmdSvcDsSchT         *RevSchConfig;/* contains each Pdu's SrId and FrameType*/ 
+}SchRevMuxFormatT;
+
+/* 
+   The structure that ties it all together and is filled in by the service
+   configuration object 
+*/
+typedef struct
+{
+   FchRevMuxFormatT  FchRevMuxFormat;
+   DcchRevMuxFormatT DcchRevMuxFormat;
+   SchRevMuxFormatT  SchRevMuxFormat[SYS_MAX_FSCH];
+}LmdRevSvcConfigT;
+
+/* Data structure used to communicate service configurations to the forward object */
+typedef struct
+{
+   kal_uint16     NumBits; /* Number of primary/sec traffic bits associated with 
+                          this physical channel */
+   kal_uint16     Routing; 
+                         /* How the primary/sec traffic for this channel should be 
+                          routed, this contains the task id for the task to
+                          which the data should be routed */
+   kal_uint8     SrId;     /* Primary/sec Channel Sr_id:  used in RLP Fwd Frame Ind. */
+   kal_uint32    MsgId;    /* The message id that should be used to route the 
+                          primary/sec traffic to the PtRouting task */
+}SubChnlT;
+
+typedef  struct
+{
+  /**---------- Signaling channel ------------------------------------------*/
+  kal_uint16              NumBits; /* Number of signaling bits associated with this
+                                  physical channel */
+  kal_uint16          Routing; 
+                                  /* How the signaling for this channel should be routed,
+                                  this contains the task id for the task to which the data
+                                  should be routed */
+  PswFrameCatagoryT   Category;
+  PswFrameQuality     Quality; /* Good for bad signalling frame */
+  SysMultiplexOptionT MuxOpt;
+  kal_uint32              MsgId;   /* The message id that should be used to route the 
+                                  signaling data to the SigRouting task */
+}SigChnlT;
+
+typedef struct
+{
+  kal_bool       IsSecondary;
+  kal_uint8      HeaderBits; /* Number of Headerbits */
+  kal_uint8      DataBits;
+  kal_uint16     Routing;
+}FwdScchT;
+
+typedef struct
+{ 
+  kal_uint8               sch_id;         
+  kal_uint8               NumLtu;
+  kal_uint16              LtuBits; /* Num of each Ltu's length in bits*/
+  kal_uint8               NumPdu;  /* Num of PDU: in case LTU = 0: total
+                                  PDU num in a frame; LTU >=2, PDU num
+                                  per LTU.*/
+  kal_uint8               MuxPduType; /* MuxPdu type for each PDU */
+  SysRlpFrameRateE    PduRate;
+  kal_uint8               PduHeaderBits;
+  kal_uint16               PduBits; 
+  kal_uint8               PduSrId; /* only offered in case PDUType1 or 2 */
+  kal_uint16          Routing;       
+  SysMultiplexOptionT mux_option;
+  kal_uint32              MsgId;
+}FwdSchT;
+
+/* SCH Frame from L1D public buffer*/
+typedef  struct
+{
+   kal_uint32     TimeStamp;        /* System time in frames, needed by TDSO */
+   kal_uint16     NumMuxPdus;       /* Number of MuxPDUS */
+   kal_uint16     NumGoodFrames;
+   kal_uint8      MuxPduType;
+   LmdSchHeaderT  Header[1];
+} LmdSchFrameT;
+
+
+typedef struct
+{
+   SubChnlT Primary;
+   SigChnlT Signaling;
+   SubChnlT Secondary;
+   /*----------- Header and null frame indicator --------------------- */
+   kal_uint8    HeaderBits;        /* Number of header bits for this physical channel */
+   kal_bool     NullFramePossible; /* Identifies that the forward object should determine if
+                                  this in fact is a null frame */
+   kal_uint16   NumBits;           /* Number of bits per second */
+   /*----------- Channel assigned --------------------- */
+   kal_bool     FchAssigned;
+   kal_bool     DcchAssigned;      /* Dcch assigned kal_boolean, indicates that Dcch is assigned. */
+}FwdDtchT;
+
+typedef enum
+{
+    FFch = 0,
+    FDcch,
+    FScch,
+    FSch,
+    FNull
+}FwdDataChnlT;
+
+/* Data structure used to communicate service configurations to the forward object */
+typedef struct
+{
+   FwdDataChnlT PhysChnlType; /* Channel type indicator -- FCH, DCCH, SCCH, SCH */
+   FwdDtchT     Dtch;
+   FwdScchT     Scch;
+   FwdSchT      Sch[SYS_MAX_FSCH];
+}LmdFwdSvcConfigT;
+
+/* data info sent to SVC */
+typedef struct 
+{
+  LmdFwdChnlTypeT     PhysChan;   /* this will tell SVC FWD receives SCH data.*/
+  kal_uint8            Header; 
+  kal_uint16           DtchNumBits;/* Only for FCH, DCCH*/
+  LmdFwdFrameRateT DtchRate;   /* Only for FCH, DCCH*/
+}FwdDataT;
+
+typedef  enum
+{   
+   LMD_REV_FCH_PT = 0x0,
+   LMD_REV_FCH_SIG,  
+   LMD_REV_FCH_SEC, 
+   LMD_REV_DCCH_PT,
+   LMD_REV_DCCH_SIG,
+   LMD_REV_DCCH_SEC,
+   LMD_REV_NONE
+} LmdRevPhysChnlTypeT;
+
+typedef struct 
+{
+   //ExeMailboxIdT       PtMbox;
+   LmdRevPhysChnlTypeT PtPhysChannel;/* the PT mailbox's carrier channel */
+}LmdPtMboxSetT;
+
+typedef struct 
+{
+   //ExeMailboxIdT       Mbox;           /* used for frame request, then RLP put data in this Mbox */
+   kal_uint8               PrimSrId;       /* used for frame request */
+   LmdRevPhysChnlTypeT PrimChannel;    /* used for Rev to dispose data */
+   RlpFrameRateTabT    PrimRateMax;    /* used for Frame request*/
+   kal_uint8               SecSrId;        /* used for frame request */
+   LmdRevPhysChnlTypeT SecChannel;     /* used for Rev to dispose rev data */
+   RlpFrameRateTabT    SecRateMax;     /* used for Frame request*/
+   kal_uint8               SchId;          /* SCH id for the REV channel*/
+   //ExeMailboxIdT       SchMbox;
+   kal_uint8               NumberOfSchPDU; /* Number of PDU's allowed */
+   SysRlpFrameRateE    PDURate; 
+}LmdRlpMboxSetT;
+
+typedef struct
+{     
+   LmdRevPhysChnlTypeT PtPhysChannel;
+   LmdRlpMboxSetT*     RlpFch;   /*RLP mail FCH setups*/ 
+   LmdRevPhysChnlTypeT SigPhysChannel; /* Signaling carrier channel */
+   kal_bool                RlpDtchShareMbox;
+}LmdRevMboxSetT;
+
+typedef struct
+{
+   kal_uint16 PtBits;
+   kal_uint16 PtRate;
+}LmdSvcPtDataT;
+
+typedef struct
+{
+   kal_uint8            PrimSrId;
+   SysRlpFrameRateE PrimRate;
+   kal_uint8            SecSrId;
+   SysRlpFrameRateE SecRate;
+}LmdSvcDsDtchT;
+
+/* The Fsch config info from SVC to FWD */
+typedef struct
+{
+  kal_bool            PilotGatingUseRate;
+  kal_bool            ForSchFerRep;
+  kal_uint8           sch_id;
+
+}LmdSvcFschInfoT;
+
+/* The Rsch config info from SVC to FWD */
+typedef struct
+{
+  kal_uint16            RevSchDtxDuration;
+  kal_uint8             sch_id;
+  kal_uint16            RevSchDuration;
+}LmdSvcRschInfoT;
+
+
+/*
+   Markov structures
+ */
+/* Markov data message */
+typedef struct
+{
+    kal_uint16 MuxCat;                              /* mux option category  */
+    kal_uint16 RxNumBits;                           /* size of data in bits */
+    kal_uint16 RxPacket [MAX_FCH_FRAME_WORD_LEN];   /* data */
+} LmdMsoFwdChDataMsgT;
+
+/* Markov control message */
+typedef struct
+{
+   kal_uint8 CtlRecType;
+    union
+   {
+      kal_uint8 Control;
+      kal_uint8 VectCounterId;
+   } Directive;
+} LmdMsoControlDataT;
+
+/* Markov Clear Spy Statistics message */
+typedef enum
+{
+   CLEAR_TX_STATS = 0x01,
+   CLEAR_RX_STATS = 0x02,
+   CLEAR_BOTH_STATS = 0x03
+} LmdDirectionFlagT;
+
+typedef struct
+{
+   LmdDirectionFlagT    DirFlag;  /* a bit mask variable (TX, RX, or both) */ 
+} LmdMsoClearStatsMsgT;
+
+/*
+   LSO structures
+ */
+
+
+/*SO75 control message*/
+typedef struct
+{
+	kal_uint8         CtlRecType;
+	union
+	{
+		kal_uint8 AckOrNak;//wait to be confirmed
+		kal_uint8 VectCounterId;
+	}Directive;
+    kal_uint8         ClearCounters;
+}  LmdLsoControlDataT;
+
+/*Control for ACK Channel(used for 1xAdv)*/
+typedef enum
+{
+    	DEPEND =0x0,
+		ACK    =0x1,
+		NAK    =0x2
+} AckNakControlT;
+
+
+/*
+   Tdso definitions
+ */
+/* Tdso connect message structure */
+typedef struct
+{
+   kal_uint8             RC;            /* Radio Configuration     */
+   kal_uint8             ChanMask;      /* PHY_RES_FCH, DCCH, SCH0 or SCH1 */
+   LmdTrafficTypeT   TrafficType;   /* PRIMARY or SECONDARY    */
+   kal_uint16            MuxOptions[4]; /* 0 for Fch, 1 for Dcch, 2 for Sch0, 3 for Sch1 */
+} LmdTdsoConfigT;
+
+typedef struct
+{
+   LmdTdsoConfigT    Fwd;
+   LmdTdsoConfigT    Rev;
+} LmdTdsoConnectMsgT;
+
+/* Tdso data message structures */
+typedef enum
+{
+   DCID_FCH = 0,
+   DCID_DCCH,
+   DCID_SCH0,
+   DCID_SCH1,
+   DCID_NULL
+} LmdDataChanIdT;
+
+typedef struct
+{
+   LmdDataChanIdT    DataChanId;       /* FCH, DCCH, SCH0 or SCH1 */
+   kal_uint16            NumPdus;
+   kal_uint16            NumBits;
+   kal_uint8             *DataP[8];
+} LmdTdsoDataT;
+
+typedef struct
+{
+   kal_uint8             FwdChanMask;      /* PHY_RES_FCH, DCCH, SCH0 or SCH1 */
+   kal_uint16            MuxCat;
+   kal_uint16            NumPdus;
+   kal_uint16            NumBits;
+   kal_uint32            SysTime;
+   CpBufferT     *DataP[8];
+} LmdTdsoFwdChDataMsgT;
+
+typedef struct
+{
+   kal_uint8             FwdChanMask;      /* PHY_RES_FCH, DCCH, SCH0 or SCH1 */
+   kal_uint8             RevChanMask;      /* PHY_RES_FCH, DCCH, SCH0 or SCH1 */
+} LmdTdsoDisconnectMsgT;
+
+typedef enum
+{
+   FWD_LINK = 0,
+   REV_LINK
+} LmdLinkDirectionT;
+
+/* Tdso clear statisctics ETS command message structure */
+typedef struct
+{
+   LmdDirectionFlagT    DirFlag;  /* a bit mask variable (TX, RX, or both) */ 
+} LmdTdsoClearStatsMsgT;
+
+/* Tdso Random Number Calc ETS command message structures */
+typedef struct
+{
+   ExeRspMsgT  RspInfo;
+   kal_bool        NewSeed;
+   kal_uint32      Seed;
+}  LmdTdsoRandomNumberCalcMsgT;
+
+typedef struct
+{
+   kal_uint8       SeqNum;
+   kal_uint32      Y31;
+   kal_uint32      Y24;
+}  RngT;
+
+typedef struct
+{
+   RngT        Yn[5];   
+} LmdTdsoRandomNumberCalcRspMsgT;
+
+/* Voice memo and voice recognition definitions */
+typedef enum
+{
+   LMD_VMEM_REASON_COMMANDED = 0,
+   LMD_VMEM_REASON_COMPLETED,
+   LMD_VMEM_REASON_CANNOT_DO
+} LmdVmemReasonT;
+
+typedef struct
+{
+   kal_uint8  NumMuxPDUs;
+   kal_uint8  Pad;
+   kal_uint16 MuxPDUSize;
+} LmdMpInputOutputDebugInputSpyT;
+
+typedef struct
+{
+   kal_uint8  NumRlpFrames;
+   kal_uint8  RlpFrameFormat;
+   kal_uint16 RlpFrameLen;
+} LmdMpInputOutputDebugOutputSpyT;
+
+typedef struct
+{
+   kal_uint16 MuxPduCtrl;
+   kal_uint16 MuxPduType5Ctrl;
+   kal_uint16 NumFrames;
+   kal_uint16 NumGoodFrames;
+   kal_uint16 NumMuxPDUs;
+   kal_uint16 SrId;
+   kal_uint16 MuxPDULen;
+   kal_uint16 MuxPDUExtHeader;
+   kal_uint8  MuxPDUData[4];
+} LmdMpPdchInputDebugSpyT;
+
+typedef struct
+{
+  kal_uint8            priSrId;   
+  SysRlpFrameRateE priRate;   
+  kal_uint8            priDataPtr[4];
+  kal_uint8            secSrId;
+  SysRlpFrameRateE secRate;
+  kal_uint8            secDataPtr[4];
+} LmdMpFundicatedDataOutputSpyT;
+
+typedef struct
+{
+   kal_uint8  srId;
+   RlpFrmFormatE  frameFormat;  
+   kal_uint8  offset;
+   kal_uint8  reserved;
+   kal_uint16 frameLen;
+   kal_uint8 Data[4];
+} LmdMpPdchOutputSpyFrameInfoT;
+
+typedef enum
+{
+   UNINITIALIZED     = 0,
+   INITIALIZED,
+   ACCESS,
+   EACH_STATE,
+   TRAFFIC,
+   TEST_STATE,
+   NULL_STATE,
+   WAIT_2_FRAME_STATE
+} LmdRevStateTypeT;
+
+typedef enum
+{
+   MPDU_NORMAL = 0,
+   MPDU_BYPASS,
+   MPDU_AUTOMATIC
+} MpOpModeT;
+
+/* MuxPDU Training States */
+typedef enum
+{
+   TRAINING_DISABLED = 0,
+   TRAINING_ACTIVE,
+   TRAINING_COMPLETE
+} MpStateT;
+/* MuxPDU Training State sub-trace ids */
+typedef enum
+{
+   MPT_SETUP_ID = 0,
+   MPT_CHECK_LTU_CRC_ID,
+   MPT_ACTIVATE_NEW_CONFIG_ID
+} MpActionIdT;
+/* MuxPDU Set Op Mode Msg */
+typedef struct
+{
+   ExeRspMsgT  RspInfo;    
+   MpOpModeT   PreferredMode;
+} LmdMpSetOpModeMsgT;
+
+typedef struct
+{
+   MpOpModeT   PreferredMode;
+   kal_uint8       CurrentMode;
+   kal_uint8       CheckLtuCrc;
+} LmdMpSetOpModeRspMsgT;
+
+/* MuxPDU Get Op Mode Msg */
+typedef struct
+{
+   ExeRspMsgT  RspInfo; 
+} LmdMpGetOpModeMsgT;
+
+typedef struct
+{
+   MpOpModeT   PreferredMode;
+   kal_uint8       CurrentMode;
+   kal_uint8       CheckLtuCrc;
+} LmdMpGetOpModeRspMsgT;
+
+
+typedef struct
+{
+   kal_uint8   FFchId;
+   kal_uint8   FSchId;
+   kal_uint8   RFchId;
+   kal_uint8   RSchId;
+}TdsoSrIdT;
+
+typedef struct
+{
+   kal_bool   Enabled;
+   kal_uint8  ChanMonitor;        /* 0 = FCH, 1 = DCCH */
+   kal_bool   PwrThreshEnable;
+   kal_uint8  PwrRepThresh;
+   kal_bool   PwrPeriodEnable;
+   kal_uint8  PwrRepFrames;
+   kal_uint8  PwrRepDelay;
+   kal_uint8  CurrRepDelay;
+   kal_uint8  BadFrames;
+   kal_uint8  DcchBadFrames;
+   kal_uint32 TotFrames;
+   kal_uint32 DcchTotFrames;
+   kal_uint8  FrameOffset;
+   kal_uint8  FwdBlankingDutyCycle;
+   kal_uint8  RevBlankingDutyCycle;
+}LmdFwdPwrCtlT;
+
+#ifdef MTK_CBP_ENCRYPT_VOICE
+typedef enum
+{
+   Discard_In_Config     = 0,
+   Discard_Full_0_Frame,
+   Discard_first_rev_3_Frame,
+   VoiceEncryptDelay_Reset,
+   Decrypt_Voice,
+   Encrypt_Voice
+} LmdVoiceEncryptEventT;
+#endif
+/*----------------------------------------------------------------------
+ Global variables.
+-----------------------------------------------------------------------*/
+/* Flag Value to indicate the Fwd counters are suspended */
+/* declared and initialized in lmdfwdch.c and used in lmdfwdch.c and lmdmpfwd.c */
+extern kal_bool  FwdCounterSuspend;
+extern kal_bool  LmdMpSchAssigned;
+
+
+extern TdsoSrIdT  TdsoSrId;
+extern kal_uint8      FwdRc;
+extern kal_uint8      RevRc;
+extern LmdFwdPwrCtlT LmdFwdPwrCtlParms;
+extern kal_uint8      VocSrId;
+extern LmdSridDataT LmdSrId[SYS_SR_ID_MAX + 1];
+
+/*flags for statistic and loopback data processing*/
+extern kal_bool  EAckCounter;
+extern kal_bool  ENakCounter;
+extern kal_bool  LsoTxFCHIsNull;
+
+#ifdef MTK_CBP_ENCRYPT_VOICE
+extern kal_bool  VoiceEncDataDisable;
+#endif
+
+
+/*----------------------------------------------------------------------
+ Global Function Prototypes
+-----------------------------------------------------------------------*/
+/*-------------------- TRACE/SPY MSG ID Handle------------------------*/
+extern void   LmdDhlMsgLog(module_type mod_id, msg_type msg_id, local_para_struct *msgPtr);
+
+/*-- Reverse Object Operations ---------------------------------*/
+extern void   LmdRevSig(kal_uint32 SigId);
+extern void   LmdRevCmdMsg(void *MsgDataPtr, kal_int32 MsgId);
+extern void   LmdRevSigMsg(void *MsgDataPtr, kal_int32 MsgId);
+extern kal_uint16 LmdRevSigDataQueueSizeGet(void);
+extern kal_uint8  LmdRevPrevGet(void);
+extern void   LmdRevSchMsg(LmdSvcRschInfoT *RschInfoP); 
+extern void   LmdGetRevStatCntMsg(LmdGetStatCntMsgT *MsgP);
+extern void   LmdSetRevStatCntMsg(LmdSetStatCntMsgT *MsgP);
+extern void   LmdResetRevStatCntMsg(void);
+extern void   LmdRevSchStop(kal_uint8  sch_id);
+extern void   LmdRevTrafficMBoxesFlush(void);
+extern void   LmdRevDataMsg(void* MsgDataPtr, kal_uint16 MsgId);
+
+/*-- Reverse channel rate test case handler -----*/
+extern void LmdRateTestControl(L1dTstChnTypeT ChnlType, L1dTstFchRateT FchRate, L1dTstSchRateT SchRate);
+
+
+/*-- Forward Object Operations ---------------------------------*/
+extern void   LmdFwdSig(kal_uint32 SigId);
+extern void   LmdFwdCmdMsg(void *MsgDataPtr, kal_int32 MsgId);
+extern void   LmdFwdSchMsg(LmdSvcFschInfoT *FschInfoP); 
+extern void   LmdGetFwdStatCntMsg(LmdGetStatCntMsgT *MsgP);
+extern void   LmdSetFwdStatCntMsg(LmdSetStatCntMsgT *MsgP);
+extern void   LmdResetFwdStatCntMsg(void);
+extern void   LmdFwdSchStopSigProc(kal_uint8  sch_id);
+extern void   LmdFwdSchPwrMeasRep(kal_uint8 sch_id);
+extern void   LmdFwdChannelInit(void);
+extern void   LmdFwdUpdateAllSchStats (kal_bool PhysChanQlty, kal_bool SchChanRdy, LmdFwdSvcConfigT *LmdFwdConfig);
+//extern void   LmdClearDtxStats(void);
+extern void   LmdIpcClearFwdStats(void);
+
+#ifdef MTK_DEV_BUG_FIX_XL2	  
+extern void   LmdFwdSchFrameCountReset(kal_bool CountReset);
+#endif
+
+/*-- Service Configuration Object Operations ---------------------------------*/
+extern void   LmdSvcSig(kal_uint32 SigId);
+extern void   LmdSvcCmdMsg(void *MsgDataPtr, kal_int32 MsgId);
+extern void   LmdSvcRevConfigGet(LmdRevSvcConfigT    *LmdRevConfig, 
+                                 LmdSvcPtDataT       *LmdPtData, 
+                                 LmdSvcDsDtchT       *RevRlpFch, 
+                                 LmdSvcDsSchT        *RevRlpSch,
+                                 kal_uint16 SigBits);
+extern void   LmdSvcFwdConfigGet(LmdFwdSvcConfigT *LmdFwdConfig, 
+                                 FwdDataT  *FwdData,
+                                 kal_bool ChnlQlty);
+extern kal_uint8  LmdSvcFwdMuxPDUType(void);
+extern void   LmdSvcFwdFrameReceive(LmdFwdChnlTypeT PhysChan);
+extern kal_uint16 LmdSvcFwdPtRate(kal_uint16 PtBits, kal_uint16 PtRouting, LmdFwdFrameRateT PhysChanRate);
+extern kal_uint16 LmdSvcFwdSecRate(kal_uint16 SecBits, kal_uint16 SecRouting);
+extern void   LmdSvcVocRateLimit(kal_bool Limit);
+extern void   LmdSvcRevMboxSet(LmdRevMboxSetT*  LmdRevMboxSet, kal_uint16 SigBits);
+
+extern kal_uint8  LmdSvcRevSigPhysRes(void);
+extern kal_uint8  LmdSvcServiceOptPhysRes(LmdLinkDirectionT LinkDir, LmdServiceOptionT SvcOpt);
+extern void   LmdSvcRevTdsoDataConvert(LmdTdsoDataT* GenMsgP, void* RevDsMsgP);
+extern kal_uint8 * LmdSvcLCMaskGet(void);
+
+extern RlpRxFrameRateT LmdRlpFrameSpyRate(SysMultiplexOptionT MuxOption, 
+                                            kal_uint16 PduType,SysRlpFrameRateE  PduRate); 
+
+extern void   LmdSvcSpeechDisableMsgHandler(LmdSpeechDisableMsgT *);
+
+extern kal_bool   LmdSvcRevSchCodingGet();
+extern kal_uint8  LmdSvcFwdSchMuxPduGet();
+/* for RSCH  DTX*/
+extern void   LmdSvcRschDtxExpired(kal_uint8  sch_id);
+extern void   LmdRevSchSendDtxExpiration(void);
+
+
+
+/* FSCH rate determination...*/
+extern void  LmdSvcActivateNewFSchConfig (void);
+extern kal_uint16 LmdSvcFwdSchDurationGet(kal_uint8 sch_id);
+
+/*-------- Direct Buffer functions --------------------*/
+extern void   LmdRevSendAccessFrame(LmdAccessDataCarrierT *LmdAccessDataCarrierP, kal_uint32 FrameBytes);
+extern void   LmdRevSendTrafficFrame(LmdReverseTchCarrierT *LmdRevTchCarrierP
+#if defined (MTK_DEV_OPTIMIZE_XL2)
+                                              , kal_uint8 vocieFlag, kal_uint8 SigFlag
+#endif
+                                              , kal_uint8 retryCount
+                                              );
+extern void   LmdRevSendTestFrame(void);
+extern void   LmdRevInitTestFrame(L1dTstChnTypeT ChnlType,L1dTstFchRateT FchRate,L1dTstSchRateT SchRate);
+extern void   LmdRevResetFrameTracking (void);
+extern void   LmdFwdStatistics(LmdFwdChnlTypeT PhysChanType, SysMultiplexOptionT MuxOpt,
+                             kal_uint16 NumBits, PswFrameCatagoryT Category, kal_bool NullFrame,
+                             kal_uint8 NumLtus, kal_uint8 NumGoodLtuCrc);
+
+/*-------- LMD Bit Copying Functions --------------------*/
+extern void   LmdPacked8to16BitCpy(kal_uint8  *FromP, kal_uint32 FromBitOffset, 
+                                   kal_uint16 *ToP, kal_uint32 ToBitOffset, kal_uint32 NumBits);
+
+extern void   Lmd16toPacked8bitcpy(kal_uint16 *FromP, kal_uint8 *ToP, kal_uint32 NumBits, 
+                                   kal_uint32 BuffBitOffset);
+
+extern void   Lmd16toPacked16BitCpy(kal_uint16 *FromP, kal_uint16 *ToP, 
+                                    kal_uint32 NumBits, kal_uint32 BuffBitOffset);
+
+extern void   LmdPacked16to16BitCpy(kal_uint16 *FromP, kal_uint16 *ToP, 
+                                    kal_uint32 NumBits, kal_uint32 BuffBitOffset);
+
+extern void   LmdPacked16toPacked16BitCpy(register kal_uint16 *FromP, 
+                                          register kal_uint16 *ToP,
+                                          kal_uint32 NumBits, kal_uint32 FromBitOffset);
+
+extern void   Lmd8Bitto8BitCpy(register kal_uint8 *FromP, register kal_uint8 *ToP, 
+                               kal_uint32 NumBits, kal_uint32 ToBitOffset);
+
+extern void   Lmd8BitOffsetto8BitOffsetCpy(register kal_uint8 *FromP, register kal_uint8 *ToP, 
+                                           kal_uint32 NumBits, kal_uint32 FromBitOffset, 
+                                           kal_uint32 ToBitOffset);
+
+extern void   LmdSendPswCmdStatusMsg(PswCmdStatusT Status);
+
+/* LMD Crc Functions */
+extern kal_uint16 LmdCrc16BitCalculate (kal_uint8 *msg, kal_uint8 len);
+extern kal_bool LmdCrc16BitCheck (kal_uint8 *message, kal_uint8 len);
+
+/* LMD IRAM Functions that are used by Markov and Test Data Service options */
+extern kal_uint32 LmdRNG48 ( kal_uint32 RNG32 );
+//extern void   LmdResetMpPdchCounter (void);
+
+/*for MOD_SPCH Functions*/
+extern void lmdSpch_process_ilm(ilm_struct *current_ilm); 
+
+
+/*-------- Markov Functions --------------------*/
+extern void LmdMsoInit ( void );
+extern void LmdMsoConnect ( kal_uint16 MultiplexOption, LmdServiceOptionT ServiceOption );
+extern void LmdMsoControlMsg ( LmdServiceOptionControlMsgT *RxMsgP );
+extern void LmdMsoProcessing ( LmdMsoFwdChDataMsgT *RxMsgP );
+extern void LmdMsoDisconnect ( void );
+extern void LmdMarkovClearStatsMsg ( LmdMsoClearStatsMsgT *RxMsgP );
+
+/*-------- Tdso Functions --------------------*/
+extern void LmdTdsoInit ( void );
+extern void lmds_process_ilm(ilm_struct *current_ilm);
+extern void LmdTdsoConnect ( LmdTdsoConnectMsgT *TdsoConnMsgP );
+extern void LmdTdsoControlMsg ( LmdServiceOptionControlMsgT *RxMsgP );
+extern void LmdTdsoProcessFwdChData ( LmdTdsoFwdChDataMsgT *RxMsgP );
+extern void LmdTdsoProcessRevChData ( void );
+extern void LmdTdsoDisConnect ( LmdTdsoDisconnectMsgT *RxMsgP );
+extern void LmdTdsoClearStatsMsg ( LmdTdsoClearStatsMsgT *RxMsgP );
+extern void LmdTdsoRandomNumberCalcMsg ( LmdTdsoRandomNumberCalcMsgT *RxMsgP );
+
+/*-------- Lso75 Functions --------------------*/
+extern void LmdLsoReset(void);
+extern kal_bool LmdOnTrafficChannel( void );
+extern kal_bool LmdInTestMode( void );
+
+/*------------- Debug Screen Info Response --------------------*/
+extern void LmdDebugScrnFERCalc (kal_bool badframe);
+extern void LmdDebugScrnInfoMsg (LmdGetDebugScrnInfoRequestT* RxMsgP);
+extern void LmdInitializeDebugScrnCounters (void);
+extern LmdRevStateTypeT getLmdRevState(void);
+#ifdef MTK_CBP_ENCRYPT_VOICE
+extern void LmdResetVoiceEncryptDelay(void);
+#endif
+
+/*****************************************************************************
+* $Log: lmddefs.h $
+* Revision 1.12.2.3  2006/03/21 14:38:21  vxnguyen
+* - Removed references to compiler flag LMD_MPDU_BYPASS_OPERATION.
+* - Defined MuxPdu SetMode and GetMode variables, message structures
+*   and function prototypes.
+* Revision 1.12.2.2  2006/02/17 10:22:11  wfu
+* - For Bypass mode.
+* Revision 1.12.2.1  2005/10/05 09:38:46  wfu
+* Revision 1.12.3.2  2006/03/13 17:31:56  winston
+* Fix CR7312: Added function prototypes for resetting the fwd/rev mux stat counters, LmdResetRevStatCntMsg() and LmdResetFwdStatCntMsg().
+* Revision 1.12.3.1  2005/10/05 09:38:46  winston
+* Duplicate revision
+* Revision 1.12  2005/10/05 09:38:46  chinh
+* - Move LmdRevStateTypeT from lmdrevch.c to this file.
+* Revision 1.11  2005/03/18 10:14:22  bcolford
+* CBP4.05 [4.21] to CBP6.1 [2.9.0] CP Software Merge.
+* Revision 1.6  2005/01/31 11:59:32  mmalopy
+* - LmdSvcGpsSpeechDisableMsgHandler() reprotoytyped as
+*   LmdSvcSpeechDisableMsgHandler() (denotes its used by
+*   applications other than GPS).
+* Revision 1.5  2005/01/14 16:08:38  wfu
+* Revision 1.4  2004/07/29 15:48:12  robertk
+* CR 3500: Removed SYS_OPTION_VOICE_MEMO compile switch from definitions.
+* Revision 1.3  2004/05/04 15:32:25  ckackman
+* CP_LMD_0.08.0_MergeCBP4.0_10.0
+* Revision 1.10  2005/02/03 12:10:39  wfu
+* - Update LmdEachCarrierT and functional prototype for LmdRevSendEachFrame() and declare the global buffer EachBuff[]  for EACH frame.
+* Revision 1.9  2004/11/18 11:11:02  vxnguyen
+* New LMD function prototypes.
+* Revision 1.8  2004/10/21 14:15:15  bcolford
+* Add new data structures to suppot F-PDCH, F-SCH and F-FCH
+* spies.
+* Revision 1.7  2004/10/06 14:01:14  bcolford
+* Add new data structures to support MuxPDU Type 5, F-PDCH
+* development.
+* Revision 1.6  2004/09/28 13:22:26  bcolford
+* CBP6.0 ver 3.3.0 to CBP6.1 merge
+* Revision 1.8  2004/06/29 11:14:39  bcolford
+* Updated for CBP4.0 to CBP6.0 merge
+* Revision 1.66  2004/03/12 15:16:33  ameya
+* Added prototypes for LmdDebugScrnFERCalc(), LmdDebugScrnInfoMsg() and LmdInitializeDebugScrnCounters().
+* Revision 1.65  2004/02/13 13:06:18  wfu
+* .Declare LmdFwdChannelInit() as a global function call. 
+* Revision 1.2  2004/04/07 16:08:58  vxnguyen
+* Removed all SpchDataMppAgc definitions/code in the effort of cleaning up IPC.
+* Revision 1.1  2004/01/22 10:44:44  fpeng
+* Revision 1.5  2004/08/27 10:48:22  bcolford
+* Export a subroutine to allow initialazation of PDCH counter.
+* Revision 1.4  2004/07/29 11:29:23  bcolford
+* Export the new PDCH Test Mode flag and the
+* LmdSrvMpPdchCtrl() subroutine.
+* Revision 1.3  2004/07/08 11:07:20  blee
+* Added support for new RLP API and support for MuxPDU Type 5
+* data objects on F-PDCH.
+* Revision 1.2.1.2  2004/04/20 10:38:34  bcolford
+* MuxPDU Type five development
+* Revision 1.2  2004/03/25 11:55:18  fpeng
+* Updated from 6.0 CP 2.5.0
+* Revision 1.7  2004/02/10 11:52:06  bcolford
+* Merged CBP4.0 Release 8.05.0 changes.
+* Revision 1.6  2004/01/30 10:32:31  vxnguyen
+* - Simplified LmdFwdSchMpFrameProc() function prototype.
+*   (the LtuOn, PhysChanQlty and SysTime arguments are no
+*   longer passed to this function).
+* Revision 1.5  2003/12/19 11:44:58  wavis
+* Removed NULL_TASK definition (replaced by EXE_DUMMY_TASK).
+* Revision 1.4  2003/12/10 16:07:13  bcolford
+* Add a new macro to support MuxPDU Bypass operation.
+* Revision 1.3.1.2  2003/12/02 16:30:40  bcolford
+* Add a new pre-processor directive to support MuxPDU Type 3
+* operation in bypass mode.
+* Revision 1.3  2003/11/26 15:37:42  bcolford
+* Added new prototypes for MuxType 3 processing on SCH.
+* Export a new flag to coordinate Sch Assigned status.
+* Revision 1.2.1.3  2003/11/26 11:09:12  bcolford
+* Completed integration between MuxPDU and TDSO.
+* Revision 1.2.1.2  2003/11/07 16:36:40  bcolford
+* Updated the prototype for MuxPDU processing subroutine.
+* Revision 1.2  2003/11/03 11:21:27  bcolford
+* Share some subroutines between normal forward channel
+* processing and MuxPDU forward channel processing.
+* Revision 1.1  2003/05/12 15:31:49  fpeng
+* Initial revision
+* Revision 1.64  2003/12/09 09:37:22  mshaver
+* Added LmdFwdSchPwrMeasRep() function prototype.
+* Revision 1.63  2003/04/25 15:02:16  wfu
+* .Change the data types of RevSchDtxDuration and RevSchDuration
+*   from kal_uint8 to kal_uint16 to avoid roundoff problem when
+*   the value goes beyond 255. CR2171.
+* Revision 1.62  2003/03/13 16:11:20  wfu
+* . LMD should inform SVC when RSCH DTX expired. Add function prototype
+* for LmdSvcRschDtxExpired().                               
+* Revision 1.61  2002/11/11 16:20:33  wfu
+* . Add one additional element of SysTime in
+*   LmdTdsoFwdChDataMsgT for 153K FSCH
+* Revision 1.60  2002/10/23 08:05:55  mshaver
+* Removed prototypes for LmdProcessSpchDataMppHfree() and
+* LmdProcessSpchDataSppHfree() as they are not needed.
+* Revision 1.59  2002/10/03 15:21:33  jbenders
+* Added function proto for LmdSvcGpsSpeechDisableMsgHandler() 
+* which will be used to properly disable/reenable the voice path and
+* vocoder at the beginning/end of a traffic channel GPS session.
+* Revision 1.58  2002/09/26 15:18:18  vxnguyen
+* Added additional Voice Memo function prototypes.
+* Revision 1.57  2002/09/09 16:18:50  wfu
+* . Add new element 'Coding' in
+*   SchRevMuxFormatT to indicate the
+*   RSCH's Turbo coding's status.
+* Revision 1.56  2002/08/27 17:28:31  wfu
+* . add LmdRevSchStop() and LmdfwdSchStopSigProc()
+*   as global functions.
+* Revision 1.55  2002/07/15 18:33:02  vxnguyen
+* Added 'LmdRNG48()' function prototype.
+* Revision 1.54  2002/06/18 11:58:03  wfu
+* .Added codes for CR 507:
+*   RLP Rx/Tx Frame Spies:
+* 
+*  1).Move #define MUXPDUTYPE1 - 6
+*     from lmdsrvcf.c.
+*  2).Declare prototype of
+*     LmdRlpFrameSpyRate().
+*  
+* Revision 1.53.1.2  2002/06/07 15:08:41  wfu
+* .  CR507 working version for RLp RX/TX  frame spy.
+* Revision 1.53.1.1  2002/05/30 11:11:28  wfu
+* Duplicate revision
+* Revision 1.53  2002/05/30 11:11:28  mshaver
+* Added VIA Technologies copyright notice.
+* Revision 1.52  2002/05/17 11:27:07  vxnguyen
+* - Updated Tdso function prototypes and definitions as a new
+* Lmd Secondary task has been created to handle Tdso.
+* Revision 1.51  2002/04/10 15:47:04  mshaver
+* Add the element  FchAssigned to FwdDtchT to indicate to the 
+* forward channel code whether or not FCH is in use.
+* Revision 1.50  2002/04/10 10:43:18  vxnguyen
+* Modified LmdSvcLCMaskGet() prototype.
+* Revision 1.49  2002/03/28 18:39:27  hans
+* is2000 rev 0 add 2, retrievable and settable parameters implemented. 
+* 
+* Revision 1.48  2002/02/07 16:50:53  vxnguyen
+* Added the use of compilor options SYS_OPTION_VOICE_MEMO
+* and SYS_OPTION_VOICE_RECOGNITION.
+* Revision 1.47  2002/01/23 17:29:24  mmalopy
+* - LmdRevSendTestFrame() and LmdRevInitTestFrame() functions
+*   prototyped.
+* Revision 1.46  2002/01/09 19:58:57  vxnguyen
+* - Added Tdso definitions.
+* - Renamed _SvcRlp_ definitions to _SvcDs_ whereever applicable
+* so that these definitions could be shared between RLP and TDSO.
+* Revision 1.45  2001/11/19 15:42:09  vxnguyen
+* Added new Voice Rec and Voice Memo definitions.
+* Revision 1.44  2001/11/13 13:10:58  mshaver
+* - Changes to be compliant with the new LMD-RLP interface design.
+* - Changes to support forward and reverse SCH.
+* - Changed fundamental and dedicated channel data structure
+*   organization to allow the code to be read easier.
+* - Changed the LMD service config get routine prototypes for both
+*   forward and reverse channels to be consistent with the above
+*   changes.
+* - Add RlpDtchShareMbox in the data structure of LmdRevMboxSetT to 
+*   indicate whether the RLP FCH and DCCH are sharing the same mailbox
+*   for delivery of reverse data to LMD.
+* - Add one element in the data structure SchRevMuxFormatT 
+*   to indicate the R-SCH's mux_option.
+* - Add LmdSchFschInfoT to allow SVC to pass FSCH Msg
+*   information to FWD.
+* - Add LmdSchRschInfoT to allow SVC to pass RSCH Msg
+*   information to REV.
+* - Declare LmdRevSchMsg() and LmdFwdSchMsg() as global in
+*   LMD, since the LMD_RSCH_MSG and LMD_FSCH_MSG will 
+*   only be handled by SVC, and SVC will call these 
+*   two functions to pass necessary information to REV and FWD.
+* Revision 1.43  2001/10/16 18:47:21  vxnguyen
+* Fixed LmdMsoConnect() prototype.
+* Revision 1.42  2001/08/29 14:49:31  vxnguyen
+* Added MSO data structure definitions and function prototypes.
+* Revision 1.41  2001/06/13 11:22:01  mshaver
+* For implementation of forward and reverse channel statistics, the
+* fch mux pdu 1 and 2 number of bits #defines were moved from
+* lmdsrvcf.c to lmddefs.h.  Also, NumBits was added to
+* LmdFwdSvcConfigT, and MuxOpt, NumBits and Category were
+* added to the FchRevMuxFormatT and DcchRevMuxFormatT
+* data structures.
+* Revision 1.40  2001/06/12 15:11:14  mshaver
+* Changed LmdFwdSvcConfigT to add message id elements to 
+* allow the service configuration object to tell the forward object
+* what message id should be used to route the sub channel data.
+* Revision 1.39  2001/06/06 10:21:29  mshaver
+* Merge in revision 1.38.1.2
+* Revision 1.38.1.2  2001/06/05 14:42:29  mshaver
+* Changed LmdFwdSvcConfigT ChanAssigned element to
+* DcchAssigned to indicate whether or not Dcch is assigned.
+* Revision 1.38.1.1  2001/06/04 14:37:02  mshaver
+* Duplicate revision
+* Revision 1.38  2001/06/04 14:37:02  mshaver
+* Moved signal definitions to lmdapi.h
+* Revision 1.37  2001/06/01 11:31:20  mshaver
+* Added prototypes for lmd crc utility functions.
+* Revision 1.36  2001/05/25 11:01:05  mshaver
+* Added ChanAssigned kal_boolean to LmdFwdSvcConfigT for
+* determining if a channel is assigned whether or not statistics 
+* for that channel should be updated.
+* Revision 1.35  2001/05/03 15:41:46  mshaver
+* Merge in changes from rev 1.30.1.2 which changed the prototype
+* for LmdSvcFwdConfigGet() to change the type for FchRate from
+* kal_uint16 to LmdFwdFrameRateT.
+* Revision 1.34  2001/04/26 16:41:52  wfu
+* Change in the data structure: LmdSvcRlpDataT:  The PrimaRate from kal_uint8 to SysRlpFrameRateT, same as SecRate.
+* Revision 1.33  2001/04/25 11:57:20  mshaver
+* Changed LmdSvcRevMboxSet() prototype to add a second
+* parameter to pass the number of signaling bits in the signaling
+* queue. This is needed by the service configuration object in order
+* for it to determine the maximum primary and secondary rates to be
+* assigned to RLP
+* Revision 1.32  2001/04/20 16:07:14  mshaver
+* Deleted unused data struct PtMboxSetT, changed types in
+* RlpChanMboxSetT to SysRlpFrameRateT, added signaling
+* physical channel type to LmdRevMboxSetT.
+* Revision 1.31  2001/04/19 17:46:37  wfu
+* Add the new data structures and functions for supporting RLP.
+* Revision 1.30  2001/04/18 15:23:11  mshaver
+* Changed LmdWvcFwdConfigGet() and 
+* LmdSvcFwdFrameReceive() prototypes' physical channel
+* parameter to be 'LmdFwdChnlTypeT' type.
+* Revision 1.29  2001/04/10 15:04:23  mshaver
+* Changes for revision 1.27 were deleted by revision 1.28. These
+* function prototypes have been restored.
+* Revision 1.28  2001/04/10 14:09:51  wfu
+* 1). Merge with 1.26.1.2
+* 2).  Added the DSPV rate representation:  PT_FULL = IPC_SPCH_BLANK , and so on.
+* Revision 1.26  2001/03/28 15:30:18  mshaver
+* Call integration. Add prototype for LmdSendPswCmdStatusMsg().
+* Revision 1.25  2001/03/19 13:57:40  wfu
+* Add MUX_PDU_NO_HEADER = 0x07
+* Revision 1.24  2001/03/16 13:32:57  wfu
+* Change the data type of Rev Config FchRate as LmdRevFundRateTypeT.
+* Revision 1.23  2001/03/16 12:53:35  wfu
+* Add  FchRate  in the Reverse Config.
+* Revision 1.22  2001/03/12 08:23:56  mshaver
+* Added prototype for LmdSvcVocRateLimit().
+* Revision 1.21  2001/03/08 17:07:08  mshaver
+* Added RevFchRate to LmdRevFchCarrierT as it is to be 
+* written to the signal buffer if there is FCH data. Also, added
+* a prototype for the reverse object function LmdRevPrevGet().
+* Revision 1.20  2001/03/02 16:35:25  wfu
+* Revision 1.19  2001/02/28 17:00:08  mshaver
+* Added prototype for reverse object for LmdRevSigDataQueueSizeGet().
+* Revision 1.18  2001/02/28 09:38:01  mshaver
+* Added rate parameter to LmdSvcRevConfigGet().
+* Revision 1.17  2001/02/27 10:10:02  wfu
+* Small changes in the functions' prototypes.
+* Revision 1.16  2001/02/27 10:07:59  wfu
+* Delete the functions' prototypes for LmdSvcInit() and LmdSvcSigBack().
+* Revision 1.15  2001/02/23 14:03:34  wfu
+* Add the function prototype:  LmdServiceConfigInit(void);
+* Revision 1.14  2001/02/23 11:03:42  wfu
+* Add the following signals:
+* LMD_SERVICE_OPTION_CONTROL_SIG
+* LMD_START_NN_SERVICE_CONFIG_SIG
+* LMD_START_SERVICE_CONFIG_SIG
+* Used from LMD<->LMD
+* Revision 1.13  2001/02/22 13:43:12  mshaver
+* Add parameter to LmdRevSendAccessFrame to pass the maximum
+* number of bytes in the access frame
+* Revision 1.12  2001/02/21 13:23:25  mshaver
+* Added parameter to LmdSvcFwdConfigGet to indicate the 
+* quality of the current channel (CRC).
+* Revision 1.11  2001/02/20 08:26:09  mshaver
+* Change header size from 16 to 8 bits in LmdSvcFwdConfigGet().
+* Revision 1.10  2001/02/16 14:48:53  mshaver
+* Added FchRate to LmdSvcFwdConfigGet() parameter list.
+* Revision 1.9  2001/02/15 17:32:01  mshaver
+* Changed the forward service config struct to define the routing
+* fields in terms of task ids, added frame category and mux option
+* to the struct as well. Added prototypes for addition service
+* configuration operations LmdSvcFwdMuxPDUType(), 
+* LmdSvcFwdFrameReceive() and LmcSvcFwdPtRate().
+* Revision 1.8  2001/02/14 13:53:37  mshaver
+* Added forward and reverse function prototypes to be consistent
+* with the Rhapsody model. Removed unneeded information that
+* is now local to a specific object.
+* Revision 1.7  2001/01/29 11:53:42  mshaver
+* Added Lmd8BitOffsetto8BitOffsetCpy() prototype, and signal
+* data queueing function prototypes.
+* Revision 1.6  2001/01/19 11:53:10  mshaver
+* Added LmdDataTypeTand LmdRevTchCarrierT data structures,
+* and lmdbit.c function prototypes.
+* Revision 1.5  2001/01/16 16:30:17  mshaver
+* Merge in revision 1.4.1.2.
+* Revision 1.4.1.2  2001/01/16 16:08:18  mshaver
+* Define enum typedef for lmd state, remove PACKED qualifier from the data structs used to write data to direct buffer as it is not needed, changed various function prototypes to be extern.
+* Revision 1.4.1.1  2001/01/10 16:07:11  mshaver
+* Duplicate revision
+* Revision 1.4  2001/01/10 16:07:11  wfu
+* revison on 01/10/01
+* Revision 1.3  2001/01/08 08:54:38  mshaver
+* Moved IPC direct buffer mailbox definitions from lmdapi.h to
+* lmddefs.h as they are not global. Added rcs log at bottom of 
+* file.
+*****************************************************************************/
+
+/*****************************************************************************
+* End of File
+*****************************************************************************/
+
+#endif
+/**Log information: \main\Trophy\Trophy_ylxiao_href22033\1 2013-03-18 14:16:24 GMT ylxiao
+** HREF#22033, merge 4.6.0**/
+/**Log information: \main\Trophy\1 2013-03-19 05:20:51 GMT hzhang
+** HREF#22033 to merge 0.4.6 code from SD.**/
+/**Log information: \main\Trophy\Trophy_SO73\1 2013-07-10 07:00:08 GMT yanliu
+** HREF#0000: 1x advance SD 20130708_1xAdvanced version merge**/
+/**Log information: \main\Trophy\2 2013-07-17 08:16:58 GMT yanliu
+** HREF#0000: 1x advance SD 20130708_1xAdvanced version merge**/
+