FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-aci/aci/psa_gppps.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 : | |
4 | Modul : | |
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 signalling functions of the | |
18 | protocol stack adapter for GPRS Point-to-Point Protocol ( PPP ). | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #if defined (GPRS) && defined (DTI) | |
23 | |
24 #ifndef PSA_GPPPS_C | |
25 #define PSA_GPPPS_C | |
26 #endif | |
27 | |
28 #include "aci_all.h" | |
29 /*==== INCLUDES ===================================================*/ | |
30 #include "dti.h" /* functionality of the dti library */ | |
31 #include "aci_cmh.h" | |
32 #include "ati_cmd.h" | |
33 #include "aci_cmd.h" | |
34 #include "aci.h" | |
35 #include "psa.h" | |
36 | |
37 #include "dti_conn_mng.h" | |
38 #include "dti_cntrl_mng.h" | |
39 | |
40 #include "psa_gppp.h" | |
41 | |
42 /*==== CONSTANTS ==================================================*/ | |
43 | |
44 #define TOK_STR " =\t" /* string of token delimiter */ | |
45 | |
46 /*==== TYPES ======================================================*/ | |
47 | |
48 | |
49 /*==== EXPORT =====================================================*/ | |
50 | |
51 | |
52 /*==== VARIABLES ==================================================*/ | |
53 | |
54 /*==== FUNCTIONS ==================================================*/ | |
55 | |
56 /* | |
57 +-------------------------------------------------------------------+ | |
58 | PROJECT : GPRS (8441) MODULE : PSA_PPPS | | |
59 | STATE : finished ROUTINE : psaGPPP_Establish | | |
60 +-------------------------------------------------------------------+ | |
61 | |
62 PURPOSE : request establishment of PPP connection | |
63 | |
64 */ | |
65 GLOBAL void psaGPPP_Establish ( T_PPP_ESTABLISH_REQ *est_req ) | |
66 { | |
67 | |
68 TRACE_FUNCTION ("psaGPPP_Establish()"); | |
69 | |
70 /* | |
71 *------------------------------------------------------------------- | |
72 * create and send primitive for establich PPP | |
73 *------------------------------------------------------------------- | |
74 */ | |
75 { | |
76 PALLOC (ppp_establish_req, PPP_ESTABLISH_REQ); | |
77 | |
78 *ppp_establish_req = *est_req; | |
79 | |
80 PSEND (hCommPPP, ppp_establish_req); | |
81 } | |
82 } | |
83 | |
84 /* | |
85 +-------------------------------------------------------------------+ | |
86 | PROJECT : GPRS (8441) MODULE : PSA_PPPS | | |
87 | STATE : finished ROUTINE : psaGPPP_Terminate | | |
88 +-------------------------------------------------------------------+ | |
89 | |
90 PURPOSE : close the PPP connection | |
91 | |
92 */ | |
93 GLOBAL void psaGPPP_Terminate ( UBYTE lower_layer ) | |
94 { | |
95 | |
96 TRACE_FUNCTION ("psaGPPP_Terminate()"); | |
97 | |
98 /* | |
99 *------------------------------------------------------------------- | |
100 * create and send primitive for network attach | |
101 *------------------------------------------------------------------- | |
102 */ | |
103 { | |
104 PALLOC (ppp_terminate_req, PPP_TERMINATE_REQ); | |
105 | |
106 /* fill in primitive parameter: registration mode */ | |
107 ppp_terminate_req -> lower_layer = lower_layer; | |
108 | |
109 PSEND (hCommPPP, ppp_terminate_req); | |
110 } | |
111 } | |
112 | |
113 /* | |
114 +-------------------------------------------------------------------+ | |
115 | PROJECT : GPRS (8441) MODULE : PSA_PPPS | | |
116 | STATE : finished ROUTINE : psaGPPP_PDP_Activate | | |
117 +-------------------------------------------------------------------+ | |
118 | |
119 PURPOSE : the PDP context is activated (only in server mode) | |
120 | |
121 */ | |
122 GLOBAL void psaGPPP_PDP_Activate ( T_NAS_ip * ip, UBYTE *pco_buf, UBYTE pco_length, U8 nsapi) | |
123 { | |
124 | |
125 TRACE_FUNCTION ("psaGPPP_PDP_Activate()"); | |
126 | |
127 /* | |
128 *------------------------------------------------------------------- | |
129 * create and send primitive for network attach | |
130 *------------------------------------------------------------------- | |
131 */ | |
132 | |
133 { | |
134 PALLOC_SDU (ppp_pdp_activate_res, PPP_PDP_ACTIVATE_RES, (USHORT)(pco_length << 3)); | |
135 | |
136 /* Issue OMAPS00047332: SM, SNDCP and UPM are not supporting ppp_hc and msid. | |
137 * these two parameter should only be removed after | |
138 * PPP SAP modification. till then reset it to 0. | |
139 */ | |
140 ppp_pdp_activate_res->ppp_hc = 0; | |
141 ppp_pdp_activate_res->msid = 0; | |
142 | |
143 #ifdef _SIMULATION_ | |
144 #pragma message("A check of the IP version is needed before starting a PPP connection.") | |
145 #endif | |
146 ppp_pdp_activate_res->ip = ip->ip_address.ipv4_addr.a4[0] << 24; | |
147 ppp_pdp_activate_res->ip += ip->ip_address.ipv4_addr.a4[1] << 16; | |
148 ppp_pdp_activate_res->ip += ip->ip_address.ipv4_addr.a4[2] << 8; | |
149 ppp_pdp_activate_res->ip += ip->ip_address.ipv4_addr.a4[3]; | |
150 ppp_pdp_activate_res->sdu.l_buf = pco_length << 3; | |
151 ppp_pdp_activate_res->sdu.o_buf = 0; | |
152 if ( pco_length ) | |
153 { | |
154 memcpy(&ppp_pdp_activate_res->sdu.buf, pco_buf, pco_length); | |
155 } | |
156 | |
157 PSEND (hCommPPP, ppp_pdp_activate_res); | |
158 } | |
159 } | |
160 | |
161 /* | |
162 +-------------------------------------------------------------------+ | |
163 | PROJECT : GPRS (8441) MODULE : PSA_PPPS | | |
164 | STATE : finished ROUTINE : psaGPPP_PDP_Reject | | |
165 +-------------------------------------------------------------------+ | |
166 | |
167 PURPOSE : the PDP context can't activated (only in server mode) | |
168 | |
169 */ | |
170 GLOBAL SHORT psaGPPP_PDP_Reject ( void ) | |
171 { | |
172 | |
173 TRACE_FUNCTION ("psaGPPP_PDP_Reject()"); | |
174 | |
175 | |
176 /* | |
177 *------------------------------------------------------------------- | |
178 * check owner id | |
179 *------------------------------------------------------------------- | |
180 */ | |
181 if(!psa_IsVldOwnId((T_OWN)gpppShrdPrm.owner)) | |
182 | |
183 return( -1 ); | |
184 | |
185 /* | |
186 *------------------------------------------------------------------- | |
187 * create and send primitive for network attach | |
188 *------------------------------------------------------------------- | |
189 */ | |
190 | |
191 PSEND (hCommPPP, gpppShrdPrm.setPrm[gpppShrdPrm.owner].pdp_rej); | |
192 | |
193 return 0; | |
194 } | |
195 | |
196 /* | |
197 +-------------------------------------------------------------------+ | |
198 | PROJECT : GPRS (8441) MODULE : PSA_PPPS | | |
199 | STATE : finished ROUTINE : psaGPPP_Modification | | |
200 +-------------------------------------------------------------------+ | |
201 | |
202 PURPOSE : negotiate header compression again (only in server mode) | |
203 | |
204 */ | |
205 /* NEEDED ???*/ | |
206 | |
207 | |
208 /* LOCAL SHORT psaGPPP_Modification ( void )*/ | |
209 /* {*/ | |
210 /* T_PPP_SET_PRM * pPrmSet; *//* points to used parameter set */ | |
211 /* TRACE_FUNCTION ("psaGPPP_Modification()");*/ | |
212 | |
213 /* | |
214 *------------------------------------------------------------------- | |
215 * check owner id | |
216 *------------------------------------------------------------------- | |
217 */ | |
218 /* if(!psa_IsVldOwnId(gpppShrdPrm.owner)) | |
219 | |
220 return( -1 ); | |
221 | |
222 pPrmSet = &gpppShrdPrm.setPrm[gpppShrdPrm.owner]; */ | |
223 | |
224 /* | |
225 *------------------------------------------------------------------- | |
226 * create and send primitive for network attach | |
227 *------------------------------------------------------------------- | |
228 */ | |
229 /* { | |
230 PALLOC (ppp_modification_req, PPP_MODIFICATION_REQ);*/ | |
231 | |
232 /* fill in primitive parameter: registration mode */ | |
233 /* ppp_modification_req -> ppp_hc = pPrmSet -> ppp_hc; | |
234 ppp_modification_req -> msid = pPrmSet -> msid; | |
235 | |
236 PSEND (hCommPPP, ppp_modification_req); | |
237 } | |
238 | |
239 return 0; | |
240 }*/ | |
241 | |
242 #endif /* GPRS */ | |
243 /*==== EOF ========================================================*/ | |
244 |