eNB_scheduler.c 38.9 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
 */
21 22

/*! \file eNB_scheduler.c
23
 * \brief eNB scheduler top level function operates on per subframe basis
24 25
 * \author  Navid Nikaein and Raymond Knopp
 * \date 2010 - 2014
26
 * \email: navid.nikaein@eurecom.fr
27 28
 * \version 0.5
 * @ingroup _mac
29

30
 */
31

32
#include "assertions.h"
33 34 35 36 37 38 39 40
#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"
41

42 43 44 45 46 47
#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"
48

49 50
#include "RRC/LITE/extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
51

52 53
//#include "LAYER2/MAC/pre_processor.c"
#include "pdcp.h"
54

55
//Agent-related headers
56 57 58
#include "enb_agent_extern.h"
#include "enb_agent_mac.h"
#include "enb_agent_mac_proto.h"
59

60 61
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
62 63
#endif

64 65
#define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_eNB_SCHEDULER 1
66
#define ENABLE_ENB_AGENT_DL_SCHEDULER
67
//#define DISABLE_SF_TRIGGER
68
//#define DISABLE_CONT_STATS
69

70 71
//#define DEBUG_HEADER_PARSING 1
//#define DEBUG_PACKET_TRACE 1
72

73 74 75 76 77
/*
  #ifndef USER_MODE
  #define msg debug_msg
  #endif
 */
78 79 80



81

82 83 84



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

Raymond Knopp's avatar
 
Raymond Knopp committed
88
  int mbsfn_status[MAX_NUM_CCs];
89
  protocol_ctxt_t   ctxt;
90
#ifdef EXMIMO
Cedric Roux's avatar
Cedric Roux committed
91
  //int ret;
92
#endif
93
#if defined(ENABLE_ITTI)
94
  MessageDef   *msg_p;
95
  const char         *msg_name;
96 97
  instance_t    instance;
  int           result;
98
#endif
Raymond Knopp's avatar
 
Raymond Knopp committed
99
  DCI_PDU *DCI_pdu[MAX_NUM_CCs];
Raymond Knopp's avatar
 
Raymond Knopp committed
100
  int CC_id,i,next_i;
Raymond Knopp's avatar
 
Raymond Knopp committed
101
  UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
102
  rnti_t rnti;
103
  void         *DLSCH_dci=NULL;
104
  int size_bits=0,size_bytes=0;
105

106
  Protocol__FlexranMessage *msg;
107

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

110
  start_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
111
  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN);
112

113
  for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
114 115
    DCI_pdu[CC_id] = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
    mbsfn_status[CC_id]=0;
116 117
    // clear vrb_map
    memset(eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map,0,100);
Raymond Knopp's avatar
 
Raymond Knopp committed
118
  }
119

Raymond Knopp's avatar
 
Raymond Knopp committed
120
  // refresh UE list based on UEs dropped by PHY in previous subframe
121 122 123
  i = UE_list->head;

  while (i>=0) {
124 125
    rnti = UE_RNTI(module_idP, i);
    CC_id = UE_PCCID(module_idP, i);
126 127 128 129
    if ((frameP==0)&&(subframeP==0))
      LOG_I(MAC,"UE  rnti %x : %s\n", rnti, 
	    UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync");

130
    next_i= UE_list->next[i];
131

132 133 134
    PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63;
    if (i==UE_list->head)
      VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]); 
135 136
    // increment this, it is cleared when we receive an sdu
    eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++;
137 138

    eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].cqi_req_timer++;
139
    
