Commit fdac4d17 authored by shahab SHARIATBAGHERI's avatar shahab SHARIATBAGHERI

uplink harq api

parent 5ce9858d
......@@ -1077,6 +1077,45 @@ int flexran_agent_mac_create_empty_ul_config(mid_t mod_id, Protocol__FlexranMess
}
int flexran_agent_mac_destroy_ul_config(Protocol__FlexranMessage *msg) {
int i,j, k;
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_MAC_CONFIG_MSG)
goto error;
Protocol__FlexUlDci *ul_dci;
free(msg->ul_mac_config_msg->header);
for (i = 0; i < msg->ul_mac_config_msg->n_ul_ue_data; i++) {
// TODO uplink rlc ...
// free(msg->ul_mac_config_msg->dl_ue_data[i]->ce_bitmap);
// for (j = 0; j < msg->ul_mac_config_msg->ul_ue_data[i]->n_rlc_pdu; j++) {
// for (k = 0; k < msg->ul_mac_config_msg->ul_ue_data[i]->rlc_pdu[j]->n_rlc_pdu_tb; k++) {
// free(msg->ul_mac_config_msg->dl_ue_data[i]->rlc_pdu[j]->rlc_pdu_tb[k]);
// }
// free(msg->ul_mac_config_msg->ul_ue_data[i]->rlc_pdu[j]->rlc_pdu_tb);
// free(msg->ul_mac_config_msg->ul_ue_data[i]->rlc_pdu[j]);
// }
// free(msg->ul_mac_config_msg->ul_ue_data[i]->rlc_pdu);
ul_dci = msg->ul_mac_config_msg->ul_ue_data[i]->ul_dci;
// free(dl_dci->tbs_size);
// free(ul_dci->mcs);
// free(ul_dci->ndi);
// free(ul_dci->rv);
// free(ul_dci);
free(msg->ul_mac_config_msg->ul_ue_data[i]);
}
free(msg->ul_mac_config_msg->ul_ue_data);
free(msg->ul_mac_config_msg);
free(msg);
return 0;
error:
return -1;
}
void flexran_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__FlexranMessage **msg) {
struct lfds700_misc_prng_state ls;
......
......@@ -57,6 +57,10 @@ int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg);
int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_dl_config(Protocol__FlexranMessage *msg);
/* UL MAC scheduling decision protocol message constructor (empty command) and destructor */
int flexran_agent_mac_create_empty_ul_config(mid_t mod_id, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_ul_config(Protocol__FlexranMessage *msg);
int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
......
......@@ -63,7 +63,7 @@ typedef struct {
void (*flexran_agent_schedule_ul_spec)(mid_t module_idP, uint32_t frameP, unsigned char cooperation_flag,
uint32_t subframeP,
unsigned char sched_subframe);
unsigned char sched_subframe, Protocol__FlexranMessage **ul_info);
/// Notify the controller for a state change of a particular UE, by sending the proper
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
......
......@@ -168,8 +168,8 @@ message flex_dl_mac_config {
message flex_ul_mac_config {
optional flex_header header = 1;
optional uint32 sfn_sf = 2;
repeated flex_ul_data ul_ue_data = 3;
optional uint32 sfn_sf = 2;
repeated flex_ul_data ul_ue_data = 3;
}
......
......@@ -32,15 +32,14 @@ enum flex_type {
//Controller command messages
FLPT_DL_MAC_CONFIG = 13;
FLPT_UL_MAC_CONFIG = 14
;
// UE state change messages
FLPT_UE_STATE_CHANGE = 15;
FLPT_UE_STATE_CHANGE = 14;
// Control delegation messages
FLPT_DELEGATE_CONTROL = 16;
FLPT_RECONFIGURE_AGENT = 17;
FLPT_RRC_TRIGGERING = 18;
FLPT_DELEGATE_CONTROL = 15;
FLPT_RECONFIGURE_AGENT = 16;
FLPT_RRC_TRIGGERING = 17;
FLPT_UL_MAC_CONFIG = 18;
}
......@@ -299,8 +299,9 @@ int flexran_get_harq(const mid_t mod_id,
const mid_t ue_id,
const int frame,
const uint8_t subframe,
uint8_t *id,
uint8_t *round) { //flag_id_status = 0 then id, else status
uint8_t *pid,
uint8_t *round,
const uint8_t harq_flag) { //flag_id_status = 0 then id, else status
/*TODO: Add int TB in function parameters to get the status of the second TB. This can be done to by editing in
* get_ue_active_harq_pid function in line 272 file: phy_procedures_lte_eNB.c to add
* DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][1];*/
......@@ -310,10 +311,21 @@ int flexran_get_harq(const mid_t mod_id,
uint16_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
if (harq_flag == openair_harq_DL){
mac_xface->get_ue_active_harq_pid(mod_id,CC_id,rnti,frame,subframe,&harq_pid,&harq_round,openair_harq_DL);
mac_xface->get_ue_active_harq_pid(mod_id,CC_id,rnti,frame,subframe,&harq_pid,&harq_round,openair_harq_DL);
*id = harq_pid;
} else if (harq_flag == openair_harq_UL){
mac_xface->get_ue_active_harq_pid(mod_id,CC_id,rnti,frame,subframe,&harq_pid,&round,openair_harq_UL);
}
else {
LOG_W(FLEXRAN_AGENT,"harq_flag is not recongnized");
}
*pid = harq_pid;
*round = harq_round;
/* if (round > 0) { */
/* *status = 1; */
......
......@@ -187,7 +187,7 @@ int flexran_get_ue_pmi(mid_t mod_id);
a designated frame and subframe. Returns 0 for success. The id and the
status of the HARQ process are stored in id and status respectively */
int flexran_get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id,
const int frame, const uint8_t subframe, unsigned char *id, unsigned char *round);
const int frame, const uint8_t subframe, unsigned char *id, unsigned char *round,const uint8_t harq_flag);
/* Uplink power control management*/
int flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id);
......
......@@ -386,8 +386,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag);
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,0,4);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,0,4, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
......@@ -398,8 +400,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag);
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,4);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,4, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
}
......@@ -415,7 +419,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -438,9 +442,12 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,7);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,7, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
......@@ -453,9 +460,11 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,8);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,8, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -472,9 +481,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,1,5);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,1,5, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -489,7 +501,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -511,9 +523,13 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,2,6);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,2,6, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -528,7 +544,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -553,9 +569,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,7);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,7, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
// no break here!
......@@ -572,7 +591,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -591,9 +610,13 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,3,7);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,3,7, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -608,7 +631,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -634,9 +657,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,8);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,8, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
// no break here!
......@@ -659,7 +685,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -679,9 +705,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,4,8);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,4,8, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -696,7 +725,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -724,9 +753,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,5,9);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,5,9, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -741,7 +773,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -768,7 +800,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -796,9 +828,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,2);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,2, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
// schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -812,9 +847,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,3);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,3, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
// schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -836,7 +874,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -860,7 +898,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -879,9 +917,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,6,0);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,6,0, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -896,7 +937,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -929,7 +970,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -952,7 +993,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -971,9 +1012,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,7,1);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,7,1, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -988,7 +1032,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -1018,9 +1062,11 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,2);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,2, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -1035,7 +1081,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -1054,9 +1100,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,8,2);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,8,2, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -1071,7 +1120,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -1094,9 +1143,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,3);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,3, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
schedule_RA(module_idP,frameP,subframeP,7); // 7 = Msg3 subframeP, not
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -1111,7 +1163,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -1128,9 +1180,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,3);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,3, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -1145,7 +1200,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -1161,9 +1216,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,4);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,subframeP,4, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
//schedule_RA(module_idP,frameP,subframeP);
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -1178,7 +1236,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -1203,7 +1261,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......@@ -1222,9 +1280,12 @@ if (mac_agent_registered[module_idP]){
#else
if (mac_agent_registered[module_idP]){
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,9,3);
agent_mac_xface[module_idP]->flexran_agent_schedule_ul_spec(module_idP,frameP,cooperation_flag,9,3, &msg);
}
flexran_agent_mac_destroy_ul_config(msg);
#endif
#ifndef FLEXRAN_AGENT_SB_IF
......@@ -1239,7 +1300,7 @@ if (mac_agent_registered[module_idP]){
mbsfn_status,
&msg);
flexran_apply_dl_scheduling_decisions(module_idP,
flexran_apply_scheduling_decisions(module_idP,
frameP,
subframeP,
mbsfn_status,
......
......@@ -174,12 +174,12 @@ void flexran_schedule_ue_spec_default(mid_t mod_id, uint32_t frame, uint32_t sub
void flexran_agent_schedule_ulsch_ue_spec(module_id_t module_idP, frame_t frameP, unsigned char cooperation_flag,
sub_frame_t subframeP,
unsigned char sched_subframe);
unsigned char sched_subframe, Protocol__FlexranMessage **ul_info);
/*
* Data plane function for applying the DL decisions of the scheduler
*/
void flexran_apply_dl_scheduling_decisions(mid_t mod_id, uint32_t frame, uint32_t subframe, int *mbsfn_flag,
void flexran_apply_scheduling_decisions(mid_t mod_id, uint32_t frame, uint32_t subframe, int *mbsfn_flag,
Protocol__FlexranMessage *dl_scheduling_info);
/*
......
......@@ -59,28 +59,28 @@
#include "SIMULATION/TOOLS/defs.h" // for taus
void flexran_apply_dl_scheduling_decisions(mid_t mod_id,
void flexran_apply_scheduling_decisions(mid_t mod_id,
uint32_t frame,
uint32_t subframe,
int *mbsfn_flag,
Protocol__FlexranMessage *dl_scheduling_info) {
Protocol__FlexDlMacConfig *mac_config = dl_scheduling_info->dl_mac_config_msg;
Protocol__FlexDlMacConfig *mac_dl_config = dl_scheduling_info->dl_mac_config_msg;
// Check if there is anything to schedule for random access
if (mac_config->n_dl_rar > 0) {
if (mac_dl_config->n_dl_rar > 0) {
/*TODO: call the random access data plane function*/
}
// Check if there is anything to schedule for paging/broadcast
if (mac_config->n_dl_broadcast > 0) {
if (mac_dl_config->n_dl_broadcast > 0) {
/*TODO: call the broadcast/paging data plane function*/
}
// Check if there is anything to schedule for the UEs
if (mac_config->n_dl_ue_data > 0) {
if (mac_dl_config->n_dl_ue_data > 0) {
flexran_apply_ue_spec_scheduling_decisions(mod_id, frame, subframe, mbsfn_flag,
mac_config->n_dl_ue_data, mac_config->dl_ue_data);
mac_dl_config->n_dl_ue_data, mac_dl_config->dl_ue_data);
}
}
......
......@@ -526,7 +526,7 @@ void _dlsch_scheduler_pre_processor (module_id_t Mod_id,
CC_id = UE_list->ordered_CCids[ii][UE_id];
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
ue_sched_ctl->max_allowed_rbs[CC_id]=nb_rbs_allowed_slice[CC_id][slice_id];
flexran_get_harq(Mod_id, CC_id, UE_id, frameP, subframeP, &harq_pid, &round);
flexran_get_harq(Mod_id, CC_id, UE_id, frameP, subframeP, &harq_pid, &round, openair_harq_DL);
// if there is no available harq_process, skip the UE
if (UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]<0)
......@@ -640,7 +640,7 @@ void _dlsch_scheduler_pre_processor (module_id_t Mod_id,
for (ii=0; ii<UE_num_active_CC(UE_list,UE_id); ii++) {
CC_id = UE_list->ordered_CCids[ii][UE_id];
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
flexran_get_harq(Mod_id, CC_id, UE_id, frameP, subframeP, &harq_pid, &round);
flexran_get_harq(Mod_id, CC_id, UE_id, frameP, subframeP, &harq_pid, &round, openair_harq_DL);
rnti = UE_RNTI(Mod_id,UE_id);
// LOG_D(MAC,"UE %d rnti 0x\n", UE_id, rnti );
......@@ -1096,7 +1096,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id,
dl_data[num_ues_added]->serv_cell_index = CC_id;
nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id];
flexran_get_harq(mod_id, CC_id, UE_id, frame, subframe, &harq_pid, &round);
flexran_get_harq(mod_id, CC_id, UE_id, frame, subframe, &harq_pid, &round, openair_harq_DL);
sdu_length_total=0;
mcs = cqi_to_mcs[flexran_get_ue_wcqi(mod_id, UE_id)];
// LOG_I(FLEXRAN_AGENT, "The MCS is %d\n", mcs);
......
......@@ -615,8 +615,8 @@ void _ulsch_scheduler_pre_processor(module_id_t module_idP,
// This is the actual CC_id in the list
CC_id = UE_list->ordered_ULCCids[n][UE_id];
mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL);
// mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL);
flexran_get_harq(module_idP, CC_id, UE_id, frameP, subframeP, &harq_pid, &round, openair_harq_UL);
if(round>0) {
nb_allocated_rbs[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb_ul[harq_pid];
} else {
......@@ -787,10 +787,11 @@ void flexran_agent_schedule_ulsch_ue_spec(module_id_t module_idP,
frame_t frameP,
unsigned char cooperation_flag,
sub_frame_t subframeP,
unsigned char sched_subframe) {
unsigned char sched_subframe,
Protocol__FlexranMessage **ul_info) {
// flexran_agent_mac_create_empty_ul_config(module_idP, ul_info);
flexran_agent_mac_create_empty_ul_config(module_idP, ul_info);
uint16_t first_rb[MAX_NUM_CCs],i;
int CC_id;
......@@ -907,7 +908,7 @@ void flexran_agent_schedule_ulsch_rnti(module_id_t module_idP,
continue;
}
rnti = UE_RNTI(module_idP,UE_id);
rnti = flexran_get_ue_crnti(module_idP, UE_id);
if (rnti==NOT_A_RNTI) {
LOG_W(MAC,"[eNB %d] frame %d subfarme %d, UE %d: no RNTI \n", module_idP,frameP,subframeP,UE_id);
......@@ -973,7 +974,7 @@ abort();
UE_template = &UE_list->UE_template[CC_id][UE_id];
UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
if (mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL) == -1 ) {
if (flexran_get_harq(module_idP, CC_id, UE_id, frameP, subframeP, &harq_pid, &round, openair_harq_UL) == -1 ) {
LOG_W(MAC,"[eNB %d] Scheduler Frame %d, subframeP %d: candidate harq_pid from PHY for UE %d CC %d RNTI %x\n",
module_idP,frameP,subframeP, UE_id, CC_id, rnti);
continue;
......
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