eNB_scheduler.c 16.7 KB
Newer Older
1
/*******************************************************************************
nikaeinn's avatar
nikaeinn committed
2 3
    OpenAirInterface
    Copyright(c) 1999 - 2014 Eurecom
4

nikaeinn's avatar
nikaeinn committed
5 6 7 8
    OpenAirInterface is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
9 10


nikaeinn's avatar
nikaeinn committed
11 12 13 14
    OpenAirInterface is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
15

nikaeinn's avatar
nikaeinn committed
16 17 18 19
    You should have received a copy of the GNU General Public License
    along with OpenAirInterface.The full GNU General Public License is
    included in this distribution in the file called "COPYING". If not,
    see <http://www.gnu.org/licenses/>.
20 21

  Contact Information
nikaeinn's avatar
nikaeinn committed
22 23
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
24
  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
nikaeinn's avatar
nikaeinn committed
25

ghaddab's avatar
ghaddab committed
26
  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
27

nikaeinn's avatar
nikaeinn committed
28
*******************************************************************************/
29
/*! \file eNB_scheduler.c
nikaeinn's avatar
nikaeinn committed
30
 * \brief eNB scheduler top level function operates on per subframe basis
31 32
 * \author  Navid Nikaein and Raymond Knopp
 * \date 2010 - 2014
33
 * \email: navid.nikaein@eurecom.fr
34 35
 * \version 0.5
 * @ingroup _mac
36

37
 */
38

39
#include "assertions.h"
40 41 42 43 44 45 46 47
#include "PHY/defs.h"
#include "PHY/extern.h"

#include "SCHED/defs.h"
#include "SCHED/extern.h"

#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
gauthier's avatar
gauthier committed
48

49 50 51 52 53 54
#include "LAYER2/MAC/proto.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
gauthier's avatar
gauthier committed
55

56 57
#include "RRC/LITE/extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
gauthier's avatar
gauthier committed
58

59 60
//#include "LAYER2/MAC/pre_processor.c"
#include "pdcp.h"
61

62 63
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
64 65
#endif

66 67 68 69
#define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_eNB_SCHEDULER 1
//#define DEBUG_HEADER_PARSING 1
//#define DEBUG_PACKET_TRACE 1
gauthier's avatar
gauthier committed
70

71 72 73 74 75
/*
  #ifndef USER_MODE
  #define msg debug_msg
  #endif
 */
gauthier's avatar
gauthier committed
76 77 78



79

80 81 82



83 84
void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP)  //, int calibration_flag) {
{
85

knopp's avatar
 
knopp committed
86
  int mbsfn_status[MAX_NUM_CCs];
87
  protocol_ctxt_t   ctxt;
88
#ifdef EXMIMO
89
  int ret;
90
#endif
91
#if defined(ENABLE_ITTI)
92 93 94 95
  MessageDef   *msg_p;
  const char   *msg_name;
  instance_t    instance;
  int           result;
96
#endif
knopp's avatar
 
knopp committed
97
  DCI_PDU *DCI_pdu[MAX_NUM_CCs];
knopp's avatar
 
knopp committed
98
  int CC_id,i,next_i;
knopp's avatar
 
knopp committed
99
  UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
100
  rnti_t rnti;
101

102
  LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
103

104
  start_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
gauthier's avatar
gauthier committed
105
  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN);
106

107
  for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
knopp's avatar
 
knopp committed
108
    DCI_pdu[CC_id] = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
109 110
    DCI_pdu[CC_id]->nCCE=0;
    DCI_pdu[CC_id]->num_pdcch_symbols=1;
knopp's avatar
 
knopp committed
111
    mbsfn_status[CC_id]=0;
112 113
    // clear vrb_map
    memset(eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map,0,100);
knopp's avatar
 
knopp committed
114
  }
115

knopp's avatar
 
knopp committed
116
  // refresh UE list based on UEs dropped by PHY in previous subframe
117 118 119
  i = UE_list->head;

  while (i>=0) {
120 121 122 123
    rnti = UE_RNTI(module_idP, i);
    CC_id = UE_PCCID(module_idP, i);
    LOG_D(MAC,"UE %d: rnti %x (%p)\n", i, rnti,
          mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti));
124
    next_i= UE_list->next[i];
125

126 127
    if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) {
      mac_remove_ue(module_idP, i, frameP, subframeP);
128 129
    }
    i = next_i;
knopp's avatar
 
knopp committed
130
  }