140
    if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) {
141
	//mac_remove_ue(module_idP, i, frameP, subframeP);
142 143 144 145
      //Inform the controller about the UE deactivation. Should be moved to RRC agent in the future
      if (mac_agent_registered[module_idP]) {
	agent_mac_xface[module_idP]->enb_agent_notify_ue_state_change(module_idP,
								      rnti,
146
								      PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
147
      }
148
    }
149 150
    else {
      // check uplink failure
kaltenbe's avatar
kaltenbe committed
151 152 153 154 155 156 157
      if ((UE_list->UE_sched_ctrl[i].ul_failure_timer>0)&&
	  (UE_list->UE_sched_ctrl[i].ul_out_of_sync==0)) {
	LOG_D(MAC,"UE %d rnti %x: UL Failure timer %d \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
	if (UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent==0) {
	  UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1;
	  
	  // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe)
158
	  LOG_D(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);	    
kaltenbe's avatar
kaltenbe committed
159 160
	  DLSCH_dci = (void *)UE_list->UE_template[CC_id][i].DLSCH_DCI[0];
	  *(uint32_t*)DLSCH_dci = 0;
161 162
	  if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
	    switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
kaltenbe's avatar
kaltenbe committed
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
	    case 6:
	      ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
	      ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 31;
	      size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
	      size_bits  = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
	      break;
	    case 25:
	      ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
	      ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 511;
	      size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t);
	      size_bits  = sizeof_DCI1A_5MHz_TDD_1_6_t;
	      break;
	    case 50:
	      ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
	      ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 2047;
	      size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t);
	      size_bits  = sizeof_DCI1A_10MHz_TDD_1_6_t;
	      break;
	    case 100:
	      ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
	      ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 8191;
	      size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t);
	      size_bits  = sizeof_DCI1A_20MHz_TDD_1_6_t;
	      break;
187
	    }
kaltenbe's avatar
kaltenbe committed
188 189
	  }
	  else { // FDD
190
	    switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
kaltenbe's avatar
kaltenbe committed
191 192 193 194 195 196
	    case 6:
	      ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->type = 1;
	      ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31;
	      size_bytes = sizeof(DCI1A_1_5MHz_FDD_t);
	      size_bits  = sizeof_DCI1A_1_5MHz_FDD_t;
	      break;
197 198 199 200 201 202
	    case 15:/*
	      ((DCI1A_2_5MHz_FDD_t*)DLSCH_dci)->type = 1;
	      ((DCI1A_2_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31;
	      size_bytes = sizeof(DCI1A_1_5MHz_FDD_t);
	      size_bits  = sizeof_DCI1A_1_5MHz_FDD_t;*/
	      break;
kaltenbe's avatar
kaltenbe committed
203 204 205 206 207 208 209 210 211 212 213
	    case 25:
	      ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->type = 1;
	      ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->rballoc = 511;
	      size_bytes = sizeof(DCI1A_5MHz_FDD_t);
	      size_bits  = sizeof_DCI1A_5MHz_FDD_t;
	      break;
	    case 50:
	      ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->type = 1;
	      ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->rballoc = 2047;
	      size_bytes = sizeof(DCI1A_10MHz_FDD_t);
	      size_bits  = sizeof_DCI1A_10MHz_FDD_t;
214
		break;
215 216 217 218 219 220
	    case 75:
	      /*	      ((DCI1A_15MHz_FDD_t*)DLSCH_dci)->type = 1;
	      ((DCI1A_15MHz_FDD_t*)DLSCH_dci)->rballoc = 2047;
	      size_bytes = sizeof(DCI1A_10MHz_FDD_t);
	      size_bits  = sizeof_DCI1A_10MHz_FDD_t;*/
		break;
kaltenbe's avatar
kaltenbe committed
221 222 223 224 225 226
	    case 100:
	      ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->type = 1;
	      ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->rballoc = 8191;
	      size_bytes = sizeof(DCI1A_20MHz_FDD_t);
	      size_bits  = sizeof_DCI1A_20MHz_FDD_t;
	      break;
227 228
	    }
	  }
kaltenbe's avatar
kaltenbe committed
229 230 231 232 233 234 235 236 237
	  
	  add_ue_spec_dci(DCI_pdu[CC_id],
			  DLSCH_dci,
			  rnti,
			    size_bytes,
			  process_ue_cqi (module_idP,i),//aggregation,
			  size_bits,
			  format1A,
			  0);
238
	}
kaltenbe's avatar
kaltenbe committed
239
	else { // ra_pdcch_sent==1
240
	  LOG_D(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);	    	    
kaltenbe's avatar
kaltenbe committed
241 242
	  if ((UE_list->UE_sched_ctrl[i].ul_failure_timer % 40) == 0)
	    UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=0; // resend every 4 frames	      
243
	}
244 245 246 247 248
      
	UE_list->UE_sched_ctrl[i].ul_failure_timer++;
	// check threshold
	if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) {
	  // inform RRC of failure and clear timer
249
	  LOG_I(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
250 251 252 253
	  mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti);
	  UE_list->UE_sched_ctrl[i].ul_failure_timer=0;
	  UE_list->UE_sched_ctrl[i].ul_out_of_sync=1;
	}
kaltenbe's avatar
kaltenbe committed
254 255 256
      }
    } // ul_failure_timer>0
    
257
    i = next_i;
Raymond Knopp's avatar
 
Raymond Knopp committed
258
  }
259

260
#if defined(ENABLE_ITTI)
261

