comparison src/aci2/aci/psa_tcpipp.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 : PSA_TCPP
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 processing functions for the
18 | primitives sent to the protocol stack adapter by the TCPIP
19 | module.
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef PSA_TCPP_C
24 #define PSA_TCPP_C
25 #endif /* of PSA_TCPP_C */
26
27 #include "aci_all.h"
28 /*==== INCLUDES ===================================================*/
29 #include "aci_cmh.h"
30 #include "ati_cmd.h"
31 #include "aci_cmd.h"
32 #include "dti.h" /* functionality of the dti library */
33 #include "dti_conn_mng.h"
34 #include "dti_cntrl_mng.h"
35
36 #include "aci_fd.h"
37 #include "aci.h"
38 #include "psa.h"
39 #include "psa_l2r.h"
40 #include "cmh.h"
41 #include "cmh_ra.h"
42 #include "cmh_l2r.h"
43 #include "psa_tcpip.h"
44 #include "psa_cc.h"
45
46 #include "wap_aci.h"
47 #include "psa_sat.h"
48
49
50 #include "dcm_utils.h"
51 #include "dcm_state.h"
52 #include "dcm_env.h"
53 #include "dcm_f.h"
54
55
56 /*==== CONSTANTS ==================================================*/
57
58 /*==== TYPES ======================================================*/
59
60 /*==== EXPORT =====================================================*/
61
62 /*==== VARIABLES ==================================================*/
63
64 /*==== FUNCTIONS ==================================================*/
65
66 /*
67 +-------------------------------------------------------------------+
68 | PROJECT : GSM-PS (6147) MODULE : PSA_TCP |
69 | ROUTINE : psa_tcpip_dti_cnf |
70 +-------------------------------------------------------------------+
71
72 PURPOSE : processes the TCPIP_DTI_CNF primitive sent by TCPIP.
73 */
74 GLOBAL const void psa_tcpip_dti_cnf(T_TCPIP_DTI_CNF *tcpip_dti_cnf)
75 {
76 TRACE_FUNCTION ("psa_tcpip_dti_cnf()");
77
78 switch( tcpip_dti_cnf->dti_conn )
79 {
80 case(TCPIP_CONNECT_DTI):
81 dti_cntrl_entity_connected( tcpip_dti_cnf->link_id, DTI_ENTITY_TCPIP, DTI_OK );
82 break;
83
84 case(TCPIP_DISCONNECT_DTI):
85 dti_cntrl_entity_disconnected( tcpip_dti_cnf->link_id, DTI_ENTITY_TCPIP );
86 break;
87 }
88 PFREE(tcpip_dti_cnf);
89 }
90
91
92 /*
93 +-------------------------------------------------------------------+
94 | PROJECT : GSM-PS (6147) MODULE : PSA_TCP |
95 | ROUTINE : psa_tcpip_ifconfig_cnf |
96 +-------------------------------------------------------------------+
97
98 PURPOSE : processes the TCPIP_CONFIG_CNF primitive sent by TCPIP.
99
100 */
101 GLOBAL const void psa_tcpip_ifconfig_cnf(T_TCPIP_IFCONFIG_CNF *tcpip_ifconfig_cnf)
102 {
103 TRACE_FUNCTION ("psa_tcpip_ifconfig_cnf()");
104
105 if(tcpip_ifconfig_cnf->result == TCPIP_RESULT_OK)
106 {
107 if (wap_state EQ TCPIP_Configuration)
108 {
109 wap_state = TCPIP_Configurated;
110 cmhTCPIP_Configurated();
111 }
112 else if (wap_state EQ TCPIP_Deconfiguration)
113 {
114 wap_state = TCPIP_Deconfigurated;
115 if(tcpipShrdPrm.connection_type EQ TCPIP_CONNECTION_TYPE_CSD_WAP)
116 {
117 wap_state = TCPIP_Deactivation;
118 psaTCPIP_config_dispatch();
119 }
120 else
121 cmhTCPIP_Deconfigurated();
122 }
123 }
124 else
125 {
126 TRACE_EVENT("unexpected TCPIP_IFCONFIG_CNF primitive received");
127 }
128
129 PFREE(tcpip_ifconfig_cnf);
130 }
131
132
133
134 GLOBAL const void psa_tcpip_shutdown_cnf(T_TCPIP_SHUTDOWN_CNF *tcpip_shutdown_cnf)
135 {
136 TRACE_FUNCTION ("psa_tcpip_shutdown_cnf()");
137
138 if(tcpip_shutdown_cnf->result != TCPIP_RESULT_OK)
139 {
140 T_DCM_STATUS_IND_MSG msg;
141 msg.hdr.msg_id = DCM_NEXT_CMD_STOP_MSG;
142 dcm_send_message(msg, DCM_SUB_WAIT_CGDEACT_CNF);
143
144 msg.hdr.msg_id = DCM_NEXT_CMD_STOP_MSG;
145 dcm_send_message(msg, DCM_SUB_WAIT_SATH_CNF);
146 }
147 else
148 {
149 wap_state = TCPIP_Deactivated;
150 psaTCPIP_config_dispatch();
151 }
152 reset_gpf_tcpip_call();
153 PFREE(tcpip_shutdown_cnf);
154 }
155
156
157
158 GLOBAL const void psa_tcpip_initialize_cnf(T_TCPIP_INITIALIZE_CNF *tcpip_initialize_cnf)
159 {
160 TRACE_FUNCTION ("psa_tcpip_initialize_cnf()");
161
162 if(tcpip_initialize_cnf->result != TCPIP_RESULT_OK)
163 {
164 T_DCM_STATUS_IND_MSG msg;
165 msg.hdr.msg_id = DCM_NEXT_CMD_STOP_MSG;
166 dcm_send_message(msg, DCM_SUB_WAIT_CGACT_CNF);
167
168 msg.hdr.msg_id = DCM_NEXT_CMD_STOP_MSG;
169 dcm_send_message(msg, DCM_SUB_WAIT_SATDN_CNF);
170 }
171 else
172 {
173 wap_state = TCPIP_Activation;
174 psaTCPIP_config_dispatch();
175 }
176 PFREE(tcpip_initialize_cnf);
177 }