Merge remote-tracking branch 'origin/develop-uedirectorysplit' into develop_integration_2018_w19

Status so far:
- monolithic eNB compiles and is functional with 1 UE in FDD, 5/10/20MHz.
  For 20MHz we don't have a nice TCP downlink (on haswell).
- oaisim does not compile
- UE does not compile
- phy simulators don't compile
- many new warnings

Conflicts:
	cmake_targets/CMakeLists.txt
	openair1/PHY/LTE_TRANSPORT/transport_eNB.h
	openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h
	openair1/PHY/defs_eNB.h
	openair1/SCHED/pusch_pc.c
	openair1/SCHED/sched_common.h
	openair1/SCHED_UE/phy_procedures_lte_ue.c
	openair2/LAYER2/MAC/eNB_scheduler.c
	openair2/LAYER2/MAC/eNB_scheduler_mch.c
	openair2/LAYER2/MAC/mac.h
	openair2/LAYER2/MAC/ra_procedures.c
	openair2/LAYER2/MAC/ue_procedures.c
	openair2/RRC/LTE/MESSAGES/asn1_msg.h
	openair2/RRC/LTE/rrc_UE.c
	openair2/RRC/LTE/rrc_defs.h
	targets/RT/USER/lte-softmodem.h
	targets/RT/USER/lte-ue.c