262
  do {
263 264
    // Checks if a message has been sent to MAC sub-task
    itti_poll_msg (TASK_MAC_ENB, &msg_p);
265

266 267 268
    if (msg_p != NULL) {
      msg_name = ITTI_MSG_NAME (msg_p);
      instance = ITTI_MSG_INSTANCE (msg_p);
269

270 271 272 273
      switch (ITTI_MSG_ID(msg_p)) {
      case MESSAGE_TEST:
        LOG_D(MAC, "Received %s\n", ITTI_MSG_NAME(msg_p));
        break;
274

275 276 277 278
      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);
279

280 281
        // TODO process BCCH data req.
        break;
282

283 284 285 286
      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);
287

288 289
        // TODO process CCCH data req.
        break;
290 291 292

#ifdef Rel10

293 294 295 296
      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);
297

298 299 300
        // TODO process MCCH data req.
        break;
#endif
301

302 303 304
      default:
        LOG_E(MAC, "Received unexpected message %s\n", msg_name);
        break;
305
      }
306 307 308 309

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

312 313
#endif

314
  // clear DCI and BCCH contents before scheduling
315
  for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
Raymond Knopp's avatar
 
Raymond Knopp committed
316 317
    DCI_pdu[CC_id]->Num_common_dci  = 0;
    DCI_pdu[CC_id]->Num_ue_spec_dci = 0;
318

319

320
#ifdef Rel10
321
    eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0;
322
#endif
323

Raymond Knopp's avatar
 
Raymond Knopp committed
324 325
    eNB_mac_inst[module_idP].frame    = frameP;
    eNB_mac_inst[module_idP].subframe = subframeP;
326 327


Raymond Knopp's avatar
 
Raymond Knopp committed
328
  }
329
  
330 331 332 333 334 335
/* #ifndef DISABLE_SF_TRIGGER */
/*   //Send subframe trigger to the controller */
/*   if (mac_agent_registered[module_idP]) { */
/*     agent_mac_xface[module_idP]->enb_agent_send_sf_trigger(module_idP); */
/*   } */
/* #endif */
336
  
337
  //if (subframeP%5 == 0)
Raymond Knopp's avatar
 
Raymond Knopp committed
338
  //#ifdef EXMIMO
339
  PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, subframeP,module_idP);
340
  pdcp_run(&ctxt);
Raymond Knopp's avatar
 
Raymond Knopp committed
341
  //#endif
342

343
  // check HO
344 345
  rrc_rx_tx(&ctxt,
            0, // eNB index, unused in eNB
346
            CC_id);
347 348

#ifdef Rel10
349 350

  for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
351 352 353 354
    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);
Raymond Knopp's avatar
 
Raymond Knopp committed
355
    }
356
  }
357

358
#endif
Raymond Knopp's avatar
 
Raymond Knopp committed
359
  // refresh UE list based on UEs dropped by PHY in previous subframe
360
  /*
Raymond Knopp's avatar
 
Raymond Knopp committed
361 362 363
  i=UE_list->head;
  while (i>=0) {
    next_i = UE_list->next[i];
364
    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)));
Raymond Knopp's avatar
 
Raymond Knopp committed
365
    if (mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i))==NULL) {
Raymond Knopp's avatar
 
Raymond Knopp committed
366
      mac_remove_ue(module_idP,i,frameP);
Raymond Knopp's avatar
 
Raymond Knopp committed
367 368 369
    }
    i=next_i;
  }
370
  */
371

372
  switch (subframeP) {
373
  case 0:
374

375
    // FDD/TDD Schedule Downlink RA transmissions (RA response, Msg4 Contention resolution)
376
    // Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6)
377
    // Schedule Normal DLSCH
378

Raymond Knopp's avatar
Raymond Knopp committed
379

380 381
    schedule_RA(module_idP,frameP,subframeP,2);

382

383
    if (mac_xface->frame_parms->frame_type == FDD) {  //FDD
384
      schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag);
385 386 387
    } else if  ((mac_xface->frame_parms->tdd_config == TDD) || //TDD
                (mac_xface->frame_parms->tdd_config == 3) ||
                (mac_xface->frame_parms->tdd_config == 6)) {
388
      //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag);
Florian Kaltenberger's avatar
Florian Kaltenberger committed
389
    }
390
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
391 392
    schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
    fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
393 394 395 396 397 398 399
#else
    if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
400
                                                                &msg);
401
	  
