Merging MR978 with develop
This commit is contained in:
@@ -430,7 +430,7 @@ void RCconfig_NR_L1(void) {
|
||||
|
||||
mac_top_init_gNB();
|
||||
|
||||
configure_nfapi_pnf(RC.gNB[j]->eth_params_n.remote_addr, RC.gNB[j]->eth_params_n.remote_portc, RC.gNB[j]->eth_params_n.my_addr, RC.gNB[j]->eth_params_n.my_portd, RC.gNB[j]->eth_params_n .remote_portd);
|
||||
configure_nr_nfapi_pnf(RC.gNB[j]->eth_params_n.remote_addr, RC.gNB[j]->eth_params_n.remote_portc, RC.gNB[j]->eth_params_n.my_addr, RC.gNB[j]->eth_params_n.my_portd, RC.gNB[j]->eth_params_n .remote_portd);
|
||||
}else { // other midhaul
|
||||
}
|
||||
}// for (j = 0; j < RC.nb_nr_L1_inst; j++)
|
||||
@@ -500,8 +500,8 @@ void RCconfig_nr_macrlc() {
|
||||
|
||||
//sf_ahead = 2; // Cannot cope with 4 subframes between RX and TX - set it to 2
|
||||
|
||||
printf("**************** vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc);
|
||||
configure_nfapi_vnf(RC.nrmac[j]->eth_params_s.my_addr, RC.nrmac[j]->eth_params_s.my_portc);
|
||||
printf("**************** vnf_port:%d\n", RC.nrmac[j]->eth_params_s.my_portc);
|
||||
configure_nr_nfapi_vnf(RC.nrmac[j]->eth_params_s.my_addr, RC.nrmac[j]->eth_params_s.my_portc);
|
||||
printf("**************** RETURNED FROM configure_nfapi_vnf() vnf_port:%d\n", RC.nrmac[j]->eth_params_s.my_portc);
|
||||
}else { // other midhaul
|
||||
AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr));
|
||||
|
||||
@@ -3067,6 +3067,49 @@ bool set_dl_ptrs_values(NR_PTRS_DownlinkConfig_t *ptrs_config,
|
||||
//printf("[MAC] PTRS is set K= %u L= %u\n", *K_ptrs,1<<*L_ptrs);
|
||||
return valid;
|
||||
}
|
||||
void get_band(uint64_t downlink_frequency,
|
||||
uint16_t *current_band,
|
||||
int32_t *current_offset,
|
||||
lte_frame_type_t *current_type)
|
||||
{
|
||||
int ind;
|
||||
uint64_t center_frequency_khz;
|
||||
uint64_t center_freq_diff_khz;
|
||||
uint64_t dl_freq_khz = downlink_frequency/1000;
|
||||
|
||||
center_freq_diff_khz = 999999999999999999; // 2^64
|
||||
*current_band = 0;
|
||||
|
||||
for ( ind=0;
|
||||
ind < sizeof(nr_bandtable) / sizeof(nr_bandtable[0]);
|
||||
ind++) {
|
||||
|
||||
LOG_I(PHY, "Scanning band %d, dl_min %"PRIu64", ul_min %"PRIu64"\n", nr_bandtable[ind].band, nr_bandtable[ind].dl_min,nr_bandtable[ind].ul_min);
|
||||
|
||||
if ( nr_bandtable[ind].dl_min <= dl_freq_khz && nr_bandtable[ind].dl_max >= dl_freq_khz ) {
|
||||
|
||||
center_frequency_khz = (nr_bandtable[ind].dl_max + nr_bandtable[ind].dl_min)/2;
|
||||
if (abs(dl_freq_khz - center_frequency_khz) < center_freq_diff_khz){
|
||||
*current_band = nr_bandtable[ind].band;
|
||||
*current_offset = (nr_bandtable[ind].ul_min - nr_bandtable[ind].dl_min)*1000;
|
||||
center_freq_diff_khz = abs(dl_freq_khz - center_frequency_khz);
|
||||
|
||||
if (*current_offset == 0)
|
||||
*current_type = TDD;
|
||||
else
|
||||
*current_type = FDD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I( PHY, "DL frequency %"PRIu64": band %d, frame_type %d, UL frequency %"PRIu64"\n",
|
||||
downlink_frequency, *current_band, *current_type, downlink_frequency+*current_offset);
|
||||
|
||||
AssertFatal(*current_band != 0,
|
||||
"Can't find EUTRA band for frequency %lu\n", downlink_frequency);
|
||||
}
|
||||
|
||||
|
||||
uint32_t get_ssb_slot(uint32_t ssb_index){
|
||||
// this function now only support f <= 3GHz
|
||||
return ssb_index & 0x3 ;
|
||||
|
||||
@@ -140,6 +140,7 @@ bool set_dl_ptrs_values(NR_PTRS_DownlinkConfig_t *ptrs_config,
|
||||
uint8_t *K_ptrs, uint8_t *L_ptrs,uint8_t *portIndex,
|
||||
uint8_t *nERatio,uint8_t *reOffset,
|
||||
uint8_t NrOfSymbols);
|
||||
void get_band(uint64_t downlink_frequency, uint16_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type);
|
||||
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
#include "NR_MIB.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
|
||||
#include "../../../../nfapi/oai_integration/vendor_ext.h"
|
||||
/* Softmodem params */
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
@@ -264,6 +264,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
}
|
||||
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask.tl.tag = NFAPI_NR_CONFIG_SSB_MASK_TAG;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask.tl.tag = NFAPI_NR_CONFIG_SSB_MASK_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->carrier_config.num_tx_ant.value = pdsch_AntennaPorts;
|
||||
@@ -282,6 +283,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
cfg->num_tlv++;
|
||||
cfg->num_tlv++;
|
||||
|
||||
|
||||
// TDD Table Configuration
|
||||
//cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;
|
||||
cfg->tdd_table.tdd_period.tl.tag = NFAPI_NR_CONFIG_TDD_PERIOD_TAG;
|
||||
@@ -306,6 +308,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
LOG_E(MAC,"TDD configuration can not be done\n");
|
||||
else
|
||||
LOG_I(MAC,"TDD has been properly configurated\n");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -366,7 +369,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
LOG_E(MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req);
|
||||
|
||||
// if in nFAPI mode
|
||||
if ( (nfapi_mode == 1 || nfapi_mode == 2) && (RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req == NULL) ){
|
||||
if ( (NFAPI_MODE == NFAPI_MODE_PNF || NFAPI_MODE == NFAPI_MODE_VNF) && (RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req == NULL) ){
|
||||
while(RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req == NULL) {
|
||||
// DJP AssertFatal(RC.nrmac[Mod_idP]->if_inst->PHY_config_req != NULL,"if_inst->phy_config_request is null\n");
|
||||
usleep(100 * 1000);
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "intertask_interface.h"
|
||||
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
|
||||
|
||||
@@ -104,7 +105,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
|
||||
|
||||
gNB->pdu_index[CC_idP] = 0;
|
||||
|
||||
if (nfapi_mode==0 || nfapi_mode == 1) { // monolithic or PNF
|
||||
if (NFAPI_MODE == NFAPI_MONOLITHIC || NFAPI_MODE == NFAPI_MODE_PNF) { // monolithic or PNF
|
||||
|
||||
DL_req[CC_idP].SFN = frameP;
|
||||
DL_req[CC_idP].Slot = slotP;
|
||||
@@ -302,7 +303,7 @@ bool is_xlsch_in_slot(uint64_t bitmap, sub_frame_t slot) {
|
||||
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
frame_t frame,
|
||||
sub_frame_t slot){
|
||||
|
||||
|
||||
protocol_ctxt_t ctxt;
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame, slot,module_idP);
|
||||
|
||||
@@ -314,7 +315,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
NR_COMMON_channels_t *cc = gNB->common_channels;
|
||||
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
||||
NR_TDD_UL_DL_Pattern_t *tdd_pattern = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
|
||||
|
||||
|
||||
switch(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity) {
|
||||
case 0:
|
||||
nb_periods_per_frame = 20; // 10ms/0p5ms
|
||||
@@ -380,7 +381,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
UE_info->num_pdcch_cand[UE_id][i] = 0;
|
||||
for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
//mbsfn_status[CC_id] = 0;
|
||||
|
||||
// clear vrb_maps
|
||||
memset(cc[CC_id].vrb_map, 0, sizeof(uint16_t) * MAX_BWP_SIZE);
|
||||
// clear last scheduled slot's content (only)!
|
||||
@@ -391,8 +391,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
|
||||
clear_nr_nfapi_information(RC.nrmac[module_idP], CC_id, frame, slot);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ((slot == 0) && (frame & 127) == 0) dump_mac_stats(RC.nrmac[module_idP]);
|
||||
|
||||
|
||||
@@ -430,7 +429,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
if (get_softmodem_params()->phy_test == 0) {
|
||||
nr_schedule_RA(module_idP, frame, slot);
|
||||
}
|
||||
|
||||
// This schedules the DCI for Uplink and subsequently PUSCH
|
||||
{
|
||||
nr_schedule_ulsch(module_idP, frame, slot, num_slots_per_tdd, nr_ulmix_slots, ulsch_in_slot_bitmap);
|
||||
|
||||
@@ -103,7 +103,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE;
|
||||
dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu));
|
||||
|
||||
dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs+1];
|
||||
dl_tti_pdsch_pdu = &nr_mac->DL_req[CC_id].dl_tti_request_body.dl_tti_pdu_list[nr_mac->DL_req[CC_id].dl_tti_request_body.nPDUs+1];
|
||||
memset((void *)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t));
|
||||
dl_tti_pdsch_pdu->PDUType = NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE;
|
||||
dl_tti_pdsch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdsch_pdu));
|
||||
@@ -238,7 +238,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
pdsch_pdu_rel15->mcsIndex[0]);
|
||||
*/
|
||||
|
||||
dl_req->nPDUs+=2;
|
||||
nr_mac->DL_req[CC_id].dl_tti_request_body.nPDUs+=2;
|
||||
|
||||
TX_req = &nr_mac->TX_req[CC_id].pdu_list[nr_mac->TX_req[CC_id].Number_of_PDUs];
|
||||
TX_req->PDU_length = 6;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "NR_MAC_gNB/mac_proto.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
|
||||
@@ -1130,4 +1130,4 @@ void nr_schedule_ulsch(module_id_t module_id,
|
||||
|
||||
memset(sched_pusch, 0, sizeof(*sched_pusch));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2098,8 +2098,7 @@ pdcp_config_set_security(
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_pdcp_config_req (
|
||||
void rrc_pdcp_config_req (
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const uint32_t actionP,
|
||||
|
||||
@@ -196,7 +196,6 @@ int pdcp_fifo_flush_mbms_sdus(const protocol_ctxt_t *const ctxt_pP) {
|
||||
//} // PDCP_USE_NETLINK
|
||||
|
||||
//AssertFatal(ret >= 0,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (errno: %d %s)\n", errno, strerror(errno));
|
||||
|
||||
//AssertFatal(ret >= 0,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (errno: %d %s)\n", errno, strerror(errno));
|
||||
delNotifiedFIFO_elt (sdu_p);
|
||||
pdcp_nb_sdu_sent ++;
|
||||
|
||||
@@ -49,7 +49,6 @@ static uint64_t pdcp_optmask;
|
||||
/* rlc_data_req queue - begin */
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
/* NR PDCP and RLC both use "big locks". In some cases a thread may do
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#define MAX_IF_MODULES 100
|
||||
//#define UL_HARQ_PRINT
|
||||
|
||||
@@ -184,7 +184,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
module_id,CC_id, UL_info->rach_ind.number_of_pdus,
|
||||
UL_info->rx_ind.number_of_pdus, UL_info->crc_ind.number_crcs);
|
||||
|
||||
if (nfapi_mode != 1) {
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF) {
|
||||
if (ifi->CC_mask==0) {
|
||||
ifi->current_frame = UL_info->frame;
|
||||
ifi->current_slot = UL_info->slot;
|
||||
@@ -203,7 +203,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
mac->UL_dci_req[CC_id].numPdus = 0;
|
||||
handle_nr_ulsch(UL_info);
|
||||
|
||||
if (nfapi_mode != 1) {
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF) {
|
||||
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
|
||||
/*
|
||||
eNB_dlsch_ulsch_scheduler(module_id,
|
||||
@@ -215,7 +215,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
gNB_dlsch_ulsch_scheduler(module_id,
|
||||
(UL_info->frame+((UL_info->slot>(spf-1-sl_ahead))?1:0)) % 1024,
|
||||
(UL_info->slot+sl_ahead)%spf);
|
||||
|
||||
|
||||
ifi->CC_mask = 0;
|
||||
sched_info->module_id = module_id;
|
||||
sched_info->CC_id = CC_id;
|
||||
@@ -243,6 +243,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
sched_info->frame,
|
||||
sched_info->slot,
|
||||
sched_info->DL_req->dl_tti_request_body.nPDUs);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||
#include "common/config/config_load_configmodule.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
#include "openair1/PHY/defs_gNB.h"
|
||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h"
|
||||
#include "openair1/PHY/LTE_TRANSPORT/transport_common.h"
|
||||
|
||||
extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
|
||||
void configure_nfapi_pnf(char *vnf_ip_addr,
|
||||
|
||||
@@ -1061,7 +1061,7 @@ void release_UE_in_freeList(module_id_t mod_id) {
|
||||
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
for (i=0; i<MAX_MOBILES_PER_ENB; i++) {
|
||||
ulsch = eNB_PHY->ulsch[i];
|
||||
@@ -7894,6 +7894,7 @@ rrc_eNB_decode_dcch(
|
||||
}
|
||||
|
||||
ue_context_p->ue_context.reestablishment_xid = -1;
|
||||
|
||||
} else {
|
||||
dedicated_DRB = 1;
|
||||
ue_context_p->ue_context.Status = RRC_RECONFIGURED;
|
||||
@@ -7901,7 +7902,6 @@ rrc_eNB_decode_dcch(
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
}
|
||||
|
||||
rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
ctxt_pP,
|
||||
ue_context_p,
|
||||
|
||||
@@ -303,4 +303,4 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
|
||||
return(0);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user