131

132
#if defined(ENABLE_ITTI)
133

134
  do {
135 136
    // Checks if a message has been sent to MAC sub-task
    itti_poll_msg (TASK_MAC_ENB, &msg_p);
137

138 139 140
    if (msg_p != NULL) {
      msg_name = ITTI_MSG_NAME (msg_p);
      instance = ITTI_MSG_INSTANCE (msg_p);
141

142 143 144 145
      switch (ITTI_MSG_ID(msg_p)) {
      case MESSAGE_TEST:
        LOG_D(MAC, "Received %s\n", ITTI_MSG_NAME(msg_p));
        break;
146

147 148 149 150
      case RRC_MAC_BCCH_DATA_REQ:
        LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d\n",
              msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
              RRC_MAC_BCCH_DATA_REQ (msg_p).frame, RRC_MAC_BCCH_DATA_REQ (msg_p).enb_index);
151

152 153
        // TODO process BCCH data req.
        break;
154

155 156 157 158
      case RRC_MAC_CCCH_DATA_REQ:
        LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d\n",
              msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
              RRC_MAC_CCCH_DATA_REQ (msg_p).frame, RRC_MAC_CCCH_DATA_REQ (msg_p).enb_index);
159

160 161
        // TODO process CCCH data req.
        break;
162 163 164

#ifdef Rel10

165 166 167 168
      case RRC_MAC_MCCH_DATA_REQ:
        LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d, mbsfn_sync_area %d\n",
              msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
              RRC_MAC_MCCH_DATA_REQ (msg_p).frame, RRC_MAC_MCCH_DATA_REQ (msg_p).enb_index, RRC_MAC_MCCH_DATA_REQ (msg_p).mbsfn_sync_area);
169

170 171 172
        // TODO process MCCH data req.
        break;
#endif
173

174 175 176
      default:
        LOG_E(MAC, "Received unexpected message %s\n", msg_name);
        break;
gauthier's avatar
gauthier committed
177
      }
178 179 180 181

      result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
      AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
    }
182
  } while(msg_p != NULL);
183

184 185
#endif

gauthier's avatar
gauthier committed
186
  // clear DCI and BCCH contents before scheduling
187
  for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
knopp's avatar
 
knopp committed
188 189
    DCI_pdu[CC_id]->Num_common_dci  = 0;
    DCI_pdu[CC_id]->Num_ue_spec_dci = 0;
190

191

192
#ifdef Rel10
193
    eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0;
194
#endif
195

knopp's avatar
 
knopp committed
196 197
    eNB_mac_inst[module_idP].frame    = frameP;
    eNB_mac_inst[module_idP].subframe = subframeP;
198 199


knopp's avatar
 
knopp committed
200
  }
201

gauthier's avatar
gauthier committed
202
  //if (subframeP%5 == 0)
knopp's avatar
 
knopp committed
203
  //#ifdef EXMIMO
204
  PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, 0,module_idP);
205
  pdcp_run(&ctxt);
knopp's avatar
 
knopp committed
206
  //#endif
207

208
  // check HO
209 210
  rrc_rx_tx(&ctxt,
            0, // eNB index, unused in eNB
211
            CC_id);
212 213

#ifdef Rel10
214 215

  for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
216 217 218 219
    if (eNB_mac_inst[module_idP].common_channels[CC_id].MBMS_flag >0) {
      start_meas(&eNB_mac_inst[module_idP].schedule_mch);
      mbsfn_status[CC_id] = schedule_MBMS(module_idP,CC_id,frameP,subframeP);
      stop_meas(&eNB_mac_inst[module_idP].schedule_mch);
knopp's avatar
 
knopp committed
220
    }
221
  }
222

223
#endif
knopp's avatar
 
knopp committed
224
  // refresh UE list based on UEs dropped by PHY in previous subframe
225
  /*
knopp's avatar
 
knopp committed
226 227 228
  i=UE_list->head;
  while (i>=0) {
    next_i = UE_list->next[i];
229
    LOG_T(MAC,"UE %d : rnti %x, stats %p\n",i,UE_RNTI(module_idP,i),mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i)));
knopp's avatar
 
knopp committed
230
    if (mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i))==NULL) {
knopp's avatar
 
knopp committed
231
      mac_remove_ue(module_idP,i,frameP);
knopp's avatar
 
knopp committed
232 233 234
    }
    i=next_i;
  }
235
  */
236