402
	  apply_dl_scheduling_decisions(module_idP,
403 404 405 406 407 408 409
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
410 411 412
    break;

  case 1:
413

414
    // TDD, schedule UL for subframeP 7 (TDD config 0,1) / subframeP 8 (TDD Config 6)
415
    // FDD, schedule normal UL/DLSCH
416 417
    if (mac_xface->frame_parms->frame_type == TDD) { // TDD
      switch (mac_xface->frame_parms->tdd_config) {
418 419
      case 0:
      case 1:
420
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7);
421
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
422
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
423
#endif
424 425 426
        break;

      case 6:
427
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8);
428
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
429
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
430
#endif
431 432 433 434 435 436
        break;

      default:
        break;
      }
    } else { //FDD
437
      schedule_ulsch(module_idP,frameP,cooperation_flag,1,5);
438
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
439
      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
440
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
441 442 443 444 445 446 447
#else
      if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
448
                                                                &msg);
449
	  
450
	  apply_dl_scheduling_decisions(module_idP,
451 452 453 454 455 456 457
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
458
    }
459

460
    break;
461 462

  case 2:
463

464
    // TDD, nothing
465
    // FDD, normal UL/DLSCH
466
    if (mac_xface->frame_parms->frame_type == FDD) {  //FDD
467
      schedule_ulsch(module_idP,frameP,cooperation_flag,2,6);
468
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
469
      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
470
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
471 472 473 474 475 476 477
#else
      if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
478
                                                                &msg);
479
	  
480
	  apply_dl_scheduling_decisions(module_idP,
481 482 483 484 485 486 487
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
488
    }
489

490 491 492
    break;

  case 3:
493

494
    // TDD Config 2, ULSCH for subframeP 7
495 496
    // TDD Config 2/5 normal DLSCH
    // FDD, normal UL/DLSCH
497 498
    if (mac_xface->frame_parms->frame_type == TDD) {
      switch (mac_xface->frame_parms->tdd_config) {
499
      case 2:
500
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7);
501 502 503

        // no break here!
      case 5:
504
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
505 506
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
507 508 509 510 511 512 513
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
514
                                                                &msg);
515
	  
516
	  apply_dl_scheduling_decisions(module_idP,
517 518 519 520 521 522 523
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
524 525 526 527 528 529
        break;

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

531
      schedule_ulsch(module_idP,frameP,cooperation_flag,3,7);
532
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
533
      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
534
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
535 536 537 538 539 540 541
#else
      if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
542
                                                                &msg);
543
	  
544
	  apply_dl_scheduling_decisions(module_idP,
545 546 547 548 549 550 551
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
552
    }
553

554
    break;
555 556

  case 4:
557

558
    // TDD Config 1, ULSCH for subframeP 8
559 560
    // TDD Config 1/2/4/5 DLSCH
    // FDD UL/DLSCH
561 562
    if (mac_xface->frame_parms->frame_type == 1) { // TDD
      switch (mac_xface->frame_parms->tdd_config) {
563
      case 1:
564
        //        schedule_RA(module_idP,frameP,subframeP);
565
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8);
566 567 568 569 570 571 572 573 574

        // no break here!
      case 2:

        // no break here!
      case 4:

        // no break here!
      case 5:
575
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
576
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
577 578 579 580 581 582 583 584
	fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
585
                                                                &msg);
586
	  
587
	  apply_dl_scheduling_decisions(module_idP,
588 589 590 591 592 593 594
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif	
595 596 597 598 599 600
        break;

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

603
	schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8);
604
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
605
	schedule_ue_spec(module_idP, frameP, subframeP,  mbsfn_status);
606
        fill_DLSCH_dci(module_idP, frameP, subframeP,   mbsfn_status);
607 608 609 610 611 612 613
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
614
                                                                &msg);
615
	  
616
	  apply_dl_scheduling_decisions(module_idP,
617 618 619 620 621 622 623
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}     
#endif
624
      }
625
    }
626

627 628 629 630 631 632 633
    break;

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

636
    //schedule_RA(module_idP,frameP,subframeP,5);
637
    if (mac_xface->frame_parms->frame_type == FDD) {
638 639
      schedule_RA(module_idP,frameP,subframeP,1);
      schedule_ulsch(module_idP,frameP,cooperation_flag,5,9);
640
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
641 642
      schedule_ue_spec(module_idP, frameP, subframeP,  mbsfn_status);
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
643 644 645 646 647 648 649
#else
      if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
650
                                                                &msg);
651
	  
