comparison g23m-aci/aci/cmh_emq.c @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
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 provides the query functions related to the
18 | SAP for engineering mode.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef ACI_EM_C
23 #define ACI_EM_C
24 #endif
25
26 #include "config.h"
27 #include "fixedconf.h"
28 #include "condat-features.h"
29 #include "aci_conf.h"
30
31 #include "aci_all.h"
32 /*===== INCLUDES ===================================================*/
33 #include "aci_cmh.h"
34 #include "ati_cmd.h"
35 #include "aci_io.h"
36
37 #include "psa.h"
38 #ifdef FAX_AND_DATA
39 #include "aci_fd.h"
40 #endif
41 #include "cmh.h"
42 #include "aci_em.h"
43 #include "cmh_em.h"
44
45
46 /*==== EXPORT =====================================================*/
47 /*
48 EXTERN UBYTE em_subclass_sc (UBYTE em_type);
49 EXTERN UBYTE em_subclass_sc_gprs (UBYTE em_type);
50 EXTERN UBYTE em_subclass_nc (UBYTE em_type);
51 EXTERN UBYTE em_subclass_loc_pag (UBYTE em_type);
52 EXTERN UBYTE em_subclass_plmn (UBYTE em_type);
53 EXTERN UBYTE em_subclass_ciph_hop_dtx (UBYTE em_type);
54 EXTERN UBYTE em_subclass_power (UBYTE em_type);
55 EXTERN UBYTE em_subclass_id (UBYTE em_type);
56 EXTERN UBYTE em_subclass_version (UBYTE em_type); */
57 EXTERN void cmhEM (T_EM_VAL * val_tmp);
58 EXTERN void cmhEMET (T_DRV_SIGNAL_EM_EVENT * Signal);
59
60 /*==== VARIABLES ==================================================*/
61
62 GLOBAL T_EM_SHRD_PRM emPrm;
63 GLOBAL T_EM_SHRD_PRM emetPrm;
64 GLOBAL T_EM_SHRD_PRM emetsPrm;
65
66 /*==== CONSTANTS ==================================================*/
67
68 /*==== FUNCTIONS ==================================================*/
69
70 LOCAL void em_at_cbfkt(T_DRV_SIGNAL_EM * Signal)
71 {
72 T_EM_VAL val_tmp;
73
74 TRACE_FUNCTION ("em_at_cbfkt()");
75
76 memset(&val_tmp, 0x00, sizeof(T_EM_VAL));
77
78 val_tmp.em_utype = Signal->SignalType;
79 switch (Signal->SignalType)
80 {
81 case EM_SUBCLASS_SC:
82 memcpy(&val_tmp.em_u.em_sc_val, &Signal->UserData.sc, sizeof(T_EM_SC_INFO_CNF));
83 break;
84 case EM_SUBCLASS_SC_GPRS:
85 memcpy(&val_tmp.em_u.em_sc_gprs_val, &Signal->UserData.sc_gprs, sizeof(T_EM_SC_GPRS_INFO_CNF));
86 break;
87 case EM_SUBCLASS_NC:
88 memcpy(&val_tmp.em_u.em_nc_val, &Signal->UserData.nc, sizeof(T_EM_NC_INFO_CNF));
89 break;
90 case EM_SUBCLASS_LOC_PAG:
91 memcpy(&val_tmp.em_u.em_loc_val, &Signal->UserData.log_pag, sizeof(T_EM_LOC_PAG_INFO_CNF));
92 break;
93 case EM_SUBCLASS_PLMN:
94 memcpy(&val_tmp.em_u.em_plmn_val, &Signal->UserData.plmn, sizeof(T_EM_PLMN_INFO_CNF));
95 break;
96 case EM_SUBCLASS_CIPH_HOP_DTX:
97 memcpy(&val_tmp.em_u.em_cip_val, &Signal->UserData.cip, sizeof(T_EM_CIP_HOP_DTX_INFO_CNF));
98 break;
99 case EM_SUBCLASS_POWER:
100 memcpy(&val_tmp.em_u.em_power_val, &Signal->UserData.power, sizeof(T_EM_POWER_INFO_CNF));
101 break;
102 case EM_SUBCLASS_ID:
103 memcpy(&val_tmp.em_u.em_id_val, &Signal->UserData.id, sizeof(T_EM_IDENTITY_INFO_CNF));
104 break;
105 case EM_SUBCLASS_SW_VERSION:
106 memcpy(&val_tmp.em_u.em_ver_val, &Signal->UserData.version, sizeof(T_EM_SW_VER));
107 break;
108 case EM_SUBCLASS_GMM:
109 memcpy(&val_tmp.em_u.em_gmm_val, &Signal->UserData.gmm, sizeof(T_EM_GMM_INFO_CNF));
110 break;
111 case EM_SUBCLASS_GRLC:
112 memcpy(&val_tmp.em_u.em_grlc_val, &Signal->UserData.grlc, sizeof(T_EM_GRLC_INFO_CNF));
113 break;
114 case EM_SUBCLASS_AMR:
115 memcpy(&val_tmp.em_u.em_amr_val, &Signal->UserData.amr, sizeof(T_EM_AMR_INFO_CNF));
116 break;
117 case EM_SUBCLASS_PDP:
118 break;
119 default:
120 break;
121 }
122
123 cmhEM( &val_tmp );
124 }
125
126 LOCAL void em_event_at_cbfkt(T_DRV_SIGNAL_EM_EVENT * Signal)
127 {
128 /*
129 * Copy the data in an internal variable
130 */
131 T_DRV_SIGNAL_EM_EVENT Signal_tmp;
132
133 memcpy(&Signal_tmp, Signal, sizeof(T_DRV_SIGNAL_EM_EVENT));
134
135 cmhEMET (&Signal_tmp);
136 }
137
138
139 GLOBAL T_ACI_RETURN sAT_PercentEM ( T_ACI_CMD_SRC srcId,
140 T_EM_AT_MODE mode,
141 T_EM_AT_TYPE type)
142 {
143 UBYTE em_class = 0;
144 UBYTE em_subclass = 0;
145 UBYTE em_type = mode;
146
147 TRACE_FUNCTION ("sAT_PercentEM ()");
148
149 /*
150 *-------------------------------------------------------------------
151 * check command source
152 *-------------------------------------------------------------------
153 */
154 if(!cmh_IsVldCmdSrc (srcId))
155 {
156 return( AT_FAIL );
157 }
158 emPrm.srcId = srcId;
159
160 if(mode EQ PCO_REP) /*request EM data as trace output*/
161 {
162 em_subclass_pco_bitmap(type); /*function to send EM_PCO_TRACE_REQ to RR (and GMM) */
163 return AT_CMPL;
164 }
165
166 switch(type)
167 {
168 case EM_AT_SC:
169 em_class = EM_CLASS_INFRA_DATA;
170 em_subclass = EM_SUBCLASS_SC;
171 break;
172 #ifdef GPRS
173 case EM_AT_SC_GPRS:
174 em_class = EM_CLASS_INFRA_DATA;
175 em_subclass = EM_SUBCLASS_SC_GPRS;
176 break;
177 #endif /* GPRS */
178 case EM_AT_NC:
179 em_class = EM_CLASS_INFRA_DATA;
180 em_subclass = EM_SUBCLASS_NC;
181 break;
182 case EM_AT_LOC_PAG:
183 em_class = EM_CLASS_INFRA_DATA;
184 em_subclass = EM_SUBCLASS_LOC_PAG;
185 break;
186 case EM_AT_PLMN:
187 em_class = EM_CLASS_INFRA_DATA;
188 em_subclass = EM_SUBCLASS_PLMN;
189 break;
190 case EM_AT_CIPH_HOP_DTX:
191 em_class = EM_CLASS_INFRA_DATA;
192 em_subclass = EM_SUBCLASS_CIPH_HOP_DTX;
193 break;
194 case EM_AT_POWER:
195 em_class = EM_CLASS_MOBILE_DATA;
196 em_subclass = EM_SUBCLASS_POWER;
197 break;
198 case EM_AT_ID:
199 em_class = EM_CLASS_MOBILE_DATA;
200 em_subclass = EM_SUBCLASS_ID;
201 break;
202 case EM_AT_VER:
203 em_class = EM_CLASS_MOBILE_DATA;
204 em_subclass = EM_SUBCLASS_SW_VERSION;
205 break;
206 #ifdef GPRS
207 case EM_AT_GMM:
208 em_class = EM_CLASS_INFRA_DATA;
209 em_subclass = EM_SUBCLASS_GMM;
210 break;
211 case EM_AT_GRLC:
212 em_class = EM_CLASS_INFRA_DATA;
213 em_subclass = EM_SUBCLASS_GRLC;
214 break;
215 #endif /* GPRS */
216 case EM_AT_AMR:
217 em_class = EM_CLASS_INFRA_DATA;
218 em_subclass = EM_SUBCLASS_AMR;
219 break;
220 #ifdef GPRS
221 case EM_AT_PDP:
222 em_class = EM_CLASS_INFRA_DATA;
223 em_subclass = EM_SUBCLASS_PDP;
224 break;
225 #endif
226 default:
227 return AT_FAIL;
228 } /* switch */
229
230 em_Read_Data_Parameter( em_class, em_subclass, em_type, em_at_cbfkt );
231
232 if(em_subclass == EM_SUBCLASS_PDP)
233 return AT_CMPL;
234
235 return AT_EXCT;
236
237 } /* sAT_PercentEM */
238
239 GLOBAL T_ACI_RETURN sAT_PercentEMET( T_ACI_CMD_SRC srcId,
240 UBYTE type)
241 {
242
243 TRACE_FUNCTION ("sAT_PercentEMET ()");
244
245 /*
246 *-------------------------------------------------------------------
247 * check command source
248 *-------------------------------------------------------------------
249 */
250 if(!cmh_IsVldCmdSrc (srcId))
251 {
252 return( AT_FAIL );
253 }
254 emetPrm.srcId = srcId;
255 em_Read_Event_Parameter (type, em_event_at_cbfkt);
256
257 return AT_CMPL;
258 } /* sAT_PercentEMET */
259
260 GLOBAL T_ACI_RETURN sAT_PercentEMETS( T_ACI_CMD_SRC srcId, UBYTE subclass,
261 ULONG bitm_h, ULONG bitm_l )
262 {
263
264 TRACE_FUNCTION ("sAT_PercentEMETS ()");
265
266 /*
267 *-------------------------------------------------------------------
268 * check command source
269 *-------------------------------------------------------------------
270 */
271 if(!cmh_IsVldCmdSrc (srcId))
272 {
273 return( AT_FAIL );
274 }
275 emetsPrm.srcId = srcId;
276
277 em_Set_EventTrace (subclass, bitm_h, bitm_l);
278
279 return AT_CMPL;
280 } /* sAT_PercentEMETS */
281
282
283
284 /*+++++++++++++++++++++++++++++++++++++++++ E O F +++++++++++++++++++++++++++++++++++++++++*/
285
286