comparison src/aci2/aci/cmh_udpas.c @ 3:93999a60b835

src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Sep 2016 00:29:36 +0000
parents
children
comparison
equal deleted inserted replaced
2:c41a534f33c6 3:93999a60b835
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : CMH_UDPAS
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 provides the set functions related to the
18 | protocol stack adapter for UDPA.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifdef DTI
23
24 #ifndef CMH_UDPAS_C
25 #define CMH_UDPAS_C
26 #endif
27
28 #include "aci_all.h"
29
30 /*==== INCLUDES ===================================================*/
31 #include "aci_cmh.h"
32
33 #ifdef FAX_AND_DATA
34 #include "aci_fd.h"
35 #endif
36
37 #include "ati_cmd.h"
38 #include "aci_cmd.h"
39 #include "aci_io.h"
40
41 #include "psa.h"
42 #include "psa_ra.h"
43 #include "psa_cc.h"
44 #include "cmh.h"
45 #include "cmh_ra.h"
46
47 #include "wap_aci.h"
48
49 #include "dti.h"
50 #include "dti_conn_mng.h"
51 #include "dti_cntrl_mng.h"
52
53 #include "cmh_ipa.h"
54
55 #ifdef SIM_TOOLKIT
56 #include "psa_sat.h"
57 #include "psa_sim.h"
58 #include "cmh_sat.h"
59 #endif
60
61 /*==== CONSTANTS ==================================================*/
62
63 /*==== EXPORT =====================================================*/
64
65 /*==== VARIABLES ==================================================*/
66
67 /*==== FUNCTIONS ==================================================*/
68
69
70 /*
71 +-------------------------------------------------------------------+
72 | PROJECT : GSM-PS (6147) MODULE : CMH_UDPAS |
73 | ROUTINE : cmhUDPA_Activate |
74 +-------------------------------------------------------------------+
75
76 PURPOSE : activates DTI connection UDP-IP
77
78 */
79
80 GLOBAL T_ACI_RETURN cmhUDPA_Activate ( T_ACI_CMD_SRC srcId,
81 SHORT cId )
82 {
83 TRACE_FUNCTION ("cmhUDPA_Activate()");
84
85 if( Wap_Call EQ TRUE )
86 {
87 wap_state = UDPA_Activation;
88 #ifdef SIM_TOOLKIT
89 #ifdef FF_SAT_E
90 /* SAT Class E */
91 if ( satShrdPrm.opchStat EQ OPCH_EST_REQ )
92 {
93 /* establish connections: SIM-UDP and UDP-IP */
94 T_DTI_ENTITY_ID entity_list[] = {DTI_ENTITY_SIM, DTI_ENTITY_UDP, DTI_ENTITY_IP};
95
96 /* prepare SAT environment for SIM - UDP connection */
97 cmhSAT_OpChnSIMCnctReq( (UBYTE) DTI_ENTITY_UDP );
98
99
100 /* create a SAT class E DTI ID if not present */
101 if ( simShrdPrm.sat_class_e_dti_id EQ DTI_DTI_ID_NOTPRESENT )
102 {
103 simShrdPrm.sat_class_e_dti_id = dti_cntrl_new_dti(DTI_DTI_ID_NOTPRESENT);
104 TRACE_EVENT_P1("sat_class_e_dti_id = %d", simShrdPrm.sat_class_e_dti_id);
105 }
106
107 dti_cntrl_est_dpath ( simShrdPrm.sat_class_e_dti_id,
108 entity_list,
109 3,
110 SPLIT,
111 IP_UDP_connect_dti_cb);
112 }
113 else
114 #endif /* FF_SAT_E */
115 #endif /* SIM_TOOLKIT */
116 {
117 /* normal WAP Call */
118 T_DTI_ENTITY_ID entity_list[] = {DTI_ENTITY_WAP, DTI_ENTITY_UDP, DTI_ENTITY_IP};
119
120 /* create a WAP DTI if not present */
121 if ( wap_dti_id EQ DTI_DTI_ID_NOTPRESENT )
122 {
123 wap_dti_id = dti_cntrl_new_dti(DTI_DTI_ID_NOTPRESENT);
124 TRACE_EVENT_P1("wap_dti_id = %d", wap_dti_id);
125 }
126
127 dti_cntrl_est_dpath ( wap_dti_id,
128 entity_list,
129 3,
130 SPLIT,
131 IP_UDP_connect_dti_cb);
132 }
133 }
134 else
135 {
136 TRACE_EVENT("Wap_Call is not set so don't establish a data path");
137 return ( AT_FAIL );
138 }
139
140 return( AT_EXCT );
141 }
142
143
144 /*
145 +-------------------------------------------------------------------+
146 | PROJECT : GSM-PS (6147) MODULE : CMH_UDPAS |
147 | ROUTINE : cmhUDPA_Deactivate |
148 +-------------------------------------------------------------------+
149
150 PURPOSE : deactivates DTI connection UDP-IP
151
152 */
153
154 GLOBAL T_ACI_RETURN cmhUDPA_Deactivate ( UBYTE src_id)
155 {
156 TRACE_FUNCTION ("cmhUDPA_Deactivate()");
157
158 wap_state = UDPA_Deactivation;
159
160 if ( wap_dti_id NEQ DTI_DTI_ID_NOTPRESENT )
161 {
162 dti_cntrl_close_dpath_from_dti_id(wap_dti_id);
163 }
164 #ifdef FF_SAT_E
165 else if (simShrdPrm.sat_class_e_dti_id NEQ DTI_DTI_ID_NOTPRESENT)
166 {
167 dti_cntrl_close_dpath_from_dti_id(simShrdPrm.sat_class_e_dti_id);
168 }
169 #endif
170 else
171 {
172 TRACE_EVENT("No dti id available");
173 return( AT_FAIL );
174 }
175
176 return( AT_EXCT );
177 }
178
179 #endif /* DTI */