yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame^] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2007 |
| 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 | * scsi.h |
| 39 | * |
| 40 | * Project: |
| 41 | * -------------------------------------------------------- |
| 42 | * MONZA |
| 43 | * |
| 44 | * Description: |
| 45 | * -------------------------------------------------------- |
| 46 | * Implementation of Scsi class. |
| 47 | * |
| 48 | * Author: |
| 49 | * -------------------------------------------------------- |
| 50 | * ------- |
| 51 | * |
| 52 | * -------------------------------------------------------- |
| 53 | * $Log$ |
| 54 | * |
| 55 | * 10 22 2021 peter.chiang |
| 56 | * [MOLY00624048] [AT&T] CDR-FVG-3900 FirstNet-5G Device Radio Requirements - Phase 1b |
| 57 | * |
| 58 | * [SCSI] disable N5 |
| 59 | * |
| 60 | * 09 28 2020 esko.oikarinen |
| 61 | * [MOLY00557246] [P200803-00845] [MTK][5G][A326B] AT+EPBSEH ?í??´í? ue capa info ?? nr41,79 ?¬ë¼ê°??? ?ì? |
| 62 | * |
| 63 | * 06 14 2019 harish.reddy |
| 64 | * [MOLY00413294] [CODE SYNC] ?TOP??NL-BD236??FT??T-Mobile??Free_test?Manual search and register KPN 4G?appear modemCrash?3/5? |
| 65 | * |
| 66 | * 05 22 2019 vinayak.bandagi |
| 67 | * [MOLY00400913] [CODE SYNC][MH4ATT_P][Protocol][10776] cannot find 348-300-3G(1900) during LTE-BTR-1-1150 |
| 68 | * |
| 69 | * 03 07 2019 shreya.raizada |
| 70 | * [MOLY00367497] [CODE SYNC] [MT3967][Eiger][O1][MD Static Test][CMW Cards][China][Auto] Incorrect UTRAN FDD bands are filled in the utra UE-CapabilityRAT-Container |
| 71 | * . |
| 72 | * |
| 73 | * 11 29 2018 peter.chiang |
| 74 | * [MOLY00366835] [Gen97] Dedicated Priority and Deprioritization SCSI Interface Change |
| 75 | * SCSI interface changes for NR |
| 76 | * |
| 77 | * 10 31 2018 vend_mtb_aritha002 |
| 78 | * [MOLY00361478] [Gen97] Gemini Compile Option Clean Up |
| 79 | * |
| 80 | * Compile Option change for __GEMINI_MONITOR_PAGE_DURING_TRANSFER__ , __GEMINI_PREEMPT_PEER_SERVICE__ , __REMOTE_SIM__ and __PLMN_LIST_IN_VIRTUAL_MODE__ |
| 81 | * |
| 82 | * 08 29 2018 peter.chiang |
| 83 | * [MOLY00348756] [VMOLY]SCSI Patchback |
| 84 | * . |
| 85 | * |
| 86 | * 08 28 2018 peter.chiang |
| 87 | * [MOLY00348756] [VMOLY]SCSI Patchback |
| 88 | * [SCSI] patchback for NR supportband Bitmask |
| 89 | * |
| 90 | * 12 14 2017 vend_mtb_aritha001 |
| 91 | * [MOLY00296081] [OPPO_FT][1151630] DUT fail to show own ( Vodafone 3G) RAT during MPLMN search for Vodafone operator. |
| 92 | * ALPS03622290 [[1155800]?17310-IN??FT-Free_Test? Observed DUT fails to show IDEA(3G) RAT while performing PLMN on Airtel operator when mode set as LWG(Auto).] |
| 93 | * |
| 94 | * 04 12 2017 rajasekhar.gade |
| 95 | * [MOLY00240270] [6293][Gemini][T+W] Phase 1: Common Interface Changes Check in |
| 96 | * |
| 97 | * . |
| 98 | * |
| 99 | * 01 06 2017 rajasekhar.gade |
| 100 | * [MOLY00215599] [B160916-164]?1??+?2????1?????????????1????2????,??2???2G |
| 101 | * |
| 102 | * . |
| 103 | * |
| 104 | * 10 24 2016 vend_mtb_mobiveil003 |
| 105 | * [MOLY00209293] Band 66 support |
| 106 | * Band 66 support |
| 107 | * |
| 108 | * 07 09 2015 peter.chiang |
| 109 | * [MOLY00125851] SCSI compile warning remove and index bug fix |
| 110 | * remove compile warning and fix index error of SCSI |
| 111 | * |
| 112 | * 06 01 2015 henry.lai |
| 113 | * [MOLY00092508] [MT6291][LTE-C2K] AS Inter RAT feature |
| 114 | * . |
| 115 | * |
| 116 | * 05 20 2015 nicky.chou |
| 117 | * [MOLY00089131] [MT6291 Gemini] L+W+W+W code revision check in |
| 118 | * . |
| 119 | * |
| 120 | * 04 14 2015 nicky.chou |
| 121 | * [MOLY00106888] [USIME]FDD/TDD set band problem when init |
| 122 | * . |
| 123 | * |
| 124 | * 12 11 2014 nicky.chou |
| 125 | * [MOLY00084935] [SCSI][LCSCE] sync to UMOLY from MT6291_DEV |
| 126 | * . |
| 127 | * |
| 128 | * 11 19 2014 nicky.chou |
| 129 | * [MOLY00084935] [SCSI][LCSCE] sync to UMOLY from MT6291_DEV |
| 130 | * . |
| 131 | * |
| 132 | * 06 04 2014 nicky.chou |
| 133 | * [MOLY00067600] [CMCC][CSFB] 5.2.1 HZ FT workaournd - add scsi GSMLatestServingCell for 4G measurement |
| 134 | * . |
| 135 | * |
| 136 | * 12 20 2013 nicky.chou |
| 137 | * [MOLY00050587] [SCSI][Gemini] remove APIs without sim_index |
| 138 | * . |
| 139 | * |
| 140 | * 11 21 2013 nicky.chou |
| 141 | * [MOLY00045854] [PS1267 HG+WG] Check-in Gemini HG+WG modification |
| 142 | * . |
| 143 | * |
| 144 | * 04 09 2013 nicky.chou |
| 145 | * [MOLY00011685] [CSE][SCSI][USIME] UMTS Band Priority Search |
| 146 | * . |
| 147 | * |
| 148 | * 03 14 2013 nicky.chou |
| 149 | * [MOLY00009229] [CSE][SCSI] Merge Multimode modification back to MOLY |
| 150 | * . |
| 151 | * |
| 152 | * 01 23 2013 nicky.chou |
| 153 | * [MOLY00009229] [CSE][SCSI] Merge Multimode modification back to MOLY |
| 154 | * . |
| 155 | * |
| 156 | * 09 26 2012 ye.yuan |
| 157 | * [MOLY00004173] [3G TDD][CISE]R9 code merge back to MOLY |
| 158 | * CSCE CODE Interface part . |
| 159 | * |
| 160 | * 07 02 2012 nicky.chou |
| 161 | * [MOLY00000149] [SCSI][CSE][USIME][MEME] Performance optimization for Auto-Band & Stored Info Freq List |
| 162 | * . |
| 163 | * |
| 164 | * 04 16 2012 nicky.chou |
| 165 | * removed! |
| 166 | * . |
| 167 | * |
| 168 | * 01 15 2012 nicky.chou |
| 169 | * removed! |
| 170 | * . |
| 171 | * |
| 172 | * 11 08 2011 nicky.chou |
| 173 | * removed! |
| 174 | * . |
| 175 | * |
| 176 | * 05 31 2011 nicky.chou |
| 177 | * removed! |
| 178 | * . |
| 179 | * |
| 180 | * 12 14 2010 nicky.chou |
| 181 | * removed! |
| 182 | * . |
| 183 | * |
| 184 | * removed! |
| 185 | * removed! |
| 186 | * |
| 187 | * |
| 188 | * removed! |
| 189 | * removed! |
| 190 | * |
| 191 | * |
| 192 | * removed! |
| 193 | * removed! |
| 194 | * |
| 195 | * |
| 196 | * removed! |
| 197 | * removed! |
| 198 | * |
| 199 | * |
| 200 | * removed! |
| 201 | * removed! |
| 202 | * |
| 203 | * |
| 204 | * removed! |
| 205 | * removed! |
| 206 | * |
| 207 | * |
| 208 | * removed! |
| 209 | * removed! |
| 210 | * |
| 211 | * |
| 212 | * removed! |
| 213 | * removed! |
| 214 | * |
| 215 | * |
| 216 | * removed! |
| 217 | * removed! |
| 218 | * |
| 219 | * |
| 220 | * removed! |
| 221 | * removed! |
| 222 | * |
| 223 | * |
| 224 | * removed! |
| 225 | * removed! |
| 226 | * |
| 227 | * |
| 228 | * removed! |
| 229 | * removed! |
| 230 | * UARFCN validation function refactor (from URR to SCSI) |
| 231 | * |
| 232 | * removed! |
| 233 | * removed! |
| 234 | * |
| 235 | * |
| 236 | * removed! |
| 237 | * removed! |
| 238 | * |
| 239 | * |
| 240 | * removed! |
| 241 | * removed! |
| 242 | * add to source control recursely |
| 243 | * |
| 244 | * removed! |
| 245 | * removed! |
| 246 | * Add copyright header. |
| 247 | * |
| 248 | * removed! |
| 249 | * removed! |
| 250 | * add to source control recursely |
| 251 | * |
| 252 | * removed! |
| 253 | * removed! |
| 254 | * |
| 255 | * |
| 256 | * removed! |
| 257 | * removed! |
| 258 | * |
| 259 | * |
| 260 | * removed! |
| 261 | * removed! |
| 262 | * |
| 263 | * |
| 264 | * removed! |
| 265 | * removed! |
| 266 | * |
| 267 | * |
| 268 | * removed! |
| 269 | * removed! |
| 270 | * |
| 271 | * |
| 272 | * removed! |
| 273 | * removed! |
| 274 | * |
| 275 | * |
| 276 | * removed! |
| 277 | * removed! |
| 278 | * |
| 279 | * |
| 280 | *****************************************************************************/ |
| 281 | /** |
| 282 | * scsi.h |
| 283 | * |
| 284 | * # @COPYLEFT 2005 Jethro E. Lee |
| 285 | * ALL WRONGS RESERVED |
| 286 | * |
| 287 | * [Useage] |
| 288 | * |
| 289 | * [SYNOPSIS] |
| 290 | * |
| 291 | * [Example] |
| 292 | */ |
| 293 | |
| 294 | #ifndef __SCSI_H__ /* _(!@$ `scsi.h' $@!)_ */ |
| 295 | #define __SCSI_H__ |
| 296 | |
| 297 | /* Nicky 20101008: include header files for redundant header file removal */ |
| 298 | #include "kal_general_types.h" |
| 299 | #include "scsi_asn.h" |
| 300 | #include "csi_asn.h" |
| 301 | #include "mcd_l3_inc_struct.h" |
| 302 | #ifdef __GSM_RAT__ |
| 303 | #include "csi_gsm_asn.h" |
| 304 | #endif |
| 305 | #ifdef __UMTS_RAT__ |
| 306 | #include "csi_umts_asn.h" |
| 307 | #endif |
| 308 | #ifdef __LTE_RAT__ |
| 309 | #include "csi_lte_asn.h" |
| 310 | #endif |
| 311 | |
| 312 | |
| 313 | #define SCSI_SIM_EF_LOCI_LEN (11) |
| 314 | #define SCSI_USIM_EF_LOCI_LEN (11) |
| 315 | #define SCSI_USIM_EF_PSLOCI_LEN (14) |
| 316 | |
| 317 | /** |
| 318 | * UTRAN Absolute Radio Frequency Channel Number |
| 319 | * |
| 320 | * UTRAFDD is designed to operatein either of the |
| 321 | * following paired bands: |
| 322 | * 1920-1980 MHz Uplink |
| 323 | * 2110-2170 MHz Downlink |
| 324 | * |
| 325 | * UARFCN Uplink: 9612- 9888 |
| 326 | * UARFCN Downlink: 10562-10838 |
| 327 | */ |
| 328 | #ifdef __LTE_RAT__ |
| 329 | #define SCSI_MAX_EARFCN (262143) |
| 330 | #endif /* __LTE_RAT__ */ |
| 331 | #define SCSI_MAX_UARFCN (16383) |
| 332 | #define SCSI_PRIMARY_SCRAMBLING_CODE_MAX (511) //UMTS FDD |
| 333 | #define SCSI_CELL_PARAMETERS_ID_MAX (127) //UMTS TDD |
| 334 | |
| 335 | /* Clause 2 of SPEC 05.05 */ |
| 336 | #define SCSI_MAX_GSM_ARFCN (1024) |
| 337 | |
| 338 | #define SCSI_GSM_CELL_INFORMATION_TAG (0xA0) |
| 339 | #define SCSI_FDD_CELL_INFORMATION_TAG (0xA1) |
| 340 | #define SCSI_TDD_CELL_INFORMATION_TAG (0xA2) |
| 341 | #define SCSI_GSM_CAMPED_BCCH_FREQUENCY_TAG (0x80) |
| 342 | #define SCSI_GSM_NEIGHBOUR_BCCH_FREQUENCY_TAG (0x81) |
| 343 | #define SCSI_INTRA_FREQUENCY_INFORMATION_TAG (0x80) |
| 344 | #define SCSI_INTER_FREQUENCY_INFORMATION_TAG (0x81) |
| 345 | #define SCSI_UNITIALIZED_USIM_DATA (0xFF) |
| 346 | |
| 347 | typedef enum { |
| 348 | SCSI_SIM1 = 0, |
| 349 | SCSI_SIM2, |
| 350 | SCSI_SIM3, |
| 351 | SCSI_SIM4, |
| 352 | SCSI_SIM_INVALID |
| 353 | }SCSI_SIM_INDEX; |
| 354 | |
| 355 | #ifdef __UMTS_RAT__ |
| 356 | |
| 357 | /** |
| 358 | * Lucien Huang 20081218: |
| 359 | * Please be sure that the following definition shall be matched with |
| 360 | * those in rrc_utils.h (same definition could be seen there) |
| 361 | **/ |
| 362 | |
| 363 | #define SCSI_TOTAL_NUMBER_OF_UMTS_FDD_BAND_DEFINED (26) |
| 364 | #define SCSI_TOTAL_NUMBER_OF_UMTS_TDD_BAND_DEFINED (6) |
| 365 | #define SCSI_TOTAL_NUMBER_OF_UMTS_BAND_DEFINED ((SCSI_TOTAL_NUMBER_OF_UMTS_FDD_BAND_DEFINED>SCSI_TOTAL_NUMBER_OF_UMTS_TDD_BAND_DEFINED)? SCSI_TOTAL_NUMBER_OF_UMTS_FDD_BAND_DEFINED: SCSI_TOTAL_NUMBER_OF_UMTS_TDD_BAND_DEFINED) |
| 366 | |
| 367 | #define SCSI_MAX_NUM_OF_UMTS_BAND_SUPPORTED (26) |
| 368 | #define SCSI_MAX_NUM_OF_UMTS_BAND_ADDITION_INFO (11) /* For UMTS FDD BAND V(Num:6) and XXVI(Num:11) */ |
| 369 | |
| 370 | enum SCSI_UMTS_BAND_UARFCN_IDENTIFIER_TAG |
| 371 | { |
| 372 | SCSI_UMTS_FDD_UARFCN_BAND_I_Identifier = 0, |
| 373 | SCSI_UMTS_FDD_UARFCN_BAND_II_Identifier, |
| 374 | SCSI_UMTS_FDD_UARFCN_BAND_III_Identifier, |
| 375 | SCSI_UMTS_FDD_UARFCN_BAND_IV_Identifier, |
| 376 | SCSI_UMTS_FDD_UARFCN_BAND_V_Identifier, |
| 377 | SCSI_UMTS_FDD_UARFCN_BAND_VI_Identifier, |
| 378 | SCSI_UMTS_FDD_UARFCN_BAND_VII_Identifier, |
| 379 | SCSI_UMTS_FDD_UARFCN_BAND_VIII_Identifier, |
| 380 | SCSI_UMTS_FDD_UARFCN_BAND_IX_Identifier, |
| 381 | SCSI_UMTS_FDD_UARFCN_BAND_X_Identifier, |
| 382 | SCSI_UMTS_FDD_UARFCN_BAND_XI_Identifier, |
| 383 | SCSI_UMTS_FDD_UARFCN_BAND_XII_Identifier, |
| 384 | SCSI_UMTS_FDD_UARFCN_BAND_XIII_Identifier, |
| 385 | SCSI_UMTS_FDD_UARFCN_BAND_XIV_Identifier, |
| 386 | SCSI_UMTS_FDD_UARFCN_BAND_XV_Identifier, |
| 387 | SCSI_UMTS_FDD_UARFCN_BAND_XVI_Identifier, |
| 388 | SCSI_UMTS_FDD_UARFCN_BAND_XVII_Identifier, |
| 389 | SCSI_UMTS_FDD_UARFCN_BAND_XVIII_Identifier, |
| 390 | SCSI_UMTS_FDD_UARFCN_BAND_XIX_Identifier, |
| 391 | SCSI_UMTS_FDD_UARFCN_BAND_XX_Identifier, |
| 392 | SCSI_UMTS_FDD_UARFCN_BAND_XXI_Identifier, |
| 393 | SCSI_UMTS_FDD_UARFCN_BAND_XXII_Identifier, |
| 394 | SCSI_UMTS_FDD_UARFCN_BAND_XXIII_Identifier, |
| 395 | SCSI_UMTS_FDD_UARFCN_BAND_XXIV_Identifier, |
| 396 | SCSI_UMTS_FDD_UARFCN_BAND_XXV_Identifier, |
| 397 | SCSI_UMTS_FDD_UARFCN_BAND_XXVI_Identifier, |
| 398 | SCSI_UMTS_FDD_UARFCN_BAND_INVALID, |
| 399 | SCSI_UMTS_TDD_UARFCN_BAND_A_Identifier = 0, |
| 400 | SCSI_UMTS_TDD_UARFCN_BAND_B_Identifier = 1, |
| 401 | SCSI_UMTS_TDD_UARFCN_BAND_C_Identifier = 2, |
| 402 | SCSI_UMTS_TDD_UARFCN_BAND_D_Identifier = 3, |
| 403 | SCSI_UMTS_TDD_UARFCN_BAND_E_Identifier = 4, |
| 404 | SCSI_UMTS_TDD_UARFCN_BAND_F_Identifier = 5, |
| 405 | SCSI_UMTS_TDD_UARFCN_BAND_INVALID = 6 |
| 406 | }; |
| 407 | |
| 408 | typedef enum SCSI_UMTS_BAND_UARFCN_IDENTIFIER_TAG SCSI_UMTS_Band_UARFCN_Identifier; |
| 409 | |
| 410 | #define SCSI_MAX_OVERLAPPING_BANDS (4) |
| 411 | |
| 412 | typedef struct { |
| 413 | kal_uint8 numUarfcn; |
| 414 | CsiUarfcn overlappingUarfcn[SCSI_MAX_OVERLAPPING_BANDS]; |
| 415 | SCSI_UMTS_Band_UARFCN_Identifier overlappingBand[SCSI_MAX_OVERLAPPING_BANDS]; |
| 416 | } SCSI_UMTS_overlapping_band_info_struct; |
| 417 | |
| 418 | typedef enum |
| 419 | { |
| 420 | SCSI_RRC_UE_PowerClassExt_class1, |
| 421 | SCSI_RRC_UE_PowerClassExt_class2, |
| 422 | SCSI_RRC_UE_PowerClassExt_class3, |
| 423 | SCSI_RRC_UE_PowerClassExt_class4, |
| 424 | SCSI_RRC_UE_PowerClassExt_spare4, |
| 425 | SCSI_RRC_UE_PowerClassExt_spare3, |
| 426 | SCSI_RRC_UE_PowerClassExt_spare2, |
| 427 | SCSI_RRC_UE_PowerClassExt_spare1 |
| 428 | } |
| 429 | SCSI_RRC_UE_PowerClassExt; |
| 430 | |
| 431 | typedef enum |
| 432 | { |
| 433 | SCSI_UMTS_UARFCN_DL, |
| 434 | SCSI_UMTS_UARFCN_UL |
| 435 | }SCSI_UMTS_UarfcnDirectionType; |
| 436 | |
| 437 | typedef struct SCSI_UMTS_BAND_UARFCN_ADDITION_SPECIAL_INFO_TAG SCSI_UMTS_Band_UARFCN_Addition_Special; |
| 438 | |
| 439 | struct SCSI_UMTS_BAND_UARFCN_ADDITION_SPECIAL_INFO_TAG |
| 440 | { |
| 441 | kal_uint8 addition_number; |
| 442 | kal_uint16 uarfcn[SCSI_MAX_NUM_OF_UMTS_BAND_ADDITION_INFO]; |
| 443 | }; |
| 444 | |
| 445 | typedef struct SCSI_UMTS_BAND_UARFCN_ADDITION_GENERAL_INFO_TAG SCSI_UMTS_Band_UARFCN_Addition_General; |
| 446 | |
| 447 | struct SCSI_UMTS_BAND_UARFCN_ADDITION_GENERAL_INFO_TAG |
| 448 | { |
| 449 | kal_uint16 addition_start; |
| 450 | kal_uint8 addition_number; |
| 451 | }; |
| 452 | |
| 453 | enum SCSI_UMTS_BAND_UARFCN_ADDITION_TYPE_TAG |
| 454 | { |
| 455 | SCSI_UMTS_BAND_UARFCN_ADDITION_None_Selector, |
| 456 | SCSI_UMTS_BAND_UARFCN_ADDITION_GENERAL_Selector, |
| 457 | SCSI_UMTS_BAND_UARFCN_ADDITION_SPECIAL_Selector |
| 458 | }; |
| 459 | |
| 460 | typedef enum SCSI_UMTS_BAND_UARFCN_ADDITION_TYPE_TAG SCSI_UMTS_Band_UARFCN_AdditionType; |
| 461 | |
| 462 | typedef struct SCSI_UMTS_BAND_UARFCN_CHECK_INFO_TAG SCSI_UMTS_BandCheckInfo; |
| 463 | |
| 464 | #if 0 /*__3GPP_25102_DEFINITION__*/ |
| 465 | /* under construction !*/ |
| 466 | /* under construction !*/ |
| 467 | /* under construction !*/ |
| 468 | /* under construction !*/ |
| 469 | /* under construction !*/ |
| 470 | #endif |
| 471 | |
| 472 | struct SCSI_UMTS_BAND_UARFCN_CHECK_INFO_TAG |
| 473 | { |
| 474 | #if 0 /*__3GPP_25102_DEFINITION__*/ |
| 475 | /* under construction !*/ |
| 476 | /* under construction !*/ |
| 477 | /* under construction !*/ |
| 478 | /* under construction !*/ |
| 479 | #endif |
| 480 | |
| 481 | kal_uint16 low_bound; |
| 482 | kal_uint16 upper_bound; |
| 483 | SCSI_UMTS_Band_UARFCN_AdditionType selection; |
| 484 | union |
| 485 | { |
| 486 | kal_uint8 none; |
| 487 | SCSI_UMTS_Band_UARFCN_Addition_General general; |
| 488 | SCSI_UMTS_Band_UARFCN_Addition_Special special; |
| 489 | }choice; |
| 490 | }; |
| 491 | |
| 492 | struct SCSI_UMTS_BAND_INFO_TAG |
| 493 | { |
| 494 | SCSI_UMTS_Band_UARFCN_Identifier radioFrequencyBand; |
| 495 | SCSI_RRC_UE_PowerClassExt ue_PowerClass; |
| 496 | kal_uint16 txRxFrequencySeparation; /* in UARFCN */ |
| 497 | SCSI_UMTS_BandCheckInfo uarfcn_check_info; |
| 498 | }; |
| 499 | |
| 500 | typedef struct SCSI_UMTS_BAND_INFO_TAG SCSI_UMTS_BandInfo; |
| 501 | |
| 502 | typedef struct SCSI_UMTS_BAND_INFO_LIST_TAG SCSI_UMTS_BandInfoList; |
| 503 | |
| 504 | struct SCSI_UMTS_BAND_INFO_LIST_TAG |
| 505 | { |
| 506 | kal_uint8 band_number; /* number of UMTS FDD working band */ |
| 507 | SCSI_UMTS_Band_UARFCN_Identifier band_index[SCSI_TOTAL_NUMBER_OF_UMTS_BAND_DEFINED]; /* list of enum of UMTS FDD working band */ |
| 508 | }; |
| 509 | |
| 510 | typedef struct SCSI_UMTS_BAND_INFO_DEFINED_TAG SCSI_UMTS_BandInfoDefinedList; |
| 511 | |
| 512 | struct SCSI_UMTS_BAND_INFO_DEFINED_TAG |
| 513 | { |
| 514 | kal_uint8 band_number; |
| 515 | SCSI_UMTS_BandInfo band_info[SCSI_TOTAL_NUMBER_OF_UMTS_BAND_DEFINED]; |
| 516 | }; |
| 517 | |
| 518 | |
| 519 | /* |
| 520 | * Chi-Chung 20090715: |
| 521 | * Code revised for frequencyRepository. This is the structure for user to get the uarfcn in a MCC |
| 522 | */ |
| 523 | #define MAX_UARFCN_PER_MCC 32 |
| 524 | |
| 525 | /* the uarfcn in a Mcc*/ |
| 526 | typedef struct SCSI_UMTS_UarfcnPerMcc |
| 527 | { |
| 528 | ScsiMccValue mcc; |
| 529 | kal_uint8 count; |
| 530 | CsiUarfcn uarfcn[MAX_UARFCN_PER_MCC]; |
| 531 | } |
| 532 | SCSI_UMTS_UarfcnPerMcc; |
| 533 | |
| 534 | #ifdef __NR_RAT__ |
| 535 | |
| 536 | #define SCSI_GEMINI_STATUS_NUM 3 |
| 537 | |
| 538 | typedef enum { |
| 539 | SCSI_GEMINI_STATUS_FULL_CAP = 0, |
| 540 | SCSI_GEMINI_STATUS_DATA_SIM, |
| 541 | SCSI_GEMINI_STATUS_NON_DATA_SIM, |
| 542 | SCSI_GEMINI_STATUS_INVALID |
| 543 | } SCSI_GEMINI_STATUS; |
| 544 | #endif /* __NR_RAT__ */ |
| 545 | |
| 546 | extern void Scsi_ComposeUmtsBandDefinitionInfo(void); |
| 547 | |
| 548 | extern void Scsi_SE_retrieveUmtsBandListInfo(SCSI_SIM_INDEX sim_index, SCSI_UMTS_BandInfoList **ppScsi_StoredUmtsFddBandListInfo); |
| 549 | |
| 550 | extern void Scsi_SE_retrieveFddUmtsBandListInfo(SCSI_SIM_INDEX sim_index, SCSI_UMTS_BandInfoList **ppScsi_StoredUmtsFddBandListInfo); |
| 551 | |
| 552 | extern void Scsi_retrieveUmtsFddAndTddBandDefinedInfo(SCSI_UMTS_BandInfoDefinedList **ppScsi_StoreUmtsFddBandDefinedInfo, SCSI_UMTS_BandInfoDefinedList **ppScsi_StoreUmtsTddBandDefinedInfo); |
| 553 | |
| 554 | extern kal_bool Scsi_SE_ensureUarfcnValid(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn); |
| 555 | |
| 556 | /**************************************************************************** |
| 557 | * Function: Scsi_UarfcnValidateInAllUmtsBand |
| 558 | * |
| 559 | * parameter: |
| 560 | * a. uarfcn - uarfcn which we want to check the validation |
| 561 | * b. type - indicate to perform DL or UL UARFCN validation |
| 562 | * c. band_id - store which band the input uarfcn locates if return KAL_TRUE |
| 563 | * meaningless if return KAL_FALSE or input band_id is NULL pointer |
| 564 | * Returns: |
| 565 | * a. return KAL_TRUE means input uarfcn is in valid range |
| 566 | * b. *band_id will store the band number which this uarfcn locates if band_id is not NULL pointer |
| 567 | * |
| 568 | * Description: |
| 569 | * Envoked for check whether the input uarfcn is in the valid value range which 3GPP defines for |
| 570 | * whole UMTS FDD bands. Currently it will check Band I - X. |
| 571 | * |
| 572 | *****************************************************************************/ |
| 573 | |
| 574 | extern kal_bool Scsi_UarfcnValidateInAllUmtsBand(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn, SCSI_UMTS_UarfcnDirectionType type, SCSI_UMTS_Band_UARFCN_Identifier *band_id); |
| 575 | |
| 576 | extern kal_bool Scsi_SE_UarfcnValidateInAllSupportUmtsBand(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn, SCSI_UMTS_UarfcnDirectionType type, SCSI_UMTS_Band_UARFCN_Identifier *band_id); |
| 577 | |
| 578 | extern kal_bool Scsi_UarfcnValidateInOneSupportUmtsBand(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn, SCSI_UMTS_UarfcnDirectionType type, SCSI_UMTS_Band_UARFCN_Identifier band_id); |
| 579 | |
| 580 | extern kal_bool Scsi_SE_UarfcnValidateInAllSupportUmtsBandExt(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn, SCSI_UMTS_UarfcnDirectionType type, SCSI_UMTS_Band_UARFCN_Identifier *band_id, kal_uint8 *indexInBandFDDList); |
| 581 | |
| 582 | extern kal_uint8 Scsi_SE_GetNumOfUmtsSupportBand(SCSI_SIM_INDEX sim_index); |
| 583 | |
| 584 | extern void Scsi_SE_GetUmtsSupportBandInfo(SCSI_SIM_INDEX sim_index, SCSI_UMTS_BandInfoList const **workBandInfo); |
| 585 | |
| 586 | extern void Scsi_SE_GetUmtsFddAndTddSupportBandInfo(SCSI_SIM_INDEX sim_index, SCSI_UMTS_BandInfoList **fddWorkBandInfo, SCSI_UMTS_BandInfoList **tddWorkBandInfo); |
| 587 | |
| 588 | extern void Scsi_SE_RequiredUmtsBandListQuery(SCSI_SIM_INDEX sim_index, kal_uint8 *query_array); |
| 589 | |
| 590 | extern kal_bool Scsi_SE_IsUmtsSupportBand(SCSI_SIM_INDEX sim_index, SCSI_UMTS_Band_UARFCN_Identifier band_id); |
| 591 | |
| 592 | #endif /* __UMTS_RAT__ */ |
| 593 | |
| 594 | #define SCSI_SET_BMP(_bitmap, _ofst, _type) ((_bitmap) |= (_type)((_type)1 << (_ofst))) |
| 595 | #define SCSI_CLR_BMP(_bitmap, _ofst, _type) ((_bitmap) &= (_type)(~((_type)1 << (_ofst)))) |
| 596 | #define SCSI_CHK_BMP(_bitmap, _ofst, _type) ((_bitmap) & (_type)((_type)1 << (_ofst))) |
| 597 | #define SCSI_BYTE_BITMASK 7 |
| 598 | /* Because LSB is for Band 1, so if we want to access Band x , we should access bitmask[x-1] */ |
| 599 | #define SCSI_BAND_BIT_MASK_GET_BYTE_OFFSET(_band) ((_band - (1)) >> (3)) |
| 600 | #define SCSI_BAND_BIT_MASK_GET_BIT_OFFSET(_band) ((_band - (1)) & (SCSI_BYTE_BITMASK)) |
| 601 | |
| 602 | #ifdef __LTE_RAT__ |
| 603 | #define MAX_BYTE_LTE_BAND_BITMASK 8 |
| 604 | |
| 605 | typedef struct SCSI_LTE_Band_Bitmask |
| 606 | { |
| 607 | kal_uint8 oneByteBandBitmask[MAX_BYTE_LTE_BAND_BITMASK]; |
| 608 | } |
| 609 | SCSI_LTE_Band_Bitmask; |
| 610 | |
| 611 | /* Extended supported LTE bitmask size in bits (256) / bits in one byte (8) |
| 612 | */ |
| 613 | #define MAX_BYTE_LTE_BAND_BITMASK_EXTENDED ( 256 / 8 ) |
| 614 | |
| 615 | typedef struct SCSI_LTE_Band_Bitmask_Extended |
| 616 | { |
| 617 | kal_uint8 oneByteBandBitmask[MAX_BYTE_LTE_BAND_BITMASK_EXTENDED]; |
| 618 | } |
| 619 | SCSI_LTE_Band_Bitmask_Extended; |
| 620 | |
| 621 | #endif /* __LTE_RAT__ */ |
| 622 | |
| 623 | #ifdef __NR_RAT__ |
| 624 | |
| 625 | #define MAX_BYTE_NR_BAND_BITMASK 128 |
| 626 | |
| 627 | typedef struct SCSI_NR_Band_Bitmask |
| 628 | { |
| 629 | kal_uint8 oneByteBandBitmask[MAX_BYTE_NR_BAND_BITMASK]; |
| 630 | } |
| 631 | SCSI_NR_Band_Bitmask; |
| 632 | |
| 633 | #endif /* __NR_RAT__ */ |
| 634 | |
| 635 | #if (defined(__23G_PRI_RESEL_SUPPORT__) || defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__) || defined(__CDMA2000_RAT__) || defined(__NR_RAT__)) |
| 636 | #define SCSI_MAX_TICKS 0xFFFFFFFF |
| 637 | |
| 638 | typedef enum { |
| 639 | SCSI_GSM_RAT, |
| 640 | SCSI_UMTSFDD_RAT, |
| 641 | SCSI_UMTSTDD_RAT, |
| 642 | SCSI_LTE_RAT, |
| 643 | SCSI_C2K_RAT, |
| 644 | SCSI_NR_RAT |
| 645 | }SCSI_RAT_MODE_TYPE; |
| 646 | #endif /* defined(__23G_PRI_RESEL_SUPPORT__) || defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__) || defined(__CDMA2000_RAT__) || defined(__NR_RAT__) */ |
| 647 | |
| 648 | #if (defined(__23G_PRI_RESEL_SUPPORT__) || defined(__LTE_RAT__) || defined(__CDMA2000_RAT__) || defined(__NR_RAT__)) |
| 649 | //Dedicated Priority Info |
| 650 | #define SCSI_MAX_NUM_OF_PRIO_INFO 40 |
| 651 | #define SCSI_MAX_BYTE_OF_GSM_PRIO_ARFCN 128 // bitmask, total 128 bytes. |
| 652 | #define SCSI_MAX_NUM_OF_UMTSFDD_PRIO_UARFCN 32 // 32 frequency. |
| 653 | #define SCSI_MAX_NUM_OF_UMTSTDD_PRIO_UARFCN 32 // 32 frequency. |
| 654 | #define SCSI_MAX_NUM_OF_LTE_PRIO_EARFCN 32 // 32 frequency |
| 655 | #define SCSI_MAX_NUM_OF_C2K_PRIO_BAND 32 // 32 band |
| 656 | #define SCSI_MAX_NUM_OF_NR_PRIO_NARFCN 8 //32 frequency |
| 657 | |
| 658 | typedef struct{ |
| 659 | kal_int8 priority; |
| 660 | kal_int8 sub_priority; // please check this equal to 0, 2, 4, 6 or 8 |
| 661 | SCSI_RAT_MODE_TYPE rat_choice; |
| 662 | kal_uint8 freq_count; // only used in 3G or LTE type, it keeps the frequency count |
| 663 | kal_uint8 gsm_band_indicator; //refer to te_gsm_band_indicator in uas_gas_enums.h |
| 664 | /** |
| 665 | * for GSM RAT, every bit represenet a ARFCN (from 0~1023); LSB of octet 1 represent arfcn = 0, MSB of octet 1 represent arfcn = 7 |
| 666 | * for UMTSFDD, every U16 element represent an UARFCN. |
| 667 | * for LTE, every U32 element represent an EARFCN. |
| 668 | * for C2K, every U8 element represent an Band. |
| 669 | * for NR, every U32 element represent an NARFCN. |
| 670 | **/ |
| 671 | union{ |
| 672 | kal_uint8 *ARFCN_bitmap; // SCSI_MAX_BYTE_OF_GSM_PRIO_ARFCN |
| 673 | kal_uint16 *UARFCN_list; // SCSI_MAX_NUM_OF_UMTSFDD_PRIO_UARFCN <== each of them is two bytes. |
| 674 | kal_uint32 *EARFCN_list; // SCSI_MAX_NUM_OF_LTE_PRIO_EARFCN <== each of them is four bytes. |
| 675 | kal_uint8 *C2K_Band_list; // SCSI_MAX_NUM_OF_C2K_PRIO_BAND <== each of them is one byte |
| 676 | kal_uint32 *NARFCN_list; // SCSI_MAX_NUM_OF_NR_PRIO_NARFCN <== each of them is four bytes. |
| 677 | }choice; |
| 678 | } SCSI_layer_prio_struct; |
| 679 | |
| 680 | typedef struct{ |
| 681 | plmn_id_struct rplmn; |
| 682 | SCSI_RAT_MODE_TYPE dedi_prio_info_src; |
| 683 | kal_uint8 layer_prio_count; |
| 684 | SCSI_layer_prio_struct layer_prio_list[SCSI_MAX_NUM_OF_PRIO_INFO]; |
| 685 | |
| 686 | kal_uint32 tick_previous; // SCSI internal use |
| 687 | kal_uint32 tick_left; // SCSI internal use |
| 688 | } SCSI_dedi_prio_info; |
| 689 | |
| 690 | #define SCSI_MAX_NUM_OF_DEPRIORITIZATION_INFO 8 |
| 691 | #define SCSI_MAX_DEPRIORITIZATION_PLMN_NUM 8 |
| 692 | |
| 693 | typedef struct{ |
| 694 | plmn_id_struct rplmn; |
| 695 | kal_uint8 earfcn_info_num; |
| 696 | kal_uint32 earfcn_info_list[SCSI_MAX_NUM_OF_DEPRIORITIZATION_INFO]; // frequency list, if earfcn == 0xffffffff => all LTE RAT |
| 697 | |
| 698 | kal_uint8 narfcn_info_num; |
| 699 | kal_uint32 narfcn_info_list[SCSI_MAX_NUM_OF_DEPRIORITIZATION_INFO]; // frequency list, if narfcn == 0xffffffff => all NR RAT |
| 700 | |
| 701 | kal_uint32 tick_previous; // SCSI internal use |
| 702 | kal_uint32 tick_left; // SCSI internal use |
| 703 | } SCSI_deprioritization_info_struct; |
| 704 | |
| 705 | // for VzW request |
| 706 | typedef struct{ |
| 707 | kal_uint8 plmn_num; |
| 708 | SCSI_deprioritization_info_struct *deprioritization_info_list[SCSI_MAX_DEPRIORITIZATION_PLMN_NUM]; |
| 709 | } SCSI_deprioritization_info_tbl_struct; |
| 710 | #endif /* __23G_PRI_RESEL_SUPPORT__ || __LTE_RAT__ || __CDMA2000_RAT__ || __NR_RAT__ */ |
| 711 | |
| 712 | |
| 713 | #if (defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__)) |
| 714 | //CSG Split Info |
| 715 | #define SCSI_MAX_NUM_OF_CSG_SPLIT_INFO 3 //the value cannot be equal to zero which 'wrap around' will happen in SCSI_newCSGSplitInfo(). |
| 716 | #define SCSI_MAX_BYTE_OF_PHY_CELL_ID 64 // bitmask, total 64 bytes. |
| 717 | #define SCSI_MAX_NUM_OF_MULTI_PLMN 6 |
| 718 | |
| 719 | #ifdef __3G_CSG_SUPPORT__ |
| 720 | typedef struct{ |
| 721 | kal_uint8 plmn_count; |
| 722 | plmn_id_struct plmn[SCSI_MAX_NUM_OF_MULTI_PLMN]; |
| 723 | CsiUarfcn uarfcn; |
| 724 | kal_uint8 phyCellId_bitmap[SCSI_MAX_BYTE_OF_PHY_CELL_ID]; //every bit represenet a PSC (from 0~512); LSB of octet 1 represent psc = 0, MSB of octet 1 represent psc = 7 |
| 725 | |
| 726 | kal_uint32 tick_previous; // SCSI internal use |
| 727 | kal_uint32 tick_left; // SCSI internal use |
| 728 | } SCSI_umts_csg_split_info; |
| 729 | #endif /* __3G_CSG_SUPPORT__ */ |
| 730 | |
| 731 | #ifdef __LTE_RAT__ |
| 732 | typedef struct{ |
| 733 | kal_uint8 plmn_count; |
| 734 | plmn_id_struct plmn[SCSI_MAX_NUM_OF_MULTI_PLMN]; |
| 735 | CsiEarfcn earfcn; |
| 736 | kal_uint8 phyCellId_bitmap[SCSI_MAX_BYTE_OF_PHY_CELL_ID]; //every bit represenet a PSC (from 0~512); LSB of octet 1 represent psc = 0, MSB of octet 1 represent psc = 7 |
| 737 | |
| 738 | kal_uint32 tick_previous; // SCSI internal use |
| 739 | kal_uint32 tick_left; // SCSI internal use |
| 740 | } SCSI_lte_csg_split_info; |
| 741 | #endif /* __LTE_RAT__ */ |
| 742 | |
| 743 | #ifdef __3G_CSG_SUPPORT__ |
| 744 | typedef struct{ |
| 745 | kal_uint8 list_count; |
| 746 | SCSI_umts_csg_split_info split_info_list[SCSI_MAX_NUM_OF_CSG_SPLIT_INFO]; |
| 747 | }SCSI_umts_csg_split_info_list; |
| 748 | #endif /* __3G_CSG_SUPPORT__ */ |
| 749 | |
| 750 | #ifdef __LTE_RAT__ |
| 751 | typedef struct{ |
| 752 | kal_uint8 list_count; |
| 753 | SCSI_lte_csg_split_info split_info_list[SCSI_MAX_NUM_OF_CSG_SPLIT_INFO]; |
| 754 | }SCSI_lte_csg_split_info_list; |
| 755 | #endif /* __LTE_RAT__ */ |
| 756 | |
| 757 | #endif /* __3G_CSG_SUPPORT__ || __LTE_RAT__ */ |
| 758 | |
| 759 | |
| 760 | // Constructor |
| 761 | extern void Scsi_Scsi(void); |
| 762 | extern void Scsi_reset(void); |
| 763 | |
| 764 | |
| 765 | // Initializer |
| 766 | extern void Scsi_initFromNVRAM(kal_uint8* nvramEfNetparBufPtr, kal_uint16 const nvramEfNetparBufLen); |
| 767 | |
| 768 | extern kal_bool Scsi_isNvramInitialized(void); |
| 769 | |
| 770 | #ifdef __GSM_RAT__ |
| 771 | /* Jethro: Suppose SIM is able to be handled in all cases, regardless the load is dual mode or single mode. */ |
| 772 | extern void Scsi_initFromSIM(plmn_id_struct const* const rPlmnId, |
| 773 | CsiGsmCellList const* const gsmCellList); |
| 774 | #endif /* __GSM_RAT__ */ |
| 775 | |
| 776 | #ifdef __UMTS_RAT__ /* 3G is to be built-in */ |
| 777 | extern void Scsi_initFromUSIM(SCSI_SIM_INDEX sim_index, |
| 778 | plmn_id_struct const* const rPlmnId, |
| 779 | CsiUmtsCellList* const umtsCellList |
| 780 | #ifdef __GSM_RAT__ |
| 781 | , |
| 782 | CsiGsmCellList const* const gsmCellList |
| 783 | #endif |
| 784 | ); |
| 785 | |
| 786 | extern void Scsi_FreqRepositoryInitFromNVRAM(kal_uint8* nvramEfNetparBufPtr, kal_uint16 const nvramEfNetparBufLen); |
| 787 | extern kal_uint16 Scsi_getNvramEFUmtsFreq(kal_uint8* const nvramEfNetparBufPtr, kal_uint16 const nvramEfNetparBufLen); |
| 788 | extern void Scsi_freqPurge(void); |
| 789 | extern void Scsi_freqPurge3GTDDOnly(void); |
| 790 | #endif /* #ifdef __UMTS_RAT__ */ |
| 791 | |
| 792 | extern void Scsi_purge(void); |
| 793 | extern void Scsi_purge3GTDDOnly(void); |
| 794 | |
| 795 | // Destructor |
| 796 | extern void Scsi_destruct(void); |
| 797 | |
| 798 | |
| 799 | #ifdef __GSM_RAT__ /* 2G is to be built-in */ |
| 800 | // GSM |
| 801 | // Setter |
| 802 | extern void Scsi_newGsmFreqRange(plmn_id_struct const* const plmnID, CsiGsmBaRangeAndBand* const BARangeList); |
| 803 | extern void Scsi_newGsmNeighborCells(plmn_id_struct const* const plmnID, CsiGsmCellList* const cellList); |
| 804 | #ifdef __LTE_RAT__ |
| 805 | extern void Scsi_newGsmLatestServingCell(plmn_id_struct const* const plmnID, CsiGsmCell const* const cell); |
| 806 | |
| 807 | //Just for UT currently, not release publicly |
| 808 | #ifdef UNIT_TEST |
| 809 | extern void Scsi_delGsmLatestServingCell(plmn_id_struct const* const plmnID); |
| 810 | #endif /* UNIT_TEST */ |
| 811 | #endif /* __LTE_RAT__ */ |
| 812 | |
| 813 | // Getter |
| 814 | extern void Scsi_getGsmFreqRange(plmn_id_struct const* const plmnID, CsiGsmBaRangeAndBand* const BARangeList); |
| 815 | extern void Scsi_getGsmNeighborCells(plmn_id_struct const* const plmnID, CsiGsmCellList* const cellList); |
| 816 | #ifdef __LTE_RAT__ |
| 817 | extern kal_bool Scsi_getGsmLatestServingCell(plmn_id_struct const* const plmnID, CsiGsmCell* const cell); |
| 818 | #endif /* __LTE_RAT__ */ |
| 819 | #endif /* #ifdef __GSM_RAT__ */ |
| 820 | |
| 821 | |
| 822 | #ifdef __UMTS_RAT__ /* 3G is to be built-in */ |
| 823 | // UMTS |
| 824 | /* David 20081107: |
| 825 | * Added for auto band mechanism. |
| 826 | */ |
| 827 | #ifdef __3G_AUTO_BAND_MECHANISM__ |
| 828 | extern void Scsi_newUmtsWorkingBand(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, SCSI_UMTS_Band_UARFCN_Identifier bandID); |
| 829 | extern void Scsi_delUmtsWorkingBand(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, SCSI_UMTS_Band_UARFCN_Identifier bandID); |
| 830 | #endif |
| 831 | // Setter |
| 832 | extern void Scsi_newUmtsFreqRange(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsFrequnecyList* const freqRange); |
| 833 | |
| 834 | extern void Scsi_newUmtsFreqList(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsFrequnecyList* const freqList, kal_bool correctOverlappingUarfcn); |
| 835 | |
| 836 | extern void Scsi_newUmtsNeighborCells(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsCellList* const cellList); |
| 837 | #ifdef __LTE_RAT__ |
| 838 | extern void Scsi_newUmtsLatestServingCell(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsCellWithUarfcn const* const cell); |
| 839 | |
| 840 | //Just for UT currently, not release publicly |
| 841 | #ifdef UNIT_TEST |
| 842 | extern void Scsi_delUmtsLatestServingCell(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID); |
| 843 | #endif /* UNIT_TEST */ |
| 844 | #endif /* __LTE_RAT__ */ |
| 845 | |
| 846 | extern void Scsi_newUmtsUarfcnList(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID , CsiUmtsUarfcnList *uarfcnList); |
| 847 | |
| 848 | // Getter |
| 849 | extern void Scsi_getUmtsFreqRange(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsFrequnecyList* const freqRange); |
| 850 | extern void Scsi_getUmtsFreqList(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsFrequnecyList* const freqList); |
| 851 | /* Nicky 20141007: Stored 3G Cell List is not used. Remove the get function. */ |
| 852 | #if 0 |
| 853 | /* under construction !*/ |
| 854 | #endif |
| 855 | #ifdef __LTE_RAT__ |
| 856 | extern kal_bool Scsi_getUmtsLatestServingCell(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsCellWithUarfcn* const cell); |
| 857 | #endif /* __LTE_RAT__ */ |
| 858 | extern void Scsi_getUmtsUarcnList(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsUarfcnList *uarfcnList); |
| 859 | extern void Scsi_getUmtsUarfcnByMcc(SCSI_SIM_INDEX sim_index, kal_uint32 const countOfMccs , SCSI_UMTS_UarfcnPerMcc* uarfcnByMccs); |
| 860 | extern kal_bool Scsi_isUarfcnSharedInCurrentPlmn(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmn_found ,kal_uint16 uarfn_to_be_checked ); |
| 861 | |
| 862 | /* Nicky 20110103: Added for Gemini 2.0 */ |
| 863 | #ifdef __GEMINI__ |
| 864 | extern kal_uint16 Scsi_getUmtsUarfcnUpperBound(SCSI_SIM_INDEX sim_index, SCSI_UMTS_Band_UARFCN_Identifier bandID); |
| 865 | extern kal_uint16 Scsi_getUmtsUarfcnLowerBound(SCSI_SIM_INDEX sim_index, SCSI_UMTS_Band_UARFCN_Identifier bandID); |
| 866 | extern kal_uint8 Scsi_getUmtsAdditionalFreqList(SCSI_SIM_INDEX sim_index, SCSI_UMTS_Band_UARFCN_Identifier bandID, kal_uint8 const sizeOfList, kal_uint16 * const additionalFreqList); |
| 867 | #endif /* #ifdef __GEMINI__ */ |
| 868 | |
| 869 | /* Nicky 20111028: Added for UMTS Band Extension, which will be used by RRCE module. */ |
| 870 | extern kal_uint16 Scsi_getBandTxRxFreqSeparation(SCSI_SIM_INDEX sim_index, SCSI_UMTS_Band_UARFCN_Identifier bandID); |
| 871 | |
| 872 | extern kal_bool Scsi_convertUarfcnForOverlappedFreqBands(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn, SCSI_UMTS_Band_UARFCN_Identifier bandId, SCSI_UMTS_Band_UARFCN_Identifier otherBandId, kal_uint16 *convertedUarfcn); |
| 873 | #endif /* #ifdef __UMTS_RAT__ */ |
| 874 | |
| 875 | extern kal_uint8 Scsi_getPlmns(plmn_id_struct* plmns); |
| 876 | |
| 877 | // Retrieve encoded data for saving to non-volatile storages, i.e., NVRAM and USIM/SIM. |
| 878 | extern kal_uint16 Scsi_getNvramEFNetpar(kal_uint8* const nvramEfNetparBufPtr, kal_uint16 const nvramEfNetparBufLen); |
| 879 | |
| 880 | #if (defined(__23G_PRI_RESEL_SUPPORT__) || defined(__LTE_RAT__)) |
| 881 | // SCSI need to provide the following functions: |
| 882 | |
| 883 | // Before use any API of DediPrioInfo, please call this function to acquire mutext. |
| 884 | extern void SCSI_acquirePrioMutex(SCSI_SIM_INDEX sim_index); |
| 885 | |
| 886 | // return the pointer of pDediPrioInfo. |
| 887 | // user can operate on SCSI_dedi_prio_info, but user shall not operate on tick_previous. tick_previous would be updated by SCSI. |
| 888 | extern SCSI_dedi_prio_info *SCSI_getDediPrioInfo(SCSI_SIM_INDEX sim_index); |
| 889 | |
| 890 | // free the memory of pDediPrioInfo, after user call this function, please never use the previous-got memory...So please be careful. |
| 891 | extern void SCSI_freeDediPrioInfo(SCSI_SIM_INDEX sim_index); |
| 892 | |
| 893 | // call SCSI_FreeDediPrioInfo to free previous-put memory in pDediPrioInfo, and then put the point address in pDediPrioInfo. |
| 894 | // please never use the previous-got memory...So please careful. |
| 895 | // Besides, update the tick_previous by SCSI. User would not update it. |
| 896 | extern void SCSI_setDediPrioInfo(SCSI_SIM_INDEX sim_index, kal_uint32 tick_left, SCSI_dedi_prio_info *pDediPrio); |
| 897 | |
| 898 | // In this function, please check the left_tick and do correct computing. If expired, please free the pDediPrioInfo and set it NULL. |
| 899 | extern void SCSI_releasePrioMutex(SCSI_SIM_INDEX sim_index); |
| 900 | |
| 901 | |
| 902 | // Before use any API of DeprioritizationInfo, please call this function to acquire mutext. |
| 903 | extern void SCSI_acquireDeprioritizationMutex(SCSI_SIM_INDEX sim_index); |
| 904 | |
| 905 | // return the pointer of pDeprioritizationInfo. |
| 906 | // user can operate on SCSI_deprioritization_info_struct, but user shall not operate on tick_previous. tick_previous would be updated by SCSI. |
| 907 | extern SCSI_deprioritization_info_struct *SCSI_getDeprioritizationInfo(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const rplmn); |
| 908 | |
| 909 | // free the memory of specific PLMN of pDeprioritizationInfo. |
| 910 | extern void SCSI_freeDeprioritizationInfo(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const rplmn); |
| 911 | |
| 912 | // call SCSI_freeDeprioritizationInfo to free previous-put memory of pDeprioritizationInfo, and then put the point address to pDeprioritizationInfo. |
| 913 | // please never use the previous-got memory...So please careful. |
| 914 | // Besides, update the tick_previous by SCSI. User would not update it. |
| 915 | extern void SCSI_setDeprioritizationInfo(SCSI_SIM_INDEX sim_index, kal_uint32 tick_left, SCSI_deprioritization_info_struct *pDeprioritizationInfo); |
| 916 | |
| 917 | // In this function, please check the left_tick and do correct computing. If expired, please free the pDeprioritizationInfo and set it NULL. |
| 918 | extern void SCSI_releaseDeprioritizationMutex(SCSI_SIM_INDEX sim_index); |
| 919 | #endif /* __23G_PRI_RESEL_SUPPORT__ || __LTE_RAT__ */ |
| 920 | |
| 921 | #if (defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__)) |
| 922 | // put the pSlitInfo which contain this arfcn in pSplitInfo according to rat_type, if not found, set content of pSplitInfo all zero. |
| 923 | // besides, according to tick_left tick_previous to delete the expired split info. |
| 924 | #ifdef __3G_CSG_SUPPORT__ |
| 925 | extern void SCSI_getUmtsCSGSplitInfo(SCSI_SIM_INDEX sim_index, CsiUarfcn uarfcn, plmn_id_struct const* const plmnID, SCSI_umts_csg_split_info * const pSplitInfo); |
| 926 | #endif /* __3G_CSG_SUPPORT__ */ |
| 927 | |
| 928 | #ifdef __LTE_RAT__ |
| 929 | extern void SCSI_getLteCSGSplitInfo(SCSI_SIM_INDEX sim_index, CsiEarfcn earfcn, plmn_id_struct const* const plmnID, SCSI_lte_csg_split_info * const pSplitInfo); |
| 930 | #endif /* __LTE_RAT__ */ |
| 931 | |
| 932 | // put the content of pCSGSplitInfoList in SCSI to pSplitInfoList according to rat_type, if pCSGSplitInfoList is null, set content of pSplitInfoList all zero. |
| 933 | // besides, according to tick_left tick_previous to delete the expired split info. |
| 934 | #ifdef __3G_CSG_SUPPORT__ |
| 935 | extern void SCSI_getUmtsCSGSplitInfoList(SCSI_SIM_INDEX sim_index, SCSI_umts_csg_split_info_list * const pSplitInfoList); |
| 936 | #endif /* __3G_CSG_SUPPORT__ */ |
| 937 | |
| 938 | #ifdef __LTE_RAT__ |
| 939 | extern void SCSI_getLteCSGSplitInfoList(SCSI_SIM_INDEX sim_index, SCSI_lte_csg_split_info_list * const pSplitInfoList); |
| 940 | #endif /* __LTE_RAT__ */ |
| 941 | |
| 942 | // If found the same frequecny replace it, else allocate one memory and put the SCSI_csg_split_info in the CSGSplitInfo according to rat_type. |
| 943 | // besides, according to tick_left tick_previous to delete the expired split info. |
| 944 | #ifdef __3G_CSG_SUPPORT__ |
| 945 | extern void SCSI_newUmtsCSGSplitInfo(SCSI_SIM_INDEX sim_index, kal_uint32 tick_left, SCSI_umts_csg_split_info const * const pSplitInfo); |
| 946 | #endif /* __3G_CSG_SUPPORT__ */ |
| 947 | |
| 948 | #ifdef __LTE_RAT__ |
| 949 | extern void SCSI_newLteCSGSplitInfo(SCSI_SIM_INDEX sim_index, kal_uint32 tick_left, SCSI_lte_csg_split_info const * const pSplitInfo); |
| 950 | #endif /* __LTE_RAT__ */ |
| 951 | |
| 952 | #endif /* __3G_CSG_SUPPORT__ || __LTE_RAT__ */ |
| 953 | |
| 954 | /*Multi-Mode******************************************************************/ |
| 955 | #ifdef __GSM_RAT__ |
| 956 | extern void Scsi_SE_ComposeGsmBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint8 GBandBitmask); |
| 957 | |
| 958 | extern void Scsi_SE_retrieveGsmBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint8 *pGBandBitmask); |
| 959 | #endif /* __GSM_RAT__ */ |
| 960 | #ifdef __UMTS_RAT__ |
| 961 | extern void Scsi_SE_ComposeUmtsBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint32 UBandBitmask); |
| 962 | |
| 963 | extern void Scsi_SE_retrieveUmtsBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint32 *pUBandBitmask); |
| 964 | |
| 965 | extern void Scsi_SE_retrieveUmtsFddBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint32 *pUFddBandBitmask); |
| 966 | |
| 967 | extern void Scsi_SE_ComposeUmtsFddAndTddBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint32 UFddBandBitmask, kal_uint32 UTddBandBitmask); |
| 968 | |
| 969 | extern void Scsi_SE_retrieveUmtsFddAndTddBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint32 *pUFddBandBitmask, kal_uint32 *pUTddBandBitmask); |
| 970 | #endif /* __UTMS_RAT__ */ |
| 971 | #ifdef __LTE_RAT__ |
| 972 | extern void Scsi_SE_ComposeLteBandBitmask(SCSI_SIM_INDEX sim_index, SCSI_LTE_Band_Bitmask LBandBitmask); |
| 973 | |
| 974 | extern void Scsi_SE_retrieveLteBandBitmask(SCSI_SIM_INDEX sim_index, SCSI_LTE_Band_Bitmask *pLBandBitmask); |
| 975 | |
| 976 | extern void Scsi_SE_ComposeLteBandBitmask_extended( SCSI_SIM_INDEX sim_index, const SCSI_LTE_Band_Bitmask_Extended* LBandBitmask ); |
| 977 | |
| 978 | extern void Scsi_SE_retrieveLteBandBitmask_extended( SCSI_SIM_INDEX sim_index, SCSI_LTE_Band_Bitmask_Extended* pLBandBitmask ); |
| 979 | #endif /* __LTE_RAT__ */ |
| 980 | |
| 981 | #ifdef __NR_RAT__ |
| 982 | |
| 983 | extern void Scsi_SE_ComposeNRBandBitmask(SCSI_SIM_INDEX sim_index, const SCSI_NR_Band_Bitmask* pNRBandBitmask); |
| 984 | extern void Scsi_SE_retrieveNRBandBitmask(SCSI_SIM_INDEX sim_index, SCSI_NR_Band_Bitmask* pNRBandBitmask); |
| 985 | extern void Scsi_SE_ComposeNR_ENDCBandBitmask(SCSI_SIM_INDEX sim_index, |
| 986 | SCSI_GEMINI_STATUS gemini_status, |
| 987 | const SCSI_NR_Band_Bitmask* pNR_ENDCBandBitmask); |
| 988 | extern void Scsi_SE_retrieveNR_ENDCBandBitmask(SCSI_SIM_INDEX sim_index, |
| 989 | SCSI_GEMINI_STATUS gemini_status, |
| 990 | SCSI_NR_Band_Bitmask* pNR_ENDCBandBitmask); |
| 991 | #endif /* __NR_RAT__ */ |
| 992 | |
| 993 | #ifdef __LTE_RAT__ |
| 994 | extern void Scsi_newLteFreqList(plmn_id_struct const* const plmnID, CsiLteFrequencyList* const freqList); |
| 995 | |
| 996 | extern void Scsi_getLteFreqList(plmn_id_struct const* const plmnID, CsiLteFrequencyList* const freqList); |
| 997 | #endif /* __LTE_RAT__ */ |
| 998 | |
| 999 | #if (defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__)) |
| 1000 | extern void Scsi_prevVisitedCellInitFromNVRAM(kal_uint8* nvramEfPrevVisitedCellBufPtr, kal_uint16 const nvramEfPrevVisitedCellBufLen); |
| 1001 | |
| 1002 | extern kal_uint16 Scsi_getNvramEFPrevVisitedCell(kal_uint8* const nvramEfPrevVisitedCellBufPtr, kal_uint16 const nvramEfPrevVisitedCellBufLen); |
| 1003 | |
| 1004 | extern void Scsi_prevVisitedCellPurge(void); |
| 1005 | |
| 1006 | extern void Scsi_newPrevVisitedCell(SCSI_SIM_INDEX const simIdx, plmn_id_struct const* const plmnID, ScsiPrevVisitedCell * prevVisitedCell); |
| 1007 | |
| 1008 | extern void Scsi_delPrevVisitedCellGivenPlmnAndCsg(SCSI_SIM_INDEX const simIdx, plmn_id_struct const* const plmnID, CsiCsgId const csgID); |
| 1009 | |
| 1010 | extern void Scsi_getPrevVisitedCellListByPlmn(SCSI_SIM_INDEX const simIdx, plmn_id_struct const* const plmnID, ScsiPrevVisitedCellList * const prevVisitedCellList); |
| 1011 | |
| 1012 | extern kal_bool Scsi_isPrevVisitedCellExistedGivenPlmnAndCsg(SCSI_SIM_INDEX const simIdx, plmn_id_struct const* const plmnID, CsiCsgId const csgID); |
| 1013 | |
| 1014 | #endif /* __3G_CSG_SUPPORT__ || __LTE_RAT__ */ |
| 1015 | /*Multi-Mode******************************************************************/ |
| 1016 | |
| 1017 | #ifdef UNIT_TEST |
| 1018 | extern void Scsi_initFromNvramUnitTesting(SCSI_SIM_INDEX sim_index); |
| 1019 | extern void Scsi_initFromNvramUnitTesting1(SCSI_SIM_INDEX sim_index); |
| 1020 | extern void Scsi_initFromNvramUnitTesting2(SCSI_SIM_INDEX sim_index); |
| 1021 | extern void Scsi_initFromNvramUnitTesting3(SCSI_SIM_INDEX sim_index); |
| 1022 | extern void Scsi_initFromNvramUnitTesting4(SCSI_SIM_INDEX sim_index); |
| 1023 | extern void Scsi_initFromNvramUnitTestingForRplmnInfo(SCSI_SIM_INDEX sim_index); |
| 1024 | //#ifdef __BAND_PRIORITY_SEARCH__ |
| 1025 | extern void Scsi_initFromNvramUnitTestingForBandPrioSearch(SCSI_SIM_INDEX sim_index); |
| 1026 | //#endif /* __BAND_PRIORITY_SEARCH__ */ |
| 1027 | extern void Scsi_te(SCSI_SIM_INDEX sim_index); |
| 1028 | #endif |
| 1029 | |
| 1030 | |
| 1031 | #endif /* _(!@$ `scsi.h' $@!)_ */ |