rlc_um_control_primitives.c 15.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.0  (the "License"); you may not use this file
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
gauthier's avatar
gauthier committed
21

22
23
#define RLC_UM_MODULE 1
#define RLC_UM_CONTROL_PRIMITIVES_C 1
24
#include "platform_types.h"
25
#include "assertions.h"
26
27
28
29
30
31
32
33
34
35
//-----------------------------------------------------------------------------
#include "rlc_um.h"
#include "rlc_primitives.h"
#include "list.h"
#include "rrm_config_structs.h"
#include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h"

#include "rlc_um_control_primitives.h"
#include "T-Reordering.h"
gauthier's avatar
gauthier committed
36
#include "msc.h"
37
38

//-----------------------------------------------------------------------------
39
void config_req_rlc_um (
40
41
42
  const protocol_ctxt_t* const ctxt_pP,
  const srb_flag_t      srb_flagP,
  const rlc_um_info_t  * const config_um_pP,
43
44
  const rb_id_t           rb_idP,
  const logical_chan_id_t chan_idP)
45
{
46
47
  rlc_union_t     *rlc_union_p  = NULL;
  rlc_um_entity_t *rlc_p        = NULL;
48
  hash_key_t       key          = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
49
  hashtable_rc_t   h_rc;
gauthier's avatar
gauthier committed
50

51
  h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
52

53
  if (h_rc == HASH_TABLE_OK) {
54
    rlc_p = &rlc_union_p->rlc.um;
55
56
    LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" CONFIG_REQ timer_reordering=%d sn_field_length=%d is_mXch=%d RB %u\n",
          PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
gauthier's avatar
gauthier committed
57
58
59
60
61
          config_um_pP->timer_reordering,
          config_um_pP->sn_field_length,
          config_um_pP->is_mXch,
          rb_idP);

62
63
64
    rlc_um_init(ctxt_pP, rlc_p);

    if (rlc_um_fsm_notify_event (ctxt_pP, rlc_p, RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_DATA_TRANSFER_READY_STATE_EVENT)) {
65
      rlc_um_set_debug_infos(ctxt_pP, rlc_p, srb_flagP, rb_idP, chan_idP);
66
67
68
69
70
71
72
73
      rlc_um_configure(
        ctxt_pP,
        rlc_p,
        config_um_pP->timer_reordering,
        config_um_pP->sn_field_length,
        config_um_pP->sn_field_length,
        config_um_pP->is_mXch);
    }
74
  } else {
75
76
    LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT"  CONFIG_REQ RB %u  RLC UM NOT FOUND\n",
          PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
77
78
          rb_idP);
  }
79
80
}
//-----------------------------------------------------------------------------
Cedric Roux's avatar
Cedric Roux committed
81
82
83
#if defined(Rel14)
const uint32_t const t_Reordering_tab[32] = {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,110,120,130,140,150,160,170,180,190,200,1600};
#else
84
const uint32_t const t_Reordering_tab[T_Reordering_spare1] = {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,110,120,130,140,150,160,170,180,190,200};
Cedric Roux's avatar
Cedric Roux committed
85
#endif
86

87
void config_req_rlc_um_asn1 (
88
89
90
91
92
93
94
  const protocol_ctxt_t* const ctxt_pP,
  const srb_flag_t          srb_flagP,
  const MBMS_flag_t         mbms_flagP,
  const mbms_session_id_t   mbms_session_idP,
  const mbms_service_id_t   mbms_service_idP,
  const UL_UM_RLC_t       * const ul_rlc_pP,
  const DL_UM_RLC_t       * const dl_rlc_pP,
95
96
  const rb_id_t             rb_idP,
  const logical_chan_id_t   chan_idP)
