eNB_scheduler.c 17.3 KB
Newer Older
1
/*******************************************************************************
2 3
    OpenAirInterface
    Copyright(c) 1999 - 2014 Eurecom
4

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


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

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
22 23 24 25
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
  OpenAirInterface Dev  : openair4g-devel@eurecom.fr

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

28
*******************************************************************************/
29
/*! \file eNB_scheduler.c
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"
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"
55

56 57
#include "RRC/LITE/extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
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
70

71 72 73 74 75
/*
  #ifndef USER_MODE
  #define msg debug_msg
  #endif
 */
76 77 78



79

80
void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP) {//, int calibration_flag) {
81

knopp's avatar
knopp committed
82 83 84 85
  unsigned int nprb[MAX_NUM_CCs];
  unsigned int nCCE[MAX_NUM_CCs];
  int mbsfn_status[MAX_NUM_CCs];
  uint32_t RBalloc[MAX_NUM_CCs];
86
#ifdef EXMIMO
87
  int ret;
88
#endif
89
#if defined(ENABLE_ITTI)
90 91 92 93
  MessageDef   *msg_p;
  const char   *msg_name;
  instance_t    instance;
  int           result;
94
#endif
knopp's avatar
knopp committed
95
  DCI_PDU *DCI_pdu[MAX_NUM_CCs];
knopp's avatar
knopp committed
96
  int CC_id,i,next_i;
knopp's avatar
knopp committed
97
  UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
98

knopp's avatar
knopp committed
99
  //  LOG_I(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
100

101 102
  start_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
  vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN);
103

knopp's avatar
knopp committed
104 105 106 107 108 109 110
  for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
    DCI_pdu[CC_id] = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
    nCCE[CC_id]=0;
    nprb[CC_id]=0;
    RBalloc[CC_id]=0;
    mbsfn_status[CC_id]=0;
  }
knopp's avatar
knopp committed
111 112 113 114 115 116
  // refresh UE list based on UEs dropped by PHY in previous subframe
  for (i=UE_list->head;i>0;i=UE_list->next[i]) {
    LOG_I(MAC,"UE %d: rnti %x (%p)\n",i,UE_RNTI(module_idP,i),mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i)));
    if (mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i))==NULL)
      mac_remove_ue(module_idP,i);
  }
117 118
#if defined(ENABLE_ITTI)
  do {
119 120
      // Checks if a message has been sent to MAC sub-task
      itti_poll_msg (TASK_MAC_ENB, &msg_p);
121

122 123 124
      if (msg_p != NULL) {
          msg_name = ITTI_MSG_NAME (msg_p);
          instance = ITTI_MSG_INSTANCE (msg_p);
125

126 127 128 129
          switch (ITTI_MSG_ID(msg_p)) {
          case MESSAGE_TEST:
            LOG_D(MAC, "Received %s\n", ITTI_MSG_NAME(msg_p));
            break;
130

131 132
          case RRC_MAC_BCCH_DATA_REQ:
            LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d\n",
133
                msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
134
                RRC_MAC_BCCH_DATA_REQ (msg_p).frame, RRC_MAC_BCCH_DATA_REQ (msg_p).enb_index);
135

136 137
            // TODO process BCCH data req.
            break;
138

139 140
          case RRC_MAC_CCCH_DATA_REQ:
            LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d\n",
141
                msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
142
                RRC_MAC_CCCH_DATA_REQ (msg_p).frame, RRC_MAC_CCCH_DATA_REQ (msg_p).enb_index);
143

144 145
            // TODO process CCCH data req.
            break;
146 147

#ifdef Rel10
148 149
          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",
150
                msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
151
                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);
152

153 154
            // TODO process MCCH data req.
            break;
155 156
#endif

157 158 159 160
          default:
            LOG_E(MAC, "Received unexpected message %s\n", msg_name);
            break;
          }
161

162 163 164
          result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
          AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
      }
165 166 167
  } while(msg_p != NULL);
#endif

168
  // clear DCI and BCCH contents before scheduling
