FreeCalypso > hg > fc-magnetite
comparison src/g23m-gprs/grlc/grlc_gffs.c @ 183:219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 13 Oct 2016 04:24:13 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
182:f02d0a0e1849 | 183:219afcfc6250 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GPRS (8441) | |
4 | Modul : GRLC | |
5 +----------------------------------------------------------------------------- | |
6 | Copyright 2002 Texas Instruments Berlin, AG | |
7 | All rights reserved. | |
8 | | |
9 | This file is confidential and a trade secret of Texas | |
10 | Instruments Berlin, AG | |
11 | The receipt of or possession of this file does not convey | |
12 | any rights to reproduce or disclose its contents or to | |
13 | manufacture, use, or sell anything it may describe, in | |
14 | whole, or in part, without the specific written consent of | |
15 | Texas Instruments Berlin, AG. | |
16 +----------------------------------------------------------------------------- | |
17 | Purpose : This module implements signal handler functions for service | |
18 | GFF of entity GRLC. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #ifndef GRLC_GFFS_C | |
23 #define GRLC_GFFS_C | |
24 #endif | |
25 | |
26 #define ENTITY_GRLC | |
27 | |
28 /*==== INCLUDES =============================================================*/ | |
29 | |
30 #include "typedefs.h" /* to get Condat data types */ | |
31 #include "vsi.h" /* to get a lot of macros */ | |
32 #include "macdef.h" | |
33 #include "gprs.h" | |
34 #include "gsm.h" /* to get a lot of macros */ | |
35 #include "ccdapi.h" /* to get CCD API */ | |
36 #include "prim.h" /* to get the definitions of used SAP and directions */ | |
37 #include "message.h" | |
38 #include "grlc.h" /* to get the global entity definitions */ | |
39 #include "grlc_gfff.h" | |
40 | |
41 /*==== CONST ================================================================*/ | |
42 | |
43 /*==== LOCAL VARS ===========================================================*/ | |
44 | |
45 /*==== PRIVATE FUNCTIONS ====================================================*/ | |
46 | |
47 /*==== PUBLIC FUNCTIONS =====================================================*/ | |
48 | |
49 | |
50 #if defined REL99 AND defined TI_PS_FF_TBF_EST_PACCH | |
51 /* | |
52 +------------------------------------------------------------------------------ | |
53 | Function : sig_tm_gff_ul_activate | |
54 +------------------------------------------------------------------------------ | |
55 | Description : Handles the internal signal SIG_TM_GFF_UL_ACTIVATE | |
56 | | |
57 | Parameters : activate_cause - added for 2 Phase Access support | |
58 | | |
59 +------------------------------------------------------------------------------ | |
60 */ | |
61 GLOBAL void sig_tm_gff_ul_activate ( UBYTE activate_cause) | |
62 { | |
63 TRACE_ISIG( "sig_tm_gff_ul_activate" ); | |
64 | |
65 switch( GET_STATE( GFF ) ) | |
66 { | |
67 case GFF_TWO_PHASE: | |
68 if (activate_cause EQ GFF_ACTIVE) | |
69 { | |
70 SET_STATE(GFF,GFF_ACTIVE); | |
71 } | |
72 break; | |
73 case GFF_ACTIVE: | |
74 if ( (activate_cause EQ GFF_ACTIVE ) AND | |
75 (grlc_data->gff.rlc_status EQ RLC_STATUS_DL )) | |
76 { | |
77 grlc_data->gff.rlc_status = RLC_STATUS_BOTH; | |
78 } | |
79 break; | |
80 case GFF_DEACTIVE: | |
81 if (activate_cause EQ GFF_TWO_PHASE) | |
82 { | |
83 SET_STATE(GFF,GFF_TWO_PHASE); | |
84 } | |
85 else | |
86 if(activate_cause EQ GFF_ACTIVE ) | |
87 { | |
88 SET_STATE(GFF,GFF_ACTIVE); | |
89 } | |
90 gff_tbf_init(); | |
91 grlc_data->gff.rlc_status = RLC_STATUS_UL; | |
92 break; | |
93 default: | |
94 TRACE_ERROR( "SIG_TM_GFF_UL_ACTIVATE unexpected" ); | |
95 break; | |
96 } | |
97 } /* sig_tm_gff_ul_activate() */ | |
98 #else | |
99 | |
100 /* | |
101 +------------------------------------------------------------------------------ | |
102 | Function : sig_tm_gff_ul_activate | |
103 +------------------------------------------------------------------------------ | |
104 | Description : Handles the internal signal SIG_TM_GFF_UL_ACTIVATE | |
105 | | |
106 | Parameters : dummy - description of parameter dummy | |
107 | | |
108 +------------------------------------------------------------------------------ | |
109 */ | |
110 GLOBAL void sig_tm_gff_ul_activate ( void) | |
111 { | |
112 TRACE_ISIG( "sig_tm_gff_ul_activate" ); | |
113 | |
114 switch( GET_STATE( GFF ) ) | |
115 { | |
116 case GFF_ACTIVE: | |
117 case GFF_DEACTIVE: | |
118 if(grlc_data->gff.rlc_status EQ RLC_STATUS_DL ) | |
119 { | |
120 grlc_data->gff.rlc_status = RLC_STATUS_BOTH; | |
121 } | |
122 else if(grlc_data->gff.rlc_status EQ RLC_STATUS_NULL ) | |
123 { | |
124 SET_STATE(GFF,GFF_ACTIVE); | |
125 gff_tbf_init(); | |
126 grlc_data->gff.rlc_status = RLC_STATUS_UL; | |
127 } | |
128 break; | |
129 default: | |
130 TRACE_ERROR( "SIG_TM_GFF_UL_ACTIVATE unexpected" ); | |
131 break; | |
132 } | |
133 } /* sig_tm_gff_ul_activate() */ | |
134 #endif | |
135 | |
136 | |
137 | |
138 /* | |
139 +------------------------------------------------------------------------------ | |
140 | Function : sig_tm_gff_ul_deactivate | |
141 +------------------------------------------------------------------------------ | |
142 | Description : Handles the internal signal SIG_TM_GFF_UL_DEACTIVATE | |
143 | | |
144 | Parameters : dummy - description of parameter dummy | |
145 | | |
146 +------------------------------------------------------------------------------ | |
147 */ | |
148 GLOBAL void sig_tm_gff_ul_deactivate ( void) | |
149 { | |
150 TRACE_ISIG( "sig_tm_gff_ul_deactivate" ); | |
151 | |
152 grlc_data->ul_tfi = 0xFF; | |
153 | |
154 switch( GET_STATE( GFF ) ) | |
155 { | |
156 #if defined REL99 AND defined TI_PS_FF_TBF_EST_PACCH | |
157 case GFF_TWO_PHASE: | |
158 #endif | |
159 case GFF_ACTIVE: | |
160 if(grlc_data->gff.rlc_status EQ RLC_STATUS_BOTH ) | |
161 grlc_data->gff.rlc_status = RLC_STATUS_DL; | |
162 else | |
163 { | |
164 grlc_data->gff.rlc_status = RLC_STATUS_NULL; | |
165 SET_STATE(GFF,GFF_DEACTIVE); | |
166 } | |
167 break; | |
168 default: | |
169 TRACE_ERROR( "SIG_TM_GFF_UL_DEACTIVATE unexpected" ); | |
170 break; | |
171 } | |
172 } /* sig_tm_gff_ul_deactivate() */ | |
173 | |
174 | |
175 | |
176 /* | |
177 +------------------------------------------------------------------------------ | |
178 | Function : sig_tm_gff_dl_activate | |
179 +------------------------------------------------------------------------------ | |
180 | Description : Handles the internal signal SIG_TM_GFF_DL_ACTIVATE | |
181 | | |
182 | Parameters : dummy - description of parameter dummy | |
183 | | |
184 +------------------------------------------------------------------------------ | |
185 */ | |
186 GLOBAL void sig_tm_gff_dl_activate ( void) | |
187 { | |
188 TRACE_ISIG( "sig_tm_gff_dl_activate" ); | |
189 | |
190 switch( GET_STATE( GFF ) ) | |
191 { | |
192 case GFF_ACTIVE: | |
193 case GFF_DEACTIVE: | |
194 if(grlc_data->gff.rlc_status EQ RLC_STATUS_UL ) | |
195 grlc_data->gff.rlc_status = RLC_STATUS_BOTH; | |
196 else if(grlc_data->gff.rlc_status EQ RLC_STATUS_NULL ) | |
197 { | |
198 SET_STATE(GFF,GFF_ACTIVE); | |
199 gff_tbf_init(); | |
200 grlc_data->gff.rlc_status = RLC_STATUS_DL; | |
201 } | |
202 break; | |
203 default: | |
204 TRACE_ERROR( "SIG_TM_GFF_DL_ACTIVATE unexpected" ); | |
205 break; | |
206 } | |
207 } /* sig_tm_gff_dl_activate() */ | |
208 | |
209 | |
210 | |
211 /* | |
212 +------------------------------------------------------------------------------ | |
213 | Function : sig_tm_gff_dl_deactivate | |
214 +------------------------------------------------------------------------------ | |
215 | Description : Handles the internal signal SIG_TM_GFF_DL_DEACTIVATE | |
216 | | |
217 | Parameters : dummy - description of parameter dummy | |
218 | | |
219 +------------------------------------------------------------------------------ | |
220 */ | |
221 GLOBAL void sig_tm_gff_dl_deactivate ( void) | |
222 { | |
223 TRACE_ISIG( "sig_tm_gff_dl_deactivate" ); | |
224 | |
225 grlc_data->dl_tfi = 0xFF; | |
226 | |
227 switch( GET_STATE( GFF ) ) | |
228 { | |
229 case GFF_ACTIVE: | |
230 if(grlc_data->gff.rlc_status EQ RLC_STATUS_BOTH ) | |
231 grlc_data->gff.rlc_status = RLC_STATUS_UL; | |
232 else | |
233 { | |
234 grlc_data->gff.rlc_status = RLC_STATUS_NULL; | |
235 SET_STATE(GFF,GFF_DEACTIVE); | |
236 } | |
237 break; | |
238 default: | |
239 TRACE_ERROR( "SIG_TM_GFF_DL_DEACTIVATE unexpected" ); | |
240 break; | |
241 } | |
242 } /* sig_tm_gff_dl_deactivate() */ | |
243 | |
244 |