97
{
98
99
100
101
  uint32_t         ul_sn_FieldLength   = 0;
  uint32_t         dl_sn_FieldLength   = 0;
  uint32_t         t_Reordering        = 0;
  rlc_union_t     *rlc_union_p         = NULL;
gauthier's avatar
gauthier committed
102
  rlc_um_entity_t *rlc_p               = NULL;
103
  hash_key_t       key                 = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
104
105
  hashtable_rc_t   h_rc;

Cedric Roux's avatar
Cedric Roux committed
106
#if defined(Rel10) || defined(Rel14)
107

gauthier's avatar
gauthier committed
108
  if (mbms_flagP) {
109
110
    AssertFatal(dl_rlc_pP, "No RLC UM DL config");
    AssertFatal(ul_rlc_pP == NULL, "RLC UM UL config present");
111
    key = RLC_COLL_KEY_MBMS_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_service_idP, mbms_session_idP);
112
    h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
113
114
115
    AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u rnti %i enb flag %u service id %u, session id %u",
                 ctxt_pP->module_id,
                 ctxt_pP->rnti,
116
117
118
119
120
                 ctxt_pP->enb_flag,
                 mbms_service_idP,
                 mbms_session_idP);
    rlc_p = &rlc_union_p->rlc.um;
  } else
gauthier's avatar
gauthier committed
121
122
#endif
  {
123
    key  = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
124
125
    h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
    AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u ue id %i enb flag %u rb id %u, srb flag %u",
126
127
                 ctxt_pP->module_id,
                 ctxt_pP->rnti,
128
129
130
131
                 ctxt_pP->enb_flag,
                 rb_idP,
                 srb_flagP);
    rlc_p = &rlc_union_p->rlc.um;
gauthier's avatar
gauthier committed
132
  }
133
134

  //-----------------------------------------------------------------------------
135
136
  LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT"  CONFIG_REQ timer_reordering=%dms sn_field_length=   RB %u \n",
        PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
137
138
        (dl_rlc_pP && dl_rlc_pP->t_Reordering<31)?t_Reordering_tab[dl_rlc_pP->t_Reordering]:-1,
        rb_idP);
gauthier's avatar
gauthier committed
139

140
  rlc_um_init(ctxt_pP, rlc_p);
141

gauthier's avatar
gauthier committed
142

