comparison src/g23m-gsm/rr/rr_forp.c @ 1:fa8dc04885d8

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