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