FreeCalypso > hg > fc-tourmaline
comparison src/g23m-aci/aci/psa_ipas.c @ 1:fa8dc04885d8
src/g23m-*: import from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 16 Oct 2020 06:25:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:4e78acac3d88 | 1:fa8dc04885d8 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : PSA_IPAS | |
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 #if defined (FF_WAP) || defined (FF_SAT_E) | |
21 | |
22 #ifndef PSA_IPAS_C | |
23 #define PSA_IPAS_C | |
24 #endif | |
25 | |
26 #include "aci_all.h" | |
27 /*==== INCLUDES ===================================================*/ | |
28 #include "aci_cmh.h" | |
29 #include "ati_cmd.h" | |
30 #include "aci_cmd.h" | |
31 #include "dti.h" /* functionality of the dti library */ | |
32 | |
33 #include "aci.h" | |
34 #include "psa.h" | |
35 //#include "psa_l2r.h" | |
36 #include "psa_cc.h" | |
37 #include "aci_fd.h" | |
38 #include "cmh.h" | |
39 #include "dti_conn_mng.h" | |
40 //#include "cmh_l2r.h" | |
41 | |
42 #include "wap_aci.h" | |
43 #include "psa_tcpip.h" | |
44 | |
45 #ifdef GPRS | |
46 #include "gaci.h" | |
47 #include "cmh_sm.h" | |
48 #endif | |
49 | |
50 /*==== CONSTANTS ==================================================*/ | |
51 | |
52 | |
53 /*==== TYPES ======================================================*/ | |
54 | |
55 | |
56 /*==== EXPORT =====================================================*/ | |
57 | |
58 | |
59 /*==== VARIABLES ==================================================*/ | |
60 | |
61 | |
62 /*==== FUNCTIONS ==================================================*/ | |
63 | |
64 | |
65 /* | |
66 +-------------------------------------------------------------------+ | |
67 | PROJECT : GSM-PS (6147) MODULE : PSA_IPA | | |
68 | ROUTINE : psaIPA_Config | | |
69 +-------------------------------------------------------------------+ | |
70 | |
71 PURPOSE : Configurate or disconfigurate IPA. | |
72 | |
73 */ | |
74 | |
75 GLOBAL void psaIPA_Config(ULONG ip, USHORT max_trans_unit, T_ACI_IPA_DIRC dirc | |
76 /*T_ACI_AT_CMD at_cmd */) | |
77 { | |
78 /* dirc = IPA_CONN if IPA is to be activated | |
79 dirc = IPA_DSC if IPA i to be deactivated */ | |
80 | |
81 TRACE_FUNCTION("psaIPA_Config()") ; | |
82 | |
83 switch( dirc ) | |
84 { | |
85 | |
86 case ( IPA_CONN ): | |
87 wap_state = IPA_Configuration; | |
88 { | |
89 PALLOC(ipa_config_req,IPA_CONFIG_REQ); | |
90 ipa_config_req -> ip = ip; | |
91 ipa_config_req->peer_ip = 0; | |
92 ipa_config_req->cmd = IPA_CONFIG_UP; | |
93 ipa_config_req -> mtu = max_trans_unit; | |
94 | |
95 PSENDX(IP,ipa_config_req); | |
96 } | |
97 break; | |
98 | |
99 case ( IPA_DSC ): | |
100 wap_state = IPA_Deconfiguration; | |
101 { | |
102 PALLOC(ipa_config_req,IPA_CONFIG_REQ); | |
103 ipa_config_req -> ip = 0; | |
104 ipa_config_req->peer_ip = 0; | |
105 ipa_config_req->cmd = IPA_CONFIG_DOWN; | |
106 ipa_config_req -> mtu = 0; | |
107 | |
108 PSENDX(IP,ipa_config_req); | |
109 } | |
110 break; | |
111 } | |
112 } | |
113 | |
114 | |
115 /* | |
116 +-------------------------------------------------------------------+ | |
117 | PROJECT : GSM-PS (6147) MODULE : PSA_IPAS | | |
118 | ROUTINE : psaIPA_Dti_Req | | |
119 +-------------------------------------------------------------------+ | |
120 | |
121 PURPOSE : connect IP | |
122 | |
123 */ | |
124 | |
125 GLOBAL void psaIPA_Dti_Req(ULONG link_id, UBYTE peer_to_connect_to, UBYTE dti_conn) | |
126 { | |
127 | |
128 PALLOC( ipa_dti_req, IPA_DTI_REQ); | |
129 | |
130 | |
131 | |
132 #ifdef GPRS | |
133 T_PDP_CONTEXT_INTERNAL *p_pdp_context_node = NULL; | |
134 | |
135 p_pdp_context_node = pdp_context_find_node_from_cid( work_cids[cid_pointer]); | |
136 | |
137 if( p_pdp_context_node ) | |
138 { | |
139 p_pdp_context_node->internal_data.link_id = link_id; | |
140 } | |
141 | |
142 /* This is probably not the right place to populate the link id since | |
143 IPA dti req might be sent for CSD call as well ! Need to investigate | |
144 as separate issue. | |
145 */ | |
146 #endif /* GPRS */ | |
147 | |
148 TRACE_FUNCTION("psaIPA_Dti_Req"); | |
149 | |
150 ipa_dti_req -> dti_conn = dti_conn; | |
151 ipa_dti_req -> link_id = link_id; | |
152 | |
153 if (dti_conn EQ IPA_CONNECT_DTI) | |
154 { | |
155 switch( peer_to_connect_to ) | |
156 { | |
157 case( DTI_ENTITY_UDP ): | |
158 ipa_dti_req -> dti_direction = DTI_CHANNEL_TO_HIGHER_LAYER; | |
159 strcpy((char*)ipa_dti_req->entity_name, dti_entity_name[DTI_ENTITY_UDP].name); | |
160 break; | |
161 #ifdef GPRS | |
162 case( DTI_ENTITY_SNDCP ): | |
163 ipa_dti_req -> dti_direction = DTI_CHANNEL_TO_LOWER_LAYER; | |
164 strcpy((char*)ipa_dti_req->entity_name, dti_entity_name[DTI_ENTITY_SNDCP].name); | |
165 break; | |
166 #endif | |
167 case( DTI_ENTITY_PPPC ): | |
168 ipa_dti_req -> dti_direction = DTI_CHANNEL_TO_LOWER_LAYER; | |
169 strcpy((char*)ipa_dti_req->entity_name, dti_entity_name[DTI_ENTITY_PPPC].name); | |
170 break; | |
171 default: | |
172 TRACE_EVENT("unknown conn_peer_Id: IPA_DTI_REQ not sent"); | |
173 PFREE(ipa_dti_req); | |
174 return; | |
175 } | |
176 } | |
177 | |
178 PSENDX( IP, ipa_dti_req ); | |
179 } | |
180 | |
181 | |
182 #endif /* WAP || SAT E */ |