Commit cb8007bb authored by Xenofon Foukas's avatar Xenofon Foukas
Browse files

Added support for enb agent MAC scheduler hot-plugging. Deactivated...

Added support for enb agent MAC scheduler hot-plugging. Deactivated schedule_ue_spec and added agent UE specific DL scheduler
parent 92f54765
......@@ -1007,6 +1007,7 @@ set (MAC_SRC
${MAC_DIR}/eNB_scheduler_RA.c
${MAC_DIR}/pre_processor.c
${MAC_DIR}/config.c
${MAC_DIR}/eNB_agent_scheduler_dlsch_ue.c
)
set (ENB_APP_SRC
......
......@@ -256,6 +256,12 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
enb_agent_init_cont_mac_stats_update(mod_id);
new_thread(receive_thread, &enb_agent[mod_id]);
/*Initialize and register the mac xface. Must be modified later
*for more flexibility in agent management */
AGENT_MAC_xface *mac_agent_xface = (AGENT_MAC_xface *) malloc(sizeof(AGENT_MAC_xface));
enb_agent_register_mac_xface(mod_id, mac_agent_xface);
/*
* initilize a timer
......
......@@ -44,7 +44,7 @@
//extern msg_context_t shared_ctxt[NUM_MAX_ENB][ENB_AGENT_MAX];
extern AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB][ENB_AGENT_MAX];
extern AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
extern unsigned int mac_agent_registered[NUM_MAX_ENB];
......
......@@ -39,6 +39,8 @@
#include "enb_agent_common.h"
#include "enb_agent_mac_internal.h"
#include "LAYER2/MAC/proto.h"
#include "log.h"
......@@ -1158,6 +1160,7 @@ int enb_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
xface->enb_agent_send_sr_info = enb_agent_send_sr_info;
xface->enb_agent_send_sf_trigger = enb_agent_send_sf_trigger;
xface->enb_agent_send_update_mac_stats = enb_agent_send_update_mac_stats;
xface->enb_agent_schedule_ue_spec = schedule_ue_spec_default;
mac_agent_registered[mod_id] = 1;
......@@ -1172,6 +1175,7 @@ int enb_agent_unregister_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
xface->enb_agent_send_sr_info = NULL;
xface->enb_agent_send_sf_trigger = NULL;
xface->enb_agent_send_update_mac_stats = NULL;
xface->enb_agent_schedule_ue_spec = NULL;
mac_agent_registered[mod_id] = 0;
agent_mac_xface[mod_id] = NULL;
......
......@@ -53,7 +53,14 @@ typedef struct {
/// Send to the controller all the mac stat updates that occured during this subframe
/// based on the stats request configuration
void (*enb_agent_send_update_mac_stats)(mid_t mod_id);
/// Run the UE DL scheduler and fill the Protocol__ProgranMessage. Assumes that
/// dl_info is already initialized as prp_dl_mac_config and fills the
/// prp_dl_data part of it
void (*enb_agent_schedule_ue_spec)(mid_t mod_id, uint32_t frame, uint32_t subframe,
unsigned int *nb_rb_used, unsigned int *nCCE_used,
int *mbsfn_flag, Protocol__ProgranMessage *dl_info);
/*TODO: Fill in with the rest of the MAC layer technology specific callbacks (UL/DL scheduling, RACH info etc)*/
} AGENT_MAC_xface;
......
This diff is collapsed.
......@@ -59,6 +59,10 @@
//#include "LAYER2/MAC/pre_processor.c"
#include "pdcp.h"
//Agent-related headers
#include "ENB_APP/enb_agent_extern.h"
#include "ENB_APP/enb_agent_mac.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
......@@ -85,6 +89,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
int mbsfn_status[MAX_NUM_CCs];
uint32_t RBalloc[MAX_NUM_CCs];
protocol_ctxt_t ctxt;
Protocol__ProgranMessage *msg;
#ifdef EXMIMO
int ret;
#endif
......@@ -275,7 +282,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break;
}
} else { //FDD
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
schedule_ulsch(module_idP,frameP,cooperation_flag,1,5,nCCE);
}
......@@ -287,7 +306,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// TDD, nothing
// FDD, normal UL/DLSCH
if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
schedule_ulsch(module_idP,frameP,cooperation_flag,2,6,nCCE);
}
......@@ -306,7 +337,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// no break here!
case 5:
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
break;
......@@ -314,7 +357,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break;
}
} else { //FDD
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
schedule_ulsch(module_idP,frameP,cooperation_flag,3,7,nCCE);
......@@ -341,7 +396,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// no break here!
case 5:
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
break;
......@@ -352,7 +419,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD
// 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);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP, frameP, subframeP, nprb, nCCE, mbsfn_status);
fill_DLSCH_dci(module_idP, frameP, subframeP, RBalloc, 1, mbsfn_status);
}
......@@ -408,13 +487,37 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
case 5:
schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE);
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
break;
case 3:
case 4:
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
break;
......@@ -423,7 +526,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
}
} else { //FDD
// schedule_ulsch(module_idP,frameP,cooperation_flag,6,0,nCCE);
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
}
......@@ -438,12 +553,36 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
case 3:
case 4:
schedule_RA(module_idP,frameP,subframeP,3,nprb,nCCE); // 3 = Msg3 subframeP, not
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
break;
case 5:
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
break;
......@@ -452,7 +591,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
}
} else { //FDD
//schedule_ulsch(module_idP,frameP,cooperation_flag,7,1,nCCE);
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
}
......@@ -472,7 +623,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// 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);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
break;
......@@ -481,7 +644,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
}
} else { //FDD
//schedule_ulsch(module_idP,frameP,cooperation_flag,8,2,nCCE);
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
}
......@@ -495,28 +670,76 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
case 1:
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);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
break;
case 3:
case 4:
schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3,nCCE);
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
break;
case 6:
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);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
break;
case 2:
case 5:
//schedule_RA(module_idP,frameP,subframeP,nprb,nCCE);
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
break;
......@@ -525,7 +748,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
}
} else { //FDD
// schedule_ulsch(module_idP,frameP,cooperation_flag,9,3,nCCE);
schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
if (mac_agent_registered[module_idP]) {
enb_agent_mac_create_empty_dl_config(module_idP, &msg);
agent_mac_xface[module_idP]->enb_agent_schedule_ue_spec(
module_idP,
frameP,
subframeP,
nprb,
nCCE,
mbsfn_status,
msg);
enb_agent_mac_destroy_dl_config(msg);
}
//schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
}
......
......@@ -35,6 +35,11 @@
*/
#ifndef __LAYER2_MAC_PROTO_H__
#define __LAYER2_MAC_PROTO_H__
#include "enb_agent_defs.h"
#include "header.pb-c.h"
#include "progran.pb-c.h"
/** \addtogroup _mac
* @{
*/
......@@ -139,6 +144,11 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,u
*/
void schedule_ue_spec(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,unsigned int *nb_rb_used0,unsigned int *nCCE_used,int *mbsfn_flag);
//To be used by the agent
void schedule_ue_spec_default(mid_t mod_id, uint32_t frame, uint32_t subframe,
unsigned int *nb_rb_used, unsigned int *nCCE_used,
int *mbsfn_flag, Protocol__ProgranMessage *dl_info);
/** \brief Function for UE/PHY to compute PUSCH transmit power in power-control procedure.
@param Mod_id Module id of UE
@returns Po_NOMINAL_PUSCH (PREAMBLE_RECEIVED_TARGET_POWER+DELTA_PREAMBLE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment