comparison src/g23m-fad/t30/t30_muxp.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 : GSM-F&D (8411)
4 | Modul : t30_muxp
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 processing
18 | of incomming primitives for the component T30
19 | of the mobile station
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef T30_MUXP_C
24 #define T30_MUXP_C
25 #endif
26
27 #define ENTITY_T30
28
29 /*==== INCLUDES ===================================================*/
30
31 #include <string.h>
32 #include <stdlib.h>
33 #include <stddef.h>
34 #include "typedefs.h"
35 #include "pcm.h"
36 #include "vsi.h"
37 #include "macdef.h"
38 #include "pconst.cdg"
39 #include "mconst.cdg"
40 #include "message.h"
41 #include "ccdapi.h"
42 #include "custom.h"
43 #include "gsm.h"
44 #include "prim.h"
45 #include "cnf_t30.h"
46 #include "mon_t30.h"
47 #include "pei.h"
48 #include "tok.h"
49 #include "dti.h" /* functionality of the dti library */
50 #include "t30.h"
51
52 /*==== CONST =======================================================*/
53
54 /*==== TYPES =======================================================*/
55
56 /*==== VAR EXPORT ==================================================*/
57
58 /*==== VAR LOCAL ===================================================*/
59
60 /*==== FUNCTIONS ===================================================*/
61
62 /*
63 +--------------------------------------------------------------------+
64 | PROJECT : GSM-F&D (8411) MODULE : T30_MUXP |
65 | STATE : code ROUTINE : mux_fad_mux_ind |
66 +--------------------------------------------------------------------+
67
68 PURPOSE : Process primitive FAD_MUX_IND received from FAD.
69 This primitive switches the state of the multiplexer.
70 */
71
72 GLOBAL void mux_fad_mux_ind (T_FAD_MUX_IND *fad_mux_ind)
73 {
74 TRACE_FUNCTION ("mux_fad_mux_ind");
75 PACCESS (fad_mux_ind);
76
77 switch (GET_STATE (MUX))
78 {
79 case T30_MUX_BCS:
80 case T30_MUX_MSG:
81 switch (fad_mux_ind->mode)
82 {
83 case MUX_BCS:
84 {
85 T_TIME v;
86 SET_STATE (MUX, T30_MUX_BCS);
87
88 /* restart timer t4 */
89 /* MG: I think the timer should only be restarted, when it is running already: */
90
91 TIMERSTATUS(T4_INDEX, &v);
92 if (v)
93 {
94 TIMERSTART (T4_INDEX, T4_VALUE);
95 }
96 if (t30_data->preamble_ind)
97 {
98 PALLOC (t30_preamble_ind, T30_PREAMBLE_IND);
99 t30_data->preamble_ind = FALSE;
100 PSENDX (MMI, t30_preamble_ind);
101 }
102 }
103 break;
104
105 case MUX_MSG:
106 SET_STATE (MUX, T30_MUX_MSG);
107 break;
108 }
109 break;
110
111 default:
112 #ifdef _SIMULATION_ /* test BCS formatter only */
113 if (t30_data->test_mode & TST_BCS)
114 {
115 switch (fad_mux_ind->mode)
116 {
117 case MUX_BCS: SET_STATE (MUX, T30_MUX_BCS); break;
118 }
119 }
120 #endif
121 break;
122 }
123 PFREE (fad_mux_ind);
124 }
125
126 /*
127 +--------------------------------------------------------------------+
128 | PROJECT : GSM-F&D (8411) MODULE : T30_MUXP |
129 | STATE : code ROUTINE : mux_fad_data_ind |
130 +--------------------------------------------------------------------+
131
132 PURPOSE : Process primitive FAD_DATA_IND received from FAD.
133 Sends the received data to the message- or the bcs-
134 formatter or to nirvana in dependence of the mux-state.
135 */
136
137 GLOBAL void mux_fad_data_ind (T_FAD_DATA_IND *fad_data_ind)
138 {
139 TRACE_FUNCTION ("mux_fad_data_ind()");
140 PACCESS (fad_data_ind);
141
142 switch (GET_STATE (MUX))
143 {
144 case T30_MUX_BCS:
145 #if defined _SIMULATION_ || defined KER_DEBUG_BCS
146 ker_debug ("FAD_DATA_IND", fad_data_ind->sdu.buf, (USHORT)(fad_data_ind->sdu.l_buf >> 3));
147 #endif
148 sig_mux_bcs_bcs_ind (fad_data_ind);
149 break;
150
151 case T30_MUX_MSG:
152 sig_mux_msg_msg_ind (fad_data_ind);
153 break;
154
155 default:
156 break;
157 }
158
159 PFREE (fad_data_ind);
160 }
161