| /***************************************************************************** |
| * 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 _SLCSMP_H_ |
| #define _SLCSMP_H_ 1 |
| /***************************************************************************** |
| * |
| * FILE NAME : slcsmp.h |
| * |
| * DESCRIPTION : This file includes the definition of SMP |
| * |
| * HISTORY : |
| * See Log at end of file |
| * |
| *****************************************************************************/ |
| #include "do_slcapi.h" |
| #include "slcamp.h" |
| #include "do_dsaapi.h" |
| #include "do_clcapi.h" |
| #include "slc_nvram.h" |
| |
| #define SESSION_CLOSE_REASON_MORE 8 |
| |
| #define SESSION_CLOSE_MESSAGEID_LEN 8 |
| #define SESSION_CLOSE_REASON_LEN 8 |
| #define SESSION_MORE_INFO_LEN 8 |
| #define SESSION_TYPE_LENGTH_LEN 1 |
| #define SESSION_TYPE_LEN_1 7 |
| #define SESSION_TYPE_LEN_2 15 |
| #define SESSION_SUBTYPE_LEN 16 |
| |
| #define KEEPALIVE_MESSAGEID_LEN 8 |
| #define KEEPALIVE_TRANSID_LEN 8 |
| |
| #define SMP_DEFAULT_TCLOSE 0x0ca8 |
| #define SMP_DEFAULT_NSMPKEEPALIVE 3 |
| |
| |
| #define SMP_KEEPALIVE_TIMER_INTERVAL 12000 |
| |
| #define SMP_DEFAULT_SUBTYPE 0x0000 |
| |
| typedef enum { |
| SMP_CONFIG_ATTR_ID = 0xff, |
| ALL_SMP_ATTR |
| }SmpAttributeID; |
| |
| typedef enum { |
| SMP_INUSE, |
| SMP_INCONFIG, |
| SMP_ALL |
| }SmpInstance; |
| |
| typedef enum { |
| SMP_SESSION_CLOSE_MSG = 0x01, |
| SMP_KEEPALIVE_REQ_MSG = 0x02, |
| SMP_KEEPALIVE_RSP_MSG = 0x03, |
| SMP_CONFIG_REQ_MSG = 0x50, |
| SMP_CONFIG_RSP_MSG = 0x51, |
| }SmpMessageTypeT; |
| |
| typedef enum { |
| INACTIVE_STATE, /*InActive ST*/ |
| SETUP_STATE, /*AMP Setup ST*/ |
| OPEN_STATE, /*Open ST*/ |
| CLOSING_STATE, |
| SMPSTATE |
| } SmpState; |
| |
| typedef enum { |
| FSM_NOT_INITED, |
| FSM_OPEN_ERR, |
| FSM_READ_ERR, |
| FSM_WRITE_ERR, |
| FSM_NO_ERR, |
| FSM_ERR |
| }FsmResult; |
| |
| typedef enum { |
| NEW_SESSION, |
| ALIVE_SESSION, |
| PRIOR_SESSION, |
| OPENED_SESSION |
| }SessionStateT; |
| |
| |
| typedef struct { |
| kal_uint8 MessageID; |
| kal_uint8 TransactionID; |
| }SmpKeepAliveMsgT; |
| |
| typedef struct{ |
| kal_uint8 Length; |
| SmpAttributeID AttrID; |
| kal_uint16 AttrValue; |
| }SmpAttributeRecord; |
| |
| typedef struct { |
| kal_uint8 MessageID; |
| kal_uint8 TransactionID; |
| SmpAttributeRecord AttrRecord; |
| }SmpConfigurationRspMsgT; |
| |
| typedef struct { |
| kal_uint16 InuseSubType; |
| kal_uint16 InconfigSubType; |
| SmpState SmpState; |
| kal_uint8 KeepAliveReqTransIdSent; |
| kal_uint8 KeepAliveReqTransIdRcv; |
| kal_bool MpsInProgress; |
| kal_uint8 NKeepAlive; /*count parameter*/ |
| kal_uint8 NRemainKeepAliveTimes; /*The remaining system time*/ |
| kal_uint8 PriorSessionGAUP; |
| SessionStateT SesionState; |
| }SmpParamT; |
| |
| typedef kal_bool (*pCallFunc)(void **retBuffer, void *storedBuffer); |
| |
| void SmpInit(void); |
| void RunSmpStateMachine(kal_uint32 MsgId, void *MsgDataP); |
| void ProcessSmpDsaFwdMsg(DsaFwdMsgT *MsgDataP); |
| void ProcessSmpKeepAliveTransTimeout(void); |
| void SmpInitStructures( kal_uint16 SubType, kal_bool InUse); |
| void SmpCommit(void); |
| void SetSmpState(SmpState state); |
| SmpState GetSmpState(void); |
| void SetSessionState(SessionStateT state); |
| SessionStateT GetSessionState(void); |
| kal_uint8 GetSessionEhrpdFlag(void); |
| void SmpDeclareSessionOpened(kal_bool informCssOnly, kal_bool newSession); |
| void SmpSendSessionOpenStatus(kal_bool status); |
| void SmpSetSessionNegoState(SessionStateT state); |
| void SlcReportSessionNegoFailure(ClcErrCauseT cause); |
| void SlcSendDsarDelMsg(kal_uint8 protocolType, kal_uint8 msgId, kal_bool reqTxStatus); |
| void SlcSessionStatePrint(void); |
| void smp_nvram_read_cnf_handle (local_para_struct *local_para_ptr, peer_buff_struct *peer_buff_ptr); |
| void smp_nvram_write_cnf_handle(local_para_struct *local_para_ptr, peer_buff_struct *peer_buff_ptr); |
| void SmpCheckSendingLocationNotificationMsg(kal_bool setFlag, kal_bool sendMsg); |
| kal_bool SmpCheckSessionNegoHpsNeeded(void); |
| |
| /***************************************************************************** |
| * $Log: slcsmp.h $ |
| * |
| * 06 04 2018 tom.wu |
| * [MOLY00328488] [Merlot][MT6761][O1][C2K][OM6M][MD3 Regression]EVDO system selecting time is longer than OPPO R11 |
| * |
| * . |
| * |
| * 07 06 2017 sue.zhong |
| * [MOLY00259241] [6293][C2K]Replace with KAL data type |
| * Correct copyright file header |
| * |
| * 04 24 2017 tom.wu |
| * [MOLY00231424] [6293][C2K] slc/clc common modify |
| * |
| * :merge MP6 CL to UMOLYA.TRUNK, 86452,86510,87001,87251,87574,87644 |
| * |
| * 04 11 2017 tom.wu |
| * [MOLY00241000] [BIANCO][MT6763][RDIT][PHONE][MD_Pre-Sanity][C2K][SIM1:CTC]fail to establish ppp link |
| * |
| * : session restore stream2/RTM personality set |
| * |
| * 02 21 2017 tom.wu |
| * [MOLY00229931] [6293][C2K] merge session restore feature modify |
| * |
| * . |
| * |
| * 12 01 2016 sue.zhong |
| * [MOLY00213777] [6293][C2K]Sync C2K code to UMOLYA TRUNK(W1648) |
| * Update C2K source |
| * |
| * 11 09 2016 sue.zhong |
| * [MOLY00208435] [6293][C2K]Sync C2K code to UMOLYA TRUNK |
| * Update C2K PS code (2/2) |
| * |
| * 11 09 2016 sue.zhong |
| * [MOLY00208435] [6293][C2K]Sync C2K code to UMOLYA TRUNK |
| * Update C2K PS code (2/2) |
| *****************************************************************************/ |
| |
| /***************************************************************************** |
| * End of File |
| *****************************************************************************/ |
| #endif /*_SLCSMP_H_*/ |
| |
| |