comparison g23m-gsm/mm/mm_fors.c @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (8410)
4 | Modul : MM_FORS
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 functions for the formatter
18 | capability of the module Mobility Managemant.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef MM_FORS_C
23 #define MM_FORS_C
24
25 #include "config.h"
26 #include "fixedconf.h"
27 #include "condat-features.h"
28
29 #define ENTITY_MM
30
31 /*==== INCLUDES ===================================================*/
32 #if defined (NEW_FRAME)
33
34 #include <string.h>
35 #include <stdlib.h>
36 #include <stddef.h>
37 #include "typedefs.h"
38 #include "pcm.h"
39 #include "pconst.cdg"
40 #include "mconst.cdg"
41 #include "message.h"
42 #include "ccdapi.h"
43 #include "vsi.h"
44 #include "custom.h"
45 #include "gsm.h"
46 #include "prim.h"
47 #include "cnf_mm.h"
48 #include "mon_mm.h"
49 #include "pei.h"
50 #include "tok.h"
51 #include "mm.h"
52
53 #else
54
55 #include <string.h>
56 #include <stdlib.h>
57 #include <stddef.h>
58 #include "stddefs.h"
59 #include "pcm.h"
60 #include "pconst.cdg"
61 #include "mconst.cdg"
62 #include "message.h"
63 #include "ccdapi.h"
64 #include "custom.h"
65 #include "gsm.h"
66 #include "prim.h"
67 #include "cnf_mm.h"
68 #include "mon_mm.h"
69 #include "vsi.h"
70 #include "pei.h"
71 #include "tok.h"
72 #include "mm.h"
73
74 #endif
75
76 /*==== EXPORT =====================================================*/
77
78 /*==== PRIVAT =====================================================*/
79
80 /*==== VARIABLES ==================================================*/
81
82 /*==== FUNCTIONS ==================================================*/
83
84 /*
85 * -------------------------------------------------------------------
86 * SIGNAL Processing functions
87 * -------------------------------------------------------------------
88 */
89
90 /*
91 +--------------------------------------------------------------------+
92 | PROJECT : GSM-PS (6147) MODULE : MM_FOR |
93 | STATE : code ROUTINE : for_cm_message |
94 +--------------------------------------------------------------------+
95
96 PURPOSE : Process the signal cm_message.
97
98 */
99
100 GLOBAL void for_cm_message (T_RR_DATA_REQ *rr_data_req)
101 {
102 TRACE_FUNCTION ("for_cm_message()");
103
104 TIMERSTOP (T3240);
105
106 PSENDX (RR, rr_data_req);
107 }
108
109 /*
110 +--------------------------------------------------------------------+
111 | PROJECT : GSM-PS (6147) MODULE : MM_FOR |
112 | STATE : code ROUTINE : for_data_req |
113 +--------------------------------------------------------------------+
114
115 PURPOSE : Process the signal data_req.
116
117 */
118
119 GLOBAL void for_data_req (USHORT bit_size_message)
120 {
121 U8 *payload;
122 U16 length;
123 /* Implements Measure#32: Row 26,...,33 */
124 PALLOC_SDU (data, RR_DATA_REQ, bit_size_message);
125
126 TRACE_FUNCTION ("for_data_req()");
127
128 data->sdu.o_buf = ENCODE_OFFSET ;
129
130 ccd_codeMsg (CCDENT_MM,
131 UPLINK,
132 (T_MSGBUF *) &data->sdu,
133 (UBYTE *) _decodedMsg,
134 NOT_PRESENT_8BIT);
135
136 ccd_codeByte (data->sdu.buf, (USHORT)(data->sdu.o_buf - 8), 8,
137 PD_MM_TI_0);
138 data->sdu.l_buf += 8;
139 data->sdu.o_buf -= 8;
140
141 payload = &(data->sdu.buf[0]); /* beginning of buffer */
142 payload += (data->sdu.o_buf) >> 3; /* plus offset (bytes) */
143 length = (data->sdu.l_buf) >> 3; /* length (bytes, bits / 8) */
144
145 /* Implements Measure#32: Row 26,...,33 */
146 switch ( _decodedMsg [0] )
147 {
148 case U_AUTH_RES:
149 TRACE_BINDUMP( mm_handle,
150 TC_USER4,
151 "Up Link: AUTHENTICATION RESPONSE",
152 payload,
153 length);
154 break;
155
156 case U_IDENT_RES:
157 TRACE_BINDUMP( mm_handle,
158 TC_USER4,
159 "Up Link: IDENTITY RESPONSE",
160 payload,
161 length);
162 break;
163
164 case U_CM_REESTAB_REQ:
165 TRACE_BINDUMP( mm_handle,
166 TC_USER4,
167 "Up Link: CM RE-ESTABLISH REQUEST",
168 payload,
169 length);
170 break;
171
172 case U_CM_SERV_ABORT:
173 TRACE_BINDUMP( mm_handle,
174 TC_USER4,
175 "Up Link: CM SERVICE ABORT",
176 payload,
177 length);
178 break;
179
180 case U_CM_SERV_REQ:
181 TRACE_BINDUMP( mm_handle,
182 TC_USER4,
183 "Up Link: CM SERVICE REQUEST",
184 payload,
185 length);
186 break;
187
188 case U_IMSI_DETACH_IND:
189 TRACE_BINDUMP( mm_handle,
190 TC_USER4,
191 "Up Link: IMSI DETACH INDICATION",
192 payload,
193 length);
194 break;
195
196 case U_LOC_UPD_REQ:
197 TRACE_BINDUMP( mm_handle,
198 TC_USER4,
199 "Up Link: LOC UPDATE REQUEST",
200 payload,
201 length);
202 break;
203
204 case U_TMSI_REALLOC_COMP:
205 TRACE_BINDUMP( mm_handle,
206 TC_USER4,
207 "Up Link: TMSI REALLOC COMPLETE",
208 payload,
209 length);
210 break;
211
212 default:
213 break;
214 }
215 PSENDX (RR, data);
216 }
217
218 /*
219 +--------------------------------------------------------------------+
220 | PROJECT : GSM-PS (6147) MODULE : MM_FOR |
221 | STATE : code ROUTINE : for_est_req |
222 +--------------------------------------------------------------------+
223
224 PURPOSE : Process the signal est_req.
225
226 */
227
228 GLOBAL void for_est_req (USHORT est_cause, USHORT bit_size_message)
229 {
230 PALLOC_SDU ( establish_req, RR_ESTABLISH_REQ, bit_size_message);
231
232 TRACE_FUNCTION ("for_est_req()");
233
234 TIMERSTOP (T3240);
235
236 establish_req->sdu.o_buf = ENCODE_OFFSET;
237
238 ccd_codeMsg (CCDENT_MM,
239 UPLINK,
240 (T_MSGBUF *) &establish_req->sdu,
241 (UBYTE *) _decodedMsg,
242 0xff);
243
244 ccd_codeByte (establish_req->sdu.buf,
245 (USHORT)(establish_req->sdu.o_buf - 8),
246 8,
247 PD_MM_TI_0);
248 establish_req->sdu.l_buf += 8;
249 establish_req->sdu.o_buf -= 8;
250 establish_req->estcs = est_cause;
251
252 PSENDX (RR, establish_req);
253 }
254
255 #endif