FreeCalypso > hg > fc-tourmaline
comparison src/g23m-aci/aci/psa_t30s.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 (6147) | |
4 | Modul : PSA_T30S | |
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 signalling functions of the | |
18 | protocol stack adapter for T30. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #if defined (DTI) || defined (FF_FAX) | |
23 | |
24 #ifndef PSA_T30S_C | |
25 #define PSA_T30S_C | |
26 #endif | |
27 | |
28 #include "aci_all.h" | |
29 | |
30 /*==== INCLUDES ===================================================*/ | |
31 #include "aci_cmh.h" | |
32 #include "ati_cmd.h" | |
33 #include "aci_cmd.h" | |
34 | |
35 #include "dti.h" | |
36 #include "dti_conn_mng.h" | |
37 #include "dti_cntrl_mng.h" | |
38 | |
39 #include "aci_fd.h" | |
40 #include "aci.h" | |
41 #include "psa.h" | |
42 #include "psa_t30.h" | |
43 #include "cmh.h" | |
44 #include "cmh_t30.h" | |
45 | |
46 | |
47 /*==== CONSTANTS ==================================================*/ | |
48 | |
49 | |
50 /*==== TYPES ======================================================*/ | |
51 | |
52 | |
53 /*==== EXPORT =====================================================*/ | |
54 | |
55 | |
56 /*==== VARIABLES ==================================================*/ | |
57 | |
58 | |
59 /*==== FUNCTIONS ==================================================*/ | |
60 | |
61 /* | |
62 +-------------------------------------------------------------------+ | |
63 | PROJECT : GSM-PS (6147) MODULE : PSA_T30 | | |
64 | ROUTINE : psaT30_Dti_Req | | |
65 +-------------------------------------------------------------------+ | |
66 | |
67 PURPOSE : connect or disconnect T30 (depends on dti_conn). | |
68 */ | |
69 | |
70 GLOBAL void psaT30_Dti_Req(T_DTI_CONN_LINK_ID link_id, UBYTE dti_conn) | |
71 { | |
72 T_DTI_CNTRL device_info; | |
73 dti_cntrl_get_info_from_dti_id(EXTRACT_DTI_ID(link_id), &device_info); | |
74 | |
75 TRACE_FUNCTION ("psaT30_Dti_Req()"); | |
76 | |
77 { | |
78 PALLOC (t30_dti_req, T30_DTI_REQ); | |
79 | |
80 t30_dti_req->dti_conn = dti_conn; | |
81 if (device_info.dev_id EQ DTI_ENTITY_UART) | |
82 strcpy((CHAR*)t30_dti_req->entity_name, UART_NAME); | |
83 else if (device_info.dev_id EQ DTI_ENTITY_PSI) | |
84 strcpy((CHAR*)t30_dti_req->entity_name, PSI_NAME); | |
85 | |
86 t30_dti_req->link_id = link_id; | |
87 t30_dti_req->dti_direction = DTI_CHANNEL_TO_LOWER_LAYER; | |
88 | |
89 if (dti_conn EQ T30_CONNECT_DTI) | |
90 { | |
91 if (dti_cntrl_set_conn_parms(link_id, DTI_ENTITY_T30, DTI_INSTANCE_NOTPRESENT, DTI_SUB_NO_NOTPRESENT) EQ FALSE) | |
92 { | |
93 return; | |
94 } | |
95 } | |
96 | |
97 PSENDX (T30, t30_dti_req); | |
98 } | |
99 } | |
100 | |
101 /* | |
102 | |
103 +-------------------------------------------------------------------+ | |
104 | PROJECT : GSM-PS (6147) MODULE : PSA_T30 | | |
105 | ROUTINE : psaT30_Activate | | |
106 +-------------------------------------------------------------------+ | |
107 | |
108 PURPOSE : activate T30. | |
109 | |
110 */ | |
111 | |
112 GLOBAL void psaT30_Activate (void) | |
113 { | |
114 TRACE_FUNCTION ("psaT30_Activate()"); | |
115 | |
116 { | |
117 PALLOC (t30_activate_req, T30_ACTIVATE_REQ); | |
118 | |
119 t30_activate_req->trans_rate = t30ShrdPrm.trans_rate; | |
120 t30_activate_req->half_rate = t30ShrdPrm.half_rate; | |
121 t30_activate_req->threshold = t30ShrdPrm.threshold; | |
122 t30_activate_req->frames_per_prim = t30ShrdPrm.frames_per_prim; | |
123 t30_activate_req->bitorder = t30ShrdPrm.bitord; | |
124 | |
125 PSENDX (T30, t30_activate_req); | |
126 } | |
127 } | |
128 | |
129 /* | |
130 +-------------------------------------------------------------------+ | |
131 | PROJECT : GSM-PS (6147) MODULE : PSA_T30 | | |
132 | ROUTINE : psaT30_Capabilities | | |
133 +-------------------------------------------------------------------+ | |
134 | |
135 PURPOSE : send selected capabilities. | |
136 | |
137 */ | |
138 | |
139 GLOBAL void psaT30_Capabilities (void) | |
140 { | |
141 TRACE_FUNCTION ("psaT30_Capabilities()"); | |
142 | |
143 { | |
144 PALLOC (t30_cap_req, T30_CAP_REQ); | |
145 | |
146 memcpy (&t30_cap_req->hdlc_info, &t30ShrdPrm.hdlc_snd, | |
147 sizeof (T_hdlc_info)); | |
148 | |
149 PSENDX (T30, t30_cap_req); | |
150 } | |
151 } | |
152 | |
153 /* | |
154 +-------------------------------------------------------------------+ | |
155 | PROJECT : GSM-PS (6147) MODULE : PSA_T30 | | |
156 | ROUTINE : psaT30_Config | | |
157 +-------------------------------------------------------------------+ | |
158 | |
159 PURPOSE : t30 configuration. | |
160 | |
161 */ | |
162 | |
163 GLOBAL void psaT30_Config (void) | |
164 { | |
165 TRACE_FUNCTION ("psaT30_Config()"); | |
166 | |
167 { | |
168 PALLOC (t30_config_req, T30_CONFIG_REQ); | |
169 | |
170 t30_config_req->hdlc_report = t30ShrdPrm.hdlc_report; | |
171 t30_config_req->test_mode = t30ShrdPrm.test_mode; | |
172 | |
173 PSENDX (T30, t30_config_req); | |
174 } | |
175 } | |
176 | |
177 /* | |
178 +-------------------------------------------------------------------+ | |
179 | PROJECT : GSM-PS (6147) MODULE : PSA_T30 | | |
180 | ROUTINE : psaT30_Deactivate | | |
181 +-------------------------------------------------------------------+ | |
182 | |
183 PURPOSE : deactivate T30. | |
184 | |
185 */ | |
186 | |
187 GLOBAL void psaT30_Deactivate (void) | |
188 { | |
189 if (t30ShrdPrm.T30_is_activated EQ FALSE) | |
190 return; | |
191 else | |
192 t30ShrdPrm.T30_is_activated = FALSE; | |
193 | |
194 TRACE_FUNCTION ("psaT30_Deactivate()"); | |
195 | |
196 { | |
197 PALLOC (t30_deactivate_req, T30_DEACTIVATE_REQ); | |
198 | |
199 PSENDX (T30, t30_deactivate_req); | |
200 } | |
201 } | |
202 | |
203 /* | |
204 +-------------------------------------------------------------------+ | |
205 | PROJECT : GSM-PS (6147) MODULE : PSA_T30 | | |
206 | ROUTINE : psaT30_Disconnect | | |
207 +-------------------------------------------------------------------+ | |
208 | |
209 PURPOSE : disconnect request. | |
210 | |
211 */ | |
212 | |
213 GLOBAL void psaT30_Disconnect (void) | |
214 { | |
215 TRACE_FUNCTION ("psaT30_Disconnect()"); | |
216 | |
217 { | |
218 PALLOC (t30_sgn_req, T30_SGN_REQ); | |
219 | |
220 t30_sgn_req->sgn = SGN_DCN; | |
221 | |
222 PSENDX (T30, t30_sgn_req); | |
223 } | |
224 } | |
225 | |
226 /* | |
227 +-------------------------------------------------------------------+ | |
228 | PROJECT : GSM-PS (6147) MODULE : PSA_T30 | | |
229 | ROUTINE : psaT30_Modify | | |
230 +-------------------------------------------------------------------+ | |
231 | |
232 PURPOSE : modification of T30. | |
233 | |
234 */ | |
235 | |
236 GLOBAL void psaT30_Modify (void) | |
237 { | |
238 TRACE_FUNCTION ("psaT30_Modify()"); | |
239 | |
240 { | |
241 PALLOC (t30_modify_req, T30_MODIFY_REQ); | |
242 | |
243 t30_modify_req->trans_rate = t30ShrdPrm.trans_rate; | |
244 t30_modify_req->half_rate = t30ShrdPrm.half_rate; | |
245 | |
246 PSENDX (T30, t30_modify_req); | |
247 } | |
248 } | |
249 | |
250 /* | |
251 +-------------------------------------------------------------------+ | |
252 | PROJECT : GSM-PS (6147) MODULE : PSA_T30 | | |
253 | ROUTINE : psaT30_Ppm | | |
254 +-------------------------------------------------------------------+ | |
255 | |
256 PURPOSE : post-page message. | |
257 | |
258 */ | |
259 | |
260 GLOBAL SHORT psaT30_Ppm (void) | |
261 { | |
262 TRACE_FUNCTION ("psaT30_Ppm()"); | |
263 | |
264 { | |
265 PALLOC (t30_sgn_req, T30_SGN_REQ); | |
266 | |
267 t30_sgn_req->sgn = t30ShrdPrm.sgn_snd; | |
268 | |
269 PSENDX (T30, t30_sgn_req); | |
270 } | |
271 | |
272 return 0; | |
273 } | |
274 | |
275 #endif /* DTI OR FF_FAX */ | |
276 | |
277 /*==== EOF ========================================================*/ | |
278 |