knopp's avatar
knopp committed
169 170 171 172 173
  for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
    DCI_pdu[CC_id]->Num_common_dci  = 0;
    DCI_pdu[CC_id]->Num_ue_spec_dci = 0;
    eNB_mac_inst[module_idP].common_channels[CC_id].bcch_active = 0;
    
174
#ifdef Rel10
175
    eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0;
176
#endif
knopp's avatar
knopp committed
177 178 179 180
    
    eNB_mac_inst[module_idP].frame    = frameP;
    eNB_mac_inst[module_idP].subframe = subframeP;
  }
181

182
  //if (subframeP%5 == 0)
knopp's avatar
knopp committed
183
  //#ifdef EXMIMO
184
  pdcp_run(frameP, 1, 0, module_idP);
knopp's avatar
knopp committed
185
  //#endif
186

187
  // check HO
188
  rrc_rx_tx(module_idP,
189 190
	    frameP,
	    1,
191 192
	    module_idP,
            CC_id);
193 194

#ifdef Rel10
knopp's avatar
knopp committed
195
  for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
196 197 198 199
    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
200
    }
201 202
  }
#endif
knopp's avatar
knopp committed
203
  // refresh UE list based on UEs dropped by PHY in previous subframe
knopp's avatar
knopp committed
204 205 206 207 208
  i=UE_list->head;
  while (i>=0) {
    next_i = UE_list->next[i];
    LOG_D(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)));
    if (mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i))==NULL) {
knopp's avatar
knopp committed
209
      mac_remove_ue(module_idP,i);
knopp's avatar
knopp committed
210 211 212
    }
    i=next_i;
  }
knopp's avatar
knopp committed
213

214

215
  switch (subframeP) {
216 217
  case 0:
    // FDD/TDD Schedule Downlink RA transmissions (RA response, Msg4 Contention resolution)
218
    // Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6)
219
    // Schedule Normal DLSCH
220

knopp's avatar
knopp committed
221
    schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE);
222 223

    if (mac_xface->lte_frame_parms->frame_type == FDD) {  //FDD
knopp's avatar
knopp committed
224
      schedule_ulsch(module_idP,frameP,cooperation_flag,0,4,nCCE);//,calibration_flag);
225 226
    }
    else if  ((mac_xface->lte_frame_parms->tdd_config == TDD) || //TDD
227 228
        (mac_xface->lte_frame_parms->tdd_config == 3) ||
        (mac_xface->lte_frame_parms->tdd_config == 6))
knopp's avatar
knopp committed
229
      //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4,nCCE);//,calibration_flag);
230

231

knopp's avatar
knopp committed
232
      // schedule_ue_spec(module_idP,subframeP,nprb,nCCE,mbsfn_status);
233

234
      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
235 236 237
    break;

  case 1:
238
    // TDD, schedule UL for subframeP 7 (TDD config 0,1) / subframeP 8 (TDD Config 6)
239 240
    // FDD, schedule normal UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == TDD) { // TDD
241 242 243
        switch (mac_xface->lte_frame_parms->tdd_config) {
        case 0:
        case 1:
knopp's avatar
knopp committed
244
          schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7,nCCE);
245 246 247
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;
        case 6:
knopp's avatar
knopp committed
248
          schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8,nCCE);
249 250 251 252 253
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;
        default:
          break;
        }
254 255
    }
    else {  //FDD
knopp's avatar
knopp committed
256 257
      schedule_ulsch(module_idP,frameP,cooperation_flag,1,5,nCCE);
        // schedule_ue_spec(module_idP,subframeP,nprb,nCCE,mbsfn_status);
258
        // fill_DLSCH_dci(module_idP,subframeP,RBalloc,0,mbsfn_status);
259 260
    }
    break;
261 262

  case 2:
263
    // TDD, nothing
264 265
    // FDD, normal UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == FDD) {  //FDD
knopp's avatar
knopp committed
266 267
      schedule_ulsch(module_idP,frameP,cooperation_flag,2,6,nCCE);
        // schedule_ue_spec(module_idP,subframeP,nprb,nCCE,mbsfn_status);
