comparison src/g23m-fad/t30/t30_muxs.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 :
4 | Modul : J:\g23m-fad\t30\t30_muxs.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 functions for processing
18 | of incomming signals for the component T30
19 | of the mobile station
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef T30_MUXS_C
24 #define T30_MUXS_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_MUXS |
65 | STATE : code ROUTINE : sig_bcs_mux_bcs_req |
66 +--------------------------------------------------------------------+
67
68 PURPOSE : Process signal BCS_REQ received from process BCS formatter.
69 The signal requests to send BCS data to FAD.
70 */
71
72 GLOBAL void sig_bcs_mux_bcs_req (T_FAD_DATA_REQ *fad_data_req)
73 {
74 TRACE_FUNCTION ("sig_bcs_mux_bcs_req()");
75 PACCESS (fad_data_req);
76
77 switch (GET_STATE (MUX))
78 {
79 case T30_MUX_BCS:
80 #ifdef KER_DEBUG_BCS
81 ker_debug ("fad_data_req", fad_data_req->sdu.buf, (USHORT)(fad_data_req->sdu.l_buf >> 3));
82 #endif
83 PSENDX (FAD, fad_data_req);
84 break;
85
86 default:
87 PFREE (fad_data_req);
88 break;
89 }
90 }
91
92 /*
93 +--------------------------------------------------------------------+
94 | PROJECT : GSM-F&D (8411) MODULE : T30_MUXS |
95 | STATE : code ROUTINE : sig_ker_mux_mux_req |
96 +--------------------------------------------------------------------+
97
98 PURPOSE : Process signal MUX_REQ received from process kernel.
99 The signal switches the state of the multiplexer.
100 */
101
102 GLOBAL void sig_ker_mux_mux_req (void)
103 {
104 TRACE_FUNCTION ("sig_ker_mux_mux_req()");
105
106 switch (GET_STATE (MUX))
107 {
108 case T30_MUX_OFF:
109 case T30_MUX_BCS:
110 case T30_MUX_MSG:
111 {
112 switch (t30_data->mux.mode)
113 {
114 case MUX_OFF: SET_STATE (MUX, T30_MUX_OFF); break;
115 case MUX_BCS: SET_STATE (MUX, T30_MUX_BCS); break;
116 case MUX_MSG: SET_STATE (MUX, T30_MUX_MSG); break;
117 }
118 break;
119 }
120 default:
121 break;
122 }
123 }
124
125 /*
126 +--------------------------------------------------------------------+
127 | PROJECT : GSM-F&D (8411) MODULE : T30_MUXS |
128 | STATE : code ROUTINE : sig_msg_mux_msg_req |
129 +--------------------------------------------------------------------+
130
131 PURPOSE : Process signal MSG_REQ received from process msg-formatter.
132 The signal requests to send msg-data to fad.
133 */
134
135 GLOBAL void sig_msg_mux_msg_req (T_FAD_DATA_REQ *fad_data_req)
136 {
137 TRACE_FUNCTION ("sig_msg_mux_msg_req()");
138 PACCESS (fad_data_req);
139
140 switch (GET_STATE (MUX))
141 {
142 case T30_MUX_MSG:
143 {
144 #ifdef KER_DEBUG_MSG
145 ker_debug ("fad_data_req", fad_data_req->sdu.buf, (USHORT)(fad_data_req->sdu.l_buf >> 3));
146 #endif
147 PSENDX (FAD, fad_data_req);
148 t30_data->fad_data_req = NULL;
149 break;
150 }
151
152 default:
153 {
154 PFREE (fad_data_req);
155 break;
156 }
157 }
158 }
159