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) 2005 |
| 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 | * Filename: |
| 37 | * --------- |
| 38 | * ps_public_utility.h |
| 39 | * |
| 40 | * Description: |
| 41 | * ------------ |
| 42 | * This file is intends for put the header of PS public API |
| 43 | * |
| 44 | * Author: |
| 45 | * ------- |
| 46 | * ------- |
| 47 | * |
| 48 | *============================================================================ |
| 49 | *****************************************************************************/ |
| 50 | #ifndef _PS_PUBLIC_UTILITY_H_ |
| 51 | #define _PS_PUBLIC_UTILITY_H_ |
| 52 | |
| 53 | #include "kal_general_types.h" |
| 54 | #include "ps_public_struct.h" |
| 55 | #include "sim_public_enum.h" |
| 56 | #include "kal_public_defs.h" //MSBB change #include "stack_config.h" |
| 57 | #include "keypad_sw.h" |
| 58 | #include "nvram_data_items.h" |
| 59 | #include "sbp_public_utility.h" |
| 60 | |
| 61 | #include "c2k_irat_msg_struct.h" |
| 62 | #include "l3_inc_enums_public.h" |
| 63 | |
| 64 | extern kal_uint8 l4c_cc_ss_string_parsing(kal_uint8 *string_ptr, kal_uint8 length, kal_uint8 sim_interface, kal_bool is_in_call); |
| 65 | |
| 66 | extern sim_interface_enum l4c_gemini_get_actual_sim_id(sim_interface_enum simId); |
| 67 | |
| 68 | extern sim_interface_enum l4c_gemini_get_switched_sim_id(sim_interface_enum simId); |
| 69 | |
| 70 | extern sim_interface_enum l4c_csus_get_actual_sim_slot_id(protocol_id_enum sim_ps_Id); |
| 71 | |
| 72 | extern protocol_id_enum l4c_csus_get_switched_sim_ps_id(sim_interface_enum sim_slot_Id); |
| 73 | |
| 74 | extern module_type rmmi_get_default_uart_owner(void); |
| 75 | |
| 76 | extern void smsal_gsm7_unpack(kal_uint8 *packed_data, kal_uint8 *unpacked_data, kal_uint16 data_len, kal_uint16 offset); |
| 77 | extern kal_uint16 smsal_msg_len_in_character(kal_uint8 dcs, kal_uint16 len, kal_uint8 last_byte); |
| 78 | extern kal_bool smsal_is_support_r4_mbdn(void); |
| 79 | extern void smsal_sdm_set_tp_rd(kal_uint8 *str, kal_uint16 str_len); |
| 80 | |
| 81 | #if defined(__IMS_SUPPORT__) || defined(__SMS_IMS_SUPPORT__) |
| 82 | extern kal_bool sdm_is_sms_tp_rd_set(void); |
yu.dong | e372c32 | 2023-08-30 20:25:04 -0700 | [diff] [blame] | 83 | extern kal_bool sdm_is_sms_tp_rd_set_for_stk(void); |
rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 84 | #endif |
| 85 | |
| 86 | extern kal_uint8 smsal_cmgf_query_with_ps_id(kal_uint8 ps_id); |
| 87 | extern kal_uint8 smsal_get_mr(kal_uint8 slot); |
| 88 | extern kal_bool smsal_is_initing_or_sim_refreshing(kal_uint8 slot); |
| 89 | extern kal_bool smsal_is_csca_set(void); |
| 90 | |
| 91 | |
| 92 | extern kal_bool l4c_kbd_getkeydata(kbd_data *keydata); |
| 93 | |
| 94 | //move to ATP extern void rmmi_sleep_mode_callback(void); |
| 95 | |
| 96 | extern void l4c_report_voice_codec(kal_uint16 codec); |
| 97 | |
| 98 | extern kal_bool tcm_get_ims_flag_by_nsapi(kal_uint8 nsapi, kal_uint8 sim_interface); |
| 99 | extern kal_bool tcm_get_nw_applied_ims_flag_by_nsapi(kal_uint8 nsapi, kal_uint8 sim_interface); |
| 100 | extern kal_uint16 tcm_get_ims_flag_to_bitmap(kal_uint8 sim_interface); |
| 101 | // CSR |
| 102 | #ifdef __VIDEO_CALL_SUPPORT__ |
| 103 | typedef void (*fp_vt_csr_activate_req)(void); |
| 104 | typedef void (*fp_vt_csr_deactivate_req)(void); |
| 105 | |
| 106 | extern fp_vt_csr_activate_req csr_get_fp_vt_csr_activate_req(void); |
| 107 | extern fp_vt_csr_deactivate_req csr_get_fp_vt_csr_deactivate_req(void); |
| 108 | #endif |
| 109 | |
| 110 | extern vg_option_enum l4crac_get_vg_option (protocol_id_enum ps_id); |
| 111 | |
| 112 | #if defined(__FAST_DORMANCY__) || defined(__NO_PSDATA_SEND_SCRI__) |
| 113 | /**************************************************************************** |
| 114 | * Function: RRC_CPCSupport |
| 115 | * |
| 116 | * Description: Return TRUE if UE supports CPC. |
| 117 | *****************************************************************************/ |
| 118 | extern kal_bool RRC_CPCSupport(void); |
| 119 | |
| 120 | #ifdef __FAST_DORMANCY__ |
| 121 | /**************************************************************************** |
| 122 | * Function: RRC_NW_R8_FD_Support |
| 123 | * |
| 124 | * Description: Return TRUE if NW supports T323. |
| 125 | *****************************************************************************/ |
| 126 | extern kal_bool RRC_NW_R8_FD_Support(); |
| 127 | #endif /* __FAST_DORMANCY__ */ |
| 128 | #endif /* __FAST_DORMANCY__ || __NO_PSDATA_SEND_SCRI__ */ |
| 129 | |
| 130 | |
| 131 | /***************************************************************************** |
| 132 | * FUNCTION |
| 133 | * sbp_query_id() |
| 134 | * |
| 135 | * DESCRIPTION |
| 136 | * This function is used to query SBP ID received by modem |
| 137 | * |
| 138 | * PARAMETERS |
| 139 | * [IN] N/A |
| 140 | * RETURNS |
| 141 | * the unsigned 4-byte value for the SBP ID |
| 142 | *****************************************************************************/ |
| 143 | extern kal_uint32 sbp_query_id(void); |
| 144 | |
| 145 | /***************************************************************************** |
| 146 | * FUNCTION |
| 147 | * l4c_get_iratmode_req() |
| 148 | * |
| 149 | * DESCRIPTION |
| 150 | * This function is used to get the setting of iratmode |
| 151 | * |
| 152 | * PARAMETERS |
| 153 | * N/A |
| 154 | * |
| 155 | * RETURNS |
| 156 | * l4c_irat_type_enum 0: AP based iRAT; 1: modem based iRAT |
| 157 | *****************************************************************************/ |
| 158 | extern l4c_irat_type_enum l4c_get_iratmode_req(void); |
| 159 | |
| 160 | #ifdef __CDMA2000_RAT__ |
| 161 | /***************************************************************************** |
| 162 | * FUNCTION |
| 163 | * errc_cel_com_lte_rat_info_to_as_info() |
| 164 | * |
| 165 | * DESCRIPTION |
| 166 | * This function is used in IRAT from C2K to LTE (LTE <--RAT_CHANGE_REQ-- C2K) to convert LTE RAT info (from C2K) into EAS RAT info (for EAS) |
| 167 | * |
| 168 | * PARAMETERS |
| 169 | * a_irat_type [IN] IRAT type from C2K to LTE |
| 170 | * *a_lte_rat_info [IN] LTE RAT info from C2K |
| 171 | * |
| 172 | * RETURNS |
| 173 | * EAS RAT info pointer, which the data is converted from *a_lte_rat_info |
| 174 | *****************************************************************************/ |
| 175 | extern void *errc_cel_com_lte_rat_info_to_as_info(irat_type_enum a_irat_type, cas_eas_activate_ecell_req_struct *a_lte_rat_info); |
| 176 | |
| 177 | /***************************************************************************** |
| 178 | * FUNCTION |
| 179 | * errc_cel_com_as_info_ptr_to_as_irat_info() |
| 180 | * |
| 181 | * DESCRIPTION |
| 182 | * This function is used in IRAT from C2K to LTE (LTE --RAT_CHANGE_CNF--> C2K) to convert EAS RAT info (from EAS) into C2K RAT info (for C2K) |
| 183 | * |
| 184 | * PARAMETERS |
| 185 | * *a_as_info_ptr [IN] LTE RAT info from EAS |
| 186 | * *c2k_rat_info [IN/OUT] LTE RAT info, containing info converted from *a_as_info_ptr, for C2K |
| 187 | * |
| 188 | * RETURNS |
| 189 | * N/A |
| 190 | *****************************************************************************/ |
| 191 | extern void errc_cel_com_as_info_ptr_to_c2k_rat_info(void *a_as_info_ptr, cas_eas_activate_ecell_cnf_struct *c2k_rat_info); |
| 192 | |
| 193 | /***************************************************************************** |
| 194 | * FUNCTION |
| 195 | * errc_cel_com_as_info_to_c2k_rat_info() |
| 196 | * |
| 197 | * DESCRIPTION |
| 198 | * This function is used in IRAT from LTE to C2K (LTE --RAT_CHANGE_IND--> C2K) to convert EAS RAT info (from EAS) into C2K RAT info (for C2K) |
| 199 | * |
| 200 | * PARAMETERS |
| 201 | * *a_as_info_ptr [IN] C2K RAT info from EAS |
| 202 | * *c2k_rat_info [IN/OUT] C2K RAT info, containing info converted from *a_as_info_ptr, for C2K |
| 203 | * |
| 204 | * RETURNS |
| 205 | * N/A |
| 206 | *****************************************************************************/ |
| 207 | extern void errc_cel_com_as_info_to_c2k_rat_info(eas_cas_activate_ccell_req_struct *c2k_rat_info, void *a_as_info_ptr); |
| 208 | |
| 209 | /***************************************************************************** |
| 210 | * FUNCTION |
| 211 | * errc_cel_com_c2k_rat_info_to_as_info_ptr() |
| 212 | * |
| 213 | * DESCRIPTION |
| 214 | * This function is used in IRAT from LTE to C2K (LTE <--RAT_CHANGE_RSP-- C2K) to convert C2K RAT info (from C2K) into EAS RAT info (for EAS) |
| 215 | * |
| 216 | * PARAMETERS |
| 217 | * a_irat_type [IN] IRAT type from LTE to C2K |
| 218 | * *c2k_rat_info [IN] C2K RAT info from C2K |
| 219 | * |
| 220 | * RETURNS |
| 221 | * C2K RAT info pointer, which the data is converted from *c2k_rat_info |
| 222 | *****************************************************************************/ |
| 223 | extern void *errc_cel_com_c2k_rat_info_to_as_info_ptr(irat_type_enum a_irat_type, eas_cas_activate_ccell_cnf_struct *c2k_rat_info); |
| 224 | #endif /* __CDMA2000_RAT__ */ |
| 225 | |
| 226 | |
| 227 | extern void l4ctcm_translate_apn_to_spec_format(kal_uint8 *access_name, kal_uint8 *src_apn, kal_uint8 apn_len); |
| 228 | extern kal_uint8 l4ctcm_translate_apn_to_string_format(kal_uint8 *src_apn, kal_uint8 *dst_apn); |
| 229 | /***************************************************************************** |
| 230 | * FUNCTION |
| 231 | * l4c_set_dynamic_sbp_id() |
| 232 | * |
| 233 | * DESCRIPTION |
| 234 | * Change SBP ID dynamically according to the inserted SIM. |
| 235 | * |
| 236 | * PARAMETERS |
| 237 | * void |
| 238 | * |
| 239 | * RETURNS |
| 240 | * void |
| 241 | *****************************************************************************/ |
| 242 | |
| 243 | extern void l4c_set_dynamic_sbp_id(void); |
| 244 | |
| 245 | #if defined (__TC01_NVRAM__) || defined(__TC01__) //MOLY00294741 |
| 246 | /***************************************************************************** |
| 247 | * FUNCTION |
| 248 | * sbp_query_md_feature_custom() |
| 249 | * |
| 250 | * DESCRIPTION |
| 251 | * This function is used to query modem configuration |
| 252 | * for customer's specific Single Binary Platform (SBP) features |
| 253 | * MUSE - ALPS0144925 |
| 254 | * |
| 255 | * PARAMETERS |
| 256 | * feature [IN] modem feature |
| 257 | * |
| 258 | * RETURNS |
| 259 | * KAL_TRUE : if this feature is turned on |
| 260 | * KAL_FALSE : if this feature is turned off |
| 261 | *****************************************************************************/ |
| 262 | extern kal_bool sbp_query_md_feature_custom(sbp_md_feature_custom_enum feature ); |
| 263 | |
| 264 | /***************************************************************************** |
| 265 | * FUNCTION |
| 266 | * sbp_set_md_feature() |
| 267 | * |
| 268 | * DESCRIPTION |
| 269 | * This function is used to query modem configuration for customer's features |
| 270 | * MUSE - ALPS0144925 |
| 271 | * PARAMETERS |
| 272 | * feature [IN] modem feature |
| 273 | * is_turned_on [IN] |
| 274 | * sbp_feature_ptr [IN/OUT] |
| 275 | * |
| 276 | * RETURNS |
| 277 | * KAL_TRUE if success; otherwise KAL_FALSE |
| 278 | *****************************************************************************/ |
| 279 | kal_bool sbp_set_md_feature_custom(sbp_md_feature_custom_enum feature, |
| 280 | kal_bool is_turned_on, |
| 281 | nvram_ef_sbp_modem_config_struct *sbp_custom_ptr); |
| 282 | #endif /* __TC01__ */ |
| 283 | |
| 284 | /***************************************************************************** |
| 285 | * FUNCTION |
| 286 | * check_if_icc_is_KOR_KT_OP_card() |
| 287 | * |
| 288 | * DESCRIPTION |
| 289 | * This function is used to check whether the inserted SIM card is KT Operator or not. |
| 290 | * |
| 291 | * PARAMETERS |
| 292 | * |
| 293 | * RETURNS |
| 294 | * TRUE or FALSE |
| 295 | *****************************************************************************/ |
| 296 | extern kal_bool check_if_icc_is_KOR_KT_OP_card(); |
| 297 | |
| 298 | /***************************************************************************** |
| 299 | * FUNCTION |
| 300 | * check_if_icc_is_KOR_SKT_OP_card() |
| 301 | * |
| 302 | * DESCRIPTION |
| 303 | * This function is used to check whether the inserted SIM card is SKT Operator or not. |
| 304 | * |
| 305 | * PARAMETERS |
| 306 | * |
| 307 | * RETURNS |
| 308 | * TRUE or FALSE |
| 309 | *****************************************************************************/ |
| 310 | extern kal_bool check_if_icc_is_KOR_SKT_OP_card(); |
| 311 | |
| 312 | /***************************************************************************** |
| 313 | * FUNCTION |
| 314 | * check_if_icc_is_KOR_KCT_OP_card() |
| 315 | * |
| 316 | * DESCRIPTION |
| 317 | * This function is used to check whether the inserted SIM card is KCT(SKT MVNO) Operator or not. |
| 318 | * |
| 319 | * PARAMETERS |
| 320 | * |
| 321 | * RETURNS |
| 322 | * TRUE or FALSE |
| 323 | *****************************************************************************/ |
| 324 | extern kal_bool check_if_icc_is_KOR_KCT_OP_card(); |
| 325 | |
| 326 | /***************************************************************************** |
| 327 | * FUNCTION |
| 328 | * check_if_icc_is_KOR_LGUPLUS_OP_card() |
| 329 | * |
| 330 | * DESCRIPTION |
| 331 | * This function is used to check whether the inserted SIM card is LGUPLUS Operator or not. |
| 332 | * |
| 333 | * PARAMETERS |
| 334 | * |
| 335 | * RETURNS |
| 336 | * TRUE or FALSE |
| 337 | *****************************************************************************/ |
| 338 | extern kal_bool check_if_icc_is_KOR_LGUPLUS_OP_card(); |
| 339 | |
| 340 | /***************************************************************************** |
| 341 | * FUNCTION |
| 342 | * check_if_icc_is_KOR_OP_card() |
| 343 | * |
| 344 | * DESCRIPTION |
| 345 | * This function is used to check whether the inserted SIM card is Korea Operator or not. |
| 346 | * |
| 347 | * PARAMETERS |
| 348 | * |
| 349 | * RETURNS |
| 350 | * TRUE or FALSE |
| 351 | *****************************************************************************/ |
| 352 | extern kal_bool check_if_icc_is_KOR_OP_card(); |
| 353 | |
| 354 | /******************************************************************************* |
| 355 | Function Name: |
| 356 | mrs_eas_is_supported_band_public |
| 357 | |
| 358 | Parameters: [in] lte_band: |
| 359 | |
| 360 | Return Value: If input band is LTE / UE supported band |
| 361 | |
| 362 | Description: |
| 363 | This function checks if input band is LTE / UE supported band. |
| 364 | It is defined in public header file for modules not belong to Modem private group, ex : Middleware LBS |
| 365 | *******************************************************************************/ |
| 366 | kal_bool mrs_eas_is_supported_band_public(kal_uint16 sim_index, kal_uint16 lte_band); /*form 1 to max_band*/ |
| 367 | |
| 368 | /***************************************************************************** |
| 369 | * FUNCTION |
| 370 | * nas_get_power_on_prefer_rat() |
| 371 | * |
| 372 | * DESCRIPTION |
| 373 | * This function will return the power on prefer rat from NWSEL |
| 374 | * |
| 375 | * PARAMETERS |
| 376 | * |
| 377 | * RETURNS |
| 378 | * rat_enum |
| 379 | *****************************************************************************/ |
| 380 | extern rat_enum nas_get_power_on_prefer_rat(rat_enum rat); |
| 381 | |
| 382 | #ifdef __IMS_SUPPORT__ |
| 383 | extern kal_bool imcsms_get_mt_ims_sms_info(sms_concat_struct sms_concat_info,kal_uint32 *seg_bitmask,kal_uint8 ps_id); |
| 384 | #endif |
| 385 | extern kal_bool sms_get_mt_sgs_sms_info(sms_concat_struct imcsms_concat_info,kal_uint32 *seg_bitmask,kal_uint8 ps_id); |
| 386 | |
| 387 | extern kal_bool smsal_duplicated_sms_detection_by_ps_id(kal_uint8 *new_mt_pdu, kal_uint16 new_mt_pdu_len,kal_uint8 ps_id); |
| 388 | |
| 389 | extern kal_bool phb_util_is_usim_csim(kal_uint8 sim_num); |
| 390 | |
| 391 | #endif /* _PS_PUBLIC_UTILITY_H_ */ |
| 392 | |