Merge branch 'bler_txoptim' of https://gitlab.eurecom.fr/oai/openairinterface5g into bler_txoptim
This commit is contained in:
@@ -9,11 +9,9 @@
|
||||
*/
|
||||
#ifndef __LAYER2_MAC_DEFS_NB_IOT_H__
|
||||
#define __LAYER2_MAC_DEFS_NB_IOT_H__
|
||||
#ifdef USER_MODE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
//#include "COMMON/openair_defs.h"
|
||||
#include "COMMON/platform_constants.h"
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
|
||||
@@ -105,13 +105,11 @@ eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_EN
|
||||
eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
|
||||
|
||||
|
||||
#ifdef OPENAIR2
|
||||
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;
|
||||
#endif
|
||||
|
||||
|
||||
DCI0_5MHz_TDD_1_6_t UL_alloc_pdu;
|
||||
|
||||
@@ -77,13 +77,6 @@ static int mbms_mch_i=0;
|
||||
//static int num_msi_per_CSA[28];
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
#ifndef USER_MODE
|
||||
#define msg debug_msg
|
||||
#endif
|
||||
*/
|
||||
|
||||
mapping BSR_names[] = {
|
||||
{"NONE", 0},
|
||||
{"SHORT BSR", 1},
|
||||
@@ -1251,65 +1244,6 @@ int ue_query_mch_fembms(module_id_t module_idP, uint8_t CC_id, uint32_t frameP,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef OLD
|
||||
// Acount for sf_allocable in CSA
|
||||
int num_sf_alloc = 0;
|
||||
|
||||
for (l = 0; l < 8; l++) {
|
||||
if (UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l] == NULL)
|
||||
continue;
|
||||
|
||||
if (UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l]->subframeAllocation.present != LTE_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame)
|
||||
continue;
|
||||
|
||||
uint32_t common_mbsfn_SubframeConfig = UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l]->subframeAllocation.choice.oneFrame.buf[0];
|
||||
|
||||
|
||||
for (j = 0; j < 6; j++)
|
||||
num_sf_alloc += ((common_mbsfn_SubframeConfig & (0x80 >> j)) == (0x80 >> j));
|
||||
//num_sf_alloc=1;
|
||||
}
|
||||
|
||||
num_sf_alloc = 10;
|
||||
|
||||
num_non_mbsfn_SubframeConfig = (UE_mac_inst[module_idP].non_mbsfn_SubframeConfig->subframeAllocation_r14.buf[0]<<1 | UE_mac_inst[module_idP].non_mbsfn_SubframeConfig->subframeAllocation_r14.buf[0]>>7);
|
||||
int ones=0;
|
||||
for(j=0; j < 16; j++){
|
||||
if(num_non_mbsfn_SubframeConfig & 1)
|
||||
ones++;
|
||||
num_non_mbsfn_SubframeConfig>>=1;
|
||||
}
|
||||
|
||||
for (l = 0; l < 28; l++) {
|
||||
if (UE_mac_inst[module_idP].pmch_stop_mtch[l] >= 1/*num_sf_alloc*/) {
|
||||
if (UE_mac_inst[module_idP].pmch_stop_mtch[l] != 2047) {
|
||||
if (UE_mac_inst[module_idP].pmch_Config[UE_mac_inst[module_idP].msi_pmch] != NULL){
|
||||
mtch_mcs = UE_mac_inst[module_idP].pmch_Config[UE_mac_inst[module_idP].msi_pmch]->dataMCS_r9;
|
||||
//int common_mbsfn_alloc_offset = UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[0]->radioframeAllocationOffset;
|
||||
long common_mbsfn_period = 1 << UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[0]->radioframeAllocationPeriod;
|
||||
long commonSF_AllocPeriod = 4 << UE_mac_inst[module_idP].commonSF_AllocPeriod_r9;
|
||||
if(UE_mac_inst[module_idP].common_num_sf_alloc >= UE_mac_inst[module_idP].pmch_stop_mtch[l]){
|
||||
//LOG_E(MAC,"Attemp to UE_mac_inst[module_idP].common_num_sf_alloc %d\n",UE_mac_inst[module_idP].common_num_sf_alloc);
|
||||
|
||||
mtch_mcs = -1;
|
||||
}/*else
|
||||
OG_W(MAC,"Attemp to UE_mac_inst[module_idP].common_num_sf_alloc %d\n",UE_mac_inst[module_idP].common_num_sf_alloc);*/
|
||||
LOG_D(MAC,"Attemp to UE_mac_inst[module_idP].common_num_sf_alloc %d num_sf_alloc %d commonSF_AllocPeriod %ld, common_mbsfn_period %ld num_non_mbsfn_SubframeConfig %x ones %d\n",UE_mac_inst[module_idP].common_num_sf_alloc,num_sf_alloc, commonSF_AllocPeriod,common_mbsfn_period,num_non_mbsfn_SubframeConfig,ones);
|
||||
UE_mac_inst[module_idP].common_num_sf_alloc++;
|
||||
UE_mac_inst[module_idP].common_num_sf_alloc = UE_mac_inst[module_idP].common_num_sf_alloc % (num_sf_alloc * commonSF_AllocPeriod / common_mbsfn_period-(1+ones)*(commonSF_AllocPeriod/4)); //TODO
|
||||
}
|
||||
else
|
||||
mtch_mcs = -1;
|
||||
|
||||
mch_lcid = (uint8_t)l;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
// Acount for sf_allocable in Common SF Allocation
|
||||
int num_sf_alloc = 0;
|
||||
@@ -1869,49 +1803,7 @@ int ue_query_mch(module_id_t module_idP, uint8_t CC_id, uint32_t frameP, uint32_
|
||||
//}
|
||||
}
|
||||
|
||||
#ifdef OLD
|
||||
// Acount for sf_allocable in CSA
|
||||
int num_sf_alloc = 0;
|
||||
|
||||
for (l = 0; l < 8; l++) {
|
||||
if (UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l] == NULL)
|
||||
continue;
|
||||
|
||||
if (UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l]->subframeAllocation.present != LTE_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame)
|
||||
continue;
|
||||
|
||||
uint32_t common_mbsfn_SubframeConfig = UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l]->subframeAllocation.choice.oneFrame.buf[0];
|
||||
|
||||
for (j = 0; j < 6; j++)
|
||||
num_sf_alloc += ((common_mbsfn_SubframeConfig & (0x80 >> j)) == (0x80 >> j));
|
||||
//num_sf_alloc=1;
|
||||
}
|
||||
|
||||
for (l = 0; l < 28; l++) {
|
||||
if (UE_mac_inst[module_idP].pmch_stop_mtch[l] >= 1/*num_sf_alloc*/) {
|
||||
if (UE_mac_inst[module_idP].pmch_stop_mtch[l] != 2047) {
|
||||
if (UE_mac_inst[module_idP].pmch_Config[UE_mac_inst[module_idP].msi_pmch] != NULL){
|
||||
mtch_mcs = UE_mac_inst[module_idP].pmch_Config[UE_mac_inst[module_idP].msi_pmch]->dataMCS_r9;
|
||||
long common_mbsfn_period = 1 << UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[0]->radioframeAllocationPeriod;
|
||||
long commonSF_AllocPeriod = 4 << UE_mac_inst[module_idP].commonSF_AllocPeriod_r9;
|
||||
if(UE_mac_inst[module_idP].common_num_sf_alloc >= UE_mac_inst[module_idP].pmch_stop_mtch[l]){
|
||||
//LOG_E(MAC,"Attemp to UE_mac_inst[module_idP].common_num_sf_alloc %d\n",UE_mac_inst[module_idP].common_num_sf_alloc);
|
||||
|
||||
mtch_mcs = -1;
|
||||
}/*else
|
||||
LOG_W(MAC,"Attemp to UE_mac_inst[module_idP].common_num_sf_alloc %d\n",UE_mac_inst[module_idP].common_num_sf_alloc);*/
|
||||
UE_mac_inst[module_idP].common_num_sf_alloc++;
|
||||
UE_mac_inst[module_idP].common_num_sf_alloc = UE_mac_inst[module_idP].common_num_sf_alloc % (num_sf_alloc * commonSF_AllocPeriod / common_mbsfn_period);
|
||||
}
|
||||
else
|
||||
mtch_mcs = -1;
|
||||
|
||||
mch_lcid = (uint8_t)l;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
// Acount for sf_allocable in Common SF Allocation
|
||||
|
||||
@@ -573,7 +573,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
|
||||
struct NR_PDCCH_Config__searchSpacesToAddModList *searchSpacesToAddModList = pdcch_Config->choice.setup->searchSpacesToAddModList;
|
||||
AssertFatal(searchSpacesToAddModList != NULL, "searchSpacesToAddModList is null\n");
|
||||
AssertFatal(searchSpacesToAddModList->list.count > 0, "list of UE specifically configured Search Spaces is empty\n");
|
||||
AssertFatal(searchSpacesToAddModList->list.count < FAPI_NR_MAX_SS_PER_CORESET, "too many searchpaces per coreset %d\n", searchSpacesToAddModList->list.count);
|
||||
AssertFatal(searchSpacesToAddModList->list.count < FAPI_NR_MAX_SS, "too many searchpaces per coreset %d\n", searchSpacesToAddModList->list.count);
|
||||
|
||||
struct NR_UplinkConfig__uplinkBWP_ToAddModList *uplinkBWP_ToAddModList = scd->uplinkConfig->uplinkBWP_ToAddModList;
|
||||
if (ul_bwp_id > 0) {
|
||||
@@ -597,7 +597,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
|
||||
AssertFatal(*ss->controlResourceSetId == mac->coreset[dl_bwp_id][coreset_id - 1]->controlResourceSetId, "ss->controlResourceSetId is unknown\n");
|
||||
AssertFatal(ss->monitoringSymbolsWithinSlot != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot is null\n");
|
||||
AssertFatal(ss->monitoringSymbolsWithinSlot->buf != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot->buf is null\n");
|
||||
mac->SSpace[dl_bwp_id][0][ss_id] = ss;
|
||||
mac->SSpace[dl_bwp_id][ss_id] = ss;
|
||||
}
|
||||
|
||||
// Check available CSSs in the commonSearchSpaceList (list of additional common search spaces)
|
||||
@@ -610,7 +610,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
|
||||
AssertFatal(css->searchSpaceType != NULL, "css->searchSpaceType is null\n");
|
||||
AssertFatal(css->monitoringSymbolsWithinSlot != NULL, "css->monitoringSymbolsWithinSlot is null\n");
|
||||
AssertFatal(css->monitoringSymbolsWithinSlot->buf != NULL, "css->monitoringSymbolsWithinSlot->buf is null\n");
|
||||
mac->SSpace[dl_bwp_id][0][ss_id] = css;
|
||||
mac->SSpace[dl_bwp_id][ss_id] = css;
|
||||
ss_id++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ typedef struct {
|
||||
NR_BWP_Downlink_t *DLbwp[MAX_NUM_BWP];
|
||||
NR_BWP_Uplink_t *ULbwp[MAX_NUM_BWP];
|
||||
NR_ControlResourceSet_t *coreset[MAX_NUM_BWP][FAPI_NR_MAX_CORESET_PER_BWP];
|
||||
NR_SearchSpace_t *SSpace[MAX_NUM_BWP][FAPI_NR_MAX_CORESET_PER_BWP][FAPI_NR_MAX_SS_PER_CORESET];
|
||||
NR_SearchSpace_t *SSpace[MAX_NUM_BWP][FAPI_NR_MAX_SS];
|
||||
|
||||
lte_frame_type_t frame_type;
|
||||
|
||||
|
||||
@@ -76,7 +76,6 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss,fapi_nr_dl_config_dci_dl_pd
|
||||
void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_request_t *dl_config, int rnti_type, int ss_id){
|
||||
|
||||
uint16_t monitoringSymbolsWithinSlot = 0;
|
||||
uint8_t coreset_id = 1;
|
||||
int sps = 0;
|
||||
|
||||
AssertFatal(mac->scc == NULL || mac->scc_SIB == NULL, "both scc and scc_SIB cannot be non-null\n");
|
||||
@@ -97,11 +96,23 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
NR_SearchSpace_t *ss;
|
||||
NR_ControlResourceSet_t *coreset;
|
||||
if(ss_id>=0) {
|
||||
ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id];
|
||||
if (rnti_type == NR_RNTI_TC || rnti_type == NR_RNTI_RA) {
|
||||
ss = mac->ra.ss;
|
||||
AssertFatal(mac->ra.ss->searchSpaceId == ss_id,"Search Space id %d does not correspond to the one in ra->ss %ld for RA procedures\n",
|
||||
ss_id,mac->ra.ss->searchSpaceId);
|
||||
}
|
||||
else
|
||||
ss = mac->SSpace[bwp_id][ss_id];
|
||||
}
|
||||
else
|
||||
ss = mac->search_space_zero;
|
||||
|
||||
uint8_t coreset_id = *ss->controlResourceSetId;
|
||||
|
||||
if(coreset_id>0) {
|
||||
coreset = mac->coreset[bwp_id][coreset_id - 1];
|
||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG;
|
||||
} else {
|
||||
ss = mac->search_space_zero;
|
||||
coreset = mac->coreset0;
|
||||
if(rnti_type == NR_RNTI_SI) {
|
||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
|
||||
@@ -255,7 +266,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
||||
RA_config_t *ra = &mac->ra;
|
||||
int ss_id;
|
||||
|
||||
uint8_t bwp_id = (mac->cg) ? mac->DL_BWP_Id : 0, coreset_id = (mac->cg) ? 1 : 0;
|
||||
uint8_t bwp_id = (mac->cg) ? mac->DL_BWP_Id : 0;
|
||||
//NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated;
|
||||
NR_BWP_DownlinkDedicated_t *bwpd = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Dedicated : mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Common : &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP;
|
||||
@@ -264,9 +275,9 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
||||
|
||||
// loop over all available SS for CORESET ID 1
|
||||
if (bwpd) {
|
||||
for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id][coreset_id - 1][ss_id] != NULL; ss_id++){
|
||||
for (ss_id = 0; ss_id < FAPI_NR_MAX_SS && mac->SSpace[bwp_id][ss_id] != NULL; ss_id++){
|
||||
LOG_D(NR_MAC, "[DCI_CONFIG] ss_id %d\n",ss_id);
|
||||
NR_SearchSpace_t *ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id];
|
||||
NR_SearchSpace_t *ss = mac->SSpace[bwp_id][ss_id];
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
||||
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
|
||||
struct NR_PhysicalCellGroupConfig *phy_cgc = mac->cg->physicalCellGroupConfig;
|
||||
|
||||
@@ -919,7 +919,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
|
||||
if (mac->ra.ra_state == WAIT_CONTENTION_RESOLUTION)
|
||||
rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_0; // msg3 retransmission
|
||||
config_dci_pdu(mac, rel15, dl_config, mac->ra.ra_state == WAIT_RAR ? NR_RNTI_RA : NR_RNTI_TC , -1);
|
||||
config_dci_pdu(mac, rel15, dl_config, mac->ra.ra_state == WAIT_RAR ? NR_RNTI_RA : NR_RNTI_TC , mac->ra.ss->searchSpaceId);
|
||||
fill_dci_search_candidates(mac->ra.ss, rel15);
|
||||
dl_config->number_pdus = 1;
|
||||
LOG_D(MAC,"mac->cg %p: Calling fill_scheduled_response rnti %x, type0_pdcch, num_pdus %d\n",mac->cg,rel15->rnti,dl_config->number_pdus);
|
||||
|
||||
@@ -60,22 +60,21 @@ uint16_t get_ssboffset_pointa(NR_ServingCellConfigCommon_t *scc,const long band)
|
||||
int ratio;
|
||||
switch (*scc->ssbSubcarrierSpacing) {
|
||||
case NR_SubcarrierSpacing_kHz15:
|
||||
AssertFatal(band <= 79,
|
||||
AssertFatal(band <= 95,
|
||||
"Band %ld is not possible for SSB with 15 kHz SCS\n",
|
||||
band);
|
||||
if (band < 77) // below 3GHz
|
||||
ratio = 3; // NRARFCN step is 5 kHz
|
||||
else
|
||||
ratio = 1; // NRARFCN step is 15 kHz
|
||||
// no band available above 3GHz using 15kHz
|
||||
ratio = 3; // NRARFCN step is 5 kHz
|
||||
break;
|
||||
case NR_SubcarrierSpacing_kHz30:
|
||||
AssertFatal(band <= 79,
|
||||
"Band %ld is not possible for SSB with 15 kHz SCS\n",
|
||||
AssertFatal(band <= 96,
|
||||
"Band %ld is not possible for SSB with 30 kHz SCS\n",
|
||||
band);
|
||||
if (band < 77) // below 3GHz
|
||||
ratio = 6; // NRARFCN step is 5 kHz
|
||||
if (band == 46 || band == 48 || band == 77 ||
|
||||
band == 78 || band == 79 || band == 96) // above 3GHz
|
||||
ratio = 2; // NRARFCN step is 15 kHz
|
||||
else
|
||||
ratio = 2; // NRARFCN step is 15 kHz
|
||||
ratio = 6; // NRARFCN step is 5 kHz
|
||||
break;
|
||||
case NR_SubcarrierSpacing_kHz120:
|
||||
AssertFatal(band >= 257,
|
||||
|
||||
@@ -513,7 +513,7 @@ void nr_store_dlsch_buffer(module_id_t module_id,
|
||||
|
||||
if (sched_ctrl->num_total_bytes == 0
|
||||
&& !sched_ctrl->ta_apply) /* If TA should be applied, give at least one RB */
|
||||
return;
|
||||
continue;
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"[%s][%d.%d], %s%d->DLSCH, RLC status %d bytes TA %d\n",
|
||||
|
||||
@@ -67,9 +67,7 @@ typedef struct {
|
||||
} pdcp_params_t;
|
||||
|
||||
|
||||
#ifndef PDCP_USE_NETLINK
|
||||
#define PDCP_USE_NETLINK ( get_pdcp_optmask() & PDCP_USE_NETLINK_BIT)
|
||||
#endif
|
||||
#define PDCP_USE_NETLINK ( get_pdcp_optmask() & PDCP_USE_NETLINK_BIT)
|
||||
#define LINK_ENB_PDCP_TO_IP_DRIVER ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_IP_DRIVER_BIT)
|
||||
#define LINK_ENB_PDCP_TO_GTPV1U ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_GTPV1U_BIT)
|
||||
#define UE_NAS_USE_TUN ( get_pdcp_optmask() & UE_NAS_USE_TUN_BIT)
|
||||
@@ -501,7 +499,6 @@ typedef struct {
|
||||
#define REORDERING_WINDOW_SN_7BIT 64
|
||||
#define REORDERING_WINDOW_SN_12BIT 2048
|
||||
|
||||
extern signed int pdcp_2_nas_irq;
|
||||
extern pdcp_stats_t UE_pdcp_stats[MAX_MOBILES_PER_ENB];
|
||||
extern pdcp_stats_t eNB_pdcp_stats[NUMBER_OF_eNB_MAX];
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
# include "rlc_tm_entity.h"
|
||||
# include "mem_block.h"
|
||||
//# include "rrm_config_structs.h"
|
||||
# include "rlc_tm_structs.h"
|
||||
//# include "rlc.h"
|
||||
# include "platform_types.h"
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "rlc_um.h"
|
||||
#include "rlc_primitives.h"
|
||||
#include "list.h"
|
||||
#include "rrm_config_structs.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
# include "rlc_um_entity.h"
|
||||
# include "mem_block.h"
|
||||
# include "rrm_config_structs.h"
|
||||
# include "rlc_um_structs.h"
|
||||
# include "rlc_um_constants.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -362,264 +362,5 @@ int dump_eNB_l2_stats(char *buffer, int length) {
|
||||
|
||||
return len + 1 /* SR: for trailing \0 */;
|
||||
}
|
||||
#ifdef PROC
|
||||
int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) {
|
||||
int len = 0,fg,Overhead, Sign;
|
||||
unsigned int i,j,k,kk;
|
||||
unsigned int Mod_id = 0,CH_index;
|
||||
unsigned int tx_pdcp_sdu;
|
||||
unsigned int tx_pdcp_sdu_discarded;
|
||||
unsigned int tx_retransmit_pdu_unblock;
|
||||
unsigned int tx_retransmit_pdu_by_status;
|
||||
unsigned int tx_retransmit_pdu;
|
||||
unsigned int tx_data_pdu;
|
||||
unsigned int tx_control_pdu;
|
||||
unsigned int rx_sdu;
|
||||
unsigned int rx_error_pdu;
|
||||
unsigned int rx_data_pdu;
|
||||
unsigned int rx_data_pdu_out_of_window;
|
||||
unsigned int rx_control_pdu;
|
||||
|
||||
// if (mac_xface->is_cluster_head == 0) {
|
||||
for (k=0; k<NB_INST; k++) {
|
||||
if (Mac_rlc_xface->Is_cluster_head[k] == 0) {
|
||||
#ifndef PHY_EMUL_ONE_MACHINE
|
||||
Mod_id=k-NB_CH_INST;
|
||||
len+=sprintf(&buffer[len],"UE TTI: %d\n",Mac_rlc_xface->frame);
|
||||
|
||||
for (CH_index = 0; CH_index<NB_CNX_UE; CH_index++) {
|
||||
if (UE_mac_inst[Mod_id].Dcch_lchan[CH_index].Active==1) {
|
||||
len+=sprintf(&buffer[len],"CH %u: Wideband SINR %d dB---\n",
|
||||
CH_index,UE_mac_inst[Mod_id].Def_meas[CH_index].Wideband_sinr);
|
||||
len+=sprintf(&buffer[len],"CH %u: Subband SINR (dB) :",
|
||||
CH_index);
|
||||
|
||||
for (fg=0; fg<NUMBER_OF_MEASUREMENT_SUBBANDS; fg++) {
|
||||
len+=sprintf(&buffer[len],"%d ",UE_mac_inst[Mod_id].Def_meas[CH_index].Sinr_meas[0][fg]);
|
||||
}
|
||||
|
||||
len+=sprintf(&buffer[len],"\n");
|
||||
len+=sprintf(&buffer[len],"BCCH %d, NB_RX_MAC = %d (%d errors)\n",
|
||||
UE_mac_inst[Mod_id].Bcch_lchan[CH_index].Lchan_info.Lchan_id.Index,
|
||||
UE_mac_inst[Mod_id].Bcch_lchan[CH_index].Lchan_info.NB_RX,
|
||||
UE_mac_inst[Mod_id].Bcch_lchan[CH_index].Lchan_info.NB_RX_ERRORS);
|
||||
len+=sprintf(&buffer[len],"CCCH %d, NB_RX_MAC = %d (%d errors)\n",
|
||||
UE_mac_inst[Mod_id].Ccch_lchan[CH_index].Lchan_info.Lchan_id.Index,
|
||||
UE_mac_inst[Mod_id].Ccch_lchan[CH_index].Lchan_info.NB_RX,
|
||||
UE_mac_inst[Mod_id].Ccch_lchan[CH_index].Lchan_info.NB_RX_ERRORS);
|
||||
len+=sprintf(&buffer[len],"LCHAN %d (DCCH), NB_TX_MAC = %d (%d bits/TTI, %d kbits/sec), NB_RX_MAC = %d (%d errors)\n",
|
||||
UE_mac_inst[Mod_id].Dcch_lchan[CH_index].Lchan_info.Lchan_id.Index,
|
||||
UE_mac_inst[Mod_id].Dcch_lchan[CH_index].Lchan_info.NB_TX,
|
||||
UE_mac_inst[Mod_id].Dcch_lchan[CH_index].Lchan_info.output_rate,
|
||||
(10*UE_mac_inst[Mod_id].Dcch_lchan[CH_index].Lchan_info.output_rate)>>5,
|
||||
UE_mac_inst[Mod_id].Dcch_lchan[CH_index].Lchan_info.NB_RX,
|
||||
UE_mac_inst[Mod_id].Dcch_lchan[CH_index].Lchan_info.NB_RX_ERRORS);
|
||||
|
||||
for(i=1; i<NB_RAB_MAX; i++) {
|
||||
if (UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Active==1) {
|
||||
Overhead=UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.output_rate - Pdcp_stats_tx_rate[k][CH_index][i];
|
||||
|
||||
if(Overhead<0) {
|
||||
Overhead=-Overhead;
|
||||
Sign=-1;
|
||||
} else {
|
||||
Sign=1;
|
||||
}
|
||||
|
||||
len+=sprintf(&buffer[len],
|
||||
"[PDCP]LCHAN %d: NB_TX = %d ,Tx_rate =(%d bits/TTI ,%d Kbits/s), NB_RX = %d ,Rx_rate =(%d bits/TTI ,%d Kbits/s) , LAYER2 TX OVERHEAD: %d Kbits/s\n",
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
|
||||
Pdcp_stats_tx[k][CH_index][i],
|
||||
Pdcp_stats_tx_rate[k][CH_index][i],
|
||||
(10*Pdcp_stats_tx_rate[k][CH_index][i])>>5,
|
||||
Pdcp_stats_rx[k][CH_index][i],
|
||||
Pdcp_stats_rx_rate[k][CH_index][i],
|
||||
(10*Pdcp_stats_rx_rate[k][CH_index][i])>>5,
|
||||
Sign*(10*Overhead)>>5);
|
||||
int status = rlc_stat_req (k,
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
|
||||
&tx_pdcp_sdu,
|
||||
&tx_pdcp_sdu_discarded,
|
||||
&tx_retransmit_pdu_unblock,
|
||||
&tx_retransmit_pdu_by_status,
|
||||
&tx_retransmit_pdu,
|
||||
&tx_data_pdu,
|
||||
&tx_control_pdu,
|
||||
&rx_sdu,
|
||||
&rx_error_pdu,
|
||||
&rx_data_pdu,
|
||||
&rx_data_pdu_out_of_window,
|
||||
&rx_control_pdu) ;
|
||||
|
||||
if (status == RLC_OP_STATUS_OK) {
|
||||
len+=sprintf(&buffer[len],"RLC LCHAN %d, NB_SDU_TO_TX = %u\tNB_SDU_DISC %u\tNB_RX_SDU %u\n",
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
|
||||
tx_pdcp_sdu,
|
||||
tx_pdcp_sdu_discarded,
|
||||
rx_sdu);
|
||||
len+=sprintf(&buffer[len],"RLC LCHAN %d, NB_TB_TX_DATA = %u\tNB_TB_TX_CONTROL %u\tNB_TX_TB_RETRANS %u",
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
|
||||
tx_data_pdu,
|
||||
tx_control_pdu,
|
||||
tx_retransmit_pdu);
|
||||
len+=sprintf(&buffer[len],"\tRLC LCHAN %d, NB_TX_TB_RETRANS_BY_STATUS = %u\tNB_TX_TB_RETRANS_PADD %u\n",
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
|
||||
tx_retransmit_pdu_by_status,
|
||||
tx_retransmit_pdu_unblock);
|
||||
len+=sprintf(&buffer[len],"RLC LCHAN %d, NB_RX_DATA = %u\tNB_RX_TB_OUT_WIN %u\tNB_RX_TB_CORRUPT %u\n",
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
|
||||
rx_data_pdu,
|
||||
rx_data_pdu_out_of_window,
|
||||
rx_error_pdu);
|
||||
}
|
||||
|
||||
len+=sprintf(&buffer[len],"[MAC]: LCHAN %d, NB_TX_MAC = %d (%d bits/TTI, %d kbits/s), NB_RX_MAC = %d (%d errors)\n",
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_TX,
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.output_rate,
|
||||
(10*UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.output_rate)>>5,
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_RX,
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_RX_ERRORS);
|
||||
len+=sprintf(&buffer[len]," TX per TB: ");
|
||||
|
||||
for(kk=0; kk<MAX_NUMBER_TB_PER_LCHAN/2; kk++) {
|
||||
len+=sprintf(&buffer[len],"%d . ",UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_TX_TB[kk]);
|
||||
}
|
||||
|
||||
len+=sprintf(&buffer[len],"\n");
|
||||
len+=sprintf(&buffer[len]," RXerr per TB: ");
|
||||
|
||||
for(kk=0; kk<MAX_NUMBER_TB_PER_LCHAN/2; kk++)
|
||||
len+=sprintf(&buffer[len],"%d/%d . ",UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_RX_ERRORS_TB[kk],
|
||||
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_RX_TB[kk]);
|
||||
|
||||
len+=sprintf(&buffer[len],"\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif //PHY_EMUL_ONE_MACHINE
|
||||
} else if(Mac_rlc_xface->Is_cluster_head[k] ==1) {
|
||||
Mod_id=k;
|
||||
len+=sprintf(&buffer[len],
|
||||
"------------------------------------------------------------------- TTI: %d------------------------------------------------------------------\n",
|
||||
Mac_rlc_xface->frame);
|
||||
|
||||
for(i=1; i<=NB_CNX_CH; i++) {
|
||||
if (CH_mac_inst[Mod_id].Dcch_lchan[i].Active==1) {
|
||||
len+=sprintf(&buffer[len],"\nMR index %u: DL SINR (feedback) %d dB, CQI: %s\n\n",
|
||||
i,//CH_rrc_inst[Mod_id].Info.UE_info[i].L2_id[0],
|
||||
CH_mac_inst[Mod_id].Def_meas[i].Wideband_sinr,
|
||||
print_cqi(CH_mac_inst[Mod_id].Def_meas[i].cqi));
|
||||
len+=sprintf(&buffer[len],
|
||||
"[MAC] LCHAN %d (DCCH), NB_TX_MAC= %d (%d bits/TTI, %d kbits/s), NB_RX_MAC= %d (errors %d, sacch errors %d, sach errors %d, sach_missing %d)\n\n",
|
||||
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.Lchan_id.Index,
|
||||
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_TX,
|
||||
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.output_rate,
|
||||
(10*CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.output_rate)>>5,
|
||||
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_RX,
|
||||
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_RX_ERRORS,
|
||||
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_RX_SACCH_ERRORS,
|
||||
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_RX_SACH_ERRORS,
|
||||
CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_RX_SACH_MISSING);
|
||||
|
||||
for(j=0; j<NB_RAB_MAX; j++) {
|
||||
if (CH_mac_inst[Mod_id].Dtch_lchan[j][i].Active==1) {
|
||||
Overhead=CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.output_rate - Pdcp_stats_tx_rate[k][i][j];
|
||||
|
||||
if(Overhead<0) {
|
||||
Overhead=-Overhead;
|
||||
Sign=-1;
|
||||
} else {
|
||||
Sign=1;
|
||||
}
|
||||
|
||||
len+=sprintf(&buffer[len],
|
||||
"[PDCP]LCHAN %d: NB_TX = %d ,Tx_rate =(%d bits/TTI ,%d Kbits/s), NB_RX = %d ,Rx_rate =(%d bits/TTI ,%d Kbits/s), LAYER2 TX OVERHEAD= %d Kbits/s\n",
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
|
||||
Pdcp_stats_tx[k][i][j],
|
||||
Pdcp_stats_tx_rate[k][i][j],
|
||||
(10*Pdcp_stats_tx_rate[k][i][j])>>5,
|
||||
Pdcp_stats_rx[k][i][j],
|
||||
Pdcp_stats_rx_rate[k][i][j],
|
||||
(10*Pdcp_stats_rx_rate[k][i][j])>>5,
|
||||
Sign*(10*Overhead)>>5);
|
||||
int status = rlc_stat_req (k,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
|
||||
&tx_pdcp_sdu,
|
||||
&tx_pdcp_sdu_discarded,
|
||||
&tx_retransmit_pdu_unblock,
|
||||
&tx_retransmit_pdu_by_status,
|
||||
&tx_retransmit_pdu,
|
||||
&tx_data_pdu,
|
||||
&tx_control_pdu,
|
||||
&rx_sdu,
|
||||
&rx_error_pdu,
|
||||
&rx_data_pdu,
|
||||
&rx_data_pdu_out_of_window,
|
||||
&rx_control_pdu) ;
|
||||
/*
|
||||
if (status == RLC_OP_STATUS_OK) {
|
||||
len+=sprintf(&buffer[len],"\t[RLC] LCHAN %d, NB_SDU_TO_TX = %d\tNB_SDU_DISC %d\tNB_RX_SDU %d\n",
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
|
||||
tx_pdcp_sdu,
|
||||
tx_pdcp_sdu_discarded,
|
||||
rx_sdu);
|
||||
len+=sprintf(&buffer[len],"\t[RLC] LCHAN %d, NB_TB_TX_DATA = %d\tNB_TB_TX_CONTROL %d\tNB_TX_TB_RETRANS %\n",
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
|
||||
tx_data_pdu,
|
||||
tx_control_pdu,
|
||||
tx_retransmit_pdu);
|
||||
len+=sprintf(&buffer[len],"\t[RLC] LCHAN %d, NB_TX_TB_RETRANS_BY_STATUS = %d\tNB_TX_TB_RETRANS_PADD %d\n",
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
|
||||
tx_retransmit_pdu_by_status,
|
||||
tx_retransmit_pdu_unblock);
|
||||
len+=sprintf(&buffer[len],"\t[RLC] LCHAN %d, NB_RX_DATA = %d\tNB_RX_TB_OUT_WIN %d\tNB_RX_TB_CORRUPT %d\n",
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
|
||||
rx_data_pdu,
|
||||
rx_data_pdu_out_of_window,
|
||||
rx_error_pdu);
|
||||
}
|
||||
*/
|
||||
len+=sprintf(&buffer[len],
|
||||
"[MAC]LCHAN %d (CNX %u,RAB %u), NB_TX_MAC= %d (%d bits/TTI, %d kbit/s), NB_RX_MAC= %d (errors %d, sacch_errors %d, sach_errors %d, sach_missing %d)\n",
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
|
||||
i,j,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_TX,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.output_rate,
|
||||
(10*CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.output_rate)>>5,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX_ERRORS,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX_SACCH_ERRORS,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX_SACH_ERRORS,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX_SACH_MISSING);
|
||||
len+=sprintf(&buffer[len],"[MAC][SCHEDULER] TX Arrival Rate %d, TX Service Rate %d, RX Arrival rate %d, RX Service rate %d, NB_BW_REQ_RX %d\n\n",
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Arrival_rate,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Tx_rate,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Req_rate,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Rx_rate,
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_BW_REQ_RX);
|
||||
/*
|
||||
len+=sprintf(&buffer[len]," TX per TB: ");
|
||||
for(kk=0;kk<MAX_NUMBER_TB_PER_LCHAN/2;kk++)
|
||||
len+=sprintf(&buffer[len],"%d.",CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_TX_TB[kk]);
|
||||
len+=sprintf(&buffer[len],"\n");
|
||||
len+=sprintf(&buffer[len]," RXerr per TB: ");
|
||||
for(kk=0;kk<MAX_NUMBER_TB_PER_LCHAN/2;kk++)
|
||||
len+=sprintf(&buffer[len],"%d/%d . ",CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX_ERRORS_TB[kk],
|
||||
CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX_TB[kk]);
|
||||
len+=sprintf(&buffer[len],"\n");
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user