blob: ff7d10568fbd4ebd10439f194852dd1dd79ddb3f [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001/*****************************************************************************
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) 2012
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 * el2_api.h
41 *
42 * Project:
43 * --------
44 * MOLY
45 *
46 * Description:
47 * ------------
48 * prototypes of EL2 export function
49 *
50 * Author:
51 * -------
52 * -------
53 *
54 * ==========================================================================
55 * $Log$
56 *
57 * 01 11 2018 jia-shi.lin
58 * [MOLY00301451] [SMO release][93/95]EL1 relative interface
59 * emac/el1 interface re-arch
60 *
61 * 08 03 2017 wen-jiunn.liu
62 * [MOLY00268551] Task batch scheduling for LTE Low power
63 * [EL2] Task Rescheduling for Low Power Polling Tick Change
64 *
65 * 08 03 2017 wen-jiunn.liu
66 * [MOLY00268551] Task batch scheduling for LTE Low power
67 * [EL2] Task Rescheduling for Low Power Polling Tick Change
68 *
69 * 04 07 2017 steve.kao
70 * [MOLY00230062] [UMOLYA] M-PS related interface changes for UPCM, RATDM, and EPDCP
71 *
72 * [UMOLYA][TRUNK]
73 *
74 * [UPCM][M-PS] Code changes
75 * 1. Duplicating UPCM contexts,
76 * 2. Use protocol_idx in UL/DL callback/ILM interfaces,
77 * 3. Check protocol_idx in LHIF PIT entries,
78 * 4. Fix test mode UL data processing flow,
79 * 5. Allowing test mode on protocol 2/3/4,
80 * 6. Wrap interfaces with RATDM with __MULTIPLE_PS__,
81 *
82 * [EPDCP][L+L] Code changes
83 *
84 * [RATDM][L+L] Code changes
85 *
86 * 09 26 2016 slifer.hsueh
87 * [MOLY00205085] [MT6293][EL2] ERLC source codes integration from DEV to TRUNK
88 * ERLC source codes integration from DEV to TRUNK
89 *
90 * 01 12 2016 kathie.ho
91 * [MOLY00156229] [MT6292] Code sync from MT6291: AuDRX
92 * CodeSync from LR11 (from 2015/09/21~11/15, exclude TSTM, MBMS)PART4
93 * CL 1800644[MT6291]Autonomous DRX
94 *
95 * 09 07 2015 nienteh.hsu
96 * [MOLY00140671] [6292] ERLC code sync from LR11 to UMOLY (August)
97 * .
98 *
99 * 09 04 2015 nienteh.hsu
100 * .
101 *
102 * 09 04 2015 nienteh.hsu
103 * Code sync from LR11 to UMOLY.
104 * CL1542770: DL & UL print SDU raw data.
105 * CL1582626: Fix of DL print SDU raw data.
106 * CL1590595: ERLC build warning fix.
107 * CL1525169: EM HO duration reporting. ERLC-UL part is merged.
108 * CL1546539: Backup SIT head and tail index when copro power off.
109 * CL1564394: Avoid early return in sched_grant_main function and not trigger poll re-TX.
110 * CL1586893: Fix of EM HO duration reporting.
111 *
112 * 12 04 2014 shengyi.ho
113 * [MOLY00083854] [TK6291] eL2 development checkin CR
114 * 1) fix erlc gtest ut case HWB leakage
115 * 2) rename am/um var reset macro with ERLCUL/ERLCDL prefix
116 * 3) fix HWB C-model function of get UL/DL alloc hwb num
117 *
118 * 11 11 2014 yiting.cheng
119 * [MOLY00084042] [UMOLY] merge UMOLY_DEV to UMOLY trunk
120 * .
121 *
122 * 10 27 2014 sh.yang
123 * [MOLY00082211] [MT6291_DEV] EMBMS check-in
124 * embms check-in
125 *
126 * 10 08 2014 shengyi.ho
127 * [MOLY00077592] [TK6291] emac/erlc development check-in - 1) tti bundle/msg3 collide rv setting. 2) sr prohibit check. 3) add emac ut framework for tx req. 4) remove unused function in MT6291
128 * .
129 *
130 * 07 31 2014 yiting.cheng
131 * [MOLY00073830] [MT6291_DEV] check-in MT6291 modification
132 * for fix potential target build error
133 *
134 * 07 30 2014 yiting.cheng
135 * [MOLY00073830] [MT6291_DEV] check-in MT6291 modification
136 * MT6291 modification, using temp interface with EL1
137 *
138 * 01 15 2014 slifer.hsueh
139 * [MOLY00053104] [MT6290E2][NAS RTD][MM][FDD] Assert fail: driver/l2copro/cipher/src/cipher_common.c 196 - L2COPRO
140 * Merge codes related to L2 copro delay power off back to MOLY TRUNK in LTE domain
141 *
142 * 01 09 2014 moja.hsu
143 * [MOLY00052975] Fine tune RAR/EAR 1ms protection to prevent false alarm.
144 * .
145 *
146 * 12 03 2013 timothy.yao
147 * [MOLY00048832] power down/on in EL2 task context and refine the flow
148 * 1. power-off/on L2 copro in EL2 task context.
149 * 2. refine the flow betwwen EL1 & EL2.
150 *
151 * 09 27 2013 steve.kao
152 * [MOLY00039195] [MT6290] [Low Power] LTE L2 copro power down in LTE flight mode
153 * Unshelved from pending changelist '272199':
154 *
155 * Fix link error
156 *
157 * 08 20 2013 mf.jhang
158 * [MOLY00034292] [MT6290E1] Move PHR to SW
159 * Move PHR report to SW
160 *
161 * 07 23 2013 mf.jhang
162 * [MOLY00030911] [MT6290E1][EMAC] EMAC code enhancement
163 * Register UL LMAC error interrupt handler
164 * Update some trace
165 *
166 * 06 10 2013 mf.jhang
167 * [MOLY00025349] [MT6290E1][GCF][MD8430][LTE][TC 7.1.5.4] Assert fail driverl2coprolmacsrcl2lmac_drv.c 268 - L2COPRO
168 * Add EL2 API for DL LMAC handler
169 *
170 * 05 16 2013 moja.hsu
171 * [MOLY00007625] Maintain code
172 * fix edyn compile warning.
173 ****************************************************************************/
174
175/**
176 * @date 2012/1/10
177 */
178
179#ifndef EL2_EXPORT_API
180#define EL2_EXPORT_API
181
182//#include "drv/drv_lmac.h"
183//#include "el1_enum.h"
184#include "kal_public_api.h"
185//#include "el2_def.h"
186#include "lte_time_common.h"
187
188/* EL2 constructor */
189void el2_init();
190
191// EL2 Tick Source Handler
192void el2_tick_source_dispatch_tick();
193
194/* EMAC export API */
195kal_bool emac_drx_is_drx_sleep(); // query whether EMAC DRX sleep or not
196void emac_rcv_ilm(ilm_struct *pIlm); ///< EMAC message handler
197void emac_el2task_rcv_ilm(ilm_struct *p_ilm); ///< EMAC message handler on EL2 task
198void emac_ctrl_data_rcv(); ///< control data receiving handler TO_BE_REMOVE: please use emac_ctrl_data_check().
199void emac_ctrl_data_check(); ///< check DL control swo bits
200void emac_early_protect_cancel_reg(void(*func)(void)); //Register early protect cancel callback
201void emac_rar_protect_cancel_reg(void(*func)(void)); //Register rar protect cancel callback
202#if MBMS_SUPPORT
203void emac_mch_data_check(); ///< check MCH swo bits
204#endif
205
206#if EL2_SBP_ON_AUDRX
207void emac_audrx_rrc_cmd(kal_uint32 time);
208void emac_audrx_nas_cmd(kal_uint32 time);
209void emac_epdcp_audrx_timer_timeout(void);
210void emac_epdcp_audrx_timer_restart(void);
211kal_uint32 emac_audrx_rrc_sleep_report(void);
212#endif
213
214/**
215 * @brief emac_check_rar_protect
216 * Check if we need to RAR 1ms protection.
217 * Prevent False alarm of frame boundary
218 *
219 * @return KAL_TRUE: Need to protection.
220 * KAL_FALSE: No need to do protection.
221 */
222//kal_bool emac_check_rar_protect(void);
223
224/**
225 * @brief emac_check_ear_protect
226 * Check if we need to RAR 1ms protection.
227 * Prevent False alarm of frame boundary
228 *
229 * @param vect SWO bit to indicate which HT contain EAR LCID
230 *
231 * @return KAL_TRUE: Need to protection.
232 * KAL_FALSE: No need to do protection.
233 */
234//kal_bool emac_check_ear_protect(ht_ear_vect *vect);
235kal_int32 _lte_dl_lmac_err_hndlr(kal_uint32 vect, void *ptr); //DL LMAC error interrupt callback
236kal_int32 _lte_ul_lmac_err_hndlr(kal_uint32 vect, void *ptr); //UL LMAC error interrupt callback
237
238/* ERLC export API */
239void erlcul_rcv_ilm(ilm_struct *pIlm); ///< ERLC-UL message handler
240void erlcdl_rcv_ilm(ilm_struct *pIlm); ///< ERLC-DL message handler
241void erlcul_poll(); ///< ERLC-UL polling
242void erlcdl_poll(); ///< ERLC-DL polling
243void erlcul_reset(); ///< ERLC-UL reset
244void erlcdl_reset(); ///< ERLC-DL reset
245
246kal_uint32 erlcul_query_sleep_allow(); ///< ERLC-UL sees if we can sleep copro
247void erlcul_copro_power_down_backup(); ///back up info used when copro power off
248
249#endif