blob: cf10b333a7419726669afb01c3b5c5d1b42d43ef [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 * sbp_public_utility.h
39 *
40 * Description:
41 * ------------
42 * This file is intends for put the header of SBP public API
43 *
44 * Author:
45 * -------
46 * -------
47 *
48 *============================================================================
49*****************************************************************************/
50
51#ifndef _SBP_PUBLIC_UTILITY_H
52#define _SBP_PUBLIC_UTILITY_H
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58#include "kal_general_types.h"
59#include "kal_public_defs.h"
60#include "sim_exported_enum.h"
61
62#define SBP_ID_INVALID 0xffffffff
63#define SBP_SIM_SLOT_ID_INVALID 0xff
64
65
66/*****************************************************************************
67* DESCRIPTION
68* This enum is defined for Single Binary Platform (SBP) features
69* NVRAM saves one binary value for each feature
70*****************************************************************************/
71typedef enum
72{
73//Please add SBP features in sbp_feature.def
74
75#define SBP_FEATURE_DEF_BEGIN(x)
76#define SBP_FEATURE_DEF(FEATURE, ATTR, DESC, DESC_V0,DESC_V1, DEFAULT_VAL) FEATURE,
77#define SBP_FEATURE_DEF_END(x)
78
79#include "sbp_feature.def"
80#undef SBP_FEATURE_DEF_BEGIN
81#undef SBP_FEATURE_DEF
82#undef SBP_FEATURE_DEF_END
83
84
85 SBP_MAX_MD_FEATURE
86}sbp_md_feature_enum;
87
88/*****************************************************************************
89* DESCRIPTION
90* This enum is defined for Single Binary Platform (SBP) features
91* NVRAM saves one byte value for each feature
92*****************************************************************************/
93typedef enum
94{
95//Please add SBP data in sbp_data.def
96
97#define SBP_DATA_DEF(ID, FEATURE, ATTR, DESC) FEATURE,
98#define SBP_DATA_DEF_BIT(ID, FEATURE, ATTR) FEATURE,
99
100#include "sbp_data.def"
101#undef SBP_DATA_DEF
102#undef SBP_DATA_DEF_BIT
103
104 SBP_DATA_MAX_MD_FEATURE
105}sbp_md_feature_data_enum;
106
107#if defined (__TC01_NVRAM__) || defined(__TC01__) // __TC01_CUST_SBP__
108/*****************************************************************************
109* DESCRIPTION
110* This enum is defined for SBP by the customer itself.
111* NVRAM saves one binary value for each feature
112*****************************************************************************/
113typedef enum
114{
115//Please add SBP features in sbp_feature_cust.def
116#define SBP_FEATURE_DEF_BEGIN(x)
117#define SBP_FEATURE_DEF(FEATURE, ATTR, DESC, DESC_V0,DESC_V1, DEFAULT_VAL) FEATURE,
118#define SBP_FEATURE_DEF_END(x)
119
120#include "sbp_feature_cust.def"
121#undef SBP_FEATURE_DEF_BEGIN
122#undef SBP_FEATURE_DEF
123#undef SBP_FEATURE_DEF_END
124
125 SBP_CUSTOM_MAX_MD_FEATURE
126}sbp_md_feature_custom_enum;
127#endif
128
129
130/* SBP Test Mode Enum */
131typedef enum
132{
133 SBP_TEST_MODE_NONE = 0,
134 SBP_TEST_MODE_1, // Obsolete, use NVRAM_EF_SBP_CUSTOM_MODEM_CONFIG_LID to specify test feature value
135 SBP_TEST_MODE_2, // To skip hard coded feature changes
136 SBP_TEST_MODE_MAX
137}sbp_test_mode_enum;
138
139/* SBP ATTRIBUTE Bitmask */
140typedef enum
141{
142 SBP_ATTR_NONE = 0,
143 SBP_ATTR_NOT_SUPPORT_DYNAMIC_SBP = 0x01, /* bit 1 is for current SBP NV will keep when Dynamic SBP change */
144 SBP_ATTR_ALL = 0xff
145}sbp_attribute_enum;
146
147/**
148* DESCRIPTION
149* This enum is TO define RUIM configuration.
150**/
151typedef enum
152{
153 SBP_RUIM_DISABLED = 0x00, /* Non-RUIM configuration */
154 SBP_RUIM_ENABLED = 0x01 /* RUIM configuration */
155}c2k_sbp_ruim_config_enum;
156
157/**
158 * SBP(Single Binary Platform) modem configuration
159 * a bitmap for all modem configurable feature
160 **/
161typedef struct
162{
163 kal_uint32 sbp_mode; //reserved for usage
164 kal_uint8 modem_sbp_config[(SBP_MAX_MD_FEATURE/8)+1]; //the size depends on SBP_MAX_MD_FEATURE
165} nvram_ef_sbp_modem_config_struct;
166
167#if defined (__TC01_NVRAM__) || defined(__TC01__) // __TC01_CUST_SBP__
168 /*MUSE - ALPS0144925 */
169 /*Customer's specific Single Binary Platform (SBP) features */
170 #define NVRAM_EF_SBP_MODEM_CONFIG_TOTAL (2)
171 #define NVRAM_CUST_SBP_IDX 2
172
173#else /* __TC01__ */
174 #define NVRAM_EF_SBP_MODEM_CONFIG_TOTAL (1)
175#endif /* __TC01__ */
176
177#define NVRAM_EF_SBP_MODEM_CONFIG_SIZE sizeof(nvram_ef_sbp_modem_config_struct)
178
179/**
180 * SBP(Single Binary Platform) modem data configuration
181 * a byte for each modem configurable feature
182 **/
183typedef struct
184{
185 kal_uint32 sbp_mode; //reserved for usage
186 kal_uint8 modem_sbp_data_config[SBP_DATA_MAX_MD_FEATURE];
187} nvram_ef_sbp_modem_data_config_struct;
188
189#define NVRAM_EF_SBP_MODEM_DATA_CONFIG_TOTAL (1)
190#define NVRAM_EF_SBP_MODEM_DATA_CONFIG_SIZE sizeof(nvram_ef_sbp_modem_data_config_struct)
191
192/**
193 * SBP(Single Binary Platform) modem feature/data customization
194 * a list of customized SBP feature / feature data
195 * priorirty: customization > DSBP > SBP
196 **/
197
198#define SBP_MAX_CUSTOM_CONFIG (100) // allows 100 custom configurations
199
200typedef enum
201{
202 SBP_CUST_CFG_TYPE_NONE = 0,
203 SBP_CUST_CFG_TYPE_FEATURE,
204 SBP_CUST_CFG_TYPE_DATA
205}sbp_cust_cfg_type_enum;
206
207typedef struct{
208 kal_uint32 sbp_id;
209 sbp_cust_cfg_type_enum sbp_cust_cfg_type;
210 kal_uint16 sbp_cust_cfg_feature; // enum for SBP feature or SBP feature data
211 kal_uint8 sbp_cust_cfg_feature_val;
212}sbp_custom_config_struct;
213
214typedef struct{
215 sbp_custom_config_struct sbp_custom_config[SBP_MAX_CUSTOM_CONFIG];
216}nvram_ef_sbp_custom_modem_config_struct;
217
218#define NVRAM_EF_SBP_CUSTOM_MODEM_CONFIG_TOTAL (1)
219#define NVRAM_EF_SBP_CUSTOM_MODEM_CONFIG_SIZE sizeof(nvram_ef_sbp_custom_modem_config_struct)
220
221
222typedef struct{
223 kal_uint32 mcf_dsbp_dr_time;
224 kal_uint32 max_mcf_dsbp_dr_time;
225}nvram_ef_sbp_dsbp_config_struct;
226
227#define NVRAM_EF_SBP_DSBP_CONFIG_TOTAL (1)
228#define NVRAM_EF_SBP_DSBP_CONFIG_SIZE sizeof(nvram_ef_sbp_dsbp_config_struct)
229
230/**
231 * SBP(Single Binary Platform) ID - plmn_id/iccid customization
232 * a customized SBP_ID - plmn_id/iccid mapping table
233 * priorirty: customization > internal static g_l4bsbp_iccid_prefix_table > internal static g_l4bsbp_plmn_table
234 **/
235
236#define SBP_MAX_CUSTOM_SBP_ID_ICCID_MAPPING (100) // allows 100 custom mapping
237#define SBP_MAX_CUSTOM_SBP_ID_PLMN_MAPPING (500) // allows 500 custom mapping
238#define SBP_MAX_CUSTOM_ICCID_LEN 21
239
240typedef struct{
241 kal_uint8 iccid_prefix[SBP_MAX_CUSTOM_ICCID_LEN];
242 kal_uint32 sbp_id;
243}sbp_custom_sbp_id_iccid_mapping_struct;
244
245typedef struct{
246 kal_uint32 plmn_range_start;
247 kal_uint32 plmn_range_end;
248 kal_uint32 sbp_id;
249}sbp_custom_sbp_id_plmn_mapping_struct;
250
251typedef struct{
252 kal_uint32 num_of_iccid_map;
253 sbp_custom_sbp_id_iccid_mapping_struct sbp_custom_sbp_id_iccid_map_table[SBP_MAX_CUSTOM_SBP_ID_ICCID_MAPPING];
254 kal_uint32 num_of_plmn_map;
255 sbp_custom_sbp_id_plmn_mapping_struct sbp_custom_sbp_id_plmn_map_table[SBP_MAX_CUSTOM_SBP_ID_PLMN_MAPPING];
256}nvram_ef_sbp_custom_sbp_id_mapping_struct;
257
258#define NVRAM_EF_SBP_CUSTOM_SBP_ID_MAPPING_TOTAL (1)
259#define NVRAM_EF_SBP_CUSTOM_SBP_ID_MAPPING_SIZE sizeof(nvram_ef_sbp_custom_sbp_id_mapping_struct)
260
261/**
262 * SBP(Single Binary Platform) ID list which need MD CXP reboot flow
263 **/
264
265#define SBP_MAX_MDCXP_SBP_ID_NUM (100) // allows 100 operators
266
267typedef struct{
268 kal_uint32 sbp_id_list[SBP_MAX_MDCXP_SBP_ID_NUM];
269}nvram_ef_sbp_mdcxp_sbp_id_list_struct;
270
271#define NVRAM_EF_SBP_MDCXP_SBP_ID_LIST_TOTAL (1)
272#define NVRAM_EF_SBP_MDCXP_SBP_ID_LIST_SIZE sizeof(nvram_ef_sbp_mdcxp_sbp_id_list_struct)
273
274typedef struct
275{
276 kal_uint8 mcc_mnc[7];
277 kal_uint32 sbp_id;
278} mccmnc_to_sbp_id_struct;
279
280typedef struct
281{
282 kal_char csc_salecode[3];
283 kal_char network_code[3];
284 kal_char network_code_2[3];
285} sbp_salecode_struct;
286
287typedef enum
288{
289 SBP_ID_OM = 0,
290 SBP_ID_UNKNOWN = SBP_ID_OM,
291
292 /* the Operator enum*/
293 SBP_ID_CMCC = 1,
294 SBP_ID_CU = 2,
295 SBP_ID_ORANGE = 3,
296 SBP_ID_TMO_EU = 5,
297 SBP_ID_VODAFONE = 6,
298 SBP_ID_ATT = 7,
299 SBP_ID_TMO_US = 8,
300 SBP_ID_CT = 9,
301 SBP_ID_TIER_2 = 10,
302 SBP_ID_H3G = 11,
303 SBP_ID_VERIZON = 12,
304 SBP_ID_TELEFONICA = 15,
305 SBP_ID_EE = 16,
306 SBP_ID_DOCOMO = 17,
307 SBP_ID_RJL = 18,
308 SBP_ID_TELSTRA = 19,
309 SBP_ID_SPRINT = 20,
310 SBP_ID_DISH = 21,
311 SBP_ID_SOFTBANK = 50,
312 SBP_ID_CSL = 100,
313 SBP_ID_PCCW = 101,
314 SBP_ID_SMT = 102,
315 SBP_ID_SINGTEL = 103,
316 SBP_ID_STARHUB = 104,
317 SBP_ID_AMX = 105,
318 SBP_ID_3HK = 106,
319 SBP_ID_SFR = 107,
320 SBP_ID_TWN = 108,
321 SBP_ID_CHT = 109,
322 SBP_ID_FET = 110,
323 SBP_ID_VDF_INDIA = 111,
324 SBP_ID_TELCEL = 112,
325 SBP_ID_BEELINE = 113,
326 SBP_ID_KT = 114,
327 SBP_ID_SKT = 115,
328 SBP_ID_UPLUS = 116,
329 SBP_ID_SMARTFREN = 117,
330 SBP_ID_YTL = 118,
331 SBP_ID_NATCOM = 119,
332 SBP_ID_CLARO = 120,
333 SBP_ID_BELL = 121,
334 SBP_ID_AIS = 122,
335 SBP_ID_APTG = 124,
336 SBP_ID_DTAC = 125,
337 SBP_ID_AVEA = 126,
338 SBP_ID_MEGAFON = 127,
339 SBP_ID_DNA = 128,
340 SBP_ID_KDDI = 129,
341 SBP_ID_TIM = 130,
342 SBP_ID_TRUEMOVER = 131,
343 SBP_ID_MOVISTAR = 132,
344 SBP_ID_DU = 133,
345 SBP_ID_ELISA = 134,
346 SBP_ID_MTS = 135,
347 SBP_ID_ENTEL = 136,
348 SBP_ID_TELE2 = 137,
349 SBP_ID_BOUYGUES = 139,
350 SBP_ID_MTN = 140,
351 SBP_ID_CELL_C = 141,
352 SBP_ID_TURKCELL = 143,
353 SBP_ID_SMILTE = 144,
354 SBP_ID_CRICKET = 145,
355 SBP_ID_ETISALAT = 146,
356 SBP_ID_AIRTEL = 147,
357 SBP_ID_SEATEL = 148,
358 SBP_ID_CMHK = 149,
359 SBP_ID_SWISSCOM_SCHWEIZ_AG = 150,
360 SBP_ID_M1 = 151,
361 SBP_ID_OPTUS = 152,
362 SBP_ID_VHA = 153,
363 SBP_ID_TELIA = 154,
364 SBP_ID_DIGI = 155,
365 SBP_ID_TELENOR = 156,
366 SBP_ID_TELUS = 157,
367 SBP_ID_ZAIN = 158,
368 SBP_ID_STC = 159,
369 SBP_ID_WEBE = 160,
370 SBP_ID_PLAY = 161,
371 SBP_ID_FREEDOM = 162,
372 SBP_ID_DIALOG = 163,
373 SBP_ID_TELENET = 164,
374 SBP_ID_SUNRISE = 165,
375 SBP_ID_SALT = 166,
376 SBP_ID_EIR = 168,
377 SBP_ID_VIPNET = 169,
378 SBP_ID_PARTNER = 170,
379 SBP_ID_WOM = 171,
380 SBP_ID_ALTICE = 172,
381 SBP_ID_NZ = 174,
382 SBP_ID_TDC = 175,
383 SBP_ID_TSTAR = 176,
384 SBP_ID_TELEKOM_EGYPT = 177,
385 SBP_ID_SMART = 178,
386 SBP_ID_ALLAI_NEWROZ = 179,
387 SBP_ID_SWAZI_MOBILE = 180,
388 SBP_ID_TELKOM_SA = 181,
389 SBP_ID_PROXIMUS = 182,
390 SBP_ID_PERSONAL = 183,
391 SBP_ID_VIETTEL = 184,
392 SBP_ID_2DEGREES = 185,
393 SBP_ID_IDEA = 186,
394 SBP_ID_SAFARICOM = 187,
395 SBP_ID_A1 = 188,
396 SBP_ID_UMOBILE = 189,
397 SBP_ID_TELKOM_KENYA = 190,
398 SBP_ID_GRAMEENPHONE = 191,
399 SBP_ID_ROBI = 192,
400 SBP_ID_O2 = 195,
401 SBP_ID_FIRSTNET = 196,
402 SBP_ID_SBERBANK = 198,
403 SBP_ID_VIVACOM = 199,
404 SBP_ID_JTL_KENYA = 200,
405 SBP_ID_KPN_NETHERLANDS = 201,
406 SBP_ID_SPARK = 202,
407 SBP_ID_NOS = 203,
408 SBP_ID_ROGERS = 204,
409 SBP_ID_ALTAN = 205,
410 SBP_ID_SKY = 206,
411 SBP_ID_CTM = 207,
412 SBP_ID_3MACAU = 208,
413 SBP_ID_AVANTEL = 209,
414 SBP_ID_BSNL = 210,
415 SBP_ID_CW = 211,
416 SBP_ID_OPEN_MOBILE = 212,
417 SBP_ID_IDC = 214,
418 SBP_ID_MOTIV = 213,
419 SBP_ID_CELLCARD = 215,
420 SBP_ID_ZONG = 216,
421 SBP_ID_TELEKOM_SLOVENIA = 217,
422 SBP_ID_RAKUTEN = 218,
423 SBP_ID_MYTEL = 219,
424 SBP_ID_TIGO = 220,
425 SBP_ID_TPG = 221,
426 SBP_ID_ACG = 222,
427 SBP_ID_OOREDOO = 223,
428 SBP_ID_TELKOMSEL = 224,
429 SBP_ID_XL = 225,
430 SBP_ID_WIND = 227,
431 SBP_ID_CELCOM = 228,
432 SBP_ID_MAXIS = 231,
433 SBP_ID_MOBITEL = 232,
434 SBP_ID_PELEPHONE = 233,
435 SBP_ID_PLUS = 234,
436 SBP_ID_VIP = 235,
437 SBP_ID_USCC = 236,
438 SBP_ID_ICE = 237,
439 SBP_ID_VIDEOTRON = 238,
440 SBP_ID_EASTLINK = 239,
441 SBP_ID_XPLORE_MOBILE = 240,
442 SBP_ID_CLARO_PUERTO_RICO = 241,
443 SBP_ID_GLOBE = 243,
444 SBP_ID_METFONE = 244,
445 SBP_ID_VIETNAMOBILE = 245,
446 SBP_ID_OOREDOO_QATAR = 246,
447 SBP_ID_MAROC_TELECOM = 247,
448 SBP_ID_EXECULINK = 248,
449 SBP_ID_WIGHTMAN = 249,
450 SBP_ID_UNION = 250,
451 SBP_ID_CORR = 251,
452 SBP_ID_PLATEAU = 252,
453 SBP_ID_GTA = 253,
454 SBP_ID_NEP = 254,
455 SBP_ID_CELLULAR_ONE_NEAZ = 255,
456 SBP_ID_CBW = 256,
457 SBP_ID_VIAERO = 257,
458 SBP_ID_CELLULAR_ONE_MTPCS = 258,
459 SBP_ID_EPIC = 259,
460 SBP_ID_IMMIX = 260,
461 SBP_ID_ASTAC = 261,
462 SBP_ID_IWIRELESS = 262,
463 SBP_ID_DTC = 263,
464 SBP_ID_PINE = 264,
465 SBP_ID_LONG_LINES = 265,
466 SBP_ID_CELLULAR_ONE_EIL = 266,
467 SBP_ID_GCI = 267,
468 SBP_ID_MOSAIC = 268,
469 SBP_ID_NEWCORE = 269,
470 SBP_ID_TELALASKA = 270,
471 SBP_ID_SAGEBRUSH = 271,
472 SBP_ID_GTT = 272,
473 SBP_ID_OPTIMERA = 273,
474 SBP_ID_YOIGO = 274,
475 SBP_ID_LIFECELL = 275,
476 SBP_ID_ALTICE_US = 276,
477 SBP_ID_TELEMACH = 277,
478 SBP_ID_JAZZ = 278,
479 SBP_ID_DITO = 279,
480 SBP_ID_OTZ = 280,
481 SBP_ID_KYIVSTAR = 281,
482 SBP_ID_MOBILY = 282,
483 SBP_ID_MEO = 283,
484 SBP_ID_MTS_SERBIA = 284,
485 SBP_ID_VINAPHONE = 285,
486 SBP_ID_MNSHUBS = 286,
487 SBP_ID_FREE = 287,
488 SBP_ID_VIRGIN = 288,
489 SBP_ID_BATELCO = 289,
490 SBP_ID_OMANTEL = 290,
491 SBP_ID_LMT = 291,
492 SBP_ID_CMHK_HKIA = 292,
493 SBP_ID_POST = 293,
494 SBP_ID_MPT = 294,
495 SBP_ID_NTC = 295,
496 SBP_ID_CAROLINA_WEST_WIRELESS = 296,
497 SBP_ID_FASTWEB = 297,
498 SBP_ID_UMNIAH = 298,
499 SBP_ID_NRJ = 299,
500 SBP_ID_TANGO = 301,
501 SBP_ID_OOREDOO_OMAN = 302,
502 SBP_ID_CTMO = 304,
503 SBP_ID_CUHK = 306,
504 SBP_ID_CELLCOM = 307,
505 SBP_ID_HOTMOBILE = 310,
506 SBP_ID_BITE = 312,
507 SBP_ID_AXTEL = 313,
508 SBP_ID_TELE_GREENLAND = 314,
509 SBP_ID_TELE2_KAZAK = 315,
510 SBP_ID_VIANOVA = 318,
511 SBP_ID_MONACO = 319,
512 SBP_ID_CORIOLIS = 320,
513 SBP_ID_ORA_VITI = 321,
514 SBP_ID_UPC = 322,
515 SBP_ID_MOLDCELL = 324,
516 SBP_ID_9MOBILE = 326,
517 SBP_ID_SASKTEL = 327,
518 SBP_ID_VOO = 328,
519 SBP_ID_TASHICELL = 334,
520 SBP_ID_TOT = 335,
521 SBP_ID_SPUSU = 338,
522 SBP_ID_UNITEL = 339,
523 SBP_ID_UCELL = 341,
524 SBP_ID_4KA = 344,
525 SBP_ID_PRIMETEL = 345,
526 SBP_ID_AIRTEL_KENYA = 347,
527 SBP_ID_NCELL = 348,
528 SBP_ID_GIBTELECOM = 350,
529 SBP_ID_MOD_EGYPT = 352,
530 SBP_ID_WE4G = 353,
531 SBP_ID_ALFA = 355,
532 SBP_ID_RAIN = 356,
533 SBP_ID_CNT = 357,
534 SBP_ID_TELMA = 358,
535 SBP_ID_ALIV = 359,
536 SBP_ID_CTEXCEL = 360,
537 SBP_ID_BMOBILE = 362,
538 SBP_ID_LICT = 398,
539
540 /* Lab testing SBP ID */
541 SBP_ID_ERICSSON = 1001,
542 SBP_ID_NOKIA = 1002,
543 SBP_ID_MTK_HQLAB_ERICSSON = 1003,
544 SBP_ID_HUAWEI_IMS_LAB = 1004,
545
546
547 /* Legacy C2K SBP ID */
548 SBP_ID_GENERIC = SBP_ID_OM,
549 SBP_ID_VERIZON_C2K = SBP_ID_VERIZON,
550
551#ifdef __TC10__
552 /* START - allocated ID for Samsung 10000 ~ 20000 */
553
554 // SBP ID FOR CHINA 10001 ~ 10999
555 SBP_ID_CHINA = 10000,
556 // SBP ID FOR GLOBAL 11001 ~ 11999
557 SBP_ID_GLOBAL = 11000,
558 SBP_ID_TNZ, // TNZ - SPARK (Formerly Telecom New Zealand)
559 // SBP ID FOR JPN 12001 ~ 12999
560 SBP_ID_JPN = 12000,
561 // SBP ID FOR KOR 13001 ~ 13999
562 SBP_ID_KOR = 13000,
563 // SBP ID FOR LATIN_AMERICA 14001 ~ 14999
564 SBP_ID_LATIN_AMERICA = 14000,
565 // SBP ID FOR N_AMERICA_CAN 15001 ~ 15999
566 SBP_ID_N_AMERICA_CAN = 15000,
567 // SBP ID FOR N_AMERICA 16001 ~ 16999
568 SBP_ID_N_AMERICA = 16000,
569 // SBP ID FOR N_AMERICA_3GPP2 17001 ~ 17999
570 SBP_ID_N_AMERICA_3GPP2 = 17000,
571
572 /* END - allocated ID for Samsung 10000 ~ 20000 */
573
574 SBP_ID_MAX = 20000, // MAX
575#endif /* __TC10__ */
576
577} sbp_id_enum;
578
579/* --------------------------
580 * End of SBP Configuration
581 * --------------------------- */
582
583
584/*****************************************************************************
585* FUNCTION
586* sbp_query_md_feature()
587*
588* DESCRIPTION
589* This function is used to query modem configuration
590*
591* PARAMETERS
592* feature [IN] modem feature
593*
594* RETURNS
595* KAL_TRUE : if this feature is turned on
596* KAL_FALSE : if this feature is turned off
597*****************************************************************************/
598extern kal_bool sbp_query_md_feature(sbp_md_feature_enum feature);
599
600/*****************************************************************************
601* FUNCTION
602* sbp_query_id()
603*
604* DESCRIPTION
605* This function is used to query SBP ID received by modem
606*
607* PARAMETERS
608* [IN] N/A
609* RETURNS
610* the unsigned 4-byte value for the SBP ID
611*****************************************************************************/
612extern kal_uint32 sbp_query_id(void);
613
614/*****************************************************************************
615* FUNCTION
616* sbp_query_sub_id()
617*
618* DESCRIPTION
619* This function is used to query SBP Sub ID received by modem
620*
621* PARAMETERS
622* [IN] N/A
623* RETURNS
624* the unsigned 4-byte value for the SBP Sub ID
625*****************************************************************************/
626extern kal_uint32 sbp_query_sub_id(void);
627
628
629/*****************************************************************************
630* FUNCTION
631* sbp_query_md_feature_for_c2k()
632*
633* DESCRIPTION
634* This function is used to query modem configuration and used by C2K team only
635* The function will judge current active PS using C2K's API and return the corresponding setting.
636*
637* PARAMETERS
638* feature [IN] modem feature
639*
640* RETURNS
641* KAL_TRUE : if this feature is turned on
642* KAL_FALSE : if this feature is turned off
643*****************************************************************************/
644extern kal_bool sbp_query_md_feature_for_c2k(sbp_md_feature_enum feature);
645
646/*****************************************************************************
647* FUNCTION
648* sbp_query_md_feature_by_ps()
649*
650* DESCRIPTION
651* This function is used to query modem configuration according to the PS ID
652*
653* PARAMETERS
654* feature [IN] modem feature
655* ps_id [IN] PS ID
656*
657* RETURNS
658* KAL_TRUE : if this feature is turned on
659* KAL_FALSE : if this feature is turned off
660*****************************************************************************/
661extern kal_bool sbp_query_md_feature_by_ps(sbp_md_feature_enum feature, protocol_id_enum ps_id);
662
663/*****************************************************************************
664* FUNCTION
665* sbp_query_md_feature_no_overwrite()
666*
667* DESCRIPTION
668* This function is used to query modem configuration without overwrite
669*
670* PARAMETERS
671* feature [IN] modem feature
672*
673* RETURNS
674* KAL_TRUE : if this feature is turned on
675* KAL_FALSE : if this feature is turned off
676*****************************************************************************/
677extern kal_bool sbp_query_md_feature_no_overwrite(sbp_md_feature_enum feature);
678
679/*****************************************************************************
680* FUNCTION
681* sbp_query_md_feature_no_overwrite_by_ps()
682*
683* DESCRIPTION
684* This function is used to query modem configuration without overwrite according to the PS ID
685*
686* PARAMETERS
687* feature [IN] modem feature
688* ps_id [IN] PS ID
689*
690* RETURNS
691* KAL_TRUE : if this feature is turned on
692* KAL_FALSE : if this feature is turned off
693*****************************************************************************/
694extern kal_bool sbp_query_md_feature_no_overwrite_by_ps(sbp_md_feature_enum feature, protocol_id_enum ps_id);
695
696
697/*****************************************************************************
698* FUNCTION
699* sbp_set_md_feature()
700*
701* DESCRIPTION
702* This function is used to set modem configuration
703*
704* PARAMETERS
705* feature [IN] modem feature
706* is_turned_on [IN]
707* sbp_feature_ptr [IN/OUT]
708*
709* RETURNS
710* KAL_TRUE if success; otherwise KAL_FALSE
711*****************************************************************************/
712extern kal_bool sbp_set_md_feature(sbp_md_feature_enum feature,
713 kal_bool is_turned_on,
714 nvram_ef_sbp_modem_config_struct *sbp_feature_ptr);
715
716/*****************************************************************************
717* FUNCTION
718* sbp_query_md_feature_data()
719*
720* DESCRIPTION
721* This function is used to query modem configuration
722*
723* PARAMETERS
724* feature [IN] modem feature
725*
726* RETURNS
727* The byte value for the input feature
728*****************************************************************************/
729extern kal_uint8 sbp_query_md_feature_data(sbp_md_feature_data_enum feature);
730
731/*****************************************************************************
732* FUNCTION
733* sbp_query_md_feature_data_for_c2k()
734*
735* DESCRIPTION
736* This function is used to query modem configuration and used by C2K team only
737* The function will judge current active PS using C2K's API and return the corresponding setting.
738*
739* PARAMETERS
740* feature [IN] modem feature
741*
742* RETURNS
743* the unsigned byte value for the feature
744*****************************************************************************/
745extern kal_uint8 sbp_query_md_feature_data_for_c2k(sbp_md_feature_data_enum feature);
746
747/*****************************************************************************
748* FUNCTION
749* sbp_query_md_feature_data_by_ps()
750*
751* DESCRIPTION
752* This function is used to query modem configuration data
753*
754* PARAMETERS
755* feature [IN] modem feature
756* ps_id [IN] PS ID
757*
758* RETURNS
759* the unsigned byte value for the feature
760*****************************************************************************/
761extern kal_uint8 sbp_query_md_feature_data_by_ps(sbp_md_feature_data_enum feature, protocol_id_enum ps_id);
762
763/*****************************************************************************
764* FUNCTION
765* sbp_query_md_feature_data_no_overwrite()
766*
767* DESCRIPTION
768* This function is used to query modem configuration without overwrite
769*
770* PARAMETERS
771* feature [IN] modem feature
772*
773* RETURNS
774* The byte value for the input feature
775*****************************************************************************/
776extern kal_uint8 sbp_query_md_feature_data_no_overwrite(sbp_md_feature_data_enum feature);
777
778/*****************************************************************************
779* FUNCTION
780* sbp_query_md_feature_data_no_overwrite_by_ps()
781*
782* DESCRIPTION
783* This function is used to query modem configuration data without overwrite
784*
785* PARAMETERS
786* feature [IN] modem feature
787* ps_id [IN] PS ID
788*
789* RETURNS
790* the unsigned byte value for the feature
791*****************************************************************************/
792extern kal_uint8 sbp_query_md_feature_data_no_overwrite_by_ps(sbp_md_feature_data_enum feature, protocol_id_enum ps_id);
793
794/*****************************************************************************
795* FUNCTION
796* sbp_set_md_feature_data()
797*
798* DESCRIPTION
799* This function is used to query modem configuration
800*
801* PARAMETERS
802* feature [IN] modem feature
803* data [IN]
804* sbp_data_ptr [IN/OUT]
805*
806* RETURNS
807* KAL_TRUE if success; otherwise KAL_FALSE
808*****************************************************************************/
809extern kal_bool sbp_set_md_feature_data(sbp_md_feature_data_enum feature,
810 kal_uint8 data,
811 nvram_ef_sbp_modem_data_config_struct *sbp_data_ptr);
812
813/*****************************************************************************
814* FUNCTION
815* sbp_general_set_md_feature_data()
816*
817* DESCRIPTION
818* This function is used to set modem configuration data
819* Please don't use this API if you don't get the permission from SBP FPM.
820*
821* PARAMETERS
822* feature [IN] modem feature
823*
824* RETURNS
825* the unsigned byte value for the feature
826*****************************************************************************/
827extern kal_bool sbp_general_set_md_feature_data(sbp_md_feature_data_enum feature, kal_uint8 data);
828
829/*****************************************************************************
830 * FUNCTION
831 * custom_nvram_set_sbp_id
832 * DESCRIPTION
833 * Set SBP features and data according to SBP ID.
834 * PARAMETERS
835 * sbp_mode [IN]
836 * RETURNS
837 * KAL_TRUE : Set SBP ID successfully
838 * KAL_FALSE : Error happens when setting SBP ID
839 *****************************************************************************/
840extern kal_bool custom_nvram_set_sbp_id(kal_uint32 sbp_id, kal_bool is_in_dynamic_sbp, kal_uint8 *imsi, protocol_id_enum ps_id);
841
842/*****************************************************************************
843 * FUNCTION
844 * custom_nvram_init_sbp_id
845 * DESCRIPTION
846 * Set SBP features and data according to SBP ID and SIM SBP ID.
847 * PARAMETERS
848 * sbp_id [IN]
849 * RETURNS
850 * Void
851 *****************************************************************************/
852extern void custom_nvram_init_sbp_id(kal_uint32 sbp_id);
853
854
855/*****************************************************************************
856* FUNCTION
857* sbp_get_sim_sbp_id_for_all()
858*
859* DESCRIPTION
860* get SIM SBP ID which trigger DSBP for all modem (IMS/VoLTE + PS/L1)
861*
862* PARAMETERS
863* ps_id [IN] protocol ID
864*
865* RETURNS
866* the unsigned 4-byte value for the SIM SBP ID
867*
868*****************************************************************************/
869extern kal_uint32 sbp_get_sim_sbp_id_for_all(protocol_id_enum ps_id);
870
871/*****************************************************************************
872* FUNCTION
873* sbp_get_current_sim_sbp_id()
874*
875* DESCRIPTION
876* get SIM SBP ID which trigger DSBP for IMS/VoLTE
877*
878* PARAMETERS
879* ps_id [IN] protocol ID
880*
881* RETURNS
882* the unsigned 4-byte value for the SIM SBP ID
883*
884*****************************************************************************/
885extern kal_uint32 sbp_get_current_sim_sbp_id(protocol_id_enum ps_id);
886
887
888/*****************************************************************************
889* FUNCTION
890* sbp_get_sim_sbp_id()
891*
892* DESCRIPTION
893* get SIM SBP ID which trigger DSBP for IMS/VoLTE
894*
895* PARAMETERS
896* ps_id [IN] protocol ID
897*
898* RETURNS
899* the unsigned 4-byte value for the SIM SBP ID
900*
901*****************************************************************************/
902extern kal_uint32 sbp_get_sim_sbp_id(protocol_id_enum ps_id);
903
904/*****************************************************************************
905* FUNCTION
906* sbp_set_sim_sbp_id_for_all()
907*
908* DESCRIPTION
909* set SIM SBP ID which trigger DSBP for all modem (IMS/VoLTE + PS/L1)
910*
911* PARAMETERS
912* ps_id [IN] protocol ID
913* sim_sbp_id [IN] SIM SBP ID
914* mcc [IN] MCC
915* mnc [IN] MNC
916* iccid [IN] ICCID
917*
918* RETURNS
919* KAL_TRUE - success
920* KAL_FALSE - failure
921*
922*****************************************************************************/
923extern kal_bool sbp_set_sim_sbp_id_for_all(protocol_id_enum ps_id, kal_uint32 sim_sbp_id, kal_uint8 *mcc, kal_uint8 *mnc, kal_uint8 *iccid);
924
925/*****************************************************************************
926* FUNCTION
927* sbp_set_current_sim_sbp_id()
928*
929* DESCRIPTION
930* get SIM SBP ID which trigger DSBP for IMS/VoLTE
931*
932* PARAMETERS
933* ps_id [IN] protocol ID
934* sim_sbp_id [IN] SIM SBP ID
935*
936* RETURNS
937* KAL_TRUE - success
938* KAL_FALSE - failure
939*
940*****************************************************************************/
941extern kal_bool sbp_set_current_sim_sbp_id(protocol_id_enum ps_id, kal_uint32 sim_sbp_id);
942
943/*****************************************************************************
944* FUNCTION
945* sbp_set_sim_sbp_id()
946*
947* DESCRIPTION
948* set SIM SBP ID which trigger DSBP for IMS/VoLTE
949*
950* PARAMETERS
951* ps_id [IN] protocol ID
952* sim_sbp_id [IN] SIM SBP ID
953*
954* RETURNS
955* KAL_TRUE - success
956* KAL_FALSE - failure
957*
958*****************************************************************************/
959extern kal_bool sbp_set_sim_sbp_id(protocol_id_enum ps_id, kal_uint32 sim_sbp_id, kal_uint8 *mcc, kal_uint8 *mnc, kal_uint8 *iccid);
960
961/*****************************************************************************
962 * FUNCTION
963 * sbp_convert_mcc_mnc_string_from_imsi
964 * DESCRIPTION
965 * get mcc, mnc from imsi with string format
966 * PARAMETERS
967 * imsi
968 * RETURNS
969 * KAL_TRUE
970 *****************************************************************************/
971kal_bool sbp_convert_mcc_mnc_string_from_imsi(kal_uint8* mcc_ptr, kal_uint32 mcc_size, kal_uint8 *mnc_ptr, kal_uint32 mnc_size, kal_uint8* imsi_ptr, kal_uint8 mnc_len);
972
973/*****************************************************************************
974 * FUNCTION
975* sbp_get_sbp_feature_raw_config()
976*
977* DESCRIPTION
978* Get SBP Feature Raw Data according to the ps_id
979* Please don't use this API if you don't get the permission from SBP FPM.
980*
981* PARAMETERS
982* ps_id [IN] protocol ID
983*
984* RETURNS
985* KAL_TRUE - success
986* KAL_FALSE - failure
987*
988*****************************************************************************/
989extern kal_bool sbp_get_sbp_feature_raw_config(protocol_id_enum ps_id, kal_uint8 *raw_config);
990
991/*****************************************************************************
992* FUNCTION
993* sbp_set_sbp_feature_raw_config()
994*
995* DESCRIPTION
996* Set SBP Feature Raw Data according to the ps_id
997* Please don't use this API if you don't get the permission from SBP FPM.
998*
999* PARAMETERS
1000* ps_id [IN] protocol ID
1001*
1002* RETURNS
1003* KAL_TRUE - success
1004* KAL_FALSE - failure
1005*
1006*****************************************************************************/
1007extern void sbp_set_sbp_feature_raw_config(protocol_id_enum ps_id, kal_uint8 *raw_config);
1008
1009
1010/*****************************************************************************
1011* FUNCTION
1012* sbp_get_sbp_data_raw_config()
1013*
1014* DESCRIPTION
1015* Get SBP Data Raw Data according to the ps_id
1016* Please don't use this API if you don't get the permission from SBP FPM.
1017*
1018* PARAMETERS
1019* ps_id [IN] protocol ID
1020*
1021* RETURNS
1022* KAL_TRUE - success
1023* KAL_FALSE - failure
1024*
1025*****************************************************************************/
1026extern kal_bool sbp_get_sbp_data_raw_config(protocol_id_enum ps_id, kal_uint8 *raw_config);
1027
1028/*****************************************************************************
1029* FUNCTION
1030* sbp_set_sbp_data_raw_config()
1031*
1032* DESCRIPTION
1033* Get SBP Data Raw Data according to the ps_id
1034* Please don't use this API if you don't get the permission from SBP FPM.
1035*
1036* PARAMETERS
1037* ps_id [IN] protocol ID
1038*
1039* RETURNS
1040* KAL_TRUE - success
1041* KAL_FALSE - failure
1042*
1043*****************************************************************************/
1044extern void sbp_set_sbp_data_raw_config(protocol_id_enum ps_id, kal_uint8 *raw_config);
1045
1046
1047/*****************************************************************************
1048* FUNCTION
1049* sbp_general_set_md_feature()
1050*
1051* DESCRIPTION
1052* This function is used to set modem configuration.
1053* Please don't use this API if you don't get the permission from SBP FPM.
1054*
1055* PARAMETERS
1056* feature [IN] modem feature
1057* is_turned_on [IN]
1058*
1059* RETURNS
1060* KAL_TRUE if success; otherwise KAL_FALSE
1061*****************************************************************************/
1062extern kal_bool sbp_general_set_md_feature(sbp_md_feature_enum feature, kal_bool is_turned_on);
1063
1064/*****************************************************************************
1065* FUNCTION
1066* sbp_update_features_to_nvram()
1067*
1068* DESCRIPTION
1069* This function is used to store current config of features from SBP contexts into NVRAM_EF_SBP_MODEM_CONFIG_LID
1070* Please don't use this API if you don't get the permission from SBP FPM.
1071*
1072* PARAMETERS
1073* ps_id [IN] protocol ID
1074*
1075* RETURNS
1076* KAL_TRUE - success
1077* KAL_FALSE - failure
1078*
1079*****************************************************************************/
1080extern kal_bool sbp_update_features_to_nvram();
1081
1082/*****************************************************************************
1083* FUNCTION
1084* sbp_update_data_to_nvram()
1085*
1086* DESCRIPTION
1087* This function is used to store current config of data from SBP contexts into NVRAM_EF_SBP_MODEM_DATA_CONFIG_LID
1088* Please don't use this API if you don't get the permission from SBP FPM.
1089*
1090* PARAMETERS
1091* ps_id [IN] protocol ID
1092*
1093* RETURNS
1094* KAL_TRUE - success
1095* KAL_FALSE - failure
1096*
1097*****************************************************************************/
1098extern kal_bool sbp_update_data_to_nvram();
1099
1100/*****************************************************************************
1101* FUNCTION
1102* sbp_update_specific_feature_to_nvram()
1103*
1104* DESCRIPTION
1105* This function is used to write a single SBP feature to NVRAM, keeping all other features the same
1106*
1107* PARAMETERS
1108* feature [IN] modem feature
1109* is_turned_on [IN]
1110*
1111* RETURNS
1112* KAL_TRUE - success
1113* KAL_FALSE - failure
1114*
1115*****************************************************************************/
1116kal_bool sbp_update_specific_feature_to_nvram(sbp_md_feature_enum feature, kal_bool is_turned_on);
1117
1118/*****************************************************************************
1119* FUNCTION
1120* sbp_update_specific_data_to_nvram()
1121*
1122* DESCRIPTION
1123* This function is used to write a single SBP feature data to NVRAM, keeping all other feature data the same
1124*
1125* PARAMETERS
1126* feature [IN] modem feature data
1127* data [IN] value of feature data
1128*
1129* RETURNS
1130* KAL_TRUE - success
1131* KAL_FALSE - failure
1132*
1133*****************************************************************************/
1134kal_bool sbp_update_specific_data_to_nvram(sbp_md_feature_data_enum feature, kal_uint8 data);
1135
1136/*****************************************************************************
1137* FUNCTION
1138* sbp_init_contexts()
1139*
1140* DESCRIPTION
1141* This function is used to init SBP Contexts
1142* Please don't use this API if you don't get the permission from SBP FPM.
1143*
1144* PARAMETERS
1145* [IN] N/A
1146*
1147* RETURNS
1148* KAL_TRUE or KAL_FALSE
1149*****************************************************************************/
1150extern kal_bool sbp_init_contexts();
1151
1152/*****************************************************************************
1153 * FUNCTION
1154 * sbp_get_dsbp_mode
1155 *
1156 * DESCRIPTION
1157 * query dynamic SBP mode
1158 *
1159 * PARAMETERS
1160 * [IN] N/A
1161 * RETURNS
1162 * current DSBP mode : l4bsbp_dsbp_mode_enum
1163 *****************************************************************************/
1164extern kal_uint8 sbp_get_dsbp_mode(void);
1165
1166/*****************************************************************************
1167 * FUNCTION
1168 * sbp_set_dsbp_mode
1169 *
1170 * DESCRIPTION
1171 * Set dynamic SBP mode.
1172 *
1173 * PARAMETERS
1174 * dsbp_mdoe [IN] l4bsbp_dsbp_mode_enum
1175 * RETURNS
1176 * KAL_TRUE : success
1177 * KAL_FALSE : fail
1178 *****************************************************************************/
1179extern kal_bool sbp_set_dsbp_mode(kal_uint8 dspb_mode);
1180
1181/*****************************************************************************
1182 * FUNCTION
1183 * sbp_get_test_mode
1184 *
1185 * DESCRIPTION
1186 * query if it is under test mode or not
1187 *
1188 * PARAMETERS
1189 * [IN] N/A
1190 * RETURNS
1191 * current SBP test mode : sbp_test_mode_enum
1192 *****************************************************************************/
1193extern sbp_test_mode_enum sbp_get_test_mode(void);
1194
1195/*****************************************************************************
1196 * FUNCTION
1197 * sbp_set_test_mode
1198 *
1199 * DESCRIPTION
1200 * Set SBP to test mode.
1201 * In test mode, we read current values of nvram files instead of using default values before applying SBP settings.
1202 *
1203 * PARAMETERS
1204 * test_mdoe [IN] sbp_test_mode_enum
1205 * RETURNS
1206 * KAL_TRUE : success
1207 * KAL_FALSE : fail
1208 *****************************************************************************/
1209extern kal_bool sbp_set_test_mode(sbp_test_mode_enum test_mode);
1210
1211/*****************************************************************************
1212* FUNCTION
1213* sbp_set_md_feature_by_ps()
1214*
1215* DESCRIPTION
1216* This function is used to set modem configuration by PS
1217* Please don't use this API if you don't get the permission from SBP FPM.
1218*
1219* PARAMETERS
1220* feature [IN] modem feature
1221* is_turned_on [IN]
1222* sbp_feature_ptr [IN/OUT]
1223*
1224* RETURNS
1225* KAL_TRUE if success; otherwise KAL_FALSE
1226*****************************************************************************/
1227kal_bool sbp_set_md_feature_by_ps(sbp_md_feature_enum feature,
1228 kal_bool is_turned_on,
1229 protocol_id_enum ps_id);
1230
1231/*****************************************************************************
1232* FUNCTION
1233* sbp_set_md_feature_data_by_ps()
1234*
1235* DESCRIPTION
1236* This function is used to set modem configuration data by PS
1237* Please don't use this API if you don't get the permission from SBP FPM.
1238*
1239* PARAMETERS
1240* feature [IN] modem feature
1241*
1242* RETURNS
1243* the unsigned byte value for the feature
1244*****************************************************************************/
1245kal_bool sbp_set_md_feature_data_by_ps(sbp_md_feature_data_enum feature,
1246 kal_uint8 data,
1247 protocol_id_enum ps_id);
1248
1249/*****************************************************************************
1250* FUNCTION
1251* sbp_set_sbp_id()
1252*
1253* DESCRIPTION
1254* This function is used to set SBP ID into SBP contexts and its NVRAM
1255* Please don't use this API if you don't get the permission from SBP FPM.
1256*
1257* PARAMETERS
1258* [IN] N/A
1259*
1260* RETURNS
1261* KAL_TRUE or KAL_FALSE
1262*****************************************************************************/
1263extern kal_bool sbp_set_sbp_id(kal_uint32 sbp_id);
1264
1265/*****************************************************************************
1266* FUNCTION
1267* sbp_md_feature_overwrite()
1268*
1269* DESCRIPTION
1270* This function is used to overwrite the configuration for GCF or other test modes
1271*
1272* PARAMETERS
1273* feature [IN] modem feature
1274* enabled [IN] feature is turned on or not
1275*
1276* RETURNS
1277* KAL_TRUE : if this feature is turned on
1278* KAL_FALSE : if this feature is turned off
1279*****************************************************************************/
1280extern kal_bool sbp_md_feature_overwrite(sbp_md_feature_enum feature, kal_bool enabled);
1281
1282/*****************************************************************************
1283* FUNCTION
1284* sbp_md_feature_data_overwrite()
1285*
1286* DESCRIPTION
1287* This function is used to overwrite the configuration for GCF or other test modes
1288*
1289* PARAMETERS
1290* feature [IN] modem feature
1291* value [IN] the value of the feature
1292*
1293* RETURNS
1294* the overwrited value for the feature
1295*****************************************************************************/
1296extern kal_uint8 sbp_md_feature_data_overwrite(sbp_md_feature_data_enum feature, kal_uint8 value);
1297
1298/*****************************************************************************
1299* FUNCTION
1300* sbp_reload_config()
1301*
1302* DESCRIPTION
1303* This function is used to reload SBP related feature/data configuration
1304* Please don't use this API if you don't get the permission from SBP FPM.
1305*
1306* PARAMETERS
1307* ps_id [IN] protocol ID
1308*
1309* RETURNS
1310* KAL_TRUE - success
1311* KAL_FALSE - failure
1312*
1313*****************************************************************************/
1314void sbp_reload_config();
1315
1316
1317/*****************************************************************************
1318 * FUNCTION
1319 * nvram_custom_config_sbp_by_model_id
1320 * DESCRIPTION
1321 * Set SBP features and data according to Model ID.
1322 * PARAMETERS
1323 * md_product_model_id [IN]
1324 * RETURNS
1325 * KAL_TRUE : Set SBP ID successfully
1326 * KAL_FALSE : Error happens when setting SBP ID
1327 *****************************************************************************/
1328extern kal_bool nvram_custom_config_sbp_by_model_id(kal_uint32 md_product_model_id);
1329
1330/*****************************************************************************
1331* FUNCTION
1332* sbp_update_custom_config_to_nvram
1333*
1334* DESCRIPTION
1335* This function updates sbp feature/data custom config to nvram
1336*
1337*
1338* PARAMETERS
1339* ps_id [IN] protocol ID
1340* is_erase [IN] reset the feature/data item or not
1341* RETURNS
1342* void
1343*
1344*****************************************************************************/
1345kal_bool sbp_update_custom_config_to_nvram(sbp_custom_config_struct *sbp_custom_config_ptr, kal_bool is_erase);
1346
1347/*****************************************************************************
1348* FUNCTION
1349* sbp_get_custom_config_nv_with_mcf
1350*
1351* DESCRIPTION
1352* This function reads NVRAM_EF_SBP_CUSTOM_MODEM_CONFIG_LID and applies MCF OTA by OP change
1353*
1354* PARAMETERS
1355* ps_id [IN] protocol ID
1356*
1357* RETURNS
1358* void
1359*
1360*****************************************************************************/
1361kal_bool sbp_get_custom_config_nv_with_mcf(protocol_id_enum ps_id, nvram_ef_sbp_custom_modem_config_struct * sbp_custom_modem_config_nv_ptr);
1362
1363/*****************************************************************************
1364* FUNCTION
1365* sbp_get_max_custom_config
1366*
1367* DESCRIPTION
1368* This function gets MAX custom config NV entries
1369*
1370* PARAMETERS
1371* [IN] N/A
1372* RETURNS
1373* void
1374*
1375*****************************************************************************/
1376kal_uint16 sbp_get_max_custom_config(void);
1377
1378/*****************************************************************************
1379* FUNCTION
1380* sbp_get_last_dsbp_sim_info()
1381*
1382* DESCRIPTION
1383* This function is used to get MCC/MNC/ICCID of last completed DSBP
1384* For mode2 device, this will include SIM info from last power up
1385* For mode1 device, only include SIM info in current sbp context
1386*
1387* PARAMETERS
1388* ps_id [IN] protocol ID
1389* param [IN] mcc, mnc, iccid
1390* RETURNS
1391* void
1392*
1393*****************************************************************************/
1394extern void sbp_get_last_dsbp_sim_info(protocol_id_enum ps_id, kal_uint8 *mcc, kal_uint8 *mnc, kal_uint8 *iccid);
1395
1396/*****************************************************************************
1397* FUNCTION
1398* sbp_get_last_mode2_dsbp_sim_info()
1399*
1400* DESCRIPTION
1401* This function is used to get SIM_SBP_ID/MCC/MNC/ICCID of last completed mode2 DSBP
1402* Can be used in DSBP callback function to compare with last mode2 DSBP result
1403* As part of mode2 design, this includes info from SIM insert of last power cycle
1404*
1405* PARAMETERS
1406* ps_id [IN] protocol ID
1407* param [IN] sim_sbp_id, mcc, mnc, iccid
1408* RETURNS
1409* void
1410*
1411*****************************************************************************/
1412extern void sbp_get_last_mode2_dsbp_sim_info(protocol_id_enum ps_id, kal_uint32 *sim_sbp_id, kal_uint8 *mcc, kal_uint8 *mnc, kal_uint8 *iccid);
1413
1414/*****************************************************************************
1415* FUNCTION
1416* sbp_get_dsbp_config()
1417*
1418* DESCRIPTION
1419* This function is used to get dsbp retry config
1420*
1421* PARAMETERS
1422* void
1423* RETURNS
1424* nvram_ef_sbp_dsbp_config_struct
1425*
1426*****************************************************************************/
1427extern nvram_ef_sbp_dsbp_config_struct* sbp_get_dsbp_config(void);
1428/*****************************************************************************
1429* FUNCTION
1430* nvram_custom_config_refresh_sbp_id_mapping_when_mcf_ota_start()
1431*
1432* DESCRIPTION
1433* This function is used to re-read NVRAM and update the globle custom sbp_id mapping table
1434* when MCF default OTA triggered.
1435*
1436* PARAMETERS
1437* void
1438* RETURNS
1439* void
1440*
1441*****************************************************************************/
1442extern void nvram_custom_config_refresh_sbp_id_mapping_when_mcf_ota_start(void);
1443
1444/*****************************************************************************
1445* FUNCTION
1446* sbp_get_custom_sbp_id_mapping_table
1447*
1448* DESCRIPTION
1449* This function is used to get the globle custom sbp_id mapping table
1450*
1451* PARAMETERS
1452* void
1453* RETURNS
1454* nvram_ef_sbp_custom_sbp_id_mapping_struct
1455*
1456*****************************************************************************/
1457extern nvram_ef_sbp_custom_sbp_id_mapping_struct* sbp_get_custom_sbp_id_mapping_table(void);
1458
1459/*****************************************************************************
1460* FUNCTION
1461* sbp_get_md_cxp_sbp_id
1462*
1463* DESCRIPTION
1464* This function is used to get trigger modem CXP (device) sbp_id
1465*
1466* PARAMETERS
1467* kal_uint32 sim_sbp_id
1468* RETURNS
1469* kal_uint32 md_cxp_sbp_id
1470*
1471*****************************************************************************/
1472extern kal_uint32 sbp_get_md_cxp_sbp_id(kal_uint32 sim_sbp_id);
1473
1474/*****************************************************************************
1475* FUNCTION
1476* sbp_set_md_cxp_sbp_id
1477*
1478* DESCRIPTION
1479* This function is used to add trigger modem CXP (device) sbp_id
1480*
1481* PARAMETERS
1482* kal_uint32 sbp_id
1483* RETURNS
1484*
1485*****************************************************************************/
1486extern void sbp_set_md_cxp_sbp_id(kal_uint32 sbp_id);
1487
1488#if defined (__TC01_NVRAM__) || defined(__TC01__) // __TC01_CUST_SBP__
1489/*****************************************************************************
1490* FUNCTION
1491* sbp_query_md_feature_custom()
1492*
1493* DESCRIPTION
1494* clone sbp_query_md_feature() for customer's SBP.
1495*
1496* PARAMETERS
1497* feature [IN] customer's modem feature
1498*
1499* RETURNS
1500* KAL_TRUE : if this feature is turned on
1501* KAL_FALSE : if this feature is turned off
1502*****************************************************************************/
1503extern kal_bool sbp_query_md_feature_custom(sbp_md_feature_custom_enum feature);
1504
1505/*****************************************************************************
1506* FUNCTION
1507* sbp_query_md_feature_by_ps_custom()
1508*
1509* DESCRIPTION
1510* clone sbp_query_md_feature_by_ps() for customer's SBP.
1511*
1512* PARAMETERS
1513* feature [IN] customer's modem feature
1514* ps_id [IN] PS ID
1515*
1516* RETURNS
1517* KAL_TRUE : if this feature is turned on
1518* KAL_FALSE : if this feature is turned off
1519*****************************************************************************/
1520extern kal_bool sbp_query_md_feature_by_ps_custom(sbp_md_feature_custom_enum feature, protocol_id_enum ps_id);
1521
1522/*****************************************************************************
1523* FUNCTION
1524* sbp_set_md_feature_custom()
1525*
1526* DESCRIPTION
1527* clone sbp_set_md_feature() for customer's SBP.
1528*
1529* PARAMETERS
1530* feature [IN] customer's modem feature
1531* is_turned_on [IN]
1532* sbp_feature_ptr [IN/OUT]
1533*
1534* RETURNS
1535* KAL_TRUE if success; otherwise KAL_FALSE
1536*****************************************************************************/
1537extern kal_bool sbp_set_md_feature_custom(sbp_md_feature_custom_enum feature,
1538 kal_bool is_turned_on,
1539 nvram_ef_sbp_modem_config_struct *sbp_feature_ptr);
1540
1541/*****************************************************************************
1542* FUNCTION
1543* sbp_set_md_feature_by_ps_custom()
1544*
1545* DESCRIPTION
1546* clone sbp_set_md_feature_by_ps() for customer's SBP.
1547*
1548* PARAMETERS
1549* feature [IN] customer's modem feature
1550* is_turned_on [IN]
1551* sbp_feature_ptr [IN/OUT]
1552*
1553* RETURNS
1554* KAL_TRUE if success; otherwise KAL_FALSE
1555*****************************************************************************/
1556extern kal_bool sbp_set_md_feature_by_ps_custom(sbp_md_feature_custom_enum feature,
1557 kal_bool is_turned_on,
1558 protocol_id_enum ps_id);
1559
1560/*****************************************************************************
1561* FUNCTION
1562* sbp_general_set_md_feature_custom()
1563*
1564* DESCRIPTION
1565* clone sbp_general_set_md_feature() for customer's SBP.
1566*
1567* PARAMETERS
1568* feature [IN] customer's modem feature
1569* is_turned_on [IN]
1570*
1571* RETURNS
1572* KAL_TRUE if success; otherwise KAL_FALSE
1573*****************************************************************************/
1574extern kal_bool sbp_general_set_md_feature_custom(sbp_md_feature_custom_enum feature, kal_bool is_turned_on);
1575
1576/*****************************************************************************
1577* FUNCTION
1578* sbp_update_features_to_nvram_custom()
1579*
1580* DESCRIPTION
1581* clone sbp_update_features_to_nvram() for customer's SBP.
1582*
1583* PARAMETERS
1584* ps_id [IN] protocol ID
1585*
1586* RETURNS
1587* KAL_TRUE - success
1588* KAL_FALSE - failure
1589*
1590*****************************************************************************/
1591extern kal_bool sbp_update_features_to_nvram_custom();
1592
1593
1594/*****************************************************************************
1595 * FUNCTION
1596* sbp_get_sbp_feature_raw_config_custom()
1597*
1598* DESCRIPTION
1599* clone sbp_get_sbp_feature_raw_config() for customer's SBP.
1600*
1601* PARAMETERS
1602* ps_id [IN] protocol ID
1603*
1604* RETURNS
1605* KAL_TRUE - success
1606* KAL_FALSE - failure
1607*
1608*****************************************************************************/
1609extern kal_bool sbp_get_sbp_feature_raw_config_custom(protocol_id_enum ps_id, kal_uint8 *raw_config);
1610
1611/*****************************************************************************
1612* FUNCTION
1613* sbp_set_sbp_feature_raw_config_custom()
1614*
1615* DESCRIPTION
1616* clone sbp_set_sbp_feature_raw_config() for customer's SBP.
1617*
1618* PARAMETERS
1619* ps_id [IN] protocol ID
1620*
1621* RETURNS
1622* KAL_TRUE - success
1623* KAL_FALSE - failure
1624*
1625*****************************************************************************/
1626extern void sbp_set_sbp_feature_raw_config_custom(protocol_id_enum ps_id, kal_uint8 *raw_config);
1627#endif /* (__TC01_NVRAM__) || defined(__TC01__) */
1628
1629#ifdef __IPC_ADAPTER__
1630/*****************************************************************************
1631* FUNCTION
1632* sbp_get_salecode()
1633*
1634* DESCRIPTION
1635* This function is used to get salecode of this ps_id
1636* If network code is present, network code is given
1637* otherwise, csc_salecode is given
1638*
1639* PARAMETERS
1640* ps_id [IN] protocol ID
1641* param [IN] salecode
1642* RETURNS
1643* void
1644*
1645*****************************************************************************/
1646extern void sbp_get_salecode(kal_char *salecode, protocol_id_enum ps_id);
1647extern void sbp_get_csc_salecode(kal_char *salecode);
1648extern void sbp_get_network_code_salecode(kal_char *salecode, protocol_id_enum ps_id);
1649#endif /* __IPC_ADAPTER__ */
1650
1651#ifdef __cplusplus
1652}
1653#endif
1654
1655#endif /* _SBP_PUBLIC_UTILITY_H */
1656