initial testing version of L1L-L1H split (RRU-RAU)
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "RadioResourceConfigCommonSIB.h"
|
||||
#include "RadioResourceConfigDedicated.h"
|
||||
#include "MeasGapConfig.h"
|
||||
#include "TDD-Config.h"
|
||||
#ifdef Rel10
|
||||
#include "MBSFN-AreaInfoList-r9.h"
|
||||
#include "MBSFN-SubframeConfigList.h"
|
||||
|
||||
@@ -93,14 +93,8 @@ typedef struct RrcConfigurationReq_s {
|
||||
uint16_t mnc;
|
||||
uint8_t mnc_digit_length;
|
||||
|
||||
/*
|
||||
paging_drx_t default_drx;
|
||||
|
||||
lte_frame_type_t frame_type;
|
||||
uint8_t tdd_config;
|
||||
uint8_t tdd_config_s;
|
||||
int16_t eutra_band;
|
||||
*/
|
||||
|
||||
paging_drx_t default_drx;
|
||||
int16_t nb_cc;
|
||||
lte_frame_type_t frame_type[MAX_NUM_CCs];
|
||||
uint8_t tdd_config[MAX_NUM_CCs];
|
||||
@@ -109,11 +103,9 @@ typedef struct RrcConfigurationReq_s {
|
||||
int16_t eutra_band[MAX_NUM_CCs];
|
||||
uint32_t downlink_frequency[MAX_NUM_CCs];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs];
|
||||
|
||||
int16_t Nid_cell[MAX_NUM_CCs];// for testing, change later
|
||||
int16_t N_RB_DL[MAX_NUM_CCs];// for testing, change later
|
||||
int nb_antennas_tx[MAX_NUM_CCs];
|
||||
int nb_antennas_rx[MAX_NUM_CCs];
|
||||
int nb_antenna_ports[MAX_NUM_CCs];
|
||||
long prach_root[MAX_NUM_CCs];
|
||||
long prach_config_index[MAX_NUM_CCs];
|
||||
BOOLEAN_t prach_high_speed[MAX_NUM_CCs];
|
||||
|
||||
+43
-18
@@ -33,6 +33,7 @@
|
||||
#include "enb_app.h"
|
||||
#include "enb_config.h"
|
||||
#include "assertions.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#include "log.h"
|
||||
#if defined(OAI_EMU)
|
||||
@@ -56,6 +57,8 @@
|
||||
extern unsigned char NB_eNB_INST;
|
||||
#endif
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
@@ -64,6 +67,8 @@ extern unsigned char NB_eNB_INST;
|
||||
# endif
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
static void configure_phy(module_id_t enb_id, const Enb_properties_array_t* enb_properties)
|
||||
{
|
||||
MessageDef *msg_p;
|
||||
@@ -84,15 +89,20 @@ static void configure_phy(module_id_t enb_id, const Enb_properties_array_t* enb_
|
||||
|
||||
itti_send_msg_to_task (TASK_PHY_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
}
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static void configure_rrc(uint32_t enb_id, const Enb_properties_array_t *enb_properties)
|
||||
static void configure_rrc(uint32_t enb_id)
|
||||
{
|
||||
MessageDef *msg_p = NULL;
|
||||
int CC_id;
|
||||
// int CC_id;
|
||||
|
||||
msg_p = itti_alloc_new_message (TASK_ENB_APP, RRC_CONFIGURATION_REQ);
|
||||
|
||||
if (RC.rrc[enb_id]) {
|
||||
RCconfig_RRC(msg_p,enb_id,&RC.rrc[enb_id]);
|
||||
|
||||
/*
|
||||
RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_properties->properties[enb_id]->eNB_id;
|
||||
RRC_CONFIGURATION_REQ (msg_p).tac = enb_properties->properties[enb_id]->tac;
|
||||
RRC_CONFIGURATION_REQ (msg_p).mcc = enb_properties->properties[enb_id]->mcc;
|
||||
@@ -187,13 +197,18 @@ static void configure_rrc(uint32_t enb_id, const Enb_properties_array_t *enb_pro
|
||||
RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[CC_id] = enb_properties->properties[enb_id]->ue_TransmissionMode[CC_id];
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
LOG_I(ENB_APP,"Sending configuration message to RRC task\n");
|
||||
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
|
||||
}
|
||||
else AssertFatal(0,"RRC context for eNB %d not allocated\n",enb_id);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
# if defined(ENABLE_USE_MME)
|
||||
static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, const Enb_properties_array_t *enb_properties)
|
||||
static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//, const Enb_properties_array_t *enb_properties)
|
||||
{
|
||||
uint32_t enb_id;
|
||||
uint32_t mme_id;
|
||||
@@ -217,9 +232,15 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
|
||||
/* note: there is an implicit relationship between the data structure and the message name */
|
||||
msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ);
|
||||
|
||||
s1ap_register_eNB = &S1AP_REGISTER_ENB_REQ(msg_p);
|
||||
RCconfig_S1(msg_p, enb_id);
|
||||
|
||||
/* Some default/random parameters */
|
||||
if (enb_id == 0) RCconfig_gtpu();
|
||||
|
||||
s1ap_register_eNB = &S1AP_REGISTER_ENB_REQ(msg_p);
|
||||
LOG_I(ENB_APP,"default drx %d\n",s1ap_register_eNB->default_drx);
|
||||
|
||||
/*
|
||||
|
||||
s1ap_register_eNB->eNB_id = enb_properties->properties[enb_id]->eNB_id;
|
||||
s1ap_register_eNB->cell_type = enb_properties->properties[enb_id]->cell_type;
|
||||
s1ap_register_eNB->eNB_name = enb_properties->properties[enb_id]->eNB_name;
|
||||
@@ -230,6 +251,7 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
|
||||
s1ap_register_eNB->default_drx = enb_properties->properties[enb_id]->pcch_defaultPagingCycle[0];
|
||||
|
||||
s1ap_register_eNB->nb_mme = enb_properties->properties[enb_id]->nb_mme;
|
||||
|
||||
AssertFatal (s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, "Too many MME for eNB %d (%d/%d)!", enb_id, s1ap_register_eNB->nb_mme,
|
||||
S1AP_MAX_NB_MME_IP_ADDRESS);
|
||||
|
||||
@@ -254,6 +276,7 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
|
||||
str = inet_ntoa(addr);
|
||||
strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str);
|
||||
|
||||
*/
|
||||
LOG_I(ENB_APP,"[eNB %d] eNB_app_register for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
@@ -270,9 +293,8 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
|
||||
/*------------------------------------------------------------------------------*/
|
||||
void *eNB_app_task(void *args_p)
|
||||
{
|
||||
const Enb_properties_array_t *enb_properties_p = NULL;
|
||||
#if defined(ENABLE_ITTI)
|
||||
uint32_t enb_nb = 1; /* Default number of eNB is 1 */
|
||||
uint32_t enb_nb = RC.nb_inst;
|
||||
uint32_t enb_id_start = 0;
|
||||
uint32_t enb_id_end = enb_id_start + enb_nb;
|
||||
# if defined(ENABLE_USE_MME)
|
||||
@@ -303,15 +325,20 @@ void *eNB_app_task(void *args_p)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
enb_properties_p = enb_config_get();
|
||||
|
||||
AssertFatal (enb_nb <= enb_properties_p->number,
|
||||
AssertFatal (enb_nb <= RC.nb_inst,
|
||||
"Number of eNB is greater than eNB defined in configuration file (%d/%d)!",
|
||||
enb_nb, enb_properties_p->number);
|
||||
enb_nb, RC.nb_inst);
|
||||
|
||||
LOG_I(ENB_APP,"Allocating eNB_RRC_INST for %d instances\n",RC.nb_inst);
|
||||
|
||||
RC.rrc = (eNB_RRC_INST **)malloc(RC.nb_inst*sizeof(eNB_RRC_INST *));
|
||||
|
||||
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
|
||||
configure_phy(enb_id, enb_properties_p);
|
||||
configure_rrc(enb_id, enb_properties_p);
|
||||
// configure_phy(enb_id);//
|
||||
RC.rrc[enb_id] = (eNB_RRC_INST*)malloc(sizeof(eNB_RRC_INST));
|
||||
|
||||
configure_rrc(enb_id);//
|
||||
}
|
||||
|
||||
#if defined (FLEXRAN_AGENT_SB_IF)
|
||||
@@ -325,7 +352,7 @@ void *eNB_app_task(void *args_p)
|
||||
# if defined(ENABLE_USE_MME)
|
||||
/* Try to register each eNB */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end, enb_properties_p);
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
# else
|
||||
/* Start L2L1 task */
|
||||
msg_p = itti_alloc_new_message(TASK_ENB_APP, INITIALIZE_MESSAGE);
|
||||
@@ -395,7 +422,7 @@ void *eNB_app_task(void *args_p)
|
||||
sleep(ENB_REGISTER_RETRY_DELAY);
|
||||
/* Restart the registration process */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end, enb_properties_p);
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -415,7 +442,7 @@ void *eNB_app_task(void *args_p)
|
||||
if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
|
||||
/* Restart the registration process */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end, enb_properties_p);
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -432,8 +459,6 @@ void *eNB_app_task(void *args_p)
|
||||
|
||||
#endif
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)enb_properties_p;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+2427
-2224
File diff suppressed because it is too large
Load Diff
@@ -73,11 +73,14 @@ typedef struct mme_ip_address_s {
|
||||
char *ipv6_address;
|
||||
} mme_ip_address_t;
|
||||
|
||||
typedef struct rrh_gw_config_s {
|
||||
typedef struct ru_config_s {
|
||||
// indicates if local or remote rf is used (1 == LOCAL)
|
||||
unsigned local_rf:1;
|
||||
// indicates if UDP socket is used
|
||||
unsigned udp:1;
|
||||
// indicates if RAW socket is used
|
||||
unsigned raw:1;
|
||||
unsigned active:1;
|
||||
char *rrh_gw_if_name;
|
||||
char *ru_if_name;
|
||||
char *local_address;
|
||||
char *remote_address;
|
||||
uint16_t local_port;
|
||||
@@ -85,15 +88,7 @@ typedef struct rrh_gw_config_s {
|
||||
uint8_t udpif4p5;
|
||||
uint8_t rawif4p5;
|
||||
uint8_t rawif5_mobipass;
|
||||
int tx_scheduling_advance;
|
||||
int tx_sample_advance;
|
||||
int iq_txshift;
|
||||
unsigned exmimo:1;
|
||||
unsigned usrp_b200:1;
|
||||
unsigned usrp_x300:1;
|
||||
unsigned bladerf:1;
|
||||
unsigned lmssdr:1;
|
||||
} rrh_gw_config_t;
|
||||
} ru_config_t;
|
||||
|
||||
typedef struct Enb_properties_s {
|
||||
/* Unique eNB_id to identify the eNB within EPC.
|
||||
@@ -127,8 +122,8 @@ typedef struct Enb_properties_s {
|
||||
/* Physical parameters */
|
||||
int16_t nb_cc;
|
||||
#ifndef OCP_FRAMEWORK
|
||||
eNB_func_t cc_node_function[1+MAX_NUM_CCs];
|
||||
eNB_timing_t cc_node_timing[1+MAX_NUM_CCs];
|
||||
node_function_t cc_node_function[1+MAX_NUM_CCs];
|
||||
node_timing_t cc_node_timing[1+MAX_NUM_CCs];
|
||||
int16_t cc_node_synch_ref[1+MAX_NUM_CCs];
|
||||
lte_frame_type_t frame_type[1+MAX_NUM_CCs];
|
||||
uint8_t tdd_config[1+MAX_NUM_CCs];
|
||||
@@ -233,11 +228,6 @@ typedef struct Enb_properties_s {
|
||||
tcp_udp_port_t flexran_agent_port;
|
||||
char *flexran_agent_cache;
|
||||
|
||||
/* Nb of RRH to connect to */
|
||||
uint8_t nb_rrh_gw;
|
||||
char *rrh_gw_if_name;
|
||||
/* List of MME to connect to */
|
||||
rrh_gw_config_t rrh_gw_config[4];
|
||||
|
||||
#ifndef OCP_FRAMEWORK
|
||||
// otg config
|
||||
@@ -274,9 +264,12 @@ typedef struct Enb_properties_s {
|
||||
typedef struct Enb_properties_array_s {
|
||||
int number;
|
||||
Enb_properties_t *properties[MAX_ENB];
|
||||
int nb_ru;
|
||||
ru_config_t *ru_config[NUMBER_OF_RU_MAX];
|
||||
} Enb_properties_array_t;
|
||||
|
||||
void enb_config_display(void);
|
||||
void ru_config_display(void);
|
||||
const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP);
|
||||
|
||||
const Enb_properties_array_t *enb_config_get(void);
|
||||
|
||||
+483
-386
@@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -42,6 +43,7 @@
|
||||
#include "extern.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/ran_context.h"
|
||||
#ifdef Rel10
|
||||
#include "MBSFN-AreaInfoList-r9.h"
|
||||
#include "MBSFN-AreaInfo-r9.h"
|
||||
@@ -49,6 +51,8 @@
|
||||
#include "PMCH-InfoList-r9.h"
|
||||
#endif
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
/* sec 5.9, 36.321: MAC Reset Procedure */
|
||||
void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index)
|
||||
{
|
||||
@@ -84,77 +88,90 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index)
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
rrc_mac_config_req(
|
||||
module_id_t Mod_idP,
|
||||
int CC_idP,
|
||||
eNB_flag_t eNB_flagP,
|
||||
rnti_t rntiP,
|
||||
uint8_t eNB_index,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated,
|
||||
int rrc_mac_config_req_eNB(module_id_t Mod_idP,
|
||||
int CC_idP,
|
||||
int physCellId,
|
||||
int p_eNB,
|
||||
int Ncp,
|
||||
int eutra_band,
|
||||
uint32_t dl_CarrierFreq,
|
||||
BCCH_BCH_Message_t *mib,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated,
|
||||
#ifdef Rel10
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
#endif
|
||||
MeasObjectToAddMod_t **measObj,
|
||||
MAC_MainConfig_t *mac_MainConfig,
|
||||
long logicalChannelIdentity,
|
||||
LogicalChannelConfig_t *logicalChannelConfig,
|
||||
MeasGapConfig_t *measGapConfig,
|
||||
TDD_Config_t *tdd_Config,
|
||||
MobilityControlInfo_t *mobilityControlInfo,
|
||||
uint8_t *SIwindowsize,
|
||||
uint16_t *SIperiod,
|
||||
ARFCN_ValueEUTRA_t *ul_CarrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
|
||||
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList
|
||||
MeasObjectToAddMod_t **measObj,
|
||||
MAC_MainConfig_t *mac_MainConfig,
|
||||
long logicalChannelIdentity,
|
||||
LogicalChannelConfig_t *logicalChannelConfig,
|
||||
MeasGapConfig_t *measGapConfig,
|
||||
TDD_Config_t *tdd_Config,
|
||||
MobilityControlInfo_t *mobilityControlInfo,
|
||||
uint8_t *SIwindowsize,
|
||||
uint16_t *SIperiod,
|
||||
uint32_t ul_CarrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
|
||||
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList
|
||||
#ifdef Rel10
|
||||
,uint8_t MBMS_Flag,
|
||||
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
|
||||
PMCH_InfoList_r9_t *pmch_InfoList
|
||||
,uint8_t MBMS_Flag,
|
||||
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
|
||||
PMCH_InfoList_r9_t *pmch_InfoList
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,uint8_t num_active_cba_groups,
|
||||
uint16_t cba_rnti
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
||||
,uint8_t num_active_cba_groups,
|
||||
uint16_t cba_rnti
|
||||
#endif
|
||||
) {
|
||||
|
||||
int i;
|
||||
|
||||
int UE_id = -1;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[Mod_idP];
|
||||
eNB_MAC_INST *eNB = RC.mac[Mod_idP];
|
||||
UE_list_t *UE_list= &eNB->UE_list;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
|
||||
|
||||
if (eNB_flagP==0) {
|
||||
LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_idP,eNB_index);
|
||||
if (mib!=NULL) {
|
||||
if (RC.mac == NULL)
|
||||
l2_init_eNB(
|
||||
#ifdef Rel10
|
||||
MBMS_Flag,
|
||||
#else
|
||||
0,
|
||||
#endif
|
||||
NULL,0,0);
|
||||
|
||||
if (tdd_Config != NULL) {
|
||||
UE_mac_inst[Mod_idP].tdd_Config = tdd_Config;
|
||||
}
|
||||
} else {
|
||||
UE_id = find_UE_id(Mod_idP, rntiP);
|
||||
if (physicalConfigDedicated == NULL) {
|
||||
LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_idP, CC_idP);
|
||||
} else {
|
||||
LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY for UE %d (%x)\n", Mod_idP, CC_idP, UE_id, UE_RNTI(Mod_idP, UE_id));
|
||||
}
|
||||
mac_top_init_eNB();
|
||||
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].mib = mib;
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].physCellId = physCellId;
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].p_eNB = p_eNB;
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].Ncp = Ncp;
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].eutra_band = eutra_band;
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].dl_CarrierFreq = dl_CarrierFreq;
|
||||
|
||||
mac_xface->phy_config_mib_eNB(Mod_idP,CC_idP,
|
||||
eutra_band,
|
||||
mib->message.dl_Bandwidth,
|
||||
&mib->message.phich_Config,
|
||||
physCellId,
|
||||
Ncp,
|
||||
p_eNB,
|
||||
dl_CarrierFreq,
|
||||
ul_CarrierFreq);
|
||||
mac_init_cell_params(Mod_idP,CC_idP);
|
||||
}
|
||||
|
||||
if (tdd_Config && SIwindowsize && SIperiod) {
|
||||
if (eNB_flagP == ENB_FLAG_YES) {
|
||||
mac_xface->phy_config_sib1_eNB(Mod_idP, CC_idP, tdd_Config, *SIwindowsize, *SIperiod);
|
||||
} else {
|
||||
mac_xface->phy_config_sib1_ue(Mod_idP,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
|
||||
}
|
||||
if ((SIwindowsize!=NULL) && (SIperiod!=NULL)) {
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].tdd_Config = tdd_Config;
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].SIwindowsize = *SIwindowsize;
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].SIperiod = *SIperiod;
|
||||
mac_xface->phy_config_sib1_eNB(Mod_idP,CC_idP,tdd_Config,*SIwindowsize,*SIperiod);
|
||||
}
|
||||
|
||||
if (radioResourceConfigCommon!=NULL) {
|
||||
if (eNB_flagP==1) {
|
||||
LOG_I(MAC,"[CONFIG]SIB2/3 Contents (partial)\n");
|
||||
LOG_I(MAC,"[CONFIG]pusch_config_common.n_SB = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB);
|
||||
LOG_I(MAC,"[CONFIG]pusch_config_common.hoppingMode = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode);
|
||||
@@ -164,186 +181,337 @@ rrc_mac_config_req(
|
||||
LOG_I(MAC,"[CONFIG]pusch_config_common.groupAssignmentPUSCH = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH);
|
||||
LOG_I(MAC,"[CONFIG]pusch_config_common.sequenceHoppingEnabled = %d\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled);
|
||||
LOG_I(MAC,"[CONFIG]pusch_config_common.cyclicShift = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift);
|
||||
mac_xface->phy_config_sib2_eNB(Mod_idP, CC_idP, radioResourceConfigCommon, ul_CarrierFreq, ul_Bandwidth, additionalSpectrumEmission, mbsfn_SubframeConfigList);
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].radioResourceConfigCommon = radioResourceConfigCommon;
|
||||
mac_xface->phy_config_sib2_ue(Mod_idP,0,eNB_index,radioResourceConfigCommon,ul_CarrierFreq,ul_Bandwidth,additionalSpectrumEmission,mbsfn_SubframeConfigList);
|
||||
}
|
||||
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].radioResourceConfigCommon = radioResourceConfigCommon;
|
||||
if (ul_CarrierFreq>0) RC.mac[Mod_idP]->common_channels[CC_idP].ul_CarrierFreq = ul_CarrierFreq;
|
||||
if (ul_Bandwidth) RC.mac[Mod_idP]->common_channels[CC_idP].ul_Bandwidth = *ul_Bandwidth;
|
||||
mac_xface->phy_config_sib2_eNB(Mod_idP, CC_idP, radioResourceConfigCommon, NULL, ul_Bandwidth, additionalSpectrumEmission, mbsfn_SubframeConfigList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
|
||||
if (logicalChannelConfig!= NULL) {
|
||||
if (eNB_flagP==0) {
|
||||
LOG_I(MAC,"[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
|
||||
if (UE_id == -1) {
|
||||
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
} else {
|
||||
if (logicalChannelConfig)
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (logicalChannelConfig->ul_SpecificParameters) {
|
||||
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) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.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);
|
||||
}
|
||||
else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity] = MAX_NUM_LCGID;
|
||||
}
|
||||
UE_mac_inst[Mod_idP].scheduling_info.LCID_buffer_remain[logicalChannelIdentity] = 0;
|
||||
} else {
|
||||
LOG_E(MAC,"[CONFIG][UE %d] LCID %ld NULL ul_SpecificParameters\n",Mod_idP,logicalChannelIdentity);
|
||||
mac_xface->macphy_exit("NULL ul_SpecificParameters");
|
||||
if (physicalConfigDedicated != NULL) {
|
||||
if (UE_id == -1)
|
||||
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
else
|
||||
mac_xface->phy_config_dedicated_eNB(Mod_idP, CC_idP, UE_RNTI(Mod_idP, UE_id), physicalConfigDedicated);
|
||||
}
|
||||
|
||||
|
||||
#ifdef Rel10
|
||||
|
||||
if (sCellToAddMod_r10 != NULL) {
|
||||
|
||||
if (UE_id == -1)
|
||||
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
else
|
||||
mac_xface->phy_config_dedicated_scell_eNB(Mod_idP,UE_RNTI(Mod_idP,UE_id),sCellToAddMod_r10,1);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
if (mbsfn_SubframeConfigList != NULL) {
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_idP, mbsfn_SubframeConfigList->list.count);
|
||||
RC.mac[Mod_idP]->common_channels[0].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
|
||||
|
||||
for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
|
||||
RC.mac[Mod_idP]->common_channels[0].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
|
||||
LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", Mod_idP, i,
|
||||
RC.mac[Mod_idP]->common_channels[0].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
RC.mac[Mod_idP]->common_channels[0].MBMS_flag = MBMS_Flag;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
|
||||
if (mbsfn_AreaInfoList != NULL) {
|
||||
// One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count);
|
||||
RC.mac[Mod_idP]->common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
|
||||
|
||||
for (i =0; i< mbsfn_AreaInfoList->list.count; i++) {
|
||||
RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_idP,i,
|
||||
RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
mac_xface->phy_config_sib13_eNB(Mod_idP,0,i,RC.mac[Mod_idP]->common_channels[0].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, "[CONFIG] Number of PMCH in this MBSFN Area %d\n", pmch_InfoList->list.count);
|
||||
|
||||
for (i =0; i< pmch_InfoList->list.count; i++) {
|
||||
RC.mac[Mod_idP]->common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
|
||||
|
||||
LOG_I(MAC, "[CONFIG] PMCH[%d]: This PMCH stop (sf_AllocEnd_r9) at subframe %ldth\n", i,
|
||||
RC.mac[Mod_idP]->common_channels[0].pmch_Config[i]->sf_AllocEnd_r9);
|
||||
LOG_I(MAC, "[CONFIG] PMCH[%d]: mch_Scheduling_Period = %ld\n", i,
|
||||
RC.mac[Mod_idP]->common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9);
|
||||
LOG_I(MAC, "[CONFIG] PMCH[%d]: dataMCS = %ld\n", i,
|
||||
RC.mac[Mod_idP]->common_channels[0].pmch_Config[i]->dataMCS_r9);
|
||||
|
||||
// MBMS session info list in each MCH
|
||||
RC.mac[Mod_idP]->common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9;
|
||||
LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, RC.mac[Mod_idP]->common_channels[0].mbms_SessionList[i]->list.count);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef CBA
|
||||
|
||||
if (cba_rnti) {
|
||||
LOG_D(MAC,"[eNB %d] configure CBA RNTI for UE %d (total active cba groups %d)\n",
|
||||
Mod_idP, UE_id, num_active_cba_groups);
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].num_active_cba_groups=num_active_cba_groups;
|
||||
|
||||
for (i=0; i < num_active_cba_groups; i ++) {
|
||||
if (RC.mac[Mod_idP]->common_channels[CC_idP].cba_rnti[i] != cba_rnti + i) {
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].cba_rnti[i] = cba_rnti + i;
|
||||
}
|
||||
|
||||
//only configure UE ids up to num_active_cba_groups
|
||||
//we use them as candidates for the transmission of dci format0)
|
||||
if (UE_id%num_active_cba_groups == i) {
|
||||
mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups );
|
||||
LOG_D(MAC,"[eNB %d] configure CBA groups %d with RNTI %x for UE %d (total active cba groups %d)\n",
|
||||
Mod_idP, i, RC.mac[Mod_idP]->common_channels[CC_idP].cba_rnti[i],UE_id, num_active_cba_groups);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (UE_id == -1) {
|
||||
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
} else {
|
||||
if (logicalChannelConfig)
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = 0;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
|
||||
|
||||
return(0);
|
||||
|
||||
}
|
||||
int
|
||||
rrc_mac_config_req_ue(
|
||||
module_id_t Mod_idP,
|
||||
int CC_idP,
|
||||
uint8_t eNB_index,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated,
|
||||
#ifdef Rel10
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
#endif
|
||||
MeasObjectToAddMod_t **measObj,
|
||||
MAC_MainConfig_t *mac_MainConfig,
|
||||
long logicalChannelIdentity,
|
||||
LogicalChannelConfig_t *logicalChannelConfig,
|
||||
MeasGapConfig_t *measGapConfig,
|
||||
TDD_Config_t *tdd_Config,
|
||||
MobilityControlInfo_t *mobilityControlInfo,
|
||||
uint8_t *SIwindowsize,
|
||||
uint16_t *SIperiod,
|
||||
ARFCN_ValueEUTRA_t *ul_CarrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
|
||||
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList
|
||||
#ifdef Rel10
|
||||
,uint8_t MBMS_Flag,
|
||||
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
|
||||
PMCH_InfoList_r9_t *pmch_InfoList
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,uint8_t num_active_cba_groups,
|
||||
uint16_t cba_rnti
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
||||
int i;
|
||||
|
||||
int UE_id = -1;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(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);
|
||||
|
||||
if (tdd_Config != NULL) {
|
||||
UE_mac_inst[Mod_idP].tdd_Config = tdd_Config;
|
||||
}
|
||||
|
||||
|
||||
if (tdd_Config && SIwindowsize && SIperiod) {
|
||||
mac_xface->phy_config_sib1_ue(Mod_idP,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
|
||||
}
|
||||
|
||||
if (radioResourceConfigCommon!=NULL) {
|
||||
UE_mac_inst[Mod_idP].radioResourceConfigCommon = radioResourceConfigCommon;
|
||||
mac_xface->phy_config_sib2_ue(Mod_idP,0,eNB_index,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);
|
||||
UE_mac_inst[Mod_idP].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid
|
||||
|
||||
if (logicalChannelConfig->ul_SpecificParameters) {
|
||||
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) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.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);
|
||||
}
|
||||
else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity] = MAX_NUM_LCGID;
|
||||
}
|
||||
UE_mac_inst[Mod_idP].scheduling_info.LCID_buffer_remain[logicalChannelIdentity] = 0;
|
||||
} else {
|
||||
LOG_E(MAC,"[CONFIG][UE %d] LCID %ld NULL ul_SpecificParameters\n",Mod_idP,logicalChannelIdentity);
|
||||
mac_xface->macphy_exit("NULL ul_SpecificParameters");
|
||||
}
|
||||
}
|
||||
|
||||
if (mac_MainConfig != NULL) {
|
||||
if (eNB_flagP==0) {
|
||||
LOG_I(MAC,"[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;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity;
|
||||
}
|
||||
|
||||
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;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
|
||||
}
|
||||
mac_xface->phy_config_harq_ue(Mod_idP,0,eNB_index,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;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
|
||||
LOG_I(MAC,"[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;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity;
|
||||
}
|
||||
|
||||
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;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
|
||||
}
|
||||
mac_xface->phy_config_harq_ue(Mod_idP,0,eNB_index,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;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
|
||||
if (mac_MainConfig->ext1 && mac_MainConfig->ext1->sr_ProhibitTimer_r9) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (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) {
|
||||
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;
|
||||
} else {
|
||||
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;
|
||||
} else {
|
||||
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;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 = (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);
|
||||
|
||||
UE_mac_inst[Mod_idP].scheduling_info.drx_config = mac_MainConfig->drx_Config;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.phr_config = mac_MainConfig->phr_Config;
|
||||
|
||||
if (mac_MainConfig->phr_Config) {
|
||||
UE_mac_inst[Mod_idP].PHR_state = 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;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.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;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].PHR_reconfigured = 0;
|
||||
UE_mac_inst[Mod_idP].PHR_state = MAC_MainConfig__phr_Config_PR_setup;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange = 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);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_idP].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);
|
||||
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);
|
||||
|
||||
if (mac_MainConfig->ext1 && mac_MainConfig->ext1->sr_ProhibitTimer_r9) {
|
||||
UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (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) {
|
||||
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;
|
||||
} else {
|
||||
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;
|
||||
} else {
|
||||
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;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 = (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);
|
||||
|
||||
UE_mac_inst[Mod_idP].scheduling_info.drx_config = mac_MainConfig->drx_Config;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.phr_config = mac_MainConfig->phr_Config;
|
||||
|
||||
if (mac_MainConfig->phr_Config) {
|
||||
UE_mac_inst[Mod_idP].PHR_state = 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;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.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;
|
||||
} else {
|
||||
UE_mac_inst[Mod_idP].PHR_reconfigured = 0;
|
||||
UE_mac_inst[Mod_idP].PHR_state = MAC_MainConfig__phr_Config_PR_setup;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange = 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);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_idP].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);
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
if (physicalConfigDedicated != NULL) {
|
||||
if (eNB_flagP==1) {
|
||||
if (UE_id == -1)
|
||||
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
else
|
||||
mac_xface->phy_config_dedicated_eNB(Mod_idP, CC_idP, UE_RNTI(Mod_idP, UE_id), physicalConfigDedicated);
|
||||
} else {
|
||||
mac_xface->phy_config_dedicated_ue(Mod_idP,0,eNB_index,physicalConfigDedicated);
|
||||
UE_mac_inst[Mod_idP].physicalConfigDedicated=physicalConfigDedicated; // for SR proc
|
||||
}
|
||||
mac_xface->phy_config_dedicated_ue(Mod_idP,0,eNB_index,physicalConfigDedicated);
|
||||
UE_mac_inst[Mod_idP].physicalConfigDedicated=physicalConfigDedicated; // for SR proc
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
|
||||
if (sCellToAddMod_r10 != NULL) {
|
||||
|
||||
if (eNB_flagP==1) {
|
||||
if (UE_id == -1)
|
||||
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
else
|
||||
mac_xface->phy_config_dedicated_scell_eNB(Mod_idP,UE_RNTI(Mod_idP,UE_id),sCellToAddMod_r10,1);
|
||||
} else {
|
||||
|
||||
//#warning "phy_config_dedicated_scell_ue is empty"
|
||||
mac_xface->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
|
||||
}
|
||||
mac_xface->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
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
if (eNB_flagP == 0) {
|
||||
if (measObj!= NULL) {
|
||||
if (measObj[0]!= NULL) {
|
||||
UE_mac_inst[Mod_idP].n_adj_cells = 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);
|
||||
|
||||
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]);
|
||||
}
|
||||
|
||||
mac_xface->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);
|
||||
if (measObj!= NULL) {
|
||||
if (measObj[0]!= NULL) {
|
||||
UE_mac_inst[Mod_idP].n_adj_cells = 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);
|
||||
|
||||
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]);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
mac_xface->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);
|
||||
}
|
||||
|
||||
/*
|
||||
if (quantityConfig != NULL) {
|
||||
if (quantityConfig[0] != NULL) {
|
||||
UE_mac_inst[Mod_idP].quantityConfig = quantityConfig[0];
|
||||
@@ -351,215 +519,144 @@ rrc_mac_config_req(
|
||||
mac_xface->phy_config_meas_ue
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if (eNB_flagP==0) {
|
||||
if(mobilityControlInfo != NULL) {
|
||||
|
||||
LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_idP,eNB_index);
|
||||
ue_mac_reset(Mod_idP,eNB_index);
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->rach_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon,
|
||||
sizeof(RACH_ConfigCommon_t));
|
||||
}
|
||||
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.prach_ConfigInfo,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.prach_Config.prach_ConfigInfo,
|
||||
sizeof(PRACH_ConfigInfo_t));
|
||||
UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.rootSequenceIndex = mobilityControlInfo->radioResourceConfigCommon.prach_Config.rootSequenceIndex;
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pdsch_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon,
|
||||
sizeof(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(PUSCH_ConfigCommon_t));
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.phich_Config) {
|
||||
/* memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->phich_Config,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.phich_Config,
|
||||
sizeof(PHICH_Config_t)); */
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pucch_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon,
|
||||
sizeof(PUCCH_ConfigCommon_t));
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->soundingRS_UL_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon,
|
||||
sizeof(SoundingRS_UL_ConfigCommon_t));
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->uplinkPowerControlCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon,
|
||||
sizeof(UplinkPowerControlCommon_t));
|
||||
}
|
||||
|
||||
//configure antennaInfoCommon somewhere here..
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.p_Max) {
|
||||
//to be configured
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.tdd_Config) {
|
||||
UE_mac_inst[Mod_idP].tdd_Config = mobilityControlInfo->radioResourceConfigCommon.tdd_Config;
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->ul_CyclicPrefixLength,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength,
|
||||
sizeof(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));
|
||||
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].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));
|
||||
}
|
||||
|
||||
mac_xface->phy_config_afterHO_ue(Mod_idP,0,eNB_index,mobilityControlInfo,0);
|
||||
if(mobilityControlInfo != NULL) {
|
||||
|
||||
LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_idP,eNB_index);
|
||||
ue_mac_reset(Mod_idP,eNB_index);
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->rach_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon,
|
||||
sizeof(RACH_ConfigCommon_t));
|
||||
}
|
||||
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.prach_ConfigInfo,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.prach_Config.prach_ConfigInfo,
|
||||
sizeof(PRACH_ConfigInfo_t));
|
||||
UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.rootSequenceIndex = mobilityControlInfo->radioResourceConfigCommon.prach_Config.rootSequenceIndex;
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pdsch_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon,
|
||||
sizeof(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(PUSCH_ConfigCommon_t));
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.phich_Config) {
|
||||
/* memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->phich_Config,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.phich_Config,
|
||||
sizeof(PHICH_Config_t)); */
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pucch_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon,
|
||||
sizeof(PUCCH_ConfigCommon_t));
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->soundingRS_UL_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon,
|
||||
sizeof(SoundingRS_UL_ConfigCommon_t));
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->uplinkPowerControlCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon,
|
||||
sizeof(UplinkPowerControlCommon_t));
|
||||
}
|
||||
|
||||
//configure antennaInfoCommon somewhere here..
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.p_Max) {
|
||||
//to be configured
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.tdd_Config) {
|
||||
UE_mac_inst[Mod_idP].tdd_Config = mobilityControlInfo->radioResourceConfigCommon.tdd_Config;
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->ul_CyclicPrefixLength,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength,
|
||||
sizeof(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));
|
||||
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].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));
|
||||
}
|
||||
|
||||
mac_xface->phy_config_afterHO_ue(Mod_idP,0,eNB_index,mobilityControlInfo,0);
|
||||
}
|
||||
|
||||
|
||||
if (mbsfn_SubframeConfigList != NULL) {
|
||||
if (eNB_flagP == 1) {
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_idP, mbsfn_SubframeConfigList->list.count);
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
|
||||
|
||||
for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
|
||||
LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", Mod_idP, i,
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].MBMS_flag = MBMS_Flag;
|
||||
#endif
|
||||
} else { // UE
|
||||
LOG_I(MAC,"[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_mac_inst[Mod_idP].mbsfn_SubframeConfig[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]);
|
||||
}
|
||||
LOG_I(MAC,"[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_mac_inst[Mod_idP].mbsfn_SubframeConfig[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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef Rel10
|
||||
|
||||
if (mbsfn_AreaInfoList != NULL) {
|
||||
if (eNB_flagP == 1) {
|
||||
// One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count);
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
|
||||
|
||||
for (i =0; i< mbsfn_AreaInfoList->list.count; i++) {
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_idP,i,
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
mac_xface->phy_config_sib13_eNB(Mod_idP,0,i,eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
|
||||
}
|
||||
} else { // UE
|
||||
LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", 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];
|
||||
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);
|
||||
mac_xface->phy_config_sib13_ue(Mod_idP,0,eNB_index,i,UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
|
||||
}
|
||||
LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", 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];
|
||||
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);
|
||||
mac_xface->phy_config_sib13_ue(Mod_idP,0,eNB_index,i,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));
|
||||
|
||||
if (eNB_flagP == 1) {
|
||||
|
||||
LOG_I(MAC, "[CONFIG] Number of PMCH in this MBSFN Area %d\n", pmch_InfoList->list.count);
|
||||
|
||||
for (i =0; i< pmch_InfoList->list.count; i++) {
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
|
||||
|
||||
LOG_I(MAC, "[CONFIG] PMCH[%d]: This PMCH stop (sf_AllocEnd_r9) at subframe %ldth\n", i,
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->sf_AllocEnd_r9);
|
||||
LOG_I(MAC, "[CONFIG] PMCH[%d]: mch_Scheduling_Period = %ld\n", i,
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9);
|
||||
LOG_I(MAC, "[CONFIG] PMCH[%d]: dataMCS = %ld\n", i,
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->dataMCS_r9);
|
||||
|
||||
// MBMS session info list in each MCH
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9;
|
||||
LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_idP].common_channels[0].mbms_SessionList[i]->list.count);
|
||||
}
|
||||
} else { // UE
|
||||
LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",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;
|
||||
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);
|
||||
}
|
||||
|
||||
UE_mac_inst[Mod_idP].mcch_status = 1;
|
||||
LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",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;
|
||||
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);
|
||||
}
|
||||
|
||||
UE_mac_inst[Mod_idP].mcch_status = 1;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#ifdef CBA
|
||||
|
||||
if (eNB_flagP == 0) {
|
||||
if (cba_rnti) {
|
||||
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);
|
||||
mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
|
||||
}
|
||||
} else {
|
||||
if (cba_rnti) {
|
||||
LOG_D(MAC,"[eNB %d] configure CBA RNTI for UE %d (total active cba groups %d)\n",
|
||||
Mod_idP, UE_id, num_active_cba_groups);
|
||||
eNB_mac_inst[Mod_idP].common_channels[CC_idP].num_active_cba_groups=num_active_cba_groups;
|
||||
|
||||
for (i=0; i < num_active_cba_groups; i ++) {
|
||||
if (eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i] != cba_rnti + i) {
|
||||
eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i] = cba_rnti + i;
|
||||
}
|
||||
|
||||
//only configure UE ids up to num_active_cba_groups
|
||||
//we use them as candidates for the transmission of dci format0)
|
||||
if (UE_id%num_active_cba_groups == i) {
|
||||
mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups );
|
||||
LOG_D(MAC,"[eNB %d] configure CBA groups %d with RNTI %x for UE %d (total active cba groups %d)\n",
|
||||
Mod_idP, i, eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i],UE_id, num_active_cba_groups);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cba_rnti) {
|
||||
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);
|
||||
mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,eNB_index,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);
|
||||
|
||||
|
||||
@@ -47,9 +47,13 @@
|
||||
|
||||
//#include "COMMON/openair_defs.h"
|
||||
|
||||
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/LTE_TRANSPORT/defs.h"
|
||||
#include "COMMON/platform_constants.h"
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "BCCH-BCH-Message.h"
|
||||
#include "RadioResourceConfigCommon.h"
|
||||
#include "RadioResourceConfigDedicated.h"
|
||||
#include "MeasGapConfig.h"
|
||||
@@ -842,6 +846,7 @@ typedef struct {
|
||||
} SBMAP_CONF;
|
||||
/*! \brief UE list used by eNB to order UEs/CC for scheduling*/
|
||||
typedef struct {
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
/// DLSCH pdu
|
||||
DLSCH_PDU DLSCH_pdu[MAX_NUM_CCs][2][NUMBER_OF_UE_MAX];
|
||||
/// DCI template and MAC connection parameters for UEs
|
||||
@@ -874,6 +879,18 @@ typedef struct {
|
||||
|
||||
/*! \brief eNB common channels */
|
||||
typedef struct {
|
||||
int physCellId;
|
||||
int p_eNB;
|
||||
int Ncp;
|
||||
int eutra_band;
|
||||
uint32_t dl_CarrierFreq;
|
||||
BCCH_BCH_Message_t *mib;
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon;
|
||||
TDD_Config_t *tdd_Config;
|
||||
uint8_t SIwindowsize;
|
||||
uint16_t SIperiod;
|
||||
ARFCN_ValueEUTRA_t ul_CarrierFreq;
|
||||
long ul_Bandwidth;
|
||||
/// Outgoing DCI for PHY generated by eNB scheduler
|
||||
DCI_PDU DCI_pdu;
|
||||
/// Outgoing BCCH pdu for PHY
|
||||
@@ -921,7 +938,7 @@ typedef struct {
|
||||
#endif
|
||||
} COMMON_channels_t;
|
||||
/*! \brief top level eNB MAC structure */
|
||||
typedef struct {
|
||||
typedef struct eNB_MAC_INST_s {
|
||||
///
|
||||
uint16_t Node_id;
|
||||
/// frame counter
|
||||
@@ -930,6 +947,7 @@ typedef struct {
|
||||
sub_frame_t subframe;
|
||||
/// Common cell resources
|
||||
COMMON_channels_t common_channels[MAX_NUM_CCs];
|
||||
|
||||
UE_list_t UE_list;
|
||||
|
||||
///subband bitmap configuration
|
||||
@@ -959,7 +977,6 @@ typedef struct {
|
||||
time_stats_t schedule_mch;
|
||||
/// processing time of eNB ULSCH reception
|
||||
time_stats_t rx_ulsch_sdu; // include rlc_data_ind
|
||||
|
||||
} eNB_MAC_INST;
|
||||
|
||||
/*
|
||||
|
||||
@@ -65,33 +65,15 @@
|
||||
|
||||
#define ENABLE_MAC_PAYLOAD_DEBUG
|
||||
#define DEBUG_eNB_SCHEDULER 1
|
||||
//efine ENABLE_ENB_AGENT_DL_SCHEDULER
|
||||
//#define DISABLE_SF_TRIGGER
|
||||
//#define DISABLE_CONT_STATS
|
||||
|
||||
//#define DEBUG_HEADER_PARSING 1
|
||||
//#define DEBUG_PACKET_TRACE 1
|
||||
|
||||
/*
|
||||
#ifndef USER_MODE
|
||||
#define msg debug_msg
|
||||
#endif
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP) //, int calibration_flag) {
|
||||
{
|
||||
|
||||
int mbsfn_status[MAX_NUM_CCs];
|
||||
protocol_ctxt_t ctxt;
|
||||
#ifdef EXMIMO
|
||||
//int ret;
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
MessageDef *msg_p;
|
||||
const char *msg_name;
|
||||
@@ -100,7 +82,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
#endif
|
||||
DCI_PDU *DCI_pdu[MAX_NUM_CCs];
|
||||
int CC_id,i; //,next_i;
|
||||
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
|
||||
UE_list_t *UE_list=&RC.mac[module_idP]->UE_list;
|
||||
rnti_t rnti;
|
||||
void *DLSCH_dci=NULL;
|
||||
int size_bits=0,size_bytes=0;
|
||||
@@ -113,14 +95,14 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
|
||||
LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
|
||||
|
||||
start_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
|
||||
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);
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
DCI_pdu[CC_id] = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
|
||||
DCI_pdu[CC_id] = &RC.mac[module_idP]->common_channels[CC_id].DCI_pdu;
|
||||
mbsfn_status[CC_id]=0;
|
||||
// clear vrb_map
|
||||
memset(eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map,0,100);
|
||||
memset(RC.mac[module_idP]->common_channels[CC_id].vrb_map,0,100);
|
||||
}
|
||||
|
||||
// clear DCI and BCCH contents before scheduling
|
||||
@@ -128,10 +110,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
DCI_pdu[CC_id]->Num_common_dci = 0;
|
||||
DCI_pdu[CC_id]->Num_ue_spec_dci = 0;
|
||||
#ifdef Rel10
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].mcch_active =0;
|
||||
#endif
|
||||
eNB_mac_inst[module_idP].frame = frameP;
|
||||
eNB_mac_inst[module_idP].subframe = subframeP;
|
||||
RC.mac[module_idP]->frame = frameP;
|
||||
RC.mac[module_idP]->subframe = subframeP;
|
||||
}
|
||||
|
||||
// refresh UE list based on UEs dropped by PHY in previous subframe
|
||||
@@ -145,13 +127,13 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
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);
|
||||
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63;
|
||||
RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63;
|
||||
if (i==UE_list->head)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[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
|
||||
eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++;
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer++;
|
||||
|
||||
eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].cqi_req_timer++;
|
||||
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++;
|
||||
eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
|
||||
|
||||
if (eNB_UE_stats==NULL) {
|
||||
@@ -177,8 +159,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
LOG_D(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
|
||||
DLSCH_dci = (void *)UE_list->UE_template[CC_id][i].DLSCH_DCI[0];
|
||||
*(uint32_t*)DLSCH_dci = 0;
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
if (RC.eNB[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
switch (RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 31;
|
||||
@@ -206,7 +188,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
}
|
||||
}
|
||||
else { // FDD
|
||||
switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
switch (RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31;
|
||||
@@ -349,10 +331,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
#ifdef Rel10
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
if (eNB_mac_inst[module_idP].common_channels[CC_id].MBMS_flag >0) {
|
||||
start_meas(&eNB_mac_inst[module_idP].schedule_mch);
|
||||
if (RC.mac[module_idP]->common_channels[CC_id].MBMS_flag >0) {
|
||||
start_meas(&RC.mac[module_idP]->schedule_mch);
|
||||
mbsfn_status[CC_id] = schedule_MBMS(module_idP,CC_id,frameP,subframeP);
|
||||
stop_meas(&eNB_mac_inst[module_idP].schedule_mch);
|
||||
stop_meas(&RC.mac[module_idP]->schedule_mch);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1113,7 +1095,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
LOG_D(MAC,"frameP %d, subframeP %d\n",frameP,subframeP);
|
||||
*/
|
||||
|
||||
stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
{
|
||||
|
||||
int CC_id;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
|
||||
|
||||
RA_TEMPLATE *RA_template;
|
||||
@@ -112,8 +112,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
vrb_map[first_rb+2] = 1;
|
||||
vrb_map[first_rb+3] = 1;
|
||||
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
switch(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
if (RC.eNB[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
switch(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
|
||||
@@ -123,7 +123,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
|
||||
break;
|
||||
@@ -137,7 +137,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
|
||||
break;
|
||||
@@ -151,7 +151,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
|
||||
break;
|
||||
@@ -165,7 +165,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
|
||||
break;
|
||||
@@ -179,13 +179,13 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
switch(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
|
||||
@@ -195,7 +195,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
|
||||
break;
|
||||
@@ -209,7 +209,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_UL,first_rb,4);
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_UL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
|
||||
break;
|
||||
@@ -223,7 +223,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
|
||||
break;
|
||||
@@ -237,7 +237,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
|
||||
break;
|
||||
@@ -296,22 +296,6 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RA proc %d, RNTI %x)\n",
|
||||
module_idP, CC_id, frameP, subframeP,i,RA_template->rnti);
|
||||
|
||||
//msg("[MAC][eNB %d][RAPROC] Frame %d, subframeP %d: Received %d bytes for Msg4: \n",module_idP,frameP,subframeP,rrc_sdu_length);
|
||||
// for (j=0;j<rrc_sdu_length;j++)
|
||||
// msg("%x ",(unsigned char)eNB_mac_inst[module_idP][CC_id].CCCH_pdu.payload[j]);
|
||||
// msg("\n");
|
||||
// msg("[MAC][eNB] Frame %d, subframeP %d: Generated DLSCH (Msg4) DCI, format 1A, for UE %d\n",frameP, subframeP,UE_id);
|
||||
// Schedule Reflection of Connection request
|
||||
|
||||
/*
|
||||
// randomize frequency allocation for RA
|
||||
while (1) {
|
||||
first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL-4));
|
||||
|
||||
if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1))
|
||||
break;
|
||||
}
|
||||
*/
|
||||
first_rb=0;
|
||||
|
||||
vrb_map[first_rb] = 1;
|
||||
@@ -354,7 +338,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
|
||||
|
||||
@@ -390,7 +374,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
|
||||
break;
|
||||
@@ -424,7 +408,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
|
||||
|
||||
@@ -459,7 +443,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
|
||||
break;
|
||||
@@ -495,7 +479,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
|
||||
((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
|
||||
break;
|
||||
@@ -529,7 +513,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
|
||||
break;
|
||||
@@ -563,7 +547,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
|
||||
((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
|
||||
break;
|
||||
@@ -596,7 +580,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
|
||||
((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
|
||||
break;
|
||||
@@ -670,7 +654,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
if (round>0) {
|
||||
//RA_template->wait_ack_Msg4++;
|
||||
// we have to schedule a retransmission
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
if (RC.eNB[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
|
||||
} else {
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
|
||||
@@ -679,7 +663,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
/*
|
||||
// randomize frequency allocation for RA
|
||||
while (1) {
|
||||
first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL-4));
|
||||
first_rb = (unsigned char)(taus()%(RC.eNB[module_idP][CC_id].frame_parms.N_RB_DL-4));
|
||||
|
||||
if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1))
|
||||
break;
|
||||
@@ -691,12 +675,12 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
vrb_map[first_rb+2] = 1;
|
||||
vrb_map[first_rb+3] = 1;
|
||||
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_UL,first_rb,4);
|
||||
if (RC.eNB[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_UL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
|
||||
} else {
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_UL,first_rb,4);
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_UL,first_rb,4);
|
||||
rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
|
||||
((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
|
||||
}
|
||||
@@ -728,7 +712,7 @@ printf("MAC: msg4 acknowledged for rnti %x fsf %d/%d, let's configure it\n", RA_
|
||||
RA_template->RA_active=FALSE;
|
||||
UE_id = find_UE_id(module_idP,RA_template->rnti);
|
||||
DevAssert( UE_id != -1 );
|
||||
eNB_mac_inst[module_idP].UE_list.UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured=TRUE;
|
||||
RC.mac[module_idP]->UE_list.UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured=TRUE;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -743,7 +727,7 @@ void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t
|
||||
{
|
||||
|
||||
uint8_t i;
|
||||
RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0];
|
||||
RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&RC.mac[module_idP]->common_channels[CC_id].RA_template[0];
|
||||
|
||||
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index);
|
||||
|
||||
@@ -787,7 +771,7 @@ void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t
|
||||
void cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rnti)
|
||||
{
|
||||
unsigned char i;
|
||||
RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0];
|
||||
RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&RC.mac[module_idP]->common_channels[CC_id].RA_template[0];
|
||||
|
||||
MSC_LOG_EVENT(MSC_PHY_ENB, "RA Cancelling procedure ue %"PRIx16" ", rnti);
|
||||
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n",module_idP,CC_id,frameP,rnti);
|
||||
|
||||
@@ -75,7 +75,7 @@ schedule_SI(
|
||||
int mcs = -1;
|
||||
void *BCCH_alloc_pdu;
|
||||
int CC_id;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
uint8_t *vrb_map;
|
||||
int first_rb = -1;
|
||||
int rballoc[MAX_NUM_CCs];
|
||||
@@ -113,7 +113,7 @@ schedule_SI(
|
||||
break;
|
||||
}
|
||||
*/
|
||||
switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
switch (RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
first_rb = 0;
|
||||
break;
|
||||
@@ -159,11 +159,11 @@ schedule_SI(
|
||||
|
||||
|
||||
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
if (RC.eNB[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
switch (RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
|
||||
@@ -178,7 +178,7 @@ schedule_SI(
|
||||
|
||||
case 25:
|
||||
((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
|
||||
@@ -193,7 +193,7 @@ schedule_SI(
|
||||
|
||||
case 50:
|
||||
((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
|
||||
@@ -208,7 +208,7 @@ schedule_SI(
|
||||
|
||||
case 100:
|
||||
((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
|
||||
@@ -223,10 +223,10 @@ schedule_SI(
|
||||
}
|
||||
|
||||
} else {
|
||||
switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
switch (RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs;
|
||||
((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
|
||||
((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
|
||||
((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
|
||||
@@ -242,7 +242,7 @@ schedule_SI(
|
||||
|
||||
case 25:
|
||||
((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs;
|
||||
((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
|
||||
((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
|
||||
((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
|
||||
@@ -258,7 +258,7 @@ schedule_SI(
|
||||
|
||||
case 50:
|
||||
((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs;
|
||||
((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
|
||||
((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
|
||||
((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
|
||||
@@ -274,7 +274,7 @@ schedule_SI(
|
||||
|
||||
case 100:
|
||||
((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs;
|
||||
((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL,first_rb,4);
|
||||
((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
|
||||
((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
|
||||
((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
|
||||
@@ -318,7 +318,7 @@ schedule_SI(
|
||||
LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n",
|
||||
module_idP, frameP, CC_id, 0xffff, bcch_sdu_length);
|
||||
}
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
if (RC.eNB[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (TDD) for CC_id %d SI %d bytes (mcs %d, rb 3, TBS %d)\n",
|
||||
frameP,
|
||||
CC_id,
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
#define ENABLE_MAC_PAYLOAD_DEBUG
|
||||
//#define DEBUG_eNB_SCHEDULER 1
|
||||
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
@@ -96,7 +96,7 @@ schedule_next_dlue(
|
||||
{
|
||||
|
||||
int next_ue;
|
||||
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
|
||||
UE_list_t *UE_list=&RC.mac[module_idP]->UE_list;
|
||||
|
||||
for (next_ue=UE_list->head; next_ue>=0; next_ue=UE_list->next[next_ue] ) {
|
||||
if (eNB_dlsch_info[module_idP][CC_id][next_ue].status == S_DL_WAITING) {
|
||||
@@ -321,7 +321,7 @@ set_ul_DAI(
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
unsigned char DAI;
|
||||
|
||||
@@ -443,7 +443,7 @@ schedule_ue_spec(
|
||||
// uint16_t pre_nb_available_rbs[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
int mcs;
|
||||
int min_rb_unit[MAX_NUM_CCs];
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
int continue_flag=0;
|
||||
@@ -648,11 +648,11 @@ schedule_ue_spec(
|
||||
}
|
||||
|
||||
nb_available_rb -= nb_rb;
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb;
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctl->dl_pow_off[CC_id];
|
||||
RC.eNB[module_idP][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb;
|
||||
RC.eNB[module_idP][CC_id]->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctl->dl_pow_off[CC_id];
|
||||
|
||||
for(j=0; j<frame_parms[CC_id]->N_RBG; j++) {
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->mu_mimo_mode[UE_id].rballoc_sub[j] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j];
|
||||
RC.eNB[module_idP][CC_id]->mu_mimo_mode[UE_id].rballoc_sub[j] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j];
|
||||
}
|
||||
|
||||
switch (mac_xface->get_transmission_mode(module_idP,CC_id,rnti)) {
|
||||
@@ -1039,11 +1039,11 @@ schedule_ue_spec(
|
||||
}
|
||||
}
|
||||
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb;
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctl->dl_pow_off[CC_id];
|
||||
RC.eNB[module_idP][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb;
|
||||
RC.eNB[module_idP][CC_id]->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctl->dl_pow_off[CC_id];
|
||||
|
||||
for(j=0; j<frame_parms[CC_id]->N_RBG; j++) {
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->mu_mimo_mode[UE_id].rballoc_sub[j] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j];
|
||||
RC.eNB[module_idP][CC_id]->mu_mimo_mode[UE_id].rballoc_sub[j] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j];
|
||||
|
||||
}
|
||||
|
||||
@@ -1087,7 +1087,6 @@ schedule_ue_spec(
|
||||
|
||||
|
||||
offset = generate_dlsch_header((unsigned char*)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0],
|
||||
// offset = generate_dlsch_header((unsigned char*)eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0],
|
||||
num_sdus, //num_sdus
|
||||
sdu_lengths, //
|
||||
sdu_lcids,
|
||||
@@ -1116,14 +1115,14 @@ schedule_ue_spec(
|
||||
#endif
|
||||
// cycle through SDUs and place in dlsch_buffer
|
||||
memcpy(&UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset],dlsch_buffer,sdu_length_total);
|
||||
// memcpy(&eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0][offset],dcch_buffer,sdu_lengths[0]);
|
||||
// memcpy(RC.mac[0].DLSCH_pdu[0][0].payload[0][offset],dcch_buffer,sdu_lengths[0]);
|
||||
|
||||
// fill remainder of DLSCH with random data
|
||||
for (j=0; j<(TBS-sdu_length_total-offset); j++) {
|
||||
UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset+sdu_length_total+j] = (char)(taus()&0xff);
|
||||
}
|
||||
|
||||
//eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0][offset+sdu_lengths[0]+j] = (char)(taus()&0xff);
|
||||
|
||||
if (opt_enabled == 1) {
|
||||
trace_pdu(1, (uint8_t *)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0],
|
||||
TBS, module_idP, 3, UE_RNTI(module_idP,UE_id),
|
||||
@@ -1530,7 +1529,7 @@ fill_DLSCH_dci(
|
||||
//void *BCCH_alloc_pdu;
|
||||
int size_bits,size_bytes;
|
||||
int CC_id;
|
||||
eNB_MAC_INST *eNB =&eNB_mac_inst[module_idP];
|
||||
eNB_MAC_INST *eNB =RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
//RA_TEMPLATE *RA_template;
|
||||
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
|
||||
@@ -1565,7 +1564,7 @@ fill_DLSCH_dci(
|
||||
|
||||
|
||||
/// Synchronizing rballoc with rballoc_sub
|
||||
for(i=0; i<PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RBG; i++) {
|
||||
for(i=0; i<RC.eNB[module_idP][CC_id]->frame_parms.N_RBG; i++) {
|
||||
rballoc_sub[i] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][i];
|
||||
}
|
||||
|
||||
@@ -1579,8 +1578,8 @@ fill_DLSCH_dci(
|
||||
case 7:
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Adding UE %d spec DCI for %d PRBS \n",module_idP, CC_id, UE_id, nb_rb);
|
||||
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
if (RC.eNB[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
switch (RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI1_1_5MHz_TDD_t*)DLSCH_dci)->rballoc = allocate_prbs_sub(nb_rb,rballoc_sub);
|
||||
((DCI1_1_5MHz_TDD_t*)DLSCH_dci)->rah = 0;
|
||||
@@ -1619,7 +1618,7 @@ fill_DLSCH_dci(
|
||||
|
||||
|
||||
} else {
|
||||
switch(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
switch(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI1_1_5MHz_FDD_t*)DLSCH_dci)->rballoc = allocate_prbs_sub(nb_rb,rballoc_sub);
|
||||
((DCI1_1_5MHz_FDD_t*)DLSCH_dci)->rah = 0;
|
||||
@@ -1675,8 +1674,8 @@ fill_DLSCH_dci(
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Adding Format 2A UE %d spec DCI for %d PRBS\n",
|
||||
module_idP, CC_id, UE_id, nb_rb);
|
||||
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
if (RC.eNB[module_idP][CC_id]->frame_parms.frame_type == TDD) {
|
||||
switch (RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI2A_1_5MHz_2A_TDD_t*)DLSCH_dci)->rballoc = allocate_prbs_sub(nb_rb,rballoc_sub);
|
||||
((DCI2A_1_5MHz_2A_TDD_t*)DLSCH_dci)->rah = 0;
|
||||
@@ -1715,7 +1714,7 @@ fill_DLSCH_dci(
|
||||
|
||||
|
||||
} else {
|
||||
switch(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
switch(RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->rballoc = allocate_prbs_sub(nb_rb,rballoc_sub);
|
||||
((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->rah = 0;
|
||||
@@ -1832,7 +1831,7 @@ get_dlsch_sdu(
|
||||
{
|
||||
|
||||
int UE_id;
|
||||
eNB_MAC_INST *eNB=&eNB_mac_inst[module_idP];
|
||||
eNB_MAC_INST *eNB=RC.mac[module_idP];
|
||||
|
||||
if (rntiP==SI_RNTI) {
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d Get DLSCH sdu for BCCH \n", module_idP, CC_id, frameP);
|
||||
@@ -1863,7 +1862,7 @@ update_ul_dci(
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
|
||||
DCI_PDU *DCI_pdu = &RC.mac[module_idP]->common_channels[CC_id].DCI_pdu;
|
||||
int i;
|
||||
DCI0_5MHz_TDD_1_6_t *ULSCH_dci = NULL;;
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#define ENABLE_MAC_PAYLOAD_DEBUG
|
||||
#define DEBUG_eNB_SCHEDULER 1
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
#ifdef Rel10
|
||||
int8_t get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t CC_id, uint8_t mbsfn_sync_area)
|
||||
@@ -68,7 +69,7 @@ int8_t get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t CC_id, uint8_t mb
|
||||
if (mbsfn_sync_area > MAX_MBSFN_AREA) {
|
||||
LOG_W(MAC,"[eNB %d] CC_id %d MBSFN synchronization area %d out of range\n ", module_idP, CC_id, mbsfn_sync_area);
|
||||
return -1;
|
||||
} else if (eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[mbsfn_sync_area] != NULL) {
|
||||
} else if (RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[mbsfn_sync_area] != NULL) {
|
||||
return mbsfn_sync_area;
|
||||
} else {
|
||||
LOG_W(MAC,"[eNB %d] CC_id %d MBSFN Subframe Config pattern %d not found \n ", module_idP, CC_id, mbsfn_sync_area);
|
||||
@@ -80,9 +81,9 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
{
|
||||
|
||||
int mcch_flag=0,mtch_flag=0, msi_flag=0;
|
||||
int mbsfn_period =0;// 1<<(eNB_mac_inst[module_idP].mbsfn_SubframeConfig[0]->radioframeAllocationPeriod);
|
||||
int mcch_period = 0;//32<<(eNB_mac_inst[module_idP].mbsfn_AreaInfo[0]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
int mch_scheduling_period = 8<<(eNB_mac_inst[module_idP].common_channels[CC_id].pmch_Config[0]->mch_SchedulingPeriod_r9);
|
||||
int mbsfn_period =0;// 1<<(RC.mac[module_idP]->mbsfn_SubframeConfig[0]->radioframeAllocationPeriod);
|
||||
int mcch_period = 0;//32<<(RC.mac[module_idP]->mbsfn_AreaInfo[0]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
int mch_scheduling_period = 8<<(RC.mac[module_idP]->common_channels[CC_id].pmch_Config[0]->mch_SchedulingPeriod_r9);
|
||||
unsigned char mcch_sdu_length;
|
||||
unsigned char header_len_mcch=0,header_len_msi=0,header_len_mtch=0, header_len_mtch_temp=0, header_len_mcch_temp=0, header_len_msi_temp=0;
|
||||
int ii=0, msi_pos=0;
|
||||
@@ -95,26 +96,26 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
uint16_t sdu_lengths[11], sdu_length_total=0;
|
||||
unsigned char mch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; // check the max value, this is for dlsch only
|
||||
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.Pdu_size=0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.Pdu_size=0;
|
||||
|
||||
for (i=0;
|
||||
i< eNB_mac_inst[module_idP].common_channels[CC_id].num_active_mbsfn_area;
|
||||
i< RC.mac[module_idP]->common_channels[CC_id].num_active_mbsfn_area;
|
||||
i++ ) {
|
||||
// assume, that there is always a mapping
|
||||
if ((j=get_mbsfn_sf_alloction(module_idP,CC_id,i)) == -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
mbsfn_period = 1<<(eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->radioframeAllocationPeriod);
|
||||
mcch_period = 32<<(eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
mbsfn_period = 1<<(RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->radioframeAllocationPeriod);
|
||||
mcch_period = 32<<(RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
msi_pos=0;
|
||||
ii=0;
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d subframeP %d : Checking MBSFN Sync Area %d/%d with SF allocation %d/%d for MCCH and MTCH (mbsfn period %d, mcch period %d)\n",
|
||||
module_idP, CC_id, frameP, subframeP,i,eNB_mac_inst[module_idP].common_channels[CC_id].num_active_mbsfn_area,
|
||||
j,eNB_mac_inst[module_idP].common_channels[CC_id].num_sf_allocation_pattern,mbsfn_period,mcch_period);
|
||||
module_idP, CC_id, frameP, subframeP,i,RC.mac[module_idP]->common_channels[CC_id].num_active_mbsfn_area,
|
||||
j,RC.mac[module_idP]->common_channels[CC_id].num_sf_allocation_pattern,mbsfn_period,mcch_period);
|
||||
|
||||
|
||||
switch (eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.signallingMCS_r9) {
|
||||
switch (RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.signallingMCS_r9) {
|
||||
case 0:
|
||||
mcch_mcs = 2;
|
||||
break;
|
||||
@@ -133,32 +134,32 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
}
|
||||
|
||||
// 1st: Check the MBSFN subframes from SIB2 info (SF allocation pattern i, max 8 non-overlapping patterns exist)
|
||||
if (frameP % mbsfn_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->radioframeAllocationOffset) { // MBSFN frameP
|
||||
if (eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) { // one-frameP format
|
||||
if (frameP % mbsfn_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->radioframeAllocationOffset) { // MBSFN frameP
|
||||
if (RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) { // one-frameP format
|
||||
|
||||
// Find the first subframeP in this MCH to transmit MSI
|
||||
if (frameP % mch_scheduling_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->radioframeAllocationOffset ) {
|
||||
if (frameP % mch_scheduling_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->radioframeAllocationOffset ) {
|
||||
while (ii == 0) {
|
||||
ii = eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & (0x80>>msi_pos);
|
||||
ii = RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & (0x80>>msi_pos);
|
||||
msi_pos++;
|
||||
}
|
||||
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d subframeP %d : sync area %d sf allocation pattern %d sf alloc %x msi pos is %d \n",
|
||||
module_idP, CC_id, frameP, subframeP,i,j,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0], msi_pos);
|
||||
RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0], msi_pos);
|
||||
}
|
||||
|
||||
// Check if the subframeP is for MSI, MCCH or MTCHs and Set the correspoding flag to 1
|
||||
switch (subframeP) {
|
||||
case 1:
|
||||
if (mac_xface->frame_parms->frame_type == FDD) {
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF1) == MBSFN_FDD_SF1) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF1) == MBSFN_FDD_SF1) {
|
||||
if (msi_pos == 1) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF1) == MBSFN_FDD_SF1) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF1) == MBSFN_FDD_SF1) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
@@ -170,13 +171,13 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
|
||||
case 2:
|
||||
if (mac_xface->frame_parms->frame_type == FDD) {
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF2) == MBSFN_FDD_SF2) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF2) == MBSFN_FDD_SF2) {
|
||||
if (msi_pos == 2) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF2) == MBSFN_FDD_SF2) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF2) == MBSFN_FDD_SF2) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
@@ -188,26 +189,26 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
|
||||
case 3:
|
||||
if (mac_xface->frame_parms->frame_type == TDD) { // TDD
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_TDD_SF3) == MBSFN_TDD_SF3) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_TDD_SF3) == MBSFN_TDD_SF3) {
|
||||
if (msi_pos == 1) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_TDD_SF3) == MBSFN_TDD_SF3) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_TDD_SF3) == MBSFN_TDD_SF3) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
mtch_flag = 1;
|
||||
}
|
||||
} else { // FDD
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF3) == MBSFN_FDD_SF3) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF3) == MBSFN_FDD_SF3) {
|
||||
if (msi_pos == 3) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF3) == MBSFN_FDD_SF3) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF3) == MBSFN_FDD_SF3) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
@@ -219,13 +220,13 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
|
||||
case 4:
|
||||
if (mac_xface->frame_parms->frame_type == TDD) {
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_TDD_SF4) == MBSFN_TDD_SF4) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_TDD_SF4) == MBSFN_TDD_SF4) {
|
||||
if (msi_pos == 2) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_TDD_SF4) == MBSFN_TDD_SF4) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_TDD_SF4) == MBSFN_TDD_SF4) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
@@ -237,13 +238,13 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
|
||||
case 6:
|
||||
if (mac_xface->frame_parms->frame_type == FDD) {
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF6) == MBSFN_FDD_SF6) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF6) == MBSFN_FDD_SF6) {
|
||||
if (msi_pos == 4) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF6) == MBSFN_FDD_SF6) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF6) == MBSFN_FDD_SF6) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
@@ -255,26 +256,26 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
|
||||
case 7:
|
||||
if (mac_xface->frame_parms->frame_type == TDD) { // TDD
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_TDD_SF7) == MBSFN_TDD_SF7) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_TDD_SF7) == MBSFN_TDD_SF7) {
|
||||
if (msi_pos == 3) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_TDD_SF7) == MBSFN_TDD_SF7) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_TDD_SF7) == MBSFN_TDD_SF7) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
mtch_flag = 1;
|
||||
}
|
||||
} else { // FDD
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF7) == MBSFN_FDD_SF7) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF7) == MBSFN_FDD_SF7) {
|
||||
if (msi_pos == 5) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF7) == MBSFN_FDD_SF7) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF7) == MBSFN_FDD_SF7) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
@@ -286,26 +287,26 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
|
||||
case 8:
|
||||
if (mac_xface->frame_parms->frame_type == TDD) { //TDD
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_TDD_SF8) == MBSFN_TDD_SF8) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_TDD_SF8) == MBSFN_TDD_SF8) {
|
||||
if (msi_pos == 4) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_TDD_SF8) == MBSFN_TDD_SF8) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_TDD_SF8) == MBSFN_TDD_SF8) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
mtch_flag = 1;
|
||||
}
|
||||
} else { // FDD
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF8) == MBSFN_FDD_SF8) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_FDD_SF8) == MBSFN_FDD_SF8) {
|
||||
if (msi_pos == 6) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF8) == MBSFN_FDD_SF8) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_FDD_SF8) == MBSFN_FDD_SF8) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
@@ -317,13 +318,13 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
|
||||
case 9:
|
||||
if (mac_xface->frame_parms->frame_type == TDD) {
|
||||
if ((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_TDD_SF9) == MBSFN_TDD_SF9) {
|
||||
if ((RC.mac[module_idP]->common_channels[CC_id].mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0] & MBSFN_TDD_SF9) == MBSFN_TDD_SF9) {
|
||||
if (msi_pos == 5) {
|
||||
msi_flag = 1;
|
||||
}
|
||||
|
||||
if ( (frameP % mcch_period == eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_TDD_SF9) == MBSFN_TDD_SF9) ) {
|
||||
if ( (frameP % mcch_period == RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_Offset_r9) &&
|
||||
((RC.mac[module_idP]->common_channels[CC_id].mbsfn_AreaInfo[i]->mcch_Config_r9.sf_AllocInfo_r9.buf[0] & MBSFN_TDD_SF9) == MBSFN_TDD_SF9) ) {
|
||||
mcch_flag = 1;
|
||||
}
|
||||
|
||||
@@ -345,15 +346,15 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
}
|
||||
} // end of for loop
|
||||
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].msi_active=0;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active=0;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].mtch_active=0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].msi_active=0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].mcch_active=0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].mtch_active=0;
|
||||
|
||||
// Calculate the mcs
|
||||
if ((msi_flag==1) || (mcch_flag==1)) {
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mcs = mcch_mcs;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mcs = mcch_mcs;
|
||||
} else if (mtch_flag == 1) { // only MTCH in this subframeP
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mcs = eNB_mac_inst[module_idP].common_channels[CC_id].pmch_Config[0]->dataMCS_r9;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mcs = RC.mac[module_idP]->common_channels[CC_id].pmch_Config[0]->dataMCS_r9;
|
||||
}
|
||||
|
||||
|
||||
@@ -378,10 +379,10 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
msi_ptr+= sizeof(MSI_ELEMENT);
|
||||
|
||||
//Header for MTCHs
|
||||
num_mtch = eNB_mac_inst[module_idP].common_channels[CC_id].mbms_SessionList[0]->list.count;
|
||||
num_mtch = RC.mac[module_idP]->common_channels[CC_id].mbms_SessionList[0]->list.count;
|
||||
|
||||
for (k=0; k<num_mtch; k++) { // loop for all session in this MCH (MCH[0]) at this moment
|
||||
((MSI_ELEMENT *) msi_ptr)->lcid = eNB_mac_inst[module_idP].common_channels[CC_id].mbms_SessionList[0]->list.array[k]->logicalChannelIdentity_r9;//mtch_lcid;
|
||||
((MSI_ELEMENT *) msi_ptr)->lcid = RC.mac[module_idP]->common_channels[CC_id].mbms_SessionList[0]->list.array[k]->logicalChannelIdentity_r9;//mtch_lcid;
|
||||
((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB = 0; // last subframeP of this mtch (only one mtch now)
|
||||
((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = 0xB;
|
||||
msi_ptr+=sizeof(MSI_ELEMENT);
|
||||
@@ -410,7 +411,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
LOG_I(MAC,"[eNB %d] CC_id %d Create %d bytes for MSI\n", module_idP, CC_id, sdu_lengths[num_sdus]);
|
||||
num_sdus++;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].msi_active=1;
|
||||
RC.mac[module_idP]->common_channels[CC_id].msi_active=1;
|
||||
}
|
||||
|
||||
// there is MCCH
|
||||
@@ -422,7 +423,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
CC_id,
|
||||
frameP,
|
||||
MCCH,1,
|
||||
&eNB_mac_inst[module_idP].common_channels[CC_id].MCCH_pdu.payload[0],
|
||||
&RC.mac[module_idP]->common_channels[CC_id].MCCH_pdu.payload[0],
|
||||
1,// this is eNB
|
||||
module_idP, // index
|
||||
i); // this is the mbsfn sync area index
|
||||
@@ -447,10 +448,10 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
mcch_mcs);
|
||||
}
|
||||
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active=1;
|
||||
RC.mac[module_idP]->common_channels[CC_id].mcch_active=1;
|
||||
|
||||
memcpy((char *)&mch_buffer[sdu_length_total],
|
||||
&eNB_mac_inst[module_idP].common_channels[CC_id].MCCH_pdu.payload[0],
|
||||
&RC.mac[module_idP]->common_channels[CC_id].MCCH_pdu.payload[0],
|
||||
mcch_sdu_length);
|
||||
sdu_lcids[num_sdus] = MCCH_LCHANID;
|
||||
sdu_lengths[num_sdus] = mcch_sdu_length;
|
||||
@@ -465,11 +466,11 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
}
|
||||
}
|
||||
|
||||
TBS = mac_xface->get_TBS_DL(eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mcs, mac_xface->frame_parms->N_RB_DL);
|
||||
TBS = mac_xface->get_TBS_DL(RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mcs, mac_xface->frame_parms->N_RB_DL);
|
||||
#ifdef Rel10
|
||||
// do not let mcch and mtch multiplexing when relaying is active
|
||||
// for sync area 1, so not transmit data
|
||||
//if ((i == 0) && ((eNB_mac_inst[module_idP].MBMS_flag != multicast_relay) || (eNB_mac_inst[module_idP].mcch_active==0))) {
|
||||
//if ((i == 0) && ((RC.mac[module_idP]->MBMS_flag != multicast_relay) || (RC.mac[module_idP]->mcch_active==0))) {
|
||||
#endif
|
||||
|
||||
// there is MTCHs, loop if there are more than 1
|
||||
@@ -479,7 +480,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
TBS = mac_xface->get_TBS(mcch_mcs, mac_xface->frame_parms->N_RB_DL);
|
||||
}
|
||||
else { // only MTCH in this subframeP
|
||||
TBS = mac_xface->get_TBS(eNB_mac_inst[module_idP].pmch_Config[0]->dataMCS_r9, mac_xface->frame_parms->N_RB_DL);
|
||||
TBS = mac_xface->get_TBS(RC.mac[module_idP]->pmch_Config[0]->dataMCS_r9, mac_xface->frame_parms->N_RB_DL);
|
||||
}
|
||||
|
||||
// get MTCH data from RLC (like for DTCH)
|
||||
@@ -524,7 +525,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
(char*)&mch_buffer[sdu_length_total]);
|
||||
//sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]);
|
||||
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] CC_id %d Got %d bytes for MTCH %d\n",module_idP,CC_id,sdu_lengths[num_sdus],MTCH);
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].mtch_active=1;
|
||||
RC.mac[module_idP]->common_channels[CC_id].mtch_active=1;
|
||||
sdu_lcids[num_sdus] = MTCH;
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
|
||||
@@ -546,10 +547,10 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
if ((sdu_length_total + header_len_msi + header_len_mcch + header_len_mtch) >0) {
|
||||
// Adjust the last subheader
|
||||
/* if ((msi_flag==1) || (mcch_flag==1)) {
|
||||
eNB_mac_inst[module_idP].MCH_pdu.mcs = mcch_mcs;
|
||||
RC.mac[module_idP]->MCH_pdu.mcs = mcch_mcs;
|
||||
}
|
||||
else if (mtch_flag == 1) { // only MTCH in this subframeP
|
||||
eNB_mac_inst[module_idP].MCH_pdu.mcs = eNB_mac_inst[module_idP].pmch_Config[0]->dataMCS_r9;
|
||||
RC.mac[module_idP]->MCH_pdu.mcs = RC.mac[module_idP]->pmch_Config[0]->dataMCS_r9;
|
||||
}
|
||||
*/
|
||||
header_len_mtch_temp = header_len_mtch;
|
||||
@@ -588,7 +589,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
|
||||
// Generate the MAC Header for MCH
|
||||
// here we use the function for DLSCH because DLSCH & MCH have the same Header structure
|
||||
offset = generate_dlsch_header((unsigned char*)eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.payload,
|
||||
offset = generate_dlsch_header((unsigned char*)RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.payload,
|
||||
num_sdus,
|
||||
sdu_lengths,
|
||||
sdu_lcids,
|
||||
@@ -598,48 +599,48 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
padding,
|
||||
post_padding);
|
||||
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.Pdu_size=TBS;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.sync_area=i;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.msi_active= eNB_mac_inst[module_idP].common_channels[CC_id].msi_active;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mcch_active= eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mtch_active= eNB_mac_inst[module_idP].common_channels[CC_id].mtch_active;
|
||||
LOG_D(MAC," MCS for this sf is %d (mcch active %d, mtch active %d)\n", eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mcs,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mcch_active,eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mtch_active );
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.Pdu_size=TBS;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.sync_area=i;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.msi_active= RC.mac[module_idP]->common_channels[CC_id].msi_active;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mcch_active= RC.mac[module_idP]->common_channels[CC_id].mcch_active;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mtch_active= RC.mac[module_idP]->common_channels[CC_id].mtch_active;
|
||||
LOG_D(MAC," MCS for this sf is %d (mcch active %d, mtch active %d)\n", RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mcs,
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mcch_active,RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mtch_active );
|
||||
LOG_I(MAC,
|
||||
"[eNB %d][MBMS USER-PLANE ] CC_id %d Generate header : sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,padding %d,post_padding %d (mcs %d, TBS %d), header MTCH %d, header MCCH %d, header MSI %d\n",
|
||||
module_idP,CC_id,sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset,padding,post_padding,eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mcs,TBS,
|
||||
module_idP,CC_id,sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset,padding,post_padding,RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mcs,TBS,
|
||||
header_len_mtch, header_len_mcch, header_len_msi);
|
||||
// copy SDU to mch_pdu after the MAC Header
|
||||
memcpy(&eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.payload[offset],mch_buffer,sdu_length_total);
|
||||
memcpy(&RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.payload[offset],mch_buffer,sdu_length_total);
|
||||
|
||||
// filling remainder of MCH with random data if necessery
|
||||
for (j=0; j<(TBS-sdu_length_total-offset); j++) {
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.payload[offset+sdu_length_total+j] = (char)(taus()&0xff);
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.payload[offset+sdu_length_total+j] = (char)(taus()&0xff);
|
||||
}
|
||||
|
||||
/* Tracing of PDU is done on UE side */
|
||||
if (opt_enabled ==1 ) {
|
||||
trace_pdu(1, (uint8_t *)eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.payload,
|
||||
trace_pdu(1, (uint8_t *)RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.payload,
|
||||
TBS, module_idP, 6, 0xffff, // M_RNTI = 6 in wirehsark
|
||||
eNB_mac_inst[module_idP].frame, eNB_mac_inst[module_idP].subframe,0,0);
|
||||
RC.mac[module_idP]->frame, RC.mac[module_idP]->subframe,0,0);
|
||||
LOG_D(OPT,"[eNB %d][MCH] CC_id %d Frame %d : MAC PDU with size %d\n",
|
||||
module_idP, CC_id, frameP, TBS);
|
||||
}
|
||||
|
||||
/*
|
||||
for (j=0;j<sdu_length_total;j++)
|
||||
printf("%2x.",eNB_mac_inst[module_idP].MCH_pdu.payload[j+offset]);
|
||||
printf("%2x.",RC.mac[module_idP]->MCH_pdu.payload[j+offset]);
|
||||
printf(" \n");*/
|
||||
return 1;
|
||||
} else {
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.Pdu_size=0;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.sync_area=0;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.msi_active=0;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mcch_active=0;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.mtch_active=0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.Pdu_size=0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.sync_area=0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.msi_active=0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mcch_active=0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].MCH_pdu.mtch_active=0;
|
||||
// for testing purpose, fill with random data
|
||||
//for (j=0;j<(TBS-sdu_length_total-offset);j++)
|
||||
// eNB_mac_inst[module_idP].MCH_pdu.payload[offset+sdu_length_total+j] = (char)(taus()&0xff);
|
||||
// RC.mac[module_idP]->MCH_pdu.payload[offset+sdu_length_total+j] = (char)(taus()&0xff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -656,10 +657,10 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
|
||||
MCH_PDU *get_mch_sdu(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t subframeP)
|
||||
{
|
||||
// eNB_mac_inst[module_idP].MCH_pdu.mcs=0;
|
||||
//LOG_D(MAC," MCH_pdu.mcs is %d\n", eNB_mac_inst[module_idP].MCH_pdu.mcs);
|
||||
// RC.mac[module_idP]->MCH_pdu.mcs=0;
|
||||
//LOG_D(MAC," MCH_pdu.mcs is %d\n", RC.mac[module_idP]->MCH_pdu.mcs);
|
||||
//#warning "MCH pdu should take the CC_id index"
|
||||
return(&eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu);
|
||||
return(&RC.mac[module_idP]->common_channels[CC_id].MCH_pdu);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -99,7 +99,7 @@ DCI_PDU *get_dci_sdu(module_id_t module_idP, int CC_id,frame_t frameP, sub_frame
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
return(&eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu);
|
||||
return(&RC.mac[module_idP]->common_channels[CC_id].DCI_pdu);
|
||||
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ int find_UE_id(module_id_t mod_idP, rnti_t rntiP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
int UE_id;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
if (UE_list->active[UE_id] != TRUE) continue;
|
||||
@@ -131,7 +131,7 @@ int UE_num_active_CC(UE_list_t *listP,int ue_idP)
|
||||
int UE_PCCID(module_id_t mod_idP,int ue_idP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
return(eNB_mac_inst[mod_idP].UE_list.pCC_id[ue_idP]);
|
||||
return(RC.mac[mod_idP]->UE_list.pCC_id[ue_idP]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -139,7 +139,7 @@ rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
rnti_t rnti = eNB_mac_inst[mod_idP].UE_list.UE_template[UE_PCCID(mod_idP,ue_idP)][ue_idP].rnti;
|
||||
rnti_t rnti = RC.mac[mod_idP]->UE_list.UE_template[UE_PCCID(mod_idP,ue_idP)][ue_idP].rnti;
|
||||
|
||||
if (rnti>0) {
|
||||
return (rnti);
|
||||
@@ -154,7 +154,7 @@ rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP)
|
||||
boolean_t is_UE_active(module_id_t mod_idP, int ue_idP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
return(eNB_mac_inst[mod_idP].UE_list.active[ue_idP]);
|
||||
return(RC.mac[mod_idP]->UE_list.active[ue_idP]);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -227,7 +227,7 @@ uint8_t find_num_active_UEs_in_cbagroup(module_id_t module_idP, int CC_id,unsign
|
||||
unsigned char nb_ue_in_pusch=0;
|
||||
LTE_eNB_UE_stats* eNB_UE_stats;
|
||||
|
||||
for (UE_id=group_id;UE_id<NUMBER_OF_UE_MAX;UE_id+=eNB_mac_inst[module_idP].common_channels[CC_id].num_active_cba_groups) {
|
||||
for (UE_id=group_id;UE_id<NUMBER_OF_UE_MAX;UE_id+=RC.mac[module_idP]->common_channels[CC_id].num_active_cba_groups) {
|
||||
|
||||
if (((rnti=eNB_mac_inst[module_idP][CC_id].UE_template[UE_id].rnti) !=0) &&
|
||||
(eNB_mac_inst[module_idP][CC_id].UE_template[UE_id].ul_active==TRUE) &&
|
||||
@@ -266,7 +266,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP)
|
||||
int UE_id;
|
||||
int i, j;
|
||||
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
|
||||
LOG_D(MAC,"[eNB %d, CC_id %d] Adding UE with rnti %x (next avail %d, num_UEs %d)\n",mod_idP,cc_idP,rntiP,UE_list->avail,UE_list->num_UEs);
|
||||
dump_ue_list(UE_list,0);
|
||||
@@ -309,7 +309,7 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
int i;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
int UE_id = find_UE_id(mod_idP,rntiP);
|
||||
int pCC_id;
|
||||
|
||||
@@ -348,7 +348,7 @@ printf("MAC: remove UE %d rnti %x\n", UE_id, rntiP);
|
||||
// check if this has an RA process active
|
||||
RA_TEMPLATE *RA_template;
|
||||
for (i=0;i<NB_RA_PROC_MAX;i++) {
|
||||
RA_template = (RA_TEMPLATE *)&eNB_mac_inst[mod_idP].common_channels[pCC_id].RA_template[i];
|
||||
RA_template = (RA_TEMPLATE *)&RC.mac[mod_idP]->common_channels[pCC_id].RA_template[i];
|
||||
if (RA_template->rnti == rntiP){
|
||||
RA_template->RA_active=FALSE;
|
||||
RA_template->generate_rar=0;
|
||||
@@ -681,8 +681,8 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si
|
||||
uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id)
|
||||
{
|
||||
|
||||
UE_TEMPLATE *UE_template = &eNB_mac_inst[module_idP].UE_list.UE_template[CC_id][UE_id];
|
||||
UE_sched_ctrl *UE_sched_ctl = &eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[UE_id];
|
||||
UE_TEMPLATE *UE_template = &RC.mac[module_idP]->UE_list.UE_template[CC_id][UE_id];
|
||||
UE_sched_ctrl *UE_sched_ctl = &RC.mac[module_idP]->UE_list.UE_sched_ctrl[UE_id];
|
||||
|
||||
|
||||
// do not schedule UE if UL is not working
|
||||
@@ -905,7 +905,7 @@ int get_nb_subband(void)
|
||||
|
||||
void init_CCE_table(int module_idP,int CC_idP)
|
||||
{
|
||||
memset(eNB_mac_inst[module_idP].CCE_table[CC_idP],0,800*sizeof(int));
|
||||
memset(RC.mac[module_idP]->CCE_table[CC_idP],0,800*sizeof(int));
|
||||
}
|
||||
|
||||
|
||||
@@ -1056,8 +1056,8 @@ int allocate_CCEs(int module_idP,
|
||||
int test_onlyP) {
|
||||
|
||||
|
||||
int *CCE_table = eNB_mac_inst[module_idP].CCE_table[CC_idP];
|
||||
DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu;
|
||||
int *CCE_table = RC.mac[module_idP]->CCE_table[CC_idP];
|
||||
DCI_PDU *DCI_pdu = &RC.mac[module_idP]->common_channels[CC_idP].DCI_pdu;
|
||||
int nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,1,subframeP);
|
||||
int fCCE;
|
||||
int i,j;
|
||||
@@ -1137,7 +1137,7 @@ boolean_t CCE_allocation_infeasible(int module_idP,
|
||||
int rnti) {
|
||||
|
||||
|
||||
DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu;
|
||||
DCI_PDU *DCI_pdu = &RC.mac[module_idP]->common_channels[CC_idP].DCI_pdu;
|
||||
//DCI_ALLOC_t *dci_alloc;
|
||||
int ret;
|
||||
boolean_t res=FALSE;
|
||||
@@ -1167,7 +1167,7 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP
|
||||
{
|
||||
|
||||
int UE_id = find_UE_id(mod_idP, rntiP);
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
|
||||
if (UE_id != -1) {
|
||||
if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED)
|
||||
@@ -1187,7 +1187,7 @@ void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti
|
||||
{
|
||||
|
||||
int UE_id = find_UE_id(mod_idP, rntiP);
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
|
||||
if (UE_id != -1) {
|
||||
LOG_I(MAC,"[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n",
|
||||
|
||||
@@ -79,7 +79,7 @@ void rx_sdu(const module_id_t enb_mod_idP,
|
||||
unsigned short rx_lengths[NB_RB_MAX];
|
||||
int UE_id = find_UE_id(enb_mod_idP,rntiP);
|
||||
int ii,j;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[enb_mod_idP];
|
||||
eNB_MAC_INST *eNB = RC.mac[enb_mod_idP];
|
||||
UE_list_t *UE_list= &eNB->UE_list;
|
||||
int crnti_rx=0;
|
||||
int old_buffer_info;
|
||||
@@ -186,9 +186,9 @@ void rx_sdu(const module_id_t enb_mod_idP,
|
||||
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid];
|
||||
|
||||
PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP] = (payload_ptr[0] & 0x3f);
|
||||
RC.eNB[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP] = (payload_ptr[0] & 0x3f);
|
||||
if (UE_id == UE_list->head)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP]);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,RC.eNB[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP]);
|
||||
if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0 ) {
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid]=frameP;
|
||||
}
|
||||
@@ -614,7 +614,7 @@ void set_msg3_subframe(module_id_t Mod_id,
|
||||
int Msg3_frame,
|
||||
int Msg3_subframe)
|
||||
{
|
||||
eNB_MAC_INST *eNB=&eNB_mac_inst[Mod_id];
|
||||
eNB_MAC_INST *eNB=RC.mac[Mod_id];
|
||||
int i;
|
||||
for (i=0; i<NB_RA_PROC_MAX; i++) {
|
||||
if (eNB->common_channels[CC_id].RA_template[i].RA_active == TRUE &&
|
||||
@@ -635,7 +635,7 @@ void schedule_ulsch(module_id_t module_idP,
|
||||
|
||||
uint16_t first_rb[MAX_NUM_CCs],i;
|
||||
int CC_id;
|
||||
eNB_MAC_INST *eNB=&eNB_mac_inst[module_idP];
|
||||
eNB_MAC_INST *eNB=RC.mac[module_idP];
|
||||
|
||||
start_meas(&eNB->schedule_ulsch);
|
||||
|
||||
@@ -715,7 +715,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
static int32_t tpc_accumulated=0;
|
||||
|
||||
int n,CC_id = 0;
|
||||
eNB_MAC_INST *eNB=&eNB_mac_inst[module_idP];
|
||||
eNB_MAC_INST *eNB=RC.mac[module_idP];
|
||||
UE_list_t *UE_list=&eNB->UE_list;
|
||||
UE_TEMPLATE *UE_template;
|
||||
UE_sched_ctrl *UE_sched_ctrl;
|
||||
@@ -817,8 +817,8 @@ abort();
|
||||
LOG_T(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d round %d (rnti %x,mode %s)\n",
|
||||
module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,rnti,mode_string[eNB_UE_stats->mode]);
|
||||
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]);
|
||||
RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]);
|
||||
if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0))
|
||||
// if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames
|
||||
{
|
||||
@@ -1195,7 +1195,7 @@ abort();
|
||||
void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframeP, unsigned char sched_subframe, uint16_t *first_rb)
|
||||
{
|
||||
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list=&eNB->UE_list;
|
||||
//UE_TEMPLATE *UE_template;
|
||||
void *ULSCH_dci = NULL;
|
||||
@@ -1213,7 +1213,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
uint8_t allocated_rbs=0;
|
||||
uint8_t total_UEs=UE_list->num_UEs;
|
||||
uint8_t active_UEs[NUM_MAX_CBA_GROUP];
|
||||
uint8_t total_groups=eNB_mac_inst[module_idP].common_channels[CC_id].num_active_cba_groups;
|
||||
uint8_t total_groups=RC.mac[module_idP]->common_channels[CC_id].num_active_cba_groups;
|
||||
int min_rb_unit=2;
|
||||
uint8_t cba_policy=CBA_ES;
|
||||
int UE_id;
|
||||
@@ -1241,7 +1241,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
frame_parms=mac_xface->get_lte_frame_parms(module_idP,CC_id);
|
||||
available_rbs=frame_parms->N_RB_DL-1-first_rb[CC_id];
|
||||
remaining_rbs=available_rbs;
|
||||
total_groups=eNB_mac_inst[module_idP].common_channels[CC_id].num_active_cba_groups;
|
||||
total_groups=RC.mac[module_idP]->common_channels[CC_id].num_active_cba_groups;
|
||||
min_rb_unit=get_min_rb_unit(module_idP,CC_id);
|
||||
|
||||
if (available_rbs < min_rb_unit )
|
||||
@@ -1252,7 +1252,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
// is scheduled, the correspodning group can't be used for CBA
|
||||
// this can be fixed later
|
||||
if (total_groups > 0) {
|
||||
DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
|
||||
DCI_pdu = &RC.mac[module_idP]->common_channels[CC_id].DCI_pdu;
|
||||
|
||||
for (cba_group=0;
|
||||
(cba_group<total_groups) > (1<<aggregation));
|
||||
@@ -1286,7 +1286,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
|
||||
// If the group needs some resource
|
||||
// determine the total number of allocations (one or multiple DCIs): to be refined
|
||||
if ((active_UEs[cba_group] > 0) && (eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group] != 0)) {
|
||||
if ((active_UEs[cba_group] > 0) && (RC.mac[module_idP]->common_channels[CC_id].cba_rnti[cba_group] != 0)) {
|
||||
// to be refined in case of : total_UEs >> weight[cba_group]*available_rbs
|
||||
|
||||
switch(cba_policy) {
|
||||
@@ -1391,7 +1391,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
first_rb[CC_id]+=rb_table[rb_table_index];
|
||||
LOG_N(MAC,
|
||||
"[eNB %d] CC_id %d Frame %d, subframeP %d: schedule CBA access %d rnti %x, total/required/allocated/remaining rbs (%d/%d/%d/%d), mcs %d, rballoc %d\n",
|
||||
module_idP, CC_id, frameP, subframeP, cba_group,eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
|
||||
module_idP, CC_id, frameP, subframeP, cba_group,RC.mac[module_idP]->common_channels[CC_id].cba_rnti[cba_group],
|
||||
available_rbs, required_rbs[cba_group], allocated_rbs, remaining_rbs,
|
||||
mcs[cba_group],rballoc);
|
||||
|
||||
@@ -1417,7 +1417,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
//add_ue_spec_dci
|
||||
add_common_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
|
||||
RC.mac[module_idP]->common_channels[CC_id].cba_rnti[cba_group],
|
||||
sizeof(DCI0_5MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_5MHz_TDD_1_6_t,
|
||||
@@ -1438,7 +1438,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
//add_ue_spec_dci
|
||||
add_common_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
|
||||
RC.mac[module_idP]->common_channels[CC_id].cba_rnti[cba_group],
|
||||
sizeof(DCI0_5MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_5MHz_FDD_t,
|
||||
@@ -1466,7 +1466,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
//add_ue_spec_dci
|
||||
add_common_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
|
||||
RC.mac[module_idP]->common_channels[CC_id].cba_rnti[cba_group],
|
||||
sizeof(DCI0_10MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_10MHz_TDD_1_6_t,
|
||||
@@ -1487,7 +1487,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
//add_ue_spec_dci
|
||||
add_common_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
|
||||
RC.mac[module_idP]->common_channels[CC_id].cba_rnti[cba_group],
|
||||
sizeof(DCI0_10MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_10MHz_FDD_t,
|
||||
|
||||
@@ -56,11 +56,8 @@ extern const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
|
||||
extern const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
|
||||
extern UE_MAC_INST *UE_mac_inst;
|
||||
extern eNB_MAC_INST *eNB_mac_inst;
|
||||
extern eNB_RRC_INST *eNB_rrc_inst;
|
||||
extern UE_RRC_INST *UE_rrc_inst;
|
||||
extern UE_MAC_INST *ue_mac_inst;
|
||||
extern UE_MAC_INST *UE_mac_inst;
|
||||
extern MAC_RLC_XFACE *Mac_rlc_xface;
|
||||
extern uint8_t Is_rrc_registered;
|
||||
|
||||
|
||||
+293
-145
@@ -63,6 +63,10 @@
|
||||
|
||||
#include "SCHED/defs.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
void dl_phy_sync_success(module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
unsigned char eNB_index,
|
||||
@@ -82,27 +86,6 @@ void dl_phy_sync_success(module_id_t module_idP,
|
||||
|
||||
}
|
||||
|
||||
void mrbch_phy_sync_failure(module_id_t module_idP, frame_t frameP, uint8_t free_eNB_index) //init as CH
|
||||
{
|
||||
|
||||
LOG_I(MAC,"[eNB %d] Frame %d: PHY Sync failure \n",module_idP,frameP);
|
||||
layer2_init_eNB(module_idP, free_eNB_index);
|
||||
openair_rrc_eNB_init(module_idP);
|
||||
}
|
||||
|
||||
char layer2_init_eNB(module_id_t module_idP, unsigned char eNB_index)
|
||||
{
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
char layer2_init_UE(module_id_t module_idP)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index)
|
||||
{
|
||||
|
||||
@@ -110,7 +93,7 @@ void mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB
|
||||
}
|
||||
|
||||
|
||||
int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active)
|
||||
int mac_top_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active)
|
||||
{
|
||||
|
||||
module_id_t Mod_id,i,j;
|
||||
@@ -145,22 +128,23 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
|
||||
LOG_I(MAC,"[MAIN] Init function start:Nb_eNB_INST=%d\n",NB_eNB_INST);
|
||||
|
||||
if (NB_eNB_INST>0) {
|
||||
eNB_mac_inst = (eNB_MAC_INST*)malloc16(NB_eNB_INST*sizeof(eNB_MAC_INST));
|
||||
|
||||
if (eNB_mac_inst == NULL) {
|
||||
RC.mac = (eNB_MAC_INST**)malloc16(NB_eNB_INST*sizeof(eNB_MAC_INST*));
|
||||
for (i=0;i<NB_eNB_INST;i++)
|
||||
RC.mac[i] = (eNB_MAC_INST*)malloc16(sizeof(eNB_MAC_INST));
|
||||
if (RC.mac == NULL) {
|
||||
LOG_D(MAC,"[MAIN] can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n",NB_eNB_INST*sizeof(eNB_MAC_INST*),NB_eNB_INST,sizeof(eNB_MAC_INST));
|
||||
mac_xface->macphy_exit("[MAC][MAIN] not enough memory for eNB \n");
|
||||
} else {
|
||||
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),NB_eNB_INST,eNB_mac_inst);
|
||||
bzero(eNB_mac_inst,NB_eNB_INST*sizeof(eNB_MAC_INST));
|
||||
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),NB_eNB_INST,RC.mac);
|
||||
for (i=0;i<NB_eNB_INST;i++) bzero(RC.mac[i],sizeof(eNB_MAC_INST));
|
||||
}
|
||||
} else {
|
||||
eNB_mac_inst = NULL;
|
||||
RC.mac = NULL;
|
||||
}
|
||||
|
||||
// Initialize Linked-List for Active UEs
|
||||
for(Mod_id=0; Mod_id<NB_eNB_INST; Mod_id++) {
|
||||
UE_list = &eNB_mac_inst[Mod_id].UE_list;
|
||||
UE_list = &RC.mac[Mod_id]->UE_list;
|
||||
|
||||
UE_list->num_UEs=0;
|
||||
UE_list->head=-1;
|
||||
@@ -174,47 +158,23 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
|
||||
|
||||
UE_list->next[list_el]=-1;
|
||||
UE_list->next_ul[list_el]=-1;
|
||||
|
||||
#ifdef PHY_EMUL
|
||||
Mac_rlc_xface->Is_cluster_head[Mod_id]=2;//0: MR, 1: CH, 2: not CH neither MR
|
||||
#endif
|
||||
/*#ifdef Rel10
|
||||
int n;
|
||||
for (n=0;n<4096;n++)
|
||||
eNB_mac_inst[Mod_id].MCH_pdu.payload[n] = taus();
|
||||
// Mac_rlc_xface->Node_id[Mod_id]=NODE_ID[Mod_id];
|
||||
#endif*/
|
||||
}
|
||||
|
||||
// Mac_rlc_xface->frame=Mac_rlc_xface->frame;
|
||||
|
||||
|
||||
if (Is_rrc_registered == 1) {
|
||||
LOG_I(MAC,"[MAIN] calling RRC\n");
|
||||
#ifndef CELLULAR //nothing to be done yet for cellular
|
||||
openair_rrc_top_init(eMBMS_active, uecap_xer, cba_group_active,HO_active);
|
||||
openair_rrc_top_init_ue(eMBMS_active, uecap_xer, cba_group_active,HO_active);
|
||||
#endif
|
||||
} else {
|
||||
LOG_I(MAC,"[MAIN] Running without an RRC\n");
|
||||
}
|
||||
|
||||
#ifndef USER_MODE
|
||||
#ifndef PHY_EMUL
|
||||
LOG_I(MAC,"[MAIN] add openair2 proc\n");
|
||||
//// add_openair2_stats();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//init_transport_channels(2);
|
||||
|
||||
// Set up DCIs for TDD 5MHz Config 1..6
|
||||
|
||||
|
||||
for (i=0; i<NB_eNB_INST; i++)
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
LOG_D(MAC,"[MAIN][eNB %d] CC_id %d initializing RA_template\n",i, CC_id);
|
||||
LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_eNB][MOD %02d][]\n", i);
|
||||
|
||||
RA_template = (RA_TEMPLATE *)&eNB_mac_inst[i].common_channels[CC_id].RA_template[0];
|
||||
RA_template = (RA_TEMPLATE *)&RC.mac[i]->common_channels[CC_id].RA_template[0];
|
||||
|
||||
for (j=0; j<NB_RA_PROC_MAX; j++) {
|
||||
if (mac_xface->frame_parms->frame_type == TDD) {
|
||||
@@ -305,41 +265,17 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
|
||||
RA_template[j].RA_dci_fmt2 = format1A;
|
||||
}
|
||||
|
||||
memset (&eNB_mac_inst[i].eNB_stats,0,sizeof(eNB_STATS));
|
||||
UE_template = (UE_TEMPLATE *)&eNB_mac_inst[i].UE_list.UE_template[CC_id][0];
|
||||
memset (&RC.mac[i]->eNB_stats,0,sizeof(eNB_STATS));
|
||||
UE_template = (UE_TEMPLATE *)&RC.mac[i]->UE_list.UE_template[CC_id][0];
|
||||
|
||||
for (j=0; j<NUMBER_OF_UE_MAX; j++) {
|
||||
UE_template[j].rnti=0;
|
||||
// initiallize the eNB to UE statistics
|
||||
memset (&eNB_mac_inst[i].UE_list.eNB_UE_stats[CC_id][j],0,sizeof(eNB_UE_STATS));
|
||||
memset (&RC.mac[i]->UE_list.eNB_UE_stats[CC_id][j],0,sizeof(eNB_UE_STATS));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ICIC init param
|
||||
#ifdef ICIC
|
||||
uint8_t SB_size;
|
||||
SB_size=mac_xface->get_SB_size(mac_xface->frame_parms->N_RB_DL);
|
||||
|
||||
srand (time(NULL));
|
||||
|
||||
for(j=0; j<NB_eNB_INST; j++)
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
eNB_mac_inst[j][CC_id].sbmap_conf.first_subframe=0;
|
||||
eNB_mac_inst[j][CC_id].sbmap_conf.periodicity=10;
|
||||
eNB_mac_inst[j][CC_id].sbmap_conf.sb_size=SB_size;
|
||||
eNB_mac_inst[j][CC_id].sbmap_conf.nb_active_sb=1;
|
||||
|
||||
for(i=0; i<NUMBER_OF_SUBBANDS; i++) {
|
||||
eNB_mac_inst[j][CC_id].sbmap_conf.sbmap[i]=1;
|
||||
}
|
||||
|
||||
eNB_mac_inst[j][CC_id].sbmap_conf.sbmap[rand()%NUMBER_OF_SUBBANDS]=0;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
//end ALU's algo
|
||||
|
||||
LOG_I(MAC,"[MAIN][INIT] Init function finished\n");
|
||||
|
||||
@@ -348,11 +284,170 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
|
||||
}
|
||||
|
||||
|
||||
int mac_init_global_param(void)
|
||||
int mac_top_init_eNB()
|
||||
{
|
||||
|
||||
module_id_t Mod_id,i;
|
||||
int list_el;
|
||||
UE_list_t *UE_list;
|
||||
eNB_MAC_INST *mac;
|
||||
|
||||
LOG_I(MAC,"[MAIN] Init function start:Nb_eNB_INST=%d\n",RC.nb_inst);
|
||||
|
||||
if (RC.nb_inst>0) {
|
||||
RC.mac = (eNB_MAC_INST**)malloc16(RC.nb_inst*sizeof(eNB_MAC_INST*));
|
||||
for (i=0;i<RC.nb_inst;i++)
|
||||
RC.mac[i] = (eNB_MAC_INST*)malloc16(sizeof(eNB_MAC_INST));
|
||||
if (RC.mac == NULL) {
|
||||
LOG_D(MAC,"[MAIN] can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n",RC.nb_inst*sizeof(eNB_MAC_INST*),RC.nb_inst,sizeof(eNB_MAC_INST));
|
||||
mac_xface->macphy_exit("[MAC][MAIN] not enough memory for eNB \n");
|
||||
} else {
|
||||
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),RC.nb_inst,RC.mac);
|
||||
for (i=0;i<RC.nb_inst;i++) bzero(RC.mac[i],sizeof(eNB_MAC_INST));
|
||||
}
|
||||
} else {
|
||||
RC.mac = NULL;
|
||||
}
|
||||
|
||||
// Initialize Linked-List for Active UEs
|
||||
for(Mod_id=0; Mod_id<RC.nb_inst; Mod_id++) {
|
||||
mac = RC.mac[Mod_id];
|
||||
UE_list = &mac->UE_list;
|
||||
|
||||
UE_list->num_UEs=0;
|
||||
UE_list->head=-1;
|
||||
UE_list->head_ul=-1;
|
||||
UE_list->avail=0;
|
||||
|
||||
for (list_el=0; list_el<NUMBER_OF_UE_MAX-1; list_el++) {
|
||||
UE_list->next[list_el]=list_el+1;
|
||||
UE_list->next_ul[list_el]=list_el+1;
|
||||
}
|
||||
|
||||
UE_list->next[list_el]=-1;
|
||||
UE_list->next_ul[list_el]=-1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void mac_init_cell_params(int Mod_idP,int CC_idP) {
|
||||
|
||||
int j;
|
||||
RA_TEMPLATE *RA_template;
|
||||
UE_TEMPLATE *UE_template;
|
||||
int size_bytes1,size_bytes2,size_bits1,size_bits2;
|
||||
|
||||
LOG_D(MAC,"[MAIN][eNB %d] CC_id %d initializing RA_template\n",Mod_idP, CC_idP);
|
||||
LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_eNB][MOD %02d][]\n", Mod_idP);
|
||||
COMMON_channels_t *cc = &RC.mac[Mod_idP]->common_channels[CC_idP];
|
||||
|
||||
RA_template = (RA_TEMPLATE *)&cc->RA_template[0];
|
||||
|
||||
for (j=0; j<NB_RA_PROC_MAX; j++) {
|
||||
if ( cc->tdd_Config != NULL) {
|
||||
switch (cc->mib->message.dl_Bandwidth) {
|
||||
case MasterInformationBlock__dl_Bandwidth_n6:
|
||||
size_bytes1 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
|
||||
size_bytes2 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
|
||||
size_bits1 = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
|
||||
size_bits2 = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
|
||||
break;
|
||||
|
||||
case MasterInformationBlock__dl_Bandwidth_n25:
|
||||
size_bytes1 = sizeof(DCI1A_5MHz_TDD_1_6_t);
|
||||
size_bytes2 = sizeof(DCI1A_5MHz_TDD_1_6_t);
|
||||
size_bits1 = sizeof_DCI1A_5MHz_TDD_1_6_t;
|
||||
size_bits2 = sizeof_DCI1A_5MHz_TDD_1_6_t;
|
||||
break;
|
||||
|
||||
case MasterInformationBlock__dl_Bandwidth_n50:
|
||||
size_bytes1 = sizeof(DCI1A_10MHz_TDD_1_6_t);
|
||||
size_bytes2 = sizeof(DCI1A_10MHz_TDD_1_6_t);
|
||||
size_bits1 = sizeof_DCI1A_10MHz_TDD_1_6_t;
|
||||
size_bits2 = sizeof_DCI1A_10MHz_TDD_1_6_t;
|
||||
break;
|
||||
|
||||
case MasterInformationBlock__dl_Bandwidth_n100:
|
||||
size_bytes1 = sizeof(DCI1A_20MHz_TDD_1_6_t);
|
||||
size_bytes2 = sizeof(DCI1A_20MHz_TDD_1_6_t);
|
||||
size_bits1 = sizeof_DCI1A_20MHz_TDD_1_6_t;
|
||||
size_bits2 = sizeof_DCI1A_20MHz_TDD_1_6_t;
|
||||
break;
|
||||
|
||||
default:
|
||||
size_bytes1 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
|
||||
size_bytes2 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
|
||||
size_bits1 = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
|
||||
size_bits2 = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
switch (cc->mib->message.dl_Bandwidth) {
|
||||
case MasterInformationBlock__dl_Bandwidth_n6:
|
||||
size_bytes1 = sizeof(DCI1A_1_5MHz_FDD_t);
|
||||
size_bytes2 = sizeof(DCI1A_1_5MHz_FDD_t);
|
||||
size_bits1 = sizeof_DCI1A_1_5MHz_FDD_t;
|
||||
size_bits2 = sizeof_DCI1A_1_5MHz_FDD_t;
|
||||
break;
|
||||
|
||||
case MasterInformationBlock__dl_Bandwidth_n25:
|
||||
size_bytes1 = sizeof(DCI1A_5MHz_FDD_t);
|
||||
size_bytes2 = sizeof(DCI1A_5MHz_FDD_t);
|
||||
size_bits1 = sizeof_DCI1A_5MHz_FDD_t;
|
||||
size_bits2 = sizeof_DCI1A_5MHz_FDD_t;
|
||||
break;
|
||||
|
||||
case MasterInformationBlock__dl_Bandwidth_n50:
|
||||
size_bytes1 = sizeof(DCI1A_10MHz_FDD_t);
|
||||
size_bytes2 = sizeof(DCI1A_10MHz_FDD_t);
|
||||
size_bits1 = sizeof_DCI1A_10MHz_FDD_t;
|
||||
size_bits2 = sizeof_DCI1A_10MHz_FDD_t;
|
||||
break;
|
||||
|
||||
case MasterInformationBlock__dl_Bandwidth_n100:
|
||||
size_bytes1 = sizeof(DCI1A_20MHz_FDD_t);
|
||||
size_bytes2 = sizeof(DCI1A_20MHz_FDD_t);
|
||||
size_bits1 = sizeof_DCI1A_20MHz_FDD_t;
|
||||
size_bits2 = sizeof_DCI1A_20MHz_FDD_t;
|
||||
break;
|
||||
|
||||
default:
|
||||
size_bytes1 = sizeof(DCI1A_1_5MHz_FDD_t);
|
||||
size_bytes2 = sizeof(DCI1A_1_5MHz_FDD_t);
|
||||
size_bits1 = sizeof_DCI1A_1_5MHz_FDD_t;
|
||||
size_bits2 = sizeof_DCI1A_1_5MHz_FDD_t;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy((void *)&RA_template[j].RA_alloc_pdu1[0],(void *)&RA_alloc_pdu,size_bytes1);
|
||||
memcpy((void *)&RA_template[j].RA_alloc_pdu2[0],(void *)&DLSCH_alloc_pdu1A,size_bytes2);
|
||||
RA_template[j].RA_dci_size_bytes1 = size_bytes1;
|
||||
RA_template[j].RA_dci_size_bytes2 = size_bytes2;
|
||||
RA_template[j].RA_dci_size_bits1 = size_bits1;
|
||||
RA_template[j].RA_dci_size_bits2 = size_bits2;
|
||||
|
||||
RA_template[j].RA_dci_fmt1 = format1A;
|
||||
RA_template[j].RA_dci_fmt2 = format1A;
|
||||
}
|
||||
|
||||
memset (&RC.mac[Mod_idP]->eNB_stats,0,sizeof(eNB_STATS));
|
||||
UE_template = (UE_TEMPLATE *)&RC.mac[Mod_idP]->UE_list.UE_template[CC_idP][0];
|
||||
|
||||
for (j=0; j<NUMBER_OF_UE_MAX; j++) {
|
||||
UE_template[j].rnti=0;
|
||||
// initiallize the eNB to UE statistics
|
||||
memset (&RC.mac[Mod_idP]->UE_list.eNB_UE_stats[CC_idP][j],0,sizeof(eNB_UE_STATS));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int rlcmac_init_global_param(void)
|
||||
{
|
||||
|
||||
|
||||
Mac_rlc_xface = NULL;
|
||||
LOG_I(MAC,"[MAIN] CALLING RLC_MODULE_INIT...\n");
|
||||
|
||||
if (rlc_module_init()!=0) {
|
||||
@@ -372,38 +467,9 @@ int mac_init_global_param(void)
|
||||
|
||||
LOG_I(MAC,"[MAIN] malloc16 OK, mac_rlc_xface @ %p\n",(void *)Mac_rlc_xface);
|
||||
|
||||
// mac_xface->macphy_data_ind=macphy_data_ind;
|
||||
mac_xface->mrbch_phy_sync_failure=mrbch_phy_sync_failure;
|
||||
mac_xface->dl_phy_sync_success=dl_phy_sync_success;
|
||||
mac_xface->out_of_sync_ind=rrc_out_of_sync_ind;
|
||||
|
||||
// Mac_rlc_xface->macphy_exit= mac_xface->macphy_exit;
|
||||
// Mac_rlc_xface->frame = 0;
|
||||
// Mac_rlc_xface->mac_config_req=mac_config_req;
|
||||
// Mac_rlc_xface->mac_meas_req=mac_meas_req;
|
||||
// Mac_rlc_xface->rrc_rlc_config_req=rrc_rlc_config_req;
|
||||
// Mac_rlc_xface->rrc_rlc_data_req=rrc_rlc_data_req;
|
||||
// Mac_rlc_xface->rrc_rlc_register_rrc=rrc_rlc_register_rrc;
|
||||
|
||||
// Mac_rlc_xface->rrc_mac_config_req=rrc_mac_config_req;
|
||||
|
||||
// LOG_I(MAC,"[MAIN] INIT_GLOBAL_PARAM: Mac_rlc_xface=%p,rrc_rlc_register_rrc =%p\n",Mac_rlc_xface,Mac_rlc_xface->rrc_rlc_register_rrc);
|
||||
|
||||
// Mac_rlc_xface->mac_rlc_data_req=mac_rlc_data_req;
|
||||
// Mac_rlc_xface->mac_rlc_data_ind=mac_rlc_data_ind;
|
||||
// Mac_rlc_xface->mac_rlc_status_ind=mac_rlc_status_ind;
|
||||
// Mac_rlc_xface->pdcp_data_req=pdcp_data_req;
|
||||
// Mac_rlc_xface->mrbch_phy_sync_failure=mrbch_phy_sync_failure;
|
||||
// Mac_rlc_xface->dl_phy_sync_success=dl_phy_sync_success;
|
||||
|
||||
LOG_I(MAC,"[MAIN] RLC interface setup and init\n");
|
||||
rrc_init_global_param();
|
||||
|
||||
#ifdef USER_MODE
|
||||
pdcp_layer_init ();
|
||||
#else
|
||||
pdcp_module_init ();
|
||||
#endif
|
||||
|
||||
LOG_I(MAC,"[MAIN] Init Global Param Done\n");
|
||||
|
||||
@@ -422,14 +488,16 @@ void mac_top_cleanup(void)
|
||||
free (UE_mac_inst);
|
||||
}
|
||||
|
||||
if (NB_eNB_INST>0) {
|
||||
free(eNB_mac_inst);
|
||||
if (RC.nb_inst>0) {
|
||||
free(RC.mac);
|
||||
}
|
||||
|
||||
free( Mac_rlc_xface);
|
||||
|
||||
free(mac_xface);
|
||||
}
|
||||
|
||||
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,uint8_t cba_group_active, uint8_t HO_active)
|
||||
int l2_init_ue(int eMBMS_active, char *uecap_xer,uint8_t cba_group_active, uint8_t HO_active)
|
||||
{
|
||||
|
||||
|
||||
@@ -439,10 +507,115 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
|
||||
// NB_INST=2;
|
||||
|
||||
Is_rrc_registered=0;
|
||||
mac_init_global_param();
|
||||
rlcmac_init_global_param();
|
||||
Is_rrc_registered=1;
|
||||
|
||||
mac_xface->macphy_init = mac_top_init;
|
||||
mac_xface->dl_phy_sync_success=dl_phy_sync_success;
|
||||
mac_xface->out_of_sync_ind=rrc_out_of_sync_ind;
|
||||
|
||||
|
||||
mac_xface->macphy_init = mac_top_init_ue;
|
||||
#ifndef USER_MODE
|
||||
mac_xface->macphy_exit = openair_sched_exit;
|
||||
#else
|
||||
mac_xface->macphy_exit=(void (*)(const char*)) exit;
|
||||
#endif
|
||||
LOG_I(MAC,"[MAIN] init UE MAC functions \n");
|
||||
mac_xface->ue_decode_si = ue_decode_si;
|
||||
mac_xface->ue_decode_p = ue_decode_p;
|
||||
mac_xface->ue_send_sdu = ue_send_sdu;
|
||||
#ifdef Rel10
|
||||
mac_xface->ue_send_mch_sdu = ue_send_mch_sdu;
|
||||
mac_xface->ue_query_mch = ue_query_mch;
|
||||
#endif
|
||||
mac_xface->ue_get_SR = ue_get_SR;
|
||||
mac_xface->ue_get_sdu = ue_get_sdu;
|
||||
mac_xface->ue_get_rach = ue_get_rach;
|
||||
mac_xface->ue_process_rar = ue_process_rar;
|
||||
mac_xface->ue_scheduler = ue_scheduler;
|
||||
mac_xface->process_timing_advance = process_timing_advance;
|
||||
|
||||
|
||||
LOG_I(MAC,"[MAIN] PHY Frame configuration \n");
|
||||
|
||||
mac_xface->get_ue_active_harq_pid = get_ue_active_harq_pid;
|
||||
mac_xface->get_PL = get_PL;
|
||||
mac_xface->get_RSRP = get_RSRP;
|
||||
mac_xface->get_RSRQ = get_RSRQ;
|
||||
mac_xface->get_RSSI = get_RSSI;
|
||||
mac_xface->get_n_adj_cells = get_n_adj_cells;
|
||||
mac_xface->get_rx_total_gain_dB = get_rx_total_gain_dB;
|
||||
mac_xface->get_Po_NOMINAL_PUSCH = get_Po_NOMINAL_PUSCH;
|
||||
mac_xface->get_num_prach_tdd = get_num_prach_tdd;
|
||||
mac_xface->get_fid_prach_tdd = get_fid_prach_tdd;
|
||||
mac_xface->get_deltaP_rampup = get_deltaP_rampup;
|
||||
mac_xface->computeRIV = computeRIV;
|
||||
mac_xface->get_TBS_DL = get_TBS_DL;
|
||||
mac_xface->get_TBS_UL = get_TBS_UL;
|
||||
mac_xface->get_nCCE_max = get_nCCE_mac;
|
||||
mac_xface->get_nCCE_offset = get_nCCE_offset;
|
||||
mac_xface->get_ue_mode = get_ue_mode;
|
||||
mac_xface->phy_config_sib1_ue = phy_config_sib1_ue;
|
||||
|
||||
mac_xface->phy_config_sib2_ue = phy_config_sib2_ue;
|
||||
mac_xface->phy_config_afterHO_ue = phy_config_afterHO_ue;
|
||||
#ifdef Rel10
|
||||
mac_xface->phy_config_sib13_ue = phy_config_sib13_ue;
|
||||
#endif
|
||||
#ifdef CBA
|
||||
mac_xface->phy_config_cba_rnti = phy_config_cba_rnti ;
|
||||
#endif
|
||||
mac_xface->estimate_ue_tx_power = estimate_ue_tx_power;
|
||||
mac_xface->phy_config_meas_ue = phy_config_meas_ue;
|
||||
mac_xface->phy_reset_ue = phy_reset_ue;
|
||||
|
||||
mac_xface->phy_config_dedicated_ue = phy_config_dedicated_ue;
|
||||
mac_xface->phy_config_harq_ue = phy_config_harq_ue;
|
||||
|
||||
mac_xface->get_lte_frame_parms = get_lte_frame_parms;
|
||||
mac_xface->get_mu_mimo_mode = get_mu_mimo_mode;
|
||||
|
||||
mac_xface->get_hundred_times_delta_TF = get_hundred_times_delta_IF_mac;
|
||||
mac_xface->get_target_pusch_rx_power = get_target_pusch_rx_power;
|
||||
mac_xface->get_target_pucch_rx_power = get_target_pucch_rx_power;
|
||||
|
||||
mac_xface->get_prach_prb_offset = get_prach_prb_offset;
|
||||
mac_xface->is_prach_subframe = is_prach_subframe;
|
||||
|
||||
#ifdef Rel10
|
||||
mac_xface->get_mch_sdu = get_mch_sdu;
|
||||
mac_xface->phy_config_dedicated_scell_ue= phy_config_dedicated_scell_ue;
|
||||
|
||||
#endif
|
||||
|
||||
mac_xface->get_PHR = get_PHR;
|
||||
LOG_D(MAC,"[MAIN] ALL INIT OK\n");
|
||||
|
||||
mac_xface->macphy_init(eMBMS_active,uecap_xer,cba_group_active,HO_active);
|
||||
|
||||
//Mac_rlc_xface->Is_cluster_head[0] = 1;
|
||||
//Mac_rlc_xface->Is_cluster_head[1] = 0;
|
||||
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
int l2_init_eNB()
|
||||
{
|
||||
|
||||
|
||||
|
||||
LOG_I(MAC,"[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
|
||||
// NB_NODE=2;
|
||||
// NB_INST=2;
|
||||
|
||||
Is_rrc_registered=0;
|
||||
rlcmac_init_global_param();
|
||||
Is_rrc_registered=1;
|
||||
|
||||
mac_xface = (MAC_xface *)malloc(sizeof(MAC_xface));
|
||||
|
||||
mac_xface->macphy_init = mac_top_init_eNB;
|
||||
#ifndef USER_MODE
|
||||
mac_xface->macphy_exit = openair_sched_exit;
|
||||
#else
|
||||
@@ -472,24 +645,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
|
||||
mac_xface->ra_succeeded = ra_succeeded;
|
||||
mac_xface->mac_phy_remove_ue = mac_phy_remove_ue;
|
||||
|
||||
LOG_I(MAC,"[MAIN] init UE MAC functions \n");
|
||||
mac_xface->ue_decode_si = ue_decode_si;
|
||||
mac_xface->ue_decode_p = ue_decode_p;
|
||||
mac_xface->ue_send_sdu = ue_send_sdu;
|
||||
#ifdef Rel10
|
||||
mac_xface->ue_send_mch_sdu = ue_send_mch_sdu;
|
||||
mac_xface->ue_query_mch = ue_query_mch;
|
||||
#endif
|
||||
mac_xface->ue_get_SR = ue_get_SR;
|
||||
mac_xface->ue_get_sdu = ue_get_sdu;
|
||||
mac_xface->ue_get_rach = ue_get_rach;
|
||||
mac_xface->ue_process_rar = ue_process_rar;
|
||||
mac_xface->ue_scheduler = ue_scheduler;
|
||||
mac_xface->process_timing_advance = process_timing_advance;
|
||||
|
||||
|
||||
LOG_I(MAC,"[MAIN] PHY Frame configuration \n");
|
||||
mac_xface->frame_parms = frame_parms;
|
||||
|
||||
mac_xface->get_ue_active_harq_pid = get_ue_active_harq_pid;
|
||||
mac_xface->get_PL = get_PL;
|
||||
@@ -508,27 +664,20 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
|
||||
mac_xface->get_nCCE_max = get_nCCE_mac;
|
||||
mac_xface->get_nCCE_offset = get_nCCE_offset;
|
||||
mac_xface->get_ue_mode = get_ue_mode;
|
||||
mac_xface->phy_config_mib_eNB = phy_config_mib_eNB;
|
||||
mac_xface->phy_config_sib1_eNB = phy_config_sib1_eNB;
|
||||
mac_xface->phy_config_sib1_ue = phy_config_sib1_ue;
|
||||
|
||||
mac_xface->phy_config_sib2_eNB = phy_config_sib2_eNB;
|
||||
mac_xface->phy_config_sib2_ue = phy_config_sib2_ue;
|
||||
mac_xface->phy_config_afterHO_ue = phy_config_afterHO_ue;
|
||||
#ifdef Rel10
|
||||
mac_xface->phy_config_sib13_eNB = phy_config_sib13_eNB;
|
||||
mac_xface->phy_config_sib13_ue = phy_config_sib13_ue;
|
||||
#endif
|
||||
#ifdef CBA
|
||||
mac_xface->phy_config_cba_rnti = phy_config_cba_rnti ;
|
||||
#endif
|
||||
mac_xface->estimate_ue_tx_power = estimate_ue_tx_power;
|
||||
mac_xface->phy_config_meas_ue = phy_config_meas_ue;
|
||||
mac_xface->phy_reset_ue = phy_reset_ue;
|
||||
|
||||
mac_xface->phy_config_dedicated_eNB = phy_config_dedicated_eNB;
|
||||
mac_xface->phy_config_dedicated_ue = phy_config_dedicated_ue;
|
||||
mac_xface->phy_config_harq_ue = phy_config_harq_ue;
|
||||
|
||||
mac_xface->get_lte_frame_parms = get_lte_frame_parms;
|
||||
mac_xface->get_mu_mimo_mode = get_mu_mimo_mode;
|
||||
|
||||
@@ -549,7 +698,6 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
|
||||
mac_xface->get_PHR = get_PHR;
|
||||
LOG_D(MAC,"[MAIN] ALL INIT OK\n");
|
||||
|
||||
mac_xface->macphy_init(eMBMS_active,uecap_xer,cba_group_active,HO_active);
|
||||
|
||||
//Mac_rlc_xface->Is_cluster_head[0] = 1;
|
||||
//Mac_rlc_xface->Is_cluster_head[1] = 0;
|
||||
|
||||
@@ -38,11 +38,11 @@
|
||||
//#include "RRC/LITE/extern.h"
|
||||
//#include "LAYER2/PDCP/pdcp.h"
|
||||
#include "proto.h"
|
||||
#ifndef USER_MODE
|
||||
static int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
|
||||
#else
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
|
||||
#endif
|
||||
|
||||
{
|
||||
|
||||
int len = 0,fg,Overhead, Sign;
|
||||
|
||||
@@ -86,7 +86,7 @@ void store_dlsch_buffer (module_id_t Mod_id,
|
||||
int UE_id,i;
|
||||
rnti_t rnti;
|
||||
mac_rlc_status_resp_t rlc_status;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
|
||||
UE_TEMPLATE *UE_template;
|
||||
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
@@ -165,7 +165,7 @@ void assign_rbs_required (module_id_t Mod_id,
|
||||
uint16_t TBS = 0;
|
||||
LTE_eNB_UE_stats *eNB_UE_stats[MAX_NUM_CCs];
|
||||
int UE_id,n,i,j,CC_id,pCCid,tmp;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
|
||||
// UE_TEMPLATE *UE_template;
|
||||
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
|
||||
@@ -268,7 +268,7 @@ int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uin
|
||||
|
||||
uint8_t round,round_max=0,UE_id;
|
||||
int CC_id;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
@@ -288,7 +288,7 @@ int maxcqi(module_id_t Mod_id,int32_t UE_id)
|
||||
{
|
||||
|
||||
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
|
||||
int CC_id,n;
|
||||
int CQI = 0;
|
||||
|
||||
@@ -319,7 +319,7 @@ struct sort_ue_dl_params {
|
||||
static int ue_dl_compare(const void *_a, const void *_b, void *_params)
|
||||
{
|
||||
struct sort_ue_dl_params *params = _params;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[params->Mod_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[params->Mod_idP]->UE_list;
|
||||
|
||||
int UE_id1 = *(const int *)_a;
|
||||
int UE_id2 = *(const int *)_b;
|
||||
@@ -402,7 +402,7 @@ void sort_UEs (module_id_t Mod_idP,
|
||||
int rnti;
|
||||
struct sort_ue_dl_params params = { Mod_idP, frameP, subframeP };
|
||||
|
||||
UE_list_t *UE_list = &eNB_mac_inst[Mod_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list;
|
||||
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
rnti = UE_RNTI(Mod_idP, i);
|
||||
@@ -436,7 +436,7 @@ void sort_UEs (module_id_t Mod_idP,
|
||||
int i=0,ii=0;//,j=0;
|
||||
rnti_t rnti1,rnti2;
|
||||
|
||||
UE_list_t *UE_list = &eNB_mac_inst[Mod_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list;
|
||||
|
||||
for (i=UE_list->head; i>=0; i=UE_list->next[i]) {
|
||||
|
||||
@@ -517,7 +517,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
|
||||
int min_rb_unit[MAX_NUM_CCs];
|
||||
uint16_t r1=0;
|
||||
uint8_t CC_id;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
|
||||
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs] = {0};
|
||||
|
||||
int transmission_mode = 0;
|
||||
@@ -901,11 +901,11 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
|
||||
|
||||
{
|
||||
int i,j;
|
||||
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
|
||||
UE_list_t *UE_list=&RC.mac[module_idP]->UE_list;
|
||||
UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
rnti_t rnti = UE_RNTI(module_idP,UE_id);
|
||||
uint8_t *vrb_map = eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map;
|
||||
int RBGsize = PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL/N_RBG;
|
||||
uint8_t *vrb_map = RC.mac[module_idP]->common_channels[CC_id].vrb_map;
|
||||
int RBGsize = RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL/N_RBG;
|
||||
#ifdef SF05_LIMIT
|
||||
//int subframe05_limit=0;
|
||||
int sf05_upper=-1,sf05_lower=-1;
|
||||
@@ -928,7 +928,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
|
||||
// WE SHOULD PROTECT the eNB_UE_stats with a mutex here ...
|
||||
|
||||
ue_sched_ctl->ta_timer = 20; // wait 20 subframes before taking TA measurement from PHY
|
||||
switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
switch (RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update;
|
||||
break;
|
||||
@@ -950,7 +950,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
|
||||
break;
|
||||
|
||||
case 100:
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.threequarter_fs == 0)
|
||||
if (RC.eNB[module_idP][CC_id]->frame_parms.threequarter_fs == 0)
|
||||
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/16;
|
||||
else
|
||||
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/12;
|
||||
@@ -1034,7 +1034,7 @@ void dlsch_scheduler_pre_processor_allocate (module_id_t Mod_id,
|
||||
{
|
||||
|
||||
int i;
|
||||
UE_list_t *UE_list=&eNB_mac_inst[Mod_id].UE_list;
|
||||
UE_list_t *UE_list=&RC.mac[Mod_id]->UE_list;
|
||||
UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
|
||||
for(i=0; i<N_RBG; i++) {
|
||||
@@ -1091,7 +1091,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
|
||||
int16_t total_remaining_rbs[MAX_NUM_CCs];
|
||||
uint16_t max_num_ue_to_be_scheduled=0,total_ue_count=0;
|
||||
rnti_t rnti= -1;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
|
||||
UE_TEMPLATE *UE_template = 0;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = 0;
|
||||
|
||||
@@ -1269,7 +1269,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
|
||||
rnti_t rnti = -1;
|
||||
int mcs;
|
||||
int rb_table_index=0,tbs,tx_power;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
|
||||
UE_TEMPLATE *UE_template;
|
||||
@@ -1379,7 +1379,7 @@ struct sort_ue_ul_params {
|
||||
static int ue_ul_compare(const void *_a, const void *_b, void *_params)
|
||||
{
|
||||
struct sort_ue_ul_params *params = _params;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[params->module_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[params->module_idP]->UE_list;
|
||||
|
||||
int UE_id1 = *(const int *)_a;
|
||||
int UE_id2 = *(const int *)_b;
|
||||
@@ -1441,7 +1441,7 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
|
||||
int rnti;
|
||||
struct sort_ue_ul_params params = { module_idP, frameP, subframeP };
|
||||
|
||||
UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
|
||||
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
rnti = UE_RNTI(module_idP, i);
|
||||
@@ -1473,7 +1473,7 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
|
||||
int i=0,ii=0;
|
||||
rnti_t rnti1,rnti2;
|
||||
|
||||
UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
|
||||
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
|
||||
|
||||
for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) {
|
||||
|
||||
|
||||
+71
-14
@@ -725,12 +725,10 @@ unsigned char generate_dlsch_header(unsigned char *mac_header,
|
||||
unsigned char short_padding,
|
||||
unsigned short post_padding);
|
||||
|
||||
/** \brief RRC Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
|
||||
/** \brief RRC eNB Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
|
||||
@param Mod_id Instance ID of eNB
|
||||
@param CC_id Component Carrier of the eNB
|
||||
@param eNB_flag Indicates if this is a eNB or UE configuration
|
||||
@param rntiP id of UE if this is an eNB configuration
|
||||
@param eNB_id Index of eNB if this is a UE configuration
|
||||
@param mib Pointer to MIB
|
||||
@param radioResourceConfigCommon Structure from SIB2 for common radio parameters (if NULL keep existing configuration)
|
||||
@param physcialConfigDedicated Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated PHY parameters (if NULL keep existing configuration)
|
||||
@param measObj Structure from RRCConnectionReconfiguration for UE measurement procedures
|
||||
@@ -747,16 +745,19 @@ unsigned char generate_dlsch_header(unsigned char *mac_header,
|
||||
@param mbsfn_AreaInfoList pointer to MBSFN Area Info list from SIB13
|
||||
@param pmch_InfoList pointer to PMCH_InfoList from MBSFNAreaConfiguration Message (MCCH Message)
|
||||
*/
|
||||
int rrc_mac_config_req(module_id_t module_idP,
|
||||
int CC_id,
|
||||
eNB_flag_t eNB_flag,
|
||||
rnti_t rntiP,
|
||||
uint8_t eNB_index,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated,
|
||||
int rrc_mac_config_req_eNB(module_id_t module_idP,
|
||||
int CC_id,
|
||||
int physCellId,
|
||||
int p_eNB,
|
||||
int Ncp,
|
||||
int eutra_band,
|
||||
uint32_t dl_CarrierFreq,
|
||||
BCCH_BCH_Message_t *mib,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated,
|
||||
#ifdef Rel10
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
#endif
|
||||
MeasObjectToAddMod_t **measObj,
|
||||
MAC_MainConfig_t *mac_MainConfig,
|
||||
@@ -767,7 +768,7 @@ int rrc_mac_config_req(module_id_t module_idP,
|
||||
MobilityControlInfo_t *mobilityControlInfo,
|
||||
uint8_t *SIwindowsize,
|
||||
uint16_t *SIperiod,
|
||||
ARFCN_ValueEUTRA_t *ul_CarrierFreq,
|
||||
uint32_t ul_CarrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
|
||||
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList
|
||||
@@ -785,6 +786,62 @@ int rrc_mac_config_req(module_id_t module_idP,
|
||||
#endif
|
||||
);
|
||||
|
||||
/** \brief RRC eNB Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
|
||||
@param Mod_id Instance ID of ue
|
||||
@param CC_id Component Carrier of the ue
|
||||
@param eNB_id Index of eNB
|
||||
@param radioResourceConfigCommon Structure from SIB2 for common radio parameters (if NULL keep existing configuration)
|
||||
@param physcialConfigDedicated Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated PHY parameters (if NULL keep existing configuration)
|
||||
@param measObj Structure from RRCConnectionReconfiguration for UE measurement procedures
|
||||
@param mac_MainConfig Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated MAC parameters (if NULL keep existing configuration)
|
||||
@param logicalChannelIdentity Logical channel identity index of corresponding logical channel config
|
||||
@param logicalChannelConfig Pointer to logical channel configuration
|
||||
@param measGapConfig Measurement Gap configuration for MAC (if NULL keep existing configuration)
|
||||
@param tdd_Config TDD Configuration from SIB1 (if NULL keep existing configuration)
|
||||
@param mobilityControlInfo mobility control info received for Handover
|
||||
@param SIwindowsize SI Windowsize from SIB1 (if NULL keep existing configuration)
|
||||
@param SIperiod SI Period from SIB1 (if NULL keep existing configuration)
|
||||
@param MBMS_Flag indicates MBMS transmission
|
||||
@param mbsfn_SubframeConfigList pointer to mbsfn subframe configuration list from SIB2
|
||||
@param mbsfn_AreaInfoList pointer to MBSFN Area Info list from SIB13
|
||||
@param pmch_InfoList pointer to PMCH_InfoList from MBSFNAreaConfiguration Message (MCCH Message)
|
||||
*/
|
||||
int rrc_mac_config_req_ue(module_id_t module_idP,
|
||||
int CC_id,
|
||||
uint8_t eNB_index,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated,
|
||||
#ifdef Rel10
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
#endif
|
||||
MeasObjectToAddMod_t **measObj,
|
||||
MAC_MainConfig_t *mac_MainConfig,
|
||||
long logicalChannelIdentity,
|
||||
LogicalChannelConfig_t *logicalChannelConfig,
|
||||
MeasGapConfig_t *measGapConfig,
|
||||
TDD_Config_t *tdd_Config,
|
||||
MobilityControlInfo_t *mobilityControlInfo,
|
||||
uint8_t *SIwindowsize,
|
||||
uint16_t *SIperiod,
|
||||
ARFCN_ValueEUTRA_t *ul_CarrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
|
||||
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList
|
||||
#ifdef Rel10
|
||||
,
|
||||
uint8_t MBMS_Flag,
|
||||
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
|
||||
PMCH_InfoList_r9_t *pmch_InfoList
|
||||
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,
|
||||
uint8_t num_active_cba_groups,
|
||||
uint16_t cba_rnti
|
||||
#endif
|
||||
);
|
||||
|
||||
/** \brief get the estimated UE distance from the PHY->MAC layer.
|
||||
@param Mod_id Instance ID of eNB
|
||||
@param UE_id Index of UE if this is an eNB configuration
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#define DEBUG_RAR
|
||||
|
||||
@@ -43,6 +44,7 @@ extern unsigned int localRIV2alloc_LUT25[512];
|
||||
extern unsigned int distRIV2alloc_LUT25[512];
|
||||
extern unsigned short RIV2nb_rb_LUT25[512];
|
||||
extern unsigned short RIV2first_rb_LUT25[512];
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
unsigned short fill_rar(
|
||||
@@ -65,9 +67,9 @@ unsigned short fill_rar(
|
||||
AssertFatal(CC_id < MAX_NUM_CCs, "CC_id %u < MAX_NUM_CCs %u", CC_id, MAX_NUM_CCs);
|
||||
|
||||
for (i=0; i<NB_RA_PROC_MAX; i++) {
|
||||
if (eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[i].generate_rar == 1) {
|
||||
if (RC.mac[module_idP]->common_channels[CC_id].RA_template[i].generate_rar == 1) {
|
||||
ra_idx=i;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[i].generate_rar = 0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].RA_template[i].generate_rar = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -79,7 +81,7 @@ unsigned short fill_rar(
|
||||
// subheader fixed
|
||||
rarh->E = 0; // First and last RAR
|
||||
rarh->T = 1; // 0 for E/T/R/R/BI subheader, 1 for E/T/RAPID subheader
|
||||
rarh->RAPID = eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].preamble_index; // Respond to Preamble 0 only for the moment
|
||||
rarh->RAPID = RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].preamble_index; // Respond to Preamble 0 only for the moment
|
||||
/*
|
||||
rar->R = 0;
|
||||
rar->Timing_Advance_Command = eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset/4;
|
||||
@@ -91,12 +93,12 @@ unsigned short fill_rar(
|
||||
rar->cqi_req = 1;
|
||||
rar->t_crnti = eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti;
|
||||
*/
|
||||
rar[4] = (uint8_t)(eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti>>8);
|
||||
rar[5] = (uint8_t)(eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti&0xff);
|
||||
//eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset = 0;
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps
|
||||
rar[0] = (uint8_t)(eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset>>(2+4)); // 7 MSBs of timing advance + divide by 4
|
||||
rar[1] = (uint8_t)(eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4
|
||||
rar[4] = (uint8_t)(RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].rnti>>8);
|
||||
rar[5] = (uint8_t)(RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].rnti&0xff);
|
||||
//RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].timing_offset = 0;
|
||||
RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps
|
||||
rar[0] = (uint8_t)(RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].timing_offset>>(2+4)); // 7 MSBs of timing advance + divide by 4
|
||||
rar[1] = (uint8_t)(RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].timing_offset<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4
|
||||
rballoc = mac_xface->computeRIV(N_RB_UL,26,1); // first PRB only for UL Grant
|
||||
rar[1] |= (rballoc>>7)&7; // Hopping = 0 (bit 3), 3 MSBs of rballoc
|
||||
rar[2] = ((uint8_t)(rballoc&0xff))<<1; // 7 LSBs of rballoc
|
||||
@@ -112,19 +114,19 @@ unsigned short fill_rar(
|
||||
frameP,
|
||||
*(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5],
|
||||
ra_idx,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti,
|
||||
rarh->RAPID,eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0].preamble_index,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset);
|
||||
RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].rnti,
|
||||
rarh->RAPID,RC.mac[module_idP]->common_channels[CC_id].RA_template[0].preamble_index,
|
||||
RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].timing_offset);
|
||||
|
||||
if (opt_enabled) {
|
||||
trace_pdu(1, dlsch_buffer, input_buffer_length, module_idP, 2, 1,
|
||||
eNB_mac_inst[module_idP].frame, eNB_mac_inst[module_idP].subframe, 0, 0);
|
||||
RC.mac[module_idP]->frame, RC.mac[module_idP]->subframe, 0, 0);
|
||||
LOG_D(OPT,"[eNB %d][RAPROC] CC_id %d RAR Frame %d trace pdu for rnti %x and rapid %d size %d\n",
|
||||
module_idP, CC_id, frameP, eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti,
|
||||
module_idP, CC_id, frameP, RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].rnti,
|
||||
rarh->RAPID, input_buffer_length);
|
||||
}
|
||||
|
||||
return(eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti);
|
||||
return(RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].rnti);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -92,7 +92,6 @@ MAC_xface *mac_xface;
|
||||
uint32_t RRC_CONNECTION_FLAG;
|
||||
|
||||
UE_MAC_INST *UE_mac_inst; //[NB_MODULE_MAX];
|
||||
eNB_MAC_INST *eNB_mac_inst; //[NB_MODULE_MAX];
|
||||
MAC_RLC_XFACE *Mac_rlc_xface;
|
||||
|
||||
/// Primary component carrier index of eNB
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
#/*________________________Makefile________________________
|
||||
|
||||
# Authors : Hicham Anouar, Lionel Gauthier, Raymond Knopp
|
||||
# Company : EURECOM
|
||||
# Emails : anouar@eurecom.fr, lionel.gauthier@eurecom.fr, knopp@eurecom.fr
|
||||
#________________________________________________________________*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
include $(OPENAIR_HOME)/common/utils/Makefile.inc
|
||||
|
||||
KERNEL_ARCH:=$(shell echo `uname -m`)
|
||||
SET_X64:=$(shell if [ $(KERNEL_ARCH) = 'x86_64' ]; then echo true ; fi)
|
||||
ifdef RTAI
|
||||
# Get the RTAI variables
|
||||
CCC = $(shell rtai-config --cc)
|
||||
RTAI_SUBVERSION=$(shell rtai-config --version | sed -e 's/^..\(.\).*$$/\1/')
|
||||
IS_RTAI_SUBVERSION_LESS_THAN_FIVE=$(shell if [ $(RTAI_SUBVERSION) -lt 5 ] ; then echo true ; fi)
|
||||
|
||||
EXTRA_CFLAGS = $(shell rtai-config --module-cflags) -DRTAI_ENABLED -DPC_TARGET -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -I$(KERNEL_DIR)/build/include -I$(KERNEL_DIR)/build/include/asm/mach-default -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TX=2 -DNB_ANTENNAS_TXRX -DMAC_CONTEXT -I/usr/include $(if $(IS_RTAI_SUBVERSION_LESS_THAN_FIVE),-DRTAI_ISNT_POSIX,)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
####################################################
|
||||
# SOURCE FOLDERS
|
||||
####################################################
|
||||
|
||||
|
||||
COMMON_DIR = ../COMMON
|
||||
AS_RLC_UM_DIR = RLC/UM_v6.1.0_LITE
|
||||
AS_RLC_AM_DIR = RLC/AM
|
||||
AS_RLC_TM_DIR = RLC/TM
|
||||
AS_RLC_DIR = RLC
|
||||
AS_PDCP_DIR = PDCP_v10.1.0
|
||||
AS_MEM_DIR = ../UTIL/MEM
|
||||
AS_LIST_DIR = ../UTIL/LISTS
|
||||
AS_FIFO_DIR = ../UTIL/FIFO
|
||||
AS_MATH_DIR = ../UTIL/MATH
|
||||
AS_TIMER_DIR = ../UTIL/TIMER
|
||||
PHY_INTERFACE_DIR = ../PHY_INTERFACE
|
||||
|
||||
export AS_RLC_UM_DIR
|
||||
export AS_RLC_AM_DIR
|
||||
export AS_RLC_TM_DIR
|
||||
export AS_RLC_DIR
|
||||
export AS_PDCP_DIR
|
||||
export AS_MPLS_DIR
|
||||
export AS_MEM_DIR
|
||||
export AS_LIST_DIR
|
||||
export AS_FIFO_DIR
|
||||
export AS_MATH_DIR
|
||||
export AS_TIMER_DIR
|
||||
export AS_RRM_CONFIG_DIR
|
||||
|
||||
|
||||
|
||||
obj-m += openair_l2.o
|
||||
|
||||
|
||||
|
||||
|
||||
openair_l2-objs += layer2_top.o MAC/layer2_scheduler.o MAC/main.o MAC/nodeb_control_plane_procedures.o MAC/ue_scheduler.o MAC/nodeb_scheduler.o MAC/ue_control_plane_procedures.o MAC/lchan_interface.o MAC/utils.o MAC/openair2_proc.o
|
||||
|
||||
openair_l2-objs += register.o
|
||||
|
||||
|
||||
|
||||
openair_l2-objs += $(AS_LIST_DIR)/list.o
|
||||
openair_l2-objs += $(AS_LIST_DIR)/list2.o
|
||||
|
||||
openair_l2-objs += $(AS_TIMER_DIR)/umts_timer.o
|
||||
|
||||
openair_l2-objs += $(AS_PDCP_DIR)/pdcp.o
|
||||
openair_l2-objs += $(AS_PDCP_DIR)/pdcp_fifo.o
|
||||
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_segment.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_fsm.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_mux.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_retrans.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_util.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_mac_status.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_demux.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_receiver.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_reassembly.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_discard_rx.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_control_primitives.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_reset.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_status.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_timers.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_discard_notif.o
|
||||
openair_l2-objs += $(AS_RLC_AM_DIR)/rlc_am_discard_tx.o
|
||||
|
||||
openair_l2-objs += $(AS_RLC_TM_DIR)/rlc_tm.o
|
||||
openair_l2-objs += $(AS_RLC_TM_DIR)/rlc_tm_control_primitives.o
|
||||
openair_l2-objs += $(AS_RLC_TM_DIR)/rlc_tm_fsm.o
|
||||
openair_l2-objs += $(AS_RLC_TM_DIR)/rlc_tm_segment.o
|
||||
openair_l2-objs += $(AS_RLC_TM_DIR)/rlc_tm_reassembly.o
|
||||
|
||||
openair_l2-objs += $(AS_RLC_UM_DIR)/rlc_um.o
|
||||
openair_l2-objs += $(AS_RLC_UM_DIR)/rlc_um_fsm.o
|
||||
openair_l2-objs += $(AS_RLC_UM_DIR)/rlc_um_control_primitives.o
|
||||
openair_l2-objs += $(AS_RLC_UM_DIR)/rlc_um_segment.o
|
||||
openair_l2-objs += $(AS_RLC_UM_DIR)/rlc_um_reassembly.o
|
||||
openair_l2-objs += $(AS_RLC_UM_DIR)/rlc_um_receiver.o
|
||||
|
||||
openair_l2-objs += $(AS_RLC_DIR)/rlc_mac.o
|
||||
openair_l2-objs += $(AS_RLC_DIR)/rlc.o
|
||||
openair_l2-objs += $(AS_RLC_DIR)/rlc_rrc.o
|
||||
openair_l2-objs += $(AS_RLC_DIR)/rlc_mpls.o
|
||||
|
||||
|
||||
openair_l2-objs += $(AS_MATH_DIR)/random.o
|
||||
openair_l2-objs += $(AS_MATH_DIR)/crc_byte.o
|
||||
|
||||
openair_l2-objs += $(AS_MEM_DIR)/mem_block.o
|
||||
|
||||
|
||||
openair_l2-objs += $(PHY_INTERFACE_DIR)/mac_phy_primitives.o
|
||||
|
||||
|
||||
ifdef MASTER
|
||||
EXTRA_CFLAGS += -DNODE_RG
|
||||
else
|
||||
EXTRA_CFLAGS += -DNODE_MT
|
||||
endif
|
||||
|
||||
|
||||
ifdef NO_RRM
|
||||
EXTRA_CFLAGS += -DNO_RRM
|
||||
else
|
||||
ifndef USER_MODE
|
||||
EXTRA_CFLAGS += -DRRC_RRM_FIFOS_XFACE
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
CCC=gcc
|
||||
|
||||
ifdef PHYEMUL
|
||||
EXTRA_CFLAGS += -DPHY_EMUL
|
||||
else
|
||||
EXTRA_CFLAGS += -I$(OPENAIR1_DIR) -DOPENAIR1 -DOPENAIR2
|
||||
endif
|
||||
|
||||
#--------------------------------------------------------
|
||||
EXTRA_CFLAGS += -DKERNEL$(KERNEL_MAIN_TYPE) -DBIGPHYSAREA #-DNO_RRM -DRRC_RRM_XFACE -DRRC_RRM_FIFOS_XFACE
|
||||
|
||||
|
||||
EXTRA_CFLAGS += -Wall -Wstrict-prototypes $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) $(if $(SET_X64),-m64,) -fno-common -fno-strict-aliasing -pipe -freg-struct-return -ffreestanding -maccumulate-outgoing-args -funroll-loops -mmmx -msse -msse2 -fomit-frame-pointer -nostdinc -DMODULE -D_LOOSE_KERNEL_NAMES -O2 $(GT2629)
|
||||
|
||||
|
||||
EXTRA_CFLAGS += -I$(OPENAIR2_DIR)/COMMON -I$(OPENAIR2_DIR)/PHY_INTERFACE -I$(OPENAIR2_DIR)/UTIL/TIMER -I$(OPENAIR2_DIR)/UTIL/MATH -I$(OPENAIR2_DIR)/UTIL/LISTS -I$(OPENAIR2_DIR)/UTIL/MEM -I$(OPENAIR2_DIR)/LAYER2/RLC -I$(OPENAIR2_DIR)/LAYER2/RLC/UM_v6.1.0_LITE -I$(OPENAIR2_DIR)/LAYER2/RLC/TM -I$(OPENAIR2_DIR)/LAYER2/RLC/AM -I$(OPENAIR2_DIR)/LAYER2/PDCP -I$(OPENAIR2_DIR) -I$(OPENAIR3_DIR)/MESH -I$(OPENAIR3_DIR)/MESH/RRM
|
||||
|
||||
@@ -177,11 +177,12 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
|
||||
AssertFatal(0, "Now execution should not go here");
|
||||
LOG_D(PDCP,"Sending to GTPV1U %d bytes\n", ((pdcp_data_ind_header_t *)(sdu_p->data))->data_size);
|
||||
gtpv1u_new_data_req(
|
||||
ctxt_pP->module_id, //gtpv1u_data_t *gtpv1u_data_p,
|
||||
ctxt_pP->rnti,//rb_id/maxDRB, TO DO UE ID
|
||||
((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id + 4,
|
||||
&(((uint8_t *) sdu_p->data)[sizeof (pdcp_data_ind_header_t)]),
|
||||
((pdcp_data_ind_header_t *)(sdu_p->data))->data_size);
|
||||
ctxt_pP->module_id, //gtpv1u_data_t *gtpv1u_data_p,
|
||||
ctxt_pP->rnti,//rb_id/maxDRB, TO DO UE ID
|
||||
((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id + 4,
|
||||
&(((uint8_t *) sdu_p->data)[sizeof (pdcp_data_ind_header_t)]),
|
||||
((pdcp_data_ind_header_t *)(sdu_p->data))->data_size,
|
||||
0);
|
||||
|
||||
list_remove_head (&pdcp_sdu_list);
|
||||
free_mem_block (sdu_p, __func__);
|
||||
|
||||
@@ -60,10 +60,10 @@ rlc_tm_send_sdu (
|
||||
PROTOCOL_RLC_TM_CTXT_ARGS(ctxt_pP, rlc_pP));
|
||||
|
||||
for (index = 0; index < length_in_bytes; index++) {
|
||||
msg ("%c", srcP[index]);
|
||||
LOG_T (RLC,"%c", srcP[index]);
|
||||
}
|
||||
|
||||
msg ("\n");
|
||||
LOG_T (RLC,"\n");
|
||||
#endif
|
||||
|
||||
memcpy (&rlc_pP->output_sdu_in_construction->data[rlc_pP->output_sdu_size_to_write], srcP, length_in_bytes);
|
||||
@@ -77,7 +77,7 @@ rlc_tm_send_sdu (
|
||||
rlc_pP->output_sdu_in_construction);
|
||||
rlc_pP->output_sdu_in_construction = NULL;
|
||||
} else {
|
||||
msg ("[RLC_TM %p][SEND_SDU] ERROR OUTPUT SDU IS NULL\n", rlc_pP);
|
||||
LOG_D (RLC,"[RLC_TM %p][SEND_SDU] ERROR OUTPUT SDU IS NULL\n", rlc_pP);
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -422,7 +422,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
|
||||
|
||||
case RLC_MODE_AM:
|
||||
#ifdef DEBUG_RLC_DATA_REQ
|
||||
msg("RLC_MODE_AM\n");
|
||||
LOG_D(RLC,"RLC_MODE_AM\n");
|
||||
#endif
|
||||
new_sdu_p = get_free_mem_block (sdu_sizeP + sizeof (struct rlc_am_data_req_alloc), __func__);
|
||||
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*________________________openair_w3g4free_top.c________________________
|
||||
|
||||
Authors : Hicham Anouar, Raymond Knopp
|
||||
Company : EURECOM
|
||||
Emails : anouar@eurecom.fr, knopp@eurecom.fr
|
||||
________________________________________________________________*/
|
||||
|
||||
#ifndef USER_MODE
|
||||
#define __NO_VERSION__
|
||||
|
||||
#include <rtai.h>
|
||||
#include <rtai_fifos.h>
|
||||
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/bitops.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/segment.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/delay.h>
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/mman.h>
|
||||
|
||||
#include <linux/slab.h>
|
||||
//#include <linux/config.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include <linux/errno.h>
|
||||
|
||||
#ifdef KERNEL2_6
|
||||
//#include <linux/config.h>
|
||||
#include <linux/slab.h>
|
||||
#endif
|
||||
|
||||
#ifdef KERNEL2_4
|
||||
#include <linux/malloc.h>
|
||||
#include <linux/wrapper.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include <linux/bigphysarea.h>
|
||||
|
||||
//#include "defs.h"
|
||||
//#include "openair_types.h"
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
|
||||
extern void macphy_scheduler(uint8_t);
|
||||
extern MAC_xface *mac_register(void *, void*, void*, void*,void*);
|
||||
extern int mac_unregister(MAC_xface *);
|
||||
extern MAC_xface *mac_xface;
|
||||
extern int mac_top_init();
|
||||
extern int mac_init_global_param(void);
|
||||
extern int pdcp_module_init(void);
|
||||
extern void pdcp_module_cleanup(void);
|
||||
|
||||
/*------------------------------------------------*/
|
||||
void w3g4free_mac_init(void)
|
||||
{
|
||||
|
||||
int ret;
|
||||
|
||||
#ifndef USER_MODE
|
||||
printk("[OPENAIR][MAC][TOP] INIT...\n");
|
||||
#else
|
||||
printf("[OPENAIR][MAC][TOP] INIT...\n");
|
||||
#endif// USER_MODE
|
||||
// if(mac_xface->is_cluster_head)
|
||||
// mac_top_init();
|
||||
//else
|
||||
mac_top_init();
|
||||
|
||||
#ifndef USER_MODE
|
||||
printk("[OPENAIR][MAC][TOP] INIT DONE.\n");
|
||||
#endif//USER_MODE
|
||||
|
||||
|
||||
|
||||
}
|
||||
/*------------------------------------------------*/
|
||||
#ifndef USER_MODE
|
||||
|
||||
/*------------------------------------------------*/
|
||||
/* Prototypes */
|
||||
/*------------------------------------------------*/
|
||||
#ifdef KERNEL2_4
|
||||
static int init_module( void );
|
||||
static void cleanup_module(void);
|
||||
#else
|
||||
static int openair_mac_init_module( void );
|
||||
static void openair_mac_cleanup_module(void);
|
||||
#endif
|
||||
|
||||
#ifdef KERNEL2_6
|
||||
static int __init openair_mac_init_module( void )
|
||||
#else
|
||||
int init_module( void )
|
||||
#endif //KERNEL2_6
|
||||
{
|
||||
printk("[OPENAIR][MAC][INIT] inserting module\n");
|
||||
|
||||
// mac_init_global_param();
|
||||
|
||||
mac_xface=mac_register(macphy_scheduler,NULL,w3g4free_mac_init,mrbch_phy_sync_failure,chbch_phy_sync_success);
|
||||
|
||||
if( mac_xface == NULL ) {
|
||||
printk("[OPENAIR][MAC][INIT] Could not get MAC descriptor\n");
|
||||
return -1;
|
||||
} else {
|
||||
printk("[OPENAIR][MAC][INIT] Got MAC descriptor \n");
|
||||
|
||||
if(mac_init_global_param()==-1) {
|
||||
mac_unregister(mac_xface);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (pdcp_module_init()!=0) {
|
||||
mac_unregister(mac_xface);
|
||||
return(-1);
|
||||
} else {
|
||||
printk("[OPENAIR][MAC][INIT] PDCP INIT OK\n");
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef KERNEL2_6
|
||||
static void __exit openair_mac_cleanup_module(void)
|
||||
#else
|
||||
void cleanup_module(void)
|
||||
#endif //KERNEL2_6
|
||||
{
|
||||
printk("[OPENAIR][MAC][CLEANUP] cleanup module\n");
|
||||
mac_unregister(mac_xface);
|
||||
pdcp_module_cleanup();
|
||||
}
|
||||
|
||||
MODULE_AUTHOR
|
||||
("Lionel GAUTHIER <lionel.gauthier@eurecom.fr>, Raymond KNOPP <raymond.knopp@eurecom.fr>, Aawatif MENOUNI <aawatif.menouni@eurecom.fr>,Dominique NUSSBAUM <dominique.nussbaum@eurecom.fr>, Michelle WETTERWALD <michelle.wetterwald@eurecom.fr>, Maxime GUILLAUD <maxime.guillaud@eurecom.fr, Hicham ANOUAR <hicham.anouar@eurecom.fr>");
|
||||
MODULE_DESCRIPTION ("openair MAC layer module");
|
||||
MODULE_LICENSE ("GPL");
|
||||
module_init (openair_mac_init_module);
|
||||
module_exit (openair_mac_cleanup_module);
|
||||
|
||||
|
||||
#endif //USER_MODE
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
static mapping rrc_status_names[] = {
|
||||
{"RRC_INACTIVE", 0},
|
||||
@@ -61,6 +62,8 @@ static mapping rrc_status_names[] = {
|
||||
{NULL, -1}
|
||||
};
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
int dump_eNB_l2_stats(char *buffer, int length)
|
||||
{
|
||||
|
||||
@@ -109,7 +112,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
|
||||
|
||||
for (eNB_id=0; eNB_id<number_of_cards; eNB_id++) {
|
||||
/* reset the values */
|
||||
eNB = &eNB_mac_inst[eNB_id];
|
||||
eNB = RC.mac[eNB_id];
|
||||
UE_list = &eNB->UE_list;
|
||||
|
||||
for (CC_id=0 ; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
@@ -98,6 +98,18 @@ typedef struct {
|
||||
void (*SR_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
|
||||
/// Indicate UL Failure to eNodeB MAC
|
||||
void (*UL_failure_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
|
||||
|
||||
/// Configure Common PHY parameters from SIB1
|
||||
void (*phy_config_mib_eNB)(module_id_t Mod_id,int CC_id,
|
||||
int eutra_band,
|
||||
int N_RB_DL,
|
||||
PHICH_Config_t *phich_Config,
|
||||
int Nid_cell,
|
||||
int Ncp,
|
||||
int p_eNB,
|
||||
uint32_t dl_CarrierFreq,
|
||||
uint32_t ul_CarrierFreq);
|
||||
|
||||
/// Configure Common PHY parameters from SIB1
|
||||
void (*phy_config_sib1_eNB)(module_id_t Mod_id,int CC_id,
|
||||
TDD_Config_t *tdd_config,
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "pdcp.h"
|
||||
#include "msc.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#ifdef PHY_EMUL
|
||||
#include "SIMULATION/simulation_defs.h"
|
||||
@@ -57,6 +58,8 @@ extern UE_MAC_INST *UE_mac_inst;
|
||||
|
||||
mui_t mui=0;
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int8_t
|
||||
mac_rrc_data_req(
|
||||
@@ -83,25 +86,25 @@ mac_rrc_data_req(
|
||||
if( enb_flagP == ENB_FLAG_YES) {
|
||||
|
||||
if((Srb_id & RAB_OFFSET) == BCCH) {
|
||||
if(eNB_rrc_inst[Mod_idP].carrier[CC_id].SI.Active==0) {
|
||||
if(RC.rrc[Mod_idP]->carrier[CC_id].SI.Active==0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// All even frames transmit SIB in SF 5
|
||||
if (eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1 == 255) {
|
||||
if (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1 == 255) {
|
||||
LOG_E(RRC,"[eNB %d] MAC Request for SIB1 and SIB1 not initialized\n",Mod_idP);
|
||||
mac_xface->macphy_exit("mac_rrc_data_req: MAC Request for SIB1 and SIB1 not initialized");
|
||||
}
|
||||
|
||||
if ((frameP%2) == 0) {
|
||||
memcpy(&buffer_pP[0],
|
||||
eNB_rrc_inst[Mod_idP].carrier[CC_id].SIB1,
|
||||
eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1);
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].SIB1,
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
{
|
||||
MessageDef *message_p;
|
||||
int sib1_size = eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1;
|
||||
int sib1_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1;
|
||||
int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu);
|
||||
|
||||
if (sib1_size > sdu_size) {
|
||||
@@ -114,7 +117,7 @@ mac_rrc_data_req(
|
||||
RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib1_size;
|
||||
memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE);
|
||||
memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu,
|
||||
eNB_rrc_inst[Mod_idP].carrier[CC_id].SIB1,
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].SIB1,
|
||||
sib1_size);
|
||||
RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index;
|
||||
|
||||
@@ -125,24 +128,24 @@ mac_rrc_data_req(
|
||||
#ifdef DEBUG_RRC
|
||||
LOG_T(RRC,"[eNB %d] Frame %d : BCCH request => SIB 1\n",Mod_idP,frameP);
|
||||
|
||||
for (i=0; i<eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1; i++) {
|
||||
for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1; i++) {
|
||||
LOG_T(RRC,"%x.",buffer_pP[i]);
|
||||
}
|
||||
|
||||
LOG_T(RRC,"\n");
|
||||
#endif
|
||||
|
||||
return (eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1);
|
||||
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
|
||||
} // All RFN mod 8 transmit SIB2-3 in SF 5
|
||||
else if ((frameP%8) == 1) {
|
||||
memcpy(&buffer_pP[0],
|
||||
eNB_rrc_inst[Mod_idP].carrier[CC_id].SIB23,
|
||||
eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB23);
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].SIB23,
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
{
|
||||
MessageDef *message_p;
|
||||
int sib23_size = eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB23;
|
||||
int sib23_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23;
|
||||
int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu);
|
||||
|
||||
if (sib23_size > sdu_size) {
|
||||
@@ -155,7 +158,7 @@ mac_rrc_data_req(
|
||||
RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib23_size;
|
||||
memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE);
|
||||
memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu,
|
||||
eNB_rrc_inst[Mod_idP].carrier[CC_id].SIB23,
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].SIB23,
|
||||
sib23_size);
|
||||
RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index;
|
||||
|
||||
@@ -166,13 +169,13 @@ mac_rrc_data_req(
|
||||
#ifdef DEBUG_RRC
|
||||
LOG_T(RRC,"[eNB %d] Frame %d BCCH request => SIB 2-3\n",Mod_idP,frameP);
|
||||
|
||||
for (i=0; i<eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB23; i++) {
|
||||
for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23; i++) {
|
||||
LOG_T(RRC,"%x.",buffer_pP[i]);
|
||||
}
|
||||
|
||||
LOG_T(RRC,"\n");
|
||||
#endif
|
||||
return(eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB23);
|
||||
return(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
|
||||
} else {
|
||||
return(0);
|
||||
}
|
||||
@@ -181,12 +184,12 @@ mac_rrc_data_req(
|
||||
if( (Srb_id & RAB_OFFSET ) == CCCH) {
|
||||
LOG_T(RRC,"[eNB %d] Frame %d CCCH request (Srb_id %d)\n",Mod_idP,frameP, Srb_id);
|
||||
|
||||
if(eNB_rrc_inst[Mod_idP].carrier[CC_id].Srb0.Active==0) {
|
||||
if(RC.rrc[Mod_idP]->carrier[CC_id].Srb0.Active==0) {
|
||||
LOG_E(RRC,"[eNB %d] CCCH Not active\n",Mod_idP);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Srb_info=&eNB_rrc_inst[Mod_idP].carrier[CC_id].Srb0;
|
||||
Srb_info=&RC.rrc[Mod_idP]->carrier[CC_id].Srb0;
|
||||
|
||||
// check if data is there for MAC
|
||||
if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer
|
||||
@@ -225,7 +228,7 @@ mac_rrc_data_req(
|
||||
#ifdef Rel10
|
||||
|
||||
if((Srb_id & RAB_OFFSET) == MCCH) {
|
||||
if(eNB_rrc_inst[Mod_idP].carrier[CC_id].MCCH_MESS[mbsfn_sync_area].Active==0) {
|
||||
if(RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESS[mbsfn_sync_area].Active==0) {
|
||||
return 0; // this parameter is set in function init_mcch in rrc_eNB.c
|
||||
}
|
||||
|
||||
@@ -239,7 +242,7 @@ mac_rrc_data_req(
|
||||
#if defined(ENABLE_ITTI)
|
||||
{
|
||||
MessageDef *message_p;
|
||||
int mcch_size = eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area];
|
||||
int mcch_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area];
|
||||
int sdu_size = sizeof(RRC_MAC_MCCH_DATA_REQ (message_p).sdu);
|
||||
|
||||
if (mcch_size > sdu_size) {
|
||||
@@ -252,7 +255,7 @@ mac_rrc_data_req(
|
||||
RRC_MAC_MCCH_DATA_REQ (message_p).sdu_size = mcch_size;
|
||||
memset (RRC_MAC_MCCH_DATA_REQ (message_p).sdu, 0, MCCH_SDU_SIZE);
|
||||
memcpy (RRC_MAC_MCCH_DATA_REQ (message_p).sdu,
|
||||
eNB_rrc_inst[Mod_idP].carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
|
||||
mcch_size);
|
||||
RRC_MAC_MCCH_DATA_REQ (message_p).enb_index = eNB_index;
|
||||
RRC_MAC_MCCH_DATA_REQ (message_p).mbsfn_sync_area = mbsfn_sync_area;
|
||||
@@ -262,20 +265,20 @@ mac_rrc_data_req(
|
||||
#endif
|
||||
|
||||
memcpy(&buffer_pP[0],
|
||||
eNB_rrc_inst[Mod_idP].carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
|
||||
eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
|
||||
|
||||
#ifdef DEBUG_RRC
|
||||
LOG_D(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_idP,frameP);
|
||||
|
||||
for (i=0; i<eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]; i++) {
|
||||
for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]; i++) {
|
||||
LOG_T(RRC,"%x.",buffer_pP[i]);
|
||||
}
|
||||
|
||||
LOG_T(RRC,"\n");
|
||||
#endif
|
||||
|
||||
return (eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
|
||||
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
|
||||
// }
|
||||
//else
|
||||
//return(0);
|
||||
@@ -462,7 +465,7 @@ mac_rrc_data_ind(
|
||||
#endif // Rel10
|
||||
|
||||
} else { // This is an eNB
|
||||
Srb_info = &eNB_rrc_inst[module_idP].carrier[CC_id].Srb0;
|
||||
Srb_info = &RC.rrc[module_idP]->carrier[CC_id].Srb0;
|
||||
LOG_T(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id);
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
@@ -706,7 +709,7 @@ mac_eNB_get_rrc_status(
|
||||
{
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
ue_context_p = rrc_eNB_get_ue_context(
|
||||
&eNB_rrc_inst[Mod_idP],
|
||||
RC.rrc[Mod_idP],
|
||||
rntiP);
|
||||
|
||||
if (ue_context_p != NULL) {
|
||||
@@ -724,7 +727,7 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
{
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
ue_context_p = rrc_eNB_get_ue_context(
|
||||
&eNB_rrc_inst[Mod_instP],
|
||||
RC.rrc[Mod_instP],
|
||||
rntiP);
|
||||
|
||||
if (ue_context_p != NULL) {
|
||||
@@ -745,7 +748,7 @@ void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
|
||||
{
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
ue_context_p = rrc_eNB_get_ue_context(
|
||||
&eNB_rrc_inst[Mod_instP],
|
||||
RC.rrc[Mod_instP],
|
||||
rntiP);
|
||||
|
||||
if (ue_context_p != NULL) {
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#endif
|
||||
|
||||
#include "RRC/LITE/defs.h"
|
||||
#include "RRC/LITE/extern.h"
|
||||
#include "RRCConnectionSetupComplete.h"
|
||||
#include "RRCConnectionReconfigurationComplete.h"
|
||||
#include "RRCConnectionReconfiguration.h"
|
||||
@@ -87,6 +88,8 @@
|
||||
# include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
#include "common/ran_context.h"
|
||||
|
||||
//#include "PHY/defs.h"
|
||||
#ifndef USER_MODE
|
||||
#define msg printk
|
||||
@@ -101,7 +104,6 @@ int errno;
|
||||
|
||||
//#define XER_PRINT
|
||||
|
||||
extern Enb_properties_array_t enb_properties;
|
||||
typedef struct xer_sprint_string_s {
|
||||
char *string;
|
||||
size_t string_size;
|
||||
@@ -111,6 +113,8 @@ typedef struct xer_sprint_string_s {
|
||||
extern unsigned char NB_eNB_INST;
|
||||
extern uint8_t usim_test;
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
uint16_t two_tier_hexagonal_cellIds[7] = {0,1,2,4,5,7,8};
|
||||
uint16_t two_tier_hexagonal_adjacent_cellIds[7][6] = {{1,2,4,5,7,8}, // CellId 0
|
||||
{11,18,2,0,8,15}, // CellId 1
|
||||
@@ -186,186 +190,84 @@ uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId)
|
||||
return 0xFF; //error!
|
||||
}
|
||||
|
||||
/*
|
||||
uint8_t do_SIB1(LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer,
|
||||
SystemInformationBlockType1_t *sib1) {
|
||||
|
||||
|
||||
PLMN_IdentityInfo_t PLMN_identity_info;
|
||||
MCC_MNC_Digit_t dummy;
|
||||
asn_enc_rval_t enc_rval;
|
||||
SchedulingInfo_t schedulingInfo;
|
||||
SIB_Type_t sib_type;
|
||||
|
||||
memset(sib1,0,sizeof(SystemInformationBlockType1_t));
|
||||
memset(&PLMN_identity_info,0,sizeof(PLMN_IdentityInfo_t));
|
||||
memset(&schedulingInfo,0,sizeof(SchedulingInfo_t));
|
||||
memset(&sib_type,0,sizeof(SIB_Type_t));
|
||||
|
||||
PLMN_identity_info.plmn_Identity.mcc = CALLOC(1,sizeof(*PLMN_identity_info.plmn_Identity.mcc));
|
||||
memset(PLMN_identity_info.plmn_Identity.mcc,0,sizeof(*PLMN_identity_info.plmn_Identity.mcc));
|
||||
|
||||
asn_set_empty(&PLMN_identity_info.plmn_Identity.mcc->list);//.size=0;
|
||||
|
||||
dummy=2;ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mcc->list,&dummy);
|
||||
dummy=6;ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mcc->list,&dummy);
|
||||
dummy=2;ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mcc->list,&dummy);
|
||||
|
||||
PLMN_identity_info.plmn_Identity.mnc.list.size=0;
|
||||
PLMN_identity_info.plmn_Identity.mnc.list.count=0;
|
||||
dummy=8;ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mnc.list,&dummy);
|
||||
dummy=0;ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mnc.list,&dummy);
|
||||
//assign_enum(&PLMN_identity_info.cellReservedForOperatorUse,PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved);
|
||||
PLMN_identity_info.cellReservedForOperatorUse=PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
|
||||
|
||||
ASN_SEQUENCE_ADD(&sib1->cellAccessRelatedInfo.plmn_IdentityList.list,&PLMN_identity_info);
|
||||
|
||||
|
||||
// 16 bits
|
||||
sib1->cellAccessRelatedInfo.trackingAreaCode.buf = MALLOC(2);
|
||||
sib1->cellAccessRelatedInfo.trackingAreaCode.buf[0]=0x00;
|
||||
sib1->cellAccessRelatedInfo.trackingAreaCode.buf[1]=0x10;
|
||||
sib1->cellAccessRelatedInfo.trackingAreaCode.size=2;
|
||||
sib1->cellAccessRelatedInfo.trackingAreaCode.bits_unused=0;
|
||||
|
||||
// 28 bits
|
||||
sib1->cellAccessRelatedInfo.cellIdentity.buf = MALLOC(8);
|
||||
sib1->cellAccessRelatedInfo.cellIdentity.buf[0]=0x01;
|
||||
sib1->cellAccessRelatedInfo.cellIdentity.buf[1]=0x48;
|
||||
sib1->cellAccessRelatedInfo.cellIdentity.buf[2]=0x0f;
|
||||
sib1->cellAccessRelatedInfo.cellIdentity.buf[3]=0x03;
|
||||
sib1->cellAccessRelatedInfo.cellIdentity.size=4;
|
||||
sib1->cellAccessRelatedInfo.cellIdentity.bits_unused=4;
|
||||
|
||||
// assign_enum(&sib1->cellAccessRelatedInfo.cellBarred,SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred);
|
||||
sib1->cellAccessRelatedInfo.cellBarred=SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred;
|
||||
|
||||
// assign_enum(&sib1->cellAccessRelatedInfo.intraFreqReselection,SystemInformationBlockType1__cellAccessRelatedInfo__intraFreqReselection_allowed);
|
||||
sib1->cellAccessRelatedInfo.intraFreqReselection=SystemInformationBlockType1__cellAccessRelatedInfo__intraFreqReselection_allowed;
|
||||
sib1->cellAccessRelatedInfo.csg_Indication=0;
|
||||
|
||||
sib1->cellSelectionInfo.q_RxLevMin=-70;
|
||||
sib1->cellSelectionInfo.q_RxLevMinOffset=NULL;
|
||||
|
||||
sib1->freqBandIndicator = 2;
|
||||
|
||||
// assign_enum(&schedulingInfo.si_Periodicity,SchedulingInfo__si_Periodicity_rf8);
|
||||
schedulingInfo.si_Periodicity=SchedulingInfo__si_Periodicity_rf8;
|
||||
|
||||
// assign_enum(&sib_type,SIB_Type_sibType3);
|
||||
sib_type=SIB_Type_sibType3;
|
||||
|
||||
ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type);
|
||||
ASN_SEQUENCE_ADD(&sib1->schedulingInfoList.list,&schedulingInfo);
|
||||
|
||||
sib1->tdd_Config = CALLOC(1,sizeof(struct TDD_Config));
|
||||
|
||||
//assign_enum(&sib1->tdd_Config->subframeAssignment,TDD_Config__subframeAssignment_sa3);
|
||||
sib1->tdd_Config->subframeAssignment=frame_parms->tdd_config; //TDD_Config__subframeAssignment_sa3;
|
||||
|
||||
// assign_enum(&sib1->tdd_Config->specialSubframePatterns,TDD_Config__specialSubframePatterns_ssp0);
|
||||
sib1->tdd_Config->specialSubframePatterns=frame_parms->tdd_config_S;//TDD_Config__specialSubframePatterns_ssp0;
|
||||
|
||||
// assign_enum(&sib1->si_WindowLength,SystemInformationBlockType1__si_WindowLength_ms10);
|
||||
sib1->si_WindowLength=SystemInformationBlockType1__si_WindowLength_ms10;
|
||||
sib1->systemInfoValueTag=0;
|
||||
// sib1.nonCriticalExtension = calloc(1,sizeof(*sib1.nonCriticalExtension));
|
||||
|
||||
#ifdef USER_MODE
|
||||
xer_fprint(stdout, &asn_DEF_SystemInformationBlockType1, (void*)sib1);
|
||||
#endif
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_SystemInformationBlockType1,
|
||||
(void*)sib1,
|
||||
buffer,
|
||||
200);
|
||||
#ifdef USER_MODE
|
||||
LOG_D(RRC,"[eNB] SystemInformationBlockType1 Encoded %d bits (%d bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
|
||||
#endif
|
||||
|
||||
if (enc_rval.encoded==-1)
|
||||
return(-1);
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
*/
|
||||
// AT4 packet
|
||||
uint8_t do_MIB(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame, uint8_t *buffer)
|
||||
uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich_Resource, uint32_t phich_duration, uint32_t frame)
|
||||
{
|
||||
|
||||
asn_enc_rval_t enc_rval;
|
||||
BCCH_BCH_Message_t mib;
|
||||
BCCH_BCH_Message_t *mib=&carrier->mib ;
|
||||
uint8_t sfn = (uint8_t)((frame>>2)&0xff);
|
||||
uint16_t spare=0;
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
switch (N_RB_DL) {
|
||||
|
||||
case 6:
|
||||
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n6;
|
||||
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n6;
|
||||
break;
|
||||
|
||||
case 15:
|
||||
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n15;
|
||||
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n15;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n25;
|
||||
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n25;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n50;
|
||||
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n50;
|
||||
break;
|
||||
|
||||
case 75:
|
||||
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n75;
|
||||
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n75;
|
||||
break;
|
||||
|
||||
case 100:
|
||||
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n100;
|
||||
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n100;
|
||||
break;
|
||||
|
||||
default:
|
||||
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n6;
|
||||
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n6;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (frame_parms->phich_config_common.phich_resource) {
|
||||
switch (phich_Resource) {
|
||||
case oneSixth:
|
||||
mib.message.phich_Config.phich_Resource = 0;
|
||||
mib->message.phich_Config.phich_Resource = 0;
|
||||
break;
|
||||
|
||||
case half:
|
||||
mib.message.phich_Config.phich_Resource = 1;
|
||||
mib->message.phich_Config.phich_Resource = 1;
|
||||
break;
|
||||
|
||||
case one:
|
||||
mib.message.phich_Config.phich_Resource = 2;
|
||||
mib->message.phich_Config.phich_Resource = 2;
|
||||
break;
|
||||
|
||||
case two:
|
||||
mib.message.phich_Config.phich_Resource = 3;
|
||||
mib->message.phich_Config.phich_Resource = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
printf("[MIB] systemBandwidth %x, phich_duration %x, phich_resource %x,sfn %x\n",
|
||||
(uint32_t)mib.message.dl_Bandwidth,
|
||||
(uint32_t)frame_parms->phich_config_common.phich_duration,
|
||||
(uint32_t)mib.message.phich_Config.phich_Resource,
|
||||
LOG_I(RRC,"[MIB] systemBandwidth %x, phich_duration %x, phich_resource %x,sfn %x\n",
|
||||
(uint32_t)mib->message.dl_Bandwidth,
|
||||
(uint32_t)phich_duration,
|
||||
(uint32_t)phich_Resource,
|
||||
(uint32_t)sfn);
|
||||
mib.message.phich_Config.phich_Duration = frame_parms->phich_config_common.phich_duration;
|
||||
mib.message.systemFrameNumber.buf = &sfn;
|
||||
mib.message.systemFrameNumber.size = 1;
|
||||
mib.message.systemFrameNumber.bits_unused=0;
|
||||
mib.message.spare.buf = (uint8_t *)&spare;
|
||||
mib.message.spare.size = 2;
|
||||
mib.message.spare.bits_unused = 6; // This makes a spare of 10 bits
|
||||
mib->message.phich_Config.phich_Duration = phich_duration;
|
||||
mib->message.systemFrameNumber.buf = &sfn;
|
||||
mib->message.systemFrameNumber.size = 1;
|
||||
mib->message.systemFrameNumber.bits_unused=0;
|
||||
mib->message.spare.buf = (uint8_t *)&spare;
|
||||
mib->message.spare.size = 2;
|
||||
mib->message.spare.bits_unused = 6; // This makes a spare of 10 bits
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message,
|
||||
(void*)&mib,
|
||||
buffer,
|
||||
(void*)mib,
|
||||
&carrier->MIB,
|
||||
100);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
|
||||
/*
|
||||
#if defined(ENABLE_ITTI)
|
||||
# if !defined(DISABLE_XER_SPRINT)
|
||||
{
|
||||
@@ -379,31 +281,21 @@ uint8_t do_MIB(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame,
|
||||
msg_p->ittiMsg.rrc_dl_bcch.size = message_string_size;
|
||||
memcpy(&msg_p->ittiMsg.rrc_dl_bcch.text, message_string, message_string_size);
|
||||
|
||||
itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p);
|
||||
itti_send_msg_to_task(TASK_UNKNOWN, enb_module_idP, msg_p);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
*/
|
||||
if (enc_rval.encoded==-1) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
return((enc_rval.encoded+7)/8);
|
||||
/*
|
||||
printf("MIB: %x ((MIB>>10)&63)+(MIB&3<<6)=SFN %x, MIB>>2&3 = phich_resource %d, MIB>>4&1 = phich_duration %d, MIB>>5&7 = system_bandwidth %d)\n",*(uint32_t *)buffer,
|
||||
(((*(uint32_t *)buffer)>>10)&0x3f)+(((*(uint32_t *)buffer)&3)<<6),
|
||||
((*(uint32_t *)buffer)>>2)&0x3,
|
||||
((*(uint32_t *)buffer)>>4)&0x1,
|
||||
((*(uint32_t *)buffer)>>5)&0x7
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
|
||||
LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer,
|
||||
BCCH_DL_SCH_Message_t *bcch_message,
|
||||
SystemInformationBlockType1_t **sib1
|
||||
uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
|
||||
int Mod_id,int CC_id
|
||||
#if defined(ENABLE_ITTI)
|
||||
, RrcConfigurationReq *configuration
|
||||
#endif
|
||||
@@ -417,6 +309,11 @@ uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
|
||||
SchedulingInfo_t schedulingInfo;
|
||||
SIB_Type_t sib_type;
|
||||
|
||||
uint8_t *buffer = carrier->SIB1;
|
||||
BCCH_DL_SCH_Message_t *bcch_message = &carrier->siblock1;
|
||||
SystemInformationBlockType1_t **sib1 = &carrier->sib1;
|
||||
|
||||
|
||||
memset(bcch_message,0,sizeof(BCCH_DL_SCH_Message_t));
|
||||
bcch_message->message.present = BCCH_DL_SCH_MessageType_PR_c1;
|
||||
bcch_message->message.choice.c1.present = BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1;
|
||||
@@ -552,14 +449,14 @@ uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
|
||||
#if defined(ENABLE_ITTI)
|
||||
configuration->tdd_config[CC_id];
|
||||
#else
|
||||
frame_parms->tdd_config;
|
||||
3;
|
||||
#endif
|
||||
|
||||
(*sib1)->tdd_Config->specialSubframePatterns =
|
||||
#if defined(ENABLE_ITTI)
|
||||
configuration->tdd_config_s[CC_id];
|
||||
#else
|
||||
frame_parms->tdd_config_S;
|
||||
0;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -589,7 +486,6 @@ uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
|
||||
msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_BCCH, message_string_size + sizeof (IttiMsgText));
|
||||
msg_p->ittiMsg.rrc_dl_bcch.size = message_string_size;
|
||||
memcpy(&msg_p->ittiMsg.rrc_dl_bcch.text, message_string, message_string_size);
|
||||
|
||||
itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p);
|
||||
}
|
||||
}
|
||||
@@ -608,17 +504,7 @@ uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
|
||||
}
|
||||
|
||||
uint8_t do_SIB23(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t *buffer,
|
||||
BCCH_DL_SCH_Message_t *bcch_message,
|
||||
SystemInformationBlockType2_t **sib2,
|
||||
SystemInformationBlockType3_t **sib3
|
||||
#ifdef Rel10
|
||||
,
|
||||
SystemInformationBlockType13_r9_t **sib13,
|
||||
uint8_t MBMS_flag
|
||||
#endif
|
||||
int CC_id
|
||||
#if defined(ENABLE_ITTI)
|
||||
, RrcConfigurationReq *configuration
|
||||
#endif
|
||||
@@ -633,6 +519,15 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
#endif
|
||||
asn_enc_rval_t enc_rval;
|
||||
|
||||
uint8_t *buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23;
|
||||
BCCH_DL_SCH_Message_t *bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].systemInformation;
|
||||
SystemInformationBlockType2_t **sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2;
|
||||
SystemInformationBlockType3_t **sib3 = &RC.rrc[Mod_id]->carrier[CC_id].sib3;
|
||||
#ifdef Rel10
|
||||
SystemInformationBlockType13_r9_t **sib13 = &RC.rrc[Mod_id]->carrier[CC_id].sib13;
|
||||
uint8_t MBMS_flag = RC.rrc[Mod_id]->carrier[CC_id].MBMS_flag;
|
||||
#endif
|
||||
|
||||
if (bcch_message) {
|
||||
memset(bcch_message,0,sizeof(BCCH_DL_SCH_Message_t));
|
||||
} else {
|
||||
@@ -864,12 +759,8 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
// PDSCH-Config
|
||||
(*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.referenceSignalPower=0; // corresponds to 24.7 dBm 5 MHz/ 27.7 10 MHz/ 30.7 20 MHz
|
||||
|
||||
if (frame_parms->mode1_flag==1) {
|
||||
(*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.p_b=0;
|
||||
} else {
|
||||
(*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.p_b=1;
|
||||
|
||||
}
|
||||
(*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.p_b=0;
|
||||
|
||||
// PUSCH-Config
|
||||
(*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.n_SB=1;
|
||||
@@ -947,11 +838,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1;
|
||||
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2;
|
||||
|
||||
if (frame_parms->frame_type == TDD) {
|
||||
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2 cuz 2last bits are unused.
|
||||
} else { /// 111000
|
||||
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2;
|
||||
}
|
||||
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2;
|
||||
|
||||
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1);
|
||||
|
||||
@@ -968,11 +855,8 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.size= 1;
|
||||
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.bits_unused= 2;
|
||||
|
||||
if (frame_parms->frame_type == TDD) {
|
||||
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2 cuz 2last bits are unused.
|
||||
} else { ///000111
|
||||
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x07<<2;
|
||||
}
|
||||
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x07<<2;
|
||||
|
||||
|
||||
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig2);
|
||||
}
|
||||
@@ -1043,11 +927,8 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf= MALLOC(1);
|
||||
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.size= 1;
|
||||
|
||||
if (frame_parms->frame_type == TDD) {//TDD: SF7
|
||||
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x08<<2;
|
||||
} else {
|
||||
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x20<<2; // FDD: SF1
|
||||
}
|
||||
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x20<<2; // FDD: SF1
|
||||
|
||||
|
||||
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
|
||||
|
||||
@@ -1069,11 +950,8 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.size= 1;
|
||||
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
|
||||
|
||||
if (frame_parms->frame_type == TDD) {//TDD: SF7
|
||||
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x08<<2;
|
||||
} else {
|
||||
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x04<<2; // FDD: SF6
|
||||
}
|
||||
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x04<<2; // FDD: SF6
|
||||
|
||||
|
||||
MBSFN_Area2->mcch_Config_r9.signallingMCS_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n7;
|
||||
|
||||
@@ -1388,10 +1266,10 @@ uint8_t
|
||||
do_RRCConnectionSetup(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
int CC_id,
|
||||
int CC_id,
|
||||
uint8_t* const buffer,
|
||||
const uint8_t transmission_mode,
|
||||
const uint8_t Transaction_id,
|
||||
const uint8_t transmission_mode,
|
||||
const uint8_t Transaction_id,
|
||||
const LTE_DL_FRAME_PARMS* const frame_parms,
|
||||
SRB_ToAddModList_t **SRB_configList,
|
||||
struct PhysicalConfigDedicated **physicalConfigDedicated)
|
||||
@@ -1399,6 +1277,7 @@ do_RRCConnectionSetup(
|
||||
|
||||
asn_enc_rval_t enc_rval;
|
||||
uint8_t ecause=0;
|
||||
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
|
||||
|
||||
long* logicalchannelgroup = NULL;
|
||||
struct SRB_ToAddMod* SRB1_config = NULL;
|
||||
@@ -1442,12 +1321,12 @@ do_RRCConnectionSetup(
|
||||
SRB1_rlc_config->present = SRB_ToAddMod__rlc_Config_PR_explicitValue;
|
||||
SRB1_rlc_config->choice.explicitValue.present=RLC_Config_PR_am;
|
||||
#if defined(ENABLE_ITTI)
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = enb_properties.properties[ctxt_pP->module_id]->srb1_timer_poll_retransmit;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = enb_properties.properties[ctxt_pP->module_id]->srb1_poll_pdu;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollByte = enb_properties.properties[ctxt_pP->module_id]->srb1_poll_byte;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.maxRetxThreshold = enb_properties.properties[ctxt_pP->module_id]->srb1_max_retx_threshold;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_Reordering = enb_properties.properties[ctxt_pP->module_id]->srb1_timer_reordering;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_StatusProhibit = enb_properties.properties[ctxt_pP->module_id]->srb1_timer_status_prohibit;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = rrc->srb1_timer_poll_retransmit;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = rrc->srb1_poll_pdu;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollByte = rrc->srb1_poll_byte;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.maxRetxThreshold = rrc->srb1_max_retx_threshold;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_Reordering = rrc->srb1_timer_reordering;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_StatusProhibit = rrc->srb1_timer_status_prohibit;
|
||||
#else
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = T_PollRetransmit_ms20;;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = PollPDU_p4;;
|
||||
@@ -1493,7 +1372,7 @@ do_RRCConnectionSetup(
|
||||
physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH = CALLOC(1,sizeof(*physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH));
|
||||
physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH = CALLOC(1,sizeof(*physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH));
|
||||
physicalConfigDedicated2->cqi_ReportConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig));
|
||||
if (enb_properties.properties[ctxt_pP->module_id]->srs_enable[CC_id])
|
||||
if (rrc->srs_enable[CC_id])
|
||||
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->soundingRS_UL_ConfigDedicated));
|
||||
else
|
||||
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = NULL;
|
||||
@@ -1582,7 +1461,7 @@ do_RRCConnectionSetup(
|
||||
*/
|
||||
|
||||
//soundingRS-UL-ConfigDedicated
|
||||
if (enb_properties.properties[ctxt_pP->module_id]->srs_enable[CC_id]) {
|
||||
if (rrc->srs_enable[CC_id]) {
|
||||
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->present = SoundingRS_UL_ConfigDedicated_PR_setup;
|
||||
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth =
|
||||
SoundingRS_UL_ConfigDedicated__setup__srs_Bandwidth_bw0;
|
||||
@@ -2759,36 +2638,3 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
|
||||
return(&UECapability);
|
||||
}
|
||||
|
||||
#ifndef USER_MODE
|
||||
int init_module(void)
|
||||
{
|
||||
printk("Init asn1_msg module\n");
|
||||
|
||||
// A non 0 return means init_module failed; module can't be loaded.
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void cleanup_module(void)
|
||||
{
|
||||
printk("Stopping asn1_msg module\n");
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(do_SIB1);
|
||||
EXPORT_SYMBOL(do_SIB23);
|
||||
EXPORT_SYMBOL(do_RRCConnectionRequest);
|
||||
EXPORT_SYMBOL(do_RRCConnectionSetupComplete);
|
||||
EXPORT_SYMBOL(do_RRCConnectionReconfigurationComplete);
|
||||
EXPORT_SYMBOL(do_RRCConnectionSetup);
|
||||
EXPORT_SYMBOL(do_RRCConnectionReestablishmentReject);
|
||||
EXPORT_SYMBOL(do_RRCConnectionReconfiguration);
|
||||
EXPORT_SYMBOL(asn_DEF_UL_DCCH_Message);
|
||||
EXPORT_SYMBOL(asn_DEF_UL_CCCH_Message);
|
||||
EXPORT_SYMBOL(asn_DEF_SystemInformation);
|
||||
EXPORT_SYMBOL(asn_DEF_DL_DCCH_Message);
|
||||
EXPORT_SYMBOL(asn_DEF_SystemInformationBlockType1);
|
||||
EXPORT_SYMBOL(asn_DEF_DL_CCCH_Message);
|
||||
EXPORT_SYMBOL(uper_decode_complete);
|
||||
EXPORT_SYMBOL(uper_decode);
|
||||
EXPORT_SYMBOL(transmission_mode_rrc);
|
||||
#endif
|
||||
|
||||
@@ -60,19 +60,24 @@ uint16_t get_adjacent_cell_id(uint8_t Mod_id,uint8_t index);
|
||||
uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId);
|
||||
|
||||
/**
|
||||
\brief Generate a default configuration for SIB1 (eNB).
|
||||
@param frame_parms Used to store some basic parameters from PHY configuration
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of SIB1
|
||||
@param sib1 Pointer to asn1c C representation of SIB1
|
||||
\brief Generate configuration for SIB1 (eNB).
|
||||
@param carrier pointer to Carrier information
|
||||
@param N_RB_DL Number of downlink PRBs
|
||||
@param phich_Resource PHICH resoure parameter
|
||||
@param phich_duration PHICH duration parameter
|
||||
@param frame radio frame number
|
||||
@return size of encoded bit stream in bytes*/
|
||||
uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich_Resource, uint32_t phich_duration, uint32_t frame);
|
||||
|
||||
/**
|
||||
\brief Generate configuration for SIB1 (eNB).
|
||||
@param carrier pointer to Carrier information
|
||||
@param Mod_id Instance of eNB
|
||||
@param Component carrier Component carrier to configure
|
||||
@param configuration Pointer Configuration Request structure
|
||||
@return size of encoded bit stream in bytes*/
|
||||
|
||||
uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
|
||||
LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer,
|
||||
BCCH_DL_SCH_Message_t *bcch_message,
|
||||
SystemInformationBlockType1_t **sib1
|
||||
#if defined(ENABLE_ITTI)
|
||||
, RrcConfigurationReq *configuration
|
||||
#endif
|
||||
uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,int Mod_id,int CC_id, RrcConfigurationReq *configuration
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -87,17 +92,7 @@ uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
|
||||
@return size of encoded bit stream in bytes*/
|
||||
|
||||
uint8_t do_SIB23(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t *buffer,
|
||||
BCCH_DL_SCH_Message_t *systemInformation,
|
||||
SystemInformationBlockType2_t **sib2,
|
||||
SystemInformationBlockType3_t **sib3
|
||||
#ifdef Rel10
|
||||
,
|
||||
SystemInformationBlockType13_r9_t **sib13,
|
||||
uint8_t MBMS_flag
|
||||
#endif
|
||||
int CC_id
|
||||
#if defined(ENABLE_ITTI)
|
||||
, RrcConfigurationReq *configuration
|
||||
#endif
|
||||
|
||||
@@ -388,11 +388,17 @@ typedef struct rrc_eNB_ue_context_s {
|
||||
} rrc_eNB_ue_context_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t *MIB;
|
||||
uint8_t sizeof_MIB;
|
||||
uint8_t *SIB1;
|
||||
uint8_t sizeof_SIB1;
|
||||
uint8_t *SIB23;
|
||||
uint8_t sizeof_SIB23;
|
||||
uint16_t physCellId;
|
||||
int physCellId;
|
||||
int Ncp;
|
||||
int p_eNB;
|
||||
uint32_t dl_CarrierFreq;
|
||||
uint32_t ul_CarrierFreq;
|
||||
BCCH_BCH_Message_t mib;
|
||||
BCCH_DL_SCH_Message_t siblock1;
|
||||
BCCH_DL_SCH_Message_t systemInformation;
|
||||
@@ -445,6 +451,22 @@ typedef struct eNB_RRC_INST_s {
|
||||
#if defined(ENABLE_ITTI)
|
||||
RrcConfigurationReq configuration;
|
||||
#endif
|
||||
// other PLMN parameters
|
||||
/// Mobile country code
|
||||
int mcc;
|
||||
/// Mobile network code
|
||||
int mnc;
|
||||
/// number of mnc digits
|
||||
int mnc_digit_length;
|
||||
|
||||
// other RAN parameters
|
||||
int srb1_timer_poll_retransmit;
|
||||
int srb1_poll_pdu;
|
||||
int srb1_poll_byte;
|
||||
int srb1_max_retx_threshold;
|
||||
int srb1_timer_reordering;
|
||||
int srb1_timer_status_prohibit;
|
||||
int srs_enable[MAX_NUM_CCs];
|
||||
} eNB_RRC_INST;
|
||||
|
||||
#define MAX_UE_CAPABILITY_SIZE 255
|
||||
|
||||
@@ -37,27 +37,8 @@
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
|
||||
extern UE_RRC_INST *UE_rrc_inst;
|
||||
extern eNB_RRC_INST *eNB_rrc_inst;
|
||||
//extern RRC_XFACE *Rrc_xface;
|
||||
#ifndef USER_MODE
|
||||
//extern MAC_RLC_XFACE *Mac_rlc_xface;
|
||||
extern int S_rrc;
|
||||
//extern int R_rrc;
|
||||
#else
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#ifndef NO_RRM
|
||||
extern sock_rrm_t S_rrc;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NO_RRM
|
||||
#ifndef USER_MODE
|
||||
extern char *Header_buf;
|
||||
extern char *Data;
|
||||
extern unsigned short Header_read_idx,Data_read_idx,Header_size;
|
||||
#endif
|
||||
extern unsigned short Data_to_read;
|
||||
#endif //NO_RRM
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
|
||||
extern uint8_t DRB2LCHAN[8];
|
||||
|
||||
|
||||
@@ -461,4 +461,5 @@ long binary_search_int(int elements[], long numElem, int value);
|
||||
|
||||
long binary_search_float(float elements[], long numElem, float value);
|
||||
|
||||
void openair_rrc_top_init_eNB(int eMBMS_active,uint8_t HO_active);
|
||||
/** @}*/
|
||||
|
||||
+295
-234
@@ -818,38 +818,38 @@ rrc_ue_process_measConfig(
|
||||
}
|
||||
|
||||
LOG_I(RRC,"call rrc_mac_config_req \n");
|
||||
rrc_mac_config_req(ctxt_pP->module_id,0,ENB_FLAG_NO,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
rrc_mac_config_req_ue(ctxt_pP->module_id,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
#ifdef Rel10
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
#endif
|
||||
UE_rrc_inst[ctxt_pP->module_id].MeasObj[eNB_index],
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
(TDD_Config_t *)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
UE_rrc_inst[ctxt_pP->module_id].MeasObj[eNB_index],
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
(TDD_Config_t *)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
#ifdef Rel10
|
||||
,
|
||||
0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
,
|
||||
0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,
|
||||
0,
|
||||
0
|
||||
,
|
||||
0,
|
||||
0
|
||||
#endif
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
if (measConfig->reportConfigToRemoveList != NULL) {
|
||||
@@ -1305,38 +1305,38 @@ rrc_ue_process_radioResourceConfigDedicated(
|
||||
|
||||
LOG_I(RRC, "[FRAME %05d][RRC_UE][MOD %02d][][--- MAC_CONFIG_REQ (SRB1 eNB %d) --->][MAC_UE][MOD %02d][]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id);
|
||||
rrc_mac_config_req(ctxt_pP->module_id,0,ENB_FLAG_NO,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
|
||||
rrc_mac_config_req_ue(ctxt_pP->module_id,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
|
||||
#ifdef Rel10
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
#endif
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
|
||||
1,
|
||||
SRB1_logicalChannelConfig,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
|
||||
1,
|
||||
SRB1_logicalChannelConfig,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
#ifdef Rel10
|
||||
,
|
||||
0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
,
|
||||
0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,
|
||||
0,
|
||||
0
|
||||
,
|
||||
0,
|
||||
0
|
||||
#endif
|
||||
);
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (UE_rrc_inst[ctxt_pP->module_id].SRB2_config[eNB_index]) {
|
||||
@@ -1363,38 +1363,38 @@ rrc_ue_process_radioResourceConfigDedicated(
|
||||
ctxt_pP->module_id,
|
||||
eNB_index,
|
||||
ctxt_pP->module_id);
|
||||
rrc_mac_config_req(ctxt_pP->module_id,0,ENB_FLAG_NO,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
|
||||
rrc_mac_config_req_ue(ctxt_pP->module_id,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
|
||||
#ifdef Rel10
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
#endif
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
|
||||
2,
|
||||
SRB2_logicalChannelConfig,
|
||||
UE_rrc_inst[ctxt_pP->module_id].measGapConfig[eNB_index],
|
||||
(TDD_Config_t *)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
|
||||
2,
|
||||
SRB2_logicalChannelConfig,
|
||||
UE_rrc_inst[ctxt_pP->module_id].measGapConfig[eNB_index],
|
||||
(TDD_Config_t *)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
#ifdef Rel10
|
||||
,
|
||||
0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
,
|
||||
0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,
|
||||
0,
|
||||
0
|
||||
,
|
||||
0,
|
||||
0
|
||||
#endif
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1470,43 +1470,43 @@ rrc_ue_process_radioResourceConfigDedicated(
|
||||
radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity,
|
||||
eNB_index,
|
||||
ctxt_pP->module_id);
|
||||
rrc_mac_config_req(ctxt_pP->module_id,0,ENB_FLAG_NO,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
|
||||
rrc_mac_config_req_ue(ctxt_pP->module_id,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
|
||||
#ifdef Rel10
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
|
||||
#endif
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
|
||||
*UE_rrc_inst[ctxt_pP->module_id].DRB_config[eNB_index][DRB_id]->logicalChannelIdentity,
|
||||
UE_rrc_inst[ctxt_pP->module_id].DRB_config[eNB_index][DRB_id]->logicalChannelConfig,
|
||||
UE_rrc_inst[ctxt_pP->module_id].measGapConfig[eNB_index],
|
||||
(TDD_Config_t*)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
|
||||
*UE_rrc_inst[ctxt_pP->module_id].DRB_config[eNB_index][DRB_id]->logicalChannelIdentity,
|
||||
UE_rrc_inst[ctxt_pP->module_id].DRB_config[eNB_index][DRB_id]->logicalChannelConfig,
|
||||
UE_rrc_inst[ctxt_pP->module_id].measGapConfig[eNB_index],
|
||||
(TDD_Config_t*)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
#ifdef Rel10
|
||||
,
|
||||
0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
,
|
||||
0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,
|
||||
UE_rrc_inst[ue_mod_idP].num_active_cba_groups, //
|
||||
UE_rrc_inst[ue_mod_idP].cba_rnti[0]
|
||||
,
|
||||
UE_rrc_inst[ue_mod_idP].num_active_cba_groups, //
|
||||
UE_rrc_inst[ue_mod_idP].cba_rnti[0]
|
||||
#endif
|
||||
);
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State = RRC_CONNECTED;
|
||||
LOG_I(RRC,"[UE %d] State = RRC_CONNECTED (eNB %d)\n",ctxt_pP->module_id,eNB_index);
|
||||
#if !defined(ENABLE_USE_MME) && defined(OAI_EMU)
|
||||
@@ -2028,41 +2028,39 @@ rrc_ue_process_mobilityControlInfo(
|
||||
ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id);
|
||||
|
||||
// Reset MAC and configure PHY
|
||||
rrc_mac_config_req(ctxt_pP->module_id,
|
||||
0,
|
||||
ENB_FLAG_NO,
|
||||
0,
|
||||
eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
rrc_mac_config_req_ue(ctxt_pP->module_id,
|
||||
0,
|
||||
eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
#ifdef Rel10
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
|
||||
#endif
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
(TDD_Config_t *)NULL,
|
||||
mobilityControlInfo,
|
||||
(uint8_t *)NULL,
|
||||
(uint16_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
(TDD_Config_t *)NULL,
|
||||
mobilityControlInfo,
|
||||
(uint8_t *)NULL,
|
||||
(uint16_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
#ifdef Rel10
|
||||
,0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
,0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,0,
|
||||
0
|
||||
,0,
|
||||
0
|
||||
#endif
|
||||
);
|
||||
|
||||
);
|
||||
|
||||
// Re-establish PDCP for all RBs that are established
|
||||
// rrc_pdcp_config_req (ue_mod_idP+NB_eNB_INST, frameP, 0, CONFIG_ACTION_ADD, ue_mod_idP+DCCH);
|
||||
// rrc_pdcp_config_req (ue_mod_idP+NB_eNB_INST, frameP, 0, CONFIG_ACTION_ADD, ue_mod_idP+DCCH1);
|
||||
@@ -2886,38 +2884,38 @@ static int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
|
||||
LOG_I( RRC, "[FRAME unknown][RRC_UE][MOD %02"PRIu8"][][--- MAC_CONFIG_REQ (SIB1 params eNB %"PRIu8") --->][MAC_UE][MOD %02"PRIu8"][]\n",
|
||||
ctxt_pP->module_id, eNB_index, ctxt_pP->module_id );
|
||||
|
||||
rrc_mac_config_req(ctxt_pP->module_id, 0, ENB_FLAG_NO, 0, eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
rrc_mac_config_req_ue(ctxt_pP->module_id, 0, eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
#ifdef Rel10
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
|
||||
#endif
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->tdd_Config,
|
||||
(MobilityControlInfo_t *) NULL,
|
||||
&UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIwindowsize,
|
||||
&UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIperiod,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(MBSFN_SubframeConfigList_t *)NULL
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->tdd_Config,
|
||||
(MobilityControlInfo_t *) NULL,
|
||||
&UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIwindowsize,
|
||||
&UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIperiod,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(MBSFN_SubframeConfigList_t *)NULL
|
||||
#ifdef Rel10
|
||||
,0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
,0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,
|
||||
0,
|
||||
0
|
||||
,
|
||||
0,
|
||||
0
|
||||
#endif
|
||||
);
|
||||
|
||||
);
|
||||
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus = 1;
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIB1systemInfoValueTag = sib1->systemInfoValueTag;
|
||||
|
||||
@@ -3522,35 +3520,35 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in
|
||||
dump_sib2( UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index] );
|
||||
LOG_I( RRC, "[FRAME %05"PRIu32"][RRC_UE][MOD %02"PRIu8"][][--- MAC_CONFIG_REQ (SIB2 params eNB %"PRIu8") --->][MAC_UE][MOD %02"PRIu8"][]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id );
|
||||
rrc_mac_config_req(ctxt_pP->module_id, 0, ENB_FLAG_NO, 0, eNB_index,
|
||||
&UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->radioResourceConfigCommon,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
rrc_mac_config_req_ue(ctxt_pP->module_id, 0, eNB_index,
|
||||
&UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->radioResourceConfigCommon,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
#ifdef Rel10
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
#endif
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
(TDD_Config_t *)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.ul_CarrierFreq,
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.ul_Bandwidth,
|
||||
&UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.additionalSpectrumEmission,
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->mbsfn_SubframeConfigList
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
(TDD_Config_t *)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.ul_CarrierFreq,
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.ul_Bandwidth,
|
||||
&UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.additionalSpectrumEmission,
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->mbsfn_SubframeConfigList
|
||||
#ifdef Rel10
|
||||
,0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
,0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,0,
|
||||
0
|
||||
,0,
|
||||
0
|
||||
#endif
|
||||
);
|
||||
);
|
||||
// After SI is received, prepare RRCConnectionRequest
|
||||
#ifdef Rel10
|
||||
|
||||
@@ -3705,31 +3703,31 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in
|
||||
// adding here function to store necessary parameters for using in decode_MCCH_Message + maybe transfer to PHY layer
|
||||
LOG_I( RRC, "[FRAME %05"PRIu32"][RRC_UE][MOD %02"PRIu8"][][--- MAC_CONFIG_REQ (SIB13 params eNB %"PRIu8") --->][MAC_UE][MOD %02"PRIu8"][]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id);
|
||||
rrc_mac_config_req(ctxt_pP->module_id,0,ENB_FLAG_NO,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
(TDD_Config_t *)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(MBSFN_SubframeConfigList_t *)NULL,
|
||||
0,
|
||||
&UE_rrc_inst[ctxt_pP->module_id].sib13[eNB_index]->mbsfn_AreaInfoList_r9,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
rrc_mac_config_req_ue(ctxt_pP->module_id,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
(TDD_Config_t *)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(MBSFN_SubframeConfigList_t *)NULL,
|
||||
0,
|
||||
&UE_rrc_inst[ctxt_pP->module_id].sib13[eNB_index]->mbsfn_AreaInfoList_r9,
|
||||
(PMCH_InfoList_r9_t *)NULL
|
||||
#ifdef CBA
|
||||
,0,
|
||||
0
|
||||
,0,
|
||||
0
|
||||
#endif
|
||||
);
|
||||
);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
@@ -4163,39 +4161,39 @@ static void decode_MBSFNAreaConfiguration( module_id_t ue_mod_idP, uint8_t eNB_i
|
||||
LOG_I(RRC,"[UE %d] Frame %d : Number of MCH(s) in the MBSFN Sync Area %d is %d\n",
|
||||
ue_mod_idP, frameP, mbsfn_sync_area, UE_rrc_inst[ue_mod_idP].mcch_message[eNB_index]->pmch_InfoList_r9.list.count);
|
||||
// store to MAC/PHY necessary parameters for receiving MTCHs
|
||||
rrc_mac_config_req(ue_mod_idP,0,ENB_FLAG_NO,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
rrc_mac_config_req_ue(ue_mod_idP,0,eNB_index,
|
||||
(RadioResourceConfigCommonSIB_t *)NULL,
|
||||
(struct PhysicalConfigDedicated *)NULL,
|
||||
#ifdef Rel10
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
|
||||
(SCellToAddMod_r10_t *)NULL,
|
||||
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
|
||||
#endif
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
(TDD_Config_t *)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(MBSFN_SubframeConfigList_t *)NULL
|
||||
(MeasObjectToAddMod_t **)NULL,
|
||||
(MAC_MainConfig_t *)NULL,
|
||||
0,
|
||||
(struct LogicalChannelConfig *)NULL,
|
||||
(MeasGapConfig_t *)NULL,
|
||||
(TDD_Config_t *)NULL,
|
||||
(MobilityControlInfo_t *)NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(MBSFN_SubframeConfigList_t *)NULL
|
||||
#ifdef Rel10
|
||||
,
|
||||
0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
&UE_rrc_inst[ue_mod_idP].mcch_message[eNB_index]->pmch_InfoList_r9
|
||||
,
|
||||
0,
|
||||
(MBSFN_AreaInfoList_r9_t *)NULL,
|
||||
&UE_rrc_inst[ue_mod_idP].mcch_message[eNB_index]->pmch_InfoList_r9
|
||||
#endif
|
||||
#ifdef CBA
|
||||
,
|
||||
0,
|
||||
0
|
||||
,
|
||||
0,
|
||||
0
|
||||
#endif
|
||||
);
|
||||
|
||||
);
|
||||
|
||||
UE_rrc_inst[ue_mod_idP].Info[eNB_index].MCCHStatus[mbsfn_sync_area] = 1;
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_idP, ENB_FLAG_NO, UE_rrc_inst[ue_mod_idP].Info[eNB_index].rnti, frameP, 0,eNB_index);
|
||||
@@ -4713,3 +4711,66 @@ void *rrc_ue_task( void *args_p )
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
void
|
||||
openair_rrc_top_init_ue(
|
||||
int eMBMS_active,
|
||||
char* uecap_xer,
|
||||
uint8_t cba_group_active,
|
||||
uint8_t HO_active
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
module_id_t module_id;
|
||||
OAI_UECapability_t *UECap = NULL;
|
||||
int CC_id;
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)CC_id;
|
||||
|
||||
LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_UE_INST=%d, NB_eNB_INST=%d\n", NB_UE_INST, NB_eNB_INST);
|
||||
|
||||
if (NB_UE_INST > 0) {
|
||||
UE_rrc_inst = (UE_RRC_INST*) malloc16(NB_UE_INST*sizeof(UE_RRC_INST));
|
||||
memset (UE_rrc_inst, 0, NB_UE_INST * sizeof(UE_RRC_INST));
|
||||
LOG_D(RRC, "ALLOCATE %d Bytes for UE_RRC_INST @ %p\n", (unsigned int)(NB_UE_INST*sizeof(UE_RRC_INST)), UE_rrc_inst);
|
||||
|
||||
// fill UE capability
|
||||
UECap = fill_ue_capability (uecap_xer);
|
||||
|
||||
for (module_id = 0; module_id < NB_UE_INST; module_id++) {
|
||||
UE_rrc_inst[module_id].UECap = UECap;
|
||||
UE_rrc_inst[module_id].UECapability = UECap->sdu;
|
||||
UE_rrc_inst[module_id].UECapability_size = UECap->sdu_size;
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
LOG_I(RRC,"[UE] eMBMS active state is %d \n", eMBMS_active);
|
||||
|
||||
for (module_id=0; module_id<NB_UE_INST; module_id++) {
|
||||
UE_rrc_inst[module_id].MBMS_flag = (uint8_t)eMBMS_active;
|
||||
}
|
||||
|
||||
#endif
|
||||
} else {
|
||||
UE_rrc_inst = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_top_cleanup_ue(
|
||||
void
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
if (NB_UE_INST > 0) free (UE_rrc_inst);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+13
-135
@@ -41,13 +41,14 @@
|
||||
#include "pdcp.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#ifdef LOCALIZATION
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define DEBUG_RRC 1
|
||||
extern eNB_MAC_INST *eNB_mac_inst;
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern UE_MAC_INST *UE_mac_inst;
|
||||
|
||||
extern mui_t rrc_eNB_mui;
|
||||
@@ -67,10 +68,10 @@ openair_rrc_on(
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n",
|
||||
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
rrc_config_buffer (&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SI, BCCH, 1);
|
||||
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SI.Active = 1;
|
||||
rrc_config_buffer (&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0, CCCH, 1);
|
||||
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Active = 1;
|
||||
rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
|
||||
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI.Active = 1;
|
||||
rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1);
|
||||
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1;
|
||||
}
|
||||
} else {
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n",
|
||||
@@ -231,130 +232,7 @@ rrc_config_buffer(
|
||||
Srb_info->Tx_buffer.payload_size = 0;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
void
|
||||
openair_rrc_top_init(
|
||||
int eMBMS_active,
|
||||
char* uecap_xer,
|
||||
uint8_t cba_group_active,
|
||||
uint8_t HO_active
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
module_id_t module_id;
|
||||
OAI_UECapability_t *UECap = NULL;
|
||||
int CC_id;
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)CC_id;
|
||||
|
||||
LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_UE_INST=%d, NB_eNB_INST=%d\n", NB_UE_INST, NB_eNB_INST);
|
||||
|
||||
if (NB_UE_INST > 0) {
|
||||
UE_rrc_inst = (UE_RRC_INST*) malloc16(NB_UE_INST*sizeof(UE_RRC_INST));
|
||||
memset (UE_rrc_inst, 0, NB_UE_INST * sizeof(UE_RRC_INST));
|
||||
LOG_D(RRC, "ALLOCATE %d Bytes for UE_RRC_INST @ %p\n", (unsigned int)(NB_UE_INST*sizeof(UE_RRC_INST)), UE_rrc_inst);
|
||||
|
||||
// fill UE capability
|
||||
UECap = fill_ue_capability (uecap_xer);
|
||||
|
||||
for (module_id = 0; module_id < NB_UE_INST; module_id++) {
|
||||
UE_rrc_inst[module_id].UECap = UECap;
|
||||
UE_rrc_inst[module_id].UECapability = UECap->sdu;
|
||||
UE_rrc_inst[module_id].UECapability_size = UECap->sdu_size;
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
LOG_I(RRC,"[UE] eMBMS active state is %d \n", eMBMS_active);
|
||||
|
||||
for (module_id=0; module_id<NB_UE_INST; module_id++) {
|
||||
UE_rrc_inst[module_id].MBMS_flag = (uint8_t)eMBMS_active;
|
||||
}
|
||||
|
||||
#endif
|
||||
} else {
|
||||
UE_rrc_inst = NULL;
|
||||
}
|
||||
|
||||
if (NB_eNB_INST > 0) {
|
||||
eNB_rrc_inst = (eNB_RRC_INST*) malloc16(NB_eNB_INST*sizeof(eNB_RRC_INST));
|
||||
memset (eNB_rrc_inst, 0, NB_eNB_INST * sizeof(eNB_RRC_INST));
|
||||
LOG_I(RRC,"[eNB] handover active state is %d \n", HO_active);
|
||||
|
||||
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
|
||||
eNB_rrc_inst[module_id].HO_flag = (uint8_t)HO_active;
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
LOG_I(RRC,"[eNB] eMBMS active state is %d \n", eMBMS_active);
|
||||
|
||||
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
eNB_rrc_inst[module_id].carrier[CC_id].MBMS_flag = (uint8_t)eMBMS_active;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef CBA
|
||||
|
||||
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
eNB_rrc_inst[module_id].carrier[CC_id].num_active_cba_groups = cba_group_active;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef LOCALIZATION
|
||||
/* later set this from xml or enb.config file*/
|
||||
struct timeval ts; // time struct
|
||||
gettimeofday(&ts, NULL); // get the current epoch timestamp
|
||||
|
||||
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
|
||||
eNB_rrc_inst[module_id].reference_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
|
||||
initialize(&eNB_rrc_inst[module_id].loc_list);
|
||||
eNB_rrc_inst[module_id].loc_type=0;
|
||||
eNB_rrc_inst[module_id].aggregation_period_ms = 5000;
|
||||
}
|
||||
|
||||
#endif
|
||||
LOG_D(RRC,
|
||||
"ALLOCATE %d Bytes for eNB_RRC_INST @ %p\n", (unsigned int)(NB_eNB_INST*sizeof(eNB_RRC_INST)), eNB_rrc_inst);
|
||||
} else {
|
||||
eNB_rrc_inst = NULL;
|
||||
}
|
||||
|
||||
#ifndef NO_RRM
|
||||
#ifndef USER_MODE
|
||||
|
||||
Header_buf=(char*)malloc16(sizeof(msg_head_t));
|
||||
Data=(char*)malloc16(2400);
|
||||
Header_read_idx=0;
|
||||
Data_read_idx=0;
|
||||
Header_size=sizeof(msg_head_t);
|
||||
|
||||
#endif //NO_RRM
|
||||
Data_to_read = 0;
|
||||
#endif //USER_MODE
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_top_cleanup(
|
||||
void
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
if (NB_UE_INST > 0) {
|
||||
free (UE_rrc_inst);
|
||||
}
|
||||
|
||||
if (NB_eNB_INST > 0) {
|
||||
free (eNB_rrc_inst);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -517,7 +395,7 @@ rrc_rx_tx(
|
||||
// counetr, and get the value and aggregate
|
||||
|
||||
// check for UL failure
|
||||
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) {
|
||||
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[ctxt_pP->module_id]->rrc_ue_head)) {
|
||||
if ((ctxt_pP->frame == 0) && (ctxt_pP->subframe==0)) {
|
||||
if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == TRUE) {
|
||||
LOG_I(RRC,"UE rnti %x:S-TMSI %x failure timer %d/20000\n",
|
||||
@@ -558,16 +436,16 @@ rrc_rx_tx(
|
||||
/* for the localization, only primary CC_id might be relevant*/
|
||||
gettimeofday(&ts, NULL);
|
||||
current_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
|
||||
ref_timestamp_ms = eNB_rrc_inst[ctxt_pP->module_id].reference_timestamp_ms;
|
||||
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) {
|
||||
ref_timestamp_ms = RC.rrc[ctxt_pP->module_id]->reference_timestamp_ms;
|
||||
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[ctxt_pP->module_id]->rrc_ue_head)) {
|
||||
ctxt = *ctxt_pP;
|
||||
ctxt.rnti = ue_context_p->ue_context.rnti;
|
||||
estimated_distance = rrc_get_estimated_ue_distance(
|
||||
&ctxt,
|
||||
CC_id,
|
||||
eNB_rrc_inst[ctxt_pP->module_id].loc_type);
|
||||
RC.rrc[ctxt_pP->module_id]->loc_type);
|
||||
|
||||
if ((current_timestamp_ms - ref_timestamp_ms > eNB_rrc_inst[ctxt_pP->module_id].aggregation_period_ms) &&
|
||||
if ((current_timestamp_ms - ref_timestamp_ms > RC.rrc[ctxt_pP->module_id]->aggregation_period_ms) &&
|
||||
estimated_distance != -1) {
|
||||
LOG_D(LOCALIZE, " RRC [UE/id %d -> eNB/id %d] timestamp %d frame %d estimated r = %f\n",
|
||||
ctxt.rnti,
|
||||
@@ -576,9 +454,9 @@ rrc_rx_tx(
|
||||
ctxt_pP->frame,
|
||||
estimated_distance);
|
||||
LOG_D(LOCALIZE, " RRC status %d\n", ue_context_p->ue_context.Status);
|
||||
push_front(&eNB_rrc_inst[ctxt_pP->module_id].loc_list,
|
||||
push_front(&RC.rrc[ctxt_pP->module_id]->loc_list,
|
||||
estimated_distance);
|
||||
eNB_rrc_inst[ctxt_pP->module_id].reference_timestamp_ms = current_timestamp_ms;
|
||||
RC.rrc[ctxt_pP->module_id]->reference_timestamp_ms = current_timestamp_ms;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+399
-429
File diff suppressed because it is too large
Load Diff
@@ -40,6 +40,10 @@
|
||||
# include "intertask_interface.h"
|
||||
# endif
|
||||
|
||||
# include "common/ran_context.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
int
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
@@ -57,7 +61,7 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
|
||||
rnti = create_tunnel_resp_pP->rnti;
|
||||
ue_context_p = rrc_eNB_get_ue_context(
|
||||
&eNB_rrc_inst[ctxt_pP->module_id],
|
||||
RC.rrc[ctxt_pP->module_id],
|
||||
ctxt_pP->rnti);
|
||||
|
||||
for (i = 0; i < create_tunnel_resp_pP->num_tunnels; i++) {
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
# include "rrc_eNB_UE_context.h"
|
||||
# include "rrc_eNB_S1AP.h"
|
||||
# include "enb_config.h"
|
||||
# include "common/ran_context.h"
|
||||
|
||||
# if defined(ENABLE_ITTI)
|
||||
# include "asn1_conversions.h"
|
||||
@@ -58,6 +59,8 @@
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#include "RRC/LITE/rrc_eNB_GTPV1U.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
/* Value to indicate an invalid UE initial id */
|
||||
static const uint16_t UE_INITIAL_ID_INVALID = 0;
|
||||
|
||||
@@ -116,7 +119,7 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
result2);
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
LOG_E(S1AP, "[eNB %ld] Error while hashtable_insert in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32"\n",
|
||||
rrc_instance_pP - eNB_rrc_inst, eNB_ue_s1ap_id);
|
||||
rrc_instance_pP - RC.rrc[0], eNB_ue_s1ap_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,14 +212,14 @@ rrc_eNB_get_ue_context_from_s1ap_ids(
|
||||
rrc_ue_s1ap_ids_t* temp = NULL;
|
||||
temp =
|
||||
rrc_eNB_S1AP_get_ue_ids(
|
||||
&eNB_rrc_inst[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
|
||||
RC.rrc[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
|
||||
ue_initial_idP,
|
||||
eNB_ue_s1ap_idP);
|
||||
|
||||
if (temp) {
|
||||
|
||||
return rrc_eNB_get_ue_context(
|
||||
&eNB_rrc_inst[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
|
||||
RC.rrc[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
|
||||
temp->ue_rnti);
|
||||
}
|
||||
|
||||
@@ -627,7 +630,10 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
RRCConnectionSetupComplete_r8_IEs_t* rrcConnectionSetupComplete
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
{
|
||||
eNB_RRC_INST *rrc=RC.rrc[ctxt_pP->module_id];
|
||||
#if defined(ENABLE_ITTI)
|
||||
{
|
||||
MessageDef* message_p = NULL;
|
||||
@@ -645,7 +651,7 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
rrc_ue_s1ap_ids_p->eNB_ue_s1ap_id = UE_INITIAL_ID_INVALID;
|
||||
rrc_ue_s1ap_ids_p->ue_rnti = ctxt_pP->rnti;
|
||||
|
||||
h_rc = hashtable_insert(eNB_rrc_inst[ctxt_pP->module_id].initial_id2_s1ap_ids,
|
||||
h_rc = hashtable_insert(RC.rrc[ctxt_pP->module_id]->initial_id2_s1ap_ids,
|
||||
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
|
||||
rrc_ue_s1ap_ids_p);
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
@@ -708,13 +714,13 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
ue_context_pP->ue_context.rnti);
|
||||
}
|
||||
} else {
|
||||
const Enb_properties_array_t *enb_properties_p = NULL;
|
||||
enb_properties_p = enb_config_get();
|
||||
// const Enb_properties_array_t *enb_properties_p = NULL;
|
||||
// enb_properties_p = enb_config_get();
|
||||
|
||||
// actually the eNB configuration contains only one PLMN (can be up to 6)
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = enb_properties_p->properties[ctxt_pP->module_id]->mcc;
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc = enb_properties_p->properties[ctxt_pP->module_id]->mnc;
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len = enb_properties_p->properties[ctxt_pP->module_id]->mnc_digit_length;
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = rrc->mcc;
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc = rrc->mnc;
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len = rrc->mnc_digit_length;
|
||||
}
|
||||
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code = BIT_STRING_to_uint8 (&r_mme->mmec);
|
||||
@@ -1172,13 +1178,13 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
|
||||
itti_send_msg_to_task(TASK_S1AP, instance, msg_complete_p);
|
||||
|
||||
rrc_ue_s1ap_ids = rrc_eNB_S1AP_get_ue_ids(
|
||||
&eNB_rrc_inst[instance],
|
||||
RC.rrc[instance],
|
||||
UE_INITIAL_ID_INVALID,
|
||||
eNB_ue_s1ap_id);
|
||||
|
||||
if (NULL != rrc_ue_s1ap_ids) {
|
||||
rrc_eNB_S1AP_remove_ue_ids(
|
||||
&eNB_rrc_inst[instance],
|
||||
RC.rrc[instance],
|
||||
rrc_ue_s1ap_ids);
|
||||
}
|
||||
return (-1);
|
||||
@@ -1236,13 +1242,13 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
|
||||
itti_send_msg_to_task(TASK_S1AP, instance, msg_complete_p);
|
||||
|
||||
rrc_ue_s1ap_ids = rrc_eNB_S1AP_get_ue_ids(
|
||||
&eNB_rrc_inst[instance],
|
||||
RC.rrc[instance],
|
||||
UE_INITIAL_ID_INVALID,
|
||||
eNB_ue_s1ap_id);
|
||||
|
||||
if (NULL != rrc_ue_s1ap_ids) {
|
||||
rrc_eNB_S1AP_remove_ue_ids(
|
||||
&eNB_rrc_inst[instance],
|
||||
RC.rrc[instance],
|
||||
rrc_ue_s1ap_ids);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,31 +36,8 @@
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
|
||||
eNB_RRC_INST *eNB_rrc_inst;
|
||||
UE_RRC_INST *UE_rrc_inst;
|
||||
//RRC_XFACE *Rrc_xface;
|
||||
#ifndef USER_MODE
|
||||
//MAC_RLC_XFACE *Mac_rlc_xface;
|
||||
#ifndef NO_RRM
|
||||
int S_rrc= RRC2RRM_FIFO;
|
||||
#endif //NO_RRM
|
||||
//int R_rrc= RRM2RRC_FIFO;
|
||||
#else
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#ifndef NO_RRM
|
||||
sock_rrm_t S_rrc;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NO_RRM
|
||||
#ifndef USER_MODE
|
||||
char *Header_buf;
|
||||
char *Data;
|
||||
unsigned short Header_read_idx,Data_read_idx,Header_size;
|
||||
#endif
|
||||
unsigned short Data_to_read;
|
||||
#endif //NO_RRM
|
||||
|
||||
#define MAX_U32 0xFFFFFFFF
|
||||
|
||||
uint8_t DRB2LCHAN[8];
|
||||
|
||||
@@ -178,7 +178,7 @@ free_mem_block (mem_block_t * leP, const char* caller)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
if (!(leP)) {
|
||||
msg ("[MEM_MNGT][FREE] WARNING FREE NULL MEM_BLOCK\n");
|
||||
LOG_W (RLC,"[MEM_MNGT][FREE] WARNING FREE NULL MEM_BLOCK\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ free_mem_block (mem_block_t * leP, const char* caller)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_MEM_MNGT_FREE
|
||||
msg ("[MEM_MNGT][FREE] free_mem_block() %p pool: %d\n", leP, leP->pool_id);
|
||||
LOG_D (RLC,"[MEM_MNGT][FREE] free_mem_block() %p pool: %d\n", leP, leP->pool_id);
|
||||
#endif
|
||||
#ifdef DEBUG_MEM_MNGT_ALLOC
|
||||
check_free_mem_block (leP);
|
||||
@@ -197,7 +197,7 @@ free_mem_block (mem_block_t * leP, const char* caller)
|
||||
list_add_tail_eurecom (leP, &mem_block_var.mem_lists[leP->pool_id]);
|
||||
#ifdef DEBUG_MEM_MNGT_ALLOC
|
||||
counters[leP->pool_id] -= 1;
|
||||
msg ("[%s][MEM_MNGT][INFO] after pool[%2d] freed: counters = {%2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d}\n",
|
||||
LGO_D (RLC,"[%s][MEM_MNGT][INFO] after pool[%2d] freed: counters = {%2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d}\n",
|
||||
caller, leP->pool_id,
|
||||
counters[0],counters[1],counters[2],counters[3],counters[4],
|
||||
counters[5],counters[6],counters[7],counters[8],counters[9],
|
||||
@@ -205,7 +205,7 @@ free_mem_block (mem_block_t * leP, const char* caller)
|
||||
#endif
|
||||
leP = NULL; // this prevent from freeing the block twice
|
||||
} else {
|
||||
msg ("[MEM_MNGT][FREE] ERROR free_mem_block() unknown pool_id : %d\n", leP->pool_id);
|
||||
LOG_E (RLC,"[MEM_MNGT][FREE] ERROR free_mem_block() unknown pool_id : %d\n", leP->pool_id);
|
||||
}
|
||||
|
||||
#ifdef MEMBLOCK_BIG_LOCK
|
||||
@@ -223,7 +223,7 @@ get_free_mem_block (uint32_t sizeP, const char* caller)
|
||||
int size;
|
||||
|
||||
if (sizeP > MEM_MNGT_MB12_BLOCK_SIZE) {
|
||||
msg ("[MEM_MNGT][ERROR][FATAL] size requested %d out of bounds\n", sizeP);
|
||||
LOG_E (RLC,"[MEM_MNGT][ERROR][FATAL] size requested %d out of bounds\n", sizeP);
|
||||
display_mem_load ();
|
||||
mac_xface->macphy_exit("[MEM_MNGT][ERROR][FATAL] get_free_mem_block size requested out of bounds");
|
||||
return NULL;
|
||||
@@ -247,7 +247,7 @@ get_free_mem_block (uint32_t sizeP, const char* caller)
|
||||
if ((le = list_remove_head (&mem_block_var.mem_lists[pool_selected]))) {
|
||||
#ifdef DEBUG_MEM_MNGT_ALLOC
|
||||
counters[pool_selected] += 1;
|
||||
msg ("[%s][MEM_MNGT][INFO] after pool[%2d] allocated: counters = {%2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d}\n",
|
||||
LOG_D (RLC,"[%s][MEM_MNGT][INFO] after pool[%2d] allocated: counters = {%2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d}\n",
|
||||
caller,
|
||||
pool_selected,
|
||||
counters[0],counters[1],counters[2],counters[3],counters[4],
|
||||
@@ -255,7 +255,7 @@ get_free_mem_block (uint32_t sizeP, const char* caller)
|
||||
counters[10],counters[11]);
|
||||
#endif
|
||||
#ifdef DEBUG_MEM_MNGT_ALLOC_SIZE
|
||||
msg ("[MEM_MNGT][INFO] ALLOC MEM_BLOCK SIZE %d bytes pool %d (%p)\n", sizeP, pool_selected,le);
|
||||
LOG_D (RLC,"[MEM_MNGT][INFO] ALLOC MEM_BLOCK SIZE %d bytes pool %d (%p)\n", sizeP, pool_selected,le);
|
||||
#endif
|
||||
|
||||
AssertFatal(le->pool_id == pool_selected, "Unexpected pool ID!");
|
||||
@@ -268,7 +268,7 @@ get_free_mem_block (uint32_t sizeP, const char* caller)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MEM_MNGT_ALLOC
|
||||
msg ("[MEM_MNGT][ERROR][MINOR] memory pool %d is empty trying next pool alloc count = %d\n", pool_selected, counters[pool_selected]);
|
||||
LOG_E (RLC,"[MEM_MNGT][ERROR][MINOR] memory pool %d is empty trying next pool alloc count = %d\n", pool_selected, counters[pool_selected]);
|
||||
#ifdef USER_MODE
|
||||
// display_mem_load ();
|
||||
// check_mem_area ((void *)&mem_block_var);
|
||||
@@ -300,18 +300,18 @@ get_free_copy_mem_block (void)
|
||||
|
||||
if ((le = list_remove_head (&mem_block_var.mem_lists[MEM_MNGT_POOL_ID_COPY]))) {
|
||||
#ifdef DEBUG_MEM_MNGT_ALLOC_SIZE
|
||||
msg ("[MEM_MNGT][INFO] ALLOC COPY MEM BLOCK (%p)\n",le);
|
||||
LOG_D (RLC,"[MEM_MNGT][INFO] ALLOC COPY MEM BLOCK (%p)\n",le);
|
||||
#endif
|
||||
#ifdef DEBUG_MEM_MNGT_ALLOC
|
||||
counters[MEM_MNGT_POOL_ID_COPY] += 1;
|
||||
msg ("[MEM_MNGT][INFO] pool counters = {%2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d}\n",
|
||||
LOG_D (RLC,"[MEM_MNGT][INFO] pool counters = {%2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d %2d}\n",
|
||||
counters[0],counters[1],counters[2],counters[3],counters[4],
|
||||
counters[5],counters[6],counters[7],counters[8],counters[9],
|
||||
counters[10],counters[11]);
|
||||
#endif
|
||||
return le;
|
||||
} else {
|
||||
msg ("[MEM_MNGT][ERROR] POOL COPY IS EMPTY\n");
|
||||
LOG_E (RLC,"[MEM_MNGT][ERROR] POOL COPY IS EMPTY\n");
|
||||
//#ifdef DEBUG_MEM_MNGT_ALLOC
|
||||
check_mem_area ();
|
||||
// break_point ();
|
||||
@@ -335,7 +335,7 @@ copy_mem_block (mem_block_t * leP, mem_block_t * destP)
|
||||
if ((destP != NULL) && (leP != NULL) && (destP->pool_id == MEM_MNGT_POOL_ID_COPY)) {
|
||||
destP->data = leP->data;
|
||||
} else {
|
||||
msg ("[MEM_MNGT][COPY] copy_mem_block() pool dest src or dest is NULL\n");
|
||||
LOG_E (RLC,"[MEM_MNGT][COPY] copy_mem_block() pool dest src or dest is NULL\n");
|
||||
}
|
||||
|
||||
return destP;
|
||||
@@ -352,33 +352,33 @@ display_mem_load (void)
|
||||
|
||||
mem_pool *memory = (mem_pool *) &mem_block_var;
|
||||
|
||||
msg ("POOL 0 (%d elements of %d Bytes): ", MEM_MNGT_MB0_NB_BLOCKS, MEM_MNGT_MB0_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 0 (%d elements of %d Bytes): ", MEM_MNGT_MB0_NB_BLOCKS, MEM_MNGT_MB0_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID0]);
|
||||
msg ("POOL 1 (%d elements of %d Bytes): ", MEM_MNGT_MB1_NB_BLOCKS, MEM_MNGT_MB1_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 1 (%d elements of %d Bytes): ", MEM_MNGT_MB1_NB_BLOCKS, MEM_MNGT_MB1_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID1]);
|
||||
msg ("POOL 2 (%d elements of %d Bytes): ", MEM_MNGT_MB2_NB_BLOCKS, MEM_MNGT_MB2_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 2 (%d elements of %d Bytes): ", MEM_MNGT_MB2_NB_BLOCKS, MEM_MNGT_MB2_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID2]);
|
||||
msg ("POOL 3 (%d elements of %d Bytes): ", MEM_MNGT_MB3_NB_BLOCKS, MEM_MNGT_MB3_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 3 (%d elements of %d Bytes): ", MEM_MNGT_MB3_NB_BLOCKS, MEM_MNGT_MB3_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID3]);
|
||||
msg ("POOL 4 (%d elements of %d Bytes): ", MEM_MNGT_MB4_NB_BLOCKS, MEM_MNGT_MB4_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 4 (%d elements of %d Bytes): ", MEM_MNGT_MB4_NB_BLOCKS, MEM_MNGT_MB4_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID4]);
|
||||
msg ("POOL 5 (%d elements of %d Bytes): ", MEM_MNGT_MB5_NB_BLOCKS, MEM_MNGT_MB5_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 5 (%d elements of %d Bytes): ", MEM_MNGT_MB5_NB_BLOCKS, MEM_MNGT_MB5_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID5]);
|
||||
msg ("POOL 6 (%d elements of %d Bytes): ", MEM_MNGT_MB6_NB_BLOCKS, MEM_MNGT_MB6_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 6 (%d elements of %d Bytes): ", MEM_MNGT_MB6_NB_BLOCKS, MEM_MNGT_MB6_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID6]);
|
||||
msg ("POOL 7 (%d elements of %d Bytes): ", MEM_MNGT_MB7_NB_BLOCKS, MEM_MNGT_MB7_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 7 (%d elements of %d Bytes): ", MEM_MNGT_MB7_NB_BLOCKS, MEM_MNGT_MB7_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID7]);
|
||||
msg ("POOL 8 (%d elements of %d Bytes): ", MEM_MNGT_MB8_NB_BLOCKS, MEM_MNGT_MB8_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 8 (%d elements of %d Bytes): ", MEM_MNGT_MB8_NB_BLOCKS, MEM_MNGT_MB8_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID8]);
|
||||
msg ("POOL 9 (%d elements of %d Bytes): ", MEM_MNGT_MB9_NB_BLOCKS, MEM_MNGT_MB9_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 9 (%d elements of %d Bytes): ", MEM_MNGT_MB9_NB_BLOCKS, MEM_MNGT_MB9_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID9]);
|
||||
msg ("POOL 10 (%d elements of %d Bytes): ", MEM_MNGT_MB10_NB_BLOCKS, MEM_MNGT_MB10_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 10 (%d elements of %d Bytes): ", MEM_MNGT_MB10_NB_BLOCKS, MEM_MNGT_MB10_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID10]);
|
||||
msg ("POOL 11 (%d elements of %d Bytes): ", MEM_MNGT_MB11_NB_BLOCKS, MEM_MNGT_MB11_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 11 (%d elements of %d Bytes): ", MEM_MNGT_MB11_NB_BLOCKS, MEM_MNGT_MB11_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID11]);
|
||||
msg ("POOL 12 (%d elements of %d Bytes): ", MEM_MNGT_MB12_NB_BLOCKS, MEM_MNGT_MB12_BLOCK_SIZE);
|
||||
LOG_D (RLC,"POOL 12 (%d elements of %d Bytes): ", MEM_MNGT_MB12_NB_BLOCKS, MEM_MNGT_MB12_BLOCK_SIZE);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID12]);
|
||||
msg ("POOL C (%d elements): ", MEM_MNGT_MBCOPY_NB_BLOCKS);
|
||||
LOG_D (RLC,"POOL C (%d elements): ", MEM_MNGT_MBCOPY_NB_BLOCKS);
|
||||
list_display (&memory->mem_lists[MEM_MNGT_POOL_ID_COPY]);
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ check_mem_area (void)
|
||||
|
||||
for (index = 0; index < MEM_MNGT_MB0_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[index].data != (unsigned char*)&(memory->mem_pool0[index][0])) && (memory->mem_blocks[index].pool_id != MEM_MNGT_POOL_ID0)) {
|
||||
msg ("[MEM] ERROR POOL0 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL0 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ check_mem_area (void)
|
||||
for (index = 0; index < MEM_MNGT_MB1_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool1[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID1)) {
|
||||
msg ("[MEM] ERROR POOL1 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL1 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ check_mem_area (void)
|
||||
for (index = 0; index < MEM_MNGT_MB2_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool2[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID2)) {
|
||||
msg ("[MEM] ERROR POOL2 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL2 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ check_mem_area (void)
|
||||
for (index = 0; index < MEM_MNGT_MB3_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool3[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID3)) {
|
||||
msg ("[MEM] ERROR POOL3 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL3 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ check_mem_area (void)
|
||||
for (index = 0; index < MEM_MNGT_MB4_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool4[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID4)) {
|
||||
msg ("[MEM] ERROR POOL4 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL4 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ check_mem_area (void)
|
||||
for (index = 0; index < MEM_MNGT_MB5_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool5[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID5)) {
|
||||
msg ("[MEM] ERROR POOL5 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL5 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ check_mem_area (void)
|
||||
for (index = 0; index < MEM_MNGT_MB6_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool6[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID6)) {
|
||||
msg ("[MEM] ERROR POOL6 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL6 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,7 +459,7 @@ check_mem_area (void)
|
||||
for (index = 0; index < MEM_MNGT_MB7_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool7[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID7)) {
|
||||
msg ("[MEM] ERROR POOL7 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL7 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ check_mem_area (void)
|
||||
for (index = 0; index < MEM_MNGT_MB8_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool8[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID8)) {
|
||||
msg ("[MEM] ERROR POOL8 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL8 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ check_mem_area (void)
|
||||
for (index = 0; index < MEM_MNGT_MB9_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool9[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID9)) {
|
||||
msg ("[MEM] ERROR POOL9 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL9 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,7 +486,7 @@ check_mem_area (void)
|
||||
for (index = mb_index; index < MEM_MNGT_MB10_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool10[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID10)) {
|
||||
msg ("[MEM] ERROR POOL10 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL10 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,7 +495,7 @@ check_mem_area (void)
|
||||
for (index = mb_index; index < MEM_MNGT_MB11_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool11[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID11)) {
|
||||
msg ("[MEM] ERROR POOL11 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL11 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,7 +504,7 @@ check_mem_area (void)
|
||||
for (index = mb_index; index < MEM_MNGT_MB12_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool12[index][0]))
|
||||
&& (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID12)) {
|
||||
msg ("[MEM] ERROR POOL12 block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL12 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,7 +512,7 @@ check_mem_area (void)
|
||||
|
||||
for (index = mb_index; index < MEM_MNGT_NB_ELEMENTS; index++) {
|
||||
if ((memory->mem_blocks[index].data != NULL) && (memory->mem_blocks[index].pool_id != MEM_MNGT_POOL_ID_COPY)) {
|
||||
msg ("[MEM] ERROR POOL COPY block index %d\n", index);
|
||||
LOG_D (RLC,"[MEM] ERROR POOL COPY block index %d\n", index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -535,7 +535,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB0_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool0[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID0)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -545,7 +545,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB1_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool1[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID1)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -555,7 +555,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB2_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool2[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID2)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -565,7 +565,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB3_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool3[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID3)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -575,7 +575,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB4_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool4[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID4)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -585,7 +585,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB5_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool5[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID5)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -595,7 +595,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB6_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool6[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID6)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -605,7 +605,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB7_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool7[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID7)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -615,7 +615,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB8_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool8[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID8)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -625,7 +625,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB9_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool9[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID9)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -635,7 +635,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB10_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool10[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID10)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -645,7 +645,7 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB11_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool11[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID11)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -655,13 +655,13 @@ check_free_mem_block (mem_block_t * leP)
|
||||
|
||||
if (block_index < MEM_MNGT_MB12_NB_BLOCKS) {
|
||||
if ((leP->data != (unsigned char*)mem_block_var.mem_pool12[block_index]) && (leP->pool_id != MEM_MNGT_POOL_ID12)) {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
msg ("[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
LOG_D (RLC,"[MEM][ERROR][FATAL] free mem block is corrupted\n");
|
||||
}
|
||||
|
||||
// the block is ok
|
||||
|
||||
@@ -645,6 +645,8 @@ typedef struct {
|
||||
unsigned char nb_ue_remote;
|
||||
unsigned char nb_enb_local;
|
||||
unsigned char nb_enb_remote;
|
||||
unsigned char nb_ru_local;
|
||||
unsigned char nb_ru_remote;
|
||||
unsigned char nb_rn_local;
|
||||
unsigned char nb_rn_remote;
|
||||
module_id_t first_enb_local;
|
||||
@@ -700,8 +702,8 @@ typedef struct {
|
||||
// phy related params
|
||||
unsigned int n_frames;
|
||||
unsigned int n_frames_flag; // if set, then let the emulation goes to infinity
|
||||
eNB_func_t node_function[MAX_NUM_CCs];
|
||||
eNB_timing_t node_timing[MAX_NUM_CCs];
|
||||
node_function_t node_function[MAX_NUM_CCs];
|
||||
node_timing_t node_timing[MAX_NUM_CCs];
|
||||
unsigned char frame_type[MAX_NUM_CCs]; //! LTE frame type (TDD=1, FDD=0). \note this should be converted to \ref lte_frame_type_t (header file reorganization needed)
|
||||
char * frame_type_name[MAX_NUM_CCs];
|
||||
unsigned char tdd_config[MAX_NUM_CCs];
|
||||
|
||||
Reference in New Issue
Block a user