FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-aci/aci/cmh_tcpipr.c @ 775:eedbf248bac0
gsm-fw/g23m-aci subtree: initial import from LoCosto source
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 12 Oct 2014 01:45:14 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
774:40a721fd9854 | 775:eedbf248bac0 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : CMH_TCPR | |
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_TCPR_C | |
22 #define CMH_TCPR_C | |
23 #endif | |
24 | |
25 #include "aci_all.h" | |
26 | |
27 /*==== INCLUDES ===================================================*/ | |
28 | |
29 #include "aci_cmh.h" | |
30 | |
31 #ifdef FAX_AND_DATA | |
32 #include "aci_fd.h" | |
33 #endif | |
34 | |
35 #include "ati_cmd.h" | |
36 #include "aci_cmd.h" | |
37 #include "aci_io.h" | |
38 | |
39 #include "psa.h" | |
40 #include "psa_ra.h" | |
41 #include "psa_cc.h" | |
42 #include "cmh.h" | |
43 #include "cmh_ra.h" | |
44 #include "dti_conn_mng.h" | |
45 #include "Dti_cntrl_mng.h" | |
46 | |
47 #include "wap_aci.h" | |
48 | |
49 #include "psa_tcpip.h" | |
50 | |
51 /*==== CONSTANTS ==================================================*/ | |
52 | |
53 /*==== EXPORT =====================================================*/ | |
54 | |
55 /*==== VARIABLES ==================================================*/ | |
56 EXTERN ULONG ipAddress; | |
57 /*==== FUNCTIONS ==================================================*/ | |
58 | |
59 /* | |
60 +-------------------------------------------------------------------+ | |
61 | PROJECT : GSM-PS (6147) MODULE : CMH_TCPR | | |
62 | ROUTINE : cmhTCPIP_Configurated | | |
63 +-------------------------------------------------------------------+ | |
64 | |
65 PURPOSE : TCPIP configurated | |
66 */ | |
67 | |
68 GLOBAL T_ACI_RETURN cmhTCPIP_Configurated ( void ) | |
69 { | |
70 TRACE_FUNCTION ("cmhTCPIP_Configurated()"); | |
71 | |
72 #ifdef FF_WAP | |
73 if (Wap_Call) | |
74 { | |
75 if ( tcpipShrdPrm.connection_type EQ TCPIP_CONNECTION_TYPE_CSD_WAP ) | |
76 { | |
77 /* This is only BMI specific code */ | |
78 rAT_WAP_PPP_connected(wapId,ipAddress); | |
79 } | |
80 else | |
81 { | |
82 TRACE_EVENT_P1 ("IP: %s", tcpipShrdPrm.ipaddr); | |
83 /* This is only BMI specific code and only evaluates the ipaddr but has nothing to do | |
84 with PPP connection since this is the GPRS path of the above if(TCPIP_CONNECTION_TYPE_CSD_WAP)*/ | |
85 rAT_WAP_PPP_connected(wapId, psaTCPIP_bytes2ipv4addr(tcpipShrdPrm.ipaddr)); | |
86 } | |
87 } | |
88 #endif | |
89 psaTCPIP_config_dispatch (); | |
90 return AT_CMPL; | |
91 } | |
92 | |
93 /* | |
94 +-------------------------------------------------------------------+ | |
95 | PROJECT : GSM-PS (6147) MODULE : CMH_TCPR | | |
96 | ROUTINE : cmhTCPIP_Configurated | | |
97 +-------------------------------------------------------------------+ | |
98 PURPOSE : TCPIP deconfigurated | |
99 */ | |
100 GLOBAL T_ACI_RETURN cmhTCPIP_Deconfigurated ( void ) | |
101 { | |
102 TRACE_FUNCTION ("cmhTCPIP_Deconfigurated()"); | |
103 | |
104 cmhTCPIP_Deactivate(tcpipShrdPrm.src_id); | |
105 return AT_CMPL; | |
106 } | |
107 | |
108 | |
109 /******************************************************************************/ | |
110 /* This function returns the DTI connection state as a string; it is only | |
111 * relevant for tracing | |
112 */ | |
113 LOCAL char* dti_conn_state_string(T_DTI_CONN_STATE state) | |
114 { | |
115 switch (state) | |
116 { | |
117 case DTI_CONN_STATE_UNKNOWN: return "DTI_CONN_STATE_UNKNOWN"; | |
118 case DTI_CONN_STATE_CONNECTING: return "DTI_CONN_STATE_CONNECTING"; | |
119 case DTI_CONN_STATE_CONNECTED: return "DTI_CONN_STATE_CONNECTED"; | |
120 case DTI_CONN_STATE_DISCONNECTING: return "DTI_CONN_STATE_DISCONNECTING"; | |
121 case DTI_CONN_STATE_DISCONNECTED: return "DTI_CONN_STATE_DISCONNECTED"; | |
122 case DTI_CONN_STATE_ERROR: return "DTI_CONN_STATE_ERROR"; | |
123 default: return "NOT_DEFINED_DTI_CONN_STATE"; | |
124 | |
125 } | |
126 } | |
127 | |
128 | |
129 /******************************************************************************/ | |
130 GLOBAL BOOL TCPIP_connect_dti_cb (UBYTE dti_id, T_DTI_CONN_STATE result_type) | |
131 { | |
132 TRACE_FUNCTION("TCPIP_connect_dti_cb()"); | |
133 TRACE_EVENT_P1("Result: %s", dti_conn_state_string(result_type)); | |
134 | |
135 switch( result_type) | |
136 { | |
137 case(DTI_CONN_STATE_CONNECTING): | |
138 case(DTI_CONN_STATE_CONNECTED): | |
139 case(DTI_CONN_STATE_DISCONNECTING): | |
140 break; | |
141 | |
142 case(DTI_CONN_STATE_DISCONNECTED): | |
143 dti_cntrl_clear_conn_parms(dti_id); | |
144 break; | |
145 | |
146 case(DTI_CONN_STATE_ERROR): | |
147 /* connection not possible: disconnect */ | |
148 dti_cntrl_close_dpath_from_dti_id( dti_id ); | |
149 break; | |
150 | |
151 default: | |
152 TRACE_EVENT("TCPIP_connect_dti_cb(): call with not awaited value"); | |
153 break; | |
154 } | |
155 return TRUE; | |
156 } | |
157 |