blob: bbc0b7b26a62f26b92ae516024521c2f1b03b954 [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,
rjw2b1408e2022-12-19 11:19:29 +0800538 SBP_ID_CBN = 388,
rjw6c1fd8f2022-11-30 14:33:01 +0800539 SBP_ID_LICT = 398,
540
541 /* Lab testing SBP ID */
542 SBP_ID_ERICSSON = 1001,
543 SBP_ID_NOKIA = 1002,
544 SBP_ID_MTK_HQLAB_ERICSSON = 1003,
545 SBP_ID_HUAWEI_IMS_LAB = 1004,
546
547
548 /* Legacy C2K SBP ID */
549 SBP_ID_GENERIC = SBP_ID_OM,
550 SBP_ID_VERIZON_C2K = SBP_ID_VERIZON,
551
552#ifdef __TC10__
553 /* START - allocated ID for Samsung 10000 ~ 20000 */
554
555 // SBP ID FOR CHINA 10001 ~ 10999
556 SBP_ID_CHINA = 10000,
557 // SBP ID FOR GLOBAL 11001 ~ 11999
558 SBP_ID_GLOBAL = 11000,
559 SBP_ID_TNZ, // TNZ - SPARK (Formerly Telecom New Zealand)
560 // SBP ID FOR JPN 12001 ~ 12999
561 SBP_ID_JPN = 12000,
562 // SBP ID FOR KOR 13001 ~ 13999
563 SBP_ID_KOR = 13000,
564 // SBP ID FOR LATIN_AMERICA 14001 ~ 14999
565 SBP_ID_LATIN_AMERICA = 14000,
566 // SBP ID FOR N_AMERICA_CAN 15001 ~ 15999
567 SBP_ID_N_AMERICA_CAN = 15000,
568 // SBP ID FOR N_AMERICA 16001 ~ 16999
569 SBP_ID_N_AMERICA = 16000,
570 // SBP ID FOR N_AMERICA_3GPP2 17001 ~ 17999
571 SBP_ID_N_AMERICA_3GPP2 = 17000,
572
573 /* END - allocated ID for Samsung 10000 ~ 20000 */
574
575 SBP_ID_MAX = 20000, // MAX
576#endif /* __TC10__ */
577
578} sbp_id_enum;
579
580/* --------------------------
581 * End of SBP Configuration
582 * --------------------------- */
583
584
585/*****************************************************************************
586* FUNCTION
587* sbp_query_md_feature()
588*
589* DESCRIPTION
590* This function is used to query modem configuration
591*
592* PARAMETERS
593* feature [IN] modem feature
594*
595* RETURNS
596* KAL_TRUE : if this feature is turned on
597* KAL_FALSE : if this feature is turned off
598*****************************************************************************/
599extern kal_bool sbp_query_md_feature(sbp_md_feature_enum feature);
600
601/*****************************************************************************
602* FUNCTION
603* sbp_query_id()
604*
605* DESCRIPTION
606* This function is used to query SBP ID received by modem
607*
608* PARAMETERS
609* [IN] N/A
610* RETURNS
611* the unsigned 4-byte value for the SBP ID
612*****************************************************************************/
613extern kal_uint32 sbp_query_id(void);
614
615/*****************************************************************************
616* FUNCTION
617* sbp_query_sub_id()
618*
619* DESCRIPTION
620* This function is used to query SBP Sub ID received by modem
621*
622* PARAMETERS
623* [IN] N/A
624* RETURNS
625* the unsigned 4-byte value for the SBP Sub ID
626*****************************************************************************/
627extern kal_uint32 sbp_query_sub_id(void);
628
629
630/*****************************************************************************
631* FUNCTION
632* sbp_query_md_feature_for_c2k()
633*
634* DESCRIPTION
635* This function is used to query modem configuration and used by C2K team only
636* The function will judge current active PS using C2K's API and return the corresponding setting.
637*
638* PARAMETERS
639* feature [IN] modem feature
640*
641* RETURNS
642* KAL_TRUE : if this feature is turned on
643* KAL_FALSE : if this feature is turned off
644*****************************************************************************/
645extern kal_bool sbp_query_md_feature_for_c2k(sbp_md_feature_enum feature);
646
647/*****************************************************************************
648* FUNCTION
649* sbp_query_md_feature_by_ps()
650*
651* DESCRIPTION
652* This function is used to query modem configuration according to the PS ID
653*
654* PARAMETERS
655* feature [IN] modem feature
656* ps_id [IN] PS ID
657*
658* RETURNS
659* KAL_TRUE : if this feature is turned on
660* KAL_FALSE : if this feature is turned off
661*****************************************************************************/
662extern kal_bool sbp_query_md_feature_by_ps(sbp_md_feature_enum feature, protocol_id_enum ps_id);
663
664/*****************************************************************************
665* FUNCTION
666* sbp_query_md_feature_no_overwrite()
667*
668* DESCRIPTION
669* This function is used to query modem configuration without overwrite
670*
671* PARAMETERS
672* feature [IN] modem feature
673*
674* RETURNS
675* KAL_TRUE : if this feature is turned on
676* KAL_FALSE : if this feature is turned off
677*****************************************************************************/
678extern kal_bool sbp_query_md_feature_no_overwrite(sbp_md_feature_enum feature);
679
680/*****************************************************************************
681* FUNCTION
682* sbp_query_md_feature_no_overwrite_by_ps()
683*
684* DESCRIPTION
685* This function is used to query modem configuration without overwrite according to the PS ID
686*
687* PARAMETERS
688* feature [IN] modem feature
689* ps_id [IN] PS ID
690*
691* RETURNS
692* KAL_TRUE : if this feature is turned on
693* KAL_FALSE : if this feature is turned off
694*****************************************************************************/
695extern kal_bool sbp_query_md_feature_no_overwrite_by_ps(sbp_md_feature_enum feature, protocol_id_enum ps_id);
696
697
698/*****************************************************************************
699* FUNCTION
700* sbp_set_md_feature()
701*
702* DESCRIPTION
703* This function is used to set modem configuration
704*
705* PARAMETERS
706* feature [IN] modem feature
707* is_turned_on [IN]
708* sbp_feature_ptr [IN/OUT]
709*
710* RETURNS
711* KAL_TRUE if success; otherwise KAL_FALSE
712*****************************************************************************/
713extern kal_bool sbp_set_md_feature(sbp_md_feature_enum feature,
714 kal_bool is_turned_on,
715 nvram_ef_sbp_modem_config_struct *sbp_feature_ptr);
716
717/*****************************************************************************
718* FUNCTION
719* sbp_query_md_feature_data()
720*
721* DESCRIPTION
722* This function is used to query modem configuration
723*
724* PARAMETERS
725* feature [IN] modem feature
726*
727* RETURNS
728* The byte value for the input feature
729*****************************************************************************/
730extern kal_uint8 sbp_query_md_feature_data(sbp_md_feature_data_enum feature);
731
732/*****************************************************************************
733* FUNCTION
734* sbp_query_md_feature_data_for_c2k()
735*
736* DESCRIPTION
737* This function is used to query modem configuration and used by C2K team only
738* The function will judge current active PS using C2K's API and return the corresponding setting.
739*
740* PARAMETERS
741* feature [IN] modem feature
742*
743* RETURNS
744* the unsigned byte value for the feature
745*****************************************************************************/
746extern kal_uint8 sbp_query_md_feature_data_for_c2k(sbp_md_feature_data_enum feature);
747
748/*****************************************************************************
749* FUNCTION
750* sbp_query_md_feature_data_by_ps()
751*
752* DESCRIPTION
753* This function is used to query modem configuration data
754*
755* PARAMETERS
756* feature [IN] modem feature
757* ps_id [IN] PS ID
758*
759* RETURNS
760* the unsigned byte value for the feature
761*****************************************************************************/
762extern kal_uint8 sbp_query_md_feature_data_by_ps(sbp_md_feature_data_enum feature, protocol_id_enum ps_id);
763
764/*****************************************************************************
765* FUNCTION
766* sbp_query_md_feature_data_no_overwrite()
767*
768* DESCRIPTION
769* This function is used to query modem configuration without overwrite
770*
771* PARAMETERS
772* feature [IN] modem feature
773*
774* RETURNS
775* The byte value for the input feature
776*****************************************************************************/
777extern kal_uint8 sbp_query_md_feature_data_no_overwrite(sbp_md_feature_data_enum feature);
778
779/*****************************************************************************
780* FUNCTION
781* sbp_query_md_feature_data_no_overwrite_by_ps()
782*
783* DESCRIPTION
784* This function is used to query modem configuration data without overwrite
785*
786* PARAMETERS
787* feature [IN] modem feature
788* ps_id [IN] PS ID
789*
790* RETURNS
791* the unsigned byte value for the feature
792*****************************************************************************/
793extern kal_uint8 sbp_query_md_feature_data_no_overwrite_by_ps(sbp_md_feature_data_enum feature, protocol_id_enum ps_id);
794
795/*****************************************************************************
796* FUNCTION
797* sbp_set_md_feature_data()
798*
799* DESCRIPTION
800* This function is used to query modem configuration
801*
802* PARAMETERS
803* feature [IN] modem feature
804* data [IN]
805* sbp_data_ptr [IN/OUT]
806*
807* RETURNS
808* KAL_TRUE if success; otherwise KAL_FALSE
809*****************************************************************************/
810extern kal_bool sbp_set_md_feature_data(sbp_md_feature_data_enum feature,
811 kal_uint8 data,
812 nvram_ef_sbp_modem_data_config_struct *sbp_data_ptr);
813
814/*****************************************************************************
815* FUNCTION
816* sbp_general_set_md_feature_data()
817*
818* DESCRIPTION
819* This function is used to set modem configuration data
820* Please don't use this API if you don't get the permission from SBP FPM.
821*
822* PARAMETERS
823* feature [IN] modem feature
824*
825* RETURNS
826* the unsigned byte value for the feature
827*****************************************************************************/
828extern kal_bool sbp_general_set_md_feature_data(sbp_md_feature_data_enum feature, kal_uint8 data);
829
830/*****************************************************************************
831 * FUNCTION
832 * custom_nvram_set_sbp_id
833 * DESCRIPTION
834 * Set SBP features and data according to SBP ID.
835 * PARAMETERS
836 * sbp_mode [IN]
837 * RETURNS
838 * KAL_TRUE : Set SBP ID successfully
839 * KAL_FALSE : Error happens when setting SBP ID
840 *****************************************************************************/
841extern 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);
842
843/*****************************************************************************
844 * FUNCTION
845 * custom_nvram_init_sbp_id
846 * DESCRIPTION
847 * Set SBP features and data according to SBP ID and SIM SBP ID.
848 * PARAMETERS
849 * sbp_id [IN]
850 * RETURNS
851 * Void
852 *****************************************************************************/
853extern void custom_nvram_init_sbp_id(kal_uint32 sbp_id);
854
855
856/*****************************************************************************
857* FUNCTION
858* sbp_get_sim_sbp_id_for_all()
859*
860* DESCRIPTION
861* get SIM SBP ID which trigger DSBP for all modem (IMS/VoLTE + PS/L1)
862*
863* PARAMETERS
864* ps_id [IN] protocol ID
865*
866* RETURNS
867* the unsigned 4-byte value for the SIM SBP ID
868*
869*****************************************************************************/
870extern kal_uint32 sbp_get_sim_sbp_id_for_all(protocol_id_enum ps_id);
871
872/*****************************************************************************
873* FUNCTION
874* sbp_get_current_sim_sbp_id()
875*
876* DESCRIPTION
877* get SIM SBP ID which trigger DSBP for IMS/VoLTE
878*
879* PARAMETERS
880* ps_id [IN] protocol ID
881*
882* RETURNS
883* the unsigned 4-byte value for the SIM SBP ID
884*
885*****************************************************************************/
886extern kal_uint32 sbp_get_current_sim_sbp_id(protocol_id_enum ps_id);
887
888
889/*****************************************************************************
890* FUNCTION
891* sbp_get_sim_sbp_id()
892*
893* DESCRIPTION
894* get SIM SBP ID which trigger DSBP for IMS/VoLTE
895*
896* PARAMETERS
897* ps_id [IN] protocol ID
898*
899* RETURNS
900* the unsigned 4-byte value for the SIM SBP ID
901*
902*****************************************************************************/
903extern kal_uint32 sbp_get_sim_sbp_id(protocol_id_enum ps_id);
904
905/*****************************************************************************
906* FUNCTION
907* sbp_set_sim_sbp_id_for_all()
908*
909* DESCRIPTION
910* set SIM SBP ID which trigger DSBP for all modem (IMS/VoLTE + PS/L1)
911*
912* PARAMETERS
913* ps_id [IN] protocol ID
914* sim_sbp_id [IN] SIM SBP ID
915* mcc [IN] MCC
916* mnc [IN] MNC
917* iccid [IN] ICCID
918*
919* RETURNS
920* KAL_TRUE - success
921* KAL_FALSE - failure
922*
923*****************************************************************************/
924extern 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);
925
926/*****************************************************************************
927* FUNCTION
928* sbp_set_current_sim_sbp_id()
929*
930* DESCRIPTION
931* get SIM SBP ID which trigger DSBP for IMS/VoLTE
932*
933* PARAMETERS
934* ps_id [IN] protocol ID
935* sim_sbp_id [IN] SIM SBP ID
936*
937* RETURNS
938* KAL_TRUE - success
939* KAL_FALSE - failure
940*
941*****************************************************************************/
942extern kal_bool sbp_set_current_sim_sbp_id(protocol_id_enum ps_id, kal_uint32 sim_sbp_id);
943
944/*****************************************************************************
945* FUNCTION
946* sbp_set_sim_sbp_id()
947*
948* DESCRIPTION
949* set SIM SBP ID which trigger DSBP for IMS/VoLTE
950*
951* PARAMETERS
952* ps_id [IN] protocol ID
953* sim_sbp_id [IN] SIM SBP ID
954*
955* RETURNS
956* KAL_TRUE - success
957* KAL_FALSE - failure
958*
959*****************************************************************************/
960extern 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);
961
962/*****************************************************************************
963 * FUNCTION
964 * sbp_convert_mcc_mnc_string_from_imsi
965 * DESCRIPTION
966 * get mcc, mnc from imsi with string format
967 * PARAMETERS
968 * imsi
969 * RETURNS
970 * KAL_TRUE
971 *****************************************************************************/
972kal_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);
973
974/*****************************************************************************
975 * FUNCTION
976* sbp_get_sbp_feature_raw_config()
977*
978* DESCRIPTION
979* Get SBP Feature Raw Data according to the ps_id
980* Please don't use this API if you don't get the permission from SBP FPM.
981*
982* PARAMETERS
983* ps_id [IN] protocol ID
984*
985* RETURNS
986* KAL_TRUE - success
987* KAL_FALSE - failure
988*
989*****************************************************************************/
990extern kal_bool sbp_get_sbp_feature_raw_config(protocol_id_enum ps_id, kal_uint8 *raw_config);
991
992/*****************************************************************************
993* FUNCTION
994* sbp_set_sbp_feature_raw_config()
995*
996* DESCRIPTION
997* Set SBP Feature Raw Data according to the ps_id
998* Please don't use this API if you don't get the permission from SBP FPM.
999*
1000* PARAMETERS
1001* ps_id [IN] protocol ID
1002*
1003* RETURNS
1004* KAL_TRUE - success
1005* KAL_FALSE - failure
1006*
1007*****************************************************************************/
1008extern void sbp_set_sbp_feature_raw_config(protocol_id_enum ps_id, kal_uint8 *raw_config);
1009
1010
1011/*****************************************************************************
1012* FUNCTION
1013* sbp_get_sbp_data_raw_config()
1014*
1015* DESCRIPTION
1016* Get SBP Data Raw Data according to the ps_id
1017* Please don't use this API if you don't get the permission from SBP FPM.
1018*
1019* PARAMETERS
1020* ps_id [IN] protocol ID
1021*
1022* RETURNS
1023* KAL_TRUE - success
1024* KAL_FALSE - failure
1025*
1026*****************************************************************************/
1027extern kal_bool sbp_get_sbp_data_raw_config(protocol_id_enum ps_id, kal_uint8 *raw_config);
1028
1029/*****************************************************************************
1030* FUNCTION
1031* sbp_set_sbp_data_raw_config()
1032*
1033* DESCRIPTION
1034* Get SBP Data Raw Data according to the ps_id
1035* Please don't use this API if you don't get the permission from SBP FPM.
1036*
1037* PARAMETERS
1038* ps_id [IN] protocol ID
1039*
1040* RETURNS
1041* KAL_TRUE - success
1042* KAL_FALSE - failure
1043*
1044*****************************************************************************/
1045extern void sbp_set_sbp_data_raw_config(protocol_id_enum ps_id, kal_uint8 *raw_config);
1046
1047
1048/*****************************************************************************
1049* FUNCTION
1050* sbp_general_set_md_feature()
1051*
1052* DESCRIPTION
1053* This function is used to set modem configuration.
1054* Please don't use this API if you don't get the permission from SBP FPM.
1055*
1056* PARAMETERS
1057* feature [IN] modem feature
1058* is_turned_on [IN]
1059*
1060* RETURNS
1061* KAL_TRUE if success; otherwise KAL_FALSE
1062*****************************************************************************/
1063extern kal_bool sbp_general_set_md_feature(sbp_md_feature_enum feature, kal_bool is_turned_on);
1064
1065/*****************************************************************************
1066* FUNCTION
1067* sbp_update_features_to_nvram()
1068*
1069* DESCRIPTION
1070* This function is used to store current config of features from SBP contexts into NVRAM_EF_SBP_MODEM_CONFIG_LID
1071* Please don't use this API if you don't get the permission from SBP FPM.
1072*
1073* PARAMETERS
1074* ps_id [IN] protocol ID
1075*
1076* RETURNS
1077* KAL_TRUE - success
1078* KAL_FALSE - failure
1079*
1080*****************************************************************************/
1081extern kal_bool sbp_update_features_to_nvram();
1082
1083/*****************************************************************************
1084* FUNCTION
1085* sbp_update_data_to_nvram()
1086*
1087* DESCRIPTION
1088* This function is used to store current config of data from SBP contexts into NVRAM_EF_SBP_MODEM_DATA_CONFIG_LID
1089* Please don't use this API if you don't get the permission from SBP FPM.
1090*
1091* PARAMETERS
1092* ps_id [IN] protocol ID
1093*
1094* RETURNS
1095* KAL_TRUE - success
1096* KAL_FALSE - failure
1097*
1098*****************************************************************************/
1099extern kal_bool sbp_update_data_to_nvram();
1100
1101/*****************************************************************************
1102* FUNCTION
1103* sbp_update_specific_feature_to_nvram()
1104*
1105* DESCRIPTION
1106* This function is used to write a single SBP feature to NVRAM, keeping all other features the same
1107*
1108* PARAMETERS
1109* feature [IN] modem feature
1110* is_turned_on [IN]
1111*
1112* RETURNS
1113* KAL_TRUE - success
1114* KAL_FALSE - failure
1115*
1116*****************************************************************************/
1117kal_bool sbp_update_specific_feature_to_nvram(sbp_md_feature_enum feature, kal_bool is_turned_on);
1118
1119/*****************************************************************************
1120* FUNCTION
1121* sbp_update_specific_data_to_nvram()
1122*
1123* DESCRIPTION
1124* This function is used to write a single SBP feature data to NVRAM, keeping all other feature data the same
1125*
1126* PARAMETERS
1127* feature [IN] modem feature data
1128* data [IN] value of feature data
1129*
1130* RETURNS
1131* KAL_TRUE - success
1132* KAL_FALSE - failure
1133*
1134*****************************************************************************/
1135kal_bool sbp_update_specific_data_to_nvram(sbp_md_feature_data_enum feature, kal_uint8 data);
1136
1137/*****************************************************************************
1138* FUNCTION
1139* sbp_init_contexts()
1140*
1141* DESCRIPTION
1142* This function is used to init SBP Contexts
1143* Please don't use this API if you don't get the permission from SBP FPM.
1144*
1145* PARAMETERS
1146* [IN] N/A
1147*
1148* RETURNS
1149* KAL_TRUE or KAL_FALSE
1150*****************************************************************************/
1151extern kal_bool sbp_init_contexts();
1152
1153/*****************************************************************************
1154 * FUNCTION
1155 * sbp_get_dsbp_mode
1156 *
1157 * DESCRIPTION
1158 * query dynamic SBP mode
1159 *
1160 * PARAMETERS
1161 * [IN] N/A
1162 * RETURNS
1163 * current DSBP mode : l4bsbp_dsbp_mode_enum
1164 *****************************************************************************/
1165extern kal_uint8 sbp_get_dsbp_mode(void);
1166
1167/*****************************************************************************
1168 * FUNCTION
1169 * sbp_set_dsbp_mode
1170 *
1171 * DESCRIPTION
1172 * Set dynamic SBP mode.
1173 *
1174 * PARAMETERS
1175 * dsbp_mdoe [IN] l4bsbp_dsbp_mode_enum
1176 * RETURNS
1177 * KAL_TRUE : success
1178 * KAL_FALSE : fail
1179 *****************************************************************************/
1180extern kal_bool sbp_set_dsbp_mode(kal_uint8 dspb_mode);
1181
1182/*****************************************************************************
1183 * FUNCTION
1184 * sbp_get_test_mode
1185 *
1186 * DESCRIPTION
1187 * query if it is under test mode or not
1188 *
1189 * PARAMETERS
1190 * [IN] N/A
1191 * RETURNS
1192 * current SBP test mode : sbp_test_mode_enum
1193 *****************************************************************************/
1194extern sbp_test_mode_enum sbp_get_test_mode(void);
1195
1196/*****************************************************************************
1197 * FUNCTION
1198 * sbp_set_test_mode
1199 *
1200 * DESCRIPTION
1201 * Set SBP to test mode.
1202 * In test mode, we read current values of nvram files instead of using default values before applying SBP settings.
1203 *
1204 * PARAMETERS
1205 * test_mdoe [IN] sbp_test_mode_enum
1206 * RETURNS
1207 * KAL_TRUE : success
1208 * KAL_FALSE : fail
1209 *****************************************************************************/
1210extern kal_bool sbp_set_test_mode(sbp_test_mode_enum test_mode);
1211
1212/*****************************************************************************
1213* FUNCTION
1214* sbp_set_md_feature_by_ps()
1215*
1216* DESCRIPTION
1217* This function is used to set modem configuration by PS
1218* Please don't use this API if you don't get the permission from SBP FPM.
1219*
1220* PARAMETERS
1221* feature [IN] modem feature
1222* is_turned_on [IN]
1223* sbp_feature_ptr [IN/OUT]
1224*
1225* RETURNS
1226* KAL_TRUE if success; otherwise KAL_FALSE
1227*****************************************************************************/
1228kal_bool sbp_set_md_feature_by_ps(sbp_md_feature_enum feature,
1229 kal_bool is_turned_on,
1230 protocol_id_enum ps_id);
1231
1232/*****************************************************************************
1233* FUNCTION
1234* sbp_set_md_feature_data_by_ps()
1235*
1236* DESCRIPTION
1237* This function is used to set modem configuration data by PS
1238* Please don't use this API if you don't get the permission from SBP FPM.
1239*
1240* PARAMETERS
1241* feature [IN] modem feature
1242*
1243* RETURNS
1244* the unsigned byte value for the feature
1245*****************************************************************************/
1246kal_bool sbp_set_md_feature_data_by_ps(sbp_md_feature_data_enum feature,
1247 kal_uint8 data,
1248 protocol_id_enum ps_id);
1249
1250/*****************************************************************************
1251* FUNCTION
1252* sbp_set_sbp_id()
1253*
1254* DESCRIPTION
1255* This function is used to set SBP ID into SBP contexts and its NVRAM
1256* Please don't use this API if you don't get the permission from SBP FPM.
1257*
1258* PARAMETERS
1259* [IN] N/A
1260*
1261* RETURNS
1262* KAL_TRUE or KAL_FALSE
1263*****************************************************************************/
1264extern kal_bool sbp_set_sbp_id(kal_uint32 sbp_id);
1265
1266/*****************************************************************************
1267* FUNCTION
1268* sbp_md_feature_overwrite()
1269*
1270* DESCRIPTION
1271* This function is used to overwrite the configuration for GCF or other test modes
1272*
1273* PARAMETERS
1274* feature [IN] modem feature
1275* enabled [IN] feature is turned on or not
1276*
1277* RETURNS
1278* KAL_TRUE : if this feature is turned on
1279* KAL_FALSE : if this feature is turned off
1280*****************************************************************************/
1281extern kal_bool sbp_md_feature_overwrite(sbp_md_feature_enum feature, kal_bool enabled);
1282
1283/*****************************************************************************
1284* FUNCTION
1285* sbp_md_feature_data_overwrite()
1286*
1287* DESCRIPTION
1288* This function is used to overwrite the configuration for GCF or other test modes
1289*
1290* PARAMETERS
1291* feature [IN] modem feature
1292* value [IN] the value of the feature
1293*
1294* RETURNS
1295* the overwrited value for the feature
1296*****************************************************************************/
1297extern kal_uint8 sbp_md_feature_data_overwrite(sbp_md_feature_data_enum feature, kal_uint8 value);
1298
1299/*****************************************************************************
1300* FUNCTION
1301* sbp_reload_config()
1302*
1303* DESCRIPTION
1304* This function is used to reload SBP related feature/data configuration
1305* Please don't use this API if you don't get the permission from SBP FPM.
1306*
1307* PARAMETERS
1308* ps_id [IN] protocol ID
1309*
1310* RETURNS
1311* KAL_TRUE - success
1312* KAL_FALSE - failure
1313*
1314*****************************************************************************/
1315void sbp_reload_config();
1316
1317
1318/*****************************************************************************
1319 * FUNCTION
1320 * nvram_custom_config_sbp_by_model_id
1321 * DESCRIPTION
1322 * Set SBP features and data according to Model ID.
1323 * PARAMETERS
1324 * md_product_model_id [IN]
1325 * RETURNS
1326 * KAL_TRUE : Set SBP ID successfully
1327 * KAL_FALSE : Error happens when setting SBP ID
1328 *****************************************************************************/
1329extern kal_bool nvram_custom_config_sbp_by_model_id(kal_uint32 md_product_model_id);
1330
1331/*****************************************************************************
1332* FUNCTION
1333* sbp_update_custom_config_to_nvram
1334*
1335* DESCRIPTION
1336* This function updates sbp feature/data custom config to nvram
1337*
1338*
1339* PARAMETERS
1340* ps_id [IN] protocol ID
1341* is_erase [IN] reset the feature/data item or not
1342* RETURNS
1343* void
1344*
1345*****************************************************************************/
1346kal_bool sbp_update_custom_config_to_nvram(sbp_custom_config_struct *sbp_custom_config_ptr, kal_bool is_erase);
1347
1348/*****************************************************************************
1349* FUNCTION
1350* sbp_get_custom_config_nv_with_mcf
1351*
1352* DESCRIPTION
1353* This function reads NVRAM_EF_SBP_CUSTOM_MODEM_CONFIG_LID and applies MCF OTA by OP change
1354*
1355* PARAMETERS
1356* ps_id [IN] protocol ID
1357*
1358* RETURNS
1359* void
1360*
1361*****************************************************************************/
1362kal_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);
1363
1364/*****************************************************************************
1365* FUNCTION
1366* sbp_get_max_custom_config
1367*
1368* DESCRIPTION
1369* This function gets MAX custom config NV entries
1370*
1371* PARAMETERS
1372* [IN] N/A
1373* RETURNS
1374* void
1375*
1376*****************************************************************************/
1377kal_uint16 sbp_get_max_custom_config(void);
1378
1379/*****************************************************************************
1380* FUNCTION
1381* sbp_get_last_dsbp_sim_info()
1382*
1383* DESCRIPTION
1384* This function is used to get MCC/MNC/ICCID of last completed DSBP
1385* For mode2 device, this will include SIM info from last power up
1386* For mode1 device, only include SIM info in current sbp context
1387*
1388* PARAMETERS
1389* ps_id [IN] protocol ID
1390* param [IN] mcc, mnc, iccid
1391* RETURNS
1392* void
1393*
1394*****************************************************************************/
1395extern void sbp_get_last_dsbp_sim_info(protocol_id_enum ps_id, kal_uint8 *mcc, kal_uint8 *mnc, kal_uint8 *iccid);
1396
1397/*****************************************************************************
1398* FUNCTION
1399* sbp_get_last_mode2_dsbp_sim_info()
1400*
1401* DESCRIPTION
1402* This function is used to get SIM_SBP_ID/MCC/MNC/ICCID of last completed mode2 DSBP
1403* Can be used in DSBP callback function to compare with last mode2 DSBP result
1404* As part of mode2 design, this includes info from SIM insert of last power cycle
1405*
1406* PARAMETERS
1407* ps_id [IN] protocol ID
1408* param [IN] sim_sbp_id, mcc, mnc, iccid
1409* RETURNS
1410* void
1411*
1412*****************************************************************************/
1413extern 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);
1414
1415/*****************************************************************************
1416* FUNCTION
1417* sbp_get_dsbp_config()
1418*
1419* DESCRIPTION
1420* This function is used to get dsbp retry config
1421*
1422* PARAMETERS
1423* void
1424* RETURNS
1425* nvram_ef_sbp_dsbp_config_struct
1426*
1427*****************************************************************************/
1428extern nvram_ef_sbp_dsbp_config_struct* sbp_get_dsbp_config(void);
1429/*****************************************************************************
1430* FUNCTION
1431* nvram_custom_config_refresh_sbp_id_mapping_when_mcf_ota_start()
1432*
1433* DESCRIPTION
1434* This function is used to re-read NVRAM and update the globle custom sbp_id mapping table
1435* when MCF default OTA triggered.
1436*
1437* PARAMETERS
1438* void
1439* RETURNS
1440* void
1441*
1442*****************************************************************************/
1443extern void nvram_custom_config_refresh_sbp_id_mapping_when_mcf_ota_start(void);
1444
1445/*****************************************************************************
1446* FUNCTION
1447* sbp_get_custom_sbp_id_mapping_table
1448*
1449* DESCRIPTION
1450* This function is used to get the globle custom sbp_id mapping table
1451*
1452* PARAMETERS
1453* void
1454* RETURNS
1455* nvram_ef_sbp_custom_sbp_id_mapping_struct
1456*
1457*****************************************************************************/
1458extern nvram_ef_sbp_custom_sbp_id_mapping_struct* sbp_get_custom_sbp_id_mapping_table(void);
1459
1460/*****************************************************************************
1461* FUNCTION
1462* sbp_get_md_cxp_sbp_id
1463*
1464* DESCRIPTION
1465* This function is used to get trigger modem CXP (device) sbp_id
1466*
1467* PARAMETERS
1468* kal_uint32 sim_sbp_id
1469* RETURNS
1470* kal_uint32 md_cxp_sbp_id
1471*
1472*****************************************************************************/
1473extern kal_uint32 sbp_get_md_cxp_sbp_id(kal_uint32 sim_sbp_id);
1474
1475/*****************************************************************************
1476* FUNCTION
1477* sbp_set_md_cxp_sbp_id
1478*
1479* DESCRIPTION
1480* This function is used to add trigger modem CXP (device) sbp_id
1481*
1482* PARAMETERS
1483* kal_uint32 sbp_id
1484* RETURNS
1485*
1486*****************************************************************************/
1487extern void sbp_set_md_cxp_sbp_id(kal_uint32 sbp_id);
1488
1489#if defined (__TC01_NVRAM__) || defined(__TC01__) // __TC01_CUST_SBP__
1490/*****************************************************************************
1491* FUNCTION
1492* sbp_query_md_feature_custom()
1493*
1494* DESCRIPTION
1495* clone sbp_query_md_feature() for customer's SBP.
1496*
1497* PARAMETERS
1498* feature [IN] customer's modem feature
1499*
1500* RETURNS
1501* KAL_TRUE : if this feature is turned on
1502* KAL_FALSE : if this feature is turned off
1503*****************************************************************************/
1504extern kal_bool sbp_query_md_feature_custom(sbp_md_feature_custom_enum feature);
1505
1506/*****************************************************************************
1507* FUNCTION
1508* sbp_query_md_feature_by_ps_custom()
1509*
1510* DESCRIPTION
1511* clone sbp_query_md_feature_by_ps() for customer's SBP.
1512*
1513* PARAMETERS
1514* feature [IN] customer's modem feature
1515* ps_id [IN] PS ID
1516*
1517* RETURNS
1518* KAL_TRUE : if this feature is turned on
1519* KAL_FALSE : if this feature is turned off
1520*****************************************************************************/
1521extern kal_bool sbp_query_md_feature_by_ps_custom(sbp_md_feature_custom_enum feature, protocol_id_enum ps_id);
1522
1523/*****************************************************************************
1524* FUNCTION
1525* sbp_set_md_feature_custom()
1526*
1527* DESCRIPTION
1528* clone sbp_set_md_feature() for customer's SBP.
1529*
1530* PARAMETERS
1531* feature [IN] customer's modem feature
1532* is_turned_on [IN]
1533* sbp_feature_ptr [IN/OUT]
1534*
1535* RETURNS
1536* KAL_TRUE if success; otherwise KAL_FALSE
1537*****************************************************************************/
1538extern kal_bool sbp_set_md_feature_custom(sbp_md_feature_custom_enum feature,
1539 kal_bool is_turned_on,
1540 nvram_ef_sbp_modem_config_struct *sbp_feature_ptr);
1541
1542/*****************************************************************************
1543* FUNCTION
1544* sbp_set_md_feature_by_ps_custom()
1545*
1546* DESCRIPTION
1547* clone sbp_set_md_feature_by_ps() for customer's SBP.
1548*
1549* PARAMETERS
1550* feature [IN] customer's modem feature
1551* is_turned_on [IN]
1552* sbp_feature_ptr [IN/OUT]
1553*
1554* RETURNS
1555* KAL_TRUE if success; otherwise KAL_FALSE
1556*****************************************************************************/
1557extern kal_bool sbp_set_md_feature_by_ps_custom(sbp_md_feature_custom_enum feature,
1558 kal_bool is_turned_on,
1559 protocol_id_enum ps_id);
1560
1561/*****************************************************************************
1562* FUNCTION
1563* sbp_general_set_md_feature_custom()
1564*
1565* DESCRIPTION
1566* clone sbp_general_set_md_feature() for customer's SBP.
1567*
1568* PARAMETERS
1569* feature [IN] customer's modem feature
1570* is_turned_on [IN]
1571*
1572* RETURNS
1573* KAL_TRUE if success; otherwise KAL_FALSE
1574*****************************************************************************/
1575extern kal_bool sbp_general_set_md_feature_custom(sbp_md_feature_custom_enum feature, kal_bool is_turned_on);
1576
1577/*****************************************************************************
1578* FUNCTION
1579* sbp_update_features_to_nvram_custom()
1580*
1581* DESCRIPTION
1582* clone sbp_update_features_to_nvram() for customer's SBP.
1583*
1584* PARAMETERS
1585* ps_id [IN] protocol ID
1586*
1587* RETURNS
1588* KAL_TRUE - success
1589* KAL_FALSE - failure
1590*
1591*****************************************************************************/
1592extern kal_bool sbp_update_features_to_nvram_custom();
1593
1594
1595/*****************************************************************************
1596 * FUNCTION
1597* sbp_get_sbp_feature_raw_config_custom()
1598*
1599* DESCRIPTION
1600* clone sbp_get_sbp_feature_raw_config() for customer's SBP.
1601*
1602* PARAMETERS
1603* ps_id [IN] protocol ID
1604*
1605* RETURNS
1606* KAL_TRUE - success
1607* KAL_FALSE - failure
1608*
1609*****************************************************************************/
1610extern kal_bool sbp_get_sbp_feature_raw_config_custom(protocol_id_enum ps_id, kal_uint8 *raw_config);
1611
1612/*****************************************************************************
1613* FUNCTION
1614* sbp_set_sbp_feature_raw_config_custom()
1615*
1616* DESCRIPTION
1617* clone sbp_set_sbp_feature_raw_config() for customer's SBP.
1618*
1619* PARAMETERS
1620* ps_id [IN] protocol ID
1621*
1622* RETURNS
1623* KAL_TRUE - success
1624* KAL_FALSE - failure
1625*
1626*****************************************************************************/
1627extern void sbp_set_sbp_feature_raw_config_custom(protocol_id_enum ps_id, kal_uint8 *raw_config);
1628#endif /* (__TC01_NVRAM__) || defined(__TC01__) */
1629
1630#ifdef __IPC_ADAPTER__
1631/*****************************************************************************
1632* FUNCTION
1633* sbp_get_salecode()
1634*
1635* DESCRIPTION
1636* This function is used to get salecode of this ps_id
1637* If network code is present, network code is given
1638* otherwise, csc_salecode is given
1639*
1640* PARAMETERS
1641* ps_id [IN] protocol ID
1642* param [IN] salecode
1643* RETURNS
1644* void
1645*
1646*****************************************************************************/
1647extern void sbp_get_salecode(kal_char *salecode, protocol_id_enum ps_id);
1648extern void sbp_get_csc_salecode(kal_char *salecode);
1649extern void sbp_get_network_code_salecode(kal_char *salecode, protocol_id_enum ps_id);
1650#endif /* __IPC_ADAPTER__ */
1651
1652#ifdef __cplusplus
1653}
1654#endif
1655
1656#endif /* _SBP_PUBLIC_UTILITY_H */
1657