Merge remote-tracking branch 'origin/develop-nr' into 409-merge-ulschsim-containing-pusch-encoding-and-decoding
This commit is contained in:
@@ -361,7 +361,7 @@ typedef struct NRRrcConfigurationReq_s {
|
||||
lte_prefix_type_t UL_BWP_prefix_type[MAX_NUM_CCs];
|
||||
long UL_timeAlignmentTimerCommon[MAX_NUM_CCs];
|
||||
long ServingCellConfigCommon_n_TimingAdvanceOffset[MAX_NUM_CCs];
|
||||
long ServingCellConfigCommon_ssb_PositionsInBurst_PR[MAX_NUM_CCs];
|
||||
uint64_t ServingCellConfigCommon_ssb_PositionsInBurst_PR[MAX_NUM_CCs];
|
||||
long ServingCellConfigCommon_ssb_periodicityServingCell[MAX_NUM_CCs]; //ServingCellConfigCommon
|
||||
long ServingCellConfigCommon_dmrs_TypeA_Position[MAX_NUM_CCs]; //ServingCellConfigCommon
|
||||
long NIA_SubcarrierSpacing[MAX_NUM_CCs]; //ServingCellConfigCommon Used only for non-initial access
|
||||
|
||||
@@ -103,7 +103,6 @@ void RCconfig_nr_flexran()
|
||||
*UL_frequencyShift7p5khz, *UL_SCS_SubcarrierSpacing, *UL_BWP_SubcarrierSpacing,
|
||||
*UL_BWP_prefix_type, *UL_timeAlignmentTimerCommon,
|
||||
*ServingCellConfigCommon_n_TimingAdvanceOffset,
|
||||
*ServingCellConfigCommon_ssb_PositionsInBurst_PR,
|
||||
*NIA_SubcarrierSpacing, *referenceSubcarrierSpacing, *dl_UL_TransmissionPeriodicity,
|
||||
*rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,
|
||||
*rach_groupBconfigured, *rach_messagePowerOffsetGroupB,
|
||||
@@ -118,7 +117,7 @@ void RCconfig_nr_flexran()
|
||||
*SearchSpace_searchSpaceType, *ue_Specific__dci_Formats,
|
||||
*RateMatchPatternLTE_CRS_subframeAllocation_choice;
|
||||
|
||||
uint64_t downlink_frequency;
|
||||
uint64_t downlink_frequency, ServingCellConfigCommon_ssb_PositionsInBurst_PR;
|
||||
|
||||
int32_t nr_band, uplink_frequency_offset, N_RB_DL, nb_antenna_ports,
|
||||
MIB_subCarrierSpacingCommon, MIB_ssb_SubcarrierOffset, MIB_dmrs_TypeA_Position,
|
||||
@@ -484,7 +483,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
char* UL_timeAlignmentTimerCommon = 0;
|
||||
|
||||
char* ServingCellConfigCommon_n_TimingAdvanceOffset = 0;
|
||||
char* ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0;
|
||||
uint64_t ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0;
|
||||
int32_t ServingCellConfigCommon_ssb_periodicityServingCell = 0;
|
||||
int32_t ServingCellConfigCommon_dmrs_TypeA_Position = 0;
|
||||
char* NIA_SubcarrierSpacing = 0;
|
||||
@@ -1125,19 +1124,23 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
RC.config_file_name, i, ServingCellConfigCommon_n_TimingAdvanceOffset);
|
||||
}
|
||||
|
||||
if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"shortBitmap")==0) {
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap;
|
||||
}else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"mediumBitmap")==0) {
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap;
|
||||
}else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"longBitmap")==0) {
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap;
|
||||
}else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"NOTHING")==0) {
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_NOTHING;
|
||||
}else {
|
||||
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for ServingCellConfigCommon_ssb_PositionsInBurst_PR choice !\n",
|
||||
RC.config_file_name, i, ServingCellConfigCommon_ssb_PositionsInBurst_PR);
|
||||
}
|
||||
|
||||
uint64_t t_freq;
|
||||
if(nr_band == 41 || (nr_band > 76 && nr_band < 80))
|
||||
t_freq = 2400000000;
|
||||
else
|
||||
t_freq = 3000000000;
|
||||
|
||||
if (downlink_frequency<t_freq && (ServingCellConfigCommon_ssb_PositionsInBurst_PR > 15))
|
||||
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unvalid value \"%ld\" for ssb_PositionsInBurst at DL frequency %ld !\n",
|
||||
RC.config_file_name, i, ServingCellConfigCommon_ssb_PositionsInBurst_PR, downlink_frequency);
|
||||
else {
|
||||
if(downlink_frequency<6000000000 && (ServingCellConfigCommon_ssb_PositionsInBurst_PR > 255))
|
||||
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unvalid value \"%ld\" for ssb_PositionsInBurst at DL frequency %ld !\n",
|
||||
RC.config_file_name, i, ServingCellConfigCommon_ssb_PositionsInBurst_PR, downlink_frequency);
|
||||
else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon_ssb_PositionsInBurst_PR;
|
||||
}
|
||||
|
||||
switch (ServingCellConfigCommon_ssb_periodicityServingCell) {
|
||||
case 5:
|
||||
|
||||
@@ -640,7 +640,7 @@ typedef enum {
|
||||
{GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE, NULL, 0, strptr:&UL_BWP_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_TIMEALIGNMENTTIMERCOMMON, NULL, 0, strptr:&UL_timeAlignmentTimerCommon, defstrval:"infinity", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_N_TIMINGADVANCEOFFSET, NULL, 0, strptr:&ServingCellConfigCommon_n_TimingAdvanceOffset, defstrval:"n0", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR, NULL, 0, strptr:&ServingCellConfigCommon_ssb_PositionsInBurst_PR, defstrval:"shortBitmap", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR, NULL, 0, i64ptr:(int64_t *)&ServingCellConfigCommon_ssb_PositionsInBurst_PR, defint64val:0, TYPE_UINT64, 0}, \
|
||||
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&ServingCellConfigCommon_ssb_periodicityServingCell, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION, NULL, 0, iptr:&ServingCellConfigCommon_dmrs_TypeA_Position, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING, NULL, 0, strptr:&NIA_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \
|
||||
|
||||
@@ -49,110 +49,6 @@ extern RAN_CONTEXT_t RC;
|
||||
extern void mac_top_init_gNB(void);
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
int32_t **rxdata;
|
||||
int32_t **txdata;
|
||||
|
||||
typedef struct nr_bandentry_s {
|
||||
int16_t band;
|
||||
uint64_t ul_min;
|
||||
uint64_t ul_max;
|
||||
uint64_t dl_min;
|
||||
uint64_t dl_max;
|
||||
uint64_t N_OFFs_DL;
|
||||
uint64_t step_size;
|
||||
} nr_bandentry_t;
|
||||
|
||||
typedef struct band_info_s {
|
||||
int nbands;
|
||||
nr_bandentry_t band_info[100];
|
||||
} nr_band_info_t;
|
||||
|
||||
static const nr_bandentry_t nr_bandtable[] = {
|
||||
{1, 1920000, 1980000, 2110000, 2170000, 20, 422000},
|
||||
{2, 1850000, 1910000, 1930000, 1990000, 20, 386000},
|
||||
{3, 1710000, 1785000, 1805000, 1880000, 20, 361000},
|
||||
{5, 824000, 849000, 869000, 894000, 20, 173800},
|
||||
{7, 2500000, 2570000, 2620000, 2690000, 20, 524000},
|
||||
{8, 880000, 915000, 925000, 960000, 20, 185000},
|
||||
{12, 698000, 716000, 728000, 746000, 20, 145800},
|
||||
{20, 832000, 862000, 791000, 821000, 20, 158200},
|
||||
{25, 1850000, 1915000, 1930000, 1995000, 20, 386000},
|
||||
{28, 703000, 758000, 758000, 813000, 20, 151600},
|
||||
{34, 2010000, 2025000, 2010000, 2025000, 20, 402000},
|
||||
{38, 2570000, 2620000, 2570000, 2630000, 20, 514000},
|
||||
{39, 1880000, 1920000, 1880000, 1920000, 20, 376000},
|
||||
{40, 2300000, 2400000, 2300000, 2400000, 20, 460000},
|
||||
{41, 2496000, 2690000, 2496000, 2690000, 3, 499200},
|
||||
{50, 1432000, 1517000, 1432000, 1517000, 20, 286400},
|
||||
{51, 1427000, 1432000, 1427000, 1432000, 20, 285400},
|
||||
{66, 1710000, 1780000, 2110000, 2200000, 20, 422000},
|
||||
{70, 1695000, 1710000, 1995000, 2020000, 20, 399000},
|
||||
{71, 663000, 698000, 617000, 652000, 20, 123400},
|
||||
{74, 1427000, 1470000, 1475000, 1518000, 20, 295000},
|
||||
{75, 000, 000, 1432000, 1517000, 20, 286400},
|
||||
{76, 000, 000, 1427000, 1432000, 20, 285400},
|
||||
{77, 3300000, 4200000, 3300000, 4200000, 1, 620000},
|
||||
{78, 3300000, 3800000, 3300000, 3800000, 1, 620000},
|
||||
{79, 4400000, 5000000, 4400000, 5000000, 2, 693334},
|
||||
{80, 1710000, 1785000, 000, 000, 20, 342000},
|
||||
{81, 860000, 915000, 000, 000, 20, 176000},
|
||||
{82, 832000, 862000, 000, 000, 20, 166400},
|
||||
{83, 703000, 748000, 000, 000, 20, 140600},
|
||||
{84, 1920000, 1980000, 000, 000, 20, 384000},
|
||||
{86, 1710000, 1785000, 000, 000, 20, 342000}
|
||||
};
|
||||
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint32_t bw)
|
||||
{
|
||||
|
||||
uint64_t dl_CarrierFreq_by_1k = dl_CarrierFreq / 1000;
|
||||
int bw_kHz = bw / 1000;
|
||||
|
||||
int i;
|
||||
|
||||
LOG_I(MAC,"Searching for nr band %d DL Carrier frequency %llu bw %u\n",nr_bandP,(long long unsigned int)dl_CarrierFreq,bw);
|
||||
AssertFatal(nr_bandP < 86, "nr_band %d > 86\n", nr_bandP);
|
||||
for (i = 0; i < 30 && nr_bandtable[i].band != nr_bandP; i++);
|
||||
|
||||
AssertFatal(dl_CarrierFreq_by_1k >= nr_bandtable[i].dl_min,
|
||||
"Band %d, bw %u : DL carrier frequency %llu kHz < %llu\n",
|
||||
nr_bandP, bw, (long long unsigned int)dl_CarrierFreq_by_1k,
|
||||
(long long unsigned int)nr_bandtable[i].dl_min);
|
||||
AssertFatal(dl_CarrierFreq_by_1k <=
|
||||
(nr_bandtable[i].dl_max - bw_kHz),
|
||||
"Band %d, dl_CarrierFreq %llu bw %u: DL carrier frequency %llu kHz > %llu\n",
|
||||
nr_bandP, (long long unsigned int)dl_CarrierFreq,bw, (long long unsigned int)dl_CarrierFreq_by_1k,
|
||||
(long long unsigned int)(nr_bandtable[i].dl_max - bw_kHz));
|
||||
|
||||
int deltaFglobal;
|
||||
|
||||
if (dl_CarrierFreq < 3e9) deltaFglobal = 5;
|
||||
else deltaFglobal = 15;
|
||||
|
||||
// This is equation before Table 5.4.2.1-1 in 38101-1-f30
|
||||
// F_REF=F_REF_Offs + deltaF_Global(N_REF-NREF_REF_Offs)
|
||||
return (((dl_CarrierFreq_by_1k - nr_bandtable[i].dl_min)/deltaFglobal) +
|
||||
nr_bandtable[i].N_OFFs_DL);
|
||||
}
|
||||
|
||||
|
||||
uint64_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn)
|
||||
{
|
||||
|
||||
int i;
|
||||
int deltaFglobal;
|
||||
|
||||
if (nr_bandP < 77 || nr_bandP > 79) deltaFglobal = 5;
|
||||
else deltaFglobal = 15;
|
||||
|
||||
AssertFatal(nr_bandP < 87, "nr_band %d > 86\n", nr_bandP);
|
||||
for (i = 0; i < 31 && nr_bandtable[i].band != nr_bandP; i++);
|
||||
AssertFatal(dl_nrarfcn>=nr_bandtable[i].N_OFFs_DL,"dl_nrarfcn %u < N_OFFs_DL %llu\n",dl_nrarfcn, (long long unsigned int)nr_bandtable[i].N_OFFs_DL);
|
||||
|
||||
return 1000*(nr_bandtable[i].dl_min + (dl_nrarfcn - nr_bandtable[i].N_OFFs_DL) * deltaFglobal);
|
||||
|
||||
}
|
||||
|
||||
void config_nr_mib(int Mod_idP,
|
||||
int CC_idP,
|
||||
@@ -184,8 +80,10 @@ void config_nr_mib(int Mod_idP,
|
||||
|
||||
void config_common(int Mod_idP,
|
||||
int CC_idP,
|
||||
int cellid,
|
||||
int nr_bandP,
|
||||
uint64_t dl_CarrierFreqP,
|
||||
uint64_t ssb_pattern,
|
||||
uint64_t dl_CarrierFreqP,
|
||||
uint32_t dl_BandwidthP
|
||||
){
|
||||
|
||||
@@ -193,6 +91,9 @@ void config_common(int Mod_idP,
|
||||
|
||||
int mu = 1;
|
||||
|
||||
cfg->sch_config.physical_cell_id.value = cellid;
|
||||
cfg->sch_config.ssb_scg_position_in_burst.value = ssb_pattern;
|
||||
|
||||
// FDD
|
||||
cfg->subframe_config.duplex_mode.value = 1;
|
||||
cfg->subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG;
|
||||
@@ -232,8 +133,10 @@ void config_common(int Mod_idP,
|
||||
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int CC_idP,
|
||||
int cellid,
|
||||
int p_gNB,
|
||||
int nr_bandP,
|
||||
uint64_t ssb_pattern,
|
||||
uint64_t dl_CarrierFreqP,
|
||||
int dl_BandwidthP,
|
||||
NR_BCCH_BCH_Message_t *mib,
|
||||
@@ -258,10 +161,13 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
);
|
||||
}// END if( mib != NULL )
|
||||
|
||||
|
||||
if( servingcellconfigcommon != NULL ){
|
||||
config_common(Mod_idP,
|
||||
CC_idP,
|
||||
cellid,
|
||||
nr_bandP,
|
||||
ssb_pattern,
|
||||
dl_CarrierFreqP,
|
||||
dl_BandwidthP
|
||||
);
|
||||
|
||||
@@ -38,8 +38,10 @@ void mac_top_init_gNB(void);
|
||||
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int CC_id,
|
||||
int cellid,
|
||||
int p_gNB,
|
||||
int nr_bandP,
|
||||
uint64_t ssb_pattern,
|
||||
uint64_t dl_CarrierFreqP,
|
||||
int dl_BandwidthP,
|
||||
NR_BCCH_BCH_Message_t *mib,
|
||||
@@ -100,4 +102,10 @@ int to_absslot(nfapi_nr_config_request_t *cfg,int frame,int slot);
|
||||
|
||||
int get_symbolsperslot(nfapi_nr_config_request_t *cfg);
|
||||
|
||||
void get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type);
|
||||
|
||||
uint64_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn);
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint32_t bw);
|
||||
|
||||
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* 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 nr_mac_common.c
|
||||
* \brief Common MAC functions for NR UE and gNB
|
||||
* \author Florian Kaltenberger and Raymond Knopp
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
* \company Eurecom, NTUST
|
||||
* \email: florian.kalteberger@eurecom.fr, raymond.knopp@eurecom.fr
|
||||
* @ingroup _mac
|
||||
|
||||
*/
|
||||
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
nr_bandentry_t nr_bandtable[] = {
|
||||
{1, 1920000, 1980000, 2110000, 2170000, 20, 422000},
|
||||
{2, 1850000, 1910000, 1930000, 1990000, 20, 386000},
|
||||
{3, 1710000, 1785000, 1805000, 1880000, 20, 361000},
|
||||
{5, 824000, 849000, 869000, 894000, 20, 173800},
|
||||
{7, 2500000, 2570000, 2620000, 2690000, 20, 524000},
|
||||
{8, 880000, 915000, 925000, 960000, 20, 185000},
|
||||
{12, 698000, 716000, 728000, 746000, 20, 145800},
|
||||
{20, 832000, 862000, 791000, 821000, 20, 158200},
|
||||
{25, 1850000, 1915000, 1930000, 1995000, 20, 386000},
|
||||
{28, 703000, 758000, 758000, 813000, 20, 151600},
|
||||
{34, 2010000, 2025000, 2010000, 2025000, 20, 402000},
|
||||
{38, 2570000, 2620000, 2570000, 2630000, 20, 514000},
|
||||
{39, 1880000, 1920000, 1880000, 1920000, 20, 376000},
|
||||
{40, 2300000, 2400000, 2300000, 2400000, 20, 460000},
|
||||
{41, 2496000, 2690000, 2496000, 2690000, 3, 499200},
|
||||
{50, 1432000, 1517000, 1432000, 1517000, 20, 286400},
|
||||
{51, 1427000, 1432000, 1427000, 1432000, 20, 285400},
|
||||
{66, 1710000, 1780000, 2110000, 2200000, 20, 422000},
|
||||
{70, 1695000, 1710000, 1995000, 2020000, 20, 399000},
|
||||
{71, 663000, 698000, 617000, 652000, 20, 123400},
|
||||
{74, 1427000, 1470000, 1475000, 1518000, 20, 295000},
|
||||
{75, 000, 000, 1432000, 1517000, 20, 286400},
|
||||
{76, 000, 000, 1427000, 1432000, 20, 285400},
|
||||
{77, 3300000, 4200000, 3300000, 4200000, 1, 620000},
|
||||
{78, 3300000, 3800000, 3300000, 3800000, 1, 620000},
|
||||
{79, 4400000, 5000000, 4400000, 5000000, 2, 693334},
|
||||
{80, 1710000, 1785000, 000, 000, 20, 342000},
|
||||
{81, 860000, 915000, 000, 000, 20, 176000},
|
||||
{82, 832000, 862000, 000, 000, 20, 166400},
|
||||
{83, 703000, 748000, 000, 000, 20, 140600},
|
||||
{84, 1920000, 1980000, 000, 000, 20, 384000},
|
||||
{86, 1710000, 1785000, 000, 000, 20, 342000}
|
||||
};
|
||||
|
||||
void get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type) {
|
||||
|
||||
int ind;
|
||||
int64_t dl_freq_khz = downlink_frequency/1000;
|
||||
for ( ind=0;
|
||||
ind < sizeof(nr_bandtable) / sizeof(nr_bandtable[0]);
|
||||
ind++) {
|
||||
|
||||
*current_band = nr_bandtable[ind].band;
|
||||
LOG_I(PHY, "Scanning band %d, dl_min %"PRIu64", ul_min %"PRIu64"\n", ind, 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 ) {
|
||||
*current_offset = (nr_bandtable[ind].ul_min - nr_bandtable[ind].dl_min)*1000;
|
||||
if (*current_offset == 0)
|
||||
*current_type = TDD;
|
||||
else
|
||||
*current_type = FDD;
|
||||
|
||||
LOG_I( PHY, "DL frequency %"PRIu32": band %d, frame_type %d, UL frequency %"PRIu32"\n",
|
||||
downlink_frequency, *current_band, *current_type, downlink_frequency+*current_offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AssertFatal(ind != (sizeof(nr_bandtable) / sizeof(nr_bandtable[0])),
|
||||
"Can't find EUTRA band for frequency %d\n", downlink_frequency);
|
||||
|
||||
}
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint32_t bw)
|
||||
{
|
||||
|
||||
uint64_t dl_CarrierFreq_by_1k = dl_CarrierFreq / 1000;
|
||||
int bw_kHz = bw / 1000;
|
||||
|
||||
int i;
|
||||
|
||||
LOG_I(MAC,"Searching for nr band %d DL Carrier frequency %llu bw %u\n",nr_bandP,(long long unsigned int)dl_CarrierFreq,bw);
|
||||
AssertFatal(nr_bandP < 86, "nr_band %d > 86\n", nr_bandP);
|
||||
for (i = 0; i < 30 && nr_bandtable[i].band != nr_bandP; i++);
|
||||
|
||||
AssertFatal(dl_CarrierFreq_by_1k >= nr_bandtable[i].dl_min,
|
||||
"Band %d, bw %u : DL carrier frequency %llu kHz < %llu\n",
|
||||
nr_bandP, bw, (long long unsigned int)dl_CarrierFreq_by_1k,
|
||||
(long long unsigned int)nr_bandtable[i].dl_min);
|
||||
AssertFatal(dl_CarrierFreq_by_1k <=
|
||||
(nr_bandtable[i].dl_max - bw_kHz),
|
||||
"Band %d, dl_CarrierFreq %llu bw %u: DL carrier frequency %llu kHz > %llu\n",
|
||||
nr_bandP, (long long unsigned int)dl_CarrierFreq,bw, (long long unsigned int)dl_CarrierFreq_by_1k,
|
||||
(long long unsigned int)(nr_bandtable[i].dl_max - bw_kHz));
|
||||
|
||||
int deltaFglobal;
|
||||
|
||||
if (dl_CarrierFreq < 3e9) deltaFglobal = 5;
|
||||
else deltaFglobal = 15;
|
||||
|
||||
// This is equation before Table 5.4.2.1-1 in 38101-1-f30
|
||||
// F_REF=F_REF_Offs + deltaF_Global(N_REF-NREF_REF_Offs)
|
||||
return (((dl_CarrierFreq_by_1k - nr_bandtable[i].dl_min)/deltaFglobal) +
|
||||
nr_bandtable[i].N_OFFs_DL);
|
||||
}
|
||||
|
||||
|
||||
uint64_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn)
|
||||
{
|
||||
|
||||
int i;
|
||||
int deltaFglobal;
|
||||
|
||||
if (nr_bandP < 77 || nr_bandP > 79) deltaFglobal = 5;
|
||||
else deltaFglobal = 15;
|
||||
|
||||
AssertFatal(nr_bandP < 87, "nr_band %d > 86\n", nr_bandP);
|
||||
for (i = 0; i < 31 && nr_bandtable[i].band != nr_bandP; i++);
|
||||
AssertFatal(dl_nrarfcn>=nr_bandtable[i].N_OFFs_DL,"dl_nrarfcn %u < N_OFFs_DL %llu\n",dl_nrarfcn, (long long unsigned int)nr_bandtable[i].N_OFFs_DL);
|
||||
|
||||
return 1000*(nr_bandtable[i].dl_min + (dl_nrarfcn - nr_bandtable[i].N_OFFs_DL) * deltaFglobal);
|
||||
|
||||
}
|
||||
@@ -747,15 +747,21 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
|
||||
//ssb_PositionsInBurst
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->present = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id];
|
||||
|
||||
if((*servingcellconfigcommon)->ssb_PositionsInBurst->present == NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap){
|
||||
uint64_t t_freq;
|
||||
if(configuration->nr_band[CC_id] == 41 || (configuration->nr_band[CC_id] > 76 && configuration->nr_band[CC_id] < 80))
|
||||
t_freq = 2400000000;
|
||||
else
|
||||
t_freq = 3000000000;
|
||||
|
||||
if(configuration->downlink_frequency[CC_id]<t_freq){
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.size = 1;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.bits_unused = 4;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.buf[0] = 0x0f;
|
||||
}else if((*servingcellconfigcommon)->ssb_PositionsInBurst->present == NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap){
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.buf[0] = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id];
|
||||
}else if(configuration->downlink_frequency[CC_id]<6000000000){
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.size = 1;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.bits_unused = 0;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.buf[0] = 0xff;
|
||||
}else if((*servingcellconfigcommon)->ssb_PositionsInBurst->present == NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap){
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.buf[0] = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id];
|
||||
}else {
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.size = 8;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.bits_unused = 0;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[0] = 0xff;
|
||||
@@ -768,6 +774,7 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[7] = 0xff;
|
||||
}
|
||||
|
||||
|
||||
//ssb_periodicityServingCell
|
||||
*(*servingcellconfigcommon)->ssb_periodicityServingCell = configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id];
|
||||
//dmrs_TypeA_Position
|
||||
|
||||
@@ -236,7 +236,7 @@ static void init_NR_SI(const protocol_ctxt_t* const ctxt_pP,
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp_UL = configuration->UL_prefix_type[CC_id];
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq = configuration->downlink_frequency[CC_id];
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].ul_CarrierFreq = configuration->downlink_frequency[CC_id]+ configuration->uplink_frequency_offset[CC_id];
|
||||
|
||||
|
||||
///MIB
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB = 0;
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].MIB = (uint8_t*) malloc16(4);
|
||||
@@ -261,11 +261,13 @@ static void init_NR_SI(const protocol_ctxt_t* const ctxt_pP,
|
||||
|
||||
LOG_I(NR_RRC,"Done init_NR_SI\n");
|
||||
|
||||
|
||||
|
||||
rrc_mac_config_req_gNB(ctxt_pP->module_id,
|
||||
CC_id,
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB,
|
||||
configuration->nr_band[CC_id],
|
||||
configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id],
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq,
|
||||
configuration->N_RB_DL[CC_id],
|
||||
(NR_BCCH_BCH_Message_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib,
|
||||
|
||||
Reference in New Issue
Block a user