Commit 56c90005 authored by Lionel Gauthier's avatar Lionel Gauthier

branch LG_PRE_RELEASE_0.3 reintegration

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7117 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 4f583e20
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <inttypes.h>
#ifdef CMAKER #ifdef CMAKER
#include <platform_types.h> #include <platform_types.h>
#endif #endif
...@@ -67,9 +68,13 @@ do { \ ...@@ -67,9 +68,13 @@ do { \
#define DevCheck(cOND, vALUE1, vALUE2, vALUE3) \ #define DevCheck(cOND, vALUE1, vALUE2, vALUE3) \
_Assert_(cOND, _Assert_Exit_, #vALUE1": %d\n"#vALUE2": %d\n"#vALUE3": %d\n\n", \ _Assert_(cOND, _Assert_Exit_, #vALUE1 ": %" PRIdMAX "\n" #vALUE2 ": %" PRIdMAX "\n" #vALUE3 ": %" PRIdMAX "\n\n", \
(int)vALUE1, (int)vALUE2, (int)vALUE3) (intmax_t)vALUE1, (intmax_t)vALUE2, (intmax_t)vALUE3)
#define DevCheck4(cOND, vALUE1, vALUE2, vALUE3, vALUE4) \
_Assert_(cOND, _Assert_Exit_, #vALUE1": %"PRIdMAX"\n"#vALUE2": %"PRIdMAX"\n"#vALUE3": %"PRIdMAX"\n"#vALUE4": %"PRIdMAX"\n\n", \
(intmax_t)vALUE1, (intmax_t)vALUE2, (intmax_t)vALUE3, (intmax_t)vALUE4)
#define DevParam(vALUE1, vALUE2, vALUE3) DevCheck(0, vALUE1, vALUE2, vALUE3) #define DevParam(vALUE1, vALUE2, vALUE3) DevCheck(0, vALUE1, vALUE2, vALUE3)
......
export OPENAIR_HOME=$(pwd) export OPENAIR_HOME=$(pwd)
export OPENAIR_DIR=$(pwd)
export OPENAIR1_DIR=$OPENAIR_HOME/openair1 export OPENAIR1_DIR=$OPENAIR_HOME/openair1
export OPENAIR2_DIR=$OPENAIR_HOME/openair2 export OPENAIR2_DIR=$OPENAIR_HOME/openair2
export OPENAIR3_DIR=$OPENAIR_HOME/openair3 export OPENAIR3_DIR=$OPENAIR_HOME/openair3
......
...@@ -150,8 +150,9 @@ int main(int argc, char *argv[]) ...@@ -150,8 +150,9 @@ int main(int argc, char *argv[])
iw_field.rx_gi2); iw_field.rx_gi2);
//printf("read set %d, time %d:%d:%d\n",i,iw_field.hour,iw_field.min,iw_field.sec); //printf("read set %d, time %d:%d:%d\n",i,iw_field.hour,iw_field.min,iw_field.sec);
if (i==0) if (i==0) {
printf("num, date; inactive_time; rx_bytes; rx_packets; tx_bytes; tx_packets; tx_retries; tx_failed; signal; signal0; signal1; tx_bitrate; tx_mcs; rx_bitrate; rx_mcs\n"); printf("num, date; inactive_time; rx_bytes; rx_packets; tx_bytes; tx_packets; tx_retries; tx_failed; signal; signal0; signal1; tx_bitrate; tx_mcs; rx_bitrate; rx_mcs\n");
}
printf("%d; %d-%s-%d %d:%d:%d; %d; %d; %d; %d; %d; %d; %d; %d; %d; %d; %e; %d; %e; %d\n", printf("%d; %d-%s-%d %d:%d:%d; %d; %d; %d; %d; %d; %d; %d; %d; %d; %d; %e; %d; %e; %d\n",
i, i,
......
...@@ -68,7 +68,7 @@ extern unsigned char NB_eNB_INST; ...@@ -68,7 +68,7 @@ extern unsigned char NB_eNB_INST;
# endif # endif
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
static void configure_phy(uint32_t enb_id, const Enb_properties_array_t *enb_properties) static void configure_phy(module_id_t enb_id, const Enb_properties_array_t* enb_properties)
{ {
MessageDef *msg_p; MessageDef *msg_p;
int CC_id; int CC_id;
...@@ -86,7 +86,7 @@ static void configure_phy(uint32_t enb_id, const Enb_properties_array_t *enb_pro ...@@ -86,7 +86,7 @@ static void configure_phy(uint32_t enb_id, const Enb_properties_array_t *enb_pro
PHY_CONFIGURATION_REQ (msg_p).rx_gain[CC_id] = enb_properties->properties[enb_id]->rx_gain[CC_id]; PHY_CONFIGURATION_REQ (msg_p).rx_gain[CC_id] = enb_properties->properties[enb_id]->rx_gain[CC_id];
} }
itti_send_msg_to_task (TASK_PHY_ENB, enb_id, msg_p); itti_send_msg_to_task (TASK_PHY_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
} }
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
...@@ -189,7 +189,7 @@ static void configure_rrc(uint32_t enb_id, const Enb_properties_array_t *enb_pro ...@@ -189,7 +189,7 @@ static void configure_rrc(uint32_t enb_id, const Enb_properties_array_t *enb_pro
RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[CC_id] = enb_properties->properties[enb_id]->ue_TimersAndConstants_n311[CC_id]; RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[CC_id] = enb_properties->properties[enb_id]->ue_TimersAndConstants_n311[CC_id];
} }
itti_send_msg_to_task (TASK_RRC_ENB, enb_id, msg_p); itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
} }
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
...@@ -231,7 +231,8 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con ...@@ -231,7 +231,8 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
s1ap_register_eNB->default_drx = enb_properties->properties[enb_id]->pcch_defaultPagingCycle[0]; s1ap_register_eNB->default_drx = enb_properties->properties[enb_id]->pcch_defaultPagingCycle[0];
s1ap_register_eNB->nb_mme = enb_properties->properties[enb_id]->nb_mme; s1ap_register_eNB->nb_mme = enb_properties->properties[enb_id]->nb_mme;
AssertFatal (s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, "Too many MME for eNB %d (%d/%d)!", enb_id, s1ap_register_eNB->nb_mme, S1AP_MAX_NB_MME_IP_ADDRESS); AssertFatal (s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, "Too many MME for eNB %d (%d/%d)!", enb_id, s1ap_register_eNB->nb_mme,
S1AP_MAX_NB_MME_IP_ADDRESS);
for (mme_id = 0; mme_id < s1ap_register_eNB->nb_mme; mme_id++) { for (mme_id = 0; mme_id < s1ap_register_eNB->nb_mme; mme_id++) {
s1ap_register_eNB->mme_ip_address[mme_id].ipv4 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4; s1ap_register_eNB->mme_ip_address[mme_id].ipv4 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4;
...@@ -250,7 +251,7 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con ...@@ -250,7 +251,7 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
str = inet_ntoa(addr); str = inet_ntoa(addr);
strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str); strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str);
itti_send_msg_to_task (TASK_S1AP, enb_id, msg_p); itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
register_enb_pending++; register_enb_pending++;
} }
......
This diff is collapsed.
...@@ -88,7 +88,12 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index) ...@@ -88,7 +88,12 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index)
} }
int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,uint8_t eNB_index, int
rrc_mac_config_req(
module_id_t Mod_id,
eNB_flag_t eNB_flagP,
rnti_t rntiP,
uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon, RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated, struct PhysicalConfigDedicated *physicalConfigDedicated,
#ifdef Rel10 #ifdef Rel10
...@@ -122,14 +127,17 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui ...@@ -122,14 +127,17 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
int i,CC_id=0; int i,CC_id=0;
int UE_id = -1;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
if (eNB_flagP==0) { if (eNB_flagP==0) {
LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_id,eNB_index); LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_id,eNB_index);
if (tdd_Config != NULL) if (tdd_Config != NULL) {
UE_mac_inst[Mod_id].tdd_Config = tdd_Config; UE_mac_inst[Mod_id].tdd_Config = tdd_Config;
}
} else { } else {
UE_id = find_UE_id(Mod_id, rntiP);
if (physicalConfigDedicated == NULL) { if (physicalConfigDedicated == NULL) {
LOG_I(MAC,"[CONFIG][eNB %d] Configuring MAC/PHY\n",Mod_id); LOG_I(MAC,"[CONFIG][eNB %d] Configuring MAC/PHY\n",Mod_id);
} else { } else {
...@@ -138,10 +146,11 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui ...@@ -138,10 +146,11 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
} }
if (tdd_Config && SIwindowsize && SIperiod) { if (tdd_Config && SIwindowsize && SIperiod) {
if (eNB_flagP == ENB_FLAG_YES) if (eNB_flagP == ENB_FLAG_YES) {
mac_xface->phy_config_sib1_eNB(Mod_id,0,tdd_Config,*SIwindowsize,*SIperiod); mac_xface->phy_config_sib1_eNB(Mod_id,0,tdd_Config,*SIwindowsize,*SIperiod);
else } else {
mac_xface->phy_config_sib1_ue(Mod_id,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod); mac_xface->phy_config_sib1_ue(Mod_id,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
}
} }
if (radioResourceConfigCommon!=NULL) { if (radioResourceConfigCommon!=NULL) {
...@@ -189,28 +198,32 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui ...@@ -189,28 +198,32 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
if (mac_MainConfig->ul_SCH_Config) { if (mac_MainConfig->ul_SCH_Config) {
if (mac_MainConfig->ul_SCH_Config->periodicBSR_Timer) if (mac_MainConfig->ul_SCH_Config->periodicBSR_Timer) {
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer; UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer;
else } else {
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity; UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity;
}
if (mac_MainConfig->ul_SCH_Config->maxHARQ_Tx) if (mac_MainConfig->ul_SCH_Config->maxHARQ_Tx) {
UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx; UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
else } else {
UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5; UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
}
if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) {
UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer; UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer;
else } else {
UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560; UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
} }
}
#ifdef Rel10 #ifdef Rel10
if (mac_MainConfig->sr_ProhibitTimer_r9) if (mac_MainConfig->sr_ProhibitTimer_r9) {
UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->sr_ProhibitTimer_r9; UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->sr_ProhibitTimer_r9;
else } else {
UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) 0; UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) 0;
}
#endif #endif
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer); UE_mac_inst[Mod_id].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer);
...@@ -485,8 +498,9 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui ...@@ -485,8 +498,9 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
eNB_mac_inst[Mod_id].common_channels[CC_id].num_active_cba_groups=num_active_cba_groups; eNB_mac_inst[Mod_id].common_channels[CC_id].num_active_cba_groups=num_active_cba_groups;
for (i=0; i < num_active_cba_groups; i ++) { for (i=0; i < num_active_cba_groups; i ++) {
if (eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] != cba_rnti + i) if (eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] != cba_rnti + i) {
eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] = cba_rnti + i; eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] = cba_rnti + i;
}
//only configure UE ids up to num_active_cba_groups //only configure UE ids up to num_active_cba_groups
//we use them as candidates for the transmission of dci format0) //we use them as candidates for the transmission of dci format0)
...@@ -505,28 +519,32 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui ...@@ -505,28 +519,32 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
return(0); return(0);
} }
#ifdef LOCALIZATION #ifdef LOCALIZATION
//------------------------------------------------------------------------------
double double
rrc_get_estimated_ue_distance(module_id_t Mod_id, const frame_t frameP, uint8_t UE_id, int CC_id, uint8_t loc_type) rrc_get_estimated_ue_distance(
const protocol_ctxt_t* const ctxt_pP,
const int CC_idP,
const uint8_t loc_typeP
)
//------------------------------------------------------------------------------
{ {
// localization types: // localization types:
// 0: power based // 0: power based
// 1: time based // 1: time based
LTE_eNB_UE_stats *eNB_UE_stats = NULL; LTE_eNB_UE_stats *eNB_UE_stats = NULL;
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list; UE_list_t* UE_list = &eNB_mac_inst[ctxt_pP->module_id].UE_list;
int pCCid; int pCCid;
int UE_id;
uint16_t rnti; if(ctxt_pP->rnti == NOT_A_RNTI) {
//for (UE_id=UE_list->head;UE_id>=0;UE_id=UE_list->next[UE_id]) {
pCCid = UE_PCCID(Mod_id,UE_id);
rnti = UE_list->UE_template[pCCid][UE_id].rnti;
if(rnti == 0)
return -1; return -1;
}
eNB_UE_stats = mac_xface->get_eNB_UE_stats(Mod_id,pCCid,rnti); UE_id = find_UE_id(ctxt_pP->module_id,ctxt_pP->rnti);
pCCid = UE_PCCID(ctxt_pP->module_id,UE_id);
eNB_UE_stats = mac_xface->get_eNB_UE_stats(ctxt_pP->module_id,pCCid,ctxt_pP->rnti);
switch (loc_type) { switch (loc_typeP) {
case 0: case 0:
return eNB_UE_stats->distance.power_based; return eNB_UE_stats->distance.power_based;
break; break;
...@@ -539,7 +557,7 @@ rrc_get_estimated_ue_distance(module_id_t Mod_id, const frame_t frameP, uint8_t ...@@ -539,7 +557,7 @@ rrc_get_estimated_ue_distance(module_id_t Mod_id, const frame_t frameP, uint8_t
return eNB_UE_stats->distance.power_based; return eNB_UE_stats->distance.power_based;
} }
// LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[Mod_id].UE_list.UE_template[CC_id][UE_id].distance.power_based); // LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[ctxt_pP->module_id].UE_list.UE_template[CC_id][UE_id].distance.power_based);
} }
......
...@@ -97,6 +97,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -97,6 +97,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
DCI_PDU *DCI_pdu[MAX_NUM_CCs]; DCI_PDU *DCI_pdu[MAX_NUM_CCs];
int CC_id,i,next_i; int CC_id,i,next_i;
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list; UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
rnti_t rnti;
LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head); LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
...@@ -112,12 +113,18 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -112,12 +113,18 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
} }
// refresh UE list based on UEs dropped by PHY in previous subframe // refresh UE list based on UEs dropped by PHY in previous subframe
for (i=UE_list->head; i>=0; i=i=next_i) { i = UE_list->head;
LOG_D(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)));
while (i>=0) {
rnti = UE_RNTI(module_idP,i);
LOG_D(MAC,"UE %d: rnti %x (%p)\n",i,rnti,mac_xface->get_eNB_UE_stats(module_idP,0,rnti));
next_i= UE_list->next[i]; next_i= UE_list->next[i];
if (mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i))==NULL) if (mac_xface->get_eNB_UE_stats(module_idP,0,rnti)==NULL) {
mac_remove_ue(module_idP,i,frameP); mac_remove_ue(module_idP,i,frameP, subframeP);
}
i = next_i;
} }
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
...@@ -190,18 +197,13 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -190,18 +197,13 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
//if (subframeP%5 == 0) //if (subframeP%5 == 0)
//#ifdef EXMIMO //#ifdef EXMIMO
ctxt.enb_module_id = module_idP; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, 0);
ctxt.ue_module_id = 0;
ctxt.frame = frameP;
ctxt.enb_flag = ENB_FLAG_YES;
pdcp_run(&ctxt); pdcp_run(&ctxt);
//#endif //#endif
// check HO // check HO
rrc_rx_tx(module_idP, rrc_rx_tx(&ctxt,
frameP, 0, // eNB index, unused in eNB
1,
module_idP,
CC_id); CC_id);
#ifdef Rel10 #ifdef Rel10
...@@ -235,7 +237,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -235,7 +237,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6) // Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6)
// Schedule Normal DLSCH // Schedule Normal DLSCH
// schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE);
if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD
schedule_ulsch(module_idP,frameP,cooperation_flag,0,4,nCCE);//,calibration_flag); schedule_ulsch(module_idP,frameP,cooperation_flag,0,4,nCCE);//,calibration_flag);
...@@ -247,8 +249,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -247,8 +249,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); // schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
//schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE); fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
//fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
break; break;
...@@ -531,8 +532,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -531,8 +532,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
} }
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
DCI_pdu[CC_id]->nCCE = nCCE[CC_id]; DCI_pdu[CC_id]->nCCE = nCCE[CC_id];
}
LOG_D(MAC,"frameP %d, subframeP %d nCCE %d\n",frameP,subframeP,nCCE[0]); LOG_D(MAC,"frameP %d, subframeP %d nCCE %d\n",frameP,subframeP,nCCE[0]);
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
*******************************************************************************/ *******************************************************************************/
/*! \file eNB_scheduler_RAs.c /*! \file eNB_scheduler_RA.c
* \brief primitives used for random access * \brief primitives used for random access
* \author Navid Nikaein and Raymond Knopp * \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014 * \date 2010 - 2014
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
*/ */
#include "assertions.h" #include "assertions.h"
#include "platform_types.h"
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/extern.h" #include "PHY/extern.h"
...@@ -108,9 +109,10 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un ...@@ -108,9 +109,10 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
// Get RRCConnectionSetup for Piggyback // Get RRCConnectionSetup for Piggyback
rrc_sdu_length = mac_rrc_data_req(module_idP, rrc_sdu_length = mac_rrc_data_req(module_idP,
frameP, frameP,
CCCH,1, CCCH,
1, // 1 transport block
&eNB->common_channels[CC_id].CCCH_pdu.payload[0], &eNB->common_channels[CC_id].CCCH_pdu.payload[0],
1, ENB_FLAG_YES,
module_idP, module_idP,
0); // not used in this case 0); // not used in this case
...@@ -381,8 +383,9 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un ...@@ -381,8 +383,9 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][(unsigned char)offset], memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][(unsigned char)offset],
&eNB->common_channels[CC_id].CCCH_pdu.payload[0], &eNB->common_channels[CC_id].CCCH_pdu.payload[0],
rrc_sdu_length); rrc_sdu_length);
#if defined(USER_MODE) && defined(OAI_EMU)
if (opt_enabled==1) { if (oai_emulation.info.opt_enabled) {
trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0],
rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id),
eNB->subframe,0,0); eNB->subframe,0,0);
...@@ -390,6 +393,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un ...@@ -390,6 +393,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
module_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length); module_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length);
} }
#endif
nprb[CC_id]= nprb[CC_id] + 3; nprb[CC_id]= nprb[CC_id] + 3;
nCCE[CC_id] = nCCE[CC_id] + 4; nCCE[CC_id] = nCCE[CC_id] + 4;
} }
...@@ -416,7 +420,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un ...@@ -416,7 +420,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
stop_meas(&eNB->schedule_ra); stop_meas(&eNB->schedule_ra);
} }
void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t preamble_index,int16_t timing_offset,uint8_t sect_id,sub_frame_t subframeP,uint8_t f_id) void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t preamble_index,int16_t timing_offset,uint8_t sect_id,sub_frame_t subframeP,
uint8_t f_id)
{ {
uint8_t i; uint8_t i;
......
...@@ -67,7 +67,15 @@ ...@@ -67,7 +67,15 @@
#define DEBUG_eNB_SCHEDULER 1 #define DEBUG_eNB_SCHEDULER 1
void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsigned int *nCCEP) //------------------------------------------------------------------------------
void
schedule_SI(
module_id_t module_idP,
frame_t frameP,
unsigned int* nprbP,
unsigned int* nCCEP
)
//------------------------------------------------------------------------------
{ {
...@@ -96,24 +104,25 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi ...@@ -96,24 +104,25 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi
LOG_D(MAC,"[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n",module_idP,CC_id,frameP,bcch_sdu_length); LOG_D(MAC,"[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n",module_idP,CC_id,frameP,bcch_sdu_length);
if (bcch_sdu_length <= (mac_xface->get_TBS_DL(0,3))) if (bcch_sdu_length <= (mac_xface->get_TBS_DL(0,3))) {
mcs=0; mcs=0;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(1,3))) } else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(1,3))) {
mcs=1; mcs=1;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(2,3))) } else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(2,3))) {
mcs=2; mcs=2;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(3,3))) } else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(3,3))) {
mcs=3; mcs=3;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(4,3))) } else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(4,3))) {
mcs=4; mcs=4;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(5,3))) } else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(5,3))) {
mcs=5; mcs=5;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(6,3))) } else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(6,3))) {
mcs=6; mcs=6;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(7,3))) } else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(7,3))) {
mcs=7; mcs=7;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(8,3))) } else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(8,3))) {
mcs=8; mcs=8;
}
if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
...@@ -132,8 +141,8 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi ...@@ -132,8 +141,8 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi
case 100: case 100:
((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs; ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs;
break; break;
} }
} else { } else {
switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
case 6: case 6:
...@@ -155,7 +164,9 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi ...@@ -155,7 +164,9 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi
} }
} }
if (opt_enabled == 1) { #if defined(USER_MODE) && defined(OAI_EMU)
if (oai_emulation.info.opt_enabled) {
trace_pdu(1, trace_pdu(1,
&eNB->common_channels[CC_id].BCCH_pdu.payload[0], &eNB->common_channels[CC_id].BCCH_pdu.payload[0],
bcch_sdu_length, bcch_sdu_length,
...@@ -165,9 +176,10 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi ...@@ -165,9 +176,10 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi
eNB->subframe, eNB->subframe,
0, 0,
0); 0);
}
LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for rnti %x with size %d\n", LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for rnti %x with size %d\n",
module_idP, frameP, 0xffff, bcch_sdu_length); module_idP, frameP, 0xffff, bcch_sdu_length);
} #endif
if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (TDD) for SI %d bytes (mcs %d, rb 3, TBS %d)\n", LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (TDD) for SI %d bytes (mcs %d, rb 3, TBS %d)\n",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -51,8 +51,9 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id) ...@@ -51,8 +51,9 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id)
return 0; // not reached return 0; // not reached
} }
if (UE_mac_inst[module_idP].radioResourceConfigCommon) if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon; rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon;
}
else { else {
LOG_E(MAC,"[UE %d] CCid %d FATAL radioResourceConfigCommon is NULL !!!\n",module_idP,CC_id); LOG_E(MAC,"[UE %d] CCid %d FATAL radioResourceConfigCommon is NULL !!!\n",module_idP,CC_id);
mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL"); mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL");
......
...@@ -115,10 +115,11 @@ void init_transport_channels(unsigned char transmission_mode) ...@@ -115,10 +115,11 @@ void init_transport_channels(unsigned char transmission_mode)
DLSCH_alloc_pdu1.rv1 = 0; DLSCH_alloc_pdu1.rv1 = 0;
// Forget second codeword // Forget second codeword
if (transmission_mode == 6) if (transmission_mode == 6) {
DLSCH_alloc_pdu1.tpmi = 5; // PUSCH_PRECODING0 DLSCH_alloc_pdu1.tpmi = 5; // PUSCH_PRECODING0
else } else {
DLSCH_alloc_pdu1.tpmi = 0; DLSCH_alloc_pdu1.tpmi = 0;
}
DLSCH_alloc_pdu2.rah = 0; DLSCH_alloc_pdu2.rah = 0;
DLSCH_alloc_pdu2.rballoc = DLSCH_RB_ALLOC; DLSCH_alloc_pdu2.rballoc = DLSCH_RB_ALLOC;
...@@ -131,9 +132,9 @@ void init_transport_channels(unsigned char transmission_mode) ...@@ -131,9 +132,9 @@ void init_transport_channels(unsigned char transmission_mode)
DLSCH_alloc_pdu2.rv1 = 0; DLSCH_alloc_pdu2.rv1 = 0;
// Forget second codeword // Forget second codeword
if (transmission_mode == 6) if (transmission_mode == 6) {
DLSCH_alloc_pdu2.tpmi = 5; // PUSCH_PRECODING0 DLSCH_alloc_pdu2.tpmi = 5; // PUSCH_PRECODING0
else } else {
DLSCH_alloc_pdu2.tpmi = 0; DLSCH_alloc_pdu2.tpmi = 0;
}
} }
...@@ -142,11 +142,12 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui ...@@ -142,11 +142,12 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
bzero(UE_mac_inst,NB_UE_INST*sizeof(UE_MAC_INST)); bzero(UE_mac_inst,NB_UE_INST*sizeof(UE_MAC_INST));
for(i=0; i<NB_UE_INST; i++) for(i=0; i<NB_UE_INST; i++) {
ue_init_mac(i); ue_init_mac(i);
}
} else } else {
UE_mac_inst = NULL; UE_mac_inst = NULL;
}
LOG_I(MAC,"[MAIN] Init function start:Nb_eNB_INST=%d\n",NB_eNB_INST); LOG_I(MAC,"[MAIN] Init function start:Nb_eNB_INST=%d\n",NB_eNB_INST);
...@@ -160,8 +161,9 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui ...@@ -160,8 +161,9 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
LOG_D(MAC,"[MAIN] ALLOCATE %d Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),NB_eNB_INST,eNB_mac_inst); LOG_D(MAC,"[MAIN] ALLOCATE %d Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),NB_eNB_INST,eNB_mac_inst);
bzero(eNB_mac_inst,NB_eNB_INST*sizeof(eNB_MAC_INST)); bzero(eNB_mac_inst,NB_eNB_INST*sizeof(eNB_MAC_INST));
} }
} else } else {
eNB_mac_inst = NULL; eNB_mac_inst = NULL;
}
// Initialize Linked-List for Active UEs // Initialize Linked-List for Active UEs
for(Mod_id=0; Mod_id<NB_eNB_INST; Mod_id++) { for(Mod_id=0; Mod_id<NB_eNB_INST; Mod_id++) {
...@@ -335,8 +337,9 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui ...@@ -335,8 +337,9 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
eNB_mac_inst[j][CC_id].sbmap_conf.sb_size=SB_size; eNB_mac_inst[j][CC_id].sbmap_conf.sb_size=SB_size;
eNB_mac_inst[j][CC_id].sbmap_conf.nb_active_sb=1; eNB_mac_inst[j][CC_id].sbmap_conf.nb_active_sb=1;
for(i=0; i<NUMBER_OF_SUBBANDS; i++) for(i=0; i<NUMBER_OF_SUBBANDS; i++) {
eNB_mac_inst[j][CC_id].sbmap_conf.sbmap[i]=1; eNB_mac_inst[j][CC_id].sbmap_conf.sbmap[i]=1;
}
eNB_mac_inst[j][CC_id].sbmap_conf.sbmap[rand()%NUMBER_OF_SUBBANDS]=0; eNB_mac_inst[j][CC_id].sbmap_conf.sbmap[rand()%NUMBER_OF_SUBBANDS]=0;
...@@ -359,8 +362,9 @@ int mac_init_global_param(void) ...@@ -359,8 +362,9 @@ int mac_init_global_param(void)
Mac_rlc_xface = NULL; Mac_rlc_xface = NULL;
LOG_I(MAC,"[MAIN] CALLING RLC_MODULE_INIT...\n"); LOG_I(MAC,"[MAIN] CALLING RLC_MODULE_INIT...\n");
if (rlc_module_init()!=0) if (rlc_module_init()!=0) {
return(-1); return(-1);
}
LOG_I(MAC,"[MAIN] RLC_MODULE_INIT OK, malloc16 for mac_rlc_xface...\n"); LOG_I(MAC,"[MAIN] RLC_MODULE_INIT OK, malloc16 for mac_rlc_xface...\n");
...@@ -421,11 +425,13 @@ void mac_top_cleanup(void) ...@@ -421,11 +425,13 @@ void mac_top_cleanup(void)
pdcp_module_cleanup (); pdcp_module_cleanup ();
#endif #endif
if (NB_UE_INST>0) if (NB_UE_INST>0) {
free (UE_mac_inst); free (UE_mac_inst);
}
if (NB_eNB_INST>0) if (NB_eNB_INST>0) {
free(eNB_mac_inst); free(eNB_mac_inst);
}
free( Mac_rlc_xface); free( Mac_rlc_xface);
} }
......
...@@ -107,8 +107,9 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) ...@@ -107,8 +107,9 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
len+=sprintf(&buffer[len],"CH %d: Subband SINR (dB) :", len+=sprintf(&buffer[len],"CH %d: Subband SINR (dB) :",
CH_index); CH_index);
for (fg=0; fg<NUMBER_OF_MEASUREMENT_SUBBANDS; fg++) for (fg=0; fg<NUMBER_OF_MEASUREMENT_SUBBANDS; fg++) {
len+=sprintf(&buffer[len],"%d ",UE_mac_inst[Mod_id].Def_meas[CH_index].Sinr_meas[0][fg]); len+=sprintf(&buffer[len],"%d ",UE_mac_inst[Mod_id].Def_meas[CH_index].Sinr_meas[0][fg]);
}
len+=sprintf(&buffer[len],"\n"); len+=sprintf(&buffer[len],"\n");
...@@ -141,7 +142,9 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) ...@@ -141,7 +142,9 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
if(Overhead<0) { if(Overhead<0) {
Overhead=-Overhead; Overhead=-Overhead;
Sign=-1; Sign=-1;
} else Sign=1; } else {
Sign=1;
}
len+=sprintf(&buffer[len],"[PDCP]LCHAN %d: NB_TX = %d ,Tx_rate =(%d bits/TTI ,%d Kbits/s), NB_RX = %d ,Rx_rate =(%d bits/TTI ,%d Kbits/s) , LAYER2 TX OVERHEAD: %d Kbits/s\n", len+=sprintf(&buffer[len],"[PDCP]LCHAN %d: NB_TX = %d ,Tx_rate =(%d bits/TTI ,%d Kbits/s), NB_RX = %d ,Rx_rate =(%d bits/TTI ,%d Kbits/s) , LAYER2 TX OVERHEAD: %d Kbits/s\n",
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index, UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
...@@ -215,8 +218,9 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) ...@@ -215,8 +218,9 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_RX_ERRORS); UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_RX_ERRORS);
len+=sprintf(&buffer[len]," TX per TB: "); len+=sprintf(&buffer[len]," TX per TB: ");
for(kk=0; kk<MAX_NUMBER_TB_PER_LCHAN/2; kk++) for(kk=0; kk<MAX_NUMBER_TB_PER_LCHAN/2; kk++) {
len+=sprintf(&buffer[len],"%d . ",UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_TX_TB[kk]); len+=sprintf(&buffer[len],"%d . ",UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_TX_TB[kk]);
}
len+=sprintf(&buffer[len],"\n"); len+=sprintf(&buffer[len],"\n");
len+=sprintf(&buffer[len]," RXerr per TB: "); len+=sprintf(&buffer[len]," RXerr per TB: ");
...@@ -241,7 +245,8 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) ...@@ -241,7 +245,8 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
else if(Mac_rlc_xface->Is_cluster_head[k] ==1) { else if(Mac_rlc_xface->Is_cluster_head[k] ==1) {
Mod_id=k; Mod_id=k;
len+=sprintf(&buffer[len],"-------------------------------------------------------------------CH %d: TTI: %d------------------------------------------------------------------\n", len+=sprintf(&buffer[len],
"-------------------------------------------------------------------CH %d: TTI: %d------------------------------------------------------------------\n",
NODE_ID[Mod_id],Mac_rlc_xface->frame); NODE_ID[Mod_id],Mac_rlc_xface->frame);
for(i=1; i<=NB_CNX_CH; i++) { for(i=1; i<=NB_CNX_CH; i++) {
...@@ -251,7 +256,8 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) ...@@ -251,7 +256,8 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
CH_mac_inst[Mod_id].Def_meas[i].Wideband_sinr); CH_mac_inst[Mod_id].Def_meas[i].Wideband_sinr);
//print_cqi(CH_mac_inst[Mod_id].Def_meas[i].cqi)); //print_cqi(CH_mac_inst[Mod_id].Def_meas[i].cqi));
len+=sprintf(&buffer[len],"[MAC] LCHAN %d (DCCH), NB_TX_MAC= %d (%d bits/TTI, %d kbits/s), NB_RX_MAC= %d (errors %d, sacch errors %d, sach errors %d, sach_missing %d)\n\n", len+=sprintf(&buffer[len],
"[MAC] LCHAN %d (DCCH), NB_TX_MAC= %d (%d bits/TTI, %d kbits/s), NB_RX_MAC= %d (errors %d, sacch errors %d, sach errors %d, sach_missing %d)\n\n",
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.Lchan_id.Index, CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.Lchan_id.Index,
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_TX, CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_TX,
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.output_rate, CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.output_rate,
...@@ -269,9 +275,12 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) ...@@ -269,9 +275,12 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
if(Overhead<0) { if(Overhead<0) {
Overhead=-Overhead; Overhead=-Overhead;
Sign=-1; Sign=-1;
} else Sign=1; } else {
Sign=1;
}
len+=sprintf(&buffer[len],"[PDCP]LCHAN %d: NB_TX = %d ,Tx_rate =(%d bits/TTI ,%d Kbits/s), NB_RX = %d ,Rx_rate =(%d bits/TTI ,%d Kbits/s), LAYER2 TX OVERHEAD= %d Kbits/s\n", len+=sprintf(&buffer[len],
"[PDCP]LCHAN %d: NB_TX = %d ,Tx_rate =(%d bits/TTI ,%d Kbits/s), NB_RX = %d ,Rx_rate =(%d bits/TTI ,%d Kbits/s), LAYER2 TX OVERHEAD= %d Kbits/s\n",
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index, CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
Pdcp_stats_tx[k][i][j], Pdcp_stats_tx[k][i][j],
Pdcp_stats_tx_rate[k][i][j], Pdcp_stats_tx_rate[k][i][j],
...@@ -317,7 +326,8 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) ...@@ -317,7 +326,8 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
rx_error_pdu); rx_error_pdu);
} }
*/ */
len+=sprintf(&buffer[len],"[MAC]LCHAN %d (CNX %d,RAB %d), NB_TX_MAC= %d (%d bits/TTI, %d kbit/s), NB_RX_MAC= %d (errors %d, sacch_errors %d, sach_errors %d, sach_missing %d)\n", len+=sprintf(&buffer[len],
"[MAC]LCHAN %d (CNX %d,RAB %d), NB_TX_MAC= %d (%d bits/TTI, %d kbit/s), NB_RX_MAC= %d (errors %d, sacch_errors %d, sach_errors %d, sach_missing %d)\n",
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index, CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
i,j, i,j,
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_TX, CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_TX,
...@@ -373,8 +383,9 @@ int add_openair2_stats() ...@@ -373,8 +383,9 @@ int add_openair2_stats()
// pde = proc_create_entry("lchan_stats", S_IFREG | S_IRUGO, proc_openair2_root); // pde = proc_create_entry("lchan_stats", S_IFREG | S_IRUGO, proc_openair2_root);
pde = create_proc_read_entry("lchan_stats", S_IFREG | S_IRUGO, proc_openair2_root, (read_proc_t*)&openair2_stats_read, NULL); pde = create_proc_read_entry("lchan_stats", S_IFREG | S_IRUGO, proc_openair2_root, (read_proc_t*)&openair2_stats_read, NULL);
if (!pde) if (!pde) {
printk("[OPENAIR][ERROR] can't create proc entry !\n"); printk("[OPENAIR][ERROR] can't create proc entry !\n");
}
//#else //#else
//create_proc_info_entry("lchan_stats", S_IFREG | S_IRUGO, proc_openair2_root, openair2_stats_read); //create_proc_info_entry("lchan_stats", S_IFREG | S_IRUGO, proc_openair2_root, openair2_stats_read);
......
This diff is collapsed.
...@@ -253,12 +253,14 @@ void initiate_ra_proc(module_id_t module_idP,int CC_id,frame_t frameP, uint16_t ...@@ -253,12 +253,14 @@ void initiate_ra_proc(module_id_t module_idP,int CC_id,frame_t frameP, uint16_t
@param N_RB_UL Number of UL resource blocks @param N_RB_UL Number of UL resource blocks
@returns t_CRNTI @returns t_CRNTI
*/ */
uint16_t fill_rar(module_id_t module_idP, unsigned short fill_rar(
int CC_id, const module_id_t module_idP,
frame_t frameP, const int CC_id,
uint8_t *dlsch_buffer, const frame_t frameP,
uint16_t N_RB_UL, uint8_t * const dlsch_buffer,
uint8_t input_buffer_length); const uint16_t N_RB_UL,
const uint8_t input_buffer_length
);
/* \brief Function to indicate a failed RA response. It removes all temporary variables related to the initial connection of a UE /* \brief Function to indicate a failed RA response. It removes all temporary variables related to the initial connection of a UE
@param Mod_id Instance ID of eNB @param Mod_id Instance ID of eNB
...@@ -420,7 +422,15 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,u ...@@ -420,7 +422,15 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,u
random-access procedure random-access procedure
@returns timing advance or 0xffff if preamble doesn't match @returns timing advance or 0xffff if preamble doesn't match
*/ */
uint16_t ue_process_rar(module_id_t module_idP, int CC_id,frame_t frameP,uint8_t *dlsch_buffer,uint16_t *t_crnti,uint8_t preamble_index); uint16_t
ue_process_rar(
const module_id_t module_idP,
const int CC_id,
const frame_t frameP,
uint8_t * const dlsch_buffer,
rnti_t * const t_crnti,
const uint8_t preamble_index
);
/* \brief Generate header for UL-SCH. This function parses the desired control elements and sdus and generates the header as described /* \brief Generate header for UL-SCH. This function parses the desired control elements and sdus and generates the header as described
...@@ -474,7 +484,7 @@ uint8_t *parse_ulsch_header(uint8_t *mac_header, ...@@ -474,7 +484,7 @@ uint8_t *parse_ulsch_header(uint8_t *mac_header,
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active); int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
int mac_init(void); int mac_init(void);
int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid); int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid);
int mac_remove_ue(module_id_t Mod_id, int UE_id,int frameP); int mac_remove_ue(module_id_t Mod_id, int UE_id,int frameP, sub_frame_t subframeP);
int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uint8_t ul_flag); int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uint8_t ul_flag);
...@@ -492,7 +502,7 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP); ...@@ -492,7 +502,7 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP);
void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP,uint16_t *first_rb); void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP,uint16_t *first_rb);
void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, UE_TEMPLATE *UE_template); void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, UE_TEMPLATE *UE_template);
/*! \fn UE_L2_state_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframe, lte_subframe_t direction,uint8_t eNB_index) /*! \fn UE_L2_state_t ue_scheduler(const module_id_t module_idP,const frame_t frameP, const sub_frame_t subframe, const lte_subframe_t direction,const uint8_t eNB_index)
\brief UE scheduler where all the ue background tasks are done. This function performs the following: 1) Trigger PDCP every 5ms 2) Call RRC for link status return to PHY3) Perform SR/BSR procedures for scheduling feedback 4) Perform PHR procedures. \brief UE scheduler where all the ue background tasks are done. This function performs the following: 1) Trigger PDCP every 5ms 2) Call RRC for link status return to PHY3) Perform SR/BSR procedures for scheduling feedback 4) Perform PHR procedures.
\param[in] module_idP instance of the UE \param[in] module_idP instance of the UE
\param[in] subframe t the subframe number \param[in] subframe t the subframe number
...@@ -500,7 +510,13 @@ void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, UE_TEMPLATE *UE_templat ...@@ -500,7 +510,13 @@ void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, UE_TEMPLATE *UE_templat
\param[in] eNB_index instance of eNB \param[in] eNB_index instance of eNB
@returns L2 state (CONNETION_OK or CONNECTION_LOST or PHY_RESYNCH) @returns L2 state (CONNETION_OK or CONNECTION_LOST or PHY_RESYNCH)
*/ */
UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframe, lte_subframe_t direction,uint8_t eNB_index,int CC_id); UE_L2_STATE_t ue_scheduler(
const module_id_t module_idP,
const frame_t frameP,
const sub_frame_t subframe,
const lte_subframe_t direction,
const uint8_t eNB_index,
const int CC_id);
/*! \fn int cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index,uint16_t buflen); /*! \fn int cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index,uint16_t buflen);
\brief determine whether to use cba resource to transmit or not \brief determine whether to use cba resource to transmit or not
...@@ -685,7 +701,7 @@ unsigned char generate_dlsch_header(unsigned char *mac_header, ...@@ -685,7 +701,7 @@ unsigned char generate_dlsch_header(unsigned char *mac_header,
/** \brief RRC Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages. /** \brief RRC Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
@param Mod_id Instance ID of eNB @param Mod_id Instance ID of eNB
@param eNB_flag Indicates if this is a eNB or UE configuration @param eNB_flag Indicates if this is a eNB or UE configuration
@param UE_id Index of UE if this is an eNB configuration @param rntiP id of UE if this is an eNB configuration
@param eNB_id Index of eNB if this is a UE configuration @param eNB_id Index of eNB if this is a UE configuration
@param radioResourceConfigCommon Structure from SIB2 for common radio parameters (if NULL keep existing configuration) @param radioResourceConfigCommon Structure from SIB2 for common radio parameters (if NULL keep existing configuration)
@param physcialConfigDedicated Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated PHY parameters (if NULL keep existing configuration) @param physcialConfigDedicated Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated PHY parameters (if NULL keep existing configuration)
...@@ -705,7 +721,7 @@ unsigned char generate_dlsch_header(unsigned char *mac_header, ...@@ -705,7 +721,7 @@ unsigned char generate_dlsch_header(unsigned char *mac_header,
*/ */
int rrc_mac_config_req(module_id_t module_idP, int rrc_mac_config_req(module_id_t module_idP,
eNB_flag_t eNB_flag, eNB_flag_t eNB_flag,
uint8_t UE_id, rnti_t rntiP,
uint8_t eNB_index, uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon, RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated, struct PhysicalConfigDedicated *physicalConfigDedicated,
...@@ -748,11 +764,10 @@ int rrc_mac_config_req(module_id_t module_idP, ...@@ -748,11 +764,10 @@ int rrc_mac_config_req(module_id_t module_idP,
@return the estimated distance in meters @return the estimated distance in meters
*/ */
double double
rrc_get_estimated_ue_distance(module_id_t Mod_id, rrc_get_estimated_ue_distance(
const frame_t frameP, const protocol_ctxt_t * const ctxt_pP,
uint8_t UE_id, const int CC_idP,
int CC_id, const uint8_t loc_typeP);
uint8_t loc_type);
#endif #endif
...@@ -70,16 +70,17 @@ int8_t get_DELTA_PREAMBLE(module_id_t module_idP,int CC_id) ...@@ -70,16 +70,17 @@ int8_t get_DELTA_PREAMBLE(module_id_t module_idP,int CC_id)
uint8_t preambleformat; uint8_t preambleformat;
if (UE_mac_inst[module_idP].tdd_Config) { // TDD if (UE_mac_inst[module_idP].tdd_Config) { // TDD
if (prachConfigIndex < 20) if (prachConfigIndex < 20) {
preambleformat = 0; preambleformat = 0;
else if (prachConfigIndex < 30) } else if (prachConfigIndex < 30) {
preambleformat = 1; preambleformat = 1;
else if (prachConfigIndex < 40) } else if (prachConfigIndex < 40) {
preambleformat = 2; preambleformat = 2;
else if (prachConfigIndex < 48) } else if (prachConfigIndex < 48) {
preambleformat = 3; preambleformat = 3;
else } else {
preambleformat = 4; preambleformat = 4;
}
} else { // FDD } else { // FDD
preambleformat = prachConfigIndex>>2; preambleformat = prachConfigIndex>>2;
} }
...@@ -127,8 +128,9 @@ void get_prach_resources(module_id_t module_idP, ...@@ -127,8 +128,9 @@ void get_prach_resources(module_id_t module_idP,
return; return;
} }
if (UE_mac_inst[module_idP].radioResourceConfigCommon) if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon; rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon;
}
else { else {
LOG_E(MAC,"[UE %d] FATAL radioResourceConfigCommon is NULL !!!\n",module_idP); LOG_E(MAC,"[UE %d] FATAL radioResourceConfigCommon is NULL !!!\n",module_idP);
mac_xface->macphy_exit("MAC FATAL radioResourceConfigCommon is NULL"); mac_xface->macphy_exit("MAC FATAL radioResourceConfigCommon is NULL");
...@@ -148,8 +150,9 @@ void get_prach_resources(module_id_t module_idP, ...@@ -148,8 +150,9 @@ void get_prach_resources(module_id_t module_idP,
} else { } else {
if (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA == if (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA ==
rach_ConfigCommon->preambleInfo.numberOfRA_Preambles) rach_ConfigCommon->preambleInfo.numberOfRA_Preambles) {
noGroupB = 1; noGroupB = 1;
}
} }
if (first_Msg3 == 1) { if (first_Msg3 == 1) {
...@@ -176,10 +179,11 @@ void get_prach_resources(module_id_t module_idP, ...@@ -176,10 +179,11 @@ void get_prach_resources(module_id_t module_idP,
UE_mac_inst[module_idP].RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER = get_Po_NOMINAL_PUSCH(module_idP,CC_id); UE_mac_inst[module_idP].RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER = get_Po_NOMINAL_PUSCH(module_idP,CC_id);
} else { // Msg3 is being retransmitted } else { // Msg3 is being retransmitted
if (UE_mac_inst[module_idP].RA_usedGroupA == 1) { if (UE_mac_inst[module_idP].RA_usedGroupA == 1) {
if (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) if (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) {
UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex = (taus())%rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA; UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex = (taus())%rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA;
else } else {
UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex = (taus())&0x3f; UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex = (taus())&0x3f;
}
UE_mac_inst[module_idP].RA_prach_resources.ra_RACH_MaskIndex = 0; UE_mac_inst[module_idP].RA_prach_resources.ra_RACH_MaskIndex = 0;
} else { } else {
...@@ -195,8 +199,9 @@ void get_prach_resources(module_id_t module_idP, ...@@ -195,8 +199,9 @@ void get_prach_resources(module_id_t module_idP,
if (UE_mac_inst[module_idP].tdd_Config) { if (UE_mac_inst[module_idP].tdd_Config) {
num_prach = mac_xface->get_num_prach_tdd(mac_xface->lte_frame_parms); num_prach = mac_xface->get_num_prach_tdd(mac_xface->lte_frame_parms);
if ((num_prach>0) && (num_prach<6)) if ((num_prach>0) && (num_prach<6)) {
UE_mac_inst[module_idP].RA_prach_resources.ra_TDD_map_index = (taus()%num_prach); UE_mac_inst[module_idP].RA_prach_resources.ra_TDD_map_index = (taus()%num_prach);
}
f_id = mac_xface->get_fid_prach_tdd(mac_xface->lte_frame_parms, f_id = mac_xface->get_fid_prach_tdd(mac_xface->lte_frame_parms,
UE_mac_inst[module_idP].RA_prach_resources.ra_TDD_map_index); UE_mac_inst[module_idP].RA_prach_resources.ra_TDD_map_index);
...@@ -217,14 +222,16 @@ void Msg1_tx(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id ...@@ -217,14 +222,16 @@ void Msg1_tx(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id
// start contention resolution timer // start contention resolution timer
UE_mac_inst[module_idP].RA_attempt_number++; UE_mac_inst[module_idP].RA_attempt_number++;
#if defined(USER_MODE) && defined(OAI_EMU)
if (opt_enabled == 1) { if (oai_emulation.info.opt_enabled) {
trace_pdu(0, NULL, 0, module_idP, 3, UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex, trace_pdu(0, NULL, 0, module_idP, 3, UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex,
UE_mac_inst[module_idP].subframe, 0, UE_mac_inst[module_idP].RA_attempt_number); UE_mac_inst[module_idP].subframe, 0, UE_mac_inst[module_idP].RA_attempt_number);
LOG_D(OPT,"[UE %d][RAPROC] TX MSG1 Frame %d trace pdu for rnti %x with size %d\n", LOG_D(OPT,"[UE %d][RAPROC] TX MSG1 Frame %d trace pdu for rnti %x with size %d\n",
module_idP, frameP, 1, UE_mac_inst[module_idP].RA_Msg3_size); module_idP, frameP, 1, UE_mac_inst[module_idP].RA_Msg3_size);
} }
#endif
} }
...@@ -241,15 +248,16 @@ void Msg3_tx(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id ...@@ -241,15 +248,16 @@ void Msg3_tx(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id
LOG_I(MAC,"[UE %d][RAPROC] Frame %d : Msg3_tx: Setting contention resolution timer\n",module_idP,frameP); LOG_I(MAC,"[UE %d][RAPROC] Frame %d : Msg3_tx: Setting contention resolution timer\n",module_idP,frameP);
UE_mac_inst[module_idP].RA_contention_resolution_cnt = 0; UE_mac_inst[module_idP].RA_contention_resolution_cnt = 0;
UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 1; UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 1;
#if defined(USER_MODE) && defined(OAI_EMU)
// msg3 if (oai_emulation.info.opt_enabled) { // msg3
if (opt_enabled == 1 ) {
trace_pdu(0, &UE_mac_inst[module_idP].CCCH_pdu.payload[0], UE_mac_inst[module_idP].RA_Msg3_size, trace_pdu(0, &UE_mac_inst[module_idP].CCCH_pdu.payload[0], UE_mac_inst[module_idP].RA_Msg3_size,
module_idP, 3, UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].subframe, 0, 0); module_idP, 3, UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].subframe, 0, 0);
LOG_D(OPT,"[UE %d][RAPROC] MSG3 Frame %d trace pdu Preamble %d with size %d\n", LOG_D(OPT,"[UE %d][RAPROC] MSG3 Frame %d trace pdu Preamble %d with size %d\n",
module_idP, frameP, UE_mac_inst[module_idP].crnti /*UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex*/, UE_mac_inst[module_idP].RA_Msg3_size); module_idP, frameP, UE_mac_inst[module_idP].crnti /*UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex*/, UE_mac_inst[module_idP].RA_Msg3_size);
} }
#endif
} }
...@@ -275,9 +283,9 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -275,9 +283,9 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
} }
if (UE_mode == PRACH) { if (UE_mode == PRACH) {
if (UE_mac_inst[module_idP].radioResourceConfigCommon) if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon; rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon;
else { } else {
return(NULL); return(NULL);
} }
...@@ -311,8 +319,9 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -311,8 +319,9 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
if (rach_ConfigCommon) { if (rach_ConfigCommon) {
UE_mac_inst[module_idP].RA_window_cnt = 2+ rach_ConfigCommon->ra_SupervisionInfo.ra_ResponseWindowSize; UE_mac_inst[module_idP].RA_window_cnt = 2+ rach_ConfigCommon->ra_SupervisionInfo.ra_ResponseWindowSize;
if (UE_mac_inst[module_idP].RA_window_cnt == 9) if (UE_mac_inst[module_idP].RA_window_cnt == 9) {
UE_mac_inst[module_idP].RA_window_cnt = 10; // Note: 9 subframe window doesn't exist, after 8 is 10! UE_mac_inst[module_idP].RA_window_cnt = 10; // Note: 9 subframe window doesn't exist, after 8 is 10!
}
} else { } else {
LOG_D(MAC,"[UE %d] FATAL Frame %d: rach_ConfigCommon is NULL !!!\n",module_idP,frameP); LOG_D(MAC,"[UE %d] FATAL Frame %d: rach_ConfigCommon is NULL !!!\n",module_idP,frameP);
mac_xface->macphy_exit("MAC rach_ConfigCommon is NULL"); mac_xface->macphy_exit("MAC rach_ConfigCommon is NULL");
...@@ -336,8 +345,8 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -336,8 +345,8 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
NULL, // short bsr NULL, // short bsr
NULL, // long_bsr NULL, // long_bsr
1); //post_padding 1); //post_padding
return(&UE_mac_inst[module_idP].RA_prach_resources); return(&UE_mac_inst[module_idP].RA_prach_resources);
} else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DCCH] > 0) { } else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DCCH] > 0) {
// This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example) // This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example)
dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element
...@@ -346,7 +355,8 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -346,7 +355,8 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
6); 6);
if (UE_mac_inst[module_idP].crnti_before_ho) if (UE_mac_inst[module_idP].crnti_before_ho)
LOG_D(MAC,"[UE %d] Frame %d : UL-DCCH -> ULSCH, HO RRCConnectionReconfigurationComplete (%x, %x), RRC message has %d bytes to send throug PRACH (mac header len %d)\n", LOG_D(MAC,
"[UE %d] Frame %d : UL-DCCH -> ULSCH, HO RRCConnectionReconfigurationComplete (%x, %x), RRC message has %d bytes to send throug PRACH (mac header len %d)\n",
module_idP,frameP, UE_mac_inst[module_idP].crnti,UE_mac_inst[module_idP].crnti_before_ho, rlc_status.bytes_in_buffer,dcch_header_len); module_idP,frameP, UE_mac_inst[module_idP].crnti,UE_mac_inst[module_idP].crnti_before_ho, rlc_status.bytes_in_buffer,dcch_header_len);
else else
LOG_D(MAC,"[UE %d] Frame %d : UL-DCCH -> ULSCH, RRC message has %d bytes to send through PRACH(mac header len %d)\n", LOG_D(MAC,"[UE %d] Frame %d : UL-DCCH -> ULSCH, RRC message has %d bytes to send through PRACH(mac header len %d)\n",
...@@ -369,8 +379,9 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -369,8 +379,9 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
if (rach_ConfigCommon) { if (rach_ConfigCommon) {
UE_mac_inst[module_idP].RA_window_cnt = 2+ rach_ConfigCommon->ra_SupervisionInfo.ra_ResponseWindowSize; UE_mac_inst[module_idP].RA_window_cnt = 2+ rach_ConfigCommon->ra_SupervisionInfo.ra_ResponseWindowSize;
if (UE_mac_inst[module_idP].RA_window_cnt == 9) if (UE_mac_inst[module_idP].RA_window_cnt == 9) {
UE_mac_inst[module_idP].RA_window_cnt = 10; // Note: 9 subframe window doesn't exist, after 8 is 10! UE_mac_inst[module_idP].RA_window_cnt = 10; // Note: 9 subframe window doesn't exist, after 8 is 10!
}
} else { } else {
LOG_D(MAC,"[UE %d] FATAL Frame %d: rach_ConfigCommon is NULL !!!\n",module_idP,frameP); LOG_D(MAC,"[UE %d] FATAL Frame %d: rach_ConfigCommon is NULL !!!\n",module_idP,frameP);
mac_xface->macphy_exit("MAC rach_ConfigCommon is NULL"); mac_xface->macphy_exit("MAC rach_ConfigCommon is NULL");
...@@ -405,8 +416,9 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -405,8 +416,9 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
if (UE_mac_inst[module_idP].RA_backoff_cnt>0) { if (UE_mac_inst[module_idP].RA_backoff_cnt>0) {
frame_diff = (sframe_t)frameP - UE_mac_inst[module_idP].RA_backoff_frame; frame_diff = (sframe_t)frameP - UE_mac_inst[module_idP].RA_backoff_frame;
if (frame_diff < 0) if (frame_diff < 0) {
frame_diff = -frame_diff; frame_diff = -frame_diff;
}
UE_mac_inst[module_idP].RA_backoff_cnt -= ((10*frame_diff) + (subframeP-UE_mac_inst[module_idP].RA_backoff_subframe)); UE_mac_inst[module_idP].RA_backoff_cnt -= ((10*frame_diff) + (subframeP-UE_mac_inst[module_idP].RA_backoff_subframe));
...@@ -418,8 +430,9 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -418,8 +430,9 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
if (UE_mac_inst[module_idP].RA_window_cnt>0) { if (UE_mac_inst[module_idP].RA_window_cnt>0) {
frame_diff = (frame_t)frameP - UE_mac_inst[module_idP].RA_tx_frame; frame_diff = (frame_t)frameP - UE_mac_inst[module_idP].RA_tx_frame;
if (frame_diff < 0) if (frame_diff < 0) {
frame_diff = -frame_diff; frame_diff = -frame_diff;
}
UE_mac_inst[module_idP].RA_window_cnt -= ((10*frame_diff) + (subframeP-UE_mac_inst[module_idP].RA_tx_subframe)); UE_mac_inst[module_idP].RA_window_cnt -= ((10*frame_diff) + (subframeP-UE_mac_inst[module_idP].RA_tx_subframe));
LOG_D(MAC,"[MAC][UE %d][RAPROC] frameP %d, subframe %d: RA Active, adjusted window cnt %d\n",module_idP, LOG_D(MAC,"[MAC][UE %d][RAPROC] frameP %d, subframe %d: RA Active, adjusted window cnt %d\n",module_idP,
...@@ -432,7 +445,8 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -432,7 +445,8 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
UE_mac_inst[module_idP].RA_tx_frame = frameP; UE_mac_inst[module_idP].RA_tx_frame = frameP;
UE_mac_inst[module_idP].RA_tx_subframe = subframeP; UE_mac_inst[module_idP].RA_tx_subframe = subframeP;
UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER++; UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER++;
UE_mac_inst[module_idP].RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER += (rach_ConfigCommon->powerRampingParameters.powerRampingStep<<1); // 2dB increments in ASN.1 definition UE_mac_inst[module_idP].RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER +=
(rach_ConfigCommon->powerRampingParameters.powerRampingStep<<1); // 2dB increments in ASN.1 definition
if (UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER == rach_ConfigCommon->ra_SupervisionInfo.preambleTransMax) { if (UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER == rach_ConfigCommon->ra_SupervisionInfo.preambleTransMax) {
LOG_D(MAC,"[UE %d] Frame %d: Maximum number of RACH attempts (%d)\n",module_idP,frameP,rach_ConfigCommon->ra_SupervisionInfo.preambleTransMax); LOG_D(MAC,"[UE %d] Frame %d: Maximum number of RACH attempts (%d)\n",module_idP,frameP,rach_ConfigCommon->ra_SupervisionInfo.preambleTransMax);
......
...@@ -56,12 +56,16 @@ extern unsigned short RIV2first_rb_LUT25[512]; ...@@ -56,12 +56,16 @@ extern unsigned short RIV2first_rb_LUT25[512];
extern inline unsigned int taus(void); extern inline unsigned int taus(void);
unsigned short fill_rar(module_id_t module_idP, //------------------------------------------------------------------------------
int CC_id, unsigned short fill_rar(
frame_t frameP, const module_id_t module_idP,
uint8_t *dlsch_buffer, const int CC_id,
uint16_t N_RB_UL, const frame_t frameP,
uint8_t input_buffer_length) uint8_t* const dlsch_buffer,
const uint16_t N_RB_UL,
const uint8_t input_buffer_length
)
//------------------------------------------------------------------------------
{ {
RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *)dlsch_buffer; RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *)dlsch_buffer;
...@@ -70,6 +74,7 @@ unsigned short fill_rar(module_id_t module_idP, ...@@ -70,6 +74,7 @@ unsigned short fill_rar(module_id_t module_idP,
int i,ra_idx = -1; int i,ra_idx = -1;
uint16_t rballoc; uint16_t rballoc;
uint8_t mcs,TPC,ULdelay,cqireq; uint8_t mcs,TPC,ULdelay,cqireq;
AssertFatal(CC_id < MAX_NUM_CCs, "CC_id %u < MAX_NUM_CCs %u", CC_id, MAX_NUM_CCs);
for (i=0; i<NB_RA_PROC_MAX; i++) { for (i=0; i<NB_RA_PROC_MAX; i++) {
if (eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[i].generate_rar == 1) { if (eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[i].generate_rar == 1) {
...@@ -112,14 +117,16 @@ unsigned short fill_rar(module_id_t module_idP, ...@@ -112,14 +117,16 @@ unsigned short fill_rar(module_id_t module_idP,
rar[2] |= ((mcs&0x8)>>3); // mcs 10 rar[2] |= ((mcs&0x8)>>3); // mcs 10
rar[3] = (((mcs&0x7)<<5)) | ((TPC&7)<<2) | ((ULdelay&1)<<1) | (cqireq&1); rar[3] = (((mcs&0x7)<<5)) | ((TPC&7)<<2) | ((ULdelay&1)<<1) | (cqireq&1);
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d Generating RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ra_idx %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n",module_idP,frameP, LOG_I(MAC,"[eNB %d][RAPROC] Frame %d Generating RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ra_idx %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n",module_idP,
frameP,
*(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5], *(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5],
ra_idx, ra_idx,
eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti, eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti,
rarh->RAPID,eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0].preamble_index, rarh->RAPID,eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0].preamble_index,
eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset); eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset);
#if defined(USER_MODE) && defined(OAI_EMU)
if (opt_enabled == 1) { if (oai_emulation.info.opt_enabled) {
trace_pdu(1, dlsch_buffer, input_buffer_length, module_idP, 2, 1, trace_pdu(1, dlsch_buffer, input_buffer_length, module_idP, 2, 1,
eNB_mac_inst[module_idP].subframe, 0, 0); eNB_mac_inst[module_idP].subframe, 0, 0);
LOG_D(OPT,"[eNB %d][RAPROC] RAR Frame %d trace pdu for rnti %x and rapid %d size %d\n", LOG_D(OPT,"[eNB %d][RAPROC] RAR Frame %d trace pdu for rnti %x and rapid %d size %d\n",
...@@ -127,10 +134,21 @@ unsigned short fill_rar(module_id_t module_idP, ...@@ -127,10 +134,21 @@ unsigned short fill_rar(module_id_t module_idP,
rarh->RAPID, input_buffer_length); rarh->RAPID, input_buffer_length);
} }
#endif
return(eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti); return(eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti);
} }
uint16_t ue_process_rar(module_id_t module_idP, int CC_id,frame_t frameP, uint8_t *dlsch_buffer,rnti_t *t_crnti,uint8_t preamble_index) //------------------------------------------------------------------------------
uint16_t
ue_process_rar(
const module_id_t module_idP,
const int CC_id,
const frame_t frameP,
uint8_t* const dlsch_buffer,
rnti_t* const t_crnti,
const uint8_t preamble_index
)
//------------------------------------------------------------------------------
{ {
RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *)dlsch_buffer; RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *)dlsch_buffer;
......
This diff is collapsed.
...@@ -70,6 +70,7 @@ RRC_OBJS += $(RRC_DIR)/rrc_eNB_ral.o ...@@ -70,6 +70,7 @@ RRC_OBJS += $(RRC_DIR)/rrc_eNB_ral.o
endif endif
RRC_OBJS += $(RRC_DIR)/rrc_eNB.o RRC_OBJS += $(RRC_DIR)/rrc_eNB.o
RRC_OBJS += $(RRC_DIR)/rrc_eNB_UE_context.o
RRC_OBJS += $(RRC_DIR)/rrc_eNB_S1AP.o RRC_OBJS += $(RRC_DIR)/rrc_eNB_S1AP.o
ifdef USE_MME ifdef USE_MME
RRC_OBJS += $(RRC_DIR)/rrc_eNB_GTPV1U.o RRC_OBJS += $(RRC_DIR)/rrc_eNB_GTPV1U.o
......
...@@ -59,8 +59,8 @@ void ...@@ -59,8 +59,8 @@ void
pdcp_data_req (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, char* sduP) pdcp_data_req (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, char* sduP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
mem_block_t* new_sdu = NULL;
mem_block_t *new_sdu = NULL;
// int i; // int i;
if ((data_sizeP > 0)) { if ((data_sizeP > 0)) {
...@@ -89,10 +89,10 @@ pdcp_data_req (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, c ...@@ -89,10 +89,10 @@ pdcp_data_req (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, c
if(Mac_rlc_xface->Is_cluster_head[module_idP]==1) { if(Mac_rlc_xface->Is_cluster_head[module_idP]==1) {
Pdcp_stats_tx[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]++; Pdcp_stats_tx[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]++;
Pdcp_stats_tx_bytes[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]+=data_sizeP; Pdcp_stats_tx_bytes[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]+=data_sizeP;
} else { } else {
Pdcp_stats_tx[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]++; Pdcp_stats_tx[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]++;
Pdcp_stats_tx_bytes[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]+=data_sizeP; Pdcp_stats_tx_bytes[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]+=data_sizeP;
} }
} else { } else {
...@@ -107,47 +107,45 @@ pdcp_data_req (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, c ...@@ -107,47 +107,45 @@ pdcp_data_req (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, c
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
pdcp_data_ind (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, mem_block_t * sduP) pdcp_data_ind (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, mem_block_t* sduP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
mem_block_t *new_sdu = NULL; mem_block_t* new_sdu = NULL;
int i; int i;
if ((data_sizeP > 0)) { if ((data_sizeP > 0)) {
// if(Mac_rlc_xface->Is_cluster_head[0]==1 && Mac_rlc_xface->frame%10==0) // if(Mac_rlc_xface->Is_cluster_head[0]==1 && Mac_rlc_xface->frame%10==0)
//msg("[PDCP][RAB %d][INST %d] PDCP_DATA_IND size %d\n", rab_idP,module_idP,data_sizeP); //msg("[PDCP][RAB %d][INST %d] PDCP_DATA_IND size %d\n", rab_idP,module_idP,data_sizeP);
#ifdef PDCP_DATA_IND_DEBUG #ifdef PDCP_DATA_IND_DEBUG
msg("[PDCP][RAB %d][INST %d] TTI %d PDCP_DATA_IND size %d\n", msg("[PDCP][RAB %d][INST %d] TTI %d PDCP_DATA_IND size %d\n",
rab_idP,module_idP,Mac_rlc_xface->frame,data_sizeP); rab_idP,module_idP,Mac_rlc_xface->frame,data_sizeP);
for (i=0; i<20; i++) for (i=0; i<20; i++) {
msg("%02X.",(unsigned char)sduP->data[i]); msg("%02X.",(unsigned char)sduP->data[i]);
}
msg("\n"); msg("\n");
#endif //PDCP_DATA_IND_DEBUG #endif //PDCP_DATA_IND_DEBUG
new_sdu = get_free_mem_block (data_sizeP + sizeof (pdcp_data_ind_header_t)); new_sdu = get_free_mem_block (data_sizeP + sizeof (pdcp_data_ind_header_t));
if (new_sdu) { if (new_sdu) {
memset (new_sdu->data, 0, sizeof (pdcp_data_ind_header_t)); memset (new_sdu->data, 0, sizeof (pdcp_data_ind_header_t));
((pdcp_data_ind_header_t *) new_sdu->data)->rb_id = rab_idP; ((pdcp_data_ind_header_t*) new_sdu->data)->rb_id = rab_idP;
((pdcp_data_ind_header_t *) new_sdu->data)->data_size = data_sizeP; ((pdcp_data_ind_header_t*) new_sdu->data)->data_size = data_sizeP;
// Here there is no virtualization possible // Here there is no virtualization possible
#ifdef IDROMEL_NEMO #ifdef IDROMEL_NEMO
if (Mac_rlc_xface->Is_cluster_head[module_idP] == 0) if (Mac_rlc_xface->Is_cluster_head[module_idP] == 0) {
((pdcp_data_ind_header_t *) new_sdu->data)->inst = rab_idP/8; ((pdcp_data_ind_header_t*) new_sdu->data)->inst = rab_idP/8;
else }
((pdcp_data_ind_header_t *) new_sdu->data)->inst = 0;
else {
((pdcp_data_ind_header_t*) new_sdu->data)->inst = 0;
}
#else #else
((pdcp_data_ind_header_t *) new_sdu->data)->inst = module_idP; ((pdcp_data_ind_header_t*) new_sdu->data)->inst = module_idP;
#endif #endif
// PROCESS OF DECOMPRESSION HERE: // PROCESS OF DECOMPRESSION HERE:
memcpy (&new_sdu->data[sizeof (pdcp_data_ind_header_t)], &sduP->data[0], data_sizeP); memcpy (&new_sdu->data[sizeof (pdcp_data_ind_header_t)], &sduP->data[0], data_sizeP);
list_add_tail_eurecom (new_sdu, &pdcp_sdu_list); list_add_tail_eurecom (new_sdu, &pdcp_sdu_list);
...@@ -158,11 +156,9 @@ pdcp_data_ind (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, m ...@@ -158,11 +156,9 @@ pdcp_data_ind (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, m
} else { } else {
Pdcp_stats_rx[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]++; Pdcp_stats_rx[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]++;
Pdcp_stats_rx_bytes[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]+=data_sizeP; Pdcp_stats_rx_bytes[module_idP][(rab_idP & RAB_OFFSET2 )>> RAB_SHIFT2][(rab_idP & RAB_OFFSET)-DTCH]+=data_sizeP;
} }
} }
free_mem_block (sduP); free_mem_block (sduP);
} }
} }
...@@ -172,16 +168,11 @@ pdcp_run (void) ...@@ -172,16 +168,11 @@ pdcp_run (void)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// NAS -> PDCP traffic // NAS -> PDCP traffic
#ifndef PDCP_USE_NETLINK
#ifndef NAS_NETLINK
#ifdef USER_MODE #ifdef USER_MODE
//#define PDCP_DUMMY_BUFFER_SIZE 38 //#define PDCP_DUMMY_BUFFER_SIZE 38
// unsigned char pdcp_dummy_buffer[PDCP_DUMMY_BUFFER_SIZE]; // unsigned char pdcp_dummy_buffer[PDCP_DUMMY_BUFFER_SIZE];
//msg("[PDCP] PDCP Run Id %d\n",modId); //msg("[PDCP] PDCP Run Id %d\n",modId);
/* /*
if(Mac_rlc_xface->frame %1 == 0 && (Mac_rlc_xface->frame > 30)) { if(Mac_rlc_xface->frame %1 == 0 && (Mac_rlc_xface->frame > 30)) {
if (Mac_rlc_xface->Is_cluster_head[0] ==0){ if (Mac_rlc_xface->Is_cluster_head[0] ==0){
...@@ -205,7 +196,6 @@ pdcp_run (void) ...@@ -205,7 +196,6 @@ pdcp_run (void)
// pdcp_data_req(0,36,PDCP_DUMMY_BUFFER_SIZE,pdcp_dummy_buffer); // pdcp_data_req(0,36,PDCP_DUMMY_BUFFER_SIZE,pdcp_dummy_buffer);
}*/ }*/
#endif #endif
#endif #endif
unsigned int diff,i,k,j; unsigned int diff,i,k,j;
...@@ -218,20 +208,16 @@ pdcp_run (void) ...@@ -218,20 +208,16 @@ pdcp_run (void)
diff = Pdcp_stats_tx_bytes[i][j][k]; diff = Pdcp_stats_tx_bytes[i][j][k];
Pdcp_stats_tx_bytes[i][j][k]=0; Pdcp_stats_tx_bytes[i][j][k]=0;
Pdcp_stats_tx_rate[i][j][k] = (diff*8)>>7;// (Pdcp_stats_tx_rate[i][k]*1+(7*diff*8)>>7)/8; Pdcp_stats_tx_rate[i][j][k] = (diff*8)>>7;// (Pdcp_stats_tx_rate[i][k]*1+(7*diff*8)>>7)/8;
diff = Pdcp_stats_rx_bytes[i][j][k]; diff = Pdcp_stats_rx_bytes[i][j][k];
Pdcp_stats_rx_bytes[i][j][k]=0; Pdcp_stats_rx_bytes[i][j][k]=0;
Pdcp_stats_rx_rate[i][j][k] =(diff*8)>>7;//(Pdcp_stats_rx_rate[i][k]*1 + (7*diff*8)>>7)/8; Pdcp_stats_rx_rate[i][j][k] =(diff*8)>>7;//(Pdcp_stats_rx_rate[i][k]*1 + (7*diff*8)>>7)/8;
} }
} }
// printf("[PDCP]Read sdus from NAS\n"); // printf("[PDCP]Read sdus from NAS\n");
pdcp_fifo_read_input_sdus(); pdcp_fifo_read_input_sdus();
// PDCP -> NAS traffic // PDCP -> NAS traffic
pdcp_fifo_flush_sdus(); pdcp_fifo_flush_sdus();
/*printf("PDCP TTI %d\n", Mac_rlc_xface->frame); /*printf("PDCP TTI %d\n", Mac_rlc_xface->frame);
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
printf("[RLC_RRC][MOD ID %d] AM:", i); printf("[RLC_RRC][MOD ID %d] AM:", i);
...@@ -263,50 +249,45 @@ pdcp_config_release (module_id_t module_idP, rb_id_t rab_idP) ...@@ -263,50 +249,45 @@ pdcp_config_release (module_id_t module_idP, rb_id_t rab_idP)
int int
pdcp_module_init () pdcp_module_init ()
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef USER_MODE #ifndef USER_MODE
int ret; int ret;
ret=rtf_create(PDCP2NW_DRIVER_FIFO,32768);
ret=rtf_create(PDCP2NAS_FIFO,32768);
if (ret < 0) { if (ret < 0) {
printk("[openair][MAC][INIT] Cannot create PDCP2NAS fifo %d (ERROR %d)\n",PDCP2NAS_FIFO,ret); printk("[openair][MAC][INIT] Cannot create PDCP2NAS fifo %d (ERROR %d)\n",PDCP2NW_DRIVER_FIFO,ret);
return(-1); return(-1);
} else { } else {
printk("[openair][MAC][INIT] Created PDCP2NAS fifo %d\n",PDCP2NAS_FIFO); printk("[openair][MAC][INIT] Created PDCP2NAS fifo %d\n",PDCP2NW_DRIVER_FIFO);
rtf_reset(PDCP2NAS_FIFO); rtf_reset(PDCP2NW_DRIVER_FIFO);
} }
ret=rtf_create(NAS2PDCP_FIFO,32768); ret=rtf_create(NW_DRIVER2PDCP_FIFO,32768);
if (ret < 0) { if (ret < 0) {
printk("[openair][MAC][INIT] Cannot create NAS2PDCP fifo %d (ERROR %d)\n",NAS2PDCP_FIFO,ret); printk("[openair][MAC][INIT] Cannot create NAS2PDCP fifo %d (ERROR %d)\n",NW_DRIVER2PDCP_FIFO,ret);
return(-1); return(-1);
} else { } else {
printk("[openair][MAC][INIT] Created NAS2PDCP fifo %d\n",NAS2PDCP_FIFO); printk("[openair][MAC][INIT] Created NAS2PDCP fifo %d\n",NW_DRIVER2PDCP_FIFO);
rtf_reset(NAS2PDCP_FIFO); rtf_reset(NW_DRIVER2PDCP_FIFO);
} }
pdcp_2_nas_irq = 0; pdcp_2_nas_irq = 0;
pdcp_input_sdu_remaining_size_to_read=0; pdcp_input_sdu_remaining_size_to_read=0;
pdcp_input_sdu_size_read=0; pdcp_input_sdu_size_read=0;
#endif #endif
return(0); return(0);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
pdcp_module_cleanup () pdcp_module_cleanup ()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
#ifndef USER_MODE #ifndef USER_MODE
rtf_destroy(NAS2PDCP_FIFO); rtf_destroy(NW_DRIVER2PDCP_FIFO);
rtf_destroy(PDCP2NAS_FIFO); rtf_destroy(PDCP2NW_DRIVER_FIFO);
#endif #endif
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -316,7 +297,6 @@ pdcp_layer_init () ...@@ -316,7 +297,6 @@ pdcp_layer_init ()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
unsigned int i,j,k; unsigned int i,j,k;
list_init (&pdcp_sdu_list, NULL); list_init (&pdcp_sdu_list, NULL);
msg("[PDCP] pdcp_layer_init \n "); msg("[PDCP] pdcp_layer_init \n ");
pdcp_output_sdu_bytes_to_write=0; pdcp_output_sdu_bytes_to_write=0;
pdcp_output_header_bytes_to_write=0; pdcp_output_header_bytes_to_write=0;
...@@ -330,13 +310,11 @@ pdcp_layer_init () ...@@ -330,13 +310,11 @@ pdcp_layer_init ()
Pdcp_stats_tx_bytes[i][k][j]=0; Pdcp_stats_tx_bytes[i][k][j]=0;
Pdcp_stats_tx_bytes_last[i][k][j]=0; Pdcp_stats_tx_bytes_last[i][k][j]=0;
Pdcp_stats_tx_rate[i][k][j]=0; Pdcp_stats_tx_rate[i][k][j]=0;
Pdcp_stats_rx[i][k][j]=0; Pdcp_stats_rx[i][k][j]=0;
Pdcp_stats_rx_bytes[i][k][j]=0; Pdcp_stats_rx_bytes[i][k][j]=0;
Pdcp_stats_rx_bytes_last[i][k][j]=0; Pdcp_stats_rx_bytes_last[i][k][j]=0;
Pdcp_stats_rx_rate[i][k][j]=0; Pdcp_stats_rx_rate[i][k][j]=0;
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
......
...@@ -69,8 +69,8 @@ public_pdcp(void pdcp_module_cleanup ();) ...@@ -69,8 +69,8 @@ public_pdcp(void pdcp_module_cleanup ();)
public_pdcp(void pdcp_layer_init ();) public_pdcp(void pdcp_layer_init ();)
public_pdcp(void pdcp_layer_cleanup ();) public_pdcp(void pdcp_layer_cleanup ();)
#define PDCP2NAS_FIFO 21 #define PDCP2NW_DRIVER_FIFO 21
#define NAS2PDCP_FIFO 22 #define NW_DRIVER2PDCP_FIFO 22
protected_pdcp_fifo(int pdcp_fifo_flush_sdus ();) protected_pdcp_fifo(int pdcp_fifo_flush_sdus ();)
protected_pdcp_fifo(int pdcp_fifo_read_input_sdus_remaining_bytes ();) protected_pdcp_fifo(int pdcp_fifo_read_input_sdus_remaining_bytes ();)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -149,10 +149,11 @@ void cleanup_pdcp_thread(void) ...@@ -149,10 +149,11 @@ void cleanup_pdcp_thread(void)
pdcp_instance_cnt = 0; pdcp_instance_cnt = 0;
if (pthread_cond_signal(&pdcp_cond) != 0) if (pthread_cond_signal(&pdcp_cond) != 0) {
LOG_I(PDCP,"ERROR pthread_cond_signal\n"); LOG_I(PDCP,"ERROR pthread_cond_signal\n");
else } else {
LOG_I(PDCP,"Signalled PDCP thread to exit\n"); LOG_I(PDCP,"Signalled PDCP thread to exit\n");
}
pthread_join(pdcp_thread,&status_p); pthread_join(pdcp_thread,&status_p);
LOG_I(PDCP,"PDCP thread exited\n"); LOG_I(PDCP,"PDCP thread exited\n");
......
...@@ -79,8 +79,9 @@ void util_print_hex_octets(comp_name_t component, unsigned char* data, unsigned ...@@ -79,8 +79,9 @@ void util_print_hex_octets(comp_name_t component, unsigned char* data, unsigned
*/ */
unsigned char index; unsigned char index;
for (index = octet_index; index < 16; ++index) for (index = octet_index; index < 16; ++index) {
LOG_T(component, " "); LOG_T(component, " ");
}
LOG_T(component, " \n"); LOG_T(component, " \n");
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -45,11 +45,10 @@ ...@@ -45,11 +45,10 @@
#include "umts_timer_proto_extern.h" #include "umts_timer_proto_extern.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_am_status_report_from_mac (void *rlcP, uint16_t eventP) rlc_am_status_report_from_mac (void* rlcP, uint16_t eventP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct rlc_am_entity* rlc = (struct rlc_am_entity*) rlcP;
struct rlc_am_entity *rlc = (struct rlc_am_entity *) rlcP;
//---------------------------------------- //----------------------------------------
// STATUS // STATUS
...@@ -83,11 +82,11 @@ rlc_am_status_report_from_mac (void *rlcP, uint16_t eventP) ...@@ -83,11 +82,11 @@ rlc_am_status_report_from_mac (void *rlcP, uint16_t eventP)
//---------------------------------------- //----------------------------------------
if ((eventP & RLC_AM_RESET_PDU_TYPE)) { if ((eventP & RLC_AM_RESET_PDU_TYPE)) {
#ifdef DEBUG_RESET #ifdef DEBUG_RESET
msg ("[RLC_AM %p][MAC_STATUS] EVENT RLC_AM_RESET_PDU_TYPE SENT ARMING RESET TIMER %d frames frame %d\n", rlcP, (uint32_t) rlc->timer_rst_init, *rlc->frame_tick_milliseconds); msg ("[RLC_AM %p][MAC_STATUS] EVENT RLC_AM_RESET_PDU_TYPE SENT ARMING RESET TIMER %d frames frame %d\n", rlcP, (uint32_t) rlc->timer_rst_init,
*rlc->frame_tick_milliseconds);
#endif #endif
rlc->timer_rst = umts_add_timer_list_up (&rlc->rlc_am_timer_list, rlc_am_reset_time_out, rlcP, NULL, (uint32_t) rlc->timer_rst_init,
rlc->timer_rst = umts_add_timer_list_up (&rlc->rlc_am_timer_list, rlc_am_reset_time_out, rlcP, NULL, (uint32_t) rlc->timer_rst_init, *rlc->frame_tick_milliseconds); *rlc->frame_tick_milliseconds);
return; return;
} }
...@@ -101,5 +100,4 @@ rlc_am_status_report_from_mac (void *rlcP, uint16_t eventP) ...@@ -101,5 +100,4 @@ rlc_am_status_report_from_mac (void *rlcP, uint16_t eventP)
rlc_am_fsm_notify_event (rlc, RLC_AM_TRANSMIT_RESET_ACK_EVENT); rlc_am_fsm_notify_event (rlc, RLC_AM_TRANSMIT_RESET_ACK_EVENT);
return; return;
} }
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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