[Feature]Upload Modem source code

Change-Id: Id4294f30faced84d3e6fd6d5e61e1111bf287a37
diff --git a/mcu/interface/protocol/as_c2k/1xrtt/stats.h b/mcu/interface/protocol/as_c2k/1xrtt/stats.h
new file mode 100644
index 0000000..584f232
--- /dev/null
+++ b/mcu/interface/protocol/as_c2k/1xrtt/stats.h
@@ -0,0 +1,233 @@
+/*****************************************************************************
+*  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) 1999-2010 VIA Telecom, Inc.  All rights reserved.
+*
+*************************************************************/
+/****************************************************************************
+ *
+ * Module:     stats.h
+ *
+ * Purpose:    This file defines the necessary data structures and interfaces
+ *             to maintain the accumulated statistics. Section x.4.5.
+ *
+ ****************************************************************************
+ *
+ *                          PVCS Header Information
+ *
+ *  $Workfile$
+ *  $Revision: 1.3 $
+ *   $Modtime$
+ *    $Author: dstecker $
+ *
+ *       $Log: stats.h $
+ *
+ *       07 06 2017 sue.zhong
+ *       [MOLY00259241] [6293][C2K]Replace with KAL data type
+ *       Correct copyright file header
+ *       Revision 1.3  2004/04/06 14:02:23  dstecker
+ *       CBP6.1 release 1
+ *       Revision 1.2  2004/03/25 12:09:45  fpeng
+ *       Updated from 6.0 CP 2.5.0
+ *       Revision 1.1  2003/05/12 15:39:06  fpeng
+ *       Initial revision
+ *       Revision 1.6  2002/06/13 13:59:13  hans
+ *       Statistics functions already disabled with ifdef removed.
+ *       Revision 1.5  2002/06/06 13:14:56  chinh
+ *       Changed and Added Copyright
+ *       Revision 1.4  2002/06/04 20:15:01  hans
+ *       Old mux1 and mux2 statistics counter now handled by lmd has been disabled with ifdef's.
+ *       Length field removed from SetRetrievableParameterMsgT typedef. 
+ *       Revision 1.3  2002/05/14 20:41:03  hans
+ *       CR ID636 bug fix for retrievable and settable parameters.
+ *       Revision 1.2  2002/03/28 18:25:13  hans
+ *       is2000 rev 0 add 2, retrievable and settable parameters implemented. 
+ *       CR503: get retrievable parameter implemented. 
+ *       CR508: set retrievable parameter implemented
+ *       Revision 1.1  2001/01/17 10:59:28  plabarbe
+ *       Initial revision
+ *       Revision 1.1  2000/10/24 14:11:29  fpeng
+ *       Initial revision
+ *       Revision 1.3  2000/08/23 22:11:29Z  RSATTARI
+ *       Isotel release 2.8 plus LSI applicable IS-95B changes.
+ *       Revision 1.10  2000/03/02 01:57:16  scotvold
+ *       Added engRelay calls to extract CPE statistics.
+ *
+ *       Revision 1.9  2000/01/17 22:27:19  scotvold
+ *       TC Backward Compatibility changes.
+ *
+ *       Revision 1.8  1999/02/05 02:16:01  scotvold
+ *       Test mode API change for reporting statistics.
+ *
+ *       Revision 1.7  1998/12/11 20:17:42  lchhailo
+ *       changed  MAX_16_BIT_VALUE
+ *
+ *       Revision 1.6  1998/12/02 00:30:54  scotvold
+ *       Added statistic setting and retrieval.
+ *
+ *       Revision 1.5  1998/10/20 23:58:23  mhayduk
+ *       Added T53 support.
+ *
+ *       Revision 1.4  1998/05/01 18:13:54  scotvold
+ *       Update for release 0.04
+ *
+ * Revision 1.3  1998/03/30  23:26:03  mhayduk
+ * Release 0.03.
+ *
+ * Revision 1.1  1997/11/06  17:49:24  mhayduk
+ * Initial revision
+ *
+ *
+ ****************************************************************************
+ ****************************************************************************/
+
+#ifndef _STATS_H_
+
+  #define _STATS_H_ 1
+
+/*****************************************************************************
+ * Includes
+ ****************************************************************************/
+#include "layer2.h"
+#include "Serv_cfg.h"
+
+/*****************************************************************************
+ * Definitions
+ ****************************************************************************/
+
+#define MAX_24_BIT_VALUE    16777216L
+#define MAX_16_BIT_VALUE    65536L
+
+
+  #define ST_MAX_PAG_PEG 7          /* maximum page chan peg count    */
+  #define ST_MAX_ACC_PEG 8          /* maximum access chan peg count  */
+  #define ST_MAX_LAYER2_RTC_PEG  5  /* maximum layer2 RTC peg count   */
+  #define ST_MAX_FCCCH_PEG 4        /* maximum page chan peg count    */
+  #define ST_MAX_BCCH_PEG  5        /* maximum page chan peg count    */
+
+
+  #define ST_RESERVED                0
+  #define ST_LEN_16                 16
+  #define ST_LEN_24                 24
+  #define ST_LEN_SYS_TIME           36
+  #define ST_PARAMETER_LEN_16       15
+  #define ST_PARAMETER_LEN_24       23
+  #define ST_UNKNOWN_PARAMETER_LEN  0x03FF
+
+  #define CP_LAYER2_RTC1  0
+  #define CP_LAYER2_RTC2  1
+  #define CP_LAYER2_RTC3  2
+  #define CP_LAYER2_RTC4  3
+  #define CP_LAYER2_RTC5  4
+
+
+/*****************************************************************************
+ * Data Structures
+ ****************************************************************************/
+
+typedef struct
+{
+  kal_uint16  parameterID;
+  kal_uint32  parameter;
+} Parameter32Rec;
+
+/* Multiplex Parameters - for retrieval */
+typedef struct
+{
+  StatCounterT   statCounter;         /* Statistics counter */
+  kal_uint32  muxStats[MAX_STAT_ELEMENT];
+} MuxParmsT;
+
+/* Traffic Channel Multiplex Parameters - for setting */
+typedef struct
+{
+  kal_uint8           numRec;
+  Parameter32Rec  rec[CP_MAX_MUX1_CATEGORY + CP_MAX_MUX2_CATEGORY];
+} MuxRecsT;
+
+typedef struct
+{
+    kal_uint16 ParameterID;
+/* Hans C. Len is not needed in currect implementation:   kal_uint16 ParameterLen;
+ */
+   kal_uint32 Value;  
+
+} SetRetrievableParameterMsgT;
+
+
+typedef struct
+{
+    ExeRspMsgT     RspInfo;
+    StatCounterT   StatCounter;         /* Statistics counter */
+} GetRetrievableParameterMsgT;
+
+
+
+/*****************************************************************************
+ * Function prototypes
+ ****************************************************************************/
+  void cpResetPageChStatistics(void);
+#if defined (MTK_DEV_OPTIMIZE_XL2)
+  void cpTracePageChStatistics(void);
+#endif
+  void cpAddPageChStatistics(kal_uint8 counter,kal_uint8 value);
+  void cpResetBcchStatistics(void);
+  void cpAddBcchStatistics(kal_uint16 counter,kal_uint16 value);
+  void cpResetFccchStatistics(void);
+  void cpAddFccchStatistics(kal_uint16 counter,kal_uint16 value);
+  void cpResetAccessChStatistics(void);
+  void cpIncAccessChStatistics(kal_uint8 counter);
+#ifdef LMD_EACH_ON
+  void cpIncEACHStatistics(kal_uint16 counter);
+#endif
+  void cpAddressedFcschStatistics(kal_uint8 ChanType);
+  void stResetTCStatistics (void);
+  kal_uint32* stGetL2RTCStats (void);
+  void stMultiplexParameters (MuxParmsT* MuxParms);
+  void stRTPM (FTCMessage* msg);
+  void stSTPM (FTCMessage* msg);
+  void stRetrieveStatistics(GetRetrievableParameterMsgT *msgPtr);
+  void stSetPEStatistics(MuxRecsT *muxRecs);
+  void stSetStatistics(MuxRecsT *muxRecs);
+  
+
+#endif  /* _STATS_H_ */
+
+