FreeCalypso > hg > fc-magnetite
comparison src/aci2/aci/psa_sms.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 : | |
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 the registration part of | |
19 | GPRS session management. | |
20 +----------------------------------------------------------------------------- | |
21 */ | |
22 | |
23 #ifdef GPRS | |
24 | |
25 #ifndef PSA_SMS_C | |
26 #define PSA_SMS_C | |
27 #endif | |
28 | |
29 #include "aci_all.h" | |
30 /*==== INCLUDES ===================================================*/ | |
31 #include "dti.h" /* functionality of the dti library */ | |
32 #include "aci_cmh.h" | |
33 #include "ati_cmd.h" | |
34 #include "aci_cmd.h" | |
35 #include "aci.h" | |
36 #include "psa.h" | |
37 | |
38 #include "dti_conn_mng.h" | |
39 #include "dti_cntrl_mng.h" | |
40 | |
41 #include "gaci_cmh.h" | |
42 #include "psa_gmm.h" | |
43 #include "psa_sm.h" | |
44 #include "cmh.h" | |
45 #include "gaci.h" | |
46 #include "gaci_cmh.h" | |
47 #include "cmh_sm.h" | |
48 | |
49 /*==== CONSTANTS ==================================================*/ | |
50 | |
51 | |
52 /*==== TYPES ======================================================*/ | |
53 | |
54 | |
55 /*==== EXPORT =====================================================*/ | |
56 | |
57 | |
58 /*==== VARIABLES ==================================================*/ | |
59 | |
60 | |
61 /*==== FUNCTIONS ==================================================*/ | |
62 | |
63 /* | |
64 +-------------------------------------------------------------------+ | |
65 | PROJECT : GPRS (8441) MODULE : PSA_SMS | | |
66 | STATE : finished ROUTINE : psaSM_ActivateReq | | |
67 +-------------------------------------------------------------------+ | |
68 | |
69 PURPOSE : MS initiates a PDP context activation | |
70 | |
71 */ | |
72 GLOBAL void psaSM_ActivateReq ( SHORT cid, | |
73 UBYTE ppp_hc, | |
74 UBYTE msid, | |
75 UBYTE hcomp, | |
76 ULONG dti_linkid, | |
77 ULONG dti_neighbor, | |
78 UBYTE dti_direction ) | |
79 { | |
80 USHORT PCO_length = pdp_context[cid - 1].user_pco.len << 3; | |
81 | |
82 TRACE_FUNCTION ("psaSM_ActivateReq()"); | |
83 | |
84 /* | |
85 *------------------------------------------------------------------- | |
86 * create and send primitive for context activation | |
87 *------------------------------------------------------------------- | |
88 */ | |
89 | |
90 { | |
91 PALLOC_SDU ( smreg_pdp_activate_req, SMREG_PDP_ACTIVATE_REQ, PCO_length ); | |
92 | |
93 smreg_pdp_activate_req -> direc = smShrdPrm.direc; | |
94 smreg_pdp_activate_req -> ppp_hc = ppp_hc; | |
95 smreg_pdp_activate_req -> msid = msid; | |
96 smreg_pdp_activate_req -> hcomp = hcomp; | |
97 smreg_pdp_activate_req -> dcomp = (1 EQ cmhSM_Get_d_comp()) ? | |
98 SMREG_COMP_BOTH_DIRECT: SMREG_COMP_NEITHER_DIRECT; | |
99 | |
100 smreg_pdp_activate_req -> pdp_type = cmhSM_Get_pdp_type(); | |
101 smreg_pdp_activate_req -> smreg_nsapi = pdp_context[cid - 1].nsapi; | |
102 smreg_pdp_activate_req -> smreg_ti = gprs_call_table[current_gprs_ct_index].sm_ind.smreg_ti; | |
103 | |
104 | |
105 cmhSM_Get_QOS ( &smreg_pdp_activate_req -> smreg_qos ); | |
106 cmhSM_Get_QOS_min ( &smreg_pdp_activate_req -> smreg_min_qos ); | |
107 cmhSM_Get_pdp_address ( &smreg_pdp_activate_req -> pdp_address ); | |
108 cmhSM_Get_smreg_apn ( &smreg_pdp_activate_req -> smreg_apn ); | |
109 | |
110 smreg_pdp_activate_req -> dti_linkid = dti_linkid; | |
111 smreg_pdp_activate_req -> dti_neighbor = dti_neighbor; | |
112 smreg_pdp_activate_req -> dti_direction = dti_direction; | |
113 | |
114 smreg_pdp_activate_req -> sdu.l_buf = PCO_length; | |
115 smreg_pdp_activate_req -> sdu.o_buf = 0; | |
116 | |
117 if ( PCO_length ) | |
118 { | |
119 memcpy(&smreg_pdp_activate_req -> sdu.buf, | |
120 pdp_context[cid - 1].user_pco.pco, | |
121 pdp_context[cid - 1].user_pco.len); | |
122 } | |
123 | |
124 psaGMM_NetworkRegistrationStatus(SMREG_PDP_ACTIVATE_REQ, smreg_pdp_activate_req); | |
125 | |
126 PSEND (hCommSM, smreg_pdp_activate_req); | |
127 } | |
128 } | |
129 | |
130 | |
131 /* | |
132 +-------------------------------------------------------------------+ | |
133 | PROJECT : GPRS (8441) MODULE : PSA_SMS | | |
134 | STATE : finished ROUTINE : psaSM_PDP_Deactivate | | |
135 +-------------------------------------------------------------------+ | |
136 | |
137 PURPOSE : MS initiates a PDP context deactivation | |
138 | |
139 */ | |
140 GLOBAL void psaSM_PDP_Deactivate ( USHORT nsapi_set, UBYTE smreg_local ) | |
141 { | |
142 | |
143 TRACE_FUNCTION ("psaSM_PDP_Deactivate()"); | |
144 | |
145 /* | |
146 *------------------------------------------------------------------- | |
147 * create and send primitive for context deactivation | |
148 *------------------------------------------------------------------- | |
149 */ | |
150 { | |
151 PALLOC (smreg_pdp_deactivate_req, SMREG_PDP_DEACTIVATE_REQ); | |
152 | |
153 smreg_pdp_deactivate_req -> nsapi_set = nsapi_set; | |
154 smreg_pdp_deactivate_req -> smreg_local = smreg_local; | |
155 | |
156 PSEND (hCommSM, smreg_pdp_deactivate_req); | |
157 } | |
158 } | |
159 | |
160 /* | |
161 +-------------------------------------------------------------------+ | |
162 | PROJECT : GPRS (8441) MODULE : PSA_SMS | | |
163 | STATE : finished ROUTINE : psaSM_PDP_No_activate | | |
164 +-------------------------------------------------------------------+ | |
165 | |
166 PURPOSE : GACI is not able to set up another context | |
167 | |
168 */ | |
169 GLOBAL void psaSM_PDP_No_activate ( UBYTE smreg_ti, USHORT smreg_cause ) | |
170 { | |
171 | |
172 TRACE_FUNCTION ("psaSM_PDP_No_activate()"); | |
173 | |
174 /* | |
175 *------------------------------------------------------------------- | |
176 * create and send primitive for rejection | |
177 * the network requested context activation | |
178 *------------------------------------------------------------------- | |
179 */ | |
180 { | |
181 PALLOC (smreg_pdp_activate_res, SMREG_PDP_ACTIVATE_RES); | |
182 | |
183 smreg_pdp_activate_res -> smreg_ti = smreg_ti; | |
184 smreg_pdp_activate_res -> smreg_cause = smreg_cause; | |
185 | |
186 PSEND (hCommSM, smreg_pdp_activate_res); | |
187 } | |
188 } | |
189 | |
190 #endif /* GPRS */ | |
191 /*==== EOF ========================================================*/ | |
192 |