[Feature]Upload Modem source code

Change-Id: Id4294f30faced84d3e6fd6d5e61e1111bf287a37
diff --git a/mcu/interface/protocol/l2_c2k/evdo/rtmqos.h b/mcu/interface/protocol/l2_c2k/evdo/rtmqos.h
new file mode 100644
index 0000000..122929a
--- /dev/null
+++ b/mcu/interface/protocol/l2_c2k/evdo/rtmqos.h
@@ -0,0 +1,187 @@
+/*****************************************************************************
+*  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) 2008-2010 VIA Telecom, Inc.  All rights reserved.
+*
+*************************************************************/
+/*****************************************************************************
+* 
+* FILE NAME   :   rtmqos.h
+*
+* DESCRIPTION :   This file contains function prototypes and other definitions
+*                 for the RCP RTM QOS component
+*
+*
+* HISTORY     :
+*     See Log at end of file
+*
+*****************************************************************************/
+
+/*----------------------------------------------------------------------------
+* Include Files
+----------------------------------------------------------------------------*/
+#ifndef  _RTM_QOS_H_
+#define  _RTM_QOS_H_
+
+#include "rtm.h"
+#include "sysdefs.h"
+#include "do_rcpapi.h"
+#include "do_rtmapi.h"
+#define RTM_QOS_SPY_SUBFR_NO           3
+
+/* Internal Data for each MAC flow */
+typedef struct 
+{
+  kal_int32    t2POutflow;              /* Q8 */  /* 0 ~ 2000 */
+  kal_int32    deltaT2PInflow;          /* Q8 */ /* -1000~1000 : -32 to 31.75 dB */
+  kal_uint32   potentialT2POutflowHC;   /* Q8 */  /* 0~1000000 */
+  kal_uint32   potentialT2POutflowLL;   /* Q8 */  /* 0~1000000 */
+  kal_uint16   queueOutflowHC;          /* suppose max 32788 bytes */
+  kal_uint16   queueOutflowLL;          /* suppose max 32788 bytes */
+  kal_bool      setF;
+    /* for real time mode selection */
+  kal_bool      setFLL[(RTM_MAX_REV_RATE_PHY2-1)];
+  kal_uint8    qrab;
+} MfcFlowDataT;
+
+/* Internal common Data for MAC flow - temporal parameter in RTM QOS module */
+typedef struct 
+{ 
+  kal_int8      rN;                                                                                          /* -255~255 (-1 to 1) signed Q7 */
+  kal_uint8      TMmin;
+  kal_uint32    txT2P;                                        /* Q8 */     /* 0~1000 */ /* output to Tx Pwr ctrl */
+  kal_uint32    sumQueueOutflow;          /* 32 * max 32788 bytes */
+  kal_int16     pilotStrength[SYS_CP_MAX_NUM_TC_ACTIVE_PILOTS];  /* Q2 dB  */
+  kal_int8    frab;         /* signed Q7 */ /* Soft value FRABn */
+} MfcCommonDataT;
+
+/* Stored Data - data should be saved for next packet calculation */
+typedef struct 
+{
+  kal_uint8     lastBucketLevelMax[MAX_MAC_FLOW_NUM];                    /* 0:NULL, 1~255: 0 to 63.5 dB per 0.25dB unit */
+  kal_int32     t2PInflow[MAX_MAC_FLOW_NUM];    /* Q8 */ /* -1000000~1000000 : 0 to 63.5 dB */
+  kal_int32     bucketLevel[MAX_MAC_FLOW_NUM];      /* Q8->Q6 to avoid overflow */   /* -1000000~1000000 : 0 to 63.5 dB */
+  kal_int32     bucketLevelSat[MAX_MAC_FLOW_NUM];       /* Q8->Q6 to avoid overflow */    /* -1000000~1000000 : 0 to 63.5 dB */
+  kal_uint8     tT2PHold[MAX_MAC_FLOW_NUM];                         /* 0 to 15 frames for n-1 */
+
+  /* 0x0~0x80 (0~32dB per 0.25dB) unsigned Q2 */
+  kal_uint8    txT2PHiCap[(RTM_MAX_REV_RATE_PHY2-1)][ MAX_SUB_PACKET_NUM]; /* Q2 */
+  /* 8bits (0 to 0x80, 0~32dB per 0.25 dB), unsigned Q2;default: 0x3,0xf¡¦. */
+  kal_uint8    txT2PLoLat[(RTM_MAX_REV_RATE_PHY2-1)][ MAX_SUB_PACKET_NUM];  /* Q2 */
+  /* 8bits (0 to 0x80, 0~32dB per 0.25 dB), unsigned Q2;default: 0x3,0xf¡¦. */
+  kal_uint8    txT2PHiCapNominal[(RTM_MAX_REV_RATE_PHY2-1)];    /* Q2 */
+  /* 0x0~0x80 (0~32dB per 0.25dB) unsigned Q2 */
+  kal_uint8    txT2PLoLatNominal[(RTM_MAX_REV_RATE_PHY2-1)];     /* Q2 */
+  /* 0x0~0x80 (0~32dB per 0.25dB) unsigned Q2 */
+  kal_uint16    t2PConversionFactorHC;                             /* Q8 */                          /* 0~1536 */
+  kal_uint16    t2PConversionFactorLL;                              /* Q8 */                          /* 0~1536 */
+  kal_int32    bucketFactor[MAX_MAC_FLOW_NUM];           /* Q8 */        /* 0~1000000 : 0 to 63.5 dB */
+              /* bucketFactor_interpolation(linearTodB10(MfcStoredData.t2PInflow[i]), MfcIn->frab, i) * MfcStoredData.t2PInflow[i]) ); */
+  kal_uint32    txT2PHiCapNominalLinear[(RTM_MAX_REV_RATE_PHY2-1)];    /* Q8 */
+  /* 0x0~0x80 (0~32dB per 0.25dB) unsigned Q2 */
+  kal_uint32    txT2PLoLatNominalLinear[(RTM_MAX_REV_RATE_PHY2-1)];     /* Q8 */
+  /* 0x0~0x80 (0~32dB per 0.25dB) unsigned Q2 */
+  kal_uint8       t2PHiCapNominalTransition[(RTM_MAX_REV_RATE_PHY2-1)]; /* Q2 */
+  /* 8bits (0 to 0x80, 0~32dB per 0.25 dB), unsigned Q2;default: 0x1c,0x28¡¦. */
+  kal_uint8       t2PLoLatNominalTransition[(RTM_MAX_REV_RATE_PHY2-1)];  /* Q2 */
+  /* 8bits (0 to 0x80, 0~32dB per 0.25 dB), unsigned Q2;default: 0x1c,0x28¡¦. */
+  kal_int32       t2PHiCapNominalAuxTransition[(RTM_MAX_REV_RATE_PHY2-1)]; /* Q2 */
+  /* 8bits (0 to 0x80, 0~32dB per 0.25 dB), unsigned Q2;default: 0x1c,0x28¡¦. */
+  kal_int32       t2PLoLatNominalAuxTransition[(RTM_MAX_REV_RATE_PHY2-1)]; /* Q2 */
+  /* 8bits (0 to 0x80, 0~32dB per 0.25 dB), unsigned Q2;default: 0x1c,0x28¡¦. */
+
+  kal_int16    maxTxT2P;                           
+  /* 0x0~0x80 (0~32dB per 0.25dB) unsigned Q2 */
+
+  kal_int16 availableTxPwr; /* Q7 */
+} MfcStoredDataT;
+
+
+/* Pre-calculated (dB to Linear conversion) Linear Attribute table */
+typedef struct 
+{ 
+  /* T2PInflowRangeNN */
+  kal_uint32    t2PInflowmax[MAX_MAC_FLOW_NUM];      /* Q8 */
+  /* 255:infinite, 0~255 (0~63.5dB/ 0.25dB), unsigned Q2, default :00:0x10,else:0x07 */
+  kal_uint32    t2PInflowmin[MAX_MAC_FLOW_NUM];     /* Q8 */
+  /* 255:infinite, 0~255 (0~63.5dB/ 0.25dB), unsigned Q2, default :00:0x10,else:0x07 */
+  /* BucketLevelMax00/01/NN */
+  kal_int32    bucketLevelMax[MAX_MAC_FLOW_NUM];      /* Q8 */
+  /* 0: NULL, 1~255 (0~63.5 dB per 0.25 dB), unsigned Q2 ; default 00:0x50,01:0x6c,NN:0x00 */
+  /* AuxiliaryPilotChannelParameters */
+  kal_uint32        auxPilotChannelGain;                /* Q8 */                                 /* 4bits, 0 to -15dB per -1dB; default: 0x0c */
+  /* CommonPowerParameters */
+  kal_uint32      txT2Pmin;                       /* Q8 */    /* 8bits unsigned Q2, 0~255(0~63.75dB per0.25dB); default:0xf */
+  /* RRIChannelPowerParameters */
+  kal_uint32        rRIChannelGainPreTransition[MAX_SUB_PACKET_NUM];   /* Q8 */
+  /* 2'comp 4 bit (-8¡¦7 per 1 dB); default: 0x0,0x0,0xa,0xa */
+  kal_uint32        rRIChannelGainPostTransition[MAX_SUB_PACKET_NUM-1];   /* Q8 */  
+   /* 2'comp 4 bit (-8¡¦7 per 1 dB); default: 0xa,0xa,0xa */
+
+  /* prepared data for interpolation */
+  kal_int16   pilotStrengthStrengthAxisSlope[14];           /* Q6 */
+  kal_int16   txT2PmaxPilotStrengthT2PAxisSlope[6];         /* Q7 */
+  kal_int8    pilotStrengthStrengthAxis[15];              /* -8~7 dB per 1dB */
+  kal_int8        T2PTransitionFunctionT2PDnT2PAxisFRABAxis[MAX_MAC_FLOW_NUM][128];                   
+  /* -128~127(-32¡¦31.75 dB per 0.25 dB), signed Q2 */
+  kal_int8        T2PTransitionFunctionT2PUpT2PAxisFRABAxis[MAX_MAC_FLOW_NUM][128];                   
+  /* -128~127(-32¡¦31.75 dB per 0.25 dB), signed Q2 */
+  kal_int8      T2PTransitionFunctionFRABAxis[MAX_MAC_FLOW_NUM][8];                   
+  /* -8~7(-1¡¦7/8), signed Q3 */ 
+  kal_int8      BucketFactorFRABAxis[MAX_MAC_FLOW_NUM][8];                   
+  /* -8~7(-1¡¦7/8), signed Q3 */
+
+  kal_int16      T2PTransitionFunctionT2PAxisSlopeConst[MAX_MAC_FLOW_NUM][15];        /* Q12 */           
+  /* (1<<16)/T2PTransitionFunctionT2PAxis[index][i]-T2PTransitionFunctionT2PAxis[index][i-1] */
+  kal_int16      T2PTransitionFunctionFRABAxisSlopeConst[MAX_MAC_FLOW_NUM][7];        /* Q11 */
+  /* (1<<16)/T2PTransitionFunctionFRABAxis[index][i]-T2PTransitionFunctionFRABAxis[index][i-1] */
+
+  kal_int16      BucketFactorT2PAxisSlopeConst[MAX_MAC_FLOW_NUM][15];        /* Q12 */           
+  /* (1<<16)/BucketFactorT2PAxis[index][i]-BucketFactorT2PAxis[index][i-1] */
+  kal_int16      BucketFactorFRABAxisSlopeConst[MAX_MAC_FLOW_NUM][7];       /* Q11 */            
+  /* (1<<16)/BucketFactorFRABAxis[index][i]-BucketFactorFRABAxis[index][i-1] */
+
+} MfcAttributeLinearDataT;
+
+
+#define RAB_UNLOADED_PERIOD 60000 /* 20 sec */ //for signaling conformance test variable
+
+#endif
+