652
	  apply_dl_scheduling_decisions(module_idP,
653 654 655 656 657 658 659
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
660 661
    } else if ((mac_xface->frame_parms->tdd_config == 0) || // TDD Config 0
               (mac_xface->frame_parms->tdd_config == 6)) { // TDD Config 6
662
      //schedule_ulsch(module_idP,cooperation_flag,subframeP);
663
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
664
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
665
#endif
666
    } else {
667
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
668 669
      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
670 671 672 673 674 675 676
#else
      if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
677
                                                                &msg);
678
	  
679
	  apply_dl_scheduling_decisions(module_idP,
680 681 682 683 684 685 686
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
687
    }
688

689 690 691
    break;

  case 6:
692

693 694 695
    // TDD Config 0,1,6 ULSCH for subframes 2,3
    // TDD Config 3,4,5 Normal DLSCH
    // FDD normal ULSCH/DLSCH
696 697
    if (mac_xface->frame_parms->frame_type == TDD) { // TDD
      switch (mac_xface->frame_parms->tdd_config) {
698 699 700 701
      case 0:
        break;

      case 1:
702
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2);
703
        //  schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
704
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
705
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
706
#endif
707 708 709
        break;

      case 6:
710
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3);
711
        //  schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
712
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
713
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
714
#endif
715 716 717
        break;

      case 5:
718
        schedule_RA(module_idP,frameP,subframeP,2);
719
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
720 721
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
722 723 724 725 726 727 728
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
729
                                                                &msg);
730
	  
731
	  apply_dl_scheduling_decisions(module_idP,
732 733 734 735 736 737 738
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
739 740 741 742
        break;

      case 3:
      case 4:
743
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
744 745
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
746 747 748 749 750 751 752
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
753
                                                                &msg);
754
	  
755
	  apply_dl_scheduling_decisions(module_idP,
756 757 758 759 760 761 762
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
763 764 765 766 767 768
        break;

      default:
        break;
      }
    } else { //FDD
769
      schedule_ulsch(module_idP,frameP,cooperation_flag,6,0);
770
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
771
      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
772
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
773 774 775 776 777 778 779
#else
      if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
780
                                                                &msg);
781
	  
782
	  apply_dl_scheduling_decisions(module_idP,
783 784 785 786 787 788 789
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
790
    }
791

792
    break;
793

794
  case 7:
795

796 797
    // TDD Config 3,4,5 Normal DLSCH
    // FDD Normal UL/DLSCH
798 799
    if (mac_xface->frame_parms->frame_type == TDD) { // TDD
      switch (mac_xface->frame_parms->tdd_config) {
800 801
      case 3:
      case 4:
802
        schedule_RA(module_idP,frameP,subframeP,3);  // 3 = Msg3 subframeP, not
803
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
804 805
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
806 807 808 809 810 811 812
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
813
                                                                &msg);
814
	  
815
	  apply_dl_scheduling_decisions(module_idP,
816 817 818 819 820 821 822
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
823 824 825
        break;

      case 5:
826
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
827 828
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
829 830 831 832 833 834 835
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
836
                                                                &msg);
837
	  
838
	  apply_dl_scheduling_decisions(module_idP,
839 840 841 842 843 844 845
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
846 847 848 849 850 851
        break;

      default:
        break;
      }
    } else { //FDD
852
      schedule_ulsch(module_idP,frameP,cooperation_flag,7,1);
853
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
854
      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
855
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
856 857 858 859 860 861 862
#else
      if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
863
                                                                &msg);
864
	  
865
	  apply_dl_scheduling_decisions(module_idP,
866 867 868 869 870 871 872
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
873
    }
874

875 876 877
    break;

  case 8:
878

879
    // TDD Config 2,3,4,5 ULSCH for subframeP 2
880 881
    //
    // FDD Normal UL/DLSCH
882 883
    if (mac_xface->frame_parms->frame_type == TDD) { // TDD
      switch (mac_xface->frame_parms->tdd_config) {
884 885 886 887 888
      case 2:
      case 3:
      case 4:
      case 5:

889
        //  schedule_RA(module_idP,subframeP);
890
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2);
891
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
892 893
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
894 895 896 897 898 899 900
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
901
                                                                &msg);
902
	  
903
	  apply_dl_scheduling_decisions(module_idP,
904 905 906 907 908 909 910
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
911 912 913 914 915 916
        break;

      default:
        break;
      }
    } else { //FDD
917
      schedule_ulsch(module_idP,frameP,cooperation_flag,8,2);
918
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
919
      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
920
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
921 922 923 924 925 926 927
#else
      if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
928
                                                                &msg);
