FreeCalypso > hg > fc-tourmaline
comparison src/g23m-aci/aci/psa_l2rp.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_L2RP | |
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 processing functions for the | |
18 | primitives send to the protocol stack adapter by layer | |
19 | 2 Relay. | |
20 +----------------------------------------------------------------------------- | |
21 */ | |
22 | |
23 #ifdef DTI | |
24 | |
25 #ifndef PSA_L2RP_C | |
26 #define PSA_L2RP_C | |
27 #endif | |
28 | |
29 #include "aci_all.h" | |
30 | |
31 /*==== INCLUDES ===================================================*/ | |
32 | |
33 #include "dti.h" /* functionality of the dti library */ | |
34 #include "aci_cmh.h" | |
35 #include "ati_cmd.h" | |
36 #include "aci_cmd.h" | |
37 #include "aci_fd.h" | |
38 #include "aci.h" | |
39 | |
40 #include "dti.h" | |
41 #include "dti_conn_mng.h" | |
42 #include "dti_cntrl_mng.h" | |
43 | |
44 #include "psa.h" | |
45 #include "cmh.h" | |
46 #include "cmh_ra.h" | |
47 #include "psa_cc.h" | |
48 #include "psa_l2r.h" | |
49 #include "cmh_l2r.h" | |
50 | |
51 #if defined (FF_WAP) || defined (FF_GPF_TCPIP) || defined (FF_SAT_E) | |
52 #include "wap_aci.h" | |
53 #include "psa_ppp_w.h" | |
54 #include "cmh_ppp.h" | |
55 #endif /* defined (FF_WAP) || defined (FF_GPF_TCPIP) */ | |
56 | |
57 #include "psa_uart.h" | |
58 #include "psa_ra.h" | |
59 #include "psa_uart.h" | |
60 #include "psa_util.h" | |
61 | |
62 #include "sap_dti.h" | |
63 | |
64 #include "dcm_f.h" | |
65 | |
66 /*==== CONSTANTS ==================================================*/ | |
67 | |
68 | |
69 /*==== TYPES ======================================================*/ | |
70 | |
71 /*==== EXPORT =====================================================*/ | |
72 | |
73 /*==== VARIABLES ==================================================*/ | |
74 | |
75 /*==== FUNCTIONS ==================================================*/ | |
76 | |
77 /* | |
78 +-------------------------------------------------------------------+ | |
79 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
80 | ROUTINE : psa_l2r_activate_cnf | | |
81 +-------------------------------------------------------------------+ | |
82 | |
83 PURPOSE : processes the L2R_L2R_ACTIVATE_CNF primitive send by L2R. | |
84 | |
85 */ | |
86 | |
87 GLOBAL void psa_l2r_activate_cnf | |
88 (T_L2R_ACTIVATE_CNF *l2r_activate_cnf) | |
89 { | |
90 TRACE_FUNCTION ("psa_l2r_activate_cnf()"); | |
91 | |
92 if (!psaCC_ctbIsValid(raShrdPrm.cId)) | |
93 { | |
94 TRACE_ERROR ("raShrdPrm.cId invalid"); | |
95 PFREE (l2r_activate_cnf); | |
96 return; | |
97 } | |
98 | |
99 switch (l2rShrdPrm.state) | |
100 { | |
101 case L2R_ACTIVATE: | |
102 { | |
103 if (l2r_activate_cnf->ack_flg EQ L2R_NAK) | |
104 { | |
105 l2rShrdPrm.state = L2R_DEACTIVATED; | |
106 | |
107 cmhL2R_Failure(); | |
108 } | |
109 else | |
110 { | |
111 PALLOC (l2r_connect_req, L2R_CONNECT_REQ); | |
112 | |
113 l2rShrdPrm.state = L2R_CONNECT; | |
114 | |
115 PSENDX (L2R, l2r_connect_req); | |
116 } | |
117 | |
118 break; | |
119 } | |
120 | |
121 case L2R_DEACTIVATE: | |
122 { | |
123 break; | |
124 } | |
125 | |
126 default: | |
127 { | |
128 l2rShrdPrm.state = L2R_DEACTIVATED; | |
129 | |
130 cmhL2R_Failure(); | |
131 | |
132 break; | |
133 } | |
134 } | |
135 | |
136 PFREE (l2r_activate_cnf); | |
137 } | |
138 | |
139 /* | |
140 +-------------------------------------------------------------------+ | |
141 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
142 | ROUTINE : psa_l2r_connect_cnf | | |
143 +-------------------------------------------------------------------+ | |
144 | |
145 PURPOSE : processes the L2R_CONNECT_CNF primitive send by L2R. | |
146 | |
147 */ | |
148 | |
149 GLOBAL void psa_l2r_connect_cnf | |
150 (T_L2R_CONNECT_CNF *l2r_connect_cnf) | |
151 { | |
152 TRACE_FUNCTION ("psa_l2r_connect_cnf()"); | |
153 | |
154 if (!psaCC_ctbIsValid(raShrdPrm.cId)) | |
155 { | |
156 TRACE_ERROR ("raShrdPrm.cId invalid"); | |
157 PFREE (l2r_connect_cnf); | |
158 return; | |
159 } | |
160 | |
161 switch (l2rShrdPrm.state) | |
162 { | |
163 case L2R_CONNECT: | |
164 { | |
165 if (l2r_connect_cnf->ack_flg EQ L2R_NAK) | |
166 { | |
167 PALLOC (l2r_deactivate_req, L2R_DEACTIVATE_REQ); | |
168 | |
169 l2rShrdPrm.state = L2R_DEACTIVATE; | |
170 | |
171 cmhL2R_Failure(); | |
172 | |
173 PSENDX (L2R, l2r_deactivate_req); | |
174 } | |
175 else | |
176 { | |
177 l2rShrdPrm.state = L2R_CONNECTED; | |
178 | |
179 cmhCC_L2R_or_TRA_Activated( DTI_ENTITY_L2R, raShrdPrm.cId ); | |
180 } | |
181 | |
182 break; | |
183 } | |
184 | |
185 case L2R_DEACTIVATE: | |
186 { | |
187 break; | |
188 } | |
189 | |
190 default: | |
191 { | |
192 PALLOC (l2r_deactivate_req, L2R_DEACTIVATE_REQ); | |
193 | |
194 l2rShrdPrm.state = L2R_DEACTIVATE; | |
195 | |
196 cmhL2R_Failure(); | |
197 | |
198 PSENDX (L2R, l2r_deactivate_req); | |
199 | |
200 break; | |
201 } | |
202 } | |
203 | |
204 PFREE (l2r_connect_cnf); | |
205 } | |
206 | |
207 /* | |
208 +-------------------------------------------------------------------+ | |
209 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
210 | ROUTINE : psa_l2r_connect_ind | | |
211 +-------------------------------------------------------------------+ | |
212 | |
213 PURPOSE : processes the L2R_CONNECT_IND primitive send by L2R. | |
214 | |
215 */ | |
216 | |
217 GLOBAL void psa_l2r_connect_ind | |
218 (T_L2R_CONNECT_IND *l2r_connect_ind) | |
219 { | |
220 TRACE_FUNCTION ("psa_l2r_connect_ind()"); | |
221 | |
222 if (!psaCC_ctbIsValid(raShrdPrm.cId)) | |
223 { | |
224 TRACE_ERROR ("raShrdPrm.cId invalid"); | |
225 PFREE (l2r_connect_ind); | |
226 return; | |
227 } | |
228 | |
229 switch (l2rShrdPrm.state) | |
230 { | |
231 case L2R_CONNECT: | |
232 { | |
233 l2rShrdPrm.state = L2R_CONNECTED; | |
234 | |
235 cmhCC_L2R_or_TRA_Activated( DTI_ENTITY_L2R, raShrdPrm.cId ); | |
236 | |
237 break; | |
238 } | |
239 | |
240 case L2R_CONNECTED: | |
241 case L2R_ENABLE: | |
242 case L2R_ENABLED: | |
243 /* case L2R_DISABLE:*/ | |
244 { | |
245 PALLOC (l2r_disc_req, L2R_DISC_REQ); | |
246 | |
247 l2rShrdPrm.state = L2R_DISCONNECT; | |
248 | |
249 cmhL2R_Failure(); | |
250 | |
251 PSENDX (L2R, l2r_disc_req); | |
252 | |
253 break; | |
254 } | |
255 | |
256 case L2R_ACTIVATE: | |
257 { | |
258 PALLOC (l2r_deactivate_req, L2R_DEACTIVATE_REQ); | |
259 | |
260 l2rShrdPrm.state = L2R_DEACTIVATE; | |
261 | |
262 cmhL2R_Failure(); | |
263 | |
264 PSENDX (L2R, l2r_deactivate_req); | |
265 | |
266 break; | |
267 } | |
268 | |
269 default: | |
270 { | |
271 cmhL2R_Failure(); | |
272 | |
273 break; | |
274 } | |
275 } | |
276 | |
277 PFREE (l2r_connect_ind); | |
278 } | |
279 | |
280 /* | |
281 +-------------------------------------------------------------------+ | |
282 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
283 | ROUTINE : psa_l2r_deactivate_cnf | | |
284 +-------------------------------------------------------------------+ | |
285 | |
286 PURPOSE : processes the L2R_DEACTIVATE_CNF primitive send by L2R. | |
287 | |
288 */ | |
289 | |
290 GLOBAL void psa_l2r_deactivate_cnf | |
291 (T_L2R_DEACTIVATE_CNF *l2r_deactivate_cnf) | |
292 { | |
293 TRACE_FUNCTION ("psa_l2r_deactivate_cnf()"); | |
294 | |
295 switch (l2rShrdPrm.state) | |
296 { | |
297 default: | |
298 { | |
299 cmhL2R_Failure(); | |
300 } | |
301 /*lint -fallthrough */ | |
302 case L2R_DEACTIVATE: | |
303 { | |
304 l2rShrdPrm.state = L2R_DEACTIVATED; | |
305 | |
306 cmhL2R_Deactivated(); | |
307 | |
308 break; | |
309 } | |
310 | |
311 } | |
312 | |
313 PFREE (l2r_deactivate_cnf); | |
314 } | |
315 | |
316 /* | |
317 +-------------------------------------------------------------------+ | |
318 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
319 | ROUTINE : psa_l2r_disc_cnf | | |
320 +-------------------------------------------------------------------+ | |
321 | |
322 PURPOSE : processes the L2R_DISC_CNF primitive send by L2R. | |
323 | |
324 */ | |
325 | |
326 GLOBAL void psa_l2r_disc_cnf (T_L2R_DISC_CNF *l2r_disc_cnf) | |
327 { | |
328 TRACE_FUNCTION ("psa_l2r_disc_cnf()"); | |
329 | |
330 switch (l2rShrdPrm.state) | |
331 { | |
332 default: | |
333 { | |
334 cmhL2R_Failure(); | |
335 } | |
336 /*lint -fallthrough */ | |
337 case L2R_DISCONNECT: | |
338 { | |
339 PALLOC (l2r_deactivate_req, L2R_DEACTIVATE_REQ); | |
340 | |
341 l2rShrdPrm.state = L2R_DEACTIVATE; | |
342 | |
343 PSENDX (L2R, l2r_deactivate_req); | |
344 | |
345 break; | |
346 } | |
347 | |
348 } | |
349 | |
350 PFREE (l2r_disc_cnf); | |
351 } | |
352 | |
353 /* | |
354 +-------------------------------------------------------------------+ | |
355 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
356 | ROUTINE : psa_l2r_disc_ind | | |
357 +-------------------------------------------------------------------+ | |
358 | |
359 PURPOSE : processes the L2R_DISC_IND primitive send by L2R. | |
360 | |
361 */ | |
362 | |
363 GLOBAL void psa_l2r_disc_ind (T_L2R_DISC_IND *l2r_disc_ind) | |
364 { | |
365 TRACE_FUNCTION ("psa_l2r_disc_ind()"); | |
366 | |
367 #if defined (FF_WAP) || defined (FF_SAT_E) | |
368 if (Wap_Call) | |
369 { | |
370 | |
371 /* | |
372 * Start terminate the whole PPP Stack if PPP activ | |
373 */ | |
374 if((pppShrdPrm.state EQ PPP_ESTABLISHED) OR (pppShrdPrm.state EQ PPP_ESTABLISH)) | |
375 cmhPPP_Terminate( DWN ); | |
376 } | |
377 else | |
378 #endif /* of WAP or SAT E */ | |
379 { | |
380 switch (l2rShrdPrm.state) | |
381 { | |
382 default: | |
383 { | |
384 cmhL2R_Failure(); | |
385 } | |
386 /*lint -fallthrough */ | |
387 case L2R_ENABLED: | |
388 { | |
389 T_DTI_CONN_LINK_ID link_id = dti_cntrl_get_link_id( DTI_ENTITY_L2R, DTI_INSTANCE_NOTPRESENT, DTI_SUB_NO_NOTPRESENT ); | |
390 dti_cntrl_set_dti_id_to_reconnect(EXTRACT_DTI_ID(link_id)); | |
391 dti_cntrl_entity_disconnected( link_id, DTI_ENTITY_L2R ); | |
392 } | |
393 /* NO BREAK ! */ | |
394 /*lint -fallthrough */ | |
395 case L2R_CONNECTED: | |
396 /* case L2R_DISABLE:*/ | |
397 { | |
398 PALLOC (l2r_deactivate_req, L2R_DEACTIVATE_REQ); | |
399 | |
400 l2rShrdPrm.state = L2R_DEACTIVATE; | |
401 | |
402 PSENDX (L2R, l2r_deactivate_req); | |
403 | |
404 break; | |
405 } | |
406 } | |
407 } | |
408 | |
409 PFREE (l2r_disc_ind); | |
410 } | |
411 | |
412 /* | |
413 +-------------------------------------------------------------------+ | |
414 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
415 | ROUTINE : psa_l2r_error_ind | | |
416 +-------------------------------------------------------------------+ | |
417 | |
418 PURPOSE : processes the L2R_ERROR_IND primitive send by L2R. | |
419 | |
420 */ | |
421 | |
422 GLOBAL void psa_l2r_error_ind (T_L2R_ERROR_IND *l2r_error_ind) | |
423 { | |
424 T_DTI_CONN_LINK_ID link_id; | |
425 | |
426 TRACE_FUNCTION ("psa_l2r_error_ind()"); | |
427 | |
428 #if defined (FF_WAP) || defined (FF_SAT_E) | |
429 | |
430 if (Wap_Call) | |
431 { | |
432 | |
433 /* | |
434 * Start terminate the whole PPP Stack if PPP have established call | |
435 * or by establish call. | |
436 */ | |
437 | |
438 if((pppShrdPrm.state EQ PPP_ESTABLISHED) OR (pppShrdPrm.state EQ PPP_ESTABLISH)) | |
439 cmhPPP_Terminate( DWN ); | |
440 | |
441 PFREE (l2r_error_ind); | |
442 return; | |
443 } | |
444 | |
445 #endif /* of WAP or SAT E */ | |
446 | |
447 | |
448 link_id = dti_cntrl_get_link_id( DTI_ENTITY_L2R, DTI_INSTANCE_NOTPRESENT, DTI_SUB_NO_NOTPRESENT ); | |
449 | |
450 if (dti_cntrl_is_dti_channel_connected (DTI_ENTITY_L2R, EXTRACT_DTI_ID(link_id)) EQ TRUE) | |
451 { | |
452 dti_cntrl_entity_disconnected( link_id, DTI_ENTITY_L2R ); | |
453 } | |
454 { | |
455 PALLOC (l2r_deactivate_req, L2R_DEACTIVATE_REQ); | |
456 | |
457 l2rShrdPrm.set_prm[l2rShrdPrm.owner].err_cause = l2r_error_ind->cause; | |
458 | |
459 l2rShrdPrm.state = L2R_DEACTIVATE; | |
460 | |
461 cmhL2R_Failure(); | |
462 | |
463 PSENDX (L2R, l2r_deactivate_req); | |
464 } | |
465 | |
466 PFREE (l2r_error_ind); | |
467 } | |
468 | |
469 /* | |
470 +-------------------------------------------------------------------+ | |
471 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
472 | ROUTINE : psa_l2r_reset_ind | | |
473 +-------------------------------------------------------------------+ | |
474 | |
475 PURPOSE : processes the L2R_RESET_IND primitive send by L2R. | |
476 | |
477 */ | |
478 | |
479 GLOBAL void psa_l2r_reset_ind (T_L2R_RESET_IND *l2r_reset_ind) | |
480 { | |
481 TRACE_FUNCTION ("psa_l2r_reset_ind()"); | |
482 | |
483 switch (l2rShrdPrm.state) | |
484 { | |
485 case L2R_CONNECTED: | |
486 case L2R_ENABLE: | |
487 case L2R_ENABLED: | |
488 /* case L2R_DISABLE:*/ | |
489 case L2R_ACTIVATE: | |
490 case L2R_CONNECT: | |
491 { | |
492 l2rShrdPrm.set_prm[l2rShrdPrm.owner].reset++; | |
493 | |
494 break; | |
495 } | |
496 /* | |
497 case L2R_ACTIVATE: | |
498 case L2R_CONNECT: | |
499 { | |
500 PALLOC (l2r_deactivate_req, L2R_DEACTIVATE_REQ); | |
501 | |
502 l2rShrdPrm.state = L2R_DEACTIVATE; | |
503 | |
504 cmhL2R_Failure(); | |
505 | |
506 PSENDX (L2R, l2r_deactivate_req); | |
507 | |
508 break; | |
509 } | |
510 */ | |
511 default: | |
512 { | |
513 cmhL2R_Failure(); | |
514 | |
515 break; | |
516 } | |
517 } | |
518 | |
519 PFREE (l2r_reset_ind); | |
520 } | |
521 | |
522 /* | |
523 +-------------------------------------------------------------------+ | |
524 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
525 | ROUTINE : psa_l2r_statistic_ind | | |
526 +-------------------------------------------------------------------+ | |
527 | |
528 PURPOSE : processes the L2R_STATISTIC_IND primitive send by L2R. | |
529 | |
530 */ | |
531 | |
532 GLOBAL void psa_l2r_statistic_ind | |
533 (T_L2R_STATISTIC_IND *l2r_statistic_ind) | |
534 { | |
535 TRACE_FUNCTION ("psa_l2r_statistic_ind()"); | |
536 | |
537 l2rShrdPrm.set_prm_use.error_rate = l2r_statistic_ind->error_rate; | |
538 | |
539 PFREE (l2r_statistic_ind); | |
540 } | |
541 | |
542 /* | |
543 +-------------------------------------------------------------------+ | |
544 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
545 | ROUTINE : psa_l2r_dti_cnf | | |
546 +-------------------------------------------------------------------+ | |
547 | |
548 PURPOSE : processes the L2R_DTI_CNF primitive send by L2R. | |
549 | |
550 */ | |
551 | |
552 GLOBAL void psa_l2r_dti_cnf (T_L2R_DTI_CNF *l2r_dti_cnf) | |
553 { | |
554 TRACE_FUNCTION ("psa_l2r_dti_cnf()"); | |
555 | |
556 /* store the current DTI id for the case of redirection */ | |
557 raShrdPrm.dti_id = EXTRACT_DTI_ID(l2r_dti_cnf->link_id); | |
558 | |
559 switch (l2rShrdPrm.state) | |
560 { | |
561 case L2R_ESCAPE: | |
562 { | |
563 if (l2r_dti_cnf->dti_conn NEQ l2rShrdPrm.uart_conn) | |
564 { | |
565 cmhL2R_Failure(); | |
566 } | |
567 l2rEntStat.isTempDisconnected = TRUE; | |
568 dti_cntrl_entity_disconnected( l2r_dti_cnf->link_id, DTI_ENTITY_L2R ); | |
569 | |
570 l2rShrdPrm.state = L2R_CONNECTED; | |
571 break; | |
572 } | |
573 | |
574 case L2R_ENABLE: | |
575 { | |
576 if (l2r_dti_cnf->dti_conn NEQ l2rShrdPrm.uart_conn) | |
577 { | |
578 PALLOC (l2r_disc_req, L2R_DISC_REQ); | |
579 | |
580 l2rShrdPrm.state = L2R_DISCONNECT; | |
581 | |
582 cmhL2R_Failure(); | |
583 | |
584 PSENDX (L2R, l2r_disc_req); | |
585 } | |
586 else | |
587 { | |
588 #if defined(FF_WAP) OR defined(FF_GPF_TCPIP) OR defined (FF_SAT_E) | |
589 T_ACI_WAP_STATES act_state = Wap_Not_Init; | |
590 if(is_gpf_tcpip_call()) { | |
591 GPF_TCPIP_STATEMENT(act_state = TCPIP_Activation); | |
592 } | |
593 else { | |
594 act_state = IPA_Activated; | |
595 } | |
596 #endif | |
597 l2rShrdPrm.state = L2R_ENABLED; | |
598 | |
599 #if defined(FF_WAP) OR defined(FF_GPF_TCPIP) OR defined (FF_SAT_E) OR defined (FF_PPP) | |
600 if ((Wap_Call AND (wap_state EQ act_state)) OR pppShrdPrm.is_PPP_CALL) | |
601 { | |
602 dti_cntrl_entity_connected( l2r_dti_cnf->link_id, DTI_ENTITY_L2R, DTI_OK ); | |
603 } | |
604 #ifdef FF_SAT_E | |
605 else if (psa_search_SATSrcId() >= 0)/* sat class c connection SIM-L2R */ | |
606 { | |
607 dti_cntrl_entity_connected( l2r_dti_cnf->link_id, DTI_ENTITY_L2R, DTI_OK ); | |
608 } | |
609 #endif /* FF_SAT_E */ | |
610 else | |
611 { | |
612 TRACE_EVENT(" error: wrong WAP state "); | |
613 } | |
614 #else /* WAP OR FF_GPF_TCPIP or SAT E */ | |
615 dti_cntrl_entity_connected( l2r_dti_cnf->link_id, DTI_ENTITY_L2R, DTI_OK ); | |
616 #endif /* of WAP OR FF_GPF_TCPIP or SAT E */ | |
617 } | |
618 | |
619 break; | |
620 } | |
621 | |
622 /* case L2R_DISABLE: | |
623 { | |
624 if (l2r_dti_cnf->dti_conn NEQ l2rShrdPrm.uart_conn) | |
625 { | |
626 PALLOC (l2r_disc_req, L2R_DISC_REQ); | |
627 | |
628 l2rShrdPrm.state = L2R_DISCONNECT; | |
629 | |
630 cmhL2R_Failure(); | |
631 | |
632 PSENDX (L2R, l2r_disc_req); | |
633 } | |
634 else | |
635 { | |
636 l2rShrdPrm.state = L2R_CONNECTED; | |
637 | |
638 cmhL2R_TRA_Disabled(); | |
639 } | |
640 | |
641 break; | |
642 }*/ | |
643 | |
644 case L2R_DETACH: | |
645 { | |
646 if (l2r_dti_cnf->dti_conn NEQ l2rShrdPrm.uart_conn) | |
647 { | |
648 cmhL2R_Failure(); | |
649 } | |
650 | |
651 { | |
652 PALLOC (l2r_deactivate_req, L2R_DEACTIVATE_REQ); | |
653 l2rShrdPrm.state = L2R_DEACTIVATE; | |
654 /* Set the flag to reconnect the registered device to ACI */ | |
655 dti_cntrl_set_dti_id_to_reconnect(EXTRACT_DTI_ID(l2r_dti_cnf->link_id)); | |
656 dti_cntrl_entity_disconnected( l2r_dti_cnf->link_id, DTI_ENTITY_L2R ); | |
657 PSENDX (L2R, l2r_deactivate_req); | |
658 } | |
659 | |
660 break; | |
661 } | |
662 | |
663 case L2R_DISCONNECT: | |
664 case L2R_DEACTIVATE: | |
665 { | |
666 break; | |
667 } | |
668 | |
669 default: | |
670 { | |
671 PALLOC (l2r_disc_req, L2R_DISC_REQ); | |
672 | |
673 l2rShrdPrm.state = L2R_DISCONNECT; | |
674 | |
675 cmhL2R_Failure(); | |
676 | |
677 PSENDX (L2R, l2r_disc_req); | |
678 | |
679 break; | |
680 } | |
681 } | |
682 | |
683 PFREE (l2r_dti_cnf); | |
684 } | |
685 | |
686 /* | |
687 +-------------------------------------------------------------------+ | |
688 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
689 | ROUTINE : psa_l2r_dti_ind | | |
690 +-------------------------------------------------------------------+ | |
691 | |
692 PURPOSE : processes the L2R_DTI_IND primitive send by L2R. | |
693 | |
694 */ | |
695 | |
696 GLOBAL void psa_l2r_dti_ind (T_L2R_DTI_IND *l2r_dti_ind) | |
697 { | |
698 TRACE_FUNCTION ("psa_l2r_dti_ind()"); | |
699 | |
700 /* store the current DTI id for the case of redirection */ | |
701 raShrdPrm.dti_id = EXTRACT_DTI_ID(l2r_dti_ind->link_id); | |
702 | |
703 switch (l2rShrdPrm.state) | |
704 { | |
705 case L2R_ENABLED: | |
706 { | |
707 l2rEntStat.isTempDisconnected = TRUE; | |
708 /* Set the flag to reconnect the registered device to ACI */ | |
709 dti_cntrl_set_dti_id_to_reconnect(EXTRACT_DTI_ID(l2r_dti_ind->link_id)); | |
710 dti_cntrl_entity_disconnected( l2r_dti_ind->link_id, DTI_ENTITY_L2R ); | |
711 | |
712 l2rShrdPrm.state = L2R_CONNECTED; | |
713 | |
714 break; | |
715 } | |
716 | |
717 case L2R_CONNECTED: | |
718 case L2R_ENABLE: | |
719 { | |
720 PALLOC (l2r_disc_req, L2R_DISC_REQ); | |
721 | |
722 l2rShrdPrm.state = L2R_DISCONNECT; | |
723 | |
724 cmhL2R_Failure(); | |
725 | |
726 PSENDX (L2R, l2r_disc_req); | |
727 | |
728 break; | |
729 } | |
730 | |
731 case L2R_ACTIVATE: | |
732 case L2R_CONNECT: | |
733 { | |
734 PALLOC (l2r_deactivate_req, L2R_DEACTIVATE_REQ); | |
735 | |
736 l2rShrdPrm.state = L2R_DEACTIVATE; | |
737 | |
738 cmhL2R_Failure(); | |
739 | |
740 PSENDX (L2R, l2r_deactivate_req); | |
741 | |
742 break; | |
743 } | |
744 | |
745 default: | |
746 { | |
747 cmhL2R_Failure(); | |
748 | |
749 break; | |
750 } | |
751 } | |
752 | |
753 PFREE (l2r_dti_ind); | |
754 } | |
755 | |
756 /* | |
757 +-------------------------------------------------------------------+ | |
758 | PROJECT : GSM-PS (6147) MODULE : PSA_L2R | | |
759 | ROUTINE : psa_l2r_xid_ind | | |
760 +-------------------------------------------------------------------+ | |
761 | |
762 PURPOSE : processes the L2R_XID_IND primitive send by L2R. | |
763 | |
764 */ | |
765 | |
766 GLOBAL void psa_l2r_xid_ind (T_L2R_XID_IND *l2r_xid_ind) | |
767 { | |
768 #define X l2rShrdPrm.set_prm_use | |
769 | |
770 TRACE_FUNCTION ("psa_l2r_xid_ind()"); | |
771 | |
772 X.rlp_vers = l2r_xid_ind->rlp_vers; | |
773 X.k_ms_iwf = l2r_xid_ind->k_ms_iwf; | |
774 X.k_iwf_ms = l2r_xid_ind->k_iwf_ms; | |
775 X.t1 = l2r_xid_ind->t1; | |
776 X.t2 = l2r_xid_ind->t2; | |
777 X.n2 = l2r_xid_ind->n2; | |
778 X.pt = l2r_xid_ind->pt; | |
779 X.p0 = l2r_xid_ind->p0; | |
780 X.p1 = l2r_xid_ind->p1; | |
781 X.p2 = l2r_xid_ind->p2; | |
782 | |
783 PFREE (l2r_xid_ind); | |
784 | |
785 #undef X | |
786 } | |
787 #endif /* DTI */ | |
788 | |
789 /*==== EOF =========================================================*/ | |
790 |