blob: 742fc06ae849f04d6d988881712ec8a51bafacc4 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001#ifndef _MLL1_GSM_H
2#define _MLL1_GSM_H
3
4#include "kal_public_defs.h" /*for LOCAL_PARA_HDR*/
5#include "mll1_common.h"
6
7/*****************************************************************************
8* DEFINITIONS
9*****************************************************************************/
10#ifdef __UMTS_RAT__
11#ifdef __UMTS_FDD_MODE__
12#define GSM_SESSION_IN_PERIOD 48 /* it is possible to have 2 gaps in 3 frames. 48/3*2= 3 , However, 8960 can have the set with 48 gap.*/
13#endif /*__UMTS_FDD_MODE__*/
14
15#ifdef __UMTS_TDD128_MODE__
16#define GSM_SESSION_IN_PERIOD 312 /*DMO in two frames will give at most 13 spare slots (4+3+3+3), 480/20 *13 = 312*/
17#endif /*__UMTS_TDD128_MODE__*/
18#else /* LTE/GSM dual mode*/
19#define GSM_SESSION_IN_PERIOD 6 /* LTE GP0 /GP1 = 6 gap*/
20#endif /*__UMTS_RAT__*/
21
22
23/* should sync. with mll1_const.h, and modify LL1_TGPS_GSM_PURPOSE_BITMAP_MAGIC_NUM in mll1_private.h */
24#define MLL1_GAP_GSM_MEAS_BIT (0x0002) /* bit 1*/
25#define MLL1_GAP_GSM_BSIC_IDENTITY_BIT (0x0004) /* bit 2*/
26#define MLL1_GAP_GSM_BSIC_RECONFIRM_BIT (0x0008) /* bit 3*/
27#define MLL1_GAP_RESERVED_GSM_BSIC_BIT (0x0040) /* bit 6*/
28#define MLL1_GAP_DROP_TDS_FOR_GSM_BSIC_BIT (0x0040) /* bit 6*/
29#define MLL1_GAP_GSM_FMO (0x0100) /* bit 8*/
30#define MLL1_GAP_RESERVED_FOR_GSM_BSIC_BIT (0x0800) /* bit 11*/
31#define MLL1_GAP_GSM_UNDEFINED_BIT (0x1000) /* bit 12*/
32#define MLL1_GAP_LTE_LEFT_TO_GSM_BIT (0x2000) /* bit 13*/
33#define GERAN_SCHEDULE_DELAY 0 /* used to postpone available gap start time */
34/*****************************************************************************
35* ENUMERATIONS
36*****************************************************************************/
37/*****************************************************************************
38* ENUMERATION
39* gl1_ll1_rat_status_enum
40*
41* DESCRIPTIONS
42* Used to identify the status in GSM RAT.
43* NOTE
44* any modification should sync. with ll1_rat_status_enum
45*****************************************************************************/
46typedef enum
47{
48 GL1_LL1_RAT_FLIGHT =0,
49 GL1_LL1_RAT_STANDBY,
50 GL1_LL1_RAT_ACTIVE,
51 GL1_LL1_RAT_NUM
52} gl1_ll1_rat_status_enum;
53
54/*****************************************************************************
55* ENUMERATION
56* gsm_tgmp_enum
57*
58* DESCRIPTIONS
59* tgmp for gsm .
60* Note
61* any modification should sync. with umts_fdd_tgmp_enum
62* GSM_PURPOSE_BSIC_CNF_ONLY, only used for TDS
63*****************************************************************************/
64typedef enum
65{
66 GSM_PURPOSE_RSSI = 1,
67 GSM_PURPOSE_BSIC_INIT,
68 GSM_PURPOSE_BSIC_CNF,
69 GSM_PURPOSE_BSIC_CNF_ONLY,
70 GSM_PURPOSE_UNDEFINED
71} gsm_tgmp_enum;
72
73/*****************************************************************************
74* STRUCTURES
75*****************************************************************************/
76/*****************************************************************************
77* STRUCT
78* gsm_time_struct
79*
80* DESCRIPTIONS
81* GSM system timing base
82*
83* PARAMETERS
84* fn - GSM Frame Number (0~2715647), 1 FN = 10000 Ebits.
85* ebit - GSM Ebit (0~9999)
86*****************************************************************************/
87typedef struct
88{
89 kal_int32 fn;
90 kal_int32 ebit;
91}geran_gsm_time_struct;
92
93/*****************************************************************************
94* STRUCT
95* ll1_gsm_standby_gap_struct
96*
97* DESCRIPTIONS
98* GSM standby gap pattern structure.
99*
100* PARAMETERS
101* start_time - start time of the gap session
102* length - length of the gap session (in ebit)
103* purpose - Purpose for this gap session
104* purpose_bitmap - Purpose bitmap for this gap session
105*****************************************************************************/
106typedef struct
107{
108 geran_gsm_time_struct start_time;
109 kal_int32 length;
110 gsm_tgmp_enum purpose;
111 kal_int32 purpose_bitmap;
112}ll1_gsm_standby_gap_struct;
113
114/*****************************************************************************
115* STRUCT
116* ll1_gl1_expand_gap_pattern_struct
117*
118* DESCRIPTIONS
119* LL1 expands gap pattern for GL1
120*
121* PARAMETERS
122* session_num - Indicate how many gap session
123* session[] - Standby gap session.
124* measure_tid - Transition id for RANK tick./Valid when active RAT is in DRX mode./And bit 0 in tick_bitmap is "1"
125* hps_tid - Transition id for HPS tick./Valid when active RAT is in DRX mode./And bit 1 in tick_bitmap is "1"
126* tick_bitmap - Bit 0 : Rank search , Bit 1 : Priority search
127* t_identify_abort - 0xFFFFFFFF means no requirement, Unit : ms, Valid when active rat is in connection mode
128* abort the bsic identification if it has not successfully decoded it with the period
129* t_reconfirm_abort - 0xFFFFFFFF means no requirement, Unit : ms, Valid when active rat is in connection mode, abort the bsic re-comfirmation
130* If fails to decode bsic after two successive attempts or if has not been able to reconfirm the bsic for a cell with the period
131* gap_expand_period - only valid when mode status in active rat is LL1_GL1_EUTRAN_CONNECT
132* - value = 240/480 ms
133* n_freq_without_m_gsm - only valid when mode status in active rat is LL1_GL1_EUTRAN_CONNECT
134* - equals to Nfreq,E-UTRA + Nfreq,UTRA.
135* dmo_lte_period - the period in DMO for lte. GSM uses remained DMO with lte purpose for gsm usage when tds is active rat
136* - Valid when : purpose_bitmap & MLL1_GAP_LTE_LEFT_TO_GSM_BIT != 0
137* dmo_lte_length - the length in DMO for lte. GSM uses remained DMO with lte purpose for gsm usage when tds is active rat
138* - Valid when : purpose_bitmap & MLL1_GAP_LTE_LEFT_TO_GSM_BIT != 0
139*****************************************************************************/
140typedef struct
141{
142 kal_uint16 session_num;
143 ll1_gsm_standby_gap_struct session[GSM_SESSION_IN_PERIOD];
144 kal_uint8 measure_tid;
145 kal_uint8 hps_tid;
146 kal_uint8 tick_bitmap;
147 kal_uint32 t_identify_abort;
148 kal_uint32 t_reconfirm_abort;
149 kal_uint16 gap_expand_period;
150 kal_uint8 n_freq_without_m_gsm;
151 kal_uint16 dmo_lte_period;
152 kal_uint16 dmo_lte_length;
153}ll1_gl1_expand_gap_pattern_struct;
154
155/*****************************************************************************
156* STRUCT
157* gl1_ll1_sync_cnf_struct
158*
159* DESCRIPTIONS
160* GL1 uses this primitive to confirm LL1 that current GERAN GSM timing
161* and micro second counter value.
162*
163* PARAMETERS
164* LOCAL_PARA_HDR
165* current_time - sync. time in geran_gsm_time_struct
166* gsm_ustime - sync. time in USC
167*****************************************************************************/
168typedef struct
169{
170 LOCAL_PARA_HDR
171 geran_gsm_time_struct current_time;
172 kal_uint32 gsm_ustime;
173}gl1_ll1_sync_cnf_struct;
174
175/*****************************************************************************
176* STRUCT
177* gl1_ll1_rat_status_ind_struct
178*
179* DESCRIPTIONS
180* This message is sent from GL1 to LL1 for informing current GL1 RAT status.
181* This message should be sent when GL1 RAT status changed.
182*
183* PARAMETERS
184* LOCAL_PARA_HDR
185* rat_status - RAT status in GL1
186*****************************************************************************/
187typedef struct
188{
189 LOCAL_PARA_HDR
190 gl1_ll1_rat_status_enum rat_status;
191}gl1_ll1_rat_status_ind_struct;
192
193/*****************************************************************************
194* STRUCT
195* gl1_ll1_mode_status_ind_struct
196*
197* DESCRIPTIONS
198* This message is sent from GL1 to LL1 for informing that GL1 mode status when GL1 is active RAT.
199* This message should be sent when GL1 mode status changed.
200*
201* PARAMETERS
202* LOCAL_PARA_HDR
203* gsm_mode_status - current mode in GL1 when GSM is active RAT
204* paging_period - valid when gsm_mode_status = GL1_LL1_IDLE_MODE
205*****************************************************************************/
206typedef struct
207{
208 LOCAL_PARA_HDR
209 ll1_active_rat_mode_status_enum gsm_mode_status;
210 kal_uint8 paging_period;
211}gl1_ll1_mode_status_ind_struct;
212
213/*****************************************************************************
214* STRUCT
215* ll1_gl1_mode_status_update_ind_struct
216*
217* DESCRIPTIONS
218* This message is sent to GL1 for informing that mode status of active RAT when GL1 is standby RAT.
219* This message should be updated for GL1 in standby when any mode status changed in active RAT.
220* Also when GL1 enters into standby RAT from FLIGHT, LL1 will update current mode state in active RAT to GL1.
221*
222* PARAMETERS
223* LOCAL_PARA_HDR
224* active_rat_mode_status - current mode status in active RAT
225*****************************************************************************/
226typedef struct
227{
228 LOCAL_PARA_HDR
229 ll1_active_rat_mode_status_enum active_rat_mode_status;
230}ll1_gl1_mode_status_update_ind_struct;
231
232/*****************************************************************************
233* STRUCT
234* gl1_ll1_measure_req_struct
235*
236* DESCRIPTIONS
237* This message is sent from GL1 to inform LL1 that how many GERAN GSM frequencies
238* are required to be measured and the measurement purposes in GERAN GSM Standby.
239*
240* PARAMETERS
241* LOCAL_PARA_HDR
242* meas_purpose_bitmap - bit 0 for measurement, bit 1 for cell search
243* tid - tid for lastest meas_req on (should only change when off)
244* tick_bitmap - bit 0 for ranking search, bit 1 for priority search
245* carrier_num - high priority freqencies when HPS ON, measurement frequencies when HPS OFF
246* t_hps - basic period of high priority search (60s)
247* is_period_reset_bmp - bit 0 for rank period, 1 means to reset
248* - bit 1 for prio period, 0 means not to reset
249* - when freq. num is same as before, ll1 will check this flag to reset period or not
250* - KAL_TRUE : reset hps period, KAL_FALSE : doesnt reset hps period.
251* current_time - current in GL1
252*****************************************************************************/
253typedef struct
254{
255 LOCAL_PARA_HDR
256 kal_uint8 meas_purpose_bitmap;
257 kal_uint8 tid;
258 kal_uint8 tick_bitmap;
259 kal_uint8 carrier_num;
260 kal_uint16 t_hps;
261 kal_int32 is_period_reset_bmp;
262 geran_gsm_time_struct current_time;
263}gl1_ll1_measure_req_struct;
264
265/*****************************************************************************
266* STRUCT
267* gl1_ll1_standby_measure_done_ind_struct
268*
269* DESCRIPTIONS
270* For low power optimization, GL1 informs LL1 which measurement purpose is
271* measured done in its period. If all measurement purposes are measured done,
272* LL1 will not tick GL1 anymore in shortest measurement period.
273*
274* PARAMETERS
275* LOCAL_PARA_HDR
276* tid - For LL1 to know this tid is mapped to which gap pattern period sent before
277* tick_bitmap - bit 0 for ranking search, bit 1 for priority search. Only one bit will be set in one message
278*****************************************************************************/
279typedef struct
280{
281 LOCAL_PARA_HDR
282 kal_uint8 tid;
283 kal_uint8 tick_bitmap;
284}gl1_ll1_standby_measure_done_ind_struct;
285
286/*****************************************************************************
287* STRUCT
288* ll1_gl1_gap_service_req_struct
289*
290* DESCRIPTIONS
291* LL1 uses this primitive to enable (disable) active RAT gap service to get (release)
292* the free radio frequency period in GERAN GSM.When LL1 disables active RAT gap service,
293* it means that GERAN GSM could use all RF time already.
294*
295* PARAMETERS
296* LOCAL_PARA_HDR
297* enable - KAL_TRUE : request gap service
298* KAL_FALSE : stop gap service
299*****************************************************************************/
300typedef struct
301{
302 LOCAL_PARA_HDR
303 kal_bool enable;
304}ll1_gl1_gap_service_req_struct;
305
306/*****************************************************************************
307* STRUCT
308* ll1_gl1_gap_stop_req_struct
309*
310* DESCRIPTIONS
311* LL1 uses this primitive to stop gap usage in GERAN GSM when GERAN GSM is standby RAT.
312* Stop all purposes in gsm, confirmed with SY Yeh/Albert Lee SE2/CS3
313* PARAMETERS
314* LOCAL_PARA_HDR
315*
316*****************************************************************************/
317typedef struct
318{
319 LOCAL_PARA_HDR
320}ll1_gl1_gap_stop_req_struct;
321
322/*****************************************************************************
323* STRUCT
324* gl1_ll1_gap_stop_cnf_struct
325*
326* DESCRIPTIONS
327* GL1 uses this primitive to confirm LL1_GL1_GAP_STOP_REQ when there is no gap usage in GERAN GSM..
328* Stop all purposes in gsm, confirmed with SY Yeh/Albert Lee SE2/CS3
329* PARAMETERS
330* LOCAL_PARA_HDR
331* current_time - current time in GL1
332*****************************************************************************/
333typedef struct
334{
335 LOCAL_PARA_HDR
336 geran_gsm_time_struct current_time;
337}gl1_ll1_gap_stop_cnf_struct;
338
339/*****************************************************************************
340* STRUCT
341* gl1_ll1_auto_gap_req_struct
342*
343* DESCRIPTIONS
344* GL1 sends this message to request LL1 that GL1 wants to use the auto gap from (fn, ebits).
345* GL1 could use this auto gap after getting the successful confirm
346*
347* PARAMETERS
348* LOCAL_PARA_HDR
349* auto_time - Start time of auto gap in GL1
350*****************************************************************************/
351typedef struct
352{
353 LOCAL_PARA_HDR
354 geran_gsm_time_struct auto_time;
355}gl1_ll1_auto_gap_req_struct;
356
357/*****************************************************************************
358* STRUCT
359* ll1_gl1_auto_gap_cnf_struct
360*
361* DESCRIPTIONS
362* LL1 sends this message to confirm GL1 auto gap request.
363* After receiving this message, GL1 could use required auto gap.
364*
365* PARAMETERS
366* LOCAL_PARA_HDR
367* success - KAL_TRUE : GL1 could use auto gap to search
368* KAL_FALSE: GL1 could not use auto gap to search.
369* And GL1 should not request auto gap until AUTO_GAP_AVAILABLE_IND
370* valid_period - The length of autonomous gap allowed by active RAT.
371* The value is valid when success = KAL_TRUE,
372* Unit : ebit
373*****************************************************************************/
374typedef struct
375{
376 LOCAL_PARA_HDR
377 kal_bool success;
378 kal_int32 valid_period;
379}ll1_gl1_auto_gap_cnf_struct;
380
381/*****************************************************************************
382* STRUCT
383* ll1_gl1_auto_gap_ind_struct
384*
385* DESCRIPTIONS
386* LL1 sends this message to inform GL1 stopping using RF in this auto gap from (fn, ebits).
387*
388* PARAMETERS
389* LOCAL_PARA_HDR
390* auto_time - Start time of auto gap
391*****************************************************************************/
392typedef struct
393{
394 LOCAL_PARA_HDR
395 geran_gsm_time_struct auto_time;
396}ll1_gl1_auto_gap_ind_struct;
397
398/*****************************************************************************
399* STRUCT
400* gl1_ll1_auto_gap_res_struct
401*
402* DESCRIPTIONS
403* GL1 sends this message to response LL1 that GL1 will/won't use RF from
404* the start timing of auto gap which is informed by LL1_GL1_auto_GAP_IND.
405*
406* PARAMETERS
407* LOCAL_PARA_HDR
408* success - KAL_TRUE : GL1 will not use RF from the starting time of LL1_GL1_AUTO_GAP_IND
409* KAL_FALSE: GL1 may use RF after starting time of LL1_GL1_AUTO_GAP_IND.
410* valid_period - The length of autonomous gap allowed in GL1
411* The value is valid when GL1 is active rat and success = KAL_TRUE
412* Unit : ebit
413*****************************************************************************/
414typedef struct
415{
416 LOCAL_PARA_HDR
417 kal_bool success;
418 kal_int32 valid_period;
419}gl1_ll1_auto_gap_res_struct;
420
421/*****************************************************************************
422* STRUCT
423* ll1_gl1_gap_notify_ind_struct
424*
425* DESCRIPTIONS
426* LL1 sends this message to inform GL1 that the starting time and length of gap pattern.
427*
428* PARAMETERS
429* LOCAL_PARA_HDR
430* standby_gap - standby gap pattern
431* tid - tid for lastest meas_req on
432*****************************************************************************/
433typedef struct
434{
435 LOCAL_PARA_HDR
436 ll1_gl1_expand_gap_pattern_struct standby_gap;
437 kal_uint8 tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
438}ll1_gl1_gap_notify_ind_struct;
439
440/*****************************************************************************
441* STRUCT
442* gl1_ll1_gap_pattern_ind_struct
443*
444* DESCRIPTIONS
445* GL1 sends this message to inform LL1 that the free RF period in GL1 as gap pattern.
446* No matter the length is bigger than zero or not, GL1 should send this message
447* and sets is_drx_tick = KAL_TRUE in one DRX period once.
448*
449* PARAMETERS
450* LOCAL_PARA_HDR
451* repeat_count - (1) : GSM in NULL/IDLE /SDCCH mode (8) : GSM in TCH/PKT mode.
452* start_time - starting time of the first gap
453* length - gap length
454* is_drx_tick - KAL_TRUE : First tick in this DRX period
455* KAL_FALSE: Not the first free interval in this DRX period
456*****************************************************************************/
457typedef struct
458{
459 LOCAL_PARA_HDR
460 kal_uint8 repeat_count;
461 geran_gsm_time_struct start_time;
462 kal_int32 length;
463 kal_bool is_drx_tick;
464}gl1_ll1_gap_pattern_ind_struct;
465
466/*****************************************************************************
467* STRUCT
468* ll1_gl1_sync_req_struct
469* gl1_ll1_active_measure_status_ind_struct
470* gl1_ll1_gap_stop_req_struct
471* ll1_gl1_gap_stop_cnf_struct
472* gl1_ll1_gap_suspend_req_struct
473* ll1_gl1_gap_suspend_cnf_struct
474* ll1_gl1_gap_suspend_req_struct
475* gl1_ll1_gap_suspend_cnf_struct
476* gl1_ll1_gap_resume_ind_struct
477* ll1_gl1_gap_resume_ind_struct
478* gl1_ll1_auto_gap_stop_req_struct
479* ll1_gl1_auto_gap_stop_ind_struct
480* gl1_ll1_auto_gap_stop_res_struct
481* ll1_gl1_auto_gap_stop_cnf_struct
482* gl1_ll1_auto_gap_end_ind_struct
483* ll1_gl1_auto_gap_end_ind_struct
484* gl1_ll1_auto_gap_available_ind_struct
485* ll1_gl1_auto_gap_available_ind_struct
486*
487* DESCRIPTIONS
488* ll1_gl1_sync_req_struct
489* LL1 will use this primitive to get GL1 current UMTS timing and micro
490* second counter value in both GL1 in active and standby mode.
491*
492* gl1_ll1_active_measure_status_ind_struct (Useless Now)
493* GL1 informs LL1 that how many configured inter-RAT frequencies in GL1
494* when priority search is turned on.
495*
496* gl1_ll1_gap_stop_req_struct
497* GL1 uses this primitive to inform LL1 to stop all gap usage in standby
498* RAT when GERAN GSM wants to change configuration or other purposes.
499*
500* ll1_gl1_gap_stop_cnf_struct
501* LL1 uses this primitive to confirm GL1 that LL1 has already stopped
502* all gap usages in standby RAT and GL1 could use all RF time.
503*
504* gl1_ll1_gap_suspend_req_struct
505* GL1 uses this primitive to temporal suspend gap usage in standby RAT for higher priority
506* task and doesn't need to give new gap configuration in connection mode when resumed.
507*
508* ll1_gl1_gap_suspend_cnf_struct
509* LL1 sends this confirm message to GL1 after all standby RAT gap usage are suspended.
510*
511* ll1_gl1_gap_suspend_req_struct
512* LL1 sends this message to GL1 to request that GL1 suspends RF usage immediately.
513*
514* gl1_ll1_gap_suspend_cnf_struct
515* GL1 sends this message to confirm LL1 that GL1 will not use gap from
516* now to receiving resume indicator
517*
518* gl1_ll1_gap_resume_ind_struct
519* GL1 sends this message to inform LL1 that GL1 has already finished
520* higher priority task, and standby RAT could use gap normally.
521*
522* ll1_gl1_gap_resume_ind_struct
523* LL1 sends this message to GL1 to resume GL1's gap usage.
524* After receiving this message, GL1 could use gap pattern normally.
525*
526* gl1_ll1_auto_gap_stop_req_struct
527* GL1 sends this message to request LL1 that GL1 wants to
528* retrieve auto gap for higher priority task.
529*
530* ll1_gl1_auto_gap_stop_ind_struct
531* LL1 sends this message to inform GL1 of stopping using RF
532* during auto gap period.
533*
534* gl1_ll1_auto_gap_stop_res_struct
535* GL1 sends this message to response LL1 that GL1 stops
536* auto gap usage.
537*
538* ll1_gl1_auto_gap_stop_cnf_struct
539* LL1 sends this message to confirm that GL1 could use RF now.
540*
541* gl1_ll1_auto_gap_end_ind_struct
542* GL1 sends this message to inform LL1 that auto gap usage is finished.
543*
544* ll1_gl1_auto_gap_end_ind_struct
545* LL1 sends this message to inform GL1 that auto gap usage is finished.
546*
547* gl1_ll1_auto_gap_available_ind_struct
548* GL1 sends this message to inform LL1 that auto gap is available now. Standby RAT
549* could request auto gap now. Standby RAT could request auto gap now
550*
551* ll1_gl1_auto_gap_available_ind_struct
552* LL1 sends this message to inform GL1 that auto gap
553* is available now. GL1 could request auto gap now.
554*
555* gl1_ll1_auto_gap_unavailable_ind_struct
556* GL1 sends this message to inform LL1 that auto gap is unavailable now.
557* Standby RAT could not request auto gap now.
558*
559* ll1_gl1_auto_gap_unavailable_ind_struct
560* LL1 sends this message to inform GL1 that auto gap is unavailable now.
561* GL1 could not request auto gap now.
562*
563* PARAMETERS
564* LOCAL_PARA_HDR
565*****************************************************************************/
566typedef struct
567{
568 LOCAL_PARA_HDR
569}ll1_gl1_sync_req_struct,
570 gl1_ll1_active_measure_status_ind_struct,
571 gl1_ll1_gap_stop_req_struct,
572 ll1_gl1_gap_stop_cnf_struct,
573 gl1_ll1_gap_suspend_req_struct,
574 ll1_gl1_gap_suspend_cnf_struct,
575 ll1_gl1_gap_suspend_req_struct,
576 gl1_ll1_gap_suspend_cnf_struct,
577 gl1_ll1_gap_resume_ind_struct,
578 ll1_gl1_gap_resume_ind_struct,
579 gl1_ll1_auto_gap_stop_req_struct,
580 ll1_gl1_auto_gap_stop_ind_struct,
581 gl1_ll1_auto_gap_stop_res_struct,
582 ll1_gl1_auto_gap_stop_cnf_struct,
583 gl1_ll1_auto_gap_end_ind_struct,
584 ll1_gl1_auto_gap_end_ind_struct,
585 gl1_ll1_auto_gap_available_ind_struct,
586 ll1_gl1_auto_gap_available_ind_struct,
587 gl1_ll1_auto_gap_unavailable_ind_struct,
588 ll1_gl1_auto_gap_unavailable_ind_struct;
589
590/*****************************************************************************
591* STRUCT
592* mll1_gl1_info_database_struct
593*
594* DESCRIPTIONS
595* GL1 information structure.
596*
597* PARAMETERS
598*
599*****************************************************************************/
600typedef struct
601{ /* Measure req*/
602 kal_uint8 tick_bmp; /* use to record tick bitmap*/
603 kal_uint8 rank_tick_tid; /* tid for rank tick*/
604 kal_uint8 prio_tick_tid; /* tid for prio tick*/
605 kal_uint8 meas_done_bmp; /* measurement done ind bitmap*/
606 kal_bool is_meas_done_useful; /* gsm uses meas_done or not by checking meas_purpose_bmp*/
607 kal_uint8 meas_purpose_bitmap; /* record the measure purpose bitmap*/
608 geran_gsm_time_struct current_time; /* gsm current time when request gap service*/
609 /* Paging period in active RAT */
610 kal_uint8 paging_period; /* Range : 2~9 Unit : 51 frames*/
611 /* Used for Mgsm in LET GP1 */
612 kal_uint8 carrier; /* in LTE GP1 Mgsm = (ceil(carrier/20))*/
613 /* Store gap information*/
614 gl1_ll1_gap_pattern_ind_struct gap_pattern; /* store gap pattern ilm*/
615 /* auto gap para*/
616 geran_gsm_time_struct auto_time; /* auto gap time*/
617 /* Mode status*/
618 ll1_active_rat_mode_status_enum mode_status; /* mode status*/
619 /* Gap request from standby rat should do sync in connection*/
620 kal_bool valid_timing; /* KAL_TRUE : with valid timing*/
621 /* KAL_FALSE : with invalid timing */
622 kal_uint8 meas_req_tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
623}mll1_gl1_info_database_struct;
624
625#if 0
626/* under construction !*/
627/* under construction !*/
628/* under construction !*/
629/* under construction !*/
630/* under construction !*/
631/* under construction !*/
632/* under construction !*/
633/* under construction !*/
634/* under construction !*/
635/* under construction !*/
636/* under construction !*/
637/* under construction !*/
638/* under construction !*/
639/* under construction !*/
640/* under construction !*/
641/* under construction !*/
642/* under construction !*/
643/* under construction !*/
644/* under construction !*/
645/* under construction !*/
646/* under construction !*/
647/* under construction !*/
648/* under construction !*/
649/* under construction !*/
650/* under construction !*/
651/* under construction !*/
652/* under construction !*/
653/* under construction !*/
654/* under construction !*/
655/* under construction !*/
656/* under construction !*/
657/* under construction !*/
658/* under construction !*/
659/* under construction !*/
660/* under construction !*/
661/* under construction !*/
662#endif /*__POP_FSM__*/
663/*****************************************************************************
664* GLOBAL FUNCTIONS
665*****************************************************************************/
666/*****************************************************************************
667* FUNCTION
668* mll1_gl1_auto_gap_available_ind
669* DESCRIPTION
670* ll1 sends auto gap available ind to GERAN now
671*
672* PARAMETERS
673* kal_bool available
674* RETURNS
675* none
676* GLOBALS AFFECTED
677* none
678*****************************************************************************/
679void mll1_gl1_auto_gap_available_ind(kal_bool available);
680
681/*****************************************************************************
682* FUNCTION
683* mll1_gl1_auto_gap_cnf
684* DESCRIPTION
685* ll1 sends auto gap cnf to GERAN now
686*
687* PARAMETERS
688* success - success or not
689* valid_period - autonomous gap length which is allowed by active rat
690* RETURNS
691* none
692* GLOBALS AFFECTED
693* none
694*****************************************************************************/
695void mll1_gl1_auto_gap_cnf(kal_bool success,kal_int32 valid_period);
696
697/*****************************************************************************
698* FUNCTION
699* mll1_gl1_auto_gap_end_ind
700* DESCRIPTION
701* ll1 sends auto gap end ind to GERAN now
702*
703* PARAMETERS
704* none
705* RETURNS
706* none
707* GLOBALS AFFECTED
708* none
709*****************************************************************************/
710void mll1_gl1_auto_gap_end_ind(void);
711
712/*****************************************************************************
713* FUNCTION
714* mll1_gl1_auto_gap_ind
715* DESCRIPTION
716* ll1 sends auto gap ind to GERAN now
717*
718* PARAMETERS
719* gsm_time - auto time
720* RETURNS
721* none
722* GLOBALS AFFECTED
723* none
724*****************************************************************************/
725void mll1_gl1_auto_gap_ind(geran_gsm_time_struct gsm_time);
726
727/*****************************************************************************
728* FUNCTION
729* mll1_gl1_auto_gap_stop_cnf
730* DESCRIPTION
731* ll1 sends auto gap stop cnf to GERAN now
732*
733* PARAMETERS
734* None
735* RETURNS
736* none
737* GLOBALS AFFECTED
738* none
739*****************************************************************************/
740void mll1_gl1_auto_gap_stop_cnf(void);
741
742/*****************************************************************************
743* FUNCTION
744* mll1_gl1_auto_gap_stop_ind
745* DESCRIPTION
746* ll1 sends auto gap stop ind to GERAN now
747*
748* PARAMETERS
749* None
750* RETURNS
751* none
752* GLOBALS AFFECTED
753* none
754*****************************************************************************/
755void mll1_gl1_auto_gap_stop_ind(void);
756
757/*****************************************************************************
758* FUNCTION
759* mll1_gl1_auto_time_minus
760* DESCRIPTION
761* add more rf margin for any standby rat which will enter sleep during autonomous serch procedure
762*
763* PARAMETERS
764* geran_gsm_time_struct*
765* kal_int32 - more RF margin (recovery from sleep).
766* RETURNS
767* void
768*****************************************************************************/
769void mll1_gl1_auto_time_minus(geran_gsm_time_struct* time, kal_int32 ebits);
770
771/*****************************************************************************
772* FUNCTION
773* mll1_gl1_expand_gap_pattern_ind
774* DESCRIPTION
775* ll1 sends gap pattern ind to GERAN now
776*
777* PARAMETERS
778* standby_gap - gap pattern for geran
779* RETURNS
780* none
781* GLOBALS AFFECTED
782* none
783*****************************************************************************/
784void mll1_gl1_expand_gap_pattern_ind(ll1_gl1_expand_gap_pattern_struct* standby_gap);
785
786/*****************************************************************************
787* FUNCTION
788* mll1_gl1_gap_resume_ind
789* DESCRIPTION
790* LL1 sends this message to GL1 to resume GL1's gap usage.
791* After receiving this message, GL1 could use gap pattern normally.
792*
793* PARAMETERS
794* none
795* RETURNS
796* none
797* GLOBALS AFFECTED
798* none
799*****************************************************************************/
800void mll1_gl1_gap_resume_ind(void);
801
802/*****************************************************************************
803* FUNCTION
804* mll1_gl1_gap_service_request
805* DESCRIPTION
806* ll1 sends gap service req to GERAN now
807*
808* PARAMETERS
809* enable - KAL_TRUE : turn on gap service
810* - KAL_FALSE : turn off gap service
811* RETURNS
812* none
813* GLOBALS AFFECTED
814* none
815*****************************************************************************/
816void mll1_gl1_gap_service_req(kal_bool enable);
817
818/*****************************************************************************
819* FUNCTION
820* mll1_gl1_gap_stop_cnf
821* DESCRIPTION
822* LL1 uses this primitive to confirm GL1 that LL1 has already stopped
823* all gap usages in standby RAT and GL1 could use all RF time.
824*
825* PARAMETERS
826* NONE
827* RETURNS
828* none
829* GLOBALS AFFECTED
830* none
831*****************************************************************************/
832void mll1_gl1_gap_stop_cnf(void);
833
834/*****************************************************************************
835* FUNCTION
836* mll1_gl1_gap_stop_req
837* DESCRIPTION
838* LL1 uses this primitive to stop gap usage in GERAN GSM when GERAN GSM is standby RAT.
839* Stop all purposes in gsm, confirmed with SY Yeh/Albert Lee SE2/CS3
840* PARAMETERS
841* None
842* RETURNS
843* none
844* GLOBALS AFFECTED
845* none
846*****************************************************************************/
847void mll1_gl1_gap_stop_req(void);
848#if 0
849/* under construction !*/
850/* under construction !*/
851/* under construction !*/
852/* under construction !*/
853/* under construction !*/
854/* under construction !*/
855/* under construction !*/
856/* under construction !*/
857/* under construction !*/
858/* under construction !*/
859/* under construction !*/
860/* under construction !*/
861/* under construction !*/
862/* under construction !*/
863/* under construction !*/
864#endif /* currently GL1 will not use suspend procedure*/
865/*****************************************************************************
866* FUNCTION
867* mll1_gl1_gap_suspend_req
868* DESCRIPTION
869* LL1 uses this primitive to suspend gap usage in GERAN GSM when GERAN GSM is standby RAT.
870*
871* PARAMETERS
872* None
873* RETURNS
874* none
875* GLOBALS AFFECTED
876* none
877*****************************************************************************/
878void mll1_gl1_gap_suspend_req(void);
879
880/*****************************************************************************
881* FUNCTION
882* mll1_gl1_get_current_time
883* DESCRIPTION
884* ll1 gets current time
885*
886* PARAMETERS
887* geran_time - gl1 current time
888*
889* RETURNS
890* none
891* GLOBALS AFFECTED
892* none
893*****************************************************************************/
894void mll1_gl1_get_current_time(geran_gsm_time_struct* geran_time);
895
896/*****************************************************************************
897* FUNCTION
898* mll1_gl1_get_auto_time
899* DESCRIPTION
900* return auto time from GL1
901*
902* PARAMETERS
903* None
904* RETURNS
905* geran_gsm_time_struct auto_time
906*****************************************************************************/
907geran_gsm_time_struct mll1_gl1_get_auto_time(void);
908
909#ifdef __LTE_RAT__
910/*****************************************************************************
911* FUNCTION
912* mll1_gl1_get_el1_rf_margin
913* DESCRIPTION
914* GL1 gets EL1 RF margin in current state
915* margin should be small, so use kal_int32
916* PARAMETERS
917* head - header_margin
918* tail - tail_margin
919* RETURNS
920* none
921*****************************************************************************/
922void mll1_gl1_get_el1_rf_margin(kal_int32* head,kal_int32* tail);
923#endif /*__LTE_RAT__*/
924
925/*****************************************************************************
926* FUNCTION
927* mll1_gl1_get_gl1_rf_margin
928* DESCRIPTION
929* GL1 gets GL1 RF margin in current state
930*
931* PARAMETERS
932* head - header_margin
933* tail - tail_margin
934* RETURNS
935* none
936*****************************************************************************/
937void mll1_gl1_get_gl1_rf_margin(kal_int32* head,kal_int32* tail);
938
939/*****************************************************************************
940* FUNCTION
941* mll1_gl1_get_timing_status
942* DESCRIPTION
943*
944* PARAMETERS
945* RETURNS
946* kal_bool - valid_timing KAL_TRUE : with valid timing
947* KAL_FALSE : with invalid timing
948* GLOBALS AFFECTED
949* none
950*****************************************************************************/
951kal_bool mll1_gl1_get_timing_status(void);
952
953
954/*****************************************************************************
955* FUNCTION
956* mll1_gl1_get_m_gsm
957* DESCRIPTION
958* return M_GSM in GL1
959*
960* PARAMETERS
961* None
962* RETURNS
963* kal_uint8 m_gsm
964*****************************************************************************/
965kal_uint8 mll1_gl1_get_m_gsm(void);
966
967/*****************************************************************************
968* FUNCTION
969* mll1_gl1_get_mode_status
970* DESCRIPTION
971* return mode status from GL1
972*
973* PARAMETERS
974* None
975* RETURNS
976* ll1_active_rat_mode_status_enum mode_status
977*****************************************************************************/
978ll1_active_rat_mode_status_enum mll1_gl1_get_mode_status(void);
979
980/*****************************************************************************
981* FUNCTION
982* mll1_gl1_get_tick_count
983* DESCRIPTION
984* GL1 tick number
985*
986* PARAMETERS
987* is_prio_search - KAL_TRUE : ll1_main wants to get prio. tick
988* KAL_FALSE : ll1_main wants to get rank tick
989* hps - 25 or 70 (uint : second)
990*
991* RETURNS
992* kal_uint32 count;
993*****************************************************************************/
994kal_uint32 mll1_gl1_get_tick_count(kal_bool is_prio_search, kal_uint16 hps);
995
996#ifdef __UMTS_RAT__
997#ifdef __UMTS_FDD_MODE__
998/*****************************************************************************
999* FUNCTION
1000* mll1_gl1_get_ul1_rf_margin
1001* DESCRIPTION
1002* GL1 gets UL1 RF margin in current state
1003*
1004* PARAMETERS
1005* head - header_margin
1006* tail - tail_margin
1007* RETURNS
1008* none
1009*****************************************************************************/
1010void mll1_gl1_get_ul1_rf_margin(kal_int32* head,kal_int32* tail);
1011#endif /*__UMTS_FDD_MODE__*/
1012
1013#ifdef __UMTS_TDD128_MODE__
1014/*****************************************************************************
1015* FUNCTION
1016* mll1_gl1_get_tl1_rf_margin
1017* DESCRIPTION
1018* GL1 gets TL1 RF margin in current state
1019*
1020* PARAMETERS
1021* head - header_margin
1022* tail - tail_margin
1023* RETURNS
1024* none
1025*****************************************************************************/
1026void mll1_gl1_get_tl1_rf_margin(kal_int32* head,kal_int32* tail);
1027
1028/*****************************************************************************
1029* FUNCTION
1030* mll1_gl1_is_fb_sb_search_on
1031* DESCRIPTION
1032* Check if gl1 turns on fb/sb search
1033*
1034* PARAMETERS
1035*
1036* RETURNS
1037* kal_bool - KAL_FALSE : turns off fb/sb search
1038* KAL_TRUE : turns on fb/sb search
1039*****************************************************************************/
1040kal_bool mll1_gl1_is_fb_sb_search_on(void);
1041
1042#endif /*__UMTS_TDD128_MODE__*/
1043#endif /*__UMTS_RAT__*/
1044/*****************************************************************************
1045* FUNCTION
1046* mll1_gl1_is_lower_pwr_on
1047* DESCRIPTION
1048* Check if gl1 is low pwr on
1049*
1050* PARAMETERS
1051*
1052* RETURNS
1053* kal_bool - KAL_FALSE : measurement is not finished and need gap in this period
1054* KAL_TRUE : measurement is finished and doesnt need gap in this period
1055*****************************************************************************/
1056kal_bool mll1_gl1_is_lower_pwr_on(void);
1057
1058/*****************************************************************************
1059* FUNCTION
1060* mll1_gl1_mode_status_update_ind
1061* DESCRIPTION
1062* This message is sent to GL1 for informing that mode status of active RAT when GL1 is standby RAT.
1063* This message should be updated for GL1 in standby when any mode status changed in active RAT.
1064*
1065* PARAMETERS
1066* status - mode status in active RAT
1067* RETURNS
1068* none
1069* GLOBALS AFFECTED
1070* none
1071*****************************************************************************/
1072void mll1_gl1_mode_status_update_ind(ll1_active_rat_mode_status_enum status);
1073
1074/*****************************************************************************
1075* FUNCTION
1076* mll1_gl1_set_timing_status
1077* DESCRIPTION
1078*
1079* PARAMETERS
1080* flag - set valid_timing = flag
1081* RETURNS
1082* none
1083* GLOBALS AFFECTED
1084* none
1085*****************************************************************************/
1086void mll1_gl1_set_timing_status(kal_bool flag);
1087
1088
1089/*****************************************************************************
1090* FUNCTION
1091* mll1_gl1_sync_time_req
1092* DESCRIPTION
1093* When timing synchronization procedure is triggered, mll1 will decide which rat should do
1094* timing synchronization based on the result of g_ll1_flight_rat|| g_ll1_standby_rat || g_ll1_active_rat.
1095*
1096* PARAMETERS
1097* RETURNS
1098* none
1099* GLOBALS AFFECTED
1100* none
1101*****************************************************************************/
1102void mll1_gl1_sync_time_req(void);
1103
1104/*****************************************************************************
1105* FUNCTION
1106* mll1_gl1_time_add
1107* DESCRIPTION
1108* This function is used to add ebits to time , for rf margin, should smaller than kal_int32
1109*
1110* PARAMETERS
1111* time - basic time
1112* ebits - add ebits
1113* RETURNS
1114* none
1115*****************************************************************************/
1116void mll1_gl1_time_add( geran_gsm_time_struct* time, kal_int32 ebits );
1117
1118/*****************************************************************************
1119* CALL FUNCTION PROTOTYPE
1120* mll1_gsm_handler()
1121*
1122* DESCRIPTION
1123* Function to handle the primitive from GL1.
1124*
1125* PARAMETERS
1126* current_ilm - primitive from GL1.
1127*
1128* RETURN
1129* None
1130*****************************************************************************/
1131void mll1_gsm_handler(void *ptr_ilm);
1132
1133/*****************************************************************************
1134* FUNCTION
1135* mll1_tick_gl1_gap_expansion
1136* DESCRIPTION
1137* tick gl1 to expand gap when sync done
1138*
1139* PARAMETERS
1140* none
1141* RETURNS
1142* none
1143* GLOBALS AFFECTED
1144* none
1145*****************************************************************************/
1146void mll1_tick_gl1_gap_expansion(void);
1147
1148/*****************************************************************************
1149* FUNCTION
1150* mll1_gl1_info_init
1151* DESCRIPTION
1152* Initialize gl1 internal global variable
1153*
1154* PARAMETERS
1155* none
1156* RETURNS
1157* none
1158* GLOBALS AFFECTED
1159* none
1160*****************************************************************************/
1161void mll1_gl1_info_init(void);
1162
1163/*****************************************************************************
1164* FUNCTION
1165* mll1_gl1_gap_pattern_timing_checking
1166* DESCRIPTION
1167* check if the pending gap is out of date or not
1168*
1169* PARAMETERS
1170* gsm_time - gl1 timing correspond to some standby rat's timing indicated in measure request
1171* RETURNS
1172* TRUE - the pending gap has not been out of date
1173* FALSE - the pending gap has been out of date
1174* GLOBALS AFFECTED
1175* none
1176*****************************************************************************/
1177kal_bool mll1_gl1_gap_pattern_timing_checking(geran_gsm_time_struct gsm_time);
1178
1179#endif /*_MLL1_GSM_H*/
1180