FreeCalypso > hg > freecalypso-citrine
comparison g23m-gsm/rr/rr_forp.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 : Decoding of Air Interface Messages. | |
18 +----------------------------------------------------------------------------- | |
19 */ | |
20 | |
21 #ifndef RR_FORC_C | |
22 #define RR_FORC_C | |
23 | |
24 #include "config.h" | |
25 #include "fixedconf.h" | |
26 #include "condat-features.h" | |
27 | |
28 #define ENTITY_RR | |
29 | |
30 /*==== INCLUDES ===================================================*/ | |
31 | |
32 #include <string.h> | |
33 #include <stdlib.h> | |
34 #include <stddef.h> /* offsetof */ | |
35 #include "typedefs.h" | |
36 #include "pcm.h" | |
37 #include "pconst.cdg" | |
38 #include "mconst.cdg" | |
39 #include "message.h" | |
40 #include "ccdapi.h" | |
41 #include "vsi.h" | |
42 #include "custom.h" | |
43 #include "gsm.h" | |
44 #include "prim.h" | |
45 #include "tok.h" | |
46 #include "rr.h" | |
47 #include "rr_em.h" | |
48 | |
49 /*==== EXPORT =====================================================*/ | |
50 | |
51 /*==== PRIVAT =====================================================*/ | |
52 | |
53 /*==== VARIABLES ==================================================*/ | |
54 | |
55 | |
56 /*==== FUNCTIONS ==================================================*/ | |
57 | |
58 | |
59 | |
60 LOCAL void for_unitdata_ind_sys_info_5_5bis(T_SI_TYPE si_type, T_MPH_UNITDATA_IND *mph_unitdata_ind, | |
61 UBYTE *ba_index, BUF_neigh_cell_desc *neigh_cell_desc, | |
62 T_LIST *list,T_VOID_STRUCT *sys_info_5_5bis); | |
63 | |
64 LOCAL void for_unitdata_ind_sys_info_2_2bis(T_SI_TYPE si_type, T_MPH_UNITDATA_IND *mph_unitdata_ind, | |
65 BUF_neigh_cell_desc *neigh_cell_desc, | |
66 T_LIST *list, T_VOID_STRUCT *sys_info_2_2bis); | |
67 | |
68 LOCAL void for_unitdata_ind_si3_si4(T_SI_TYPE si_type, T_MPH_UNITDATA_IND *mph_unitdata_ind, | |
69 T_loc_area_ident *loc_area_ident, | |
70 T_VOID_STRUCT *sys_info_3_4); | |
71 /* | |
72 * ------------------------------------------------------------------- | |
73 * PRIMITIVE Processing functions | |
74 * ------------------------------------------------------------------- | |
75 */ | |
76 | |
77 /* | |
78 +--------------------------------------------------------------------+ | |
79 | PROJECT : GSM-PS (6147) MODULE : RR_FOR | | |
80 | STATE : code ROUTINE : for_dl_data_ind | | |
81 +--------------------------------------------------------------------+ | |
82 | |
83 PURPOSE : Process the primitive DL_DATA_IND received from RR. | |
84 | |
85 */ | |
86 | |
87 GLOBAL void for_dl_data_ind (T_DL_DATA_IND *dl_data_ind_orig) | |
88 { | |
89 GET_INSTANCE_DATA; | |
90 UBYTE pd; | |
91 UBYTE ti; | |
92 UBYTE mt; | |
93 U8 *payload; | |
94 U16 length; | |
95 | |
96 #if defined FF_EOTD | |
97 UBYTE other_than_applic = 1; | |
98 #endif /* FF_EOTD */ | |
99 | |
100 PPASS(dl_data_ind_orig, dl_data_ind, DL_DATA_IND); | |
101 | |
102 TRACE_FUNCTION ("for_dl_data_ind()"); | |
103 | |
104 if (dl_data_ind->sdu.l_buf < 16) | |
105 { | |
106 /* | |
107 * message too short, Ignore the message. | |
108 */ | |
109 PFREE (dl_data_ind); | |
110 return; | |
111 } | |
112 /* | |
113 * get protocol discriminator and transaction identifier | |
114 * from the message. | |
115 */ | |
116 GET_PD (dl_data_ind->sdu, pd); | |
117 GET_TI (dl_data_ind->sdu, ti); | |
118 | |
119 /* | |
120 * check the protocol discriminator. | |
121 */ | |
122 switch (pd) | |
123 { | |
124 case PD_TST: | |
125 /* | |
126 * Test messages are handled in RR. | |
127 */ | |
128 if (ti NEQ 0) | |
129 { | |
130 /* | |
131 * The skip-indicator (equal to transaction identifier in higher layer) | |
132 * must be set to 0, else ignore the message. | |
133 */ | |
134 PFREE (dl_data_ind); | |
135 break; | |
136 } | |
137 | |
138 /* | |
139 * For test messages the handling is directly coded in RR without CCD. | |
140 * Get the message type: | |
141 */ | |
142 ccd_decodeByte (dl_data_ind->sdu.buf, (USHORT)(dl_data_ind->sdu.o_buf+8),8, | |
143 &mt); | |
144 | |
145 switch (mt) | |
146 { | |
147 case OPEN_LOOP_CMD: | |
148 /* | |
149 * Open a TCH loop | |
150 */ | |
151 dat_for_open_loop_cmd (dl_data_ind); | |
152 break; | |
153 | |
154 case CLOSE_TCH_LOOP_CMD: | |
155 /* | |
156 * Close a TCH loop | |
157 */ | |
158 dat_for_close_loop_cmd (dl_data_ind, dl_data_ind->sdu.buf[ | |
159 (dl_data_ind->sdu.o_buf+16)>>3]); | |
160 break; | |
161 | |
162 case TEST_INTERFACE: | |
163 /* | |
164 * Handling of the test interface message for DAI purposes. | |
165 */ | |
166 dat_for_test_interface (dl_data_ind, dl_data_ind->sdu.buf[ | |
167 (dl_data_ind->sdu.o_buf+16)>>3]); | |
168 break; | |
169 | |
170 default: | |
171 /* | |
172 * Unknown message type, Ignore the message. | |
173 */ | |
174 PFREE (dl_data_ind); | |
175 break; | |
176 } | |
177 break; | |
178 | |
179 case PD_RR: | |
180 /* | |
181 * RR Messages | |
182 */ | |
183 if (ti NEQ 0) | |
184 { | |
185 /* | |
186 * The skip-indicator (equal to transaction identifier in higher layer) | |
187 * must be set to 0, else ignore the message. | |
188 */ | |
189 PFREE (dl_data_ind); | |
190 break; | |
191 } | |
192 | |
193 payload = &(dl_data_ind->sdu.buf[0]); /*Beginning of the buffer */ | |
194 payload += (dl_data_ind->sdu.o_buf) >> 3; /* Plus offset (bytes) */ | |
195 | |
196 length = BYTELEN ( dl_data_ind->sdu.l_buf ); /* Length (bytes) */ | |
197 | |
198 | |
199 /* | |
200 * modify length and offset of the incoming message toskip protocol | |
201 * discriminator and transaction identifier. CCD starts with the | |
202 * message type. | |
203 */ | |
204 | |
205 dl_data_ind->sdu.l_buf -= 8; | |
206 dl_data_ind->sdu.o_buf += 8; | |
207 | |
208 /* | |
209 * clean the error field and the output of CCD. | |
210 */ | |
211 memset (&rr_data->ms_data.error, 0, sizeof (T_ERROR)); | |
212 memset (_decodedMsg, 0, MAX_MSTRUCT_LEN_RR); | |
213 | |
214 /* | |
215 * decode the message with CCD. | |
216 */ | |
217 if (ccd_decodeMsg (CCDENT_RR, DOWNLINK, | |
218 (T_MSGBUF *)&dl_data_ind->sdu, | |
219 _decodedMsg, NOT_PRESENT_8BIT) NEQ ccdOK) | |
220 { | |
221 /* | |
222 * CCD has detected an error | |
223 */ | |
224 USHORT parlist[6]; | |
225 UBYTE ccd_err; | |
226 | |
227 /* | |
228 * get the first detected error from CCD. | |
229 */ | |
230 memset (parlist,0, sizeof (parlist)); | |
231 ccd_err = ccd_getFirstError (CCDENT_RR, parlist); | |
232 | |
233 do | |
234 { | |
235 /* | |
236 * Error Handling | |
237 */ | |
238 switch (ccd_err) | |
239 { | |
240 case ERR_MSG_LEN: /* some exceeds entire message length */ | |
241 case ERR_COMPREH_REQUIRED: /* Comprehension required */ | |
242 case ERR_MAND_ELEM_MISS: /* Mandatory elements missing */ | |
243 if((_decodedMsg[0] EQ D_CHAN_REL ) AND (ccd_err EQ ERR_MAND_ELEM_MISS) ) | |
244 { | |
245 break; /* actions same as normal release */ | |
246 } | |
247 else | |
248 { | |
249 dat_send_rr_status_msg (RRC_INVALID_MAN_INFO); | |
250 PFREE (dl_data_ind); | |
251 return; | |
252 } | |
253 | |
254 case ERR_INVALID_MID: /* unknown message type is handled below */ | |
255 break; | |
256 case ERR_IE_NOT_EXPECTED: | |
257 case ERR_IE_SEQUENCE: | |
258 case ERR_MAX_IE_EXCEED: | |
259 case ERR_MAX_REPEAT: | |
260 TRACE_EVENT_P1("CCD error=%d ignored here", ccd_err); | |
261 break; | |
262 default: | |
263 TRACE_ERROR("unknow CCD return"); | |
264 break; | |
265 } | |
266 ccd_err = ccd_getNextError (CCDENT_RR, parlist); | |
267 } | |
268 while (ccd_err NEQ ERR_NO_MORE_ERROR); | |
269 } | |
270 | |
271 /* | |
272 * depending on the message type | |
273 */ | |
274 | |
275 RR_BINDUMP (payload,length,ARFCN_NOT_PRESENT, | |
276 FRAME_NUM_NOT_PRESENT,DOWNLINK); | |
277 | |
278 switch (_decodedMsg[0]) | |
279 { | |
280 case D_ASSIGN_CMD: | |
281 /* | |
282 * Assignment command message to start an intracell | |
283 * handover. Check the message content and configure layer 1. | |
284 */ | |
285 for_check_assign_cmd (dl_data_ind, (T_D_ASSIGN_CMD *)_decodedMsg); | |
286 break; | |
287 | |
288 case D_CHAN_REL: | |
289 { | |
290 /* | |
291 * channel release message to release a RR-connection. | |
292 */ | |
293 MCAST (chan_rel, D_CHAN_REL); | |
294 | |
295 if (chan_rel->v_ba_range) | |
296 { | |
297 /* | |
298 * if the optional information element BA_RANGE is | |
299 * included check the frequencies. | |
300 */ | |
301 if (! for_check_ba_range (&chan_rel->ba_range)) | |
302 { | |
303 /* | |
304 * set the optional element as not available if | |
305 * it contains a non-supported channel number. | |
306 */ | |
307 chan_rel->v_ba_range = FALSE; | |
308 } | |
309 } | |
310 | |
311 /* | |
312 * start processing of the channel release message. | |
313 */ | |
314 dat_for_chan_rel (dl_data_ind, chan_rel); | |
315 break; | |
316 } | |
317 | |
318 case D_CHAN_MOD: | |
319 { | |
320 /* | |
321 * channel mode modify message to handle a | |
322 * changed channel mode. | |
323 */ | |
324 MCAST (chmod, D_CHAN_MOD); /* T_D_CHAN_MOD */ | |
325 | |
326 switch( chmod->chan_desc.chan_type ) | |
327 { | |
328 case TCH_H_S0: | |
329 case TCH_H_S1: | |
330 switch(chmod->chan_mode) | |
331 { | |
332 case CM_DATA_12_0: /* data 12 k */ | |
333 case CM_DATA_6_0: /* data 6 k */ | |
334 case CM_DATA_3_6: /* data 3.6 k */ | |
335 case CM_DATA_14_4: /* data 14.4 k */ | |
336 if(FldGet(rr_data->mscap.datCap2, DHRSup) EQ 0) | |
337 { | |
338 for_set_content_error (RRC_CHANNEL_MODE); | |
339 TRACE_EVENT("Half Rate Data NOT supported"); | |
340 } | |
341 break; | |
342 default: | |
343 break; | |
344 } | |
345 break; | |
346 default: | |
347 break; | |
348 } | |
349 | |
350 /* | |
351 * check the channel description | |
352 */ | |
353 for_check_channel_descr (&chmod->chan_desc); | |
354 | |
355 /* | |
356 * check the channel mode | |
357 */ | |
358 for_check_channel_mode (chmod->chan_mode); | |
359 | |
360 /* | |
361 * if there any problem in channel mode or channel description | |
362 * the CHANNEL MODE ACK message will be sent with old channel type/mode | |
363 */ | |
364 if(rr_data->ms_data.error.val EQ RRC_CHANNEL_MODE) | |
365 { | |
366 dat_for_chan_mod (dl_data_ind, chmod); | |
367 break; | |
368 } | |
369 | |
370 /* | |
371 * if the message contains a channel mode information element which indicating AMR | |
372 * and the multirate configuration IEI exists, check the multirate configuration IEI. | |
373 */ | |
374 | |
375 if ( (chmod->chan_mode EQ CM_AMR) AND (chmod->v_multirate_conf) ) | |
376 { | |
377 /* | |
378 * From 3GPP TS 04.08 | |
379 * | |
380 * "Channel Description IE" in Channel Mode Modify | |
381 * | |
382 * This is sufficient to identify the channel in the case of a TCH/H + TCH/H configuration. | |
383 * If used for a multislot configuration, the IE shall describe the present channel configuration with | |
384 * TN indicating the main channel. | |
385 * | |
386 * The IE shall not indicate a new channel configuration when included in the Channel Mode Modify message. | |
387 */ | |
388 for_check_multirate_conf( &chmod->multirate_conf, rr_data->sc_data.chan_desc.chan_type); | |
389 } | |
390 | |
391 /* | |
392 * From 3GPP TS 04.18 Sec. 3.4.6.1.3 Abnormal cases | |
393 * If any inconsistencies in MultiRate IEs then ignore the Channel Mode Modify | |
394 * and shall not send the CHANNEL MODE MODIFY | |
395 */ | |
396 if(rr_data->ms_data.error.val EQ RRC_CHANNEL_MODE) | |
397 { | |
398 PFREE(dl_data_ind); | |
399 break; | |
400 } | |
401 | |
402 /* | |
403 * process the message | |
404 * There is no error in Channel Type, Channel Descr and no inconsistency in Multirate IEs | |
405 */ | |
406 | |
407 dat_for_chan_mod (dl_data_ind, chmod); | |
408 break; | |
409 } | |
410 | |
411 case D_CIPH_CMD: | |
412 { | |
413 /* | |
414 * change the cipher mode setting | |
415 */ | |
416 | |
417 MCAST (ciph_cmd, D_CIPH_CMD); /* T_D_CIPH_CMD */ | |
418 | |
419 /* | |
420 * check the message content | |
421 */ | |
422 for_check_cipher_mode_set (&ciph_cmd->ciph_mode_set); | |
423 | |
424 /* | |
425 * process the message | |
426 */ | |
427 | |
428 dat_for_ciph_cmd (dl_data_ind, ciph_cmd); | |
429 break; | |
430 } | |
431 | |
432 case D_FREQ_REDEF: | |
433 { | |
434 /* | |
435 * frequency redefinition message to change the frequency | |
436 * hopping list during a connection. | |
437 */ | |
438 | |
439 /*lint -e813*/ | |
440 T_LIST cell_chan_desc; | |
441 | |
442 MCAST (freq_redef, D_FREQ_REDEF); /* T_D_FREQ_REDEF */ | |
443 | |
444 /* | |
445 * check the channel description | |
446 */ | |
447 for_check_channel_descr (&freq_redef->chan_desc); | |
448 | |
449 if (freq_redef->v_cell_chan_desc) | |
450 { | |
451 /* | |
452 * If the message contains a new cell channel description | |
453 * build a channel number list. This new list will replace | |
454 * the current list stored in RR. | |
455 */ | |
456 for_create_channel_list ((T_f_range *)&freq_redef->cell_chan_desc, | |
457 &cell_chan_desc); | |
458 } | |
459 | |
460 | |
461 /* | |
462 * process the message. | |
463 */ | |
464 dat_for_freq_redef (dl_data_ind, freq_redef, &cell_chan_desc); | |
465 break; | |
466 } | |
467 | |
468 case D_HANDOV_CMD: | |
469 /* | |
470 * check the message content and process the handover message. | |
471 */ | |
472 | |
473 for_check_handov_cmd (dl_data_ind, (T_D_HANDOV_CMD *)_decodedMsg); | |
474 break; | |
475 | |
476 case B_RR_STATUS: | |
477 /* | |
478 * incoming status messages are ignored. | |
479 */ | |
480 | |
481 EM_RR_STATUS_RECEIVED; | |
482 | |
483 PFREE (dl_data_ind); | |
484 break; | |
485 | |
486 case D_CLASS_ENQ: | |
487 /* | |
488 * the network requests the mobile station classmark. | |
489 */ | |
490 #ifdef REL99 | |
491 dat_for_class_enq (dl_data_ind, (T_D_CLASS_ENQ *)_decodedMsg); | |
492 #else | |
493 dat_for_class_enq (dl_data_ind); | |
494 #endif | |
495 break; | |
496 | |
497 #ifdef GPRS | |
498 case D_PDCH_ASS_CMD: | |
499 dl_data_ind->sdu.l_buf += 8; | |
500 dl_data_ind->sdu.o_buf -= 8; | |
501 rr_data->gprs_data.tbf_est = TBF_EST_NONE; | |
502 dat_rrgrr_data_ind (dl_data_ind); | |
503 break; | |
504 | |
505 case D_CHANGE_ORDER: | |
506 dl_data_ind->sdu.l_buf += 8; | |
507 dl_data_ind->sdu.o_buf -= 8; | |
508 rr_data->gprs_data.tbf_est = TBF_EST_NONE; | |
509 dat_rrgrr_change_order (dl_data_ind, (T_D_CHANGE_ORDER *)_decodedMsg); | |
510 break; | |
511 #endif | |
512 | |
513 #if defined FF_EOTD | |
514 case B_APPLIC_INFO: | |
515 { | |
516 MCAST (b_applic_info, B_APPLIC_INFO); | |
517 dat_for_applic_info (b_applic_info); | |
518 other_than_applic = 0; | |
519 PFREE(dl_data_ind); | |
520 break; | |
521 } | |
522 #endif /* FF_EOTD */ | |
523 | |
524 default: /* switch (_decodedMsg[0]) */ | |
525 /* | |
526 * Unknown or not supported message | |
527 * Answer with a RR STATUS message. | |
528 */ | |
529 dat_send_rr_status_msg (RRC_MSG_NOT_IMPL); | |
530 | |
531 PFREE (dl_data_ind); | |
532 break; | |
533 } | |
534 break; | |
535 | |
536 default: /* switch (pd) */ | |
537 /* | |
538 * all other protocol discriminators are for upper layer | |
539 * and will be forwarded to MM. | |
540 */ | |
541 dat_for_l3_data_ind (dl_data_ind); | |
542 break; | |
543 } | |
544 | |
545 #if defined FF_EOTD | |
546 if ( other_than_applic AND rr_data->applic_rx.state EQ SAI_SEGM ) | |
547 rr_applic_rx_init ( &rr_data->applic_rx ); | |
548 #endif /* FF_EOTD */ | |
549 } | |
550 | |
551 /* | |
552 +--------------------------------------------------------------------+ | |
553 | PROJECT : GSM-PS (6147) MODULE : RR_FOR | | |
554 | STATE : code ROUTINE : for_mph_unitdata_ind | | |
555 +--------------------------------------------------------------------+ | |
556 | |
557 PURPOSE : Reception of unacknowledged message on BCCH, AGCH or PCH. | |
558 | |
559 */ | |
560 | |
561 GLOBAL void for_mph_unitdata_ind (T_MPH_UNITDATA_IND *mph_unitdata_ind_orig) | |
562 { | |
563 GET_INSTANCE_DATA; | |
564 T_LIST list; /* used for storing a neighbourcell list */ | |
565 UBYTE pd; /* Protocol discriminator */ | |
566 UBYTE ti; /* Transaction identifier (equal to skip indicator) */ | |
567 U8 *payload; | |
568 U16 length; | |
569 | |
570 PPASS(mph_unitdata_ind_orig, mph_unitdata_ind, MPH_UNITDATA_IND); | |
571 | |
572 if (mph_unitdata_ind->sdu.l_buf < 16) | |
573 { | |
574 PFREE (mph_unitdata_ind); /* message too short ignore message */ | |
575 return; | |
576 } | |
577 /* | |
578 * Extract the protocol discriminator and the | |
579 * skip indicator from the unacknowledged message. | |
580 */ | |
581 GET_UI_PD (mph_unitdata_ind->sdu, pd); | |
582 GET_UI_TI (mph_unitdata_ind->sdu, ti); | |
583 | |
584 payload = &(mph_unitdata_ind->sdu.buf[0]); /*Beginning of the buffer */ | |
585 payload += (mph_unitdata_ind->sdu.o_buf) >> 3; /*Plus offset (bytes) */ | |
586 | |
587 length = BYTELEN ( mph_unitdata_ind->sdu.l_buf ); /*Length (Bytes)*/ | |
588 | |
589 /* | |
590 * Skip both the PD and TI in the message by modifying the pointer | |
591 * in the sdu to the begin of the message type. | |
592 */ | |
593 mph_unitdata_ind->sdu.l_buf -= 8; | |
594 mph_unitdata_ind->sdu.o_buf += 8; | |
595 | |
596 /* | |
597 * The protocol discriminator must be RR. | |
598 * The skip indicator (TI) must be 0. (GSM 04.08, 10.3.1) | |
599 */ | |
600 if (! (pd EQ PD_RR AND ti EQ 0)) | |
601 { | |
602 PFREE (mph_unitdata_ind); | |
603 return; | |
604 } | |
605 | |
606 /* | |
607 * Clear error field and CCD result field. | |
608 */ | |
609 memset (&rr_data->ms_data.error,0, sizeof(rr_data->ms_data.error)); | |
610 memset (_decodedMsg,0, sizeof(_decodedMsg)); | |
611 | |
612 /* | |
613 * Decode the message with CCD. | |
614 */ | |
615 if (ccd_decodeMsg (CCDENT_RR, DOWNLINK, | |
616 (T_MSGBUF *)&mph_unitdata_ind->sdu, | |
617 (UBYTE *)_decodedMsg, | |
618 NOT_PRESENT_8BIT) NEQ ccdOK) | |
619 { | |
620 /* | |
621 * CCD has detected an error | |
622 */ | |
623 UBYTE ccd_err; | |
624 USHORT parlist [6]; | |
625 | |
626 /* | |
627 * get the first error | |
628 */ | |
629 ccd_err = ccd_getFirstError (CCDENT_RR, parlist); | |
630 do | |
631 { | |
632 /* | |
633 * Error Handling | |
634 */ | |
635 switch (ccd_err) | |
636 { | |
637 case ERR_INVALID_MID: /* unknown message type */ | |
638 case ERR_MSG_LEN: /* some IE exceeds entire message length */ | |
639 case ERR_COMPREH_REQUIRED: /* comprehension required */ | |
640 case ERR_MAND_ELEM_MISS: /* Mandatory elements missing */ | |
641 TRACE_EVENT_P2("message with mt=%d ignored due to CCD error=%d", | |
642 mph_unitdata_ind->sdu.buf[mph_unitdata_ind->sdu.o_buf>>3], | |
643 ccd_err); | |
644 PFREE (mph_unitdata_ind); /* in unacknowledged mode ignore message */ | |
645 return; | |
646 | |
647 case ERR_IE_NOT_EXPECTED: | |
648 case ERR_IE_SEQUENCE: | |
649 case ERR_MAX_IE_EXCEED: | |
650 case ERR_MAX_REPEAT: | |
651 TRACE_EVENT_P1("CCD error=%d ignored here", ccd_err); | |
652 break; | |
653 default: | |
654 TRACE_ERROR("unknown CCD return"); | |
655 break; | |
656 } | |
657 ccd_err = ccd_getNextError (CCDENT_RR, parlist); | |
658 } | |
659 while (ccd_err NEQ ERR_NO_MORE_ERROR); | |
660 } | |
661 | |
662 RR_BINDUMP (payload,length,mph_unitdata_ind->arfcn, | |
663 mph_unitdata_ind->fn,DOWNLINK); | |
664 | |
665 /* | |
666 * depending on the message type | |
667 */ | |
668 switch (_decodedMsg[0]) | |
669 { | |
670 case D_SYS_INFO_1: | |
671 { | |
672 /* | |
673 * system information type 1 message on BCCH | |
674 */ | |
675 MCAST (sys_info_1, D_SYS_INFO_1); /* T_D_SYS_INFO_1 */ | |
676 | |
677 /* | |
678 * successfully received system info | |
679 * decrements the BCCH error counter | |
680 */ | |
681 if (rr_data->bcch_error) | |
682 rr_data->bcch_error--; | |
683 | |
684 /* | |
685 * create a cell channel description and store it | |
686 * for later use together with frequency hopping | |
687 */ | |
688 for_create_channel_list ((T_f_range *)&sys_info_1->cell_chan_desc, | |
689 &list); | |
690 | |
691 /* | |
692 * Process the message | |
693 */ | |
694 att_for_sysinfo_type1 (mph_unitdata_ind->arfcn, sys_info_1, &list); | |
695 break; | |
696 } | |
697 | |
698 case D_SYS_INFO_2: | |
699 { | |
700 /* | |
701 * System information type 2 message on BCCH | |
702 */ | |
703 /* Implements RR Clone findings #13 */ | |
704 | |
705 MCAST (sys_info_2, D_SYS_INFO_2); /* T_D_SYS_INFO_2 */ | |
706 | |
707 /* Implements RR Clone findings #13 */ | |
708 for_unitdata_ind_sys_info_2_2bis(SI_TYPE_2, mph_unitdata_ind, | |
709 &sys_info_2->neigh_cell_desc,&list,(T_VOID_STRUCT *)sys_info_2); | |
710 | |
711 break; | |
712 } | |
713 | |
714 case D_SYS_INFO_2BIS: | |
715 { | |
716 /* | |
717 * system information type 2bis message on BCCH | |
718 */ | |
719 /* Implements RR Clone findings #13 */ | |
720 | |
721 MCAST (sys_info_2bis, D_SYS_INFO_2BIS); /* T_D_SYS_INFO_2BIS */ | |
722 | |
723 | |
724 /* Implements RR Clone findings #13 */ | |
725 for_unitdata_ind_sys_info_2_2bis(SI_TYPE_2BIS, mph_unitdata_ind, | |
726 &sys_info_2bis->neigh_cell_desc,&list,(T_VOID_STRUCT *)sys_info_2bis); | |
727 break; | |
728 } | |
729 | |
730 case D_SYS_INFO_2TER: | |
731 { | |
732 /* | |
733 * system information type 2ter message on BCCH | |
734 */ | |
735 | |
736 MCAST (sys_info_2ter, D_SYS_INFO_2TER); /* T_D_SYS_INFO_2TER */ | |
737 | |
738 /* | |
739 * successfully received system info | |
740 * decrements the BCCH error counter | |
741 */ | |
742 if (rr_data->bcch_error) | |
743 rr_data->bcch_error--; | |
744 | |
745 switch (std) | |
746 { | |
747 case STD_EGSM: | |
748 case STD_DUAL: | |
749 case STD_DUAL_EGSM: | |
750 case STD_DUAL_US: | |
751 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT | |
752 case STD_850_1800: | |
753 case STD_900_1900: | |
754 case STD_850_900_1800: | |
755 case STD_850_900_1900: | |
756 #endif | |
757 /* | |
758 * only for extended GSM and dualband | |
759 * | |
760 * extract the multiband parameter | |
761 */ | |
762 rr_data->ncell_mb = (sys_info_2ter->neigh_cell_desc.b_neigh_cell_desc | |
763 [sys_info_2ter->neigh_cell_desc.o_neigh_cell_desc>>3] | |
764 & 0x60) >> 5; | |
765 | |
766 /* | |
767 * create a neighbourcell list | |
768 */ | |
769 for_create_channel_list ((T_f_range *)&sys_info_2ter->neigh_cell_desc, | |
770 &list); | |
771 | |
772 /* | |
773 * process the message in the attachment process | |
774 */ | |
775 att_for_sysinfo_type2ter (mph_unitdata_ind->arfcn, sys_info_2ter, &list); | |
776 break; | |
777 | |
778 default: | |
779 break; | |
780 } | |
781 break; | |
782 } | |
783 | |
784 #if defined (REL99) && defined (TI_PS_FF_EMR) | |
785 case D_SYS_INFO_2QUATER: | |
786 { | |
787 /* Process and store only for serving cell..Since SI-2quater | |
788 is required only for reporting*/ | |
789 UBYTE index = att_get_index(mph_unitdata_ind->arfcn); | |
790 | |
791 if( index EQ SC_INDEX ) | |
792 { | |
793 MCAST (sys_info_2quater, D_SYS_INFO_2QUATER); /* T_D_SYS_INFO_2QUATER */ | |
794 if(for_process_si2quater(&sys_info_2quater->si_2qua_octets)) | |
795 { | |
796 for_send_enh_para(&rr_data->sc_data.emr_data_current); | |
797 /*we received all the instances successfully, we no longer need to monitor SI-2quater*/ | |
798 for_mon_si2quater_req(STOP_MON_BCCH); | |
799 rr_data->sc_data.cd.si2quater_status = SI2QUATER_ACQ_COMP; | |
800 } | |
801 } | |
802 break; | |
803 } | |
804 #endif | |
805 | |
806 case D_SYS_INFO_3: | |
807 { | |
808 /* | |
809 * create system information type 3 message on BCCH | |
810 */ | |
811 | |
812 MCAST (sys_info_3, D_SYS_INFO_3); /* T_D_SYS_INFO_3 */ | |
813 | |
814 /* Implements RR Clone findings #16 */ | |
815 for_unitdata_ind_si3_si4(SI_TYPE_3, mph_unitdata_ind, | |
816 &sys_info_3->loc_area_ident,(T_VOID_STRUCT *)sys_info_3); | |
817 | |
818 break; | |
819 } | |
820 | |
821 case D_SYS_INFO_4: | |
822 { | |
823 /* | |
824 * system information type 4 message on BCCH | |
825 */ | |
826 | |
827 MCAST (sys_info_4, D_SYS_INFO_4); /* T_D_SYS_INFO_4 */ | |
828 | |
829 /* Implements RR Clone findings #16 */ | |
830 for_unitdata_ind_si3_si4(SI_TYPE_4, mph_unitdata_ind, | |
831 &sys_info_4->loc_area_ident,(T_VOID_STRUCT *)sys_info_4); | |
832 break; | |
833 } | |
834 | |
835 case D_SYS_INFO_5: | |
836 { | |
837 /* | |
838 * system information type 5 message on SACCH | |
839 */ | |
840 /* Implements RR Clone findings #4 */ | |
841 | |
842 MCAST (sys_info_5, D_SYS_INFO_5); /* T_D_SYS_INFO_5 */ | |
843 | |
844 /* Implements RR Clone findings #4 */ | |
845 for_unitdata_ind_sys_info_5_5bis(SI_TYPE_5, mph_unitdata_ind,&rr_data->sc_data.ba_index, | |
846 &sys_info_5->neigh_cell_desc, &list,(T_VOID_STRUCT *)sys_info_5); | |
847 break; | |
848 } | |
849 | |
850 case D_SYS_INFO_5BIS: | |
851 { | |
852 /* | |
853 * system information type 5bis message on SACCH | |
854 */ | |
855 /* Implements RR Clone findings #4 */ | |
856 | |
857 MCAST (sys_info_5bis, D_SYS_INFO_5BIS); /* T_D_SYS_INFO_5BIS */ | |
858 | |
859 /* Implements RR Clone findings #4 */ | |
860 for_unitdata_ind_sys_info_5_5bis(SI_TYPE_5BIS, mph_unitdata_ind,&rr_data->sc_data.ba_index, | |
861 &sys_info_5bis->neigh_cell_desc,&list,(T_VOID_STRUCT *)sys_info_5bis); | |
862 break; | |
863 } | |
864 | |
865 case D_SYS_INFO_5TER: | |
866 { | |
867 /* | |
868 * system information type 5ter message on SACCH | |
869 */ | |
870 | |
871 MCAST (sys_info_5ter, D_SYS_INFO_5TER); /* T_D_SYS_INFO_5TER */ | |
872 | |
873 switch (std) | |
874 { | |
875 case STD_EGSM: | |
876 case STD_DUAL: | |
877 case STD_DUAL_EGSM: | |
878 case STD_DUAL_US: | |
879 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT | |
880 case STD_850_1800: | |
881 case STD_900_1900: | |
882 case STD_850_900_1800: | |
883 case STD_850_900_1900: | |
884 #endif | |
885 /* | |
886 * only for extended GSM and Dualband | |
887 * | |
888 * dont use ba index from 5ter, because R&S sends inconsistent | |
889 * BCCH data for multiband testcase 26.6.3.6 | |
890 * | |
891 * extract multiband parameter | |
892 */ | |
893 rr_data->ncell_mb = (sys_info_5ter->neigh_cell_desc.b_neigh_cell_desc | |
894 [sys_info_5ter->neigh_cell_desc.o_neigh_cell_desc>>3] | |
895 & 0x60) >> 5; | |
896 | |
897 /* | |
898 * create a neighbourcell list | |
899 */ | |
900 for_create_channel_list ((T_f_range *)&sys_info_5ter->neigh_cell_desc, | |
901 &list); | |
902 | |
903 /* | |
904 * process the message in the attachment process | |
905 */ | |
906 att_for_sysinfo_type5ter (mph_unitdata_ind->arfcn, &list); | |
907 break; | |
908 | |
909 default: | |
910 break; | |
911 } | |
912 break; | |
913 } | |
914 | |
915 case D_SYS_INFO_6: | |
916 { | |
917 /* | |
918 * system information type 6 message on SACCH | |
919 */ | |
920 | |
921 MCAST (sys_info_6, D_SYS_INFO_6); /* T_D_SYS_INFO_6 */ | |
922 | |
923 if (sys_info_6->loc_area_ident.c_mnc EQ 2) | |
924 { | |
925 /* Internally G23 uses always 3-digit-MNC */ | |
926 sys_info_6->loc_area_ident.c_mnc = SIZE_MNC; | |
927 sys_info_6->loc_area_ident.mnc[2] = 0xf; | |
928 } | |
929 | |
930 /* | |
931 * process the message in the attachment process | |
932 */ | |
933 att_for_sysinfo_type6 (mph_unitdata_ind->arfcn, sys_info_6); | |
934 break; | |
935 } | |
936 | |
937 case D_SYS_INFO_7: /* T_D_SYS_INFO_7 */ | |
938 case D_SYS_INFO_8: /* T_D_SYS_INFO_8 */ | |
939 /* | |
940 * successfully received system info | |
941 * decrements the BCCH error counter | |
942 */ | |
943 | |
944 if (rr_data->bcch_error) | |
945 rr_data->bcch_error--; | |
946 | |
947 /* | |
948 * process the message in the attachment process | |
949 */ | |
950 att_for_sysinfo_type7_8 (mph_unitdata_ind->arfcn, (T_D_SYS_INFO_8 *)_decodedMsg); | |
951 break; | |
952 #ifdef GPRS | |
953 case D_SYS_INFO_13: /* T_D_SYS_INFO_13 */ | |
954 { | |
955 MCAST (sys_info_13, D_SYS_INFO_13); | |
956 | |
957 if (rr_data->bcch_error) | |
958 rr_data->bcch_error--; | |
959 | |
960 att_for_sysinfo_type13 (mph_unitdata_ind, sys_info_13); | |
961 } | |
962 break; | |
963 #endif | |
964 | |
965 case D_IMM_ASSIGN: | |
966 { | |
967 /* | |
968 * immediate assignment message on AGCH | |
969 */ | |
970 | |
971 MCAST (imm_assign, D_IMM_ASSIGN); /* T_D_IMM_ASSIGN */ | |
972 | |
973 /* | |
974 * process the message | |
975 */ | |
976 dat_for_imm_assign (mph_unitdata_ind, imm_assign); | |
977 break; | |
978 } | |
979 | |
980 case D_IMM_ASSIGN_EXT: | |
981 { | |
982 /* | |
983 * immediate assignment extended message on AGCH | |
984 */ | |
985 | |
986 MCAST (imm_assign_ext, D_IMM_ASSIGN_EXT); /* T_D_IMM_ASSIGN_EXT */ | |
987 | |
988 /* | |
989 * process the message. | |
990 */ | |
991 dat_for_imm_assign_ext (mph_unitdata_ind, imm_assign_ext); | |
992 break; | |
993 } | |
994 | |
995 case D_IMM_ASSIGN_REJ: | |
996 { | |
997 MCAST (imm_assign_rej, D_IMM_ASSIGN_REJ); /* T_D_IMM_ASSIGN_REJ */ | |
998 | |
999 /* | |
1000 * process the message | |
1001 */ | |
1002 dat_for_imm_assign_rej (imm_assign_rej); | |
1003 break; | |
1004 } | |
1005 | |
1006 case D_EXT_MEAS_ORDER: | |
1007 { | |
1008 MCAST (ext_meas_order, D_EXT_MEAS_ORDER); | |
1009 | |
1010 dat_for_ext_meas_order (ext_meas_order); | |
1011 break; | |
1012 } | |
1013 | |
1014 default: | |
1015 TRACE_EVENT_P1 ( "unknown %02x", _decodedMsg[0] ); | |
1016 break; | |
1017 } | |
1018 | |
1019 PFREE (mph_unitdata_ind); | |
1020 } | |
1021 | |
1022 /* | |
1023 +--------------------------------------------------------------------+ | |
1024 | PROJECT : GSM-PS (6147) MODULE : RR_FOR | | |
1025 | STATE : code ROUTINE : for_rr_trace_message | | |
1026 +--------------------------------------------------------------------+ | |
1027 | |
1028 PURPOSE : Function replaces RR_BINDUMP & TRACE_DATA_IND Macros | |
1029 | |
1030 */ | |
1031 | |
1032 GLOBAL void for_rr_trace_message (UBYTE *payload, USHORT length, | |
1033 USHORT arfcn, ULONG fn, UBYTE direction) | |
1034 { | |
1035 GET_INSTANCE_DATA; | |
1036 | |
1037 if(direction EQ DOWNLINK) | |
1038 { | |
1039 switch(_decodedMsg[0]) | |
1040 { | |
1041 case D_ASSIGN_CMD: | |
1042 TRACE_EVENT ( "ASSIGNMENT_COMMAND DL" ); | |
1043 break; | |
1044 | |
1045 case D_CHAN_REL: | |
1046 TRACE_EVENT ( "CHANNEL_RELEASE DL" ); | |
1047 break; | |
1048 | |
1049 case D_CHAN_MOD: | |
1050 TRACE_EVENT ( "CHANNEL_MODE_MODIFY DL" ); | |
1051 break; | |
1052 | |
1053 case D_CIPH_CMD: | |
1054 TRACE_EVENT ( "CIPHERING_COMMAND DL" ); | |
1055 break; | |
1056 | |
1057 case D_FREQ_REDEF: | |
1058 TRACE_EVENT ( "FREQ RE-DEFINITION DL" ); | |
1059 break; | |
1060 | |
1061 case D_HANDOV_CMD: | |
1062 TRACE_EVENT ( "HANDOVER_COMMAND DL" ); | |
1063 break; | |
1064 | |
1065 case B_RR_STATUS: | |
1066 TRACE_EVENT ( "RR_STATUS DL" ); | |
1067 break; | |
1068 | |
1069 case D_CLASS_ENQ: | |
1070 TRACE_EVENT ( "CLASSMARK_ENQUIRY DL" ); | |
1071 break; | |
1072 | |
1073 #ifdef GPRS | |
1074 case D_PDCH_ASS_CMD: | |
1075 TRACE_EVENT ( "PDCH_ASSIGNMENT_COMMAND DL" ); | |
1076 break; | |
1077 | |
1078 case D_CHANGE_ORDER: | |
1079 TRACE_EVENT ( "CHANGE_ORDER DL" ); | |
1080 break; | |
1081 #endif /*GPRS*/ | |
1082 | |
1083 case D_SYS_INFO_1: | |
1084 TRACE_EVENT ( "SYS_INFO_1 DL" ); | |
1085 break; | |
1086 | |
1087 case D_SYS_INFO_2: | |
1088 TRACE_EVENT ( "SYS_INFO_2 DL"); | |
1089 break; | |
1090 | |
1091 case D_SYS_INFO_2BIS: | |
1092 TRACE_EVENT ( "SYS_INFO_2BIS DL" ); | |
1093 break; | |
1094 | |
1095 case D_SYS_INFO_2TER: | |
1096 TRACE_EVENT ( "SYS_INFO_2TER DL" ); | |
1097 break; | |
1098 | |
1099 case D_SYS_INFO_3: | |
1100 TRACE_EVENT ( "SYS_INFO_3 DL" ); | |
1101 break; | |
1102 | |
1103 case D_SYS_INFO_4: | |
1104 TRACE_EVENT ( "SYS_INFO_4 DL" ); | |
1105 break; | |
1106 | |
1107 case D_SYS_INFO_5: | |
1108 TRACE_EVENT ( "SYS_INFO_5 DL"); | |
1109 break; | |
1110 | |
1111 case D_SYS_INFO_5BIS: | |
1112 TRACE_EVENT ( "SYS_INFO_5BIS DL" ); | |
1113 break; | |
1114 | |
1115 case D_SYS_INFO_5TER: | |
1116 TRACE_EVENT ( "SYS_INFO_5TER DL" ); | |
1117 break; | |
1118 | |
1119 case D_SYS_INFO_6: | |
1120 TRACE_EVENT ( "SYS_INFO_6 DL" ); | |
1121 break; | |
1122 | |
1123 case D_SYS_INFO_7: | |
1124 TRACE_EVENT ( "SYS_INFO_7 DL" ); | |
1125 break; | |
1126 | |
1127 case D_SYS_INFO_8: | |
1128 TRACE_EVENT ( "SYS_INFO_8 DL" ); | |
1129 break; | |
1130 | |
1131 #ifdef GPRS | |
1132 case D_SYS_INFO_13: | |
1133 TRACE_EVENT ( "SYS_INFO_13 DL" ); | |
1134 break; | |
1135 #endif/*GPRS*/ | |
1136 | |
1137 case D_IMM_ASSIGN: | |
1138 TRACE_EVENT ( "IMM_ASSIGN DL" ); | |
1139 break; | |
1140 | |
1141 case D_IMM_ASSIGN_EXT: | |
1142 TRACE_EVENT ( "IMM_ASSIGN_EXT DL" ); | |
1143 break; | |
1144 | |
1145 case D_IMM_ASSIGN_REJ: | |
1146 TRACE_EVENT ( "IMM_ASSIGN_REJ DL" ); | |
1147 break; | |
1148 | |
1149 case D_EXT_MEAS_ORDER: | |
1150 TRACE_EVENT ( "EXT_MEAS_ORDER" ); | |
1151 break; | |
1152 | |
1153 default: | |
1154 return; | |
1155 } | |
1156 } | |
1157 else /*UPLINK*/ | |
1158 { | |
1159 switch(_decodedMsg[0]) | |
1160 { | |
1161 case U_PAG_RES: | |
1162 TRACE_EVENT ( "PAGING_RESPONSE UL" ); | |
1163 break; | |
1164 | |
1165 case U_ASSIGN_FAIL: | |
1166 TRACE_EVENT ( "ASSIGNMENT_FAILURE UL" ); | |
1167 break; | |
1168 | |
1169 case U_CIPH_COMP: | |
1170 TRACE_EVENT ( "CIPHERING_COMPLETE UL" ); | |
1171 break; | |
1172 | |
1173 case U_HANDOV_FAIL: | |
1174 TRACE_EVENT ( "HANDOVER_FAILURE UL" ); | |
1175 break; | |
1176 | |
1177 case U_HANDOV_COMP: | |
1178 TRACE_EVENT ( "HANDOVER_COMPLETE UL" ); | |
1179 break; | |
1180 | |
1181 case U_ASSIGN_COMP: | |
1182 TRACE_EVENT ( "ASSIGNMENT_COMPLETE UL" ); | |
1183 break; | |
1184 | |
1185 case U_CHAN_MOD_ACK: | |
1186 TRACE_EVENT ( "CHANNEL_MODE_ACKNOWLEDGE UL" ); | |
1187 break; | |
1188 | |
1189 case U_MEAS_REP: | |
1190 TRACE_EVENT ( "MEASUREMENT_REPORT UL" ); | |
1191 break; | |
1192 | |
1193 case U_CLASS_CHNG: | |
1194 TRACE_EVENT ( "CLASSMARK_CHANGE UL" ); | |
1195 break; | |
1196 | |
1197 case D_RR_INIT_REQ: | |
1198 TRACE_EVENT ( "RR_INITIALISATION_REQ UL" ); | |
1199 break; | |
1200 | |
1201 case U_PART_REL_COMP: | |
1202 TRACE_EVENT ( "PARTIAL_RELEASE_COMPLETE UL" ); | |
1203 break; | |
1204 | |
1205 case U_GPRS_SUSP_REQ: | |
1206 TRACE_EVENT ( "GPRS_SUSPENSION_REQ UL" ); | |
1207 break; | |
1208 | |
1209 case U_EXT_MEAS_REPORT: | |
1210 TRACE_EVENT ( "EXT_MEAS_REP UL" ); | |
1211 break; | |
1212 | |
1213 default: | |
1214 return; | |
1215 } | |
1216 } | |
1217 | |
1218 TRACE_BINDUMP(rr_handle,TC_USER4,NULLSTRING,payload,length); | |
1219 | |
1220 TRACE_EVENT_P4 ("[%u] FN=%lu CR=%d SC=%d", | |
1221 (arfcn)&ARFCN_MASK, fn, | |
1222 (short)(rr_data->nc_data[CR_INDEX].arfcn), | |
1223 (short)(rr_data->nc_data[SC_INDEX].arfcn)); | |
1224 | |
1225 } | |
1226 | |
1227 | |
1228 /* | |
1229 +--------------------------------------------------------------------+ | |
1230 | PROJECT : GSM-PS (6147) MODULE : RR_FOR | | |
1231 | STATE : code ROUTINE : for_unitdata_ind_sys_info_5_5bis | | |
1232 +--------------------------------------------------------------------+ | |
1233 | |
1234 PURPOSE : This function handles the system information type 5 and 5 bis | |
1235 common parameters. | |
1236 | |
1237 */ | |
1238 LOCAL void for_unitdata_ind_sys_info_5_5bis(T_SI_TYPE si_type, T_MPH_UNITDATA_IND *mph_unitdata_ind, | |
1239 UBYTE *ba_index,BUF_neigh_cell_desc *neigh_cell_desc, | |
1240 T_LIST *list, T_VOID_STRUCT *sys_info_5_5bis ) | |
1241 { | |
1242 | |
1243 GET_INSTANCE_DATA; | |
1244 UBYTE old_index; | |
1245 UBYTE ncell_ext; | |
1246 | |
1247 TRACE_FUNCTION("for_unitdata_ind_sys_info_5_5bis()"); | |
1248 | |
1249 /* | |
1250 * store the current band allocation value | |
1251 */ | |
1252 old_index = *ba_index; | |
1253 | |
1254 /* | |
1255 * extract the extension indication | |
1256 */ | |
1257 ncell_ext = (neigh_cell_desc->b_neigh_cell_desc | |
1258 [neigh_cell_desc->o_neigh_cell_desc>>3] | |
1259 & 0x20) ? 1 : 0; | |
1260 /* | |
1261 * extract the new band allocation value | |
1262 */ | |
1263 #if defined (REL99) && defined (TI_PS_FF_EMR) | |
1264 rr_data->sc_data.new_ba_index = (neigh_cell_desc->b_neigh_cell_desc | |
1265 [neigh_cell_desc->o_neigh_cell_desc>>3] | |
1266 & 0x10) ? 1 : 0; | |
1267 #else | |
1268 *ba_index = (neigh_cell_desc->b_neigh_cell_desc | |
1269 [neigh_cell_desc->o_neigh_cell_desc>>3] | |
1270 & 0x10) ? 1 : 0; | |
1271 #endif | |
1272 | |
1273 /* | |
1274 * create a neighbourcell list | |
1275 */ | |
1276 for_create_channel_list ((T_f_range *)neigh_cell_desc, | |
1277 list); | |
1278 | |
1279 /* | |
1280 * process the message in the attachment process | |
1281 */ | |
1282 att_for_sysinfo_type5_5bis (mph_unitdata_ind->arfcn, list, | |
1283 old_index, ncell_ext,si_type); | |
1284 } | |
1285 | |
1286 /* | |
1287 +--------------------------------------------------------------------+ | |
1288 | PROJECT : GSM-PS (6147) MODULE : RR_FOR | |
1289 | STATE : code ROUTINE : for_unitdata_ind_sys_info_2_2bis | | |
1290 +--------------------------------------------------------------------+ | |
1291 | |
1292 PURPOSE : This function handles the System Information 2 and 2bis common parameters | |
1293 | |
1294 */ | |
1295 | |
1296 LOCAL void for_unitdata_ind_sys_info_2_2bis(T_SI_TYPE si_type, T_MPH_UNITDATA_IND *mph_unitdata_ind, | |
1297 BUF_neigh_cell_desc *neigh_cell_desc, | |
1298 T_LIST *list, T_VOID_STRUCT *sys_info_2_2bis) | |
1299 { | |
1300 GET_INSTANCE_DATA; | |
1301 UBYTE ncell_ext; | |
1302 #if defined (REL99) && defined (TI_PS_FF_EMR) | |
1303 UBYTE ba_ind; | |
1304 UBYTE index; | |
1305 #endif | |
1306 | |
1307 TRACE_FUNCTION("for_unitdata_ind_sys_info_2_2bis()"); | |
1308 | |
1309 /* | |
1310 * successfully received system info | |
1311 * decrements the BCCH error counter | |
1312 */ | |
1313 if (rr_data->bcch_error) | |
1314 (rr_data->bcch_error)--; | |
1315 | |
1316 /* | |
1317 * extract the ncell extension flag. It indicates | |
1318 * whether the neighbourcell description is complete | |
1319 * or must be combined with the neighbourcell description | |
1320 * of system information 2bis. | |
1321 */ | |
1322 ncell_ext = neigh_cell_desc->b_neigh_cell_desc | |
1323 [neigh_cell_desc->o_neigh_cell_desc>>3] | |
1324 & 0x20; | |
1325 | |
1326 #if defined (REL99) && defined (TI_PS_FF_EMR) | |
1327 ba_ind = (neigh_cell_desc->b_neigh_cell_desc | |
1328 [neigh_cell_desc->o_neigh_cell_desc>>3] | |
1329 & 0x10) ? 1 : 0; | |
1330 index = att_get_index(mph_unitdata_ind->arfcn); | |
1331 /* Store BA_IND in appropriate context*/ | |
1332 for_update_ba_ind (index, ba_ind); | |
1333 #endif | |
1334 | |
1335 /* | |
1336 * create a neighbourcell list | |
1337 */ | |
1338 for_create_channel_list ((T_f_range *)neigh_cell_desc, | |
1339 list); | |
1340 /* | |
1341 * process the message in the attachment process | |
1342 */ | |
1343 | |
1344 att_for_sysinfo_type2_2bis (mph_unitdata_ind->arfcn, sys_info_2_2bis, | |
1345 list, ncell_ext, si_type); | |
1346 } | |
1347 | |
1348 /* | |
1349 +--------------------------------------------------------------------+ | |
1350 | PROJECT : GSM-PS (6147) MODULE : RR_FOR | | |
1351 | STATE : code ROUTINE : for_unitdata_ind_si3_si4 | | |
1352 +--------------------------------------------------------------------+ | |
1353 | |
1354 PURPOSE : This function handles System information type 3 and 4 | |
1355 common parameters. | |
1356 | |
1357 */ | |
1358 LOCAL void for_unitdata_ind_si3_si4(T_SI_TYPE si_type, T_MPH_UNITDATA_IND *mph_unitdata_ind, | |
1359 T_loc_area_ident *loc_area_ident, | |
1360 T_VOID_STRUCT *sys_info_3_4) | |
1361 | |
1362 { | |
1363 GET_INSTANCE_DATA; | |
1364 TRACE_FUNCTION("for_unitdata_ind_si3_si4()"); | |
1365 | |
1366 if (loc_area_ident->c_mnc EQ 2) | |
1367 { | |
1368 /* Internally G23 uses always 3-digit-MNC */ | |
1369 loc_area_ident->c_mnc = SIZE_MNC; | |
1370 loc_area_ident->mnc[2] = 0xf; | |
1371 } | |
1372 | |
1373 /* | |
1374 * successfully received system info | |
1375 * decrements the BCCH error counter | |
1376 */ | |
1377 if (rr_data->bcch_error) | |
1378 (rr_data->bcch_error)--; | |
1379 | |
1380 | |
1381 if(si_type EQ SI_TYPE_4) | |
1382 { | |
1383 if (((T_D_SYS_INFO_4 *)sys_info_3_4)->v_chan_desc) | |
1384 { | |
1385 /* | |
1386 * If system information contains a CBCH channel | |
1387 * description check the CBCH channel description | |
1388 */ | |
1389 for_check_channel_descr (&((T_D_SYS_INFO_4 *)sys_info_3_4)->chan_desc); | |
1390 | |
1391 /* | |
1392 * Consistency check: If the CBCH channel description | |
1393 * defines Frequency hopping but the mobile allocation | |
1394 * is not available, clear the CBCH channel description. | |
1395 */ | |
1396 if (((T_D_SYS_INFO_4 *)sys_info_3_4)->chan_desc.hop EQ TRUE AND | |
1397 ((T_D_SYS_INFO_4 *)sys_info_3_4)->v_mob_alloc EQ FALSE) | |
1398 ((T_D_SYS_INFO_4 *)sys_info_3_4)->v_chan_desc = FALSE ; | |
1399 } | |
1400 att_for_sysinfo_type4 (mph_unitdata_ind->arfcn, (T_D_SYS_INFO_4 *)sys_info_3_4); | |
1401 } | |
1402 | |
1403 /* | |
1404 * process the message in the attachment process | |
1405 */ | |
1406 if(si_type EQ SI_TYPE_3) | |
1407 att_for_sysinfo_type3 (mph_unitdata_ind->arfcn, (T_D_SYS_INFO_3 *)sys_info_3_4); | |
1408 | |
1409 } | |
1410 | |
1411 #if defined (REL99) && defined (TI_PS_FF_EMR) | |
1412 /* | |
1413 +--------------------------------------------------------------------+ | |
1414 | PROJECT : GSM-PS (6147) MODULE : RR_FOR | | |
1415 | STATE : code ROUTINE : for_dl_short_unitdata_ind | | |
1416 +--------------------------------------------------------------------+ | |
1417 | |
1418 PURPOSE : Process the primitive DL_SHORT_UNITDATA_IND received from RR. | |
1419 | |
1420 */ | |
1421 | |
1422 GLOBAL void for_dl_short_unitdata_ind (T_DL_SHORT_UNITDATA_IND *dl_short_unitdata_ind_orig) | |
1423 { | |
1424 GET_INSTANCE_DATA; | |
1425 PPASS(dl_short_unitdata_ind_orig, short_unitdata_ind, DL_SHORT_UNITDATA_IND); | |
1426 /* | |
1427 * Clear error field and CCD result field. | |
1428 */ | |
1429 memset (&rr_data->ms_data.error,0, sizeof(rr_data->ms_data.error)); | |
1430 memset (_decodedMsg,0, sizeof(_decodedMsg)); | |
1431 | |
1432 /* | |
1433 * Decode the message with CCD. | |
1434 * | |
1435 * The protocol discriminator bit is implicitely checked when trying | |
1436 * to decode the message | |
1437 */ | |
1438 if (ccd_decodeMsg (CCDENT_RR_SHORT, DOWNLINK, | |
1439 (T_MSGBUF *)&short_unitdata_ind->sdu, | |
1440 (UBYTE *)_decodedMsg, | |
1441 NOT_PRESENT_8BIT) NEQ ccdOK) | |
1442 { | |
1443 /* | |
1444 * CCD has detected an error | |
1445 */ | |
1446 UBYTE ccd_err; | |
1447 USHORT parlist [6]; | |
1448 | |
1449 /* | |
1450 * get the first error | |
1451 */ | |
1452 ccd_err = ccd_getFirstError (CCDENT_RR, parlist); | |
1453 do | |
1454 { | |
1455 /* | |
1456 * Error Handling | |
1457 */ | |
1458 switch (ccd_err) | |
1459 { | |
1460 case ERR_INVALID_MID: /* unknown message type */ | |
1461 case ERR_MSG_LEN: /* some exceeds entire message length */ | |
1462 case ERR_MAND_ELEM_MISS: /* Mandatory elements missing */ | |
1463 TRACE_EVENT_P2("message with mt=%02x ignored due to CCD error=%d", | |
1464 ((short_unitdata_ind->sdu.buf[short_unitdata_ind->sdu.o_buf>>3]) >> 2) & 0x3F, | |
1465 ccd_err); | |
1466 PFREE (short_unitdata_ind); /* in unacknowledged mode ignore message */ | |
1467 return; | |
1468 | |
1469 case ERR_MAX_REPEAT: | |
1470 TRACE_EVENT_P1("CCD error=%d ignored here", ccd_err); | |
1471 break; | |
1472 default: | |
1473 TRACE_ERROR("unknown CCD return"); | |
1474 break; | |
1475 } | |
1476 ccd_err = ccd_getNextError (CCDENT_RR, parlist); | |
1477 } | |
1478 while (ccd_err NEQ ERR_NO_MORE_ERROR); | |
1479 } | |
1480 | |
1481 /* | |
1482 * depending on the message type | |
1483 */ | |
1484 switch (_decodedMsg[0]) | |
1485 { | |
1486 case D_MEAS_INF: | |
1487 { | |
1488 /* | |
1489 * add handling of message here:*/ | |
1490 MCAST (meas_inf, D_MEAS_INF); | |
1491 if (dat_for_meas_inf(meas_inf) ) | |
1492 { | |
1493 /*Send Enhanced para to ALR*/ | |
1494 attf_send_enh_para_to_alr(rr_data->sc_data.emr_data_current.rep_type, | |
1495 &rr_data->sc_data.emr_data_current.enh_para); | |
1496 } | |
1497 } | |
1498 break; | |
1499 default: | |
1500 TRACE_EVENT_P1 ( "message %02x not supported", _decodedMsg[0] ); | |
1501 break; | |
1502 } | |
1503 | |
1504 PFREE (short_unitdata_ind); | |
1505 } | |
1506 #endif | |
1507 #endif |