gauthier's avatar
gauthier committed
237
  switch (subframeP) {
238
  case 0:
239

240
    // FDD/TDD Schedule Downlink RA transmissions (RA response, Msg4 Contention resolution)
gauthier's avatar
gauthier committed
241
    // Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6)
242
    // Schedule Normal DLSCH
gauthier's avatar
gauthier committed
243

knopp's avatar
knopp committed
244

245 246
    schedule_RA(module_idP,frameP,subframeP,2);

247 248

    if (mac_xface->lte_frame_parms->frame_type == FDD) {  //FDD
249
      schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag);
250 251 252
    } else if  ((mac_xface->lte_frame_parms->tdd_config == TDD) || //TDD
                (mac_xface->lte_frame_parms->tdd_config == 3) ||
                (mac_xface->lte_frame_parms->tdd_config == 6)) {
253
      //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag);
Florian Kaltenberger's avatar
Florian Kaltenberger committed
254
    }
255

256 257
    schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
    fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
258

259 260 261
    break;

  case 1:
262

gauthier's avatar
gauthier committed
263
    // TDD, schedule UL for subframeP 7 (TDD config 0,1) / subframeP 8 (TDD Config 6)
264 265
    // FDD, schedule normal UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == TDD) { // TDD
266 267 268
      switch (mac_xface->lte_frame_parms->tdd_config) {
      case 0:
      case 1:
269
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7);
270
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
271 272 273
        break;

      case 6:
274
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8);
275
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
276 277 278 279 280 281
        break;

      default:
        break;
      }
    } else { //FDD
282
      schedule_ulsch(module_idP,frameP,cooperation_flag,1,5);
283
      //      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
284
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
285
    }
286

287
    break;
288 289

  case 2:
290

gauthier's avatar
gauthier committed
291
    // TDD, nothing
292 293
    // FDD, normal UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == FDD) {  //FDD
294
      schedule_ulsch(module_idP,frameP,cooperation_flag,2,6);
295
      //      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
296
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
297
    }
298

299 300 301
    break;

  case 3:
302

gauthier's avatar
gauthier committed
303
    // TDD Config 2, ULSCH for subframeP 7
304 305 306
    // TDD Config 2/5 normal DLSCH
    // FDD, normal UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == TDD) {
307 308
      switch (mac_xface->lte_frame_parms->tdd_config) {
      case 2:
309
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7);
310 311 312

        // no break here!
      case 5:
313 314
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
315 316 317 318 319 320
        break;

      default:
        break;
      }
    } else { //FDD
321

322
      schedule_ulsch(module_idP,frameP,cooperation_flag,3,7);
323
      //      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
324
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
325
    }
326

327
    break;
328 329

  case 4:
330

gauthier's avatar
gauthier committed
331
    // TDD Config 1, ULSCH for subframeP 8
332 333 334
    // TDD Config 1/2/4/5 DLSCH
    // FDD UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == 1) { // TDD
335 336
      switch (mac_xface->lte_frame_parms->tdd_config) {
      case 1:
337
        //        schedule_RA(module_idP,frameP,subframeP);
338
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8);
339 340 341 342 343 344 345 346 347

        // no break here!
      case 2:

        // no break here!
      case 4:

        // no break here!
      case 5:
knopp's avatar
knopp committed
348

349 350
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
351 352 353 354 355 356 357 358
        break;

      default:
        break;
      }
    } else {
      if (mac_xface->lte_frame_parms->frame_type == FDD) {  //FDD

359 360
	//        schedule_RA(module_idP,frameP, subframeP, 0);
	schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8);
361
	//	schedule_ue_spec(module_idP, frameP, subframeP,  mbsfn_status);
362
        fill_DLSCH_dci(module_idP, frameP, subframeP,   mbsfn_status);
363
      }
364
    }
365

366 367 368 369 370 371 372
    break;

  case 5:
    // TDD/FDD Schedule SI
    // TDD Config 0,6 ULSCH for subframes 9,3 resp.
    // TDD normal DLSCH
    // FDD normal UL/DLSCH
373
    schedule_SI(module_idP,frameP,subframeP);
374

375
    //schedule_RA(module_idP,frameP,subframeP,5);
