FreeCalypso > hg > fc-selenite
comparison src/g23m-gsm/rr/rr_em.c @ 1:d393cd9bb723
src/g23m-*: initial import from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 15 Jul 2018 04:40:46 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:b6a5e36de839 | 1:d393cd9bb723 |
---|---|
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 defines the engineering mode (EM) device driver for the | |
18 | G23 protocol stack. This driver is used to control all engineering | |
19 | mode related functions. | |
20 +----------------------------------------------------------------------------- | |
21 */ | |
22 | |
23 #ifndef RR_EM_C | |
24 #define RR_EM_C | |
25 | |
26 #define ENTITY_RR | |
27 | |
28 /*==== INCLUDES ===================================================*/ | |
29 | |
30 #include <string.h> | |
31 #include <stdlib.h> | |
32 #include <stddef.h> /* offsetof */ | |
33 #include <stdio.h> /* sprintf */ | |
34 #include "typedefs.h" | |
35 #include "pcm.h" | |
36 #include "pconst.cdg" | |
37 #include "mconst.cdg" | |
38 #include "message.h" | |
39 #include "ccdapi.h" | |
40 #include "vsi.h" | |
41 #include "custom.h" | |
42 #include "gsm.h" | |
43 #include "prim.h" | |
44 #include "cnf_rr.h" | |
45 #include "tok.h" | |
46 #include "rr.h" | |
47 #include "rr_em.h" | |
48 | |
49 /*==== EXPORT =====================================================*/ | |
50 | |
51 /*==== VARIABLES ==================================================*/ | |
52 | |
53 #ifdef FF_EM_MODE | |
54 | |
55 /* | |
56 These variables are used between entities. Even this is not a clean solution it is a straigth forward | |
57 way to reduce the overhead to a minimum. A clean solution would be based on an only usage of primitives | |
58 which would stress the os with no aditional advantage!! | |
59 */ | |
60 /* these are accessed by ACI */ | |
61 GLOBAL UBYTE em_rr_sem_buffer [EM_RR_SEM_SIZE]; /*lint -esym(552,em_rr_sem_buffer) -esym(765,em_rr_sem_buffer ) */ | |
62 GLOBAL UBYTE em_rr_sem_index; /*lint -esym(765,em_rr_sem_index)*/ | |
63 GLOBAL UBYTE em_act_dlt = 0; /*lint -esym(765,em_act_dlt) | used by ALR */ | |
64 GLOBAL UBYTE em_act_rlt = 0; /*lint -esym(765,em_act_rlt) | used by ALR */ | |
65 | |
66 static USHORT ma [MAX_MA_CHANNELS]; /* MA list after starting time */ | |
67 static USHORT ma2[MAX_MA_CHANNELS]; /* MA list before starting time if available */ | |
68 static UBYTE v_start=0; /* starting time valid */ | |
69 static UBYTE maio2=0; | |
70 | |
71 static T_HANDLE sem_EM_RR; | |
72 static UBYTE em_rr_trace_occured; | |
73 | |
74 | |
75 /* Event tracing flags for EM */ | |
76 GLOBAL BOOL rr_v[EM_MAX_RR_EVENTS]; | |
77 GLOBAL USHORT em_assign_fail_rr_cause; | |
78 GLOBAL USHORT em_handover_fail_rr_cause; | |
79 | |
80 LOCAL void em_rr_sem_clear (void); | |
81 LOCAL void rr_em_first_event_check(void); | |
82 | |
83 #endif /* FF_EM_MODE */ | |
84 | |
85 /*==== FUNCTIONS ==================================================*/ | |
86 #ifdef FF_EM_MODE | |
87 | |
88 | |
89 /* | |
90 +------------------------------------------------------------------------------ | |
91 | Function : dat_em_get_hchn | |
92 +------------------------------------------------------------------------------ | |
93 | Description : This function stores the hopping channels after change occured. | |
94 | | |
95 | Parameters : channel_array - channel mode 1 | |
96 | channel2_array - channel mode 2 | |
97 | start - valid flag for channel mode2 | |
98 | maio_2 - MAIO for before time configuration | |
99 | | |
100 | Return : void | |
101 +------------------------------------------------------------------------------ | |
102 */ | |
103 | |
104 GLOBAL void dat_em_get_hchn (USHORT* channel_array, USHORT* channel2_array, UBYTE start,UBYTE maio_2) | |
105 { | |
106 TRACE_FUNCTION ("dat_em_get_hchn()"); | |
107 | |
108 memset(ma, 0, 65); | |
109 memset(ma2, 0, 65); | |
110 memcpy(ma, channel_array, 65); | |
111 v_start = start; | |
112 if (v_start) { | |
113 maio2 = maio_2; | |
114 memcpy(ma2, channel2_array, 65); } | |
115 } | |
116 /* | |
117 +------------------------------------------------------------------------------ | |
118 | Function : em_init_get_hchn | |
119 +------------------------------------------------------------------------------ | |
120 | Description : initiates the hopping list. This is necessary, because a request | |
121 | of the hopping list immideatly after switch on causes a reset. | |
122 | | |
123 | Return : void | |
124 +------------------------------------------------------------------------------ | |
125 */ | |
126 | |
127 GLOBAL void em_init_get_hchn () | |
128 { | |
129 TRACE_FUNCTION ("em_init_get_hchn()"); | |
130 | |
131 ma[0] = NOT_PRESENT_16BIT; | |
132 ma2[0] = NOT_PRESENT_16BIT; | |
133 } | |
134 | |
135 /* | |
136 +------------------------------------------------------------------------------ | |
137 | Function : em_get_first_codec | |
138 +------------------------------------------------------------------------------ | |
139 | Description : Returns the highest bit rate AMR codec mode | |
140 | | |
141 | Parameters : acs - Active codec set | |
142 | | |
143 | Return : void | |
144 +------------------------------------------------------------------------------ | |
145 */ | |
146 | |
147 GLOBAL UBYTE em_get_first_codec(UBYTE acs) | |
148 { | |
149 UBYTE i; | |
150 | |
151 /* Find Highest bit rate codec mode from ACS */ | |
152 for(i=0;i<8;i++) | |
153 { | |
154 if((0x80>>i) & acs ) | |
155 break; | |
156 } | |
157 | |
158 /* First codec( Highest bit rate codec mode) */ | |
159 return (EM_AMR_MODE_12_2-i); | |
160 } | |
161 | |
162 /* | |
163 +------------------------------------------------------------------------------ | |
164 | Function : dat_em_sc_info_req | |
165 +------------------------------------------------------------------------------ | |
166 | Description : Process the primitive EM_SC_INFO_REQ. | |
167 | | |
168 | Parameters : Primitive from EM - T_EM_SC_INFO_REQ | |
169 | | |
170 | Return : void | |
171 +------------------------------------------------------------------------------ | |
172 */ | |
173 GLOBAL void dat_em_sc_info_req (T_EM_SC_INFO_REQ *em_sc_info_req) | |
174 { | |
175 GET_INSTANCE_DATA; | |
176 PALLOC(em_sc_info_cnf, EM_SC_INFO_CNF); | |
177 memset (em_sc_info_cnf, 0, sizeof (T_EM_SC_INFO_CNF)); | |
178 | |
179 PFREE(em_sc_info_req); | |
180 TRACE_FUNCTION ("dat_em_sc_info_req()"); | |
181 | |
182 em_sc_info_cnf->vocoder = EM_VOC_NA; | |
183 | |
184 switch (GET_STATE (STATE_ATT)) | |
185 { | |
186 case ATT_IDLE: | |
187 if (rr_data->nc_data[SC_INDEX].bcch_status EQ DECODED) | |
188 { | |
189 em_sc_info_cnf->arfcn = rr_data->nc_data[SC_INDEX].arfcn; | |
190 em_sc_info_cnf->c1 = rr_data->nc_data[SC_INDEX].c1; | |
191 em_sc_info_cnf->c2 = rr_data->nc_data[SC_INDEX].c2; | |
192 em_sc_info_cnf->rxlev = rr_data->nc_data[SC_INDEX].rxlev; | |
193 em_sc_info_cnf->bsic = rr_data->nc_data[SC_INDEX].bsic; | |
194 em_sc_info_cnf->dsc = em_act_dlt; | |
195 em_sc_info_cnf->txlev = rr_data->sc_data.cd.cell_options.pow_ctrl; | |
196 em_sc_info_cnf->tn = rr_data->sc_data.chan_desc.tn; | |
197 em_sc_info_cnf->lac = rr_data->nc_data[SC_INDEX].lai.lac; | |
198 em_sc_info_cnf->cba = rr_data->nc_data[SC_INDEX].rach.cell_bar_access; | |
199 em_sc_info_cnf->cbq = rr_data->nc_data[SC_INDEX].c2_par.cbq; | |
200 em_sc_info_cnf->cell_id = rr_data->nc_data[SC_INDEX].cell_id; | |
201 em_sc_info_cnf->cell_type_ind = EM_CELL_GSM; | |
202 #ifdef GPRS | |
203 if(rr_data->nc_data[SC_INDEX].rac NEQ NOT_PRESENT_8BIT) | |
204 em_sc_info_cnf->cell_type_ind = EM_CELL_GPRS; | |
205 #endif | |
206 } | |
207 else if (rr_data->nc_data[SC_INDEX].bcch_status EQ NON_DECODED) | |
208 { | |
209 em_sc_info_cnf->arfcn = rr_data->nc_data[SC_INDEX].arfcn; | |
210 em_sc_info_cnf->rxlev = rr_data->nc_data[SC_INDEX].rxlev; | |
211 em_sc_info_cnf->bsic = rr_data->nc_data[SC_INDEX].bsic; | |
212 } | |
213 break; | |
214 | |
215 case ATT_DEDICATED: | |
216 if (!rr_data->ms_data.measurement_report.valid) | |
217 break; | |
218 | |
219 em_sc_info_cnf->arfcn = rr_data->ms_data.measurement_report.arfcn; | |
220 em_sc_info_cnf->bsic = rr_data->nc_data[SC_INDEX].bsic; | |
221 em_sc_info_cnf->txlev = rr_data->sc_data.cd.cell_options.pow_ctrl; | |
222 em_sc_info_cnf->tn = rr_data->sc_data.chan_desc.tn; | |
223 em_sc_info_cnf->lac = rr_data->nc_data[SC_INDEX].lai.lac; | |
224 em_sc_info_cnf->cell_id = rr_data->nc_data[SC_INDEX].cell_id; | |
225 em_sc_info_cnf->rxlev_f = rr_data->ms_data.measurement_report.rx_lev_full; | |
226 em_sc_info_cnf->rxlev_s = rr_data->ms_data.measurement_report.rx_lev_sub; | |
227 em_sc_info_cnf->rlt = em_act_rlt; | |
228 em_sc_info_cnf->tav = rr_data->sc_data.new_ta; | |
229 em_sc_info_cnf->rxqual_f = rr_data->ms_data.measurement_report.rx_qual_full; | |
230 em_sc_info_cnf->rxqual_s = rr_data->ms_data.measurement_report.rx_qual_sub; | |
231 em_sc_info_cnf->vocoder = rr_data->sc_data.ch_mode; | |
232 if (rr_data->nc_data[SC_INDEX].bcch_status EQ DECODED) | |
233 { | |
234 em_sc_info_cnf->cell_type_ind = EM_CELL_GSM; | |
235 #ifdef GPRS | |
236 if(rr_data->nc_data[SC_INDEX].rac NEQ NOT_PRESENT_8BIT) | |
237 em_sc_info_cnf->cell_type_ind = EM_CELL_GPRS; | |
238 #endif | |
239 } | |
240 break; | |
241 | |
242 default: | |
243 break; | |
244 }/*switch*/ | |
245 PSENDX(MMI, em_sc_info_cnf); | |
246 } /*dat_em_sc_info_req*/ | |
247 | |
248 /* | |
249 +------------------------------------------------------------------------------ | |
250 | Function : dat_em_nc_info_req | |
251 +------------------------------------------------------------------------------ | |
252 | Description : Process the primitive EM_NC_INFO_REQ. | |
253 | | |
254 | Parameters : Primitive from EM - T_EM_NC_INFO_REQ | |
255 | | |
256 | Return : void | |
257 +------------------------------------------------------------------------------ | |
258 */ | |
259 GLOBAL void dat_em_nc_info_req (T_EM_NC_INFO_REQ *em_nc_info_req) | |
260 { | |
261 GET_INSTANCE_DATA; | |
262 UBYTE index = 0; | |
263 UBYTE index2 = 0; | |
264 PALLOC(em_nc_info_cnf, EM_NC_INFO_CNF); | |
265 memset (em_nc_info_cnf, 0, sizeof (T_EM_NC_INFO_CNF)); | |
266 memset (em_nc_info_cnf->rac, 0xff, EM_MAX_NUM_NC); | |
267 | |
268 PFREE(em_nc_info_req); | |
269 TRACE_FUNCTION ("dat_em_nc_info_req()"); | |
270 | |
271 switch (GET_STATE (STATE_ATT)) | |
272 { | |
273 case ATT_IDLE: | |
274 for (index = 0 , index2 = 0 ; index < EM_MAX_NUM_NC ; index++) | |
275 { | |
276 if (rr_data->nc_data[index].bcch_status EQ DECODED) | |
277 { | |
278 em_nc_info_cnf->arfcn_nc[index2] = rr_data->nc_data[index].arfcn; | |
279 em_nc_info_cnf->c1_nc[index2] = rr_data->nc_data[index].c1; | |
280 em_nc_info_cnf->c2_nc[index2] = rr_data->nc_data[index].c2; | |
281 em_nc_info_cnf->rxlev_nc[index2] = rr_data->nc_data[index].rxlev; | |
282 em_nc_info_cnf->bsic_nc[index2] = rr_data->nc_data[index].bsic; | |
283 em_nc_info_cnf->cell_id_nc[index2] = rr_data->nc_data[index].cell_id; | |
284 em_nc_info_cnf->lac_nc[index2] = rr_data->nc_data[index].lai.lac; | |
285 em_nc_info_cnf->frame_offset[index2] = rr_data->ms_data.measurement_report.ncells.frame_offset[index]; | |
286 em_nc_info_cnf->time_alignmt[index2] = rr_data->ms_data.measurement_report.ncells.time_alignmt[index]; | |
287 em_nc_info_cnf->cba_nc[index2] = rr_data->nc_data[index].rach.cell_bar_access; | |
288 em_nc_info_cnf->cbq_nc[index2] = rr_data->nc_data[index].c2_par.cbq; | |
289 em_nc_info_cnf->cell_type_ind[index2] = EM_CELL_GSM; | |
290 #ifdef GPRS | |
291 em_nc_info_cnf->rac[index2] = rr_data->nc_data[index].rac; | |
292 | |
293 /* rac in nc_data is set only when v_gprs_ind is present in SI3/SI4 rest | |
294 octets. Since v_gprs_ind is not stored,rac is used to check gprs | |
295 support in the cell */ | |
296 if(em_nc_info_cnf->rac[index2] NEQ NOT_PRESENT_8BIT) | |
297 em_nc_info_cnf->cell_type_ind[index2] = EM_CELL_GPRS; | |
298 #endif | |
299 em_nc_info_cnf->cell_resel_offset[index2] = rr_data->nc_data[index].c2_par.cell_reselect_offset; | |
300 em_nc_info_cnf->temp_offset[index2] = rr_data->nc_data[index].c2_par.temp_offset; | |
301 em_nc_info_cnf->rxlev_acc_min[index2] = rr_data->nc_data[index].select_para.rxlev_access_min; | |
302 index2++; | |
303 } /* if decoded */ | |
304 | |
305 else if (rr_data->nc_data[index].bcch_status EQ NON_DECODED) | |
306 { | |
307 em_nc_info_cnf->arfcn_nc[index2] = rr_data->nc_data[index].arfcn; | |
308 em_nc_info_cnf->rxlev_nc[index2] = rr_data->nc_data[index].rxlev; | |
309 em_nc_info_cnf->bsic_nc[index2] = rr_data->nc_data[index].bsic; | |
310 index2++; | |
311 } /* if non decoded */ | |
312 } /* for */ | |
313 em_nc_info_cnf->no_ncells = rr_data->ms_data.measurement_report.ncells.no_of_ncells; | |
314 break; | |
315 | |
316 case ATT_DEDICATED: | |
317 { | |
318 if (!rr_data->ms_data.measurement_report.valid) | |
319 break; | |
320 | |
321 em_nc_info_cnf->no_ncells = rr_data->ms_data.measurement_report.ncells.no_of_ncells; | |
322 | |
323 for (index = 0; index< rr_data->ms_data.measurement_report.ncells.no_of_ncells; index++) | |
324 { | |
325 /*in the measurement report the cells are ordered by fieldstrength*/ | |
326 em_nc_info_cnf->arfcn_nc[index] = rr_data->ms_data.measurement_report.ncells.arfcn[index]; | |
327 em_nc_info_cnf->rxlev_nc[index] = rr_data->ms_data.measurement_report.ncells.rx_lev[index]; | |
328 em_nc_info_cnf->bsic_nc[index] = rr_data->ms_data.measurement_report.ncells.bsic[index]; | |
329 em_nc_info_cnf->frame_offset[index]= rr_data->ms_data.measurement_report.ncells.frame_offset[index]; | |
330 em_nc_info_cnf->time_alignmt[index]= rr_data->ms_data.measurement_report.ncells.time_alignmt[index]; | |
331 } /*for*/ | |
332 }/*case*/ | |
333 break; | |
334 | |
335 default: | |
336 break; | |
337 }/*switch*/ | |
338 PSENDX(MMI, em_nc_info_cnf); | |
339 }/*dat_em_nc_info_req*/ | |
340 | |
341 /* | |
342 +------------------------------------------------------------------------------ | |
343 | Function : dat_em_loc_pag_info_req | |
344 +------------------------------------------------------------------------------ | |
345 | Description : Process the primitive EM_LOC_PAG_INFO_REQ. | |
346 | | |
347 | Parameters : Primitive from EM - T_EM_LOC_PAG_INFO_REQ | |
348 | | |
349 | Return : void | |
350 +------------------------------------------------------------------------------ | |
351 */ | |
352 GLOBAL void dat_em_loc_pag_info_req (T_EM_LOC_PAG_INFO_REQ *em_loc_pag_info_req) | |
353 { | |
354 GET_INSTANCE_DATA; | |
355 PALLOC(em_loc_pag_info_cnf, EM_LOC_PAG_INFO_CNF); | |
356 memset (em_loc_pag_info_cnf, 0, sizeof (T_EM_LOC_PAG_INFO_CNF)); | |
357 | |
358 PFREE(em_loc_pag_info_req); | |
359 TRACE_FUNCTION ("dat_em_loc_pag_info_req()"); | |
360 | |
361 if (rr_data->nc_data[SC_INDEX].bcch_status EQ DECODED) | |
362 { | |
363 memcpy(em_loc_pag_info_cnf->mcc, rr_data->nc_data[SC_INDEX].lai.mcc, SIZE_MCC); | |
364 | |
365 /*check for MNC with 2 digits*/ | |
366 /* Fixed for Issue 21468 */ | |
367 if (rr_data->nc_data[SC_INDEX].lai.mnc[2] NEQ 0xF) /*defines a 3 digit NMC*/ | |
368 { | |
369 memcpy(em_loc_pag_info_cnf->mnc, rr_data->nc_data[SC_INDEX].lai.mnc, SIZE_MNC); | |
370 } | |
371 else /*2 digit -> leave the first value empty*/ | |
372 { | |
373 em_loc_pag_info_cnf->mnc[1] = rr_data->nc_data[SC_INDEX].lai.mnc[0]; | |
374 em_loc_pag_info_cnf->mnc[2] = rr_data->nc_data[SC_INDEX].lai.mnc[1]; | |
375 } | |
376 | |
377 em_loc_pag_info_cnf->bs_pa_mfrms = rr_data->nc_data[SC_INDEX].control_descr.bs_pa_mfrms; | |
378 em_loc_pag_info_cnf->t3212 = rr_data->nc_data[SC_INDEX].control_descr.t3212; | |
379 } | |
380 | |
381 if (rr_data->ms_data.tmsi_available EQ TRUE) | |
382 em_loc_pag_info_cnf->tmsi = rr_data->ms_data.tmsi_binary; | |
383 | |
384 PSENDX(MMI, em_loc_pag_info_cnf); | |
385 }/*dat_em_loc_pag_info_req*/ | |
386 | |
387 /* | |
388 +------------------------------------------------------------------------------ | |
389 | Function : dat_em_plmn_info_req | |
390 +------------------------------------------------------------------------------ | |
391 | Description : Process the primitive EM_PLMN_INFO_REQ. | |
392 | | |
393 | Parameters : Primitive from EM - T_EM_PLMN_INFO_REQ | |
394 | | |
395 | Return : void | |
396 +------------------------------------------------------------------------------ | |
397 */ | |
398 GLOBAL void dat_em_plmn_info_req (T_EM_PLMN_INFO_REQ *em_plmn_info_req) | |
399 { | |
400 GET_INSTANCE_DATA; | |
401 PALLOC(em_plmn_info_cnf, EM_PLMN_INFO_CNF); | |
402 memset (em_plmn_info_cnf, 0, sizeof (T_EM_PLMN_INFO_CNF)); | |
403 | |
404 PFREE(em_plmn_info_req); | |
405 TRACE_FUNCTION ("dat_em_plmn_info_req()"); | |
406 | |
407 em_plmn_info_cnf->no_creq_max = rr_data->nc_data[SC_INDEX].rach.max_retrans; | |
408 em_plmn_info_cnf->reest_flag = rr_data->nc_data[SC_INDEX].rach.re; | |
409 em_plmn_info_cnf->txpwr_max = rr_data->nc_data[SC_INDEX].select_para.ms_txpwr_max_cch; | |
410 em_plmn_info_cnf->rxlev_min = rr_data->nc_data[SC_INDEX].select_para.rxlev_access_min; | |
411 em_plmn_info_cnf->rel_cause = 0xff; /* these info will be parsed by aci */ | |
412 | |
413 PSENDX(MMI, em_plmn_info_cnf); | |
414 }/*dat_em_plmn_info_req*/ | |
415 /* | |
416 +------------------------------------------------------------------------------ | |
417 | Function : dat_em_cip_hop_dtx_info_req | |
418 +------------------------------------------------------------------------------ | |
419 | Description : Process the primitive EM_CIP_HOP_DTX_INFO_REQ. | |
420 | | |
421 | Parameters : Primitive from EM - T_EM_CIP_HOP_DTX_INFO_REQ | |
422 | | |
423 | Return : void | |
424 +------------------------------------------------------------------------------ | |
425 */ | |
426 GLOBAL void dat_em_cip_hop_dtx_info_req (T_EM_CIP_HOP_DTX_INFO_REQ *em_cip_hop_dtx_info_req) | |
427 { | |
428 GET_INSTANCE_DATA; | |
429 UBYTE i; | |
430 PALLOC(em_cip_hop_dtx_info_cnf, EM_CIP_HOP_DTX_INFO_CNF); | |
431 memset (em_cip_hop_dtx_info_cnf, 0, sizeof (T_EM_CIP_HOP_DTX_INFO_CNF)); | |
432 | |
433 PFREE(em_cip_hop_dtx_info_req); | |
434 TRACE_FUNCTION ("dat_em_cip_hop_dtx_info_req()"); | |
435 | |
436 /* Intialize to 0xffff. No hopping channels */ | |
437 em_cip_hop_dtx_info_cnf->hop_chn.ma[0] = NOT_PRESENT_16BIT; | |
438 em_cip_hop_dtx_info_cnf->hop_chn2.ma[0] = NOT_PRESENT_16BIT; | |
439 | |
440 if((GET_STATE(STATE_ATT) EQ ATT_DEDICATED) AND | |
441 (GET_STATE(STATE_DAT) EQ DAT_DEDICATED)) | |
442 { | |
443 /* cipher status */ | |
444 em_cip_hop_dtx_info_cnf->ciph_stat = rr_data->sc_data.ciph_on; | |
445 | |
446 /* Hopping status */ | |
447 em_cip_hop_dtx_info_cnf->hop = rr_data->sc_data.chan_desc.hop; | |
448 | |
449 if (rr_data->sc_data.chan_desc.hop EQ H_NO) | |
450 { /* Hopping is not configured */ | |
451 em_cip_hop_dtx_info_cnf->arfcn = rr_data->sc_data.chan_desc.arfcn; | |
452 } | |
453 else | |
454 { /* hopping sequence no */ | |
455 em_cip_hop_dtx_info_cnf->hsn = rr_data->sc_data.chan_desc.hsn; | |
456 } | |
457 | |
458 if(em_cip_hop_dtx_info_cnf->hop NEQ H_NO) | |
459 { | |
460 /* MAIO */ | |
461 em_cip_hop_dtx_info_cnf->hop_chn.maio = rr_data->sc_data.chan_desc.maio; | |
462 | |
463 i=0; | |
464 while((i<MAX_MA_CHANNELS) AND (ma[i] NEQ NOT_PRESENT_16BIT)) | |
465 { | |
466 em_cip_hop_dtx_info_cnf->hop_chn.ma[i] = ma[i]; | |
467 i++; | |
468 } | |
469 | |
470 /* Number of hopping channels */ | |
471 em_cip_hop_dtx_info_cnf->hop_chn.nr_arfcns = i; | |
472 if(i < MAX_MA_CHANNELS) | |
473 { | |
474 em_cip_hop_dtx_info_cnf->hop_chn.ma[i] = NOT_PRESENT_16BIT; | |
475 } | |
476 | |
477 /* starting time status */ | |
478 em_cip_hop_dtx_info_cnf->v_start = v_start; | |
479 | |
480 /* Hopping list after time */ | |
481 if (v_start) | |
482 { | |
483 /* MAIO */ | |
484 em_cip_hop_dtx_info_cnf->hop_chn2.maio = maio2; | |
485 | |
486 i=0; | |
487 while((i<MAX_MA_CHANNELS) AND (ma2[i] NEQ NOT_PRESENT_16BIT)) | |
488 { | |
489 em_cip_hop_dtx_info_cnf->hop_chn2.ma[i] = ma2[i]; | |
490 i++; | |
491 } | |
492 /* Number of hopping channels */ | |
493 em_cip_hop_dtx_info_cnf->hop_chn2.nr_arfcns = i; | |
494 if(i < MAX_MA_CHANNELS) | |
495 { | |
496 em_cip_hop_dtx_info_cnf->hop_chn2.ma[i] = NOT_PRESENT_16BIT; | |
497 } | |
498 } /* v_start */ | |
499 | |
500 } /* hop NEQ H_NO */ | |
501 | |
502 } /* dedicated state */ | |
503 | |
504 /* DTX status */ | |
505 em_cip_hop_dtx_info_cnf->dtx_stat = rr_data->sc_data.cd.dtx; | |
506 | |
507 PSENDX(MMI, em_cip_hop_dtx_info_cnf); | |
508 }/*dat_em_cip_hop_dtx_info_req*/ | |
509 | |
510 /* | |
511 +------------------------------------------------------------------------------ | |
512 | Function : dat_em_mobdata_power_info_req | |
513 +------------------------------------------------------------------------------ | |
514 | Description : Process the primitive EM_POWER_INFO_REQ. | |
515 | | |
516 | Parameters : Primitive from EM - T_EM_POWER_INFO_REQ | |
517 | | |
518 | Return : void | |
519 +------------------------------------------------------------------------------ | |
520 */ | |
521 GLOBAL void dat_em_mobdata_power_info_req (T_EM_POWER_INFO_REQ *em_power_info_req) | |
522 { | |
523 GET_INSTANCE_DATA; | |
524 PALLOC(em_power_info_cnf, EM_POWER_INFO_CNF); | |
525 | |
526 PFREE(em_power_info_req); | |
527 | |
528 TRACE_FUNCTION ("dat_em_mobdata_power_info_req()"); | |
529 | |
530 memset (em_power_info_cnf, 0, sizeof (T_EM_POWER_INFO_CNF)); | |
531 memcpy(&em_power_info_cnf->classm2, &rr_data->ms_data.classmark2, sizeof (T_classm2)); | |
532 memcpy(&em_power_info_cnf->classm3, &rr_data->ms_data.classmark3, sizeof (T_classm3)); | |
533 | |
534 PSENDX(MMI, em_power_info_cnf); | |
535 }/*dat_em_mobdata_power_info_req*/ | |
536 | |
537 /* | |
538 +------------------------------------------------------------------------------ | |
539 | Function : dat_em_mobdata_id_info_req | |
540 +------------------------------------------------------------------------------ | |
541 | Description : Process the primitive EM_IDENTITY_INFO_REQ. | |
542 | | |
543 | Parameters : Primitive from EM - T_EM_IDENTITY_INFO_REQ | |
544 | | |
545 | Return : void | |
546 +------------------------------------------------------------------------------ | |
547 */ | |
548 GLOBAL void dat_em_mobdata_id_info_req (T_EM_IDENTITY_INFO_REQ *em_identity_info_req) | |
549 { | |
550 GET_INSTANCE_DATA; | |
551 PALLOC(em_identity_info_cnf, EM_IDENTITY_INFO_CNF); | |
552 memset (em_identity_info_cnf, 0, sizeof (T_EM_IDENTITY_INFO_CNF)); | |
553 | |
554 PFREE(em_identity_info_req); | |
555 TRACE_FUNCTION ("dat_em_mobdata_id_info_req()"); | |
556 | |
557 /* | |
558 * The values for IMEI and IMEISV are identical up to the last 4bits. The 'ident_type' distinguish | |
559 * IMEI and IMEISV where ident_type = 3 is synonymously with IMEISV. In case only IMEI is needed, | |
560 * em_mm_mobdata_id_info_req->em_imei.ident_dig[16] should not considered. | |
561 */ | |
562 | |
563 em_identity_info_cnf->em_imeisv.ident_type = rr_data->ms_data.imei.ident_type; | |
564 em_identity_info_cnf->em_imeisv.v_ident_dig = rr_data->ms_data.imei.v_ident_dig; | |
565 em_identity_info_cnf->em_imeisv.c_ident_dig = rr_data->ms_data.imei.c_ident_dig; | |
566 em_identity_info_cnf->em_imeisv.odd_even = rr_data->ms_data.imei.odd_even; | |
567 memcpy (em_identity_info_cnf->em_imeisv.ident_dig, rr_data->ms_data.imei.ident_dig, 16); | |
568 | |
569 if (rr_data->ms_data.imsi_available) /* SIM available */ | |
570 { | |
571 em_identity_info_cnf->em_imsi.ident_type = rr_data->ms_data.imsi.ident_type; | |
572 em_identity_info_cnf->em_imsi.v_ident_dig = rr_data->ms_data.imsi.v_ident_dig; | |
573 em_identity_info_cnf->em_imsi.c_ident_dig = rr_data->ms_data.imsi.c_ident_dig; | |
574 em_identity_info_cnf->em_imsi.odd_even = rr_data->ms_data.imsi.odd_even; | |
575 memcpy (em_identity_info_cnf->em_imsi.ident_dig, rr_data->ms_data.imsi.ident_dig, 16); | |
576 } | |
577 | |
578 if (rr_data->ms_data.tmsi_available EQ TRUE) | |
579 em_identity_info_cnf->tmsi = rr_data->ms_data.tmsi_binary; | |
580 | |
581 PSENDX(MMI, em_identity_info_cnf); | |
582 } /*dat_em_mobdata_id_info_req*/ | |
583 | |
584 /* | |
585 +------------------------------------------------------------------------------ | |
586 | Function : dat_em_mobdata_version_info_req | |
587 +------------------------------------------------------------------------------ | |
588 | Description : Process the primitive EM_SW_VERSION_INFO_REQ. | |
589 | | |
590 | Parameters : Primitive from EM - T_EM_SW_VERSION_INFO_REQ | |
591 | | |
592 | Return : void | |
593 +------------------------------------------------------------------------------ | |
594 */ | |
595 GLOBAL void dat_em_mobdata_version_info_req (T_EM_SW_VERSION_INFO_REQ *em_sw_version_info_req) | |
596 { | |
597 PALLOC(em_sw_version_info_cnf, EM_SW_VERSION_INFO_CNF); | |
598 PFREE(em_sw_version_info_req); | |
599 | |
600 | |
601 TRACE_FUNCTION ("dat_em_mobdata_version_info_req()"); | |
602 | |
603 memset (em_sw_version_info_cnf, 0, sizeof (T_EM_SW_VERSION_INFO_CNF)); | |
604 | |
605 em_sw_version_info_cnf->v_mmi = 0xFF; | |
606 em_sw_version_info_cnf->v_sim = 0xFF; | |
607 em_sw_version_info_cnf->v_cc = 0xFF; | |
608 em_sw_version_info_cnf->v_ss = 0xFF; | |
609 em_sw_version_info_cnf->v_sms = 0xFF; | |
610 em_sw_version_info_cnf->v_mm = 0xFF; | |
611 em_sw_version_info_cnf->v_rr = 0xFF; | |
612 em_sw_version_info_cnf->v_dl = 0xFF; | |
613 em_sw_version_info_cnf->v_l1 = 0xFF; | |
614 | |
615 PSENDX(MMI, em_sw_version_info_cnf); | |
616 }/*dat_em_mobdata_version_info_req*/ | |
617 | |
618 | |
619 /* | |
620 +------------------------------------------------------------------------------ | |
621 | Function : dat_em_amr_info_req | |
622 +------------------------------------------------------------------------------ | |
623 | Description : Process the primitive EM_AMR_INFO_REQ. | |
624 | | |
625 | Parameters : Primitive from EM - T_EM_AMR_INFO_REQ | |
626 | | |
627 | Return : void | |
628 +------------------------------------------------------------------------------ | |
629 */ | |
630 GLOBAL void dat_em_amr_info_req (T_EM_AMR_INFO_REQ *em_amr_info_req) | |
631 { | |
632 GET_INSTANCE_DATA; | |
633 UBYTE i=0; | |
634 PALLOC(em_amr_info_cnf, EM_AMR_INFO_CNF); | |
635 memset (em_amr_info_cnf, 0, sizeof (T_EM_AMR_INFO_CNF)); | |
636 | |
637 PFREE(em_amr_info_req); | |
638 TRACE_FUNCTION ("dat_em_amr_info_req()"); | |
639 | |
640 /* AMR information is valid only in dedicated state, when chan mode is AMR */ | |
641 if((GET_STATE(STATE_ATT) EQ ATT_DEDICATED) AND | |
642 (GET_STATE(STATE_DAT) EQ DAT_DEDICATED)) | |
643 { | |
644 if(rr_data->sc_data.ch_mode EQ CM_AMR) | |
645 { | |
646 /* AMR vocoder type */ | |
647 em_amr_info_cnf->amr_vocoder = rr_data->sc_data.chan_desc.chan_type; | |
648 | |
649 /* Initial codec mode indicator */ | |
650 em_amr_info_cnf->amr_icmi = rr_data->sc_data.amr_conf.icmi; | |
651 | |
652 /* Initial codec mode. Valid if icmi = 1(Start mode signalled) */ | |
653 em_amr_info_cnf->amr_icm = rr_data->sc_data.amr_conf.st_mode; | |
654 | |
655 /* Active codec set */ | |
656 em_amr_info_cnf->amr_acs = rr_data->sc_data.amr_conf.set_amr; | |
657 | |
658 /* First codec( Highest bit rate codec mode) */ | |
659 em_amr_info_cnf->amr_first_codec = | |
660 em_get_first_codec(rr_data->sc_data.amr_conf.set_amr); | |
661 | |
662 if(rr_data->sc_data.amr_conf.v_cod_prop) | |
663 { | |
664 /* Number of codec modes */ | |
665 em_amr_info_cnf->amr_nr_modes = rr_data->sc_data.amr_conf.c_cod_prop + 1; | |
666 | |
667 /* Threshold and Hysteresis properties between codec modes */ | |
668 for(i=0;i<rr_data->sc_data.amr_conf.c_cod_prop;i++) | |
669 { | |
670 memcpy(&em_amr_info_cnf->amr_cod_prop[i],&rr_data->sc_data.amr_conf.cod_prop[i], | |
671 sizeof(T_amr_cod_prop)); | |
672 } | |
673 } | |
674 else | |
675 { | |
676 /* Number of codec modes */ | |
677 em_amr_info_cnf->amr_nr_modes = 1; | |
678 } | |
679 } /* CM_AMR */ | |
680 } /* ATT DEDICATED */ | |
681 | |
682 PSENDX(MMI, em_amr_info_cnf); | |
683 } /*dat_em_amr_info_req*/ | |
684 | |
685 /* | |
686 +------------------------------------------------------------------------------ | |
687 | Function : em_init_rr_event_trace | |
688 +------------------------------------------------------------------------------ | |
689 | Description : Initialize the event tracing flags for RR | |
690 | | |
691 | Parameters : void | |
692 | | |
693 | Return : void | |
694 | | |
695 +------------------------------------------------------------------------------ | |
696 */ | |
697 GLOBAL void em_init_rr_event_trace(void) | |
698 { | |
699 UBYTE i; | |
700 | |
701 TRACE_FUNCTION ("em_init_rr_event_trace()"); | |
702 | |
703 for (i=0; i< EM_MAX_RR_EVENTS; i++) | |
704 rr_v[i] = 0; | |
705 } | |
706 | |
707 /* | |
708 +------------------------------------------------------------------------------ | |
709 | Function : rr_em_rr_event_req | |
710 +------------------------------------------------------------------------------ | |
711 | Description : Set the event tracing flags according the bitmask | |
712 | | |
713 | Parameters : Primitive - Bitmask(T_EM_RR_EVENT_REQ) | |
714 | | |
715 | Return : void | |
716 | | |
717 +------------------------------------------------------------------------------ | |
718 */ | |
719 GLOBAL void rr_em_rr_event_req (T_EM_RR_EVENT_REQ *em_rr_event_req) | |
720 { | |
721 UBYTE i; | |
722 | |
723 TRACE_FUNCTION ("rr_em_rr_event_req()"); | |
724 | |
725 /* | |
726 * The event tracing flags are set according the bitmask. rr_v[i] are | |
727 * the flags belonging to the event number described in 8443.601 | |
728 */ | |
729 for(i=1; i<33; i++) | |
730 rr_v[i] = ((em_rr_event_req->bitmask_rr_l & (0x01<<(i-1))) > 0) ? TRUE : FALSE; | |
731 | |
732 for(i=33; i<(EM_MAX_RR_EVENTS); i++) | |
733 rr_v[i] = ((em_rr_event_req->bitmask_rr_h & (0x01<<(i-1))) > 0) ? TRUE : FALSE; | |
734 | |
735 /* | |
736 A new event trace is generated therefor the flag is set to 0. | |
737 */ | |
738 em_rr_trace_occured = 0; | |
739 | |
740 PFREE(em_rr_event_req); | |
741 } | |
742 | |
743 /* | |
744 +------------------------------------------------------------------------------ | |
745 | Function : em_write_buffer_2 | |
746 +------------------------------------------------------------------------------ | |
747 | Description : Perform buffer check and store corresponding data in it. | |
748 | | |
749 | Parameters : Event number | |
750 | | |
751 | Return : TRUE/FALSE | |
752 | | |
753 +------------------------------------------------------------------------------ | |
754 */ | |
755 #define EVT_LEN_OFFSET 2 /* Event Number and Length value bytes */ | |
756 #define BUFFER_2_LENGTH 2 | |
757 GLOBAL UBYTE em_write_buffer_2 (UBYTE event_no) | |
758 { | |
759 UBYTE em_rr_event_buffer[BUFFER_2_LENGTH]; | |
760 UBYTE em_rr_buffer_write = 0; | |
761 | |
762 TRACE_FUNCTION ("rr_em_write_buffer_2()"); | |
763 | |
764 /* | |
765 ACI is informed about the first event trace, used for later data processing. | |
766 */ | |
767 rr_em_first_event_check(); | |
768 | |
769 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
770 em_rr_event_buffer[em_rr_buffer_write] = 0x00; /* Value length - 0 equals no data */ | |
771 | |
772 return (em_rr_sem (BUFFER_2_LENGTH, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
773 } | |
774 | |
775 /* | |
776 +------------------------------------------------------------------------------ | |
777 | Function : em_write_buffer_3 | |
778 +------------------------------------------------------------------------------ | |
779 | Description : Perform buffer check and store corresponding data in it. | |
780 | | |
781 | Parameters : Event number, data value | |
782 | | |
783 | Return : TRUE/FALSE | |
784 | | |
785 +------------------------------------------------------------------------------ | |
786 */ | |
787 #define BUFFER_3_LENGTH 3 | |
788 GLOBAL UBYTE em_write_buffer_3 (UBYTE event_no, UBYTE value) | |
789 { | |
790 UBYTE em_rr_event_buffer[BUFFER_3_LENGTH]; | |
791 UBYTE em_rr_buffer_write = 0; | |
792 | |
793 TRACE_FUNCTION ("rr_em_write_buffer_3()"); | |
794 | |
795 /* | |
796 ACI is informed about the first event trace, used for later data processing. | |
797 */ | |
798 rr_em_first_event_check(); | |
799 | |
800 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
801 em_rr_event_buffer[em_rr_buffer_write++] = BUFFER_3_LENGTH-EVT_LEN_OFFSET; /* Value length - 0 equals no value */ | |
802 em_rr_event_buffer[em_rr_buffer_write] = value; /* Data to be stored */ | |
803 | |
804 return (em_rr_sem (BUFFER_3_LENGTH, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
805 } | |
806 | |
807 /* | |
808 +------------------------------------------------------------------------------ | |
809 | Function : em_write_buffer_3a | |
810 +------------------------------------------------------------------------------ | |
811 | Description : Perform buffer check and store corresponding data in it. | |
812 | | |
813 | Parameters : Event number, data value (USHORT) | |
814 | | |
815 | Return : TRUE/FALSE | |
816 | | |
817 +------------------------------------------------------------------------------ | |
818 */ | |
819 #define BUFFER_3A_LENGTH 4 | |
820 GLOBAL UBYTE em_write_buffer_3a (UBYTE event_no, USHORT value) | |
821 { | |
822 UBYTE em_rr_event_buffer[BUFFER_3A_LENGTH]; | |
823 UBYTE em_rr_buffer_write = 0; | |
824 | |
825 TRACE_FUNCTION ("rr_em_write_buffer_3a()"); | |
826 | |
827 /* | |
828 ACI is informed about the first event trace, used for later data processing. | |
829 */ | |
830 rr_em_first_event_check(); | |
831 | |
832 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
833 em_rr_event_buffer[em_rr_buffer_write++] = BUFFER_3A_LENGTH-EVT_LEN_OFFSET; /* Value length - 0 equals no value */ | |
834 em_rr_event_buffer[em_rr_buffer_write++] = (UBYTE)(value >> 8); /* Data to be stored - MSB first */ | |
835 em_rr_event_buffer[em_rr_buffer_write++] = (UBYTE)(value ); /* LSB second */ | |
836 | |
837 return (em_rr_sem (BUFFER_3A_LENGTH, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
838 } | |
839 | |
840 /* | |
841 +------------------------------------------------------------------------------ | |
842 | Function : em_write_buffer_4 | |
843 +------------------------------------------------------------------------------ | |
844 | Description : Perform buffer check and store corresponding data in it. | |
845 | | |
846 | Parameters : Event number, length of data and value1 and value2 | |
847 | | |
848 | Return : TRUE/FALSE | |
849 | | |
850 +------------------------------------------------------------------------------ | |
851 */ | |
852 #define BUFFER_4_LENGTH 4 | |
853 GLOBAL UBYTE em_write_buffer_4 (UBYTE event_no, UBYTE value1, UBYTE value2) | |
854 { | |
855 UBYTE em_rr_event_buffer[BUFFER_4_LENGTH]; | |
856 UBYTE em_rr_buffer_write = 0; | |
857 | |
858 TRACE_FUNCTION ("rr_em_write_buffer_4()"); | |
859 | |
860 /* | |
861 ACI is informed about the first event trace, used for later data processing. | |
862 */ | |
863 rr_em_first_event_check(); | |
864 | |
865 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
866 em_rr_event_buffer[em_rr_buffer_write++] = BUFFER_4_LENGTH-EVT_LEN_OFFSET; /* Value length - 0 equals no value */ | |
867 em_rr_event_buffer[em_rr_buffer_write++] = value1; /* Value 1 */ | |
868 em_rr_event_buffer[em_rr_buffer_write++] = value2; /* Value 2 */ | |
869 | |
870 return (em_rr_sem (BUFFER_4_LENGTH, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
871 } | |
872 | |
873 /* | |
874 +------------------------------------------------------------------------------ | |
875 | Function : em_write_buffer_4a | |
876 +------------------------------------------------------------------------------ | |
877 | Description : Perform buffer check and store corresponding data in it. | |
878 | | |
879 | Parameters : Event number, data value, data cs (USHORT) | |
880 | | |
881 | Return : TRUE/FALSE | |
882 | | |
883 +------------------------------------------------------------------------------ | |
884 */ | |
885 #define BUFFER_4A_LENGTH 5 | |
886 GLOBAL UBYTE em_write_buffer_4a (UBYTE event_no, UBYTE value, USHORT cs) | |
887 { | |
888 UBYTE em_rr_event_buffer[BUFFER_4A_LENGTH]; | |
889 UBYTE em_rr_buffer_write = 0; | |
890 | |
891 TRACE_FUNCTION ("rr_em_write_buffer_4a()"); | |
892 | |
893 /* | |
894 ACI is informed about the first event trace, used for later data processing. | |
895 */ | |
896 rr_em_first_event_check(); | |
897 | |
898 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
899 em_rr_event_buffer[em_rr_buffer_write++] = BUFFER_4A_LENGTH-EVT_LEN_OFFSET; /* Value length - 0 equals no value */ | |
900 em_rr_event_buffer[em_rr_buffer_write++] = value; /* first data info */ | |
901 em_rr_event_buffer[em_rr_buffer_write++] = (UBYTE)(cs >> 8); /* Data to be stored - MSB first */ | |
902 em_rr_event_buffer[em_rr_buffer_write++] = (UBYTE)(cs); /* LSB second */ | |
903 | |
904 return (em_rr_sem (BUFFER_4A_LENGTH, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
905 } | |
906 | |
907 /* | |
908 +------------------------------------------------------------------------------ | |
909 | Function : em_write_buffer_4b | |
910 +------------------------------------------------------------------------------ | |
911 | Description : Perform buffer check and store corresponding data in it. | |
912 | | |
913 | Parameters : Event number, data value, data plmn (T_plmn) | |
914 | | |
915 | Return : TRUE/FALSE | |
916 | | |
917 +------------------------------------------------------------------------------ | |
918 */ | |
919 #define BUFFER_4B_LENGTH 9 | |
920 GLOBAL UBYTE em_write_buffer_4b (UBYTE event_no, UBYTE value, T_plmn plmn) | |
921 { | |
922 UBYTE em_rr_event_buffer[BUFFER_4B_LENGTH]; | |
923 UBYTE em_rr_buffer_write = 0; | |
924 | |
925 TRACE_FUNCTION ("rr_em_write_buffer_4b()"); | |
926 | |
927 /* | |
928 ACI is informed about the first event trace, used for later data processing. | |
929 */ | |
930 rr_em_first_event_check(); | |
931 | |
932 memset(em_rr_event_buffer, 0, BUFFER_4B_LENGTH); | |
933 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
934 em_rr_event_buffer[em_rr_buffer_write++] = BUFFER_4B_LENGTH-EVT_LEN_OFFSET; /* Value length - 0 equals no value */ | |
935 em_rr_event_buffer[em_rr_buffer_write++] = value; | |
936 if(plmn.v_plmn) | |
937 { | |
938 memcpy(&em_rr_event_buffer[em_rr_buffer_write], plmn.mcc, SIZE_MCC); | |
939 em_rr_buffer_write += SIZE_MCC; | |
940 memcpy(&em_rr_event_buffer[em_rr_buffer_write], plmn.mnc, SIZE_MNC); | |
941 } | |
942 | |
943 return (em_rr_sem (BUFFER_4B_LENGTH, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
944 } | |
945 | |
946 /* | |
947 +------------------------------------------------------------------------------ | |
948 | Function : em_write_buffer_4c | |
949 +------------------------------------------------------------------------------ | |
950 | Description : Perform buffer check and store corresponding data in it. | |
951 | | |
952 | Parameters : Event number, data value1, data plmn (T_plmn) | |
953 | | |
954 | Return : TRUE/FALSE | |
955 | | |
956 +------------------------------------------------------------------------------ | |
957 */ | |
958 #define BUFFER_4C_LENGTH ((MAX_PLMN*(SIZE_MCC+SIZE_MNC))+EVT_LEN_OFFSET) | |
959 GLOBAL UBYTE em_write_buffer_4c (UBYTE event_no, UBYTE value1, T_plmn plmn[MAX_PLMN]) | |
960 { | |
961 UBYTE em_rr_event_buffer[BUFFER_4C_LENGTH]; | |
962 UBYTE em_rr_buffer_write = 0; | |
963 UBYTE length = 0; | |
964 UBYTE i; | |
965 | |
966 TRACE_FUNCTION ("rr_em_write_buffer_4c()"); | |
967 /* Ensure value1 is within specified boundaries */ | |
968 if( value1 > MAX_PLMN ) | |
969 { | |
970 value1 = MAX_PLMN; | |
971 } | |
972 | |
973 /* | |
974 ACI is informed about the first event trace, used for later data processing. | |
975 */ | |
976 rr_em_first_event_check(); | |
977 | |
978 memset(em_rr_event_buffer, 0, BUFFER_4C_LENGTH); | |
979 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
980 em_rr_event_buffer[em_rr_buffer_write++] = 1+value1*(SIZE_MCC + SIZE_MNC); /* Value length - 0 equals no value */ | |
981 for (i=0; i<value1; i++) { | |
982 if(plmn[i].v_plmn) | |
983 { | |
984 memcpy(em_rr_event_buffer + em_rr_buffer_write, plmn[i].mcc, SIZE_MCC); | |
985 em_rr_buffer_write += SIZE_MCC; | |
986 memcpy(em_rr_event_buffer + em_rr_buffer_write, plmn[i].mnc, SIZE_MNC); | |
987 em_rr_buffer_write += SIZE_MNC; | |
988 } | |
989 } | |
990 length = (EVT_LEN_OFFSET + value1*(SIZE_MCC + SIZE_MNC)); | |
991 | |
992 return (em_rr_sem (length, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
993 } | |
994 | |
995 /* | |
996 +------------------------------------------------------------------------------ | |
997 | Function : em_write_buffer_5 | |
998 +------------------------------------------------------------------------------ | |
999 | Description : Perform buffer check and store corresponding data in it. | |
1000 | | |
1001 | Parameters : Event number, data value1, data value2, data cs (USHORT) | |
1002 | | |
1003 | Return : TRUE/FALSE | |
1004 | | |
1005 +------------------------------------------------------------------------------ | |
1006 */ | |
1007 #define BUFFER_5_LENGTH 5 | |
1008 GLOBAL UBYTE em_write_buffer_5 (UBYTE event_no, UBYTE value1, UBYTE value2, UBYTE value3) | |
1009 { | |
1010 UBYTE em_rr_event_buffer[BUFFER_5_LENGTH]; | |
1011 UBYTE em_rr_buffer_write = 0; | |
1012 | |
1013 TRACE_FUNCTION ("rr_em_write_buffer_5()"); | |
1014 | |
1015 /* | |
1016 ACI is informed about the first event trace, used for later data processing. | |
1017 */ | |
1018 rr_em_first_event_check(); | |
1019 | |
1020 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
1021 em_rr_event_buffer[em_rr_buffer_write++] = BUFFER_5_LENGTH-EVT_LEN_OFFSET; /* Value length - 0 equals no value */ | |
1022 em_rr_event_buffer[em_rr_buffer_write++] = value1; /* first data info */ | |
1023 em_rr_event_buffer[em_rr_buffer_write++] = value2; /* second data info */ | |
1024 em_rr_event_buffer[em_rr_buffer_write++] = value3; /* Data */ | |
1025 | |
1026 return (em_rr_sem (BUFFER_5_LENGTH, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
1027 } | |
1028 | |
1029 /* | |
1030 +------------------------------------------------------------------------------ | |
1031 | Function : em_write_buffer_5c | |
1032 +------------------------------------------------------------------------------ | |
1033 | Description : Perform buffer check and store corresponding data in it. | |
1034 | | |
1035 | Parameters : Event number, data value, data plmn (T_plmn) | |
1036 | | |
1037 | Return : TRUE/FALSE | |
1038 | | |
1039 +------------------------------------------------------------------------------ | |
1040 */ | |
1041 #define BUFFER_5C_LENGTH 10 | |
1042 GLOBAL UBYTE em_write_buffer_5c (UBYTE event_no, UBYTE value1, UBYTE value2, T_plmn plmn) | |
1043 { | |
1044 UBYTE em_rr_event_buffer[BUFFER_5C_LENGTH]; | |
1045 UBYTE em_rr_buffer_write = 0; | |
1046 | |
1047 TRACE_FUNCTION ("rr_em_write_buffer_5c()"); | |
1048 | |
1049 /* | |
1050 ACI is informed about the first event trace, used for later data processing. | |
1051 */ | |
1052 rr_em_first_event_check(); | |
1053 | |
1054 memset(em_rr_event_buffer, 0, BUFFER_5C_LENGTH); | |
1055 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
1056 em_rr_event_buffer[em_rr_buffer_write++] = BUFFER_5C_LENGTH-EVT_LEN_OFFSET; /* Value length - 0 equals no value */ | |
1057 em_rr_event_buffer[em_rr_buffer_write++] = value1; | |
1058 em_rr_event_buffer[em_rr_buffer_write++] = value2; | |
1059 if(plmn.v_plmn) | |
1060 { | |
1061 memcpy(em_rr_event_buffer + em_rr_buffer_write, plmn.mcc, SIZE_MCC); | |
1062 em_rr_buffer_write += SIZE_MCC; | |
1063 memcpy(em_rr_event_buffer + em_rr_buffer_write, plmn.mnc, SIZE_MNC); | |
1064 } | |
1065 | |
1066 return (em_rr_sem (BUFFER_5C_LENGTH, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
1067 } | |
1068 | |
1069 /* | |
1070 +------------------------------------------------------------------------------ | |
1071 | Function : em_write_buffer_8 | |
1072 +------------------------------------------------------------------------------ | |
1073 | Description : Perform buffer check and store corresponding data in it. | |
1074 | | |
1075 | Parameters : Event number, data value1, data value2, data cs (USHORT) | |
1076 | | |
1077 | Return : TRUE/FALSE | |
1078 | | |
1079 +------------------------------------------------------------------------------ | |
1080 */ | |
1081 #define BUFFER_8_LENGTH 8 | |
1082 GLOBAL UBYTE em_write_buffer_8 (UBYTE event_no, UBYTE value1, UBYTE value2, UBYTE value3, UBYTE value4, | |
1083 UBYTE value5, UBYTE value6) | |
1084 { | |
1085 UBYTE em_rr_event_buffer[BUFFER_8_LENGTH]; | |
1086 UBYTE em_rr_buffer_write = 0; | |
1087 | |
1088 TRACE_FUNCTION ("rr_em_write_buffer_8()"); | |
1089 | |
1090 /* | |
1091 ACI is informed about the first event trace, used for later data processing. | |
1092 */ | |
1093 rr_em_first_event_check(); | |
1094 | |
1095 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
1096 em_rr_event_buffer[em_rr_buffer_write++] = BUFFER_8_LENGTH-EVT_LEN_OFFSET; /* Value length - 0 equals no value */ | |
1097 em_rr_event_buffer[em_rr_buffer_write++] = value1; /* first data info */ | |
1098 em_rr_event_buffer[em_rr_buffer_write++] = value2; /* second data info */ | |
1099 em_rr_event_buffer[em_rr_buffer_write++] = value3; /* data */ | |
1100 em_rr_event_buffer[em_rr_buffer_write++] = value4; /* data */ | |
1101 em_rr_event_buffer[em_rr_buffer_write++] = value5; /* data */ | |
1102 em_rr_event_buffer[em_rr_buffer_write++] = value6; /* data */ | |
1103 | |
1104 return (em_rr_sem (BUFFER_8_LENGTH, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
1105 } | |
1106 | |
1107 /* | |
1108 +------------------------------------------------------------------------------ | |
1109 | Function : em_write_buffer_9 | |
1110 +------------------------------------------------------------------------------ | |
1111 | Description : Perform buffer check and store corresponding data in it. | |
1112 | | |
1113 | Parameters : Event number, data value1, data value2, data cs (USHORT) | |
1114 | | |
1115 | Return : TRUE/FALSE | |
1116 | | |
1117 +------------------------------------------------------------------------------ | |
1118 */ | |
1119 #define BUFFER_9_LENGTH 9 | |
1120 GLOBAL UBYTE em_write_buffer_9 (UBYTE event_no, UBYTE value1, UBYTE value2, UBYTE value3, | |
1121 UBYTE value4, UBYTE value5, UBYTE value6, UBYTE value7) | |
1122 { | |
1123 UBYTE em_rr_event_buffer[BUFFER_9_LENGTH]; | |
1124 UBYTE em_rr_buffer_write = 0; | |
1125 | |
1126 TRACE_FUNCTION ("rr_em_write_buffer_9()"); | |
1127 | |
1128 /* | |
1129 ACI is informed about the first event trace, used for later data processing. | |
1130 */ | |
1131 rr_em_first_event_check(); | |
1132 | |
1133 em_rr_event_buffer[em_rr_buffer_write++] = event_no; /* Event number */ | |
1134 em_rr_event_buffer[em_rr_buffer_write++] = BUFFER_9_LENGTH-EVT_LEN_OFFSET; /* Value length - 0 equals no value */ | |
1135 em_rr_event_buffer[em_rr_buffer_write++] = value1; /* first data info */ | |
1136 em_rr_event_buffer[em_rr_buffer_write++] = value2; /* second data info */ | |
1137 em_rr_event_buffer[em_rr_buffer_write++] = value3; /* data */ | |
1138 em_rr_event_buffer[em_rr_buffer_write++] = value4; /* data */ | |
1139 em_rr_event_buffer[em_rr_buffer_write++] = value5; /* data */ | |
1140 em_rr_event_buffer[em_rr_buffer_write++] = value6; /* data */ | |
1141 em_rr_event_buffer[em_rr_buffer_write++] = value7; /* data */ | |
1142 | |
1143 return (em_rr_sem (BUFFER_9_LENGTH, em_rr_event_buffer)); /* Data is stored inside buffer, reset flag */ | |
1144 } | |
1145 | |
1146 /* | |
1147 +------------------------------------------------------------------------------ | |
1148 | Function : rr_semaphore_err | |
1149 +------------------------------------------------------------------------------ | |
1150 | Description : Semaphor error | |
1151 | | |
1152 | | |
1153 | Parameters : void | |
1154 | | |
1155 | Return : void | |
1156 | | |
1157 +------------------------------------------------------------------------------ | |
1158 */ | |
1159 static void rr_semaphore_err (void) | |
1160 { | |
1161 static UCHAR out = 0; | |
1162 if (!out) | |
1163 { | |
1164 out = 1; | |
1165 /* Implements Measure#32: Row 224 */ | |
1166 TRACE_EVENT ("semaphore error"); | |
1167 | |
1168 } | |
1169 } | |
1170 | |
1171 | |
1172 /* | |
1173 +------------------------------------------------------------------------------ | |
1174 | Function : rr_enter_critical_section | |
1175 +------------------------------------------------------------------------------ | |
1176 | Description : | |
1177 | Attempt to access critical section by taking control | |
1178 | of the semaphore | |
1179 | | |
1180 | Parameters : void | |
1181 | | |
1182 | Return : int | |
1183 | | |
1184 +------------------------------------------------------------------------------ | |
1185 */ | |
1186 static int rr_enter_critical_section (T_HANDLE sem) | |
1187 { | |
1188 if (vsi_s_get (VSI_CALLER sem) NEQ VSI_OK) | |
1189 { | |
1190 SYST_TRACE ( "** Enter Critical Sec:semaphore NOT cleared **"); | |
1191 rr_semaphore_err(); | |
1192 return -1; | |
1193 } | |
1194 else | |
1195 { | |
1196 return 0; | |
1197 } | |
1198 } | |
1199 | |
1200 /* | |
1201 +------------------------------------------------------------------------------ | |
1202 | Function : rr_leave_critical_section | |
1203 +------------------------------------------------------------------------------ | |
1204 | Description : | |
1205 | Relinquish control of semaphore and release access to | |
1206 | critical section | |
1207 | | |
1208 | Parameters : void | |
1209 | | |
1210 | Return : int | |
1211 | | |
1212 +------------------------------------------------------------------------------ | |
1213 */ | |
1214 static int rr_leave_critical_section (T_HANDLE sem) | |
1215 { | |
1216 if (vsi_s_release (VSI_CALLER sem) NEQ VSI_OK) | |
1217 { | |
1218 SYST_TRACE ( "** Leave Critical Sec:semaphore NOT cleared **"); | |
1219 rr_semaphore_err(); | |
1220 return -1; | |
1221 } | |
1222 else | |
1223 { | |
1224 return 0; | |
1225 } | |
1226 } | |
1227 | |
1228 /* | |
1229 +------------------------------------------------------------------------------ | |
1230 | Function : em_rr_sem_init | |
1231 +------------------------------------------------------------------------------ | |
1232 | Description : | |
1233 | Initialise Semaphore | |
1234 | | |
1235 | Parameters : void | |
1236 | | |
1237 | Return : int | |
1238 | | |
1239 +------------------------------------------------------------------------------ | |
1240 */ | |
1241 GLOBAL void em_rr_sem_init (void) | |
1242 { | |
1243 sem_EM_RR = vsi_s_open (VSI_CALLER "EM_RR_SEM",1); | |
1244 | |
1245 if (sem_EM_RR NEQ VSI_ERROR) | |
1246 em_rr_sem_clear (); | |
1247 else | |
1248 SYST_TRACE ("RR:can´t open semaphore \"EM_RR_SEM\""); | |
1249 } | |
1250 | |
1251 /* | |
1252 +------------------------------------------------------------------------------ | |
1253 | Function : em_rr_sem_exit | |
1254 +------------------------------------------------------------------------------ | |
1255 | Description : | |
1256 | Close the semaphore | |
1257 | | |
1258 | Parameters : void | |
1259 | | |
1260 | Return : void | |
1261 | | |
1262 +------------------------------------------------------------------------------ | |
1263 */ | |
1264 GLOBAL void em_rr_sem_exit (void) | |
1265 { | |
1266 if (sem_EM_RR NEQ VSI_ERROR) | |
1267 vsi_s_close (VSI_CALLER sem_EM_RR); | |
1268 } | |
1269 | |
1270 /* | |
1271 +------------------------------------------------------------------------------ | |
1272 | Function : em_rr_sem_clear | |
1273 +------------------------------------------------------------------------------ | |
1274 | Description : | |
1275 | Clear semaphore | |
1276 | | |
1277 | Parameters : void | |
1278 | | |
1279 | Return : void | |
1280 | | |
1281 +------------------------------------------------------------------------------ | |
1282 */ | |
1283 LOCAL void em_rr_sem_clear (void) | |
1284 { | |
1285 if (rr_enter_critical_section(sem_EM_RR)) | |
1286 { | |
1287 return; | |
1288 } | |
1289 | |
1290 em_rr_sem_index = 0; | |
1291 if(rr_leave_critical_section(sem_EM_RR)) | |
1292 { | |
1293 return; | |
1294 } | |
1295 SYST_TRACE ( "RR:em_rr_sem_index cleared"); | |
1296 } | |
1297 | |
1298 /* | |
1299 +------------------------------------------------------------------------------ | |
1300 | Function : em_rr_sem_reset | |
1301 +------------------------------------------------------------------------------ | |
1302 | Description : | |
1303 | Reset the semaphore | |
1304 | | |
1305 | Parameters : void | |
1306 | | |
1307 | Return : UBYTE | |
1308 | | |
1309 +------------------------------------------------------------------------------ | |
1310 */ | |
1311 /*lint -esym(714,em_rr_sem_reset) | Symbol not referenced | used by ACI */ | |
1312 /*lint -esym(765,em_rr_sem_reset) | external could be made static | used by ACI */ | |
1313 | |
1314 GLOBAL void em_rr_sem_reset (void) | |
1315 { | |
1316 em_rr_sem_index = 0; | |
1317 if(rr_leave_critical_section(sem_EM_RR)) | |
1318 { | |
1319 return; | |
1320 } | |
1321 | |
1322 SYST_TRACE ( "RR:em_rr_sem_index reset OK"); | |
1323 } | |
1324 | |
1325 /* | |
1326 +------------------------------------------------------------------------------ | |
1327 | Function : em_rr_sem_read | |
1328 +------------------------------------------------------------------------------ | |
1329 | Description : | |
1330 | Read state of the semaphore. The rr semaphor will be read by | |
1331 | the engineering mode via aci. | |
1332 | | |
1333 | Parameters : void | |
1334 | | |
1335 | Return : UBYTE | |
1336 | | |
1337 +------------------------------------------------------------------------------ | |
1338 */ | |
1339 /*lint -esym(714,em_rr_sem_read) | Symbol not referenced | used by ACI */ | |
1340 /*lint -esym(765,em_rr_sem_read) | external could be made static | used by ACI */ | |
1341 | |
1342 GLOBAL void em_rr_sem_read (void) | |
1343 { | |
1344 TRACE_FUNCTION ("em_rr_sem_read()"); | |
1345 | |
1346 { | |
1347 USHORT semCount; | |
1348 | |
1349 if (vsi_s_status (VSI_CALLER sem_EM_RR, &semCount) NEQ VSI_OK) | |
1350 { | |
1351 SYST_TRACE ( "** RR:sem status error **"); | |
1352 rr_semaphore_err(); | |
1353 return; | |
1354 } | |
1355 if (semCount EQ 0) | |
1356 { | |
1357 vsi_o_ttrace(VSI_CALLER TC_EVENT, "semCount = %d", semCount); | |
1358 SYST_TRACE ( "semCount EQ 0"); | |
1359 return; | |
1360 } | |
1361 } | |
1362 | |
1363 rr_enter_critical_section(sem_EM_RR); | |
1364 } | |
1365 | |
1366 /* | |
1367 +------------------------------------------------------------------------------ | |
1368 | Function : em_rr_sem | |
1369 +------------------------------------------------------------------------------ | |
1370 | Description : | |
1371 | | |
1372 | | |
1373 | Parameters : void | |
1374 | | |
1375 | Return : TRUE/FALSE - TRUE keeps the event flag valid, | |
1376 | FALSE indicates a successful flag handle | |
1377 | | |
1378 +------------------------------------------------------------------------------ | |
1379 */ | |
1380 /*lint -esym(714,em_rr_sem) | Symbol not referenced | used by ACI */ | |
1381 /*lint -esym(765,em_rr_sem) | external could be made static | used by ACI */ | |
1382 GLOBAL UBYTE em_rr_sem (UBYTE length, UBYTE *data) | |
1383 { | |
1384 UBYTE i; | |
1385 | |
1386 TRACE_FUNCTION ("em_rr_sem()"); | |
1387 | |
1388 { | |
1389 USHORT semCount; | |
1390 | |
1391 if (vsi_s_status (VSI_CALLER sem_EM_RR, &semCount) NEQ VSI_OK) | |
1392 { | |
1393 rr_semaphore_err(); | |
1394 return FALSE; | |
1395 } | |
1396 if (semCount EQ 0) | |
1397 { | |
1398 vsi_o_ttrace(VSI_CALLER TC_EVENT, "semCount = %d", semCount); | |
1399 SYST_TRACE ( "semCount EQ 0"); | |
1400 return FALSE; | |
1401 } | |
1402 } | |
1403 | |
1404 /* | |
1405 * buffer overflow protection | |
1406 */ | |
1407 if (( em_rr_sem_index + length) > EM_RR_SEM_SIZE ) | |
1408 { | |
1409 TRACE_FUNCTION ("rr buffer overflow"); | |
1410 return FALSE; | |
1411 } | |
1412 | |
1413 if(rr_enter_critical_section(sem_EM_RR)) | |
1414 return FALSE; | |
1415 | |
1416 for (i=0; i<length; i++) | |
1417 em_rr_sem_buffer[em_rr_sem_index++] = *(data++); | |
1418 | |
1419 if(rr_leave_critical_section(sem_EM_RR)) | |
1420 { | |
1421 SYST_TRACE ( "** Unable to clear semaphore **"); | |
1422 return FALSE; | |
1423 } | |
1424 | |
1425 return TRUE; /* indicates that flag was handled */ | |
1426 } /* endfunc em_rr_sem */ | |
1427 | |
1428 | |
1429 /* | |
1430 +------------------------------------------------------------------------------ | |
1431 | Function : rr_em_first_event_check() | |
1432 +------------------------------------------------------------------------------ | |
1433 | Description : Checks if first EM-Event ocured | |
1434 | | |
1435 | Parameters : None | |
1436 | | |
1437 | Return : None | |
1438 | | |
1439 +------------------------------------------------------------------------------ | |
1440 */ | |
1441 | |
1442 /* | |
1443 ACI is informed about the first event trace, used for later data processing. | |
1444 */ | |
1445 | |
1446 LOCAL void rr_em_first_event_check(void) | |
1447 { | |
1448 TRACE_FUNCTION("rr_em_first_event_check()"); | |
1449 | |
1450 if(em_rr_trace_occured EQ 0) | |
1451 { | |
1452 PALLOC(em_notification, EM_DATA_IND); | |
1453 em_notification->entity = EM_RR; | |
1454 PSENDX(MMI, em_notification); | |
1455 em_rr_trace_occured++; | |
1456 } | |
1457 } | |
1458 | |
1459 /* | |
1460 +------------------------------------------------------------------------------ | |
1461 | Function : rr_em_pco_trace_req | |
1462 +------------------------------------------------------------------------------ | |
1463 | Description : Process the primitive EM_PCO_TRACE_REQ. | |
1464 | | |
1465 | Parameters : UBYTE pco_bitmap | |
1466 | | |
1467 | Return : void | |
1468 | | |
1469 | Purpose : with this primitive the requested EM Data is traced in the PCO. | |
1470 +------------------------------------------------------------------------------ | |
1471 */ | |
1472 GLOBAL void rr_em_pco_trace_req (T_EM_PCO_TRACE_REQ *em_pco_trace_req) | |
1473 { | |
1474 GET_INSTANCE_DATA; | |
1475 UBYTE em_cell_type = EM_CELL_NA; | |
1476 TRACE_FUNCTION("rr_em_pco_trace_req()"); | |
1477 | |
1478 /*check for SC data*/ | |
1479 if(em_pco_trace_req->pco_bitmap & EM_PCO_SC_INFO) | |
1480 { | |
1481 switch (GET_STATE (STATE_ATT)) | |
1482 { | |
1483 case ATT_IDLE: | |
1484 | |
1485 if (rr_data->nc_data[SC_INDEX].bcch_status EQ DECODED) | |
1486 { | |
1487 em_cell_type = EM_CELL_GSM; | |
1488 #ifdef GPRS | |
1489 if(rr_data->nc_data[SC_INDEX].rac NEQ NOT_PRESENT_8BIT) | |
1490 em_cell_type = EM_CELL_GPRS; | |
1491 #endif | |
1492 | |
1493 TRACE_EVENT_EM_P8("EM_SC_INFO_REQ_IDLE_DECODED: arfcn:%d c1:%d c2:%d rxlev:%d bsic:%d cell_id:%d dsc:%d cell_type:%d", | |
1494 | |
1495 rr_data->nc_data[SC_INDEX].arfcn, | |
1496 rr_data->nc_data[SC_INDEX].c1, | |
1497 rr_data->nc_data[SC_INDEX].c2, | |
1498 rr_data->nc_data[SC_INDEX].rxlev, | |
1499 rr_data->nc_data[SC_INDEX].bsic, | |
1500 rr_data->nc_data[SC_INDEX].cell_id, | |
1501 em_act_dlt, | |
1502 em_cell_type); | |
1503 | |
1504 TRACE_EVENT_EM_P5("EM_SC_INFO_REQ_IDLE_DECODED: txlev:%d tn:%d lac:%d cba:%d cbq:%d", | |
1505 rr_data->sc_data.cd.cell_options.pow_ctrl, | |
1506 rr_data->sc_data.chan_desc.tn, | |
1507 rr_data->nc_data[SC_INDEX].lai.lac, | |
1508 rr_data->nc_data[SC_INDEX].rach.cell_bar_access, | |
1509 rr_data->nc_data[SC_INDEX].c2_par.cbq); | |
1510 } | |
1511 else if (rr_data->nc_data[SC_INDEX].bcch_status EQ NON_DECODED) | |
1512 { | |
1513 TRACE_EVENT_EM_P4("EM_SC_INFO_REQ_IDLE_NON_DECODED: cell_type:%d arfcn:%d rxlev:%d bsic:%d", | |
1514 em_cell_type, | |
1515 rr_data->nc_data[SC_INDEX].arfcn, | |
1516 rr_data->nc_data[SC_INDEX].rxlev, | |
1517 rr_data->nc_data[SC_INDEX].bsic); | |
1518 } | |
1519 break; | |
1520 | |
1521 case ATT_DEDICATED: | |
1522 if (!rr_data->ms_data.measurement_report.valid) | |
1523 break; | |
1524 | |
1525 em_cell_type = EM_CELL_GSM; | |
1526 | |
1527 #ifdef GPRS | |
1528 if(rr_data->nc_data[SC_INDEX].rac NEQ NOT_PRESENT_8BIT) | |
1529 em_cell_type = EM_CELL_GPRS; | |
1530 #endif | |
1531 | |
1532 TRACE_EVENT_EM_P1("EM_SC_INFO_REQ_DEDICATED: cell_type:%d", em_cell_type); | |
1533 | |
1534 TRACE_EVENT_EM_P6("EM_SC_INFO_REQ_DEDICATED: arfcn:%d bsic:%d cell_id:%d txlev:%d tn:%d rxlev_f:%d", | |
1535 rr_data->ms_data.measurement_report.arfcn, | |
1536 rr_data->nc_data[SC_INDEX].bsic, | |
1537 rr_data->nc_data[SC_INDEX].cell_id, | |
1538 rr_data->sc_data.cd.cell_options.pow_ctrl, | |
1539 rr_data->sc_data.chan_desc.tn, | |
1540 rr_data->ms_data.measurement_report.rx_lev_full); | |
1541 | |
1542 TRACE_EVENT_EM_P6("EM_SC_INFO_REQ_DEDICATED: rxlev_s:%d rlt:%d ta:%d rxqual_f:%d rxqual_s:%d vocoder:%d", | |
1543 rr_data->ms_data.measurement_report.rx_lev_sub, | |
1544 em_act_rlt, | |
1545 rr_data->sc_data.new_ta, | |
1546 rr_data->ms_data.measurement_report.rx_qual_full, | |
1547 rr_data->ms_data.measurement_report.rx_qual_sub, | |
1548 rr_data->sc_data.ch_mode); | |
1549 | |
1550 break; | |
1551 | |
1552 default: | |
1553 break; | |
1554 }/*switch - state*/ | |
1555 }/*if - SC data*/ | |
1556 | |
1557 /*check NC data*/ | |
1558 if(em_pco_trace_req->pco_bitmap & EM_PCO_NC_INFO) | |
1559 { | |
1560 UBYTE index = 0; | |
1561 UBYTE rac = 0xff; | |
1562 | |
1563 switch (GET_STATE (STATE_ATT)) | |
1564 { | |
1565 case ATT_IDLE: | |
1566 | |
1567 TRACE_EVENT_EM_P1("EM_NC_INFO_REQ_IDLE: num_nc:%d", /*number of neighbour cells*/ | |
1568 rr_data->ms_data.measurement_report.ncells.no_of_ncells); | |
1569 | |
1570 for (index = 0; index < EM_MAX_NUM_NC ; index++) /*report cells ordered by index in NC list*/ | |
1571 { | |
1572 em_cell_type = EM_CELL_NA; | |
1573 | |
1574 if (rr_data->nc_data[index].bcch_status EQ DECODED) | |
1575 { | |
1576 em_cell_type = EM_CELL_GSM; | |
1577 rac = 0xff; | |
1578 #ifdef GPRS | |
1579 rac = rr_data->nc_data[index].rac; | |
1580 if(rr_data->nc_data[index].rac NEQ NOT_PRESENT_8BIT) | |
1581 em_cell_type = EM_CELL_GPRS; | |
1582 #endif | |
1583 | |
1584 TRACE_EVENT_EM_P8("EM_NC_INFO_REQ_IDLE_DECODED: cell_type:%d rac:%d index:%d arfcn:%d c1:%d c2:%d rxlev:%d bsic:%d", | |
1585 em_cell_type, | |
1586 rac, | |
1587 index, | |
1588 rr_data->nc_data[index].arfcn, | |
1589 rr_data->nc_data[index].c1, | |
1590 rr_data->nc_data[index].c2, | |
1591 rr_data->nc_data[index].rxlev, | |
1592 rr_data->nc_data[index].bsic); | |
1593 | |
1594 TRACE_EVENT_EM_P6("EM_NC_INFO_REQ_IDLE_DECODED: cid:%d lac:%d f_o:%ld t_a:%ld cba:%d cbq:%d", | |
1595 rr_data->nc_data[index].cell_id, | |
1596 rr_data->nc_data[index].lai.lac, | |
1597 rr_data->ms_data.measurement_report.ncells.frame_offset[index], | |
1598 rr_data->ms_data.measurement_report.ncells.time_alignmt[index], | |
1599 rr_data->nc_data[index].rach.cell_bar_access, | |
1600 rr_data->nc_data[index].c2_par.cbq); | |
1601 | |
1602 TRACE_EVENT_EM_P3("EM_NC_INFO_REQ_IDLE_DECODED: cell_resel_off:%d temp_off:%d rxlev_acc_min:%ld", | |
1603 rr_data->nc_data[index].c2_par.cell_reselect_offset, | |
1604 rr_data->nc_data[index].c2_par.temp_offset, | |
1605 rr_data->nc_data[index].select_para.rxlev_access_min); | |
1606 | |
1607 } /* if decoded */ | |
1608 | |
1609 else if (rr_data->nc_data[index].bcch_status EQ NON_DECODED) | |
1610 { | |
1611 TRACE_EVENT_EM_P4("EM_NC_INFO_REQ_IDLE_NON_DECODED: cell_type:%d arfcn:%d rxlev:%d bsic:%d", | |
1612 em_cell_type, | |
1613 rr_data->nc_data[index].arfcn, | |
1614 rr_data->nc_data[index].rxlev, | |
1615 rr_data->nc_data[index].bsic); | |
1616 } /* if non decoded */ | |
1617 } /* for */ | |
1618 | |
1619 break; | |
1620 | |
1621 case ATT_DEDICATED: | |
1622 { | |
1623 if (!rr_data->ms_data.measurement_report.valid) | |
1624 break; | |
1625 | |
1626 TRACE_EVENT_EM_P1("EM_NC_INFO_REQ_DEDICATED: num_nc:%d", | |
1627 rr_data->ms_data.measurement_report.ncells.no_of_ncells); | |
1628 | |
1629 for (index = 0; index< rr_data->ms_data.measurement_report.ncells.no_of_ncells; index++) | |
1630 { | |
1631 /*in the measurement report the cells are ordered by fieldstrength - | |
1632 non valid measurements are at the end*/ | |
1633 TRACE_EVENT_EM_P6("EM_NC_INFO_REQ_DEDICATED: index:%d arfcn:%d rx_lev:%d bsic:%d f_o:%ld t_a:%ld", | |
1634 index, | |
1635 rr_data->ms_data.measurement_report.ncells.arfcn[index], | |
1636 rr_data->ms_data.measurement_report.ncells.rx_lev[index], | |
1637 rr_data->ms_data.measurement_report.ncells.bsic[index], | |
1638 rr_data->ms_data.measurement_report.ncells.frame_offset[index], | |
1639 rr_data->ms_data.measurement_report.ncells.time_alignmt[index]); | |
1640 }/*for*/ | |
1641 | |
1642 }/*case*/ | |
1643 break; | |
1644 | |
1645 default: | |
1646 break; | |
1647 }/*switch - state*/ | |
1648 }/*if - NC data*/ | |
1649 | |
1650 /*check Location and Paging data*/ | |
1651 if(em_pco_trace_req->pco_bitmap & EM_PCO_LOC_PAG_INFO) | |
1652 { | |
1653 if (rr_data->nc_data[SC_INDEX].bcch_status EQ DECODED) | |
1654 { | |
1655 TRACE_EVENT_EM_P8("EM_LOC_PAG_INFO_REQ_DECODED: mcc:%d %d %d mnc:%d %d %d bs_pa_mfrms:%d t3212:%d", | |
1656 rr_data->nc_data[SC_INDEX].lai.mcc[0], | |
1657 rr_data->nc_data[SC_INDEX].lai.mcc[1], | |
1658 rr_data->nc_data[SC_INDEX].lai.mcc[2], | |
1659 | |
1660 /*2 digits vs. 3 digits*/ | |
1661 rr_data->nc_data[SC_INDEX].lai.mnc[2] NEQ 0xF ? rr_data->nc_data[SC_INDEX].lai.mnc[0] : | |
1662 0 , | |
1663 rr_data->nc_data[SC_INDEX].lai.mnc[2] NEQ 0xF ? rr_data->nc_data[SC_INDEX].lai.mnc[1] : | |
1664 rr_data->nc_data[SC_INDEX].lai.mnc[0], | |
1665 rr_data->nc_data[SC_INDEX].lai.mnc[2] NEQ 0xF ? rr_data->nc_data[SC_INDEX].lai.mnc[2] : | |
1666 rr_data->nc_data[SC_INDEX].lai.mnc[1], | |
1667 | |
1668 rr_data->nc_data[SC_INDEX].control_descr.bs_pa_mfrms, | |
1669 rr_data->nc_data[SC_INDEX].control_descr.t3212); | |
1670 } | |
1671 if (rr_data->ms_data.tmsi_available EQ TRUE) | |
1672 TRACE_EVENT_EM_P1("EM_LOC_PAG_INFO_REQ_TMSI: %d", rr_data->ms_data.tmsi_binary); | |
1673 }/*if - Location and Paging data*/ | |
1674 | |
1675 /*check PLMN parameters*/ | |
1676 if(em_pco_trace_req->pco_bitmap & EM_PCO_PLMN_INFO) | |
1677 { | |
1678 TRACE_EVENT_EM_P4("EM_PLMN_INFO_REQ: no_creq_max:%d re_flag:%d TXPOW_max:%d RXLEV_acc_min:%d", | |
1679 rr_data->nc_data[SC_INDEX].rach.max_retrans, | |
1680 rr_data->nc_data[SC_INDEX].rach.re, | |
1681 rr_data->nc_data[SC_INDEX].select_para.ms_txpwr_max_cch, | |
1682 rr_data->nc_data[SC_INDEX].select_para.rxlev_access_min); | |
1683 | |
1684 }/* if - PLMN parameters*/ | |
1685 | |
1686 /*check Ciphering Hopping DTX data*/ | |
1687 if(em_pco_trace_req->pco_bitmap & EM_PCO_CIPH_HOP_DTX_INFO) | |
1688 { | |
1689 UBYTE i,offset; | |
1690 /* Implements Measure#32: Row 242 */ | |
1691 char *basestr="EM_CIP_HOP_DTX_INFO_REQ_FREQ"; | |
1692 | |
1693 /*to store the trace output*/ | |
1694 char hop_freq_list[MAX_SPRINTF_STRING_LEN]; /*lint !e813 , info about length*/ | |
1695 | |
1696 if((GET_STATE(STATE_ATT) EQ ATT_DEDICATED) AND | |
1697 (GET_STATE(STATE_DAT) EQ DAT_DEDICATED)) | |
1698 { | |
1699 | |
1700 TRACE_EVENT_EM_P6("EM_CIP_HOP_DTX_INFO_REQ_DEDICATED: ciph:%d dtx:%d v_start:%d hop:%d hsn:%d arfcn:%d", | |
1701 rr_data->sc_data.ciph_on, | |
1702 rr_data->sc_data.cd.dtx, | |
1703 v_start, | |
1704 rr_data->sc_data.chan_desc.hop, | |
1705 rr_data->sc_data.chan_desc.hop NEQ H_NO ? rr_data->sc_data.chan_desc.hsn : NOT_PRESENT_16BIT, | |
1706 rr_data->sc_data.chan_desc.arfcn); | |
1707 | |
1708 if(rr_data->sc_data.chan_desc.hop NEQ H_NO) | |
1709 { | |
1710 /* Implements Measure#32: Row 242 */ | |
1711 offset = sprintf(hop_freq_list, "%s1: ", basestr); | |
1712 | |
1713 | |
1714 for (i = 0; (i < MAX_MA_CHANNELS) AND (ma[i] NEQ NOT_PRESENT_16BIT); i++) | |
1715 { | |
1716 offset += sprintf(hop_freq_list+offset, "%u ", ma[i]); | |
1717 /* | |
1718 * 4 spaces for freq + 1 blank space + 1 space for '\0' | |
1719 */ | |
1720 if(offset > MAX_SPRINTF_STRING_LEN - 6) | |
1721 { | |
1722 TRACE_EVENT_EM (hop_freq_list); | |
1723 /* Implements Measure#32: Row 245 */ | |
1724 offset = sprintf(hop_freq_list, "%s1_CONT: ", basestr); | |
1725 } | |
1726 } | |
1727 TRACE_EVENT_EM (hop_freq_list); | |
1728 TRACE_EVENT_EM_P2("EM_CIP_HOP_DTX_INFO_REQ_FREQ1: nr_arfcns:%d, maio:%d", | |
1729 i,rr_data->sc_data.chan_desc.maio); | |
1730 } /* If hopping valid */ | |
1731 | |
1732 if (v_start) | |
1733 { | |
1734 | |
1735 /* Implements Measure#32: Row 247 */ | |
1736 offset = sprintf(hop_freq_list, "%s2: ", basestr);/*before starting time*/ | |
1737 | |
1738 for (i = 0; (i < MAX_MA_CHANNELS) AND (ma2[i] NEQ NOT_PRESENT_16BIT); i++) | |
1739 { | |
1740 offset += sprintf(hop_freq_list+offset, "%u ", ma2[i]); | |
1741 if(offset > MAX_SPRINTF_STRING_LEN - 6) | |
1742 { | |
1743 TRACE_EVENT_EM (hop_freq_list); | |
1744 /* Implements Measure#32: Row 248 */ | |
1745 offset = sprintf(hop_freq_list, "%s2_CONT: ", basestr); | |
1746 } | |
1747 } | |
1748 TRACE_EVENT_EM (hop_freq_list); | |
1749 TRACE_EVENT_EM_P2("EM_CIP_HOP_DTX_INFO_REQ_FREQ2: nr_arfcns:%d, maio:%d",i, maio2); | |
1750 | |
1751 }/*if - starting time valid*/ | |
1752 } /* ATT dedicated state */ | |
1753 else | |
1754 { | |
1755 TRACE_EVENT_EM_P1("EM_CIP_HOP_DTX_INFO_REQ_IDLE: dtx:%d", rr_data->sc_data.cd.dtx); | |
1756 } /* ATT idle state */ | |
1757 }/*if - ciphering, hopping, dtx*/ | |
1758 | |
1759 /*check Power (Classmark) data*/ | |
1760 if(em_pco_trace_req->pco_bitmap & EM_PCO_POWER_INFO) | |
1761 {/*here the em_power_info_cnf struckture is used, because I couldn't find classmark definition*/ | |
1762 PALLOC(em_power_info_cnf, EM_POWER_INFO_CNF); | |
1763 memset (em_power_info_cnf, 0, sizeof (T_EM_POWER_INFO_CNF)); | |
1764 memcpy(&em_power_info_cnf->classm2, &rr_data->ms_data.classmark2, sizeof (T_classm2)); | |
1765 memcpy(&em_power_info_cnf->classm3, &rr_data->ms_data.classmark3, sizeof (T_classm3)); | |
1766 | |
1767 TRACE_EVENT_EM_P6("EM_POWER_INFO_REQ_CLASSMARK_2: rev_lev:%d es_ind:%d a5_1:%d rf_pow_cap:%d ps_cap:%d ss_screen:%d", | |
1768 em_power_info_cnf->classm2.rev_lev, em_power_info_cnf->classm2.es_ind, | |
1769 em_power_info_cnf->classm2.a5_1, em_power_info_cnf->classm2.rf_pow_cap, | |
1770 em_power_info_cnf->classm2.ps_cap, em_power_info_cnf->classm2.ss_screen); | |
1771 TRACE_EVENT_EM_P6("EM_POWER_INFO_REQ_CLASSMARK_2: sm_cap:%d freq_cap:%d class_3:%d cmsp:%d a5_3:%d a5_2:%d", | |
1772 em_power_info_cnf->classm2.sm_cap, em_power_info_cnf->classm2.freq_cap, | |
1773 em_power_info_cnf->classm2.class_3, em_power_info_cnf->classm2.cmsp, | |
1774 em_power_info_cnf->classm2.a5_3, em_power_info_cnf->classm2.a5_2); | |
1775 | |
1776 TRACE_EVENT_EM_P6("EM_POWER_INFO_REQ_CLASSMARK_3: mb_sub:%d a5_7:%d a5_6:%d a5_5:%d a5_4:%d v_radio_cap_2:%d", | |
1777 em_power_info_cnf->classm3.mb_sub, em_power_info_cnf->classm3.a5_7, | |
1778 em_power_info_cnf->classm3.a5_6, em_power_info_cnf->classm3.a5_5, | |
1779 em_power_info_cnf->classm3.a5_4, em_power_info_cnf->classm3.v_radio_cap_2); | |
1780 TRACE_EVENT_EM_P6("EM_POWER_INFO_REQ_CLASSMARK_3: ra_cap_2:%d v_ra_cap_1:%d ra_cap_1:%d v_r_sup:%d r_sup:%d v_m_s_class:%d", | |
1781 em_power_info_cnf->classm3.radio_cap_2, em_power_info_cnf->classm3.v_radio_cap_1, | |
1782 em_power_info_cnf->classm3.radio_cap_1, em_power_info_cnf->classm3.v_r_support, | |
1783 em_power_info_cnf->classm3.r_support, em_power_info_cnf->classm3.v_m_s_class); | |
1784 TRACE_EVENT_EM_P6("EM_POWER_INFO_REQ_CLASSMARK_3: m_s_class:%d ucs2_treat:%d ext_meas_cap:%d v_meas_cap:%d sw_time:%d sws_time:%d", | |
1785 em_power_info_cnf->classm3.m_s_class, em_power_info_cnf->classm3.ucs2_treat, | |
1786 em_power_info_cnf->classm3.ext_meas_cap, em_power_info_cnf->classm3.v_meas_cap, | |
1787 em_power_info_cnf->classm3.meas_cap.sw_time, em_power_info_cnf->classm3.meas_cap.sws_time); | |
1788 | |
1789 PFREE(em_power_info_cnf); | |
1790 | |
1791 }/* if - Power (Classmark) data*/ | |
1792 | |
1793 /*check Identity data*/ | |
1794 if(em_pco_trace_req->pco_bitmap & EM_PCO_IDENTITY_INFO) | |
1795 { | |
1796 TRACE_EVENT_EM_P4("EM_IDENTITY_INFO_REQ_IMEI: id_type:%d v_id:%d c_id:%d odd_even:%d", | |
1797 rr_data->ms_data.imei.ident_type, | |
1798 rr_data->ms_data.imei.v_ident_dig, | |
1799 rr_data->ms_data.imei.c_ident_dig, | |
1800 rr_data->ms_data.imei.odd_even); | |
1801 | |
1802 TRACE_EVENT_EM_P8("EM_IDENTITY_INFO_REQ: imei_1: %d %d %d %d %d %d %d %d", | |
1803 rr_data->ms_data.imei.ident_dig[0], rr_data->ms_data.imei.ident_dig[1], | |
1804 rr_data->ms_data.imei.ident_dig[2], rr_data->ms_data.imei.ident_dig[3], | |
1805 rr_data->ms_data.imei.ident_dig[4], rr_data->ms_data.imei.ident_dig[5], | |
1806 rr_data->ms_data.imei.ident_dig[6], rr_data->ms_data.imei.ident_dig[7]); | |
1807 TRACE_EVENT_EM_P8("EM_IDENTITY_INFO_REQ: imei_2: %d %d %d %d %d %d %d %d", | |
1808 rr_data->ms_data.imei.ident_dig[8], rr_data->ms_data.imei.ident_dig[9], | |
1809 rr_data->ms_data.imei.ident_dig[10], rr_data->ms_data.imei.ident_dig[11], | |
1810 rr_data->ms_data.imei.ident_dig[12], rr_data->ms_data.imei.ident_dig[13], | |
1811 rr_data->ms_data.imei.ident_dig[14], rr_data->ms_data.imei.ident_dig[15]); | |
1812 | |
1813 if (rr_data->ms_data.imsi_available) /* SIM available */ | |
1814 { | |
1815 TRACE_EVENT_EM_P4("EM_IDENTITY_INFO_REQ_IMSI: id_type:%d v_id:%d c_id:%d odd_even:%d", | |
1816 rr_data->ms_data.imsi.ident_type, | |
1817 rr_data->ms_data.imsi.v_ident_dig, | |
1818 rr_data->ms_data.imsi.c_ident_dig, | |
1819 rr_data->ms_data.imsi.odd_even); | |
1820 TRACE_EVENT_EM_P8("EM_IDENTITY_INFO_REQ: imsi_1: %d %d %d %d %d %d %d %d", | |
1821 rr_data->ms_data.imsi.ident_dig[0], rr_data->ms_data.imsi.ident_dig[1], | |
1822 rr_data->ms_data.imsi.ident_dig[2], rr_data->ms_data.imsi.ident_dig[3], | |
1823 rr_data->ms_data.imsi.ident_dig[4], rr_data->ms_data.imsi.ident_dig[5], | |
1824 rr_data->ms_data.imsi.ident_dig[6], rr_data->ms_data.imsi.ident_dig[7]); | |
1825 TRACE_EVENT_EM_P8("EM_IDENTITY_INFO_REQ: imsi_2: %d %d %d %d %d %d %d %d", | |
1826 rr_data->ms_data.imsi.ident_dig[8], rr_data->ms_data.imsi.ident_dig[9], | |
1827 rr_data->ms_data.imsi.ident_dig[10], rr_data->ms_data.imsi.ident_dig[11], | |
1828 rr_data->ms_data.imsi.ident_dig[12], rr_data->ms_data.imsi.ident_dig[13], | |
1829 rr_data->ms_data.imsi.ident_dig[14], rr_data->ms_data.imsi.ident_dig[15]); | |
1830 }/*if - SIM available*/ | |
1831 | |
1832 if (rr_data->ms_data.tmsi_available EQ TRUE) | |
1833 TRACE_EVENT_EM_P1("EM_IDENTITY_INFO_REQ: tmsi_bin: %ld", rr_data->ms_data.tmsi_binary); | |
1834 }/*if - Identity data*/ | |
1835 | |
1836 /*check AMR configuration data*/ | |
1837 if(em_pco_trace_req->pco_bitmap & EM_PCO_AMR_INFO) | |
1838 { | |
1839 if((GET_STATE(STATE_ATT) EQ ATT_DEDICATED) AND | |
1840 (GET_STATE(STATE_DAT) EQ DAT_DEDICATED)) | |
1841 { | |
1842 if(rr_data->sc_data.ch_mode EQ CM_AMR) | |
1843 { | |
1844 UBYTE amr_index,amr_nr_modes = 1; | |
1845 | |
1846 TRACE_EVENT_EM_P5("EM_AMR_INFO_REQ_DEDICATED: vocoder:%d icmi:%d icm:%d acs:%d first_codec:%d", | |
1847 rr_data->sc_data.chan_desc.chan_type, | |
1848 rr_data->sc_data.amr_conf.icmi, | |
1849 rr_data->sc_data.amr_conf.st_mode, | |
1850 rr_data->sc_data.amr_conf.set_amr, | |
1851 em_get_first_codec(rr_data->sc_data.amr_conf.set_amr)); | |
1852 | |
1853 if(rr_data->sc_data.amr_conf.v_cod_prop) | |
1854 { | |
1855 /* Number of codec modes */ | |
1856 amr_nr_modes = rr_data->sc_data.amr_conf.c_cod_prop + 1; | |
1857 | |
1858 TRACE_EVENT_EM_P1("EM_AMR_INFO_REQ_DEDICATED: amr_num_modes:%d", | |
1859 amr_nr_modes); | |
1860 | |
1861 /* Threshold and Hysteresis properties between codec modes */ | |
1862 for(amr_index=0;amr_index<amr_nr_modes;amr_index++) | |
1863 { | |
1864 TRACE_EVENT_EM_P2("EM_AMR_COD_PROP: thr:%d hyst:%d", | |
1865 rr_data->sc_data.amr_conf.cod_prop[amr_index].codec_thr, | |
1866 rr_data->sc_data.amr_conf.cod_prop[amr_index].codec_hyst); | |
1867 } | |
1868 } /* codec properties */ | |
1869 } /* AMR configured */ | |
1870 else | |
1871 { | |
1872 TRACE_EVENT_EM("EM_AMR_INFO_REQ_DEDICATED: AMR not configured"); | |
1873 } /* AMR not configured in dedicated state */ | |
1874 } /* ATT dedicated state */ | |
1875 else | |
1876 { | |
1877 TRACE_EVENT_EM("EM_AMR_INFO_REQ_IDLE: Not Applicable"); | |
1878 } /* ATT idle state */ | |
1879 } /* EM_PCO_AMR_INFO */ | |
1880 | |
1881 #if !defined (WIN32) | |
1882 /*check SW Version data*/ | |
1883 if(em_pco_trace_req->pco_bitmap & EM_PCO_SW_VERSION_INFO) | |
1884 { | |
1885 TRACE_EVENT_EM_P1("EM_SW_SIM: %s",sim_version()); | |
1886 TRACE_EVENT_EM_P1("EM_SW_SMS: %s",sms_version()); | |
1887 TRACE_EVENT_EM_P1("EM_SW_SS: %s",ss_version()) ; | |
1888 TRACE_EVENT_EM_P1("EM_SW_CC: %s",cc_version()) ; | |
1889 TRACE_EVENT_EM_P1("EM_SW_MM: %s",mm_version()) ; | |
1890 TRACE_EVENT_EM_P1("EM_SW_RR: %s",rr_version()) ; | |
1891 TRACE_EVENT_EM_P1("EM_SW_DL: %s",dl_version()) ; | |
1892 TRACE_EVENT_EM_P1("EM_SW_L1: %s",l1_version()) ; | |
1893 }/*if - SW Version data*/ | |
1894 #endif | |
1895 | |
1896 PFREE(em_pco_trace_req); | |
1897 }/*rr_em_pco_trace_req*/ | |
1898 | |
1899 | |
1900 /* ------------------ Microtec Cooperation Functions ----------*/ | |
1901 #ifdef GPRS /* changes for later: Include extra compile switch for fmm */ | |
1902 /* | |
1903 +------------------------------------------------------------------------------ | |
1904 | Function : dat_em_fmm_sc_info_req | |
1905 +------------------------------------------------------------------------------ | |
1906 | Description : This function provides the data for microtec fmm - Program | |
1907 | | |
1908 | Parameters : Primitive from EM - T_EM_FMM_SC_INFO_REQ | |
1909 | | |
1910 | Return : void | |
1911 +------------------------------------------------------------------------------ | |
1912 This function sends the latest stored data of the SC. It is only interesting | |
1913 during a GPRS connection (PTM). Therefor the ATT_STATE is ATT_IDLE (or RE_SELECTION). | |
1914 | |
1915 */ | |
1916 | |
1917 GLOBAL void dat_em_fmm_sc_info_req (T_EM_FMM_SC_INFO_REQ *em_fmm_sc_info_req) | |
1918 { | |
1919 /*GET_INSTANCE_DATA;*/ | |
1920 PFREE(em_fmm_sc_info_req); | |
1921 | |
1922 TRACE_FUNCTION ("dat_fmm_em_sc_info_req()"); | |
1923 | |
1924 #ifdef FF_WAP | |
1925 { | |
1926 PALLOC(em_fmm_sc_info_cnf, EM_FMM_SC_INFO_CNF); | |
1927 | |
1928 memset (em_fmm_sc_info_cnf, 0, sizeof (T_EM_FMM_SC_INFO_CNF)); | |
1929 | |
1930 switch (GET_STATE (STATE_ATT)) | |
1931 { | |
1932 case ATT_IDLE: | |
1933 if (rr_data->nc_data[SC_INDEX].bcch_status EQ DECODED) | |
1934 { | |
1935 em_fmm_sc_info_cnf->arfcn = rr_data->nc_data[SC_INDEX].arfcn; | |
1936 em_fmm_sc_info_cnf->c1 = rr_data->nc_data[SC_INDEX].c1; | |
1937 em_fmm_sc_info_cnf->c2 = rr_data->nc_data[SC_INDEX].c2; | |
1938 em_fmm_sc_info_cnf->rac = rr_data->nc_data[SC_INDEX].rac; | |
1939 em_fmm_sc_info_cnf->hyst = rr_data->nc_data[SC_INDEX].select_para.cell_resel_hyst; | |
1940 em_fmm_sc_info_cnf->c32 = rr_data->nc_data[SC_INDEX].c32; /*c32_used abfragen ?*/ | |
1941 em_fmm_sc_info_cnf->gprs_prio_class = rr_data->nc_data[SC_INDEX].cr_par.priority_class; | |
1942 } | |
1943 else if (rr_data->nc_data[SC_INDEX].bcch_status EQ NON_DECODED) | |
1944 { | |
1945 em_fmm_sc_info_cnf->arfcn = rr_data->nc_data[SC_INDEX].arfcn; | |
1946 } | |
1947 break; | |
1948 case ATT_CS3: | |
1949 break; /* Cell reselection - if needed can be included later*/ | |
1950 default: | |
1951 break; | |
1952 } /*switch*/ | |
1953 | |
1954 /* TRACE_EVENT_P7("arfcn:%d c1:%d c2:%d rac:%d hyst:%d c32:%d prio:%d" , em_fmm_sc_info_cnf->arfcn,\ | |
1955 em_fmm_sc_info_cnf->c1 , em_fmm_sc_info_cnf->c2 , em_fmm_sc_info_cnf->rac , em_fmm_sc_info_cnf->hyst,\ | |
1956 em_fmm_sc_info_cnf->c32, em_fmm_sc_info_cnf->gprs_prio_class);*/ | |
1957 | |
1958 PSENDX( WAP, em_fmm_sc_info_cnf); | |
1959 } | |
1960 | |
1961 #endif /*FF_WAP*/ | |
1962 | |
1963 } | |
1964 | |
1965 | |
1966 /* | |
1967 +------------------------------------------------------------------------------ | |
1968 | Function : dat_em_fmm_nc_info_req | |
1969 +------------------------------------------------------------------------------ | |
1970 | Description : Process the primitive EM_FMM_NC_INFO_REQ. | |
1971 | | |
1972 | Parameters : Primitive from EM - T_EM_FMM_NC_INFO_REQ | |
1973 | | |
1974 | Return : void | |
1975 +------------------------------------------------------------------------------ | |
1976 This function sends the latest stored data of the NC. It is only interesting | |
1977 during a GPRS connection (PTM). Therefor the ATT_STATE is ATT_IDLE or RE_SELECTION. | |
1978 So the measurement report results should also be available in the nc_data. | |
1979 */ | |
1980 GLOBAL void dat_em_fmm_nc_info_req (T_EM_FMM_NC_INFO_REQ *em_fmm_nc_info_req) | |
1981 { | |
1982 /*GET_INSTANCE_DATA;*/ | |
1983 PFREE(em_fmm_nc_info_req); | |
1984 | |
1985 TRACE_FUNCTION ("dat_em_fmm_nc_info_req()"); | |
1986 | |
1987 #ifdef FF_WAP | |
1988 { | |
1989 UBYTE index = 0, index2 = 0; | |
1990 PALLOC(em_fmm_nc_info_cnf, EM_FMM_NC_INFO_CNF); | |
1991 | |
1992 memset (em_fmm_nc_info_cnf, 0, sizeof (T_EM_FMM_NC_INFO_CNF)); | |
1993 | |
1994 switch (GET_STATE (STATE_ATT)) | |
1995 { | |
1996 case ATT_IDLE: | |
1997 em_fmm_nc_info_cnf->no_ncells = rr_data->ms_data.measurement_report.ncells.no_of_ncells; | |
1998 for (index = index2 = 0; index< EM_MAX_NUM_NC; index++) | |
1999 { | |
2000 if (rr_data->nc_data[index].bcch_status EQ DECODED) | |
2001 { | |
2002 em_fmm_nc_info_cnf->arfcn_nc[index2] = rr_data->nc_data[index].arfcn; | |
2003 em_fmm_nc_info_cnf->c2_nc[index2] = rr_data->nc_data[index].c2; | |
2004 em_fmm_nc_info_cnf->rac_nc[index2] = rr_data->nc_data[index].rac; | |
2005 em_fmm_nc_info_cnf->c31_nc[index2] = rr_data->nc_data[index].c31; | |
2006 em_fmm_nc_info_cnf->c32_nc[index2] = rr_data->nc_data[index].c32; | |
2007 em_fmm_nc_info_cnf->gprs_prio_class_nc[index2] = rr_data->nc_data[index].cr_par.priority_class; | |
2008 index2++; | |
2009 } /* if decoded */ | |
2010 | |
2011 else if (rr_data->nc_data[index].bcch_status EQ NON_DECODED) | |
2012 { | |
2013 em_fmm_nc_info_cnf->arfcn_nc[index] = rr_data->nc_data[index].arfcn; | |
2014 } /* if non decoded */ | |
2015 } /* for */ | |
2016 | |
2017 break; | |
2018 default: | |
2019 break; | |
2020 }/*switch*/ | |
2021 | |
2022 /* for (index = 0 ; index < EM_MAX_NUM_NC ; index++) | |
2023 TRACE_EVENT_P6("arfcn:%d c2:%d rac:%d c31:%d c32:%d prio:%d", em_fmm_nc_info_cnf->arfcn_nc[index],\ | |
2024 em_fmm_nc_info_cnf->c2_nc[index], em_fmm_nc_info_cnf->rac_nc[index],\ | |
2025 em_fmm_nc_info_cnf->c31_nc[index], em_fmm_nc_info_cnf->c32_nc[index],\ | |
2026 em_fmm_nc_info_cnf->gprs_prio_class_nc[index]);*/ | |
2027 | |
2028 PSENDX( WAP, em_fmm_nc_info_cnf); | |
2029 } | |
2030 | |
2031 #endif /*FF_WAP*/ | |
2032 | |
2033 | |
2034 } | |
2035 | |
2036 /* | |
2037 +------------------------------------------------------------------------------ | |
2038 | Function : dat_em_fmm_reselection_start_ind | |
2039 +------------------------------------------------------------------------------ | |
2040 | Description : Indicates the start of an cell reselection to FMM | |
2041 | | |
2042 | Parameters : void | |
2043 | | |
2044 | Return : void | |
2045 +------------------------------------------------------------------------------ | |
2046 */ | |
2047 GLOBAL void dat_em_fmm_reselection_start_ind (void) | |
2048 { | |
2049 /*GET_INSTANCE_DATA;*/ | |
2050 TRACE_FUNCTION("dat_em_fmm_reselection_start_ind()"); | |
2051 #ifdef FF_WAP | |
2052 { | |
2053 PALLOC(em_fmm_reselection_start_ind, EM_FMM_RESELECTION_START_IND); | |
2054 memset (em_fmm_reselection_start_ind, 0, sizeof (T_EM_FMM_RESELECTION_START_IND)); | |
2055 em_fmm_reselection_start_ind->arfcn = rr_data->nc_data[rr_data->reselect_index].arfcn; | |
2056 em_fmm_reselection_start_ind->rac = rr_data->nc_data[rr_data->reselect_index].rac; | |
2057 em_fmm_reselection_start_ind->res_type = rr_data->sc_data.selection_type; | |
2058 | |
2059 /* TRACE_EVENT_P3("em_fmm_reselection_start_ind %d,%d,%d",em_fmm_reselection_start_ind->arfcn, | |
2060 em_fmm_reselection_start_ind->rac,em_fmm_reselection_start_ind->res_type );*/ | |
2061 | |
2062 PSENDX(WAP, em_fmm_reselection_start_ind); | |
2063 } | |
2064 | |
2065 #endif /*FF_WAP */ | |
2066 | |
2067 } | |
2068 | |
2069 /* | |
2070 +------------------------------------------------------------------------------ | |
2071 | Function : dat_em_fmm_reselection_end_ind | |
2072 +------------------------------------------------------------------------------ | |
2073 | Description : Indicates the end of an cell reselection to FMM | |
2074 | | |
2075 | Parameters : void | |
2076 | | |
2077 | Return : void | |
2078 +------------------------------------------------------------------------------ | |
2079 */ | |
2080 GLOBAL void dat_em_fmm_reselection_end_ind (void) | |
2081 { | |
2082 /*GET_INSTANCE_DATA;*/ | |
2083 TRACE_FUNCTION("dat_em_fmm_reselection_end_ind()"); | |
2084 #ifdef FF_WAP | |
2085 { | |
2086 PALLOC(em_fmm_resel_end_ind, EM_FMM_RESELECTION_END_IND); | |
2087 memset (em_fmm_resel_end_ind, 0, sizeof (T_EM_FMM_RESELECTION_END_IND)); | |
2088 em_fmm_resel_end_ind->arfcn = rr_data->nc_data[SC_INDEX].arfcn; | |
2089 em_fmm_resel_end_ind->rac = rr_data->nc_data[SC_INDEX].rac; | |
2090 /* TRACE_EVENT_P2("em_fmm_reselection_end_ind %d,%d",em_fmm_resel_end_ind->arfcn, | |
2091 em_fmm_resel_end_ind->rac);*/ | |
2092 | |
2093 PSENDX(WAP, em_fmm_resel_end_ind); | |
2094 } | |
2095 | |
2096 #endif /*FF_WAP*/ | |
2097 | |
2098 } | |
2099 | |
2100 | |
2101 #endif /* GPRS */ | |
2102 | |
2103 #endif /* FF_EM_MODE */ | |
2104 | |
2105 | |
2106 | |
2107 #endif /* RR_EM_C */ |