FreeCalypso > hg > leo2moko-debug
comparison g23m/condat/ms/src/aci/psa_tras.c @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : PSA_TRAS | |
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 #ifdef DTI | |
21 | |
22 #ifndef PSA_TRAS_C | |
23 #define PSA_TRAS_C | |
24 #endif | |
25 | |
26 #include "aci_all.h" | |
27 | |
28 /*==== INCLUDES ===================================================*/ | |
29 #include "aci_cmh.h" | |
30 #include "ati_cmd.h" | |
31 #include "aci_cmd.h" | |
32 | |
33 #include "dti.h" | |
34 #include "dti_conn_mng.h" | |
35 #include "dti_cntrl_mng.h" | |
36 | |
37 #include "aci.h" | |
38 #include "psa.h" | |
39 #include "cmh.h" | |
40 #include "aci_fd.h" | |
41 #include "cmh_ra.h" | |
42 #include "psa_l2r.h" | |
43 #include "dti_conn_mng.h" | |
44 #include "cmh_l2r.h" | |
45 #include "psa_uart.h" | |
46 | |
47 #include "psa_util.h" | |
48 #include "psa_tra.h" | |
49 | |
50 /*==== CONSTANTS ==================================================*/ | |
51 | |
52 | |
53 /*==== TYPES ======================================================*/ | |
54 | |
55 | |
56 /*==== EXPORT =====================================================*/ | |
57 | |
58 | |
59 /*==== VARIABLES ==================================================*/ | |
60 | |
61 | |
62 /*==== FUNCTIONS ==================================================*/ | |
63 | |
64 /* | |
65 +-------------------------------------------------------------------+ | |
66 | PROJECT : GSM-PS (6147) MODULE : PSA_TRA | | |
67 | ROUTINE : psaTRA_Activate | | |
68 +-------------------------------------------------------------------+ | |
69 | |
70 PURPOSE : | |
71 | |
72 */ | |
73 | |
74 GLOBAL void psaTRA_Activate (void) | |
75 { | |
76 TRACE_FUNCTION ("psaTRA_Activate()"); | |
77 TRA_is_activated = FALSE; | |
78 { | |
79 PALLOC (tra_activate_req, TRA_ACTIVATE_REQ); | |
80 PSENDX (TRA, tra_activate_req); | |
81 } | |
82 } | |
83 | |
84 /* | |
85 +-------------------------------------------------------------------+ | |
86 | PROJECT : GSM-PS (6147) MODULE : PSA_TRA | | |
87 | ROUTINE : psaTRA_Dti_Req | | |
88 +-------------------------------------------------------------------+ | |
89 | |
90 PURPOSE : connect or disconnect TRA (depends on dti_conn). | |
91 | |
92 */ | |
93 | |
94 GLOBAL void psaTRA_Dti_Req (T_DTI_CONN_LINK_ID link_id, UBYTE dti_conn, UBYTE peer) | |
95 { | |
96 T_DTI_ENTITY_ID peer_unit_id; | |
97 UBYTE dti_id = EXTRACT_DTI_ID( link_id ); | |
98 | |
99 TRACE_FUNCTION ("psaTRA_Dti_Req()"); | |
100 | |
101 { | |
102 PALLOC (tra_dti_req, TRA_DTI_REQ); | |
103 | |
104 tra_dti_req->dti_conn = dti_conn; | |
105 tra_dti_req->link_id = link_id; | |
106 | |
107 if (IS_SRC_BT(dti_id)) | |
108 { | |
109 TRACE_EVENT("psa_tras - BT_ADAPTER Act"); | |
110 strcpy((CHAR*)tra_dti_req->entity_name, BTI_NAME); | |
111 tra_dti_req->dti_direction = DTI_CHANNEL_TO_HIGHER_LAYER; | |
112 peer_unit_id = DTI_ENTITY_BLUETOOTH; | |
113 } | |
114 #ifdef FF_SAT_E | |
115 else if (peer EQ DTI_ENTITY_SIM) | |
116 { | |
117 strcpy((CHAR*)tra_dti_req->entity_name, SIM_NAME); | |
118 tra_dti_req->dti_direction = DTI_CHANNEL_TO_HIGHER_LAYER; | |
119 peer_unit_id = DTI_ENTITY_SIM; | |
120 } | |
121 #endif /* FF_SAT_E */ | |
122 else if (peer EQ DTI_ENTITY_UART) | |
123 { | |
124 strcpy((CHAR*)tra_dti_req->entity_name, UART_NAME); | |
125 tra_dti_req->dti_direction = DTI_CHANNEL_TO_LOWER_LAYER; | |
126 peer_unit_id = DTI_ENTITY_UART; | |
127 } | |
128 else | |
129 { | |
130 strcpy((CHAR*)tra_dti_req->entity_name, PSI_NAME); | |
131 tra_dti_req->dti_direction = DTI_CHANNEL_TO_LOWER_LAYER; | |
132 peer_unit_id = DTI_ENTITY_PSI; | |
133 } | |
134 if (dti_conn EQ TRA_CONNECT_DTI) | |
135 { | |
136 if (dti_cntrl_set_conn_parms(link_id, DTI_ENTITY_TRA, DTI_INSTANCE_NOTPRESENT, DTI_SUB_NO_NOTPRESENT) EQ FALSE) | |
137 { | |
138 return; | |
139 } | |
140 } | |
141 | |
142 PSENDX (TRA, tra_dti_req); | |
143 } | |
144 } | |
145 | |
146 | |
147 /* | |
148 +-------------------------------------------------------------------+ | |
149 | PROJECT : GSM-PS (6147) MODULE : PSA_TRA | | |
150 | ROUTINE : psaTRA_Deactivate | | |
151 +-------------------------------------------------------------------+ | |
152 | |
153 PURPOSE : | |
154 | |
155 */ | |
156 | |
157 GLOBAL void psaTRA_Deactivate (void) | |
158 { | |
159 TRACE_FUNCTION ("psaTRA_Deactivate()"); | |
160 | |
161 if (TRA_is_activated EQ FALSE) | |
162 return; | |
163 else | |
164 TRA_is_activated = FALSE; | |
165 | |
166 { | |
167 PALLOC (tra_deactivate_req, TRA_DEACTIVATE_REQ); | |
168 PSENDX (TRA, tra_deactivate_req); | |
169 } | |
170 } | |
171 #endif /* DTI */ |