FreeCalypso > hg > fc-magnetite
comparison src/g23m-fad/rlp/rlp_srm.c @ 174:90eb61ecd093
src/g23m-fad: initial import from TCS3.2/LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 12 Oct 2016 05:40:46 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
173:bf64d785238a | 174:90eb61ecd093 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : CSD (8411) | |
4 | Modul : Rlp_srm.c | |
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 Modul defines the SREJ timer manager for | |
18 | the component Radio Link Protocol of the mobile station | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #ifndef RLP_SRM_C | |
23 #define RLP_SRM_C | |
24 #endif | |
25 | |
26 #define ENTITY_RLP | |
27 | |
28 /*==== INCLUDES ===================================================*/ | |
29 | |
30 #include <string.h> | |
31 #include "typedefs.h" | |
32 #include "vsi.h" | |
33 #include "custom.h" | |
34 #include "gsm.h" | |
35 #include "cus_rlp.h" | |
36 #include "prim.h" | |
37 #include "tok.h" | |
38 #include "rlp.h" | |
39 | |
40 /*==== CONST =======================================================*/ | |
41 | |
42 /*==== TYPES =======================================================*/ | |
43 | |
44 /*==== VAR EXPORT ==================================================*/ | |
45 | |
46 /*==== VAR LOCAL ===================================================*/ | |
47 | |
48 /*==== FUNCTIONS ===================================================*/ | |
49 | |
50 /* | |
51 +------------------------------------------------------------------------------ | |
52 | Function : srm_init | |
53 +------------------------------------------------------------------------------ | |
54 | Description : initialize the srej timer manager | |
55 | | |
56 | Parameters : - | |
57 | | |
58 | | |
59 | Return : - | |
60 +------------------------------------------------------------------------------ | |
61 */ | |
62 | |
63 | |
64 GLOBAL void srm_init | |
65 ( | |
66 void | |
67 ) | |
68 { | |
69 SHORT n; | |
70 | |
71 TRACE_FUNCTION ("srm_init()"); | |
72 | |
73 n =0; | |
74 while (n < SRM_DATA_SIZE) | |
75 { | |
76 rlp_data->srm.Data[n].count = 0; | |
77 n++; | |
78 } | |
79 } | |
80 | |
81 /* | |
82 +------------------------------------------------------------------------------ | |
83 | Function : srm_deinit | |
84 +------------------------------------------------------------------------------ | |
85 | Description : deintialize the srej timer manager at a certain point of time | |
86 | | |
87 | Parameters : - | |
88 | | |
89 | | |
90 | Return : - | |
91 +------------------------------------------------------------------------------ | |
92 */ | |
93 | |
94 | |
95 GLOBAL void srm_deinit | |
96 ( | |
97 void | |
98 ) | |
99 { | |
100 TRACE_FUNCTION ("srm_deinit()"); | |
101 srm_init(); | |
102 } | |
103 | |
104 /* | |
105 +------------------------------------------------------------------------------ | |
106 | Function : srm_reset | |
107 +------------------------------------------------------------------------------ | |
108 | Description : reset the srej timer manager | |
109 | | |
110 | Parameters : - | |
111 | | |
112 | | |
113 | Return : - | |
114 +------------------------------------------------------------------------------ | |
115 */ | |
116 | |
117 | |
118 GLOBAL void srm_reset | |
119 ( | |
120 void | |
121 ) | |
122 { | |
123 | |
124 TRACE_FUNCTION ("srm_reset()"); | |
125 | |
126 srm_init(); | |
127 } | |
128 | |
129 /* | |
130 +------------------------------------------------------------------------------ | |
131 | Function : srm_clear | |
132 +------------------------------------------------------------------------------ | |
133 | Description : clear the srej count for one slot | |
134 | | |
135 | Parameters : n - | |
136 | | |
137 | | |
138 | Return : - | |
139 +------------------------------------------------------------------------------ | |
140 */ | |
141 | |
142 | |
143 GLOBAL void srm_clear | |
144 ( | |
145 T_FRAME_NUM n | |
146 ) | |
147 { | |
148 | |
149 TRACE_FUNCTION ("srm_clear()"); | |
150 | |
151 rlp_data->srm.Data[n].count = 0; | |
152 } | |
153 | |
154 /* | |
155 +------------------------------------------------------------------------------ | |
156 | Function : srm_count | |
157 +------------------------------------------------------------------------------ | |
158 | Description : increment the srej count for one slot | |
159 | | |
160 | Parameters : n - | |
161 | | |
162 | | |
163 | Return : | |
164 +------------------------------------------------------------------------------ | |
165 */ | |
166 | |
167 | |
168 GLOBAL void srm_count(T_FRAME_NUM n) | |
169 { | |
170 TRACE_FUNCTION ("srm_count()"); | |
171 | |
172 rlp_data->srm.Data[n].count++; | |
173 } | |
174 | |
175 /* | |
176 +------------------------------------------------------------------------------ | |
177 | Function : srm_get_counter | |
178 +------------------------------------------------------------------------------ | |
179 | Description : get the srej count for one slot | |
180 | | |
181 | Parameters : n - | |
182 | | |
183 | | |
184 | Return : count - | |
185 +------------------------------------------------------------------------------ | |
186 */ | |
187 | |
188 | |
189 GLOBAL T_COUNTER srm_get_counter(T_FRAME_NUM n) | |
190 { | |
191 | |
192 TRACE_FUNCTION ("srm_get_counter()"); | |
193 | |
194 return rlp_data->srm.Data[n].count; | |
195 } |