comparison src/g23m-gsm/mm/mm_gprsp.c @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (8410)
4 | Modul : MM_GPRSP.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 module defines the functions which are necessary
18 | to bind the GPRS Primitives (MMGMM SAP) to the
19 | MM entity's internal functional interface.
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef MM_GPRSP_C
24 #define MM_GPRSP_C
25
26 #define ENTITY_MM
27
28 /*==== INCLUDES ===================================================*/
29 #include <string.h>
30 #include "typedefs.h"
31 #include "pconst.cdg"
32 #include "message.h"
33 #include "ccdapi.h"
34 #include "vsi.h"
35 #include "custom.h"
36 #include "gsm.h"
37 #include "prim.h"
38 #include "cnf_mm.h"
39 #include "mon_mm.h"
40 #include "pei.h"
41 #include "tok.h"
42 #include "mm.h"
43
44 #ifdef GPRS
45
46 /*==== EXPORT ==============================================================*/
47
48 /*==== TEST ================================================================*/
49
50 /*==== PRIVAT ==============================================================*/
51
52 /*==== VARIABLES ===========================================================*/
53
54 /*==== FUNCTIONS ===========================================================*/
55
56 /*
57 +----------------------------------------------------------------------------+
58 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
59 | STATE : code ROUTINE : mm_mmgmm_reg_req |
60 +----------------------------------------------------------------------------+
61
62 PURPOSE : This function receives the MMGMM_REG_REQ primitive and
63 forwards it to its appropriate handler.
64
65 */
66
67 GLOBAL void mm_mmgmm_reg_req (const T_MMGMM_REG_REQ *mmgmm_reg_req)
68 {
69 TRACE_FUNCTION ("mm_mmgmm_reg_req()");
70 mm_func_mmgmm_reg_req (mmgmm_reg_req->service_mode,
71 mmgmm_reg_req->reg_type,
72 mmgmm_reg_req->mobile_class,
73 mmgmm_reg_req->bootup_act);
74
75 PFREE (mmgmm_reg_req);
76 }
77
78
79 /*
80 +----------------------------------------------------------------------------+
81 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
82 | STATE : code ROUTINE : mm_mmgmm_nreg_req |
83 +----------------------------------------------------------------------------+
84
85 PURPOSE : This function receives the MMGMM_NREG_REQ primitive and
86 forwards it to its appropriate handler.
87
88 */
89
90 GLOBAL void mm_mmgmm_nreg_req (const T_MMGMM_NREG_REQ *mmgmm_nreg_req)
91 {
92 TRACE_FUNCTION ("mm_mmgmm_nreg_req()");
93
94 mm_func_mmgmm_nreg_req (mmgmm_nreg_req->detach_cause,
95 mmgmm_nreg_req->detach_done,
96 mmgmm_nreg_req->cause);
97
98 PFREE (mmgmm_nreg_req);
99 }
100
101
102 /*
103 +----------------------------------------------------------------------------+
104 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
105 | STATE : code ROUTINE : mm_mmgmm_net_req |
106 +----------------------------------------------------------------------------+
107
108 PURPOSE : This function receives the MMGMM_NREG_REQ primitive and
109 forwards it to its appropriate handler.
110
111 */
112
113 GLOBAL void mm_mmgmm_net_req (const T_MMGMM_NET_REQ *mmgmm_net_req)
114 {
115 GET_INSTANCE_DATA;
116 TRACE_FUNCTION ("mm_mmgmm_net_req()");
117
118 /* Mark the network search as beeing for the MMI */
119 mm_data->plmn_scan_mmi = TRUE;
120
121 /* Start scanning for available PLMNs */
122 mm_func_mmgmm_net_req ();
123
124 PFREE (mmgmm_net_req);
125 }
126
127
128 /*
129 +----------------------------------------------------------------------------+
130 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
131 | STATE : code ROUTINE : mm_mmgmm_plmn_res |
132 +----------------------------------------------------------------------------+
133
134 PURPOSE : This function receives the MMGMM_PLMN_RES primitive and
135 forwards it to its appropriate handler.
136
137 */
138
139 GLOBAL void mm_mmgmm_plmn_res (const T_MMGMM_PLMN_RES *mmgmm_plmn_res)
140 {
141 TRACE_FUNCTION ("mm_mmgmm_plmn_res()");
142
143 #ifdef WIN32
144 vsi_o_ttrace (VSI_CALLER TC_EVENT,
145 " plmn = %x%x%x %x%x%x",
146 mmgmm_plmn_res->plmn.mcc[0],
147 mmgmm_plmn_res->plmn.mcc[1],
148 mmgmm_plmn_res->plmn.mcc[2],
149 mmgmm_plmn_res->plmn.mnc[0],
150 mmgmm_plmn_res->plmn.mnc[1],
151 mmgmm_plmn_res->plmn.mnc[2]);
152 vsi_o_ttrace (VSI_CALLER TC_EVENT,
153 " reg_type = %x",
154 mmgmm_plmn_res->reg_type);
155 #endif /* #ifdef WIN32 */
156
157 mm_func_mmgmm_plmn_res (&mmgmm_plmn_res->plmn,
158 mmgmm_plmn_res->reg_type,
159 mmgmm_plmn_res->mobile_class);
160
161 PFREE (mmgmm_plmn_res);
162 }
163
164
165 /*
166 +----------------------------------------------------------------------------+
167 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
168 | STATE : code ROUTINE : mm_mmgmm_plmn_mode_req |
169 +----------------------------------------------------------------------------+
170
171 PURPOSE : This function receives the MMGMM_PLMN_MODE_REQ primitive and
172 forwards it to its appropriate handler.
173
174 */
175
176 GLOBAL void
177 mm_mmgmm_plmn_mode_req (const T_MMGMM_PLMN_MODE_REQ *mmgmm_plmn_mode_req)
178 {
179 TRACE_FUNCTION ("mm_mmgmm_plmn_mode_req()");
180
181 mm_func_mmgmm_plmn_mode_req (mmgmm_plmn_mode_req->mode);
182
183 PFREE (mmgmm_plmn_mode_req);
184 }
185
186
187 /*
188 +----------------------------------------------------------------------------+
189 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
190 | STATE : code ROUTINE : mm_mmgmm_auth_rej_req |
191 +----------------------------------------------------------------------------+
192
193 PURPOSE : This function receives the MMGMM_AUTH_REG_REQ primitive and
194 forwards it to its appropriate handler.
195
196 */
197
198 GLOBAL void
199 mm_mmgmm_auth_rej_req (const T_MMGMM_AUTH_REJ_REQ *mmgmm_auth_rej_req)
200 {
201 TRACE_FUNCTION ("mm_mmgmm_auth_rej_req()");
202
203 mm_func_mmgmm_auth_rej_req ();
204
205 PFREE (mmgmm_auth_rej_req);
206 }
207
208 /*
209 +----------------------------------------------------------------------------+
210 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
211 | STATE : code ROUTINE : mm_mmgmm_cm_establish_res |
212 +----------------------------------------------------------------------------+
213
214 PURPOSE : This function receives the MMGMM_CM_ESTABLISH_RES primitive and
215 forwards it to its appropriate handler.
216
217 */
218
219 GLOBAL void
220 mm_mmgmm_cm_establish_res (const T_MMGMM_CM_ESTABLISH_RES *est_res)
221 {
222 TRACE_FUNCTION ("mm_mmgmm_cm_establish_res()");
223
224 mm_func_mmgmm_cm_establish_res (est_res->cm_establish_res);
225
226 PFREE (est_res);
227 }
228
229
230 /*
231 +----------------------------------------------------------------------------+
232 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
233 | STATE : code ROUTINE : mm_mmgmm_attach_started_req |
234 +----------------------------------------------------------------------------+
235
236 PURPOSE : This function receives the MMGMM_ATTACH_STARTED_REQ primitive and
237 forwards it to its appropriate handler.
238
239 */
240
241 GLOBAL void
242 mm_mmgmm_attach_started_req (const T_MMGMM_ATTACH_STARTED_REQ *start_req)
243 {
244 TRACE_FUNCTION ("mm_mmgmm_attach_started_req()");
245
246 mm_func_mmgmm_attach_started_req ();
247
248 PFREE (start_req);
249 }
250
251
252 /*
253 +----------------------------------------------------------------------------+
254 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
255 | STATE : code ROUTINE : mm_mmgmm_attach_acc_req |
256 +----------------------------------------------------------------------------+
257
258 PURPOSE : This function receives the MMGMM_ATTACH_ACC_REQ primitive and
259 forwards it to its appropriate handler.
260
261 */
262
263 GLOBAL void
264 mm_mmgmm_attach_acc_req (const T_MMGMM_ATTACH_ACC_REQ *mmgmm_attach_acc_req)
265 {
266 TRACE_FUNCTION ("mmgmm_attach_acc_req()");
267
268 mm_func_mmgmm_attach_acc_req (&mmgmm_attach_acc_req->plmn,
269 mmgmm_attach_acc_req->lac,
270 mmgmm_attach_acc_req->v_tmsi,
271 mmgmm_attach_acc_req->tmsi,
272 mmgmm_attach_acc_req->v_equ_plmn_list,
273 &mmgmm_attach_acc_req->equ_plmn_list);
274
275 PFREE (mmgmm_attach_acc_req);
276 }
277
278
279 /*
280 +----------------------------------------------------------------------------+
281 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
282 | STATE : code ROUTINE : mm_mmgmm_attach_rej_req |
283 +----------------------------------------------------------------------------+
284
285 PURPOSE : This function receives the MMGMM_ATTACH_REJ_REQ primitive and
286 forwards it to its appropriate handler.
287
288 */
289
290 GLOBAL void
291 mm_mmgmm_attach_rej_req (const T_MMGMM_ATTACH_REJ_REQ *mmgmm_attach_rej_req)
292 {
293 TRACE_FUNCTION ("mm_mmgmm_attach_rej_req()");
294
295 mm_func_mmgmm_attach_rej_req (mmgmm_attach_rej_req->cause);
296
297 PFREE (mmgmm_attach_rej_req);
298 }
299
300
301 /*
302 +----------------------------------------------------------------------------+
303 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
304 | STATE : code ROUTINE : mm_mmgmm_detach_started_req |
305 +----------------------------------------------------------------------------+
306
307 PURPOSE : This function receives the MMGMM_DETACH_STARTED_REQ primitive and
308 forwards it to its appropriate handler.
309
310 */
311
312 GLOBAL void
313 mm_mmgmm_detach_started_req (const T_MMGMM_DETACH_STARTED_REQ *det_start_req)
314 {
315 TRACE_FUNCTION ("mm_mmgmm_detach_started_req()");
316
317 mm_func_mmgmm_detach_started_req ();
318
319 PFREE (det_start_req);
320 }
321
322
323 /*
324 +----------------------------------------------------------------------------+
325 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
326 | STATE : code ROUTINE : mm_mmgmm_start_t3212_req |
327 +----------------------------------------------------------------------------+
328
329 PURPOSE : This function receives the MMGMM_START_T3212_REQ primitive and
330 forwards it to its appropriate handler.
331
332 */
333
334 GLOBAL void
335 mm_mmgmm_start_t3212_req (const T_MMGMM_START_T3212_REQ *start_t3212_req)
336 {
337 TRACE_FUNCTION ("mmgmm_start_t3212_req()");
338
339 mm_func_mmgmm_start_t3212_req ();
340
341 PFREE (start_t3212_req);
342 }
343
344
345 /*
346 +----------------------------------------------------------------------------+
347 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
348 | STATE : code ROUTINE : mm_mmgmm_cm_emergency_res |
349 +----------------------------------------------------------------------------+
350
351 PURPOSE : This function receives the MMGMM_CM_EMERGENCY_RES primitive and
352 forwards it to its appropriate handler.
353
354 */
355
356 GLOBAL void
357 mm_mmgmm_cm_emergency_res (const T_MMGMM_CM_EMERGENCY_RES *emerge_res)
358 {
359 TRACE_FUNCTION ("mm_mmgmm_cm_emergency_res()");
360
361 mm_func_mmgmm_cm_emergency_res (emerge_res->cm_establish_res);
362
363 PFREE (emerge_res);
364 }
365
366
367 /*
368 +----------------------------------------------------------------------------+
369 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
370 | STATE : code ROUTINE : mm_mmgmm_allowed_req |
371 +----------------------------------------------------------------------------+
372
373 PURPOSE : This function receives the MMGMM_ALLOWED_REQ primitive and
374 forwards it to its appropriate handler.
375
376 */
377
378 GLOBAL void
379 mm_mmgmm_allowed_req (const T_MMGMM_ALLOWED_REQ *allowed_req)
380 {
381 GET_INSTANCE_DATA;
382 TRACE_FUNCTION ("mm_mmgmm_allowed_req()");
383
384 /*
385 * It can be safely assumed that the PLMN and the LAC is the
386 * PLMN and the LAC where RR is currently camped on.
387 */
388 assert (mm_check_lai_from_RR (&mm_data->mm.lai,
389 &allowed_req->plmn,
390 allowed_req->lac));
391
392 mm_func_mmgmm_allowed_req (allowed_req->v_equ_plmn_list, &allowed_req->equ_plmn_list);
393
394 PFREE (allowed_req);
395 }
396
397 #if 0
398 /*
399 +----------------------------------------------------------------------------+
400 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
401 | STATE : code ROUTINE : mm_mmgmm_trigger_req |
402 +----------------------------------------------------------------------------+
403
404 PURPOSE : This function receives the MMGMM_TRIGGER_REQ primitive and
405 forwards it to its appropriate handler.
406
407 */
408
409 GLOBAL void mm_mmgmm_trigger_req (const T_MMGMM_TRIGGER_REQ *trigger_req)
410 {
411 TRACE_FUNCTION ("mm_mmgmm_trigger_req()");
412
413 mm_func_mmgmm_trigger_req ();
414
415 PFREE (trigger_req);
416 }
417 #endif
418
419 #endif /* GPRS */
420
421 #endif /* MM_GPRSP_C */