comparison g23m/condat/ms/src/aci/cmh_ipar.c @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : CMH_IPAR
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 :
18 +-----------------------------------------------------------------------------
19 */
20
21 #ifndef CMH_IPAR_C
22 #define CMH_IPAR_C
23 #endif
24
25 #include "aci_all.h"
26
27 /*==== INCLUDES ===================================================*/
28 #include "aci_cmh.h"
29 #include "ati_cmd.h"
30 #include "aci_cmd.h"
31
32 #ifdef FAX_AND_DATA
33 #include "aci_fd.h"
34 #endif
35
36 #include "dti.h"
37 #include "dti_conn_mng.h"
38 #include "dti_cntrl_mng.h"
39
40 #include "aci_io.h"
41
42 #include "psa.h"
43 #include "psa_ra.h"
44 #include "psa_cc.h"
45 #include "cmh.h"
46 #include "cmh_ra.h"
47
48 #include "wap_aci.h"
49
50 #include "psa_tcpip.h"
51
52 /*==== CONSTANTS ==================================================*/
53
54 /*==== EXPORT =====================================================*/
55
56 EXTERN SHORT cmhCC_IPA_Configurated (void);
57 EXTERN SHORT cmhCC_IPA_Deconfigurated (void);
58
59 /*==== VARIABLES ==================================================*/
60
61 /*==== FUNCTIONS ==================================================*/
62
63
64 /*
65 +-------------------------------------------------------------------+
66 | PROJECT : GSM-PS (6147) MODULE : CMH_IPAR |
67 | ROUTINE : cmhIPA_Configurated |
68 +-------------------------------------------------------------------+
69
70 PURPOSE : IPA configurated
71 */
72
73 GLOBAL T_ACI_RETURN cmhIPA_Configurated ( void )
74 {
75
76 TRACE_FUNCTION ("cmhIPA_Configurated()");
77
78 cmhCC_IPA_Configurated();
79
80 return 0;
81 }
82
83 /*
84 +-------------------------------------------------------------------+
85 | PROJECT : GSM-PS (6147) MODULE : CMH_IPAR |
86 | ROUTINE : cmhIPA_Deconfigurated |
87 +-------------------------------------------------------------------+
88
89 PURPOSE : IPA deconfigurated
90 */
91
92 GLOBAL T_ACI_RETURN cmhIPA_Deconfigurated ( void )
93 {
94
95 TRACE_FUNCTION ("cmhIPA_Deconfigurated()");
96
97 cmhCC_IPA_Deconfigurated();
98
99 return 0;
100 }
101
102 /*
103 +--------------------------------------------------------------------+
104 | PROJECT : GSM-F&D (8411) MODULE : CMH_IPAR |
105 | STATE : code ROUTINE : IP_UDP_connect_dti_cb |
106 +--------------------------------------------------------------------+
107
108 PURPOSE : Callback for connection between IP and UDP.
109
110 */
111
112 GLOBAL BOOL IP_UDP_connect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type)
113 {
114 TRACE_FUNCTION("IP_UDP_connect_dti_cb()");
115
116 switch( result_type)
117 {
118 case(DTI_CONN_STATE_DISCONNECTING):
119 break;
120
121 case(DTI_CONN_STATE_CONNECTED):
122 if (wap_state EQ UDPA_Activation)
123 {
124 wap_state = IPA_Activated;
125 psaUDPIP_config_dispatch();
126 }
127 else
128 {
129 TRACE_EVENT_P1("IP_UDP_connect_dti_cb(): DTI_CONN_STATE_CONNECTED, but wrong WAP STATE: %d ",wap_state );
130 }
131 break;
132
133 case(DTI_CONN_STATE_DISCONNECTED):
134 if (wap_state EQ UDPA_Deactivation)
135 {
136 /* wap_state is set to IPA_Deactivated in psaUDPIP_config_dispatch() */
137 wap_state = IPA_Deactivation;
138 psaUDPIP_config_dispatch();
139 dti_cntrl_erase_entry (dti_id);
140 dti_cntrl_clear_conn_parms(dti_id);
141 if (wap_dti_id EQ dti_id)
142 {
143 wap_dti_id = DTI_DTI_ID_NOTPRESENT;
144 TRACE_EVENT("IP_UDP_connect_dti_cb(): DTI_CONN_STATE_DISCONNECTED and wap_dti_id resetted");
145 }
146 }
147 else
148 {
149 TRACE_EVENT_P1("IP_UDP_connect_dti_cb(): DTI_CONN_STATE_DISCONNECTED, but wrong WAP STATE: %d ",wap_state );
150 }
151 break;
152
153 case(DTI_CONN_STATE_ERROR):
154 /* connection not possible: disconnect */
155 dti_cntrl_close_dpath_from_dti_id( dti_id );
156 break;
157
158 default:
159 TRACE_EVENT("IP_UDP_connect_dti_cb(): call with not awaited value");
160 break;
161 }
162 return TRUE;
163 }