[Feature]Upload Modem source code

Change-Id: Id4294f30faced84d3e6fd6d5e61e1111bf287a37
diff --git a/mcu/interface/protocol/l2_c2k/evdo/par.h b/mcu/interface/protocol/l2_c2k/evdo/par.h
new file mode 100644
index 0000000..dced0c7
--- /dev/null
+++ b/mcu/interface/protocol/l2_c2k/evdo/par.h
@@ -0,0 +1,355 @@
+/*****************************************************************************
+*  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) 2006-2010 VIA Telecom, Inc.  All rights reserved.
+*
+*************************************************************/
+#ifndef  _PAR_H_
+#define  _PAR_H_
+/*****************************************************************************
+*
+* FILE NAME   :   par.h
+*
+* DESCRIPTION :   This file contains function prototypes and other definitions
+*                 for the Reverse Packet Application
+*
+* HISTORY     :
+*     See Log at end of file
+*
+*****************************************************************************/
+
+/*----------------------------------------------------------------------------
+* Include Files
+----------------------------------------------------------------------------*/
+#include "ParRlpList.h"
+#include "do_fcpapi.h"
+#include "do_dsaapi.h"
+#include "do_Qos.h"
+#ifdef CBP7_EHRPD
+//#include "../fcp/paflist.h"
+#endif
+
+#include "slc_nvram.h"
+
+/*----------------------------------------------------------------------------
+Defines And Macros
+----------------------------------------------------------------------------*/
+#define RLP_DPA_HEADER_BITS        22
+
+
+#define MAX_LOCATION_LEN          128
+#define MAX_STORAGEBLOB_LEN       128
+#define MAX_NAK_REC_NUM 20  /* Max NakRequests # in Nak msg */
+/*----------------------------------------------------------------------------
+structure definitions
+----------------------------------------------------------------------------*/
+/*                               Enum definitions                                   */
+typedef enum
+{
+    RCP_PAR_SUBTYPE_ERR,
+    RCP_PAR_STRNUM_ERR,
+    RCP_PAR_TXLIST_ERR,
+    RCP_PAR_RETXLIST_ERR,
+    RCP_PAR_PHYMISSLIST_ERR,
+    RCP_PAR_MSGDEC_ERR,
+    RCP_PAR_APPNOTINIT_ERR,
+    RCP_PAR_TXLIST_FULL_ERR,
+    RCP_PAR_MSGID_ERR,
+    RCP_PAR_OTAMSGID_ERR,
+    RCP_PAR_GAUP_ATTR_ERR,
+    RCP_PAR_NAK_NOT_SUPPORT_ERR,
+    RCP_PAR_GRANT_SIZE_NOT_ENOUGH_ERR,
+    RCP_PAR_MAX_ERR_ID
+}PARErrorT;
+
+
+
+typedef struct
+{
+    kal_uint8 nAppType;
+    kal_uint16 nProtocolType;
+    ParFlowCtrlStateT stFlowCtrl;
+#ifdef CBP7_EHRPD
+    ParRspStateT          stRsp;
+#endif
+}ParAppInstanceT;
+
+typedef struct
+{
+    kal_uint16 nProtocolType;
+    kal_uint8 nAppType;
+}ParStreamConfigInfoT;
+
+typedef enum
+{
+    PAR_Invalid = 0x0,
+    PAR_Default = 0x1,
+    PAR_MultiFlow
+} PARAppTypeT;
+
+typedef enum
+{
+    RESET_TX_INDICATION_MSG,
+    RESET_MSG = RESET_TX_INDICATION_MSG,
+    RESET_RX_INDICATION_MSG,
+    RESET_ACK_MSG = RESET_RX_INDICATION_MSG,
+    NAK_MSG,
+    LOCATION_REQUEST_MSG,
+    LOCATION_NOTIFICATION_MSG,
+    LOCATION_ASSIGNMENT_MSG,
+    LOCATION_COMPLETE_MSG,
+    XON_REQUEST_MSG,
+    XON_RESPONSE_MSG,
+    XOFF_REQUEST_MSG,
+    XOFF_RESPONSE_MSG,
+    DATA_READY_MSG,
+    DATA_READY_ACK_MSG,
+    RESET_TX_INDICATION_ACK_MSG = 0x0d,
+    RESET_TX_COMPLETE_MSG,
+    RESET_RX_COMPLETE_MSG,
+
+    STORAGEBLOB_REQ_MSG,
+    STORAGEBLOB_NOTIFICATION_MSG,
+    STORAGEBLOB_ASSIGNMENT_MSG,
+    STORAGEBLOB_COMPLETE_MSG,
+
+    DATA_OVER_SIGNALING_MSG = 0x14,
+    DATA_OVER_SIGNALING_ACK_MSG,
+    RESERVATION_ON_REQ_MSG=0x16,
+    RESERVATION_OFF_REQ_MSG,
+    RESERVATION_ACCEPT_MSG,
+    RESERVATION_REJECT_MSG,
+    REV_RESERVATION_ON_MSG,
+    REV_RESERVATION_OFF_MSG,
+    FWD_RESERVATION_OFF_MSG = 0x22,
+    FWD_RESERVATION_ON_MSG,
+    FWD_RESERVATION_ACK_MSG,
+    CONFIGURATION_REQUEST_MSG = 0x50,
+    CONFIGURATION_RESPONSE_MSG,
+    ATTRIBUTE_UPDATE_REQ_MSG = 0x52,
+    ATTRIBUTE_UPDATE_ACCEPT_MSG,
+    ATTRIBUTE_UPDATE_REJECT_MSG
+}PAROtaMsgIdT;
+
+typedef enum
+{
+    RLP_NULL_ST,
+    RLP_DATA_ST,
+    RLP_RESET_INIT_ST,
+    RLP_RESET_RSP_ST,
+    RLP_MAX_ST
+} ParRlpStateT;
+
+typedef enum
+{
+    RLP_NONE,
+    RLP_TXQ,
+    RLP_RETXQ
+}RlpTxQTypeT;
+
+typedef  struct
+{
+    kal_uint32  FirstErased;
+    kal_uint16  WindowLen;
+} ParRlpNakReqT;
+typedef  struct
+{
+    kal_uint8   RLPFlow;
+#ifdef CBP7_EHRPD
+    ParRspRouteT RspRoute;
+#endif
+    kal_uint8   SequenceLength;
+    kal_uint8   NakRequests;
+    ParRlpNakReqT  Request[MAX_NAK_REC_NUM];
+#ifdef CBP7_EHRPD
+    kal_uint8   VR;
+#endif
+}ParRlpNakMsgT;
+
+typedef  struct
+{
+    kal_uint32 TimerId;
+}ParTExpireMsgT;
+/************************************************************/
+/*                               structure for RLP                                              */
+
+typedef  struct
+{
+    /*  kal_bool        bBufFull;*/
+    RlpTxQTypeT BufType;  /*Type of buffer the last packet sent from*/
+    kal_uint16      BytesTx;
+    kal_uint16      BytesRetx;
+#ifdef CBP7_EHRPD
+    PAR_LIST_STR TxReseqQ;    /*If the  DataUnit is packet for a Packet stream, need this for retx */
+#endif
+}ParRlpTxInfoT;
+
+
+typedef  struct ParRlpInstance_Struct
+{
+    kal_uint8                    AppType;
+    kal_uint8                    RLPId;
+    kal_uint8                    RLPFlowId;
+    kal_uint8                    RLPIDLen;   /*In Bits*/
+    kal_uint8                    SEQLen;     /* In Bits*/
+    kal_uint8                    RLPHdrLen;  /*In Bytes */
+    kal_uint8                    Priority;
+    ParRlpStateT             RlpState;
+    kal_uint32                   vs;
+    kal_uint32                   range;
+    BestPktInfoT             bestPktInfo;
+    ParRlpTxListT            TxList;
+    ParRlpRetxListT          RetxList;
+    ParRlpTxInfoT           TxInfo;
+    kal_uint8                    MacFlowId;
+    kal_bool                     FlushTimerExpired;
+#ifdef CBP7_EHRPD
+    kal_uint32                  maxVS;
+    ParRspRouteT       curRoute;
+    kal_uint16  (*ParRlpSendDataFromTxQ)(struct ParRlpInstance_Struct *pInst, DatapktlistGT* pPktList, kal_uint16 nBytesAvail);
+    kal_uint16  (*ParRlpSendDataFromRetxQ)(struct ParRlpInstance_Struct *pInst, DatapktlistGT* pPktList, kal_uint16 nBytesAvail);
+    PAR_LIST_STR           TxReseqQ;     /*If the  DataUnit is packet for a Packet stream, need this for retx */
+#endif
+}ParRlpInstanceT;
+
+
+/*************************************************************************************/
+/*                      structure for Location Update Protocol                       */
+typedef  struct
+{
+    kal_uint8  LocationType;
+    kal_uint8  LocationLen;
+    kal_uint8  LocationValue[MAX_LOCATION_LEN];
+} ParLocationDataRecT;
+
+typedef  struct
+{
+    kal_uint16  StorageBLOBType;
+    kal_uint8   StorageBLOBLen;
+    kal_uint8   StorageBLOBValue[MAX_STORAGEBLOB_LEN];
+} ParStorageBLOBDataRecT;
+
+typedef  struct
+{
+    kal_bool    bLocValueStored;
+    kal_uint8   LocTransId;
+    kal_bool    bStorageBlobStored;
+    kal_uint8   BlobTransId;
+    ParLocationDataRecT     LocationData;
+    ParStorageBLOBDataRecT  StorageBlob;
+    /*kal_bool    bConnSetup;*/
+}ParLocUpdInfoT;
+/*************************************************************************************/
+/*                          structure for Attribute                                  */
+typedef  struct
+{
+    AppSubTypeT  parSubType;
+    /* kal_uint16        ProtocolType;*/
+
+    /*Default Packet Application Attributes*/
+    kal_uint8           RANHandoff;
+
+    /*Multi-Flow Packet Application Attributes*/
+    kal_uint8           MaxAbortTimer;   /*in units of 100ms*/
+    kal_bool            RevFlowNakEnabled;
+    kal_bool            FlowPhysicalLayerNakEnabledRev;
+    kal_uint8           RevFlowHighLayerProtocol;
+    /* kal_uint8           ReservationIdleStateRev[MAX_NUM_RESERVATIONS];
+    kal_uint8           ReservationIdleStateFwd[MAX_NUM_RESERVATIONS];*/
+    kal_uint16          FlowTransmitAbortTimerRev;
+    kal_bool            FlowDataOverSignalingAllowedRev;
+    FlowIdentificationAttribT attribRevFlowIdentification;
+    FlowTimersAttribT         attribRevFlowTimer;
+    kal_uint16          FlowAbortTimerRevInFrame;
+    /*   FlowReservationAttribT    attribRevFlowReservation;
+    FlowReservationAttribT    attribFwdFlowReservation;*/
+
+    MaxRLPFlowsAttribT        attribRevmaxRLPFlows;
+    /*    MaxReservationsAttribT attribRevMaxResv;*/
+    SupportHLProtocolT       SupportedHLProtocol;
+#ifdef CBP7_EHRPD
+
+    /*Enhanced Multi-Flow Packet Application attributes */
+    kal_bool             PPPFreeAuthenticationSupport;
+    kal_bool            TwoRouteSupported;
+    kal_bool            ATNakDelaySupported;
+    kal_uint8    attribRevFlowProtocolPDU;
+    kal_uint8    attribRevFlowDataUnit;
+    kal_uint8   attribRevRouteProtocolPDU;
+    RevFlowProtocolParametersAttribT attribRevFlowProtocolParameters;
+    RevRouteProtocolParametersAttribT attribRevRouteProtocolParameters;
+#endif
+}ParAccessConfigDataT;
+
+
+typedef  struct
+{
+    kal_uint8 AttrToBeNegotiated;
+    kal_uint8 CfgReqTranId;
+} ParAttrNegotiationInfoT;
+
+/*----------------------------------------------------------------------------
+API Functions
+----------------------------------------------------------------------------*/
+void ParMsgHandler(kal_uint32 MsgId, kal_uint32 MsgSize, void* pMsg);
+void ProcessParDsaFwdMsg(DsaFwdMsgT *MsgDataP);
+void ParInit(void);
+void ParInitAppInstWithStreamConfigInfo(StreamConfigAttribT *pConfigData);
+void ParRlpPhyMissRetxQUpdate(void);
+void ParAppFlowCtrlStateSet(ParAppInstanceT *pAppInst, ParFlowCtrlStateT state);
+kal_bool ParSendDSARMsg(DsaRevMsgT*  pMailMsg);
+void ParSendFwdAttribute(PafRcpSessionConfigMsgT* pCfgData);
+void ParAccessCommit(void);
+void ParServiceCommit(void);
+void ParInitStructures(kal_uint16 SubType, kal_bool InUse);
+void ParHandleReservationLabelCmd(ParRlpReservationOnOffMsgT* pMsg);
+void ParHandleSnKKQoSRequestCmd(ParSnKKQosReqMsgT* pMsg);
+void ParSendReservationOnReq(kal_uint8 Count, ReservationInfoT* pResv);
+void ParSendReservationOffReq(kal_uint8 Count, ReservationInfoT* pResv);
+void ProcessParLupUnsolicitedCfgMsg(LUPUnsolicitedCfgMsgT* MsgDataP);
+ParRlpInstanceT *GetRlpInstByAppStream(ParHlpDataTxMsgT *pMsg, PARAppStreamT AppStream);
+
+
+/*****************************************************************************
+* End of File
+*****************************************************************************/
+#endif
+
+