yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame^] | 1 | /************************************************************* |
| 2 | * |
| 3 | * This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc. |
| 4 | * |
| 5 | * Any unauthorized use inconsistent with the terms of such license is strictly prohibited. |
| 6 | * |
| 7 | * Copyright (c) 1999-2010 VIA Telecom, Inc. All rights reserved. |
| 8 | * |
| 9 | *************************************************************/ |
| 10 | /**************************************************************************** |
| 11 | * |
| 12 | * Module: prefroam.h |
| 13 | * |
| 14 | * Purpose: Definitions for Preferred Roamer List updates from OTASP. |
| 15 | * |
| 16 | * SNR 7/19/00 Updated the purpose: removed the 'NAM updates' |
| 17 | * see Rev 1.2 comments |
| 18 | * |
| 19 | **************************************************************************** |
| 20 | * |
| 21 | * PVCS Header Information |
| 22 | * |
| 23 | * $Workfile$ |
| 24 | * $Revision: 1.4 $ |
| 25 | * $Modtime$ |
| 26 | * $Author: mclee $ |
| 27 | * |
| 28 | * $Log: PREFROAM.H $ |
| 29 | * |
| 30 | * 06 29 2017 sue.zhong |
| 31 | * [MOLY00259241] [6293][C2K]Replace with KAL data type |
| 32 | * ::KAL type - folder inc |
| 33 | * |
| 34 | * 05 18 2017 qiming.li |
| 35 | * [MOLY00246713][UMOLYA] CSS Traces Re-organization and Re-format |
| 36 | * |
| 37 | * 05 17 2017 peijun.zheng |
| 38 | * [MOLY00249027] [BIACNO][MT6763][New feature]C2K code release code modification |
| 39 | * |
| 40 | * C2k code release. |
| 41 | * |
| 42 | * 02 10 2017 jiayong.zhang |
| 43 | * [MOLY00221596] [Gen93] L4 Integration M1 check in |
| 44 | * |
| 45 | * . |
| 46 | * Revision 1.4 2006/03/29 12:13:26 mclee |
| 47 | * - Add _ResetOosaCounters() prototype. |
| 48 | * Revision 1.3 2005/03/18 10:24:43 bcolford |
| 49 | * CBP4.05 [4.21] to CBP6.1 [2.9.0] CP Software Merge. |
| 50 | * Revision 1.3 2004/12/01 08:26:21 mclee |
| 51 | * Merged up to CP 12.0.2 changes from CBP 4.0 into the CBP 4.05 baseline. Add #define CURRENT_SYSTEM 15. |
| 52 | * Revision 1.2 2004/08/13 10:05:44 agontar |
| 53 | * Removed T53 flag; added support for BC3; cleaned up logs |
| 54 | * Revision 1.2 2004/03/25 12:08:58 fpeng |
| 55 | * Updated from 6.0 CP 2.5.0 |
| 56 | * Revision 1.2 2004/02/10 12:50:13 bcolford |
| 57 | * Merged CBP4.0 Release 8.05.0 changes. |
| 58 | * Revision 1.9 2003/11/06 11:34:18 ameya |
| 59 | * Added new indications to enter CSS, changed function names of cssCpUnpackPrl() and cssCpValidateSystem(). Also added prototypes for cssCpRedirectionEndTimeout() and cssCpMorePrefScanTimeout(). |
| 60 | * Revision 1.8 2002/07/31 17:22:35 hans |
| 61 | * A, B and C frequency block added for Band Class 4 (cr726). |
| 62 | * Revision 1.7 2002/06/06 13:14:15 chinh |
| 63 | * Changed and Added Copyright |
| 64 | * Revision 1.6 2002/02/25 08:47:35 AMALA |
| 65 | * Corrected SS Re-Scan errors. |
| 66 | * Revision 1.5 2002/01/10 17:11:06 AMALA |
| 67 | * Added emergency mode processing for new system selection. |
| 68 | * Revision 1.4 2002/01/02 10:08:52 AMALA |
| 69 | * Added new system selection changes. |
| 70 | * Added system re-scan functionality. |
| 71 | * Revision 1.3 2001/11/08 12:20:50 AMALA |
| 72 | * Deleted compiler switch SYS_SEL_1_CBP3_MERGE & |
| 73 | * associated non-compiled code. |
| 74 | * Revision 1.2 2001/09/17 14:10:54 AMALA |
| 75 | * CBP3 System Selection port |
| 76 | * Revision 1.1 2001/01/17 10:59:14 plabarbe |
| 77 | * Initial revision |
| 78 | * Revision 1.1 2000/10/24 14:11:24 fpeng |
| 79 | * Initial revision |
| 80 | * Revision 1.4 2000/09/23 02:38:24Z rnookala |
| 81 | * removed function prototype unpackSspr |
| 82 | * Revision 1.3 2000/08/23 22:10:14Z RSATTARI |
| 83 | * Isotel release 2.8 plus LSI applicable IS-95B changes. |
| 84 | * Revision 1.3 2000/02/18 23:03:59 gfrye |
| 85 | * Added defines for PRL_HEADER_SIZE and PRL_CRC_SIZE. |
| 86 | * |
| 87 | * Revision 1.2 2000/01/21 22:08:46 gfrye |
| 88 | * Moved NAM parameters structures to wbios.h. |
| 89 | * Added channel list and acquisition record list structures to help |
| 90 | * separate "geo scan" list from initial power-up scan list. |
| 91 | * |
| 92 | * Revision 1.1 1999/12/09 23:02:44 gfrye |
| 93 | * Initial revision |
| 94 | * |
| 95 | * |
| 96 | **************************************************************************** |
| 97 | ****************************************************************************/ |
| 98 | |
| 99 | #ifndef PREFROAM_H |
| 100 | #define PREFROAM_H |
| 101 | |
| 102 | /***************************************************************************** |
| 103 | * Includes |
| 104 | ****************************************************************************/ |
| 105 | #include "cssapi.h" |
| 106 | #include "pswnam.h" |
| 107 | |
| 108 | /***************************************************************************** |
| 109 | * Definitions |
| 110 | ****************************************************************************/ |
| 111 | |
| 112 | /* Cellular System types */ |
| 113 | #define CP_SYSTEM_CDMA 1 /* Band 0 CDMA */ |
| 114 | #define CP_SYSTEM_ANALOG 2 /* Band 0 Analog */ |
| 115 | #define CP_SYSTEM_UNKNOWN 3 |
| 116 | |
| 117 | /* max times to attempt CDMA acquisition from CDMA Available indication */ |
| 118 | /* from Analog mode */ |
| 119 | #define CP_SELECT_MAX_CDMA_AVAIL_TRIES 5 |
| 120 | |
| 121 | /* Call Processing system determination indications */ |
| 122 | /* NOTE: If this list is changed, please update enum CssIndicationId in ps_trace.txt */ |
| 123 | |
| 124 | |
| 125 | /* NOTE: If this list is changed, please update enum CssIndicationId in css_trace.txt */ |
| 126 | |
| 127 | /* system selection codes, see Table 1.4-1: System Selection Codes in 3GPP2 C.S0057-D v1.0 */ |
| 128 | |
| 129 | #define BC0_A 0 |
| 130 | #define BC0_B 1 |
| 131 | |
| 132 | #define BC1_A 2 |
| 133 | #define BC1_B 3 |
| 134 | #define BC1_C 4 |
| 135 | #define BC1_D 5 |
| 136 | #define BC1_E 6 |
| 137 | #define BC1_F 7 |
| 138 | |
| 139 | #define BC2_A 8 |
| 140 | #define BC2_B 9 |
| 141 | |
| 142 | /* Band Class 3: 830 to 925 MHz JTACS */ |
| 143 | #define BC3_A 10 |
| 144 | #define BC3_B 11 |
| 145 | |
| 146 | #define BC4_A 12 |
| 147 | #define BC4_B 13 |
| 148 | #define BC4_C 14 |
| 149 | |
| 150 | #define BC5_A 15 |
| 151 | #define BC5_B 16 |
| 152 | #define BC5_C 17 |
| 153 | #define BC5_D 18 |
| 154 | #define BC5_E 19 |
| 155 | #define BC5_F 20 |
| 156 | #define BC5_G 21 |
| 157 | #define BC5_H 22 |
| 158 | |
| 159 | /* Band Class 6: 2GHz */ |
| 160 | #define BC6_A 23 |
| 161 | |
| 162 | /* 3GPP2 C.S0057-D v1.0: Band Class 7: only C block is valid, with code=24 */ |
| 163 | #define BC7_C 24 |
| 164 | |
| 165 | #define BC19_A 25 |
| 166 | #define BC19_B 26 |
| 167 | #define BC19_C 27 |
| 168 | |
| 169 | #define BC8_A 28 |
| 170 | |
| 171 | #define BC9_A 29 |
| 172 | |
| 173 | #define BC10_A 30 |
| 174 | #define BC10_B 31 |
| 175 | #define BC10_C 32 |
| 176 | #define BC10_D 33 |
| 177 | #define BC10_E 34 |
| 178 | |
| 179 | #define BC11_A 35 |
| 180 | #define BC11_B 36 |
| 181 | #define BC11_C 37 |
| 182 | #define BC11_D 38 |
| 183 | #define BC11_E 39 |
| 184 | #define BC11_F 40 |
| 185 | |
| 186 | #define BC12_A 41 |
| 187 | #define BC12_B 42 |
| 188 | |
| 189 | #define BC13_A 43 |
| 190 | #define BC13_B 44 |
| 191 | #define BC13_C 45 |
| 192 | #define BC13_D 46 |
| 193 | #define BC13_E 47 |
| 194 | #define BC13_F 48 |
| 195 | #define BC13_G 49 |
| 196 | #define BC13_H 50 |
| 197 | #define BC13_I 51 |
| 198 | #define BC13_J 52 |
| 199 | #define BC13_K 53 |
| 200 | #define BC13_L 54 |
| 201 | #define BC13_M 55 |
| 202 | #define BC13_N 56 |
| 203 | |
| 204 | #define BC14_A 2 |
| 205 | #define BC14_B 3 |
| 206 | #define BC14_C 4 |
| 207 | #define BC14_D 5 |
| 208 | #define BC14_E 6 |
| 209 | #define BC14_F 7 |
| 210 | #define BC14_G 57 |
| 211 | |
| 212 | #define BC15_A 58 |
| 213 | #define BC15_B 59 |
| 214 | #define BC15_C 60 |
| 215 | #define BC15_D 61 |
| 216 | #define BC15_E 62 |
| 217 | #define BC15_F 63 |
| 218 | |
| 219 | #define BC16_A 64 |
| 220 | #define BC16_B 65 |
| 221 | #define BC16_C 66 |
| 222 | #define BC16_D 67 |
| 223 | |
| 224 | #define BC18_D 68 |
| 225 | #define BC18_PSB 69 |
| 226 | |
| 227 | #define BC20_A 70 |
| 228 | |
| 229 | |
| 230 | /* Used if desired system is unknown for OTASP "*228" */ |
| 231 | #define CURRENT_SYSTEM 100 |
| 232 | #define OTASP_NO_SYSTEM 255 |
| 233 | |
| 234 | /* field widths, see IS-683-A, section 3.5.3 */ |
| 235 | #define PR_LIST_SIZE_WIDTH 16 |
| 236 | #define PR_LIST_ID_WIDTH 16 |
| 237 | #define CUR_SSPR_P_REV_WIDTH 8 /*as define in C.S0016.C for Extened PRL*/ |
| 238 | #define PREF_ONLY_WIDTH 1 |
| 239 | #define DEF_ROAM_IND_WIDTH 8 |
| 240 | #define NUM_ACQ_RECS_WIDTH 9 |
| 241 | #define NUM_COMMOM_SUBNET_REC_WIDTH 9 /*as define in C.S0016.C for Extened PRL*/ |
| 242 | #define NUM_SYS_RECS_WIDTH 14 |
| 243 | #define PRL_CRC_WIDTH 16 |
| 244 | /* -- |
| 245 | * 64 / 8 = 8 bytes */ |
| 246 | #define PRL_HEADER_SIZE 8 |
| 247 | #define PRL_CRC_SIZE 2 |
| 248 | |
| 249 | /* acquisition record fields */ |
| 250 | #define ACQ_TYPE_WIDTH 4 |
| 251 | #define EXT_ACQ_TYPE_WIDTH 8 |
| 252 | #define EXT_ACQ_LENGTH_WIDTH 8 /*as define in C.S0016.C for Extened PRL*/ |
| 253 | #define SYSTEM_A_B_WIDTH 2 |
| 254 | #define SYSTEM_PRI_SEC_WIDTH 2 |
| 255 | #define NUM_CHANS_WIDTH 5 |
| 256 | #define BAND_WIDTH 5 |
| 257 | #define CHANNEL_WIDTH 11 |
| 258 | #define NUM_BLOCKS_WIDTH 3 |
| 259 | #define FREQ_BLOCK_WIDTH 3 |
| 260 | |
| 261 | #define SUBNET_COMMON_LENGTH_WIDTH 4 |
| 262 | |
| 263 | /* system record fields */ |
| 264 | #define SID_WIDTH 15 |
| 265 | #define NID_INCL_WIDTH 2 |
| 266 | #define NID_WIDTH 16 /* optional */ |
| 267 | #define PREF_NEG_WIDTH 1 |
| 268 | #define GEO_WIDTH 1 |
| 269 | #define PRIORITY_WIDTH 1 /* optional */ |
| 270 | #define ACQ_INDEX_WIDTH 9 |
| 271 | #define ROAM_IND_WIDTH 8 /* optional */ |
| 272 | #define SYS_RECORD_LEN_WIDTH 5 |
| 273 | #define SYS_RECORD_TYPE_WIDTH 4 |
| 274 | #define SUBNET_COMM_INC_WIDTH 1 |
| 275 | #define SUBNET_LSB_LEN_WIDTH 7 |
| 276 | #define SUBNET_COMM_OFFSET_WIDTH 12 |
| 277 | #define ASSOCIATION_INC_WIDTH 1 |
| 278 | #define ASSOCIATION_TAG_WIDTH 8 |
| 279 | #define PN_ASSOCIATION_WIDTH 1 |
| 280 | #define DATA_ASSOCIATION_WIDTH 1 |
| 281 | #define SUBTYPE_WIDTH 3 |
| 282 | #define MCC_WIDTH 12 |
| 283 | #define MNC_WIDTH 12 |
| 284 | #define NUM_SID_WIDTH 4 |
| 285 | #define MCC_OFFSET_WIDTH 4 |
| 286 | #define NUM_SID_NID_WIDTH 4 |
| 287 | #define NUM_SUBNET_WIDTH 4 |
| 288 | #define NUM_SUBNET_LEN_WIDTH 8 |
| 289 | #define MCC_SID_WIDTH 16 |
| 290 | #define MCC_NID_WIDTH 16 |
| 291 | #define SUBNET_OFFSET_WIDTH 4 |
| 292 | |
| 293 | /* values for NID_INCL */ |
| 294 | #define NID_ALL_ONES 0 |
| 295 | #define NID_INCLUDED 1 |
| 296 | #define NID_ALL_ZEROS 2 |
| 297 | |
| 298 | /* special values for nid */ |
| 299 | #define NID_WILDCARD 0xFFFF |
| 300 | #define NID_PUBLIC 0x0000 |
| 301 | |
| 302 | #define SID_WILDCARD 0x0000 /* 0x0 means wildcard SID for PRL */ |
| 303 | #ifdef MTK_CBP |
| 304 | /* NAM home SID not programmed requirement in Verzion Reqs-ERI */ |
| 305 | #define SID_NOT_PROGRAMMED 0x0000 /* 0x0 means not programmed SID for home SID */ |
| 306 | |
| 307 | #define MCC_INVALID 0xFFFF |
| 308 | #define MNC_INVALID 0xFF |
| 309 | #endif |
| 310 | |
| 311 | /* values for block, see table 3.5.5.2.1.5-1 */ |
| 312 | #define PCS_BLOCK_A 0 |
| 313 | #define PCS_BLOCK_B 1 |
| 314 | #define PCS_BLOCK_C 2 |
| 315 | #define PCS_BLOCK_D 3 |
| 316 | #define PCS_BLOCK_E 4 |
| 317 | #define PCS_BLOCK_F 5 |
| 318 | #define PCS_BLOCK_ANY 7 |
| 319 | |
| 320 | |
| 321 | /**************************************************************************** |
| 322 | * PE => SSPR Interface Function Prototypes |
| 323 | ****************************************************************************/ |
| 324 | PRL_HEADER* cssCpGetPrlInfo(NamNumber namNumber); |
| 325 | void cssCpEmergencyCallbackModeTimeout(void); |
| 326 | void cssCpRescanTimeout(void); |
| 327 | kal_bool cssCpRescanEnabled(void); |
| 328 | void cssCpRedirectionEndTimeout(void); |
| 329 | void cssCpMorePrefScanTimeout(void); |
| 330 | void cssCpEprlEspmWaitTimeout(void); |
| 331 | |
| 332 | |
| 333 | /***************************************************************************** |
| 334 | * System Re-Direction Prototypes |
| 335 | ****************************************************************************/ |
| 336 | |
| 337 | void cpSystemSelectionReset(void); |
| 338 | void cpSetRedirectionStatus(kal_bool status); |
| 339 | kal_uint16 cpGetAnalogRedirectionSid(void); |
| 340 | kal_uint16 cpGetRedirectionSid(void); |
| 341 | kal_uint16 cpGetRedirectionNid(void); |
| 342 | kal_bool cpGetRedirectionIgnoreCDMA(void); |
| 343 | kal_bool cpIsReturnIfFail(void); |
| 344 | void cssCpCustomSystemSelection(void); |
| 345 | |
| 346 | void namUpdate(kal_uint8 whatsChanged); |
| 347 | void _ResetOosaCounters(void); |
| 348 | |
| 349 | #endif /* PREFROAM_H */ |