blob: 682348377e0ecbf94a8705762e9b5a0d05d19aa6 [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) 2018
*
* 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).
*
*******************************************************************************/
#ifndef MSPM_PUBLIC_STRUCT_H
#define MSPM_PUBLIC_STRUCT_H
#include "kal_public_defs.h"
/********************************************
* MACROS *
********************************************/
#if !defined(__MTK_TARGET__) && !defined(__UE_SIMULATOR__)
#ifndef MSPM_UT
#define MSPM_UT
#endif
#endif
#define MSPM_MAX_PRIORITY_LEVEL 32
/********************************************
* TYPE DEFINITIONS & ENUMS *
********************************************/
typedef enum
{
MSPM_PROC_ATTR_AS_CONNECTION,
MSPM_PROC_ATTR_C2K_AS_CONNECTION,
MSPM_PROC_ATTR_PRIORITY_CAN_CHANGE,
MSPM_PROC_ATTR_PREEMPTED_BY_PEER_NOT_ALLOWED,
MSPM_PROC_ATTR_OCCUPY_RF_IMMEDIATELY,
MSPM_PROC_ATTR_SUSPEND_PEER_SIM,
MSPM_PROC_ATTR_23G_NAS_PS_SIG,
MSPM_PROC_ATTR_MAX_NUM
} mspm_procedure_attribute_enum;
typedef enum
{
MSPM_CELLULAR_EMERGENCY_CALL_SESSION,
MSPM_CELLULAR_CALL_SESSION,
MSPM_CELLULAR_CONNECTED_CALL_SESSION,
MSPM_CELLULAR_SRVCC_CALL_SESSION,
MSPM_VODATA_CALL_SESSION,
MSPM_VODATA_EMERGENCY_CALL_SESSION,
MSPM_IMS_CALL_ALT1,
MSPM_IMS_CALL_ALT2,
MSPM_BIP,
MSPM_CS_CALL,
MSPM_SMS,
MSPM_MMS,
MSPM_DDM_RETRY_FOR_SUSPEND,
MSPM_CISS,
MSPM_XCAP_SS,
M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_GMM_COMBINED_RAU,
MSPM_ESM_ACT_PDN,
MSPM_ESM_ACT_PDN_IMS,
MSPM_ESM_ACT_PDN_EMC,
MSPM_ESM_ACT_BEARER,
MSPM_ESM_MOD_BEARER,
MSPM_ESM_DEACT_PDN,
MSPM_ESM_IMS_DED,
MSPM_EMM_ATTACH,
MSPM_EMM_DETACH,
MSPM_EMM_DETACH_POWER_OFF,
MSPM_EMM_DETACH_RSIM,
MSPM_EMM_TAU,
MSPM_EMM_TAU_IRAT,
MSPM_EMM_TAU_DRB,
MSPM_EMM_TAU_RSIM,
MSPM_EMM_TAU_RETRY,
MSPM_EMM_TAU_CSFB,
MSPM_EMM_TAU_AFR_NR,
MSPM_EMM_SERVICE,
MSPM_EMM_SERVICE_RSIM,
MSPM_EMM_EXT_SERVICE,
MSPM_EMM_PS_PAGING,
MSPM_EMM_PS_PAGING_HIGH,
MSPM_EMM_SMC,
MSPM_5G_AS_CONNECTION,
MSPM_5G_AS_INACTIVE,
MSPM_5G_AS_RNA_UPDATE,
MSPM_4G_AS_CONNECTION,
MSPM_4G_AS_CONNECTION_ABORT,
MSPM_4G_AS_RECONFIG_DURING,
MSPM_3G_AS_CONNECTION,
MSPM_3G_AS_PCH,
MSPM_2G_AS_CONNECTION_CS,
MSPM_2G_AS_CONNECTION_PS,
MSPM_C1X_AS_CONNECTION_CS,
MSPM_C1X_AS_CONNECTION_SRLTE_ENHAN,
MSPM_C1X_AS_CONNECTION_PS,
MSPM_CDO_AS_CONNECTION_PS,
MSPM_CDO_AS_CONNECTION_HPS,
MSPM_VGSM_EST_EMERGENCY_PDU_SESSION,
MSPM_VGSM_EST_IMS_PDU_SESSION,
MSPM_VGSM_EST_PDUS,
MSPM_VGSM_MOD_PDUS,
MSPM_VGSM_REL_PDUS,
MSPM_VGSM_CONN_REQ,
MSPM_VGMM_REG,
MSPM_VGMM_DEREG,
MSPM_VGMM_DEREG_POWER_OFF,
MSPM_VGMM_REG_UPDATE,
MSPM_VGMM_REG_UPDATE_IRAT,
MSPM_VGMM_REG_UPDATE_UP,
MSPM_VGMM_SERVICE,
MSPM_VGMM_PS_PAGING,
MSPM_VGMM_PS_PAGING_NON_PREEMPTED,
MSPM_VGMM_PAGING_DRB,
MSPM_VGMM_IRAT_PROTECT,
MSPM_ERRC_TEST_RFDB_CHECK,
MSPM_ERRC_CONFIG_RFDB_CHECK,
MSPM_NRRC_TEST_RFDB_CHECK,
MSPM_NRRC_CONFIG_RFDB_CHECK,
MSPM_EL1_RFDB_CONFIG,
MSPM_NL1_RFDB_CONFIG,
MSPM_MT_SGS_SMS,
MSPM_MT_IMS_SMS,
MSPM_GEMINI_ABORT_4G_PROTECT,
MSPM_NRRC_ODSI_RA_HIGH,
MSPM_NRRC_ODSI_RA_LOW,
MSPM_PRE_GEMINI_ABORT,
MSPM_IMSM_ACT,
MSPM_ERRC_NR_GAPLESS_SFTD,
MSPM_NFR_PROTECT,
MSPM_OTTAPP_VV_TOP,
MSPM_LPP_POS_MEAS_MEM_SHARE,
MSPM_N3GPP_ACT_PDN,
MSPM_N3GPP_ACT_PDN_IMS,
MSPM_N3GPP_ACT_PDN_EMC,
MSPM_N3GPP_IKEV2_EXCHANGE,
MSPM_PROCEDURE_ENUM_NUM
} mspm_procedure_enum;
typedef enum
{
MSPM_SIM1 = 0,
MSPM_SIM2 = 1,
MSPM_SIM3 = 2,
MSPM_SIM4 = 3,
MSPM_SIM_NONE = 0xFF
} mspm_sim_index_enum;
typedef enum
{
MSPM_VC_CAUSE_NONE,
MSPM_VC_CAUSE_SRLTE,
MSPM_VC_CAUSE_RSIM,
MSPM_VC_CAUSE_SIGNALING
} mspm_vc_cause_enum;
// MSG_ID_MSPM_SESSION_START_REQ
typedef struct
{
LOCAL_PARA_HDR
mspm_sim_index_enum sim_index; // sim_index in current module
mspm_procedure_enum procedure; // procedure to be started
kal_bool is_block_waiting; // TRUE : Source module will wait CNF message with result success for "wait_time" seconds
// False : MSPM will reply the request immediately no matter success or fail CNF
kal_uint32 wait_time; // "wait_time" seconds for "wait_time">0. In case "wait_time" = 0, it means infinitely wait
} mspm_session_start_req_struct;
// MSG_ID_MSPM_SESSION_START_CNF
typedef struct
{
LOCAL_PARA_HDR
mspm_procedure_enum procedure;
kal_bool result; // TRUE : success; FALSE : fail
} mspm_session_start_cnf_struct;
// MSG_ID_MSPM_SESSION_START_NTF
typedef struct
{
LOCAL_PARA_HDR
mspm_sim_index_enum sim_index;
mspm_procedure_enum procedure;
} mspm_session_start_ntf_struct;
// MSG_ID_MSPM_SESSION_END_NTF
typedef struct
{
LOCAL_PARA_HDR
mspm_sim_index_enum sim_index;
mspm_procedure_enum procedure;
kal_bool is_extend_timer_disable;
} mspm_session_end_ntf_struct;
// MSG_ID_MSPM_AS_SESSION_START_REQ
typedef struct
{
LOCAL_PARA_HDR
mspm_sim_index_enum sim_index;
mspm_procedure_enum procedure;
kal_uint32 mspm_ack_id; // 0: from primitive, none 0: from callback function
} mspm_as_session_start_req_struct;
// MSG_ID_MSPM_AS_SESSION_START_CNF
typedef struct
{
LOCAL_PARA_HDR
mspm_procedure_enum procedure;
kal_bool result;
} mspm_as_session_start_cnf_struct;
// MSG_ID_MSPM_AS_SESSION_END_NTF
typedef struct
{
LOCAL_PARA_HDR
mspm_sim_index_enum sim_index;
mspm_procedure_enum procedure;
kal_uint32 mspm_ack_id; // 0: from primitive, none 0: from callback function
} mspm_as_session_end_ntf_struct;
// MSG_ID_MSPM_RF_OWNER_CHANGE_NTF
typedef struct
{
LOCAL_PARA_HDR
mspm_sim_index_enum rf_owner;
} mspm_rf_owner_change_ntf_struct;
// MSG_ID_MSPM_RF_OWNER_PRIORITY_CHANGE_NTF
typedef struct
{
LOCAL_PARA_HDR
mspm_sim_index_enum rf_owner;
kal_uint8 priority;
} mspm_rf_owner_priority_change_ntf_struct;
// MSG_ID_MSPM_AS_LEAVE_VC_SUSPEND_REQ
typedef struct
{
LOCAL_PARA_HDR
mspm_sim_index_enum sim_index;
} mspm_as_leave_vc_suspend_req_struct;
// MSG_ID_MSPM_XL1_DR_STATUS_IND
typedef struct
{
LOCAL_PARA_HDR
kal_bool is_dr_enable;
} mspm_xl1_dr_status_ind_struct;
/********************************************
* VARIABLES *
********************************************/
/********************************************
* FUNCTION DECLARATIONS *
********************************************/
extern kal_bool mspm_as_session_start_request(mspm_sim_index_enum sim_index, module_type mod_src, mspm_procedure_enum procedure);
extern void mspm_as_session_end_ntf(mspm_sim_index_enum sim_index, module_type mod_src, mspm_procedure_enum procedure);
extern mspm_sim_index_enum mspm_query_rf_owner(void);
extern kal_bool mspm_is_this_sim_rf_owner(mspm_sim_index_enum sim_index);
extern kal_uint8 mspm_query_sim_priority(mspm_sim_index_enum sim_index);
extern kal_bool mspm_is_proc_ongoing(mspm_sim_index_enum sim_index, mspm_procedure_enum procedure);
extern kal_uint8 mspm_query_proc_priority(mspm_procedure_enum procedure);
extern kal_uint8 mspm_query_num_of_ongoing_proc(mspm_sim_index_enum sim_index);
extern mspm_sim_index_enum mspm_query_sim_index_with_highest_ongoing_proc(mspm_sim_index_enum current_sim_index);
extern kal_uint8 mspm_query_ongoing_proc_num_with_attr(mspm_sim_index_enum sim_index, mspm_procedure_attribute_enum proc_attr);
extern kal_uint8 mspm_query_ongoing_as_session_num(mspm_sim_index_enum sim_index);
extern kal_bool mspm_query_proc_attr(mspm_procedure_enum procedure, mspm_procedure_attribute_enum proc_attr);
extern kal_bool mspm_is_any_peer_sim_proc_ongoing(mspm_sim_index_enum current_sim_index, mspm_procedure_enum procedure);
extern kal_bool mspm_is_current_sim_occupy_rf_possible(mspm_sim_index_enum current_sim_index);
extern kal_bool mspm_is_peer_sim_in_connected(mspm_sim_index_enum current_sim_index);
extern mspm_vc_cause_enum mspm_query_vc_cause(mspm_sim_index_enum current_sim_index);
extern kal_bool mspm_is_this_sim_in_vc(mspm_sim_index_enum sim_index);
extern kal_bool mspm_is_peer_sim_in_nr_connected(mspm_sim_index_enum current_sim_index);
#ifdef MSPM_UT
void mspm_ut_set_rf_owner(mspm_sim_index_enum sim_index);
void mspm_ut_set_sim_priority(mspm_sim_index_enum sim_index, kal_uint32 priority);
void mspm_ut_reset(void);
void mspm_ut_set_non_as_session_status(mspm_sim_index_enum sim_index, mspm_procedure_enum procedure, kal_bool is_ongoing);
#endif
#endif /* MSPM_PUBLIC_STRUCT_H */