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 | * csr_fsm.h |
| 39 | * |
| 40 | * Project: |
| 41 | * -------- |
| 42 | * Monza |
| 43 | * |
| 44 | * Description: |
| 45 | * ------------ |
| 46 | * This file is intends for CSR FSM. |
| 47 | * |
| 48 | * Author: |
| 49 | * ------- |
| 50 | * ------- |
| 51 | * |
| 52 | *============================================================================ |
| 53 | * HISTORY |
| 54 | * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 55 | *------------------------------------------------------------------------------ |
| 56 | * removed! |
| 57 | * |
| 58 | * removed! |
| 59 | * removed! |
| 60 | * removed! |
| 61 | * |
| 62 | * |
| 63 | * removed! |
| 64 | * removed! |
| 65 | * removed! |
| 66 | * |
| 67 | * removed! |
| 68 | * removed! |
| 69 | * removed! |
| 70 | * |
| 71 | * removed! |
| 72 | * removed! |
| 73 | * removed! |
| 74 | * |
| 75 | * removed! |
| 76 | * removed! |
| 77 | * |
| 78 | * removed! |
| 79 | * removed! |
| 80 | * |
| 81 | * removed! |
| 82 | * removed! |
| 83 | * removed! |
| 84 | * |
| 85 | * removed! |
| 86 | * removed! |
| 87 | * removed! |
| 88 | * |
| 89 | * removed! |
| 90 | * removed! |
| 91 | * |
| 92 | * removed! |
| 93 | * removed! |
| 94 | * removed! |
| 95 | * |
| 96 | * removed! |
| 97 | * removed! |
| 98 | * removed! |
| 99 | * |
| 100 | * removed! |
| 101 | * removed! |
| 102 | * removed! |
| 103 | * |
| 104 | * removed! |
| 105 | * removed! |
| 106 | * |
| 107 | * removed! |
| 108 | * removed! |
| 109 | * |
| 110 | * removed! |
| 111 | * removed! |
| 112 | * removed! |
| 113 | * |
| 114 | * removed! |
| 115 | * removed! |
| 116 | * removed! |
| 117 | * |
| 118 | * removed! |
| 119 | * removed! |
| 120 | * |
| 121 | * removed! |
| 122 | * |
| 123 | * removed! |
| 124 | * removed! |
| 125 | * removed! |
| 126 | * |
| 127 | * removed! |
| 128 | * removed! |
| 129 | * removed! |
| 130 | * |
| 131 | * removed! |
| 132 | * removed! |
| 133 | * removed! |
| 134 | * |
| 135 | * removed! |
| 136 | * removed! |
| 137 | * removed! |
| 138 | * |
| 139 | * removed! |
| 140 | * removed! |
| 141 | * removed! |
| 142 | * |
| 143 | * removed! |
| 144 | * removed! |
| 145 | * removed! |
| 146 | * |
| 147 | * removed! |
| 148 | * removed! |
| 149 | * removed! |
| 150 | * |
| 151 | * removed! |
| 152 | * removed! |
| 153 | * removed! |
| 154 | * |
| 155 | * removed! |
| 156 | * removed! |
| 157 | * |
| 158 | * |
| 159 | * removed! |
| 160 | * removed! |
| 161 | * removed! |
| 162 | * |
| 163 | * removed! |
| 164 | * removed! |
| 165 | * |
| 166 | * |
| 167 | * removed! |
| 168 | * removed! |
| 169 | * removed! |
| 170 | * |
| 171 | * removed! |
| 172 | * removed! |
| 173 | * |
| 174 | * |
| 175 | * removed! |
| 176 | * removed! |
| 177 | * removed! |
| 178 | * |
| 179 | * removed! |
| 180 | * removed! |
| 181 | * |
| 182 | * |
| 183 | * removed! |
| 184 | * removed! |
| 185 | * |
| 186 | * |
| 187 | * removed! |
| 188 | * removed! |
| 189 | * |
| 190 | * |
| 191 | * removed! |
| 192 | * removed! |
| 193 | * |
| 194 | * |
| 195 | * removed! |
| 196 | * removed! |
| 197 | * removed! |
| 198 | * |
| 199 | * removed! |
| 200 | * removed! |
| 201 | * removed! |
| 202 | * |
| 203 | * removed! |
| 204 | * removed! |
| 205 | * |
| 206 | * |
| 207 | * removed! |
| 208 | * removed! |
| 209 | * |
| 210 | * |
| 211 | * removed! |
| 212 | * removed! |
| 213 | * |
| 214 | * |
| 215 | * removed! |
| 216 | * removed! |
| 217 | * |
| 218 | * |
| 219 | *------------------------------------------------------------------------------ |
| 220 | * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 221 | *============================================================================ |
| 222 | *******************************************************************************/ |
| 223 | /**************************************************************************** |
| 224 | * |
| 225 | * Assignment : 3G Protocol Software |
| 226 | * CONFIDENTIAL |
| 227 | * Copyright (c) 2000-2005, UbiNetics Ltd. All rights reserved. |
| 228 | * Cambridge Technology Centre |
| 229 | * Melbourn Royston |
| 230 | * Herts SG8 6DP UK |
| 231 | * Tel: +44 1763 262222 |
| 232 | * |
| 233 | **************************************************************************** |
| 234 | * |
| 235 | * COMPONENT: CSR |
| 236 | * MODULE: $RCSfile: rab.h,v $ |
| 237 | * VERSION: $Revision: 1.2 $ |
| 238 | * DATED: 2003/06/19 14:37:49 $ |
| 239 | * AUTHOR: Kathiravan |
| 240 | * |
| 241 | * DESCRIPTION: CSR fsm |
| 242 | * |
| 243 | ****************************************************************************/ |
| 244 | #if !defined(CSR_FSM_H) |
| 245 | #define CSR_FSM_H |
| 246 | |
| 247 | #include "kal_general_types.h" |
| 248 | #include "kal_public_api.h" |
| 249 | #include "ul2d_msgid.h" |
| 250 | #include "as_common.h" |
| 251 | #include "uas_common_struct.h" |
| 252 | #include "ratcm_csr_struct.h" |
| 253 | #include "uas_common_enums.h" |
| 254 | #include "em_struct.h" |
| 255 | #include "l1audio.h" |
| 256 | #ifdef __VIDEO_CALL_SUPPORT__ |
| 257 | #include "TVT_callback.h" |
| 258 | #endif |
| 259 | |
| 260 | /* MACROS *******************************************************************/ |
| 261 | #define MAX_NO_OF_SI 255 |
| 262 | #define UNKNOWN_AMR_FRAME_TYPE 0xff /* CSR internal use */ |
| 263 | #define MAX_NO_OF_CSR_ENTITY 6 |
| 264 | #define MAX_NO_OF_CSR_REACHED (MAX_NO_OF_CSR_ENTITY+1) |
| 265 | #define CSR_ENTITY_NOT_FOUND (MAX_NO_OF_CSR_ENTITY+2) |
| 266 | #define MAX_AMR_CLASS 3 |
| 267 | #define GetPos(low, high, pos) (pos = ((low+high)/2)) |
| 268 | #define INIT_CODEC_DATA(Codec_DataToSend) \ |
| 269 | { \ |
| 270 | Codec_DataToSend->AMRClass[0] = NULL; \ |
| 271 | Codec_DataToSend->AMRClass[1] = NULL; \ |
| 272 | Codec_DataToSend->AMRClass[2] = NULL; \ |
| 273 | } |
| 274 | #define MAX_AMR_FRAME_SIZE 31 |
| 275 | #define CSR_CS_FCS_LEN 3 |
| 276 | #define CSR_CS_PDU_SIZE 72 /* RLP frame size */ |
| 277 | #define CSR_VT_PDU_SIZE 80 /* video call frame size */ |
| 278 | #define CSR_CS_TRA_PDU_SIZE 80 /* MAUI_02375911, 3G 64K Transparent CSD, add for sync-hdlc CSD */ |
| 279 | #define CSR_ASSERT(x) DEBUG_ASSERT(x) |
| 280 | |
| 281 | /* mtk02374 20110801 use CSR_NON_SPEECH_SERVICE to replace checking of services other than speech */ |
| 282 | #if defined(__VIDEO_CALL_SUPPORT__) || defined(__SYNC_HDLC_CSD__) |
| 283 | #define CSR_NON_SPEECH_SERVICE |
| 284 | #endif |
| 285 | |
| 286 | #ifdef __EM_MODE__ |
| 287 | #define FDD_SET_CSR_EM_NEED_UPDATE() FDD_CSREntityInfo.EmNeedUpdate = KAL_TRUE; |
| 288 | #define FDD_RESET_CSR_EM_NEED_UPDATE() FDD_CSREntityInfo.EmNeedUpdate = KAL_FALSE; |
| 289 | #define FDD_IS_CSR_EM_NEED_UPDATE() (FDD_CSREntityInfo.EmNeedUpdate) |
| 290 | #define FDD_SET_CSR_EM_SRC(em_src) FDD_CSREntityInfo.EmSrc |= em_src; |
| 291 | #define FDD_CLEAR_CSR_EM_SRC(em_src) FDD_CSREntityInfo.EmSrc &= ~em_src; |
| 292 | #define FDD_RESET_CSR_EM_SRC() FDD_CSREntityInfo.EmSrc = CSR_EM_NONE; |
| 293 | #define FDD_IS_CSR_EM_ENABLE() (FDD_CSREntityInfo.EmSrc != CSR_EM_NONE) |
| 294 | #define FDD_IS_CSR_EM_DISABLE() (FDD_CSREntityInfo.EmSrc == CSR_EM_NONE) |
| 295 | #define FDD_IS_CSR_UPDATE_EM_TO_ELT() (FDD_CSREntityInfo.EmSrc & CSR_EM_ELT) |
| 296 | #define FDD_IS_CSR_UPDATE_EM_TO_AP() (FDD_CSREntityInfo.EmSrc & CSR_EM_AP) |
| 297 | #endif |
| 298 | |
| 299 | /* FDD MACROS ***************************************************************/ |
| 300 | #define FDD_GetSizeofAMRClassA(FrameType,SizeOfClassA) (SizeOfClassA = (FDD_FrameTypeAndDataRate[FrameType].sizeOfClassA)) |
| 301 | #define FDD_GetSizeofAMRClassB(FrameType,SizeOfClassB) (SizeOfClassB = (FDD_FrameTypeAndDataRate[FrameType].sizeOfClassB)) |
| 302 | #define FDD_GetSizeofAMRClassC(FrameType,SizeOfClassC) (SizeOfClassC = (FDD_FrameTypeAndDataRate[FrameType].sizeOfClassC)) |
| 303 | #define FDD_CC_DEFAULT_STREAM_ID 1 |
| 304 | #define FDD_CSR_SEND_ILM(src_mod_id, dest_mod_id, msg_id, local_para_ptr, peer_buff_ptr) FDD_CsrSendIlm(src_mod_id, dest_mod_id, msg_id, (local_para_struct *)local_para_ptr, (peer_buff_struct *)peer_buff_ptr); |
| 305 | #define FDD_mSET_SEND_CONFIG_MAPPING_IND(SendCfgReq) SendCfgReq = KAL_TRUE; |
| 306 | #define FDD_mReSET_SEND_CONFIG_MAPPING_IND(SendCfgReq) SendCfgReq = KAL_FALSE; |
| 307 | #define FDD_CSR_STATE_CHANGE(idx, newState) \ |
| 308 | MD_TRC_FDD_CSR__CHANGE_STATE(idx, FDD_CSREntityInfo.CSRWorkSpace[idx]->CSRCurrentState, newState); \ |
| 309 | FDD_CSREntityInfo.CSRWorkSpace[idx]->CSRCurrentState = newState; |
| 310 | |
| 311 | #define FDD_CSRENTITY_ACTIVE_SIM() (FDD_CSREntityInfo.activeSim) |
| 312 | #define TDD_CSR_ACTIVE_SIM() (0) |
| 313 | |
| 314 | #ifdef __CSHSPA_SUPPORT__ |
| 315 | #define FDD_CSR_UL_AFM_OPT (AFM_OPT_ALIGN_ALLOC | AFM_OPT_DBG) |
| 316 | #define FDD_CSR_UL_DATA_POOL_SIZE \ |
| 317 | (AFM_POOL_OVERHEAD(FDD_CSR_UL_AFM_OPT , 1 ) \ |
| 318 | + AFM_SUBPOOL_OVERHEAD(FDD_CSR_UL_AFM_OPT, (MAX_CS_DATA_SIZE + sizeof(SHAQ_csr_data_req_struct) + FDD_NUM_DRLC_UM_USER_RB_OFFSET + 4), MAX_CS_UL_MEM_NUM) + 64) |
| 319 | #endif |
| 320 | |
| 321 | #ifdef __MTK_TARGET__ |
| 322 | #define FDD_CSR_LOG_FILE(a,b,c) |
| 323 | #else |
| 324 | #define FDD_CSR_LOG_FILE(a,b,c) FDD_CsrWriteLog(a,b,c) |
| 325 | #endif |
| 326 | |
| 327 | /* TDD MACROS ***************************************************************/ |
| 328 | #define TDD_GetSizeofAMRClassA(FrameType,SizeOfClassA) (SizeOfClassA = (TDD_FrameTypeAndDataRate[FrameType].sizeOfClassA)) |
| 329 | #define TDD_GetSizeofAMRClassB(FrameType,SizeOfClassB) (SizeOfClassB = (TDD_FrameTypeAndDataRate[FrameType].sizeOfClassB)) |
| 330 | #define TDD_GetSizeofAMRClassC(FrameType,SizeOfClassC) (SizeOfClassC = (TDD_FrameTypeAndDataRate[FrameType].sizeOfClassC)) |
| 331 | #ifdef __MTK_TARGET__ |
| 332 | #define TDD_CSR_LOG_FILE(a,b,c) |
| 333 | #else |
| 334 | #define TDD_CSR_LOG_FILE(a,b,c) TDD_csr_write_log(a,b,c) |
| 335 | #endif |
| 336 | |
| 337 | /* TYPES DEFINITIONS ********************************************************/ |
| 338 | typedef U8 AMRFrameType; |
| 339 | |
| 340 | typedef enum |
| 341 | { |
| 342 | stCSR_INACTIVE, |
| 343 | stCSR_ACTIVE, |
| 344 | stCSR_WAIT_FOR_RAB_ESTABLISH, |
| 345 | stCSR_WAIT_FOR_RAB_MODIFY_OR_RELEASE, |
| 346 | stCSR_WAIT_FOR_ROUTING |
| 347 | } tCSR_States; |
| 348 | |
| 349 | /* MAUI_02375904 */ |
| 350 | typedef enum |
| 351 | { |
| 352 | RAB_ESTAB_CREATE_CSR_ENTITY_IF_NOT_FOUND, |
| 353 | SET_ROUTE_CREATE_CSR_ENTITY_IF_NOT_FOUND, |
| 354 | FIND_CSR_ENTITY_BY_RAB_ID, |
| 355 | FIND_CSR_ENTITY_BY_STREAM_ID |
| 356 | } tCSR_Action; |
| 357 | |
| 358 | /* [MAUI_01663681] Add trace info for Speech Codec Type Reference TS26.103, Table 6.3-1 */ |
| 359 | typedef enum |
| 360 | { |
| 361 | GSM_FR = 0, /* GSM Full Rate */ |
| 362 | GSM_HR, /* GSM Half Rate */ |
| 363 | GSM_EFR, /* GSM Enhanced Full Rate */ |
| 364 | FR_AMR, /* Full Rate Adaptive Multi-Rate */ |
| 365 | HR_AMR, /* Half Rate Adaptive Multi-Rate */ |
| 366 | UMTS_AMR, /* UMTS Adaptive Multi-Rate */ |
| 367 | UMTS_AMR_2, /* UMTS Adaptive Multi-Rate 2*/ |
| 368 | TDMA_EFR, /* TDMA Enhanced Full Rate */ |
| 369 | PDC_EFR, /* PDC Enhanced Full Rate */ |
| 370 | FR_AMR_WB, /* Full Rate Adaptive Multi-Rate WideBand */ |
| 371 | UMTS_AMR_WB, /* UMTS Adaptive Multi-Rate WideBand */ |
| 372 | OHR_AMR, /* 8PSK Half Rate Adaptive Multi-Rate */ |
| 373 | OFR_AMR_WB, /* 8PSK Full Rate Adaptive Multi-Rate WideBand */ |
| 374 | OHR_AMR_WB, /* 8PSK Half Rate Adaptive Multi-Rate WideBand */ |
| 375 | MuMe = 255 /* Reserved for MuMe dummy Codec Type, shall not to be used*/ |
| 376 | } tCSR_SpeechCodecType; |
| 377 | |
| 378 | /* MAUI_01966343 Note: Any modification of the enum shall sync with FrameTypeAndDataRate[] */ |
| 379 | typedef enum |
| 380 | { |
| 381 | AMR_FRAME_4_75 = 0, |
| 382 | AMR_FRAME_5_15, |
| 383 | AMR_FRAME_5_90, |
| 384 | AMR_FRAME_6_70, |
| 385 | AMR_FRAME_7_40, |
| 386 | AMR_FRAME_7_95, |
| 387 | AMR_FRAME_10_2, |
| 388 | AMR_FRAME_12_2, |
| 389 | AMR_FRAME_SID, |
| 390 | AMR_FRAME_GSM_EFR_SID, |
| 391 | AMR_FRAME_TDMA_EFR_SID, |
| 392 | AMR_FRAME_PDC_EFR_SID, |
| 393 | RFU_AMR_FRAME_TYPE_12, //reserved for future use |
| 394 | RFU_AMR_FRAME_TYPE_13, //reserved for future use |
| 395 | RFU_AMR_FRAME_TYPE_14, //reserved for future use |
| 396 | AMR_FRAME_NO_DATA = 15, |
| 397 | |
| 398 | #ifdef __AMRWB_LINK_SUPPORT__ |
| 399 | AMRWB_FRAME_6_60, |
| 400 | AMRWB_FRAME_8_85, |
| 401 | AMRWB_FRAME_12_65, |
| 402 | AMRWB_FRAME_14_25, |
| 403 | AMRWB_FRAME_15_85, |
| 404 | AMRWB_FRAME_18_25, |
| 405 | AMRWB_FRAME_19_85, |
| 406 | AMRWB_FRAME_23_05, |
| 407 | AMRWB_FRAME_23_85, |
| 408 | AMRWB_FRAME_SID, |
| 409 | //AMR WB frame type 10, reserved for future use |
| 410 | //AMR WB frame type 11, reserved for future use |
| 411 | //AMR WB frame type 12, reserved for future use |
| 412 | //AMR WB frame type 13, reserved for future use |
| 413 | //AMR WB frame type 14, speech lost, not used |
| 414 | //AMR WB frame type 15, No Data, use AMR_FRAME_NO_DATA for both NB and WB |
| 415 | #endif /*__AMRWB_LINK_SUPPORT__ */ |
| 416 | |
| 417 | MAX_NO_OF_FRAME_TYPE, // 25 |
| 418 | AMR_FRAME_TYPE_ALL_BARRED = 31 |
| 419 | } tAMRWB_FrameType; |
| 420 | |
| 421 | typedef enum |
| 422 | { |
| 423 | stCSR_UNKNOWN_PHASE, |
| 424 | stCSR_ODD_FRAME, |
| 425 | stCSR_EVEN_FRAME |
| 426 | } tCSR_CodecPhase; |
| 427 | |
| 428 | typedef struct |
| 429 | { |
| 430 | U8 sizeOfAMRClass[MAX_AMR_CLASS]; |
| 431 | } Size_AMRClasses; |
| 432 | |
| 433 | #ifdef __AMRWB_LINK_SUPPORT__ |
| 434 | /* MAUI_01966343, requested subflow size may exceed 255 */ |
| 435 | typedef struct |
| 436 | { |
| 437 | U16 sizeOfClassA; |
| 438 | U16 sizeOfClassB; |
| 439 | U16 sizeOfClassC; |
| 440 | U16 totalSize; |
| 441 | } FrameType_DataRate; |
| 442 | #else |
| 443 | typedef struct |
| 444 | { |
| 445 | U8 sizeOfClassA; |
| 446 | U8 sizeOfClassB; |
| 447 | U8 sizeOfClassC; |
| 448 | U8 totalSize; |
| 449 | } FrameType_DataRate; |
| 450 | #endif /* __AMRWB_LINK_SUPPORT__ */ |
| 451 | |
| 452 | #ifdef __EM_MODE__ |
| 453 | typedef enum |
| 454 | { |
| 455 | /* EM disable */ |
| 456 | CSR_EM_NONE = 0x0, |
| 457 | /* bit 1: update to ELT */ |
| 458 | CSR_EM_ELT = 0x1, |
| 459 | /* bit 2: update to AP */ |
| 460 | CSR_EM_AP = 0x2 |
| 461 | } tCSR_UpdateEmSource; |
| 462 | #endif |
| 463 | |
| 464 | typedef struct |
| 465 | { |
| 466 | /* RAB id */ |
| 467 | U8 CSREntityId; |
| 468 | |
| 469 | /* Stream id */ |
| 470 | U8 StreamId; |
| 471 | tCSR_States CSRCurrentState; |
| 472 | tCSR_TargetEntity CSRTargetEntity; |
| 473 | U8 CSRRabMode; |
| 474 | |
| 475 | /* MAUI_02375904 */ |
| 476 | |
| 477 | /* number of RB */ |
| 478 | U8 NumRBs; |
| 479 | /* RB IDs */ |
| 480 | U8 RB[MAX_RBS_IN_RAB]; |
| 481 | U8 RBWithStatus; |
| 482 | /* SDU of each RB */ |
| 483 | U16 ReqSizeOfRBs[MAX_RBS_IN_RAB]; |
| 484 | |
| 485 | /* ~MAUI_02375904 */ |
| 486 | |
| 487 | U16 dataLength; |
| 488 | U8* dlPdu; |
| 489 | |
| 490 | /* Current CodecType */ |
| 491 | tCSR_SpeechCodecType CodecType; |
| 492 | tCSR_CodecPhase CodecPhase; |
| 493 | |
| 494 | /* Current UL Codec Data Rate */ |
| 495 | AMRFrameType CurCodec; |
| 496 | U8 maxCsDelay; |
| 497 | U8 prevRxNWDelay; |
| 498 | |
| 499 | /* RLC TM segment config of each RB */ |
| 500 | kal_bool ulRLCSegment[MAX_RBS_IN_RAB]; |
| 501 | |
| 502 | /* Current DL Codec Data Rate */ |
| 503 | AMRFrameType CurDLCodec; |
| 504 | } aCSRContext; |
| 505 | |
| 506 | typedef struct |
| 507 | { |
| 508 | U8 activeSim; /* for L+W GEMINI, 0:SIM1, 1:SIM2; for single SIM, it will be always 0 */ |
| 509 | U8 NoOfCSREntityExist; |
| 510 | KAL_AFM_ID afm_id; |
| 511 | aCSRContext *CSRWorkSpace[MAX_NO_OF_CSR_ENTITY]; |
| 512 | #ifdef __EM_MODE__ |
| 513 | kal_bool is_EM_activate; |
| 514 | U8 EmSrc; /* The bitmap whom CSR need to update EM information to */ |
| 515 | kal_bool EmNeedUpdate; |
| 516 | #endif /* __EM_MODE__ */ |
| 517 | } aCSREntityInfo; |
| 518 | |
| 519 | typedef struct |
| 520 | { |
| 521 | LOCAL_PARA_HDR |
| 522 | U8 streamId; |
| 523 | U8 frameType; |
| 524 | U8 data[MAX_AMR_FRAME_SIZE]; |
| 525 | } csr_amr_data_ind_struct; |
| 526 | |
| 527 | typedef enum |
| 528 | { |
| 529 | CSR_ILM_INVALID, |
| 530 | CSR_ILM_ACCEPT, |
| 531 | CSR_ILM_IGNORE |
| 532 | } tCSR_GeminiIlmCheck; |
| 533 | |
| 534 | typedef enum |
| 535 | { |
| 536 | stCSR_UL_FRAME, |
| 537 | stCSR_DL_FRAME |
| 538 | } tCSR_FrameDirect; |
| 539 | |
| 540 | /* GLOBAL VARIABLE DECLARATIONS *********************************************/ |
| 541 | extern aCSREntityInfo FDD_CSREntityInfo; |
| 542 | |
| 543 | /* PUBLIC FUNCTION PROTOTYPES ***********************************************/ |
| 544 | /* FDD Functions ************************************************************/ |
| 545 | extern void FDD_CsrInitCSREntityInfo(void); |
| 546 | extern void FDD_CsrResetCSREntityInfo(void); |
| 547 | extern void FDD_CsrProcessCCUCSRSetRoutingReq(ilm_struct *RcvMsg); |
| 548 | extern void FDD_CsrProcessCCSRRabEstablishInd(ilm_struct *RcvMsg); |
| 549 | extern void FDD_CsrProcessCCSRRabModifyInd(ilm_struct *RcvMsg); |
| 550 | extern void FDD_CsrProcessCCSRRabReleaseInd(ilm_struct *RcvMsg); |
| 551 | extern void FDD_CsrProcessCSRUmacTfcInd(ilm_struct *RcvMsg); |
| 552 | extern void FDD_CsrProcessCSRStatusInd(ilm_struct *RcvMsg); |
| 553 | extern void FDD_CSR_SP3G_Callback(SP3G_Event event, void *data); |
| 554 | extern void FDD_CsrProcessTstInjectMsg(ilm_struct *RcvMsg); |
| 555 | |
| 556 | #ifdef __CSHSPA_SUPPORT__ |
| 557 | extern void SP3GHSPA_UL_GetSpeechFrame(kal_uint8 *frame_type, kal_uint8 *rab_byte_array, kal_uint8 *len); |
| 558 | extern void SP3GHSPA_DL_PutSpeechFrame(kal_uint32 CFN, kal_uint8 frame_type, kal_bool crc_status, kal_uint8 *subflow); |
| 559 | extern void SP3GHSPA_DL_SetMaxCsDelay(kal_uint8 max_cs_delay); |
| 560 | #endif |
| 561 | |
| 562 | #ifdef __RATDM_UL_SHAQ__ |
| 563 | extern void FDD_CsrFreeTmElmt(kal_uint8 *addr); |
| 564 | #ifdef __CSHSPA_SUPPORT__ |
| 565 | extern void FDD_CsrFreeUmElmt(kal_uint8 *addr); |
| 566 | #endif |
| 567 | #endif |
| 568 | |
| 569 | #if 0 |
| 570 | #ifdef __3G_NEW_CS_DL_ARCH__ |
| 571 | /* under construction !*/ |
| 572 | #else |
| 573 | /* under construction !*/ |
| 574 | #endif |
| 575 | #endif |
| 576 | |
| 577 | #ifdef __VIDEO_CALL_SUPPORT__ |
| 578 | extern void FDD_vt_csr_activate_req(void); |
| 579 | extern void FDD_vt_csr_deactivate_req(void); |
| 580 | #endif |
| 581 | |
| 582 | #if defined(__GEMINI__) && defined(__GEMINI_WCDMA__) |
| 583 | extern tCSR_GeminiIlmCheck FDD_CsrGeminiGuardIlm(ilm_struct *ilm_ptr); |
| 584 | #endif |
| 585 | |
| 586 | #ifdef __EM_MODE__ |
| 587 | extern void FDD_CsrProcessL4CpsEMUpdateReq(ilm_struct *ilm_ptr); |
| 588 | #endif |
| 589 | |
| 590 | #ifndef __MTK_TARGET__ |
| 591 | extern void FDD_CsrProcessCSRUnitTestMsg(ilm_struct *RcvMsg); |
| 592 | #endif |
| 593 | |
| 594 | /* TDD Functions ***********************************************************/ |
| 595 | extern void TDD_InitCSREntityInfo(void); |
| 596 | extern void TDD_ResetCSREntityInfo(void); |
| 597 | extern U8 TDD_GetCSRWorkSpace(U8 CSRId, U8 action); |
| 598 | extern void TDD_ProcessCCUCSRSetRoutingReq(ilm_struct *RcvMsg); |
| 599 | extern void TDD_ProcessCCSRRabEstablishInd(ilm_struct *RcvMsg); |
| 600 | extern void TDD_ProcessCCSRRabModifyInd(ilm_struct *RcvMsg); |
| 601 | extern void TDD_ProcessCCSRRabReleaseInd(ilm_struct *RcvMsg); |
| 602 | extern void TDD_ProcessUCSDDataReq(ilm_struct* RcvMsg); |
| 603 | extern void TDD_ProcessCSRUmacTfcInd(ilm_struct *RcvMsg); |
| 604 | extern void TDD_ProcessCSRStatusInd(ilm_struct* RcvMsg); |
| 605 | |
| 606 | #ifdef __VIDEO_CALL_SUPPORT__ |
| 607 | extern void TDD_vt_csr_activate_req(void); |
| 608 | extern void TDD_vt_csr_deactivate_req(void); |
| 609 | #endif |
| 610 | |
| 611 | #ifdef __EM_MODE__ |
| 612 | extern void TDD_ProcessL4CpsEMUpdateReq(ilm_struct *ilm_ptr); |
| 613 | #endif |
| 614 | |
| 615 | void TDD_UpdateCodecToEmInfo(tCSR_FrameDirect dir, U8 frameType); |
| 616 | extern void TDD_ProcessPLAUUSAUDConfigMappingInd(ilm_struct *RcvMsg); |
| 617 | extern void TDD_ProcessPLAUUSAUDConfigMappingCnf(ilm_struct *RcvMsg); |
| 618 | |
| 619 | #if 0 |
| 620 | /* under construction !*/ |
| 621 | /* under construction !*/ |
| 622 | #endif |
| 623 | |
| 624 | extern void TDD_ProcessUUSAUDCoderDataCnf(ilm_struct *RcvMsg); |
| 625 | |
| 626 | #ifndef __MTK_TARGET__ |
| 627 | extern void TDD_ProcessCSRUnitTestMsg(ilm_struct *RcvMsg); |
| 628 | #endif |
| 629 | |
| 630 | extern kal_uint8 FDD_CSR_GetActiveSIM(void); |
| 631 | |
| 632 | |
| 633 | #endif /* CSR_FSM_H */ |