This commit is contained in:
Cedric Roux
2018-05-14 16:28:04 +02:00
355 changed files with 25839 additions and 25937 deletions
+2 -4
View File
@@ -29,10 +29,8 @@
#ifndef PHY_MESSAGES_TYPES_H_
#define PHY_MESSAGES_TYPES_H_
#include "PHY/impl_defs_lte.h"
#if ENABLE_RAL
#include "ral_messages_types.h" //LG: MIH moved from repository/trunk to repository/extras
#endif
#include "PHY/defs_common.h"
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define PHY_CONFIGURATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.phy_configuration_req
+4 -2
View File
@@ -69,10 +69,12 @@
#ifdef LARGE_SCALE
# define MAX_MOBILES_PER_ENB 128
//# define MAX_RG 2
# define MAX_MOBILES_PER_ENB_NB_IoT 128
# define MAX_eNB 2
#else
# define MAX_MOBILES_PER_ENB 16
//# define MAX_RG 2
# define MAX_MOBILES_PER_ENB_NB_IoT 16
# define MAX_eNB 2
#endif
#define MAX_MANAGED_ENB_PER_MOBILE 2
@@ -34,7 +34,7 @@
#include "flexran_agent_timer.h"
#include "flexran_agent_ran_api.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/mac_proto.h"
#include "liblfds700.h"
@@ -836,7 +836,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
Protocol__FlexHeader *header = NULL;
int i, j, UE_id;
int available_harq[NUMBER_OF_UE_MAX];
int available_harq[MAX_MOBILES_PER_ENB];
const int xid = *((int *)params);
@@ -854,7 +854,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
frame_t frame;
sub_frame_t subframe;
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
available_harq[i] = -1;
}
@@ -878,7 +878,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
sf_trigger_msg->n_dl_info = 0;
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
for (j = 0; j < 8; j++) {
if (RC.mac && RC.mac[mod_id] && RC.mac[mod_id]->UE_list.eNB_UE_stats[UE_PCCID(mod_id,i)][i].harq_pid == 1) {
available_harq[i] = j;
@@ -904,7 +904,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
goto error;
i = -1;
//Fill the status of the current HARQ process for each UE
for(UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
for(UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (available_harq[UE_id] < 0) {
continue;
} else {
@@ -1262,7 +1262,7 @@ void flexran_agent_init_mac_agent(mid_t mod_id) {
//Allow RINGBUFFER_SIZE messages to be stored in the ringbuffer at any time
dl_mac_config_array[mod_id] = malloc( sizeof(struct lfds700_ringbuffer_element) * num_elements);
lfds700_ringbuffer_init_valid_on_current_logical_core( &ringbuffer_state[mod_id], dl_mac_config_array[mod_id], num_elements, &ps[mod_id], NULL );
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
for (j = 0; j < 8; j++) {
if (RC.mac && RC.mac[mod_id])
RC.mac[mod_id]->UE_list.eNB_UE_stats[UE_PCCID(mod_id,i)][i].harq_pid = 0;
@@ -37,7 +37,7 @@ unsigned int pdcp_agent_registered[NUM_MAX_ENB];
/*Array containing the Agent-PDCP interfaces*/
AGENT_PDCP_xface *agent_pdcp_xface[NUM_MAX_ENB];
// NUMBER_OF_UE_MAX
// MAX_MOBILES_PER_ENB
void flexran_agent_pdcp_aggregate_stats(const mid_t mod_id,
const mid_t ue_id,
+1 -1
View File
@@ -30,7 +30,7 @@
#include <sys/types.h>
#include "openair1/PHY/extern.h"
#include "openair1/PHY/phy_extern.h"
#include "common/utils/load_module_shlib.h"
#define NBIOT_INTERFACE_SOURCE
#include "NB_IoT_interface.h"
+1
View File
@@ -46,6 +46,7 @@
# include "gtpv1u_eNB_task.h"
# endif
#include "openair1/PHY/INIT/phy_init.h"
extern unsigned char NB_eNB_INST;
#endif
+7 -4
View File
@@ -45,9 +45,10 @@
#endif
#include "sctp_default_values.h"
#include "SystemInformationBlockType2.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/proto.h"
#include "PHY/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/mac_proto.h"
#include "PHY/phy_extern.h"
#include "PHY/INIT/phy_init.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include "nfapi_vnf.h"
#include "nfapi_pnf.h"
@@ -383,8 +384,10 @@ void RCconfig_macrlc() {
RC.nb_macrlc_inst=MacRLC_ParamList.numelt;
mac_top_init_eNB();
for (j=0;j<RC.nb_macrlc_inst;j++) {
RC.nb_mac_CC = (int*)malloc(RC.nb_macrlc_inst*sizeof(int));
for (j=0;j<RC.nb_macrlc_inst;j++) {
RC.nb_mac_CC[j] = *(MacRLC_ParamList.paramarray[j][MACRLC_CC_IDX].iptr);
//RC.mac[j]->phy_test = *(MacRLC_ParamList.paramarray[j][MACRLC_PHY_TEST_IDX].iptr);
//printf("PHY_TEST = %d,%d\n", RC.mac[j]->phy_test, j);
+2 -2
View File
@@ -38,7 +38,7 @@
#include "platform_types.h"
#include "platform_constants.h"
#include "PHY/impl_defs_lte.h"
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "s1ap_messages_types.h"
#ifdef CMAKER
#include "SystemInformationBlockType2.h"
@@ -47,7 +47,7 @@
#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h"
#endif
#include "intertask_interface_types.h"
#include "RRC/LITE/defs.h"
#include "RRC/LTE/rrc_defs.h"
#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
struct in_addr inp;\
+3 -3
View File
@@ -35,11 +35,11 @@
#include "flexran_agent_extern.h"
#include "flexran_agent_net_comm.h"
#include "flexran_agent_ran_api.h"
#include "PHY/extern.h"
//#include "PHY/extern.h"
#include "log.h"
#include "SCHED/defs.h"
#include "RRC/LITE/extern.h"
//#include "SCHED/defs.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "rrc_eNB_UE_context.h"
-1
View File
@@ -42,7 +42,6 @@
#include "flexran_agent_defs.h"
#include "enb_config.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/RLC/rlc.h"
# include "tree.h"
+1 -1
View File
@@ -1219,7 +1219,7 @@ void flexran_set_pdcp_rx_stat_window(const mid_t mod_id, const mid_t ue_id, uint
/*PDCP num tx pdu status flexRAN*/
uint32_t flexran_get_pdcp_tx(const mid_t mod_id, const mid_t ue_id, const lcid_t lcid){
if (mod_id <0 || mod_id> MAX_NUM_CCs || ue_id<0 || ue_id> NUMBER_OF_UE_MAX || lcid<0 || lcid>NB_RB_MAX)
if (mod_id <0 || mod_id> MAX_NUM_CCs || ue_id<0 || ue_id> MAX_MOBILES_PER_ENB || lcid<0 || lcid>NB_RB_MAX)
return -1;
return Pdcp_stats_tx[mod_id][ue_id][lcid];
}
+4 -5
View File
@@ -36,14 +36,13 @@
#include "enb_config.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/RLC/rlc.h"
#include "SCHED/defs.h"
#include "SCHED/sched_eNB.h"
#include "pdcp.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "RRC/LITE/rrc_eNB_UE_context.h"
#include "PHY/extern.h"
#include "RRC/LTE/rrc_eNB_UE_context.h"
#include "PHY/phy_extern.h"
#include "log.h"
/****************************
+3 -4
View File
@@ -32,7 +32,6 @@
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "SCHED/defs.h"
#include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
@@ -43,9 +42,9 @@
#include "MeasObjectToAddModList.h"
#include "TDD-Config.h"
#include "MAC-MainConfig.h"
#include "defs.h"
#include "proto.h"
#include "extern.h"
#include "mac.h"
#include "mac_proto.h"
#include "mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
+4 -4
View File
@@ -32,7 +32,7 @@
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "SCHED/defs.h"
#include "SCHED_UE/sched_UE.h"
#include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
@@ -43,9 +43,9 @@
#include "MeasObjectToAddModList.h"
#include "TDD-Config.h"
#include "MAC-MainConfig.h"
#include "defs.h"
#include "proto.h"
#include "extern.h"
#include "mac.h"
#include "mac_proto.h"
#include "mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
+6 -6
View File
@@ -98,7 +98,7 @@ typedef enum{
DL
}message_direction_t;
#define MAX_NUMBER_OF_UE_MAX_NB_IoT 20
#define MAX_MAX_MOBILES_PER_ENB_NB_IoT 20
#define SCH_PAYLOAD_SIZE_MAX_NB_IoT 320
#define MAX_NUMBER_OF_SIBs_NB_IoT 16
@@ -233,17 +233,17 @@ typedef struct{
typedef struct {
/// DCI template and MAC connection parameters for UEs
UE_TEMPLATE_NB_IoT UE_template_NB_IoT[MAX_NUMBER_OF_UE_MAX_NB_IoT];
UE_TEMPLATE_NB_IoT UE_template_NB_IoT[MAX_MAX_MOBILES_PER_ENB_NB_IoT];
/// NPDCCH Period and searching space info
NPDCCH_config_dedicated_NB_IoT_t NPDCCH_config_dedicated;
//int next[MAX_NUMBER_OF_UE_MAX_NB_IoT];
//int next[MAX_MAX_MOBILES_PER_ENB_NB_IoT];
// -1:No UE in list
int head;
// -1:No UE in list
int tail;
int num_UEs;
//boolean_t active[MAX_NUMBER_OF_UE_MAX_NB_IoT];
//boolean_t active[MAX_MAX_MOBILES_PER_ENB_NB_IoT];
} UE_list_NB_IoT_t;
@@ -261,7 +261,7 @@ typedef struct{
// flag to indicate scheduling type1 NPDCCH CSS with different CE level
uint8_t flag_type1_css[3];
// flag to indicate scheduling NPDCCH USS with UE list
uint8_t flag_uss[MAX_NUMBER_OF_UE_MAX_NB_IoT];
uint8_t flag_uss[MAX_MAX_MOBILES_PER_ENB_NB_IoT];
// flag to indicate scheduling sib1/MIB
uint8_t flag_fix_scheduling;
// number of the type2 css to schedule in this period
@@ -494,7 +494,7 @@ typedef struct eNB_MAC_INST_NB_IoT_s {
RA_template_list_t RA_msg3_list;
RA_template_list_t RA_msg4_list;
RA_TEMPLATE_NB_IoT RA_template[MAX_NUMBER_OF_UE_MAX_NB_IoT];
RA_TEMPLATE_NB_IoT RA_template[MAX_MAX_MOBILES_PER_ENB_NB_IoT];
//int32_t last_tx_subframe;
+214 -208
View File
@@ -30,23 +30,18 @@
*/
#include "assertions.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/mac_proto.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
//#include "LAYER2/MAC/pre_processor.c"
@@ -60,6 +55,8 @@
#include "intertask_interface.h"
#endif
#include "assertions.h"
#define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_eNB_SCHEDULER 1
@@ -72,6 +69,8 @@ uint16_t pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
void
schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
{
eNB_MAC_INST *eNB = RC.mac[module_idP];
UE_list_t *UE_list = &eNB->UE_list;
nfapi_ul_config_request_body_t *ul_req;
@@ -90,140 +89,148 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
uint16_t srsPeriodicity, srsOffset;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
soundingRS_UL_ConfigCommon = &cc[CC_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon;
// check if SRS is enabled in this frame/subframe
if (soundingRS_UL_ConfigCommon) {
srs_SubframeConfig = soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig;
if (cc[CC_id].tdd_Config == NULL) { // FDD
deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0];
TSFC = deltaTSFCTabType1[srs_SubframeConfig][1];
} else { // TDD
deltaTSFC = deltaTSFCTabType2[srs_SubframeConfig][0];
TSFC = deltaTSFCTabType2[srs_SubframeConfig][1];
}
// Sounding reference signal subframes are the subframes satisfying ns/2 mod TSFC (- deltaTSFC
uint16_t tmp = (subframeP % TSFC);
if ((1 << tmp) & deltaTSFC) {
// This is an SRS subframe, loop over UEs
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
if (RC.mac[module_idP]->UE_list.active[UE_id] != TRUE)
continue;
ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL,
"physicalConfigDedicated is null for UE %d\n", UE_id);
if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated) != NULL) {
if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) {
get_srs_pos(&cc[CC_id],soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex,&srsPeriodicity, &srsOffset);
if (((10 * frameP + subframeP) % srsPeriodicity) == srsOffset) {
// Program SRS
ul_req->srs_present = 1;
nfapi_ul_config_request_pdu_t * ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE;
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_srs_pdu));
ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG;
ul_config_pdu->srs_pdu.srs_pdu_rel8.size = (uint8_t)sizeof(nfapi_ul_config_srs_pdu);
ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;;
ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb = soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex;
ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; // ul_config_pdu->srs_pdu.srs_pdu_rel10.antenna_port = ;//
// ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs = ;//
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
RC.mac[module_idP]->UL_req[CC_id].header.message_id = NFAPI_UL_CONFIG_REQUEST;
ul_req->number_of_pdus++;
} // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset)
} // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup)
} // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL)
} // for (UE_id ...
} // if((1<<tmp) & deltaTSFC)
} // SRS config
}
soundingRS_UL_ConfigCommon = &cc[CC_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon;
// check if SRS is enabled in this frame/subframe
if (soundingRS_UL_ConfigCommon) {
srs_SubframeConfig = soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig;
if (cc[CC_id].tdd_Config == NULL) { // FDD
deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0];
TSFC = deltaTSFCTabType1[srs_SubframeConfig][1];
} else { // TDD
deltaTSFC = deltaTSFCTabType2[srs_SubframeConfig][0];
TSFC = deltaTSFCTabType2[srs_SubframeConfig][1];
}
// Sounding reference signal subframes are the subframes satisfying ns/2 mod TSFC (- deltaTSFC
uint16_t tmp = (subframeP % TSFC);
if ((1 << tmp) & deltaTSFC) {
// This is an SRS subframe, loop over UEs
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (!RC.mac[module_idP]->UE_list.active[UE_id]) continue;
ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL,
"physicalConfigDedicated is null for UE %d\n",
UE_id);
if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated) != NULL) {
if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) {
get_srs_pos(&cc[CC_id],
soundingRS_UL_ConfigDedicated->choice.
setup.srs_ConfigIndex,
&srsPeriodicity, &srsOffset);
if (((10 * frameP + subframeP) % srsPeriodicity) == srsOffset) {
// Program SRS
ul_req->srs_present = 1;
nfapi_ul_config_request_pdu_t * ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE;
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_srs_pdu));
ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG;
ul_config_pdu->srs_pdu.srs_pdu_rel8.size = (uint8_t)sizeof(nfapi_ul_config_srs_pdu);
ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;;
ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb = soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex;
ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; // ul_config_pdu->srs_pdu.srs_pdu_rel10.antenna_port = ;//
// ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs = ;//
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
RC.mac[module_idP]->UL_req[CC_id].header.message_id = NFAPI_UL_CONFIG_REQUEST;
ul_req->number_of_pdus++;
} // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset)
} // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup)
} // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL)
} // for (UE_id ...
} // if((1<<tmp) & deltaTSFC)
} // SRS config
}
}
void
schedule_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
{
eNB_MAC_INST *eNB = RC.mac[module_idP];
UE_list_t *UE_list = &eNB->UE_list;
COMMON_channels_t *cc;
nfapi_ul_config_request_body_t *ul_req;
int CC_id, UE_id;
struct CQI_ReportPeriodic *cqi_ReportPeriodic;
uint16_t Npd, N_OFFSET_CQI;
int H;
eNB_MAC_INST *eNB = RC.mac[module_idP];
UE_list_t *UE_list = &eNB->UE_list;
COMMON_channels_t *cc;
nfapi_ul_config_request_body_t *ul_req;
int CC_id, UE_id;
struct CQI_ReportPeriodic *cqi_ReportPeriodic;
uint16_t Npd, N_OFFSET_CQI;
int H;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
cc = &eNB->common_channels[CC_id];
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
if (UE_list->active[UE_id] != TRUE)
continue;
ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
AssertFatal(UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated
!= NULL,
"physicalConfigDedicated is null for UE %d\n",
UE_id);
if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) {
if ((cqi_ReportPeriodic = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) != NULL
&& (cqi_ReportPeriodic->present != CQI_ReportPeriodic_PR_release)) {
//Rel8 Periodic CQI/PMI/RI reporting
get_csi_params(cc, cqi_ReportPeriodic, &Npd,
&N_OFFSET_CQI, &H);
if ((((frameP * 10) + subframeP) % Npd) == N_OFFSET_CQI) { // CQI opportunity
UE_list->UE_sched_ctrl[UE_id].feedback_cnt[CC_id] = (((frameP * 10) + subframeP) / Npd) % H;
// Program CQI
nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
memset((void *) ul_config_pdu, 0,
sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_list->UE_sched_ctrl[UE_id], CC_id, cc,get_tmode(module_idP, CC_id, UE_id),cqi_ReportPeriodic);
ul_req->number_of_pdus++;
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
#if defined(Rel10) || defined(Rel14)
// PUT rel10-13 UCI options here
#endif
} else
if ((cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
&& ((((frameP * 10) + subframeP) % ((H * Npd) << (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex / 161))) == N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex % 161))) { // RI opportunity
// Program RI
nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
memset((void *) ul_config_pdu, 0,
sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = (cc->p_eNB == 2) ? 1 : 2;
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
ul_req->number_of_pdus++;
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
}
} // if ((cqi_ReportPeriodic = cqi_ReportConfig->cqi_ReportPeriodic)!=NULL) {
cc = &eNB->common_channels[CC_id];
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (!UE_list->active[UE_id]) continue;
} // if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig)
ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
} // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
} // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
AssertFatal(UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated
!= NULL,
"physicalConfigDedicated is null for UE %d\n",
UE_id);
if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) {
if ((cqi_ReportPeriodic = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) != NULL
&& (cqi_ReportPeriodic->present != CQI_ReportPeriodic_PR_release)) {
//Rel8 Periodic CQI/PMI/RI reporting
get_csi_params(cc, cqi_ReportPeriodic, &Npd,
&N_OFFSET_CQI, &H);
if ((((frameP * 10) + subframeP) % Npd) == N_OFFSET_CQI) { // CQI opportunity
UE_list->UE_sched_ctrl[UE_id].feedback_cnt[CC_id] = (((frameP * 10) + subframeP) / Npd) % H;
// Program CQI
nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
memset((void *) ul_config_pdu, 0,
sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_list->UE_sched_ctrl[UE_id], CC_id, cc,
get_tmode(module_idP, CC_id, UE_id),
cqi_ReportPeriodic);
ul_req->number_of_pdus++;
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
#if defined(Rel10) || defined(Rel14)
// PUT rel10-13 UCI options here
#endif
} else
if ((cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
&& ((((frameP * 10) + subframeP) % ((H * Npd) << (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex / 161))) == N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex % 161))) { // RI opportunity
// Program RI
nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
memset((void *) ul_config_pdu, 0,
sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = (cc->p_eNB == 2) ? 1 : 2;
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
ul_req->number_of_pdus++;
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
}
} // if ((cqi_ReportPeriodic = cqi_ReportConfig->cqi_ReportPeriodic)!=NULL) {
} // if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig)
} // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
} // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
}
void
@@ -244,8 +251,8 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
if (RC.mac[module_idP]->UE_list.active[UE_id] != TRUE) continue;
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (!RC.mac[module_idP]->UE_list.active[UE_id]) continue;
ul_req = &RC.mac[module_idP]->UL_req[CC_id];
ul_req_body = &ul_req->ul_config_request_body;
@@ -519,96 +526,95 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
cc[CC_id].mcch_active = 0;
#endif
clear_nfapi_information(RC.mac[module_idP], CC_id, frameP, subframeP);
}
// refresh UE list based on UEs dropped by PHY in previous subframe
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
if (UE_list->active[i] != TRUE)
continue;
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (UE_list->active[i]) {
rnti = UE_RNTI(module_idP, i);
CC_id = UE_PCCID(module_idP, i);
if (((frameP&127) == 0) && (subframeP == 0)) {
LOG_I(MAC,
"UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n",
rnti,
UE_list->UE_sched_ctrl[i].ul_out_of_sync ==
0 ? "in synch" : "out of sync",
UE_list->UE_template[CC_id][i].phr_info,
UE_list->UE_sched_ctrl[i].dl_cqi[CC_id],
(UE_list->UE_sched_ctrl[i].pusch_snr[CC_id] - 128) / 2,
(UE_list->UE_sched_ctrl[i].pucch1_snr[CC_id] - 128) / 2);
}
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,
RC.eNB[module_idP][CC_id]->
pusch_stats_bsr[i][(frameP * 10) + subframeP]);
// increment this, it is cleared when we receive an sdu
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer++;
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++;
LOG_D(MAC, "UE %d/%x : ul_inactivity %d, cqi_req %d\n", i, rnti,
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].
ul_inactivity_timer,
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer);
check_ul_failure(module_idP, CC_id, i, frameP, subframeP);
if (RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer > 0) {
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer++;
if(RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer >=
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer_thres) {
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer = 0;
for (int ue_id_l = 0; ue_id_l < NUMBER_OF_UE_MAX; ue_id_l++) {
if (reestablish_rnti_map[ue_id_l][0] == rnti) {
// clear currentC-RNTI from map
reestablish_rnti_map[ue_id_l][0] = 0;
reestablish_rnti_map[ue_id_l][1] = 0;
break;
rnti = UE_RNTI(module_idP, i);
CC_id = UE_PCCID(module_idP, i);
if (((frameP&127) == 0) && (subframeP == 0)) {
LOG_I(MAC,
"UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n",
rnti,
UE_list->UE_sched_ctrl[i].ul_out_of_sync ==
0 ? "in synch" : "out of sync",
UE_list->UE_template[CC_id][i].phr_info,
UE_list->UE_sched_ctrl[i].dl_cqi[CC_id],
(UE_list->UE_sched_ctrl[i].pusch_snr[CC_id] - 128) / 2,
(UE_list->UE_sched_ctrl[i].pucch1_snr[CC_id] - 128) / 2);
}
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,
RC.eNB[module_idP][CC_id]->
pusch_stats_bsr[i][(frameP * 10) + subframeP]);
// increment this, it is cleared when we receive an sdu
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer++;
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++;
LOG_D(MAC, "UE %d/%x : ul_inactivity %d, cqi_req %d\n", i, rnti,
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].
ul_inactivity_timer,
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer);
check_ul_failure(module_idP, CC_id, i, frameP, subframeP);
if (RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer > 0) {
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer++;
if(RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer >=
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer_thres) {
RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer = 0;
for (int ue_id_l = 0; ue_id_l < MAX_MOBILES_PER_ENB; ue_id_l++) {
if (reestablish_rnti_map[ue_id_l][0] == rnti) {
// clear currentC-RNTI from map
reestablish_rnti_map[ue_id_l][0] = 0;
reestablish_rnti_map[ue_id_l][1] = 0;
break;
}
}
}
for (int ii=0; ii<NUMBER_OF_UE_MAX; ii++) {
LTE_eNB_ULSCH_t *ulsch = RC.eNB[module_idP][CC_id]->ulsch[ii];
if((ulsch != NULL) && (ulsch->rnti == rnti)){
LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti);
clean_eNb_ulsch(ulsch);
// Note: This should not be done in the MAC!
for (int ii=0; ii<MAX_MOBILES_PER_ENB; ii++) {
LTE_eNB_ULSCH_t *ulsch = RC.eNB[module_idP][CC_id]->ulsch[ii];
if((ulsch != NULL) && (ulsch->rnti == rnti)){
LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti);
clean_eNb_ulsch(ulsch);
}
}
}
for (int ii=0; ii<NUMBER_OF_UE_MAX; ii++) {
LTE_eNB_DLSCH_t *dlsch = RC.eNB[module_idP][CC_id]->dlsch[ii][0];
if((dlsch != NULL) && (dlsch->rnti == rnti)){
LOG_I(MAC, "clean_eNb_dlsch UE %x \n", rnti);
clean_eNb_dlsch(dlsch);
for (int ii=0; ii<MAX_MOBILES_PER_ENB; ii++) {
LTE_eNB_DLSCH_t *dlsch = RC.eNB[module_idP][CC_id]->dlsch[ii][0];
if((dlsch != NULL) && (dlsch->rnti == rnti)){
LOG_I(MAC, "clean_eNb_dlsch UE %x \n", rnti);
clean_eNb_dlsch(dlsch);
}
}
}
for(int j = 0; j < 10; j++){
nfapi_ul_config_request_body_t *ul_req_tmp = NULL;
ul_req_tmp = &RC.mac[module_idP]->UL_req_tmp[CC_id][j].ul_config_request_body;
if(ul_req_tmp){
int pdu_number = ul_req_tmp->number_of_pdus;
for(int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--){
if(ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti){
LOG_I(MAC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number);
if(pdu_index < pdu_number -1){
memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t));
for(int j = 0; j < 10; j++){
nfapi_ul_config_request_body_t *ul_req_tmp = NULL;
ul_req_tmp = &RC.mac[module_idP]->UL_req_tmp[CC_id][j].ul_config_request_body;
if(ul_req_tmp){
int pdu_number = ul_req_tmp->number_of_pdus;
for(int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--){
if(ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti){
LOG_I(MAC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number);
if(pdu_index < pdu_number -1){
memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t));
}
ul_req_tmp->number_of_pdus--;
}
ul_req_tmp->number_of_pdus--;
}
}
}
}
rrc_mac_remove_ue(module_idP,rnti);
}
}
}
}
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES,
NOT_A_RNTI, frameP, subframeP,
module_idP);
+13 -14
View File
@@ -34,24 +34,19 @@
#include "assertions.h"
#include "platform_types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "msc.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/mac_proto.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
//#include "LAYER2/MAC/pre_processor.c"
@@ -61,10 +56,14 @@
#include "intertask_interface.h"
#endif
#include "SIMULATION/TOOLS/defs.h" // for taus
#include "SIMULATION/TOOLS/sim.h" // for taus
#include "T.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
extern uint8_t nfapi_mode;
extern int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
@@ -1511,18 +1510,18 @@ initiate_ra_proc(module_id_t module_idP,
/* TODO: find better procedure to allocate RNTI */
do {
#if defined(USRP_REC_PLAY) // deterministic rnti in usrp record/playback mode
static int drnti[NUMBER_OF_UE_MAX] = { 0xbda7, 0x71da, 0x9c40, 0xc350, 0x2710, 0x4e20, 0x7530, 0x1388, 0x3a98, 0x61a8, 0x88b8, 0xafc8, 0xd6d8, 0x1b58, 0x4268, 0x6978 };
static int drnti[MAX_MOBILES_PER_ENB] = { 0xbda7, 0x71da, 0x9c40, 0xc350, 0x2710, 0x4e20, 0x7530, 0x1388, 0x3a98, 0x61a8, 0x88b8, 0xafc8, 0xd6d8, 0x1b58, 0x4268, 0x6978 };
int j = 0;
int nb_ue = 0;
for (j = 0; j < NUMBER_OF_UE_MAX; j++) {
for (j = 0; j < MAX_MOBILES_PER_ENB; j++) {
if (UE_RNTI(module_idP, j) > 0) {
nb_ue++;
} else {
break;
}
}
if (nb_ue >= NUMBER_OF_UE_MAX) {
printf("No more free RNTI available, increase NUMBER_OF_UE_MAX\n");
if (nb_ue >= MAX_MOBILES_PER_ENB) {
printf("No more free RNTI available, increase MAX_MOBILES_PER_ENB\n");
abort();
}
ra[i].rnti = drnti[nb_ue];
+7 -10
View File
@@ -30,22 +30,16 @@
*/
#include "assertions.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
//#include "LAYER2/MAC/pre_processor.c"
@@ -58,6 +52,9 @@
#define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_eNB_SCHEDULER 1
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
// NEED TO ADD schedule_SI_BR for SIB1_BR and SIB23_BR
// CCE_allocation_infeasible to be done for EPDCCH/MPDCCH
+8 -12
View File
@@ -29,29 +29,25 @@
*/
#include "assertions.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
//#include "LAYER2/MAC/pre_processor.c"
#include "pdcp.h"
#include "SIMULATION/TOOLS/defs.h" // for taus
#include "SIMULATION/TOOLS/sim.h" // for taus
#include "assertions.h"
#if defined(ENABLE_ITTI)
#include "intertask_interface.h"
@@ -1801,7 +1797,7 @@ void schedule_PCH(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP)
vrb_map = (void*)&cc->vrb_map;
n_rb_dl = to_prb(cc->mib->message.dl_Bandwidth);
dl_req = &eNB->DL_req[CC_id].dl_config_request_body;
for (uint16_t i = 0; i < NUMBER_OF_UE_MAX; i++) {
for (uint16_t i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (UE_PF_PO[CC_id][i].enable_flag != TRUE) {
continue;
}
+8 -12
View File
@@ -29,36 +29,32 @@
*/
#include "assertions.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
//#include "LAYER2/MAC/pre_processor.c"
#include "pdcp.h"
#include "assertions.h"
#if defined(ENABLE_ITTI)
#include "intertask_interface.h"
#endif
#include "SIMULATION/TOOLS/defs.h" // for taus
#include "SIMULATION/TOOLS/sim.h" // for taus
#define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_eNB_SCHEDULER 1
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
@@ -662,7 +658,7 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
);
//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]);
//sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(MAX_MOBILES_PER_ENB+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);
+7 -8
View File
@@ -30,22 +30,21 @@
*/
#include "assertions.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "SCHED/sched_eNB.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "SIMULATION/TOOLS/defs.h" // for taus
#include "SIMULATION/TOOLS/sim.h" // for taus
#include "T.h"
+15 -18
View File
@@ -30,23 +30,18 @@
*/
#include "assertions.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/mac_proto.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
//#include "LAYER2/MAC/pre_processor.c"
@@ -61,6 +56,10 @@
#define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_eNB_SCHEDULER 1
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
extern int n_active_slices;
int choose(int n, int k)
@@ -984,6 +983,8 @@ get_rel8_dl_cqi_pmi_size(UE_sched_ctrl * sched_ctl, int CC_idP,
cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present);
}
void
fill_nfapi_dl_dci_1A(nfapi_dl_config_request_pdu_t *dl_config_pdu,
uint8_t aggregation_level,
@@ -1666,7 +1667,7 @@ void init_ue_sched_info(void)
for (i = 0; i < NUMBER_OF_eNB_MAX; i++) {
for (k = 0; k < MAX_NUM_CCs; k++) {
for (j = 0; j < NUMBER_OF_UE_MAX; j++) {
for (j = 0; j < MAX_MOBILES_PER_ENB; j++) {
// init DL
eNB_dlsch_info[i][k][j].weight = 0;
eNB_dlsch_info[i][k][j].subframe = 0;
@@ -1697,7 +1698,7 @@ int find_UE_id(module_id_t mod_idP, rnti_t rntiP)
int UE_id;
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (UE_list->active[UE_id] != TRUE)
continue;
if (UE_list->UE_template[UE_PCCID(mod_idP, UE_id)][UE_id].rnti ==
@@ -1838,7 +1839,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP, int harq_pidP
mod_idP, cc_idP, rntiP, UE_list->avail, UE_list->num_UEs);
dump_ue_list(UE_list, 0);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (UE_list->active[i] == TRUE)
continue;
UE_id = i;
@@ -2324,9 +2325,7 @@ int get_bw_index(module_id_t module_id, uint8_t CC_id)
{
int bw_index = 0;
int N_RB_DL =
to_prb(RC.mac[module_id]->common_channels[CC_id].mib->
message.dl_Bandwidth);
int N_RB_DL = to_prb(RC.mac[module_id]->common_channels[CC_id].mib->message.dl_Bandwidth);
switch (N_RB_DL) {
case 6: // 1.4 MHz
@@ -2359,9 +2358,7 @@ int get_bw_index(module_id_t module_id, uint8_t CC_id)
int get_min_rb_unit(module_id_t module_id, uint8_t CC_id)
{
int min_rb_unit = 0;
int N_RB_DL =
to_prb(RC.mac[module_id]->common_channels[CC_id].mib->
message.dl_Bandwidth);
int N_RB_DL = to_prb(RC.mac[module_id]->common_channels[CC_id].mib->message.dl_Bandwidth);
switch (N_RB_DL) {
case 6: // 1.4 MHz
+6 -10
View File
@@ -31,25 +31,21 @@
/* indented with: indent -kr eNB_scheduler_RA.c */
#include "assertions.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "assertions.h"
//#include "LAYER2/MAC/pre_processor.c"
#include "pdcp.h"
@@ -144,7 +140,7 @@ rx_sdu(const module_id_t enb_mod_idP,
start_meas(&mac->rx_ulsch_sdu);
if ((UE_id > NUMBER_OF_UE_MAX) || (UE_id == -1))
if ((UE_id > MAX_MOBILES_PER_ENB) || (UE_id == -1))
for (ii = 0; ii < NB_RB_MAX; ii++) {
rx_lengths[ii] = 0;
}
+49 -3
View File
@@ -29,10 +29,10 @@
*/
#include "defs.h"
#include "extern.h"
#include "mac.h"
#include "mac_extern.h"
#include "UTIL/LOG/log.h"
#include "proto.h"
#include "mac_proto.h"
int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP, uint8_t CC_id)
{
@@ -54,6 +54,52 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP, uint8_t CC_id)
1) + get_DELTA_PREAMBLE(module_idP, CC_id));
}
int8_t get_DELTA_PREAMBLE(module_id_t module_idP, int CC_id)
{
AssertFatal(CC_id == 0,
"Transmission on secondary CCs is not supported yet\n");
uint8_t prachConfigIndex =
UE_mac_inst[module_idP].radioResourceConfigCommon->
prach_Config.prach_ConfigInfo.prach_ConfigIndex;
uint8_t preambleformat;
if (UE_mac_inst[module_idP].tdd_Config) { // TDD
if (prachConfigIndex < 20) {
preambleformat = 0;
} else if (prachConfigIndex < 30) {
preambleformat = 1;
} else if (prachConfigIndex < 40) {
preambleformat = 2;
} else if (prachConfigIndex < 48) {
preambleformat = 3;
} else {
preambleformat = 4;
}
} else { // FDD
preambleformat = prachConfigIndex >> 2;
}
switch (preambleformat) {
case 0:
case 1:
return (0);
case 2:
case 3:
return (-3);
case 4:
return (8);
default:
AssertFatal(1 == 0,
"[UE %d] ue_procedures.c: FATAL, Illegal preambleformat %d, prachConfigIndex %d\n",
module_idP, preambleformat, prachConfigIndex);
}
}
int8_t get_deltaP_rampup(module_id_t module_idP, uint8_t CC_id)
{
@@ -43,11 +43,10 @@
#include <stdlib.h>
#include <string.h>
#include "PHY/defs.h"
#include "PHY/LTE_TRANSPORT/defs.h"
#include "COMMON/platform_constants.h"
#include "BCCH-BCH-Message.h"
#include "RadioResourceConfigCommon.h"
#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "MeasGapConfig.h"
#include "SchedulingInfoList.h"
@@ -69,6 +68,13 @@
#include "nfapi_interface.h"
#include "PHY_INTERFACE/IF_Module.h"
#include "PHY/TOOLS/time_meas.h"
#include "PHY/defs_common.h" // for PRACH_RESOURCES_t
#include "PHY/LTE_TRANSPORT/transport_common.h"
#include "targets/ARCH/COMMON/common_lib.h"
/** @defgroup _mac MAC
* @ingroup _oai2
* @{
@@ -491,15 +497,12 @@ typedef struct {
uint16_t Pdu_size;
} __attribute__ ((__packed__)) ULSCH_PDU;
/*! \brief Uplink SCH PDU Structure */
typedef struct {
int8_t payload[DCH_PAYLOAD_SIZE_MAX]; /*!< \brief SACH payload */
uint16_t Pdu_size;
} __attribute__ ((__packed__)) ULDCH_PDU;
#include "PHY/impl_defs_top.h"
/*!\brief RA process state*/
typedef enum {
IDLE = 0,
@@ -921,8 +924,8 @@ typedef struct {
///Contention resolution timer used during random access
uint8_t mac_ContentionResolutionTimer;
uint16_t max_rbs_allowed_slice[MAX_NUM_CCs][MAX_NUM_SLICES];
uint16_t max_rbs_allowed_slice_uplink[MAX_NUM_CCs][MAX_NUM_SLICES];
uint16_t max_rbs_allowed_slice[NFAPI_CC_MAX][MAX_NUM_SLICES];
uint16_t max_rbs_allowed_slice_uplink[NFAPI_CC_MAX][MAX_NUM_SLICES];
uint8_t max_mcs[MAX_NUM_LCID];
@@ -931,14 +934,14 @@ typedef struct {
// resource scheduling information
/// Current DL harq round per harq_pid on each CC
uint8_t round[MAX_NUM_CCs][10];
uint8_t round[NFAPI_CC_MAX][10];
/// Current Active TBs per harq_pid on each CC
uint8_t tbcnt[MAX_NUM_CCs][10];
uint8_t tbcnt[NFAPI_CC_MAX][10];
/// Current UL harq round per harq_pid on each CC
uint8_t round_UL[MAX_NUM_CCs][8];
uint8_t dl_pow_off[MAX_NUM_CCs];
uint16_t pre_nb_available_rbs[MAX_NUM_CCs];
unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX];
uint8_t round_UL[NFAPI_CC_MAX][8];
uint8_t dl_pow_off[NFAPI_CC_MAX];
uint16_t pre_nb_available_rbs[NFAPI_CC_MAX];
unsigned char rballoc_sub_UE[NFAPI_CC_MAX][N_RBG_MAX];
uint16_t ta_timer;
int16_t ta_update;
uint16_t ul_consecutive_errors;
@@ -1053,34 +1056,34 @@ typedef struct {
typedef struct {
/// Dedicated information for UEs
struct PhysicalConfigDedicated
*physicalConfigDedicated[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
*physicalConfigDedicated[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
/// DLSCH pdu
DLSCH_PDU DLSCH_pdu[MAX_NUM_CCs][2][NUMBER_OF_UE_MAX];
DLSCH_PDU DLSCH_pdu[NFAPI_CC_MAX][2][MAX_MOBILES_PER_ENB];
/// DCI template and MAC connection parameters for UEs
UE_TEMPLATE UE_template[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
UE_TEMPLATE UE_template[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
/// DCI template and MAC connection for RA processes
int pCC_id[NUMBER_OF_UE_MAX];
int pCC_id[MAX_MOBILES_PER_ENB];
/// sorted downlink component carrier for the scheduler
int ordered_CCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
int ordered_CCids[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
/// number of downlink active component carrier
int numactiveCCs[NUMBER_OF_UE_MAX];
int numactiveCCs[MAX_MOBILES_PER_ENB];
/// sorted uplink component carrier for the scheduler
int ordered_ULCCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
int ordered_ULCCids[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
/// number of uplink active component carrier
int numactiveULCCs[NUMBER_OF_UE_MAX];
int numactiveULCCs[MAX_MOBILES_PER_ENB];
/// number of downlink active component carrier
uint8_t dl_CC_bitmap[NUMBER_OF_UE_MAX];
uint8_t dl_CC_bitmap[MAX_MOBILES_PER_ENB];
/// eNB to UE statistics
eNB_UE_STATS eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
eNB_UE_STATS eNB_UE_stats[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
/// scheduling control info
UE_sched_ctrl UE_sched_ctrl[NUMBER_OF_UE_MAX];
int next[NUMBER_OF_UE_MAX];
UE_sched_ctrl UE_sched_ctrl[MAX_MOBILES_PER_ENB];
int next[MAX_MOBILES_PER_ENB];
int head;
int next_ul[NUMBER_OF_UE_MAX];
int next_ul[MAX_MOBILES_PER_ENB];
int head_ul;
int avail;
int num_UEs;
boolean_t active[NUMBER_OF_UE_MAX];
boolean_t active[MAX_MOBILES_PER_ENB];
/// Sorting criteria for the UE list in the MAC preprocessor
uint16_t sorting_criteria[MAX_NUM_SLICES][CR_NUM];
@@ -1161,84 +1164,82 @@ typedef struct {
/*! \brief top level eNB MAC structure */
typedef struct eNB_MAC_INST_s {
/// Ethernet parameters for northbound midhaul interface
eth_params_t eth_params_n;
/// Ethernet parameters for fronthaul interface
eth_params_t eth_params_s;
///
module_id_t Mod_id;
/// frame counter
frame_t frame;
/// subframe counter
sub_frame_t subframe;
/// Pointer to IF module instance for PHY
IF_Module_t *if_inst;
/// Common cell resources
COMMON_channels_t common_channels[MAX_NUM_CCs];
/// current PDU index (BCH,MCH,DLSCH)
uint16_t pdu_index[MAX_NUM_CCs];
/// flag to enable phy-test (disables the scheduler)
uint16_t phy_test;
/// NFAPI Config Request Structure
nfapi_config_request_t config[MAX_NUM_CCs];
/// Preallocated DL pdu list
nfapi_dl_config_request_pdu_t
dl_config_pdu_list[MAX_NUM_CCs][MAX_NUM_DL_PDU];
/// NFAPI DL Config Request Structure
nfapi_dl_config_request_t DL_req[MAX_NUM_CCs];
/// Preallocated UL pdu list
nfapi_ul_config_request_pdu_t
ul_config_pdu_list[MAX_NUM_CCs][MAX_NUM_UL_PDU];
/// Preallocated UL pdu list for ULSCH (n+k delay)
nfapi_ul_config_request_pdu_t
ul_config_pdu_list_tmp[MAX_NUM_CCs][10][MAX_NUM_UL_PDU];
/// NFAPI UL Config Request Structure, send to L1 4 subframes before processing takes place
nfapi_ul_config_request_t UL_req[MAX_NUM_CCs];
/// NFAPI "Temporary" UL Config Request Structure, holds future UL_config requests
nfapi_ul_config_request_t UL_req_tmp[MAX_NUM_CCs][10];
/// Preallocated HI_DCI0 pdu list
nfapi_hi_dci0_request_pdu_t
hi_dci0_pdu_list[MAX_NUM_CCs][MAX_NUM_HI_DCI0_PDU];
/// NFAPI HI/DCI0 Config Request Structure
nfapi_hi_dci0_request_t HI_DCI0_req[MAX_NUM_CCs];
/// Prealocated TX pdu list
nfapi_tx_request_pdu_t
tx_request_pdu[MAX_NUM_CCs][MAX_NUM_TX_REQUEST_PDU];
/// NFAPI DL PDU structure
nfapi_tx_request_t TX_req[MAX_NUM_CCs];
/// UL handle
uint32_t ul_handle;
UE_list_t UE_list;
///subband bitmap configuration
SBMAP_CONF sbmap_conf;
/// CCE table used to build DCI scheduling information
int CCE_table[MAX_NUM_CCs][800];
/// active flag for Other lcid
uint8_t lcid_active[NB_RB_MAX];
/// eNB stats
eNB_STATS eNB_stats[MAX_NUM_CCs];
// MAC function execution peformance profiler
/// processing time of eNB scheduler
time_stats_t eNB_scheduler;
/// processing time of eNB scheduler for SI
time_stats_t schedule_si;
/// processing time of eNB scheduler for Random access
time_stats_t schedule_ra;
/// processing time of eNB ULSCH scheduler
time_stats_t schedule_ulsch;
/// processing time of eNB DCI generation
time_stats_t fill_DLSCH_dci;
/// processing time of eNB MAC preprocessor
time_stats_t schedule_dlsch_preprocessor;
/// processing time of eNB DLSCH scheduler
time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor
/// processing time of eNB MCH scheduler
time_stats_t schedule_mch;
/// processing time of eNB ULSCH reception
time_stats_t rx_ulsch_sdu; // include rlc_data_ind
/// processing time of eNB PCH scheduler
time_stats_t schedule_pch;
eth_params_t eth_params_n;
/// Ethernet parameters for fronthaul interface
eth_params_t eth_params_s;
///
module_id_t Mod_id;
/// frame counter
frame_t frame;
/// subframe counter
sub_frame_t subframe;
/// Pointer to IF module instance for PHY
IF_Module_t *if_inst;
/// Common cell resources
COMMON_channels_t common_channels[NFAPI_CC_MAX];
/// current PDU index (BCH,MCH,DLSCH)
uint16_t pdu_index[NFAPI_CC_MAX];
/// NFAPI Config Request Structure
nfapi_config_request_t config[NFAPI_CC_MAX];
/// Preallocated DL pdu list
nfapi_dl_config_request_pdu_t
dl_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_DL_PDU];
/// NFAPI DL Config Request Structure
nfapi_dl_config_request_t DL_req[NFAPI_CC_MAX];
/// Preallocated UL pdu list
nfapi_ul_config_request_pdu_t
ul_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_UL_PDU];
/// Preallocated UL pdu list for ULSCH (n+k delay)
nfapi_ul_config_request_pdu_t
ul_config_pdu_list_tmp[NFAPI_CC_MAX][10][MAX_NUM_UL_PDU];
/// NFAPI UL Config Request Structure, send to L1 4 subframes before processing takes place
nfapi_ul_config_request_t UL_req[NFAPI_CC_MAX];
/// NFAPI "Temporary" UL Config Request Structure, holds future UL_config requests
nfapi_ul_config_request_t UL_req_tmp[NFAPI_CC_MAX][10];
/// Preallocated HI_DCI0 pdu list
nfapi_hi_dci0_request_pdu_t
hi_dci0_pdu_list[NFAPI_CC_MAX][MAX_NUM_HI_DCI0_PDU];
/// NFAPI HI/DCI0 Config Request Structure
nfapi_hi_dci0_request_t HI_DCI0_req[NFAPI_CC_MAX];
/// Prealocated TX pdu list
nfapi_tx_request_pdu_t
tx_request_pdu[NFAPI_CC_MAX][MAX_NUM_TX_REQUEST_PDU];
/// NFAPI DL PDU structure
nfapi_tx_request_t TX_req[NFAPI_CC_MAX];
/// UL handle
uint32_t ul_handle;
UE_list_t UE_list;
///subband bitmap configuration
SBMAP_CONF sbmap_conf;
/// CCE table used to build DCI scheduling information
int CCE_table[NFAPI_CC_MAX][800];
/// active flag for Other lcid
uint8_t lcid_active[NB_RB_MAX];
/// eNB stats
eNB_STATS eNB_stats[NFAPI_CC_MAX];
// MAC function execution peformance profiler
/// processing time of eNB scheduler
time_stats_t eNB_scheduler;
/// processing time of eNB scheduler for SI
time_stats_t schedule_si;
/// processing time of eNB scheduler for Random access
time_stats_t schedule_ra;
/// processing time of eNB ULSCH scheduler
time_stats_t schedule_ulsch;
/// processing time of eNB DCI generation
time_stats_t fill_DLSCH_dci;
/// processing time of eNB MAC preprocessor
time_stats_t schedule_dlsch_preprocessor;
/// processing time of eNB DLSCH scheduler
time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor
/// processing time of eNB MCH scheduler
time_stats_t schedule_mch;
/// processing time of eNB ULSCH reception
time_stats_t rx_ulsch_sdu; // include rlc_data_ind
/// processing time of eNB PCH scheduler
time_stats_t schedule_pch;
} eNB_MAC_INST;
/*
@@ -1377,27 +1378,26 @@ typedef struct {
uint32_t SL_LCID[MAX_NUM_LCID];
#endif
/// pointer to TDD Configuration (NULL for FDD)
TDD_Config_t *tdd_Config;
/// Number of adjacent cells to measure
uint8_t n_adj_cells;
/// Array of adjacent physical cell ids
uint32_t adj_cell_id[6];
/// Pointer to RRC MAC configuration
MAC_MainConfig_t *macConfig;
/// Pointer to RRC Measurement gap configuration
MeasGapConfig_t *measGapConfig;
/// Pointers to LogicalChannelConfig indexed by LogicalChannelIdentity. Note NULL means LCHAN is inactive.
LogicalChannelConfig_t *logicalChannelConfig[MAX_NUM_LCID];
/// Scheduling Information
UE_SCHEDULING_INFO scheduling_info;
/// Outgoing CCCH pdu for PHY
CCCH_PDU CCCH_pdu;
/// Outgoing RAR pdu for PHY
RAR_PDU RAR_pdu;
/// Incoming DLSCH pdu for PHY
DLSCH_PDU DLSCH_pdu[NUMBER_OF_UE_MAX][2];
/// pointer to TDD Configuration (NULL for FDD)
TDD_Config_t *tdd_Config;
/// Number of adjacent cells to measure
uint8_t n_adj_cells;
/// Array of adjacent physical cell ids
uint32_t adj_cell_id[6];
/// Pointer to RRC MAC configuration
MAC_MainConfig_t *macConfig;
/// Pointer to RRC Measurement gap configuration
MeasGapConfig_t *measGapConfig;
/// Pointers to LogicalChannelConfig indexed by LogicalChannelIdentity. Note NULL means LCHAN is inactive.
LogicalChannelConfig_t *logicalChannelConfig[MAX_NUM_LCID];
/// Scheduling Information
UE_SCHEDULING_INFO scheduling_info;
/// Outgoing CCCH pdu for PHY
CCCH_PDU CCCH_pdu;
/// Outgoing RAR pdu for PHY
RAR_PDU RAR_pdu;
/// Incoming DLSCH pdu for PHY
DLSCH_PDU DLSCH_pdu[MAX_MOBILES_PER_ENB][2];
#ifdef Rel14
int sltx_active;
SLSCH_t slsch;
@@ -1405,58 +1405,58 @@ typedef struct {
ULSCH_PDU slsch_pdu;
int slsch_lcid;
#endif
/// number of attempt for rach
uint8_t RA_attempt_number;
/// Random-access procedure flag
uint8_t RA_active;
/// Random-access window counter
int8_t RA_window_cnt;
/// Random-access Msg3 size in bytes
uint8_t RA_Msg3_size;
/// Random-access prachMaskIndex
uint8_t RA_prachMaskIndex;
/// Flag indicating Preamble set (A,B) used for first Msg3 transmission
uint8_t RA_usedGroupA;
/// Random-access Resources
PRACH_RESOURCES_t RA_prach_resources;
/// Random-access PREAMBLE_TRANSMISSION_COUNTER
uint8_t RA_PREAMBLE_TRANSMISSION_COUNTER;
/// Random-access backoff counter
int16_t RA_backoff_cnt;
/// Random-access variable for window calculation (frame of last change in window counter)
uint32_t RA_tx_frame;
/// Random-access variable for window calculation (subframe of last change in window counter)
uint8_t RA_tx_subframe;
/// Random-access Group B maximum path-loss
/// Random-access variable for backoff (frame of last change in backoff counter)
uint32_t RA_backoff_frame;
/// Random-access variable for backoff (subframe of last change in backoff counter)
uint8_t RA_backoff_subframe;
/// Random-access Group B maximum path-loss
uint16_t RA_maxPL;
/// Random-access Contention Resolution Timer active flag
uint8_t RA_contention_resolution_timer_active;
/// Random-access Contention Resolution Timer count value
uint8_t RA_contention_resolution_cnt;
/// power headroom reporitng reconfigured
uint8_t PHR_reconfigured;
/// power headroom state as configured by the higher layers
uint8_t PHR_state;
/// power backoff due to power management (as allowed by P-MPRc) for this cell
uint8_t PHR_reporting_active;
/// power backoff due to power management (as allowed by P-MPRc) for this cell
uint8_t power_backoff_db[NUMBER_OF_eNB_MAX];
/// BSR report falg management
uint8_t BSR_reporting_active;
/// retxBSR-Timer expires flag
uint8_t retxBSRTimer_expires_flag;
/// periodBSR-Timer expires flag
uint8_t periodBSRTimer_expires_flag;
/// number of attempt for rach
uint8_t RA_attempt_number;
/// Random-access procedure flag
uint8_t RA_active;
/// Random-access window counter
int8_t RA_window_cnt;
/// Random-access Msg3 size in bytes
uint8_t RA_Msg3_size;
/// Random-access prachMaskIndex
uint8_t RA_prachMaskIndex;
/// Flag indicating Preamble set (A,B) used for first Msg3 transmission
uint8_t RA_usedGroupA;
/// Random-access Resources
PRACH_RESOURCES_t RA_prach_resources;
/// Random-access PREAMBLE_TRANSMISSION_COUNTER
uint8_t RA_PREAMBLE_TRANSMISSION_COUNTER;
/// Random-access backoff counter
int16_t RA_backoff_cnt;
/// Random-access variable for window calculation (frame of last change in window counter)
uint32_t RA_tx_frame;
/// Random-access variable for window calculation (subframe of last change in window counter)
uint8_t RA_tx_subframe;
/// Random-access Group B maximum path-loss
/// Random-access variable for backoff (frame of last change in backoff counter)
uint32_t RA_backoff_frame;
/// Random-access variable for backoff (subframe of last change in backoff counter)
uint8_t RA_backoff_subframe;
/// Random-access Group B maximum path-loss
uint16_t RA_maxPL;
/// Random-access Contention Resolution Timer active flag
uint8_t RA_contention_resolution_timer_active;
/// Random-access Contention Resolution Timer count value
uint8_t RA_contention_resolution_cnt;
/// power headroom reporitng reconfigured
uint8_t PHR_reconfigured;
/// power headroom state as configured by the higher layers
uint8_t PHR_state;
/// power backoff due to power management (as allowed by P-MPRc) for this cell
uint8_t PHR_reporting_active;
/// power backoff due to power management (as allowed by P-MPRc) for this cell
uint8_t power_backoff_db[MAX_eNB];
/// BSR report falg management
uint8_t BSR_reporting_active;
/// retxBSR-Timer expires flag
uint8_t retxBSRTimer_expires_flag;
/// periodBSR-Timer expires flag
uint8_t periodBSRTimer_expires_flag;
/// MBSFN_Subframe Configuration
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; // FIXME replace 8 by MAX_MBSFN_AREA?
/// number of subframe allocation pattern available for MBSFN sync area
uint8_t num_sf_allocation_pattern;
/// MBSFN_Subframe Configuration
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; // FIXME replace 8 by MAX_MBSFN_AREA?
/// number of subframe allocation pattern available for MBSFN sync area
uint8_t num_sf_allocation_pattern;
#if defined(Rel10) || defined(Rel14)
/// number of active MBSFN area
uint8_t num_active_mbsfn_area;
@@ -1511,8 +1511,6 @@ typedef struct {
uint8_t n_adj_cells;
} neigh_cell_id_t;
#include "proto.h"
#include "mac_proto.h"
/*@}*/
#endif /*__LAYER2_MAC_DEFS_H__ */
@@ -32,10 +32,10 @@
#ifndef __MAC_EXTERN_H__
#define __MAC_EXTERN_H__
#include "PHY/defs.h"
#include "defs.h"
//#include "PHY/defs_common.h"
#include "mac.h"
#include "RRC/LITE/defs.h"
#include "RRC/LTE/rrc_defs.h"
extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE];
//extern uint32_t EBSR_Level[63];
@@ -52,8 +52,8 @@ extern UE_RRC_INST *UE_rrc_inst;
extern UE_MAC_INST *UE_mac_inst;
extern eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
extern eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
@@ -75,26 +75,5 @@ extern uint32_t RRC_CONNECTION_FLAG;
extern uint8_t rb_table[34];
extern DCI0_5MHz_TDD_1_6_t UL_alloc_pdu;
extern DCI1A_5MHz_TDD_1_6_t RA_alloc_pdu;
extern DCI1A_5MHz_TDD_1_6_t DLSCH_alloc_pdu1A;
extern DCI1A_5MHz_TDD_1_6_t BCCH_alloc_pdu;
extern DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
extern DCI1_5MHz_TDD_t DLSCH_alloc_pdu;
extern DCI0_5MHz_FDD_t UL_alloc_pdu_fdd;
extern DCI1A_5MHz_FDD_t DLSCH_alloc_pdu1A_fdd;
extern DCI1A_5MHz_FDD_t RA_alloc_pdu_fdd;
extern DCI1A_5MHz_FDD_t BCCH_alloc_pdu_fdd;
extern DCI1A_5MHz_FDD_t CCCH_alloc_pdu_fdd;
extern DCI1_5MHz_FDD_t DLSCH_alloc_pdu_fdd;
extern DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu1;
extern DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2;
extern DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E;
#endif //DEF_H
@@ -29,7 +29,8 @@
#ifndef __LAYER2_MAC_PROTO_H__
#define __LAYER2_MAC_PROTO_H__
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/mac.h"
#include "PHY/defs_common.h" // for PRACH_RESOURCES_t and lte_subframe_t
/** \addtogroup _mac
* @{
@@ -210,13 +211,13 @@ void dlsch_scheduler_pre_processor_reset(int module_idP, int UE_id,
int subframeP,
int N_RBG,
uint16_t
nb_rbs_required[MAX_NUM_CCs]
[NUMBER_OF_UE_MAX],
nb_rbs_required[NFAPI_CC_MAX]
[MAX_MOBILES_PER_ENB],
unsigned char
rballoc_sub[MAX_NUM_CCs]
rballoc_sub[NFAPI_CC_MAX]
[N_RBG_MAX],
unsigned char
MIMO_mode_indicator[MAX_NUM_CCs]
MIMO_mode_indicator[NFAPI_CC_MAX]
[N_RBG_MAX]);
// eNB functions
@@ -232,7 +233,7 @@ void dlsch_scheduler_pre_processor(module_id_t module_idP,
slice_id_t slice_idP,
frame_t frameP,
sub_frame_t subframe,
int N_RBG[MAX_NUM_CCs],
int N_RBG[NFAPI_CC_MAX],
int *mbsfn_flag);
@@ -243,19 +244,10 @@ void dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
int transmission_mode,
int min_rb_unit,
uint8_t N_RB_DL,
uint16_t
nb_rbs_required[MAX_NUM_CCs]
[NUMBER_OF_UE_MAX],
uint16_t
nb_rbs_required_remaining
[MAX_NUM_CCs]
[NUMBER_OF_UE_MAX],
unsigned char
rballoc_sub[MAX_NUM_CCs]
[N_RBG_MAX],
unsigned char
MIMO_mode_indicator
[MAX_NUM_CCs][N_RBG_MAX]);
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
uint16_t nb_rbs_required_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
unsigned char rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX],
unsigned char MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]);
/* \brief Function to trigger the eNB scheduling procedure. It is called by PHY at the beginning of each subframe, \f$n$\f
and generates all DLSCH allocations for subframe \f$n\f$ and ULSCH allocations for subframe \f$n+k$\f.
@@ -673,8 +665,6 @@ uint8_t *parse_ulsch_header(uint8_t * mac_header,
int to_prb(int);
int to_rbg(int);
int l2_init(LTE_DL_FRAME_PARMS * frame_parms, int eMBMS_active,
char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
int mac_init(void);
int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti, int harq_pid
#ifdef Rel14
@@ -32,8 +32,8 @@
#ifndef __MAC_VARS_H__
#define __MAC_VARS_H__
#include "PHY/defs.h"
#include "defs.h"
#include "PHY/defs_common.h"
#include "mac.h"
#include "COMMON/mac_rrc_primitives.h"
const uint32_t BSR_TABLE[BSR_TABLE_SIZE] =
@@ -103,8 +103,8 @@ int pCC_id[NUMBER_OF_eNB_MAX];
eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
#ifdef OPENAIR2
+9 -12
View File
@@ -29,21 +29,18 @@
*/
#include "defs.h"
#include "proto.h"
#include "extern.h"
#include "mac.h"
#include "mac_proto.h"
#include "mac_extern.h"
#include "assertions.h"
#include "PHY_INTERFACE/extern.h"
#include "PHY/defs.h"
#include "SCHED/defs.h"
//#include "PHY_INTERFACE/phy_extern.h"
//#include "PHY/defs_eNB.h"
//#include "SCHED/sched_eNB.h"
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
#include "RRC/LITE/defs.h"
#include "RRC/LTE/rrc_defs.h"
#include "UTIL/LOG/log.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "SCHED/defs.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
@@ -123,7 +120,7 @@ void mac_top_init_eNB(void)
UE_list->head_ul = -1;
UE_list->avail = 0;
for (list_el = 0; list_el < NUMBER_OF_UE_MAX - 1; list_el++) {
for (list_el = 0; list_el < MAX_MOBILES_PER_ENB - 1; list_el++) {
UE_list->next[list_el] = list_el + 1;
UE_list->next_ul[list_el] = list_el + 1;
}
@@ -147,7 +144,7 @@ void mac_init_cell_params(int Mod_idP, int CC_idP)
UE_template =
(UE_TEMPLATE *) & RC.mac[Mod_idP]->UE_list.UE_template[CC_idP][0];
for (j = 0; j < NUMBER_OF_UE_MAX; j++) {
for (j = 0; j < MAX_MOBILES_PER_ENB; 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,
+7 -9
View File
@@ -29,20 +29,18 @@
*/
#include "defs.h"
#include "proto.h"
#include "extern.h"
#include "mac.h"
#include "mac_proto.h"
#include "mac_extern.h"
#include "assertions.h"
#include "PHY_INTERFACE/extern.h"
#include "PHY/defs.h"
#include "SCHED/defs.h"
#include "PHY_INTERFACE/phy_interface_extern.h"
#include "PHY/defs_UE.h"
#include "SCHED_UE/sched_UE.h"
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
#include "RRC/LITE/defs.h"
#include "RRC/LTE/rrc_defs.h"
#include "UTIL/LOG/log.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "SCHED/defs.h"
#include "common/ran_context.h"
+57 -72
View File
@@ -33,24 +33,21 @@
#include <stdlib.h>
#include "assertions.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "rlc.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
#define DEBUG_eNB_SCHEDULER 1
#define DEBUG_HEADER_PARSING 1
@@ -107,7 +104,7 @@ store_dlsch_buffer(module_id_t Mod_id, slice_id_t slice_id, frame_t frameP,
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++) {
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (UE_list->active[UE_id] != TRUE)
continue;
@@ -196,8 +193,8 @@ assign_rbs_required(module_id_t Mod_id,
frame_t frameP,
sub_frame_t subframe,
uint16_t
nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
int min_rb_unit[MAX_NUM_CCs])
nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
int min_rb_unit[NFAPI_CC_MAX])
{
uint16_t TBS = 0;
@@ -208,7 +205,7 @@ assign_rbs_required(module_id_t Mod_id,
int N_RB_DL;
// clear rb allocations across all CC_id
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (UE_list->active[UE_id] != TRUE)
continue;
if (!ue_slice_membership(UE_id, slice_id))
@@ -231,7 +228,7 @@ assign_rbs_required(module_id_t Mod_id,
&UE_list->eNB_UE_stats[UE_list->
ordered_CCids[i][UE_id]][UE_id];
for (j = i + 1; j < UE_list->numactiveCCs[UE_id]; j++) {
DevAssert(j < MAX_NUM_CCs);
DevAssert(j < NFAPI_CC_MAX);
eNB_UE_stats_j =
&UE_list->
eNB_UE_stats[UE_list->ordered_CCids[j][UE_id]][UE_id];
@@ -315,7 +312,7 @@ maxround(module_id_t Mod_id, uint16_t rnti, int frame,
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
COMMON_channels_t *cc;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) {
cc = &RC.mac[Mod_id]->common_channels[CC_id];
@@ -490,14 +487,14 @@ void decode_sorting_policy(module_id_t Mod_idP, slice_id_t slice_id) {
void sort_UEs(module_id_t Mod_idP, slice_id_t slice_id, int frameP, sub_frame_t subframeP)
{
int i;
int list[NUMBER_OF_UE_MAX];
int list[MAX_MOBILES_PER_ENB];
int list_size = 0;
int rnti;
struct sort_ue_dl_params params = { Mod_idP, frameP, subframeP, slice_id };
UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list;
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (UE_list->active[i] == FALSE)
continue;
@@ -602,11 +599,11 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
slice_id_t slice_id,
frame_t frameP,
sub_frame_t subframeP,
int N_RBG[MAX_NUM_CCs],
int min_rb_unit[MAX_NUM_CCs],
uint8_t rballoc_sub[MAX_NUM_CCs][N_RBG_MAX],
uint8_t MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX],
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]) {
int N_RBG[NFAPI_CC_MAX],
int min_rb_unit[NFAPI_CC_MAX],
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX],
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX],
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]) {
int UE_id, CC_id;
@@ -614,22 +611,22 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
rnti_t rnti;
uint8_t harq_pid, round, transmission_mode;
uint8_t total_rbs_used[MAX_NUM_CCs];
uint8_t total_ue_count[MAX_NUM_CCs];
uint16_t average_rbs_per_user[MAX_NUM_CCs];
uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
uint16_t nb_rbs_required_remaining_1[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
uint8_t total_rbs_used[NFAPI_CC_MAX];
uint8_t total_ue_count[NFAPI_CC_MAX];
uint16_t average_rbs_per_user[NFAPI_CC_MAX];
uint16_t nb_rbs_required_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
uint16_t nb_rbs_required_remaining_1[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
int N_RB_DL;
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
UE_sched_ctrl *ue_sched_ctl;
COMMON_channels_t *cc;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) {
total_ue_count[CC_id] = 0;
total_rbs_used[CC_id] = 0;
average_rbs_per_user[CC_id] = 0;
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; ++UE_id) {
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; ++UE_id) {
nb_rbs_required_remaining[CC_id][UE_id] = 0;
}
}
@@ -820,9 +817,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
transmission_mode,
min_rb_unit
[CC_id],
to_prb(RC.mac
[Mod_id]->common_channels
[CC_id].mib->message.dl_Bandwidth),
to_prb(RC.mac[Mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth),
nb_rbs_required,
nb_rbs_required_remaining,
rballoc_sub,
@@ -1002,18 +997,18 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
slice_id_t slice_id,
frame_t frameP,
sub_frame_t subframeP,
int N_RBG[MAX_NUM_CCs],
int N_RBG[NFAPI_CC_MAX],
int *mbsfn_flag) {
int UE_id;
uint8_t CC_id;
uint16_t i, j;
uint8_t rballoc_sub[MAX_NUM_CCs][N_RBG_MAX];
uint8_t MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]; // If TM5 is revisited, we can move this inside accounting
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX];
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]; // If TM5 is revisited, we can move this inside accounting
int min_rb_unit[MAX_NUM_CCs];
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
int min_rb_unit[NFAPI_CC_MAX];
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
UE_sched_ctrl *ue_sched_ctl;
@@ -1030,14 +1025,14 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
UE_sched_ctrl *ue_sched_ctl1, *ue_sched_ctl2;
#endif
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) {
if (mbsfn_flag[CC_id] > 0) // If this CC is allocated for MBSFN skip it here
continue;
min_rb_unit[CC_id] = get_min_rb_unit(Mod_id, CC_id);
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; ++UE_id) {
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; ++UE_id) {
if (UE_list->active[UE_id] != TRUE)
continue;
@@ -1081,7 +1076,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
#ifdef TM5
// This has to be revisited!!!!
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) {
i1 = 0;
i2 = 0;
i3 = 0;
@@ -1155,13 +1150,13 @@ dlsch_scheduler_pre_processor_reset(int module_idP,
int frameP,
int subframeP,
int N_RBG,
uint16_t nb_rbs_required[MAX_NUM_CCs]
[NUMBER_OF_UE_MAX],
uint16_t nb_rbs_required[NFAPI_CC_MAX]
[MAX_MOBILES_PER_ENB],
unsigned char
rballoc_sub[MAX_NUM_CCs]
rballoc_sub[NFAPI_CC_MAX]
[N_RBG_MAX],
unsigned char
MIMO_mode_indicator[MAX_NUM_CCs]
MIMO_mode_indicator[NFAPI_CC_MAX]
[N_RBG_MAX])
{
int i, j;
@@ -1342,17 +1337,10 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
int transmission_mode,
int min_rb_unit,
uint8_t N_RB_DL,
uint16_t
nb_rbs_required[MAX_NUM_CCs]
[NUMBER_OF_UE_MAX],
uint16_t
nb_rbs_required_remaining
[MAX_NUM_CCs]
[NUMBER_OF_UE_MAX], unsigned char
rballoc_sub[MAX_NUM_CCs]
[N_RBG_MAX], unsigned char
MIMO_mode_indicator
[MAX_NUM_CCs][N_RBG_MAX])
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
uint16_t nb_rbs_required_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
unsigned char rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX],
unsigned char MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX])
{
int i;
@@ -1422,11 +1410,11 @@ ulsch_scheduler_pre_processor(module_id_t module_idP,
int16_t i;
uint16_t UE_id, n, r;
uint8_t CC_id, harq_pid;
uint16_t nb_allocated_rbs[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
total_allocated_rbs[MAX_NUM_CCs],
average_rbs_per_user[MAX_NUM_CCs];
int16_t total_remaining_rbs[MAX_NUM_CCs];
uint16_t total_ue_count[MAX_NUM_CCs];
uint16_t nb_allocated_rbs[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
total_allocated_rbs[NFAPI_CC_MAX],
average_rbs_per_user[NFAPI_CC_MAX];
int16_t total_remaining_rbs[NFAPI_CC_MAX];
uint16_t total_ue_count[NFAPI_CC_MAX];
rnti_t rnti = -1;
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
UE_TEMPLATE *UE_template = 0;
@@ -1444,7 +1432,7 @@ ulsch_scheduler_pre_processor(module_id_t module_idP,
// we need to distribute RBs among UEs
// step1: reset the vars
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) {
total_allocated_rbs[CC_id] = 0;
total_remaining_rbs[CC_id] = 0;
average_rbs_per_user[CC_id] = 0;
@@ -1617,7 +1605,7 @@ ulsch_scheduler_pre_processor(module_id_t module_idP,
/* this logging is wrong, ue_sched_ctl may not be valid here
* TODO: fix
*/
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) {
if (total_allocated_rbs[CC_id] > 0) {
LOG_D(MAC, "[eNB %d] total RB allocated for all UEs = %d/%d\n",
@@ -1648,7 +1636,7 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_id, int frameP,
int Ncp;
int N_RB_UL;
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (UE_list->active[i] != TRUE)
continue;
@@ -1676,14 +1664,11 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_id, int frameP,
// This is the actual CC_id in the list
CC_id = UE_list->ordered_ULCCids[n][UE_id];
if (CC_id >= MAX_NUM_CCs) {
LOG_E(MAC, "CC_id %u should be < %u, loop n=%u < numactiveULCCs[%u]=%u",
CC_id, MAX_NUM_CCs, n, UE_id, UE_list->numactiveULCCs[UE_id]);
}
AssertFatal(CC_id < MAX_NUM_CCs,
AssertFatal(CC_id < RC.nb_mac_CC[module_idP],
"CC_id %u should be < %u, loop n=%u < numactiveULCCs[%u]=%u",
CC_id, MAX_NUM_CCs, n, UE_id,
CC_id, NFAPI_CC_MAX, n, UE_id,
UE_list->numactiveULCCs[UE_id]);
UE_template = &UE_list->UE_template[CC_id][UE_id];
@@ -1845,14 +1830,14 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params)
void sort_ue_ul(module_id_t module_idP, int frameP, sub_frame_t subframeP)
{
int i;
int list[NUMBER_OF_UE_MAX];
int list[MAX_MOBILES_PER_ENB];
int list_size = 0;
int rnti;
struct sort_ue_ul_params params = { module_idP, frameP, subframeP };
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (UE_list->active[i] == FALSE)
continue;
if ((rnti = UE_RNTI(module_idP, i)) == NOT_A_RNTI)
+7 -59
View File
@@ -30,76 +30,24 @@
* \warning
*/
#include "extern.h"
#include "defs.h"
#include "proto.h"
#include "mac_extern.h"
#include "mac.h"
#include "mac_proto.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "PHY_INTERFACE/extern.h"
#include "SCHED/defs.h"
#include "PHY_INTERFACE/phy_interface_extern.h"
#include "SCHED_UE/sched_UE.h"
#include "COMMON/mac_rrc_primitives.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "UTIL/LOG/log.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
#ifdef PHY_EMUL
#include "SIMULATION/simulation_defs.h"
#endif
#include "SIMULATION/TOOLS/defs.h" // for taus
#include "SIMULATION/TOOLS/sim.h" // for taus
extern uint8_t nfapi_mode;
extern UE_MODE_t get_ue_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
int8_t get_DELTA_PREAMBLE(module_id_t module_idP,int CC_id)
{
AssertFatal(CC_id == 0,
"Transmission on secondary CCs is not supported yet\n");
uint8_t prachConfigIndex =
UE_mac_inst[module_idP].radioResourceConfigCommon->
prach_Config.prach_ConfigInfo.prach_ConfigIndex;
uint8_t preambleformat;
if (UE_mac_inst[module_idP].tdd_Config) { // TDD
if (prachConfigIndex < 20) {
preambleformat = 0;
} else if (prachConfigIndex < 30) {
preambleformat = 1;
} else if (prachConfigIndex < 40) {
preambleformat = 2;
} else if (prachConfigIndex < 48) {
preambleformat = 3;
} else {
preambleformat = 4;
}
} else { // FDD
preambleformat = prachConfigIndex >> 2;
}
switch (preambleformat) {
case 0:
case 1:
return (0);
case 2:
case 3:
return (-3);
case 4:
return (8);
default:
AssertFatal(1 == 0,
"[UE %d] ue_procedures.c: FATAL, Illegal preambleformat %d, prachConfigIndex %d\n",
module_idP, preambleformat, prachConfigIndex);
}
}
/// This routine implements Section 5.1.2 (UE Random Access Resource Selection) from 36.321
void
get_prach_resources(module_id_t module_idP,
+4 -4
View File
@@ -28,10 +28,10 @@
*/
#include "defs.h"
#include "proto.h"
#include "extern.h"
#include "SIMULATION/TOOLS/defs.h"
#include "mac.h"
#include "mac_proto.h"
#include "mac_extern.h"
#include "SIMULATION/TOOLS/sim.h"
#include "UTIL/LOG/log.h"
#include "OCG.h"
#include "OCG_extern.h"
+4 -4
View File
@@ -28,10 +28,10 @@
*/
#include "defs.h"
#include "proto.h"
#include "extern.h"
#include "SIMULATION/TOOLS/defs.h"
#include "mac.h"
#include "mac_proto.h"
#include "mac_extern.h"
#include "SIMULATION/TOOLS/sim.h"
#include "UTIL/LOG/log.h"
#include "OCG.h"
#include "OCG_extern.h"
+7 -14
View File
@@ -33,20 +33,16 @@
#include <pthread.h>
#endif
#include "extern.h"
#include "defs.h"
#include "proto.h"
#ifdef PHY_EMUL
#include "SIMULATION/PHY_EMULATION/impl_defs.h"
#else
#include "SCHED/defs.h"
#include "mac_extern.h"
#include "mac.h"
#include "mac_proto.h"
#include "SCHED_UE/sched_UE.h"
#include "PHY/impl_defs_top.h"
#endif
#include "PHY_INTERFACE/extern.h"
#include "PHY_INTERFACE/phy_interface_extern.h"
#include "COMMON/mac_rrc_primitives.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
@@ -54,9 +50,6 @@
#include "OCG_extern.h"
#include "openair2/PHY_INTERFACE/phy_stub_UE.h"
#ifdef PHY_EMUL
#include "SIMULATION/simulation_defs.h"
#endif
#include "pdcp.h"
#if defined(ENABLE_ITTI)
@@ -65,7 +58,7 @@
#include "assertions.h"
#include "SIMULATION/TOOLS/defs.h" // for taus
#include "SIMULATION/TOOLS/sim.h" // for taus
#define DEBUG_HEADER_PARSING 1
#define ENABLE_MAC_PAYLOAD_DEBUG 1
+15 -15
View File
@@ -36,8 +36,8 @@
#include "pdcp_util.h"
#include "pdcp_sequence_manager.h"
#include "LAYER2/RLC/rlc.h"
#include "LAYER2/MAC/extern.h"
#include "RRC/LITE/proto.h"
#include "LAYER2/MAC/mac_extern.h"
#include "RRC/LTE/rrc_proto.h"
#include "pdcp_primitives.h"
#include "OCG.h"
#include "OCG_extern.h"
@@ -406,7 +406,7 @@ boolean_t pdcp_data_req(
* so we return TRUE afterwards
*/
for (pdcp_uid=0; pdcp_uid< NUMBER_OF_UE_MAX;pdcp_uid++){
for (pdcp_uid=0; pdcp_uid< MAX_MOBILES_PER_ENB;pdcp_uid++){
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti )
break;
}
@@ -823,7 +823,7 @@ pdcp_data_ind(
* XXX Following two actions are identical, is there a merge error?
*/
for (pdcp_uid=0; pdcp_uid< NUMBER_OF_UE_MAX;pdcp_uid++){
for (pdcp_uid=0; pdcp_uid< MAX_MOBILES_PER_ENB;pdcp_uid++){
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti ){
break;
}
@@ -871,7 +871,7 @@ void pdcp_update_stats(const protocol_ctxt_t* const ctxt_pP){
// these stats are measured for both eNB and UE on per seond basis
for (rb_id =0; rb_id < NB_RB_MAX; rb_id ++){
for (pdcp_uid=0; pdcp_uid< NUMBER_OF_UE_MAX;pdcp_uid++){
for (pdcp_uid=0; pdcp_uid< MAX_MOBILES_PER_ENB;pdcp_uid++){
//printf("frame %d and subframe %d \n", pdcp_enb[ctxt_pP->module_id].frame, pdcp_enb[ctxt_pP->module_id].subframe);
// tx stats
if (Pdcp_stats_tx_window_ms[ctxt_pP->module_id][pdcp_uid] > 0 &&
@@ -1080,14 +1080,14 @@ pdcp_run (
void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP){
int i, ue_flag=1; //, ret=-1; to be decied later
for (i=0; i < NUMBER_OF_UE_MAX; i++){
for (i=0; i < MAX_MOBILES_PER_ENB; i++){
if (pdcp_enb[ctxt_pP->module_id].rnti[i] == ctxt_pP->rnti) {
ue_flag=-1;
break;
}
}
if (ue_flag == 1 ){
for (i=0; i < NUMBER_OF_UE_MAX ; i++){
for (i=0; i < MAX_MOBILES_PER_ENB ; i++){
if (pdcp_enb[ctxt_pP->module_id].rnti[i] == 0 ){
pdcp_enb[ctxt_pP->module_id].rnti[i]=ctxt_pP->rnti;
pdcp_enb[ctxt_pP->module_id].uid[i]=i;
@@ -1115,7 +1115,7 @@ pdcp_remove_UE(
int i;
// check and remove SRBs first
for(int i = 0;i<NUMBER_OF_UE_MAX;i++){
for(int i = 0;i<MAX_MOBILES_PER_ENB;i++){
if(pdcp_eNB_UE_instance_to_rnti[i] == ctxt_pP->rnti){
pdcp_eNB_UE_instance_to_rnti[i] = NOT_A_RNTI;
break;
@@ -1136,7 +1136,7 @@ pdcp_remove_UE(
(void)h_rc; /* remove gcc warning "set but not used" */
// remove ue for pdcp enb inst
for (i=0; i < NUMBER_OF_UE_MAX; i++) {
for (i=0; i < MAX_MOBILES_PER_ENB; i++) {
if (pdcp_enb[ctxt_pP->module_id].rnti[i] == ctxt_pP->rnti ) {
LOG_I(PDCP, "remove uid is %d/%d %x\n", i,
pdcp_enb[ctxt_pP->module_id].uid[i],
@@ -1573,16 +1573,16 @@ pdcp_config_req_asn1 (
//pdcp_eNB_UE_instance_to_rnti[ctxtP->module_id] = ctxt_pP->rnti;
// pdcp_eNB_UE_instance_to_rnti[pdcp_eNB_UE_instance_to_rnti_index] = ctxt_pP->rnti;
if( srb_flagP == SRB_FLAG_NO ) {
for(int i = 0;i<NUMBER_OF_UE_MAX;i++){
for(int i = 0;i<MAX_MOBILES_PER_ENB;i++){
if(pdcp_eNB_UE_instance_to_rnti[pdcp_eNB_UE_instance_to_rnti_index] == NOT_A_RNTI){
break;
}
pdcp_eNB_UE_instance_to_rnti_index = (pdcp_eNB_UE_instance_to_rnti_index + 1) % NUMBER_OF_UE_MAX;
pdcp_eNB_UE_instance_to_rnti_index = (pdcp_eNB_UE_instance_to_rnti_index + 1) % MAX_MOBILES_PER_ENB;
}
pdcp_eNB_UE_instance_to_rnti[pdcp_eNB_UE_instance_to_rnti_index] = ctxt_pP->rnti;
pdcp_eNB_UE_instance_to_rnti_index = (pdcp_eNB_UE_instance_to_rnti_index + 1) % NUMBER_OF_UE_MAX;
pdcp_eNB_UE_instance_to_rnti_index = (pdcp_eNB_UE_instance_to_rnti_index + 1) % MAX_MOBILES_PER_ENB;
}
//pdcp_eNB_UE_instance_to_rnti_index = (pdcp_eNB_UE_instance_to_rnti_index + 1) % NUMBER_OF_UE_MAX;
//pdcp_eNB_UE_instance_to_rnti_index = (pdcp_eNB_UE_instance_to_rnti_index + 1) % MAX_MOBILES_PER_ENB;
} else {
pdcp_pP->is_ue = TRUE;
pdcp_UE_UE_module_id_to_rnti[ctxt_pP->module_id] = ctxt_pP->rnti;
@@ -2030,7 +2030,7 @@ void pdcp_layer_init(void)
pdcp_coll_p = hashtable_create ((maxDRB + 2) * 16, NULL, pdcp_free);
AssertFatal(pdcp_coll_p != NULL, "UNRECOVERABLE error, PDCP hashtable_create failed");
for (instance = 0; instance < NUMBER_OF_UE_MAX; instance++) {
for (instance = 0; instance < MAX_MOBILES_PER_ENB; instance++) {
#if defined(Rel10) || defined(Rel14)
for (service_id = 0; service_id < maxServiceCount; service_id++) {
@@ -2068,7 +2068,7 @@ void pdcp_layer_init(void)
memset(Pdcp_stats_tx_window_ms, 0, sizeof(Pdcp_stats_tx_window_ms));
memset(Pdcp_stats_rx_window_ms, 0, sizeof(Pdcp_stats_rx_window_ms));
for (i =0; i< MAX_NUM_CCs ; i ++){
for (j=0; j< NUMBER_OF_UE_MAX;j++){
for (j=0; j< MAX_MOBILES_PER_ENB;j++){
Pdcp_stats_tx_window_ms[i][j]=100;
Pdcp_stats_rx_window_ms[i][j]=100;
}
+38 -38
View File
@@ -67,7 +67,7 @@
#include "UTIL/LISTS/list.h"
#endif //NON_ACCESS_STRATUM
//-----------------------------------------------------------------------------
#include "RRC/LITE/defs.h"
#include "RRC/LTE/rrc_defs.h"
#include "COMMON/platform_constants.h"
#include "COMMON/platform_types.h"
#include "DRB-ToAddMod.h"
@@ -94,34 +94,34 @@ extern int pdcp_instance_cnt;
int init_pdcp_thread(void);
void cleanup_pdcp_thread(void);
public_pdcp(uint32_t Pdcp_stats_tx_window_ms[MAX_NUM_CCs][NUMBER_OF_UE_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_bytes[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_bytes_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_bytes_tmp_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_tmp_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_sn[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_throughput_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_aiat[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_aiat_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_aiat_tmp_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_iat[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_window_ms[MAX_NUM_CCs][MAX_MOBILES_PER_ENB]);
public_pdcp(uint32_t Pdcp_stats_tx_bytes[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_bytes_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_bytes_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_sn[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_throughput_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_aiat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_aiat_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_aiat_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_iat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_window_ms[MAX_NUM_CCs][NUMBER_OF_UE_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_tmp_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_bytes[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_bytes_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_bytes_tmp_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_sn[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_goodput_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_aiat[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_aiat_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_aiat_tmp_w[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_iat[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_outoforder[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_window_ms[MAX_NUM_CCs][MAX_MOBILES_PER_ENB]);
public_pdcp(uint32_t Pdcp_stats_rx[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_bytes[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_bytes_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_bytes_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_sn[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_goodput_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_aiat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_aiat_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_aiat_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_iat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_rx_outoforder[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]);
public_pdcp(void pdcp_update_perioidical_stats(const protocol_ctxt_t* const ctxt_pP));
@@ -131,8 +131,8 @@ public_pdcp(void pdcp_update_perioidical_stats(const protocol_ctxt_t* const ctx
//public_pdcp(uint64_t *pdcp_size_packet);
typedef struct pdcp_enb_s {
// used for eNB stats generation
uint16_t uid[NUMBER_OF_UE_MAX];
rnti_t rnti[NUMBER_OF_UE_MAX];
uint16_t uid[MAX_MOBILES_PER_ENB];
rnti_t rnti[MAX_MOBILES_PER_ENB];
uint16_t num_ues;
uint64_t sfn;
@@ -532,19 +532,19 @@ typedef struct pdcp_missing_pdu_info_t {
protected_pdcp(signed int pdcp_2_nas_irq;)
public_pdcp(pdcp_stats_t UE_pdcp_stats[NUMBER_OF_UE_MAX];)
public_pdcp(pdcp_stats_t UE_pdcp_stats[MAX_MOBILES_PER_ENB];)
public_pdcp(pdcp_stats_t eNB_pdcp_stats[NUMBER_OF_eNB_MAX];)
//protected_pdcp(pdcp_t pdcp_array_srb_ue[NUMBER_OF_UE_MAX][2];)
//protected_pdcp(pdcp_t pdcp_array_drb_ue[NUMBER_OF_UE_MAX][maxDRB];)
//public_pdcp(pdcp_t pdcp_array_srb_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][2];)
//protected_pdcp(pdcp_t pdcp_array_drb_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][maxDRB];)
//protected_pdcp(pdcp_t pdcp_array_srb_ue[MAX_MOBILES_PER_ENB][2];)
//protected_pdcp(pdcp_t pdcp_array_drb_ue[MAX_MOBILES_PER_ENB][maxDRB];)
//public_pdcp(pdcp_t pdcp_array_srb_eNB[NUMBER_OF_eNB_MAX][MAX_MOBILES_PER_ENB][2];)
//protected_pdcp(pdcp_t pdcp_array_drb_eNB[NUMBER_OF_eNB_MAX][MAX_MOBILES_PER_ENB][maxDRB];)
// for UE code conly
protected_pdcp(rnti_t pdcp_UE_UE_module_id_to_rnti[NUMBER_OF_UE_MAX];)
protected_pdcp(rnti_t pdcp_eNB_UE_instance_to_rnti[NUMBER_OF_UE_MAX];) // for noS1 mode
protected_pdcp(rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB];)
protected_pdcp(rnti_t pdcp_eNB_UE_instance_to_rnti[MAX_MOBILES_PER_ENB];) // for noS1 mode
protected_pdcp(unsigned int pdcp_eNB_UE_instance_to_rnti_index;)
#if defined(Rel10) || defined(Rel14)
public_pdcp(pdcp_mbms_t pdcp_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_pdcp(pdcp_mbms_t pdcp_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_pdcp(pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
#endif
protected_pdcp(sdu_size_t pdcp_output_sdu_bytes_to_write;)
+4 -4
View File
@@ -46,10 +46,10 @@ extern int otg_enabled;
#define rtf_put write
#define rtf_get read
#include "../MAC/extern.h"
#include "../MAC/mac_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "NETWORK_DRIVER/LITE/constant.h"
#include "SIMULATION/ETH_TRANSPORT/extern.h"
//#include "SIMULATION/ETH_TRANSPORT/extern.h"
#include "UTIL/OCG/OCG.h"
#include "UTIL/OCG/OCG_extern.h"
#include "UTIL/LOG/log.h"
@@ -74,7 +74,7 @@ extern struct nlmsghdr *nas_nlh_rx;
extern struct iovec nas_iov_tx;
extern struct iovec nas_iov_rx;
#ifdef UE_NAS_USE_TUN
extern int nas_sock_fd[NUMBER_OF_UE_MAX];
extern int nas_sock_fd[MAX_MOBILES_PER_ENB];
#else
extern int nas_sock_fd;
#endif
@@ -1178,7 +1178,7 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP)
ctxt_pP->subframe,
ctxt_pP->module_id);
for (dst_id = 0; dst_id<NUMBER_OF_UE_MAX; dst_id++) {
for (dst_id = 0; dst_id<MAX_MOBILES_PER_ENB; dst_id++) {
ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt.module_id][dst_id];
}
}
+1 -1
View File
@@ -55,7 +55,7 @@
#include "UTIL/LOG/log.h"
#include "UTIL/OCG/OCG.h"
#include "UTIL/OCG/OCG_extern.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "pdcp.h"
#include "pdcp_primitives.h"
+1 -1
View File
@@ -34,7 +34,7 @@
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "pdcp.h"
#include "msc.h"
+1 -1
View File
@@ -37,7 +37,7 @@
#include "mac_primitives.h"
#include "rlc_primitives.h"
#include "list.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UL-AM-RLC.h"
#include "DL-AM-RLC.h"
+1
View File
@@ -71,6 +71,7 @@
# include "rlc_am_reassembly.h"
# include "rlc_am_init.h"
# include "RLC-Config.h"
# include "assertions.h"
//# include "rlc_am_test.h"
@@ -30,7 +30,7 @@
#define RLC_AM_IN_SDU_C 1
//-----------------------------------------------------------------------------
#include "rlc_am.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#define TRACE_RLC_AM_FREE_SDU 0
+1 -1
View File
@@ -24,7 +24,7 @@
#include <string.h>
//-----------------------------------------------------------------------------
#include "rlc_am.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
//-----------------------------------------------------------------------------
void
+1 -1
View File
@@ -55,7 +55,7 @@
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "PHY/defs.h"
//#include "PHY/defs.h"
/*! \struct rlc_am_info_t
@@ -30,7 +30,7 @@
#include "rlc.h"
#include "rlc_am.h"
#include "list.h"
#include "LAYER2/MAC/extern.h"
//#include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h"
#include "msc.h"
@@ -28,7 +28,7 @@
#include "rlc.h"
#include "rlc_am.h"
#include "list.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
@@ -26,7 +26,7 @@
//-----------------------------------------------------------------------------
#include "rlc_am.h"
#include "rlc.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "msc.h"
//-----------------------------------------------------------------------------
@@ -27,7 +27,7 @@
#include "assertions.h"
#include "list.h"
#include "rlc_am.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
@@ -56,7 +56,7 @@
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "PHY/defs.h"
//#include "PHY/defs.h"
//-----------------------------------------------------------------------------
/*! \fn rlc_am_rx_pdu_status_t rlc_am_rx_list_check_duplicate_insert_pdu(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* const rlc_pP,mem_block_t* const tb_pP)
@@ -29,7 +29,7 @@
#include "msc.h"
#include "list.h"
#include "rlc_am.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
//-----------------------------------------------------------------------------
@@ -32,7 +32,6 @@
#include "assertions.h"
#include "list.h"
#include "rlc_am.h"
#include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h"
# if ENABLE_ITTI
@@ -55,7 +55,7 @@
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "PHY/defs.h"
//#include "PHY/defs.h"
//-----------------------------------------------------------------------------
/*! \fn uint16_t rlc_am_read_bit_field (uint8_t** dataP, unsigned int* bit_posP, const signed int bits_to_readP)
@@ -27,7 +27,7 @@
#include "platform_constants.h"
//-----------------------------------------------------------------------------
#include "rlc_am.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "msc.h"
//-----------------------------------------------------------------------------
@@ -26,7 +26,7 @@
#include "platform_constants.h"
//-----------------------------------------------------------------------------
#include "rlc_am.h"
# include "LAYER2/MAC/extern.h"
# include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "msc.h"
//-----------------------------------------------------------------------------
@@ -26,7 +26,7 @@
#include "platform_constants.h"
//-----------------------------------------------------------------------------
#include "rlc_am.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "msc.h"
//-----------------------------------------------------------------------------
+1 -1
View File
@@ -29,7 +29,7 @@
#include "mac_primitives.h"
#include "rlc_primitives.h"
#include "list.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
//-----------------------------------------------------------------------------
void
rlc_tm_send_sdu (
+1 -1
View File
@@ -23,7 +23,7 @@
#define RLC_TM_INIT_C 1
//-----------------------------------------------------------------------------
#include "rlc_tm.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
//-----------------------------------------------------------------------------
void config_req_rlc_tm (
const protocol_ctxt_t* const ctxt_pP,
+1 -1
View File
@@ -35,7 +35,7 @@
#include "list.h"
#include "rlc_primitives.h"
#include "mac_primitives.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
@@ -28,7 +28,7 @@
#include "rlc_primitives.h"
#include "list.h"
#include "rrm_config_structs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "rlc_um_control_primitives.h"
+1 -1
View File
@@ -24,7 +24,7 @@
#include "platform_types.h"
//-----------------------------------------------------------------------------
#include "rlc_um.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
@@ -33,7 +33,7 @@
#include "rlc_um.h"
#include "rlc_primitives.h"
#include "list.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "msc.h"
+2 -2
View File
@@ -29,7 +29,7 @@
#define RLC_C
#include "rlc.h"
#include "mem_block.h"
#include "../MAC/extern.h"
#include "../MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/OCG/OCG_vars.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
@@ -624,7 +624,7 @@ rlc_module_init (void)
rlc_coll_p = hashtable_create ((maxDRB + 2) * 16, NULL, rb_free_rlc_union);
AssertFatal(rlc_coll_p != NULL, "UNRECOVERABLE error, RLC hashtable_create failed");
for (module_id1=0; module_id1 < NUMBER_OF_UE_MAX; module_id1++) {
for (module_id1=0; module_id1 < MAX_MOBILES_PER_ENB; module_id1++) {
#if defined(Rel10) || defined(Rel14)
for (k=0; k < RLC_MAX_MBMS_LC; k++) {
+7 -7
View File
@@ -47,7 +47,7 @@
# include "asn1_constants.h"
# include "UTIL/LOG/log.h"
# include "mem_block.h"
# include "PHY/defs.h"
//# include "PHY/defs.h"
# include "RLC-Config.h"
# include "DRB-ToAddMod.h"
# include "DRB-ToAddModList.h"
@@ -174,7 +174,7 @@ typedef struct {
//-----------------------------------------------------------------------------
#define RLC_MAX_MBMS_LC (maxSessionPerPMCH * maxServiceCount)
#define RLC_MAX_LC ((max_val_DRB_Identity+1)* NUMBER_OF_UE_MAX)
#define RLC_MAX_LC ((max_val_DRB_Identity+1)* MAX_MOBILES_PER_ENB)
protected_rlc(void (*rlc_rrc_data_ind)(
const protocol_ctxt_t* const ctxtP,
@@ -234,10 +234,10 @@ typedef struct rlc_mbms_id_s {
# define maxSessionPerPMCH 1
# endif
#endif
//public_rlc(rlc_mbms_t rlc_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
//public_rlc(rlc_mbms_t rlc_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
//public_rlc(rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[NUMBER_OF_UE_MAX][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[NUMBER_OF_eNB_MAX][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[MAX_MOBILES_PER_ENB][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
#define rlc_mbms_enb_get_lcid_by_rb_id(Enb_mOD,rB_iD) rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD]
;
@@ -253,8 +253,8 @@ public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[NUMBER_OF_e
rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD] = lOG_cH_iD; \
} while (0);
public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_ue [NUMBER_OF_UE_MAX][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_eNB[NUMBER_OF_eNB_MAX][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_ue [MAX_MOBILES_PER_ENB][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_eNB[MAX_eNB][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
#define RLC_COLL_KEY_VALUE(eNB_iD, rNTI, iS_eNB, rB_iD, iS_sRB) \
+1 -1
View File
@@ -30,7 +30,7 @@
//-----------------------------------------------------------------------------
#define RLC_MAC_C
#include "rlc.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/OCG/OCG_vars.h"
#include "hashtable.h"
+1 -1
View File
@@ -43,7 +43,7 @@
#include "PMCH-InfoList-r9.h"
#endif
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "assertions.h"
//-----------------------------------------------------------------------------
rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
+2 -2
View File
@@ -32,8 +32,8 @@
#include <inttypes.h>
#include "LAYER2/RLC/rlc.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
#include "UTIL/LOG/log.h"
#include "common/ran_context.h"
+1 -1
View File
@@ -52,7 +52,7 @@
#define UE_IP_NB_INSTANCES_MAX NUMBER_OF_UE_MAX
#define UE_IP_NB_INSTANCES_MAX MAX_MOBILES_PER_ENB
#endif
+4 -4
View File
@@ -1,8 +1,8 @@
#include "openair1/PHY/defs.h"
#include "openair1/PHY/defs_eNB.h"
#include "openair2/PHY_INTERFACE/IF_Module.h"
#include "openair1/PHY/extern.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/proto.h"
#include "openair1/PHY/phy_extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/mac_proto.h"
#include "common/ran_context.h"
#define MAX_IF_MODULES 100
+3 -2
View File
@@ -34,9 +34,10 @@
#include <stdint.h>
#include "openair1/PHY/LTE_TRANSPORT/defs.h"
//#include "openair1/PHY/LTE_TRANSPORT/transport_eNB.h"
#include "nfapi_interface.h"
#include "platform_constants.h"
#include "platform_types.h"
#define MAX_NUM_DL_PDU 100
#define MAX_NUM_UL_PDU 100
-373
View File
@@ -1,373 +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.1 (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
*/
/*! \file PHY_INTERFACE/defs.h
* \brief mac phy interface primitives
* \author Raymond Knopp and Navid Nikaein
* \date 2011
* \version 0.5
* \mail navid.nikaein@eurecom.fr or openair_tech@eurecom.fr
*/
#ifndef __MAC_PHY_PRIMITIVES_H__
# define __MAC_PHY_PRIMITIVES_H__
#include "LAYER2/MAC/defs.h"
#define MAX_NUMBER_OF_MAC_INSTANCES 16
#define NULL_PDU 255
#define DCI 0
#define DLSCH 1
#define ULSCH 2
#define mac_exit_wrapper(sTRING) \
do { \
char temp[300]; \
snprintf(temp, sizeof(temp), "%s in file "__FILE__" at line %d\n", sTRING, __LINE__); \
mac_xface->macphy_exit(temp); \
} while(0)
/** @defgroup _phy_if MAC-PHY interface
* @ingroup _oai2
* @{
*/
/*! \brief MACPHY Interface */
/*
typedef struct {
/// Pointer function that initializes L2
int (*macphy_init)(int eMBMS_active, char *uecap_xer, uint8_t CBA_active,uint8_t HO_active);
/// Pointer function that stops the low-level scheduler due an exit condition
void (*macphy_exit)(const char *);
// eNB functions
/// Invoke dlsch/ulsch scheduling procedure for new subframe
void (*eNB_dlsch_ulsch_scheduler)(module_id_t Mod_id,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP);//, int calibration_flag);
/// Fill random access response sdu, passing timing advance
uint16_t (*fill_rar)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t *dlsch_buffer,uint16_t N_RB_UL, uint8_t input_buffer_length);
/// Initiate the RA procedure upon reception (hypothetical) of a valid preamble
void (*initiate_ra_proc)(module_id_t Mod_id,int CC_id,frame_t frameP,uint16_t preamble,int16_t timing_offset,uint8_t sect_id,sub_frame_t subframe,uint8_t f_id);
/// cancel an ongoing RA procedure
void (*cancel_ra_proc)(module_id_t Mod_id,int CC_id,frame_t frameP,uint16_t preamble);
/// Inform MAC layer that an uplink is scheduled for Msg3 in given subframe.
/// This is used so that the MAC scheduler marks as busy the RBs used by the Msg3.
void (*set_msg3_subframe)(module_id_t Mod_id,
int CC_id,
int frame,
int subframe,
int rnti,
int Msg3_frame,
int Msg3_subframe);
/// Get DCI for current subframe from MAC
DCI_PDU* (*get_dci_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe);
/// Get DLSCH sdu for particular RNTI and Transport block index
uint8_t* (*get_dlsch_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,uint8_t TB_index);
/// Send ULSCH sdu to MAC for given rnti
void (*rx_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP, sub_frame_t sub_frameP,rnti_t rnti, uint8_t *sdu,uint16_t sdu_len, int harq_pid,uint8_t *msg3_flag);
/// Indicate failure to synch to external source
void (*mrbch_phy_sync_failure) (module_id_t Mod_id,frame_t frameP, uint8_t free_eNB_index);
/// Indicate Scheduling Request from UE
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,
uint8_t SIwindowsize,
uint16_t SIperiod);
/// Configure Common PHY parameters from SIB2
void (*phy_config_sib2_eNB)(module_id_t Mod_id, int CC_id,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
#if defined(Rel10) || defined(Rel14)
/// Configure Common PHY parameters from SIB13
void (*phy_config_sib13_eNB)(module_id_t Mod_id,int CC_id, int mbsfn_Area_idx,
long mbsfn_AreaId_r9);
void (*phy_config_dedicated_scell_eNB)(uint8_t Mod_id,
uint16_t rnti,
SCellToAddMod_r10_t *sCellToAddMod_r10,
int CC_id);
#endif
/// PHY-Config-Dedicated eNB
void (*phy_config_dedicated_eNB)(module_id_t Mod_id,int CC_id,rnti_t rnti,
struct PhysicalConfigDedicated *physicalConfigDedicated);
#if defined(Rel10) || defined(Rel14)
/// Get MCH sdu and corresponding MCS for particular MBSFN subframe
MCH_PDU* (*get_mch_sdu)(module_id_t Mod_id, int CC_id, frame_t frameP,sub_frame_t subframe);
#endif
// configure the cba rnti at the physical layer
void (*phy_config_cba_rnti)(module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, uint16_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups);
/// get delta mcs for fast UL AMC
int16_t (*estimate_ue_tx_power)(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
int (*mac_phy_remove_ue)(module_id_t Mod_idP,rnti_t rntiP);
/// UE functions
/// reset the ue phy
void (*phy_reset_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Indicate loss of synchronization of PBCH for this eNB to MAC layer
void (*out_of_sync_ind)(module_id_t Mod_id,frame_t frameP,uint16_t eNB_index);
/// Send a received SI sdu
void (*ue_decode_si)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
/// Send a received Paging sdu
void (*ue_decode_p)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
/// Send a received DLSCH sdu to MAC
void (*ue_send_sdu)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,sub_frame_t subframe,uint8_t *sdu,uint16_t sdu_len,uint8_t CH_index);
#if defined(Rel10) || defined(Rel14)
/// Send a received MCH sdu to MAC
void (*ue_send_mch_sdu)(module_id_t Mod_id,uint8_t CC_id, frame_t frameP,uint8_t *sdu,uint16_t sdu_len,uint8_t eNB_index,uint8_t sync_area);
/// Function to check if UE PHY needs to decode MCH for MAC
/// get the sync area id, and return MCS value if need to decode, otherwise -1
int (*ue_query_mch)(module_id_t Mod_id, uint8_t CC_id,frame_t frameP,sub_frame_t subframe,uint8_t eNB_index,uint8_t *sync_area, uint8_t *mcch_active);
#endif
/// Retrieve ULSCH sdu from MAC
void (*ue_get_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe, uint8_t CH_index,uint8_t *ulsch_buffer,uint16_t buflen,uint8_t *access_mode);
/// Retrieve RRCConnectionReq from MAC
PRACH_RESOURCES_t* (*ue_get_rach)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t Msg3_flag,sub_frame_t subframe);
/// Process Random-Access Response
uint16_t (*ue_process_rar)(module_id_t Mod_id,int CC_id,frame_t frameP, uint16_t ra_rnti, uint8_t *dlsch_buffer, uint16_t *t_crnti,uint8_t preamble_index, uint8_t* selected_rar_buffer);
/// Get SR payload (0,1) from UE MAC
uint32_t (*ue_get_SR)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t eNB_id,rnti_t rnti,sub_frame_t subframe);
/// Indicate synchronization with valid PBCH
void (*dl_phy_sync_success) (module_id_t Mod_id,frame_t frameP, uint8_t CH_index,uint8_t first_sync);
/// Only calls the PDCP for now
UE_L2_STATE_t (*ue_scheduler)(module_id_t Mod_id, frame_t rxFrameP,sub_frame_t rxSubframe, frame_t txFrameP,sub_frame_t txSubframe, lte_subframe_t direction, uint8_t eNB_id, int CC_id);
/// PHY-Config-Dedicated UE
void (*phy_config_dedicated_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
struct PhysicalConfigDedicated *physicalConfigDedicated);
/// PHY-Config-harq UE
void (*phy_config_harq_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
uint16_t max_harq_tx);
/// Configure Common PHY parameters from SIB1
void (*phy_config_sib1_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
TDD_Config_t *tdd_config,
uint8_t SIwindowsize,
uint16_t SIperiod);
/// Configure Common PHY parameters from SIB2
void (*phy_config_sib2_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
#if defined(Rel10) || defined(Rel14)
/// Configure Common PHY parameters from SIB13
void (*phy_config_sib13_ue)(uint8_t Mod_id,int CC_id, uint8_t eNB_index,int mbsfn_Area_idx,
long mbsfn_AreaId_r9);
void (*phy_config_dedicated_scell_ue)(uint8_t Mod_id,
uint8_t eNB_index,
SCellToAddMod_r10_t *sCellToAddMod_r10,
int CC_id);
#endif
/// Configure Common PHY parameters from mobilityControlInfo
void (*phy_config_afterHO_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
MobilityControlInfo_t *mobilityControlInfo,
uint8_t ho_failed);
/// Function to indicate failure of contention resolution or RA procedure
void (*ra_failed)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
/// Function to indicate success of contention resolution or RA procedure
void (*ra_succeeded)(module_id_t Mod_id,uint8_t CC_id, uint8_t eNB_index);
/// Function to indicate the transmission of msg1/rach to MAC
void (*Msg1_transmitted)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,uint8_t eNB_id);
/// Function to indicate Msg3 transmission/retransmission which initiates/reset Contention Resolution Timer
void (*Msg3_transmitted)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,uint8_t eNB_id);
/// Function to pass inter-cell measurement parameters to PHY (cell Ids)
void (*phy_config_meas_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n_adj_cells,uint32_t *adj_cell_id);
// PHY Helper Functions
/// RIV computation from PHY
uint16_t (*computeRIV)(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
/// Downlink TBS table lookup from PHY
uint32_t (*get_TBS_DL)(uint8_t mcs, uint16_t nb_rb);
/// Uplink TBS table lookup from PHY
uint32_t (*get_TBS_UL)(uint8_t mcs, uint16_t nb_rb);
/// Function to retrieve the HARQ round index for a particular UL/DLSCH and harq_pid
int (*get_ue_active_harq_pid)(module_id_t Mod_id, uint8_t CC_id,rnti_t rnti, int frame, uint8_t subframe, uint8_t *harq_pid, uint8_t *round, uint8_t ul_flag);
/// Function to retrieve number of CCE
uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe);
int (*get_nCCE_offset)(int *CCE_table,
const unsigned char L,
const int nCCE,
const int common_dci,
const unsigned short rnti,
const unsigned char subframe);
/// Function to retrieve number of PRB in an rb_alloc
uint32_t (*get_nb_rb)(uint8_t ra_header, uint32_t rb_alloc, int n_rb_dl);
/// Function to convert VRB to PRB for distributed allocation
uint32_t (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap);
/// Function to retrieve transmission mode for UE
uint8_t (*get_transmission_mode)(module_id_t Mod_id,uint8_t CC_id,rnti_t rnti);
/// Function to retrieve rb_alloc bitmap from dci rballoc field and VRB type
uint32_t (*get_rballoc)(vrb_t vrb_type, uint16_t rb_alloc_dci);
/// Function for UE MAC to retrieve current PHY connectivity mode (PRACH,RA_RESPONSE,PUSCH)
UE_MODE_t (*get_ue_mode)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to retrieve measured Path Loss
int16_t (*get_PL)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to retrieve the rssi
uint32_t (*get_RSSI)(uint8_t Mod_id,uint8_t CC_id);
/// Function for UE MAC to retrieve the total gain
uint32_t (*get_rx_total_gain_dB)(uint8_t Mod_id,uint8_t CC_id);
/// Function for UE MAC to retrieve the number of adjustent cells
uint8_t (*get_n_adj_cells)(uint8_t Mod_id,uint8_t CC_id);
/// Function for UE MAC to retrieve RSRP/RSRQ measurements
uint32_t (*get_RSRP)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to retrieve RSRP/RSRQ measurements
uint32_t (*get_RSRQ)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
uint8_t (*set_RSRP_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
uint8_t (*set_RSRQ_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
/// Function for UE/eNB MAC to retrieve number of PRACH in TDD
uint8_t (*get_num_prach_tdd)(LTE_DL_FRAME_PARMS *frame_parms);
/// Function for UE/eNB MAC to retrieve f_id of particular PRACH resource in TDD
uint8_t (*get_fid_prach_tdd)(LTE_DL_FRAME_PARMS *frame_parms,uint8_t tdd_map_index);
/// Function for eNB MAC to retrieve subframe direction
lte_subframe_t (*get_subframe_direction)(module_id_t Mod_id, uint8_t CC_id, uint8_t subframe);
// MAC Helper functions
/// Function for UE/PHY to compute PUSCH transmit power in power-control procedure (Po_NOMINAL_PUSCH parameter)
int8_t (*get_Po_NOMINAL_PUSCH)(module_id_t Mod_id,uint8_t CC_id);
/// Function for UE/PHY to compute PUSCH transmit power in power-control procedure (deltaP_rampup parameter)
int8_t (*get_deltaP_rampup)(module_id_t Mod_id,uint8_t CC_id);
/// Function for UE/PHY to compute PHR
int8_t (*get_PHR)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
/// Function for UE to process the timing advance command
void (*process_timing_advance)(module_id_t Mod_id,uint8_t CC_id, int16_t timing_advance);
/// Function for MAC to get the UE stats from the PHY
LTE_eNB_UE_stats* (*get_eNB_UE_stats)(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti);
/// get the frame parameters from the PHY
LTE_DL_FRAME_PARMS* (*get_lte_frame_parms)(module_id_t Mod_id, uint8_t CC_id);
/// get the Multiuser mimo mode
MU_MIMO_mode* (*get_mu_mimo_mode) (module_id_t Mod_id, uint8_t CC_id, rnti_t rnti);
/// get the delta TF for Uplink Power Control Calculation
int16_t (*get_hundred_times_delta_TF) (module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid);
/// get target PUSCH received power
int16_t (*get_target_pusch_rx_power) (module_id_t module_idP, uint8_t CC_id);
/// get target PUSCH received power
int16_t (*get_target_pucch_rx_power) (module_id_t module_idP, uint8_t CC_id);
unsigned char is_cluster_head;
unsigned char is_primary_cluster_head;
unsigned char is_secondary_cluster_head;
unsigned char cluster_head_index;
/// PHY Frame Configuration
LTE_DL_FRAME_PARMS *frame_parms;
uint8_t (*get_prach_prb_offset)(LTE_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf);
int (*is_prach_subframe)(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe);
/// ICIC algos
uint8_t (*get_SB_size)(uint8_t n_rb_dl);
///end ALU's algo
} MAC_xface;
*/
#endif
/** @} */
+55
View File
@@ -0,0 +1,55 @@
/*
* 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.1 (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
*/
/*! \file PHY_INTERFACE/defs.h
* \brief mac phy interface primitives
* \author Raymond Knopp and Navid Nikaein
* \date 2011
* \version 0.5
* \mail navid.nikaein@eurecom.fr or openair_tech@eurecom.fr
*/
#ifndef __PHY_INTERFACE_H__
# define __PHY_INTERFACE_H__
#include "LAYER2/MAC/mac.h"
#define MAX_NUMBER_OF_MAC_INSTANCES 16
#define NULL_PDU 255
#define DCI 0
#define DLSCH 1
#define ULSCH 2
#define mac_exit_wrapper(sTRING) \
do { \
char temp[300]; \
snprintf(temp, sizeof(temp), "%s in file "__FILE__" at line %d\n", sTRING, __LINE__); \
mac_xface->macphy_exit(temp); \
} while(0)
#endif
/** @} */
@@ -23,7 +23,7 @@
#define __PHY_INTERFACE_VARS_H__
//#include "SIMULATION/PHY_EMULATION/spec_defs.h"
#include "defs.h"
#include "phy_interface.h"
#ifdef PHY_EMUL
#include "SIMULATION/PHY_EMULATION/DEVICE_DRIVER/defs.h"
+4 -4
View File
@@ -2,11 +2,11 @@
//#include "openair1/PHY/defs.h"
//#include "openair2/PHY_INTERFACE/IF_Module.h"
//#include "openair1/PHY/extern.h"
#include "openair2/LAYER2/MAC/extern.h"
#include "openair2/LAYER2/MAC/defs.h"
#include "openair2/LAYER2/MAC/proto.h"
#include "openair2/LAYER2/MAC/mac_extern.h"
#include "openair2/LAYER2/MAC/mac.h"
#include "openair2/LAYER2/MAC/mac_proto.h"
//#include "openair2/LAYER2/MAC/vars.h"
#include "openair1/SCHED/defs.h"
#include "openair1/SCHED_UE/sched_UE.h"
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h"
//#include "common/ran_context.h"
#include "openair2/PHY_INTERFACE/phy_stub_UE.h"
@@ -29,26 +29,14 @@
*/
#include "platform_types.h"
//#include "openair_defs.h"
//#include "openair_proto.h"
#include "defs.h"
#include "extern.h"
//#include "mac_lchan_interface.h"
//#include "openair_rrc_utils.h"
//#include "openair_rrc_main.h"
#include "rrc_defs.h"
#include "rrc_extern.h"
#include "UTIL/LOG/log.h"
#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"
extern EMULATION_VARS *Emul_vars;
extern eNB_MAC_INST *eNB_mac_inst;
extern UE_MAC_INST *UE_mac_inst;
#endif
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
@@ -29,26 +29,14 @@
*/
#include "platform_types.h"
//#include "openair_defs.h"
//#include "openair_proto.h"
#include "defs.h"
#include "extern.h"
//#include "mac_lchan_interface.h"
//#include "openair_rrc_utils.h"
//#include "openair_rrc_main.h"
#include "rrc_defs.h"
#include "rrc_extern.h"
#include "UTIL/LOG/log.h"
#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"
extern EMULATION_VARS *Emul_vars;
extern eNB_MAC_INST *eNB_mac_inst;
extern UE_MAC_INST *UE_mac_inst;
#endif
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
@@ -29,13 +29,8 @@
*/
#include "platform_types.h"
//#include "openair_defs.h"
//#include "openair_proto.h"
#include "defs.h"
#include "extern.h"
//#include "mac_lchan_interface.h"
//#include "openair_rrc_utils.h"
//#include "openair_rrc_main.h"
#include "rrc_defs.h"
#include "rrc_extern.h"
#include "UTIL/LOG/log.h"
#include "rrc_eNB_UE_context.h"
#include "pdcp.h"
@@ -57,8 +57,8 @@
//#define MRB1 1
#endif
#include "RRC/LITE/defs.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_defs.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRCConnectionSetupComplete.h"
#include "RRCConnectionReconfigurationComplete.h"
#include "RRCConnectionReconfiguration.h"
@@ -73,7 +73,7 @@
#include "SBCCH-SL-BCH-MessageType.h"
#include "SBCCH-SL-BCH-Message.h"
#include "PHY/defs.h"
//#include "PHY/defs.h"
#include "MeasObjectToAddModList.h"
#include "ReportConfigToAddModList.h"
@@ -39,7 +39,7 @@
#include <asn_application.h>
#include <asn_internal.h> /* for _ASN_DEFAULT_STACK_MAX */
#include "RRC/LITE/defs.h"
#include "RRC/LTE/rrc_defs.h"
#include "SL-DestinationInfoList-r12.h"
/*
@@ -53,7 +53,7 @@
#include "RRCConnectionSetup-NB.h"
#include "SRB-ToAddModList-NB-r13.h"
#include "DRB-ToAddModList-NB-r13.h"
#include "RRC/LITE/defs_NB_IoT.h"
#include "RRC/LTE/defs_NB_IoT.h"
#include "RRCConnectionSetupComplete-NB.h"
#include "RRCConnectionReconfigurationComplete-NB.h"
#include "RRCConnectionReconfiguration-NB.h"

Some files were not shown because too many files have changed in this diff Show More