929
	  
930
	  apply_dl_scheduling_decisions(module_idP,
931 932 933 934 935 936 937
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
938
    }
939

940 941 942
    break;

  case 9:
943

944
    // TDD Config 1,3,4,6 ULSCH for subframes 3,3,3,4
945 946
    if (mac_xface->frame_parms->frame_type == TDD) {
      switch (mac_xface->frame_parms->tdd_config) {
947
      case 1:
948
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3);
949
        schedule_RA(module_idP,frameP,subframeP,7);  // 7 = Msg3 subframeP, not
950
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
951 952
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
953 954 955 956 957 958 959
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
960
                                                                &msg);
961
	  
962
	  apply_dl_scheduling_decisions(module_idP,
963 964 965 966 967 968 969
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
970 971 972 973
        break;

      case 3:
      case 4:
974
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3);
975
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
976 977
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
978 979 980 981 982 983 984
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
985
                                                                &msg);
986
	  
987
	  apply_dl_scheduling_decisions(module_idP,
988 989 990 991 992 993 994
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
995 996 997
        break;

      case 6:
998
        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);
999
        //schedule_RA(module_idP,frameP,subframeP);
1000
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
1001 1002
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
1003 1004 1005 1006 1007 1008 1009
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
1010
                                                                &msg);
1011
	  
1012
	  apply_dl_scheduling_decisions(module_idP,
1013 1014 1015 1016 1017 1018 1019
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
1020 1021 1022 1023
        break;

      case 2:
      case 5:
1024
        //schedule_RA(module_idP,frameP,subframeP);
1025
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
1026 1027
        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
1028 1029 1030 1031 1032 1033 1034
#else
	if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
1035
                                                                &msg);
1036
	  
1037
	  apply_dl_scheduling_decisions(module_idP,
1038 1039 1040 1041 1042 1043 1044
				     frameP,
				     subframeP,
				     mbsfn_status,
				     msg);
	  enb_agent_mac_destroy_dl_config(msg);
	}
#endif
1045 1046 1047 1048 1049 1050
        break;

      default:
        break;
      }
    } else { //FDD
1051
      schedule_ulsch(module_idP,frameP,cooperation_flag,9,3);
1052
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
1053
      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
1054
      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
1055 1056 1057 1058 1059 1060 1061
#else
      if (mac_agent_registered[module_idP]) {                                  
	  agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
                                                                module_idP,
                                                                frameP,                  
                                                                subframeP,
                                                                mbsfn_status,
1062
                                                                &msg);
1063
	  
1064
	  apply_dl_scheduling_decisions(module_idP,
1065 1066 1067 1068
					frameP,
					subframeP,
					mbsfn_status,
					msg);
1069 1070 1071
	  enb_agent_mac_destroy_dl_config(msg);
      }
#endif
1072
    }
1073

1074
    break;
1075

1076
  }
1077

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

1080
  // Allocate CCEs for good after scheduling is done
1081 1082
  for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
    allocate_CCEs(module_idP,CC_id,subframeP,0);
1083

1084 1085 1086 1087 1088 1089 1090
#ifndef DISABLE_CONT_STATS
  //Send subframe trigger to the controller
  if (mac_agent_registered[module_idP]) {
    agent_mac_xface[module_idP]->enb_agent_send_update_mac_stats(module_idP);
  }
#endif

Raymond Knopp's avatar
Raymond Knopp committed
1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108
  /*
  int dummy=0;
  for (i=0;
       i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci;
       i++)
    if (DCI_pdu[CC_id]->dci_alloc[i].rnti==2)
      dummy=1;
	
  if (dummy==1)
    for (i=0;
	 i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci;
	 i++)
      LOG_I(MAC,"Frame %d, subframe %d: DCI %d/%d, format %d, rnti %x, NCCE %d(num_pdcch_symb %d)\n",
	    frameP,subframeP,i,DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci,
	    DCI_pdu[CC_id]->dci_alloc[i].format,
	    DCI_pdu[CC_id]->dci_alloc[i].rnti,
	    DCI_pdu[CC_id]->dci_alloc[i].firstCCE,
	    DCI_pdu[CC_id]->num_pdcch_symbols);
1109

1110
  LOG_D(MAC,"frameP %d, subframeP %d\n",frameP,subframeP);
Raymond Knopp's avatar
Raymond Knopp committed
1111
  */
1112

1113
  stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
1114
  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT);
1115

1116
}
1117 1118 1119