cleaning only

This commit is contained in:
laurent
2023-01-19 14:52:39 +01:00
committed by Robert Schmidt
parent 214aa50595
commit b74ba0fb92
142 changed files with 565 additions and 1842 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
#define GTPV1_U_MESSAGES_TYPES_H_
#include "LTE_asn_constant.h"
#include "NR_asn_constant.h"
#define GTPV1U_MAX_BEARERS_PER_UE max_val_LTE_DRB_Identity
#define NR_GTPV1U_MAX_BEARERS_PER_UE max_val_NR_DRB_Identity
+1 -48
View File
@@ -24,7 +24,7 @@
#include "LAYER2/RLC/rlc.h"
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "openair2/RRC/LTE/rrc_defs.h"
#include "LTE_RadioResourceConfigCommonSIB.h"
@@ -324,53 +324,6 @@ typedef struct { //RRC_INTERFACE_FUNCTIONS
double (*rrc_get_estimated_ue_distance) (module_id_t Mod_id, uint8_t UE_id, uint8_t CC_id, uint8_t loc_type);
} RRC_XFACE;
typedef struct {
//MAC_INTERFACE_FUNCTIONS
unsigned int frame;
unsigned short Node_id[NB_MODULES_MAX];
char Is_cluster_head[NB_MODULES_MAX];
void (*macphy_exit)(const char *); /* Pointer function that stops the low-level scheduler due an exit condition */
unsigned short (*mac_config_req)(uint8_t,uint8_t,MAC_CONFIG_REQ *);
MAC_MEAS_REQ_ENTRY *(*mac_meas_req)(uint8_t, MAC_MEAS_REQ *);
void (*mac_out_of_sync_ind)(uint8_t,uint32_t,unsigned short);
//RLC_INTERFACE_FUNCTIONS
void (*pdcp_run)(void);
void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char *);
signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t );
int (*rrc_mac_config_req)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t UE_id,uint8_t eNB_index,
LTE_RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated,
LTE_MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity,
LTE_LogicalChannelConfig_t *logicalChannelConfig,
LTE_MeasGapConfig_t *measGapConfig,
LTE_TDD_Config_t *tdd_Config,
uint8_t *SIwindowsize,
uint16_t *SIperiod,
MBMS_flag_t MBMS_Flag,
struct LTE_MBSFN_SubframeConfigList *mbsfn_SubframeConfigList,
LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
struct LTE_PMCH_InfoList_r9 *pmch_InfoList
);
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, const unsigned int,char *
,uint32_t
,uint32_t
);
void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char *, tb_size_t, num_tb_t, crc_t * );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, sub_frame_t subframeP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP,
logical_chan_id_t channel_idP, tb_size_t tb_sizeP
,uint32_t sourceL2Id
,uint32_t destinationL2Id
);
signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *);
void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t, rb_id_t, sdu_size_t, char * ),
void (*rrc_data_confP) (module_id_t, rb_id_t, mui_t ) ) ;
void (*mrbch_phy_sync_failure) (uint8_t Mod_id, frame_t frame, uint8_t Free_ch_index);
void (*dl_phy_sync_success) (uint8_t Mod_id, frame_t frame, uint8_t eNB_index);
} MAC_RLC_XFACE;
//#define IDLE 0
#define NEED_RADIO_CONFIG 3
#define RADIO_CONFIG_TX 2
-159
View File
@@ -1,159 +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
*/
/*
platform_constants.h
-------------------
AUTHOR : Lionel GAUTHIER and Navid Nikaein
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#ifndef __PLATFORM_CONSTANTS_H__
# define __PLATFORM_CONSTANTS_H__
#include "LTE_asn_constant.h"
#include "NR_asn_constant.h"
#define NR_MAXDRB 14
#ifdef JUMBO_FRAME
#define NL_MAX_PAYLOAD 18000 /* this should cover the max mtu size*/
#else
#define NL_MAX_PAYLOAD 9000 /* this should cover the max mtu size*/
#endif
#ifdef LARGE_SCALE
#define NB_MODULES_MAX 128
#define NB_NODE_MAX 128
#else
#define NB_MODULES_MAX 32
#define NB_NODE_MAX 32
#endif
#ifdef JUMBO_FRAME
#define MAX_IP_PACKET_SIZE 10000 // 9000
#else
#if defined(OAI_NW_DRIVER_TYPE_ETHERNET)
/* SR: When using ethernet network driver the packet size is 1512 :
* 1500 bytes IP packet + 14 bytes ethernet header
*/
#define MAX_IP_PACKET_SIZE 1514
#else
#define MAX_IP_PACKET_SIZE 1500 // 3000
#endif
#endif
// overwrite the previous deinitions
# define MAX_MODULES NB_MODULES_MAX
#define MAX_NR_RRC_UE_CONTEXTS 64
#ifndef UE_EXPANSION
#ifdef LARGE_SCALE
#define MAX_MOBILES_PER_ENB 128
#define MAX_MOBILES_PER_ENB_NB_IoT 128
#define MAX_MOBILES_PER_GNB 128
#define MAX_eNB 2
#define MAX_gNB 2
#else
#define MAX_MOBILES_PER_ENB 40
#define MAX_MOBILES_PER_ENB_NB_IoT 40
#define MAX_MOBILES_PER_GNB 16
#define MAX_eNB 2
#define MAX_gNB 2
#endif
#else
#define MAX_MOBILES_PER_ENB 256
#define MAX_MOBILES_PER_ENB_NB_IoT 256
#define MAX_MOBILES_PER_GNB 256
#define MAX_eNB 2
#define MAX_gNB 2
#endif
#define NUMBER_OF_NR_UCI_STATS_MAX 16
#define MAX_MANAGED_ENB_PER_MOBILE 2
#define MAX_MANAGED_GNB_PER_MOBILE 2
///NB-IOT
#define NB_RB_MAX_NB_IOT (LTE_maxDRB_NB_r13 + 3) //MP: NB_IoT --> 2(DRB)+3(SRBs - 2 is not used) = 5
#define DEFAULT_RAB_ID 1
#define NB_RB_MAX (LTE_maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#define NR_NB_RB_MAX (NR_maxDRB + 3)
#define NGAP_MAX_PDU_SESSION (256) /* As defined in TS 38.413 9.2.1.1 Range Bound for PDU Sessions. */
#define NGAP_MAX_DRBS_PER_UE (32) /* As defined in TS 38.413 9.2.1.1 - maxnoofDRBs */
#define NB_RB_MBMS_MAX (LTE_maxSessionPerPMCH*LTE_maxServiceCount)
#define NB_RAB_MAX LTE_maxDRB /* was 8, now 11 */
#define RAB_SHIFT1 9
#define RAB_SHIFT2 3
//#define RAB_OFFSET 0x0007
#define RAB_OFFSET 0x000F
#define RAB_OFFSET1 0x7E00
#define RAB_OFFSET2 0x01F8
#define DIR_OFFSET 0x8000
#define DIR_SHIFT 15
#define CH_OFFSET 0x0004
#define CH_SHIFT 2
// RLC Entity
#define RLC_TX_MAXSIZE 10000000
#define RLC_RX_MAXSIZE 10000000
// RLC_AM_SEND_MRW
# define SEND_MRW_OFF 15
# define SEND_MRW_ON 240
// RLC_SEGMENTATION_INDICATION
# define SEGMENTATION_NOT_ALLOWED 0
# define SEGMENTATION_ALLOWED 1
// RLC_DELIVERY_OF_ERRONEOUS_SDU
# define DELIVERY_OF_ERRONEOUS_SDU_NO 0
# define DELIVERY_OF_ERRONEOUS_SDU_YES 1
# define DELIVERY_OF_ERRONEOUS_SDU_NO_DETECT 2
// CBA constant
#define NUM_MAX_CBA_GROUP 4
#ifndef __cplusplus
#ifndef NULL
#define NULL 0
#endif
#ifndef null
#define null 0
#endif
#endif
#define UNUSED_PARAM_MBMS_SESSION_ID 0
#define UNUSED_PARAM_MBMS_SERVICE_ID 0
#define printk printf
#define UNUSED_VARIABLE(vARIABLE) (void)(vARIABLE)
#endif /* __PLATFORM_CONSTANTS_H__ */
+2 -2
View File
@@ -224,9 +224,9 @@ typedef struct protocol_ctxt_s {
// warning time hardcoded
#define PROTOCOL_CTXT_TIME_MILLI_SECONDS(CtXt_h) ((CtXt_h)->frame*10+(CtXt_h)->subframe)
#define UE_MODULE_ID_TO_INSTANCE( mODULE_iD ) mODULE_iD + NB_eNB_INST
#define UE_MODULE_ID_TO_INSTANCE(mODULE_iD) mODULE_iD + RC.nb_inst
#define ENB_MODULE_ID_TO_INSTANCE( mODULE_iD ) mODULE_iD
#define UE_INSTANCE_TO_MODULE_ID( iNSTANCE ) iNSTANCE - NB_eNB_INST
#define UE_INSTANCE_TO_MODULE_ID(iNSTANCE) iNSTANCE - RC.nb_inst
#define ENB_INSTANCE_TO_MODULE_ID( iNSTANCE )iNSTANCE
//NR
+1 -1
View File
@@ -31,7 +31,7 @@
***************************************************************************/
# ifndef __RRM_CONSTANTS_H__
# define __RRM_CONSTANTS_H__
# include "platform_constants.h"
#include "common/platform_constants.h"
/*#################################################
CONSTANTS FOR L1/L2/L3 LAYERS
-1
View File
@@ -49,7 +49,6 @@
# define X2AP_ENB_REGISTER_RETRY_DELAY 10
#include "openair1/PHY/INIT/phy_init.h"
extern unsigned char NB_eNB_INST;
extern RAN_CONTEXT_t RC;
+1 -1
View File
@@ -36,7 +36,7 @@
#include "commonDef.h"
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
#include "PHY/defs_eNB.h"
#include "s1ap_messages_types.h"
#include "f1ap_messages_types.h"
+1 -1
View File
@@ -36,7 +36,7 @@
#include "commonDef.h"
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
#include "PHY/defs_eNB.h"
#include "s1ap_messages_types.h"
#include "ngap_messages_types.h"
+2 -1
View File
@@ -29,7 +29,7 @@
*/
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "LTE_SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h"
#include "LTE_RadioResourceConfigDedicated.h"
@@ -58,6 +58,7 @@ extern int l2_init_eNB(void);
extern void mac_top_init_eNB(void);
extern void mac_init_cell_params(int Mod_idP,int CC_idP);
SCHEDULER_MODES global_scheduler_mode;
typedef struct eutra_bandentry_s {
int16_t band;
uint32_t ul_min;
+1 -1
View File
@@ -33,7 +33,7 @@
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "nfapi/oai_integration/vendor_ext.h"
#include "SCHED_UE/sched_UE.h"
#include "LTE_SystemInformationBlockType2.h"
+1 -2
View File
@@ -12,8 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include "COMMON/openair_defs.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "COMMON/mac_rrc_primitives.h"
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
//#include "PHY/defs.h"
+2 -20
View File
@@ -58,6 +58,7 @@
#include <dlfcn.h>
#include "T.h"
#include "openair2/LAYER2/MAC/mac_extern.h"
#define ENABLE_MAC_PAYLOAD_DEBUG
//#define DEBUG_eNB_SCHEDULER 1
@@ -65,26 +66,7 @@
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
//------------------------------------------------------------------------------
void
add_ue_dlsch_info(module_id_t module_idP,
int CC_id,
int UE_id,
sub_frame_t subframeP,
UE_DLSCH_STATUS status,
rnti_t rnti)
//------------------------------------------------------------------------------
{
eNB_DLSCH_INFO *info = &eNB_dlsch_info[module_idP][CC_id][UE_id];
// LOG_D(MAC, "%s(module_idP:%d, CC_id:%d, UE_id:%d, subframeP:%d, status:%d) serving_num:%d rnti:%x\n", __FUNCTION__, module_idP, CC_id, UE_id, subframeP, status, eNB_dlsch_info[module_idP][CC_id][UE_id].serving_num, UE_RNTI(module_idP,UE_id));
info->rnti = rnti;
// info->weight = weight;
info->subframe = subframeP;
info->status = status;
info->serving_num++;
return;
}
mac_rlc_am_muilist_t rlc_am_mui;
//------------------------------------------------------------------------------
int
+7 -42
View File
@@ -295,13 +295,7 @@ void dlsch_scheduler_pre_ue_select_fairRR(
// update UL DAI after DLSCH scheduling
set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP);
}
add_ue_dlsch_info(module_idP,
CC_id,
UE_id,
subframeP,
S_DL_NONE,
rnti);
eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_NONE;
end_flag[CC_id] = 1;
break;
}
@@ -423,13 +417,7 @@ void dlsch_scheduler_pre_ue_select_fairRR(
// update UL DAI after DLSCH scheduling
set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP);
}
add_ue_dlsch_info(module_idP,
CC_id,
UE_id,
subframeP,
S_DL_NONE,
rnti);
eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_NONE;
end_flag[CC_id] = 1;
break;
}
@@ -551,13 +539,7 @@ void dlsch_scheduler_pre_ue_select_fairRR(
// update UL DAI after DLSCH scheduling
set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP);
}
add_ue_dlsch_info(module_idP,
CC_id,
UE_id,
subframeP,
S_DL_NONE,
rnti);
eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_NONE;
end_flag[CC_id] = 1;
break;
}
@@ -1204,7 +1186,6 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
}
}
//weight = get_ue_weight(module_idP,UE_id);
// aggregation = 2;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
N_RB_DL[CC_id] = to_prb(cc[CC_id].mib->message.dl_Bandwidth);
@@ -1503,13 +1484,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
frameP, subframeP, UE_id, rnti);
}
}
add_ue_dlsch_info(module_idP,
CC_id,
UE_id,
subframeP,
S_DL_SCHEDULED,
rnti);
eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_SCHEDULED;
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[round]++;
UE_info->eNB_UE_stats[CC_id][UE_id].num_retransmission += 1;
UE_info->eNB_UE_stats[CC_id][UE_id].rbs_used_retx = nb_rb;
@@ -1943,12 +1918,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
T_INT(harq_pid), T_BUFFER(UE_info->DLSCH_pdu[CC_id][0][UE_id].payload[0], TBS));
UE_info->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb;
add_ue_dlsch_info(module_idP,
CC_id,
UE_id,
subframeP,
S_DL_SCHEDULED,
rnti);
eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_SCHEDULED;
// store stats
eNB->eNB_stats[CC_id].dlsch_bytes_tx+=sdu_length_total;
eNB->eNB_stats[CC_id].dlsch_pdus_tx+=1;
@@ -2162,7 +2132,7 @@ fill_DLSCH_dci_fairRR(
if (eNB_dlsch_info[module_idP][CC_id][UE_id].status == S_DL_SCHEDULED) {
// clear scheduling flag
eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_WAITING;
eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_NONE;
rnti = UE_RNTI(module_idP,UE_id);
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP,subframeP);
nb_rb = UE_info->UE_template[CC_id][UE_id].nb_rb[harq_pid];
@@ -3351,12 +3321,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
uint16_t ul_sched_frame = sched_frame;
uint16_t ul_sched_subframeP = sched_subframeP;
add_subframe(&ul_sched_frame, &ul_sched_subframeP, 2);
ul_req->sfn_sf = ul_sched_frame<<4|ul_sched_subframeP;
add_ue_ulsch_info(module_idP,
CC_id,
UE_id,
subframeP,
S_UL_SCHEDULED);
ul_req->sfn_sf = ul_sched_frame << 4 | ul_sched_subframeP;
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id);
// increment first rb for next UE allocation
first_rb[CC_id]+=rb_table[rb_table_index];
@@ -324,11 +324,6 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
ul_req->number_of_pdus = 1;
mac->ul_handle++;
add_ue_ulsch_info(module_idP,
CC_id,
UE_id,
subframeP,
S_UL_SCHEDULED);
// increment first rb for next UE allocation
first_rb[CC_id]+= nb_rb;
} // loop of CC_id
+29 -31
View File
@@ -58,10 +58,36 @@ extern uint16_t frame_cnt;
#include "common/ran_context.h"
#include "SCHED/sched_common.h"
#include "openair2/LAYER2/MAC/mac_extern.h"
/*
* If the CQI is low, then scheduler will use a higher aggregation level and lower aggregation level otherwise
* this is also dependent to transmission mode, where an offset could be defined
*/
// the follwoing three tables are calibrated for TXMODE 1 and 2
static const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = {
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 37 bits
//{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 43
{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE = 44
};
static const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = {
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size < 38 bits
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE < 43
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE < 47
{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE < 55
};
static const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = {
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 47 bits
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 55
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 59
{3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0} // 20_DCI0_CRC_SIZE = 64
};
extern RAN_CONTEXT_t RC;
eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
//------------------------------------------------------------------------------
int
choose(int n,
@@ -1940,8 +1966,6 @@ narrowband_to_first_rb(COMMON_channels_t *cc,
return 0;
}
//------------------------------------------------------------------------------
void
init_ue_sched_info(void)
//------------------------------------------------------------------------------
@@ -1951,15 +1975,7 @@ 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 < MAX_MOBILES_PER_ENB; j++) {
// init DL
eNB_dlsch_info[i][k][j].weight = 0;
eNB_dlsch_info[i][k][j].subframe = 0;
eNB_dlsch_info[i][k][j].serving_num = 0;
eNB_dlsch_info[i][k][j].status = S_DL_NONE;
// init UL
eNB_ulsch_info[i][k][j].subframe = 0;
eNB_ulsch_info[i][k][j].serving_num = 0;
eNB_ulsch_info[i][k][j].status = S_UL_NONE;
}
}
}
@@ -1967,16 +1983,6 @@ init_ue_sched_info(void)
return;
}
//------------------------------------------------------------------------------
unsigned char
get_ue_weight(module_id_t module_idP,
int CC_idP,
int ue_idP)
//------------------------------------------------------------------------------
{
return (eNB_dlsch_info[module_idP][CC_idP][ue_idP].weight);
}
//------------------------------------------------------------------------------
int
find_UE_id(module_id_t mod_idP,
@@ -2239,9 +2245,7 @@ add_new_ue(module_id_t mod_idP,
UE_info->UE_sched_ctrl[UE_id].round[cc_idP][j] = 8;
UE_info->UE_sched_ctrl[UE_id].round_UL[cc_idP][j] = 0;
}
eNB_ulsch_info[mod_idP][cc_idP][UE_id].status = S_UL_WAITING;
eNB_dlsch_info[mod_idP][cc_idP][UE_id].status = S_DL_WAITING;
eNB_dlsch_info[mod_idP][cc_idP][UE_id].status = S_DL_NONE;
LOG_D(MAC, "[eNB %d] Add UE_id %d on Primary CC_id %d: rnti %x\n",
mod_idP,
UE_id,
@@ -2317,13 +2321,7 @@ rrc_mac_remove_ue(module_id_t mod_idP,
ue_stats->total_pdu_bytes_rx = 0;
ue_stats->total_num_pdus_rx = 0;
ue_stats->total_num_errors_rx = 0;
eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
eNB_ulsch_info[mod_idP][pCC_id][UE_id].status = S_UL_NONE;
eNB_ulsch_info[mod_idP][pCC_id][UE_id].serving_num = 0;
eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE;
eNB_dlsch_info[mod_idP][pCC_id][UE_id].serving_num = 0;
// check if this has an RA process active
if (find_RA_id(mod_idP,
pCC_id,
-24
View File
@@ -1063,24 +1063,6 @@ bytes_to_bsr_index(int32_t nbytes)
return (i - 1);
}
//-----------------------------------------------------------------------------
/*
* Add ue info in eNB_ulsch_info[module_idP][CC_id][UE_id] struct
*/
void
add_ue_ulsch_info(module_id_t module_idP,
int CC_id,
int UE_id,
sub_frame_t subframeP,
UE_ULSCH_STATUS status)
//-----------------------------------------------------------------------------
{
eNB_ulsch_info[module_idP][CC_id][UE_id].rnti = UE_RNTI(module_idP, UE_id);
eNB_ulsch_info[module_idP][CC_id][UE_id].subframe = subframeP;
eNB_ulsch_info[module_idP][CC_id][UE_id].status = status;
eNB_ulsch_info[module_idP][CC_id][UE_id].serving_num++;
}
//-----------------------------------------------------------------------------
/*
* Parse MAC header from ULSCH
@@ -1786,7 +1768,6 @@ schedule_ulsch_rnti(module_id_t module_idP,
ul_req_tmp_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
mac->ul_handle++;
ul_req_tmp->sfn_sf = sched_frame << 4 | sched_subframeP;
add_ue_ulsch_info(module_idP, CC_id, UE_id, subframeP, S_UL_SCHEDULED);
LOG_D(MAC,
"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for "
"next UE_id %d, format 0\n",
@@ -2284,11 +2265,6 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP,
(frameP * 10) + subframeP);
ul_req_tmp->number_of_pdus++;
eNB->ul_handle++;
add_ue_ulsch_info(module_idP,
CC_id,
UE_id,
subframeP,
S_UL_SCHEDULED);
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n",
module_idP,
CC_id,
+5 -71
View File
@@ -43,7 +43,7 @@
#include <stdlib.h>
#include <string.h>
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "LTE_BCCH-BCH-Message.h"
#include "LTE_RadioResourceConfigCommon.h"
#include "LTE_RadioResourceConfigCommonSIB.h"
@@ -504,66 +504,18 @@ typedef struct {
} __attribute__ ((__packed__)) ULDCH_PDU;
/*!\brief RA process state*/
typedef enum {
IDLE = 0,
MSG2,
WAITMSG3,
MSG4,
WAITMSG4ACK,
MSGCRNTI,
MSGCRNTI_ACK
} RA_state;
/*!\brief UE ULSCH scheduling states*/
typedef enum {
S_UL_NONE = 0,
S_UL_WAITING,
S_UL_SCHEDULED,
S_UL_BUFFERED,
S_UL_NUM_STATUS
} UE_ULSCH_STATUS;
typedef enum { IDLE = 0, MSG2, WAITMSG3, MSG4, WAITMSG4ACK, MSGCRNTI, MSGCRNTI_ACK } RA_state;
/*!\brief UE DLSCH scheduling states*/
typedef enum {
S_DL_NONE = 0,
S_DL_WAITING,
S_DL_SCHEDULED,
S_DL_BUFFERED,
S_DL_NUM_STATUS
} UE_DLSCH_STATUS;
/*!\brief scheduling policy for the contention-based access */
typedef enum {
CBA_ES = 0, /// equal share of RB among groups w
CBA_ES_S, /// equal share of RB among groups with small allocation
CBA_PF, /// proportional fair (kind of)
CBA_PF_S, /// proportional fair (kind of) with small RB allocation
CBA_RS /// random allocation
} CBA_POLICY;
typedef enum { S_DL_NONE = 0, S_DL_SCHEDULED } UE_DLSCH_STATUS;
/*!\brief scheduler mode */
typedef enum {
SCHED_MODE_DEFAULT = 0, /// default cheduler
SCHED_MODE_FAIR_RR /// fair raund robin
SCHED_MODE_DEFAULT = 0, /// default cheduler
SCHED_MODE_FAIR_RR /// fair raund robin
} SCHEDULER_MODES;
/*! \brief temporary struct for ULSCH sched */
typedef struct {
rnti_t rnti;
uint16_t subframe;
uint16_t serving_num;
UE_ULSCH_STATUS status;
} eNB_ULSCH_INFO;
/*! \brief temp struct for DLSCH sched */
typedef struct {
rnti_t rnti;
uint16_t weight;
uint16_t subframe;
uint16_t serving_num;
UE_DLSCH_STATUS status;
} eNB_DLSCH_INFO;
/*! \brief eNB overall statistics */
typedef struct {
/// num BCCH PDU per CC
@@ -1142,16 +1094,6 @@ typedef struct {
int8_t crnti_harq_pid;
} RA_t;
/*! \brief subband bitmap confguration (for ALU icic algo purpose), in test phase */
typedef struct {
uint8_t sbmap[13]; //13 = number of SB MAX for 100 PRB
uint8_t periodicity;
uint8_t first_subframe;
uint8_t sb_size;
uint8_t nb_active_sb;
} SBMAP_CONF;
/*! \brief UE_list_t is a "list" of users within UE_info_t. Especial useful in
* the scheduler and to keep "classes" of users. */
typedef struct {
@@ -1403,9 +1345,6 @@ typedef struct eNB_MAC_INST_s {
/// UL handle
uint32_t ul_handle;
UE_info_t UE_info;
///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
@@ -1724,11 +1663,6 @@ typedef struct {
eth_params_t eth_params_n;
} UE_MAC_INST;
/*! \brief ID of the neighboring cells used for HO*/
typedef struct {
uint16_t cell_ids[6];
uint8_t n_adj_cells;
} neigh_cell_id_t;
typedef struct {
volatile uint8_t flag;
+8 -23
View File
@@ -36,33 +36,12 @@
#include "mac.h"
#include "RRC/LTE/rrc_defs.h"
extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE];
//extern uint32_t EBSR_Level[63];
extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE];
//extern uint32_t Extended_BSR_TABLE[63]; ----currently not used
extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
extern const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
extern const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
extern UE_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][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
extern unsigned char NB_INST;
extern unsigned char NB_eNB_INST;
extern uint16_t NB_UE_INST;
extern uint16_t NB_THREAD_INST;
extern unsigned char NB_RN_INST;
extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB];
extern int NB_UE_INST;
extern const int cqi_to_mcs[16];
extern uint32_t RRC_CONNECTION_FLAG;
extern uint8_t rb_table[34];
extern rb_id_t mbms_rab_id;
@@ -81,4 +60,10 @@ extern SCHEDULER_MODES global_scheduler_mode;
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
extern rb_id_t mbms_rab_id;
static const uint32_t BSR_TABLE[BSR_TABLE_SIZE] = {0, 10, 12, 14, 17, 19, 22, 26, 31, 36, 42, 49, 57, 67, 78, 91,
105, 125, 146, 171, 200, 234, 274, 321, 376, 440, 515, 603, 706, 826, 967, 1132,
1326, 1552, 1817, 2127, 2490, 2915, 3413, 3995, 4677, 5467, 6411, 7505, 8787, 10287, 12043, 14099,
16507, 19325, 22624, 26487, 31009, 36304, 42502, 49759, 58255, 68201, 79846, 93479, 109439, 128125, 150000, 300000};
#endif //DEF_H
-11
View File
@@ -212,11 +212,6 @@ void mac_switch_node_function(module_id_t module_idP);
int mac_init_global_param(void);
void mac_top_cleanup(void);
void mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP,
uint16_t eNB_index);
void clear_nfapi_information(eNB_MAC_INST *eNB, int CC_idP,
frame_t frameP, sub_frame_t subframeP);
@@ -391,10 +386,6 @@ MCH_PDU *get_mch_sdu(module_id_t Mod_id, int CC_id, frame_t frame,
void ue_mac_reset(module_id_t module_idP, uint8_t eNB_index);
void ue_init_mac(module_id_t module_idP);
void init_ue_sched_info(void);
void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id,
sub_frame_t subframe, UE_ULSCH_STATUS status);
void add_ue_dlsch_info(module_id_t module_idP, int CC_id, int UE_id,
sub_frame_t subframe, UE_DLSCH_STATUS status, rnti_t rnti);
int find_UE_id(module_id_t module_idP, rnti_t rnti);
int find_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP);
rnti_t UE_RNTI(module_id_t module_idP, int UE_id);
@@ -488,8 +479,6 @@ uint32_t req_new_ulsch(module_id_t module_idP);
uint32_t ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
uint8_t eNB_id, rnti_t rnti, sub_frame_t subframe);
uint8_t get_ue_weight(module_id_t module_idP, int CC_id, int UE_id);
// UE functions
void mac_out_of_sync_ind(module_id_t module_idP, frame_t frameP,
uint16_t CH_index);
-141
View File
@@ -1,141 +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 vars.h
* \brief mac vars
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \version 1.0
* \email navid.nikaein@eurecom.fr
* @ingroup _mac
*/
#ifndef __MAC_VARS_H__
#define __MAC_VARS_H__
#include "PHY/defs_common.h"
#include "mac.h"
#include "COMMON/mac_rrc_primitives.h"
const uint32_t BSR_TABLE[BSR_TABLE_SIZE] = {
0, 10, 12, 14, 17, 19, 22, 26, 31, 36, 42, 49, 57, 67, 78, 91,
105, 125, 146, 171, 200, 234, 274, 321, 376, 440, 515, 603, 706, 826,
967, 1132,
1326, 1552, 1817, 2127, 2490, 2915, 3413, 3995, 4677, 5467, 6411, 7505,
8787, 10287, 12043, 14099,
16507, 19325, 22624, 26487, 31009, 36304, 42502, 49759, 58255, 68201,
79846, 93479, 109439, 128125, 150000, 300000
};
// extended bsr table--currently not used
const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE] = {
0, 10, 13, 16, 19, 23, 29, 35, 43, 53, 65, 80, 98, 120, 147,
181, 223, 274, 337, 414, 509, 625, 769, 945, 1162, 1429,
1757, 2161, 2657, 3267, 4017, 4940, 6074, 7469, 9185,
11294, 13888, 17077, 20999, 25822, 31752, 39045, 48012,
59039, 72598, 89272, 109774, 134986, 165989, 204111,
250990, 308634, 379519, 466683, 573866, 705666, 867737,
1067031, 1312097, 1613447, 1984009, 2439678, 3000000,
6000000
};
//#define MAX_SIZE_OF_AGG3 576
//#define MAX_SIZE_OF_AGG2 288
//#define MAX_SIZE_OF_AGG1 144
//#define MAX_SIZE_OF_AGG0 72
/*
* If the CQI is low, then scheduler will use a higher aggregation level and lower aggregation level otherwise
* this is also dependent to transmission mode, where an offset could be defined
*/
// the follwoing three tables are calibrated for TXMODE 1 and 2
const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = {
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 37 bits
//{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 43
{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE = 44
};
const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = {
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size < 38 bits
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE < 43
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE < 47
{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE < 55
};
const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = {
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 47 bits
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 55
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 59
{3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0} // 20_DCI0_CRC_SIZE = 64
};
//uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181};
uint32_t RRC_CONNECTION_FLAG;
UE_MAC_INST *UE_mac_inst = NULL; //[NB_MODULE_MAX];
MAC_RLC_XFACE *Mac_rlc_xface;
/// Primary component carrier index of eNB
int pCC_id[NUMBER_OF_eNB_MAX];
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
unsigned char NB_eNB_INST = 0;
uint16_t NB_UE_INST = 0;
uint16_t NB_THREAD_INST = 0;
unsigned char NB_RN_INST = 0;
unsigned char NB_INST = 0;
DCI0_5MHz_TDD_1_6_t UL_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t DLSCH_alloc_pdu1A;
DCI1A_5MHz_TDD_1_6_t RA_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t BCCH_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
DCI1_5MHz_TDD_t DLSCH_alloc_pdu;
DCI1C_5MHz_t MCCH_alloc_pdu;
DCI0_5MHz_FDD_t UL_alloc_pdu_fdd;
DCI1A_5MHz_FDD_t DLSCH_alloc_pdu1A_fdd;
DCI1A_5MHz_FDD_t RA_alloc_pdu_fdd;
DCI1A_5MHz_FDD_t BCCH_alloc_pdu_fdd;
DCI1A_5MHz_FDD_t CCCH_alloc_pdu_fdd;
DCI1_5MHz_FDD_t DLSCH_alloc_pdu_fdd;
DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu1;
DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2;
DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E;
mac_rlc_am_muilist_t rlc_am_mui;
SCHEDULER_MODES global_scheduler_mode;
#endif
-14
View File
@@ -249,20 +249,6 @@ int rlcmac_init_global_param(void)
return 0;
}
void mac_top_cleanup(void)
{
if (NB_UE_INST > 0) {
free(UE_mac_inst);
}
if (RC.nb_macrlc_inst > 0) {
free(RC.mac);
}
}
int l2_init_eNB(void)
{
-7
View File
@@ -59,13 +59,6 @@ void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char e
}
}
void
mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP,
uint16_t eNB_index) {
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index);
}
int
mac_top_init_ue(int eMBMS_active, char *uecap_xer,
uint8_t cba_group_active, uint8_t HO_active) {
@@ -41,24 +41,6 @@ extern const uint8_t nr_slots_per_frame[5];
extern dci_pdu_rel15_t *def_dci_pdu_rel15;
/* extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE];
extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE];
extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
extern const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
extern const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
extern UE_RRC_INST *UE_rrc_inst;
extern const int cqi_to_mcs[16];
extern uint32_t RRC_CONNECTION_FLAG;
extern uint8_t rb_table[34];
extern mac_rlc_am_muilist_t rlc_am_mui;
extern SCHEDULER_MODES global_scheduler_mode;
extern unsigned char NB_UE_INST;*/
extern unsigned char NB_INST;
extern unsigned char NB_eNB_INST;
extern unsigned char NB_RN_INST;
/* Scheduler */
extern RAN_CONTEXT_t RC;
extern uint8_t nfapi_mode;
@@ -67,7 +49,6 @@ extern SCHEDULER_MODES global_scheduler_mode;
/*#if defined(PRE_SCD_THREAD)
extern const int cqi_to_mcs[16];
extern uint32_t RRC_CONNECTION_FLAG;
extern uint8_t rb_table[34];
#if defined(PRE_SCD_THREAD)
+1 -1
View File
@@ -31,7 +31,7 @@
*/
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "common/ran_context.h"
#include "common/utils/nr/nr_common.h"
#include "common/utils/LOG/log.h"
+1 -1
View File
@@ -44,7 +44,7 @@
/* Commmon */
#include "radio/COMMON/common_lib.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "common/ran_context.h"
#include "collection/linear_alloc.h"
+1 -1
View File
@@ -45,7 +45,7 @@
#include "otg_rx.h"
#include "common/utils/LOG/log.h"
#include <inttypes.h>
#include "platform_constants.h"
#include "common/platform_constants.h"
#include "nfapi/oai_integration/vendor_ext.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/ngran_types.h"
+1 -1
View File
@@ -36,7 +36,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
#include "RRC/LTE/rrc_defs.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "COMMON/platform_types.h"
#include "LTE_DRB-ToAddMod.h"
#include "LTE_DRB-ToAddModList.h"
+1 -1
View File
@@ -57,7 +57,7 @@ extern int otg_enabled;
#include "UTIL/OTG/otg_tx.h"
#include "nfapi/oai_integration/vendor_ext.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
#include "pdcp.h"
#include "assertions.h"
@@ -28,7 +28,7 @@
#include "common/utils/LOG/log.h"
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
#include "pdcp.h"
#include "pdcp_primitives.h"
+1 -1
View File
@@ -23,7 +23,7 @@
#define RLC_AM_C 1
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
//-----------------------------------------------------------------------------
#include "assertions.h"
@@ -38,7 +38,7 @@
//-----------------------------------------------------------------------------
# include <pthread.h>
# include "platform_types.h"
# include "platform_constants.h"
#include "common/platform_constants.h"
# include "list.h"
# include "rlc_primitives.h"
# include "rlc_def_lte.h"
+1 -1
View File
@@ -39,7 +39,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
//#include "PHY/defs.h"
@@ -39,7 +39,7 @@
# include "UTIL/MEM/mem_block.h"
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
//#include "PHY/defs.h"
//-----------------------------------------------------------------------------
@@ -39,7 +39,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
//#include "PHY/defs.h"
//-----------------------------------------------------------------------------
@@ -32,7 +32,7 @@
# define __RLC_AM_STRUCTS_H__
# include "platform_types.h"
# include "platform_constants.h"
#include "common/platform_constants.h"
# include "list.h"
# include "mem_block.h"
# include "rlc_am_constants.h"
@@ -24,7 +24,7 @@
//-----------------------------------------------------------------------------
//#include "rtos_header.h"
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
//-----------------------------------------------------------------------------
#include "rlc_am.h"
#include "LAYER2/MAC/mac_extern.h"
@@ -23,7 +23,7 @@
#define RLC_AM_TIMER_POLL_REORDERING_C 1
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
//-----------------------------------------------------------------------------
#include "rlc_am.h"
# include "LAYER2/MAC/mac_extern.h"
@@ -23,7 +23,7 @@
#define RLC_AM_TIMER_STATUS_PROHIBIT_C 1
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
//-----------------------------------------------------------------------------
#include "rlc_am.h"
#include "LAYER2/MAC/mac_extern.h"
+1 -1
View File
@@ -23,7 +23,7 @@
#define RLC_TM_C 1
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
//-----------------------------------------------------------------------------
#include "rlc_tm.h"
#include "mac_primitives.h"
@@ -32,7 +32,7 @@
# define __RLC_TM_ENTITY_H__
//-----------------------------------------------------------------------------
# include "platform_types.h"
# include "platform_constants.h"
#include "common/platform_constants.h"
# include "rlc_tm_structs.h"
# include "rlc_def.h"
//-----------------------------------------------------------------------------
+1 -1
View File
@@ -24,7 +24,7 @@
//-----------------------------------------------------------------------------
//#include "rtos_header.h"
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
//-----------------------------------------------------------------------------
#if ENABLE_ITTI
#include "intertask_interface.h"
@@ -33,7 +33,7 @@
# include <pthread.h>
# include "platform_types.h"
# include "platform_constants.h"
#include "common/platform_constants.h"
# include "list.h"
# include "rlc_primitives.h"
# include "rlc_def.h"
@@ -23,7 +23,7 @@
#define RLC_UM_SEGMENT_C 1
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
//-----------------------------------------------------------------------------
#include <assert.h>
#include "assertions.h"
+1 -1
View File
@@ -36,7 +36,7 @@
# define __RLC_H__
# include "platform_types.h"
# include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
# include "hashtable.h"
# include "rlc_am.h"
# include "rlc_um.h"
+1
View File
@@ -37,6 +37,7 @@
#include "hashtable.h"
#include "assertions.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
//#define DEBUG_MAC_INTERFACE 1
+1 -1
View File
@@ -34,7 +34,7 @@
# include <stdio.h>
# include <stdlib.h>
# include "platform_types.h"
# include "platform_constants.h"
#include "common/platform_constants.h"
# include "mem_block.h"
+1 -1
View File
@@ -36,7 +36,7 @@
#include "commonDef.h"
#include "platform_types.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
#include "PHY/impl_defs_top.h"
#include "PHY/defs_eNB.h"
#include "s1ap_messages_types.h"
+1 -1
View File
@@ -39,7 +39,7 @@
#include "local.h"
#include "proto_extern.h"
//#include "platform_constants.h"
//#include "common/platform_constants.h"
//#define NETLINK_DEBUG 1
+1 -1
View File
@@ -36,7 +36,7 @@
#include <stdint.h>
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
#include "platform_constants.h"
#include "common/platform_constants.h"
#include "platform_types.h"
#define MAX_NUM_DL_PDU 100
-466
View File
@@ -1,466 +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 rrc_common.c
* \brief rrc common procedures for eNB and UE
* \author Navid Nikaein and Raymond Knopp
* \date 2011 - 2014
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr and raymond.knopp@eurecom.fr
*/
#include "defs.h"
#include "extern.h"
#include "LAYER2/MAC/extern.h"
#include "COMMON/openair_defs.h"
#include "COMMON/platform_types.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "LAYER2/RLC/rlc.h"
#include "COMMON/mac_rrc_primitives.h"
#include "UTIL/LOG/log.h"
#include "asn1_msg.h"
#include "pdcp.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "rrc_eNB_UE_context.h"
#include "common/ran_context.h"
#ifdef LOCALIZATION
#include <sys/time.h>
#endif
#define DEBUG_RRC 1
extern RAN_CONTEXT_t RC;
extern UE_MAC_INST *UE_mac_inst;
extern mui_t rrc_eNB_mui;
//configure BCCH & CCCH Logical Channels and associated rrc_buffers, configure associated SRBs
//-----------------------------------------------------------------------------
void
openair_rrc_on(
const protocol_ctxt_t* const ctxt_pP
)
//-----------------------------------------------------------------------------
{
unsigned short i;
int CC_id;
if (ctxt_pP->enb_flag == ENB_FLAG_YES) {
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI.Active = 1;
rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1);
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1;
}
} else {
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
for (i = 0; i < NB_eNB_INST; i++) {
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" Activating CCCH (eNB %d)\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP), i);
UE_rrc_inst[ctxt_pP->module_id].Srb0[i].Srb_id = CCCH;
memcpy (&UE_rrc_inst[ctxt_pP->module_id].Srb0[i].Lchan_desc[0], &CCCH_LCHAN_DESC, LCHAN_DESC_SIZE);
memcpy (&UE_rrc_inst[ctxt_pP->module_id].Srb0[i].Lchan_desc[1], &CCCH_LCHAN_DESC, LCHAN_DESC_SIZE);
rrc_config_buffer (&UE_rrc_inst[ctxt_pP->module_id].Srb0[i], CCCH, 1);
UE_rrc_inst[ctxt_pP->module_id].Srb0[i].Active = 1;
}
}
}
//-----------------------------------------------------------------------------
int
rrc_init_global_param(
void
)
//-----------------------------------------------------------------------------
{
rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc
DCCH_LCHAN_DESC.transport_block_size = 4;
DCCH_LCHAN_DESC.max_transport_blocks = 16;
DCCH_LCHAN_DESC.Delay_class = 1;
DTCH_DL_LCHAN_DESC.transport_block_size = 52;
DTCH_DL_LCHAN_DESC.max_transport_blocks = 20;
DTCH_DL_LCHAN_DESC.Delay_class = 1;
DTCH_UL_LCHAN_DESC.transport_block_size = 52;
DTCH_UL_LCHAN_DESC.max_transport_blocks = 20;
DTCH_UL_LCHAN_DESC.Delay_class = 1;
Rlc_info_um.rlc_mode = RLC_MODE_UM;
Rlc_info_um.rlc.rlc_um_info.timer_reordering = 5;
Rlc_info_um.rlc.rlc_um_info.sn_field_length = 10;
Rlc_info_um.rlc.rlc_um_info.is_mXch = 0;
//Rlc_info_um.rlc.rlc_um_info.sdu_discard_mode=16;
Rlc_info_am_config.rlc_mode = RLC_MODE_AM;
Rlc_info_am_config.rlc.rlc_am_info.max_retx_threshold = 50;
Rlc_info_am_config.rlc.rlc_am_info.poll_pdu = 8;
Rlc_info_am_config.rlc.rlc_am_info.poll_byte = 1000;
Rlc_info_am_config.rlc.rlc_am_info.t_poll_retransmit = 15;
Rlc_info_am_config.rlc.rlc_am_info.t_reordering = 50;
Rlc_info_am_config.rlc.rlc_am_info.t_status_prohibit = 10;
return 0;
}
//-----------------------------------------------------------------------------
void
rrc_config_buffer(
SRB_INFO* Srb_info,
uint8_t Lchan_type,
uint8_t Role
)
//-----------------------------------------------------------------------------
{
Srb_info->Rx_buffer.payload_size = 0;
Srb_info->Tx_buffer.payload_size = 0;
}
//-----------------------------------------------------------------------------
void
rrc_t310_expiration(
const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index
)
//-----------------------------------------------------------------------------
{
if (UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State != RRC_CONNECTED) {
LOG_D(RRC, "Timer 310 expired, going to RRC_IDLE\n");
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State = RRC_IDLE;
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].UE_index = 0xffff;
UE_rrc_inst[ctxt_pP->module_id].Srb0[eNB_index].Rx_buffer.payload_size = 0;
UE_rrc_inst[ctxt_pP->module_id].Srb0[eNB_index].Tx_buffer.payload_size = 0;
UE_rrc_inst[ctxt_pP->module_id].Srb1[eNB_index].Srb_info.Rx_buffer.payload_size = 0;
UE_rrc_inst[ctxt_pP->module_id].Srb1[eNB_index].Srb_info.Tx_buffer.payload_size = 0;
if (UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Active == 1) {
msg ("[RRC Inst %d] eNB_index %d, Remove RB %d\n ", ctxt_pP->module_id, eNB_index,
UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Srb_info.Srb_id);
rrc_pdcp_config_req (ctxt_pP,
SRB_FLAG_YES,
CONFIG_ACTION_REMOVE,
UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Srb_info.Srb_id,
0);
rrc_rlc_config_req (ctxt_pP,
SRB_FLAG_YES,
MBMS_FLAG_NO,
CONFIG_ACTION_REMOVE,
UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Srb_info.Srb_id,
Rlc_info_um);
UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Active = 0;
UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Status = IDLE;
UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Next_check_frame = 0;
}
} else { // Restablishment procedure
LOG_D(RRC, "Timer 310 expired, trying RRCRestablishment ...\n");
}
}
//-----------------------------------------------------------------------------
RRC_status_t
rrc_rx_tx(
protocol_ctxt_t* const ctxt_pP,
const uint8_t enb_indexP,
const int CC_id
)
//-----------------------------------------------------------------------------
{
//uint8_t UE_id;
int32_t current_timestamp_ms, ref_timestamp_ms;
struct timeval ts;
struct rrc_eNB_ue_context_s *ue_context_p = NULL,*ue_to_be_removed = NULL;
#ifdef LOCALIZATION
double estimated_distance;
protocol_ctxt_t ctxt;
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_IN);
if(ctxt_pP->enb_flag == ENB_FLAG_NO) {
// check timers
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_active == 1) {
if ((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_cnt % 10) == 0)
LOG_D(RRC,
"[UE %d][RAPROC] Frame %d T300 Count %d ms\n", ctxt_pP->module_id, ctxt_pP->frame, UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_cnt);
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_cnt
== T300[UE_rrc_inst[ctxt_pP->module_id].sib2[enb_indexP]->ue_TimersAndConstants.t300]) {
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_active = 0;
// ALLOW CCCH to be used
UE_rrc_inst[ctxt_pP->module_id].Srb0[enb_indexP].Tx_buffer.payload_size = 0;
rrc_ue_generate_RRCConnectionRequest (ctxt_pP, enb_indexP);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
return (RRC_ConnSetup_failed);
}
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_cnt++;
}
if ((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].SIStatus&2)>0) {
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].N310_cnt
== N310[UE_rrc_inst[ctxt_pP->module_id].sib2[enb_indexP]->ue_TimersAndConstants.n310]) {
LOG_I(RRC,"Activating T310\n");
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_active = 1;
}
} else { // in case we have not received SIB2 yet
/* if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].N310_cnt == 100) {
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].N310_cnt = 0;
}*/
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
return RRC_OK;
}
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_active == 1) {
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].N311_cnt
== N311[UE_rrc_inst[ctxt_pP->module_id].sib2[enb_indexP]->ue_TimersAndConstants.n311]) {
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_active = 0;
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].N311_cnt = 0;
}
if ((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_cnt % 10) == 0) {
LOG_D(RRC, "[UE %d] Frame %d T310 Count %d ms\n", ctxt_pP->module_id, ctxt_pP->frame, UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_cnt);
}
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_cnt == T310[UE_rrc_inst[ctxt_pP->module_id].sib2[enb_indexP]->ue_TimersAndConstants.t310]) {
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_active = 0;
rrc_t310_expiration (ctxt_pP, enb_indexP);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
LOG_I(RRC,"Returning RRC_PHY_RESYNCH: T310 expired\n");
return RRC_PHY_RESYNCH;
}
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_cnt++;
}
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_active==1) {
if ((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_cnt % 10) == 0)
LOG_D(RRC,"[UE %d][RAPROC] Frame %d T304 Count %d ms\n",ctxt_pP->module_id,ctxt_pP->frame,
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_cnt);
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_cnt == 0) {
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_active = 0;
UE_rrc_inst[ctxt_pP->module_id].HandoverInfoUe.measFlag = 1;
LOG_E(RRC,"[UE %d] Handover failure..initiating connection re-establishment procedure... \n",
ctxt_pP->module_id);
//Implement 36.331, section 5.3.5.6 here
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
return(RRC_Handover_failed);
}
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_cnt--;
}
// Layer 3 filtering of RRC measurements
if (UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0] != NULL) {
ue_meas_filtering(ctxt_pP,enb_indexP);
}
ue_measurement_report_triggering(ctxt_pP,enb_indexP);
if (UE_rrc_inst[ctxt_pP->module_id].Info[0].handoverTarget > 0) {
LOG_I(RRC,"[UE %d] Frame %d : RRC handover initiated\n", ctxt_pP->module_id, ctxt_pP->frame);
}
if((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].State == RRC_HO_EXECUTION) &&
(UE_rrc_inst[ctxt_pP->module_id].HandoverInfoUe.targetCellId != 0xFF)) {
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].State= RRC_IDLE;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
return(RRC_HO_STARTED);
}
} else { // eNB
check_handovers(ctxt_pP);
// counetr, and get the value and aggregate
// check for UL failure
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[ctxt_pP->module_id]->rrc_ue_head)) {
LOG_D(RRC,"SFN.SN %d.%d => release timer %d/%d\n",ctxt_pP->frame,ctxt_pP->subframe,
ue_context_p->ue_context.ue_release_timer,ue_context_p->ue_context.ue_release_timer_thres);
if ((ctxt_pP->frame == 0) && (ctxt_pP->subframe==0)) {
if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == true) {
LOG_I(RRC,"UE rnti %x:S-TMSI %x failure timer %d/20000\n",
ue_context_p->ue_context.rnti,
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
ue_context_p->ue_context.ul_failure_timer);
}
else {
LOG_I(RRC,"UE rnti %x failure timer %d/20000\n",
ue_context_p->ue_context.rnti,
ue_context_p->ue_context.ul_failure_timer);
}
}
if (ue_context_p->ue_context.ul_failure_timer>0) {
ue_context_p->ue_context.ul_failure_timer++;
if (ue_context_p->ue_context.ul_failure_timer >= 20000) {
// remove UE after 20 seconds after MAC has indicated UL failure
LOG_I(RRC,"Removing UE %x instance (failure)\n",ue_context_p->ue_context.rnti);
ue_to_be_removed = ue_context_p;
break;
}
}
if (ue_context_p->ue_context.ue_release_timer>0) {
ue_context_p->ue_context.ue_release_timer++;
if (ue_context_p->ue_context.ue_release_timer >=
ue_context_p->ue_context.ue_release_timer_thres) {
LOG_I(RRC,"Removing UE %x instance (release timer %d)\n",ue_context_p->ue_context.rnti,ue_context_p->ue_context.ue_release_timer);
ue_to_be_removed = ue_context_p;
exit(-1);
break;
}
}
}
if (ue_to_be_removed)
rrc_eNB_free_UE(ctxt_pP->module_id,ue_to_be_removed);
#ifdef RRC_LOCALIZATION
/* for the localization, only primary CC_id might be relevant*/
gettimeofday(&ts, NULL);
current_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
ref_timestamp_ms = RC.rrc[ctxt_pP->module_id]->reference_timestamp_ms;
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[ctxt_pP->module_id]->rrc_ue_head)) {
ctxt = *ctxt_pP;
ctxt.rnti = ue_context_p->ue_context.rnti;
estimated_distance = rrc_get_estimated_ue_distance(
&ctxt,
CC_id,
RC.rrc[ctxt_pP->module_id]->loc_type);
if ((current_timestamp_ms - ref_timestamp_ms > RC.rrc[ctxt_pP->module_id]->aggregation_period_ms) &&
estimated_distance != -1) {
LOG_D(LOCALIZE, " RRC [UE/id %d -> eNB/id %d] timestamp %d frame %d estimated r = %f\n",
ctxt.rnti,
ctxt_pP->module_id,
current_timestamp_ms,
ctxt_pP->frame,
estimated_distance);
LOG_D(LOCALIZE, " RRC status %d\n", ue_context_p->ue_context.StatusRrc);
push_front(&RC.rrc[ctxt_pP->module_id]->loc_list,
estimated_distance);
RC.rrc[ctxt_pP->module_id]->reference_timestamp_ms = current_timestamp_ms;
}
}
#endif
(void)ts; /* remove gcc warning "unused variable" */
(void)ref_timestamp_ms; /* remove gcc warning "unused variable" */
(void)current_timestamp_ms; /* remove gcc warning "unused variable" */
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
return (RRC_OK);
}
//-----------------------------------------------------------------------------
long
binary_search_int(
int elements[],
long numElem,
int value
)
//-----------------------------------------------------------------------------
{
long first, last, middle, search = -1;
first = 0;
last = numElem-1;
middle = (first+last)/2;
if(value < elements[0]) {
return first;
}
if(value > elements[last]) {
return last;
}
while (first <= last) {
if (elements[middle] < value) {
first = middle+1;
} else if (elements[middle] == value) {
search = middle+1;
break;
} else {
last = middle -1;
}
middle = (first+last)/2;
}
if (first > last) {
LOG_E(RRC,"Error in binary search!");
}
return search;
}
/* This is a binary search routine which operates on an array of floating
point numbers and returns the index of the range the value lies in
Used for RSRP and RSRQ measurement mapping. Can potentially be used for other things
*/
//-----------------------------------------------------------------------------
long
binary_search_float(
float elements[],
long numElem,
float value
)
//-----------------------------------------------------------------------------
{
long first, last, middle;
first = 0;
last = numElem-1;
middle = (first+last)/2;
if(value <= elements[0]) {
return first;
}
if(value >= elements[last]) {
return last;
}
while (last - first > 1) {
if (elements[middle] > value) {
last = middle;
} else {
first = middle;
}
middle = (first+last)/2;
}
if (first < 0 || first >= numElem) {
LOG_E(RRC,"\n Error in binary search float!");
}
return first;
}
+1 -1
View File
@@ -44,7 +44,7 @@
#include "common/utils/LOG/log.h"
#include "rrc_eNB_UE_context.h"
#include "pdcp.h"
#include "common/ran_context.h"
#include "intertask_interface.h"
-3
View File
@@ -116,9 +116,6 @@ typedef struct xer_sprint_string_s {
size_t string_index;
} xer_sprint_string_t;
extern unsigned char NB_eNB_INST;
extern RAN_CONTEXT_t RC;
uint16_t two_tier_hexagonal_cellIds[7] = {0,1,2,4,5,7,8};
+1 -1
View File
@@ -40,7 +40,7 @@
#include "collection/tree.h"
#include "rrc_types_NB_IoT.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "COMMON/platform_types.h"
#include "common/openairinterface5g_limits.h"
+10
View File
@@ -99,7 +99,17 @@ static int from_nr_ue_fd = -1;
static int to_nr_ue_fd = -1;
int slrb_id;
int send_ue_information = 0;
// TimeToTrigger enum mapping table (36.331 TimeToTrigger IE)
static const uint32_t timeToTrigger_ms[16] = {0, 40, 64, 80, 100, 128, 160, 256, 320, 480, 512, 640, 1024, 1280, 2560, 5120};
/* 36.133 Section 9.1.4 RSRP Measurement Report Mapping, Table: 9.1.4-1 */
static const float RSRP_meas_mapping[98] = {-140, -139, -138, -137, -136, -135, -134, -133, -132, -131, -130, -129, -128, -127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116,
-115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104, -103, -102, -101, -100, -99, -98, -97, -96, -95, -94, -93, -92, -91,
-90, -89, -88, -87, -86, -85, -84, -83, -82, -81, -80, -79, -78, -77, -76, -75, -74, -73, -72, -71, -70, -69, -68, -67, -66,
-65, -64, -63, -62, -61, -60, -59, -58, -57, -56, -55, -54, -53, -52, -51, -50, -49, -48, -47, -46, -45, -44, -43};
static const float RSRQ_meas_mapping[35] = {-19, -18.5, -18, -17.5, -17, -16.5, -16, -15.5, -15, -14.5, -14, -13.5, -13, -12.5, -12, -11.5, -11, -10.5,
-10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2};
// for malloc_clear
#include "PHY/defs_UE.h"
+3 -12
View File
@@ -42,6 +42,7 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "rrc_eNB_UE_context.h"
#include "common/ran_context.h"
#include "openair2/RRC/LTE/rrc_proto.h"
extern RAN_CONTEXT_t RC;
extern UE_MAC_INST *UE_mac_inst;
@@ -95,12 +96,7 @@ rrc_config_buffer(
//-----------------------------------------------------------------------------
long
binary_search_int(
int elements[],
long numElem,
int value
)
long binary_search_int(const int elements[], long numElem, int value)
//-----------------------------------------------------------------------------
{
long first, last, middle, search = -1;
@@ -141,12 +137,7 @@ binary_search_int(
Used for RSRP and RSRQ measurement mapping. Can potentially be used for other things
*/
//-----------------------------------------------------------------------------
long
binary_search_float(
float elements[],
long numElem,
float value
)
long binary_search_float(const float elements[], long numElem, float value)
//-----------------------------------------------------------------------------
{
long first, last, middle;
+2 -3
View File
@@ -44,12 +44,11 @@
#include "NR_UE-MRDC-Capability.h"
#include "NR_UE-NR-Capability.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "COMMON/platform_types.h"
#include "LAYER2/MAC/mac.h"
#include "openair2/RRC/common.h"
//for D2D
#define DEBUG_CTRL_SOCKET
+2 -13
View File
@@ -34,6 +34,7 @@
#include "COMMON/mac_rrc_primitives.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/RLC/rlc.h"
#include "openair2/RRC/LTE/rrc_defs.h"
extern UE_RRC_INST *UE_rrc_inst;
@@ -43,10 +44,7 @@ extern uint8_t DRB2LCHAN[8];
extern LTE_LogicalChannelConfig_t SRB1_logicalChannelConfig_defaultValue;
extern LTE_LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue;
extern unsigned char NB_INST;
extern unsigned char NB_eNB_INST;
extern uint16_t NB_UE_INST;
extern int NB_UE_INST;
extern void* bigphys_malloc(int);
@@ -59,15 +57,6 @@ extern LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_
extern MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER;
extern MAC_AVG_T BCCH_MEAS_AVG,CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG;
extern uint16_t T300[8];
extern uint16_t T310[8];
extern uint16_t N310[8];
extern uint16_t N311[8];
extern uint32_t T304[8];
extern uint32_t timeToTrigger_ms[16];
extern float RSRP_meas_mapping[98];
extern float RSRQ_meas_mapping[35];
extern UE_PF_PO_t UE_PF_PO[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
extern pthread_mutex_t ue_pf_po_mutex;
+2 -2
View File
@@ -655,9 +655,9 @@ rrc_eNB_free_UE(
const struct rrc_eNB_ue_context_s *const ue_context_pP
);
long binary_search_int(int elements[], long numElem, int value);
long binary_search_int(const int elements[], long numElem, int value);
long binary_search_float(float elements[], long numElem, float value);
long binary_search_float(const float elements[], long numElem, float value);
void openair_rrc_top_init_eNB(int eMBMS_active,uint8_t HO_active);
+1 -152
View File
@@ -35,13 +35,12 @@
#include "LAYER2/RLC/rlc.h"
#include "COMMON/mac_rrc_primitives.h"
#include "LAYER2/MAC/mac.h"
#include "openair2/RRC/NR/nr_rrc_extern.h"
UE_PF_PO_t UE_PF_PO[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
pthread_mutex_t ue_pf_po_mutex;
UE_RRC_INST *UE_rrc_inst = NULL;
#include "LAYER2/MAC/mac_extern.h"
#define MAX_U32 0xFFFFFFFF
extern uint16_t ue_id_g;
uint8_t DRB2LCHAN[8];
@@ -86,156 +85,6 @@ LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DT
MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER;
MAC_AVG_T BCCH_MEAS_AVG, CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG;
// timers
uint16_t T300[8] = {100,200,300,400,600,1000,1500,2000};
uint16_t T310[8] = {0,50,100,200,500,1000,2000};
uint16_t N310[8] = {1,2,3,4,6,8,10,20};
uint16_t N311[8] = {1,2,3,4,6,8,10,20};
uint32_t T304[8] = {50,100,150,200,500,1000,2000,MAX_U32};
// TimeToTrigger enum mapping table (36.331 TimeToTrigger IE)
uint32_t timeToTrigger_ms[16] = {0,40,64,80,100,128,160,256,320,480,512,640,1024,1280,2560,5120};
/* 36.133 Section 9.1.4 RSRP Measurement Report Mapping, Table: 9.1.4-1 */
float RSRP_meas_mapping[98] = {
-140,
-139,
-138,
-137,
-136,
-135,
-134,
-133,
-132,
-131,
-130,
-129,
-128,
-127,
-126,
-125,
-124,
-123,
-122,
-121,
-120,
-119,
-118,
-117,
-116,
-115,
-114,
-113,
-112,
-111,
-110,
-109,
-108,
-107,
-106,
-105,
-104,
-103,
-102,
-101,
-100,
-99,
-98,
-97,
-96,
-95,
-94,
-93,
-92,
-91,
-90,
-89,
-88,
-87,
-86,
-85,
-84,
-83,
-82,
-81,
-80,
-79,
-78,
-77,
-76,
-75,
-74,
-73,
-72,
-71,
-70,
-69,
-68,
-67,
-66,
-65,
-64,
-63,
-62,
-61,
-60,
-59,
-58,
-57,
-56,
-55,
-54,
-53,
-52,
-51,
-50,
-49,
-48,
-47,
-46,
-45,
-44,
-43
};
float RSRQ_meas_mapping[35] = {
-19,
-18.5,
-18,
-17.5,
-17,
-16.5,
-16,
-15.5,
-15,
-14.5,
-14,
-13.5,
-13,
-12.5,
-12,
-11.5,
-11,
-10.5,
-10,
-9.5,
-9,
-8.5,
-8,
-7.5,
-7,
-6.5,
-6,
-5.5,
-5,
-4.5,
-4,
-3.5,
-3,
-2.5,
-2
};
// only used for RRC connection re-establishment procedure TS36.331 5.3.7
// [0]: current C-RNTI, [1]: prior C-RNTI
// insert one when eNB received RRCConnectionReestablishmentRequest message
-4
View File
@@ -148,10 +148,6 @@ typedef struct xer_sprint_string_s {
size_t string_index;
} xer_sprint_string_t;
//replace LTE
//extern unsigned char NB_eNB_INST;
extern unsigned char NB_gNB_INST;
extern RAN_CONTEXT_t RC;
/*
+1 -1
View File
@@ -40,7 +40,7 @@
#include "nr_rrc_types.h"
#include "common/ngran_types.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "COMMON/platform_types.h"
#include "mac_rrc_dl.h"
+3 -13
View File
@@ -34,6 +34,8 @@
#include "COMMON/mac_rrc_primitives.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/RLC/rlc.h"
#include "openair2/RRC/LTE/rrc_defs.h"
#include "openair2/RRC/common.h"
#define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1 - The physical layer imposes a limit to the maximum size a SIB can take. The maximum SIB1 or SI message size is 2976 bits.
@@ -45,10 +47,7 @@ extern NR_LogicalChannelConfig_t NR_SRB1_logicalChannelConfig_defaultValue;
extern NR_LogicalChannelConfig_t NR_SRB2_logicalChannelConfig_defaultValue;
extern NR_LogicalChannelConfig_t NR_SRB3_logicalChannelConfig_defaultValue;
extern unsigned char NB_INST;
extern unsigned char NB_eNB_INST;
extern uint16_t NB_UE_INST;
extern int NB_UE_INST;
extern void* bigphys_malloc(int);
@@ -61,15 +60,6 @@ extern LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_
extern MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER;
extern MAC_AVG_T BCCH_MEAS_AVG,CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG;
extern uint16_t T300[8];
extern uint16_t T310[8];
extern uint16_t N310[8];
extern uint16_t N311[8];
extern uint32_t T304[8];
extern uint32_t timeToTrigger_ms[16];
extern float RSRP_meas_mapping[98];
extern float RSRQ_meas_mapping[35];
extern UE_PF_PO_t UE_PF_PO[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
extern pthread_mutex_t ue_pf_po_mutex;
+7 -1
View File
@@ -1345,7 +1345,13 @@ static void rrc_ue_generate_RRCSetupComplete(
ctxt_pP->module_id,ctxt_pP->frame, size, gNB_index);
LOG_D(NR_RRC,
"[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCSetupComplete to gNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
ctxt_pP->frame, ctxt_pP->module_id+NB_RN_INST, size, gNB_index, nr_rrc_mui, ctxt_pP->module_id+NB_eNB_INST, DCCH);
ctxt_pP->frame,
ctxt_pP->module_id,
size,
gNB_index,
nr_rrc_mui,
ctxt_pP->module_id + NB_eNB_INST,
DCCH);
//for (int i=0;i<size;i++) printf("%02x ",buffer[i]);
//printf("\n");
+30
View File
@@ -0,0 +1,30 @@
/*
* 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
*/
#ifndef __OPENAIR_RRC_COMMON_H___
#define __OPENAIR_RRC_COMMON_H___
static const uint16_t T300[8] = {100, 200, 300, 400, 600, 1000, 1500, 2000};
static const uint16_t T310[8] = {0, 50, 100, 200, 500, 1000, 2000};
static const uint16_t N310[8] = {1, 2, 3, 4, 6, 8, 10, 20};
static const uint16_t N311[8] = {1, 2, 3, 4, 6, 8, 10, 20};
static const uint32_t T304[8] = {50, 100, 150, 200, 500, 1000, 2000, UINT32_MAX};
#endif
+1 -1
View File
@@ -36,7 +36,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "openair2/COMMON/platform_constants.h"
#include "common/platform_constants.h"
//-----------------------------------------------------------------------------
typedef struct mem_block_t {
+1 -1
View File
@@ -35,7 +35,7 @@
/* \brief To define the NUMBER_OF_eNB_MAX and MAX_MOBILES_PER_ENB */
#include "common/openairinterface5g_limits.h"
#include <openair2/COMMON/platform_constants.h>
#include <common/platform_constants.h>
#include "otg_config.h"
/**
-1
View File
@@ -35,7 +35,6 @@
#include "otg_externs.h"
#include "otg_kpi.h"
extern unsigned char NB_eNB_INST;
extern uint16_t NB_UE_INST;
FD_otg *form_dl, *form_ul;
-1
View File
@@ -40,7 +40,6 @@ unsigned int start_log_jitter=0;
#include "otg_kpi.h"
#include "otg_externs.h"
extern unsigned char NB_eNB_INST;
extern uint16_t NB_UE_INST;
void tx_throughput(int src, int dst, int application) {
-1
View File
@@ -43,7 +43,6 @@
#include <sql_common.h>
#endif
extern unsigned char NB_eNB_INST;
extern uint16_t NB_UE_INST;
//#include "LAYER2/MAC/extern.h"
-1
View File
@@ -35,7 +35,6 @@
#include "otg_tx.h"
#include "otg_externs.h"
extern unsigned char NB_eNB_INST;
extern uint16_t NB_UE_INST;
-3
View File
@@ -41,10 +41,7 @@
#include <math.h>
#include <unistd.h>
#include "otg.h"
//#include "COMMON/platform_constants.h"
/*! \fn int time_dist(const int src, const int dst, const int state)
* \brief compute Inter Departure Time, in ms