268
        // fill_DLSCH_dci(module_idP,subframeP,RBalloc,0,mbsfn_status);
269 270 271 272
    }
    break;

  case 3:
273
    // TDD Config 2, ULSCH for subframeP 7
274 275 276
    // TDD Config 2/5 normal DLSCH
    // FDD, normal UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == TDD) {
277 278
        switch (mac_xface->lte_frame_parms->tdd_config) {
        case 2:
knopp's avatar
knopp committed
279
          schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7,nCCE);
280
        case 5:
knopp's avatar
knopp committed
281
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
282 283 284 285 286
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;
        default:
          break;
        }
287 288
    }
    else { //FDD
knopp's avatar
knopp committed
289
        //      schedule_ulsch(module_idP,frameP,cooperation_flag,3,7,nCCE);
290 291
        // schedule_ue_spec(module_idP,subframeP,0,0,mbsfn_status);
        // fill_DLSCH_dci(module_idP,subframeP,RBalloc,0,mbsfn_status);
292 293
    }
    break;
294 295

  case 4:
296
    // TDD Config 1, ULSCH for subframeP 8
297 298 299
    // TDD Config 1/2/4/5 DLSCH
    // FDD UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == 1) { // TDD
300 301
        switch (mac_xface->lte_frame_parms->tdd_config) {
        case 1:
knopp's avatar
knopp committed
302 303
          //        schedule_RA(module_idP,frameP,subframeP,nprb,nCCE);
          schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8,nCCE);
304 305 306
        case 2:
        case 4:
        case 5:
knopp's avatar
knopp committed
307
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
308 309 310 311 312
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
          break;
        default:
          break;
        }
313 314
    }
    else {
315
        if (mac_xface->lte_frame_parms->frame_type == FDD) {  //FDD
knopp's avatar
knopp committed
316 317 318 319
	  schedule_RA(module_idP,frameP, subframeP, 0, nprb, nCCE);
            //	schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8, nCCE);
            //schedule_ue_spec(module_idP, frameP, subframeP, nprb, nCCE, mbsfn_status);
	  fill_DLSCH_dci(module_idP, frameP, subframeP, RBalloc, 1, mbsfn_status);
knopp's avatar
knopp committed
320

321
        }
322 323 324 325 326 327 328 329
    }
    break;

  case 5:
    // TDD/FDD Schedule SI
    // TDD Config 0,6 ULSCH for subframes 9,3 resp.
    // TDD normal DLSCH
    // FDD normal UL/DLSCH
knopp's avatar
knopp committed
330 331
    schedule_SI(module_idP,frameP,nprb,nCCE);
    //schedule_RA(module_idP,frameP,subframeP,5,nprb,nCCE);
332
    if ((mac_xface->lte_frame_parms->frame_type == FDD) ) {
knopp's avatar
knopp committed
333 334
        //      schedule_RA(module_idP,frameP,subframeP,1,nprb,nCCE);
        //      schedule_ulsch(module_idP,frameP,cooperation_flag,5,9,nCCE);
335
        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
336 337 338

    }
    else if ((mac_xface->lte_frame_parms->tdd_config == 0) || // TDD Config 0
339
        (mac_xface->lte_frame_parms->tdd_config == 6)) { // TDD Config 6
knopp's avatar
knopp committed
340
        //schedule_ulsch(module_idP,cooperation_flag,subframeP,nCCE);
341
        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
342 343
    }
    else {
knopp's avatar
knopp committed
344
        //schedule_ue_spec(module_idP,subframeP,nprb,nCCE,mbsfn_status);
345
        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
346 347 348 349 350 351 352 353
    }
    break;

  case 6:
    // 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
354 355 356 357
        switch (mac_xface->lte_frame_parms->tdd_config) {
        case 0:
          break;
        case 1:
knopp's avatar
knopp committed
358 359
          schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2,nCCE);
          //	schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
360 361 362
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;
        case 6:
