merge nfapi_cleanup
This commit is contained in:
+826
-869
File diff suppressed because it is too large
Load Diff
+330
-411
File diff suppressed because it is too large
Load Diff
+272
-278
@@ -32,12 +32,12 @@
|
||||
|
||||
#include "COMMON/platform_types.h"
|
||||
#include "COMMON/platform_constants.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "SCHED_UE/sched_UE.h"
|
||||
#include "LTE_SystemInformationBlockType2.h"
|
||||
//#include "RadioResourceConfigCommonSIB.h"
|
||||
#include "LTE_RadioResourceConfigDedicated.h"
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
|
||||
#include "LTE_PRACH-ConfigSIB-v1310.h"
|
||||
#include "LTE_PRACH-ConfigSIB-v1310.h"
|
||||
#endif
|
||||
#include "LTE_MeasGapConfig.h"
|
||||
#include "LTE_MeasObjectToAddModList.h"
|
||||
@@ -52,51 +52,38 @@
|
||||
|
||||
#include "common/ran_context.h"
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
#include "LTE_MBSFN-AreaInfoList-r9.h"
|
||||
#include "LTE_MBSFN-AreaInfo-r9.h"
|
||||
#include "LTE_MBSFN-SubframeConfigList.h"
|
||||
#include "LTE_PMCH-InfoList-r9.h"
|
||||
#include "LTE_MBSFN-AreaInfoList-r9.h"
|
||||
#include "LTE_MBSFN-AreaInfo-r9.h"
|
||||
#include "LTE_MBSFN-SubframeConfigList.h"
|
||||
#include "LTE_PMCH-InfoList-r9.h"
|
||||
#endif
|
||||
|
||||
extern void mac_init_cell_params(int Mod_idP,int CC_idP);
|
||||
extern void phy_reset_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
|
||||
/* sec 5.9, 36.321: MAC Reset Procedure */
|
||||
void ue_mac_reset(module_id_t module_idP, uint8_t eNB_index)
|
||||
{
|
||||
|
||||
void ue_mac_reset(module_id_t module_idP, uint8_t eNB_index) {
|
||||
//Resetting Bj
|
||||
UE_mac_inst[module_idP].scheduling_info.Bj[0] = 0;
|
||||
UE_mac_inst[module_idP].scheduling_info.Bj[1] = 0;
|
||||
UE_mac_inst[module_idP].scheduling_info.Bj[2] = 0;
|
||||
|
||||
//Stopping all timers
|
||||
|
||||
//timeAlignmentTimer expires
|
||||
|
||||
// PHY changes for UE MAC reset
|
||||
phy_reset_ue(module_idP, 0, eNB_index);
|
||||
|
||||
// notify RRC to relase PUCCH/SRS
|
||||
// cancel all pending SRs
|
||||
UE_mac_inst[module_idP].scheduling_info.SR_pending = 0;
|
||||
UE_mac_inst[module_idP].scheduling_info.SR_COUNTER = 0;
|
||||
|
||||
//Set BSR Trigger Bmp and remove timer flags
|
||||
UE_mac_inst[module_idP].BSR_reporting_active = BSR_TRIGGER_NONE;
|
||||
|
||||
// stop ongoing RACH procedure
|
||||
|
||||
// discard explicitly signaled ra_PreambleIndex and ra_RACH_MaskIndex, if any
|
||||
UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex = 0; // check!
|
||||
UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex = 0; // check!
|
||||
UE_mac_inst[module_idP].RA_prach_resources.ra_RACH_MaskIndex = 0;
|
||||
|
||||
|
||||
ue_init_mac(module_idP); //This will hopefully do the rest of the MAC reset procedure
|
||||
|
||||
ue_init_mac(module_idP); //This will hopefully do the rest of the MAC reset procedure
|
||||
}
|
||||
|
||||
int32_t **rxdata;
|
||||
@@ -105,209 +92,207 @@ int32_t **txdata;
|
||||
|
||||
int
|
||||
rrc_mac_config_req_ue(module_id_t Mod_idP,
|
||||
int CC_idP,
|
||||
uint8_t eNB_index,
|
||||
LTE_RadioResourceConfigCommonSIB_t *
|
||||
radioResourceConfigCommon,
|
||||
struct LTE_PhysicalConfigDedicated
|
||||
*physicalConfigDedicated,
|
||||
int CC_idP,
|
||||
uint8_t eNB_index,
|
||||
LTE_RadioResourceConfigCommonSIB_t *
|
||||
radioResourceConfigCommon,
|
||||
struct LTE_PhysicalConfigDedicated
|
||||
*physicalConfigDedicated,
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
LTE_SCellToAddMod_r10_t * sCellToAddMod_r10,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
LTE_SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
#endif
|
||||
LTE_MeasObjectToAddMod_t ** measObj,
|
||||
LTE_MAC_MainConfig_t * mac_MainConfig,
|
||||
long logicalChannelIdentity,
|
||||
LTE_LogicalChannelConfig_t * logicalChannelConfig,
|
||||
LTE_MeasGapConfig_t * measGapConfig,
|
||||
LTE_TDD_Config_t * tdd_Config,
|
||||
LTE_MobilityControlInfo_t * mobilityControlInfo,
|
||||
uint8_t * SIwindowsize,
|
||||
uint16_t * SIperiod,
|
||||
LTE_ARFCN_ValueEUTRA_t * ul_CarrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
LTE_AdditionalSpectrumEmission_t *
|
||||
additionalSpectrumEmission,
|
||||
struct LTE_MBSFN_SubframeConfigList
|
||||
*mbsfn_SubframeConfigList
|
||||
LTE_MeasObjectToAddMod_t **measObj,
|
||||
LTE_MAC_MainConfig_t *mac_MainConfig,
|
||||
long logicalChannelIdentity,
|
||||
LTE_LogicalChannelConfig_t *logicalChannelConfig,
|
||||
LTE_MeasGapConfig_t *measGapConfig,
|
||||
LTE_TDD_Config_t *tdd_Config,
|
||||
LTE_MobilityControlInfo_t *mobilityControlInfo,
|
||||
uint8_t *SIwindowsize,
|
||||
uint16_t *SIperiod,
|
||||
LTE_ARFCN_ValueEUTRA_t *ul_CarrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
LTE_AdditionalSpectrumEmission_t *
|
||||
additionalSpectrumEmission,
|
||||
struct LTE_MBSFN_SubframeConfigList
|
||||
*mbsfn_SubframeConfigList
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
, uint8_t MBMS_Flag,
|
||||
LTE_MBSFN_AreaInfoList_r9_t * mbsfn_AreaInfoList,
|
||||
LTE_PMCH_InfoList_r9_t * pmch_InfoList
|
||||
, uint8_t MBMS_Flag,
|
||||
LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
|
||||
LTE_PMCH_InfoList_r9_t *pmch_InfoList
|
||||
#endif
|
||||
#ifdef CBA
|
||||
, uint8_t num_active_cba_groups, uint16_t cba_rnti
|
||||
, uint8_t num_active_cba_groups, uint16_t cba_rnti
|
||||
#endif
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,config_action_t config_action
|
||||
,const uint32_t * const sourceL2Id
|
||||
,const uint32_t * const destinationL2Id
|
||||
,const uint32_t *const sourceL2Id
|
||||
,const uint32_t *const destinationL2Id
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
||||
) {
|
||||
int i;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
|
||||
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
|
||||
LOG_I(MAC, "[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",
|
||||
Mod_idP, eNB_index);
|
||||
Mod_idP, eNB_index);
|
||||
|
||||
if (tdd_Config != NULL) {
|
||||
UE_mac_inst[Mod_idP].tdd_Config = tdd_Config;
|
||||
}
|
||||
|
||||
|
||||
if (tdd_Config && SIwindowsize && SIperiod) {
|
||||
phy_config_sib1_ue(Mod_idP, 0, eNB_index, tdd_Config,
|
||||
*SIwindowsize, *SIperiod);
|
||||
*SIwindowsize, *SIperiod);
|
||||
}
|
||||
|
||||
if (radioResourceConfigCommon != NULL) {
|
||||
UE_mac_inst[Mod_idP].radioResourceConfigCommon =
|
||||
radioResourceConfigCommon;
|
||||
phy_config_sib2_ue(Mod_idP, 0, eNB_index,
|
||||
radioResourceConfigCommon, ul_CarrierFreq,
|
||||
ul_Bandwidth, additionalSpectrumEmission,
|
||||
mbsfn_SubframeConfigList);
|
||||
radioResourceConfigCommon, ul_CarrierFreq,
|
||||
ul_Bandwidth, additionalSpectrumEmission,
|
||||
mbsfn_SubframeConfigList);
|
||||
}
|
||||
|
||||
// SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
|
||||
if (logicalChannelConfig != NULL) {
|
||||
LOG_I(MAC,
|
||||
"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",
|
||||
Mod_idP, eNB_index);
|
||||
"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",
|
||||
Mod_idP, eNB_index);
|
||||
UE_mac_inst[Mod_idP].logicalChannelConfig[logicalChannelIdentity] =
|
||||
logicalChannelConfig;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity] = 0; // initilize the bucket for this lcid
|
||||
|
||||
UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity] = 0; // initilize the bucket for this lcid
|
||||
AssertFatal(logicalChannelConfig->ul_SpecificParameters != NULL,
|
||||
"[UE %d] LCID %ld NULL ul_SpecificParameters\n",
|
||||
Mod_idP, logicalChannelIdentity);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.bucket_size[logicalChannelIdentity] = logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate * logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration; // set the max bucket size
|
||||
"[UE %d] LCID %ld NULL ul_SpecificParameters\n",
|
||||
Mod_idP, logicalChannelIdentity);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.bucket_size[logicalChannelIdentity] = logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate *
|
||||
logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration; // set the max bucket size
|
||||
|
||||
if (logicalChannelConfig->ul_SpecificParameters->
|
||||
logicalChannelGroup != NULL) {
|
||||
logicalChannelGroup != NULL) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.
|
||||
LCGID[logicalChannelIdentity] =
|
||||
*logicalChannelConfig->ul_SpecificParameters->
|
||||
logicalChannelGroup;
|
||||
LCGID[logicalChannelIdentity] =
|
||||
*logicalChannelConfig->ul_SpecificParameters->
|
||||
logicalChannelGroup;
|
||||
LOG_D(MAC,
|
||||
"[CONFIG][UE %d] LCID %ld is attached to the LCGID %ld\n",
|
||||
Mod_idP, logicalChannelIdentity,
|
||||
*logicalChannelConfig->
|
||||
ul_SpecificParameters->logicalChannelGroup);
|
||||
"[CONFIG][UE %d] LCID %ld is attached to the LCGID %ld\n",
|
||||
Mod_idP, logicalChannelIdentity,
|
||||
*logicalChannelConfig->
|
||||
ul_SpecificParameters->logicalChannelGroup);
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.
|
||||
LCGID[logicalChannelIdentity] = MAX_NUM_LCGID;
|
||||
LCGID[logicalChannelIdentity] = MAX_NUM_LCGID;
|
||||
}
|
||||
|
||||
UE_mac_inst[Mod_idP].
|
||||
scheduling_info.LCID_buffer_remain[logicalChannelIdentity] = 0;
|
||||
scheduling_info.LCID_buffer_remain[logicalChannelIdentity] = 0;
|
||||
}
|
||||
|
||||
if (mac_MainConfig != NULL) {
|
||||
LOG_I(MAC,
|
||||
"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",
|
||||
Mod_idP, eNB_index);
|
||||
"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",
|
||||
Mod_idP, eNB_index);
|
||||
UE_mac_inst[Mod_idP].macConfig = mac_MainConfig;
|
||||
UE_mac_inst[Mod_idP].measGapConfig = measGapConfig;
|
||||
|
||||
if (mac_MainConfig->ul_SCH_Config) {
|
||||
|
||||
if (mac_MainConfig->ul_SCH_Config->periodicBSR_Timer) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer =
|
||||
(uint16_t) *
|
||||
mac_MainConfig->ul_SCH_Config->periodicBSR_Timer;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer =
|
||||
(uint16_t) *
|
||||
mac_MainConfig->ul_SCH_Config->periodicBSR_Timer;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer =
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer =
|
||||
#if (LTE_RRC_VERSION < MAKE_VERSION(12, 0, 0))
|
||||
(uint16_t)
|
||||
LTE_MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity
|
||||
(uint16_t)
|
||||
LTE_MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity
|
||||
#else
|
||||
(uint16_t) LTE_PeriodicBSR_Timer_r12_infinity;
|
||||
(uint16_t) LTE_PeriodicBSR_Timer_r12_infinity;
|
||||
#endif
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
if (mac_MainConfig->ul_SCH_Config->maxHARQ_Tx) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx =
|
||||
(uint16_t) * mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx =
|
||||
(uint16_t) * mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx =
|
||||
(uint16_t)
|
||||
LTE_MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx =
|
||||
(uint16_t)
|
||||
LTE_MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
|
||||
}
|
||||
if(nfapi_mode!=3)
|
||||
|
||||
if(NFAPI_MODE != NFAPI_UE_STUB_PNF)
|
||||
phy_config_harq_ue(Mod_idP, 0, eNB_index,
|
||||
UE_mac_inst[Mod_idP].
|
||||
scheduling_info.maxHARQ_Tx);
|
||||
UE_mac_inst[Mod_idP].
|
||||
scheduling_info.maxHARQ_Tx);
|
||||
|
||||
if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer =
|
||||
(uint16_t) mac_MainConfig->ul_SCH_Config->
|
||||
retxBSR_Timer;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer =
|
||||
(uint16_t) mac_MainConfig->ul_SCH_Config->
|
||||
retxBSR_Timer;
|
||||
} else {
|
||||
#if (LTE_RRC_VERSION < MAKE_VERSION(12, 0, 0))
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer =
|
||||
(uint16_t)
|
||||
LTE_MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer =
|
||||
(uint16_t)
|
||||
LTE_MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
|
||||
#else
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer =
|
||||
(uint16_t) LTE_RetxBSR_Timer_r12_sf2560;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer =
|
||||
(uint16_t) LTE_RetxBSR_Timer_r12_sf2560;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
if (mac_MainConfig->ext1
|
||||
&& mac_MainConfig->ext1->sr_ProhibitTimer_r9) {
|
||||
&& mac_MainConfig->ext1->sr_ProhibitTimer_r9) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer =
|
||||
(uint16_t) * mac_MainConfig->ext1->sr_ProhibitTimer_r9;
|
||||
(uint16_t) * mac_MainConfig->ext1->sr_ProhibitTimer_r9;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = 0;
|
||||
}
|
||||
|
||||
if (mac_MainConfig->ext2
|
||||
&& mac_MainConfig->ext2->mac_MainConfig_v1020) {
|
||||
&& mac_MainConfig->ext2->mac_MainConfig_v1020) {
|
||||
if (mac_MainConfig->ext2->
|
||||
mac_MainConfig_v1020->extendedBSR_Sizes_r10) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.
|
||||
extendedBSR_Sizes_r10 =
|
||||
(uint16_t) *
|
||||
mac_MainConfig->ext2->
|
||||
mac_MainConfig_v1020->extendedBSR_Sizes_r10;
|
||||
mac_MainConfig_v1020->extendedBSR_Sizes_r10) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.
|
||||
extendedBSR_Sizes_r10 =
|
||||
(uint16_t) *
|
||||
mac_MainConfig->ext2->
|
||||
mac_MainConfig_v1020->extendedBSR_Sizes_r10;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.
|
||||
extendedBSR_Sizes_r10 = (uint16_t) 0;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.
|
||||
extendedBSR_Sizes_r10 = (uint16_t) 0;
|
||||
}
|
||||
|
||||
if (mac_MainConfig->ext2->mac_MainConfig_v1020->
|
||||
extendedPHR_r10) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 =
|
||||
(uint16_t) *
|
||||
mac_MainConfig->ext2->mac_MainConfig_v1020->
|
||||
extendedPHR_r10;
|
||||
extendedPHR_r10) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 =
|
||||
(uint16_t) *
|
||||
mac_MainConfig->ext2->mac_MainConfig_v1020->
|
||||
extendedPHR_r10;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 =
|
||||
(uint16_t) 0;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 =
|
||||
(uint16_t) 0;
|
||||
}
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.extendedBSR_Sizes_r10 =
|
||||
(uint16_t) 0;
|
||||
(uint16_t) 0;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 =
|
||||
(uint16_t) 0;
|
||||
(uint16_t) 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF =
|
||||
MAC_UE_BSR_TIMER_NOT_RUNNING;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF =
|
||||
MAC_UE_BSR_TIMER_NOT_RUNNING;
|
||||
|
||||
UE_mac_inst[Mod_idP].BSR_reporting_active = BSR_TRIGGER_NONE;
|
||||
|
||||
LOG_D(MAC, "[UE %d]: periodic BSR %d (SF), retx BSR %d (SF)\n",
|
||||
Mod_idP,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF);
|
||||
|
||||
Mod_idP,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.drx_config =
|
||||
mac_MainConfig->drx_Config;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.phr_config =
|
||||
@@ -315,62 +300,62 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
|
||||
|
||||
if (mac_MainConfig->phr_Config) {
|
||||
UE_mac_inst[Mod_idP].PHR_state =
|
||||
mac_MainConfig->phr_Config->present;
|
||||
mac_MainConfig->phr_Config->present;
|
||||
UE_mac_inst[Mod_idP].PHR_reconfigured = 1;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer =
|
||||
mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer;
|
||||
mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer =
|
||||
mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer;
|
||||
mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange =
|
||||
mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange;
|
||||
mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].PHR_reconfigured = 0;
|
||||
UE_mac_inst[Mod_idP].PHR_state =
|
||||
LTE_MAC_MainConfig__phr_Config_PR_setup;
|
||||
LTE_MAC_MainConfig__phr_Config_PR_setup;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer =
|
||||
LTE_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
|
||||
LTE_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer =
|
||||
LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
|
||||
LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange =
|
||||
LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1;
|
||||
LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1;
|
||||
}
|
||||
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF =
|
||||
get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_idP].
|
||||
scheduling_info.periodicPHR_Timer);
|
||||
scheduling_info.periodicPHR_Timer);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF =
|
||||
get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_idP].
|
||||
scheduling_info.prohibitPHR_Timer);
|
||||
scheduling_info.prohibitPHR_Timer);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db =
|
||||
get_db_dl_PathlossChange(UE_mac_inst[Mod_idP].
|
||||
scheduling_info.PathlossChange);
|
||||
scheduling_info.PathlossChange);
|
||||
UE_mac_inst[Mod_idP].PHR_reporting_active = 0;
|
||||
LOG_D(MAC,
|
||||
"[UE %d] config PHR (%d): periodic %d (SF) prohibit %d (SF) pathlosschange %d (db) \n",
|
||||
Mod_idP,
|
||||
(mac_MainConfig->phr_Config) ? mac_MainConfig->
|
||||
phr_Config->present : -1,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db);
|
||||
"[UE %d] config PHR (%d): periodic %d (SF) prohibit %d (SF) pathlosschange %d (db) \n",
|
||||
Mod_idP,
|
||||
(mac_MainConfig->phr_Config) ? mac_MainConfig->
|
||||
phr_Config->present : -1,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db);
|
||||
}
|
||||
|
||||
|
||||
if (physicalConfigDedicated != NULL) {
|
||||
if(nfapi_mode!=3)
|
||||
if(NFAPI_MODE != NFAPI_UE_STUB_PNF)
|
||||
phy_config_dedicated_ue(Mod_idP, 0, eNB_index,
|
||||
physicalConfigDedicated);
|
||||
UE_mac_inst[Mod_idP].physicalConfigDedicated = physicalConfigDedicated; // for SR proc
|
||||
physicalConfigDedicated);
|
||||
|
||||
UE_mac_inst[Mod_idP].physicalConfigDedicated = physicalConfigDedicated; // for SR proc
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
if (sCellToAddMod_r10 != NULL) {
|
||||
|
||||
|
||||
phy_config_dedicated_scell_ue(Mod_idP, eNB_index,
|
||||
sCellToAddMod_r10, 1);
|
||||
UE_mac_inst[Mod_idP].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0
|
||||
sCellToAddMod_r10, 1);
|
||||
UE_mac_inst[Mod_idP].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (measObj != NULL) {
|
||||
@@ -378,104 +363,104 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
|
||||
measObj[0]->measObject.present == LTE_MeasObjectToAddMod__measObject_PR_measObjectEUTRA &&
|
||||
measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList != NULL) {
|
||||
UE_mac_inst[Mod_idP].n_adj_cells =
|
||||
measObj[0]->measObject.choice.
|
||||
measObjectEUTRA.cellsToAddModList->list.count;
|
||||
measObj[0]->measObject.choice.
|
||||
measObjectEUTRA.cellsToAddModList->list.count;
|
||||
LOG_I(MAC, "Number of adjacent cells %d\n",
|
||||
UE_mac_inst[Mod_idP].n_adj_cells);
|
||||
UE_mac_inst[Mod_idP].n_adj_cells);
|
||||
|
||||
for (i = 0; i < UE_mac_inst[Mod_idP].n_adj_cells; i++) {
|
||||
UE_mac_inst[Mod_idP].adj_cell_id[i] =
|
||||
measObj[0]->measObject.choice.
|
||||
measObjectEUTRA.cellsToAddModList->list.array[i]->
|
||||
physCellId;
|
||||
LOG_I(MAC, "Cell %d : Nid_cell %d\n", i,
|
||||
UE_mac_inst[Mod_idP].adj_cell_id[i]);
|
||||
UE_mac_inst[Mod_idP].adj_cell_id[i] =
|
||||
measObj[0]->measObject.choice.
|
||||
measObjectEUTRA.cellsToAddModList->list.array[i]->
|
||||
physCellId;
|
||||
LOG_I(MAC, "Cell %d : Nid_cell %d\n", i,
|
||||
UE_mac_inst[Mod_idP].adj_cell_id[i]);
|
||||
}
|
||||
|
||||
phy_config_meas_ue(Mod_idP, 0, eNB_index,
|
||||
UE_mac_inst[Mod_idP].n_adj_cells,
|
||||
UE_mac_inst[Mod_idP].adj_cell_id);
|
||||
UE_mac_inst[Mod_idP].n_adj_cells,
|
||||
UE_mac_inst[Mod_idP].adj_cell_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mobilityControlInfo != NULL) {
|
||||
|
||||
LOG_D(MAC, "[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",
|
||||
Mod_idP, eNB_index);
|
||||
Mod_idP, eNB_index);
|
||||
ue_mac_reset(Mod_idP, eNB_index);
|
||||
|
||||
if (mobilityControlInfo->radioResourceConfigCommon.
|
||||
rach_ConfigCommon) {
|
||||
rach_ConfigCommon) {
|
||||
memcpy((void *)
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
rach_ConfigCommon,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.rach_ConfigCommon,
|
||||
sizeof(LTE_RACH_ConfigCommon_t));
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
rach_ConfigCommon,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.rach_ConfigCommon,
|
||||
sizeof(LTE_RACH_ConfigCommon_t));
|
||||
}
|
||||
|
||||
memcpy((void *) &UE_mac_inst[Mod_idP].
|
||||
radioResourceConfigCommon->prach_Config.prach_ConfigInfo,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.prach_Config.prach_ConfigInfo,
|
||||
sizeof(LTE_PRACH_ConfigInfo_t));
|
||||
radioResourceConfigCommon->prach_Config.prach_ConfigInfo,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.prach_Config.prach_ConfigInfo,
|
||||
sizeof(LTE_PRACH_ConfigInfo_t));
|
||||
UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
prach_Config.rootSequenceIndex =
|
||||
prach_Config.rootSequenceIndex =
|
||||
mobilityControlInfo->radioResourceConfigCommon.
|
||||
prach_Config.rootSequenceIndex;
|
||||
|
||||
if (mobilityControlInfo->radioResourceConfigCommon.
|
||||
pdsch_ConfigCommon) {
|
||||
pdsch_ConfigCommon) {
|
||||
memcpy((void *)
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
pdsch_ConfigCommon,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.pdsch_ConfigCommon,
|
||||
sizeof(LTE_PDSCH_ConfigCommon_t));
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
pdsch_ConfigCommon,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.pdsch_ConfigCommon,
|
||||
sizeof(LTE_PDSCH_ConfigCommon_t));
|
||||
}
|
||||
|
||||
// not a pointer: mobilityControlInfo->radioResourceConfigCommon.pusch_ConfigCommon
|
||||
memcpy((void *) &UE_mac_inst[Mod_idP].
|
||||
radioResourceConfigCommon->pusch_ConfigCommon,
|
||||
(void *) &mobilityControlInfo->
|
||||
radioResourceConfigCommon.pusch_ConfigCommon,
|
||||
sizeof(LTE_PUSCH_ConfigCommon_t));
|
||||
radioResourceConfigCommon->pusch_ConfigCommon,
|
||||
(void *) &mobilityControlInfo->
|
||||
radioResourceConfigCommon.pusch_ConfigCommon,
|
||||
sizeof(LTE_PUSCH_ConfigCommon_t));
|
||||
|
||||
if (mobilityControlInfo->radioResourceConfigCommon.phich_Config) {
|
||||
/* memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->phich_Config,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.phich_Config,
|
||||
sizeof(LTE_PHICH_Config_t)); */
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.phich_Config,
|
||||
sizeof(LTE_PHICH_Config_t)); */
|
||||
}
|
||||
|
||||
if (mobilityControlInfo->radioResourceConfigCommon.
|
||||
pucch_ConfigCommon) {
|
||||
pucch_ConfigCommon) {
|
||||
memcpy((void *)
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
pucch_ConfigCommon,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.pucch_ConfigCommon,
|
||||
sizeof(LTE_PUCCH_ConfigCommon_t));
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
pucch_ConfigCommon,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.pucch_ConfigCommon,
|
||||
sizeof(LTE_PUCCH_ConfigCommon_t));
|
||||
}
|
||||
|
||||
if (mobilityControlInfo->
|
||||
radioResourceConfigCommon.soundingRS_UL_ConfigCommon) {
|
||||
radioResourceConfigCommon.soundingRS_UL_ConfigCommon) {
|
||||
memcpy((void *)
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
soundingRS_UL_ConfigCommon,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.soundingRS_UL_ConfigCommon,
|
||||
sizeof(LTE_SoundingRS_UL_ConfigCommon_t));
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
soundingRS_UL_ConfigCommon,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.soundingRS_UL_ConfigCommon,
|
||||
sizeof(LTE_SoundingRS_UL_ConfigCommon_t));
|
||||
}
|
||||
|
||||
if (mobilityControlInfo->
|
||||
radioResourceConfigCommon.uplinkPowerControlCommon) {
|
||||
radioResourceConfigCommon.uplinkPowerControlCommon) {
|
||||
memcpy((void *)
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
uplinkPowerControlCommon,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.uplinkPowerControlCommon,
|
||||
sizeof(LTE_UplinkPowerControlCommon_t));
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
uplinkPowerControlCommon,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.uplinkPowerControlCommon,
|
||||
sizeof(LTE_UplinkPowerControlCommon_t));
|
||||
}
|
||||
|
||||
//configure antennaInfoCommon somewhere here..
|
||||
if (mobilityControlInfo->radioResourceConfigCommon.p_Max) {
|
||||
//to be configured
|
||||
@@ -483,97 +468,97 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
|
||||
|
||||
if (mobilityControlInfo->radioResourceConfigCommon.tdd_Config) {
|
||||
UE_mac_inst[Mod_idP].tdd_Config =
|
||||
mobilityControlInfo->radioResourceConfigCommon.tdd_Config;
|
||||
mobilityControlInfo->radioResourceConfigCommon.tdd_Config;
|
||||
}
|
||||
|
||||
if (mobilityControlInfo->
|
||||
radioResourceConfigCommon.ul_CyclicPrefixLength) {
|
||||
radioResourceConfigCommon.ul_CyclicPrefixLength) {
|
||||
memcpy((void *)
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
ul_CyclicPrefixLength,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.ul_CyclicPrefixLength,
|
||||
sizeof(LTE_UL_CyclicPrefixLength_t));
|
||||
&UE_mac_inst[Mod_idP].radioResourceConfigCommon->
|
||||
ul_CyclicPrefixLength,
|
||||
(void *) mobilityControlInfo->
|
||||
radioResourceConfigCommon.ul_CyclicPrefixLength,
|
||||
sizeof(LTE_UL_CyclicPrefixLength_t));
|
||||
}
|
||||
|
||||
// store the previous rnti in case of failure, and set thenew rnti
|
||||
UE_mac_inst[Mod_idP].crnti_before_ho = UE_mac_inst[Mod_idP].crnti;
|
||||
UE_mac_inst[Mod_idP].crnti =
|
||||
((mobilityControlInfo->
|
||||
newUE_Identity.buf[0]) | (mobilityControlInfo->
|
||||
newUE_Identity.buf[1] << 8));
|
||||
newUE_Identity.buf[0]) | (mobilityControlInfo->
|
||||
newUE_Identity.buf[1] << 8));
|
||||
LOG_I(MAC, "[UE %d] Received new identity %x from %d\n", Mod_idP,
|
||||
UE_mac_inst[Mod_idP].crnti, eNB_index);
|
||||
UE_mac_inst[Mod_idP].crnti, eNB_index);
|
||||
UE_mac_inst[Mod_idP].rach_ConfigDedicated =
|
||||
malloc(sizeof(*mobilityControlInfo->rach_ConfigDedicated));
|
||||
|
||||
if (mobilityControlInfo->rach_ConfigDedicated) {
|
||||
memcpy((void *) UE_mac_inst[Mod_idP].rach_ConfigDedicated,
|
||||
(void *) mobilityControlInfo->rach_ConfigDedicated,
|
||||
sizeof(*mobilityControlInfo->rach_ConfigDedicated));
|
||||
(void *) mobilityControlInfo->rach_ConfigDedicated,
|
||||
sizeof(*mobilityControlInfo->rach_ConfigDedicated));
|
||||
}
|
||||
|
||||
phy_config_afterHO_ue(Mod_idP, 0, eNB_index, mobilityControlInfo,
|
||||
0);
|
||||
0);
|
||||
}
|
||||
|
||||
|
||||
if (mbsfn_SubframeConfigList != NULL) {
|
||||
LOG_I(MAC,
|
||||
"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n",
|
||||
Mod_idP, mbsfn_SubframeConfigList->list.count);
|
||||
"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n",
|
||||
Mod_idP, mbsfn_SubframeConfigList->list.count);
|
||||
UE_mac_inst[Mod_idP].num_sf_allocation_pattern =
|
||||
mbsfn_SubframeConfigList->list.count;
|
||||
|
||||
for (i = 0; i < mbsfn_SubframeConfigList->list.count; i++) {
|
||||
LOG_I(MAC,
|
||||
"[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n",
|
||||
Mod_idP, i);
|
||||
"[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n",
|
||||
Mod_idP, i);
|
||||
UE_mac_inst[Mod_idP].mbsfn_SubframeConfig[i] =
|
||||
mbsfn_SubframeConfigList->list.array[i];
|
||||
mbsfn_SubframeConfigList->list.array[i];
|
||||
// LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is %ld\n", Mod_idP,
|
||||
// UE_mac_inst[Mod_idP].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
|
||||
}
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
if (mbsfn_AreaInfoList != NULL) {
|
||||
LOG_I(MAC, "[UE %d][CONFIG] Received %d MBSFN Area Info\n",
|
||||
Mod_idP, mbsfn_AreaInfoList->list.count);
|
||||
Mod_idP, mbsfn_AreaInfoList->list.count);
|
||||
UE_mac_inst[Mod_idP].num_active_mbsfn_area =
|
||||
mbsfn_AreaInfoList->list.count;
|
||||
|
||||
for (i = 0; i < mbsfn_AreaInfoList->list.count; i++) {
|
||||
UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i] =
|
||||
mbsfn_AreaInfoList->list.array[i];
|
||||
mbsfn_AreaInfoList->list.array[i];
|
||||
LOG_I(MAC,
|
||||
"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",
|
||||
Mod_idP, i,
|
||||
UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->
|
||||
mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",
|
||||
Mod_idP, i,
|
||||
UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->
|
||||
mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
phy_config_sib13_ue(Mod_idP, 0, eNB_index, i,
|
||||
UE_mac_inst[Mod_idP].
|
||||
mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
|
||||
UE_mac_inst[Mod_idP].
|
||||
mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
|
||||
}
|
||||
}
|
||||
|
||||
if (pmch_InfoList != NULL) {
|
||||
|
||||
// LOG_I(MAC,"DUY: lcid when entering rrc_mac config_req is %02d\n",(pmch_InfoList->list.array[0]->mbms_SessionInfoList_r9.list.array[0]->logicalChannelIdentity_r9));
|
||||
|
||||
LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",
|
||||
Mod_idP);
|
||||
Mod_idP);
|
||||
|
||||
for (i = 0; i < pmch_InfoList->list.count; i++) {
|
||||
UE_mac_inst[Mod_idP].pmch_Config[i] =
|
||||
&pmch_InfoList->list.array[i]->pmch_Config_r9;
|
||||
&pmch_InfoList->list.array[i]->pmch_Config_r9;
|
||||
LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n",
|
||||
Mod_idP, i,
|
||||
UE_mac_inst[Mod_idP].
|
||||
pmch_Config[i]->mch_SchedulingPeriod_r9);
|
||||
Mod_idP, i,
|
||||
UE_mac_inst[Mod_idP].
|
||||
pmch_Config[i]->mch_SchedulingPeriod_r9);
|
||||
}
|
||||
|
||||
UE_mac_inst[Mod_idP].mcch_status = 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef CBA
|
||||
|
||||
@@ -581,44 +566,53 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
|
||||
UE_mac_inst[Mod_idP].cba_rnti[num_active_cba_groups - 1] =
|
||||
cba_rnti;
|
||||
LOG_D(MAC,
|
||||
"[UE %d] configure CBA group %d RNTI %x for eNB %d (total active cba group %d)\n",
|
||||
Mod_idP, Mod_idP % num_active_cba_groups, cba_rnti,
|
||||
eNB_index, num_active_cba_groups);
|
||||
"[UE %d] configure CBA group %d RNTI %x for eNB %d (total active cba group %d)\n",
|
||||
Mod_idP, Mod_idP % num_active_cba_groups, cba_rnti,
|
||||
eNB_index, num_active_cba_groups);
|
||||
phy_config_cba_rnti(Mod_idP, CC_idP, eNB_flagP, eNB_index,
|
||||
cba_rnti, num_active_cba_groups - 1,
|
||||
num_active_cba_groups);
|
||||
cba_rnti, num_active_cba_groups - 1,
|
||||
num_active_cba_groups);
|
||||
}
|
||||
|
||||
#endif
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
|
||||
//for D2D
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
switch (config_action) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
switch (config_action) {
|
||||
case CONFIG_ACTION_ADD:
|
||||
if (sourceL2Id){
|
||||
UE_mac_inst[Mod_idP].sourceL2Id = *sourceL2Id;
|
||||
LOG_I(MAC,"[UE %d] Configure source L2Id 0x%08x \n", Mod_idP, *sourceL2Id );
|
||||
}
|
||||
if (destinationL2Id) {
|
||||
LOG_I(MAC,"[UE %d] Configure destination L2Id 0x%08x\n", Mod_idP, *destinationL2Id );
|
||||
int j = 0;
|
||||
int i = 0;
|
||||
for (i=0; i< MAX_NUM_DEST; i++) {
|
||||
if ((UE_mac_inst[Mod_idP].destinationList[i] == 0) && (j == 0)) j = i+1;
|
||||
if (UE_mac_inst[Mod_idP].destinationList[i] == *destinationL2Id) break; //destination already exists!
|
||||
}
|
||||
if ((i == MAX_NUM_DEST) && (j > 0)) UE_mac_inst[Mod_idP].destinationList[j-1] = *destinationL2Id;
|
||||
UE_mac_inst[Mod_idP].numCommFlows++;
|
||||
}
|
||||
break;
|
||||
if (sourceL2Id) {
|
||||
UE_mac_inst[Mod_idP].sourceL2Id = *sourceL2Id;
|
||||
LOG_I(MAC,"[UE %d] Configure source L2Id 0x%08x \n", Mod_idP, *sourceL2Id );
|
||||
}
|
||||
|
||||
if (destinationL2Id) {
|
||||
LOG_I(MAC,"[UE %d] Configure destination L2Id 0x%08x\n", Mod_idP, *destinationL2Id );
|
||||
int j = 0;
|
||||
int i = 0;
|
||||
|
||||
for (i=0; i< MAX_NUM_DEST; i++) {
|
||||
if ((UE_mac_inst[Mod_idP].destinationList[i] == 0) && (j == 0)) j = i+1;
|
||||
|
||||
if (UE_mac_inst[Mod_idP].destinationList[i] == *destinationL2Id) break; //destination already exists!
|
||||
}
|
||||
|
||||
if ((i == MAX_NUM_DEST) && (j > 0)) UE_mac_inst[Mod_idP].destinationList[j-1] = *destinationL2Id;
|
||||
|
||||
UE_mac_inst[Mod_idP].numCommFlows++;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case CONFIG_ACTION_REMOVE:
|
||||
//TODO
|
||||
break;
|
||||
//TODO
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
||||
+310
-323
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
@@ -55,7 +56,7 @@
|
||||
#include "eNB_scheduler_fairRR.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
#include "assertions.h"
|
||||
@@ -70,10 +71,7 @@ uint16_t pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
|
||||
|
||||
|
||||
void
|
||||
schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
{
|
||||
|
||||
|
||||
schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) {
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
nfapi_ul_config_request_body_t *ul_req;
|
||||
@@ -82,81 +80,84 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
LTE_SoundingRS_UL_ConfigCommon_t *soundingRS_UL_ConfigCommon;
|
||||
struct LTE_SoundingRS_UL_ConfigDedicated *soundingRS_UL_ConfigDedicated;
|
||||
uint8_t TSFC;
|
||||
uint16_t deltaTSFC; // bitmap
|
||||
uint16_t deltaTSFC; // bitmap
|
||||
uint8_t srs_SubframeConfig;
|
||||
|
||||
// table for TSFC (Period) and deltaSFC (offset)
|
||||
const uint16_t deltaTSFCTabType1[15][2] = { {1, 1}, {1, 2}, {2, 2}, {1, 5}, {2, 5}, {4, 5}, {8, 5}, {3, 5}, {12, 5}, {1, 10}, {2, 10}, {4, 10}, {8, 10}, {351, 10}, {383, 10} }; // Table 5.5.3.3-2 3GPP 36.211 FDD
|
||||
const uint16_t deltaTSFCTabType2[14][2] = { {2, 5}, {6, 5}, {10, 5}, {18, 5}, {14, 5}, {22, 5}, {26, 5}, {30, 5}, {70, 10}, {74, 10}, {194, 10}, {326, 10}, {586, 10}, {210, 10} }; // Table 5.5.3.3-2 3GPP 36.211 TDD
|
||||
|
||||
const uint16_t deltaTSFCTabType1[15][2] = { {1, 1}, {1, 2}, {2, 2}, {1, 5}, {2, 5}, {4, 5}, {8, 5}, {3, 5}, {12, 5}, {1, 10}, {2, 10}, {4, 10}, {8, 10}, {351, 10}, {383, 10} }; // Table 5.5.3.3-2 3GPP 36.211 FDD
|
||||
const uint16_t deltaTSFCTabType2[14][2] = { {2, 5}, {6, 5}, {10, 5}, {18, 5}, {14, 5}, {22, 5}, {26, 5}, {30, 5}, {70, 10}, {74, 10}, {194, 10}, {326, 10}, {586, 10}, {210, 10} }; // Table 5.5.3.3-2 3GPP 36.211 TDD
|
||||
uint16_t srsPeriodicity, srsOffset;
|
||||
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
soundingRS_UL_ConfigCommon = &cc[CC_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon;
|
||||
|
||||
// check if SRS is enabled in this frame/subframe
|
||||
if (soundingRS_UL_ConfigCommon) {
|
||||
srs_SubframeConfig = soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig;
|
||||
if (cc[CC_id].tdd_Config == NULL) { // FDD
|
||||
deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0];
|
||||
TSFC = deltaTSFCTabType1[srs_SubframeConfig][1];
|
||||
} else { // TDD
|
||||
deltaTSFC = deltaTSFCTabType2[srs_SubframeConfig][0];
|
||||
TSFC = deltaTSFCTabType2[srs_SubframeConfig][1];
|
||||
|
||||
if (cc[CC_id].tdd_Config == NULL) { // FDD
|
||||
deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0];
|
||||
TSFC = deltaTSFCTabType1[srs_SubframeConfig][1];
|
||||
} else { // TDD
|
||||
deltaTSFC = deltaTSFCTabType2[srs_SubframeConfig][0];
|
||||
TSFC = deltaTSFCTabType2[srs_SubframeConfig][1];
|
||||
}
|
||||
|
||||
// Sounding reference signal subframes are the subframes satisfying ns/2 mod TSFC (- deltaTSFC
|
||||
uint16_t tmp = (subframeP % TSFC);
|
||||
|
||||
|
||||
if ((1 << tmp) & deltaTSFC) {
|
||||
// This is an SRS subframe, loop over UEs
|
||||
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (!RC.mac[module_idP]->UE_list.active[UE_id]) continue;
|
||||
ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
|
||||
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
|
||||
if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
|
||||
|
||||
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL,
|
||||
"physicalConfigDedicated is null for UE %d\n",
|
||||
UE_id);
|
||||
|
||||
if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated) != NULL) {
|
||||
if (soundingRS_UL_ConfigDedicated->present == LTE_SoundingRS_UL_ConfigDedicated_PR_setup) {
|
||||
get_srs_pos(&cc[CC_id],
|
||||
soundingRS_UL_ConfigDedicated->choice.
|
||||
setup.srs_ConfigIndex,
|
||||
&srsPeriodicity, &srsOffset);
|
||||
if (((10 * frameP + subframeP) % srsPeriodicity) == srsOffset) {
|
||||
// Program SRS
|
||||
ul_req->srs_present = 1;
|
||||
nfapi_ul_config_request_pdu_t * ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
|
||||
memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_srs_pdu));
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.size = (uint8_t)sizeof(nfapi_ul_config_srs_pdu);
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb = soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; // ul_config_pdu->srs_pdu.srs_pdu_rel10.antenna_port = ;//
|
||||
// ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs = ;//
|
||||
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
|
||||
RC.mac[module_idP]->UL_req[CC_id].header.message_id = NFAPI_UL_CONFIG_REQUEST;
|
||||
ul_req->number_of_pdus++;
|
||||
} // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset)
|
||||
} // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup)
|
||||
} // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL)
|
||||
} // for (UE_id ...
|
||||
} // if((1<<tmp) & deltaTSFC)
|
||||
|
||||
} // SRS config
|
||||
// This is an SRS subframe, loop over UEs
|
||||
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (!RC.mac[module_idP]->UE_list.active[UE_id]) continue;
|
||||
|
||||
ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
|
||||
|
||||
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
|
||||
if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
|
||||
|
||||
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL,
|
||||
"physicalConfigDedicated is null for UE %d\n",
|
||||
UE_id);
|
||||
|
||||
if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated) != NULL) {
|
||||
if (soundingRS_UL_ConfigDedicated->present == LTE_SoundingRS_UL_ConfigDedicated_PR_setup) {
|
||||
get_srs_pos(&cc[CC_id],
|
||||
soundingRS_UL_ConfigDedicated->choice.
|
||||
setup.srs_ConfigIndex,
|
||||
&srsPeriodicity, &srsOffset);
|
||||
|
||||
if (((10 * frameP + subframeP) % srsPeriodicity) == srsOffset) {
|
||||
// Program SRS
|
||||
ul_req->srs_present = 1;
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
|
||||
memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_srs_pdu));
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.size = (uint8_t)sizeof(nfapi_ul_config_srs_pdu);
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb = soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift =
|
||||
soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; // ul_config_pdu->srs_pdu.srs_pdu_rel10.antenna_port = ;//
|
||||
// ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs = ;//
|
||||
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
|
||||
RC.mac[module_idP]->UL_req[CC_id].header.message_id = NFAPI_UL_CONFIG_REQUEST;
|
||||
ul_req->number_of_pdus++;
|
||||
} // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset)
|
||||
} // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup)
|
||||
} // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL)
|
||||
} // for (UE_id ...
|
||||
} // if((1<<tmp) & deltaTSFC)
|
||||
} // SRS config
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
{
|
||||
schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) {
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
COMMON_channels_t *cc;
|
||||
@@ -167,8 +168,8 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
int H;
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
cc = &eNB->common_channels[CC_id];
|
||||
|
||||
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (!UE_list->active[UE_id]) continue;
|
||||
|
||||
@@ -178,67 +179,64 @@ schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
|
||||
|
||||
AssertFatal(UE_list->
|
||||
UE_template[CC_id][UE_id].physicalConfigDedicated
|
||||
!= NULL,
|
||||
"physicalConfigDedicated is null for UE %d\n",
|
||||
UE_id);
|
||||
UE_template[CC_id][UE_id].physicalConfigDedicated
|
||||
!= NULL,
|
||||
"physicalConfigDedicated is null for UE %d\n",
|
||||
UE_id);
|
||||
|
||||
if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) {
|
||||
if ((cqi_ReportPeriodic = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) != NULL
|
||||
&& (cqi_ReportPeriodic->present != LTE_CQI_ReportPeriodic_PR_release)) {
|
||||
//Rel8 Periodic CQI/PMI/RI reporting
|
||||
|
||||
get_csi_params(cc, cqi_ReportPeriodic, &Npd,
|
||||
&N_OFFSET_CQI, &H);
|
||||
|
||||
if ((((frameP * 10) + subframeP) % Npd) == N_OFFSET_CQI) { // CQI opportunity
|
||||
UE_list->UE_sched_ctrl[UE_id].feedback_cnt[CC_id] = (((frameP * 10) + subframeP) / Npd) % H;
|
||||
// Program CQI
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
|
||||
memset((void *) ul_config_pdu, 0,
|
||||
sizeof(nfapi_ul_config_request_pdu_t));
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_list->UE_sched_ctrl[UE_id], CC_id, cc,
|
||||
get_tmode(module_idP, CC_id, UE_id),
|
||||
cqi_ReportPeriodic);
|
||||
ul_req->number_of_pdus++;
|
||||
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
|
||||
if ((cqi_ReportPeriodic = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) != NULL
|
||||
&& (cqi_ReportPeriodic->present != LTE_CQI_ReportPeriodic_PR_release)) {
|
||||
//Rel8 Periodic CQI/PMI/RI reporting
|
||||
get_csi_params(cc, cqi_ReportPeriodic, &Npd,
|
||||
&N_OFFSET_CQI, &H);
|
||||
|
||||
if ((((frameP * 10) + subframeP) % Npd) == N_OFFSET_CQI) { // CQI opportunity
|
||||
UE_list->UE_sched_ctrl[UE_id].feedback_cnt[CC_id] = (((frameP * 10) + subframeP) / Npd) % H;
|
||||
// Program CQI
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
|
||||
memset((void *) ul_config_pdu, 0,
|
||||
sizeof(nfapi_ul_config_request_pdu_t));
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_list->UE_sched_ctrl[UE_id], CC_id, cc,
|
||||
get_tmode(module_idP, CC_id, UE_id),
|
||||
cqi_ReportPeriodic);
|
||||
ul_req->number_of_pdus++;
|
||||
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
// PUT rel10-13 UCI options here
|
||||
// PUT rel10-13 UCI options here
|
||||
#endif
|
||||
} else
|
||||
if ((cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
|
||||
&& ((((frameP * 10) + subframeP) % ((H * Npd) << (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex / 161))) == N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex % 161))) { // RI opportunity
|
||||
// Program RI
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
|
||||
memset((void *) ul_config_pdu, 0,
|
||||
sizeof(nfapi_ul_config_request_pdu_t));
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = (cc->p_eNB == 2) ? 1 : 2;
|
||||
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
|
||||
ul_req->number_of_pdus++;
|
||||
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
|
||||
}
|
||||
} // if ((cqi_ReportPeriodic = cqi_ReportConfig->cqi_ReportPeriodic)!=NULL) {
|
||||
} // if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig)
|
||||
} // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
|
||||
} // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
} else if ((cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
|
||||
&& ((((frameP * 10) + subframeP) % ((H * Npd) << (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex / 161))) == N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex %
|
||||
161))) { // RI opportunity
|
||||
// Program RI
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
|
||||
memset((void *) ul_config_pdu, 0,
|
||||
sizeof(nfapi_ul_config_request_pdu_t));
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = (cc->p_eNB == 2) ? 1 : 2;
|
||||
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
|
||||
ul_req->number_of_pdus++;
|
||||
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
|
||||
}
|
||||
} // if ((cqi_ReportPeriodic = cqi_ReportConfig->cqi_ReportPeriodic)!=NULL) {
|
||||
} // if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig)
|
||||
} // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
|
||||
} // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
}
|
||||
|
||||
void
|
||||
schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
{
|
||||
schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) {
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
nfapi_ul_config_request_t *ul_req;
|
||||
@@ -266,91 +264,89 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated== NULL) continue;
|
||||
|
||||
if ((SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig) != NULL) {
|
||||
if (SRconfig->present == LTE_SchedulingRequestConfig_PR_setup) {
|
||||
if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period
|
||||
if ((subframeP % 5) != SRconfig->choice.setup.sr_ConfigIndex) continue;
|
||||
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 14) { // 10 ms SR period
|
||||
if (subframeP != (SRconfig->choice.setup.sr_ConfigIndex - 5)) continue;
|
||||
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 34) { // 20 ms SR period
|
||||
if ((10 * (frameP & 1) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 15)) continue;
|
||||
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 74) { // 40 ms SR period
|
||||
if ((10 * (frameP & 3) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 35)) continue;
|
||||
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period
|
||||
if ((10 * (frameP & 7) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 75)) continue;
|
||||
}
|
||||
} // SRconfig->present == SchedulingRequestConfig_PR_setup)
|
||||
} // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL)
|
||||
if (SRconfig->present == LTE_SchedulingRequestConfig_PR_setup) {
|
||||
if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period
|
||||
if ((subframeP % 5) != SRconfig->choice.setup.sr_ConfigIndex) continue;
|
||||
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 14) { // 10 ms SR period
|
||||
if (subframeP != (SRconfig->choice.setup.sr_ConfigIndex - 5)) continue;
|
||||
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 34) { // 20 ms SR period
|
||||
if ((10 * (frameP & 1) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 15)) continue;
|
||||
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 74) { // 40 ms SR period
|
||||
if ((10 * (frameP & 3) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 35)) continue;
|
||||
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period
|
||||
if ((10 * (frameP & 7) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 75)) continue;
|
||||
}
|
||||
} // SRconfig->present == SchedulingRequestConfig_PR_setup)
|
||||
} // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL)
|
||||
|
||||
// if we get here there is some PUCCH1 reception to schedule for SR
|
||||
|
||||
skip_ue = 0;
|
||||
is_harq = 0;
|
||||
|
||||
// check that there is no existing UL grant for ULSCH which overrides the SR
|
||||
for (i = 0; i < ul_req_body->number_of_pdus; i++) {
|
||||
if (((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) ||
|
||||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) ||
|
||||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) ||
|
||||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE)) &&
|
||||
(ul_req_body->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
|
||||
skip_ue = 1;
|
||||
break;
|
||||
}
|
||||
/* if there is already an HARQ pdu, convert to SR_HARQ */
|
||||
else if ((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) &&
|
||||
(ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
|
||||
is_harq = 1;
|
||||
break;
|
||||
}
|
||||
if (((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) ||
|
||||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) ||
|
||||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) ||
|
||||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE)) &&
|
||||
(ul_req_body->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
|
||||
skip_ue = 1;
|
||||
break;
|
||||
}
|
||||
/* if there is already an HARQ pdu, convert to SR_HARQ */
|
||||
else if ((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) &&
|
||||
(ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
|
||||
is_harq = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// drop the allocation because ULSCH with handle it with BSR
|
||||
if (skip_ue == 1) continue;
|
||||
|
||||
LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x is_harq:%d\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti, is_harq);
|
||||
|
||||
// check Rel10 or Rel8 SR
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
if ((UE_list-> UE_template[CC_id][UE_id].physicalConfigDedicated->ext2)
|
||||
&& (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)
|
||||
&& (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) {
|
||||
sr.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG;
|
||||
sr.sr_information_rel10.number_of_pucch_resources = 1;
|
||||
sr.sr_information_rel10.pucch_index_p1 = *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10;
|
||||
LOG_D(MAC,"REL10 PUCCH INDEX P1:%d\n", sr.sr_information_rel10.pucch_index_p1);
|
||||
&& (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)
|
||||
&& (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) {
|
||||
sr.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG;
|
||||
sr.sr_information_rel10.number_of_pucch_resources = 1;
|
||||
sr.sr_information_rel10.pucch_index_p1 = *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10;
|
||||
LOG_D(MAC,"REL10 PUCCH INDEX P1:%d\n", sr.sr_information_rel10.pucch_index_p1);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
sr.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG;
|
||||
sr.sr_information_rel8.pucch_index = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex;
|
||||
LOG_D(MAC,"REL8 PUCCH INDEX:%d\n", sr.sr_information_rel8.pucch_index);
|
||||
}
|
||||
{
|
||||
sr.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG;
|
||||
sr.sr_information_rel8.pucch_index = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex;
|
||||
LOG_D(MAC,"REL8 PUCCH INDEX:%d\n", sr.sr_information_rel8.pucch_index);
|
||||
}
|
||||
|
||||
/* if there is already an HARQ pdu, convert to SR_HARQ */
|
||||
if (is_harq) {
|
||||
nfapi_ul_config_harq_information h = ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.harq_information;
|
||||
ul_req_body->ul_config_pdu_list[i].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE;
|
||||
ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.sr_information = sr;
|
||||
ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.harq_information = h;
|
||||
nfapi_ul_config_harq_information h = ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.harq_information;
|
||||
ul_req_body->ul_config_pdu_list[i].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE;
|
||||
ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.sr_information = sr;
|
||||
ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.harq_information = h;
|
||||
} else {
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel11.tl.tag = 0;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel13.tl.tag = 0;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.sr_information = sr;
|
||||
ul_req_body->number_of_pdus++;
|
||||
} /* if (is_harq) */
|
||||
ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
|
||||
} // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id])
|
||||
} // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
|
||||
}
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel11.tl.tag = 0;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel13.tl.tag = 0;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.sr_information = sr;
|
||||
ul_req_body->number_of_pdus++;
|
||||
} /* if (is_harq) */
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
|
||||
} // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id])
|
||||
} // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
|
||||
}
|
||||
|
||||
void
|
||||
check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
|
||||
frame_t frameP, sub_frame_t subframeP)
|
||||
{
|
||||
frame_t frameP, sub_frame_t subframeP) {
|
||||
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
|
||||
nfapi_dl_config_request_t *DL_req = &RC.mac[module_idP]->DL_req[0];
|
||||
uint16_t rnti = UE_RNTI(module_idP, UE_id);
|
||||
@@ -362,9 +358,9 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 1)
|
||||
LOG_I(MAC, "UE %d rnti %x: UL Failure timer %d \n", UE_id, rnti,
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer);
|
||||
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent == 0) {
|
||||
UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 1;
|
||||
|
||||
// add a format 1A dci for this UE to request an RA procedure (only one UE per subframe)
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[DL_req[CC_id].dl_config_request_body.number_pdu];
|
||||
memset((void *) dl_config_pdu, 0,sizeof(nfapi_dl_config_request_pdu_t));
|
||||
@@ -373,34 +369,35 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP, CC_id),
|
||||
UE_list->UE_sched_ctrl[UE_id].
|
||||
dl_cqi[CC_id], format1A);
|
||||
UE_list->UE_sched_ctrl[UE_id].
|
||||
dl_cqi[CC_id], format1A);
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
|
||||
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
|
||||
AssertFatal((cc[CC_id].mib->message.dl_Bandwidth >= 0) && (cc[CC_id].mib->message.dl_Bandwidth < 6),
|
||||
"illegal dl_Bandwidth %d\n",
|
||||
(int) cc[CC_id].mib->message.dl_Bandwidth);
|
||||
"illegal dl_Bandwidth %d\n",
|
||||
(int) cc[CC_id].mib->message.dl_Bandwidth);
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = pdcch_order_table[cc[CC_id].mib->message.dl_Bandwidth];
|
||||
DL_req[CC_id].dl_config_request_body.number_dci++;
|
||||
DL_req[CC_id].dl_config_request_body.number_pdu++;
|
||||
DL_req[CC_id].dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
|
||||
LOG_D(MAC,
|
||||
"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d), resource_block_coding %d \n",
|
||||
UE_id, rnti,
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer,
|
||||
dl_config_pdu->dci_dl_pdu.
|
||||
dci_dl_pdu_rel8.resource_block_coding);
|
||||
} else { // ra_pdcch_sent==1
|
||||
"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d), resource_block_coding %d \n",
|
||||
UE_id, rnti,
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer,
|
||||
dl_config_pdu->dci_dl_pdu.
|
||||
dci_dl_pdu_rel8.resource_block_coding);
|
||||
} else { // ra_pdcch_sent==1
|
||||
LOG_D(MAC,
|
||||
"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",
|
||||
UE_id, rnti,
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer);
|
||||
if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 80) == 0) UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 8 frames
|
||||
"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",
|
||||
UE_id, rnti,
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer);
|
||||
|
||||
if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 80) == 0) UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 8 frames
|
||||
}
|
||||
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer++;
|
||||
|
||||
// check threshold
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 4000) {
|
||||
// note: probably ul_failure_timer should be less than UE radio link failure time(see T310/N310/N311)
|
||||
@@ -415,113 +412,91 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
|
||||
} else {
|
||||
// inform RRC of failure and clear timer
|
||||
LOG_I(MAC,
|
||||
"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",
|
||||
UE_id, rnti);
|
||||
"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",
|
||||
UE_id, rnti);
|
||||
mac_eNB_rrc_ul_failure(module_idP, CC_id, frameP, subframeP,rnti);
|
||||
}
|
||||
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0;
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 1;
|
||||
}
|
||||
} // ul_failure_timer>0
|
||||
} // ul_failure_timer>0
|
||||
}
|
||||
|
||||
void
|
||||
clear_nfapi_information(eNB_MAC_INST * eNB, int CC_idP,
|
||||
frame_t frameP, sub_frame_t subframeP)
|
||||
{
|
||||
clear_nfapi_information(eNB_MAC_INST *eNB, int CC_idP,
|
||||
frame_t frameP, sub_frame_t subframeP) {
|
||||
nfapi_dl_config_request_t *DL_req = &eNB->DL_req[0];
|
||||
nfapi_ul_config_request_t *UL_req = &eNB->UL_req[0];
|
||||
nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[CC_idP][subframeP];
|
||||
nfapi_tx_request_t *TX_req = &eNB->TX_req[0];
|
||||
|
||||
eNB->pdu_index[CC_idP] = 0;
|
||||
|
||||
if (nfapi_mode==0 || nfapi_mode == 1) { // monolithic or PNF
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF || NFAPI_MODE == NFAPI_MONOLITHIC) { // monolithic or PNF
|
||||
DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols = 1;
|
||||
DL_req[CC_idP].dl_config_request_body.number_dci = 0;
|
||||
DL_req[CC_idP].dl_config_request_body.number_pdu = 0;
|
||||
DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0;
|
||||
DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich = 6000;
|
||||
DL_req[CC_idP].sfn_sf = subframeP + (frameP<<4);
|
||||
|
||||
HI_DCI0_req->hi_dci0_request_body.sfnsf = subframeP + (frameP<<4);
|
||||
HI_DCI0_req->hi_dci0_request_body.number_of_dci = 0;
|
||||
|
||||
|
||||
UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0;
|
||||
UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources = 0; // ignored, handled by PHY for now
|
||||
UL_req[CC_idP].ul_config_request_body.srs_present = 0; // ignored, handled by PHY for now
|
||||
|
||||
TX_req[CC_idP].tx_request_body.number_of_pdus = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
{
|
||||
copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) {
|
||||
int CC_id;
|
||||
eNB_MAC_INST *mac = RC.mac[module_idP];
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
nfapi_ul_config_request_t *ul_req_tmp = &mac->UL_req_tmp[CC_id][subframeP];
|
||||
nfapi_ul_config_request_t *ul_req = &mac->UL_req[CC_id];
|
||||
nfapi_ul_config_request_pdu_t *ul_req_pdu = ul_req->ul_config_request_body.ul_config_pdu_list;
|
||||
|
||||
*ul_req = *ul_req_tmp;
|
||||
|
||||
// Restore the pointer
|
||||
ul_req->ul_config_request_body.ul_config_pdu_list = ul_req_pdu;
|
||||
ul_req->sfn_sf = (frameP<<4) + subframeP;
|
||||
ul_req_tmp->ul_config_request_body.number_of_pdus = 0;
|
||||
|
||||
if (ul_req->ul_config_request_body.number_of_pdus>0)
|
||||
{
|
||||
LOG_D(PHY, "%s() active NOW (frameP:%d subframeP:%d) pdus:%d\n", __FUNCTION__, frameP, subframeP, ul_req->ul_config_request_body.number_of_pdus);
|
||||
}
|
||||
if (ul_req->ul_config_request_body.number_of_pdus>0) {
|
||||
LOG_D(PHY, "%s() active NOW (frameP:%d subframeP:%d) pdus:%d\n", __FUNCTION__, frameP, subframeP, ul_req->ul_config_request_body.number_of_pdus);
|
||||
}
|
||||
|
||||
memcpy((void*)ul_req->ul_config_request_body.ul_config_pdu_list,
|
||||
(void*)ul_req_tmp->ul_config_request_body.ul_config_pdu_list,
|
||||
ul_req->ul_config_request_body.number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t));
|
||||
memcpy((void *)ul_req->ul_config_request_body.ul_config_pdu_list,
|
||||
(void *)ul_req_tmp->ul_config_request_body.ul_config_pdu_list,
|
||||
ul_req->ul_config_request_body.number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
|
||||
sub_frame_t subframeP)
|
||||
{
|
||||
|
||||
sub_frame_t subframeP) {
|
||||
int mbsfn_status[MAX_NUM_CCs];
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
int CC_id, i = -1;
|
||||
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
|
||||
rnti_t rnti;
|
||||
|
||||
COMMON_channels_t *cc = RC.mac[module_idP]->common_channels;
|
||||
|
||||
start_meas(&RC.mac[module_idP]->eNB_scheduler);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,
|
||||
VCD_FUNCTION_IN);
|
||||
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,
|
||||
VCD_FUNCTION_IN);
|
||||
RC.mac[module_idP]->frame = frameP;
|
||||
RC.mac[module_idP]->subframe = subframeP;
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
mbsfn_status[CC_id] = 0;
|
||||
|
||||
// clear vrb_maps
|
||||
memset(cc[CC_id].vrb_map, 0, 100);
|
||||
memset(cc[CC_id].vrb_map_UL, 0, 100);
|
||||
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
cc[CC_id].mcch_active = 0;
|
||||
#endif
|
||||
|
||||
clear_nfapi_information(RC.mac[module_idP], CC_id, frameP, subframeP);
|
||||
}
|
||||
|
||||
@@ -530,105 +505,115 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
|
||||
if (UE_list->active[i]) {
|
||||
rnti = UE_RNTI(module_idP, i);
|
||||
CC_id = UE_PCCID(module_idP, i);
|
||||
|
||||
|
||||
if (((frameP&127) == 0) && (subframeP == 0)) {
|
||||
LOG_I(MAC,
|
||||
"UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n",
|
||||
rnti,
|
||||
UE_list->UE_sched_ctrl[i].ul_out_of_sync ==
|
||||
0 ? "in synch" : "out of sync",
|
||||
UE_list->UE_template[CC_id][i].phr_info,
|
||||
UE_list->UE_sched_ctrl[i].dl_cqi[CC_id],
|
||||
(5*UE_list->UE_sched_ctrl[i].pusch_snr[CC_id] - 640) / 10,
|
||||
(5*UE_list->UE_sched_ctrl[i].pucch1_snr[CC_id] - 640) / 10);
|
||||
LOG_I(MAC,
|
||||
"UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n",
|
||||
rnti,
|
||||
UE_list->UE_sched_ctrl[i].ul_out_of_sync ==
|
||||
0 ? "in synch" : "out of sync",
|
||||
UE_list->UE_template[CC_id][i].phr_info,
|
||||
UE_list->UE_sched_ctrl[i].dl_cqi[CC_id],
|
||||
(5*UE_list->UE_sched_ctrl[i].pusch_snr[CC_id] - 640) / 10,
|
||||
(5*UE_list->UE_sched_ctrl[i].pucch1_snr[CC_id] - 640) / 10);
|
||||
}
|
||||
|
||||
|
||||
RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP * 10) +
|
||||
subframeP] = -63;
|
||||
subframeP] = -63;
|
||||
|
||||
if (i == UE_list->head)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,
|
||||
RC.eNB[module_idP][CC_id]->
|
||||
pusch_stats_bsr[i][(frameP * 10) + subframeP]);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,
|
||||
RC.eNB[module_idP][CC_id]->
|
||||
pusch_stats_bsr[i][(frameP * 10) + subframeP]);
|
||||
|
||||
// increment this, it is cleared when we receive an sdu
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer++;
|
||||
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++;
|
||||
LOG_D(MAC, "UE %d/%x : ul_inactivity %d, cqi_req %d\n", i, rnti,
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].
|
||||
ul_inactivity_timer,
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer);
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].
|
||||
ul_inactivity_timer,
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer);
|
||||
check_ul_failure(module_idP, CC_id, i, frameP, subframeP);
|
||||
|
||||
|
||||
if (RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer > 0) {
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer++;
|
||||
if(RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer >=
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer_thres) {
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer = 0;
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer++;
|
||||
|
||||
if(RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer >=
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer_thres) {
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer = 0;
|
||||
|
||||
//clear reestablish_rnti_map
|
||||
if(RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer_thres >20){
|
||||
for (int ue_id_l = 0; ue_id_l < MAX_MOBILES_PER_ENB; ue_id_l++) {
|
||||
if (reestablish_rnti_map[ue_id_l][0] == rnti) {
|
||||
// clear currentC-RNTI from map
|
||||
reestablish_rnti_map[ue_id_l][0] = 0;
|
||||
reestablish_rnti_map[ue_id_l][1] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer_thres >20) {
|
||||
for (int ue_id_l = 0; ue_id_l < MAX_MOBILES_PER_ENB; ue_id_l++) {
|
||||
if (reestablish_rnti_map[ue_id_l][0] == rnti) {
|
||||
// clear currentC-RNTI from map
|
||||
reestablish_rnti_map[ue_id_l][0] = 0;
|
||||
reestablish_rnti_map[ue_id_l][1] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, rnti, 0, 0,module_idP);
|
||||
rrc_rlc_remove_ue(&ctxt);
|
||||
pdcp_remove_UE(&ctxt);
|
||||
}
|
||||
// Note: This should not be done in the MAC!
|
||||
for (int ii=0; ii<MAX_MOBILES_PER_ENB; ii++) {
|
||||
LTE_eNB_ULSCH_t *ulsch = RC.eNB[module_idP][CC_id]->ulsch[ii];
|
||||
if((ulsch != NULL) && (ulsch->rnti == rnti)){
|
||||
|
||||
// Note: This should not be done in the MAC!
|
||||
for (int ii=0; ii<MAX_MOBILES_PER_ENB; ii++) {
|
||||
LTE_eNB_ULSCH_t *ulsch = RC.eNB[module_idP][CC_id]->ulsch[ii];
|
||||
|
||||
if((ulsch != NULL) && (ulsch->rnti == rnti)) {
|
||||
void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch);
|
||||
LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti);
|
||||
clean_eNb_ulsch(ulsch);
|
||||
}
|
||||
}
|
||||
for (int ii=0; ii<MAX_MOBILES_PER_ENB; ii++) {
|
||||
LTE_eNB_DLSCH_t *dlsch = RC.eNB[module_idP][CC_id]->dlsch[ii][0];
|
||||
if((dlsch != NULL) && (dlsch->rnti == rnti)){
|
||||
LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti);
|
||||
clean_eNb_ulsch(ulsch);
|
||||
}
|
||||
}
|
||||
|
||||
for (int ii=0; ii<MAX_MOBILES_PER_ENB; ii++) {
|
||||
LTE_eNB_DLSCH_t *dlsch = RC.eNB[module_idP][CC_id]->dlsch[ii][0];
|
||||
|
||||
if((dlsch != NULL) && (dlsch->rnti == rnti)) {
|
||||
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch);
|
||||
LOG_I(MAC, "clean_eNb_dlsch UE %x \n", rnti);
|
||||
clean_eNb_dlsch(dlsch);
|
||||
}
|
||||
}
|
||||
|
||||
for(int j = 0; j < 10; j++){
|
||||
nfapi_ul_config_request_body_t *ul_req_tmp = NULL;
|
||||
ul_req_tmp = &RC.mac[module_idP]->UL_req_tmp[CC_id][j].ul_config_request_body;
|
||||
if(ul_req_tmp){
|
||||
int pdu_number = ul_req_tmp->number_of_pdus;
|
||||
for(int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--){
|
||||
if(ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti){
|
||||
LOG_I(MAC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number);
|
||||
if(pdu_index < pdu_number -1){
|
||||
memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t));
|
||||
}
|
||||
ul_req_tmp->number_of_pdus--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rrc_mac_remove_ue(module_idP,rnti);
|
||||
}
|
||||
LOG_I(MAC, "clean_eNb_dlsch UE %x \n", rnti);
|
||||
clean_eNb_dlsch(dlsch);
|
||||
}
|
||||
}
|
||||
|
||||
for(int j = 0; j < 10; j++) {
|
||||
nfapi_ul_config_request_body_t *ul_req_tmp = NULL;
|
||||
ul_req_tmp = &RC.mac[module_idP]->UL_req_tmp[CC_id][j].ul_config_request_body;
|
||||
|
||||
if(ul_req_tmp) {
|
||||
int pdu_number = ul_req_tmp->number_of_pdus;
|
||||
|
||||
for(int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--) {
|
||||
if(ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti) {
|
||||
LOG_I(MAC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number);
|
||||
|
||||
if(pdu_index < pdu_number -1) {
|
||||
memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t));
|
||||
}
|
||||
|
||||
ul_req_tmp->number_of_pdus--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rrc_mac_remove_ue(module_idP,rnti);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if (!defined(PRE_SCD_THREAD))
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES,
|
||||
NOT_A_RNTI, frameP, subframeP,
|
||||
module_idP);
|
||||
NOT_A_RNTI, frameP, subframeP,
|
||||
module_idP);
|
||||
pdcp_run(&ctxt);
|
||||
|
||||
rrc_rx_tx(&ctxt, CC_id);
|
||||
#endif
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
@@ -640,27 +625,29 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int debug_flag=0;
|
||||
void (*schedule_ulsch_p)(module_id_t module_idP, frame_t frameP, sub_frame_t subframe)=NULL;
|
||||
void (*schedule_ue_spec_p)(module_id_t module_idP, frame_t frameP, sub_frame_t subframe, int *mbsfn_flag)=NULL;
|
||||
if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_DEFAULT){
|
||||
|
||||
if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_DEFAULT) {
|
||||
schedule_ulsch_p = schedule_ulsch;
|
||||
schedule_ue_spec_p = schedule_dlsch;
|
||||
}else if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_FAIR_RR){
|
||||
} else if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_FAIR_RR) {
|
||||
memset(dlsch_ue_select, 0, sizeof(dlsch_ue_select));
|
||||
schedule_ulsch_p = schedule_ulsch_fairRR;
|
||||
schedule_ue_spec_p = schedule_ue_spec_fairRR;
|
||||
}
|
||||
if(debug_flag==0){
|
||||
|
||||
if(debug_flag==0) {
|
||||
LOG_E(MAC,"SCHED_MODE=%d\n",RC.mac[module_idP]->scheduler_mode);
|
||||
debug_flag=1;
|
||||
}
|
||||
|
||||
// This schedules MIB
|
||||
if ((subframeP == 0) && (frameP & 3) == 0)
|
||||
schedule_mib(module_idP, frameP, subframeP);
|
||||
if (get_softmodem_params()->phy_test == 0){
|
||||
schedule_mib(module_idP, frameP, subframeP);
|
||||
|
||||
if (get_softmodem_params()->phy_test == 0) {
|
||||
// This schedules SI for legacy LTE and eMTC starting in subframeP
|
||||
schedule_SI(module_idP, frameP, subframeP);
|
||||
// This schedules Paging in subframeP
|
||||
@@ -671,12 +658,14 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
|
||||
copy_ulreq(module_idP, frameP, subframeP);
|
||||
// This schedules SRS in subframeP
|
||||
schedule_SRS(module_idP, frameP, subframeP);
|
||||
|
||||
// This schedules ULSCH in subframeP (dci0)
|
||||
if (schedule_ulsch_p != NULL) {
|
||||
schedule_ulsch_p(module_idP, frameP, subframeP);
|
||||
schedule_ulsch_p(module_idP, frameP, subframeP);
|
||||
} else {
|
||||
LOG_E(MAC," %s %d: schedule_ulsch_p is NULL, function not called\n",__FILE__,__LINE__);
|
||||
LOG_E(MAC," %s %d: schedule_ulsch_p is NULL, function not called\n",__FILE__,__LINE__);
|
||||
}
|
||||
|
||||
// This schedules UCI_SR in subframeP
|
||||
schedule_SR(module_idP, frameP, subframeP);
|
||||
// This schedules UCI_CSI in subframeP
|
||||
@@ -685,15 +674,14 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
|
||||
// This schedules DLSCH in subframeP
|
||||
schedule_ue_spec_br(module_idP, frameP, subframeP);
|
||||
#endif
|
||||
|
||||
// This schedules DLSCH in subframeP
|
||||
if (schedule_ue_spec_p != NULL) {
|
||||
schedule_ue_spec_p(module_idP, frameP, subframeP, mbsfn_status);
|
||||
schedule_ue_spec_p(module_idP, frameP, subframeP, mbsfn_status);
|
||||
} else {
|
||||
LOG_E(MAC," %s %d: schedule_ue_spec_p is NULL, function not called\n",__FILE__,__LINE__);
|
||||
LOG_E(MAC," %s %d: schedule_ue_spec_p is NULL, function not called\n",__FILE__,__LINE__);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
schedule_ulsch_phy_test(module_idP,frameP,subframeP);
|
||||
schedule_ue_spec_phy_test(module_idP,frameP,subframeP,mbsfn_status);
|
||||
}
|
||||
@@ -709,8 +697,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
|
||||
}
|
||||
|
||||
stop_meas(&RC.mac[module_idP]->eNB_scheduler);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,
|
||||
VCD_FUNCTION_OUT);
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,
|
||||
VCD_FUNCTION_OUT);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -40,6 +40,7 @@
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/MAC/eNB_scheduler_fairRR.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
@@ -49,7 +50,7 @@
|
||||
|
||||
#include "T.h"
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
#ifdef PHY_TX_THREAD
|
||||
extern volatile int16_t phy_tx_txdataF_end;
|
||||
extern int oai_exit;
|
||||
@@ -841,7 +842,6 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
|
||||
#ifdef DEBUG_eNB_SCHEDULER
|
||||
int k;
|
||||
#endif
|
||||
|
||||
start_meas(&eNB->schedule_dlsch);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
|
||||
(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH, VCD_FUNCTION_IN);
|
||||
@@ -1012,7 +1012,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
|
||||
DevCheck(((eNB_UE_stats->dl_cqi < MIN_CQI_VALUE) || (eNB_UE_stats->dl_cqi > MAX_CQI_VALUE)),
|
||||
eNB_UE_stats->dl_cqi, MIN_CQI_VALUE, MAX_CQI_VALUE);
|
||||
*/
|
||||
if (nfapi_mode) {
|
||||
if (NFAPI_MODE != NFAPI_MONOLITHIC) {
|
||||
eNB_UE_stats->dlsch_mcs1 = 10;//cqi_to_mcs[ue_sched_ctl->dl_cqi[CC_id]];
|
||||
} else {
|
||||
eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[ue_sched_ctl->dl_cqi[CC_id]];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -39,12 +39,12 @@
|
||||
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
|
||||
#include "RRC/LTE/rrc_defs.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern FILL_UL_INFO_MUTEX_t fill_ul_mutex;
|
||||
extern uint8_t nfapi_mode;
|
||||
extern void openair_rrc_top_init_ue( int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
|
||||
|
||||
void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char eNB_index, uint8_t first_sync) { //init as MR
|
||||
@@ -91,7 +91,7 @@ mac_top_init_ue(int eMBMS_active, char *uecap_xer,
|
||||
}
|
||||
|
||||
// mutex below are used for multiple UE's L2 FAPI simulation.
|
||||
if (nfapi_mode == 3) {
|
||||
if (NFAPI_MODE == NFAPI_UE_STUB_PNF) {
|
||||
pthread_mutex_init(&fill_ul_mutex.rx_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.crc_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.sr_mutex,NULL);
|
||||
|
||||
+510
-509
File diff suppressed because it is too large
Load Diff
+2604
-2718
File diff suppressed because it is too large
Load Diff
+240
-276
@@ -46,10 +46,12 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include <inttypes.h>
|
||||
#include "platform_constants.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "msc.h"
|
||||
#include "common/ngran_types.h"
|
||||
#include "targets/COMMON/openairinterface5g_limits.h"
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
#include "openair2/RRC/NAS/nas_config.h"
|
||||
@@ -60,9 +62,8 @@
|
||||
# include "gtpv1u.h"
|
||||
|
||||
#include "ENB_APP/enb_config.h"
|
||||
#ifndef UETARGET
|
||||
#include "LAYER2/PROTO_AGENT/proto_agent.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
extern int otg_enabled;
|
||||
extern uint8_t nfapi_mode;
|
||||
@@ -83,7 +84,7 @@ hash_table_t *pdcp_coll_p = NULL;
|
||||
|
||||
|
||||
/* pdcp module parameters and related functions*/
|
||||
static pdcp_params_t pdcp_params= {0};
|
||||
static pdcp_params_t pdcp_params= {0,NULL};
|
||||
|
||||
uint64_t get_pdcp_optmask(void) {
|
||||
return pdcp_params.optmask;
|
||||
@@ -190,22 +191,9 @@ boolean_t pdcp_data_req(
|
||||
sdu_buffer_sizeP);
|
||||
LOG_UI(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP);
|
||||
}
|
||||
#ifndef UETARGET
|
||||
if (NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
|
||||
/* currently, there is no support to send also the source/destinationL2Id */
|
||||
proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
|
||||
confirmP, sdu_buffer_sizeP, pdcp_pdu_p);
|
||||
/* assume good status */
|
||||
rlc_status = RLC_OP_STATUS_OK;
|
||||
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP,
|
||||
confirmP, sdu_buffer_sizeP, pdcp_pdu_p
|
||||
,NULL, NULL
|
||||
);
|
||||
}
|
||||
rlc_status = pdcp_params.send_rlc_data_req_func(ctxt_pP, srb_flagP, NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)?MBMS_FLAG_NO:MBMS_FLAG_YES, rb_idP, muiP,
|
||||
confirmP, sdu_buffer_sizeP, pdcp_pdu_p,NULL,NULL);
|
||||
} else {
|
||||
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
|
||||
LOG_E(PDCP,PROTOCOL_CTXT_FMT" PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
|
||||
@@ -364,74 +352,55 @@ boolean_t pdcp_data_req(
|
||||
*/
|
||||
LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)pdcp_pdu_p->data,pdcp_pdu_size,
|
||||
"[MSG] PDCP DL %s PDU on rb_id %d\n",(srb_flagP)? "CONTROL" : "DATA", rb_idP);
|
||||
|
||||
if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1))
|
||||
{
|
||||
|
||||
#ifndef UETARGET
|
||||
LOG_D(PDCP, "pdcp data req on drb %d, size %d, rnti %x, node_type %d \n",
|
||||
if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1)) {
|
||||
LOG_D(PDCP, "pdcp data req on drb %d, size %d, rnti %x, node_type %d \n",
|
||||
rb_idP, pdcp_pdu_size, ctxt_pP->rnti, RC.rrc[ctxt_pP->module_id]->node_type);
|
||||
|
||||
if (NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
|
||||
/* currently, there is no support to send also the source/destinationL2Id */
|
||||
proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
|
||||
confirmP, pdcp_pdu_size, pdcp_pdu_p);
|
||||
/* assume good status */
|
||||
rlc_status = RLC_OP_STATUS_OK;
|
||||
ret = TRUE;
|
||||
LOG_D(PDCP, "proto_agent_send_rlc_data_req for UE RNTI %x, rb %d, pdu size %d \n",
|
||||
ctxt_pP->rnti, rb_idP, pdcp_pdu_size);
|
||||
|
||||
} else if (NODE_IS_DU(RC.rrc[ctxt_pP->module_id]->node_type)){
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_YES && NODE_IS_DU(RC.rrc[ctxt_pP->module_id]->node_type)) {
|
||||
LOG_E(PDCP, "Can't be DU, bad node type %d \n", RC.rrc[ctxt_pP->module_id]->node_type);
|
||||
ret=FALSE;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
|
||||
confirmP, pdcp_pdu_size, pdcp_pdu_p, sourceL2Id,
|
||||
destinationL2Id
|
||||
);
|
||||
switch (rlc_status) {
|
||||
case RLC_OP_STATUS_OK:
|
||||
LOG_D(PDCP, "Data sending request over RLC succeeded!\n");
|
||||
ret=TRUE;
|
||||
break;
|
||||
} else {
|
||||
rlc_status = pdcp_params.send_rlc_data_req_func(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
|
||||
confirmP, pdcp_pdu_size, pdcp_pdu_p,sourceL2Id,
|
||||
destinationL2Id);
|
||||
|
||||
case RLC_OP_STATUS_BAD_PARAMETER:
|
||||
LOG_W(PDCP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
|
||||
ret= FALSE;
|
||||
break;
|
||||
switch (rlc_status) {
|
||||
case RLC_OP_STATUS_OK:
|
||||
LOG_D(PDCP, "Data sending request over RLC succeeded!\n");
|
||||
ret=TRUE;
|
||||
break;
|
||||
|
||||
case RLC_OP_STATUS_INTERNAL_ERROR:
|
||||
LOG_W(PDCP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
|
||||
ret= FALSE;
|
||||
break;
|
||||
case RLC_OP_STATUS_BAD_PARAMETER:
|
||||
LOG_W(PDCP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
|
||||
ret= FALSE;
|
||||
break;
|
||||
|
||||
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
|
||||
LOG_W(PDCP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
|
||||
ret= FALSE;
|
||||
break;
|
||||
case RLC_OP_STATUS_INTERNAL_ERROR:
|
||||
LOG_W(PDCP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
|
||||
ret= FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_W(PDCP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
|
||||
ret= FALSE;
|
||||
break;
|
||||
} // switch case
|
||||
} /* end if node_type is CU */
|
||||
}
|
||||
else // SRB
|
||||
{
|
||||
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
|
||||
LOG_W(PDCP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
|
||||
ret= FALSE;
|
||||
break;
|
||||
|
||||
#ifndef UETARGET
|
||||
if (NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
|
||||
default:
|
||||
LOG_W(PDCP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
|
||||
ret= FALSE;
|
||||
break;
|
||||
} // switch case
|
||||
} /* end if node_type is not DU */
|
||||
} else { // SRB
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_YES && NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
|
||||
// DL transfer
|
||||
MessageDef *message_p;
|
||||
// Note: the acyual task must be TASK_PDCP_ENB, but this task is not created
|
||||
message_p = itti_alloc_new_message (TASK_PDCP_ENB, F1AP_DL_RRC_MESSAGE);
|
||||
F1AP_DL_RRC_MESSAGE (message_p).rrc_container = &pdcp_pdu_p->data[0] ;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).rrc_container_length = pdcp_pdu_size;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).gNB_CU_ue_id = 0;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).gNB_CU_ue_id = 0;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).gNB_DU_ue_id = 0;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).old_gNB_DU_ue_id = 0xFFFFFFFF; // unknown
|
||||
F1AP_DL_RRC_MESSAGE (message_p).rnti = ctxt_pP->rnti;
|
||||
@@ -442,10 +411,7 @@ boolean_t pdcp_data_req(
|
||||
//CU_send_DL_RRC_MESSAGE_TRANSFER(ctxt_pP->module_id, message_p);
|
||||
LOG_I(PDCP, "Send F1AP_DL_RRC_MESSAGE with ITTI\n");
|
||||
ret=TRUE;
|
||||
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
rlc_status = rlc_data_req(ctxt_pP
|
||||
, srb_flagP
|
||||
, MBMS_FLAG_NO
|
||||
@@ -454,11 +420,10 @@ boolean_t pdcp_data_req(
|
||||
, confirmP
|
||||
, pdcp_pdu_size
|
||||
, pdcp_pdu_p
|
||||
#ifdef Rel14
|
||||
,NULL
|
||||
,NULL
|
||||
#endif
|
||||
);
|
||||
);
|
||||
|
||||
switch (rlc_status) {
|
||||
case RLC_OP_STATUS_OK:
|
||||
LOG_D(PDCP, "Data sending request over RLC succeeded!\n");
|
||||
@@ -719,13 +684,13 @@ pdcp_data_ind(
|
||||
}
|
||||
|
||||
security_ok = pdcp_validate_security(ctxt_pP,
|
||||
pdcp_p,
|
||||
srb_flagP,
|
||||
rb_idP,
|
||||
pdcp_header_len,
|
||||
pdcp_p,
|
||||
srb_flagP,
|
||||
rb_idP,
|
||||
pdcp_header_len,
|
||||
rx_hfn_for_count,
|
||||
pdcp_sn_for_count,
|
||||
sdu_buffer_pP->data,
|
||||
sdu_buffer_pP->data,
|
||||
sdu_buffer_sizeP - pdcp_tailer_len) == 0;
|
||||
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
@@ -788,35 +753,106 @@ pdcp_data_ind(
|
||||
payload_offset=pdcp_header_len;// PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
|
||||
|
||||
switch (pdcp_p->rlc_mode) {
|
||||
case RLC_MODE_AM: {
|
||||
/* process as described in 36.323 5.1.2.1.2 */
|
||||
int reordering_window;
|
||||
case RLC_MODE_AM: {
|
||||
/* process as described in 36.323 5.1.2.1.2 */
|
||||
int reordering_window;
|
||||
|
||||
if (pdcp_p->seq_num_size == 7)
|
||||
reordering_window = REORDERING_WINDOW_SN_7BIT;
|
||||
else
|
||||
reordering_window = REORDERING_WINDOW_SN_12BIT;
|
||||
if (pdcp_p->seq_num_size == 7)
|
||||
reordering_window = REORDERING_WINDOW_SN_7BIT;
|
||||
else
|
||||
reordering_window = REORDERING_WINDOW_SN_12BIT;
|
||||
|
||||
if (sequence_number - pdcp_p->last_submitted_pdcp_rx_sn > reordering_window ||
|
||||
(pdcp_p->last_submitted_pdcp_rx_sn - sequence_number >= 0 &&
|
||||
pdcp_p->last_submitted_pdcp_rx_sn - sequence_number < reordering_window)) {
|
||||
/* TODO: specs say to decipher and do header decompression */
|
||||
LOG_W(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"discard PDU, out of\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
LOG_W(PDCP, "Ignoring PDU...\n");
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* TODO: indicate integrity verification failure to upper layer */
|
||||
return FALSE;
|
||||
} else if (pdcp_p->next_pdcp_rx_sn - sequence_number > reordering_window) {
|
||||
pdcp_p->rx_hfn++;
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
|
||||
} else if (sequence_number - pdcp_p->next_pdcp_rx_sn >= reordering_window) {
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn - 1;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
} else if (sequence_number >= pdcp_p->next_pdcp_rx_sn) {
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
|
||||
|
||||
if (pdcp_p->next_pdcp_rx_sn > pdcp_p->maximum_pdcp_rx_sn) {
|
||||
pdcp_p->next_pdcp_rx_sn = 0;
|
||||
pdcp_p->rx_hfn++;
|
||||
}
|
||||
} else { /* sequence_number < pdcp_p->next_pdcp_rx_sn */
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
}
|
||||
|
||||
if (pdcp_p->security_activated == 1) {
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
start_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
|
||||
security_ok = pdcp_validate_security(ctxt_pP,
|
||||
pdcp_p,
|
||||
srb_flagP,
|
||||
rb_idP,
|
||||
pdcp_header_len,
|
||||
rx_hfn_for_count,
|
||||
pdcp_sn_for_count,
|
||||
sdu_buffer_pP->data,
|
||||
sdu_buffer_sizeP - pdcp_tailer_len) == 0;
|
||||
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
stop_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
} else {
|
||||
security_ok = 1;
|
||||
}
|
||||
|
||||
if (security_ok == 0) {
|
||||
LOG_W(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"security not validated for incoming PDPC DRB RLC/AM PDU\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
LOG_W(PDCP, "Ignoring PDU...\n");
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* TODO: indicate integrity verification failure to upper layer */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* TODO: specs say we have to store this PDU in a list and then deliver
|
||||
* stored packets to upper layers according to a well defined
|
||||
* procedure. The code below that deals with delivery is today
|
||||
* too complex to do this properly, so we only send the current
|
||||
* received packet. This is not correct and has to be fixed
|
||||
* some day.
|
||||
* In the meantime, let's pretend the last submitted PDCP SDU
|
||||
* is the current one.
|
||||
* TODO: we also have to deal with re-establishment PDU (control PDUs)
|
||||
* that contain no SDU.
|
||||
*/
|
||||
pdcp_p->last_submitted_pdcp_rx_sn = sequence_number;
|
||||
break;
|
||||
} /* case RLC_MODE_AM */
|
||||
|
||||
case RLC_MODE_UM:
|
||||
|
||||
/* process as described in 36.323 5.1.2.1.3 */
|
||||
if (sequence_number < pdcp_p->next_pdcp_rx_sn) {
|
||||
pdcp_p->rx_hfn++;
|
||||
}
|
||||
|
||||
if (sequence_number - pdcp_p->last_submitted_pdcp_rx_sn > reordering_window ||
|
||||
(pdcp_p->last_submitted_pdcp_rx_sn - sequence_number >= 0 &&
|
||||
pdcp_p->last_submitted_pdcp_rx_sn - sequence_number < reordering_window)) {
|
||||
/* TODO: specs say to decipher and do header decompression */
|
||||
LOG_W(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"discard PDU, out of\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
LOG_W(PDCP, "Ignoring PDU...\n");
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* TODO: indicate integrity verification failure to upper layer */
|
||||
return FALSE;
|
||||
} else if (pdcp_p->next_pdcp_rx_sn - sequence_number > reordering_window) {
|
||||
pdcp_p->rx_hfn++;
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
|
||||
} else if (sequence_number - pdcp_p->next_pdcp_rx_sn >= reordering_window) {
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn - 1;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
} else if (sequence_number >= pdcp_p->next_pdcp_rx_sn) {
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
|
||||
@@ -825,119 +861,48 @@ pdcp_data_ind(
|
||||
pdcp_p->next_pdcp_rx_sn = 0;
|
||||
pdcp_p->rx_hfn++;
|
||||
}
|
||||
} else { /* sequence_number < pdcp_p->next_pdcp_rx_sn */
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
}
|
||||
|
||||
if (pdcp_p->security_activated == 1) {
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
start_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
if (pdcp_p->security_activated == 1) {
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
start_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
|
||||
security_ok = pdcp_validate_security(ctxt_pP,
|
||||
pdcp_p,
|
||||
srb_flagP,
|
||||
rb_idP,
|
||||
pdcp_header_len,
|
||||
rx_hfn_for_count,
|
||||
pdcp_sn_for_count,
|
||||
sdu_buffer_pP->data,
|
||||
sdu_buffer_sizeP - pdcp_tailer_len) == 0;
|
||||
security_ok = pdcp_validate_security(ctxt_pP,
|
||||
pdcp_p,
|
||||
srb_flagP,
|
||||
rb_idP,
|
||||
pdcp_header_len,
|
||||
rx_hfn_for_count,
|
||||
pdcp_sn_for_count,
|
||||
sdu_buffer_pP->data,
|
||||
sdu_buffer_sizeP - pdcp_tailer_len) == 0;
|
||||
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
stop_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
} else {
|
||||
security_ok = 1;
|
||||
}
|
||||
|
||||
if (security_ok == 0) {
|
||||
LOG_W(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"security not validated for incoming PDPC DRB RLC/AM PDU\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
LOG_W(PDCP, "Ignoring PDU...\n");
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* TODO: indicate integrity verification failure to upper layer */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* TODO: specs say we have to store this PDU in a list and then deliver
|
||||
* stored packets to upper layers according to a well defined
|
||||
* procedure. The code below that deals with delivery is today
|
||||
* too complex to do this properly, so we only send the current
|
||||
* received packet. This is not correct and has to be fixed
|
||||
* some day.
|
||||
* In the meantime, let's pretend the last submitted PDCP SDU
|
||||
* is the current one.
|
||||
* TODO: we also have to deal with re-establishment PDU (control PDUs)
|
||||
* that contain no SDU.
|
||||
*/
|
||||
pdcp_p->last_submitted_pdcp_rx_sn = sequence_number;
|
||||
break;
|
||||
} /* case RLC_MODE_AM */
|
||||
|
||||
case RLC_MODE_UM:
|
||||
|
||||
/* process as described in 36.323 5.1.2.1.3 */
|
||||
if (sequence_number < pdcp_p->next_pdcp_rx_sn) {
|
||||
pdcp_p->rx_hfn++;
|
||||
}
|
||||
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
|
||||
|
||||
if (pdcp_p->next_pdcp_rx_sn > pdcp_p->maximum_pdcp_rx_sn) {
|
||||
pdcp_p->next_pdcp_rx_sn = 0;
|
||||
pdcp_p->rx_hfn++;
|
||||
}
|
||||
|
||||
if (pdcp_p->security_activated == 1) {
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
start_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
|
||||
security_ok = pdcp_validate_security(ctxt_pP,
|
||||
pdcp_p,
|
||||
srb_flagP,
|
||||
rb_idP,
|
||||
pdcp_header_len,
|
||||
rx_hfn_for_count,
|
||||
pdcp_sn_for_count,
|
||||
sdu_buffer_pP->data,
|
||||
sdu_buffer_sizeP - pdcp_tailer_len) == 0;
|
||||
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
stop_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
} else {
|
||||
stop_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
security_ok = 1;
|
||||
}
|
||||
} else {
|
||||
security_ok = 1;
|
||||
}
|
||||
|
||||
if (security_ok == 0) {
|
||||
LOG_W(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"security not validated for incoming PDPC DRB RLC/UM PDU\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
LOG_W(PDCP, "Ignoring PDU...\n");
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* TODO: indicate integrity verification failure to upper layer */
|
||||
return FALSE;
|
||||
}
|
||||
if (security_ok == 0) {
|
||||
LOG_W(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"security not validated for incoming PDPC DRB RLC/UM PDU\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
LOG_W(PDCP, "Ignoring PDU...\n");
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* TODO: indicate integrity verification failure to upper layer */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PDCP, "bad RLC mode, cannot happen.\n");
|
||||
exit(1);
|
||||
default:
|
||||
LOG_E(PDCP, "bad RLC mode, cannot happen.\n");
|
||||
exit(1);
|
||||
} /* switch (pdcp_p->rlc_mode) */
|
||||
} else { /* MBMS_flagP == 0 */
|
||||
payload_offset=0;
|
||||
@@ -966,37 +931,36 @@ pdcp_data_ind(
|
||||
*/
|
||||
|
||||
if (LINK_ENB_PDCP_TO_GTPV1U) {
|
||||
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
|
||||
LOG_D(PDCP, "Sending packet to GTP, Calling GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u\n",
|
||||
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
|
||||
LOG_D(PDCP, "Sending packet to GTP, Calling GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u\n",
|
||||
ctxt_pP->rnti,
|
||||
rb_id + 4,
|
||||
sdu_buffer_sizeP - payload_offset );
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_PDCP_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
"0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u",
|
||||
ctxt_pP->rnti,
|
||||
rb_id + 4,
|
||||
sdu_buffer_sizeP - payload_offset);
|
||||
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
|
||||
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
|
||||
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
|
||||
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY");
|
||||
memcpy(>pu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], &sdu_buffer_pP->data[payload_offset], sdu_buffer_sizeP - payload_offset);
|
||||
message_p = itti_alloc_new_message(TASK_PDCP_ENB, GTPV1U_ENB_TUNNEL_DATA_REQ);
|
||||
AssertFatal(message_p != NULL, "OUT OF MEMORY");
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
|
||||
packet_forwarded = TRUE;
|
||||
}
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_PDCP_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
"0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u",
|
||||
ctxt_pP->rnti,
|
||||
rb_id + 4,
|
||||
sdu_buffer_sizeP - payload_offset);
|
||||
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
|
||||
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
|
||||
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
|
||||
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY");
|
||||
memcpy(>pu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], &sdu_buffer_pP->data[payload_offset], sdu_buffer_sizeP - payload_offset);
|
||||
message_p = itti_alloc_new_message(TASK_PDCP_ENB, GTPV1U_ENB_TUNNEL_DATA_REQ);
|
||||
AssertFatal(message_p != NULL, "OUT OF MEMORY");
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
|
||||
packet_forwarded = TRUE;
|
||||
}
|
||||
} else {
|
||||
packet_forwarded = FALSE;
|
||||
packet_forwarded = FALSE;
|
||||
}
|
||||
|
||||
#ifdef MBMS_MULTICAST_OUT
|
||||
@@ -1035,28 +999,28 @@ pdcp_data_ind(
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->rb_id = rb_id;
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
/* for the UE compiled in S1 mode, we need 1 here
|
||||
* for the UE compiled in noS1 mode, we need 0
|
||||
* TODO: be sure of this
|
||||
*/
|
||||
if (nfapi_mode == 3) {
|
||||
/* for the UE compiled in S1 mode, we need 1 here
|
||||
* for the UE compiled in noS1 mode, we need 0
|
||||
* TODO: be sure of this
|
||||
*/
|
||||
if (NFAPI_MODE == NFAPI_UE_STUB_PNF ) {
|
||||
#ifdef UESIM_EXPANSION
|
||||
|
||||
if (UE_NAS_USE_TUN) {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
} else {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 0;
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 0;
|
||||
}
|
||||
|
||||
#else
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
#endif
|
||||
} else { // nfapi_mode
|
||||
if (UE_NAS_USE_TUN) {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
} else {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 1;
|
||||
}
|
||||
} else {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 1;
|
||||
}
|
||||
} // nfapi_mode
|
||||
}
|
||||
} else {
|
||||
@@ -1065,9 +1029,9 @@ pdcp_data_ind(
|
||||
}
|
||||
|
||||
if( LOG_DEBUGFLAG(DEBUG_PDCP) ) {
|
||||
static uint32_t pdcp_inst = 0;
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = pdcp_inst++;
|
||||
LOG_D(PDCP, "inst=%d size=%d\n", ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst, ((pdcp_data_ind_header_t *) new_sdu_p->data)->data_size);
|
||||
static uint32_t pdcp_inst = 0;
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = pdcp_inst++;
|
||||
LOG_D(PDCP, "inst=%d size=%d\n", ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst, ((pdcp_data_ind_header_t *) new_sdu_p->data)->data_size);
|
||||
}
|
||||
|
||||
memcpy(&new_sdu_p->data[sizeof (pdcp_data_ind_header_t)],
|
||||
@@ -1082,35 +1046,23 @@ pdcp_data_ind(
|
||||
sdu_buffer_sizeP - payload_offset);
|
||||
//util_print_hex_octets(PDCP, &new_sdu_p->data[sizeof (pdcp_data_ind_header_t)], sdu_buffer_sizeP - payload_offset);
|
||||
//util_flush_hex_octets(PDCP, &new_sdu_p->data[sizeof (pdcp_data_ind_header_t)], sdu_buffer_sizeP - payload_offset);
|
||||
|
||||
#if defined(STOP_ON_IP_TRAFFIC_OVERLOAD)
|
||||
/* This was an "orphan else" in tag 2019.w07 and discovered during merge.
|
||||
* Commenting so it could be reintegrated. */
|
||||
//else {
|
||||
// AssertFatal(0, PROTOCOL_PDCP_CTXT_FMT" PDCP_DATA_IND SDU DROPPED, OUT OF MEMORY \n",
|
||||
// PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
//}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Update PDCP statistics */
|
||||
for (pdcp_uid=0; pdcp_uid< MAX_MOBILES_PER_ENB;pdcp_uid++){
|
||||
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti ){
|
||||
for (pdcp_uid=0; pdcp_uid< MAX_MOBILES_PER_ENB; pdcp_uid++) {
|
||||
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Pdcp_stats_rx[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
|
||||
Pdcp_stats_rx_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
|
||||
Pdcp_stats_rx_bytes[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(sdu_buffer_sizeP - payload_offset);
|
||||
Pdcp_stats_rx_bytes_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(sdu_buffer_sizeP - payload_offset);
|
||||
|
||||
Pdcp_stats_rx_sn[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=sequence_number;
|
||||
Pdcp_stats_rx_aiat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
|
||||
Pdcp_stats_rx_aiat_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
|
||||
Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=pdcp_enb[ctxt_pP->module_id].sfn;
|
||||
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
|
||||
if (ctxt_pP->enb_flag) {
|
||||
@@ -1296,8 +1248,7 @@ pdcp_run (
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_RUN, VCD_FUNCTION_OUT);
|
||||
}
|
||||
|
||||
void pdcp_init_stats_UE(module_id_t mod, uint16_t uid)
|
||||
{
|
||||
void pdcp_init_stats_UE(module_id_t mod, uint16_t uid) {
|
||||
Pdcp_stats_tx_window_ms[mod][uid] = 100;
|
||||
Pdcp_stats_rx_window_ms[mod][uid] = 100;
|
||||
|
||||
@@ -1314,7 +1265,6 @@ void pdcp_init_stats_UE(module_id_t mod, uint16_t uid)
|
||||
Pdcp_stats_tx_aiat_w[mod][uid][i] = 0;
|
||||
Pdcp_stats_tx_aiat_tmp_w[mod][uid][i] = 0;
|
||||
Pdcp_stats_tx_iat[mod][uid][i] = 0;
|
||||
|
||||
Pdcp_stats_rx[mod][uid][i] = 0;
|
||||
Pdcp_stats_rx_w[mod][uid][i] = 0;
|
||||
Pdcp_stats_rx_tmp_w[mod][uid][i] = 0;
|
||||
@@ -2186,6 +2136,16 @@ rrc_pdcp_config_req (
|
||||
}
|
||||
}
|
||||
|
||||
pdcp_data_ind_func_t get_pdcp_data_ind_func() {
|
||||
return pdcp_params.pdcp_data_ind_func;
|
||||
}
|
||||
|
||||
void pdcp_set_rlc_funcptr(send_rlc_data_req_func_t send_rlc_data_req,
|
||||
pdcp_data_ind_func_t pdcp_data_ind) {
|
||||
pdcp_params.send_rlc_data_req_func = send_rlc_data_req;
|
||||
pdcp_params.pdcp_data_ind_func = pdcp_data_ind;
|
||||
}
|
||||
|
||||
uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
|
||||
/* temporary enforce netlink when UE_NAS_USE_TUN is set,
|
||||
this is while switching from noS1 as build option
|
||||
@@ -2203,10 +2163,11 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
|
||||
nas_getparams();
|
||||
|
||||
if(UE_NAS_USE_TUN) {
|
||||
netlink_init_tun("ue");
|
||||
int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 )?MAX_NUMBER_NETIF:1;
|
||||
netlink_init_tun("ue",num_if);
|
||||
LOG_I(PDCP, "UE pdcp will use tun interface\n");
|
||||
} else if(ENB_NAS_USE_TUN) {
|
||||
netlink_init_tun("enb");
|
||||
netlink_init_tun("enb",1);
|
||||
nas_config(1, 1, 1, "enb");
|
||||
LOG_I(PDCP, "ENB pdcp will use tun interface\n");
|
||||
} else {
|
||||
@@ -2215,6 +2176,8 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
|
||||
}
|
||||
}
|
||||
|
||||
/* default interface with rlc (will be modified if CU) */
|
||||
pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)rlc_data_req, pdcp_data_ind);
|
||||
return pdcp_params.optmask ;
|
||||
}
|
||||
|
||||
@@ -2301,6 +2264,7 @@ void pdcp_layer_init(void)
|
||||
memset(pdcp_enb, 0, sizeof(pdcp_enb_t));
|
||||
memset(Pdcp_stats_tx_window_ms, 0, sizeof(Pdcp_stats_tx_window_ms));
|
||||
memset(Pdcp_stats_rx_window_ms, 0, sizeof(Pdcp_stats_rx_window_ms));
|
||||
|
||||
for (i = 0; i < MAX_eNB; i++) {
|
||||
for (j = 0; j < MAX_MOBILES_PER_ENB; j++) {
|
||||
Pdcp_stats_tx_window_ms[i][j]=100;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* \version 1.0
|
||||
*/
|
||||
|
||||
/** @defgroup _pdcp PDCP
|
||||
/** @defgroup _pdcp PDCP
|
||||
* @ingroup _oai2
|
||||
* @{
|
||||
*/
|
||||
@@ -51,6 +51,17 @@
|
||||
#include "LTE_PMCH-InfoList-r9.h"
|
||||
#endif
|
||||
|
||||
typedef rlc_op_status_t (*send_rlc_data_req_func_t)(const protocol_ctxt_t *const,
|
||||
const srb_flag_t, const MBMS_flag_t,
|
||||
const rb_id_t, const mui_t,
|
||||
confirm_t, sdu_size_t, mem_block_t *,const uint32_t *const, const uint32_t *const);
|
||||
typedef boolean_t (*pdcp_data_ind_func_t)( const protocol_ctxt_t *, const srb_flag_t,
|
||||
const MBMS_flag_t, const rb_id_t, const sdu_size_t,
|
||||
mem_block_t *,const uint32_t *const, const uint32_t *const);
|
||||
/* maximum number of tun interfaces that will be created to emulates UEs */
|
||||
/* UEs beyond that will be multiplexed on the same tun */
|
||||
#define MAX_NUMBER_NETIF 16
|
||||
|
||||
#define PDCP_USE_NETLINK_BIT (1<< 11)
|
||||
#define LINK_ENB_PDCP_TO_IP_DRIVER_BIT (1<< 13)
|
||||
#define LINK_ENB_PDCP_TO_GTPV1U_BIT (1<< 14)
|
||||
@@ -58,8 +69,12 @@
|
||||
#define ENB_NAS_USE_TUN_BIT (1<< 16)
|
||||
typedef struct {
|
||||
uint64_t optmask;
|
||||
send_rlc_data_req_func_t send_rlc_data_req_func;
|
||||
pdcp_data_ind_func_t pdcp_data_ind_func;
|
||||
} pdcp_params_t;
|
||||
|
||||
|
||||
|
||||
#define PDCP_USE_NETLINK ( get_pdcp_optmask() & PDCP_USE_NETLINK_BIT)
|
||||
#define LINK_ENB_PDCP_TO_IP_DRIVER ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_IP_DRIVER_BIT)
|
||||
#define LINK_ENB_PDCP_TO_GTPV1U ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_GTPV1U_BIT)
|
||||
@@ -76,8 +91,8 @@ extern int pdcp_instance_cnt;
|
||||
#define PROTOCOL_PDCP_CTXT_FMT PROTOCOL_CTXT_FMT"[%s %02u] "
|
||||
|
||||
#define PROTOCOL_PDCP_CTXT_ARGS(CTXT_Pp, pDCP_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp),\
|
||||
(pDCP_Pp->is_srb) ? "SRB" : "DRB",\
|
||||
pDCP_Pp->rb_id
|
||||
(pDCP_Pp->is_srb) ? "SRB" : "DRB",\
|
||||
pDCP_Pp->rb_id
|
||||
int init_pdcp_thread(void);
|
||||
void cleanup_pdcp_thread(void);
|
||||
|
||||
@@ -121,12 +136,12 @@ typedef struct pdcp_enb_s {
|
||||
uint16_t uid[MAX_MOBILES_PER_ENB];
|
||||
rnti_t rnti[MAX_MOBILES_PER_ENB];
|
||||
uint16_t num_ues;
|
||||
|
||||
|
||||
uint64_t sfn;
|
||||
frame_t frame;
|
||||
sub_frame_t subframe;
|
||||
|
||||
} pdcp_enb_t;
|
||||
|
||||
} pdcp_enb_t;
|
||||
|
||||
pdcp_enb_t pdcp_enb[MAX_NUM_CCs];
|
||||
|
||||
@@ -151,7 +166,7 @@ typedef struct pdcp_s {
|
||||
boolean_t is_ue;
|
||||
boolean_t is_srb;
|
||||
|
||||
/* Configured security algorithms */
|
||||
/* Configured security algorithms */
|
||||
uint8_t cipheringAlgorithm;
|
||||
uint8_t integrityProtAlgorithm;
|
||||
|
||||
@@ -202,10 +217,6 @@ typedef struct pdcp_s {
|
||||
* which is not also a valid sequence number
|
||||
*/
|
||||
short int first_missing_pdu;
|
||||
/*
|
||||
* decipher using a different rx_hfn
|
||||
*/
|
||||
|
||||
|
||||
} pdcp_t;
|
||||
|
||||
@@ -239,13 +250,13 @@ typedef struct pdcp_mbms_s {
|
||||
*/
|
||||
boolean_t pdcp_data_req(
|
||||
protocol_ctxt_t *ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP, \
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP, \
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t mode
|
||||
const pdcp_transmission_mode_t mode
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,const uint32_t *const sourceL2Id
|
||||
,const uint32_t *const destinationL2Id
|
||||
@@ -267,10 +278,10 @@ boolean_t pdcp_data_req(
|
||||
*/
|
||||
boolean_t pdcp_data_ind(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
mem_block_t *const sdu_buffer);
|
||||
|
||||
/*! \fn void rrc_pdcp_config_req(const protocol_ctxt_t* const ,uint32_t,rb_id_t,uint8_t)
|
||||
@@ -285,10 +296,10 @@ boolean_t pdcp_data_ind(
|
||||
*/
|
||||
void rrc_pdcp_config_req (
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const uint32_t actionP,
|
||||
const rb_id_t rb_idP,
|
||||
const uint8_t security_modeP);
|
||||
const srb_flag_t srb_flagP,
|
||||
const uint32_t actionP,
|
||||
const rb_id_t rb_idP,
|
||||
const uint8_t security_modeP);
|
||||
|
||||
/*! \fn bool rrc_pdcp_config_asn1_req (const protocol_ctxt_t* const , SRB_ToAddModList_t* srb2add_list, DRB_ToAddModList_t* drb2add_list, DRB_ToReleaseList_t* drb2release_list)
|
||||
* \brief Function for RRC to configure a Radio Bearer.
|
||||
@@ -306,17 +317,17 @@ void rrc_pdcp_config_req (
|
||||
*/
|
||||
boolean_t rrc_pdcp_config_asn1_req (
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
LTE_SRB_ToAddModList_t *const srb2add_list,
|
||||
LTE_DRB_ToAddModList_t *const drb2add_list,
|
||||
LTE_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc
|
||||
LTE_SRB_ToAddModList_t *const srb2add_list,
|
||||
LTE_DRB_ToAddModList_t *const drb2add_list,
|
||||
LTE_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
#endif
|
||||
,rb_id_t *const defaultDRB
|
||||
,rb_id_t *const defaultDRB
|
||||
);
|
||||
|
||||
/*! \fn boolean_t pdcp_config_req_asn1 (const protocol_ctxt_t* const ctxt_pP, srb_flag_t srb_flagP, uint32_t action, rb_id_t rb_id, uint8_t rb_sn, uint8_t rb_report, uint16_t header_compression_profile, uint8_t security_mode)
|
||||
@@ -341,20 +352,20 @@ boolean_t rrc_pdcp_config_asn1_req (
|
||||
*/
|
||||
boolean_t pdcp_config_req_asn1 (
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
pdcp_t *const pdcp_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rlc_mode_t rlc_mode,
|
||||
const uint32_t action,
|
||||
const uint16_t lc_id,
|
||||
const uint16_t mch_id,
|
||||
const rb_id_t rb_id,
|
||||
const uint8_t rb_sn,
|
||||
const uint8_t rb_report,
|
||||
const uint16_t header_compression_profile,
|
||||
const uint8_t security_mode,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc);
|
||||
pdcp_t *const pdcp_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rlc_mode_t rlc_mode,
|
||||
const uint32_t action,
|
||||
const uint16_t lc_id,
|
||||
const uint16_t mch_id,
|
||||
const rb_id_t rb_id,
|
||||
const uint8_t rb_sn,
|
||||
const uint8_t rb_report,
|
||||
const uint16_t header_compression_profile,
|
||||
const uint8_t security_mode,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc);
|
||||
|
||||
/*! \fn void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP)
|
||||
* \brief Function (for RRC) to add a new UE in PDCP module
|
||||
@@ -362,9 +373,9 @@ boolean_t pdcp_config_req_asn1 (
|
||||
* \return A status about the processing, OK or error code.
|
||||
*/
|
||||
void pdcp_add_UE(const protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
|
||||
/*! \fn boolean_t pdcp_remove_UE(const protocol_ctxt_t* const ctxt_pP)
|
||||
* \brief Function for RRC to remove UE from PDCP module hashtable
|
||||
* \brief Function for RRC to remove UE from PDCP module hashtable
|
||||
* \param[in] ctxt_pP Running context.
|
||||
* \return A status about the processing, OK or error code.
|
||||
*/
|
||||
@@ -401,7 +412,9 @@ int pdcp_fifo_flush_sdus ( const protocol_ctxt_t *const ct
|
||||
int pdcp_fifo_read_input_sdus_remaining_bytes ( const protocol_ctxt_t *const ctxt_pP);
|
||||
int pdcp_fifo_read_input_sdus ( const protocol_ctxt_t *const ctxt_pP);
|
||||
void pdcp_fifo_read_input_sdus_from_otg ( const protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
void pdcp_set_rlc_funcptr(send_rlc_data_req_func_t send_rlc_data_req,
|
||||
pdcp_data_ind_func_t pdcp_data_ind);
|
||||
pdcp_data_ind_func_t get_pdcp_data_ind_func(void);
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
@@ -449,26 +462,26 @@ struct sockaddr_in pdcp_sin;
|
||||
void pdcp_pc5_socket_init(void);
|
||||
|
||||
typedef struct {
|
||||
rb_id_t rb_id;
|
||||
sdu_size_t data_size;
|
||||
signed int inst;
|
||||
ip_traffic_type_t traffic_type;
|
||||
uint32_t sourceL2Id;
|
||||
uint32_t destinationL2Id;
|
||||
rb_id_t rb_id;
|
||||
sdu_size_t data_size;
|
||||
signed int inst;
|
||||
ip_traffic_type_t traffic_type;
|
||||
uint32_t sourceL2Id;
|
||||
uint32_t destinationL2Id;
|
||||
} __attribute__((__packed__)) pc5s_header_t;
|
||||
|
||||
//new PC5S-message
|
||||
typedef struct {
|
||||
unsigned char bytes[PC5_SIGNALLING_PAYLOAD_SIZE];
|
||||
unsigned char bytes[PC5_SIGNALLING_PAYLOAD_SIZE];
|
||||
} __attribute__((__packed__)) PC5SignallingMessage ;
|
||||
|
||||
//example of PC5-S messages
|
||||
typedef struct {
|
||||
pc5s_header_t pc5s_header;
|
||||
union {
|
||||
uint8_t status;
|
||||
PC5SignallingMessage pc5_signalling_message;
|
||||
} pc5sPrimitive;
|
||||
pc5s_header_t pc5s_header;
|
||||
union {
|
||||
uint8_t status;
|
||||
PC5SignallingMessage pc5_signalling_message;
|
||||
} pc5sPrimitive;
|
||||
} __attribute__((__packed__)) sidelink_pc5s_element;
|
||||
|
||||
|
||||
@@ -513,33 +526,33 @@ sdu_size_t pdcp_input_sdu_size_read;
|
||||
sdu_size_t pdcp_input_sdu_remaining_size_to_read;
|
||||
|
||||
#define PDCP_COLL_KEY_VALUE(mODULE_iD, rNTI, iS_eNB, rB_iD, iS_sRB) \
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(rB_iD)) << 25) | \
|
||||
(((hash_key_t)(iS_sRB)) << 33) | \
|
||||
(((hash_key_t)(0x55)) << 34))
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(rB_iD)) << 25) | \
|
||||
(((hash_key_t)(iS_sRB)) << 33) | \
|
||||
(((hash_key_t)(0x55)) << 34))
|
||||
|
||||
// hash key to the same PDCP as indexed by PDCP_COLL_KEY_VALUE(... rB_iD, iS_sRB=0) where rB_iD
|
||||
// is the default DRB ID. The hidden code 0x55 indicates the key is indexed by (rB_iD,is_sRB)
|
||||
// whereas the hidden code 0xaa indicates the key is for default DRB only
|
||||
#define PDCP_COLL_KEY_DEFAULT_DRB_VALUE(mODULE_iD, rNTI, iS_eNB) \
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(0xff)) << 25) | \
|
||||
(((hash_key_t)(0x00)) << 33) | \
|
||||
(((hash_key_t)(0xaa)) << 34))
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(0xff)) << 25) | \
|
||||
(((hash_key_t)(0x00)) << 33) | \
|
||||
(((hash_key_t)(0xaa)) << 34))
|
||||
|
||||
// service id max val is maxServiceCount = 16 (asn1_constants.h)
|
||||
|
||||
#define PDCP_COLL_KEY_MBMS_VALUE(mODULE_iD, rNTI, iS_eNB, sERVICE_ID, sESSION_ID) \
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(sERVICE_ID)) << 32) | \
|
||||
(((hash_key_t)(sESSION_ID)) << 37) | \
|
||||
(((hash_key_t)(0x0000000000000001)) << 63))
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(sERVICE_ID)) << 32) | \
|
||||
(((hash_key_t)(sESSION_ID)) << 37) | \
|
||||
(((hash_key_t)(0x0000000000000001)) << 63))
|
||||
|
||||
extern hash_table_t *pdcp_coll_p;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@
|
||||
#include "proto_agent.h"
|
||||
#include "assertions.h"
|
||||
#include "proto_agent_net_comm.h"
|
||||
#include "proto_agent_async.h"
|
||||
#include "proto_agent_async.h"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
@@ -49,58 +49,53 @@ proto_agent_instance_t proto_agent[MAX_DU];
|
||||
|
||||
pthread_t new_thread(void *(*f)(void *), void *b);
|
||||
|
||||
Protocol__FlexsplitMessage *proto_agent_timeout_fsp(void* args);
|
||||
Protocol__FlexsplitMessage *proto_agent_timeout_fsp(void *args);
|
||||
|
||||
#define TEST_MOD 0
|
||||
|
||||
#define ECHO
|
||||
|
||||
/* Server side function; upon a new connection
|
||||
/* Server side function; upon a new connection
|
||||
reception, sends the hello packets
|
||||
*/
|
||||
int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p)
|
||||
{
|
||||
int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) {
|
||||
int channel_id;
|
||||
|
||||
// RS: CUDU does not work!
|
||||
//DevAssert(p->local_interface);
|
||||
//DevAssert(p->local_ipv4_address);
|
||||
//DevAssert(p->local_port > 1024); // "unprivileged" port
|
||||
//DevAssert(p->remote_ipv4_address);
|
||||
//DevAssert(p->remote_port > 1024); // "unprivileged" port
|
||||
|
||||
proto_agent[mod_id].mod_id = mod_id;
|
||||
proto_agent[mod_id].exit = 0;
|
||||
|
||||
/* Initialize the channel container */
|
||||
|
||||
/* TODO only initialize the first time */
|
||||
proto_agent_init_channel_container();
|
||||
|
||||
/*Create the async channel info*/
|
||||
proto_agent_async_channel_t *channel_info;
|
||||
channel_info = proto_agent_async_channel_info(mod_id, p->local_ipv4_address, p->local_port,
|
||||
p->remote_ipv4_address, p->remote_port);
|
||||
p->remote_ipv4_address, p->remote_port);
|
||||
|
||||
if (!channel_info) goto error;
|
||||
|
||||
|
||||
/* Create a channel using the async channel info */
|
||||
channel_id = proto_agent_create_channel((void *) channel_info,
|
||||
proto_agent_async_msg_send,
|
||||
proto_agent_async_msg_recv,
|
||||
proto_agent_async_release);
|
||||
proto_agent_async_msg_send,
|
||||
proto_agent_async_msg_recv,
|
||||
proto_agent_async_release);
|
||||
|
||||
if (channel_id <= 0) goto error;
|
||||
|
||||
proto_agent_channel_t *channel = proto_agent_get_channel(channel_id);
|
||||
if (!channel) goto error;
|
||||
proto_agent[mod_id].channel = channel;
|
||||
|
||||
if (!channel) goto error;
|
||||
|
||||
proto_agent[mod_id].channel = channel;
|
||||
/* Register the channel for all underlying agents (use ENB_AGENT_MAX) */
|
||||
proto_agent_register_channel(mod_id, channel, ENB_AGENT_MAX);
|
||||
|
||||
// Code for sending the HELLO/ECHO_REQ message once a connection is established
|
||||
//uint8_t *msg = NULL;
|
||||
//Protocol__FlexsplitMessage *init_msg=NULL;
|
||||
|
||||
//if (udp == 0)
|
||||
//{
|
||||
// // If the comm is not UDP, allow the server to send the first packet over the channel
|
||||
@@ -112,7 +107,6 @@ int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p)
|
||||
// int msgsize = 0;
|
||||
// if (init_msg != NULL)
|
||||
// msg = proto_agent_pack_message(init_msg, &msgsize);
|
||||
|
||||
// if (msg!= NULL)
|
||||
// {
|
||||
// LOG_D(PROTO_AGENT, "Server sending the message over the async channel\n");
|
||||
@@ -122,23 +116,18 @@ int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p)
|
||||
// the server thread blocks until it reads any data
|
||||
// over the channel
|
||||
// */
|
||||
|
||||
//}
|
||||
|
||||
proto_agent[mod_id].recv_thread = new_thread(proto_agent_receive, &proto_agent[mod_id]);
|
||||
|
||||
fprintf(stderr, "[PROTO_AGENT] server started at port %s:%d\n", p->local_ipv4_address, p->local_port);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
LOG_E(PROTO_AGENT, "there was an error\n");
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
void proto_agent_stop(mod_id_t mod_id)
|
||||
{
|
||||
void proto_agent_stop(mod_id_t mod_id) {
|
||||
if (!proto_agent[mod_id].channel) return;
|
||||
|
||||
/* unlock the independent read thread proto_agent_receive() */
|
||||
proto_agent[mod_id].exit = 1;
|
||||
proto_agent_async_msg_recv_unlock(proto_agent[mod_id].channel->channel_info);
|
||||
@@ -171,22 +160,19 @@ void proto_agent_stop(mod_id_t mod_id)
|
||||
//}
|
||||
|
||||
|
||||
void
|
||||
proto_agent_send_rlc_data_req(const protocol_ctxt_t* const ctxt_pP,
|
||||
const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP, const mui_t muiP,
|
||||
confirm_t confirmP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP)
|
||||
{
|
||||
|
||||
rlc_op_status_t proto_agent_send_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP, const mui_t muiP,
|
||||
confirm_t confirmP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP) {
|
||||
uint8_t *msg = NULL;
|
||||
Protocol__FlexsplitMessage *init_msg=NULL;
|
||||
int msg_flag = 0;
|
||||
int msgsize = 0;
|
||||
mod_id_t mod_id = ctxt_pP->module_id;
|
||||
data_req_args args;
|
||||
|
||||
DevAssert(proto_agent[mod_id].channel);
|
||||
DevAssert(proto_agent[mod_id].channel->channel_info);
|
||||
|
||||
args.ctxt = ctxt_pP;
|
||||
args.srb_flag = srb_flagP;
|
||||
args.MBMS_flag = MBMS_flagP;
|
||||
@@ -195,112 +181,103 @@ proto_agent_send_rlc_data_req(const protocol_ctxt_t* const ctxt_pP,
|
||||
args.confirm = confirmP;
|
||||
args.sdu_size = sdu_sizeP;
|
||||
args.sdu_p = sdu_pP;
|
||||
|
||||
msg_flag = proto_agent_pdcp_data_req(mod_id, (void *) &args, &init_msg);
|
||||
if (msg_flag != 0 || !init_msg) goto error;
|
||||
|
||||
msg = proto_agent_pack_message(init_msg, &msgsize);
|
||||
if (!msg) goto error;
|
||||
|
||||
proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info);
|
||||
|
||||
if (msg_flag != 0 || !init_msg) goto error;
|
||||
|
||||
msg = proto_agent_pack_message(init_msg, &msgsize);
|
||||
|
||||
if (!msg) goto error;
|
||||
|
||||
proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info);
|
||||
free_mem_block(sdu_pP, __func__);
|
||||
|
||||
return;
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(PROTO_AGENT, "PROTO_AGENT there was an error\n");
|
||||
return;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
proto_agent_send_pdcp_data_ind(const protocol_ctxt_t* const ctxt_pP, const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP)
|
||||
{
|
||||
proto_agent_send_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP, const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP) {
|
||||
uint8_t *msg = NULL;
|
||||
Protocol__FlexsplitMessage *init_msg = NULL;
|
||||
int msg_flag = 0;
|
||||
int msgsize = 0;
|
||||
mod_id_t mod_id = ctxt_pP->module_id;
|
||||
data_req_args args;
|
||||
|
||||
DevAssert(proto_agent[mod_id].channel);
|
||||
DevAssert(proto_agent[mod_id].channel->channel_info);
|
||||
|
||||
args.ctxt = ctxt_pP;
|
||||
args.srb_flag = srb_flagP;
|
||||
args.MBMS_flag = MBMS_flagP;
|
||||
args.rb_id = rb_idP;
|
||||
args.sdu_size = sdu_sizeP;
|
||||
args.sdu_p = sdu_pP;
|
||||
|
||||
msg_flag = proto_agent_pdcp_data_ind(mod_id, (void *) &args, &init_msg);
|
||||
|
||||
if (msg_flag != 0 || !init_msg) goto error;
|
||||
|
||||
msg = proto_agent_pack_message(init_msg, &msgsize);
|
||||
|
||||
if (!msg) goto error;
|
||||
|
||||
proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info);
|
||||
|
||||
free_mem_block(sdu_pP, __func__);
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
LOG_E(PROTO_AGENT, "there was an error in %s\n", __func__);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
void *
|
||||
proto_agent_receive(void *args)
|
||||
{
|
||||
proto_agent_receive(void *args) {
|
||||
proto_agent_instance_t *inst = args;
|
||||
void *data = NULL;
|
||||
int size;
|
||||
int priority;
|
||||
err_code_t err_code;
|
||||
|
||||
pthread_setname_np(pthread_self(), "proto_rx");
|
||||
Protocol__FlexsplitMessage *msg;
|
||||
uint8_t *ser_msg;
|
||||
|
||||
|
||||
while (1) {
|
||||
|
||||
msg = NULL;
|
||||
ser_msg = NULL;
|
||||
|
||||
if ((size = proto_agent_async_msg_recv(&data, &priority, inst->channel->channel_info)) < 0){
|
||||
|
||||
if ((size = proto_agent_async_msg_recv(&data, &priority, inst->channel->channel_info)) < 0) {
|
||||
err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENQUEUING;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (inst->exit) break;
|
||||
|
||||
LOG_D(PROTO_AGENT, "Server side Received message with size %d and priority %d, calling message handle\n", size, priority);
|
||||
|
||||
msg = proto_agent_handle_message(inst->mod_id, data, size);
|
||||
|
||||
if (!msg) {
|
||||
LOG_D(PROTO_AGENT, "msg to send back is NULL\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
ser_msg = proto_agent_pack_message(msg, &size);
|
||||
|
||||
if (!ser_msg) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
LOG_D(PROTO_AGENT, "Server sending the reply message over the async channel\n");
|
||||
if (proto_agent_async_msg_send((void *)ser_msg, (int) size, 1, inst->channel->channel_info)){
|
||||
|
||||
if (proto_agent_async_msg_send((void *)ser_msg, (int) size, 1, inst->channel->channel_info)) {
|
||||
err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENQUEUING;
|
||||
goto error;
|
||||
}
|
||||
|
||||
LOG_D(PROTO_AGENT, "sent message with size %d\n", size);
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
return NULL;
|
||||
error:
|
||||
LOG_E(PROTO_AGENT, "proto_agent_receive(): error %d occured\n",err_code);
|
||||
return NULL;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file proto_agent.h
|
||||
* \brief top level protocol agent
|
||||
* \brief top level protocol agent
|
||||
* \author Navid Nikaein and Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
@@ -41,18 +41,18 @@
|
||||
#include "proto_agent_common.h"
|
||||
|
||||
|
||||
void * proto_agent_receive(void *args);
|
||||
void *proto_agent_receive(void *args);
|
||||
|
||||
int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p);
|
||||
void proto_agent_stop(mod_id_t mod_id);
|
||||
|
||||
void proto_agent_send_rlc_data_req( const protocol_ctxt_t* const ctxt_pP,
|
||||
rlc_op_status_t proto_agent_send_rlc_data_req( const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP, const mui_t muiP, confirm_t confirmP,
|
||||
sdu_size_t sdu_sizeP, mem_block_t *sdu_pP);
|
||||
|
||||
void proto_agent_send_pdcp_data_ind(const protocol_ctxt_t* const ctxt_pP,
|
||||
const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP);
|
||||
void proto_agent_send_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP);
|
||||
|
||||
#endif
|
||||
|
||||
+19
-28
@@ -330,8 +330,6 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
|
||||
#endif
|
||||
) {
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
mem_block_t *new_sdu_p = NULL;
|
||||
rlc_mode_t rlc_mode = RLC_MODE_NONE;
|
||||
rlc_union_t *rlc_union_p = NULL;
|
||||
@@ -599,34 +597,27 @@ void rlc_data_ind (
|
||||
rb_idP,
|
||||
sdu_sizeP);
|
||||
rlc_util_print_hex_octets(RLC, (unsigned char *)sdu_pP->data, sdu_sizeP);
|
||||
|
||||
if (ctxt_pP->enb_flag) {
|
||||
#if T_TRACER
|
||||
|
||||
if (ctxt_pP->enb_flag)
|
||||
T(T_ENB_RLC_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP));
|
||||
|
||||
#endif
|
||||
const ngran_node_t type = RC.rrc[ctxt_pP->module_id]->node_type;
|
||||
AssertFatal(type != ngran_eNB_CU && type != ngran_ng_eNB_CU && type != ngran_gNB_CU,
|
||||
"Can't be CU, bad node type %d\n", type);
|
||||
|
||||
#ifndef UETARGET
|
||||
const ngran_node_t type = RC.rrc[ctxt_pP->module_id]->node_type;
|
||||
AssertFatal(type != ngran_eNB_CU && type != ngran_ng_eNB_CU && type != ngran_gNB_CU,
|
||||
"Can't be CU, bad node type %d\n", type);
|
||||
if (NODE_IS_DU(type) && srb_flagP == 1) {
|
||||
MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, F1AP_UL_RRC_MESSAGE);
|
||||
F1AP_UL_RRC_MESSAGE(msg).rnti = ctxt_pP->rnti;
|
||||
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_idP;
|
||||
F1AP_UL_RRC_MESSAGE(msg).rrc_container = sdu_pP->data;
|
||||
F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = sdu_sizeP;
|
||||
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), msg);
|
||||
return;
|
||||
}
|
||||
} // case monolithic eNodeB or UE
|
||||
|
||||
if (NODE_IS_DU(type)) {
|
||||
if (srb_flagP == 1) {
|
||||
MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, F1AP_UL_RRC_MESSAGE);
|
||||
F1AP_UL_RRC_MESSAGE(msg).rnti = ctxt_pP->rnti;
|
||||
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_idP;
|
||||
F1AP_UL_RRC_MESSAGE(msg).rrc_container = sdu_pP->data;
|
||||
F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = sdu_sizeP;
|
||||
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), msg);
|
||||
} else {
|
||||
proto_agent_send_pdcp_data_ind (ctxt_pP, srb_flagP, MBMS_flagP, rb_idP, sdu_sizeP, sdu_pP);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{ // case monolithic eNodeB or UE
|
||||
pdcp_data_ind(ctxt_pP, srb_flagP, MBMS_flagP, rb_idP, sdu_sizeP, sdu_pP);
|
||||
}
|
||||
get_pdcp_data_ind_func()(ctxt_pP, srb_flagP, MBMS_flagP, rb_idP, sdu_sizeP, sdu_pP,NULL,NULL);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void rlc_data_conf (const protocol_ctxt_t *const ctxt_pP,
|
||||
@@ -671,12 +662,12 @@ rlc_module_init (void) {
|
||||
}
|
||||
}
|
||||
|
||||
for (k=0; k < RLC_MAX_MBMS_LC; k++) {
|
||||
for (k=0; k < RLC_MAX_MBMS_LC; k++) {
|
||||
rlc_mbms_lcid2service_session_id_eNB[0][k].service_id = 0;
|
||||
rlc_mbms_lcid2service_session_id_eNB[0][k].session_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (k=0; k < NB_RB_MBMS_MAX; k++) {
|
||||
for (k=0; k < NB_RB_MBMS_MAX; k++) {
|
||||
rlc_mbms_rbid2lcid_eNB[0][k] = RLC_LC_UNALLOCATED;
|
||||
}
|
||||
|
||||
|
||||
+393
-356
@@ -4,7 +4,7 @@
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#define MAX_IF_MODULES 100
|
||||
|
||||
IF_Module_t *if_inst[MAX_IF_MODULES];
|
||||
@@ -15,216 +15,194 @@ extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind);
|
||||
extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind);
|
||||
extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
|
||||
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
extern uint16_t sf_ahead;
|
||||
uint16_t frame_cnt=0;
|
||||
void handle_rach(UL_IND_t *UL_info) {
|
||||
int i;
|
||||
|
||||
if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) {
|
||||
|
||||
AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
|
||||
UL_info->rach_ind.rach_indication_body.number_of_preambles=0;
|
||||
LOG_D(MAC,"UL_info[Frame %d, Subframe %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->subframe, NFAPI_SFNSF2DEC(UL_info->rach_ind.sfn_sf));
|
||||
initiate_ra_proc(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf),
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf),
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,0
|
||||
,0
|
||||
#endif
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
|
||||
if (UL_info->rach_ind_br.rach_indication_body.number_of_preambles>0) {
|
||||
|
||||
AssertFatal(UL_info->rach_ind_br.rach_indication_body.number_of_preambles<5,"More than 4 preambles not supported\n");
|
||||
for (i=0;i<UL_info->rach_ind_br.rach_indication_body.number_of_preambles;i++) {
|
||||
|
||||
for (i=0; i<UL_info->rach_ind_br.rach_indication_body.number_of_preambles; i++) {
|
||||
AssertFatal(UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type>0,
|
||||
"Got regular PRACH preamble, not BL/CE\n");
|
||||
"Got regular PRACH preamble, not BL/CE\n");
|
||||
LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->subframe,
|
||||
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type-1);
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type-1);
|
||||
UL_info->rach_ind_br.rach_indication_body.number_of_preambles=0;
|
||||
|
||||
initiate_ra_proc(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.preamble,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.rnti,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type);
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.preamble,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.rnti,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type);
|
||||
}
|
||||
|
||||
UL_info->rach_ind_br.rach_indication_body.number_of_preambles=0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void handle_sr(UL_IND_t *UL_info) {
|
||||
|
||||
int i;
|
||||
|
||||
if (nfapi_mode == 1) // PNF
|
||||
{
|
||||
if (UL_info->sr_ind.sr_indication_body.number_of_srs>0)
|
||||
{
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF) { // PNF
|
||||
if (UL_info->sr_ind.sr_indication_body.number_of_srs>0) {
|
||||
oai_nfapi_sr_indication(&UL_info->sr_ind);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++)
|
||||
} else {
|
||||
for (i=0; i<UL_info->sr_ind.sr_indication_body.number_of_srs; i++)
|
||||
SR_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);
|
||||
}
|
||||
|
||||
UL_info->sr_ind.sr_indication_body.number_of_srs=0;
|
||||
}
|
||||
|
||||
void handle_cqi(UL_IND_t *UL_info) {
|
||||
|
||||
int i;
|
||||
|
||||
if (nfapi_mode == 1)
|
||||
{
|
||||
if (UL_info->cqi_ind.number_of_cqis>0)
|
||||
{
|
||||
if (NFAPI_MODE==NFAPI_MODE_PNF) {
|
||||
if (UL_info->cqi_ind.number_of_cqis>0) {
|
||||
LOG_D(PHY,"UL_info->cqi_ind.number_of_cqis:%d\n", UL_info->cqi_ind.number_of_cqis);
|
||||
nfapi_cqi_indication_t ind;
|
||||
|
||||
ind.header.message_id = NFAPI_RX_CQI_INDICATION;
|
||||
ind.sfn_sf = UL_info->frame<<4 | UL_info->subframe;
|
||||
ind.cqi_indication_body = UL_info->cqi_ind;
|
||||
|
||||
oai_nfapi_cqi_indication(&ind);
|
||||
|
||||
UL_info->cqi_ind.number_of_cqis=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++)
|
||||
} else {
|
||||
for (i=0; i<UL_info->cqi_ind.number_of_cqis; i++)
|
||||
cqi_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
|
||||
UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->subframe,
|
||||
UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
|
||||
UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
|
||||
|
||||
UL_info->cqi_ind.number_of_cqis=0;
|
||||
}
|
||||
}
|
||||
|
||||
void handle_harq(UL_IND_t *UL_info) {
|
||||
|
||||
int i;
|
||||
|
||||
if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) // PNF
|
||||
{
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) { // PNF
|
||||
//LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs);
|
||||
|
||||
int retval = oai_nfapi_harq_indication(&UL_info->harq_ind);
|
||||
|
||||
if (retval!=0)
|
||||
{
|
||||
if (retval!=0) {
|
||||
LOG_E(PHY, "Failed to encode NFAPI HARQ_IND retval:%d\n", retval);
|
||||
}
|
||||
|
||||
UL_info->harq_ind.harq_indication_body.number_of_harqs = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0;i<UL_info->harq_ind.harq_indication_body.number_of_harqs;i++)
|
||||
} else {
|
||||
for (i=0; i<UL_info->harq_ind.harq_indication_body.number_of_harqs; i++)
|
||||
harq_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf),
|
||||
&UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]);
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf),
|
||||
&UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]);
|
||||
|
||||
UL_info->harq_ind.harq_indication_body.number_of_harqs=0;
|
||||
}
|
||||
}
|
||||
|
||||
void handle_ulsch(UL_IND_t *UL_info) {
|
||||
|
||||
int i,j;
|
||||
|
||||
if(nfapi_mode == 1)
|
||||
{
|
||||
if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0)
|
||||
{
|
||||
if(NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||
if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
|
||||
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
|
||||
|
||||
oai_nfapi_crc_indication(&UL_info->crc_ind);
|
||||
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs = 0;
|
||||
}
|
||||
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0)
|
||||
{
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0) {
|
||||
//LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
|
||||
oai_nfapi_rx_ind(&UL_info->rx_ind);
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
|
||||
for (i=0;i<UL_info->rx_ind.rx_indication_body.number_of_pdus;i++) {
|
||||
for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) {
|
||||
for (i=0; i<UL_info->rx_ind.rx_indication_body.number_of_pdus; i++) {
|
||||
for (j=0; j<UL_info->crc_ind.crc_indication_body.number_of_crcs; j++) {
|
||||
// find crc_indication j corresponding rx_indication i
|
||||
LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti);
|
||||
LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j,
|
||||
UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti);
|
||||
|
||||
if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti) {
|
||||
LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag);
|
||||
|
||||
if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
|
||||
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe);
|
||||
rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
(uint8_t *)NULL,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
else {
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
(uint8_t *)NULL,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
} else {
|
||||
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe);
|
||||
rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
|
||||
break;
|
||||
} //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
|
||||
// UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti)
|
||||
} // for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++)
|
||||
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
|
||||
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs=0;
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
} // UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->subframe && UL_info->crc_ind.crc_indication_body.number_of_crcs>0
|
||||
else if (UL_info->rx_ind.rx_indication_body.number_of_pdus!=0 || UL_info->crc_ind.crc_indication_body.number_of_crcs!=0) {
|
||||
LOG_E(PHY,"hoping not to have mis-match between CRC ind and RX ind - hopefully the missing message is coming shortly rx_ind:%d(SFN/SF:%05d) crc_ind:%d(SFN/SF:%05d) UL_info(SFN/SF):%04d%d\n",
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf),
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf),
|
||||
UL_info->frame, UL_info->subframe);
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf),
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf),
|
||||
UL_info->frame, UL_info->subframe);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -246,257 +224,334 @@ static char s[SMAX];
|
||||
static int size;
|
||||
static int maxsize = SMAX;
|
||||
|
||||
static void put(char x)
|
||||
{
|
||||
if (size == maxsize) { printf("incrase SMAX\n"); exit(1); }
|
||||
static void put(char x) {
|
||||
if (size == maxsize) {
|
||||
printf("incrase SMAX\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
s[size++] = x;
|
||||
}
|
||||
|
||||
static void append_string(char *t)
|
||||
{
|
||||
static void append_string(char *t) {
|
||||
size--;
|
||||
|
||||
while (*t) put(*t++);
|
||||
|
||||
put(0);
|
||||
}
|
||||
|
||||
static void dump_ul(UL_IND_t *u)
|
||||
{
|
||||
static void dump_ul(UL_IND_t *u) {
|
||||
int i;
|
||||
|
||||
C;
|
||||
A("XXXX UL mod %d CC %d f.sf %d.%d\n",
|
||||
u->module_id, u->CC_id, u->frame, u->subframe);
|
||||
|
||||
A("XXXX harq_ind %d\n", u->harq_ind.harq_indication_body.number_of_harqs);
|
||||
for (i = 0; i < u->harq_ind.harq_indication_body.number_of_harqs; i++) {
|
||||
nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_indication_body.harq_pdu_list[i];
|
||||
A("XXXX harq ind %d\n", i);
|
||||
A("XXXX rnti %d\n", v->rx_ue_information.rnti);
|
||||
A("XXXX tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1,
|
||||
v->harq_indication_fdd_rel8.harq_tb2);
|
||||
A("XXXX number_of_ack_nack %d\n",
|
||||
v->harq_indication_fdd_rel9.number_of_ack_nack);
|
||||
A("XXXX harq[0] = %d\n",
|
||||
v->harq_indication_fdd_rel9.harq_tb_n[0]);
|
||||
A("XXXX harq ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi,
|
||||
v->ul_cqi_information.channel);
|
||||
}
|
||||
|
||||
for (i = 0; i < u->harq_ind.harq_indication_body.number_of_harqs; i++) {
|
||||
nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_indication_body.harq_pdu_list[i];
|
||||
A("XXXX harq ind %d\n", i);
|
||||
A("XXXX rnti %d\n", v->rx_ue_information.rnti);
|
||||
A("XXXX tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1,
|
||||
v->harq_indication_fdd_rel8.harq_tb2);
|
||||
A("XXXX number_of_ack_nack %d\n",
|
||||
v->harq_indication_fdd_rel9.number_of_ack_nack);
|
||||
A("XXXX harq[0] = %d\n",
|
||||
v->harq_indication_fdd_rel9.harq_tb_n[0]);
|
||||
A("XXXX harq ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi,
|
||||
v->ul_cqi_information.channel);
|
||||
}
|
||||
|
||||
A("XXXX crc_ind %d\n", u->crc_ind.crc_indication_body.number_of_crcs);
|
||||
|
||||
A("XXXX sr_ind %d\n", u->sr_ind.sr_indication_body.number_of_srs);
|
||||
|
||||
A("XXXX cqi_ind %d\n", u->cqi_ind.number_of_cqis);
|
||||
for (i = 0; i < u->cqi_ind.number_of_cqis; i++) {
|
||||
nfapi_cqi_indication_pdu_t *v = &u->cqi_ind.cqi_pdu_list[i];
|
||||
A("XXXX cqi ind %d\n", i);
|
||||
A("XXXX cqi ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi,
|
||||
v->ul_cqi_information.channel);
|
||||
}
|
||||
|
||||
for (i = 0; i < u->cqi_ind.number_of_cqis; i++) {
|
||||
nfapi_cqi_indication_pdu_t *v = &u->cqi_ind.cqi_pdu_list[i];
|
||||
A("XXXX cqi ind %d\n", i);
|
||||
A("XXXX cqi ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi,
|
||||
v->ul_cqi_information.channel);
|
||||
}
|
||||
|
||||
A("XXXX rach_ind %d\n", u->rach_ind.rach_indication_body.number_of_preambles);
|
||||
|
||||
A("XXXX rx_ind %d\n", u->rx_ind.rx_indication_body.number_of_pdus);
|
||||
for (i = 0; i < u->rx_ind.rx_indication_body.number_of_pdus; i++) {
|
||||
nfapi_rx_indication_pdu_t *v = &u->rx_ind.rx_indication_body.rx_pdu_list[i];
|
||||
A("XXXX rx ind %d\n", i);
|
||||
A("XXXX timing_advance %d\n",
|
||||
v->rx_indication_rel8.timing_advance);
|
||||
A("XXXX rx ul_cqi %d\n", v->rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
|
||||
for (i = 0; i < u->rx_ind.rx_indication_body.number_of_pdus; i++) {
|
||||
nfapi_rx_indication_pdu_t *v = &u->rx_ind.rx_indication_body.rx_pdu_list[i];
|
||||
A("XXXX rx ind %d\n", i);
|
||||
A("XXXX timing_advance %d\n",
|
||||
v->rx_indication_rel8.timing_advance);
|
||||
A("XXXX rx ul_cqi %d\n", v->rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
|
||||
LOG_I(PHY, "XXXX UL\nXXXX UL\n%s", s);
|
||||
}
|
||||
|
||||
static char *DL_PDU_TYPE(int x)
|
||||
{
|
||||
static char *DL_PDU_TYPE(int x) {
|
||||
switch (x) {
|
||||
case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: return "NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_BCH_PDU_TYPE: return "NFAPI_DL_CONFIG_BCH_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_MCH_PDU_TYPE: return "NFAPI_DL_CONFIG_MCH_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: return "NFAPI_DL_CONFIG_DLSCH_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_PCH_PDU_TYPE: return "NFAPI_DL_CONFIG_PCH_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_PRS_PDU_TYPE: return "NFAPI_DL_CONFIG_PRS_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE: return "NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE: return "NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: return "NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_NBCH_PDU_TYPE: return "NFAPI_DL_CONFIG_NBCH_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE: return "NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE: return "NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE";
|
||||
case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_BCH_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_BCH_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_MCH_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_MCH_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_DLSCH_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_PCH_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_PCH_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_PRS_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_PRS_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_NBCH_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_NBCH_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE";
|
||||
|
||||
case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE:
|
||||
return "NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE";
|
||||
}
|
||||
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
static char *UL_PDU_TYPE(int x)
|
||||
{
|
||||
static char *UL_PDU_TYPE(int x) {
|
||||
switch (x) {
|
||||
case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_SRS_PDU_TYPE: return "NFAPI_UL_CONFIG_SRS_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE: return "NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE: return "NFAPI_UL_CONFIG_NULSCH_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_NRACH_PDU_TYPE: return "NFAPI_UL_CONFIG_NRACH_PDU_TYPE";
|
||||
case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_ULSCH_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_SRS_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_SRS_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_NULSCH_PDU_TYPE";
|
||||
|
||||
case NFAPI_UL_CONFIG_NRACH_PDU_TYPE:
|
||||
return "NFAPI_UL_CONFIG_NRACH_PDU_TYPE";
|
||||
}
|
||||
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
static char *HI_DCI0_PDU_TYPE(int x)
|
||||
{
|
||||
static char *HI_DCI0_PDU_TYPE(int x) {
|
||||
switch (x) {
|
||||
case NFAPI_HI_DCI0_HI_PDU_TYPE: return "NFAPI_HI_DCI0_HI_PDU_TYPE";
|
||||
case NFAPI_HI_DCI0_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_DCI_PDU_TYPE";
|
||||
case NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE";
|
||||
case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE";
|
||||
case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE";
|
||||
case NFAPI_HI_DCI0_HI_PDU_TYPE:
|
||||
return "NFAPI_HI_DCI0_HI_PDU_TYPE";
|
||||
|
||||
case NFAPI_HI_DCI0_DCI_PDU_TYPE:
|
||||
return "NFAPI_HI_DCI0_DCI_PDU_TYPE";
|
||||
|
||||
case NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE:
|
||||
return "NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE";
|
||||
|
||||
case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE:
|
||||
return "NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE";
|
||||
|
||||
case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE:
|
||||
return "NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE";
|
||||
}
|
||||
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
static void dump_dl(Sched_Rsp_t *d)
|
||||
{
|
||||
static void dump_dl(Sched_Rsp_t *d) {
|
||||
int i;
|
||||
|
||||
C;
|
||||
A("XXXX DL mod %d CC %d f.sf %d.%d\n",
|
||||
d->module_id, d->CC_id, d->frame, d->subframe);
|
||||
|
||||
if (d->DL_req != NULL) {
|
||||
nfapi_dl_config_request_body_t *v=&d->DL_req->dl_config_request_body;
|
||||
nfapi_dl_config_request_pdu_t *p = v->dl_config_pdu_list;
|
||||
A("XXXX DL_req sfnsf %d\n", d->DL_req->sfn_sf);
|
||||
A("XXXX PDCCH size %d\n", v->number_pdcch_ofdm_symbols);
|
||||
A("XXXX DCIs %d\n", v->number_dci);
|
||||
A("XXXX PDUs %d\n", v->number_pdu);
|
||||
A("XXXX rntis %d\n", v->number_pdsch_rnti);
|
||||
A("XXXX pcfich power %d\n", v->transmission_power_pcfich);
|
||||
for (i = 0; i < v->number_pdu; i++) {
|
||||
A("XXXX pdu %d\n", i);
|
||||
A("XXXX type %d %s\n", p[i].pdu_type, DL_PDU_TYPE(p[i].pdu_type));
|
||||
switch (p[i].pdu_type) {
|
||||
case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: {
|
||||
nfapi_dl_config_dci_dl_pdu_rel8_t *q =
|
||||
&p[i].dci_dl_pdu.dci_dl_pdu_rel8;
|
||||
A("XXXX dci format %d\n", q->dci_format);
|
||||
A("XXXX cce idx %d\n", q->cce_idx);
|
||||
A("XXXX agg lvl %d\n", q->aggregation_level);
|
||||
A("XXXX rnti %d\n", q->rnti);
|
||||
A("XXXX rb coding %8.8x\n", q->resource_block_coding);
|
||||
A("XXXX mcs_1 %d\n", q->mcs_1);
|
||||
A("XXXX rv_1 %d\n", q->redundancy_version_1);
|
||||
A("XXXX ndi_1 %d\n", q->new_data_indicator_1);
|
||||
A("XXXX harq pid %d\n", q->harq_process);
|
||||
A("XXXX tpc %d\n", q->tpc);
|
||||
A("XXXX tbs idx %d\n", q->transport_block_size_index);
|
||||
A("XXXX dl pow off %d\n", q->downlink_power_offset);
|
||||
A("XXXX rnti type %d\n", q->rnti_type);
|
||||
A("XXXX xmit pow %d\n", q->transmission_power);
|
||||
break;
|
||||
}
|
||||
case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: {
|
||||
nfapi_dl_config_dlsch_pdu_rel8_t *q =
|
||||
&p[i].dlsch_pdu.dlsch_pdu_rel8;
|
||||
A("XXXX pdu_index %d\n", q->pdu_index);
|
||||
A("XXXX rnti %d\n", q->rnti);
|
||||
A("XXXX rv %d\n", q->redundancy_version);
|
||||
A("XXXX mcs %d\n", q->modulation);
|
||||
A("XXXX pa %d\n", q->pa);
|
||||
break;
|
||||
}}
|
||||
if (d->DL_req != NULL) {
|
||||
nfapi_dl_config_request_body_t *v=&d->DL_req->dl_config_request_body;
|
||||
nfapi_dl_config_request_pdu_t *p = v->dl_config_pdu_list;
|
||||
A("XXXX DL_req sfnsf %d\n", d->DL_req->sfn_sf);
|
||||
A("XXXX PDCCH size %d\n", v->number_pdcch_ofdm_symbols);
|
||||
A("XXXX DCIs %d\n", v->number_dci);
|
||||
A("XXXX PDUs %d\n", v->number_pdu);
|
||||
A("XXXX rntis %d\n", v->number_pdsch_rnti);
|
||||
A("XXXX pcfich power %d\n", v->transmission_power_pcfich);
|
||||
|
||||
for (i = 0; i < v->number_pdu; i++) {
|
||||
A("XXXX pdu %d\n", i);
|
||||
A("XXXX type %d %s\n", p[i].pdu_type, DL_PDU_TYPE(p[i].pdu_type));
|
||||
|
||||
switch (p[i].pdu_type) {
|
||||
case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: {
|
||||
nfapi_dl_config_dci_dl_pdu_rel8_t *q =
|
||||
&p[i].dci_dl_pdu.dci_dl_pdu_rel8;
|
||||
A("XXXX dci format %d\n", q->dci_format);
|
||||
A("XXXX cce idx %d\n", q->cce_idx);
|
||||
A("XXXX agg lvl %d\n", q->aggregation_level);
|
||||
A("XXXX rnti %d\n", q->rnti);
|
||||
A("XXXX rb coding %8.8x\n", q->resource_block_coding);
|
||||
A("XXXX mcs_1 %d\n", q->mcs_1);
|
||||
A("XXXX rv_1 %d\n", q->redundancy_version_1);
|
||||
A("XXXX ndi_1 %d\n", q->new_data_indicator_1);
|
||||
A("XXXX harq pid %d\n", q->harq_process);
|
||||
A("XXXX tpc %d\n", q->tpc);
|
||||
A("XXXX tbs idx %d\n", q->transport_block_size_index);
|
||||
A("XXXX dl pow off %d\n", q->downlink_power_offset);
|
||||
A("XXXX rnti type %d\n", q->rnti_type);
|
||||
A("XXXX xmit pow %d\n", q->transmission_power);
|
||||
break;
|
||||
}
|
||||
|
||||
case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: {
|
||||
nfapi_dl_config_dlsch_pdu_rel8_t *q =
|
||||
&p[i].dlsch_pdu.dlsch_pdu_rel8;
|
||||
A("XXXX pdu_index %d\n", q->pdu_index);
|
||||
A("XXXX rnti %d\n", q->rnti);
|
||||
A("XXXX rv %d\n", q->redundancy_version);
|
||||
A("XXXX mcs %d\n", q->modulation);
|
||||
A("XXXX pa %d\n", q->pa);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (d->HI_DCI0_req != NULL) {
|
||||
nfapi_hi_dci0_request_body_t *v=&d->HI_DCI0_req->hi_dci0_request_body;
|
||||
A("XXXX up HI_DCI0_req sfnsf %d (%d.%d)\n", d->HI_DCI0_req->sfn_sf,
|
||||
d->HI_DCI0_req->sfn_sf/16, d->HI_DCI0_req->sfn_sf%16);
|
||||
A("XXXX up sfnsf %d\n", v->sfnsf);
|
||||
A("XXXX up DCIs %d\n", v->number_of_dci);
|
||||
A("XXXX up HIs %d\n", v->number_of_hi);
|
||||
|
||||
for (i = 0; i < v->number_of_dci + v->number_of_hi; i++) {
|
||||
nfapi_hi_dci0_request_pdu_t *p = &v->hi_dci0_pdu_list[i];
|
||||
A("XXXX up pdu %d\n", i);
|
||||
A("XXXX up type %d %s\n",p->pdu_type,HI_DCI0_PDU_TYPE(p->pdu_type));
|
||||
|
||||
if (p->pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) {
|
||||
nfapi_hi_dci0_dci_pdu_rel8_t *q = &p->dci_pdu.dci_pdu_rel8;
|
||||
A("XXXX up dci_format %d\n", q->dci_format);
|
||||
A("XXXX up cce_index %d\n", q->cce_index);
|
||||
A("XXXX up aggregation_level %d\n", q->aggregation_level);
|
||||
A("XXXX up rnti %d\n", q->rnti);
|
||||
A("XXXX up rb start %d\n", q->resource_block_start);
|
||||
A("XXXX up # rb %d\n", q->number_of_resource_block);
|
||||
A("XXXX up mcs_1 %d\n", q->mcs_1);
|
||||
A("XXXX up cshift_2_for_drms %d\n", q->cyclic_shift_2_for_drms);
|
||||
A("XXXX up freq hop enabled %d\n", q->frequency_hopping_enabled_flag);
|
||||
A("XXXX up fre hop bits %d\n", q->frequency_hopping_bits);
|
||||
A("XXXX up NDI_1 %d\n", q->new_data_indication_1);
|
||||
A("XXXX up tx_antenna_seleciton %d\n", q->ue_tx_antenna_seleciton);
|
||||
A("XXXX up tpc %d\n", q->tpc);
|
||||
A("XXXX up cqi_csi_request %d\n", q->cqi_csi_request);
|
||||
A("XXXX up ul_index %d\n", q->ul_index);
|
||||
A("XXXX up dl_assignment_index %d\n", q->dl_assignment_index);
|
||||
A("XXXX up tpc_bitmap %d\n", q->tpc_bitmap);
|
||||
A("XXXX up transmission_power %d\n", q->transmission_power);
|
||||
}
|
||||
|
||||
if (d->HI_DCI0_req != NULL) {
|
||||
nfapi_hi_dci0_request_body_t *v=&d->HI_DCI0_req->hi_dci0_request_body;
|
||||
A("XXXX up HI_DCI0_req sfnsf %d (%d.%d)\n", d->HI_DCI0_req->sfn_sf,
|
||||
d->HI_DCI0_req->sfn_sf/16, d->HI_DCI0_req->sfn_sf%16);
|
||||
A("XXXX up sfnsf %d\n", v->sfnsf);
|
||||
A("XXXX up DCIs %d\n", v->number_of_dci);
|
||||
A("XXXX up HIs %d\n", v->number_of_hi);
|
||||
for (i = 0; i < v->number_of_dci + v->number_of_hi; i++) {
|
||||
nfapi_hi_dci0_request_pdu_t *p = &v->hi_dci0_pdu_list[i];
|
||||
A("XXXX up pdu %d\n", i);
|
||||
A("XXXX up type %d %s\n",p->pdu_type,HI_DCI0_PDU_TYPE(p->pdu_type));
|
||||
if (p->pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) {
|
||||
nfapi_hi_dci0_dci_pdu_rel8_t *q = &p->dci_pdu.dci_pdu_rel8;
|
||||
A("XXXX up dci_format %d\n", q->dci_format);
|
||||
A("XXXX up cce_index %d\n", q->cce_index);
|
||||
A("XXXX up aggregation_level %d\n", q->aggregation_level);
|
||||
A("XXXX up rnti %d\n", q->rnti);
|
||||
A("XXXX up rb start %d\n", q->resource_block_start);
|
||||
A("XXXX up # rb %d\n", q->number_of_resource_block);
|
||||
A("XXXX up mcs_1 %d\n", q->mcs_1);
|
||||
A("XXXX up cshift_2_for_drms %d\n", q->cyclic_shift_2_for_drms);
|
||||
A("XXXX up freq hop enabled %d\n", q->frequency_hopping_enabled_flag);
|
||||
A("XXXX up fre hop bits %d\n", q->frequency_hopping_bits);
|
||||
A("XXXX up NDI_1 %d\n", q->new_data_indication_1);
|
||||
A("XXXX up tx_antenna_seleciton %d\n", q->ue_tx_antenna_seleciton);
|
||||
A("XXXX up tpc %d\n", q->tpc);
|
||||
A("XXXX up cqi_csi_request %d\n", q->cqi_csi_request);
|
||||
A("XXXX up ul_index %d\n", q->ul_index);
|
||||
A("XXXX up dl_assignment_index %d\n", q->dl_assignment_index);
|
||||
A("XXXX up tpc_bitmap %d\n", q->tpc_bitmap);
|
||||
A("XXXX up transmission_power %d\n", q->transmission_power);
|
||||
}
|
||||
if (p->pdu_type == NFAPI_HI_DCI0_HI_PDU_TYPE) {
|
||||
nfapi_hi_dci0_hi_pdu_rel8_t *q = &p->hi_pdu.hi_pdu_rel8;
|
||||
A("XXXX up rb start %d\n", q->resource_block_start);
|
||||
A("XXXX up cs2_drms %d\n", q->cyclic_shift_2_for_drms);
|
||||
A("XXXX up ack %d\n", q->hi_value);
|
||||
A("XXXX up i_phich %d\n", q->i_phich);
|
||||
A("XXXX up power %d\n", q->transmission_power);
|
||||
}
|
||||
}
|
||||
if (p->pdu_type == NFAPI_HI_DCI0_HI_PDU_TYPE) {
|
||||
nfapi_hi_dci0_hi_pdu_rel8_t *q = &p->hi_pdu.hi_pdu_rel8;
|
||||
A("XXXX up rb start %d\n", q->resource_block_start);
|
||||
A("XXXX up cs2_drms %d\n", q->cyclic_shift_2_for_drms);
|
||||
A("XXXX up ack %d\n", q->hi_value);
|
||||
A("XXXX up i_phich %d\n", q->i_phich);
|
||||
A("XXXX up power %d\n", q->transmission_power);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (d->UL_req != NULL) {
|
||||
nfapi_ul_config_request_body_t *v=&d->UL_req->ul_config_request_body;
|
||||
A("XXXX UL_req sfnsf %d (%d.%d)\n", d->UL_req->sfn_sf,
|
||||
d->UL_req->sfn_sf/16, d->UL_req->sfn_sf%16);
|
||||
A("XXXX PDUs %d\n", v->number_of_pdus);
|
||||
A("XXXX ra freq %d\n", v->rach_prach_frequency_resources);
|
||||
A("XXXX srs? %d\n", v->srs_present);
|
||||
for (i = 0; i < v->number_of_pdus; i++) {
|
||||
nfapi_ul_config_request_pdu_t *p = &v->ul_config_pdu_list[i];
|
||||
A("XXXX pdu %d\n", i);
|
||||
A("XXXX type %d %s\n", p->pdu_type, UL_PDU_TYPE(p->pdu_type));
|
||||
switch(p->pdu_type) {
|
||||
case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: {
|
||||
nfapi_ul_config_uci_harq_pdu *q = &p->uci_harq_pdu;
|
||||
nfapi_ul_config_harq_information_rel9_fdd_t *h =
|
||||
&q->harq_information.harq_information_rel9_fdd;
|
||||
A("XXXX rnti %d\n",
|
||||
q->ue_information.ue_information_rel8.rnti);
|
||||
A("XXXX harq size %d\n", h->harq_size);
|
||||
A("XXXX ack_nack_mode %d\n", h->ack_nack_mode);
|
||||
A("XXXX # pucch res %d\n", h->number_of_pucch_resources);
|
||||
A("XXXX n_pucch_1_0 %d\n", h->n_pucch_1_0);
|
||||
A("XXXX n_pucch_1_1 %d\n", h->n_pucch_1_1);
|
||||
A("XXXX n_pucch_1_2 %d\n", h->n_pucch_1_2);
|
||||
A("XXXX n_pucch_1_3 %d\n", h->n_pucch_1_3);
|
||||
break;
|
||||
}
|
||||
case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: {
|
||||
nfapi_ul_config_uci_sr_pdu *q = &p->uci_sr_pdu;
|
||||
nfapi_ul_config_sr_information_rel8_t *h =
|
||||
&q->sr_information.sr_information_rel8;
|
||||
A("XXXX rnti %d\n",
|
||||
q->ue_information.ue_information_rel8.rnti);
|
||||
A("XXXX pucch_index %d\n", h->pucch_index);
|
||||
}}
|
||||
if (d->UL_req != NULL) {
|
||||
nfapi_ul_config_request_body_t *v=&d->UL_req->ul_config_request_body;
|
||||
A("XXXX UL_req sfnsf %d (%d.%d)\n", d->UL_req->sfn_sf,
|
||||
d->UL_req->sfn_sf/16, d->UL_req->sfn_sf%16);
|
||||
A("XXXX PDUs %d\n", v->number_of_pdus);
|
||||
A("XXXX ra freq %d\n", v->rach_prach_frequency_resources);
|
||||
A("XXXX srs? %d\n", v->srs_present);
|
||||
|
||||
for (i = 0; i < v->number_of_pdus; i++) {
|
||||
nfapi_ul_config_request_pdu_t *p = &v->ul_config_pdu_list[i];
|
||||
A("XXXX pdu %d\n", i);
|
||||
A("XXXX type %d %s\n", p->pdu_type, UL_PDU_TYPE(p->pdu_type));
|
||||
|
||||
switch(p->pdu_type) {
|
||||
case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: {
|
||||
nfapi_ul_config_uci_harq_pdu *q = &p->uci_harq_pdu;
|
||||
nfapi_ul_config_harq_information_rel9_fdd_t *h =
|
||||
&q->harq_information.harq_information_rel9_fdd;
|
||||
A("XXXX rnti %d\n",
|
||||
q->ue_information.ue_information_rel8.rnti);
|
||||
A("XXXX harq size %d\n", h->harq_size);
|
||||
A("XXXX ack_nack_mode %d\n", h->ack_nack_mode);
|
||||
A("XXXX # pucch res %d\n", h->number_of_pucch_resources);
|
||||
A("XXXX n_pucch_1_0 %d\n", h->n_pucch_1_0);
|
||||
A("XXXX n_pucch_1_1 %d\n", h->n_pucch_1_1);
|
||||
A("XXXX n_pucch_1_2 %d\n", h->n_pucch_1_2);
|
||||
A("XXXX n_pucch_1_3 %d\n", h->n_pucch_1_3);
|
||||
break;
|
||||
}
|
||||
|
||||
case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: {
|
||||
nfapi_ul_config_uci_sr_pdu *q = &p->uci_sr_pdu;
|
||||
nfapi_ul_config_sr_information_rel8_t *h =
|
||||
&q->sr_information.sr_information_rel8;
|
||||
A("XXXX rnti %d\n",
|
||||
q->ue_information.ue_information_rel8.rnti);
|
||||
A("XXXX pucch_index %d\n", h->pucch_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(PHY, "XXXX DL\nXXXX DL\n%s", s);
|
||||
}
|
||||
@@ -510,81 +565,69 @@ static void dump_dl(Sched_Rsp_t *d)
|
||||
/* debug utility functions end */
|
||||
/****************************************************************************/
|
||||
|
||||
void UL_indication(UL_IND_t *UL_info)
|
||||
{
|
||||
|
||||
void UL_indication(UL_IND_t *UL_info) {
|
||||
AssertFatal(UL_info!=NULL,"UL_INFO is null\n");
|
||||
|
||||
#ifdef DUMP_FAPI
|
||||
dump_ul(UL_info);
|
||||
#endif
|
||||
|
||||
module_id_t module_id = UL_info->module_id;
|
||||
int CC_id = UL_info->CC_id;
|
||||
Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id];
|
||||
IF_Module_t *ifi = if_inst[module_id];
|
||||
eNB_MAC_INST *mac = RC.mac[module_id];
|
||||
|
||||
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n",
|
||||
UL_info->frame,UL_info->subframe,
|
||||
module_id,CC_id,
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
|
||||
if(UL_info->frame==1023&&UL_info->subframe==6){ // dl scheduling (0,0)
|
||||
frame_cnt= (frame_cnt + 1)%7; // to prevent frame_cnt get too big
|
||||
LOG_D(MAC,"current (%d,%d) frame count dl is %d\n",UL_info->frame,UL_info->subframe,frame_cnt);
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis,
|
||||
UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
|
||||
|
||||
if(UL_info->frame==1023&&UL_info->subframe==6) { // dl scheduling (0,0)
|
||||
frame_cnt= (frame_cnt + 1)%7; // to prevent frame_cnt get too big
|
||||
LOG_D(MAC,"current (%d,%d) frame count dl is %d\n",UL_info->frame,UL_info->subframe,frame_cnt);
|
||||
}
|
||||
|
||||
if (nfapi_mode != 1)
|
||||
{
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF) {
|
||||
if (ifi->CC_mask==0) {
|
||||
ifi->current_frame = UL_info->frame;
|
||||
ifi->current_subframe = UL_info->subframe;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask);
|
||||
AssertFatal(UL_info->subframe != ifi->current_subframe,"CC_mask %x is not full and subframe has changed\n",ifi->CC_mask);
|
||||
}
|
||||
|
||||
ifi->CC_mask |= (1<<CC_id);
|
||||
}
|
||||
|
||||
|
||||
// clear DL/UL info for new scheduling round
|
||||
clear_nfapi_information(RC.mac[module_id],CC_id,
|
||||
UL_info->frame,UL_info->subframe);
|
||||
|
||||
UL_info->frame,UL_info->subframe);
|
||||
handle_rach(UL_info);
|
||||
|
||||
handle_sr(UL_info);
|
||||
|
||||
handle_cqi(UL_info);
|
||||
|
||||
handle_harq(UL_info);
|
||||
|
||||
// clear HI prior to handling ULSCH
|
||||
uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_id] , UL_info->subframe);
|
||||
if(sf_ahead_dl!=255){
|
||||
mac->HI_DCI0_req[CC_id][(UL_info->subframe+sf_ahead_dl)%10].hi_dci0_request_body.number_of_hi = 0;
|
||||
LOG_D(MAC,"current (%d,%d) clear HI_DCI0_req[0][%d]\n",UL_info->frame,UL_info->subframe,(UL_info->subframe+sf_ahead_dl)%10);
|
||||
uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_id], UL_info->subframe);
|
||||
|
||||
if(sf_ahead_dl!=255) {
|
||||
mac->HI_DCI0_req[CC_id][(UL_info->subframe+sf_ahead_dl)%10].hi_dci0_request_body.number_of_hi = 0;
|
||||
LOG_D(MAC,"current (%d,%d) clear HI_DCI0_req[0][%d]\n",UL_info->frame,UL_info->subframe,(UL_info->subframe+sf_ahead_dl)%10);
|
||||
}
|
||||
|
||||
|
||||
handle_ulsch(UL_info);
|
||||
|
||||
if (nfapi_mode != 1)
|
||||
{
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF) {
|
||||
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
|
||||
|
||||
eNB_dlsch_ulsch_scheduler(module_id,
|
||||
(UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024,
|
||||
(UL_info->subframe+sf_ahead)%10);
|
||||
|
||||
(UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024,
|
||||
(UL_info->subframe+sf_ahead)%10);
|
||||
ifi->CC_mask = 0;
|
||||
|
||||
sched_info->module_id = module_id;
|
||||
sched_info->CC_id = CC_id;
|
||||
sched_info->frame = (UL_info->frame + ((UL_info->subframe>(9-sf_ahead)) ? 1 : 0)) % 1024;
|
||||
sched_info->subframe = (UL_info->subframe+sf_ahead)%10;
|
||||
sched_info->DL_req = &mac->DL_req[CC_id];
|
||||
sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id][sched_info->subframe];
|
||||
|
||||
if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
|
||||
(is_UL_sf(&mac->common_channels[CC_id],sched_info->subframe)>0))
|
||||
sched_info->UL_req = &mac->UL_req[CC_id];
|
||||
@@ -592,17 +635,15 @@ void UL_indication(UL_IND_t *UL_info)
|
||||
sched_info->UL_req = NULL;
|
||||
|
||||
sched_info->TX_req = &mac->TX_req[CC_id];
|
||||
|
||||
#ifdef DUMP_FAPI
|
||||
dump_dl(sched_info);
|
||||
#endif
|
||||
|
||||
if (ifi->schedule_response)
|
||||
{
|
||||
if (ifi->schedule_response) {
|
||||
AssertFatal(ifi->schedule_response!=NULL,
|
||||
"schedule_response is null (mod %d, cc %d)\n",
|
||||
module_id,
|
||||
CC_id);
|
||||
"schedule_response is null (mod %d, cc %d)\n",
|
||||
module_id,
|
||||
CC_id);
|
||||
ifi->schedule_response(sched_info);
|
||||
}
|
||||
|
||||
@@ -611,28 +652,24 @@ void UL_indication(UL_IND_t *UL_info)
|
||||
}
|
||||
}
|
||||
|
||||
IF_Module_t *IF_Module_init(int Mod_id){
|
||||
|
||||
IF_Module_t *IF_Module_init(int Mod_id) {
|
||||
AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES);
|
||||
|
||||
LOG_D(PHY,"Installing callbacks for IF_Module - UL_indication\n");
|
||||
|
||||
if (if_inst[Mod_id]==NULL) {
|
||||
if_inst[Mod_id] = (IF_Module_t*)malloc(sizeof(IF_Module_t));
|
||||
memset((void*)if_inst[Mod_id],0,sizeof(IF_Module_t));
|
||||
|
||||
if_inst[Mod_id] = (IF_Module_t *)malloc(sizeof(IF_Module_t));
|
||||
memset((void *)if_inst[Mod_id],0,sizeof(IF_Module_t));
|
||||
if_inst[Mod_id]->CC_mask=0;
|
||||
if_inst[Mod_id]->UL_indication = UL_indication;
|
||||
|
||||
AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0,
|
||||
"allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
|
||||
"allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
|
||||
}
|
||||
|
||||
return if_inst[Mod_id];
|
||||
}
|
||||
|
||||
void IF_Module_kill(int Mod_id) {
|
||||
|
||||
AssertFatal(Mod_id>MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES);
|
||||
if (if_inst[Mod_id]!=NULL) free(if_inst[Mod_id]);
|
||||
|
||||
if (if_inst[Mod_id]!=NULL) free(if_inst[Mod_id]);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
//#define RRC_DATA_REQ_DEBUG
|
||||
@@ -49,21 +49,21 @@ extern RAN_CONTEXT_t RC;
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t
|
||||
rrc_data_req(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
uint8_t* const buffer_pP,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
if(sdu_sizeP == 255)
|
||||
{
|
||||
if(sdu_sizeP == 255) {
|
||||
LOG_I(RRC,"sdu_sizeP == 255");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE,
|
||||
ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE,
|
||||
@@ -74,71 +74,49 @@ rrc_data_req(
|
||||
ctxt_pP->rnti,
|
||||
muiP,
|
||||
sdu_sizeP);
|
||||
MessageDef *message_p;
|
||||
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
|
||||
uint8_t *message_buffer;
|
||||
message_buffer = itti_malloc (
|
||||
ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE,
|
||||
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
|
||||
sdu_sizeP);
|
||||
memcpy (message_buffer, buffer_pP, sdu_sizeP);
|
||||
message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, RRC_DCCH_DATA_REQ);
|
||||
RRC_DCCH_DATA_REQ (message_p).frame = ctxt_pP->frame;
|
||||
RRC_DCCH_DATA_REQ (message_p).enb_flag = ctxt_pP->enb_flag;
|
||||
RRC_DCCH_DATA_REQ (message_p).rb_id = rb_idP;
|
||||
RRC_DCCH_DATA_REQ (message_p).muip = muiP;
|
||||
RRC_DCCH_DATA_REQ (message_p).confirmp = confirmP;
|
||||
RRC_DCCH_DATA_REQ (message_p).sdu_size = sdu_sizeP;
|
||||
RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer;
|
||||
//memcpy (RRC_DCCH_DATA_REQ (message_p).sdu_p, buffer_pP, sdu_sizeP);
|
||||
RRC_DCCH_DATA_REQ (message_p).mode = modeP;
|
||||
RRC_DCCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id;
|
||||
RRC_DCCH_DATA_REQ (message_p).rnti = ctxt_pP->rnti;
|
||||
RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index;
|
||||
itti_send_msg_to_task (
|
||||
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
|
||||
ctxt_pP->instance,
|
||||
message_p);
|
||||
LOG_I(RRC,"sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB\n");
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
{
|
||||
MessageDef *message_p;
|
||||
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
|
||||
uint8_t *message_buffer;
|
||||
/* Hack: only trigger PDCP if in CU, otherwise it is triggered by RU threads
|
||||
* Ideally, PDCP would not neet to be triggered like this but react to ITTI
|
||||
* messages automatically */
|
||||
if (ctxt_pP->enb_flag && NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type))
|
||||
pdcp_run(ctxt_pP);
|
||||
|
||||
message_buffer = itti_malloc (
|
||||
ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE,
|
||||
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
|
||||
sdu_sizeP);
|
||||
|
||||
memcpy (message_buffer, buffer_pP, sdu_sizeP);
|
||||
|
||||
message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, RRC_DCCH_DATA_REQ);
|
||||
RRC_DCCH_DATA_REQ (message_p).frame = ctxt_pP->frame;
|
||||
RRC_DCCH_DATA_REQ (message_p).enb_flag = ctxt_pP->enb_flag;
|
||||
RRC_DCCH_DATA_REQ (message_p).rb_id = rb_idP;
|
||||
RRC_DCCH_DATA_REQ (message_p).muip = muiP;
|
||||
RRC_DCCH_DATA_REQ (message_p).confirmp = confirmP;
|
||||
RRC_DCCH_DATA_REQ (message_p).sdu_size = sdu_sizeP;
|
||||
RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer;
|
||||
//memcpy (RRC_DCCH_DATA_REQ (message_p).sdu_p, buffer_pP, sdu_sizeP);
|
||||
|
||||
RRC_DCCH_DATA_REQ (message_p).mode = modeP;
|
||||
RRC_DCCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id;
|
||||
RRC_DCCH_DATA_REQ (message_p).rnti = ctxt_pP->rnti;
|
||||
RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index;
|
||||
|
||||
itti_send_msg_to_task (
|
||||
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
|
||||
ctxt_pP->instance,
|
||||
message_p);
|
||||
LOG_I(RRC,"sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB\n");
|
||||
#ifndef UETARGET
|
||||
/* Hack: only trigger PDCP if in CU, otherwise it is triggered by RU threads
|
||||
* Ideally, PDCP would not neet to be triggered like this but react to ITTI
|
||||
* messages automatically */
|
||||
if (NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type))
|
||||
pdcp_run(ctxt_pP);
|
||||
#endif
|
||||
|
||||
return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
|
||||
|
||||
}
|
||||
#else
|
||||
return pdcp_data_req (
|
||||
ctxt_pP,
|
||||
SRB_FLAG_YES,
|
||||
rb_idP,
|
||||
muiP,
|
||||
confirmP,
|
||||
sdu_sizeP,
|
||||
buffer_pP,
|
||||
modeP);
|
||||
#endif
|
||||
return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
rrc_data_ind(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t Srb_id,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
const uint8_t* const buffer_pP
|
||||
const uint8_t *const buffer_pP
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
@@ -162,10 +140,8 @@ rrc_data_ind(
|
||||
MessageDef *message_p;
|
||||
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
|
||||
uint8_t *message_buffer;
|
||||
|
||||
message_buffer = itti_malloc (ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, sdu_sizeP);
|
||||
memcpy (message_buffer, buffer_pP, sdu_sizeP);
|
||||
|
||||
message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, RRC_DCCH_DATA_IND);
|
||||
RRC_DCCH_DATA_IND (message_p).frame = ctxt_pP->frame;
|
||||
RRC_DCCH_DATA_IND (message_p).dcch_index = DCCH_index;
|
||||
@@ -174,16 +150,13 @@ rrc_data_ind(
|
||||
RRC_DCCH_DATA_IND (message_p).rnti = ctxt_pP->rnti;
|
||||
RRC_DCCH_DATA_IND (message_p).module_id = ctxt_pP->module_id;
|
||||
RRC_DCCH_DATA_IND (message_p).eNB_index = ctxt_pP->eNB_index;
|
||||
|
||||
itti_send_msg_to_task (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, ctxt_pP->instance, message_p);
|
||||
}
|
||||
#else
|
||||
|
||||
rrc_eNB_decode_dcch(
|
||||
ctxt_pP,
|
||||
DCCH_index,
|
||||
buffer_pP,
|
||||
sdu_sizeP);
|
||||
|
||||
rrc_eNB_decode_dcch(
|
||||
ctxt_pP,
|
||||
DCCH_index,
|
||||
buffer_pP,
|
||||
sdu_sizeP);
|
||||
#endif
|
||||
}
|
||||
|
||||
+24
-38
@@ -801,42 +801,33 @@ rrc_ue_establish_drb(
|
||||
(void)ip_addr_offset4;
|
||||
LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n",
|
||||
ue_mod_idP, frameP, DRB_config->drb_Identity, (int)*DRB_config->logicalChannelIdentity);
|
||||
/*
|
||||
rrc_pdcp_config_req (ue_mod_idP+NB_eNB_INST, frameP, 0, CONFIG_ACTION_ADD,
|
||||
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity, UNDEF_SECURITY_MODE);
|
||||
|
||||
rrc_rlc_config_req(ue_mod_idP+NB_eNB_INST,frameP,0,CONFIG_ACTION_ADD,
|
||||
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity,
|
||||
RADIO_ACCESS_BEARER,Rlc_info_um);
|
||||
*/
|
||||
// if(!EPC_MODE_ENABLED) {
|
||||
//# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
ip_addr_offset3 = 0;
|
||||
ip_addr_offset4 = 1;
|
||||
LOG_I(OIP,"[UE %d] trying to bring up the OAI interface oip%d, IP 10.0.%d.%d\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1);
|
||||
oip_ifup=nas_config(ip_addr_offset3+ue_mod_idP+1, // interface_id
|
||||
ip_addr_offset3+ue_mod_idP+1, // third_octet
|
||||
ip_addr_offset4+ue_mod_idP+1, // fourth_octet
|
||||
"oip"); // interface suffix
|
||||
if(!EPC_MODE_ENABLED) {
|
||||
ip_addr_offset3 = 0;
|
||||
ip_addr_offset4 = 1;
|
||||
LOG_I(OIP,"[UE %d] trying to bring up the OAI interface %d, IP X.Y.%d.%d\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1);
|
||||
oip_ifup=nas_config(ip_addr_offset3+ue_mod_idP+1, // interface_id
|
||||
UE_NAS_USE_TUN?1:(ip_addr_offset3+ue_mod_idP+1), // third_octet
|
||||
ip_addr_offset4+ue_mod_idP+1, // fourth_octet
|
||||
"oip"); // interface suffix (when using kernel module)
|
||||
|
||||
if (oip_ifup == 0 && (!UE_NAS_USE_TUN)) { // interface is up --> send a config the DRB
|
||||
LOG_I(OIP,"[UE %d] Config the ue net interface %d to send/receive pkt on DRB %ld to/from the protocol stack\n",
|
||||
ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP,
|
||||
(long int)((eNB_index * LTE_maxDRB) + DRB_config->drb_Identity));
|
||||
rb_conf_ipv4(0,//add
|
||||
ue_mod_idP,//cx align with the UE index
|
||||
ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index
|
||||
(eNB_index * LTE_maxDRB) + DRB_config->drb_Identity,//rb
|
||||
0,//dscp
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr
|
||||
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index);
|
||||
}
|
||||
if (oip_ifup == 0 && (!UE_NAS_USE_TUN)) { // interface is up --> send a config the DRB
|
||||
LOG_I(OIP,"[UE %d] Config the ue net interface %d to send/receive pkt on DRB %ld to/from the protocol stack\n",
|
||||
ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP,
|
||||
(long int)((eNB_index * LTE_maxDRB) + DRB_config->drb_Identity));
|
||||
rb_conf_ipv4(0,//add
|
||||
ue_mod_idP,//cx align with the UE index
|
||||
ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index
|
||||
(eNB_index * LTE_maxDRB) + DRB_config->drb_Identity,//rb
|
||||
0,//dscp
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr
|
||||
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index);
|
||||
}
|
||||
} // !EPC_MODE_ENABLED
|
||||
|
||||
//# endif
|
||||
// }
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -2656,11 +2647,6 @@ int decode_BCCH_DLSCH_Message(
|
||||
}
|
||||
}
|
||||
|
||||
// if ((rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE)
|
||||
//#if defined(ENABLE_USE_MME)
|
||||
// && (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL)
|
||||
//#endif
|
||||
// ) {
|
||||
if (rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE) {
|
||||
if ( (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL) || (!EPC_MODE_ENABLED)) {
|
||||
rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0);
|
||||
|
||||
@@ -236,8 +236,8 @@ int nas_config(int interface_id, int thirdOctet, int fourthOctet, char *ifname)
|
||||
char broadcastAddress[20];
|
||||
char interfaceName[20];
|
||||
int returnValue;
|
||||
sprintf(ipAddress, "10.0.%d.%d", thirdOctet,fourthOctet);
|
||||
sprintf(broadcastAddress, "10.0.%d.255", thirdOctet);
|
||||
sprintf(ipAddress, "%s.%d.%d", baseNetAddress,thirdOctet,fourthOctet);
|
||||
sprintf(broadcastAddress, "%s.%d.255",baseNetAddress, thirdOctet);
|
||||
sprintf(interfaceName, "%s%s%d", (UE_NAS_USE_TUN || ENB_NAS_USE_TUN)?"oaitun_":ifname,
|
||||
UE_NAS_USE_TUN?"ue": (ENB_NAS_USE_TUN?"enb":""),interface_id);
|
||||
bringInterfaceUp(interfaceName, 0);
|
||||
|
||||
Reference in New Issue
Block a user