blob: 64eceafcf0f2d6d535df72f70b79a7551c0e9b23 [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) 2016
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* This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc.
38*
39* Any unauthorized use inconsistent with the terms of such license is strictly prohibited.
40*
41* Copyright (c) 2006-2010 VIA Telecom, Inc. All rights reserved.
42*
43*************************************************************/
44#ifndef _CLCTIMER_H_
45#define _CLCTIMER_H_ 1
46/*****************************************************************************
47*
48* FILE NAME : clctimer.h
49*
50* DESCRIPTION : Timer Controller interface for the CLC Task
51*
52* HISTORY :
53* See Log at end of file
54*
55*****************************************************************************/
56
57/*----------------------------------------------------------------------------
58 Include Files
59----------------------------------------------------------------------------*/
60
61/*----------------------------------------------------------------------------
62 Global Defines and Macros
63----------------------------------------------------------------------------*/
64#if 0 /* rtm3 / phy2 testing purpose */
65/* under construction !*/
66/* under construction !*/
67#else
68#define TOMPQCSUPERVISION 5333 /*Spec define: QuickConfig Supervision timer 12 * 256 * 1.667ms = 5.12second*/
69 /*93 using task SMP, timer expire maight be excuted before CC package decode success in CL1*/
70 /*Add 0.5cc =128slot Margin, 12cc + 0.5cc = 5.12s + 213ms = 5333ms*/
71
72#define TOMPSPSUPERVISION 5333 /*Spec define: SectorParamters Supervision timer 12 * 256 * 1.667 ms = 5.12 second + 128slot Margin*/
73 /*93 using task SMP, timer expire maight be excuted before CC package decode success in CL1*/
74 /*Add 0.5cc = 128slot Margin, 12cc + 0.5cc = 5.12s + 213ms = 5333ms*/
75
76#define TOMPOVHDSUPERVISION_TEST 10 /* Define a short period timer to trigger the CLC_OMP_QC_SUPERVISION_TIMER expire easily. */
77#endif
78
79#define TIDPCONNSETUP 2500 /*Maximum access terminal time in the connection setup state */
80#define TIDPPAGEPENDING 1000 /*Default Page pending timer in Freeze state */
81
82#define TIDPLONGSLEEPDELAY 60000 /* Long sleep delay timer duration - 60 seconds */
83
84#define TOMPIHOOHMDECODE 1000 /*OMP decode tmr expired (500ms for now)*/
85
86/* TO DO - check the units of timer - 1ms OR 10ms */
87
88#define INSP_SYNC_ACQ_TIME 5000 /* Time to acquire Sync msg - 5 seconds */
89
90/* Time to acquire Sync msg on second run, to handle dead loop by 1x preemption (could be 1.28 sec) */
91#define INSP_SYNC_ACQ_TIME_SHORT 1000
92
93
94#define INSP_SYNC_TIMING_TIME 1500 /* Time to set System Time - 160ms+margin */
95 /* From Irvine FT - now we do ClkCal (1.28s), inc to 1.5s to wait for RMC_Syncok */
96
97#define INSP_PILOT_ACQ_TIME 10000 /* Time from tune channel to sync OK */
98
99#ifdef MTK_DEV_C2K_IRAT
100#define INSP_PILOT_ACQ_FAIL_COUNT 1
101#define INSP_SRLTE_PILOT_ACQ_TIME 10000 * INSP_PILOT_ACQ_FAIL_COUNT /* Time from tune channel to sync OK */
102#define IDP_CONTINUE_RCV_UATI_ASSIGNMENT_PERIOD 430 /* 1 control channel cycle about 426ms.*/
103#define IDP_GUARD_CHANNEL_PROTECT_PERIOD 10000 /* The maximum time of applying channel protection for EVDO.*/
104#endif
105
106#ifndef MTK_PLT_ON_PC_UT
107#define T_WFR_RMC_INTER_HO_CNF_REDUCTION 30 /* About 3~4 frame ticks(8ms for each frame tick). */
108#else
109#define T_WFR_RMC_INTER_HO_CNF_REDUCTION 3000
110#endif
111
112#define T_BLOCK_IDO_WAKE_REDUCTION 4000
113
114#define T_CC_SYNC_CAP_CHECK 180
115
116#define INSP_WTF_ANTENNA_TIME 15000
117
118#define T_WFR_RSVAS_OCCUPY_IND_TIMER 5000
119
120#define T_GUARD_INTERVAL_BETWEEN_WAKEUP_AND_SLEEP_CMD_TIMER 17
121
122#define T_GUARD_NON_SLOTTED_MODE_TIMER 240000
123
124/*----------------------------------------------------------------------------
125 Global Typedefs
126----------------------------------------------------------------------------*/
127
128/* Connection Layer controller Errors */
129typedef enum
130{
131 CLC_OMP_QC_SUPERVISION_TIMER,
132 CLC_OMP_SP_SUPERVISION_TIMER,
133 CLC_IDP_CONNECTION_SETUP_TIMER,
134 CLC_IDP_PAGE_PENDING_TIMER,
135 CLC_IDP_SUSPENDPERIOD_TIMER,
136 CLC_INSP_SYNC_ACQ_TIMER,
137 CLC_INSP_TIMING_TIMER,
138 CLC_IDP_NO_SRCH_DONE_WAKEUP_TIME,
139 CLC_INSP_PILOT_ACQ_TIMER,
140 CLC_OMP_IHO_OHMDECODE_TIMER,
141 CLC_IDP_BLOCK_IHO_WAKE_REDUCTION_TIMER,
142 CLC_IDP_CC_SYNC_CAP_CHECK_TIMER,
143 CLC_IDP_DFS_TIMER,
144 CLC_INSP_WAITFIR_ANTENNA_TIMER,
145#ifdef MTK_DEV_C2K_IRAT
146 CLC_INSP_SRLTE_PILOT_ACQ_TIMER,
147 CLC_IDP_CONTINUE_RCV_UATI_ASSIGNMENT_TIMER,
148 CLC_IDP_WFR_RSVAS_OCCUPY_IND_TIMER,
149 CLC_IDP_GUARD_INTERVAL_BETWEEN_WAKEUP_AND_SLEEP_CMD_TIMER,
150 CLC_IDP_GUARD_CHANNEL_PROTECT_TIMER,
151#endif
152 CLC_IDP_WFR_RMC_INTER_HO_CNF_TIMER,
153 CLC_IDP_GUARD_NON_SLOTTED_MODE_TIMER,
154 NUM_CLCTMRs
155} ClcTimerId;
156
157/*----------------------------------------------------------------------------
158 Global Data
159----------------------------------------------------------------------------*/
160extern event_scheduler *pClcEsch;
161
162/*----------------------------------------------------------------------------
163 Global Function Prototypes
164----------------------------------------------------------------------------*/
165void clcTimerInit (void);
166void clcStartTimer (ClcTimerId internalId, kal_uint32 duration);
167void clcStopTimer (ClcTimerId internalId);
168kal_bool clcIsTimerActive(ClcTimerId timer);
169void ProcessClcTimerExpiredMsg(kal_uint32 timerId);
170
171/*****************************************************************************
172* $Log: clctimer.h $
173*
174* 09 18 2020 dayang.liu
175* [MOLY00560078] DM?? DTS2020081904LO9PP0D00 P155 [ASSERT] file:mcu/protocol/lte_sec/errc/assert/errc_el1_assert_csr.c line:91
176*
177* .
178*
179* 08 14 2019 dayang.liu
180* sync MOLY00362652 into APOLLO.SQC.
181*
182* 07 04 2019 dayang.liu
183* [MOLY00406740] [URGENT][Cervino][MT6762][P0][MP2][Sprint][FT_REG][Kansas][SI2][C2K][Random][ASSERT] file:mcu/common/modem/c2k/rfd/external/cl1d_rf_error_check.c line:527
184*
185* MOLY00406740 - Sync to Vmoly .
186* MOLY00406420, MOLY00343805, MOLY00334479
187*
188* 06 28 2019 dayang.liu
189* [MOLY00374669] [Telephony PPM][Lafite][P0][OPPO][VIVO NEX A][P90][TC150] T1 Fail: DUT=5.89s vs REF=2.74s - VMOLY
190*
191* 06 26 2019 dayang.liu
192* [MOLY00372025] [MT6779][Lafite][P0][BSP+][MP2][C2K][OM][MTBF][ErrorTimes:1]Externel (EE),0,0,99,/data/vendor/core/,1,modem,Trigger time:[2018-12-08 00:54:21.378788]
193*
194* Merge [MOLY00372025] into VMOLY.
195*
196* ALPS04228687 - LR12A.R2.MP.
197*
198* 05 25 2018 dayang.liu
199* [MOLY00328321] [EIGER][MT3967][RDIT][FT][CT][SRLTE+L][random][SH][SIM1:CMCC][SIM2:CT]DUT cannot attach to 3G
200* ALPS03932411 - UMOLYE-TRUNK.
201*
202* 05 15 2018 dayang.liu
203* [MOLY00326014] [Gen95][MSPM] SW changes check in UMOLYE
204* merge EVDO into UMOLYE branch.
205*
206* 07 06 2017 sue.zhong
207* [MOLY00259241] [6293][C2K]Replace with KAL data type
208* Correct copyright file header
209*
210* 05 12 2017 wesley.li
211* [MOLY00247455] [6293][C2K][PS]Change KAL timer API to event scheduler API
212*
213* CL:timer modification
214*
215* 05 09 2017 tom.wu
216* [MOLY00247691] [BIANCO][MT6763][C2K][RDIT][PHONE][PreHQA][CCF][Spirent][C.S0033(RevA)][4.2.1]Time Reference fail
217*
218* , modify OMP supervsn timer to 12+0.5 CC cycle
219*
220* 04 26 2017 dayang.liu
221* [MOLY00245272] [BIANCO][MT6763][RDIT][PHONE][Stress][C2K][SIM1:CTC]Fail to establish ppp link @Do only mode
222* ALPS03266267 - Add protect timer for MSG_ID_IDP_RMC_INTER_HO_CNF_MSG.
223*
224* 04 19 2017 dayang.liu
225* [MOLY00241439] [BUG][PS][CLC] Add ELT cmd for idle supervision fail procedure.
226* Add ELT CMD to triggrt supervision Event.
227*
228* 11 09 2016 sue.zhong
229* [MOLY00208435] [6293][C2K]Sync C2K code to UMOLYA TRUNK
230* Update C2K PS code (1/2)
231*****************************************************************************/
232
233/*****************************************************************************
234* End of File
235*****************************************************************************/
236#endif /*_CLCTIMER_H_*/
237
238