FreeCalypso > hg > fc-tourmaline
comparison src/g23m-aci/aci/psa_tras.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_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 #ifdef TI_PS_HCOMM_CHANGE | |
81 PSEND (hCommTRA, tra_activate_req); | |
82 #else | |
83 PSENDX (TRA, tra_activate_req); | |
84 #endif | |
85 } | |
86 } | |
87 | |
88 /* | |
89 +-------------------------------------------------------------------+ | |
90 | PROJECT : GSM-PS (6147) MODULE : PSA_TRA | | |
91 | ROUTINE : psaTRA_Dti_Req | | |
92 +-------------------------------------------------------------------+ | |
93 | |
94 PURPOSE : connect or disconnect TRA (depends on dti_conn). | |
95 | |
96 */ | |
97 | |
98 GLOBAL void psaTRA_Dti_Req (T_DTI_CONN_LINK_ID link_id, UBYTE dti_conn, UBYTE peer) | |
99 { | |
100 | |
101 UBYTE dti_id = EXTRACT_DTI_ID( link_id ); | |
102 | |
103 TRACE_FUNCTION ("psaTRA_Dti_Req()"); | |
104 | |
105 { | |
106 PALLOC (tra_dti_req, TRA_DTI_REQ); | |
107 | |
108 tra_dti_req->dti_conn = dti_conn; | |
109 tra_dti_req->link_id = link_id; | |
110 | |
111 if (IS_SRC_BT(dti_id)) | |
112 { | |
113 TRACE_EVENT("psa_tras - BT_ADAPTER Act"); | |
114 strcpy((CHAR*)tra_dti_req->entity_name, BTI_NAME); | |
115 tra_dti_req->dti_direction = DTI_CHANNEL_TO_HIGHER_LAYER; | |
116 } | |
117 #ifdef FF_SAT_E | |
118 else if (peer EQ DTI_ENTITY_SIM) | |
119 { | |
120 strcpy((CHAR*)tra_dti_req->entity_name, SIM_NAME); | |
121 tra_dti_req->dti_direction = DTI_CHANNEL_TO_HIGHER_LAYER; | |
122 } | |
123 #endif /* FF_SAT_E */ | |
124 else if (peer EQ DTI_ENTITY_UART) | |
125 { | |
126 strcpy((CHAR*)tra_dti_req->entity_name, UART_NAME); | |
127 tra_dti_req->dti_direction = DTI_CHANNEL_TO_LOWER_LAYER; | |
128 } | |
129 else | |
130 { | |
131 strcpy((CHAR*)tra_dti_req->entity_name, PSI_NAME); | |
132 tra_dti_req->dti_direction = DTI_CHANNEL_TO_LOWER_LAYER; | |
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 #ifdef TI_PS_HCOMM_CHANGE | |
143 PSEND (hCommTRA, tra_dti_req); | |
144 #else | |
145 PSENDX (TRA, tra_dti_req); | |
146 #endif | |
147 } | |
148 } | |
149 | |
150 | |
151 /* | |
152 +-------------------------------------------------------------------+ | |
153 | PROJECT : GSM-PS (6147) MODULE : PSA_TRA | | |
154 | ROUTINE : psaTRA_Deactivate | | |
155 +-------------------------------------------------------------------+ | |
156 | |
157 PURPOSE : | |
158 | |
159 */ | |
160 | |
161 GLOBAL void psaTRA_Deactivate (void) | |
162 { | |
163 TRACE_FUNCTION ("psaTRA_Deactivate()"); | |
164 | |
165 if (TRA_is_activated EQ FALSE) | |
166 return; | |
167 else | |
168 TRA_is_activated = FALSE; | |
169 | |
170 { | |
171 PALLOC (tra_deactivate_req, TRA_DEACTIVATE_REQ); | |
172 #ifdef TI_PS_HCOMM_CHANGE | |
173 PSEND (hCommTRA, tra_deactivate_req); | |
174 #else | |
175 PSENDX (TRA, tra_deactivate_req); | |
176 #endif | |
177 } | |
178 } | |
179 #endif /* DTI */ |