rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2006 |
| 8 | * |
| 9 | * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 10 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| 11 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| 12 | * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 13 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 15 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 16 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 17 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| 18 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| 19 | * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| 20 | * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| 21 | * |
| 22 | * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| 23 | * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 24 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 25 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| 26 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 27 | * |
| 28 | * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| 29 | * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| 30 | * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| 31 | * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| 32 | * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| 33 | * |
| 34 | *****************************************************************************/ |
| 35 | |
| 36 | /***************************************************************************** |
| 37 | * |
| 38 | * Filename: |
| 39 | * --------- |
| 40 | * custom_ssds.h |
| 41 | * |
| 42 | * Project: |
| 43 | * -------- |
| 44 | * |
| 45 | * Description: |
| 46 | * ------------ |
| 47 | * * |
| 48 | * Author: |
| 49 | * ------- |
| 50 | * ------- |
| 51 | *============================================================================ |
| 52 | * HISTORY |
| 53 | * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 54 | *------------------------------------------------------------------------------ |
| 55 | * |
| 56 | *------------------------------------------------------------------------------ |
| 57 | * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 58 | *============================================================================ |
| 59 | ****************************************************************************/ |
| 60 | |
| 61 | #ifndef __CUSTOM_SSDS_H__ |
| 62 | #define __CUSTOM_SSDS_H__ |
| 63 | |
| 64 | #include "sim_exported_enum.h" |
| 65 | #include "l3_inc_enums_public.h" |
| 66 | |
| 67 | typedef enum |
| 68 | { |
| 69 | CUSTOM_SSDS_ATCMD_TYPE_SET_CALL_FORWARDING, |
| 70 | CUSTOM_SSDS_ATCMD_TYPE_GET_CALL_FORWARDING, |
| 71 | CUSTOM_SSDS_ATCMD_TYPE_SET_CALL_WAITING, |
| 72 | CUSTOM_SSDS_ATCMD_TYPE_GET_CALL_WAITING, |
| 73 | CUSTOM_SSDS_ATCMD_TYPE_SET_CALL_BARRING, |
| 74 | CUSTOM_SSDS_ATCMD_TYPE_GET_CALL_BARRING, |
| 75 | CUSTOM_SSDS_ATCMD_TYPE_SET_CLIR, |
| 76 | CUSTOM_SSDS_ATCMD_TYPE_GET_CLIR, |
| 77 | CUSTOM_SSDS_ATCMD_TYPE_SET_CLIP, |
| 78 | CUSTOM_SSDS_ATCMD_TYPE_GET_CLIP, |
| 79 | CUSTOM_SSDS_ATCMD_TYPE_SET_COLP, |
| 80 | CUSTOM_SSDS_ATCMD_TYPE_GET_COLP, |
| 81 | CUSTOM_SSDS_ATCMD_TYPE_SET_COLR, |
| 82 | CUSTOM_SSDS_ATCMD_TYPE_GET_COLR, |
| 83 | CUSTOM_SSDS_ATCMD_TYPE_UNKNOWN |
| 84 | |
| 85 | }custom_ssds_atcmd_type; |
| 86 | |
| 87 | typedef enum |
| 88 | { |
| 89 | CUSTOM_SSDS_PATH_TYPE_PS_PREFER, /*Support XCAP and CS. And with PS prefer*/ |
| 90 | CUSTOM_SSDS_PATH_TYPE_PS_ONLY, /*XCAP only*/ |
| 91 | CUSTOM_SSDS_PATH_TYPE_CS_ONLY, /*CS only*/ |
| 92 | CUSTOM_SSDS_PATH_TYPE_NOT_SUPPORT_409, /*not support: return error 409*/ |
| 93 | CUSTOM_SSDS_PATH_TYPE_NOT_SUPPORT_832, /*not support: return error 832*/ |
| 94 | CUSTOM_SSDS_PATH_TYPE_NOT_SUPPORT_CCWA, /*not support: return +CCWA:0xff,0, then OK*/ |
| 95 | CUSTOM_SSDS_PATH_TYPE_NOT_SUPPORT_403, /*not support: return error 403*/ |
| 96 | CUSTOM_SSDS_PATH_TYPE_NOT_SUPPORT_100, /*not support: return error 100*/ |
| 97 | CUSTOM_SSDS_PATH_TYPE_PS_ONLY_SET_TO_QUERY, /*XCAP only, Specail for call waiting: change to query operation*/ |
| 98 | CUSTOM_SSDS_PATH_TYPE_PS_ONLY_SET_TO_QUERY_PDN, /* XCAP only, return the status of PDN establishment successful or not */ |
| 99 | CUSTOM_SSDS_PATH_TYPE_NOT_SUPPORT_31, /*no csfb, return error 31*/ |
| 100 | CUSTOM_SSDS_PATH_TYPE_CS_ONLY_ALWAYS, /*CS even if IMS call exist*/ |
| 101 | CUSTOM_SSDS_PATH_TYPE_OPERATION_NOT_SUPPORTED_4, /* return error 4 */ |
| 102 | CUSTOM_SSDS_PATH_TYPE_OPR_DTR_BARRING_8, /* return error 8 */ |
| 103 | CUSTOM_SSDS_PATH_TYPE_CALL_BARRED_10, /* return error 10 */ |
| 104 | CUSTOM_SSDS_PATH_TYPE_SIM_PIN_REQUIRED_11, /* return error 11 */ |
| 105 | CUSTOM_SSDS_PATH_TYPE_SIM_PUK_REQUIRED_12, /* return error 12 */ |
| 106 | CUSTOM_SSDS_PATH_TYPE_NOT_FOUND_404, /* return error 404 */ |
| 107 | CUSTOM_SSDS_PATH_TYPE_PRECONDITION_FAILED_412, /* return error 412 */ |
| 108 | CUSTOM_SSDS_PATH_TYPE_PHB_FDN_BLOCKED_2600, /* return error 2600 */ |
| 109 | CUSTOM_SSDS_PATH_TYPE_TB_SOLUTION, /* CLIR/CW terminal based solution */ |
| 110 | CUSTOM_SSDS_PATH_TYPE_NO_CONN_845 /* Report no connection when data off */ |
| 111 | |
| 112 | }custom_ssds_path_type; |
| 113 | |
| 114 | typedef enum |
| 115 | { |
| 116 | CUSTOM_SSDS_USSD_PATH_TYPE_INVALID, |
| 117 | CUSTOM_SSDS_USSD_PATH_TYPE_IMS, /*Support IMS and VoPS*/ |
| 118 | CUSTOM_SSDS_USSD_PATH_TYPE_CS, |
| 119 | CUSTOM_SSDS_USSD_PATH_TYPE_NOT_SUPPORT |
| 120 | |
| 121 | }custom_ssds_ussd_path_type; |
| 122 | |
| 123 | |
| 124 | typedef enum |
| 125 | { |
| 126 | CUSTOM_SSDS_CSFB_TYPE_ALWAYS, /*csfb: from now on till reboot*/ |
| 127 | CUSTOM_SSDS_CSFB_TYPE_ONCE, /*csfb: but only this time*/ |
| 128 | CUSTOM_SSDS_CSFB_TYPE_NO_CCWA, /*no csfb, return +CCWA:0xff,0, then OK*/ |
| 129 | CUSTOM_SSDS_CSFB_TYPE_NO_832, /*no csfb, return error 832*/ |
| 130 | CUSTOM_SSDS_CSFB_TYPE_NO_403, /*no csfb, return error 403*/ |
| 131 | CUSTOM_SSDS_CSFB_TYPE_NO_4, /*no csfb, return error 409*/ |
| 132 | CUSTOM_SSDS_CSFB_TYPE_NO_409, /*no csfb, return error 409*/ |
| 133 | CUSTOM_SSDS_CSFB_TYPE_NO_31, /*no csfb, return error 31*/ |
| 134 | CUSTOM_SSDS_CSFB_TYPE_NO /*csfb: no*/ |
| 135 | |
| 136 | }custom_ssds_csfb_type; |
| 137 | |
| 138 | typedef enum |
| 139 | { |
| 140 | CUSTOM_SSDS_PDN_TYPE_XCAP, /*Need to setup XCAP PDN*/ |
| 141 | CUSTOM_SSDS_PDN_TYPE_INTERNET, /*Need to setup internet PDN*/ |
| 142 | CUSTOM_SSDS_PDN_TYPE_NO, /*No need to setup PDN*/ |
| 143 | CUSTOM_SSDS_PDN_TYPE_NOT_MATCH, /*The condition of setup PDN is not matched*/ |
| 144 | |
| 145 | }custom_ssds_pdn_type; |
| 146 | |
| 147 | typedef enum |
| 148 | { |
| 149 | CUSTOM_SSDS_ROAMING_TYPE_NO, /*No roaming*/ |
| 150 | CUSTOM_SSDS_ROAMING_TYPE_UNKNOWN, /*roaming, but can not tell if its domestic or international*/ |
| 151 | CUSTOM_SSDS_ROAMING_TYPE_DOMESTIC, /*Domistic roaming*/ |
| 152 | CUSTOM_SSDS_ROAMING_TYPE_INTERNATIONAL, /*International roaming*/ |
| 153 | |
| 154 | }custom_ssds_roaming_type; |
| 155 | |
| 156 | typedef enum |
| 157 | { |
| 158 | CUSTOM_SSDS_IMS_DOMAIN_TYPE_NONE, |
| 159 | CUSTOM_SSDS_IMS_DOMAIN_TYPE_WFC, |
| 160 | CUSTOM_SSDS_IMS_DOMAIN_TYPE_LTE, |
| 161 | CUSTOM_SSDS_IMS_DOMAIN_TYPE_OTHERS |
| 162 | |
| 163 | }custom_ssds_ims_domain_type; |
| 164 | |
| 165 | typedef enum |
| 166 | { |
| 167 | CUSTOM_SSDS_PDN_FAIL_PATH_TYPE_NO_CSFB, /*No need CSFB,return error to AP*/ |
| 168 | CUSTOM_SSDS_PDN_FAIL_PATH_TYPE_CSFB_ONCE, /*Need CSFB once*/ |
| 169 | CUSTOM_SSDS_PDN_FAIL_PATH_TYPE_CSFB_ALWAYS, /*CSFB always*/ |
| 170 | CUSTOM_SSDS_PDN_FAIL_PATH_TYPE_NO_CSFB_31, /*For CT No need CSFB,return error to AP*/ |
| 171 | |
| 172 | }custom_ssds_pdn_fail_path_type; |
| 173 | |
| 174 | typedef enum |
| 175 | { |
| 176 | CUSTOM_SSDS_ALL_OUTGOING_CALL_BARRING, |
| 177 | CUSTOM_SSDS_OUTGOING_CALL_BARRING, |
| 178 | CUSTOM_SSDS_INCOMING_CALL_BARRING, |
| 179 | |
| 180 | }custom_ssds_call_barring_type; |
| 181 | |
| 182 | typedef enum{ |
| 183 | CUSTOM_SSDS_RF_OFF, |
| 184 | CUSTOM_SSDS_RF_ON, |
| 185 | }custom_ssds_rf_status; |
| 186 | |
| 187 | typedef enum |
| 188 | { |
| 189 | CUSTOM_SSDS_STATUS_NOT_CHECKED, |
| 190 | CUSTOM_SSDS_STATUS_USER_VOLTE_SUBSCRIBED, |
| 191 | CUSTOM_SSDS_STATUS_USER_VOLTE_NOT_SUBSCRIBED |
| 192 | |
| 193 | }custom_ssds_user_volte_subscription_status; |
| 194 | |
yu.dong | e372c32 | 2023-08-30 20:25:04 -0700 | [diff] [blame] | 195 | typedef enum |
| 196 | { |
| 197 | SSDS_CW_SYNC_TYPE_NONE, |
| 198 | SSDS_CW_SYNC_TYPE_REAL_TIME, |
| 199 | SSDS_CW_SYNC_TYPE_NON_REAL_TIME, |
| 200 | SSDS_CW_SYNC_IMS_REGISTERED_NON_REAL_TIME_ELSE_REAL_TIME |
| 201 | }custom_ssds_cw_sync_type; |
| 202 | |
rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 203 | typedef struct |
| 204 | { |
| 205 | kal_int8 *atcmd_buff; |
| 206 | kal_uint16 atcmd_len; |
| 207 | custom_ssds_atcmd_type atcmd_type; |
| 208 | }custom_ssds_atcmd_info; |
| 209 | |
| 210 | typedef struct |
| 211 | { |
| 212 | sim_interface_enum sim_id; |
| 213 | kal_uint8 sim_type; |
| 214 | kal_char mccmnc[7]; |
| 215 | |
| 216 | kal_bool is_ct_volte_enabled; |
| 217 | kal_bool is_ct_card; |
| 218 | rat_enum preferred_network_type; |
| 219 | kal_bool is_data_roaming_setting_enabled; |
| 220 | kal_bool is_mobile_data_setting_enabled; |
| 221 | kal_bool only_use_real_error_code; |
| 222 | |
| 223 | }custom_ssds_info_struct; |
| 224 | |
| 225 | typedef enum { |
| 226 | CUSTOM_SSDS_XCAP_NW_ERROR_NONE = 0, |
| 227 | CUSTOM_SSDS_XCAP_NW_ERROR_NW_NO_RESPONSE = 1, |
| 228 | CUSTOM_SSDS_XCAP_NW_ERROR_GEMINI_ISSUE = 2, |
| 229 | CUSTOM_SSDS_XCAP_NW_ERROR_CANNOT_CONNECT_TO_SERVER = 3, |
| 230 | CUSTOM_SSDS_XCAP_NW_ERROR_PS_ALWAYS_FAIL = 4, |
| 231 | CUSTOM_SSDS_XCAP_NW_EEROR_SERVICE_NOT_SUPPORTED = 5, // network not support this sim do xcap |
| 232 | }custom_ssds_xcap_nw_error_info; |
| 233 | |
| 234 | typedef struct |
| 235 | { |
| 236 | kal_uint32 error_code; |
| 237 | kal_uint32 real_error_code; |
| 238 | custom_ssds_xcap_nw_error_info error_info; |
| 239 | }custom_ssds_xcap_error_info_struct; |
| 240 | |
| 241 | typedef enum { |
| 242 | CUSTOM_SSDS_CFG_TYPE_MCF_OTA, |
| 243 | CUSTOM_SSDS_CFG_TYPE_MCF_OTA_BY_OP, |
| 244 | CUSTOM_SSDS_CFG_TYPE_NVRAM, |
| 245 | CUSTOM_SSDS_CFG_TYPE_MAX |
| 246 | }custom_ssds_config_type; |
| 247 | |
| 248 | typedef enum { |
| 249 | CUSTOM_SSDS_RAT_MODE_CHANGE_TIMER_TYPE_TRIGGER = 0, |
| 250 | CUSTOM_SSDS_RAT_MODE_CHANGE_TIMER_TYPE_WAIT = 1, |
| 251 | CUSTOM_SSDS_RAT_MODE_CHANGE_TIMER_TYPE_CS_REG = 2 |
| 252 | }custom_ssds_rat_mode_change_timer_type; |
| 253 | |
| 254 | /********new design begin***********/ |
| 255 | //condition |
| 256 | typedef struct |
| 257 | { |
| 258 | sim_interface_enum sim_id; |
| 259 | kal_uint8 ps_id; |
| 260 | kal_uint8 sim_type; |
| 261 | kal_char mccmnc[7]; |
| 262 | kal_char mcc[4]; |
| 263 | kal_char mnc[4]; |
| 264 | kal_uint32 op_id; |
| 265 | custom_ssds_atcmd_type atcmd_type;//Duplicate with atcmd_type in the atcmd_info;remove atcmd_info |
| 266 | custom_ssds_call_barring_type cb_type;//The type of call barring |
| 267 | kal_bool is_cfu;//is call forwarding uncondition |
| 268 | kal_bool is_ct_volte_enabled; |
| 269 | kal_bool is_ct_card; |
| 270 | kal_bool is_ims_registered; |
| 271 | custom_ssds_ims_domain_type ims_domain; |
| 272 | kal_bool ps_attached; |
| 273 | kal_bool lte_attached; |
| 274 | kal_bool nr_attached; |
| 275 | custom_ssds_rf_status rf_status; |
| 276 | rat_enum preferred_network_type; |
| 277 | custom_ssds_roaming_type roaming_status; |
| 278 | kal_bool is_data_roaming_setting_enabled; |
| 279 | kal_bool is_mobile_data_setting_enabled; |
| 280 | kal_bool is_imsvops_support;//for ussd |
| 281 | |
| 282 | kal_uint32 rsp_id;//only used for rsp domain selection |
| 283 | kal_uint32 real_rsp_id; |
| 284 | custom_ssds_xcap_error_info_struct *ssds_xcap_error_info;//only used for getting disable_ut_timer vaule |
| 285 | custom_ssds_user_volte_subscription_status user_volte_subscription_status; |
| 286 | |
| 287 | //the output parameter |
| 288 | kal_bool only_use_real_error_code;//in case of set_to_query, this value will be true |
| 289 | |
| 290 | }custom_ssds_params_info_struct; |
| 291 | |
| 292 | /********new design end*************/ |
| 293 | |
yu.dong | e372c32 | 2023-08-30 20:25:04 -0700 | [diff] [blame] | 294 | custom_ssds_ussd_path_type custom_ssds_get_ussd_req_path_variable ( custom_ssds_params_info_struct *params_info); |
| 295 | custom_ssds_ussd_path_type custom_ssds_get_stk_ussd_req_path_variable ( custom_ssds_params_info_struct *params_info); |
rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 296 | void custom_ssds_need_send_409_err_string_variable(module_type module,kal_bool *need_send,kal_uint32 op_id,kal_char *mccmnc); |
yu.dong | e372c32 | 2023-08-30 20:25:04 -0700 | [diff] [blame] | 297 | void custom_ssds_need_sync_cw_in_234g_variable(custom_ssds_params_info_struct *params_info,custom_ssds_cw_sync_type *need_sync); |
rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 298 | void custom_ssds_need_send_test_cmd(module_type module,kal_bool *need_send,kal_uint32 op_id,kal_char *mccmnc); |
| 299 | void custom_ssds_ussd_is_csfb_retry_allowed(custom_ssds_params_info_struct *params_info,kal_bool *is_ussd_csfb_allowed); |
| 300 | |
| 301 | kal_bool custom_ssds_need_sync_to_cs(custom_ssds_atcmd_type ss_type,kal_uint32 rsp_code); |
| 302 | kal_bool custom_ssds_is_csfb_allowed(kal_uint32 op_id, kal_char *mccmnc, custom_ssds_roaming_type roaming_type); |
yu.dong | e372c32 | 2023-08-30 20:25:04 -0700 | [diff] [blame] | 303 | |
| 304 | void custom_ssds_config_get_need_sync_cw_in_234g_from_common_file(custom_ssds_params_info_struct *params_info, |
| 305 | custom_ssds_cw_sync_type *need_sync, |
| 306 | custom_ssds_config_type cfg_type); |
rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 307 | kal_bool custom_ssds_is_ussi_allowed_during_ims_call(custom_ssds_params_info_struct *params_info); |
| 308 | kal_bool custom_ssds_is_csfb_during_imsCall_allowed(kal_uint32 op_id, |
| 309 | kal_char *mccmnc, |
| 310 | custom_ssds_roaming_type roaming_type, |
| 311 | custom_ssds_ims_domain_type ims_domain, |
| 312 | kal_bool is_wfc_call); |
| 313 | |
| 314 | custom_ssds_path_type custom_ssds_get_req_path(custom_ssds_params_info_struct *params_info); |
| 315 | custom_ssds_csfb_type custom_ssds_get_rsp_path(custom_ssds_params_info_struct *params_info); |
| 316 | kal_uint32 custom_ssds_get_disable_ut_timer_value(custom_ssds_params_info_struct *params_info); |
| 317 | kal_bool custom_ssds_is_rat_mode_change_allowed(custom_ssds_params_info_struct *params_info); |
| 318 | kal_uint32 custom_ssds_get_rat_mode_change_timer_value(custom_ssds_rat_mode_change_timer_type timer_type); |
| 319 | |
| 320 | kal_bool custom_only_ps_supported_atcmd( custom_ssds_params_info_struct *params_info, |
| 321 | custom_ssds_path_type *atcmd_req_type); |
| 322 | |
| 323 | kal_bool custom_only_cs_supported_atcmd(custom_ssds_params_info_struct *params_info, |
| 324 | custom_ssds_path_type *atcmd_req_type); |
| 325 | #endif |
| 326 | |