comparison gsm-fw/g23m-gsm/mm/mm_fors.c @ 673:2f7df7a314f8

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