blob: 599bb75b511995d2ce391f3d2addac5d0ef241e9 [file] [log] [blame]
/*****************************************************************************
* 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) 2010 VIA Telecom, Inc. All rights reserved.
*
*************************************************************/
#ifndef _ALMPDEFS_H_
#define _ALMPDEFS_H_ 1
/****************************************************************************
*
* Module: almpdefs.h
*
* Purpose:
*
****************************************************************************/
/*----------------------------------------------------------------------------
Include Files
----------------------------------------------------------------------------*/
#include "inspdefs.h"
#include "do_almpapi.h"
#include "do_dsaapi.h"
#include "pswapi.h"
#include "slc_nvram.h"
/*----------------------------------------------------------------------------
Local Defines and Macros
----------------------------------------------------------------------------*/
#define HLW_OPEN_CONN_MASK 0x01
#define FTAP_OPEN_CONN_MASK 0x02
#define RTAP_OPEN_CONN_MASK 0x04
#define SCP_OPEN_CONN_MASK 0x08
#define ETS_OPEN_CONN_MASK 0x10
#define ALMP_CONFIG_MESSAGE_ID_WIDTH 8
#define ALMP_CONFIG_TRANS_ID_WIDTH 8
#define ALMP_CONFIG_RECORD_LEN_WIDTH 8
#define ALMP_CONFIG_RECORD_ATTR_ID_WIDTH 8
#define ALMP_CONFIG_RECORD_ATTR_VALUE_WIDTH 8
#define ALMP_CONFAIL_REPORT_ACK_TRANS_ID_WIDTH 8
#define CP_ALMP_MESSAGE_ID_WIDTH 8
#define CP_NUM_CHANNEL_WIDTH 8
#define CP_SYSTEMTYPE_WIDTH 8
#define CP_BANDCLASS_WIDTH 5
#define CP_CHANNELNUM_WIDTH 11
#define ALMP_CONNFAIL_REPORT_MESSAGE_ID_WIDTH 8
#define ALMP_CONNFAIL_REPORT_TRANS_ID_WIDTH 8
#define ALMP_CONNFAIL_REPORT_NUMREC_WIDTH 4
#define ALMP_CONNFAIL_REPORT_REASON_WIDTH 4
#define ALMP_CONNFAIL_REPORT_TIMESTAMP_WIDTH 32
#define ALMP_CONNFAIL_REPORT_SECTOR_ID_WIDTH 128
#define ALMP_CONNFAIL_REPORT_CHANNELREC_SYSTEM_TYPE_WIDTH 8
#define ALMP_CONNFAIL_REPORT_CHANNELREC_BAND_CLASS_WIDTH 5
#define ALMP_CONNFAIL_REPORT_CHANNELREC_CHANN_NUM_WIDTH 11
#define ALMP_CONNFAIL_REPORT_LATLONGINC_WIDTH 1
#define ALMP_CONNFAIL_REPORT_LAT_WIDTH 22
#define ALMP_CONNFAIL_REPORT_LONG_WIDTH 23
#define CP_MAX_NUM_REDIRECT_CHANNELS 10 /* can be more, just taken for now */
#define CP_MAX_CONNECTIONFAIL_REC_NUM 4
#define ALMP_MAX_CONNECTIONFAIL_SEND_CNT 4
#define NONE 0
#define CONNFAIL_REPORT_DISABLE 0x00
typedef enum
{
ALMP_REDIRECT_MESSAGE = 0x00,
ALMP_CONNFAIL_REPORT_MESSAGE = 0x01,
ALMP_CONNFAIL_REPORT_ACK_MESSAGE = 0x02,
ALMP_CONFIG_REQUEST_MESSAGE = 0x50,
ALMP_CONFIG_RESPONSE_MESSAGE,
} AlmpMsgTypeT;
typedef enum
{
ALMP_INUSE,
ALMP_INCONFIG,
ALMP_ALL
}AlmpInsT;
typedef enum
{
FTAP,
RTAP
} AlmpTapTypeT;
typedef enum
{
GEN_CONN_FAILURE,
TUNING_1X_FAILURE,
TUNING_POS_FAILURE,
OTHER_FAILURE,
ALL_FAILURE
} AlmpConnFailReasonT;
/* ALMP Redirect Message */
typedef struct
{
kal_uint8 MessageId; /* 8 bits */
kal_uint8 NumChannel; /* 8 bits */
ChanRecGT Channels[CP_MAX_NUM_REDIRECT_CHANNELS]; /* 24 bits/channel */
} AlmpRedirectMsgT;
typedef struct
{
kal_uint32 TimeStamp;
ChanRecGT Channel;
kal_uint8 FailReason;
kal_bool LatLongInc;
kal_uint32 Latitude;
kal_uint32 Longitude;
kal_uint8 SectorId[16];
}ConnFailRecT;
typedef struct
{
kal_uint8 NumRecord;
ConnFailRecT ConnFailRec[CP_MAX_CONNECTIONFAIL_REC_NUM];
}AlmpConnFailRecT;
typedef struct
{
kal_bool WaitAckPending;
kal_uint8 nSendCount;
}AlmpConnFailAckCntT;
/*----------------------------------------------------------------------------
Function Prototypes
----------------------------------------------------------------------------*/
void AlmpInitialize(kal_bool bCreateTask);
void RunAlmpStateMachine(kal_uint32 MsgId, void *MsgDataP);
void ProcessAlmpDsaFwdMsg(DsaFwdMsgT *MsgDataP);
void ProcessAlmpPswPowerMsg(PswPowerMsgT *MsgDataPtr);
void ProcessAlmpInspNtwkAcqdMsg(AlmpInspNtwkAcqdMsgT *MsgDataPtr);
void ProcessAlmpIdpConnOpenedMsg(void);
void ProcessAlmpIdpConnFailedMsg(AlmpIdpConnFailMsgT *MsgPtr);
void ProcessAlmpCspConnClosedMsg(void);
void ProcessAlmpOmpAnRedirectMsg(AlmpOmpAnRedirectMsgT *MsgDataPtr );
void ProcessAlmpIdpPageReqMsg(void);
void ProcessAlmpIdpFastconnInitiatedMsg(void);
void ProcessAlmpCcmAcmSupervsnFailMsg(kal_bool bDueSysTimeFault, kal_bool bNetworkLostInd,kal_bool bDuePreempted);
void ProcessAlmpSysAcqReqMsg(SysAcqReasonT reason);
void ProcessAlmpOosaWakeupReqMsg(void);
void ProcessAlmpSupervsnFailMsg(void);
void ProcessAlmpRupConnLostMsg(void);
void ProcessAlmpRupAssgnRejMsg(void);
void ProcessAlmpCssReInitMsg(void);
void ProcessAlmpHlwRelConnMsg(void);
void ProcessAlmpHlwCloseConnMsg(void);
void ProcessAlmpHlwOpenConnMsg(void);
void ProcessAlmpTapOpenConnMsg(AlmpTapTypeT Tap);
void ProcessAlmpTapRelConnMsg(AlmpTapTypeT Tap);
void ProcessAlmpTapCloseConnMsg(AlmpTapTypeT Tap);
void ProcessAlmpScpOpenConnMsg(void);
void ProcessAlmpScpRelConnMsg(void);
void ProcessAlmpScpCloseConnMsg(kal_bool bScpNegotiationComplete);
void ProcessAlmpOmpUpdateMsg(AlmpOmpUpdateMsgT* MsgDataPtr);
void ProcessAlmpDsaTxStatusMsg(DsarTxStatusMsgT *MsgDataP);
void ProcesAlmpSmpCloseConnMsg(void);
void ProcessAlmpEltOpenConnMsg(void);
void ProcessAlmpEltRelConnMsg(void);
void ProcessAlmpEltRelConnSHDRMsg(void);
void ProcessAlmpScpReconfigMsg(void);
void ProcessAlmpScpCommitedMsg(void);
void AlmpQueConnqstInInitState(kal_uint8 connection);
void AlmpSendConnectFailReportMsg(void);
void AlmpInitStructures( kal_uint8 SubType, kal_bool InUse);
void ProcessAlmpCcmSuperFailMsg(kal_bool bDueSysTimeFault,kal_bool bDuePreempted);
void processAlmpOmpSuperFailMsg(void);
void ProcessAlmpIdpThawMsg(void);
void ProcessCssSystemValidatedMsg(void);
void ProcessClcL3StatePrint(void);
void AlmpResetRmc(kal_bool bCallFromAlmp);
void AlmpSetNetworkSearchPriority(kal_bool aIsNeedUpPriority);
kal_bool AlmpIsUpNetworkSearchPriority();
/*****************************************************************************
* End of File
*****************************************************************************/
#endif /*_ALMPDEFS_H_*/