comparison src/aci2/aci/psa_aaas.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 : ACI
4 | Modul : psa_aaa
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 modul ...
18 +-----------------------------------------------------------------------------
19 */
20 #ifndef PSA_AAAS_C
21 #define PSA_AAAS_C
22 #endif
23
24 #include "aci_all.h"
25
26 /*==== INCLUDES ===================================================*/
27 #include "aci_cmh.h"
28 #include "ati_cmd.h"
29 #include "aci_cmd.h"
30 #include "dti.h" /* functionality of the dti library */
31
32 #include "aci.h"
33 #include "aci_lst.h"
34
35 #include "dti_conn_mng.h"
36 #include "dti_cntrl_mng.h"
37 #include "psa_uart.h"
38 #include "ati_io.h"
39
40 #include "aci_mem.h"
41
42 #include "ati_src_riv.h"
43 #include "psa_aaa.h"
44
45
46 /*
47 +-----------------------------------------------------------------------+
48 | PROJECT : GSM-F&D (8411) MODULE : psa_aaa |
49 | STATE : code ROUTINE : psa_aaa_open_port_cnf |
50 +-----------------------------------------------------------------------+
51
52 PURPOSE : - called by psa_aaa_open_port_req() !
53 */
54 GLOBAL const void psaAAA_open_port_cnf (UBYTE port_number,
55 UBYTE sub_no,
56 UBYTE dti_id)
57 {
58 TRACE_FUNCTION("psaAAA_open_port_cnf()");
59
60 TRACE_EVENT_P2("port_number: %d, dti_id: %d", port_number, dti_id);
61
62 {
63 PALLOC (aaa_open_port_cnf, AAA_OPEN_PORT_CNF);
64
65 aaa_open_port_cnf->port_number = port_number;
66 aaa_open_port_cnf->sub_no = sub_no;
67 aaa_open_port_cnf->dti_id = dti_id;
68
69 #ifdef FF_ESIM
70 PSENDX (ESIM, aaa_open_port_cnf);
71 #else
72 PSENDX (AAA, aaa_open_port_cnf);
73 #endif
74 }
75 }
76
77 /*
78 +------------------------------------------------------------------------+
79 | PROJECT : GSM-F&D (8411) MODULE : psa_aaa |
80 | STATE : code ROUTINE : psa_aaa_close_port_cnf |
81 +------------------------------------------------------------------------+
82
83 PURPOSE : - called by psa_aaa_close_port_req() !
84 */
85 GLOBAL const void psaAAA_close_port_cnf (UBYTE port_number,
86 UBYTE sub_no)
87
88 {
89 TRACE_FUNCTION("psaAAA_close_port_cnf()");
90
91 TRACE_EVENT_P1("port_number: %d", port_number);
92
93 {
94 PALLOC (aaa_close_port_cnf, AAA_CLOSE_PORT_CNF);
95
96 aaa_close_port_cnf->port_number = port_number;
97 aaa_close_port_cnf->sub_no = sub_no;
98
99 #ifdef FF_ESIM
100 PSENDX (ESIM, aaa_close_port_cnf);
101 #else
102 PSENDX (AAA, aaa_close_port_cnf);
103 #endif
104 }
105 }
106
107 /*
108 +-----------------------------------------------------------------------+
109 | PROJECT : GSM-F&D (8411) MODULE : psa_aaa |
110 | STATE : code ROUTINE : psa_aaa_cmd_cnf |
111 +-----------------------------------------------------------------------+
112
113 PURPOSE : - called by riv_src_result_cb()
114 */
115 GLOBAL const void psaAAA_cmd_cnf (UBYTE port_number,
116 UBYTE sub_no,
117 USHORT result_len,
118 UBYTE *cmd_result)
119 {
120 TRACE_FUNCTION("psaAAA_cmd_cnf()");
121
122 TRACE_EVENT_P2("port_number: %d, cmd_result: %s", port_number, cmd_result);
123
124 {
125 PALLOC (aaa_cmd_cnf, AAA_CMD_CNF);
126
127 aaa_cmd_cnf->port_number = port_number;
128 aaa_cmd_cnf->sub_no = sub_no;
129 aaa_cmd_cnf->result_len = result_len;
130 memcpy (aaa_cmd_cnf->cmd_result, cmd_result, result_len);
131
132 #ifdef FF_ESIM
133 PSENDX (ESIM, aaa_cmd_cnf);
134 #else
135 PSENDX (AAA, aaa_cmd_cnf);
136 #endif
137 }
138 }
139
140 /*
141 +-----------------------------------------------------------------------+
142 | PROJECT : GSM-F&D (8411) MODULE : psa_aaa |
143 | STATE : code ROUTINE : psa_aaa_pres_cnf |
144 +-----------------------------------------------------------------------+
145
146 PURPOSE : - called by riv_src_result_cb()
147 */
148 GLOBAL const void psaAAA_pres_ind (UBYTE port_number,
149 UBYTE sub_no,
150 USHORT result_len,
151 UBYTE *cmd_result)
152 {
153 TRACE_FUNCTION("psaAAA_pres_ind()");
154
155 TRACE_EVENT_P2("port_number: %d, cmd_result: %s", port_number, cmd_result);
156
157 {
158 PALLOC (psa_aaa_pres_ind, AAA_PRES_IND);
159
160 psa_aaa_pres_ind->port_number = port_number;
161 psa_aaa_pres_ind->sub_no = sub_no;
162 psa_aaa_pres_ind->result_len = result_len;
163 memcpy (psa_aaa_pres_ind->cmd_result, cmd_result, result_len);
164
165 #ifdef FF_ESIM
166 PSENDX (ESIM, psa_aaa_pres_ind);
167 #else
168 PSENDX (AAA, psa_aaa_pres_ind);
169 #endif
170 }
171 }
172
173 /*
174 +-----------------------------------------------------------------------+
175 | PROJECT : GSM-F&D (8411) MODULE : psa_aaa |
176 | STATE : code ROUTINE : psa_aaa_ures_ind |
177 +-----------------------------------------------------------------------+
178
179 PURPOSE : - called by riv_src_result_cb()
180 */
181 GLOBAL const void psaAAA_ures_ind (UBYTE port_number,
182 UBYTE sub_no,
183 USHORT result_len,
184 UBYTE *cmd_result)
185 {
186 TRACE_FUNCTION("psaAAA_ures_ind()");
187
188 TRACE_EVENT_P2("port_number: %d, cmd_result: %s", port_number, cmd_result);
189
190 {
191 PALLOC (psa_aaa_ures_ind, AAA_URES_IND);
192
193 psa_aaa_ures_ind->port_number = port_number;
194 psa_aaa_ures_ind->sub_no = sub_no;
195 psa_aaa_ures_ind->result_len = result_len;
196 memcpy (psa_aaa_ures_ind->cmd_result, cmd_result, result_len);
197
198 #ifdef FF_ESIM
199 PSENDX (ESIM, psa_aaa_ures_ind);
200 #else
201 PSENDX (AAA, psa_aaa_ures_ind);
202 #endif
203 }
204 }
205
206 /*
207 +-----------------------------------------------------------------------+
208 | PROJECT : GSM-F&D (8411) MODULE : psa_aaa |
209 | STATE : code ROUTINE : psa_aaa_dti_ind |
210 +-----------------------------------------------------------------------+
211
212 PURPOSE : - called by dti_cntrl_maintain_entity(), which itself is registered
213 as a call back funcion at the DTI connection manager
214 */
215 GLOBAL const void psaAAA_dti_ind (ULONG link_id,
216 T_DTI_ENTITY_ID peer_ent_id)
217 {
218 UBYTE dti_id = EXTRACT_DTI_ID(link_id);
219 T_DTI_CNTRL info;
220 CHAR *entity_name = dti_entity_name[peer_ent_id].name;
221
222 TRACE_FUNCTION("psaAAA_dti_ind()");
223
224 dti_cntrl_get_info_from_dti_id (dti_id, &info);
225 /*
226 * info->dev_no == port_number
227 */
228 TRACE_EVENT_P3("port_number: %d, link_id: %d, connect with: %s", info.dev_no, link_id, entity_name);
229 /*
230 * just to remember the link_id
231 */
232 dti_cntrl_set_conn_parms (link_id,
233 DTI_ENTITY_AAA,
234 info.dev_no,
235 info.sub_no);
236
237 {
238 PALLOC (psa_aaa_dti_ind, AAA_DTI_IND);
239
240 psa_aaa_dti_ind->port_number = info.dev_no;
241 psa_aaa_dti_ind->sub_no = info.sub_no;
242 psa_aaa_dti_ind->link_id = link_id;
243 strcpy ((char *)psa_aaa_dti_ind->entity_name, entity_name);
244
245 #ifdef FF_ESIM
246 PSENDX (ESIM, psa_aaa_dti_ind);
247 #else
248 PSENDX (AAA, psa_aaa_dti_ind);
249 #endif
250 }
251 }
252
253 /*
254 +-----------------------------------------------------------------------+
255 | PROJECT : GSM-F&D (8411) MODULE : psa_aaa |
256 | STATE : code ROUTINE : psa_aaa_disconnect_ind |
257 +-----------------------------------------------------------------------+
258
259 PURPOSE : - called by dti_cntrl_maintain_entity(), which itself is registered
260 as a call back funcion at the DTI connection manager
261 */
262 GLOBAL const void psaAAA_disconnect_ind (ULONG link_id)
263 {
264 UBYTE dti_id = EXTRACT_DTI_ID(link_id);
265 T_DTI_CNTRL info;
266
267 TRACE_FUNCTION("psaAAA_disconnect_ind()");
268
269 dti_cntrl_get_info_from_dti_id (dti_id, &info);
270
271 {
272 PALLOC (psa_aaa_disconnect_ind, AAA_DISCONNECT_IND);
273
274 psa_aaa_disconnect_ind->port_number = info.dev_no;
275 psa_aaa_disconnect_ind->sub_no = info.sub_no;
276 psa_aaa_disconnect_ind->link_id = link_id;
277
278 #ifdef FF_ESIM
279 PSENDX (ESIM, psa_aaa_disconnect_ind);
280 #else
281 PSENDX (AAA, psa_aaa_disconnect_ind);
282 #endif
283 }
284 }