143
  if (rlc_um_fsm_notify_event (ctxt_pP, rlc_p, RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_DATA_TRANSFER_READY_STATE_EVENT)) {
144
    rlc_um_set_debug_infos(ctxt_pP,rlc_p, srb_flagP, rb_idP, chan_idP);
145
146
147
148
149
150
151
152
153
154
155
156

    if (ul_rlc_pP != NULL) {
      switch (ul_rlc_pP->sn_FieldLength) {
      case SN_FieldLength_size5:
        ul_sn_FieldLength = 5;
        break;

      case SN_FieldLength_size10:
        ul_sn_FieldLength = 10;
        break;

      default:
Cedric Roux's avatar
Cedric Roux committed
157
        LOG_E(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID UL sn_FieldLength %ld, RLC NOT CONFIGURED\n",
158
              PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
159
160
              rlc_p->rb_id,
              ul_rlc_pP->sn_FieldLength);
gauthier's avatar
gauthier committed
161
162
163
164
165
166
167
168
169
        MSC_LOG_RX_DISCARDED_MESSAGE(
      	    (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
      	    (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
      	    NULL,
      	    0,
      	    MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ UL sn_FieldLength %u",
      	    MSC_AS_TIME_ARGS(ctxt_pP),
      	    PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
      	    ul_rlc_pP->sn_FieldLength);
170
        return;
171
      }
172
173
174
175
176
177
178
179
180
181
182
183
184
    }

    if (dl_rlc_pP != NULL) {
      switch (dl_rlc_pP->sn_FieldLength) {
      case SN_FieldLength_size5:
        dl_sn_FieldLength = 5;
        break;

      case SN_FieldLength_size10:
        dl_sn_FieldLength = 10;
        break;

      default:
Cedric Roux's avatar
Cedric Roux committed
185
        LOG_E(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID DL sn_FieldLength %ld, RLC NOT CONFIGURED\n",
186
              PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
187
188
              rlc_p->rb_id,
              dl_rlc_pP->sn_FieldLength);
gauthier's avatar
gauthier committed
189
190
191
192
193
194
195
196
197
        MSC_LOG_RX_DISCARDED_MESSAGE(
      	    (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
      	    (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
      	    NULL,
      	    0,
      	    MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ DL sn_FieldLength %u",
      	    MSC_AS_TIME_ARGS(ctxt_pP),
      	    PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
      	    dl_rlc_pP->sn_FieldLength);
198
        return;
199
      }
200

Cedric Roux's avatar
Cedric Roux committed
201
202
203
#if defined(Rel14)
      if (dl_rlc_pP->t_Reordering<32) {
#else
204
      if (dl_rlc_pP->t_Reordering<T_Reordering_spare1) {
Cedric Roux's avatar
Cedric Roux committed
205
#endif
206
        t_Reordering = t_Reordering_tab[dl_rlc_pP->t_Reordering];
207
      } else {
Cedric Roux's avatar
Cedric Roux committed
208
        LOG_E(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID T_Reordering %ld, RLC NOT CONFIGURED\n",
209
              PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
210
211
              rlc_p->rb_id,
              dl_rlc_pP->t_Reordering);
gauthier's avatar
gauthier committed
212
213
214
215
216
217
218
219
220
221

        MSC_LOG_RX_DISCARDED_MESSAGE(
      	    (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
      	    (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
      	    NULL,
      	    0,
      	    MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u",
      	    MSC_AS_TIME_ARGS(ctxt_pP),
      	    PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
      	    dl_rlc_pP->t_Reordering);
222
        return;
223
      }
224
225
226
227
228
229
230
231
    }

    if (ctxt_pP->enb_flag > 0) {
      rlc_um_configure(ctxt_pP,rlc_p,
                       t_Reordering,
                       ul_sn_FieldLength,
                       dl_sn_FieldLength,
                       mbms_flagP);
gauthier's avatar
gauthier committed
232
233
234
235
236
237
238
239
240
241
242
      MSC_LOG_RX_MESSAGE(
    	    (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
    	    (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
    	    NULL,
    	    0,
    	    MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u rx snfl %u tx snfl %u",
    	    MSC_AS_TIME_ARGS(ctxt_pP),
    	    PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
    	    t_Reordering,
    	    ul_sn_FieldLength,
    	    dl_sn_FieldLength);
243
    } else {
gauthier's avatar
gauthier committed
244

245
246
247
248
249
      rlc_um_configure(ctxt_pP,rlc_p,
                       t_Reordering,
                       dl_sn_FieldLength,
                       ul_sn_FieldLength,
                       mbms_flagP);
gauthier's avatar
gauthier committed
250
251
252
253
254
255
256
257
258
259
260
      MSC_LOG_RX_MESSAGE(
    	    (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
    	    (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
    	    NULL,
    	    0,
    	    MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u rx snfl %u tx snfl %u",
    	    MSC_AS_TIME_ARGS(ctxt_pP),
    	    PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
    	    t_Reordering,
    	    dl_sn_FieldLength,
    	    ul_sn_FieldLength);
261
    }
gauthier's avatar
gauthier committed
262
  }
263
264
265
}
//-----------------------------------------------------------------------------
void
266
rlc_um_init (
267
268
269
  const protocol_ctxt_t* const ctxt_pP,
  rlc_um_entity_t * const rlc_pP
)
270
271
{

gauthier's avatar
gauthier committed
272
  AssertFatal(rlc_pP, "Bad RLC UM pointer (NULL)");
273

274
  if (rlc_pP->initialized) {
275
276
    LOG_D(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [INIT] ALREADY DONE, DOING NOTHING\n",
          PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP));
277
  } else {
278
279
    LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" [INIT] STATE VARIABLES, BUFFERS, LISTS\n",
          PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP));
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
    memset (rlc_pP, 0, sizeof (rlc_um_entity_t));
    // TX SIDE
    list_init (&rlc_pP->pdus_to_mac_layer, NULL);
    pthread_mutex_init(&rlc_pP->lock_input_sdus, NULL);
    list_init (&rlc_pP->input_sdus, NULL);

    rlc_pP->protocol_state = RLC_NULL_STATE;

    //rlc_pP->vt_us = 0;

    // RX SIDE
    list_init (&rlc_pP->pdus_from_mac_layer, NULL);
    //rlc_pP->vr_ur = 0;
    //rlc_pP->vr_ux = 0;
    //rlc_pP->vr_uh = 0;
    //rlc_pP->output_sdu_size_to_write = 0;
    //rlc_pP->output_sdu_in_construction = NULL;

    rlc_pP->rx_sn_length          = 10;
    rlc_pP->rx_header_min_length_in_bytes = 2;
    rlc_pP->tx_sn_length          = 10;
    rlc_pP->tx_header_min_length_in_bytes = 2;

    pthread_mutex_init(&rlc_pP->lock_dar_buffer, NULL);

    if (rlc_pP->dar_buffer == NULL) {
      rlc_pP->dar_buffer = calloc (1, 1024 * sizeof (void *));
    }

    rlc_pP->first_pdu = 1;
    rlc_pP->initialized = TRUE;
311
  }
312
313
314
}
//-----------------------------------------------------------------------------
void
315
rlc_um_reset_state_variables (
316
317
318
  const protocol_ctxt_t* const ctxt_pP,
  rlc_um_entity_t * const rlc_pP
)
319
{
gauthier's avatar
gauthier committed
320
  rlc_pP->buffer_occupancy = 0;
gauthier's avatar
Clean    
gauthier committed
321

322
323

  // TX SIDE
gauthier's avatar
gauthier committed
324
  rlc_pP->vt_us = 0;
325
  // RX SIDE
gauthier's avatar
gauthier committed
326
327
328
  rlc_pP->vr_ur = 0;
  rlc_pP->vr_ux = 0;
  rlc_pP->vr_uh = 0;
329
330
331
}
//-----------------------------------------------------------------------------
void
332
rlc_um_cleanup (
333
  rlc_um_entity_t * const rlc_pP)
334
335
336
{
  int             index;
  // TX SIDE
gauthier's avatar
gauthier committed
337
  list_free (&rlc_pP->pdus_to_mac_layer);
gauthier's avatar
mutex !    
gauthier committed
338
  pthread_mutex_destroy(&rlc_pP->lock_input_sdus);
339
  list_free (&rlc_pP->input_sdus);
340
341

  // RX SIDE
gauthier's avatar
gauthier committed
342
  list_free (&rlc_pP->pdus_from_mac_layer);
343

gauthier's avatar
gauthier committed
344
  if ((rlc_pP->output_sdu_in_construction)) {
345
    free_mem_block (rlc_pP->output_sdu_in_construction, __func__);
346
  }
347

348
  if (rlc_pP->dar_buffer) {
349
350
    for (index = 0; index < 1024; index++) {
      if (rlc_pP->dar_buffer[index]) {
351
        free_mem_block (rlc_pP->dar_buffer[index], __func__);
352
      }
353
354
355
356
    }

    free (rlc_pP->dar_buffer);
    rlc_pP->dar_buffer = NULL;
357
  }
358

359
  pthread_mutex_destroy(&rlc_pP->lock_dar_buffer);
gauthier's avatar
gauthier committed
360
  memset(rlc_pP, 0, sizeof(rlc_um_entity_t));
361
362
363
}

//-----------------------------------------------------------------------------
364
void rlc_um_configure(
365
366
367
368
369
370
  const protocol_ctxt_t* const ctxt_pP,
  rlc_um_entity_t * const rlc_pP,
  const uint32_t         timer_reorderingP,
  const uint32_t         rx_sn_field_lengthP,
  const uint32_t         tx_sn_field_lengthP,
  const uint32_t         is_mXchP)
371
{
gauthier's avatar
gauthier committed
372
  if (rx_sn_field_lengthP == 10) {
373
374
375
376
    rlc_pP->rx_sn_length                  = 10;
    rlc_pP->rx_sn_modulo                  = RLC_UM_SN_10_BITS_MODULO;
    rlc_pP->rx_um_window_size             = RLC_UM_WINDOW_SIZE_SN_10_BITS;
    rlc_pP->rx_header_min_length_in_bytes = 2;
gauthier's avatar
gauthier committed
377
  } else if (rx_sn_field_lengthP == 5) {
378
379
380
381
    rlc_pP->rx_sn_length                  = 5;
    rlc_pP->rx_sn_modulo                  = RLC_UM_SN_5_BITS_MODULO;
    rlc_pP->rx_um_window_size             = RLC_UM_WINDOW_SIZE_SN_5_BITS;
    rlc_pP->rx_header_min_length_in_bytes = 1;
gauthier's avatar
gauthier committed
382
  } else if (rx_sn_field_lengthP != 0) {
383
384
    LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID RX SN LENGTH %d BITS NOT IMPLEMENTED YET, RLC NOT CONFIGURED\n",
          PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP),
385
386
387
          rlc_pP->rb_id,
          rx_sn_field_lengthP);
    return;
gauthier's avatar
gauthier committed
388
389
390
  }

  if (tx_sn_field_lengthP == 10) {
391
392
393
394
    rlc_pP->tx_sn_length                  = 10;
    rlc_pP->tx_sn_modulo                  = RLC_UM_SN_10_BITS_MODULO;
    rlc_pP->tx_um_window_size             = RLC_UM_WINDOW_SIZE_SN_10_BITS;
    rlc_pP->tx_header_min_length_in_bytes = 2;
gauthier's avatar
gauthier committed
395
  } else if (tx_sn_field_lengthP == 5) {
396
397
398
399
    rlc_pP->tx_sn_length                  = 5;
    rlc_pP->tx_sn_modulo                  = RLC_UM_SN_5_BITS_MODULO;
    rlc_pP->tx_um_window_size             = RLC_UM_WINDOW_SIZE_SN_5_BITS;
    rlc_pP->tx_header_min_length_in_bytes = 1;
gauthier's avatar
gauthier committed
400
  } else if (tx_sn_field_lengthP != 0) {
401
402
    LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" [CONFIGURE] RB %u INVALID RX SN LENGTH %d BITS NOT IMPLEMENTED YET, RLC NOT CONFIGURED\n",
          PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP),
403
404
405
          rlc_pP->rb_id,
          tx_sn_field_lengthP);
    return;
gauthier's avatar
gauthier committed
406
407
408
  }

  if (is_mXchP > 0) {
409
410
    rlc_pP->tx_um_window_size = 0;
    rlc_pP->rx_um_window_size = 0;
gauthier's avatar
gauthier committed
411
  }
412

gauthier's avatar
gauthier committed
413
414
415
416
417
418
  rlc_pP->is_mxch = is_mXchP;

  rlc_pP->last_reassemblied_sn  = rlc_pP->rx_sn_modulo - 1;
  rlc_pP->last_reassemblied_missing_sn  = rlc_pP->rx_sn_modulo - 1;
  rlc_pP->reassembly_missing_sn_detected = 0;
  // timers
419
  rlc_um_init_timer_reordering(ctxt_pP,rlc_pP, timer_reorderingP);
gauthier's avatar
gauthier committed
420
421
422

  rlc_pP->first_pdu = 1;

423
  rlc_um_reset_state_variables (ctxt_pP,rlc_pP);
424
425
}
//-----------------------------------------------------------------------------
426
void rlc_um_set_debug_infos(
427
428
  const protocol_ctxt_t* const ctxt_pP,
  rlc_um_entity_t * const rlc_pP,
429
430
  const srb_flag_t        srb_flagP,
  const rb_id_t           rb_idP,
431
  const logical_chan_id_t chan_idP) 
432
{
433
434
  LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" [SET DEBUG INFOS] rb_id %d srb_flag %d\n",
        PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP),
435
436
        rb_idP,
        srb_flagP);
437
  rlc_pP->rb_id      = rb_idP;
438
  rlc_pP->channel_id = chan_idP;
439

440
  if (srb_flagP) {
441
    rlc_pP->is_data_plane = 0;
442
  } else {
443
    rlc_pP->is_data_plane = 1;
gauthier's avatar
gauthier committed
444
  }
445
}