Merge remote-tracking branch 'origin/develop' into feature-131-new-license

Conflicts:
	openair1/PHY/INIT/lte_init.c
	openair1/PHY/LTE_TRANSPORT/dci_tools.c
	openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
	openair1/SCHED/phy_procedures_lte_eNb.c
	openair1/SCHED/phy_procedures_lte_ue.c
	openair1/SIMULATION/LTE_PHY/dlsim.c
	openair1/SIMULATION/RF/adc.c
	openair2/LAYER2/MAC/lte_transport_init.c
	targets/RT/USER/lte-softmodem.c
	targets/RT/USER/sched_dlsch.c
	targets/RT/USER/sched_rx_pdsch.c
	targets/RT/USER/sched_ulsch.c
	targets/SIMU/USER/oaisim.c
This commit is contained in:
Cedric Roux
2016-09-27 15:05:00 +02:00
200 changed files with 22970 additions and 19972 deletions
+14 -9
View File
@@ -262,10 +262,10 @@ mac_rrc_data_req(
#endif //Rel10
} else { //This is an UE
#ifdef DEBUG_RRC
LOG_D(RRC,"[UE %d] Frame %d Filling CCCH SRB_ID %d\n",Mod_idP,frameP,Srb_id);
LOG_D(RRC,"[UE %d] Frame %d buffer_pP status %d,\n",Mod_idP,frameP, UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size);
#endif
if( (UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size > 0) ) {
@@ -368,6 +368,10 @@ mac_rrc_data_ind(
#endif
}
if(srb_idP == PCCH) {
LOG_D(RRC,"[UE %d] Received SDU for PCCH on SRB %d from eNB %d\n",module_idP,srb_idP,eNB_indexP);
decode_PCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t*)sduP,sdu_lenP);
}
if((srb_idP & RAB_OFFSET) == CCCH) {
if (sdu_lenP>0) {
LOG_T(RRC,"[UE %d] Received SDU for CCCH on SRB %d from eNB %d\n",module_idP,srb_idP & RAB_OFFSET,eNB_indexP);
@@ -648,13 +652,14 @@ void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
void rrc_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
{
//-------------------------------------------------------------------------------------------//
LOG_I(RRC,"[UE %d] Frame %d: OUT OF SYNC FROM eNB %d (T310 active %d : T310 %d, N310 %d, N311 %d)\n ",
Mod_idP,frameP,eNB_index,
UE_rrc_inst[Mod_idP].Info[eNB_index].T300_active,
UE_rrc_inst[Mod_idP].Info[eNB_index].T310_cnt,
UE_rrc_inst[Mod_idP].Info[eNB_index].N310_cnt,
UE_rrc_inst[Mod_idP].Info[eNB_index].N311_cnt);
if (UE_rrc_inst[Mod_idP].Info[eNB_index].N310_cnt>10)
LOG_I(RRC,"[UE %d] Frame %d: OUT OF SYNC FROM eNB %d (T310 active %d : T310 %d, N310 %d, N311 %d)\n ",
Mod_idP,frameP,eNB_index,
UE_rrc_inst[Mod_idP].Info[eNB_index].T300_active,
UE_rrc_inst[Mod_idP].Info[eNB_index].T310_cnt,
UE_rrc_inst[Mod_idP].Info[eNB_index].N310_cnt,
UE_rrc_inst[Mod_idP].Info[eNB_index].N311_cnt);
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
+1
View File
@@ -337,6 +337,7 @@ typedef struct eNB_RRC_UE_s {
#endif
uint32_t ul_failure_timer;
uint32_t ue_release_timer;
uint32_t ue_release_timer_thres;
} eNB_RRC_UE_t;
typedef uid_t ue_uid_t;
+6
View File
@@ -342,6 +342,12 @@ int decode_BCCH_DLSCH_Message(
const uint8_t rsrq,
const uint8_t rsrp );
int decode_PCCH_DLSCH_Message(
const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index,
uint8_t* const Sdu,
const uint8_t Sdu_len);
void
ue_meas_filtering(
const protocol_ctxt_t* const ctxt_pP,
+39 -5
View File
@@ -30,6 +30,7 @@
#include "UL-DCCH-Message.h"
#include "DL-DCCH-Message.h"
#include "BCCH-DL-SCH-Message.h"
#include "PCCH-Message.h"
#ifdef Rel10
#include "MCCH-Message.h"
#endif
@@ -2435,6 +2436,39 @@ int decode_BCCH_DLSCH_Message(
return 0;
}
//-----------------------------------------------------------------------------
int decode_PCCH_DLSCH_Message(
const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index,
uint8_t* const Sdu,
const uint8_t Sdu_len)
{
PCCH_Message_t *pcch_message = NULL;
int i;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_IN );
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_PCCH_Message,
(void **)&pcch_message,
(const void *)Sdu,
Sdu_len );
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E( RRC, "[UE %"PRIu8"] Failed to decode PCCH_MESSAGE (%zu bits)\n",
ctxt_pP->module_id,
dec_rval.consumed );
for (i=0;i<Sdu_len;i++)
printf("%02x ",Sdu[i]);
printf("\n");
// free the memory
SEQUENCE_free( &asn_DEF_PCCH_Message, (void*)pcch_message, 1 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_OUT );
return -1;
}
return(0);
}
//-----------------------------------------------------------------------------
static int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t rsrq, const uint8_t rsrp )
@@ -3439,7 +3473,7 @@ void ue_meas_filtering( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
UE_rrc_inst[ctxt_pP->module_id].rsrp_db[eNB_offset] =
(dB_fixed_times10(mac_xface->get_RSRP(ctxt_pP->module_id,0,eNB_offset))/10.0) -
mac_xface->get_rx_total_gain_dB(ctxt_pP->module_id,0) -
dB_fixed(mac_xface->lte_frame_parms->N_RB_DL*12);
dB_fixed(mac_xface->frame_parms->N_RB_DL*12);
UE_rrc_inst[ctxt_pP->module_id].rsrp_db_filtered[eNB_offset] =
(1.0-a)*UE_rrc_inst[ctxt_pP->module_id].rsrp_db_filtered[eNB_offset] +
a*UE_rrc_inst[ctxt_pP->module_id].rsrp_db[eNB_offset];
@@ -3450,7 +3484,7 @@ void ue_meas_filtering( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
LOG_D(RRC,"RSRP_dBm: %3.2f \n",(dB_fixed_times10(mac_xface->get_RSRP(ctxt_pP->module_id,0,eNB_offset))/10.0));
LOG_D(RRC,"gain_loss_dB: %d \n",mac_xface->get_rx_total_gain_dB(ctxt_pP->module_id,0));
LOG_D(RRC,"gain_fixed_dB: %d \n",dB_fixed(mac_xface->lte_frame_parms->N_RB_DL*12));
LOG_D(RRC,"gain_fixed_dB: %d \n",dB_fixed(mac_xface->frame_parms->N_RB_DL*12));
LOG_D(PHY,"[UE %d] Frame %d, RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB)\n",
ctxt_pP->module_id,
ctxt_pP->frame,
@@ -3708,7 +3742,7 @@ static uint8_t check_trigger_meas_event(
TimeToTrigger_t ttt )
{
uint8_t eNB_offset;
uint8_t currentCellIndex = mac_xface->lte_frame_parms->Nid_cell;
uint8_t currentCellIndex = mac_xface->frame_parms->Nid_cell;
uint8_t tmp_offset;
LOG_I(RRC,"[UE %d] ofn(%d) ocn(%d) hys(%d) ofs(%d) ocs(%d) a3_offset(%d) ttt(%d) rssi %3.1f\n",
@@ -3741,9 +3775,9 @@ static uint8_t check_trigger_meas_event(
LOG_D(RRC,"[UE %d] Frame %d eNB %d: Handover triggered: targetCellId: %d currentCellId: %d eNB_offset: %d rsrp source: %3.1f rsrp target: %3.1f\n", \
ue_mod_idP, frameP, eNB_index,
UE_rrc_inst->HandoverInfoUe.targetCellId,ue_cnx_index,eNB_offset,
(dB_fixed_times10(UE_rrc_inst[ue_mod_idP].rsrp_db[0])/10.0)-mac_xface->get_rx_total_gain_dB(ue_mod_idP,0)-dB_fixed(mac_xface->lte_frame_parms->N_RB_DL*12),
(dB_fixed_times10(UE_rrc_inst[ue_mod_idP].rsrp_db[0])/10.0)-mac_xface->get_rx_total_gain_dB(ue_mod_idP,0)-dB_fixed(mac_xface->frame_parms->N_RB_DL*12),
(dB_fixed_times10(UE_rrc_inst[ue_mod_idP].rsrp_db[eNB_offset])/10.0)-mac_xface->get_rx_total_gain_dB(ue_mod_idP,
0)-dB_fixed(mac_xface->lte_frame_parms->N_RB_DL*12));
0)-dB_fixed(mac_xface->frame_parms->N_RB_DL*12));
UE_rrc_inst->Info[0].handoverTarget = eNB_offset;
//LOG_D(RRC,"PHY_ID: %d \n",UE_rrc_inst->HandoverInfoUe.targetCellId);
return 1;
+15 -2
View File
@@ -496,6 +496,19 @@ rrc_rx_tx(
// check for UL failure
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) {
if ((ctxt_pP->frame == 0) && (ctxt_pP->subframe==0)) {
if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == TRUE) {
LOG_I(RRC,"UE rnti %x:S-TMSI %x failure timer %d/20000\n",
ue_context_p->ue_context.rnti,
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
ue_context_p->ue_context.ul_failure_timer);
}
else {
LOG_I(RRC,"UE rnti %x failure timer %d/20000\n",
ue_context_p->ue_context.rnti,
ue_context_p->ue_context.ul_failure_timer);
}
}
if (ue_context_p->ue_context.ul_failure_timer>0) {
ue_context_p->ue_context.ul_failure_timer++;
if (ue_context_p->ue_context.ul_failure_timer >= 20000) {
@@ -507,8 +520,8 @@ rrc_rx_tx(
}
if (ue_context_p->ue_context.ue_release_timer>0) {
ue_context_p->ue_context.ue_release_timer++;
if (ue_context_p->ue_context.ue_release_timer >= 100) {
// remove UE after 10 frames after RRCConnectionRelease is triggered
if (ue_context_p->ue_context.ue_release_timer >=
ue_context_p->ue_context.ue_release_timer_thres) {
LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti);
ue_to_be_removed = ue_context_p;
break;
+20 -11
View File
@@ -164,7 +164,7 @@ init_SI(
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB1 = do_SIB1(
ctxt_pP->module_id,
CC_id,
mac_xface->lte_frame_parms,
mac_xface->frame_parms,
(uint8_t*)eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SIB1,
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].siblock1,
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib1
@@ -194,7 +194,7 @@ init_SI(
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB23 = do_SIB23(
ctxt_pP->module_id,
CC_id,
mac_xface->lte_frame_parms,
mac_xface->frame_parms,
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SIB23,
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].systemInformation,
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib2,
@@ -360,7 +360,7 @@ init_MCCH(
mac_xface->macphy_exit("[RRC][init_MCCH] not enough memory\n");
} else {
eNB_rrc_inst[enb_mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[sync_area] = do_MBSFNAreaConfig(enb_mod_idP,
mac_xface->lte_frame_parms,
mac_xface->frame_parms,
sync_area,
(uint8_t *)eNB_rrc_inst[enb_mod_idP].carrier[CC_id].MCCH_MESSAGE[sync_area],
&eNB_rrc_inst[enb_mod_idP].carrier[CC_id].mcch,
@@ -542,7 +542,7 @@ rrc_eNB_ue_context_stmsi_exist(
m_tmsiP, mme_codeP, ue_context_p,
ue_context_p->ue_context.rnti);
if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == TRUE) {
printf("S-TMSI %x, MME %x\n",
printf("=> S-TMSI %x, MME %x\n",
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code);
if (ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi == m_tmsiP)
@@ -1084,7 +1084,8 @@ rrc_eNB_generate_RRCConnectionRelease(
size = do_RRCConnectionRelease(ctxt_pP->module_id, buffer,rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id));
// set release timer
ue_context_pP->ue_context.ue_release_timer=1;
// remove UE after 10 frames after RRCConnectionRelease is triggered
ue_context_pP->ue_context.ue_release_timer_thres=100;
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate RRCConnectionRelease (bytes %d)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
@@ -2708,11 +2709,11 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
physicalConfigDedicated2->schedulingRequestConfig->present = SchedulingRequestConfig_PR_setup;
physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = ue_context_pP->local_uid;
if (mac_xface->lte_frame_parms->frame_type == 0) { // FDD
if (mac_xface->frame_parms->frame_type == 0) { // FDD
physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 5 + (ue_context_pP->local_uid %
10); // Isr = 5 (every 10 subframes, offset=2+UE_id mod3)
} else {
switch (mac_xface->lte_frame_parms->tdd_config) {
switch (mac_xface->frame_parms->tdd_config) {
case 1:
physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 7 + (ue_context_pP->local_uid & 1) + ((
ue_context_pP->local_uid & 3) >> 1) * 5; // Isr = 5 (every 10 subframes, offset=2 for UE0, 3 for UE1, 7 for UE2, 8 for UE3 , 2 for UE4 etc..)
@@ -3706,6 +3707,7 @@ rrc_eNB_generate_RRCConnectionSetup(
SRB_ToAddModList_t **SRB_configList;
SRB_ToAddMod_t *SRB1_config;
int cnt;
LTE_DL_FRAME_PARMS *fp = mac_xface->get_lte_frame_parms(ctxt_pP->module_id,CC_id);
T(T_ENB_RRC_CONNECTION_SETUP, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
@@ -3715,9 +3717,9 @@ rrc_eNB_generate_RRCConnectionSetup(
do_RRCConnectionSetup(ctxt_pP,
ue_context_pP,
(uint8_t*) eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.Payload,
(mac_xface->lte_frame_parms->nb_antennas_tx_eNB==2)?2:1, //at this point we do not have the UE capability information, so it can only be TM1 or TM2
(fp->nb_antennas_tx_eNB==2)?2:1, //at this point we do not have the UE capability information, so it can only be TM1 or TM2
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id),
mac_xface->lte_frame_parms,
fp,
SRB_configList,
&ue_context_pP->ue_context.physicalConfigDedicated);
@@ -3802,6 +3804,10 @@ rrc_eNB_generate_RRCConnectionSetup(
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size);
// activate release timer, if RRCSetupComplete not received after 10 frames, remove UE
ue_context_pP->ue_context.ue_release_timer=1;
// remove UE after 10 frames after RRCConnectionRelease is triggered
ue_context_pP->ue_context.ue_release_timer_thres=100;
}
#if defined(ENABLE_ITTI)
@@ -4164,7 +4170,7 @@ rrc_eNB_decode_ccch(
if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) {
//#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)"
LOG_I(RRC," S-TMSI exists, ue_context_p %p\n",ue_context_p);
LOG_I(RRC," S-TMSI exists, ue_context_p %p, old rnti %x => %x\n",ue_context_p,ue_context_p->ue_context.rnti,ctxt_pP->rnti);
stmsi_received=1;
/* replace rnti in the context */
/* for that, remove the context from the RB tree */
@@ -4179,6 +4185,7 @@ rrc_eNB_decode_ccch(
// AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
// ue_context_p = NULL;
} else {
LOG_I(RRC," S-TMSI doesn't exist, setting Initialue_identity_s_TMSI.m_tmsi to %x => %x\n",ue_context_p,m_tmsi);
ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, NOT_A_RANDOM_UE_IDENTITY);
if (ue_context_p == NULL)
LOG_E(RRC, "%s:%d:%s: rrc_eNB_get_next_free_ue_context returned NULL\n", __FILE__, __LINE__, __FUNCTION__);
@@ -4250,6 +4257,7 @@ rrc_eNB_decode_ccch(
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Can't create new context for UE random UE identity (0x%" PRIx64 ")\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
random_value);
rrc_mac_remove_ue(ctxt_pP->module_id,ctxt_pP->rnti);
return -1;
}
}
@@ -4599,6 +4607,7 @@ rrc_eNB_decode_dcch(
}
}
ue_context_p->ue_context.ue_release_timer=0;
break;
case UL_DCCH_MessageType__c1_PR_securityModeComplete:
@@ -4608,7 +4617,7 @@ rrc_eNB_decode_dcch(
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"[MSG] RRC Security Mode Complete\n");
for (i = 0; i < sdu_sizeP; i++) {
for (i = 0; i < sdu_sizeP; i++) eNB->pusch_vars[UE_id]{
LOG_F(RRC,"%02x ", ((uint8_t*)Rx_sdu)[i]);
}