blob: a3dd17cd2f8d654d238e7dd9b3c2091411a48832 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001#ifndef _MLL1_UMTS_FDD_H
2#define _MLL1_UMTS_FDD_H
3
4#include "kal_public_defs.h" /*for LOCAL_PARA_HDR*/
5#include "mll1_common.h"
6/*****************************************************************************
7* DEFINITIONS
8*****************************************************************************/
9#define UMTS_FDD_SESSION_IN_PERIOD 8 /* align gsm, LTE only need 6 for gp0/gp1 */
10
11#define UMTS_FDD_MAX_DCH_GAP_PARAM_NUM 6 /*2 Pop temp modification for UL1's TGPS free buffer issue*/
12#define UMTS_FDD_MAX_TGPS_NUM 6
13#define UMTS_FDD_SCHEDULE_DELAY 0 /* used to postpone available gap start time */
14/*****************************************************************************
15* ENUMERATIONS
16*****************************************************************************/
17
18/*****************************************************************************
19* ENUMERATION
20* ul1_ll1_rat_status_enum
21*
22* DESCRIPTIONS
23* Used to identify the status in UMTS FDD RAT.
24* NOTE
25* any modification should sync. with ll1_rat_status_enum
26*****************************************************************************/
27typedef enum
28{
29 UL1_LL1_RAT_FLIGHT =0,
30 UL1_LL1_RAT_STANDBY,
31 UL1_LL1_RAT_ACTIVE,
32 UL1_LL1_RAT_NUM
33} ul1_ll1_rat_status_enum;
34
35/*****************************************************************************
36* ENUMERATION
37* umts_fdd_tgps_status_enum
38*
39* DESCRIPTIONS
40* ACTIVE_GAP: the tgps is used in standby L1.
41* INACTIVE_GAP: the tgps is not used in standby L1.
42*****************************************************************************/
43typedef enum
44{
45 UL1_ACTIVATE_GAP=0, /* 0 */
46 UL1_DEACTIVATE_GAP /* 1 */
47}umts_fdd_tgps_status_enum;
48
49/*****************************************************************************
50* ENUMERATION
51* umts_fdd_tgmp_enum
52*
53* DESCRIPTIONS
54* The enum type of TGPS purpose
55* NOTE
56* any change should note x_tgmp_enum
57*****************************************************************************/
58typedef enum
59{
60 UL1_LL1_FDD_MEASURE, /* Inter-frequency measurement */
61 UL1_LL1_GSM_RSSI, /* GSM RSSI measurement */
62 UL1_LL1_GSM_BSIC_INIT, /* GSM initial BSIC */
63 UL1_LL1_GSM_BSIC_CNF, /* GSM BSIC confirm */
64 UL1_LL1_EUTRAN, /* Inter-RAT LTE measurement*/
65 UL1_LL1_UMTS_TDD, /* Inter-RAT UMTS_TDD measurement*/
66 UL1_LL1_PURPOSE_UNDEFINED
67} umts_fdd_tgmp_enum;
68
69/*****************************************************************************
70* STRUCTURES
71*****************************************************************************/
72
73/*****************************************************************************
74* STRUCT
75* umts_fdd_time_struct
76*
77* DESCRIPTIONS
78* UMTS FDD system timing base
79*
80* PARAMETERS
81* sfn - UMTS FDD system frame number (0~4095), 1 sfn = 38400*8.
82* echip - UMTS FDD Echip (0~307199)
83*****************************************************************************/
84typedef struct
85{
86 kal_int32 sfn;
87 kal_int32 echip;
88}umts_fdd_time_struct;
89
90/*****************************************************************************
91* STRUCT
92* ll1_umts_fdd_standby_gap_struct
93*
94* DESCRIPTIONS
95* UMTS FDD standby gap pattern structure.
96*
97* PARAMETERS
98* start_time - start time of the gap session
99* length - length of the gap session (in echip)
100*****************************************************************************/
101typedef struct
102{
103 umts_fdd_time_struct start_time;
104 kal_int32 length;
105}ll1_umts_fdd_standby_gap_struct;
106
107/*****************************************************************************
108* STRUCT
109* ll1_ul1_expand_gap_pattern_struct
110*
111* DESCRIPTIONS
112* LL1 expands gap pattern for UL1
113*
114* PARAMETERS
115* session_num - Indicate how many gap session
116* session[] - Standby gap session.
117* measure_tid - Transition id for RANK tick./Valid when active RAT is in DRX mode./And bit 0 in tick_bitmap is "1"
118* hps_tid - Transition id for HPS tick./Valid when active RAT is in DRX mode./And bit 1 in tick_bitmap is "1"
119* tick_bitmap - Bit 0 : Rank search , Bit 1 : Priority search
120*****************************************************************************/
121typedef struct
122{
123 kal_uint8 session_num;
124 ll1_umts_fdd_standby_gap_struct session[UMTS_FDD_SESSION_IN_PERIOD];
125 kal_uint8 measure_tid;
126 kal_uint8 hps_tid;
127 kal_uint8 tick_bitmap;
128}ll1_ul1_expand_gap_pattern_struct;
129
130/*****************************************************************************
131* STRUCT
132* ll1_umts_fdd_gap_config_struct
133*
134* DESCRIPTIONS
135* UMTS FDD gap configuration when UMTS FDD is active RAT.
136*
137* PARAMETERS
138* start_time - Valid time of gap pattern in active RAT
139* use_num - Continuous gap number could be used in active RAT(Each FMO cycle = 10*M_REP*NTTI as a unit)
140* skip_num - Skip number in active RAT (Each FMO cycle = 10*M_REP*NTTI as a unit)
141*****************************************************************************/
142typedef struct
143{
144 umts_fdd_time_struct start_time;
145 kal_uint8 use_num;
146 kal_uint8 skip_num;
147}ll1_umts_fdd_gap_config_struct;
148
149/*****************************************************************************
150* STRUCT
151* umts_fdd_idle_gap_struct
152*
153* DESCRIPTIONS
154* UMTS FDD idle gap structure.
155*
156* PARAMETERS
157* start_time - start time of the gap session
158* length - length of the gap session (in echip)
159* is_drx_tick - KAL_TRUE : First tick in this DRX period
160* KAL_FALSE: Not the first free interval in this DRX period
161*****************************************************************************/
162typedef struct
163{
164 umts_fdd_time_struct start_time;
165 kal_int32 length;
166 kal_bool is_drx_tick;
167}umts_fdd_idle_gap_struct;
168
169/*****************************************************************************
170* STRUCT
171* umts_fdd_fach_gap_struct
172*
173* DESCRIPTIONS
174* UMTS FDD FACH gap structure.(FMO)
175*
176* PARAMETERS
177* active_time_sfm - The first SFN for starting FMO.
178* fmo_offset - The FMO offset from the beginning of each FMO cycle in UMTS FDD frames.
179* fmo_duration - The FMO duration for measurements within each FMO cycle in UMTS FDD frames
180* period_length - Equal to 10*M_REP*NTTI
181*****************************************************************************/
182typedef struct
183{
184 kal_uint32 active_time_sfn;
185 kal_uint32 fmo_offset;
186 kal_uint32 fmo_duration;
187 kal_uint32 period_length;
188}umts_fdd_fach_gap_struct;
189
190/*****************************************************************************
191* STRUCT
192* umts_fdd_dch_gap_info_struct
193*
194* DESCRIPTIONS
195* UMTS FDD gap information structure. (TGPSi configuration)
196*
197* PARAMETERS
198* refer to spec. 36.331
199*****************************************************************************/
200typedef struct
201{
202 kal_uint8 tgpsi;
203 umts_fdd_tgps_status_enum status;
204 kal_int16 tgsfn;
205 umts_fdd_tgmp_enum purpose;
206 kal_uint16 original_tgprc;
207 kal_uint16 remain_tgprc;
208 kal_uint8 tgsn;
209 kal_uint8 tgl1;
210 kal_uint8 tgl2;
211 kal_uint16 tgd;
212 kal_uint8 tgpl1;
213 kal_uint8 tgpl2;
214 kal_uint16 t_reconfirm_dch;
215 kal_uint16 t_identify_dch;
216}umts_fdd_dch_gap_info_struct;
217
218/*****************************************************************************
219* STRUCT
220* umts_fdd_dch_gap_param_struct
221*
222* DESCRIPTIONS
223* UMTS FDD DCH gap info structure. (gap_info_lenthg TGPSi in one TGPS configuration )
224*
225* PARAMETERS
226* gap_info_length - The DCH gap pattern sequence number
227* reconfig_time_sfn - valid time of this configuration
228* dch_gap_info[] -
229*****************************************************************************/
230typedef struct
231{
232 kal_uint8 gap_info_length;
233 kal_int16 reconfig_time_sfn;
234 umts_fdd_dch_gap_info_struct dch_gap_info[UMTS_FDD_MAX_TGPS_NUM];
235}umts_fdd_dch_gap_param_struct;
236
237/*****************************************************************************
238* STRUCT
239* umts_fdd_dch_gap_struct
240*
241* DESCRIPTIONS
242* UMTS FDD DCH gap structure. ( many TGPS configurations)
243*
244* PARAMETERS
245* gap_param_num - Indicate that whether the patterns need to be applied
246* umts_fdd_dch_gap_param[] - DCH gap configurations
247*****************************************************************************/
248typedef struct
249{
250 kal_uint8 gap_param_num;
251 umts_fdd_dch_gap_param_struct umts_fdd_dch_gap_param[UMTS_FDD_MAX_DCH_GAP_PARAM_NUM];
252}umts_fdd_dch_gap_struct;
253
254/*****************************************************************************
255* STRUCT
256* ul1_ll1_sync_cnf_struct
257*
258* DESCRIPTIONS
259* UL1 uses this primitive to confirm LL1 that current UMTS FDD timing
260* and micro second counter value.
261*
262* PARAMETERS
263* LOCAL_PARA_HDR
264* current_time - sync. time in umts_fdd_time_struct
265* umts_fdd_ustime - sync. time in USC
266*****************************************************************************/
267typedef struct
268{
269 LOCAL_PARA_HDR
270 umts_fdd_time_struct current_time;
271 kal_uint32 umts_fdd_ustime;
272}ul1_ll1_sync_cnf_struct;
273
274/*****************************************************************************
275* STRUCT
276* ul1_ll1_rat_status_ind_struct
277*
278* DESCRIPTIONS
279* This message is sent from UL1 to LL1 for informing current UL1 RAT status.
280* This message should be sent when UL1 RAT status changed.
281*
282* PARAMETERS
283* LOCAL_PARA_HDR
284* rat_status - RAT status in UL1
285*****************************************************************************/
286typedef struct
287{
288 LOCAL_PARA_HDR
289 ul1_ll1_rat_status_enum rat_status;
290}ul1_ll1_rat_status_ind_struct;
291
292/*****************************************************************************
293* STRUCT
294* ul1_ll1_mode_status_ind_struct
295*
296* DESCRIPTIONS
297* This message is sent from UL1 to LL1 for informing that UL1 mode status when UL1 is active RAT.
298* This message should be sent when UL1 mode status changed.
299*
300* PARAMETERS
301* LOCAL_PARA_HDR
302* fdd_mode_status - current mode in UL1 when UMTS FDD is active RAT
303* drx_cycle_length - valid when gsm_mode_status = UL1_LL1_IDLE_MODE || LL1_FDD_EFACH_DRX_MODE
304* burst_length - valid when gsm_mode_status = LL1_FDD_EFACH_DRX_MODE, and should be smaller than drx_cycle_length
305*****************************************************************************/
306typedef struct
307{
308 LOCAL_PARA_HDR
309 ll1_active_rat_mode_status_enum fdd_mode_status;
310 kal_uint16 drx_cycle_length;
311 kal_uint16 burst_length;
312}ul1_ll1_mode_status_ind_struct;
313
314/*****************************************************************************
315* STRUCT
316* ll1_ul1_mode_status_update_ind_struct
317*
318* DESCRIPTIONS
319* This message is sent to UL1 for informing that mode status of active RAT when UL1 is standby RAT.
320* This message should be updated for UL1 in standby when any mode status changed in active RAT.
321* Also when UL1 enters into standby RAT from FLIGHT, LL1 will update current mode state in active RAT to UL1.
322*
323* PARAMETERS
324* LOCAL_PARA_HDR
325* active_rat_mode_status - current mode status in active RAT
326*****************************************************************************/
327typedef struct
328{
329 LOCAL_PARA_HDR
330 ll1_active_rat_mode_status_enum active_rat_mode_status;
331}ll1_ul1_mode_status_update_ind_struct;
332
333/*****************************************************************************
334* STRUCT
335* ul1_ll1_active_measure_status_ind_struct
336*
337* DESCRIPTIONS
338* UL1 informs LL1 that how many higher priority inter-frequencies in UL1 when high priority search is turned on
339*
340* PARAMETERS
341* LOCAL_PARA_HDR
342* freq_num - The number of higher priority inter-freq. in UL1.(0~3)
343* When HPS off, the freq_num is equal to zero.
344*****************************************************************************/
345typedef struct
346{
347 LOCAL_PARA_HDR
348 kal_uint8 freq_num;
349}ul1_ll1_active_measure_status_ind_struct;
350
351/*****************************************************************************
352* STRUCT
353* ul1_ll1_measure_req_struct
354*
355* DESCRIPTIONS
356* This message is sent from UL1 to inform LL1 that how many UMTS FDD frequencies are required to be
357* measured and the measurement purposes both in UMTS FDD Active and Standby. The message is not
358* applicable for UL1 to request gaps for inter-frequency measurement in idle mode.
359*
360* PARAMETERS
361* LOCAL_PARA_HDR
362* meas_purpose_bitmap - bit 0 for measurement, bit 1 for cell search
363* tid - tid for lastest meas_req on (should only change when off)
364* tick_bitmap - bit 0 for ranking search, bit 1 for priority search
365* freq_num - high priority freqencies when HPS ON, measurement frequencies when HPS OFF
366* t_hps - basic period of high priority search (25s,60s,70s)
367* is_period_reset_bmp - bit 0 for rank period, 1 means to reset
368* - bit 1 for prio period, 0 means not to reset
369* - when freq. num is same as before, ll1 will check this flag to reset period or not
370* - bit 2 for Tmeas prohibit n_laer, 0 means not to apply n_layer
371* - when freq. num is same as before, ll1 will check this flag to apply n_layer or not
372* current_time - current in UL1
373*****************************************************************************/
374typedef struct
375{
376 LOCAL_PARA_HDR
377 kal_uint8 meas_purpose_bitmap;
378 kal_uint8 tid;
379 kal_uint8 tick_bitmap;
380 kal_uint8 freq_num;
381 kal_uint16 t_hps;
382 kal_int32 is_period_reset_bmp;
383 umts_fdd_time_struct current_time;
384}ul1_ll1_measure_req_struct;
385
386/*****************************************************************************
387* STRUCT
388* ul1_ll1_standby_measure_done_ind_struct
389*
390* DESCRIPTIONS
391* For low power optimization, UL1 informs LL1 which measurement purpose is
392* measured done in its period. If all measurement purposes are measured done,
393* LL1 will not tick UL1 anymore in shortest measurement period.
394*
395* PARAMETERS
396* LOCAL_PARA_HDR
397* tid - For LL1 to know this tid is mapped to which gap pattern period sent before
398* tick_bitmap - bit 0 for ranking search, bit 1 for priority search. Only one bit will be set in one message.
399*****************************************************************************/
400typedef struct
401{
402 LOCAL_PARA_HDR
403 kal_uint8 tid;
404 kal_uint8 tick_bitmap;
405}ul1_ll1_standby_measure_done_ind_struct;
406
407/*****************************************************************************
408* STRUCT
409* ll1_ul1_gap_service_req_struct
410*
411* DESCRIPTIONS
412* LL1 uses this primitive to enable (disable) active RAT gap service to get (release)
413* the free radio frequency period in UMTS FDD.When LL1 disables active RAT gap service,
414* it means that UMTS FDD could use all RF time already.
415*
416* PARAMETERS
417* LOCAL_PARA_HDR
418* enable - KAL_TRUE : request gap service
419* KAL_FALSE : stop gap service
420*****************************************************************************/
421typedef struct
422{
423 LOCAL_PARA_HDR
424 kal_bool enable;
425}ll1_ul1_gap_service_req_struct;
426
427/*****************************************************************************
428* STRUCT
429* ul1_ll1_gap_stop_cnf_struct
430*
431* DESCRIPTIONS
432* UL1 uses this primitive to confirm LL1_UL1_GAP_STOP_REQ when there is no gap usage in UMTS_FDD..
433*
434* PARAMETERS
435* LOCAL_PARA_HDR
436* current_time - current time in UL1
437*****************************************************************************/
438typedef struct
439{
440 LOCAL_PARA_HDR
441 umts_fdd_time_struct current_time;
442}ul1_ll1_gap_stop_cnf_struct;
443
444/*****************************************************************************
445* STRUCT
446* ul1_ll1_auto_gap_req_struct
447*
448* DESCRIPTIONS
449* UL1 sends this message to request LL1 that UL1 wants to use the auto gap from (sfn, echip).
450* UL1 could use this auto gap after getting the successful confirm
451*
452* PARAMETERS
453* LOCAL_PARA_HDR
454* auto_time - Start time of auto gap in UL1
455*****************************************************************************/
456typedef struct
457{
458 LOCAL_PARA_HDR
459 umts_fdd_time_struct auto_time;
460}ul1_ll1_auto_gap_req_struct;
461
462/*****************************************************************************
463* STRUCT
464* ll1_ul1_auto_gap_cnf_struct
465*
466* DESCRIPTIONS
467* LL1 sends this message to confirm UL1 auto gap request.
468* After receiving this message, UL1 could use required auto gap.
469*
470* PARAMETERS
471* LOCAL_PARA_HDR
472* success - KAL_TRUE : UL1 could use auto gap to search
473* KAL_FALSE: UL1 could not use auto gap to search.
474* And UL1 should not request auto gap until AUTO_GAP_AVAILABLE_IND
475* valid_period - The length of autonomous gap allowed by active RAT
476* The value is valid when success = KAL_TRUE
477* Unit : echip
478*****************************************************************************/
479typedef struct
480{
481 LOCAL_PARA_HDR
482 kal_bool success;
483 kal_int32 valid_period;
484}ll1_ul1_auto_gap_cnf_struct;
485
486/*****************************************************************************
487* STRUCT
488* ll1_ul1_auto_gap_ind_struct
489*
490* DESCRIPTIONS
491* LL1 sends this message to inform UL1 stopping using RF in this auto gap from (sfn, echip).
492*
493* PARAMETERS
494* LOCAL_PARA_HDR
495* auto_time - Start time of auto gap
496*****************************************************************************/
497typedef struct
498{
499 LOCAL_PARA_HDR
500 umts_fdd_time_struct auto_time;
501}ll1_ul1_auto_gap_ind_struct;
502
503/*****************************************************************************
504* STRUCT
505* ul1_ll1_auto_gap_res_struct
506*
507* DESCRIPTIONS
508* UL1 sends this message to response LL1 that UL1 will/won't use RF from
509* the start timing of auto gap which is informed by LL1_UL1_AUTO_GAP_IND.
510*
511* PARAMETERS
512* LOCAL_PARA_HDR
513* success - KAL_TRUE : UL1 will not use RF from the starting time of LL1_UL1_AUTONOMOIS_GAP_IND
514* KAL_FALSE: UL1 may use RF after starting time of LL1_UL1_AUTONOMOIS_GAP_IND.
515* valid_period - The length of autonomous gap allowed in UL1
516* The value is valid when UL1 is active rat and success = KAL_TRUE
517* Unit : echip
518*****************************************************************************/
519typedef struct
520{
521 LOCAL_PARA_HDR
522 kal_bool success;
523 kal_int32 valid_period;
524}ul1_ll1_auto_gap_res_struct;
525
526/*****************************************************************************
527* STRUCT
528* ll1_ul1_gap_notify_ind_struct
529*
530* DESCRIPTIONS
531* LL1 sends this message to inform UL1 that the starting time and length of gap pattern when UL1 is standby RAT.
532* LL1 sends this message to inform UL1 the gap pattern configuration when UL1 is active RAT.
533*
534* PARAMETERS
535* LOCAL_PARA_HDR
536* standby_gap - standby gap pattern
537* active_gap - active gap pattern configuration
538* tid - tid for lastest meas_req on
539*****************************************************************************/
540typedef struct
541{
542 LOCAL_PARA_HDR
543 ll1_ul1_expand_gap_pattern_struct standby_gap;
544 ll1_umts_fdd_gap_config_struct active_gap;
545 kal_uint8 tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
546}ll1_ul1_gap_notify_ind_struct;
547
548/*****************************************************************************
549* STRUCT
550* ul1_ll1_gap_pattern_ind_struct
551*
552* DESCRIPTIONS
553* UL1 sends this message to inform LL1 that the free RF period in UL1 as gap pattern.
554* PARAMETERS
555* LOCAL_PARA_HDR
556* ul1_current_time - Ul1 current time
557* idle_gap - No matter the length is bigger than zero or not,
558* UL1 should send this message and sets is_drx_tick = KAL_TRUE in one DRX period once.
559* fach_gap - fach gap pattern
560* dch_gap - tgps gap pattern
561*****************************************************************************/
562typedef struct
563{
564 LOCAL_PARA_HDR
565 umts_fdd_time_struct ul1_current_time;
566 umts_fdd_idle_gap_struct idle_gap;
567 umts_fdd_fach_gap_struct fach_gap;
568 umts_fdd_dch_gap_struct dch_gap;
569}ul1_ll1_gap_pattern_ind_struct;
570
571/*****************************************************************************
572* STRUCT
573* ll1_ul1_sync_req_struct
574* ul1_ll1_gap_stop_req_struct
575* ll1_ul1_gap_stop_cnf_struct
576* ll1_ul1_gap_stop_req_struct
577* ul1_ll1_gap_suspend_req_struct
578* ll1_ul1_gap_suspend_cnf_struct
579* ll1_ul1_gap_suspend_req_struct
580* ul1_ll1_gap_suspend_cnf_struct
581* ul1_ll1_gap_resume_ind_struct
582* ll1_ul1_gap_resume_ind_struct
583* ul1_ll1_auto_gap_stop_req_struct
584* ll1_ul1_auto_gap_stop_ind_struct
585* ul1_ll1_auto_gap_stop_res_struct
586* ll1_ul1_auto_gap_stop_cnf_struct
587* ul1_ll1_auto_gap_end_ind_struct
588* ll1_ul1_auto_gap_end_ind_struct
589* ul1_ll1_auto_gap_available_ind_struct
590* ll1_ul1_auto_gap_available_ind_struct
591*
592* DESCRIPTIONS
593* ll1_ul1_sync_req_struct
594* LL1 will use this primitive to get UL1 current UMTS timing and micro
595* second counter value in both UL1 in active and standby mode.
596*
597* ul1_ll1_gap_stop_req_struct
598* UL1 uses this primitive to inform LL1 to stop all gap usage in standby
599* RAT when GERAN GSM wants to change configuration or other purposes.
600*
601* ll1_ul1_gap_stop_cnf_struct
602* LL1 uses this primitive to confirm UL1 that LL1 has already stopped
603* all gap usages in standby RAT and UL1 could use all RF time.
604*
605* ll1_ul1_gap_stop_req_struct
606* LL1 uses this primitive to stop gap usage in UMTS FDD when UMTS FDD is standby RAT.
607*
608* ul1_ll1_gap_suspend_req_struct
609* UL1 uses this primitive to temporal suspend gap usage in standby RAT for higher priority
610* task and doesn't need to give new gap configuration in connection mode when resumed.
611*
612* ll1_ul1_gap_suspend_cnf_struct
613* LL1 sends this confirm message to UL1 after all standby RAT gap usage are suspended.
614*
615* ll1_ul1_gap_suspend_req_struct
616* LL1 sends this message to UL1 to request that UL1 suspends RF usage immediately.
617*
618* ul1_ll1_gap_suspend_cnf_struct
619* UL1 sends this message to confirm LL1 that UL1 will not use gap from
620* now to receiving resume indicator
621*
622* ul1_ll1_gap_resume_ind_struct
623* UL1 sends this message to inform LL1 that UL1 has already finished
624* higher priority task, and standby RAT could use gap normally.
625*
626* ll1_ul1_gap_resume_ind_struct
627* LL1 sends this message to UL1 to resume UL1's gap usage.
628* After receiving this message, UL1 could use gap pattern normally.
629*
630* ul1_ll1_auto_gap_stop_req_struct
631* UL1 sends this message to request LL1 that UL1 wants to
632* retrieve auto gap for higher priority task.
633*
634* ll1_ul1_auto_gap_stop_ind_struct
635* LL1 sends this message to inform UL1 of stopping using RF
636* during auto gap period.
637*
638* ul1_ll1_auto_gap_stop_res_struct
639* UL1 sends this message to response LL1 that UL1 stops
640* auto gap usage.
641*
642* ll1_ul1_auto_gap_stop_cnf_struct
643* LL1 sends this message to confirm that UL1 could use RF now.
644*
645* ul1_ll1_auto_gap_end_ind_struct
646* UL1 sends this message to inform LL1 that auto gap usage is finished.
647*
648* ll1_ul1_auto_gap_end_ind_struct
649* LL1 sends this message to inform UL1 that auto gap usage is finished.
650*
651* ul1_ll1_auto_gap_available_ind_struct
652* UL1 sends this message to inform LL1 that auto gap is available now. Standby RAT
653* could request auto gap now. Standby RAT could request auto gap now
654*
655* ll1_ul1_auto_gap_available_ind_struct
656* LL1 sends this message to inform UL1 that auto gap
657* is available now. UL1 could request auto gap now.
658*
659* ul1_ll1_auto_gap_unavailable_ind_struct
660* UL1 sends this message to inform LL1 that auto gap is unavailable now.
661* Standby RAT could not request auto gap now.
662*
663* ll1_ul1_auto_gap_unavailable_ind_struct
664* LL1 sends this message to inform UL1 that auto gap is unavailable now.
665* UL1 could not request auto gap now.
666*
667
668* PARAMETERS
669* LOCAL_PARA_HDR
670*****************************************************************************/
671typedef struct
672{
673 LOCAL_PARA_HDR
674}ll1_ul1_sync_req_struct,
675 ul1_ll1_gap_stop_req_struct,
676 ll1_ul1_gap_stop_cnf_struct,
677 ll1_ul1_gap_stop_req_struct,
678 ul1_ll1_gap_suspend_req_struct,
679 ll1_ul1_gap_suspend_cnf_struct,
680 ll1_ul1_gap_suspend_req_struct,
681 ul1_ll1_gap_suspend_cnf_struct,
682 ul1_ll1_gap_resume_ind_struct,
683 ll1_ul1_gap_resume_ind_struct,
684 ul1_ll1_auto_gap_stop_req_struct,
685 ll1_ul1_auto_gap_stop_ind_struct,
686 ul1_ll1_auto_gap_stop_res_struct,
687 ll1_ul1_auto_gap_stop_cnf_struct,
688 ul1_ll1_auto_gap_end_ind_struct,
689 ll1_ul1_auto_gap_end_ind_struct,
690 ul1_ll1_auto_gap_available_ind_struct,
691 ll1_ul1_auto_gap_available_ind_struct,
692 ul1_ll1_auto_gap_unavailable_ind_struct,
693 ll1_ul1_auto_gap_unavailable_ind_struct;
694
695/*****************************************************************************
696* STRUCT
697* mll1_ul1_info_database_struct
698*
699* DESCRIPTIONS
700* UL1 information structure.
701*
702* PARAMETERS
703*
704*****************************************************************************/
705typedef struct
706{ /* measure req*/
707 kal_uint8 tick_bmp; /* use to record tick bitmap*/
708 kal_uint8 rank_tick_tid; /* tid for rank tick*/
709 kal_uint8 prio_tick_tid; /* tid for prio tick*/
710 kal_uint8 meas_done_bmp; /* measurement done ind bitmap*/
711 kal_bool is_meas_done_useful; /* umts fdd uses meas_done or not by checking meas_purpose_bmp*/
712 kal_uint8 meas_purpose_bitmap; /* record the measure purpose bitmap*/
713 umts_fdd_time_struct current_time; /* umts fdd current time when request gap service*/
714 umts_fdd_time_struct current_time_from_ul1; /* Record the UL1 current time carried in the gap pattern ind */
715 /* Paging period in active RAT */
716 kal_int32 drx_cycle; /* 80,160,320,640,1280,2560,5120 Unit : ms*/
717 /* Burst length for eFACH DRX*/
718 kal_int32 burst_length; /* 10,20,40,80,160 Unit : ms*/
719 /* auto gap para*/
720 umts_fdd_time_struct auto_time; /* auto gap time*/
721 /* Mode status*/
722 ll1_active_rat_mode_status_enum mode_status; /* mode status*/
723 /* GAP pattern*/
724 ul1_ll1_gap_pattern_ind_struct gap_pattern; /* Gap pattern */
725 /* Gap request from standby rat should do sync in connection*/
726 kal_bool valid_timing; /* KAL_TRUE : with valid timing */
727 /* KAL_FALSE : with invalid timing */
728 kal_uint8 meas_req_tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
729}mll1_ul1_info_database_struct;
730#if 0
731/* under construction !*/
732/* under construction !*/
733/* under construction !*/
734/* under construction !*/
735/* under construction !*/
736/* under construction !*/
737/* under construction !*/
738/* under construction !*/
739/* under construction !*/
740/* under construction !*/
741/* under construction !*/
742/* under construction !*/
743/* under construction !*/
744/* under construction !*/
745/* under construction !*/
746/* under construction !*/
747/* under construction !*/
748/* under construction !*/
749/* under construction !*/
750/* under construction !*/
751/* under construction !*/
752/* under construction !*/
753/* under construction !*/
754/* under construction !*/
755/* under construction !*/
756/* under construction !*/
757/* under construction !*/
758/* under construction !*/
759/* under construction !*/
760/* under construction !*/
761/* under construction !*/
762/* under construction !*/
763/* under construction !*/
764/* under construction !*/
765/* under construction !*/
766#endif /*__POP_FSM__*/
767
768/*****************************************************************************
769* GLOBAL FUNCTIONS
770*****************************************************************************/
771
772/*****************************************************************************
773* FUNCTION
774* mll1_tick_ul1_gap_expansion
775* DESCRIPTION
776* tick ul1 to expand gap when sync done
777*
778* PARAMETERS
779* none
780* RETURNS
781* none
782* GLOBALS AFFECTED
783* none
784*****************************************************************************/
785void mll1_tick_ul1_gap_expansion(void);
786
787/*****************************************************************************
788* FUNCTION
789* mll1_ul1_auto_gap_available_ind
790* DESCRIPTION
791* ll1 sends auto gap available ind to UMTS FDD now
792*
793* PARAMETERS
794* kal_bool available
795* RETURNS
796* none
797* GLOBALS AFFECTED
798* none
799*****************************************************************************/
800void mll1_ul1_auto_gap_available_ind(kal_bool available);
801
802/*****************************************************************************
803* FUNCTION
804* mll1_ul1_auto_gap_cnf
805* DESCRIPTION
806* ll1 sends auto gap cnf to UMTS_FDD now
807*
808* PARAMETERS
809* success - success or not
810* RETURNS
811* none
812* GLOBALS AFFECTED
813* none
814*****************************************************************************/
815void mll1_ul1_auto_gap_cnf(kal_bool success,kal_int32 valid_period);
816
817/*****************************************************************************
818* FUNCTION
819* mll1_ul1_auto_gap_end_ind
820* DESCRIPTION
821* ll1 sends auto gap end ind to UMTS FDD now
822*
823* PARAMETERS
824* none
825* RETURNS
826* none
827* GLOBALS AFFECTED
828* none
829*****************************************************************************/
830void mll1_ul1_auto_gap_end_ind(void);
831
832/*****************************************************************************
833* FUNCTION
834* mll1_ul1_auto_gap_ind
835* DESCRIPTION
836* ll1 sends auto gap end ind to UMTS FDD now
837*
838* PARAMETERS
839* fdd_time - auto time
840* RETURNS
841* none
842* GLOBALS AFFECTED
843* none
844*****************************************************************************/
845void mll1_ul1_auto_gap_ind(umts_fdd_time_struct fdd_time);
846
847/*****************************************************************************
848* FUNCTION
849* mll1_ul1_auto_gap_stop_cnf
850* DESCRIPTION
851* ll1 sends auto gap stop cnf to UMTS_FDD now
852*
853* PARAMETERS
854* None
855* RETURNS
856* none
857* GLOBALS AFFECTED
858* none
859*****************************************************************************/
860void mll1_ul1_auto_gap_stop_cnf(void);
861
862/*****************************************************************************
863* FUNCTION
864* mll1_ul1_auto_gap_stop_ind
865* DESCRIPTION
866* ll1 sends auto gap stop ind to UMTS_FDD now
867*
868* PARAMETERS
869* None
870* RETURNS
871* none
872* GLOBALS AFFECTED
873* none
874*****************************************************************************/
875void mll1_ul1_auto_gap_stop_ind(void);
876
877/*****************************************************************************
878* FUNCTION
879* mll1_ul1_auto_time_minus
880* DESCRIPTION
881* Add more rf margin for any standby rat which will enter sleep during autonomous serch procedure
882* Assume margin is smaller than one sfn
883* PARAMETERS
884* umts_fdd_time_struct*
885* kal_int32 - more RF margin (recovery from sleep).
886* RETURNS
887* void
888*****************************************************************************/
889void mll1_ul1_auto_time_minus(umts_fdd_time_struct* time, kal_int32 echip);
890
891/*****************************************************************************
892* FUNCTION
893* mll1_ul1_expand_active_gap_pattern_ind
894* DESCRIPTION
895* ll1 sends active gap pattern ind to UMTS_FDD now
896*
897* PARAMETERS
898* start_time - Valid time of gap pattern in active RAT
899* use_num - Continuous gap number could be used in active RAT(Each FMO cycle = 10*M_REP*NTTI as a unit)
900* skip_num - Skip number in active RAT (Each FMO cycle = 10*M_REP*NTTI as a unit)
901* RETURNS
902* none
903* GLOBALS AFFECTED
904* none
905*****************************************************************************/
906void mll1_ul1_expand_active_gap_pattern_ind(umts_fdd_time_struct* start_time,kal_uint8 use_num,kal_uint8 skip_num);
907
908/*****************************************************************************
909* FUNCTION
910* mll1_ul1_expand_gap_pattern_ind
911* DESCRIPTION
912* ll1 sends auto gap available ind to UMTS FDD now
913*
914* PARAMETERS
915* standby_gap - gap pattern for umts fdd
916* RETURNS
917* none
918* GLOBALS AFFECTED
919* none
920*****************************************************************************/
921void mll1_ul1_expand_gap_pattern_ind(ll1_ul1_expand_gap_pattern_struct* standby_gap);
922
923/*****************************************************************************
924* FUNCTION
925* mll1_ul1_gap_resume_ind
926* DESCRIPTION
927* LL1 sends this message to UL1 to resume UL1's gap usage.
928* After receiving this message, UL1 could use gap pattern normally.
929*
930* PARAMETERS
931* none
932* RETURNS
933* none
934* GLOBALS AFFECTED
935* none
936*****************************************************************************/
937void mll1_ul1_gap_resume_ind(void);
938
939/*****************************************************************************
940* FUNCTION
941* mll1_ul1_gap_service_req
942* DESCRIPTION
943* ll1 sends gap service req to UMTS_FDD now
944*
945* PARAMETERS
946* enable - KAL_TRUE : turn on gap service
947* - KAL_FALSE : turn off gap service
948* RETURNS
949* none
950* GLOBALS AFFECTED
951* none
952*****************************************************************************/
953void mll1_ul1_gap_service_req(kal_bool enable);
954
955/*****************************************************************************
956* FUNCTION
957* mll1_ul1_gap_stop_cnf
958* DESCRIPTION
959* LL1 uses this primitive to confirm UL1 that LL1 has already stopped
960* all gap usages in standby RAT and UL1 could use all RF time.
961*
962* PARAMETERS
963* NONE
964* RETURNS
965* none
966* GLOBALS AFFECTED
967* none
968*****************************************************************************/
969void mll1_ul1_gap_stop_cnf(void);
970
971/*****************************************************************************
972* FUNCTION
973* mll1_ul1_gap_stop_req
974* DESCRIPTION
975* LL1 uses this primitive to stop gap usage in UMTS FDD when UMTS FDD is standby RAT.
976*
977* PARAMETERS
978* NONE
979* RETURNS
980* none
981* GLOBALS AFFECTED
982* none
983*****************************************************************************/
984void mll1_ul1_gap_stop_req(void);
985
986/*****************************************************************************
987* FUNCTION
988* mll1_ul1_gap_suspend_cnf
989* DESCRIPTION
990* LL1 sends this confirm message to UL1 after gap usage in standby RAT is suspended.
991* UL1 could use RF only after getting this message.
992*
993* PARAMETERS
994* NONE
995* RETURNS
996* none
997* GLOBALS AFFECTED
998* none
999*****************************************************************************/
1000void mll1_ul1_gap_suspend_cnf(void);
1001
1002/*****************************************************************************
1003* FUNCTION
1004* mll1_ul1_gap_suspend_req
1005* DESCRIPTION
1006* LL1 uses this primitive to suspend gap usage in UMTS FDD when UMTS FDD is standby RAT.
1007*
1008* PARAMETERS
1009* NONE
1010* RETURNS
1011* none
1012* GLOBALS AFFECTED
1013* none
1014*****************************************************************************/
1015void mll1_ul1_gap_suspend_req(void);
1016
1017/*****************************************************************************
1018* FUNCTION
1019* mll1_ul1_get_auto_time
1020* DESCRIPTION
1021* return auto time from UL1
1022*
1023* PARAMETERS
1024* None
1025* RETURNS
1026* umts_fdd_time_struct auto_time
1027*****************************************************************************/
1028umts_fdd_time_struct mll1_ul1_get_auto_time(void);
1029
1030/*****************************************************************************
1031* FUNCTION
1032* mll1_ul1_get_current_time
1033* DESCRIPTION
1034* ll1 gets current time + ahead margin to expand gap
1035*
1036* PARAMETERS
1037* umts_fdd_time - start time of expansion period
1038* kal_bool is_ahead_time
1039* TRUE : advance eutran_time with the predefined ahead_time
1040* FALSE: don't advance eutran_time with the predefined ahead_time
1041* RETURNS
1042* none
1043* GLOBALS AFFECTED
1044* none
1045*****************************************************************************/
1046void mll1_ul1_get_current_time(umts_fdd_time_struct* fdd_time, kal_bool is_ahead_time);
1047
1048/*****************************************************************************
1049* FUNCTION
1050* mll1_ul1_get_efach_drx_tick_count
1051* DESCRIPTION
1052* ll1 gets rank tick base when umts fdd in efach drx mode
1053*
1054* PARAMETERS
1055* none
1056* RETURNS
1057* kal_uint32 count
1058* GLOBALS AFFECTED
1059* none
1060*****************************************************************************/
1061kal_uint32 mll1_ul1_get_efach_drx_tick_count(void);
1062
1063#ifdef __LTE_RAT__
1064/*****************************************************************************
1065* FUNCTION
1066* mll1_ul1_get_el1_rf_margin
1067* DESCRIPTION
1068* UL1 gets EL1 RF margin in current state
1069*
1070* PARAMETERS
1071* head - header_margin
1072* tail - tail_margin
1073* RETURNS
1074* none
1075*****************************************************************************/
1076void mll1_ul1_get_el1_rf_margin(kal_int32* head,kal_int32* tail);
1077#endif /*__LTE_RAT__*/
1078
1079#ifdef __GSM_RAT__
1080/*****************************************************************************
1081* FUNCTION
1082* mll1_ul1_get_gl1_rf_margin
1083* DESCRIPTION
1084* UL1 gets GL1 RF margin in current state
1085*
1086* PARAMETERS
1087* head - header_margin
1088* tail - tail_margin
1089* RETURNS
1090* none
1091*****************************************************************************/
1092void mll1_ul1_get_gl1_rf_margin(kal_int32* head,kal_int32* tail);
1093#endif /*__GSM_RAT__*/
1094
1095/*****************************************************************************
1096* FUNCTION
1097* mll1_ul1_get_mode_status
1098* DESCRIPTION
1099* return mode status from UL1
1100*
1101* PARAMETERS
1102* None
1103* RETURNS
1104* ll1_active_rat_mode_status_enum mode_status
1105*****************************************************************************/
1106ll1_active_rat_mode_status_enum mll1_ul1_get_mode_status(void);
1107
1108/*****************************************************************************
1109* FUNCTION
1110* mll1_ul1_get_t_abort
1111* DESCRIPTION
1112* Tidentify,gsm / Treconfirm,gsm uint: ms
1113*
1114* PARAMETERS
1115* tti - in ms
1116* t_meas - in ms
1117*
1118* RETURNS
1119* kal_uint32 t_abort;
1120*****************************************************************************/
1121kal_uint32 mll1_ul1_get_t_abort(kal_uint32 tti, kal_uint32 t_meas, kal_bool is_identify);
1122
1123
1124/*****************************************************************************
1125* FUNCTION
1126* mll1_ul1_get_t_abort_for_efach_drx
1127* DESCRIPTION
1128* Tidentify,gsm / Treconfirm,gsm uint: ms
1129*
1130* PARAMETERS
1131* kal_bool is_identify
1132*
1133* RETURNS
1134* kal_uint32 t_abort;
1135*****************************************************************************/
1136kal_uint32 mll1_ul1_get_t_abort_for_efach_drx(kal_bool is_identify);
1137
1138/*****************************************************************************
1139* FUNCTION
1140* mll1_ul1_get_tick_count
1141* DESCRIPTION
1142* UL1 tick number
1143*
1144* PARAMETERS
1145* is_prio_search - KAL_FALSE : ll1_main wants to get meas. tick
1146* KAL_TRUE : ll1_main wants to get prio. tick
1147* t_hps - 60 (uint : second)
1148*
1149* RETURNS
1150* kal_uint32 count;
1151*****************************************************************************/
1152kal_uint32 mll1_ul1_get_tick_count(kal_bool is_prio_search, kal_uint16 t_hps);
1153
1154/*****************************************************************************
1155* FUNCTION
1156* mll1_ul1_get_timing_status
1157* DESCRIPTION
1158*
1159* PARAMETERS
1160* RETURNS
1161* kal_bool - valid_timing KAL_TRUE : with valid timing
1162* KAL_FALSE : with invalid timing
1163* GLOBALS AFFECTED
1164* none
1165*****************************************************************************/
1166kal_bool mll1_ul1_get_timing_status(void);
1167
1168/*****************************************************************************
1169* FUNCTION
1170* mll1_ul1_get_ul1_rf_margin
1171* DESCRIPTION
1172* UL1 gets RF margin in current state
1173*
1174* PARAMETERS
1175* head - header_margin
1176* tail - tail_margin
1177* RETURNS
1178* none
1179*****************************************************************************/
1180void mll1_ul1_get_ul1_rf_margin(kal_int32* head,kal_int32* tail);
1181
1182/*****************************************************************************
1183* FUNCTION
1184* mll1_ul1_is_before_dest_time
1185* DESCRIPTION
1186* check if gap start time is before dest time,
1187*
1188* PARAMETERS
1189* src - gap start time sfn
1190* dest - expand start time sfn
1191* RETURNS
1192* kal_bool - KAL_TRUE : means that src is before dest time
1193* : the src_time is before the dest_time. Return false if they are equal.
1194* KAL_FALSE : means that dest is before src time
1195* GLOBALS AFFECTED
1196* none
1197*****************************************************************************/
1198kal_bool mll1_ul1_is_before_dest_time(kal_int32 src,kal_int32 dest);
1199
1200/*****************************************************************************
1201* FUNCTION
1202* mll1_ul1_offset_to_fmo_act_time
1203* DESCRIPTION
1204* calculate the timing offset between FMO activation time and expand start time.
1205*
1206* PARAMETERS
1207* src - gap start time sfn
1208* dest - expand start time sfn
1209* RETURNS
1210* kal_int32 - (-1) : FMO activation time fall in the duration of 480ms expand period.
1211* other positive value: the offset between MO activation time and expand start time.
1212*
1213* GLOBALS AFFECTED
1214* none
1215*****************************************************************************/
1216kal_int32 mll1_ul1_offset_to_fmo_act_time(kal_int32 src, umts_fdd_time_struct* dest);
1217
1218/*****************************************************************************
1219* FUNCTION
1220* mll1_ul1_is_lower_pwr_on
1221* DESCRIPTION
1222* Check if ul1 is low pwr on
1223*
1224* PARAMETERS
1225*
1226* RETURNS
1227* kal_bool - KAL_FALSE : measurement is not finished and need gap in this period
1228* KAL_TRUE : measurement is finished and doesnt need gap in this period
1229*****************************************************************************/
1230kal_bool mll1_ul1_is_lower_pwr_on(void);
1231
1232/*****************************************************************************
1233* FUNCTION
1234* mll1_ul1_mode_status_update_ind
1235* DESCRIPTION
1236* This message is sent to UL1 for informing that mode status of active RAT when UL1 is standby RAT.
1237* This message should be updated for UL1 in standby when any mode status changed in active RAT.
1238*
1239* PARAMETERS
1240* status - mode status in active RAT
1241* RETURNS
1242* none
1243* GLOBALS AFFECTED
1244* none
1245*****************************************************************************/
1246void mll1_ul1_mode_status_update_ind(ll1_active_rat_mode_status_enum status);
1247
1248/*****************************************************************************
1249* FUNCTION
1250* mll1_ul1_set_timing_status
1251* DESCRIPTION
1252*
1253* PARAMETERS
1254* flag - set valid_timing = flag
1255* RETURNS
1256* none
1257* GLOBALS AFFECTED
1258* none
1259*****************************************************************************/
1260void mll1_ul1_set_timing_status(kal_bool flag);
1261
1262/*****************************************************************************
1263* FUNCTION
1264* mll1_ul1_sync_time_req
1265* DESCRIPTION
1266* When timing synchronization procedure is triggered, mll1 will decide which rat should do
1267* timing synchronization based on the result of g_ll1_flight_rat|| g_ll1_standby_rat || g_ll1_active_rat.
1268*
1269* PARAMETERS
1270* RETURNS
1271* none
1272* GLOBALS AFFECTED
1273* none
1274*****************************************************************************/
1275void mll1_ul1_sync_time_req(void);
1276
1277/*****************************************************************************
1278* FUNCTION
1279* mll1_ul1_time_add
1280* DESCRIPTION
1281* This function is used to add echips to time
1282*
1283* PARAMETERS
1284* time - basic time
1285* echips - echips
1286* RETURNS
1287* none
1288*****************************************************************************/
1289void mll1_ul1_time_add( umts_fdd_time_struct* time, kal_int32 echips);
1290
1291
1292/*****************************************************************************
1293* FUNCTION
1294* mll1_ul1_update_current_time
1295* DESCRIPTION
1296* ll1 updates current time after timing sync. done
1297*
1298* PARAMETERS
1299* umts_fdd_time - current time
1300* RETURNS
1301* none
1302* GLOBALS AFFECTED
1303* none
1304*****************************************************************************/
1305void mll1_ul1_update_current_time(umts_fdd_time_struct* fdd_time);
1306
1307/*****************************************************************************
1308* CALL FUNCTION PROTOTYPE
1309* mll1_umts_fdd_handler()
1310*
1311* DESCRIPTION
1312* Function to handle the primitive from UL1.
1313*
1314* PARAMETERS
1315* current_ilm - primitive from UL1.
1316*
1317* RETURN
1318* None
1319*****************************************************************************/
1320void mll1_umts_fdd_handler(void *ptr_ilm);
1321
1322/*****************************************************************************
1323* FUNCTION
1324* mll1_ul1_info_init
1325* DESCRIPTION
1326* Initialize ul1 internal global variable
1327*
1328* PARAMETERS
1329* none
1330* RETURNS
1331* none
1332*****************************************************************************/
1333void mll1_fdd_info_init(void);
1334
1335/*****************************************************************************
1336* FUNCTION
1337* mll1_ul1_gap_pattern_timing_checking
1338* DESCRIPTION
1339* check if the pending gap is out of date or not
1340*
1341* PARAMETERS
1342* umts_fdd_time - ul1 timing correspond to some standby rat's timing indicated in measure request
1343* RETURNS
1344* TRUE - the pending gap has not been out of date
1345* FALSE - the pending gap has been out of date
1346* GLOBALS AFFECTED
1347* none
1348*****************************************************************************/
1349kal_bool mll1_ul1_gap_pattern_timing_checking(umts_fdd_time_struct umts_fdd_time);
1350
1351#endif /*_MLL1_UMTS_FDD_H*/
1352