comparison src/g23m-gprs/grr/grr_gfpf.c @ 183:219afcfc6250

src/g23m-gprs: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 13 Oct 2016 04:24:13 +0000
parents
children
comparison
equal deleted inserted replaced
182:f02d0a0e1849 183:219afcfc6250
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GPRS (8441)
4 | Modul : GRR
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 implements local functions for service GFP of
18 | entity GRR.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef GRR_GFPF_C
23 #define GRR_GFPF_C
24 #endif
25
26 #define ENTITY_GRR
27
28 /*==== INCLUDES =============================================================*/
29
30 #include "typedefs.h" /* to get Condat data types */
31
32 #include "vsi.h" /* to get a lot of macros */
33 #include "macdef.h"
34 #include "gprs.h"
35 #include "gsm.h" /* to get a lot of macros */
36 #include "ccdapi.h" /* to get CCD API */
37 #include "prim.h" /* to get the definitions of used SAP and directions */
38 #include "message.h"
39 #include "grr.h" /* to get the global entity definitions */
40 #include "grr_f.h" /* to get the global entity procedure definitions */
41 #include "grr_pgs.h"
42 #include "grr_psis.h"
43 #include "grr_css.h"
44 #include "grr_meass.h"
45 #include "grr_tcs.h"
46 #include "grr_ctrls.h"
47 #include <stdio.h>
48 #include "cl_rlcmac.h"
49
50 /*==== CONST ================================================================*/
51
52
53 /*==== DIAGNOSTICS ==========================================================*/
54
55 /*==== LOCAL VARS ===========================================================*/
56
57 /*==== PRIVATE FUNCTIONS ====================================================*/
58
59 /*==== PUBLIC FUNCTIONS =====================================================*/
60 /*
61 +------------------------------------------------------------------------------
62 | Function : gfp_init
63 +------------------------------------------------------------------------------
64 | Description : The function gfp_init() initialize all service relevant
65 | variables.
66 |
67 | Parameters : void
68 |
69 +------------------------------------------------------------------------------
70 */
71 GLOBAL void gfp_init ( void )
72 {
73 TRACE_FUNCTION( "gfp_init" );
74
75 INIT_STATE(GFP,GFP_IDLE);
76
77 } /* gfp_init() */
78
79 /*
80 +------------------------------------------------------------------------------
81 | Function : gfp_prcs_ctrl_msg
82 +------------------------------------------------------------------------------
83 | Description :
84 |
85 | Parameters :
86 |
87 +------------------------------------------------------------------------------
88 */
89 GLOBAL BOOL gfp_prcs_ctrl_msg ( UBYTE* l2_frame,
90 UBYTE l2_channel,
91 UBYTE relative_position,
92 ULONG frame_number )
93 {
94 T_MSGBUF * message_complete;
95 UBYTE message_type;
96 T_D_HEADER temp_header;
97 BOOL ms_paging_group;
98 BOOL address;
99 BOOL result = FALSE;
100 #ifdef REL99
101 T_TIME time_to_poll=0;
102 #endif
103
104 TRACE_FUNCTION( "gfp_prcs_ctrl_msg" );
105
106 grr_decode_rlcmac( l2_frame, &temp_header );
107
108 #ifdef _SIMULATION_
109
110 TRACE_EVENT_P1( "Control message at FN = %ld", frame_number );
111
112 #endif /* #ifdef _SIMULATION_ */
113
114 if( temp_header.payload EQ CTRL_BLK_NO_OPT OR
115 temp_header.payload EQ CTRL_BLK_OPT )
116 {
117 ULONG tc_user = TC_USER4;
118 UBYTE trace_msg_type = D_MSG_TYPE_2ND_SEGMENT_c;
119
120 if( temp_header.payload EQ CTRL_BLK_NO_OPT OR
121 temp_header.d_ctrl.rbsn EQ 0 )
122 {
123 trace_msg_type = temp_header.d_ctrl.msg_type;
124 }
125
126 if( trace_msg_type EQ D_DL_DUMMY_c )
127 {
128 tc_user = TC_USER5;
129 }
130
131 TRACE_BINDUMP( hCommGRR, tc_user,
132 cl_rlcmac_get_msg_name( trace_msg_type, RLC_MAC_ROUTE_DL ),
133 l2_frame, MAX_L2_FRAME_SIZE ); /*lint !e569*/
134
135 message_complete = grr_handle_rlcmac_header( PACKET_MODE_PIM,
136 &temp_header,
137 frame_number );
138
139 if( message_complete NEQ NULL )
140 {
141 message_type = grr_decode_grr( message_complete );
142 ms_paging_group = ( l2_channel EQ L2_PCHANNEL_PPCH );
143
144 /*
145 * check address
146 */
147 switch( message_type )
148 {
149 case D_ACCESS_REJ_c: /* Packet Access Reject */
150 case D_CELL_CHAN_ORDER_c: /* Packet Cell Change Order */
151 case D_DL_ASSIGN_c: /* Packet Downlink Assignment */
152 case D_MEAS_ORDER_c: /* Packet Measurement Order */
153 case D_PAGING_REQ_c: /* Packet Paging Request */
154 case D_POLLING_REQ_c: /* Packet Polling Request */
155 case D_PRACH_PAR_c: /* Packet PRACH Parameters */
156 case D_QUEUING_NOT_c: /* Packet Queuing Notification */
157 case D_UL_ASSIGN_c: /* Packet Uplink Assignment */
158 case D_DL_DUMMY_c: /* Packet Downlink Dummy Control Block */
159 case PSI_1_c: /* Packet System Information Type 1 */
160 case PSI_2_c: /* Packet System Information Type 2 */
161 case PSI_3_c: /* Packet System Information Type 3 */
162 case PSI_3_BIS_c: /* Packet System Information Type 3 bis */
163 #if defined (REL99) AND defined (TI_PS_FF_EMR)
164 case PSI_3_TER_c: /* Packet System Information Type 3 ter */
165 #endif
166 case PSI_4_c: /* Packet System Information Type 4 */
167 case PSI_5_c: /* Packet System Information Type 5 */
168 #ifdef REL99
169 case PSI_8_c: /* Packet System Information Type 8 */
170 #endif
171 address = grr_check_address( message_type,0xFF );
172 {
173 /* the MS shall take into account the page mode info in any message on PCCCH */
174 MCAST( d_dl_assign, D_DL_ASSIGN );
175
176 sig_gfp_pg_mode( d_dl_assign->page_mode, ms_paging_group );
177 }
178 break;
179
180 default:
181 case D_PDCH_RELEASE_c:
182 case D_CTRL_PWR_TA_c:
183 case D_TS_RECONFIG_c:
184 case D_TBF_RELEASE_c:
185 case D_UL_ACK_c:
186 case PSI_13_c:
187 address = FALSE;
188
189 TRACE_EVENT( "gfp_prcs_ctrl_msg: unexpected control message type" );
190 break;
191 }
192
193 if( !address )
194 {
195 return( result );
196 }
197
198 /* 0460 - Section 10.4.5
199 * MS shall ignore the RRBP field if received as part of
200 * packet access reject (or) packet queue notification (or) packet paging request meassages
201 * Avoid sending Poll response */
202 if ( message_type NEQ D_ACCESS_REJ_c AND
203 message_type NEQ D_QUEUING_NOT_c AND
204 message_type NEQ D_PAGING_REQ_c )
205 {
206 /*
207 * save poll position
208 */
209 if( temp_header.d_ctrl.sp )
210 {
211 MCAST( d_poll_req, D_POLLING_REQ);
212
213
214 if( message_type EQ D_POLLING_REQ_c )
215 {
216 if( d_poll_req->ctrl_ack_type EQ 0 )
217 {
218 sig_gfp_tc_poll_ind(frame_number,temp_header.d_ctrl.rrbp,CGRLC_POLL_RES_AB,temp_header.pctrl_ack);
219 }
220 else
221 {
222 sig_gfp_tc_poll_ind(frame_number,temp_header.d_ctrl.rrbp,CGRLC_POLL_RES_NB,temp_header.pctrl_ack);
223 }
224 }
225 else if(psc_db->gprs_cell_opt.ctrl_ack_type)
226 {
227 sig_gfp_tc_poll_ind(frame_number,temp_header.d_ctrl.rrbp,CGRLC_POLL_RES_NB,temp_header.pctrl_ack);
228 }
229 else
230 {
231 sig_gfp_tc_poll_ind(frame_number,temp_header.d_ctrl.rrbp,CGRLC_POLL_RES_AB,temp_header.pctrl_ack);
232 }
233 #ifdef REL99
234 time_to_poll = grr_get_time_to_send_poll(temp_header.d_ctrl.rrbp);
235 #endif
236 }
237 }
238 /*
239
240 if( message_type EQ ... )
241 {
242 ULONG trace[5];
243
244 trace[0] = l2_frame[0] << 24;
245 trace[0] |= l2_frame[1] << 16;
246 trace[0] |= l2_frame[2] << 8;
247 trace[0] |= l2_frame[3] << 0;
248
249 trace[1] = l2_frame[4] << 24;
250 trace[1] |= l2_frame[5] << 16;
251 trace[1] |= l2_frame[6] << 8;
252 trace[1] |= l2_frame[7] << 0;
253
254 trace[2] = l2_frame[8] << 24;
255 trace[2] |= l2_frame[9] << 16;
256 trace[2] |= l2_frame[10] << 8;
257 trace[2] |= l2_frame[11] << 0;
258
259 trace[3] = l2_frame[12] << 24;
260 trace[3] |= l2_frame[13] << 16;
261 trace[3] |= l2_frame[14] << 8;
262 trace[3] |= l2_frame[15] << 0;
263
264 trace[4] = l2_frame[16] << 24;
265 trace[4] |= l2_frame[17] << 16;
266 trace[4] |= l2_frame[18] << 8;
267 trace[4] |= l2_frame[19] << 0;
268
269 TRACE_EVENT_P8( "RLC_CTRL: %08X%08X%08X%08X%08X%02X%02X%02X",
270 trace[0], trace[1], trace[2], trace[3], trace[4],
271 l2_frame[20], l2_frame[21], l2_frame[22] );
272 }
273
274 */
275
276 switch( message_type )
277 {
278 case D_ACCESS_REJ_c: /* Packet Access Reject */
279 {
280
281 sig_gfp_tc_access_rej( );
282 }
283 break;
284
285 case D_QUEUING_NOT_c: /* Packet Queuing Notification */
286 {
287
288 sig_gfp_tc_queuing_not( );
289 }
290 break;
291
292 case D_UL_ASSIGN_c: /* Packet Uplink Assignment */
293 {
294 MCAST( d_ul_assign, D_UL_ASSIGN );
295
296
297 if( d_ul_assign->v_pers_lev )
298 {
299 sig_gfp_psi_save_persistence_level( &d_ul_assign->pers_lev );
300 }
301
302 sig_gfp_tc_ul_assign( );
303
304 result = TRUE;
305 }
306 break;
307
308 case D_DL_ASSIGN_c: /* Packet Downlink Assignment */
309 {
310 MCAST( d_dl_assign, D_DL_ASSIGN );
311
312
313 if( d_dl_assign->v_pers_lev )
314 {
315 sig_gfp_psi_save_persistence_level( &d_dl_assign->pers_lev );
316 }
317
318 sig_gfp_tc_dl_assign( );
319
320 result = TRUE;
321 }
322 break;
323
324 case D_PAGING_REQ_c: /* Packet Paging Request */
325 {
326 MCAST( d_paging_req, D_PAGING_REQ );
327
328
329 if( d_paging_req->v_pers_lev )
330 {
331 sig_gfp_psi_save_persistence_level( &d_paging_req->pers_lev );
332 }
333
334 sig_gfp_pg_req( );
335 }
336 break;
337
338 case PSI_1_c: /* Packet System Information Type 1 */
339 {
340
341 sig_gfp_psi_1( );
342 }
343 break;
344
345 case PSI_2_c: /* Packet System Information Type 2 */
346 {
347
348 sig_gfp_psi_2( relative_position );
349 }
350 break;
351
352 case PSI_3_c: /* Packet System Information Type 3 */
353 {
354
355 sig_gfp_psi_3( relative_position );
356 }
357 break;
358
359 case PSI_3_BIS_c: /* Packet System Information Type 3 bis */
360 {
361
362 sig_gfp_psi_3_bis( relative_position );
363 }
364 break;
365
366 #if defined (REL99) AND defined (TI_PS_FF_EMR)
367 case PSI_3_TER_c: /* Packet System Information Type 3 ter */
368 {
369 sig_gfp_psi_3_ter( relative_position );
370 }
371 break;
372 #endif
373
374 case PSI_4_c: /* Packet System Information Type 4 */
375 {
376
377 sig_gfp_psi_4( relative_position );
378 }
379 break;
380
381 case PSI_5_c: /* Packet System Information Type 5 */
382 {
383
384 sig_gfp_psi_5( relative_position );
385 }
386 break;
387
388 #ifdef REL99
389 case PSI_8_c: /* Packet System Information Type 8 */
390 {
391
392 sig_gfp_psi_8( relative_position );
393 }
394 break;
395 #endif
396
397 case D_CELL_CHAN_ORDER_c: /* Packet Cell Change Order */
398 {
399 #ifdef REL99
400 sig_gfp_ctrl_cc_order(time_to_poll);
401 #else
402 sig_gfp_ctrl_cc_order( );
403 #endif
404 }
405 break;
406
407 case D_DL_DUMMY_c: /* Packet Downlink Dummy Control Block */
408 {
409 MCAST( d_dl_dummy, D_DL_DUMMY );
410
411 if( d_dl_dummy->v_pers_lev )
412 {
413 sig_gfp_psi_save_persistence_level( &d_dl_dummy->pers_lev );
414 }
415
416
417 /*
418 * This message is not send to any other service.
419 */
420 }
421 break;
422
423 case D_MEAS_ORDER_c: /* Packet Measurement Order */
424 {
425
426 sig_gfp_meas_order( );
427 }
428 break;
429
430 case D_POLLING_REQ_c: /* Packet Polling Request */
431 {
432
433 /*
434 * No signal to GRR, polling is handled with grr_poll_pos_ind
435 */
436 }
437 break;
438
439 case D_PRACH_PAR_c: /* Packet PRACH Parameters */
440 {
441
442 sig_gfp_psi_prach( );
443 }
444 break;
445
446 default:
447 TRACE_ERROR( "gfp_prcs_ctrl_msg: unexpected control message type" );
448 break;
449 } /* switch( message_type ) */
450
451 if( grr_data->pwr_ctrl_valid_flags.v_pwr_ctrl_param OR
452 grr_data->pwr_ctrl_valid_flags.v_glbl_pwr_ctrl_param OR
453 grr_data->pwr_ctrl_valid_flags.v_freq_param )
454 {
455 grr_cgrlc_pwr_ctrl_req( FALSE );
456 }
457 } /* if( message_complete NEQ NULL ) */
458 else
459 {
460 TRACE_EVENT_P1( "Incomplete control message at FN = %ld", frame_number );
461 }
462 }/* if( temp_header.payload EQ CTRL_BLK_NO_OPT OR temp_header.payload EQ CTRL_BLK_OPT ) */
463 else
464 {
465 TRACE_ERROR( "gfp_prcs_ctrl_msg: unexpected paylaod type" );
466
467 TRACE_BINDUMP( hCommGRR, TC_USER4,
468 cl_rlcmac_get_msg_name( D_MSG_TYPE_UNKNOWN_c, RLC_MAC_ROUTE_DL ),
469 l2_frame, MAX_L2_FRAME_SIZE ); /*lint !e569*/
470 }
471
472 return( result );
473
474 } /* gfp_prcs_ctrl_msg() */
475
476
477
478 /*
479 +------------------------------------------------------------------------------
480 | Function : gfp_check_tfi
481 +------------------------------------------------------------------------------
482 | Description : The function gfp_check_tfi() ....
483 |
484 | Parameters : ptr_header_i - header parameter
485 | tn - timeslot
486 |
487 +-------------------------------------------------------------------------------
488 */
489 GLOBAL BOOL gfp_check_tfi ( T_D_HEADER * ptr_header_i , UBYTE tn)
490 {
491 BOOL result;
492 TRACE_FUNCTION( "gfp_check_tfi" );
493
494 grr_data->gfp.tfi_check_needed = TRUE;
495
496 if(( ptr_header_i->payload EQ CTRL_BLK_NO_OPT)
497 OR
498 ((ptr_header_i->payload EQ CTRL_BLK_OPT)
499 AND
500 !(ptr_header_i->d_ctrl.ac)))
501 {
502 result = TRUE;
503 }
504 else if((ptr_header_i->payload EQ CTRL_BLK_OPT)
505 AND
506 ptr_header_i->d_ctrl.ac
507 AND
508 ptr_header_i->d_ctrl.d
509 AND
510 (ptr_header_i->d_ctrl.tfi EQ grr_data->downlink_tbf.tfi)
511 AND
512 ((0x80>>tn) & grr_data->downlink_tbf.ts_mask))
513 {
514 grr_data->gfp.tfi_check_needed = FALSE; /*tfi correct ignore tfi in air message*/
515 result = TRUE;
516 }
517 else if((ptr_header_i->payload EQ CTRL_BLK_OPT)
518 AND
519 ptr_header_i->d_ctrl.ac
520 AND
521 !(ptr_header_i->d_ctrl.d)
522 AND
523 (ptr_header_i->d_ctrl.tfi EQ grr_data->uplink_tbf.tfi)
524 AND
525 ((0x80>>tn) & grr_data->uplink_tbf.ts_mask))
526 {
527 grr_data->gfp.tfi_check_needed = FALSE; /*tfi correct ignore tfi in air message*/
528 result = TRUE;
529 }
530 else if(ptr_header_i->payload EQ 3)
531 {
532 result = TRUE;
533 }
534 else
535 {
536 result = FALSE;
537 TRACE_EVENT_P7("wrong tfi in ctrl block pt=%d ac=%d d=%d tfi=%d dl_tfi=%d ul_tfi=%d msg_type=0x%x",
538 ptr_header_i->payload,
539 ptr_header_i->d_ctrl.ac,
540 ptr_header_i->d_ctrl.d,
541 ptr_header_i->d_ctrl.tfi,
542 grr_data->downlink_tbf.tfi,
543 grr_data->uplink_tbf.tfi,
544 ptr_header_i->ptr_block[0]>>2); }
545
546 return result;
547
548 } /* gfp_check_tfi() */
549
550
551 /*
552 +------------------------------------------------------------------------------
553 | Function : gfp_send_ctrl_block
554 +------------------------------------------------------------------------------
555 | Description : The function gfp_send_ctrl_block() ....
556 |
557 | Parameters : dummy - description of parameter dummy
558 |
559 +------------------------------------------------------------------------------ X
560 */
561 GLOBAL void gfp_send_ctrl_block (ULONG fn_i, UBYTE tn_i, UBYTE rrbp_i, UBYTE sp_i,UBYTE pctrl_ack_i , T_MSGBUF * ptr_ctrl_block_i )
562 {
563 MCAST(d_dl_assign,D_DL_ASSIGN);
564 MCAST(d_poll_req,D_POLLING_REQ);
565 UBYTE msg_type;
566 BOOL address;
567 #ifdef REL99
568 T_TIME time_to_poll=0;
569 #endif
570 TRACE_FUNCTION( "gfp_send_ctrl_block" );
571
572
573
574 msg_type = ptr_ctrl_block_i->buf[0] >> 2;
575 switch(msg_type)
576 {
577
578 #ifdef _TARGET_
579 case PSI_1_c : /* Packet System Information Type 1 */
580 /*TRACE_EVENT("PSI 1");*/
581 break;
582 case PSI_2_c : /* Packet System Information Type 2 */
583 /*TRACE_EVENT("PSI 2");*/
584 break;
585 case PSI_3_c : /* Packet System Information Type 3 */
586 /*TRACE_EVENT("PSI 3");*/
587 break;
588 case PSI_3_BIS_c : /* Packet System Information Type 3 bis */
589 /*TRACE_EVENT("PSI 3bis");*/
590 break;
591
592 #if defined (REL99) AND defined (TI_PS_FF_EMR)
593 case PSI_3_TER_c :
594 /*TRACE_EVENT("PSI 3ter");*/
595 #endif
596
597 case PSI_4_c : /* Packet System Information Type 4 */
598 /*TRACE_EVENT("PSI 4");*/
599 break;
600 #ifdef REL99
601 case PSI_8_c : /* Packet System Information Type 8 */
602 /*TRACE_EVENT("PSI 8");*/
603 break;
604 #endif
605 #endif /*_TARGET_ */
606
607 /*
608 * the PSI5 should not be decoded on TARGET and in SIMULATION
609 */
610 case PSI_5_c : /* Packet System Information Type 5 */
611 /*TRACE_EVENT("PSI 5");*/
612 break;
613
614 /*
615 * the PSI13 should be decoded on TARGET and in SIMULATION
616 *
617 * case PSI_13_c : * Packet System Information Type 13 *
618 * TRACE_EVENT("PSI 13");
619 * break;
620 */
621
622 default:
623 msg_type = grr_decode_grr(ptr_ctrl_block_i);
624 if(grr_data->gfp.tfi_check_needed)
625 { /* check address within air message */
626 address = grr_check_address(msg_type,tn_i);
627 }
628 else
629 { /* ignore address within airmessage, block was addressed with correct tfi in optional header*/
630 address = TRUE;
631 }
632
633 /*
634 * save persistence level, even if address is wrong
635 */
636 switch (msg_type )
637 {
638 case D_DL_ASSIGN_c :
639 case D_PAGING_REQ_c:
640 case D_DL_DUMMY_c :
641 if(d_dl_assign->v_pers_lev)
642 {
643 sig_gfp_psi_save_persistence_level( &(d_dl_assign->pers_lev) );
644 }
645 break;
646 }
647
648 if (address AND grr_data->uplink_tbf.ti AND
649 (grr_data->tbf_type EQ CGRLC_TBF_MODE_UL))
650 {
651 /*4.60, 7.1.2.3a RLC/MAC procedures during contention resolution
652 - the mobile station shall not accept a PACKET MEASUREMENT ORDER
653 message, a PACKET CELL CHANGE ORDER message and a PACKET POWER
654 CONTROL/TIMING ADVANCE message addressing the mobile station
655 with the TFI value associated with the uplink TBF ;
656 */
657
658 switch (msg_type)
659 {
660 case D_CTRL_PWR_TA_c :
661 {
662 MCAST(d_ctrl_pwr_ta,D_CTRL_PWR_TA);
663 if (!grr_data->gfp.tfi_check_needed OR d_ctrl_pwr_ta->add4.v_glob_tfi)
664 {
665 TRACE_EVENT("CTRL_PWR_TA ignored - received during contention");
666 address = FALSE;
667 }
668 }
669 break;
670 case D_MEAS_ORDER_c :
671 {
672 MCAST(d_meas_order,D_MEAS_ORDER);
673 if (!grr_data->gfp.tfi_check_needed OR d_meas_order->add1.v_glob_tfi)
674 {
675 TRACE_EVENT("MEAS_ORDER ignored - received during contention");
676 address = FALSE;
677 }
678 }
679 break;
680 case D_CELL_CHAN_ORDER_c :
681 {
682 MCAST(d_cell_chan_order,D_CELL_CHAN_ORDER);
683 if (!grr_data->gfp.tfi_check_needed OR d_cell_chan_order->add1.v_glob_tfi)
684 {
685 TRACE_EVENT("CELL_CHAN_ORDER ignored - received during contention");
686 address = FALSE;
687 }
688 }
689 break;
690 default :
691 break;
692 }
693 }
694
695 if(address)
696 {
697 /*
698 * handle poll position
699 */
700 /* 0460 - Section 10.4.5
701 * MS shall ignore the RRBP field if received as part of
702 * packet access reject (or) packet queue notification (or) packet paging request meassages
703 * Avoid sending Poll response */
704 if( sp_i AND
705 (msg_type NEQ D_UL_ACK_c) AND /* packet uplink ack/nack will be handled in grlc*/
706 (msg_type NEQ D_ACCESS_REJ_c) AND
707 (msg_type NEQ D_PAGING_REQ_c ) )
708 {
709 PALLOC(cgrlc_poll_req,CGRLC_POLL_REQ);
710
711 cgrlc_poll_req->poll_fn = grr_calc_new_poll_pos(fn_i, rrbp_i);
712 cgrlc_poll_req->tn = tn_i;
713 cgrlc_poll_req->ctrl_ack = pctrl_ack_i;
714 if ((msg_type EQ D_POLLING_REQ_c) AND (d_poll_req->ctrl_ack_type))
715 {
716 cgrlc_poll_req->poll_b_type = CGRLC_POLL_RES_NB;
717 }
718 else if (msg_type EQ D_POLLING_REQ_c AND (d_poll_req->ctrl_ack_type EQ 0))
719 {
720 cgrlc_poll_req->poll_b_type = CGRLC_POLL_RES_AB;
721 }
722 else
723 {
724 cgrlc_poll_req->poll_b_type = CGRLC_POLL_CTRL;
725 }
726 grr_data->l1_del_tbf_start_fn = grr_decode_tbf_start_rel (cgrlc_poll_req->poll_fn,1);
727 PSEND(hCommGRLC,cgrlc_poll_req);
728 #ifdef REL99
729 time_to_poll = grr_get_time_to_send_poll(rrbp_i);
730 #endif
731 }
732 if(msg_type NEQ D_DL_DUMMY_c)
733 {
734 if (sp_i)
735 {
736 TRACE_EVENT_P3("correct add with Poll: msg_type=0x%2x,fn_i=%ld,rrbp=%d ",
737 msg_type,
738 fn_i,
739 rrbp_i );
740 }
741 else
742 {
743 TRACE_EVENT_P2("correct add at fn=%ld: msg_type = 0x%2x",fn_i,msg_type);
744 }
745 }
746 /*
747
748 if( msg_type EQ ... )
749 {
750 ULONG trace[5];
751
752 trace[0] = ptr_ctrl_block_i->buf[0] << 24;
753 trace[0] |= ptr_ctrl_block_i->buf[1] << 16;
754 trace[0] |= ptr_ctrl_block_i->buf[2] << 8;
755 trace[0] |= ptr_ctrl_block_i->buf[3] << 0;
756
757 trace[1] = ptr_ctrl_block_i->buf[4] << 24;
758 trace[1] |= ptr_ctrl_block_i->buf[5] << 16;
759 trace[1] |= ptr_ctrl_block_i->buf[6] << 8;
760 trace[1] |= ptr_ctrl_block_i->buf[7] << 0;
761
762 trace[2] = ptr_ctrl_block_i->buf[8] << 24;
763 trace[2] |= ptr_ctrl_block_i->buf[9] << 16;
764 trace[2] |= ptr_ctrl_block_i->buf[10] << 8;
765 trace[2] |= ptr_ctrl_block_i->buf[11] << 0;
766
767 trace[3] = ptr_ctrl_block_i->buf[12] << 24;
768 trace[3] |= ptr_ctrl_block_i->buf[13] << 16;
769 trace[3] |= ptr_ctrl_block_i->buf[14] << 8;
770 trace[3] |= ptr_ctrl_block_i->buf[15] << 0;
771
772 trace[4] = ptr_ctrl_block_i->buf[16] << 24;
773 trace[4] |= ptr_ctrl_block_i->buf[17] << 16;
774 trace[4] |= ptr_ctrl_block_i->buf[18] << 8;
775 trace[4] |= ptr_ctrl_block_i->buf[19] << 0;
776
777 TRACE_EVENT_P8( "RLC_CTRL: %08X%08X%08X%08X%08X%02X%02X%02X",
778 trace[0], trace[1], trace[2], trace[3], trace[4],
779 ptr_ctrl_block_i->buf[20], ptr_ctrl_block_i->buf[21],
780 ptr_ctrl_block_i->buf[22] );
781 }
782
783 */
784
785 switch (msg_type )
786 {
787 case D_ACCESS_REJ_c : /* Packet Access Reject */
788 sig_gfp_tc_access_rej_ptm();
789 break;
790 case D_TS_RECONFIG_c: /* Packet Timeslot reconfigure */
791 sig_gfp_tc_ts_reconfig_ptm ();
792 break;
793 case D_UL_ASSIGN_c : /* Packet Uplink Assignment */
794 sig_gfp_tc_ul_assign_ptm ();
795 break;
796 case D_DL_ASSIGN_c : /* Packet Downlink Assignment */
797 sig_gfp_tc_dl_assign_ptm ();
798 break;
799 case D_TBF_RELEASE_c : /* Packet TBF release */
800 sig_gfp_tc_packet_tbf_rel_ptm(fn_i,rrbp_i,sp_i);
801 break;
802 case D_PAGING_REQ_c : /* Packet Paging Request */
803 sig_gfp_pg_req ();
804 break;
805 case D_UL_ACK_c : /* Packet Uplink Ack/Nack */
806 {
807 MCAST(d_ul_ack,D_UL_ACK);
808 if(grr_data->uplink_tbf.mac_mode EQ FIXED_ALLOCATION)
809 {
810 sig_gfp_tc_fix_alloc_ack_ptm();
811 }
812 /*
813 * send ta update, if pta is present and allocation bitmap is not present.
814 * If pta and allocation bitmap is present, than the ta update is sent
815 * with MPHP_ASSIGNMENT_REQ primitive.
816 */
817 if( d_ul_ack->gprs_ul_ack_nack_info.v_pta AND
818 (
819 (grr_data->uplink_tbf.mac_mode NEQ FIXED_ALLOCATION) OR
820 (!(d_ul_ack->gprs_ul_ack_nack_info.v_f_alloc_ack AND d_ul_ack->gprs_ul_ack_nack_info.f_alloc_ack.v_fa_s2))
821 )
822 )
823 {
824 sig_gfp_tc_update_ta_req_ptm();
825 }
826 }
827 break;
828 case PSI_1_c : /* Packet System Information Type 1 */
829 sig_gfp_psi_1_ptm ();
830 break;
831 case PSI_2_c : /* Packet System Information Type 2 */
832 sig_gfp_psi_2_ptm ();
833 break;
834 case PSI_3_c : /* Packet System Information Type 3 */
835 sig_gfp_psi_3_ptm ();
836 break;
837 case PSI_3_BIS_c : /* Packet System Information Type 3 bis */
838 sig_gfp_psi_3_bis_ptm ();
839 break;
840
841 #if defined (REL99) AND defined (TI_PS_FF_EMR)
842 case PSI_3_TER_c : /* Packet System Information Type 3 ter */
843 sig_gfp_psi_3_ter_ptm ();
844 #endif
845 /*lint -fallthrough*/
846
847 case PSI_4_c : /* Packet System Information Type 4 */
848 sig_gfp_psi_4_ptm ();
849 break;
850 #ifdef REL99
851 case PSI_8_c : /* Packet System Information Type 8 */
852 sig_gfp_psi_8_ptm ();
853 break;
854 #endif
855 case PSI_13_c : /* Packet System Information Type 13 */
856 sig_gfp_psi_13_ptm ();
857 break;
858 case D_CELL_CHAN_ORDER_c : /* Packet Cell Change Order */
859 #ifdef REL99
860 sig_gfp_ctrl_cc_order (time_to_poll);
861 #else
862 sig_gfp_ctrl_cc_order ();
863 #endif
864 break;
865 case D_DL_DUMMY_c : /* Packet Downlink Dummy Control Block */
866 break;
867 case D_MEAS_ORDER_c : /* Packet Measurement Order */
868 sig_gfp_meas_order ();
869 break;
870 case D_PDCH_RELEASE_c : /* Packet PDCH Release */
871 TRACE_EVENT_P4("pdch rel on tn %d: %4x-%4x-%4x",
872 tn_i,
873 ptr_ctrl_block_i->buf[0],
874 ptr_ctrl_block_i->buf[1],
875 ptr_ctrl_block_i->buf[2]);/*lint !e415 !e416*/
876 sig_gfp_tc_pdch_release_ptm ( tn_i );
877 break;
878 case D_POLLING_REQ_c : /* Packet Polling Request */
879 break;
880 case D_CTRL_PWR_TA_c : /* Packet control power timing advance Parameters */
881 sig_gfp_meas_ctrl_pwr_ta_ptm ( );
882 break;
883 default:
884 TRACE_ERROR( "CGRLC_DATA_IND with unexpected ctrl message typ " );
885 break;
886 } /* switch (msg_type) */
887
888 if( grr_data->pwr_ctrl_valid_flags.v_pwr_ctrl_param OR
889 grr_data->pwr_ctrl_valid_flags.v_glbl_pwr_ctrl_param OR
890 grr_data->pwr_ctrl_valid_flags.v_freq_param )
891 {
892 grr_cgrlc_pwr_ctrl_req( FALSE );
893 }
894 }
895 else
896 {
897 TRACE_EVENT_P3("not add to MS: msg_type = %2x fn_i=%ld sp=%d",msg_type,fn_i,sp_i);
898 }
899 break;
900 }
901 grr_data->l1_del_tbf_start_fn = GRR_INVALID_FN;
902 }/* gfp_send_ctrl_block() */