knopp's avatar
knopp committed
363 364
          schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3,nCCE);
          //	schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
365 366 367
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;
        case 5:
knopp's avatar
knopp committed
368 369
          schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE);
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
370 371 372 373
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
          break;
        case 3:
        case 4:
knopp's avatar
knopp committed
374
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
375 376 377 378 379 380
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;

        default:
          break;
        }
381 382
    }
    else {  //FDD
knopp's avatar
knopp committed
383 384
        //      schedule_ulsch(module_idP,frameP,cooperation_flag,6,0,nCCE);
        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
385
        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
386 387
    }
    break;
388

389 390 391 392
  case 7:
    // TDD Config 3,4,5 Normal DLSCH
    // FDD Normal UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == TDD) { // TDD
393 394 395
        switch (mac_xface->lte_frame_parms->tdd_config) {
        case 3:
        case 4:
knopp's avatar
knopp committed
396 397
          //	  schedule_RA(module_idP,frameP,subframeP,3,nprb,nCCE);  // 3 = Msg3 subframeP, not
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
398 399 400
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); //1,mbsfn_status);
          break;
        case 5:
knopp's avatar
knopp committed
401
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
402 403 404 405 406
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;
        default:
          break;
        }
407
    }
408
    else {  //FDD
knopp's avatar
knopp committed
409 410
        //      schedule_ulsch(module_idP,frameP,cooperation_flag,7,1,nCCE);
        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
411
        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
412 413 414 415
    }
    break;

  case 8:
416
    // TDD Config 2,3,4,5 ULSCH for subframeP 2
417 418 419
    //
    // FDD Normal UL/DLSCH
    if (mac_xface->lte_frame_parms->frame_type == TDD) { // TDD
420 421 422 423 424 425
        switch (mac_xface->lte_frame_parms->tdd_config) {
        case 2:
        case 3:
        case 4:
        case 5:

knopp's avatar
knopp committed
426 427 428
          //	schedule_RA(module_idP,subframeP,nprb,nCCE);
          schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2,nCCE);
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
429 430 431 432 433
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;
        default:
          break;
        }
434 435
    }
    else {  //FDD
knopp's avatar
knopp committed
436 437
        //      schedule_ulsch(module_idP,frameP,cooperation_flag,8,2,nCCE);
        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
438
        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
439 440 441 442 443 444
    }
    break;

  case 9:
    // TDD Config 1,3,4,6 ULSCH for subframes 3,3,3,4
    if (mac_xface->lte_frame_parms->frame_type == TDD) {
445 446
        switch (mac_xface->lte_frame_parms->tdd_config) {
        case 1:
knopp's avatar
knopp committed
447 448 449
          schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3,nCCE);
          schedule_RA(module_idP,frameP,subframeP,7,nprb,nCCE);  // 7 = Msg3 subframeP, not
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
450 451 452 453
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
          break;
        case 3:
        case 4:
knopp's avatar
knopp committed
454 455
          schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3,nCCE);
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
456 457 458
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;
        case 6:
knopp's avatar
knopp committed
459 460 461
          schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4,nCCE);
          //schedule_RA(module_idP,frameP,subframeP,nprb,nCCE);
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
462 463 464 465
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;
        case 2:
        case 5:
knopp's avatar
knopp committed
466 467
          //schedule_RA(module_idP,frameP,subframeP,nprb,nCCE);
          schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
468 469 470 471 472
          fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
          break;
        default:
          break;
        }
473 474
    }
    else {  //FDD
knopp's avatar
knopp committed
475 476
        //      schedule_ulsch(module_idP,frameP,cooperation_flag,9,3,nCCE);
        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
477
        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
478 479
    }
    break;
480

481
  }
482

knopp's avatar
knopp committed
483 484 485
  for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
    DCI_pdu[CC_id]->nCCE = nCCE[CC_id];
  LOG_D(MAC,"frameP %d, subframeP %d nCCE %d\n",frameP,subframeP,nCCE[0]);
486

487
  stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
488 489
  vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT);
 
490
}
491 492 493