comparison src/g23m-aci/aci/cmh_tcpips.c @ 162:53929b40109c

src/g23m-aci: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Oct 2016 02:02:43 +0000
parents
children
comparison
equal deleted inserted replaced
161:4557e2a9c18e 162:53929b40109c
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : CMH_TCPS
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 TCPIP.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef CMH_TCPS_C
23 #define CMH_TCPS_C
24 #endif
25
26 #include "aci_all.h"
27
28 /*==== INCLUDES ===================================================*/
29
30 #include "aci_cmh.h"
31
32 #ifdef FAX_AND_DATA
33 #include "aci_fd.h"
34 #endif
35
36 #include "ati_cmd.h"
37 #include "aci_cmd.h"
38 #include "aci_io.h"
39
40 #include "psa.h"
41 #include "psa_ra.h"
42 #include "psa_cc.h"
43 #include "cmh.h"
44 #include "cmh_ra.h"
45
46 #include "wap_aci.h"
47
48 #include "dti.h"
49 #include "dti_conn_mng.h"
50 #include "dti_cntrl_mng.h"
51
52 #include "cmh_ipa.h"
53
54 #ifdef SIM_TOOLKIT
55 #include "psa_sat.h"
56 #include "psa_sim.h"
57 #endif
58
59 #ifdef FF_GPF_TCPIP
60 #include "dcm_utils.h"
61 #include "dcm_state.h"
62 #include "dcm_env.h"
63 #endif /* FF_GPF_TCPIP */
64
65 /*==== CONSTANTS ==================================================*/
66
67 /*==== EXPORT =====================================================*/
68
69 /*==== VARIABLES ==================================================*/
70
71 /*==== FUNCTIONS ==================================================*/
72
73 /*
74 +-------------------------------------------------------------------+
75 | PROJECT : GSM-PS (6147) MODULE : CMH_TCPS |
76 | ROUTINE : cmhTCPIP_Activate |
77 +-------------------------------------------------------------------+
78
79 PURPOSE : activates DTI connection TCPIP-IP
80
81 */
82
83 #if 0
84 T_ACI_RETURN cmhTCPIP_Activate (T_ACI_CMD_SRC srcId, SHORT cId)
85 {
86 T_BEARER_TYPE current_bear_type = NO_BEARER_TYPE;
87 TRACE_FUNCTION ("cmhTCPIP_Activate()");
88
89 if (Wap_Call EQ TRUE)
90 {
91 wap_state = TCPIP_Activation;
92
93 #if defined (SIM_TOOLKIT) AND defined(FF_SAT_E)
94 /* SAT Class E */
95 if (satShrdPrm.opchStat EQ OPCH_EST_REQ)
96 {
97 T_DTI_ENTITY_ID entity_list[] = {DTI_ENTITY_TCPIP, DTI_ENTITY_IP};
98
99 /* create a SAT class E DTI ID if not present */
100 if (simShrdPrm.sat_class_e_dti_id EQ DTI_DTI_ID_NOTPRESENT)
101 {
102 simShrdPrm.sat_class_e_dti_id = dti_cntrl_new_dti (DTI_DTI_ID_NOTPRESENT);
103 TRACE_EVENT_P1 ("sat_class_e_dti_id = %d", simShrdPrm.sat_class_e_dti_id);
104 }
105
106 dti_cntrl_est_dpath (
107 simShrdPrm.sat_class_e_dti_id,
108 entity_list,
109 2,
110 SPLIT,
111 TCPIP_connect_dti_cb
112 );
113 }
114 else
115 #endif
116 {
117 /* normal WAP Call */
118 // TODO: check this function: get_current_bearer_type()
119 //current_bear_type = get_current_bearer_type();
120
121 if(current_bear_type == GPRS_BEARER_TYPE)
122 {
123 T_DTI_ENTITY_ID entity_list[] = {DTI_ENTITY_TCPIP, DTI_ENTITY_SNDCP};
124 /* create a WAP DTI if not present */
125 if (wap_dti_id EQ DTI_DTI_ID_NOTPRESENT)
126 {
127 wap_dti_id = dti_cntrl_new_dti (DTI_DTI_ID_NOTPRESENT);
128 TRACE_EVENT_P1 ("wap_dti_id = %d", wap_dti_id);
129 }
130 dti_cntrl_est_dpath(wap_dti_id,
131 entity_list,
132 2,
133 SPLIT,
134 TCPIP_connect_dti_cb);
135 }
136 else if(current_bear_type == GSM_BEARER_TYPE)
137 {
138 T_DTI_ENTITY_ID entity_list[] = {DTI_ENTITY_TCPIP, DTI_ENTITY_PPPC , DTI_ENTITY_L2R };
139
140 /* create a WAP DTI if not present */
141 if (wap_dti_id EQ DTI_DTI_ID_NOTPRESENT)
142 {
143 wap_dti_id = dti_cntrl_new_dti (DTI_DTI_ID_NOTPRESENT);
144 TRACE_EVENT_P1 ("wap_dti_id = %d", wap_dti_id);
145 }
146 dti_cntrl_est_dpath(wap_dti_id,
147 entity_list,
148 3,
149 SPLIT,
150 TCPIP_connect_dti_cb);
151 }
152 else
153 {
154 TRACE_EVENT ("Ivalid Bearer Type is not set,so don't establish a data path");
155 return AT_FAIL;
156 }
157 }
158 }
159 else
160 {
161 TRACE_EVENT ("Wap_Call is not set so don't establish a data path");
162 return AT_FAIL;
163 }
164
165 return AT_EXCT;
166 }
167 #endif
168
169 /*
170 +-------------------------------------------------------------------+
171 | PROJECT : GSM-PS (6147) MODULE : CMH_TCPS |
172 | ROUTINE : cmhTCPIP_Deactivate |
173 +-------------------------------------------------------------------+
174
175 PURPOSE : deactivates DTI connection TCPIP-IP
176
177 */
178
179 T_ACI_RETURN cmhTCPIP_Deactivate (UBYTE src_id)
180 {
181 TRACE_FUNCTION ("cmhTCPIP_Deactivate()");
182
183 wap_state = TCPIP_Deactivation;
184
185 if ( wap_dti_id NEQ DTI_DTI_ID_NOTPRESENT )
186 {
187 dti_cntrl_close_dpath_from_dti_id (wap_dti_id);
188 }
189 else if (simShrdPrm.sat_class_e_dti_id NEQ DTI_DTI_ID_NOTPRESENT)
190 {
191 dti_cntrl_close_dpath_from_dti_id (simShrdPrm.sat_class_e_dti_id);
192 }
193 else
194 {
195 TRACE_EVENT ("No dti id available");
196 return AT_FAIL;
197 }
198
199 return AT_EXCT;
200 }
201