Merge remote-tracking branch 'origin/band_number_improv' into integration_2026_w09 (!3943)
Remove L1 dependence from NR band number L1 band information relied on get_band function that couldn't provide an unambiguous result. Also there is no SCF compliant parameter for L1 and generally we don't really need that information in L1. The MR also remove a RU section that used nr_band but was never really accessed in NR.
This commit is contained in:
+36
-99
@@ -152,6 +152,32 @@ int get_smallest_supported_bandwidth_index(int scs, frequency_range_t frequency_
|
||||
return -1; // not found
|
||||
}
|
||||
|
||||
// Table 5.4.3.3-1 38-101
|
||||
uint8_t set_ssb_case(int scs, int nr_band)
|
||||
{
|
||||
uint8_t ssb_case = 0;
|
||||
switch (scs) {
|
||||
case 0:
|
||||
ssb_case = 0; // case A
|
||||
break;
|
||||
case 1:
|
||||
if (nr_band == 5 || nr_band == 24 || nr_band == 66 || nr_band == 255)
|
||||
ssb_case = 1; // case B
|
||||
else
|
||||
ssb_case = 2; // case C
|
||||
break;
|
||||
case 3:
|
||||
ssb_case = 3; // case D
|
||||
break;
|
||||
case 4:
|
||||
ssb_case = 4; // case E
|
||||
break;
|
||||
default:
|
||||
AssertFatal(false, "Invalid sub-carrier spacing for SSB\n");
|
||||
}
|
||||
return ssb_case;
|
||||
}
|
||||
|
||||
// Table 5.2-1 NR operating bands in FR1 & FR2 (3GPP TS 38.101) (Rel.17)
|
||||
// Table 5.4.2.3-1 Applicable NR-ARFCN per operating band in FR1 & FR2 (3GPP TS 38.101)
|
||||
// Notes:
|
||||
@@ -393,77 +419,6 @@ bool compare_relative_ul_channel_bw(int nr_band, int scs, int channel_bandwidth,
|
||||
return rel_bw > limit;
|
||||
}
|
||||
|
||||
static bool check_delta_duplex(int index, uint64_t dlfreq_khz, uint64_t ulfreq_khz, int64_t dlbw, int64_t ulbw)
|
||||
{
|
||||
int uldl_min_offset = nr_bandtable[index].dl_min - nr_bandtable[index].ul_min;
|
||||
int txrx_offset = dlfreq_khz - ulfreq_khz;
|
||||
LOG_I(NR_PHY, "dlfreq:%ld ulfreq:%ld deltaduplex:%d khz, uldl_min_offset:%d khz\n",
|
||||
dlfreq_khz, ulfreq_khz, txrx_offset, uldl_min_offset);
|
||||
if (txrx_offset == uldl_min_offset)
|
||||
return true;
|
||||
|
||||
int band = nr_bandtable[index].band;
|
||||
|
||||
// Refer to section 5.4.4 in spec 38.101-5
|
||||
if (band == 256 && txrx_offset >= 165000 && txrx_offset <= 215000)
|
||||
return true;
|
||||
if (band == 255 && txrx_offset >= -130500 && txrx_offset <= -72500)
|
||||
return true;
|
||||
if (band == 254 && txrx_offset >= 862000 && txrx_offset <= 885000)
|
||||
return true;
|
||||
|
||||
// Refer to section 5.4.4 in spec 38.101-1 for these bands 24, 91-94, 109
|
||||
if (band == 24 && (txrx_offset == -101500 || txrx_offset == -120500))
|
||||
return true;
|
||||
//Delta duplex is also a range for these bands n91-n94, n109.
|
||||
if ((band >= 91 && band <= 94) || band == 109) {
|
||||
dlbw = ((dlbw / 1000) + 1) * 1000;
|
||||
ulbw = ((ulbw / 1000) + 1) * 1000;
|
||||
int lower_limit = nr_bandtable[index].dl_min - nr_bandtable[index].ul_max + ((dlbw + ulbw) >> 1);
|
||||
int upper_limit = nr_bandtable[index].dl_max - nr_bandtable[index].ul_min - ((dlbw + ulbw) >> 1);
|
||||
LOG_I(NR_PHY, "Band %d dlbw:%ld Khz, ulbw: %ld Khz RXTX lower limit:%d khz, upper limit:%d khz\n",
|
||||
band, dlbw, ulbw, lower_limit, upper_limit);
|
||||
|
||||
if (txrx_offset >= lower_limit && txrx_offset <= upper_limit)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex, int64_t dlbw, int64_t ulbw)
|
||||
{
|
||||
const int64_t dl_freq_khz = downlink_frequency / 1000;
|
||||
const int32_t delta_duplex_khz = delta_duplex / 1000;
|
||||
const int64_t ul_freq_khz = dl_freq_khz + delta_duplex_khz;
|
||||
|
||||
uint16_t current_band = 0;
|
||||
|
||||
for (int ind = 0; ind < sizeofArray(nr_bandtable); ind++) {
|
||||
|
||||
if (dl_freq_khz < nr_bandtable[ind].dl_min || dl_freq_khz > nr_bandtable[ind].dl_max)
|
||||
continue;
|
||||
|
||||
if (ul_freq_khz < nr_bandtable[ind].ul_min || ul_freq_khz > nr_bandtable[ind].ul_max)
|
||||
continue;
|
||||
|
||||
if (!check_delta_duplex(ind, dl_freq_khz, ul_freq_khz, dlbw, ulbw))
|
||||
continue;
|
||||
|
||||
current_band = nr_bandtable[ind].band;
|
||||
}
|
||||
|
||||
printf("DL frequency %"PRIu64": band %d, UL frequency %"PRIu64"\n",
|
||||
downlink_frequency, current_band, downlink_frequency+delta_duplex);
|
||||
|
||||
AssertFatal(current_band != 0,
|
||||
"Can't find EUTRA band for frequency %" PRIu64 " and duplex_spacing %d\n",
|
||||
downlink_frequency,
|
||||
delta_duplex);
|
||||
|
||||
return current_band;
|
||||
}
|
||||
|
||||
int NRRIV2BW(int locationAndBandwidth,int N_RB) {
|
||||
int tmp = locationAndBandwidth/N_RB;
|
||||
int tmp2 = locationAndBandwidth%N_RB;
|
||||
@@ -595,44 +550,26 @@ void get_delta_arfcn(int i, uint32_t nrarfcn, uint64_t N_OFFs)
|
||||
LOG_E(NR_MAC, "nrarfcn %u is not on the channel raster for step size %lu\n", nrarfcn, nr_bandtable[i].step_size);
|
||||
}
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw)
|
||||
uint32_t to_nrarfcn(uint64_t CarrierFreq)
|
||||
{
|
||||
uint64_t dl_CarrierFreq_by_1k = dl_CarrierFreq / 1000;
|
||||
int bw_kHz = bw / 1000;
|
||||
uint32_t nrarfcn;
|
||||
int i = get_nr_table_idx(nr_bandP, scs_index);
|
||||
|
||||
LOG_D(NR_MAC, "Searching for nr band %d DL Carrier frequency %llu bw %u\n", nr_bandP, (long long unsigned int)dl_CarrierFreq, bw);
|
||||
|
||||
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/2),
|
||||
"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/2));
|
||||
|
||||
uint64_t CarrierFreq_by_1k = CarrierFreq / 1000;
|
||||
// FR2
|
||||
int deltaFglobal = 60;
|
||||
uint32_t N_REF_Offs = 2016667;
|
||||
uint64_t F_REF_Offs_khz = 24250080;
|
||||
|
||||
if (dl_CarrierFreq < 24.25e9) {
|
||||
// FR1
|
||||
if (CarrierFreq < 3e9) {
|
||||
deltaFglobal = 5;
|
||||
N_REF_Offs = 0;
|
||||
F_REF_Offs_khz = 0;
|
||||
} else if (CarrierFreq < 24.25e9) {
|
||||
deltaFglobal = 15;
|
||||
N_REF_Offs = 600000;
|
||||
F_REF_Offs_khz = 3000000;
|
||||
}
|
||||
if (dl_CarrierFreq < 3e9) {
|
||||
deltaFglobal = 5;
|
||||
N_REF_Offs = 0;
|
||||
F_REF_Offs_khz = 0;
|
||||
}
|
||||
|
||||
// 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)
|
||||
nrarfcn = (((dl_CarrierFreq_by_1k - F_REF_Offs_khz) / deltaFglobal) + N_REF_Offs);
|
||||
//get_delta_arfcn(i, nrarfcn, nr_bandtable[i].N_OFFs_DL);
|
||||
|
||||
uint32_t nrarfcn = (((CarrierFreq_by_1k - F_REF_Offs_khz) / deltaFglobal) + N_REF_Offs);
|
||||
return nrarfcn;
|
||||
}
|
||||
|
||||
|
||||
@@ -276,8 +276,8 @@ static __attribute__((always_inline)) inline int count_bits64_with_mask(uint64_t
|
||||
void warn_higher_threequarter_fs(const int n_rb, const int mu);
|
||||
|
||||
uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
|
||||
|
||||
uint32_t to_nrarfcn(uint64_t dl_CarrierFreq);
|
||||
uint8_t set_ssb_case(int scs, int nr_band);
|
||||
int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, const int N_regs);
|
||||
int get_SLIV(uint8_t S, uint8_t L);
|
||||
void get_coreset_rballoc(const uint8_t *FreqDomainResource, int *n_rb, int *rb_offset);
|
||||
@@ -285,7 +285,6 @@ int get_coreset_num_cces(const uint8_t *FreqDomainResource, int duration);
|
||||
int get_nr_table_idx(int nr_bandP, uint8_t scs_index);
|
||||
int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index);
|
||||
frame_type_t get_frame_type(uint16_t nr_bandP, uint8_t scs_index);
|
||||
uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex, int64_t dlbw, int64_t ulbw);
|
||||
int NRRIV2BW(int locationAndBandwidth,int N_RB);
|
||||
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
|
||||
int PRBalloc_to_locationandbandwidth0(int NPRB,int RBstart,int BWPsize);
|
||||
|
||||
+2
-301
@@ -69,176 +69,6 @@ static int DEFRUTPCORES[] = {-1,-1,-1,-1};
|
||||
|
||||
static void NRRCconfig_RU(configmodule_interface_t *cfg);
|
||||
|
||||
/*************************************************************/
|
||||
/* Functions to attach and configure RRU */
|
||||
|
||||
int attach_rru(RU_t *ru)
|
||||
{
|
||||
RRU_CONFIG_msg_t rru_config_msg;
|
||||
int received_capabilities=0;
|
||||
wait_gNBs();
|
||||
|
||||
// Wait for capabilities
|
||||
while (received_capabilities==0) {
|
||||
rru_config_msg = (RRU_CONFIG_msg_t){.type = RAU_tick, .len = sizeof(rru_config_msg.msg)};
|
||||
LOG_D(PHY, "Sending RAU tick to RRU %d\n", ru->idx);
|
||||
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),
|
||||
"RU %d cannot access remote radio\n",ru->idx);
|
||||
ssize_t msg_len = rru_config_msg.len + sizeof(RRU_capabilities_t);
|
||||
// wait for answer with timeout
|
||||
ssize_t len = ru->ifdevice.trx_ctlrecv_func(&ru->ifdevice, &rru_config_msg, msg_len);
|
||||
if (len < 0) {
|
||||
LOG_D(PHY, "Waiting for RRU %d\n", ru->idx);
|
||||
} else if (rru_config_msg.type == RRU_capabilities) {
|
||||
AssertFatal(rru_config_msg.len == msg_len,
|
||||
"Received capabilities with incorrect length (%ld!=%ld)\n",
|
||||
rru_config_msg.len,
|
||||
msg_len);
|
||||
RRU_capabilities_t *cap = (RRU_capabilities_t *)rru_config_msg.msg;
|
||||
LOG_I(PHY,
|
||||
"Received capabilities from RRU %d (len %ld/%ld, num_bands %d,max_pdschReferenceSignalPower %d, max_rxgain %d, nb_tx "
|
||||
"%d, nb_rx %d)\n",
|
||||
ru->idx,
|
||||
rru_config_msg.len,
|
||||
msg_len,
|
||||
cap->num_bands,
|
||||
cap->max_pdschReferenceSignalPower[0],
|
||||
cap->max_rxgain[0],
|
||||
cap->nb_tx[0],
|
||||
cap->nb_rx[0]);
|
||||
received_capabilities=1;
|
||||
} else {
|
||||
LOG_E(PHY,"Received incorrect message %d from RRU %d\n",rru_config_msg.type,ru->idx);
|
||||
}
|
||||
}
|
||||
|
||||
configure_ru(ru, (RRU_capabilities_t *)rru_config_msg.msg);
|
||||
rru_config_msg.type = RRU_config;
|
||||
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
|
||||
RRU_config_t *conf = (RRU_config_t *)rru_config_msg.msg;
|
||||
LOG_I(PHY,
|
||||
"Sending Configuration to RRU %d (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL "
|
||||
"%d,3/4FS %d, prach_FO %d, prach_CI %d)\n",
|
||||
ru->idx,
|
||||
conf->num_bands,
|
||||
conf->band_list[0],
|
||||
conf->tx_freq[0],
|
||||
conf->rx_freq[0],
|
||||
conf->att_tx[0],
|
||||
conf->att_rx[0],
|
||||
conf->N_RB_DL[0],
|
||||
conf->N_RB_UL[0],
|
||||
conf->threequarter_fs[0],
|
||||
conf->prach_FreqOffset[0],
|
||||
conf->prach_ConfigIndex[0]);
|
||||
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),
|
||||
"RU %d failed send configuration to remote radio\n",ru->idx);
|
||||
int len = ru->ifdevice.trx_ctlrecv_func(&ru->ifdevice, &rru_config_msg, sizeof(rru_config_msg.msg));
|
||||
if (len < 0) {
|
||||
LOG_I(PHY,"Waiting for RRU %d\n",ru->idx);
|
||||
} else if (rru_config_msg.type == RRU_config_ok) {
|
||||
LOG_I(PHY, "RRU_config_ok received\n");
|
||||
} else {
|
||||
LOG_E(PHY,"Received incorrect message %d from RRU %d\n",rru_config_msg.type,ru->idx);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int connect_rau(RU_t *ru) {
|
||||
RRU_CONFIG_msg_t rru_config_msg;
|
||||
|
||||
// wait for RAU_tick
|
||||
int tick_received = 0;
|
||||
while (tick_received == 0) {
|
||||
ssize_t msg_len = sizeof(rru_config_msg.msg);
|
||||
int len = ru->ifdevice.trx_ctlrecv_func(&ru->ifdevice, &rru_config_msg, msg_len);
|
||||
if (len < 0) {
|
||||
LOG_I(PHY,"Waiting for RAU\n");
|
||||
} else {
|
||||
if (rru_config_msg.type == RAU_tick) {
|
||||
LOG_I(PHY,"Tick received from RAU\n");
|
||||
tick_received = 1;
|
||||
} else
|
||||
LOG_E(PHY, "Received erroneous message (%d)from RAU, expected RAU_tick\n", rru_config_msg.type);
|
||||
}
|
||||
}
|
||||
|
||||
// send capabilities
|
||||
rru_config_msg.type = RRU_capabilities;
|
||||
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_capabilities_t);
|
||||
RRU_capabilities_t *cap = (RRU_capabilities_t *)rru_config_msg.msg;
|
||||
LOG_I(PHY,
|
||||
"Sending Capabilities (len %ld, num_bands %d,max_pdschReferenceSignalPower %d, max_rxgain %d, nb_tx %d, nb_rx %d)\n",
|
||||
rru_config_msg.len,
|
||||
ru->num_bands,
|
||||
ru->max_pdschReferenceSignalPower,
|
||||
ru->max_rxgain,
|
||||
ru->nb_tx,
|
||||
ru->nb_rx);
|
||||
|
||||
switch (ru->function) {
|
||||
case NGFI_RRU_IF4p5:
|
||||
cap->FH_fmt = OAI_IF4p5_only;
|
||||
break;
|
||||
|
||||
case NGFI_RRU_IF5:
|
||||
cap->FH_fmt = OAI_IF5_only;
|
||||
break;
|
||||
|
||||
case MBP_RRU_IF5:
|
||||
cap->FH_fmt = MBP_IF5;
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(false, "RU_function is unknown %d\n", RC.ru[0]->function);
|
||||
break;
|
||||
}
|
||||
|
||||
cap->num_bands = ru->num_bands;
|
||||
for (int i = 0; i < ru->num_bands; i++) {
|
||||
LOG_I(PHY,"Band %d: nb_rx %d nb_tx %d pdschReferenceSignalPower %d rxgain %d\n",
|
||||
ru->band[i],ru->nb_rx,ru->nb_tx,ru->max_pdschReferenceSignalPower,ru->max_rxgain);
|
||||
cap->band_list[i] = ru->band[i];
|
||||
cap->nb_rx[i] = ru->nb_rx;
|
||||
cap->nb_tx[i] = ru->nb_tx;
|
||||
cap->max_pdschReferenceSignalPower[i] = ru->max_pdschReferenceSignalPower;
|
||||
cap->max_rxgain[i] = ru->max_rxgain;
|
||||
}
|
||||
|
||||
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),
|
||||
"RU %d failed send capabilities to RAU\n",ru->idx);
|
||||
// wait for configuration
|
||||
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
|
||||
|
||||
int configuration_received = 0;
|
||||
while (configuration_received == 0) {
|
||||
int len = ru->ifdevice.trx_ctlrecv_func(&ru->ifdevice, &rru_config_msg, rru_config_msg.len);
|
||||
if (len < 0) {
|
||||
LOG_I(PHY,"Waiting for configuration from RAU\n");
|
||||
} else {
|
||||
RRU_config_t *conf = (RRU_config_t *)rru_config_msg.msg;
|
||||
LOG_I(PHY,
|
||||
"Configuration received from RAU (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL "
|
||||
"%d,3/4FS %d, prach_FO %d, prach_CI %d)\n",
|
||||
conf->num_bands,
|
||||
conf->band_list[0],
|
||||
conf->tx_freq[0],
|
||||
conf->rx_freq[0],
|
||||
conf->att_tx[0],
|
||||
conf->att_rx[0],
|
||||
conf->N_RB_DL[0],
|
||||
conf->N_RB_UL[0],
|
||||
conf->threequarter_fs[0],
|
||||
conf->prach_FreqOffset[0],
|
||||
conf->prach_ConfigIndex[0]);
|
||||
configure_rru(ru, (void *)rru_config_msg.msg);
|
||||
configuration_received = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************/
|
||||
/* Southbound Fronthaul functions, RCC/RAU */
|
||||
|
||||
@@ -1034,15 +864,6 @@ void *ru_thread(void *param)
|
||||
LOG_I(PHY, "Starting IF interface for RU %d, nb_rx %d\n", ru->idx, ru->nb_rx);
|
||||
AssertFatal(ru->nr_start_if(ru, NULL) == 0, "Could not start the IF device\n");
|
||||
|
||||
if (ru->has_ctrl_prt > 0) {
|
||||
if (ru->if_south == LOCAL_RF)
|
||||
ret = connect_rau(ru);
|
||||
else
|
||||
ret = attach_rru(ru);
|
||||
|
||||
AssertFatal(ret == 0, "Cannot connect to remote radio\n");
|
||||
}
|
||||
|
||||
} else if (ru->if_south == LOCAL_RF) { // configure RF parameters only
|
||||
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
|
||||
AssertFatal(ret==0,"Cannot connect to local radio\n");
|
||||
@@ -1257,123 +1078,6 @@ void kill_NR_RU_proc(int inst) {
|
||||
LOG_I(PHY, "RU %d RF device stopped\n",ru->idx);
|
||||
}
|
||||
|
||||
int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) {
|
||||
FH_fmt_options_t fmt = cap->FH_fmt;
|
||||
int i;
|
||||
LOG_I(PHY,"RRU %d, num_bands %d, looking for band %d\n",ru->idx,cap->num_bands,ru->nr_frame_parms->nr_band);
|
||||
|
||||
for (i=0; i<cap->num_bands; i++) {
|
||||
LOG_I(PHY,"band %d on RRU %d\n",cap->band_list[i],ru->idx);
|
||||
if (ru->nr_frame_parms->nr_band == cap->band_list[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == cap->num_bands) {
|
||||
LOG_I(PHY,"Couldn't find target NR band %d on RRU %d\n",ru->nr_frame_parms->nr_band,ru->idx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
switch (ru->if_south) {
|
||||
case LOCAL_RF:
|
||||
AssertFatal(1==0, "This RU should not have a local RF, exiting\n");
|
||||
return(0);
|
||||
break;
|
||||
|
||||
case REMOTE_IF5:
|
||||
if (fmt == OAI_IF5_only || fmt == OAI_IF5_and_IF4p5)
|
||||
return (0);
|
||||
break;
|
||||
|
||||
case REMOTE_IF4p5:
|
||||
if (fmt == OAI_IF4p5_only || fmt == OAI_IF5_and_IF4p5)
|
||||
return (0);
|
||||
break;
|
||||
|
||||
case REMOTE_MBP_IF5:
|
||||
if (fmt == MBP_IF5)
|
||||
return (0);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_I(PHY,"No compatible Fronthaul interface found for RRU %d\n", ru->idx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
||||
|
||||
const char rru_format_options[4][20] = {"OAI_IF5_only", "OAI_IF4p5_only", "OAI_IF5_and_IF4p5", "MBP_IF5"};
|
||||
const char rru_formats[3][20] = {"OAI_IF5", "MBP_IF5", "OAI_IF4p5"};
|
||||
const char ru_if_formats[4][20] = {"LOCAL_RF", "REMOTE_OAI_IF5", "REMOTE_MBP_IF5", "REMOTE_OAI_IF4p5"};
|
||||
|
||||
void configure_ru(void *ruu, void *arg)
|
||||
{
|
||||
RU_t *ru = (RU_t *)ruu;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
int ret;
|
||||
LOG_I(PHY, "Received capabilities from RRU %d\n", ru->idx);
|
||||
|
||||
RRU_capabilities_t *capabilities = (RRU_capabilities_t *)arg;
|
||||
if (capabilities->FH_fmt < MAX_FH_FMTs)
|
||||
LOG_I(PHY, "RU FH options %s\n", rru_format_options[capabilities->FH_fmt]);
|
||||
|
||||
ret = check_capabilities(ru,capabilities);
|
||||
AssertFatal(ret == 0, "Cannot configure RRU %d, check_capabilities returned %d\n", ru->idx, ret);
|
||||
// take antenna capabilities of RRU
|
||||
ru->nb_tx = capabilities->nb_tx[0];
|
||||
ru->nb_rx = capabilities->nb_rx[0];
|
||||
// Pass configuration to RRU
|
||||
LOG_I(PHY, "Using %s fronthaul (%d), band %d \n",ru_if_formats[ru->if_south],ru->if_south,ru->nr_frame_parms->nr_band);
|
||||
|
||||
// wait for configuration
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
*config = (RRU_config_t){.FH_fmt = ru->if_south,
|
||||
.num_bands = 1,
|
||||
.band_list[0] = ru->nr_frame_parms->nr_band,
|
||||
.tx_freq[0] = ru->nr_frame_parms->dl_CarrierFreq,
|
||||
.rx_freq[0] = ru->nr_frame_parms->ul_CarrierFreq,
|
||||
.att_tx[0] = ru->att_tx,
|
||||
.att_rx[0] = ru->att_rx,
|
||||
.N_RB_DL[0] = cfg->carrier_config.dl_grid_size[cfg->ssb_config.scs_common.value].value,
|
||||
.N_RB_UL[0] = cfg->carrier_config.dl_grid_size[cfg->ssb_config.scs_common.value].value,
|
||||
.threequarter_fs[0] = ru->nr_frame_parms->threequarter_fs};
|
||||
nr_init_frame_parms(&ru->config, ru->nr_frame_parms);
|
||||
nr_phy_init_RU(ru);
|
||||
}
|
||||
|
||||
void configure_rru(void *ruu, void *arg)
|
||||
{
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RU_t *ru = (RU_t *)ruu;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
|
||||
fp->nr_band = config->band_list[0];
|
||||
fp->dl_CarrierFreq = config->tx_freq[0];
|
||||
fp->ul_CarrierFreq = config->rx_freq[0];
|
||||
|
||||
if (fp->dl_CarrierFreq == fp->ul_CarrierFreq) {
|
||||
cfg->cell_config.frame_duplex_type.value = TDD;
|
||||
} else
|
||||
cfg->cell_config.frame_duplex_type.value = FDD;
|
||||
|
||||
ru->att_tx = config->att_tx[0];
|
||||
ru->att_rx = config->att_rx[0];
|
||||
int mu = cfg->ssb_config.scs_common.value;
|
||||
cfg->carrier_config.dl_grid_size[mu].value = config->N_RB_DL[0];
|
||||
cfg->carrier_config.dl_grid_size[mu].value = config->N_RB_UL[0];
|
||||
fp->threequarter_fs = config->threequarter_fs[0];
|
||||
|
||||
if (ru->function==NGFI_RRU_IF4p5) {
|
||||
fp->att_rx = ru->att_rx;
|
||||
fp->att_tx = ru->att_tx;
|
||||
}
|
||||
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
nr_init_frame_parms(&ru->config, fp);
|
||||
nr_phy_init_RU(ru);
|
||||
}
|
||||
|
||||
void set_function_spec_param(RU_t *ru)
|
||||
{
|
||||
switch (ru->if_south) {
|
||||
@@ -1444,7 +1148,6 @@ void set_function_spec_param(RU_t *ru)
|
||||
ru->nr_start_if = nr_start_if; // need to start if interface for IF5
|
||||
ru->ifdevice.host_type = RAU_HOST;
|
||||
ru->ifdevice.eth_params = &ru->eth_params;
|
||||
ru->ifdevice.configure_rru = configure_ru;
|
||||
|
||||
break;
|
||||
|
||||
@@ -1464,7 +1167,6 @@ void set_function_spec_param(RU_t *ru)
|
||||
ru->nr_start_if = nr_start_if; // need to start if interface for IF4p5
|
||||
ru->ifdevice.host_type = RAU_HOST;
|
||||
ru->ifdevice.eth_params = &ru->eth_params;
|
||||
ru->ifdevice.configure_rru = configure_ru;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1753,13 +1455,12 @@ static void NRRCconfig_RU(configmodule_interface_t *cfg)
|
||||
for (int i = 0; i < ru->num_bands; i++)
|
||||
ru->band[i] = param[RU_BAND_LIST_IDX].iptr[i];
|
||||
ru->openair0_cfg.nr_flag = *param[RU_NR_FLAG].iptr;
|
||||
ru->openair0_cfg.nr_band = ru->band[0];
|
||||
// TODO remove band from RU?
|
||||
ru->openair0_cfg.nr_scs_for_raster = *param[RU_NR_SCS_FOR_RASTER].iptr;
|
||||
LOG_D(PHY,
|
||||
"[RU %d] Setting nr_flag %d, nr_band %d, nr_scs_for_raster %d\n",
|
||||
"[RU %d] Setting nr_flag %d, nr_scs_for_raster %d\n",
|
||||
j,
|
||||
ru->openair0_cfg.nr_flag,
|
||||
ru->openair0_cfg.nr_band,
|
||||
ru->openair0_cfg.nr_scs_for_raster);
|
||||
ru->openair0_cfg.rxfh_cores[0] = *param[RU_RXFH_CORE_ID].iptr;
|
||||
ru->openair0_cfg.txfh_cores[0] = *param[RU_TXFH_CORE_ID].iptr;
|
||||
|
||||
@@ -110,6 +110,12 @@ int nrue_get_cell_count(void)
|
||||
return nrue_cell_count;
|
||||
}
|
||||
|
||||
int nrue_get_band(const PHY_VARS_NR_UE *UE)
|
||||
{
|
||||
int cell_id = nrue_rus[UE->rf_map.card].used_by_cell;
|
||||
return nrue_cells[cell_id].band;
|
||||
}
|
||||
|
||||
const nrUE_cell_params_t *nrue_get_cell(int cell_id)
|
||||
{
|
||||
AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
|
||||
|
||||
@@ -30,7 +30,7 @@ const nrUE_cell_params_t *nrue_get_cell(int cell_id);
|
||||
NR_DL_FRAME_PARMS *nrue_get_cell_fp(int cell_id);
|
||||
void nrue_set_cell(int cell_id, const nrUE_cell_params_t *cell);
|
||||
void nrue_set_cell_params(configmodule_interface_t *cfg);
|
||||
|
||||
int nrue_get_band(const PHY_VARS_NR_UE *UE);
|
||||
int nrue_get_ru_count(void);
|
||||
const nrUE_RU_params_t *nrue_get_ru(int ru_id);
|
||||
void nrue_set_ru_cell_id(int ru_id, int cell_id);
|
||||
|
||||
+1
-1
@@ -841,7 +841,7 @@ void *UE_thread(void *arg)
|
||||
// Get list of GSCN in this band for UE's bandwidth and center frequency.
|
||||
LOG_W(PHY, "UE set to scan all GSCN in current bandwidth\n");
|
||||
syncMsg->numGscn =
|
||||
get_scan_ssb_first_sc(fp->dl_CarrierFreq, fp->N_RB_DL, fp->nr_band, fp->numerology_index, syncMsg->gscnInfo);
|
||||
get_scan_ssb_first_sc(fp->dl_CarrierFreq, fp->N_RB_DL, nrue_get_band(UE), fp->numerology_index, syncMsg->gscnInfo);
|
||||
} else {
|
||||
LOG_W(PHY, "SSB position provided\n");
|
||||
syncMsg->gscnInfo[0] = (nr_gscn_info_t){.ssbFirstSC = fp->ssb_start_subcarrier};
|
||||
|
||||
@@ -385,7 +385,7 @@ int main(int argc, char **argv)
|
||||
fapi_nr_config_request_t *nrUE_config = &UE_CC->nrUE_config;
|
||||
nr_init_frame_parms_ue(fp, nrUE_config, mac->nr_band);
|
||||
|
||||
cell.band = fp->nr_band;
|
||||
cell.band = mac->nr_band;
|
||||
cell.rf_frequency = fp->dl_CarrierFreq;
|
||||
cell.rf_freq_offset = fp->ul_CarrierFreq - fp->dl_CarrierFreq;
|
||||
cell.numerology = fp->numerology_index;
|
||||
|
||||
@@ -1233,6 +1233,14 @@ uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e
|
||||
// only increase if it was set
|
||||
numTLVs += pNfapiMsg->analog_beamforming_ve.analog_bf_vendor_ext.tl.tag == NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_FAPI_SSB_CASE_VENDOR_EXTENSION_TAG,
|
||||
&(pNfapiMsg->ssb_table.case_v3),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
|
||||
numTLVs += pNfapiMsg->ssb_table.case_v3.tl.tag == NFAPI_NR_FAPI_SSB_CASE_VENDOR_EXTENSION_TAG;
|
||||
|
||||
pNfapiMsg->num_tlv = numTLVs;
|
||||
retval &= push8(pNfapiMsg->num_tlv, &pNumTLVFields, end);
|
||||
return retval;
|
||||
@@ -1395,10 +1403,13 @@ uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
|
||||
#endif
|
||||
{NFAPI_NR_FAPI_NUM_BEAMS_PERIOD_VENDOR_EXTENSION_TAG,
|
||||
&(pNfapiMsg->analog_beamforming_ve.num_beams_period_vendor_ext),
|
||||
&unpack_uint8_tlv_value},
|
||||
{NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG,
|
||||
&(pNfapiMsg->analog_beamforming_ve.analog_bf_vendor_ext),
|
||||
&unpack_uint8_tlv_value},
|
||||
&unpack_uint8_tlv_value},
|
||||
{NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG,
|
||||
&(pNfapiMsg->analog_beamforming_ve.analog_bf_vendor_ext),
|
||||
&unpack_uint8_tlv_value},
|
||||
{NFAPI_NR_FAPI_SSB_CASE_VENDOR_EXTENSION_TAG,
|
||||
&(pNfapiMsg->ssb_table.case_v3),
|
||||
&unpack_uint8_tlv_value},
|
||||
{NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG, &(pNfapiMsg->measurement_config.rssi_measurement), &unpack_uint8_tlv_value},
|
||||
{NFAPI_NR_CONFIG_BEAMFORMING_TABLE_TAG, NULL, &unpack_dbt_table_tlv_value},
|
||||
{NFAPI_NR_CONFIG_PRECODING_TABLE_V6_TAG, NULL, &unpack_pm_table_tlv_value},
|
||||
|
||||
@@ -242,6 +242,8 @@ bool eq_config_request(const nfapi_nr_config_request_scf_t *unpacked_req, const
|
||||
EQ_TLV(unpacked_req->ssb_table.ssb_beam_id_list[i].beam_id, req->ssb_table.ssb_beam_id_list[i].beam_id);
|
||||
}
|
||||
|
||||
EQ_TLV(unpacked_req->ssb_table.case_v3, req->ssb_table.case_v3);
|
||||
|
||||
if (req->cell_config.frame_duplex_type.value == 1 /* TDD */) {
|
||||
EQ_TLV(unpacked_req->tdd_table.tdd_period, req->tdd_table.tdd_period);
|
||||
|
||||
@@ -790,6 +792,8 @@ void copy_config_request(const nfapi_nr_config_request_scf_t *src, nfapi_nr_conf
|
||||
COPY_TLV(dst->ssb_table.ssb_beam_id_list[i].beam_id, src->ssb_table.ssb_beam_id_list[i].beam_id);
|
||||
}
|
||||
|
||||
COPY_TLV(dst->ssb_table.case_v3, src->ssb_table.case_v3);
|
||||
|
||||
if (src->cell_config.frame_duplex_type.value == 1 /* TDD */) {
|
||||
COPY_TLV(dst->tdd_table.tdd_period, src->tdd_table.tdd_period);
|
||||
|
||||
@@ -1229,6 +1233,10 @@ void dump_config_request(const nfapi_nr_config_request_scf_t *msg)
|
||||
depth--;
|
||||
INDENTED_TLV_PRINT("ssPBCH Multiple Carriers in a Band", ssb_table->ss_pbch_multiple_carriers_in_a_band);
|
||||
INDENTED_TLV_PRINT("Multiple Cells ssPBCH in a Carrier", ssb_table->multiple_cells_ss_pbch_in_a_carrier);
|
||||
// Only print if it's filled
|
||||
if (ssb_table->case_v3.tl.tag == NFAPI_NR_FAPI_SSB_CASE_VENDOR_EXTENSION_TAG) {
|
||||
INDENTED_TLV_PRINT("SSB Case V3", ssb_table->case_v3);
|
||||
}
|
||||
/* TDD Table */
|
||||
const nfapi_nr_tdd_table_t *tdd_table = &msg->tdd_table;
|
||||
if (cell_config->frame_duplex_type.value == 1 /* TDD */) {
|
||||
|
||||
@@ -675,15 +675,15 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
uint16_t ssb_offset_point_a;//Offset of lowest subcarrier of lowest resource block used for SS/PBCH block. Given in PRB [38.211, section 4.4.4.2] Value: 0->2199
|
||||
uint8_t beta_pss;//PSS EPRE to SSS EPRE in a SS/PBCH block [38.213, sec 4.1] Values: 0 = 0dB
|
||||
uint8_t ssb_period;//SSB periodicity in msec Value: 0: ms5 1: ms10 2: ms20 3: ms40 4: ms80 5: ms160
|
||||
uint8_t ssb_subcarrier_offset;//ssbSubcarrierOffset or 𝑘𝑆𝑆𝐵 (38.211, section 7.4.3.1) Value: 0->31
|
||||
uint8_t beta_pss;//PSS EPRE to SSS EPRE in a SS/PBCH block [38.213, sec 4.1] Values: 0 = 0dB
|
||||
uint8_t ssb_period;//SSB periodicity in msec Value: 0: ms5 1: ms10 2: ms20 3: ms40 4: ms80 5: ms160
|
||||
uint8_t ssb_subcarrier_offset;//ssbSubcarrierOffset or 𝑘𝑆𝑆𝐵 (38.211, section 7.4.3.1) Value: 0->31
|
||||
uint32_t MIB;//MIB payload, where the 24 MSB are used and represent the MIB in [38.331 MIB IE] and represent 0 1 2 3 1 , , , ,..., A− a a a a a [38.212, sec 7.1.1]
|
||||
fapi_nr_ssb_mask_size_2_t ssb_mask_list[2];
|
||||
fapi_nr_ssb_mask_size_64_t* ssb_beam_id_list;//64
|
||||
uint8_t ss_pbch_multiple_carriers_in_a_band;//0 = disabled 1 = enabled
|
||||
uint8_t multiple_cells_ss_pbch_in_a_carrier;//Indicates that multiple cells will be supported in a single carrier 0 = disabled 1 = enabled
|
||||
|
||||
uint8_t ss_pbch_multiple_carriers_in_a_band;//0 = disabled 1 = enabled
|
||||
uint8_t multiple_cells_ss_pbch_in_a_carrier;//Indicates that multiple cells will be supported in a single carrier 0 = disabled 1 = enabled
|
||||
uint8_t ssb_case; // 0: case A 1: case B 2: case C 3: case D 4: case E
|
||||
} fapi_nr_ssb_table_t;
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG 0x0120
|
||||
#define NFAPI_NR_FAPI_NUM_BEAMS_PERIOD_VENDOR_EXTENSION_TAG 0xA000
|
||||
#define NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG 0xA001
|
||||
#define NFAPI_NR_FAPI_SSB_CASE_VENDOR_EXTENSION_TAG 0xA002
|
||||
|
||||
typedef struct {
|
||||
uint16_t phy_id;
|
||||
|
||||
@@ -413,15 +413,15 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
nfapi_uint16_tlv_t ssb_offset_point_a;//Offset of lowest subcarrier of lowest resource block used for SS/PBCH block. Given in PRB [38.211, section 4.4.4.2] Value: 0->2199
|
||||
nfapi_uint8_tlv_t beta_pss;//PSS EPRE to SSS EPRE in a SS/PBCH block [38.213, sec 4.1] Values: 0 = 0dB
|
||||
nfapi_uint8_tlv_t ssb_period;//SSB periodicity in msec Value: 0: ms5 1: ms10 2: ms20 3: ms40 4: ms80 5: ms160
|
||||
nfapi_uint8_tlv_t ssb_subcarrier_offset;//ssbSubcarrierOffset or 𝑘𝑆𝑆𝐵 (38.211, section 7.4.3.1) Value: 0->31
|
||||
nfapi_uint8_tlv_t beta_pss;//PSS EPRE to SSS EPRE in a SS/PBCH block [38.213, sec 4.1] Values: 0 = 0dB
|
||||
nfapi_uint8_tlv_t ssb_period;//SSB periodicity in msec Value: 0: ms5 1: ms10 2: ms20 3: ms40 4: ms80 5: ms160
|
||||
nfapi_uint8_tlv_t ssb_subcarrier_offset;//ssbSubcarrierOffset or 𝑘𝑆𝑆𝐵 (38.211, section 7.4.3.1) Value: 0->31
|
||||
nfapi_uint32_tlv_t MIB;//MIB payload, where the 24 MSB are used and represent the MIB in [38.331 MIB IE] and represent 0 1 2 3 1 , , , ,..., A− a a a a a [38.212, sec 7.1.1]
|
||||
nfapi_nr_ssb_mask_list_t ssb_mask_list[2];
|
||||
nfapi_nr_ssb_beam_id_list_t ssb_beam_id_list[64];
|
||||
nfapi_uint8_tlv_t ss_pbch_multiple_carriers_in_a_band;//0 = disabled 1 = enabled
|
||||
nfapi_uint8_tlv_t multiple_cells_ss_pbch_in_a_carrier;//Indicates that multiple cells will be supported in a single carrier 0 = disabled 1 = enabled
|
||||
|
||||
nfapi_uint8_tlv_t ss_pbch_multiple_carriers_in_a_band;//0 = disabled 1 = enabled
|
||||
nfapi_uint8_tlv_t multiple_cells_ss_pbch_in_a_carrier;//Indicates that multiple cells will be supported in a single carrier 0 = disabled 1 = enabled
|
||||
nfapi_uint8_tlv_t case_v3;
|
||||
} nfapi_nr_ssb_table_t;
|
||||
|
||||
//table 3-26
|
||||
|
||||
@@ -365,7 +365,7 @@ typedef struct
|
||||
//Indicates presence of +/-5Khz shift wrt FREF for V2X reference frequencies.
|
||||
//Possible values: {-1,0,1}
|
||||
int8_t sl_value_N;
|
||||
|
||||
uint32_t band;
|
||||
} sl_nr_carrier_config_t;
|
||||
|
||||
|
||||
|
||||
@@ -179,6 +179,9 @@ static void fill_config_request_tlv_tdd_rand(nfapi_nr_config_request_scf_t *nfap
|
||||
nfapi_resp->num_tlv++;
|
||||
}
|
||||
|
||||
FILL_TLV(nfapi_resp->ssb_table.case_v3, NFAPI_NR_FAPI_SSB_CASE_VENDOR_EXTENSION_TAG, rand8());
|
||||
nfapi_resp->num_tlv++;
|
||||
|
||||
FILL_TLV(nfapi_resp->tdd_table.tdd_period, NFAPI_NR_CONFIG_TDD_PERIOD_TAG, 6 /* ms5 */);
|
||||
nfapi_resp->num_tlv++;
|
||||
|
||||
|
||||
@@ -313,31 +313,32 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
|
||||
gNB_config->carrier_config.num_tx_ant.value = fp->nb_antennas_tx;
|
||||
gNB_config->carrier_config.num_rx_ant.value = fp->nb_antennas_rx;
|
||||
|
||||
int nr_band = 78;
|
||||
switch (mu) {
|
||||
case 0:
|
||||
gNB->gNB_config.tdd_table.tdd_period.value = 7;
|
||||
fp->dl_CarrierFreq = 2600000000;
|
||||
fp->ul_CarrierFreq = 2600000000;
|
||||
fp->nr_band = 38;
|
||||
nr_band = 38;
|
||||
break;
|
||||
case 1:
|
||||
gNB->gNB_config.tdd_table.tdd_period.value = 6;
|
||||
fp->dl_CarrierFreq = 3600000000;
|
||||
fp->ul_CarrierFreq = 3600000000;
|
||||
fp->nr_band = 78;
|
||||
nr_band = 78;
|
||||
break;
|
||||
case 3:
|
||||
gNB->gNB_config.tdd_table.tdd_period.value = 3;
|
||||
fp->dl_CarrierFreq = 27524520000;
|
||||
fp->ul_CarrierFreq = 27524520000;
|
||||
fp->nr_band = 261;
|
||||
nr_band = 261;
|
||||
break;
|
||||
default:
|
||||
printf("unsupported numerology %d\n", mu);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
frequency_range_t frequency_range = get_freq_range_from_band(fp->nr_band);
|
||||
frequency_range_t frequency_range = get_freq_range_from_band(nr_band);
|
||||
int bw_index = get_supported_band_index(mu, frequency_range, N_RB_DL);
|
||||
gNB_config->carrier_config.dl_bandwidth.value = get_supported_bw_mhz(frequency_range, bw_index);
|
||||
|
||||
@@ -366,9 +367,8 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
|
||||
fp->ul_CarrierFreq = ((ul_bw_khz>>1) + gNB_config->carrier_config.uplink_frequency.value)*1000 ;
|
||||
|
||||
int32_t dlul_offset = fp->ul_CarrierFreq - fp->dl_CarrierFreq;
|
||||
fp->nr_band = get_band(fp->dl_CarrierFreq, dlul_offset, dl_bw_khz, ul_bw_khz);
|
||||
|
||||
LOG_I(PHY, "DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %d Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, dlul_offset);
|
||||
LOG_I(PHY, "DL frequency %lu Hz, UL frequency %lu Hz: uldl offset %d Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, dlul_offset);
|
||||
|
||||
fp->threequarter_fs = get_softmodem_params()->threequarter_fs;
|
||||
LOG_D(PHY,"Configuring MIB for instance %d, : (Nid_cell %d,DL freq %llu, UL freq %llu)\n",
|
||||
|
||||
+22
-109
@@ -29,73 +29,6 @@
|
||||
static const uint32_t nr_subcarrier_spacing[MAX_NUM_SUBCARRIER_SPACING] = {15e3, 30e3, 60e3, 120e3, 240e3};
|
||||
static const uint16_t nr_slots_per_subframe[MAX_NUM_SUBCARRIER_SPACING] = {1, 2, 4, 8, 16};
|
||||
|
||||
// Table 5.4.3.3-1 38-101
|
||||
static const int nr_ssb_table[][3] = {
|
||||
{1, 15, nr_ssb_type_A},
|
||||
{2, 15, nr_ssb_type_A},
|
||||
{3, 15, nr_ssb_type_A},
|
||||
{5, 15, nr_ssb_type_A},
|
||||
{5, 30, nr_ssb_type_B},
|
||||
{7, 15, nr_ssb_type_A},
|
||||
{8, 15, nr_ssb_type_A},
|
||||
{12, 15, nr_ssb_type_A},
|
||||
{13, 15, nr_ssb_type_A},
|
||||
{14, 15, nr_ssb_type_A},
|
||||
{18, 15, nr_ssb_type_A},
|
||||
{20, 15, nr_ssb_type_A},
|
||||
{24, 15, nr_ssb_type_A},
|
||||
{24, 30, nr_ssb_type_B},
|
||||
{25, 15, nr_ssb_type_A},
|
||||
{26, 15, nr_ssb_type_A},
|
||||
{28, 15, nr_ssb_type_A},
|
||||
{29, 15, nr_ssb_type_A},
|
||||
{30, 15, nr_ssb_type_A},
|
||||
{34, 15, nr_ssb_type_A},
|
||||
{34, 30, nr_ssb_type_C},
|
||||
{38, 15, nr_ssb_type_A},
|
||||
{38, 30, nr_ssb_type_C},
|
||||
{39, 15, nr_ssb_type_A},
|
||||
{39, 30, nr_ssb_type_C},
|
||||
{40, 30, nr_ssb_type_C},
|
||||
{41, 15, nr_ssb_type_A},
|
||||
{41, 30, nr_ssb_type_C},
|
||||
{46, 30, nr_ssb_type_C},
|
||||
{48, 30, nr_ssb_type_C},
|
||||
{50, 30, nr_ssb_type_C},
|
||||
{51, 15, nr_ssb_type_A},
|
||||
{53, 15, nr_ssb_type_A},
|
||||
{53, 30, nr_ssb_type_C},
|
||||
{65, 15, nr_ssb_type_A},
|
||||
{66, 15, nr_ssb_type_A},
|
||||
{66, 30, nr_ssb_type_B},
|
||||
{67, 15, nr_ssb_type_A},
|
||||
{70, 15, nr_ssb_type_A},
|
||||
{71, 15, nr_ssb_type_A},
|
||||
{74, 15, nr_ssb_type_A},
|
||||
{75, 15, nr_ssb_type_A},
|
||||
{76, 15, nr_ssb_type_A},
|
||||
{77, 30, nr_ssb_type_C},
|
||||
{78, 30, nr_ssb_type_C},
|
||||
{79, 30, nr_ssb_type_C},
|
||||
{85, 15, nr_ssb_type_A},
|
||||
{90, 15, nr_ssb_type_A},
|
||||
{90, 30, nr_ssb_type_C},
|
||||
{91, 15, nr_ssb_type_A},
|
||||
{92, 15, nr_ssb_type_A},
|
||||
{93, 15, nr_ssb_type_A},
|
||||
{94, 15, nr_ssb_type_A},
|
||||
{96, 30, nr_ssb_type_C},
|
||||
{100, 15, nr_ssb_type_A},
|
||||
{101, 15, nr_ssb_type_A},
|
||||
{101, 30, nr_ssb_type_C},
|
||||
{102, 30, nr_ssb_type_C},
|
||||
{104, 30, nr_ssb_type_C},
|
||||
{254, 15, nr_ssb_type_A},
|
||||
{254, 30, nr_ssb_type_C},
|
||||
{255, 15, nr_ssb_type_A},
|
||||
{255, 30, nr_ssb_type_B},
|
||||
{256, 15, nr_ssb_type_A}};
|
||||
|
||||
void set_Lmax(NR_DL_FRAME_PARMS *fp) {
|
||||
// definition of Lmax according to ts 38.213 section 4.1
|
||||
if (fp->dl_CarrierFreq < 6e9) {
|
||||
@@ -150,55 +83,34 @@ int nr_get_ssb_start_symbol(const NR_DL_FRAME_PARMS *fp, uint8_t i_ssb)
|
||||
return symbol;
|
||||
}
|
||||
|
||||
void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL)
|
||||
static void set_scs_parameters(NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL, int ssb_case)
|
||||
{
|
||||
int idx = 0;
|
||||
switch(mu) {
|
||||
case NR_MU_0: //15kHz scs
|
||||
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_0];
|
||||
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_0];
|
||||
fp->ssb_type = nr_ssb_type_A;
|
||||
while (nr_ssb_table[idx][0] != fp->nr_band)
|
||||
idx++;
|
||||
AssertFatal(nr_ssb_table[idx][1] == 15,"SCS %d not applicable to band %d\n",
|
||||
fp->subcarrier_spacing,fp->nr_band);
|
||||
break;
|
||||
|
||||
case NR_MU_1: //30kHz scs
|
||||
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_1];
|
||||
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_1];
|
||||
while(nr_ssb_table[idx][0] != fp->nr_band ||
|
||||
nr_ssb_table[idx][1] != 30) {
|
||||
AssertFatal(nr_ssb_table[idx][0] <= fp->nr_band,
|
||||
"SCS %d not applicable to band %d\n",
|
||||
fp->subcarrier_spacing,
|
||||
fp->nr_band);
|
||||
idx++;
|
||||
}
|
||||
fp->ssb_type = nr_ssb_table[idx][2];
|
||||
break;
|
||||
|
||||
case NR_MU_2: //60kHz scs
|
||||
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_2];
|
||||
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_2];
|
||||
break;
|
||||
|
||||
case NR_MU_3:
|
||||
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_3];
|
||||
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_3];
|
||||
fp->ssb_type = nr_ssb_type_D;
|
||||
break;
|
||||
|
||||
case NR_MU_4:
|
||||
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_4];
|
||||
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_4];
|
||||
fp->ssb_type = nr_ssb_type_E;
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid numerology index %d", mu);
|
||||
AssertFatal(false, "Invalid numerology index %d", mu);
|
||||
}
|
||||
|
||||
fp->ssb_type = ssb_case;
|
||||
// Start with FFT size 512
|
||||
fp->ofdm_symbol_size = 512;
|
||||
|
||||
@@ -231,7 +143,7 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL)
|
||||
fp->ofdm_symbol_size);
|
||||
}
|
||||
|
||||
void sl_set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_SL)
|
||||
void sl_set_scs_parameters(NR_DL_FRAME_PARMS *fp, int mu, int N_RB_SL)
|
||||
{
|
||||
|
||||
AssertFatal(mu >= NR_MU_0 && mu <= NR_MU_4,"Invalid numerology index %d", mu);
|
||||
@@ -402,7 +314,7 @@ void nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, NR_DL_FRAME_PARMS *
|
||||
fp->half_frame_bit = 0; // half frame bit initialized to 0 here
|
||||
fp->numerology_index = mu;
|
||||
|
||||
set_scs_parameters(fp, mu, fp->N_RB_DL);
|
||||
set_scs_parameters(fp, mu, fp->N_RB_DL, cfg->ssb_table.case_v3.value);
|
||||
|
||||
fp->slots_per_frame = 10* fp->slots_per_subframe;
|
||||
|
||||
@@ -435,9 +347,7 @@ void nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, NR_DL_FRAME_PARMS *
|
||||
fp->print_ue_help_cmdline_log = true;
|
||||
}
|
||||
|
||||
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
fapi_nr_config_request_t* config,
|
||||
uint16_t nr_band)
|
||||
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, fapi_nr_config_request_t* config, uint16_t nr_band)
|
||||
{
|
||||
|
||||
uint8_t nb_ant_ports_gNB = 1;
|
||||
@@ -454,7 +364,6 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
fp->nb_antenna_ports_gNB = nb_ant_ports_gNB;
|
||||
fp->tdd_config = tdd_cfg;
|
||||
fp->Nid_cell = Nid_cell;
|
||||
fp->nr_band = nr_band;
|
||||
|
||||
LOG_I(PHY, "Initializing frame parms: set nb_antenna_ports_gNB %d, tdd_config, %d, Nid_cell %d\n", fp->nb_antenna_ports_gNB, fp->tdd_config, fp->Nid_cell);
|
||||
|
||||
@@ -472,13 +381,21 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
fp->N_RB_DL = config->carrier_config.dl_grid_size[fp->numerology_index];
|
||||
fp->N_RB_SL = config->carrier_config.sl_grid_size[fp->numerology_index];
|
||||
|
||||
fp->frame_type = get_frame_type(fp->nr_band, fp->numerology_index);
|
||||
fp->frame_type = get_frame_type(nr_band, fp->numerology_index);
|
||||
int64_t uplink_frequency_offset = fp->ul_CarrierFreq - fp->dl_CarrierFreq;
|
||||
uplink_frequency_offset *= 1000;
|
||||
|
||||
LOG_I(PHY, "Initializing frame parms: DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %ld Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, uplink_frequency_offset);
|
||||
LOG_I(PHY,
|
||||
"Initializing frame parms: DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %ld Hz\n",
|
||||
fp->dl_CarrierFreq,
|
||||
fp->ul_CarrierFreq,
|
||||
nr_band,
|
||||
uplink_frequency_offset);
|
||||
|
||||
AssertFatal(fp->frame_type==config->cell_config.frame_duplex_type, "Invalid duplex type (frame_type %d,cell_config.frame_duplex_type %d) in config request file for band %d\n", fp->frame_type,config->cell_config.frame_duplex_type,fp->nr_band);
|
||||
AssertFatal(fp->frame_type == config->cell_config.frame_duplex_type,
|
||||
"Invalid duplex type (frame_type %d,cell_config.frame_duplex_type %d) in config request file for band %d\n",
|
||||
fp->frame_type,config->cell_config.frame_duplex_type,
|
||||
nr_band);
|
||||
|
||||
LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",fp->numerology_index, fp->N_RB_DL, Ncp);
|
||||
|
||||
@@ -488,7 +405,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
|
||||
fp->Ncp = Ncp;
|
||||
int N_RB = fp->N_RB_DL;
|
||||
set_scs_parameters(fp, fp->numerology_index, N_RB);
|
||||
set_scs_parameters(fp, fp->numerology_index, N_RB, config->ssb_table.ssb_case);
|
||||
|
||||
fp->slots_per_frame = 10* fp->slots_per_subframe;
|
||||
fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||
@@ -549,11 +466,10 @@ void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_p
|
||||
frame_parms->N_RB_DL = N_RB_DL;
|
||||
frame_parms->N_RB_UL = frame_parms->N_RB_DL;
|
||||
|
||||
frame_parms->nr_band = nr_band;
|
||||
frame_parms->frame_type = get_frame_type(frame_parms->nr_band, frame_parms->numerology_index);
|
||||
frame_parms->frame_type = get_frame_type(nr_band, frame_parms->numerology_index);
|
||||
|
||||
frame_parms->Ncp = NORMAL;
|
||||
set_scs_parameters(frame_parms, frame_parms->numerology_index, frame_parms->N_RB_DL);
|
||||
set_scs_parameters(frame_parms, frame_parms->numerology_index, frame_parms->N_RB_DL, set_ssb_case(mu, nr_band));
|
||||
set_Lmax(frame_parms);
|
||||
|
||||
frame_parms->slots_per_frame = 10* frame_parms->slots_per_subframe;
|
||||
@@ -596,7 +512,6 @@ void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp)
|
||||
LOG_I(PHY, "fp->Ncp=%d\n", fp->Ncp);
|
||||
LOG_I(PHY, "fp->N_RB_DL=%d\n", fp->N_RB_DL);
|
||||
LOG_I(PHY, "fp->numerology_index=%d\n", fp->numerology_index);
|
||||
LOG_I(PHY, "fp->nr_band=%d\n", fp->nr_band);
|
||||
LOG_I(PHY, "fp->ofdm_offset_divisor=%d\n", fp->ofdm_offset_divisor);
|
||||
LOG_I(PHY, "fp->threequarter_fs=%d\n", fp->threequarter_fs);
|
||||
LOG_I(PHY, "fp->sl_CarrierFreq=%lu\n", fp->sl_CarrierFreq);
|
||||
@@ -612,8 +527,6 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
|
||||
fp->ofdm_offset_divisor = ofdm_offset_divisor;
|
||||
fp->threequarter_fs = threequarter_fs;
|
||||
|
||||
fp->nr_band = get_band(config->sl_carrier_config.sl_frequency, 0, 0, 0);
|
||||
|
||||
fp->att_rx = 0;
|
||||
fp->att_tx = 0;
|
||||
fp->nb_antennas_rx = config->sl_carrier_config.sl_num_rx_ant;
|
||||
@@ -625,7 +538,7 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
|
||||
fp->N_RB_UL = fp->N_RB_SL;
|
||||
fp->Ncp = config->sl_bwp_config.sl_cyclic_prefix;
|
||||
|
||||
fp->frame_type = get_frame_type(fp->nr_band, fp->numerology_index);
|
||||
fp->frame_type = get_frame_type(config->sl_carrier_config.band, fp->numerology_index);
|
||||
|
||||
uint64_t bw_khz = (12 * config->sl_carrier_config.sl_grid_size) * (15 << config->sl_bwp_config.sl_scs);
|
||||
// REfer to section 3GPP spec 38.101 5.4E.2.1
|
||||
@@ -645,7 +558,7 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
|
||||
fp->dl_CarrierFreq,
|
||||
fp->ul_CarrierFreq,
|
||||
fp->sl_CarrierFreq,
|
||||
fp->nr_band);
|
||||
config->sl_carrier_config.band);
|
||||
|
||||
AssertFatal(fp->frame_type == TDD, "Sidelink bands only support TDD");
|
||||
|
||||
|
||||
@@ -101,7 +101,6 @@ TEST(nr_frame_params, test_mu_3)
|
||||
cfg.cell_config.frame_duplex_type.value = TDD;
|
||||
cfg.ssb_config.scs_common.value = mu;
|
||||
fp.dl_CarrierFreq = 27524520000;
|
||||
fp.nr_band = 261;
|
||||
nr_init_frame_parms(&cfg, &fp);
|
||||
nr_dump_frame_parms(&fp);
|
||||
test_coherence_symbol_api(&fp);
|
||||
@@ -121,7 +120,6 @@ TEST(nr_frame_params, test_mu_2)
|
||||
cfg.cell_config.frame_duplex_type.value = TDD;
|
||||
cfg.ssb_config.scs_common.value = mu;
|
||||
fp.dl_CarrierFreq = 27524520000;
|
||||
fp.nr_band = 261;
|
||||
nr_init_frame_parms(&cfg, &fp);
|
||||
nr_dump_frame_parms(&fp);
|
||||
test_coherence_symbol_api(&fp);
|
||||
@@ -141,7 +139,6 @@ TEST(nr_frame_params, test_mu_1)
|
||||
cfg.cell_config.frame_duplex_type.value = TDD;
|
||||
cfg.ssb_config.scs_common.value = mu;
|
||||
fp.dl_CarrierFreq = 3600000000;
|
||||
fp.nr_band = 78;
|
||||
nr_init_frame_parms(&cfg, &fp);
|
||||
nr_dump_frame_parms(&fp);
|
||||
test_coherence_symbol_api(&fp);
|
||||
@@ -161,7 +158,6 @@ TEST(nr_frame_params, test_mu_0)
|
||||
cfg.cell_config.frame_duplex_type.value = TDD;
|
||||
cfg.ssb_config.scs_common.value = mu;
|
||||
fp.dl_CarrierFreq = 2600000000;
|
||||
fp.nr_band = 38;
|
||||
nr_init_frame_parms(&cfg, &fp);
|
||||
nr_dump_frame_parms(&fp);
|
||||
test_coherence_symbol_api(&fp);
|
||||
|
||||
@@ -171,8 +171,6 @@ struct NR_DL_FRAME_PARMS {
|
||||
uint8_t N_RBG;
|
||||
/// Total Number of Resource Block Groups SubSets: this is P
|
||||
uint8_t N_RBGS;
|
||||
/// NR Band
|
||||
uint16_t nr_band;
|
||||
/// DL carrier frequency
|
||||
uint64_t dl_CarrierFreq;
|
||||
/// UL carrier frequency
|
||||
|
||||
@@ -116,7 +116,7 @@ static uint32_t get_ssb_arfcn(NR_DL_FRAME_PARMS *frame_parms)
|
||||
uint32_t band_size_hz = frame_parms->N_RB_DL * 12 * frame_parms->subcarrier_spacing;
|
||||
int ssb_center_sc = frame_parms->ssb_start_subcarrier + 120; // ssb is 20 PRBs -> 240 sub-carriers
|
||||
uint64_t ssb_freq = frame_parms->dl_CarrierFreq - (band_size_hz / 2) + frame_parms->subcarrier_spacing * ssb_center_sc;
|
||||
return to_nrarfcn(frame_parms->nr_band, ssb_freq, frame_parms->numerology_index, band_size_hz);
|
||||
return to_nrarfcn(ssb_freq);
|
||||
}
|
||||
void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
uint8_t pdu_type,
|
||||
|
||||
@@ -433,11 +433,7 @@ int main(int argc, char **argv){
|
||||
|
||||
nr_phy_config_request_sim(gNB, N_RB_UL, N_RB_UL, mu, Nid_cell, SSB_positions);
|
||||
|
||||
uint64_t absoluteFrequencyPointA = to_nrarfcn(frame_parms->nr_band,
|
||||
frame_parms->dl_CarrierFreq,
|
||||
frame_parms->numerology_index,
|
||||
frame_parms->N_RB_UL*(180e3)*(1 << frame_parms->numerology_index));
|
||||
|
||||
uint64_t absoluteFrequencyPointA = to_nrarfcn(frame_parms->dl_CarrierFreq);
|
||||
uint8_t frame = 1;
|
||||
uint8_t subframe = 9;
|
||||
uint8_t slot = 10 * frame_parms->slots_per_subframe - 1;
|
||||
|
||||
@@ -229,6 +229,7 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommo
|
||||
cfg->ssb_table.ssb_offset_point_a = frequencyInfoDL->offsetToPointA;
|
||||
cfg->ssb_table.ssb_period = scc->ssb_PeriodicityServingCell;
|
||||
cfg->ssb_table.ssb_subcarrier_offset = mac->ssb_subcarrier_offset;
|
||||
cfg->ssb_table.ssb_case = set_ssb_case(mac->numerology, mac->nr_band);
|
||||
|
||||
if (mac->frequency_range == FR1){
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask = ((uint32_t) scc->ssb_PositionsInBurst.inOneGroup.buf[0]) << 24;
|
||||
@@ -546,6 +547,7 @@ static void config_common_ue(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommon_t
|
||||
cfg->ssb_table.ssb_period = *scc->ssb_periodicityServingCell;
|
||||
// NSA -> take ssb offset from SCS
|
||||
cfg->ssb_table.ssb_subcarrier_offset = absolute_diff % (12 * scs_scaling);
|
||||
cfg->ssb_table.ssb_case = set_ssb_case(*scc->ssbSubcarrierSpacing, mac->nr_band);
|
||||
}
|
||||
|
||||
switch (scc->ssb_PositionsInBurst->present) {
|
||||
|
||||
@@ -126,9 +126,9 @@ static void sl_prepare_phy_config(int module_id,
|
||||
|
||||
AssertFatal(SSB_ARFCN, "sl_AbsoluteFrequencySSB cannot be 0\n");
|
||||
|
||||
LOG_I(NR_MAC, "SIDELINK CONFIGs: AbsFreqSSB:%d, AbsFreqPointA:%d, SL band:%d\n",
|
||||
SSB_ARFCN,pointA_ARFCN, sl_band);
|
||||
LOG_I(NR_MAC, "SIDELINK CONFIGs: AbsFreqSSB:%d, AbsFreqPointA:%d, SL band:%d\n", SSB_ARFCN, pointA_ARFCN, sl_band);
|
||||
|
||||
phycfg->sl_carrier_config.band = sl_band;
|
||||
//FREQSHIFT_7P5KHZ is DISABLED
|
||||
phycfg->sl_carrier_config.sl_frequency_shift_7p5khz = 0;
|
||||
phycfg->sl_carrier_config.sl_value_N = freqcfg->valueN_r16;
|
||||
@@ -141,8 +141,7 @@ static void sl_prepare_phy_config(int module_id,
|
||||
int bw_index = get_supported_band_index(carriercfg->subcarrierSpacing, FR1, carriercfg->carrierBandwidth);
|
||||
phycfg->sl_carrier_config.sl_bandwidth = get_supported_bw_mhz(FR1, bw_index);
|
||||
|
||||
phycfg->sl_carrier_config.sl_frequency =
|
||||
from_nrarfcn(sl_band,carriercfg->subcarrierSpacing,pointA_ARFCN); // freq in kHz
|
||||
phycfg->sl_carrier_config.sl_frequency = from_nrarfcn(sl_band, carriercfg->subcarrierSpacing, pointA_ARFCN); // freq in kHz
|
||||
|
||||
phycfg->sl_carrier_config.sl_grid_size = carriercfg->carrierBandwidth;
|
||||
//For sidelink offset to carrier is 0. hence not used
|
||||
|
||||
@@ -397,8 +397,9 @@ static void config_common(gNB_MAC_INST *nrmac, const nr_mac_config_t *config, NR
|
||||
nrmac->common_channels[0].ServingCellConfigCommon = scc;
|
||||
|
||||
// Carrier configuration
|
||||
struct NR_FrequencyInfoDL *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
|
||||
frequency_range_t frequency_range = get_freq_range_from_band(*frequencyInfoDL->frequencyBandList.list.array[0]);
|
||||
NR_FrequencyInfoDL_t *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
|
||||
NR_FreqBandIndicatorNR_t nr_band = *frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
frequency_range_t frequency_range = get_freq_range_from_band(nr_band);
|
||||
int bw_index = get_supported_band_index(frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
frequency_range,
|
||||
frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
||||
@@ -406,7 +407,7 @@ static void config_common(gNB_MAC_INST *nrmac, const nr_mac_config_t *config, NR
|
||||
cfg->carrier_config.dl_bandwidth.tl.tag = NFAPI_NR_CONFIG_DL_BANDWIDTH_TAG; // temporary
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->carrier_config.dl_frequency.value = from_nrarfcn(*frequencyInfoDL->frequencyBandList.list.array[0],
|
||||
cfg->carrier_config.dl_frequency.value = from_nrarfcn(nr_band,
|
||||
*scc->ssbSubcarrierSpacing,
|
||||
frequencyInfoDL->absoluteFrequencyPointA)
|
||||
/ 1000; // freq in kHz
|
||||
@@ -462,8 +463,7 @@ static void config_common(gNB_MAC_INST *nrmac, const nr_mac_config_t *config, NR
|
||||
}
|
||||
}
|
||||
|
||||
NR_FreqBandIndicatorNR_t band = *frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
frame_type_t frame_type = get_frame_type(band, *scc->ssbSubcarrierSpacing);
|
||||
frame_type_t frame_type = get_frame_type(nr_band, *scc->ssbSubcarrierSpacing);
|
||||
nrmac->common_channels[0].frame_type = frame_type;
|
||||
|
||||
// Cell configuration
|
||||
@@ -508,7 +508,7 @@ static void config_common(gNB_MAC_INST *nrmac, const nr_mac_config_t *config, NR
|
||||
else {
|
||||
// If absent, use SCS as derived from the prach-ConfigurationIndex (for 839)
|
||||
int config_index = rach_ConfigCommon->rach_ConfigGeneric.prach_ConfigurationIndex;
|
||||
int frame_type = get_frame_type(band, frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing);
|
||||
int frame_type = get_frame_type(nr_band, frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing);
|
||||
int format = get_nr_prach_format_from_index(config_index, UL_pointA, frame_type) & 0xff;
|
||||
cfg->prach_config.prach_sub_c_spacing.value = get_delta_f_RA_long(format);
|
||||
}
|
||||
@@ -606,6 +606,10 @@ static void config_common(gNB_MAC_INST *nrmac, const nr_mac_config_t *config, NR
|
||||
cfg->ssb_table.ssb_subcarrier_offset.tl.tag = NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->ssb_table.case_v3.value = set_ssb_case(*scc->ssbSubcarrierSpacing, nr_band);
|
||||
cfg->ssb_table.case_v3.tl.tag = NFAPI_NR_FAPI_SSB_CASE_VENDOR_EXTENSION_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
uint8_t *mib_payload = nrmac->common_channels[0].MIB_pdu;
|
||||
uint32_t mib = (mib_payload[2] << 16) | (mib_payload[1] << 8) | mib_payload[0];
|
||||
cfg->ssb_table.MIB.tl.tag = NFAPI_NR_CONFIG_MIB_TAG;
|
||||
@@ -742,7 +746,7 @@ static void config_common(gNB_MAC_INST *nrmac, const nr_mac_config_t *config, NR
|
||||
carr_ul - carr_dl,
|
||||
bw,
|
||||
mu,
|
||||
band,
|
||||
nr_band,
|
||||
12 * prb_offset + sc_offset,
|
||||
get_softmodem_params()->threequarter_fs ? "-E" : "");
|
||||
} else {
|
||||
@@ -751,7 +755,7 @@ static void config_common(gNB_MAC_INST *nrmac, const nr_mac_config_t *config, NR
|
||||
carr_dl,
|
||||
bw,
|
||||
mu,
|
||||
band,
|
||||
nr_band,
|
||||
12 * prb_offset + sc_offset,
|
||||
get_softmodem_params()->threequarter_fs ? "-E" : "");
|
||||
}
|
||||
|
||||
@@ -417,10 +417,7 @@ int aw2s_startstreaming(openair0_device_t *device)
|
||||
return (0);
|
||||
}
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP,
|
||||
uint64_t dl_CarrierFreq,
|
||||
uint8_t scs_index,
|
||||
uint32_t bw);
|
||||
uint32_t to_nrarfcn(uint64_t dl_CarrierFreq);
|
||||
|
||||
int aw2s_oriinit(openair0_device_t *device)
|
||||
{
|
||||
@@ -543,7 +540,7 @@ int aw2s_oriinit(openair0_device_t *device)
|
||||
txParams.TxNRFDD.axcB = 0;
|
||||
txParams.TxNRFDD.chanBW = openair0_cfg->tx_bw/100e3;
|
||||
|
||||
txParams.TxNRFDD.AWS_arfcn = to_nrarfcn(openair0_cfg->nr_band,(long long int)openair0_cfg->tx_freq[0],openair0_cfg->nr_scs_for_raster,(uint32_t)openair0_cfg->tx_bw);
|
||||
txParams.TxNRFDD.AWS_arfcn = to_nrarfcn((long long int)openair0_cfg->tx_freq[0]);
|
||||
txParams.TxNRFDD.maxTxPwr = 430-((int)openair0_cfg->tx_gain[0]*10);
|
||||
}
|
||||
else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 0) {
|
||||
@@ -562,7 +559,7 @@ int aw2s_oriinit(openair0_device_t *device)
|
||||
txParams.TxNRTDD.axcW = 1;
|
||||
txParams.TxNRTDD.axcB = 0;
|
||||
txParams.TxNRTDD.chanBW = openair0_cfg->tx_bw/100e3;
|
||||
txParams.TxNRTDD.AWS_arfcn = to_nrarfcn(openair0_cfg->nr_band,(long long int)openair0_cfg->tx_freq[0],openair0_cfg->nr_scs_for_raster,(uint32_t)openair0_cfg->tx_bw);
|
||||
txParams.TxNRTDD.AWS_arfcn = to_nrarfcn((long long int)openair0_cfg->tx_freq[0]);
|
||||
txParams.TxNRTDD.maxTxPwr = 430-((int)openair0_cfg->tx_gain[0]*10);
|
||||
|
||||
printf("AW2S: Configuring for NR TDD, NRARFCN %u, Power %d, BW %d\n",
|
||||
@@ -678,7 +675,7 @@ int aw2s_oriinit(openair0_device_t *device)
|
||||
rxParams.RxNRFDD.axcW = 1;
|
||||
rxParams.RxNRFDD.axcB = 0;
|
||||
rxParams.RxNRFDD.chanBW = txParams.TxNRFDD.chanBW;
|
||||
rxParams.RxNRFDD.AWS_arfcn = to_nrarfcn(openair0_cfg->nr_band,(long long int)openair0_cfg->rx_freq[0],openair0_cfg->nr_scs_for_raster,openair0_cfg->rx_bw);
|
||||
rxParams.RxNRFDD.AWS_arfcn = to_nrarfcn((long long int)openair0_cfg->rx_freq[0]);
|
||||
result = ORI_ObjectCreation(ori, rxTypeRef, rxParams, rxParamList, num_rxparams, rxParamResult, &rx0, &RE_result);
|
||||
}
|
||||
else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 0) {
|
||||
|
||||
@@ -276,8 +276,6 @@ typedef struct openair0_config {
|
||||
recplay_conf_t *recplay_conf;
|
||||
//! Flag to indicate this configuration is for NR
|
||||
int nr_flag;
|
||||
//! NR band number
|
||||
int nr_band;
|
||||
//! NR scs for raster
|
||||
int nr_scs_for_raster;
|
||||
//! Core IDs for RX FH
|
||||
|
||||
@@ -248,7 +248,7 @@ static bool create_uplane_conf_v2(const ru_session_t *ru_session, const openair0
|
||||
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"center-of-channel-bandwidth\" node.\n");
|
||||
|
||||
char rx_arfcn[16];
|
||||
snprintf(rx_arfcn, sizeof(rx_arfcn), "%d", to_nrarfcn(oai->nr_band, oai->rx_freq[0], oai->nr_scs_for_raster, oai->rx_bw));
|
||||
snprintf(rx_arfcn, sizeof(rx_arfcn), "%d", to_nrarfcn(oai->rx_freq[0]));
|
||||
ret = lyd_new_term(rx_carrier_node, NULL, "absolute-frequency-center", rx_arfcn, 0, NULL);
|
||||
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"absolute-frequency-center\" node.\n");
|
||||
|
||||
@@ -290,7 +290,7 @@ static bool create_uplane_conf_v2(const ru_session_t *ru_session, const openair0
|
||||
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"center-of-channel-bandwidth\" node.\n");
|
||||
|
||||
char tx_arfcn[16];
|
||||
snprintf(tx_arfcn, sizeof(tx_arfcn), "%d", to_nrarfcn(oai->nr_band, oai->tx_freq[0], oai->nr_scs_for_raster, oai->tx_bw));
|
||||
snprintf(tx_arfcn, sizeof(tx_arfcn), "%d", to_nrarfcn(oai->tx_freq[0]));
|
||||
ret = lyd_new_term(tx_carrier_node, NULL, "absolute-frequency-center", tx_arfcn, 0, NULL);
|
||||
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"absolute-frequency-center\" node.\n");
|
||||
|
||||
|
||||
@@ -902,7 +902,6 @@ static bool set_fh_config(void *mplane_api, int ru_idx, int num_rus, enum xran_c
|
||||
DevAssert(oai0->rx_freq[0] > 0);
|
||||
for (int i = 1; i < oai0->rx_num_channels; ++i)
|
||||
DevAssert(oai0->rx_freq[0] == oai0->rx_freq[i]);
|
||||
DevAssert(oai0->nr_band > 0);
|
||||
paramdef_t FHconfigs[] = ORAN_FH_DESC;
|
||||
paramlist_def_t FH_ConfigList = {CONFIG_STRING_ORAN_FH};
|
||||
char aprefix[MAX_OPTNAME_SIZE] = {0};
|
||||
|
||||
Reference in New Issue
Block a user