blob: c3cf8400b053d384ea5d74f2442b0b981016d2b0 [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/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * l1_dm.h
41 *
42 * Project:
43 * --------
44 * Maui_Software
45 *
46 * Description:
47 * ------------
48 * This file is for the dual mode operation.
49 *
50 * Author:
51 * -------
52 * -------
53 *
54 *============================================================================
55 * HISTORY
56 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
57 *------------------------------------------------------------------------------
58 * removed!
59 * removed!
60 * removed!
61 *
62 * removed!
63 * removed!
64 *
65 * removed!
66 * removed!
67 * removed!
68 *
69 * removed!
70 * removed!
71 * removed!
72 *
73 * removed!
74 * removed!
75 * removed!
76 * removed!
77 *
78 * removed!
79 * removed!
80 * removed!
81 * removed!
82 *
83 * removed!
84 * removed!
85 *
86 * removed!
87 * removed!
88 *
89 * removed!
90 * removed!
91 * removed!
92 * removed!
93 *
94 * removed!
95 * removed!
96 * removed!
97 * removed!
98 *
99 * removed!
100 * removed!
101 * removed!
102 *
103 * removed!
104 * removed!
105 * removed!
106 *
107 * removed!
108 * removed!
109 *
110 * removed!
111 * removed!
112 *
113 * removed!
114 * removed!
115 *
116 * removed!
117 * removed!
118 *
119 * removed!
120 * removed!
121 *
122 * removed!
123 * removed!
124 *
125 * removed!
126 * removed!
127 * removed!
128 *
129 * removed!
130 * removed!
131 *
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 * removed!
158 *
159 * removed!
160 * removed!
161 * removed!
162 *
163 * removed!
164 * removed!
165 *
166 * removed!
167 * removed!
168 *
169 * removed!
170 * removed!
171 * removed!
172 *
173 * removed!
174 * removed!
175 * removed!
176 *
177 * removed!
178 * removed!
179 * removed!
180 *
181 * removed!
182 * removed!
183 * removed!
184 *
185 * removed!
186 * removed!
187 * removed!
188 *
189 * removed!
190 * removed!
191 * removed!
192 *
193 * removed!
194 * removed!
195 * removed!
196 *
197 * removed!
198 * removed!
199 * removed!
200 *
201 * removed!
202 * removed!
203 * removed!
204 *
205 * removed!
206 * removed!
207 * removed!
208 *
209 * removed!
210 * removed!
211 * removed!
212 * removed!
213 *
214 * removed!
215 * removed!
216 *
217 * removed!
218 * removed!
219 * removed!
220 *
221 * removed!
222 * removed!
223 * removed!
224 *
225 * removed!
226 * removed!
227 * removed!
228 *
229 * removed!
230 * removed!
231 * removed!
232 *
233 * removed!
234 * removed!
235 * removed!
236 *
237 * removed!
238 * removed!
239 * removed!
240 *
241 * removed!
242 * removed!
243 * removed!
244 * removed!
245 * removed!
246 *
247 * removed!
248 * removed!
249 * removed!
250 *
251 * removed!
252 * removed!
253 * removed!
254 *
255 * removed!
256 * removed!
257 * removed!
258 *
259 * removed!
260 * removed!
261 * removed!
262 *
263 * removed!
264 * removed!
265 * removed!
266 *
267 * removed!
268 * removed!
269 * removed!
270 *
271 * removed!
272 * removed!
273 * removed!
274 *
275 * removed!
276 * removed!
277 * removed!
278 *
279 * removed!
280 * removed!
281 * removed!
282 *
283 * removed!
284 * removed!
285 *
286 * removed!
287 * removed!
288 * removed!
289 *
290 * removed!
291 * removed!
292 *
293 * removed!
294 * removed!
295 * removed!
296 *
297 * removed!
298 * removed!
299 * removed!
300 *
301 * removed!
302 * removed!
303 * removed!
304 *
305 * removed!
306 * removed!
307 * removed!
308 *
309 * removed!
310 * removed!
311 * removed!
312 *
313 * removed!
314 * removed!
315 * removed!
316 *
317 * removed!
318 * removed!
319 * removed!
320 *
321 * removed!
322 * removed!
323 * removed!
324 *
325 * removed!
326 * removed!
327 *
328 * removed!
329 * removed!
330 * removed!
331 *
332 * removed!
333 * removed!
334 * removed!
335 *
336 * removed!
337 * removed!
338 *
339 * removed!
340 * removed!
341 *
342 * removed!
343 * removed!
344 * removed!
345 * removed!
346 * removed!
347 * removed!
348 * removed!
349 * removed!
350 * removed!
351 * removed!
352 * removed!
353 * removed!
354 * removed!
355 * removed!
356 * removed!
357 *
358 * removed!
359 * removed!
360 * removed!
361 *
362 * removed!
363 * removed!
364 * removed!
365 *
366 * removed!
367 * removed!
368 * removed!
369 *
370 * removed!
371 * removed!
372 * removed!
373 *
374 * removed!
375 * removed!
376 * removed!
377 *
378 * removed!
379 * removed!
380 * removed!
381 *
382 * removed!
383 * removed!
384 * removed!
385 *
386 * removed!
387 * removed!
388 * removed!
389 *
390 * removed!
391 * removed!
392 * removed!
393 *
394 * removed!
395 * removed!
396 * removed!
397 *
398 * removed!
399 * removed!
400 * removed!
401 *
402 * removed!
403 * removed!
404 * removed!
405 *
406 * removed!
407 * removed!
408 * removed!
409 *
410 * removed!
411 * removed!
412 * removed!
413 *
414 * removed!
415 * removed!
416 * removed!
417 *
418 * removed!
419 * removed!
420 * removed!
421 *
422 * removed!
423 * removed!
424 * removed!
425 *
426 * removed!
427 * removed!
428 * removed!
429 *
430 * removed!
431 * removed!
432 * removed!
433 *
434 * removed!
435 * removed!
436 * removed!
437 *
438 * removed!
439 * removed!
440 * removed!
441 *
442 * removed!
443 * removed!
444 * removed!
445 *
446 * removed!
447 * removed!
448 * removed!
449 *
450 * removed!
451 * removed!
452 * removed!
453 *
454 * removed!
455 * removed!
456 * removed!
457 *
458 * removed!
459 * removed!
460 * removed!
461 *
462 * removed!
463 * removed!
464 * removed!
465 *
466 * removed!
467 * removed!
468 * removed!
469 *
470 * removed!
471 * removed!
472 * removed!
473 *
474 * removed!
475 * removed!
476 * removed!
477 *
478 * removed!
479 * removed!
480 * removed!
481 *
482 * removed!
483 * removed!
484 * removed!
485 *
486 * removed!
487 * removed!
488 * removed!
489 *
490 * removed!
491 * removed!
492 * removed!
493 *
494 * removed!
495 * removed!
496 * removed!
497 *
498 * removed!
499 * removed!
500 * removed!
501 *
502 * removed!
503 * removed!
504 * removed!
505 *
506 * removed!
507 * removed!
508 * removed!
509 *
510 * removed!
511 * removed!
512 * removed!
513 *
514 * removed!
515 * removed!
516 * removed!
517 *
518 * removed!
519 * removed!
520 * removed!
521 *
522 * removed!
523 * removed!
524 * removed!
525 *
526 * removed!
527 * removed!
528 * removed!
529 *
530 * removed!
531 * removed!
532 * removed!
533 *
534 * removed!
535 * removed!
536 * removed!
537 *
538 * removed!
539 * removed!
540 * removed!
541 *
542 * removed!
543 * removed!
544 * removed!
545 *
546 * removed!
547 * removed!
548 * removed!
549 *
550 * removed!
551 * removed!
552 * removed!
553 *
554 * removed!
555 * removed!
556 * removed!
557 *
558 * removed!
559 * removed!
560 * removed!
561 *
562 * removed!
563 * removed!
564 * removed!
565 *
566 * removed!
567 * removed!
568 * removed!
569 *
570 * removed!
571 * removed!
572 * removed!
573 *
574 * removed!
575 * removed!
576 * removed!
577 *
578 * removed!
579 * removed!
580 * removed!
581 *
582 * removed!
583 * removed!
584 * removed!
585 *
586 * removed!
587 * removed!
588 * removed!
589 *
590 * removed!
591 * removed!
592 * removed!
593 *
594 * removed!
595 * removed!
596 * removed!
597 *
598 * removed!
599 * removed!
600 * removed!
601 *
602 * removed!
603 * removed!
604 * removed!
605 *
606 * removed!
607 * removed!
608 * removed!
609 *
610 * removed!
611 * removed!
612 * removed!
613 *
614 * removed!
615 * removed!
616 * removed!
617 *
618 * removed!
619 * removed!
620 * removed!
621 *
622 * removed!
623 * removed!
624 * removed!
625 *
626 * removed!
627 * removed!
628 * removed!
629 *
630 * removed!
631 * removed!
632 * removed!
633 *
634 * removed!
635 * removed!
636 * removed!
637 * removed!
638 *
639 * removed!
640 * removed!
641 * removed!
642 *------------------------------------------------------------------------------
643 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
644 *============================================================================
645 ****************************************************************************/
646
647#ifndef L1_DM_H
648#define L1_DM_H
649
650#include "l1_surround_private.h"
651#include "common_reg.h"
652#include "l1d_data_l1core.h"
653#include "l1d_cid.h"
654#include "l1_types.h"
655#include "l1_core_private.h"
656#include "mph_types.h"
657#include "tool.h"
658#include "kal_general_types.h"
659#include "mll1_gsm.h"
660#include "gmss_public.h"
661
662/****************************** enum begin ************************************/
663typedef enum
664{
665 UMTS_FDD_IDLE,
666 UMTS_FDD_FACH,
667 UMTS_FDD_EFACH_DRX,
668 UMTS_FDD_DCH,
669 UMTS_TDD_IDLE,
670 UMTS_TDD_FACH,
671 UMTS_TDD_DCH,
672 UMTS_C2K_IDLE,
673 LTE_IDLE,
674 LTE_DCH,
675 LTE_DCH_DRX,
676 GSM_IDLE,
677 GSM_DCH,
678 NEWRADIO_IDLE,
679 NEWRADIO_DCH,
680 MM_NULL
681} mm_mode_enum;
682
683#if 0
684/* under construction !*/
685/* under construction !*/
686/* under construction !*/
687/* under construction !*/
688/* under construction !*/
689/* under construction !*/
690/* under construction !*/
691/* under construction !*/
692/* under construction !*/
693/* under construction !*/
694/* under construction !*/
695/* under construction !*/
696/* under construction !*/
697/* under construction !*/
698/* under construction !*/
699/* under construction !*/
700/* under construction !*/
701#endif
702
703/****************************** enum end **************************************/
704
705
706
707/****************************** define begin ************************************/
708#define L1C_AG_AHEAD_FRAME 9
709#define L1C_AG_LENGTH_EBIT 173333 /* 80ms for 2G active */
710#define L1C_AG_NOT_CNF_LENGTH (-1) //
711
712
713#define L1C_NORMAL_GAP_SERVICE (0x1)
714#define L1C_AUTO_GAP_SERVICE (0x2)
715#define L1C_GAP_STOP_TIME 3
716
717#define GL1_GAP_NUM_IN_PERIOD GSM_SESSION_IN_PERIOD
718
719/* define database switch macros for 2G standby */
720#ifdef __GERAN_R8__
721#define SIM_REG_BA_OFFSET ( L1C_SIM1 ) //0
722#define SIM_PRIO_BA_OFFSET ( L1C_SIM_NUM ) //L1C_SIM_NUM
723#define SWITCH_TO_PRIO_RESEL_STANDBY() ( l1c_sim_prio_ba_offset = SIM_PRIO_BA_OFFSET ) /* be called only when the sim is in standby mode */
724#define SWITCH_TO_REG_RESEL_STANDBY() ( l1c_sim_prio_ba_offset = SIM_REG_BA_OFFSET )
725#define SWITCH_TO_ASSIGNED_RESEL_STANDBY( mode ) ( l1c_sim_prio_ba_offset = (( mode == REG_RESEL_STANDBY )? SIM_REG_BA_OFFSET : SIM_PRIO_BA_OFFSET ) )
726#define L1C_RESEL_MODE_STANDBY ( (l1c_sim_prio_ba_offset == SIM_REG_BA_OFFSET)? REG_RESEL_STANDBY : PRIO_RESEL_STANDBY )
727#define IS_PRIO_RESEL_MODE_STANDBY ( l1c_sim_prio_ba_offset == SIM_PRIO_BA_OFFSET )
728#define IS_REG_RESEL_MODE_STANDBY ( l1c_sim_prio_ba_offset == SIM_REG_BA_OFFSET )
729#else
730#define L1C_RESEL_MODE_STANDBY ( REG_RESEL_STANDBY )
731#endif /* __GERAN_R8__ */
732
733/* define L1C MM mode macros for 2G standby */
734#define L1C_IS_CONNECTED_STANDBY(mode) ( mode == UMTS_FDD_FACH || mode == UMTS_TDD_FACH || mode == UMTS_FDD_DCH || mode == UMTS_TDD_DCH || mode == LTE_DCH )
735#define L1C_IS_IDLE_STANDBY(mode) ( mode == UMTS_FDD_IDLE || mode == UMTS_TDD_IDLE || mode == UMTS_C2K_IDLE || mode == LTE_IDLE || mode == NEWRADIO_IDLE )
736#define L1C_IS_IDLE_OR_CON_DRX_STANDBY(mode) ( mode == UMTS_FDD_IDLE || mode == UMTS_TDD_IDLE || mode == UMTS_FDD_EFACH_DRX || mode == UMTS_C2K_IDLE || mode == LTE_IDLE || mode == LTE_DCH_DRX || mode == NEWRADIO_IDLE )
737
738/* this macro must be used in 2g standby */
739#define L1C_IS_UTRAN_TDD_MODE_STANDBY(mode) ( mode == UMTS_TDD_FACH || mode == UMTS_TDD_DCH || mode == UMTS_TDD_IDLE )
740#define L1C_IS_UTRAN_TDD_MODE_CONNECTED_STANDBY(mode) ( mode == UMTS_TDD_FACH || mode == UMTS_TDD_DCH )
741
742
743#define GL1_CHECK_BIT(a, mask) ( ((a)&(mask)) != 0 )
744#define GL1_SET_BIT(a, mask) ( (a) |= (mask) )
745#define GL1_CLEAR_BIT(a, mask) ( (a) &= ~(mask) )
746
747
748
749#define DEFAULT_PM_PASS_PER_PERIOD_IDLE 1
750#define DEFAULT_PM_PASS_PER_PERIOD_EFACH_DRX 1
751#define DEFAULT_PM_PASS_PER_PERIOD_DCH_FACH 3
752#define DEFAULT_PM_PASS_PER_PERIOD_LTE_CONNECTED_DRX 1
753#define MAX_TRIES_FB_PLMN_2G_STANDBY 2
754#define MIN_3G_GAP_FRAME 8 /* 2 blocks, to avoid PCh norm/ext case. */
755#define RF_ADDITIONAL_MARGIN_FOR_SB_HEAD_EBITS (TQ_SBWIN_DSP_EXTEND1 * 2)
756#define RF_ADDITIONAL_MARGIN_FOR_SB_TAIL_EBITS (TQ_SBWIN_DSP_EXTEND2 * 2)
757#define FB_MAX_WINDOW_SLOTS (12*8+3)
758#define FB_MAX_SEARCH_TOTAL_SLOTS (FB_MAX_WINDOW_SLOTS*8) /* use to stop FB search if UMTS_IDLE gap < FB_MAX_WINDOW_SLOTS */
759#define FRAME_IN_EBITS 10000
760#define SLOT_IN_EBITS 1250
761#define FB_MIN_WINDOW_EBITS 2176 //TDD gap use
762#define FB_MIN_WINDOW_SLOTS 3 //FDD/LTE gap use
763
764#ifdef __UMTS_RAT__ // TDD needs 106, FDD needs 36
765#define L1_MAX_GAP_HANDLER 106
766#endif
767
768#if 0
769/* under construction !*/
770/* under construction !*/
771/* under construction !*/
772/* under construction !*/
773/* under construction !*/
774/* under construction !*/
775/* under construction !*/
776/* under construction !*/
777/* under construction !*/
778/* under construction !*/
779/* under construction !*/
780/* under construction !*/
781/* under construction !*/
782/* under construction !*/
783#endif
784
785#ifdef __UMTS_RAT__
786#define TD_SUBFRAME_TO_EBIT 10833 //10840
787#define TD_SLOT_TO_EBIT 1462
788#define LONG_GAP_LEN_FACH_DCH 10000 //10000
789#define MIN_SB_DELAY_ALLOW_FB_SEARCH 32502 /* # of ebit for 15ms */
790#define DEFALT_BSIC_RECONFIRM_TIME 5000 /* in unit of ms */
791#define DEFALT_BSIC_SEARCH_ABORT_TIME (DEFALT_BSIC_RECONFIRM_TIME*10/46) /* in unit of TDMA frames */
792#endif
793
794#ifdef __GL1_GEMINI__
795#if defined( __GL1_GEMINI_WCDMA__ ) || defined( __GEMINI__ ) || defined( __CDMA2000_RAT__ ) || defined( __IRAT_MEAS_SUPPORT_IN_VIRTUAL_MODE__ )
796#define STANDBY_MEAS_LENGTH_ACTIVE_IDLE 2 //unit: frame
797#endif
798#endif
799
800#define SRVCC_USE_CGI_AUTO_GAPS 1
801
802#if (SRVCC_USE_CGI_AUTO_GAPS)
803#define SRVCC_BOOST_IN_QDBM 1
804#define SRVCC_MAX_BOOST_RANGE_IN_QDBM 12
805#define MAX_SRVCC_BSIC_ATTEMPTS 2
806#endif
807/****************************** define end **************************************/
808
809
810/****************************** struct begin ************************************/
811typedef struct Gap_Handler Gap_Handler;
812
813struct Gap_Handler
814{
815 Time start_time;
816 bool pm_period_start;
817 gsm_tgmp_enum purpose;
818 kal_uint16 gap_num;
819 sGAP gap[GL1_MAX_GAP_NUM_IN_ONE_FRAME];
820 kal_bool gap_reschedule;
821 Gap_Handler* prev;
822 Gap_Handler* next;
823};
824
825typedef struct
826{
827 Gap_Handler GAPPool[L1_MAX_GAP_HANDLER];
828 Gap_Handler* unusedGAPs[L1_MAX_GAP_HANDLER];
829 Gap_Handler* usedGAPs[L1_MAX_GAP_HANDLER];
830 Gap_Handler* running_gap;
831 Gap_Handler* gapTimer_gap;
832 Gap_Handler* bsic_gap;
833 kal_uint32 t_reconfirm; /* In unit of TDMA frames(4.6ms). used for fach/dch/lte connected */
834 kal_uint32 t_identify; /* In unit of TDMA frames(4.6ms). used for fach/dch/lte connected*/
835 kal_uint32 bsic_reconfirm_para; /* In unit of msec. Used in FACH/DCH mode. */
836 Time next_session_start_after; //for FB gap in the end of period, the first session in the next session must >= this time
837 uint16 fb_search_cnt_down;
838 kal_uint8 unusedGAPCount;
839 kal_uint8 usedGAPCount;
840#ifdef __LTE_RAT__
841 kal_uint8 tds_lte_left_gap_idx; //use for lte left pattern calculation
842#endif /*__LTE_RAT__*/
843} GapGlobal;
844
845typedef struct
846{
847 mm_mode_enum mode;
848 Timer activeRATTimer;
849 Timer standbyRATTimer;
850 /* 3G active, common parameters */
851 kal_bool pm_meas_started;
852 intx pm_cell_num[ NUM_RESEL_MODE_STANDBY ];
853 kal_bool lock_sm;
854 bool Dedi3G;
855 kal_uint8 GAPStatus; //bit0: normal gap, bit1: auto gap
856 kal_bool gap_suspended; // fmo_lock
857 kal_uint8 wait_HW_stop_count; /* frame countdown to wait 2G FB/SB, PM stop */
858 bool umts_hspa; //TDS
859
860 /* Power Scan */
861 kal_bool power_scan_started;
862 kal_bool tempStopPSM;
863 /* RSSI measurement */
864 kal_uint8 pm_pass_per_period; /* Default=1. */
865 kal_uint8 pm_pass_this_period[ NUM_RESEL_MODE_STANDBY ];
866 kal_uint8 pm_tid[ NUM_RESEL_MODE_STANDBY ];
867 kal_uint8 pm_tid_new[ NUM_RESEL_MODE_STANDBY ];
868 bool pm_tid_done[ NUM_RESEL_MODE_STANDBY ];
869 bool next_pm_start_time_valid;
870 kal_uint8 next_pm_pass_per_period; //FDD connected
871 Time next_pm_start_time; //FDD connected
872 intx next_pm_cell_num; //connected
873 kal_uint8 arfcn_count_measured; //the number of arfcn that have been measured; reset when ba is changed or avg is reset
874#if 1 //def __GL1_GEMINI__
875// Timer idleSuspendPM; //used to stop measurement at the end of idle gap
876#endif
877 bool stopAllMeas; //only TDS use
878 //bool skip_next_gap; //TDS /* after long fb search gap in FACH/DCH, skip next gap to prevent conflict */
879 Timer pmSessionTimer; //TDS
880
881 /* BSIC search */
882 Timer sbTimer;
883 Timer fbTimer;
884 Timer bsicSCTimer;
885 Timer dummyFBTimer;
886 Timer SRVCCGapSetTimer;
887 Timer SRVCCGapResetTimer;
888 bool resetSRVCCGapMeas;
889 bool first_gap_notify;
890 uint16 default_sb_window_ebits;
891 TID fb_tid;
892 TID sb_tid;
893 bool fb_started;
894 bool sb_started;
895 bool retry_sb;
896 bool fb_max_window;
897 kal_uint16 fb_total_search_slot; /* used to count total FB search slot in UMTS_IDLE */
898 intx fb_slot_count; //slot for FDD, ebit for TDD
899 AGCCellData bsic_agc_cell;
900 //AfcParams* afc;
901 /*FDD*/
902 //kal_uint8 bsic_slot; /* For FB window. */
903 //scCellBSIC* bsic_cell; /* For FB or SB. */
904 //AGCCellData cell;
905 //ARFCN fb_arfcn;
906 /* Gap Handler and Timing sync. */
907 Timer gapTimer;
908 Timer gapStopTimer_all; //syy
909 Timer gapStopTimer_suspend; //syy: fmo lock timer
910 Timer syncTimer;
911 TID sync_tid;
912 Time sync_offset;
913 //Time sync_start_time;
914
915
916 /* For 2G active */
917 Timer search_3gTimer;
918 kal_int8 GAPreservedFrames; /* The gap reserved frames for 3G, ex Timer_3GSearch, TimerAutoGap. Only SIM1 need to check it. */
919 intx search_3g_FN26;
920 kal_uint8 search_3g_state_cnt; /* Range: 0~7. If equals 7, it will be reset to 0, and enters CM state. */
921 kal_bool gap_schedule_started;
922 /* For 2G active/PCH, assign DRX period to 3G. */
923 bool rf_checked;
924 bool l1i_checked;
925 bool rf_sleep;
926 kal_uint16 l1i_sleep_frame;
927 kal_uint16 l1i_sleep_ebit;
928 bool umts_gap_running;
929 Time umts_gap_start_time;
930 kal_uint32 umts_gap_len;
931 TID GAPtid;
932 TID SuspendGaptid;
933
934 /* Measurement priority */
935 MeasurementPriority meas_priority;
936 MeasurementPriority meas_priority_cgi;
937 MeasurementPriority meas_priority_scan;
938#ifdef __GERAN_R8__
939 MeasurementPriority meas_priority_higher;
940#endif /* __GERAN_R8__ */
941
942#ifdef __GERAN_R8__
943 kal_bool pm_meas_started_higher;
944#endif /* __GERAN_R8__ */
945
946#if defined ( __GL1_GEMINI__ )
947 Timer restartGAPtimer; // This variable is only used when active RAT is FDD or LTE.
948#endif
949
950/* TDS */
951 bool LockGAP;
952#if defined (__GL1_GEMINI__)
953 bool isChannelLock; //used in TD MM Gemini lock and unlock mechanism
954 /*dm_global.isChannelLock only can be set as true when TDD is active RAT, it cannot be set as true when FDD is active RAT.*/
955#endif /* defined (__GL1_GEMINI__) */
956
957 //kal_uint8 gapPurpose;
958 kal_bool DRX_Tick; //2G active, for drx tick in gap pattern
959
960 Timer autoGaptimer;
961 Timer autoGapReportTimer;
962 kal_int32 autoGaptimerLength; //the length L1C uses, from the time that AG can be used
963 kal_int32 autoGapLengthGive; //the length filled in report, from ST. If there's reservation after ST, this will be longer than autoGaptimerLength
964
965 kal_bool standbyAGConfirm;
966 kal_int8 standbyAGUseCount;
967 Time standbyAGStartTime;
968 kal_int32 standbyAGLength; //-1 means not confirmed
969 Timer standbyAGStopTimer; //used to wait for L1D stop to send ReportGSMAutoGAPStop
970 Timer standbyAGEndTimer; //used to send reportGapEnd when reportCGI is stopped by upper layer
971#ifdef __GL1_GEMINI__
972#if defined( __GL1_GEMINI_WCDMA__ ) || defined( __GEMINI__ ) || defined( __CDMA2000_RAT__ ) || defined( __IRAT_MEAS_SUPPORT_IN_VIRTUAL_MODE__ )
973 Timer standbyMeasTimer; // used to schedule standby measurement for standby meas
974 Timer standbyMeasTimerPowerScan; // used to schedule standby measurement for manual power scan request
975#endif
976#endif
977#if defined( __GEMINI__ ) || defined( __IRAT_MEAS_SUPPORT_IN_VIRTUAL_MODE__ )
978 uint32 scanPeriod;
979 uint32 scanLength;
980 uint32 scanPeriod_PM;
981 uint32 scanLength_PM;
982 uint16 BSICPeriod;
983 uint8 rdrb_for_manualscan_standbymeas;
984 bool backup_meas;
985 bool backup_scan;
986#endif
987 intx arfcn_start_index_copy; //To backup the value of arfcn_start_index
988#ifdef __GL1_GEMINI__
989 Timer VirtualSuspendCnfTimer;
990#endif
991} DualModeGlobal;
992
993
994
995/****************************** struct end **************************************/
996
997
998
999
1000/****************************** function prototype begin ************************************/
1001/* for autonomous gap, common for FDD, TDD, LTE */
1002void L1T_AutoGAPStart( Time starting_time );
1003void L1T_AutoGAPEnd( void );
1004void L1T_GSMAutoGAPStop( void );
1005void L1T_GSMAutoGAPConfirm( kal_bool, kal_int32 );
1006
1007void L1I_Timer_AutoGap( Timer* timer );
1008void L1I_Timer_ReportAutoGap( Timer* timer );
1009void L1I_MMPutAutoGAP( void );
1010intx L1I_GetGSMAutoGAPLengthEbit( void );
1011void L1I_Timer_GSMAutoGAPStop(Timer* timer);
1012void L1I_Timer_GSMAutoGAPEnd(Timer* timer);
1013void L1T_ReRequestGSMAutoGAP( void );
1014void L1I_ReRequestGSMAutoGAP( void );
1015
1016
1017/* to suspend GL1 gap usage. to replace fach/fmo lock/unlock */
1018void L1T_SuspendGAP( void );
1019void L1T_ResumeGAP( void );
1020
1021void L1T_CancelGap_Lock_2G( void );
1022void L1T_CancelGap_Unlock_2G( void );
1023void L1T_SetGAPPurpose_idle(kal_uint16 gap_num, ll1_gsm_standby_gap_struct *gap);
1024void L1I_Start_SACCh_Timer( bool delay );
1025
1026void L1T_SetModeInStandby( ll1_active_rat_mode_status_enum mode );
1027void L1I_Internal_StopGAP(void);
1028Gap_Handler* L1I_UpdateRunningGap( l1c_mm_sim_mode_enum local_sim_mode );
1029
1030void L1T_GAPStatus(gl1_gap_status_enum GAPStatus);
1031void L1T_StartGAPSchedule( void );
1032void L1T_StopGAPSchedule (void);
1033void L1T_StopGAPPattern(void);
1034void L1I_NextBSIC_GAP(void);
1035void L1I_Update_HP_SB_UTRAN_TDD( Gap_Handler* gap );
1036void L1I_StartBSIC_GAP(Gap_Handler* gap);
1037void L1I_StartFB_GAP(Gap_Handler* gap);
1038void L1I_StartSB_GAP(Gap_Handler* gap);
1039void L1T_StandbyRAT(void);
1040void L1T_ActiveRAT(void);
1041void L1T_InterRATSyncGen(void);
1042void L1T_InitMM( void );
1043void L1I_Set_L1D_DM_State( void );
1044void L1I_Set_L1D_DM_Query_State( void );
1045void L1I_Start_GAP_Timer(void);
1046void L1I_Init_GAPSchedule(void); // bool priority_low );
1047void L1I_Timer_SB(Timer* timer);
1048void L1I_Timer_FB(Timer* timer);
1049#ifdef __GL1_GEMINI__
1050void L1I_Timer_VirtualSuspendCnf(Timer* timer);
1051#endif
1052
1053void L1D_FCCh_DM( Report *report, ARFCN arfcn, int32 gap_len_ebit, AfcParams *afcParams, int16 repeat_cnt, L1D_APIcaller_id caller );
1054void L1D_SCh_DM( Report *report, ARFCN arfcn, bool retry, intx ebitPosition, AfcParams *afcParams, L1D_APIcaller_id caller );
1055
1056void L1T_SetGAPPattern_NR(kal_uint16 session_num, ll1_gsm_standby_gap_struct* session, ll1_active_rat_mode_status_enum mode,
1057 kal_bool pm_tick, kal_uint8 pm_tid, kal_bool pm_tick_higher, kal_uint8 pm_tid_higher );
1058
1059#ifdef __LTE_RAT__
1060void L1T_SetGAPPattern_LTE(kal_uint16 session_num, ll1_gsm_standby_gap_struct* session, ll1_active_rat_mode_status_enum mode,
1061 kal_uint32 t_reconfirm, kal_uint32 t_identify, kal_uint16 gap_expand_period, kal_uint8 n_freq,
1062 kal_bool pm_tick, kal_uint8 pm_tid,
1063 kal_bool pm_tick_higher, kal_uint8 pm_tid_higher, kal_uint8 gap_set_num );
1064
1065void L1T_SetGAPPurpose_LTE_connected( kal_uint16 gap_num, ll1_gsm_standby_gap_struct *gap, kal_uint32 t_reconfirm_dch, kal_uint32 t_identify_dch, kal_uint16 gap_expand_period, kal_uint8 n_freq, kal_uint8 gap_set_num );
1066#endif /*__LTE_RAT__*/
1067
1068#ifdef __CDMA2000_RAT__
1069void L1T_SetGAPPattern_C2K( kal_uint16 gap_num, ll1_gsm_standby_gap_struct* gap, ll1_active_rat_mode_status_enum mode,
1070 kal_bool pm_tick, kal_uint8 pm_tid );
1071#endif
1072
1073#ifdef __GERAN_R8__
1074void L1T_SetGAPPattern_FDD( kal_uint16 gap_num, ll1_gsm_standby_gap_struct* gap, ll1_active_rat_mode_status_enum mode,
1075 kal_uint32 t_reconfirm, kal_uint32 t_identify,
1076 kal_bool pm_tick, kal_uint8 pm_tid,
1077kal_bool pm_tick_higher, kal_uint8 pm_tid_higher );
1078//void L1T_GAPScheduleDone( kal_uint8 tid, kal_bool priority_search );
1079#else
1080void L1T_SetGAPPattern_FDD( kal_uint16 gap_num, Gap_Session*gap, ll1_active_rat_mode_status_enum mode,
1081 kal_uint32 t_reconfirm, kal_uint32 t_identify,
1082 kal_bool pm_tick, kal_uint8 pm_tid );
1083//void L1T_StartGAPSchedule( void );
1084//void L1T_GAPScheduleDone( kal_uint8 tid );
1085#endif /* __GERAN_R8__ */
1086
1087#if defined ( __GL1_GEMINI__ ) && defined ( __GL1_MULTI_MODE__ )
1088void L1T_StopALTGAPSchedule_2( void );
1089void L1T_CancelGap_Lock_2G_2( void );
1090bool L1I_QueryAny2GStandbyLockSM( void );
1091bool L1I_QueryAnyDedicatedFlag( void );
1092#endif
1093
1094void L1I_Timer_GAP(Timer* timer);
1095void L1I_Schedule_GapPurpose_rssi( Gap_Handler* gap, Timer* timer );
1096
1097
1098/* L1 internal function for DM. */
1099void L1I_InternalFrameTick_DM (void);
1100void L1I_StartSB_Timer(scCellBSIC* cell, kal_bool retry, intx sb_ebitDelay);
1101void L1I_StartFB_Timer(scCellBSIC* cell, intx ebitDelay, intx slot_count);
1102intx L1I_GetNormalGapFBLength( l1c_sim_mode_enum local_sim_mode );
1103scCellBSIC* check_fb_position(Gap_Handler *gap, intx* ebitDelay, intx* slot_count);
1104scCellBSIC* check_sb_position(Gap_Handler *gap, intx* ebitDelay);
1105scCellBSIC* check_hp_sb_position(Gap_Handler *gap, intx* ebitDelay, bool* retry_sb, kal_uint16* sb_pos);
1106void L1_Prepare_HP_SB_Data( SChData* p );
1107kal_uint16 ebit_2_slot(intx ebit);
1108void L1T_SetGAPPurpose_fach( kal_uint16 gap_num, ll1_gsm_standby_gap_struct *gap, kal_uint32 t_reconfirm_fach, kal_uint32 t_identify_fach);
1109void L1T_SetGAPPurpose_dch( gsm_tgmp_enum change_purpose, kal_uint16 gap_num, ll1_gsm_standby_gap_struct *gap, kal_uint32 t_reconfirm_dch, kal_uint32 t_identify_dch);
1110
1111
1112intx L1I_GetNext_SB_Position( Time servTime, int32 frameOffset, intx ebitOffset, intx gap_delay );
1113kal_bool check_bcch_gap_coincide(intx timer_schedule_delay, intx gap_len, intx bcch_ebitDelay);
1114kal_bool check_sb_gap_coincide(intx gap_len, intx sb_ebitDelay);
1115kal_uint8 check_hp_sb_gap_coincide(intx gap_ebitDelay, intx len, intx sb_ebitDelay, kal_bool retry);
1116bool check_hp_sb_end(kal_uint16 hp_sb_pos);
1117
1118
1119//void L1I_Start_GAP_Timer(void);
1120#ifdef __GL1_GEMINI__
1121#if defined( __GL1_GEMINI_WCDMA__ ) || defined( __GEMINI__ ) || defined( __CDMA2000_RAT__ ) || defined( __IRAT_MEAS_SUPPORT_IN_VIRTUAL_MODE__ )
1122void L1I_Timer_StandbyMeas( Timer* timer );
1123void L1I_Timer_StandbyPowerScan (Timer* timer );
1124bool L1I_IsNeedToDoStandbyMeas( void );
1125void L1I_StartStandbyMeasTimer( void );
1126#endif
1127#endif
1128#ifdef __GL1_GEMINI_WCDMA__
1129void L1I_SetStandbyPwrScanPriority( bool is_PLMNList );
1130#endif
1131void L1I_Timer_Search_3g(Timer* timer);
1132void L1I_Timer_BSICSC(Timer* timer);
1133void L1I_Timer_DUMMYFB(Timer* timer);
1134void L1I_Timer_SRVCCGapSet(Timer* timer);
1135void L1I_Timer_SRVCCGapReset(Timer* timer);
1136void L1I_BackupARFCNIndex(void);
1137void L1I_RestoreARFCNIndex(void);
1138
1139void L1I_TimerStandby( Timer* timer );
1140void L1T_Next_BSICSC(void);
1141void L1T_StartStandby_Timer( void );
1142void L1I_Timer_IRATSync(Timer* timer);
1143void L1I_Timer_ActiveRAT(Timer* timer);
1144
1145void L1T_Search_3g_Start(void);
1146void L1T_DM_SetMode( SurroundMode newMode );
1147void L1T_DM_Set_search_3g_FN26(kal_uint8 search_3g_FN26);
1148
1149//void L1T_Init_GAPSchedule(void); // bool priority_low );
1150void L1I_Init_3G_GAP_SimMode( l1c_mm_sim_mode_enum local_sim_mode );
1151void L1I_Check_3G_GAP( l1c_mm_sim_mode_enum local_sim_mode );
1152
1153#ifdef MTK_SLEEP_ENABLE
1154bool L1I_Assign_3G_GAP( kal_uint16 l1i_sleep_frame );
1155#else
1156bool L1I_Assign_3G_GAP(void);
1157#endif
1158
1159bool L1I_Check_3G_GAP_From_Timer(int32 ebitDelay);
1160void L1I_gsm_gap_cancel_req(void);
1161
1162void L1I_ReportFCCh_DM( Report* report );
1163void L1T_ReportFCCh_DM( Report* report );
1164void L1I_StopSCh_DM( void);
1165void L1I_StopFCCh_DM( void );
1166uint8 L1I_SChStop_DM( void );
1167uint8 L1I_FCChStop_DM( void );
1168void L1I_AbortReservationFCCh_DM( intx busyFrames, intx busyEBits );
1169//void L1D_SCh_DM( Report* report, ARFCN arfcn, bool retry, AfcParams* afcParams );
1170void L1I_ReportSCh_DM( Report* report );
1171void L1T_ReportSCh_DM( Report* report );
1172
1173void L1I_ReportSyncTime( Report* report );
1174void L1T_ReportSyncTime( Report* report );
1175void L1T_ReportSuspendGap( Report* report );
1176void L1T_Init_Gap(void);
1177void L1I_Update_Gap(Gap_Handler* gap, intx remain_gap_len);
1178Gap_Handler* L1I_NewGapHandler(void);
1179void L1I_DeleteGapHandler(Gap_Handler* gap_handler);
1180
1181void L1T_ResetAFC_DM(void);
1182
1183intx L1_TimeDiff( Time timeA, Time timeB);
1184void L1I_InsertGapHandler(Gap_Handler* gap);
1185void L1I_RemoveGapHandler(Gap_Handler* gap_handler);
1186void L1I_DebugGapHandler(void); /* Only for debug purpose. */
1187void L1I_RemoveSuspend( void );
1188
1189void L1I_Schedule_GapPurpose_undefined(Gap_Handler* gap);
1190
1191void L1I_Consume_PM_DM(void); /* Used to consume PM cells, and not to fill it into PM queue. This is used for FMO_Lock request. */
1192void L1I_MeasurementsProcessDummyResults( void );
1193void L1T_SurroundReportTickStandby(void);
1194uint8 L1I_SurroundAbortReceive_DM( void );
1195uint8 L1I_SurroundAbortBCChReceive_DM( void );
1196intx L1I_NBCChStop( void );
1197void L1I_Timer_Tick(Timer* timer);
1198void L1I_Timer_GAPStop_suspend(Timer* timer);
1199void L1I_Timer_GAPStop_all(Timer* timer); //syy
1200
1201//void L1I_TimerSuspendPMforGAP( Timer* timer ); //syy
1202
1203#ifdef __GL1_GEMINI__
1204void L1I_Timer_restartGAP(Timer* timer);
1205kal_bool L1I_QueryIsContiFB( void );
1206kal_uint32 L1I_QueryGAPReservedLength( void );
1207#endif
1208
1209#ifdef __GL1_GEMINI__
1210#if defined( __GL1_GEMINI_WCDMA__ ) || defined( __GEMINI__ ) || defined( __CDMA2000_RAT__ ) || defined( __IRAT_MEAS_SUPPORT_IN_VIRTUAL_MODE__ )
1211kal_uint32 L1I_QueryGAPPMReservedLength(void);
1212#endif /* defined( __GL1_GEMINI_WCDMA__ ) || defined( __GEMINI__ ) */
1213#endif
1214
1215#if defined( __GEMINI__ ) || defined( __IRAT_MEAS_SUPPORT_IN_VIRTUAL_MODE__ )
1216void L1I_SetStandbyPwrScanParam( uint32 scanPeriod, uint32 scanLength );
1217void L1I_SetStandbyBSICParam( uint16 scanPeriod );
1218void L1I_AssignGAPinVirtualMode( void );
1219
1220#ifdef __IRAT_MEAS_SUPPORT_IN_VIRTUAL_MODE__
1221void L1T_VStandbyMeasSetParam( uint32 MeasPeriod, uint32 MeasLength );
1222#endif /* __IRAT_MEAS_SUPPORT_IN_VIRTUAL_MODE__ */
1223
1224#endif /* defined( __GEMINI__ ) || defined( __IRAT_MEAS_SUPPORT_IN_VIRTUAL_MODE__ ) */
1225
1226#ifdef __GL1_MULTI_MODE__
1227bool L1I_QueryAnyActiveRATinDedicated( void );
1228#endif
1229
1230/* Interface with L1D. */
1231//void L1D_FCCh_DM(Report* report, ARFCN arfcn, int16 gap_len, AfcParams* afcParams);
1232void L1D_Sync_To_3G_DM(Report* report);
1233void L1D_Start_Next_PM_DM( void );
1234void L1D_Skip_PM_DM(L1D_APIcaller_id caller);
1235uint16 L1D_Get_SBWIN_LEN_DM(void);
1236intx L1D_Cal_PM_Count_DM( sGAP *gap );
1237intx L1D_Cal_FB_Slot_Length_DM(intx ebit_duration);
1238void L1D_Sync_To_Multi_Mode( Report *report, L1D_APIcaller_id caller );
1239bool L1D_check_3g_reli(void);
1240#if IS_GL1_MULTI_MODE_SUPPORT
1241void L1D_Set_GSM_RAT_Mode( L1D_MM_STATE L1D_DM_STATE, l1c_sim_mode_enum sim_idx, L1D_APIcaller_id caller);
1242void L1D_Set_GSM_Query_RAT_Mode( L1D_MM_STATE L1D_DM_STATE );
1243#endif
1244
1245void L1I_ResetAFC_DM( void );
1246
1247
1248void L1T_Set_Timer_UTRAN_FDD_and_EUTRAN( void );
1249void L1T_Set_Timer_UTRAN_TDD( void );
1250void L1T_SetGAPPattern_TDD( kal_uint16 gap_num, ll1_gsm_standby_gap_struct* gap, ll1_active_rat_mode_status_enum mode,
1251 kal_bool pm_tick, kal_uint8 pm_tid
1252#ifdef __GERAN_R8__
1253 ,kal_bool pm_tick_higher, kal_uint8 pm_tid_higher
1254#endif
1255#ifdef __LTE_RAT__
1256 ,kal_uint16 dmo_lte_period, kal_uint16 dmo_lte_length
1257#endif
1258);
1259
1260/* L1C DM Internal Use. */
1261Time L1I_GapEndTime( Gap_Handler* session );
1262void L1I_Stop_BSIC_Schedule_UTRAN_TDD( void );
1263void L1I_Measurement_Period_Start_UTRAN_TDD( void );
1264void L1I_Schedule_GapPurpose_rssi_UTRAN_TDD( Gap_Handler* gap, sGAP* gap_pattern );
1265void L1I_Schedule_GapPurpose_bsic_UTRAN_TDD( Gap_Handler* gap, sGAP* gap_pattern );
1266void L1I_Timer_GAP_UTRAN_TDD(Timer* timer);
1267void L1I_Timer_PM_Session_UTRAN_TDD( Timer* timer );
1268void L1I_Reset_PM_Session( void );
1269void L1T_SetGAPPurpose_fach_dch_UTRAN_TDD( kal_uint16 gap_num, ll1_gsm_standby_gap_struct* gap
1270#ifdef __LTE_RAT__
1271 ,kal_uint16 dmo_lte_period, kal_uint16 dmo_lte_length
1272#endif
1273);
1274
1275#ifdef __UMTS_TDD128_MODE__
1276/* TDD DM *//* L1C/D Interface function for DM. */
1277/* TDD DM *///void L1D_Sync_To_3G_DM( Report *report );
1278 #if L1D_WT_COBIN_ARCHITECTURE_SUPPORT
1279/* TDD DM */void L1D_Set_Gap_TDD( sGAP *gap, L1D_APIcaller_id caller ); /* set GAP pattern to L1D in 3G FACH and DCH state */
1280 #else
1281/* TDD DM */void L1D_Set_Gap( sGAP *gap ); /* set GAP pattern to L1D in 3G FACH and DCH state */
1282 #endif
1283/* TDD DM *///void L1D_Set_GSM_RAT_Mode( L1D_MM_STATE L1D_DM_STATE, L1D_APIcaller_id caller );
1284/* TDD DM *///bool L1D_IsTDStandby_DM(void);
1285/* TDD DM *///void L1D_SCh_DM( Report *report, ARFCN arfcn, bool retry, intx ebitPosition, AfcParams *afcParams );
1286/* TDD DM *///void L1D_FCCh_DM( Report *report, ARFCN arfcn, int32 gap_len_ebit, AfcParams *afcParams, int16 repeat_cnt );
1287/* TDD DM *///void L1D_Sync_To_3G_DM( Report *report );
1288/* TDD DM *///uint16 L1D_Get_SBWIN_LEN_DM( void );
1289 #if IS_AFC_CAPABILITY_ENHANCEMENT_SUPPORT
1290/* TDD DM */void L1D_AFCSetDACValue_DM( AfcParams *p, int32 DacValue, L1D_APIcaller_id caller );
1291 #else
1292/* TDD DM */void L1D_AFCSetDACValue_DM( AfcParams *p, int16 DacValue, L1D_APIcaller_id caller );
1293 #endif /* IS_AFC_CAPABILITY_ENHANCEMENT_SUPPORT */
1294/* TDD DM *///bool L1D_check_3g_reli( void );
1295/* TDD DM */void L1D_AFCResetParams_DM( AfcParams *p, L1D_APIcaller_id caller );
1296/* TDD DM */bool L1D_AFC_2G_ACTIVE_ASK_FreqCorrect( uint8 simIndex, kal_bool correction, kal_bool is_l1c, AfcParams *afcParams );
1297/* TDD DM */void L1D_Start_Next_PM_DM( void );
1298/* TDD DM *///void L1D_Skip_PM_DM( L1D_APIcaller_id caller );
1299/* TDD DM *///intx L1D_Cal_PM_Count_DM( sGAP* gap );
1300 #if L1D_WT_COBIN_ARCHITECTURE_SUPPORT
1301 #if IS_AFC_CAPABILITY_ENHANCEMENT_SUPPORT
1302/* TDD DM */kal_int32 L1D_AFCGetDAC_Value_DM_TDD(bool is_2g_2_3g);
1303 #else
1304/* TDD DM */kal_int16 L1D_AFCGetDAC_Value_DM_TDD(bool is_2g_2_3g);
1305 #endif /* IS_AFC_CAPABILITY_ENHANCEMENT_SUPPORT */
1306/* TDD DM */void L1D_FCCh_Update_rxTime_TDD(Time rxTime, L1D_APIcaller_id caller);
1307/* TDD DM */void L1D_FBM_Update_left_times_TDD(int16 new_left_times, L1D_APIcaller_id caller);
1308/* TDD DM */intx L1D_Cal_PM_Count_DM_Query_TDD( sGAP *gap );
1309 #else
1310 #if IS_AFC_CAPABILITY_ENHANCEMENT_SUPPORT
1311 /* TDD DM */kal_int32 L1D_AFCGetDAC_Value_DM(bool is_2g_2_3g);
1312 #else
1313/* TDD DM */kal_int16 L1D_AFCGetDAC_Value_DM(bool is_2g_2_3g);
1314 #endif /* IS_AFC_CAPABILITY_ENHANCEMENT_SUPPORT */
1315/* TDD DM */void L1D_FCCh_Update_rxTime(Time rxTime, L1D_APIcaller_id caller);
1316/* TDD DM */void L1D_FBM_Update_left_times(int16 new_left_times, L1D_APIcaller_id caller);
1317/* TDD DM */intx L1D_Cal_PM_Count_DM_Query( sGAP *gap );
1318 #endif
1319/* TDD DM */void L1D_Sync_To_Multi_Mode( Report *report, L1D_APIcaller_id caller );
1320#endif /*__UMTS_TDD128_MODE__*/
1321
1322/****************************** function prototype end **************************************/
1323
1324
1325
1326
1327
1328
1329/****************************** global variable begin ************************************/
1330
1331
1332#ifdef __GL1_GEMINI_WCDMA__
1333#define gap_global gapGlobals_database[l1c_sim_mode]
1334#define local_gap_global gapGlobals_database[local_sim_mode]
1335extern GapGlobal gapGlobals_database[L1C_MM_SIM_NUM];
1336#define dm_global dmGlobals_database[l1c_sim_mode]
1337#define local_dm_global dmGlobals_database[local_sim_mode]
1338extern DualModeGlobal dmGlobals_database[L1C_MM_SIM_NUM];
1339#define gap_base gapBase_database[l1c_sim_mode]
1340#define local_gap_base gapBase_database[local_sim_mode]
1341extern Gap_Handler gapBase_database[L1C_MM_SIM_NUM];
1342extern uint8 syncBitmap;
1343#else
1344#define local_gap_global gap_global
1345#define local_dm_global dm_global
1346#define local_gap_base gap_base
1347extern GapGlobal gap_global;
1348extern DualModeGlobal dm_global;
1349extern Gap_Handler gap_base;
1350#endif
1351bool L1I_QueryAllSIMInGSMIdle( void );
1352
1353/****************************** global variable end **************************************/
1354
1355
1356EXTERN_TRACE_CLASS( tcDM ); /* For L1 simulation. */
1357
1358#endif
1359#if IS_TXRX_GET_INFO
1360kal_uint64 L1D_Rx_Active_Time();
1361void L1D_Rx_Reset_Time();
1362void L1I_CalculateFBRxTime(void);
1363void L1I_QueryFBStartTime(void);
1364Power L1I_QueryTxPowerInfo(void);
1365void L1I_getTxinformationTime(Power txpower, int32 reservationMask);
1366#endif