376
    if (mac_xface->lte_frame_parms->frame_type == FDD) {
377 378 379 380
      schedule_RA(module_idP,frameP,subframeP,1);
      schedule_ulsch(module_idP,frameP,cooperation_flag,5,9);
      schedule_ue_spec(module_idP, frameP, subframeP,  mbsfn_status);
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
381 382
    } else if ((mac_xface->lte_frame_parms->tdd_config == 0) || // TDD Config 0
               (mac_xface->lte_frame_parms->tdd_config == 6)) { // TDD Config 6
383
      //schedule_ulsch(module_idP,cooperation_flag,subframeP);
384
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
385
    } else {
386 387
      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
388
    }
389

390 391 392
    break;

  case 6:
393

394 395 396 397
    // TDD Config 0,1,6 ULSCH for subframes 2,3
    // TDD Config 3,4,5 Normal DLSCH
    // FDD normal ULSCH/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == TDD) { // TDD
398 399 400 401 402
      switch (mac_xface->lte_frame_parms->tdd_config) {
      case 0:
        break;

      case 1:
403
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2);
404 405
        //  schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
406 407 408
        break;

      case 6:
409
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3);
410 411
        //  schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
412 413 414
        break;

      case 5:
415 416 417
        schedule_RA(module_idP,frameP,subframeP,2);
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
418 419 420 421
        break;

      case 3:
      case 4:
422 423
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
424 425 426 427 428 429
        break;

      default:
        break;
      }
    } else { //FDD
430
      //      schedule_ulsch(module_idP,frameP,cooperation_flag,6,0);
431
      //      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
432
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
433
    }
434

435
    break;
gauthier's avatar
gauthier committed
436

437
  case 7:
438

439 440 441
    // TDD Config 3,4,5 Normal DLSCH
    // FDD Normal UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == TDD) { // TDD
442 443 444
      switch (mac_xface->lte_frame_parms->tdd_config) {
      case 3:
      case 4:
445 446 447
        schedule_RA(module_idP,frameP,subframeP,3);  // 3 = Msg3 subframeP, not
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
448 449 450
        break;

      case 5:
451 452
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
453 454 455 456 457 458
        break;

      default:
        break;
      }
    } else { //FDD
459
      //schedule_ulsch(module_idP,frameP,cooperation_flag,7,1);
460
      //      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
461
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
462
    }
463

464 465 466
    break;

  case 8:
467

gauthier's avatar
gauthier committed
468
    // TDD Config 2,3,4,5 ULSCH for subframeP 2
469 470 471
    //
    // FDD Normal UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == TDD) { // TDD
472 473 474 475 476 477
      switch (mac_xface->lte_frame_parms->tdd_config) {
      case 2:
      case 3:
      case 4:
      case 5:

478
        //  schedule_RA(module_idP,subframeP);
479
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2);
480 481
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
482 483 484 485 486 487
        break;

      default:
        break;
      }
    } else { //FDD
488
      //schedule_ulsch(module_idP,frameP,cooperation_flag,8,2);
489
      //      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
490
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
491
    }
492

493 494 495
    break;

  case 9:
496

497 498
    // TDD Config 1,3,4,6 ULSCH for subframes 3,3,3,4
    if (mac_xface->lte_frame_parms->frame_type == TDD) {
499 500
      switch (mac_xface->lte_frame_parms->tdd_config) {
      case 1:
501
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3);
502 503 504
        schedule_RA(module_idP,frameP,subframeP,7);  // 7 = Msg3 subframeP, not
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
505 506 507 508
        break;

      case 3:
      case 4:
509
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3);
510 511
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
512 513 514
        break;

      case 6:
515
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);
516 517 518
        //schedule_RA(module_idP,frameP,subframeP);
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
519 520 521 522
        break;

      case 2:
      case 5:
523 524 525
        //schedule_RA(module_idP,frameP,subframeP);
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
526 527 528 529 530 531
        break;

      default:
        break;
      }
    } else { //FDD
532
      //     schedule_ulsch(module_idP,frameP,cooperation_flag,9,3);
533
      //      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
534
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
535
    }
536

537
    break;
gauthier's avatar
gauthier committed
538

539
  }
540

541
  LOG_D(MAC,"FrameP %d, subframeP %d : Scheduling CCEs\n",frameP,subframeP);
542

543
  // Allocate CCEs for good after scheduling is done
544 545
  for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
    allocate_CCEs(module_idP,CC_id,subframeP,0);
546

547
  LOG_D(MAC,"frameP %d, subframeP %d\n",frameP,subframeP);
548

549
  stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
gauthier's avatar
gauthier committed
550
  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT);
551

552
}
553 554 555