Merge remote-tracking branch 'origin/develop' into develop-CSI-Measurements
# Conflicts: # openair2/RRC/NR/nr_rrc_config.c # targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf # targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf
This commit is contained in:
@@ -21,8 +21,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 31; //0;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
#spCellConfigCommon
|
||||
|
||||
@@ -32,7 +32,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
min_rxtxtime = 6;
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 31; //0;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
|
||||
@@ -32,7 +32,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
|
||||
@@ -21,7 +21,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
|
||||
@@ -44,7 +44,6 @@ gNBs =
|
||||
local_s_portd = 2152;
|
||||
remote_s_portc = 500;
|
||||
remote_s_portd = 2152;
|
||||
ssb_SubcarrierOffset = 0;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
|
||||
@@ -36,7 +36,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
|
||||
@@ -37,7 +37,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts_XP = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts_XP = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
|
||||
@@ -21,7 +21,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
|
||||
@@ -19,7 +19,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 31; //0;
|
||||
pdsch_AntennaPorts_XP = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
ul_prbblacklist = "51,52,53,54"
|
||||
|
||||
@@ -41,7 +41,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pusch_AntennaPorts = 2;
|
||||
ul_prbblacklist = "51,52,53,54"
|
||||
do_SRS = 1;
|
||||
|
||||
@@ -37,7 +37,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts_XP = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
ul_prbblacklist = "51,52,53,54"
|
||||
|
||||
@@ -37,7 +37,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pusch_AntennaPorts = 2;
|
||||
ul_prbblacklist = "51,52,53,54"
|
||||
do_SRS = 1;
|
||||
|
||||
@@ -37,7 +37,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
#pusch_TargetSNRx10 = 200;
|
||||
#pucch_TargetSNRx10 = 200;
|
||||
ul_prbblacklist = "51,52,53,54"
|
||||
|
||||
@@ -37,7 +37,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts_XP = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
#pusch_TargetSNRx10 = 200;
|
||||
|
||||
@@ -21,7 +21,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
|
||||
@@ -19,7 +19,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 31; //0;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
|
||||
@@ -20,7 +20,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 31; //0;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
|
||||
@@ -32,7 +32,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
|
||||
@@ -32,9 +32,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
sib1_tda = 15;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
|
||||
@@ -1952,6 +1952,7 @@ set (MAC_SRC_UE
|
||||
|
||||
set (MAC_NR_SRC_UE
|
||||
${NR_UE_PHY_INTERFACE_DIR}/NR_IF_Module.c
|
||||
${NR_UE_PHY_INTERFACE_DIR}/NR_Packet_Drop.c
|
||||
${NR_UE_MAC_DIR}/config_ue.c
|
||||
${NR_UE_MAC_DIR}/mac_vars.c
|
||||
${NR_UE_MAC_DIR}/main_ue_nr.c
|
||||
|
||||
@@ -1062,7 +1062,8 @@
|
||||
(Test3: PBCH-only, 217 PRB),
|
||||
(Test4: PBCH and synchronization, 217 RPB),
|
||||
(Test5: PBCH-only, 273 PRB),
|
||||
(Test6: PBCH and synchronization, 273 PRB)</desc>
|
||||
(Test6: PBCH and synchronization, 273 PRB),
|
||||
(Test7: PBCH and synchronization, 106PBR, SSB SC OFFSET 6)</desc>
|
||||
<pre_compile_prog></pre_compile_prog>
|
||||
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
|
||||
<compile_prog_args> --phy_simulators -c </compile_prog_args>
|
||||
@@ -1074,8 +1075,9 @@
|
||||
-s-11 -S-8 -n10 -R217
|
||||
-s-11 -S-8 -n10 -o8000 -I -R217
|
||||
-s-11 -S-8 -n10 -R273
|
||||
-s-11 -S-8 -n10 -o8000 -I -R273</main_exec_args>
|
||||
<tags>nr_pbchsim.test1 nr_pbchsim.test2 nr_pbchsim.test3 nr_pbchsim.test4 nr_pbchsim.test5 nr_pbchsim.test6</tags>
|
||||
-s-11 -S-8 -n10 -o8000 -I -R273
|
||||
-s-11 -S-8 -n10 -R106 -O6</main_exec_args>
|
||||
<tags>nr_pbchsim.test1 nr_pbchsim.test2 nr_pbchsim.test3 nr_pbchsim.test4 nr_pbchsim.test5 nr_pbchsim.test6 nr_pbchsim.test7</tags>
|
||||
<search_expr_true>PBCH test OK</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
|
||||
@@ -109,6 +109,7 @@ check_supported_distribution() {
|
||||
"ubuntu18.04") return 0 ;;
|
||||
"ubuntu16.04") return 0 ;;
|
||||
"fedora35") return 0 ;;
|
||||
"fedora36") return 0 ;;
|
||||
"rhel7") return 0 ;;
|
||||
"rhel7.6") return 0 ;;
|
||||
"rhel7.7") return 0 ;;
|
||||
@@ -623,7 +624,6 @@ check_install_additional_tools (){
|
||||
android-tools-adb \
|
||||
wvdial \
|
||||
sshpass \
|
||||
nscd \
|
||||
bc \
|
||||
ntp"
|
||||
elif [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
|
||||
@@ -648,7 +648,6 @@ check_install_additional_tools (){
|
||||
wvdial \
|
||||
numpy \
|
||||
sshpass \
|
||||
nscd \
|
||||
python2-paramiko \
|
||||
python-pyroute2 \
|
||||
python-netifaces \
|
||||
@@ -676,7 +675,6 @@ check_install_additional_tools (){
|
||||
wvdial \
|
||||
python-numpy \
|
||||
sshpass \
|
||||
nscd \
|
||||
python-paramiko \
|
||||
python-pyroute2 \
|
||||
python-netifaces \
|
||||
|
||||
@@ -21,8 +21,6 @@ gNBs =
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 31; //0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++) {
|
||||
// Allocate 10 subframes of I/Q TX signal data (time) if not
|
||||
ru->common.txdata[i] = (int32_t*)malloc16_clear((ru->sf_extension +fp->samples_per_frame) *sizeof(int32_t));
|
||||
ru->common.txdata[i] = (int32_t*)malloc16_clear((ru->sf_extension + fp->samples_per_frame)*sizeof(int32_t));
|
||||
LOG_I(PHY,"[INIT] common.txdata[%d] = %p (%lu bytes,sf_extension %d)\n",i,ru->common.txdata[i],
|
||||
(ru->sf_extension + fp->samples_per_frame)*sizeof(int32_t),ru->sf_extension);
|
||||
ru->common.txdata[i] = &ru->common.txdata[i][ru->sf_extension];
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <linux/version.h>
|
||||
#if RHEL_RELEASE_CODE >= 1796
|
||||
#if defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796 && RHEL_RELEASE_CODE != 2403
|
||||
#include <lapacke/lapacke_utils.h>
|
||||
#include <lapacke/lapacke.h>
|
||||
#else
|
||||
|
||||
@@ -14,7 +14,7 @@ data storage. */
|
||||
#include <cblas.h>
|
||||
#include <string.h>
|
||||
#include <linux/version.h>
|
||||
#if RHEL_RELEASE_CODE >= 1796
|
||||
#if defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796 && RHEL_RELEASE_CODE != 2403
|
||||
#include <lapacke/lapacke_utils.h>
|
||||
#include <lapacke/lapacke.h>
|
||||
#else
|
||||
|
||||
@@ -278,16 +278,30 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
uint8_t maxpos=0;
|
||||
uint8_t index=0;
|
||||
|
||||
int nb_re_pucch = 12*pucch_pdu->prb_size; // prb size is 1
|
||||
int32_t rp[frame_parms->nb_antennas_rx][pucch_pdu->nr_of_symbols][nb_re_pucch],*tmp_rp;
|
||||
|
||||
for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
|
||||
l2 = l+pucch_pdu->start_symbol_index;
|
||||
|
||||
re_offset[l] = (12*prb_offset[l]) + frame_parms->first_carrier_offset;
|
||||
if (re_offset[l]>= frame_parms->ofdm_symbol_size)
|
||||
re_offset[l]-=frame_parms->ofdm_symbol_size;
|
||||
|
||||
AssertFatal(re_offset[l]+12 < frame_parms->ofdm_symbol_size,"pucch straddles DC carrier, handle this!\n");
|
||||
|
||||
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
|
||||
c16_t *r=(c16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]];
|
||||
for (n=0;n<12;n++) {
|
||||
tmp_rp = &rxdataF[aa][soffset + l2*frame_parms->ofdm_symbol_size];
|
||||
if(re_offset[l] + nb_re_pucch > frame_parms->ofdm_symbol_size) {
|
||||
int neg_length = frame_parms->ofdm_symbol_size-re_offset[l];
|
||||
int pos_length = nb_re_pucch-neg_length;
|
||||
memcpy1((void*)rp[aa][l],(void*)&tmp_rp[re_offset[l]],neg_length*sizeof(int32_t));
|
||||
memcpy1((void*)&rp[aa][l][neg_length],(void*)tmp_rp,pos_length*sizeof(int32_t));
|
||||
}
|
||||
else
|
||||
memcpy1((void*)rp[aa][l],(void*)&tmp_rp[re_offset[l]],nb_re_pucch*sizeof(int32_t));
|
||||
|
||||
c16_t *r = (c16_t*)&rp[aa][l];
|
||||
|
||||
for (n=0;n<nb_re_pucch;n++) {
|
||||
xr[aa][l][n].r = (int32_t)x_re[l][n] * r[n].r + (int32_t)x_im[l][n] * r[n].i;
|
||||
xr[aa][l][n].i = (int32_t)x_re[l][n] * r[n].i - (int32_t)x_im[l][n] * r[n].r;
|
||||
#ifdef DEBUG_NR_PUCCH_RX
|
||||
@@ -385,9 +399,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]]);
|
||||
int SNRtimes10,sigenergy=0;
|
||||
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++)
|
||||
sigenergy += signal_energy_nodc(&rxdataF[aa][soffset+
|
||||
(pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size)+
|
||||
re_offset[0]],12);
|
||||
sigenergy += signal_energy_nodc(rp[aa][0],12);
|
||||
SNRtimes10 = xrtmag_dBtimes10-(10*max_n0);
|
||||
int cqi;
|
||||
if (SNRtimes10 < -640) cqi=0;
|
||||
|
||||
@@ -907,7 +907,7 @@ typedef enum {no_relay=1,unicast_relay_type1,unicast_relay_type2, multicast_rela
|
||||
|
||||
|
||||
|
||||
#define MCS_COUNT 28
|
||||
#define MCS_COUNT 29
|
||||
#define MCS_TABLE_LENGTH_MAX 64
|
||||
|
||||
|
||||
|
||||
@@ -251,7 +251,6 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
|
||||
if (number_dl_pdu>0)
|
||||
oai_nfapi_dl_tti_req(DL_req);
|
||||
|
||||
}
|
||||
stop_meas(&gNB->schedule_response_stats);
|
||||
}
|
||||
|
||||
@@ -50,19 +50,6 @@ uint8_t SSB_Table[38]={0,2,4,6,8,10,12,14,254,254,16,18,20,22,24,26,28,30,254,25
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_scf_t *cfg, NR_DL_FRAME_PARMS *fp) {
|
||||
|
||||
uint8_t sco = 0;
|
||||
if (((fp->freq_range == nr_FR1) && (cfg->ssb_table.ssb_subcarrier_offset.value<24)) ||
|
||||
((fp->freq_range == nr_FR2) && (cfg->ssb_table.ssb_subcarrier_offset.value<12)) ) {
|
||||
if (fp->freq_range == nr_FR1)
|
||||
sco = cfg->ssb_table.ssb_subcarrier_offset.value>>cfg->ssb_config.scs_common.value;
|
||||
}
|
||||
|
||||
fp->ssb_start_subcarrier = (12 * cfg->ssb_table.ssb_offset_point_a.value + sco);
|
||||
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->ssb_table.ssb_offset_point_a.value,sco);
|
||||
}
|
||||
|
||||
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_dl_tti_ssb_pdu ssb_pdu) {
|
||||
|
||||
NR_DL_FRAME_PARMS *fp=&gNB->frame_parms;
|
||||
@@ -84,7 +71,9 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
|
||||
int ssb_start_symbol_abs = nr_get_ssb_start_symbol(fp,ssb_index); // computing the starting symbol for current ssb
|
||||
ssb_start_symbol = ssb_start_symbol_abs % fp->symbols_per_slot; // start symbol wrt slot
|
||||
|
||||
nr_set_ssb_first_subcarrier(cfg, fp); // setting the first subcarrier
|
||||
// setting the first subcarrier
|
||||
fp->ssb_start_subcarrier = (12 * cfg->ssb_table.ssb_offset_point_a.value + ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset);
|
||||
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->ssb_table.ssb_offset_point_a.value,ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset);
|
||||
|
||||
LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol);
|
||||
nr_generate_pss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
|
||||
|
||||
@@ -210,7 +210,6 @@ int nr_derive_key(int alg_type, uint8_t alg_id,
|
||||
}
|
||||
|
||||
void config_common(int Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
int pusch_AntennaPorts,
|
||||
NR_ServingCellConfigCommon_t *scc);
|
||||
@@ -242,10 +241,10 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
|
||||
return 0;
|
||||
}
|
||||
|
||||
nr_bler_struct nr_bler_data[NR_NUM_MCS];
|
||||
|
||||
void processSlotTX(void *arg) {}
|
||||
|
||||
nr_bler_struct nr_bler_data[NR_NUM_MCS];
|
||||
|
||||
//nFAPI P7 dummy functions to avoid linking errors
|
||||
|
||||
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); }
|
||||
@@ -857,9 +856,9 @@ int main(int argc, char **argv)
|
||||
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||
|
||||
// common configuration
|
||||
rrc_mac_config_req_gNB(0,0, pdsch_AntennaPorts, n_tx, 0, 6, scc, NULL, NULL, 0, 0, NULL);
|
||||
rrc_mac_config_req_gNB(0, pdsch_AntennaPorts, n_tx, 0, 6, scc, NULL, NULL, 0, 0, NULL);
|
||||
// UE dedicated configuration
|
||||
rrc_mac_config_req_gNB(0,0, pdsch_AntennaPorts, n_tx, 0, 6, scc, NULL, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
|
||||
rrc_mac_config_req_gNB(0, pdsch_AntennaPorts, n_tx, 0, 6, scc, NULL, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
|
||||
// reset preprocessor to the one of DLSIM after it has been set during
|
||||
// rrc_mac_config_req_gNB
|
||||
gNB_mac->pre_processor_dl = nr_dlsim_preprocessor;
|
||||
|
||||
@@ -171,6 +171,7 @@ int main(int argc, char **argv)
|
||||
uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
|
||||
uint16_t Nid_cell=0;
|
||||
uint64_t SSB_positions=0x01;
|
||||
int ssb_subcarrier_offset = 0;
|
||||
|
||||
channel_desc_t *gNB2UE;
|
||||
|
||||
@@ -214,7 +215,7 @@ int main(int argc, char **argv)
|
||||
exit_fun("[NR_PBCHSIM] Error, configuration module init failed\n");
|
||||
}
|
||||
|
||||
while ((c = getopt (argc, argv, "F:g:hIL:m:M:n:N:o:P:r:R:s:S:x:y:z:")) != -1) {
|
||||
while ((c = getopt (argc, argv, "F:g:hIL:m:M:n:N:o:O:P:r:R:s:S:x:y:z:")) != -1) {
|
||||
switch (c) {
|
||||
/*case 'f':
|
||||
write_output_file=1;
|
||||
@@ -312,6 +313,10 @@ int main(int argc, char **argv)
|
||||
Nid_cell = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'O':
|
||||
ssb_subcarrier_offset = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
cfo = atof(optarg);
|
||||
#ifdef DEBUG_NR_PBCHSIM
|
||||
@@ -414,6 +419,7 @@ int main(int argc, char **argv)
|
||||
printf("-n Number of frames to simulate\n");
|
||||
printf("-N Nid_cell\n");
|
||||
printf("-o Carrier frequency offset in Hz\n");
|
||||
printf("-O SSB subcarrier offset\n");
|
||||
//printf("-O oversampling factor (1,2,4,8,16)\n");
|
||||
//printf("-p Use extended prefix mode\n");
|
||||
printf("-P PBCH phase, allowed values 0-3\n");
|
||||
@@ -457,7 +463,7 @@ int main(int argc, char **argv)
|
||||
|
||||
nr_phy_config_request_sim_pbchsim(gNB,N_RB_DL,N_RB_DL,mu,Nid_cell,SSB_positions);
|
||||
phy_init_nr_gNB(gNB,0,1);
|
||||
nr_set_ssb_first_subcarrier(&gNB->gNB_config,frame_parms);
|
||||
frame_parms->ssb_start_subcarrier = 12 * gNB->gNB_config.ssb_table.ssb_offset_point_a.value + ssb_subcarrier_offset;
|
||||
|
||||
uint8_t n_hf = 0;
|
||||
int cyclic_prefix_type = NFAPI_CP_NORMAL;
|
||||
@@ -580,6 +586,7 @@ int main(int argc, char **argv)
|
||||
|
||||
msgDataTx.ssb[i].ssb_pdu.ssb_pdu_rel15.bchPayload = 0x55dd33;
|
||||
msgDataTx.ssb[i].ssb_pdu.ssb_pdu_rel15.SsbBlockIndex = i;
|
||||
msgDataTx.ssb[i].ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset = ssb_subcarrier_offset;
|
||||
|
||||
start_symbol = nr_get_ssb_start_symbol(frame_parms,i);
|
||||
int slot = start_symbol/14;
|
||||
@@ -722,8 +729,8 @@ int main(int argc, char **argv)
|
||||
if (ret<0) n_errors++;
|
||||
}
|
||||
else {
|
||||
UE_nr_rxtx_proc_t proc={0};
|
||||
NR_UE_PDCCH_CONFIG phy_pdcch_config={0};
|
||||
UE_nr_rxtx_proc_t proc={0};
|
||||
NR_UE_PDCCH_CONFIG phy_pdcch_config={0};
|
||||
|
||||
UE->rx_offset=0;
|
||||
uint8_t ssb_index = 0;
|
||||
|
||||
@@ -640,6 +640,7 @@ int main(int argc, char **argv)
|
||||
pucch_pdu.initial_cyclic_shift = 0;
|
||||
pucch_pdu.start_symbol_index = startingSymbolIndex;
|
||||
pucch_pdu.prb_start = startingPRB;
|
||||
pucch_pdu.prb_size = 1;
|
||||
pucch_pdu.bwp_start = 0;
|
||||
pucch_pdu.bwp_size = N_RB_DL;
|
||||
if (nrofSymbols>1) {
|
||||
|
||||
@@ -800,9 +800,9 @@ int main(int argc, char **argv)
|
||||
|
||||
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||
// common configuration
|
||||
rrc_mac_config_req_gNB(0,0, conf.pdsch_AntennaPorts, n_rx, 0, 6, scc, &rrc.carrier.mib, rrc.carrier.siblock1, 0, 0, NULL);
|
||||
rrc_mac_config_req_gNB(0, conf.pdsch_AntennaPorts, n_rx, 0, 6, scc, &rrc.carrier.mib, rrc.carrier.siblock1, 0, 0, NULL);
|
||||
// UE dedicated configuration
|
||||
rrc_mac_config_req_gNB(0,0, conf.pdsch_AntennaPorts, n_rx, 0, 6, scc, &rrc.carrier.mib, rrc.carrier.siblock1, 1,
|
||||
rrc_mac_config_req_gNB(0, conf.pdsch_AntennaPorts, n_rx, 0, 6, scc, &rrc.carrier.mib, rrc.carrier.siblock1, 1,
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity, secondaryCellGroup);
|
||||
frame_parms->nb_antennas_tx = 1;
|
||||
frame_parms->nb_antennas_rx = n_rx;
|
||||
|
||||
@@ -42,7 +42,6 @@ void randominit(unsigned seed_init)
|
||||
{
|
||||
int i;
|
||||
// this need to be integrated with the existing rng, like taus: navid
|
||||
printf("Initializing random number generator, seed %x\n",seed_init);
|
||||
|
||||
if (seed_init == 0) {
|
||||
srand((unsigned)time(NULL));
|
||||
@@ -51,6 +50,7 @@ void randominit(unsigned seed_init)
|
||||
} else {
|
||||
seed = seed_init;
|
||||
}
|
||||
printf("Initializing random number generator, seed %x\n",seed);
|
||||
|
||||
if (seed % 2 == 0) seed += 1; /* seed and mod are relative prime */
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ MESSAGE_DEF(F1AP_DL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_dl_rrc
|
||||
//MESSAGE_DEF(F1AP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_initial_context_setup_req_t , f1ap_initial_context_setup_req )
|
||||
MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_setup_req)
|
||||
MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_RESP, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_setup_resp)
|
||||
MESSAGE_DEF(F1AP_UE_CONTEXT_MODIFICATION_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_modification_req)
|
||||
MESSAGE_DEF(F1AP_UE_CONTEXT_MODIFICATION_RESP, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_modification_resp)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,15 +39,15 @@
|
||||
#define F1AP_INITIAL_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_initial_ul_rrc_message
|
||||
#define F1AP_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ul_rrc_message
|
||||
#define F1AP_UE_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_req
|
||||
#define F1AP_UE_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_resp
|
||||
#define F1AP_UE_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_resp
|
||||
#define F1AP_UE_CONTEXT_RELEASE_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_resp
|
||||
#define F1AP_UE_CONTEXT_MODIFICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_req
|
||||
#define F1AP_UE_CONTEXT_MODIFICATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_resp
|
||||
#define F1AP_UE_CONTEXT_MODIFICATION_FAIL(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_fail
|
||||
|
||||
#define F1AP_DL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_dl_rrc_message
|
||||
#define F1AP_UE_CONTEXT_RELEASE_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_req
|
||||
#define F1AP_UE_CONTEXT_RELEASE_CMD(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_req
|
||||
#define F1AP_UE_CONTEXT_MODIFICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_req
|
||||
|
||||
/* Length of the transport layer address string
|
||||
* 160 bits / 8 bits by char.
|
||||
@@ -345,6 +345,35 @@ typedef struct f1ap_rb_failed_to_be_setup_s {
|
||||
long rb_id;
|
||||
} f1ap_rb_failed_to_be_setup_t;
|
||||
|
||||
typedef struct cu_to_du_rrc_information_s {
|
||||
uint8_t * cG_ConfigInfo;
|
||||
uint32_t cG_ConfigInfo_length;
|
||||
uint8_t * uE_CapabilityRAT_ContainerList;
|
||||
uint32_t uE_CapabilityRAT_ContainerList_length;
|
||||
uint8_t * measConfig;
|
||||
uint32_t measConfig_length;
|
||||
}cu_to_du_rrc_information_t;
|
||||
|
||||
typedef struct du_to_du_rrc_information_s {
|
||||
uint8_t * cellGroupConfig;
|
||||
uint8_t cellGroupConfig_length;
|
||||
uint8_t * measGapConfig;
|
||||
uint8_t measGapConfig_length;
|
||||
uint8_t * requestedP_MaxFR1;
|
||||
uint8_t requestedP_MaxFR1_length;
|
||||
}du_to_cu_rrc_information_t;
|
||||
|
||||
typedef enum QoS_information_e {
|
||||
NG_RAN_QoS = 0,
|
||||
EUTRAN_QoS = 1,
|
||||
} QoS_information_t;
|
||||
|
||||
typedef enum ReconfigurationCompl_e {
|
||||
RRCreconf_info_not_present = 0,
|
||||
RRCreconf_failure = 1,
|
||||
RRCreconf_success = 2,
|
||||
} ReconfigurationCompl_t;
|
||||
|
||||
typedef struct f1ap_ue_context_setup_s {
|
||||
uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
|
||||
uint32_t gNB_DU_ue_id;
|
||||
@@ -357,40 +386,27 @@ typedef struct f1ap_ue_context_setup_s {
|
||||
uint8_t servCellIndex;
|
||||
uint8_t *cellULConfigured;
|
||||
uint32_t servCellId;
|
||||
uint8_t *cu_to_du_rrc_information;
|
||||
cu_to_du_rrc_information_t *cu_to_du_rrc_information;
|
||||
uint8_t cu_to_du_rrc_information_length;
|
||||
uint8_t *du_to_cu_rrc_information;
|
||||
uint8_t du_to_cu_rrc_information_length;
|
||||
f1ap_drb_to_be_setup_t *drbs_to_be_setup; // BK: need to replace by s1ap_initial_context_setup_req
|
||||
uint8_t drbs_to_be_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
|
||||
//uint8_t *du_to_cu_rrc_information;
|
||||
du_to_cu_rrc_information_t *du_to_cu_rrc_information;
|
||||
uint32_t du_to_cu_rrc_information_length;
|
||||
f1ap_drb_to_be_setup_t *drbs_to_be_setup;
|
||||
uint8_t drbs_to_be_setup_length;
|
||||
f1ap_drb_to_be_setup_t *drbs_to_be_modified;
|
||||
uint8_t drbs_to_be_modified_length;
|
||||
QoS_information_t QoS_information_type;
|
||||
uint8_t drbs_failed_to_be_setup_length;
|
||||
f1ap_rb_failed_to_be_setup_t *drbs_failed_to_be_setup;
|
||||
f1ap_srb_to_be_setup_t *srbs_to_be_setup;
|
||||
uint8_t srbs_to_be_setup_length;
|
||||
uint8_t srbs_failed_to_be_setup_length;
|
||||
f1ap_rb_failed_to_be_setup_t *srbs_failed_to_be_setup;
|
||||
s1ap_initial_context_setup_req_t *s1ap_initial_context_setup_req;
|
||||
// coniatner for the rrc_eNB_generate_SecurityModeCommand message
|
||||
ReconfigurationCompl_t ReconfigComplOutcome;
|
||||
uint8_t *rrc_container;
|
||||
int rrc_container_length;
|
||||
} f1ap_ue_context_setup_t;
|
||||
|
||||
typedef struct f1ap_ue_context_setup_resp_s {
|
||||
uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
|
||||
uint32_t gNB_DU_ue_id;
|
||||
uint16_t rnti;
|
||||
uint8_t du_to_cu_rrc_information[1024 /*Arbitrarily big enough*/];
|
||||
uint32_t du_to_cu_rrc_information_length;
|
||||
f1ap_drb_to_be_setup_t *drbs_setup; // BK: need to replace by s1ap_initial_context_setup_req
|
||||
uint8_t drbs_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
|
||||
f1ap_srb_to_be_setup_t *srbs_setup;
|
||||
uint8_t srbs_setup_length;
|
||||
uint8_t srbs_failed_to_be_setup_length;
|
||||
f1ap_rb_failed_to_be_setup_t *srbs_failed_to_be_setup;
|
||||
uint8_t drbs_failed_to_be_setup_length;
|
||||
f1ap_rb_failed_to_be_setup_t *drbs_failed_to_be_setup;
|
||||
} f1ap_ue_context_setup_resp_t;
|
||||
|
||||
typedef enum F1ap_Cause_e {
|
||||
F1AP_CAUSE_NOTHING, /* No components present */
|
||||
F1AP_CAUSE_RADIO_NETWORK,
|
||||
|
||||
@@ -27,4 +27,5 @@ MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end
|
||||
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
|
||||
MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq)
|
||||
|
||||
MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq)
|
||||
MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq)
|
||||
MESSAGE_DEF(GTPV1U_DU_BUFFER_REPORT_REQ, MESSAGE_PRIORITY_MED, gtpv1u_DU_buffer_report_req_t, NRGtpv1uBufferReportReq)
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#define GTPV1U_GNB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uTunnelDataReq
|
||||
|
||||
#define GTPV1U_DU_BUFFER_REPORT_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uBufferReportReq
|
||||
|
||||
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
|
||||
|
||||
typedef struct gtpv1u_enb_create_x2u_tunnel_req_s {
|
||||
@@ -213,4 +215,10 @@ typedef struct gtpv1u_gnb_tunnel_data_req_s {
|
||||
pdusessionid_t pdusession_id;
|
||||
} gtpv1u_gnb_tunnel_data_req_t;
|
||||
|
||||
typedef struct gtpv1u_DU_buffer_report_req_s {
|
||||
uint32_t buffer_availability;
|
||||
rnti_t rnti;
|
||||
pdusessionid_t pdusession_id;
|
||||
} gtpv1u_DU_buffer_report_req_t;
|
||||
|
||||
#endif /* GTPV1_U_MESSAGES_TYPES_H_ */
|
||||
|
||||
@@ -417,7 +417,6 @@ typedef struct NRRrcConfigurationReq_s {
|
||||
uint8_t num_plmn;
|
||||
NR_ServingCellConfigCommon_t *scc;
|
||||
NR_ServingCellConfig_t *scd;
|
||||
int ssb_SubcarrierOffset;
|
||||
int sib1_tda;
|
||||
rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts;
|
||||
int pusch_AntennaPorts;
|
||||
|
||||
@@ -180,6 +180,12 @@ void *F1AP_CU_task(void *arg) {
|
||||
&F1AP_UE_CONTEXT_SETUP_REQ(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_MODIFICATION_REQ:
|
||||
LOG_I(F1AP, "CU Task received F1AP_UE_CONTEXT_MODIFICATION_REQ\n");
|
||||
CU_send_UE_CONTEXT_MODIFICATION_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_UE_CONTEXT_MODIFICATION_REQ(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc
|
||||
LOG_I(F1AP, "CU Task Received F1AP_UE_CONTEXT_RELEASE_CMD\n");
|
||||
CU_send_UE_CONTEXT_RELEASE_COMMAND(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -72,7 +72,8 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
|
||||
/*
|
||||
* UE Context Modification (gNB-CU initiated)
|
||||
*/
|
||||
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance);
|
||||
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
|
||||
f1ap_ue_context_setup_t *f1ap_ue_context_modification_req);
|
||||
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
|
||||
@@ -78,6 +78,10 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) {
|
||||
case F1AP_ProcedureCode_id_UEContextSetup:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__);
|
||||
break;
|
||||
|
||||
case F1AP_ProcedureCode_id_UEContextModification:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextModification\n", __func__);
|
||||
break;
|
||||
|
||||
// case F1AP_ProcedureCode_id_InitialContextSetup:
|
||||
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
@@ -123,6 +127,10 @@ static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu) {
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__);
|
||||
break;
|
||||
|
||||
case F1AP_ProcedureCode_id_UEContextModification:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextModification\n", __func__);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(F1AP,"Unknown procedure ID (%d) for successfull outcome message\n",
|
||||
(int)pdu->choice.successfulOutcome->procedureCode);
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#define ENB_NAME "Eurecom ENB"
|
||||
#define ENB_NAME_FORMAT (ENB_NAME" %u")
|
||||
|
||||
#define F1AP_PORT_NUMBER (30923)
|
||||
#define F1AP_PORT_NUMBER (38472)
|
||||
#define F1AP_SCTP_PPID (62)
|
||||
|
||||
#endif /* F1AP_DEFAULT_VALUES_H_ */
|
||||
|
||||
@@ -172,7 +172,20 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
MCC_MNC_TO_PLMNID(cell->mcc, cell->mnc, cell->mnc_digit_length, &servedPLMN_item->pLMN_Identity);
|
||||
// // /* - CHOICE NR-MODE-Info */
|
||||
F1AP_NR_Mode_Info_t *nR_Mode_Info= &served_cell_information->nR_Mode_Info;
|
||||
F1AP_ProtocolExtensionContainer_154P34_t *p_154P34=calloc(1,sizeof(* p_154P34));
|
||||
servedPLMN_item->iE_Extensions = (struct F1AP_ProtocolExtensionContainer *)p_154P34;
|
||||
asn1cSequenceAdd(p_154P34->list, F1AP_ServedPLMNs_ItemExtIEs_t , served_plmns_itemExtIEs);
|
||||
served_plmns_itemExtIEs->criticality = F1AP_Criticality_ignore;
|
||||
served_plmns_itemExtIEs->id = F1AP_ProtocolIE_ID_id_TAISliceSupportList;
|
||||
served_plmns_itemExtIEs->extensionValue.present = F1AP_ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
|
||||
F1AP_SliceSupportList_t *slice_support_list = &served_plmns_itemExtIEs->extensionValue.choice.SliceSupportList;
|
||||
|
||||
asn1cSequenceAdd(slice_support_list->list, F1AP_SliceSupportItem_t, SliceSupport_item);
|
||||
INT8_TO_OCTET_STRING(1,&SliceSupport_item->sNSSAI.sST);
|
||||
asn1cCalloc(SliceSupport_item->sNSSAI.sD, tmp);
|
||||
INT24_TO_OCTET_STRING(10203,tmp);
|
||||
//INT24_TO_OCTET_STRING(1,tmp);
|
||||
|
||||
if (f1ap_req(false, instance)->fdd_flag) { // FDD
|
||||
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
|
||||
asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
|
||||
|
||||
@@ -810,6 +810,13 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP,
|
||||
sdu2P,
|
||||
sdu2_lenP);
|
||||
}
|
||||
/* mandatory */
|
||||
/* c6. Transaction ID (integer value) */
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_InitialULRRCMessageTransferIEs_t, ie6);
|
||||
ie6->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ie6->criticality = F1AP_Criticality_ignore;
|
||||
ie6->value.present = F1AP_F1SetupRequestIEs__value_PR_TransactionID;
|
||||
ie6->value.choice.TransactionID = F1AP_get_next_transaction_identifier(f1ap_req(false, instanceP)->gNB_DU_id, f1ap_req(false, instanceP)->gNB_DU_id);
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
|
||||
@@ -126,7 +126,7 @@ void *F1AP_DU_task(void *arg) {
|
||||
LOG_I(F1AP, "DU Task Received F1AP_SETUP_REQ\n");
|
||||
f1ap_setup_req_t *msgSetup=&F1AP_SETUP_REQ(msg);
|
||||
createF1inst(false, myInstance, msgSetup);
|
||||
getCxt(DUtype, myInstance)->gtpInst=du_create_gtpu_instance_to_cu(msgSetup->CU_f1_ip_address.ipv4_address,
|
||||
getCxt(DUtype, myInstance)->gtpInst=du_create_gtpu_instance_to_cu(msgSetup->CU_f1_ip_address.ipv4_address, //"172.21.6.9", //"172.21.10.9",//"172.21.9.5", //msgSetup->CU_f1_ip_address.ipv4_address, //"192.168.18.91"
|
||||
msgSetup->CUport,
|
||||
msgSetup->DU_f1_ip_address.ipv4_address,
|
||||
msgSetup->DUport);
|
||||
@@ -175,7 +175,7 @@ void *F1AP_DU_task(void *arg) {
|
||||
break;
|
||||
|
||||
case F1AP_UL_RRC_MESSAGE: // to rrc
|
||||
LOG_I(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
|
||||
LOG_D(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
|
||||
|
||||
if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_DU) {
|
||||
DU_send_UL_NR_RRC_MESSAGE_TRANSFER(myInstance,
|
||||
@@ -191,6 +191,11 @@ void *F1AP_DU_task(void *arg) {
|
||||
DU_send_UE_CONTEXT_SETUP_RESPONSE(myInstance, &F1AP_UE_CONTEXT_SETUP_RESP(msg));
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_MODIFICATION_RESP:
|
||||
LOG_I(F1AP, "DU task received itti message from RRC for F1AP_UE_CONTEXT_MODIFICATION_RESP message generation \n");
|
||||
DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(myInstance, &F1AP_UE_CONTEXT_MODIFICATION_RESP(msg));
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC
|
||||
LOG_I(F1AP, "DU Task Received F1AP_UE_CONTEXT_RELEASE_REQ\n");
|
||||
DU_send_UE_CONTEXT_RELEASE_REQUEST(myInstance,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,7 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance);
|
||||
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_context_setup_t *resp);
|
||||
int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance);
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "f1ap_common.h"
|
||||
#include "f1ap_encoder.h"
|
||||
|
||||
int asn1_encoder_xer_print = 1;
|
||||
int asn1_encoder_xer_print = 0;
|
||||
|
||||
int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) {
|
||||
ssize_t encoded;
|
||||
|
||||
@@ -50,7 +50,7 @@ f1ap_message_processing_t f1ap_messages_processing[][3] = {
|
||||
{ DU_handle_gNB_CU_CONFIGURATION_UPDATE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE }, /* gNBCUConfigurationUpdate */
|
||||
{ DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0 }, /* UEContextSetup */
|
||||
{ DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0 }, /* UEContextRelease */
|
||||
{ 0, 0, 0 }, /* UEContextModification */
|
||||
{ DU_handle_UE_CONTEXT_MODIFICATION_REQUEST, CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE, 0 }, /* UEContextModification */
|
||||
{ 0, 0, 0 }, /* UEContextModificationRequired */
|
||||
{ 0, 0, 0 }, /* UEMobilityCommand */
|
||||
{ CU_handle_UE_CONTEXT_RELEASE_REQUEST, 0, 0 }, /* UEContextReleaseRequest */
|
||||
|
||||
@@ -32,7 +32,7 @@ void f1ap_itti_send_sctp_data_req(bool isCu, instance_t instance, uint8_t *buffe
|
||||
sctp_data_req->buffer = buffer;
|
||||
sctp_data_req->buffer_length = buffer_length;
|
||||
sctp_data_req->stream = stream;
|
||||
LOG_I(F1AP, "Sending ITTI message to SCTP Task\n");
|
||||
LOG_D(F1AP, "Sending ITTI message to SCTP Task\n");
|
||||
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
|
||||
}
|
||||
|
||||
|
||||
@@ -1235,8 +1235,6 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
(NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l] == 3),"BAD MNC DIGIT LENGTH %d",
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l]);
|
||||
}
|
||||
LOG_I(GNB_APP,"SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = *GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr;
|
||||
LOG_I(GNB_APP,"pdsch_AntennaPorts N1 %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts.N1 = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr;
|
||||
LOG_I(GNB_APP,"pdsch_AntennaPorts N2 %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr);
|
||||
@@ -1957,9 +1955,38 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) {
|
||||
f1Setup->measurement_timing_information[k] = "0";
|
||||
f1Setup->ranac[k] = 0;
|
||||
f1Setup->mib[k] = rrc->carrier.MIB;
|
||||
f1Setup->sib1[k] = rrc->carrier.SIB1;
|
||||
f1Setup->mib_length[k] = rrc->carrier.sizeof_MIB;
|
||||
f1Setup->sib1_length[k] = rrc->carrier.sizeof_SIB1;
|
||||
|
||||
NR_BCCH_DL_SCH_Message_t *bcch_message = NULL;
|
||||
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_BCCH_DL_SCH_Message,
|
||||
(void **)&bcch_message,
|
||||
(const void *)rrc->carrier.SIB1,
|
||||
rrc->carrier.sizeof_SIB1);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
LOG_E(RRC,"SIB1 decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_NR_BCCH_DL_SCH_Message, bcch_message, 1 );
|
||||
exit(1);
|
||||
}
|
||||
|
||||
NR_SIB1_t *bcch_SIB1 = bcch_message->message.choice.c1->choice.systemInformationBlockType1;
|
||||
f1Setup->sib1[k] = calloc(1,rrc->carrier.sizeof_SIB1);
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_SIB1,
|
||||
NULL,
|
||||
(void *)bcch_SIB1,
|
||||
f1Setup->sib1[k],
|
||||
NR_MAX_SIB_LENGTH/8);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
|
||||
//if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
LOG_I(NR_RRC, "SIB1 container to be integrated in F1 Setup request:\n");
|
||||
xer_fprint(stdout, &asn_DEF_NR_SIB1,(void *)bcch_message->message.choice.c1->choice.systemInformationBlockType1 );
|
||||
//}
|
||||
f1Setup->sib1_length[k] = (enc_rval.encoded+7)/8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2121,7 +2148,6 @@ void configure_gnb_du_mac(int inst) {
|
||||
// LOG_I(GNB_APP,"Configuring MAC/L1 %d, carrier->sib2 %p\n", inst, &carrier->sib2->radioResourceConfigCommon);
|
||||
LOG_I(GNB_APP,"Configuring gNB DU MAC/L1 %d \n", inst);
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->configuration.ssb_SubcarrierOffset,
|
||||
rrc->configuration.pdsch_AntennaPorts,
|
||||
rrc->configuration.pusch_AntennaPorts,
|
||||
rrc->configuration.sib1_tda,
|
||||
|
||||
@@ -113,7 +113,6 @@ typedef enum {
|
||||
#define GNB_CONFIG_STRING_REMOTE_S_PORTC "remote_s_portc"
|
||||
#define GNB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd"
|
||||
#define GNB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd"
|
||||
#define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N1 "pdsch_AntennaPorts_N1"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N2 "pdsch_AntennaPorts_N2"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS_XP "pdsch_AntennaPorts_XP"
|
||||
@@ -149,7 +148,6 @@ typedef enum {
|
||||
{GNB_CONFIG_STRING_REMOTE_S_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N1, "horiz. log. antenna ports", 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N2, "vert. log. antenna ports", 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_XP, "XP log. antenna ports", 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
@@ -179,20 +177,19 @@ typedef enum {
|
||||
#define GNB_REMOTE_S_PORTC_IDX 11
|
||||
#define GNB_LOCAL_S_PORTD_IDX 12
|
||||
#define GNB_REMOTE_S_PORTD_IDX 13
|
||||
#define GNB_SSB_SUBCARRIEROFFSET_IDX 14
|
||||
#define GNB_PDSCH_ANTENNAPORTS_N1_IDX 15
|
||||
#define GNB_PDSCH_ANTENNAPORTS_N2_IDX 16
|
||||
#define GNB_PDSCH_ANTENNAPORTS_XP_IDX 17
|
||||
#define GNB_PUSCH_ANTENNAPORTS_IDX 18
|
||||
#define GNB_SIB1_TDA_IDX 19
|
||||
#define GNB_DO_CSIRS_IDX 20
|
||||
#define GNB_DO_SRS_IDX 21
|
||||
#define GNB_NRCELLID_IDX 22
|
||||
#define GNB_MINRXTXTIME_IDX 23
|
||||
#define GNB_ULPRBBLACKLIST_IDX 24
|
||||
#define GNB_UMONDEFAULTDRB_IDX 25
|
||||
#define GNB_FORCE256QAMOFF_IDX 26
|
||||
#define GNB_ENABLE_SDAP_IDX 27
|
||||
#define GNB_PDSCH_ANTENNAPORTS_N1_IDX 14
|
||||
#define GNB_PDSCH_ANTENNAPORTS_N2_IDX 15
|
||||
#define GNB_PDSCH_ANTENNAPORTS_XP_IDX 16
|
||||
#define GNB_PUSCH_ANTENNAPORTS_IDX 17
|
||||
#define GNB_SIB1_TDA_IDX 18
|
||||
#define GNB_DO_CSIRS_IDX 19
|
||||
#define GNB_DO_SRS_IDX 20
|
||||
#define GNB_NRCELLID_IDX 21
|
||||
#define GNB_MINRXTXTIME_IDX 22
|
||||
#define GNB_ULPRBBLACKLIST_IDX 23
|
||||
#define GNB_UMONDEFAULTDRB_IDX 24
|
||||
#define GNB_FORCE256QAMOFF_IDX 25
|
||||
#define GNB_ENABLE_SDAP_IDX 26
|
||||
|
||||
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
|
||||
#define GNBPARAMS_CHECK { \
|
||||
|
||||
@@ -343,7 +343,9 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
|
||||
cfg->ssb_table.ssb_offset_point_a = absolute_diff/(12*scs_scaling) - 10;
|
||||
cfg->ssb_table.ssb_period = *scc->ssb_periodicityServingCell;
|
||||
cfg->ssb_table.ssb_subcarrier_offset = mac->ssb_subcarrier_offset;
|
||||
|
||||
// NSA -> take ssb offset from SCS
|
||||
cfg->ssb_table.ssb_subcarrier_offset = absolute_diff%(12*scs_scaling);
|
||||
|
||||
switch (scc->ssb_PositionsInBurst->present) {
|
||||
case 1 :
|
||||
|
||||
Executable → Regular
+1
@@ -24,3 +24,4 @@
|
||||
*/
|
||||
long nr_get_Pcmax(module_id_t mod_id);
|
||||
/** @}*/
|
||||
|
||||
|
||||
@@ -2443,11 +2443,9 @@ int8_t nr_ue_get_SR(module_id_t module_idP, frame_t frameP, slot_t slot){
|
||||
// start the sr-prohibittimer : rel 9 and above
|
||||
if (mac->scheduling_info.sr_ProhibitTimer > 0) { // timer configured
|
||||
mac->scheduling_info.sr_ProhibitTimer--;
|
||||
mac->scheduling_info.
|
||||
sr_ProhibitTimer_Running = 1;
|
||||
mac->scheduling_info.sr_ProhibitTimer_Running = 1;
|
||||
} else {
|
||||
mac->scheduling_info.
|
||||
sr_ProhibitTimer_Running = 0;
|
||||
mac->scheduling_info.sr_ProhibitTimer_Running = 0;
|
||||
}
|
||||
//mac->ul_active =1;
|
||||
return (1); //instruct phy to signal SR
|
||||
|
||||
@@ -160,7 +160,7 @@ void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sche
|
||||
|
||||
}
|
||||
|
||||
void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) {
|
||||
void config_common(int Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) {
|
||||
|
||||
nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[Mod_idP]->config[0];
|
||||
RC.nrmac[Mod_idP]->common_channels[0].ServingCellConfigCommon = scc;
|
||||
@@ -341,26 +341,22 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA > 2016666)
|
||||
scs_scaling = scs_scaling>>2;
|
||||
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
|
||||
uint16_t sco = absolute_diff%(12*scs_scaling);
|
||||
// values of subcarrier offset larger than the limit only indicates CORESET for Type0-PDCCH CSS set is not present
|
||||
int ssb_SubcarrierOffset_limit = 0;
|
||||
int offset_scaling = 0; //15kHz
|
||||
if(frequency_range == FR1) {
|
||||
ssb_SubcarrierOffset_limit = 24;
|
||||
if (ssb_SubcarrierOffset<ssb_SubcarrierOffset_limit)
|
||||
offset_scaling = cfg->ssb_config.scs_common.value;
|
||||
} else
|
||||
ssb_SubcarrierOffset_limit = 12;
|
||||
if (ssb_SubcarrierOffset<ssb_SubcarrierOffset_limit)
|
||||
AssertFatal(sco==(scs_scaling * ssb_SubcarrierOffset),
|
||||
"absoluteFrequencySSB has a subcarrier offset of %d while it should be %d\n",sco/scs_scaling,ssb_SubcarrierOffset);
|
||||
|
||||
RC.nrmac[Mod_idP]->ssb_SubcarrierOffset = absolute_diff%(12*scs_scaling);
|
||||
int sco = 31; // no SIB1
|
||||
if(get_softmodem_params()->sa) {
|
||||
sco = RC.nrmac[Mod_idP]->ssb_SubcarrierOffset;
|
||||
if(frequency_range == FR1)
|
||||
sco <<= cfg->ssb_config.scs_common.value; // 38.211 section 7.4.3.1 in FR1 it is expresses in terms of 15kHz SCS
|
||||
}
|
||||
|
||||
cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling) - 10; //absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total
|
||||
cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->ssb_table.ssb_period.value = *scc->ssb_periodicityServingCell;
|
||||
cfg->ssb_table.ssb_period.tl.tag = NFAPI_NR_CONFIG_SSB_PERIOD_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->ssb_table.ssb_subcarrier_offset.value = ssb_SubcarrierOffset<<offset_scaling;
|
||||
cfg->ssb_table.ssb_subcarrier_offset.value = sco;
|
||||
cfg->ssb_table.ssb_subcarrier_offset.tl.tag = NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
@@ -462,8 +458,7 @@ int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, rnti_t rnti, NR_S
|
||||
return -1;
|
||||
}
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl;
|
||||
const uint16_t sf_ahead = 6/(0x01<<subcarrierSpacing) + ((6%(0x01<<subcarrierSpacing))>0);
|
||||
const uint16_t sl_ahead = sf_ahead * (0x01<<subcarrierSpacing);
|
||||
const uint16_t sl_ahead = RC.nrmac[Mod_idP]->if_inst->sl_ahead;
|
||||
sched_ctrl->rrc_processing_timer = (rrc_reconfiguration_delay<<subcarrierSpacing) + sl_ahead;
|
||||
LOG_I(NR_MAC, "Activating RRC processing timer for UE %04x with %d ms\n", UE_info->rnti, rrc_reconfiguration_delay);
|
||||
|
||||
@@ -471,7 +466,6 @@ int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, rnti_t rnti, NR_S
|
||||
}
|
||||
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts,
|
||||
int pusch_AntennaPorts,
|
||||
int sib1_tda,
|
||||
@@ -486,19 +480,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
if (scc != NULL ) {
|
||||
AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present);
|
||||
|
||||
/* dimension UL_tti_req_ahead for number of slots in frame */
|
||||
const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
|
||||
RC.nrmac[Mod_idP]->UL_tti_req_ahead[0] = calloc(n, sizeof(nfapi_nr_ul_tti_request_t));
|
||||
AssertFatal(RC.nrmac[Mod_idP]->UL_tti_req_ahead[0],
|
||||
"could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n");
|
||||
/* fill in slot/frame numbers: slot is fixed, frame will be updated by scheduler
|
||||
* consider that scheduler runs sl_ahead: the first sl_ahead slots are
|
||||
* already "in the past" and thus we put frame 1 instead of 0! */
|
||||
for (int i = 0; i < n; ++i) {
|
||||
nfapi_nr_ul_tti_request_t *req = &RC.nrmac[Mod_idP]->UL_tti_req_ahead[0][i];
|
||||
req->SFN = i < (RC.nrmac[Mod_idP]->if_inst->sl_ahead-1);
|
||||
req->Slot = i;
|
||||
}
|
||||
RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL =
|
||||
calloc(n * MAX_BWP_SIZE, sizeof(uint16_t));
|
||||
AssertFatal(RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL,
|
||||
@@ -509,7 +491,6 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int num_pdsch_antenna_ports = pdsch_AntennaPorts.N1 * pdsch_AntennaPorts.N2 * pdsch_AntennaPorts.XP;
|
||||
RC.nrmac[Mod_idP]->xp_pdsch_antenna_ports = pdsch_AntennaPorts.XP;
|
||||
config_common(Mod_idP,
|
||||
ssb_SubcarrierOffset,
|
||||
num_pdsch_antenna_ports,
|
||||
pusch_AntennaPorts,
|
||||
scc);
|
||||
@@ -523,7 +504,6 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
printf("Waiting for PHY_config_req\n");
|
||||
}
|
||||
}
|
||||
RC.nrmac[Mod_idP]->ssb_SubcarrierOffset = ssb_SubcarrierOffset;
|
||||
RC.nrmac[Mod_idP]->minRXTXTIMEpdsch = minRXTXTIMEpdsch;
|
||||
|
||||
NR_PHY_Config_t phycfg;
|
||||
|
||||
@@ -68,6 +68,8 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
|
||||
NR_ServingCellConfigCommon_t *scc = gNB->common_channels->ServingCellConfigCommon;
|
||||
const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
|
||||
|
||||
UL_tti_req_ahead_initialization(gNB, scc, num_slots, CC_idP);
|
||||
|
||||
nfapi_nr_dl_tti_request_t *DL_req = &gNB->DL_req[0];
|
||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t **pdcch = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t **)gNB->pdcch_pdu_idx[CC_idP];
|
||||
nfapi_nr_ul_tti_request_t *future_ul_tti_req =
|
||||
|
||||
@@ -3073,3 +3073,20 @@ void schedule_nr_bwp_switch(module_id_t module_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid) {
|
||||
|
||||
if(gNB->UL_tti_req_ahead[CCid]) return;
|
||||
|
||||
gNB->UL_tti_req_ahead[CCid] = calloc(n, sizeof(nfapi_nr_ul_tti_request_t));
|
||||
AssertFatal(gNB->UL_tti_req_ahead[CCid],
|
||||
"could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n");
|
||||
/* fill in slot/frame numbers: slot is fixed, frame will be updated by scheduler
|
||||
* consider that scheduler runs sl_ahead: the first sl_ahead slots are
|
||||
* already "in the past" and thus we put frame 1 instead of 0! */
|
||||
for (int i = 0; i < n; ++i) {
|
||||
nfapi_nr_ul_tti_request_t *req = &gNB->UL_tti_req_ahead[CCid][i];
|
||||
req->SFN = i < (gNB->if_inst->sl_ahead-1);
|
||||
req->Slot = i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1372,7 +1372,7 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot)
|
||||
UE_iterator(nrmac->UE_info.list, UE) {
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
|
||||
|
||||
if (sched_ctrl->ul_failure==1) continue;
|
||||
if (sched_ctrl->ul_failure==1 || sched_ctrl->rrc_processing_timer>0) continue;
|
||||
NR_PUCCH_Config_t *pucch_Config = NULL;
|
||||
if (sched_ctrl->active_ubwp) {
|
||||
pucch_Config = sched_ctrl->active_ubwp->bwp_Dedicated->pucch_Config->choice.setup;
|
||||
@@ -1384,7 +1384,6 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot)
|
||||
UE->CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) {
|
||||
pucch_Config = UE->CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
|
||||
}
|
||||
|
||||
else continue;
|
||||
if (!pucch_Config->schedulingRequestResourceToAddModList)
|
||||
continue;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <openair2/UTIL/OPT/opt.h>
|
||||
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
extern void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl);
|
||||
|
||||
int get_dci_format(NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ void mac_top_init_gNB(void);
|
||||
void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl);
|
||||
|
||||
void config_common(int Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
int pusch_AntennaPorts,
|
||||
NR_ServingCellConfigCommon_t *scc);
|
||||
@@ -52,7 +51,6 @@ int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP,
|
||||
uint32_t rrc_reconfiguration_delay);
|
||||
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts,
|
||||
int pusch_AntennaPorts,
|
||||
int sib1_tda,
|
||||
@@ -418,16 +416,6 @@ int get_ulscs(nfapi_nr_config_request_t *cfg);
|
||||
|
||||
int get_symbolsperslot(nfapi_nr_config_request_t *cfg);
|
||||
|
||||
void config_nr_mib(int Mod_idP,
|
||||
int CC_idP,
|
||||
int p_gNBP,
|
||||
int subCarrierSpacingCommon,
|
||||
uint32_t ssb_SubcarrierOffset,
|
||||
int dmrs_TypeA_Position,
|
||||
uint32_t pdcch_ConfigSIB1,
|
||||
int cellBarred,
|
||||
int intraFreqReselection);
|
||||
|
||||
int nr_write_ce_dlsch_pdu(module_id_t module_idP,
|
||||
const NR_UE_sched_ctrl_t *ue_sched_ctl,
|
||||
unsigned char *mac_pdu,
|
||||
@@ -524,6 +512,8 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options,
|
||||
int max_mcs,
|
||||
frame_t frame);
|
||||
|
||||
void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid);
|
||||
|
||||
void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t frameP, sub_frame_t slotP);
|
||||
|
||||
size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset_rsrp);
|
||||
|
||||
@@ -274,9 +274,8 @@ static void do_pdcp_data_ind(
|
||||
if (rb != NULL) {
|
||||
rb->recv_pdu(rb, (char *)sdu_buffer->data, sdu_buffer_size);
|
||||
} else {
|
||||
LOG_E(PDCP, "%s:%d:%s: fatal: no RB found (rb_id %ld, srb_flag %d)\n",
|
||||
LOG_E(PDCP, "%s:%d:%s: no RB found (rb_id %ld, srb_flag %d)\n",
|
||||
__FILE__, __LINE__, __FUNCTION__, rb_id, srb_flagP);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
|
||||
|
||||
@@ -77,14 +77,15 @@ nr_rlc_entity_t *new_nr_rlc_entity_am(
|
||||
ret->sn_modulus = 1 << ret->sn_field_length;
|
||||
ret->window_size = ret->sn_modulus / 2;
|
||||
|
||||
ret->common.recv_pdu = nr_rlc_entity_am_recv_pdu;
|
||||
ret->common.buffer_status = nr_rlc_entity_am_buffer_status;
|
||||
ret->common.generate_pdu = nr_rlc_entity_am_generate_pdu;
|
||||
ret->common.recv_sdu = nr_rlc_entity_am_recv_sdu;
|
||||
ret->common.set_time = nr_rlc_entity_am_set_time;
|
||||
ret->common.discard_sdu = nr_rlc_entity_am_discard_sdu;
|
||||
ret->common.reestablishment = nr_rlc_entity_am_reestablishment;
|
||||
ret->common.delete = nr_rlc_entity_am_delete;
|
||||
ret->common.recv_pdu = nr_rlc_entity_am_recv_pdu;
|
||||
ret->common.buffer_status = nr_rlc_entity_am_buffer_status;
|
||||
ret->common.generate_pdu = nr_rlc_entity_am_generate_pdu;
|
||||
ret->common.recv_sdu = nr_rlc_entity_am_recv_sdu;
|
||||
ret->common.set_time = nr_rlc_entity_am_set_time;
|
||||
ret->common.discard_sdu = nr_rlc_entity_am_discard_sdu;
|
||||
ret->common.reestablishment = nr_rlc_entity_am_reestablishment;
|
||||
ret->common.delete = nr_rlc_entity_am_delete;
|
||||
ret->common.available_tx_space = nr_rlc_entity_am_available_tx_space;
|
||||
|
||||
ret->common.deliver_sdu = deliver_sdu;
|
||||
ret->common.deliver_sdu_data = deliver_sdu_data;
|
||||
@@ -127,14 +128,15 @@ nr_rlc_entity_t *new_nr_rlc_entity_um(
|
||||
ret->sn_modulus = 1 << ret->sn_field_length;
|
||||
ret->window_size = ret->sn_modulus / 2;
|
||||
|
||||
ret->common.recv_pdu = nr_rlc_entity_um_recv_pdu;
|
||||
ret->common.buffer_status = nr_rlc_entity_um_buffer_status;
|
||||
ret->common.generate_pdu = nr_rlc_entity_um_generate_pdu;
|
||||
ret->common.recv_sdu = nr_rlc_entity_um_recv_sdu;
|
||||
ret->common.set_time = nr_rlc_entity_um_set_time;
|
||||
ret->common.discard_sdu = nr_rlc_entity_um_discard_sdu;
|
||||
ret->common.reestablishment = nr_rlc_entity_um_reestablishment;
|
||||
ret->common.delete = nr_rlc_entity_um_delete;
|
||||
ret->common.recv_pdu = nr_rlc_entity_um_recv_pdu;
|
||||
ret->common.buffer_status = nr_rlc_entity_um_buffer_status;
|
||||
ret->common.generate_pdu = nr_rlc_entity_um_generate_pdu;
|
||||
ret->common.recv_sdu = nr_rlc_entity_um_recv_sdu;
|
||||
ret->common.set_time = nr_rlc_entity_um_set_time;
|
||||
ret->common.discard_sdu = nr_rlc_entity_um_discard_sdu;
|
||||
ret->common.reestablishment = nr_rlc_entity_um_reestablishment;
|
||||
ret->common.delete = nr_rlc_entity_um_delete;
|
||||
ret->common.available_tx_space = nr_rlc_entity_um_available_tx_space;
|
||||
|
||||
ret->common.deliver_sdu = deliver_sdu;
|
||||
ret->common.deliver_sdu_data = deliver_sdu_data;
|
||||
@@ -158,14 +160,15 @@ nr_rlc_entity_t *new_nr_rlc_entity_tm(
|
||||
|
||||
ret->tx_maxsize = tx_maxsize;
|
||||
|
||||
ret->common.recv_pdu = nr_rlc_entity_tm_recv_pdu;
|
||||
ret->common.buffer_status = nr_rlc_entity_tm_buffer_status;
|
||||
ret->common.generate_pdu = nr_rlc_entity_tm_generate_pdu;
|
||||
ret->common.recv_sdu = nr_rlc_entity_tm_recv_sdu;
|
||||
ret->common.set_time = nr_rlc_entity_tm_set_time;
|
||||
ret->common.discard_sdu = nr_rlc_entity_tm_discard_sdu;
|
||||
ret->common.reestablishment = nr_rlc_entity_tm_reestablishment;
|
||||
ret->common.delete = nr_rlc_entity_tm_delete;
|
||||
ret->common.recv_pdu = nr_rlc_entity_tm_recv_pdu;
|
||||
ret->common.buffer_status = nr_rlc_entity_tm_buffer_status;
|
||||
ret->common.generate_pdu = nr_rlc_entity_tm_generate_pdu;
|
||||
ret->common.recv_sdu = nr_rlc_entity_tm_recv_sdu;
|
||||
ret->common.set_time = nr_rlc_entity_tm_set_time;
|
||||
ret->common.discard_sdu = nr_rlc_entity_tm_discard_sdu;
|
||||
ret->common.reestablishment = nr_rlc_entity_tm_reestablishment;
|
||||
ret->common.delete = nr_rlc_entity_tm_delete;
|
||||
ret->common.available_tx_space = nr_rlc_entity_tm_available_tx_space;
|
||||
|
||||
ret->common.deliver_sdu = deliver_sdu;
|
||||
ret->common.deliver_sdu_data = deliver_sdu_data;
|
||||
|
||||
@@ -50,6 +50,8 @@ typedef struct nr_rlc_entity_t {
|
||||
|
||||
void (*delete)(struct nr_rlc_entity_t *entity);
|
||||
|
||||
int (*available_tx_space)(struct nr_rlc_entity_t *entity);
|
||||
|
||||
/* callbacks provided to the RLC module */
|
||||
void (*deliver_sdu)(void *deliver_sdu_data, struct nr_rlc_entity_t *entity,
|
||||
char *buf, int size);
|
||||
|
||||
@@ -1910,3 +1910,9 @@ void nr_rlc_entity_am_delete(nr_rlc_entity_t *_entity)
|
||||
clear_entity(entity);
|
||||
free(entity);
|
||||
}
|
||||
|
||||
int nr_rlc_entity_am_available_tx_space(nr_rlc_entity_t *_entity)
|
||||
{
|
||||
nr_rlc_entity_am_t *entity = (nr_rlc_entity_am_t *)_entity;
|
||||
return entity->tx_maxsize - entity->tx_size;
|
||||
}
|
||||
|
||||
@@ -99,5 +99,6 @@ void nr_rlc_entity_am_set_time(nr_rlc_entity_t *entity, uint64_t now);
|
||||
void nr_rlc_entity_am_discard_sdu(nr_rlc_entity_t *_entity, int sdu_id);
|
||||
void nr_rlc_entity_am_reestablishment(nr_rlc_entity_t *_entity);
|
||||
void nr_rlc_entity_am_delete(nr_rlc_entity_t *entity);
|
||||
int nr_rlc_entity_am_available_tx_space(nr_rlc_entity_t *entity);
|
||||
|
||||
#endif /* _NR_RLC_ENTITY_AM_H_ */
|
||||
|
||||
@@ -174,3 +174,9 @@ void nr_rlc_entity_tm_delete(nr_rlc_entity_t *_entity)
|
||||
clear_entity(entity);
|
||||
free(entity);
|
||||
}
|
||||
|
||||
int nr_rlc_entity_tm_available_tx_space(nr_rlc_entity_t *_entity)
|
||||
{
|
||||
nr_rlc_entity_tm_t *entity = (nr_rlc_entity_tm_t *)_entity;
|
||||
return entity->tx_maxsize - entity->tx_size;
|
||||
}
|
||||
|
||||
@@ -51,5 +51,6 @@ void nr_rlc_entity_tm_set_time(nr_rlc_entity_t *entity, uint64_t now);
|
||||
void nr_rlc_entity_tm_discard_sdu(nr_rlc_entity_t *_entity, int sdu_id);
|
||||
void nr_rlc_entity_tm_reestablishment(nr_rlc_entity_t *_entity);
|
||||
void nr_rlc_entity_tm_delete(nr_rlc_entity_t *entity);
|
||||
int nr_rlc_entity_tm_available_tx_space(nr_rlc_entity_t *entity);
|
||||
|
||||
#endif /* _NR_RLC_ENTITY_TM_H_ */
|
||||
|
||||
@@ -695,3 +695,9 @@ void nr_rlc_entity_um_delete(nr_rlc_entity_t *_entity)
|
||||
clear_entity(entity);
|
||||
free(entity);
|
||||
}
|
||||
|
||||
int nr_rlc_entity_um_available_tx_space(nr_rlc_entity_t *_entity)
|
||||
{
|
||||
nr_rlc_entity_um_t *entity = (nr_rlc_entity_um_t *)_entity;
|
||||
return entity->tx_maxsize - entity->tx_size;
|
||||
}
|
||||
|
||||
@@ -75,5 +75,6 @@ void nr_rlc_entity_um_set_time(nr_rlc_entity_t *entity, uint64_t now);
|
||||
void nr_rlc_entity_um_discard_sdu(nr_rlc_entity_t *_entity, int sdu_id);
|
||||
void nr_rlc_entity_um_reestablishment(nr_rlc_entity_t *_entity);
|
||||
void nr_rlc_entity_um_delete(nr_rlc_entity_t *entity);
|
||||
int nr_rlc_entity_um_available_tx_space(nr_rlc_entity_t *entity);
|
||||
|
||||
#endif /* _NR_RLC_ENTITY_UM_H_ */
|
||||
|
||||
@@ -101,6 +101,7 @@ void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config
|
||||
switch (rlc_config_pr){
|
||||
case NR_RLC_Config_PR_um_Bi_Directional:
|
||||
// RLC UM Bi-directional Bearer configuration
|
||||
LOG_I(RLC, "RLC UM Bi-directional Bearer configuration selected \n");
|
||||
rlc_Config->choice.um_Bi_Directional = calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional));
|
||||
rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength));
|
||||
*rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = NR_SN_FieldLengthUM_size12;
|
||||
@@ -213,10 +214,12 @@ tbs_size_t mac_rlc_data_req(
|
||||
}
|
||||
|
||||
if (rb != NULL) {
|
||||
LOG_D(RLC, "MAC PDU to get created for channel_idP:%d \n", channel_idP);
|
||||
rb->set_time(rb, nr_rlc_current_time);
|
||||
maxsize = tb_sizeP;
|
||||
ret = rb->generate_pdu(rb, buffer_pP, maxsize);
|
||||
} else {
|
||||
LOG_D(RLC, "MAC PDU failed to get created for channel_idP:%d \n", channel_idP);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
@@ -394,6 +397,35 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
|
||||
return RLC_OP_STATUS_OK;
|
||||
}
|
||||
|
||||
int nr_rlc_get_available_tx_space(
|
||||
const rnti_t rntiP,
|
||||
const logical_chan_id_t channel_idP)
|
||||
{
|
||||
nr_rlc_ue_t *ue;
|
||||
nr_rlc_entity_t *rb;
|
||||
int ret;
|
||||
|
||||
nr_rlc_manager_lock(nr_rlc_ue_manager);
|
||||
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP);
|
||||
|
||||
switch (channel_idP) {
|
||||
case 1 ... 3: rb = ue->srb[channel_idP - 1]; break;
|
||||
case 4 ... 8: rb = ue->drb[channel_idP - 4]; break;
|
||||
default: rb = NULL; break;
|
||||
}
|
||||
|
||||
if (rb != NULL) {
|
||||
ret = rb->available_tx_space(rb);
|
||||
} else {
|
||||
LOG_E(RLC, "[%s] Radio Bearer (channel ID %d) is NULL for UE with rntiP %x\n", __FUNCTION__, channel_idP, rntiP);
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
nr_rlc_manager_unlock(nr_rlc_ue_manager);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rlc_module_init(int enb_flag)
|
||||
{
|
||||
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
@@ -46,4 +46,8 @@ void nr_rlc_bearer_init(NR_RLC_BearerConfig_t *RLC_BearerConfig, NR_RLC_BearerCo
|
||||
|
||||
void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config_pr);
|
||||
|
||||
void nr_rlc_bearer_init_ul_spec(struct NR_LogicalChannelConfig *mac_LogicalChannelConfig);
|
||||
void nr_rlc_bearer_init_ul_spec(struct NR_LogicalChannelConfig *mac_LogicalChannelConfig);
|
||||
|
||||
int nr_rlc_get_available_tx_space(
|
||||
const rnti_t rntiP,
|
||||
const logical_chan_id_t channel_idP);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1065,3 +1065,15 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
sdu_sizeP,
|
||||
sdu_pP, NULL, NULL);
|
||||
}
|
||||
|
||||
/* HACK to be removed: nr_rlc_get_available_tx_space is needed by
|
||||
* openair3/ocp-gtpu/gtp_itf.cpp which is compiled in lte-softmodem
|
||||
* so let's put a dummy nr_rlc_get_available_tx_space here
|
||||
*/
|
||||
int nr_rlc_get_available_tx_space(
|
||||
const rnti_t rntiP,
|
||||
const logical_chan_id_t channel_idP)
|
||||
{
|
||||
abort();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,8 @@ int nas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
|
||||
// End debug information
|
||||
netif_stop_queue(dev);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE>=1796)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
|
||||
|| (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796 && RHEL_RELEASE_CODE != 2403)
|
||||
netif_trans_update(dev);
|
||||
#else
|
||||
dev->trans_start = jiffies;
|
||||
@@ -267,7 +268,8 @@ void nas_tx_timeout(struct net_device *dev)
|
||||
printk("TX_TIMEOUT: begin\n");
|
||||
// (struct nas_priv *)(dev->priv)->stats.tx_errors++;
|
||||
(priv->stats).tx_errors++;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE>=1796)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
|
||||
|| (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796 && RHEL_RELEASE_CODE != 2403)
|
||||
netif_trans_update(dev);
|
||||
#else
|
||||
dev->trans_start = jiffies;
|
||||
@@ -285,7 +287,8 @@ static const struct net_device_ops nasmesh_netdev_ops = {
|
||||
.ndo_set_mac_address = NULL,
|
||||
.ndo_set_config = nas_set_config,
|
||||
.ndo_do_ioctl = nas_CTL_ioctl,
|
||||
#if (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE>=1797 && LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0))
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0) \
|
||||
|| (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1797 && RHEL_RELEASE_CODE != 2403)
|
||||
.extended.ndo_change_mtu = nas_change_mtu,
|
||||
#else
|
||||
.ndo_change_mtu = nas_change_mtu,
|
||||
|
||||
@@ -239,7 +239,8 @@ int ue_ip_hard_start_xmit(struct sk_buff *skb_pP, struct net_device *dev_pP) {
|
||||
|
||||
// End debug information
|
||||
netif_stop_queue(dev_pP);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
|
||||
|| (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796 && RHEL_RELEASE_CODE != 2403)
|
||||
netif_trans_update(dev_pP);
|
||||
#else
|
||||
dev_pP->trans_start = jiffies;
|
||||
@@ -315,7 +316,8 @@ void ue_ip_tx_timeout(struct net_device *dev_pP)
|
||||
printk("[UE_IP_DRV][%s] begin\n", __FUNCTION__);
|
||||
// (ue_ip_priv_t *)(dev_pP->priv_p)->stats.tx_errors++;
|
||||
(priv_p->stats).tx_errors++;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
|
||||
|| (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796 && RHEL_RELEASE_CODE != 2403)
|
||||
netif_trans_update(dev_pP);
|
||||
#else
|
||||
dev_pP->trans_start = jiffies;
|
||||
@@ -333,7 +335,7 @@ static const struct net_device_ops ue_ip_netdev_ops = {
|
||||
.ndo_set_mac_address = ue_ip_set_mac_address,
|
||||
.ndo_set_config = ue_ip_set_config,
|
||||
.ndo_do_ioctl = NULL,
|
||||
#if (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1797)
|
||||
#if defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1797 && RHEL_RELEASE_CODE != 2403
|
||||
.extended.ndo_change_mtu = ue_ip_change_mtu,
|
||||
#else
|
||||
.ndo_change_mtu = ue_ip_change_mtu,
|
||||
|
||||
@@ -66,17 +66,6 @@ queue_t nr_tx_req_queue;
|
||||
queue_t nr_ul_dci_req_queue;
|
||||
queue_t nr_ul_tti_req_queue;
|
||||
|
||||
static slot_rnti_mcs_s slot_rnti_mcs[NUM_NFAPI_SLOT];
|
||||
|
||||
//static int get_mcs_from_sinr(float sinr);
|
||||
//static int get_cqi_from_mcs(void);
|
||||
static void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, int sf, int index);
|
||||
//static bool did_drop_transport_block(int slot, uint16_t rnti);
|
||||
static float get_bler_val(uint8_t mcs, int sinr);
|
||||
static bool should_drop_transport_block(int slot, uint16_t rnti);
|
||||
static void save_pdsch_pdu_for_crnti(nfapi_nr_dl_tti_request_t *dl_tti_request);
|
||||
static inline bool is_channel_modeling(void);
|
||||
|
||||
void nrue_init_standalone_socket(int tx_port, int rx_port)
|
||||
{
|
||||
{
|
||||
@@ -939,7 +928,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea
|
||||
return;
|
||||
}
|
||||
|
||||
static void save_pdsch_pdu_for_crnti(nfapi_nr_dl_tti_request_t *dl_tti_request)
|
||||
void save_pdsch_pdu_for_crnti(nfapi_nr_dl_tti_request_t *dl_tti_request)
|
||||
{
|
||||
int count_sent = 0;
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
@@ -1353,245 +1342,3 @@ void RCconfig_nr_ue_L1(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
static int get_mcs_from_sinr(float sinr)
|
||||
{
|
||||
if (sinr < (nr_bler_data[0].bler_table[0][0]))
|
||||
{
|
||||
LOG_D(NR_MAC, "The SINR found is smaller than first MCS table\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sinr > (nr_bler_data[NR_NUM_MCS-1].bler_table[nr_bler_data[NR_NUM_MCS-1].length - 1][0]))
|
||||
{
|
||||
LOG_D(NR_MAC, "The SINR found is larger than last MCS table\n");
|
||||
return NR_NUM_MCS-1;
|
||||
}
|
||||
|
||||
for (int n = NR_NUM_MCS-1; n >= 0; n--)
|
||||
{
|
||||
CHECK_INDEX(nr_bler_data, n);
|
||||
float largest_sinr = (nr_bler_data[n].bler_table[nr_bler_data[n].length - 1][0]);
|
||||
float smallest_sinr = (nr_bler_data[n].bler_table[0][0]);
|
||||
if (sinr < largest_sinr && sinr > smallest_sinr)
|
||||
{
|
||||
LOG_D(NR_MAC, "The SINR found in MCS %d table\n", n);
|
||||
return n;
|
||||
}
|
||||
}
|
||||
LOG_E(NR_MAC, "Unable to get an MCS value.\n");
|
||||
abort();
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
static int get_cqi_from_mcs(void)
|
||||
{
|
||||
static const int mcs_to_cqi[] = {0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8,
|
||||
9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15};
|
||||
assert(NUM_ELEMENTS(mcs_to_cqi) == NR_NUM_MCS);
|
||||
int slot = 0;
|
||||
while (slot < NUM_NFAPI_SLOT)
|
||||
{
|
||||
if (slot_rnti_mcs[slot].latest)
|
||||
{
|
||||
int num_pdus = slot_rnti_mcs[slot].num_pdus;
|
||||
if (num_pdus <= 0)
|
||||
{
|
||||
LOG_E(NR_MAC, "%s: slot_rnti_mcs[%d].num_pdus = 0\n", __FUNCTION__, slot);
|
||||
abort();
|
||||
}
|
||||
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].mcs, num_pdus);
|
||||
int mcs = get_mcs_from_sinr(slot_rnti_mcs[slot].sinr);
|
||||
CHECK_INDEX(mcs_to_cqi, mcs);
|
||||
int cqi = mcs_to_cqi[mcs];
|
||||
LOG_D(NR_MAC, "SINR: %f -> MCS: %d -> CQI: %d\n", slot_rnti_mcs[slot].sinr, mcs, cqi);
|
||||
return cqi;
|
||||
}
|
||||
slot++;
|
||||
}
|
||||
LOG_E(NR_MAC, "Unable to get CQI value because no MCS found\n");
|
||||
abort();
|
||||
}
|
||||
*/
|
||||
|
||||
static void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, int slot, int index)
|
||||
{
|
||||
if (pdu == NULL)
|
||||
{
|
||||
LOG_E(NR_MAC,"PDU NULL\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
/* This function is executed for every pdsch pdu type in a dl_tti_request. We save
|
||||
the assocaited MCS and RNTI value for each. The 'index' passed in is a count of
|
||||
how many times we have called this function for a particular dl_tti_request. It
|
||||
allows us to save MCS/RNTI data in correct indicies when multiple pdsch pdu's are received.*/
|
||||
for (int i = 0; i < NUM_NFAPI_SLOT; i++)
|
||||
{
|
||||
slot_rnti_mcs[i].latest = false;
|
||||
}
|
||||
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].rnti, index);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].mcs, index);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].drop_flag, index);
|
||||
slot_rnti_mcs[slot].rnti[index] = pdu->rnti;
|
||||
slot_rnti_mcs[slot].mcs[index] = pdu->mcsIndex[0];
|
||||
slot_rnti_mcs[slot].rvIndex[index] = pdu->rvIndex[0];
|
||||
slot_rnti_mcs[slot].drop_flag[index] = false;
|
||||
slot_rnti_mcs[slot].num_pdus = index+1; //index starts at 0 so we incrament to get num of pdus
|
||||
slot_rnti_mcs[slot].latest = true;
|
||||
LOG_D(NR_MAC, "Adding MCS %d and RNTI %x for slot_rnti_mcs[%d]\n", slot_rnti_mcs[slot].mcs[index], slot_rnti_mcs[slot].rnti[index], slot);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
static bool did_drop_transport_block(int slot, uint16_t rnti)
|
||||
{
|
||||
int num_pdus = slot_rnti_mcs[slot].num_pdus;
|
||||
if (num_pdus <= 0)
|
||||
{
|
||||
LOG_E(MAC, "Problem, the PDU size is <= 0. We dropped this packet\n");
|
||||
return true;
|
||||
}
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].rnti, num_pdus);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].drop_flag, num_pdus);
|
||||
for (int n = 0; n < num_pdus; n++)
|
||||
{
|
||||
if (slot_rnti_mcs[slot].rnti[n] == rnti && slot_rnti_mcs[slot].drop_flag[n])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
static float get_bler_val(uint8_t mcs, int sinr)
|
||||
{
|
||||
// 4th col = dropped packets, 5th col = total packets
|
||||
float bler_val = 0.0;
|
||||
CHECK_INDEX(nr_bler_data, mcs);
|
||||
LOG_D(NR_MAC, "sinr %d min %d max %d\n", sinr,
|
||||
(int)(nr_bler_data[mcs].bler_table[0][0] * 10),
|
||||
(int)(nr_bler_data[mcs].bler_table[nr_bler_data[mcs].length - 1][0] * 10)
|
||||
);
|
||||
|
||||
if (sinr < (int)(nr_bler_data[mcs].bler_table[0][0] * 10))
|
||||
{
|
||||
LOG_D(NR_MAC, "MCS %d table. SINR is smaller than lowest SINR, bler_val is set based on lowest SINR in table\n", mcs);
|
||||
bler_val = nr_bler_data[mcs].bler_table[0][4] / nr_bler_data[mcs].bler_table[0][5];
|
||||
return bler_val;
|
||||
}
|
||||
if (sinr > (int)(nr_bler_data[mcs].bler_table[nr_bler_data[mcs].length - 1][0] * 10))
|
||||
{
|
||||
LOG_D(NR_MAC, "MCS %d table. SINR is greater than largest SINR. bler_val is set based on largest SINR in table\n", mcs);
|
||||
bler_val = nr_bler_data[mcs].bler_table[(nr_bler_data[mcs].length - 1)][4] / nr_bler_data[mcs].bler_table[(nr_bler_data[mcs].length - 1)][5];
|
||||
return bler_val;
|
||||
}
|
||||
// Loop through bler table to find sinr_index
|
||||
for (int i = 0; i < nr_bler_data[mcs].length; i++)
|
||||
{
|
||||
int temp_sinr = (int)(nr_bler_data[mcs].bler_table[i][0] * 10);
|
||||
if (temp_sinr == sinr)
|
||||
{
|
||||
bler_val = nr_bler_data[mcs].bler_table[i][4] / nr_bler_data[mcs].bler_table[i][5];
|
||||
return bler_val;
|
||||
}
|
||||
// Linear interpolation when SINR is between indices
|
||||
if (temp_sinr > sinr)
|
||||
{
|
||||
float bler_val1 = nr_bler_data[mcs].bler_table[i - 1][4] / nr_bler_data[mcs].bler_table[i - 1][5];
|
||||
float bler_val2 = nr_bler_data[mcs].bler_table[i][4] / nr_bler_data[mcs].bler_table[i][5];
|
||||
LOG_D(NR_MAC, "sinr %d min %f max %f\n", sinr, bler_val1, bler_val2);
|
||||
return ((bler_val1 + bler_val2) / 2);
|
||||
}
|
||||
}
|
||||
LOG_E(NR_MAC, "NO SINR INDEX FOUND!\n");
|
||||
abort();
|
||||
|
||||
}
|
||||
|
||||
static inline bool is_channel_modeling(void)
|
||||
{
|
||||
/* TODO: For now we enable channel modeling based on the node_number.
|
||||
Replace with a command line option to enable/disable channel modeling.
|
||||
The LTE UE will crash when channel modeling is conducted for NSA
|
||||
mode. It does not crash for LTE mode. We have not implemented channel
|
||||
modeling for NSA mode yet. For now, we ensure only do do channel modeling
|
||||
in LTE/NR mode. */
|
||||
return get_softmodem_params()->node_number == 0 && !get_softmodem_params()->nsa;
|
||||
}
|
||||
|
||||
static bool should_drop_transport_block(int slot, uint16_t rnti)
|
||||
{
|
||||
if (!is_channel_modeling())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* We want to avoid dropping setup messages because this would be pathological. */
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
if (mac->ra.ra_state < RA_SUCCEEDED)
|
||||
{
|
||||
LOG_D(NR_MAC, "Not dropping because MAC state: %d", mac->ra.ra_state);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Get block error rate (bler_val) from table based on every saved
|
||||
MCS and SINR to be used as the cutoff rate for dropping packets.
|
||||
Generate random uniform vairable to compare against bler_val. */
|
||||
int num_pdus = slot_rnti_mcs[slot].num_pdus;
|
||||
assert(slot < 20 && slot >= 0);
|
||||
LOG_D(NR_MAC, "rnti: %x num_pdus %d state %d slot %u sinr %f\n",
|
||||
rnti, num_pdus, mac->ra.ra_state, slot, slot_rnti_mcs[slot].sinr);
|
||||
assert(num_pdus > 0);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].rnti, num_pdus);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].mcs, num_pdus);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].drop_flag, num_pdus);
|
||||
int n = 0;
|
||||
uint8_t mcs = 99;
|
||||
for (n = 0; n < num_pdus; n++)
|
||||
{
|
||||
if (slot_rnti_mcs[slot].rnti[n] == rnti)
|
||||
{
|
||||
mcs = slot_rnti_mcs[slot].mcs[n];
|
||||
}
|
||||
if (mcs != 99)
|
||||
{
|
||||
/* Use MCS to get the bler value. Since there can be multiple MCS
|
||||
values for a particular slot, we verify that all PDUs are not
|
||||
flagged for drop before returning. If even one is flagged for drop
|
||||
we return immediately because we drop the entire packet. */
|
||||
|
||||
LOG_D(NR_MAC, "rnti: %x mcs %u slot %u sinr %f\n",
|
||||
slot_rnti_mcs[slot].rnti[n], mcs, slot, slot_rnti_mcs[slot].sinr);
|
||||
|
||||
float bler_val;
|
||||
if (slot_rnti_mcs[slot].rvIndex[n] != 0)
|
||||
bler_val = 0;
|
||||
else
|
||||
bler_val = get_bler_val(mcs, ((int)(slot_rnti_mcs[slot].sinr * 10)));
|
||||
double drop_cutoff = ((double) rand() / (RAND_MAX));
|
||||
assert(drop_cutoff <= 1);
|
||||
LOG_D(NR_MAC, "SINR = %f, Bler_val = %f, MCS = %"PRIu8"\n", slot_rnti_mcs[slot].sinr, bler_val, slot_rnti_mcs[slot].mcs[n]);
|
||||
if (drop_cutoff <= bler_val)
|
||||
{
|
||||
slot_rnti_mcs[slot].drop_flag[n] = true;
|
||||
LOG_T(NR_MAC, "We are dropping this packet. Bler_val = %f, MCS = %"PRIu8", slot = %d\n", bler_val, slot_rnti_mcs[slot].mcs[n], slot);
|
||||
return slot_rnti_mcs[slot].drop_flag[n];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (mcs == 99)
|
||||
{
|
||||
LOG_E(NR_MAC, "NO MCS Found for rnti %x. slot_rnti_mcs[%d].mcs[%d] \n", rnti, slot, n);
|
||||
abort();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -40,45 +40,12 @@
|
||||
#include "openair2/PHY_INTERFACE/queue_t.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
#include "NR_Packet_Drop.h"
|
||||
|
||||
#define NR_NUM_MCS 29
|
||||
#define NUM_SINR 100
|
||||
#define NUM_BLER_COL 13
|
||||
#define NUM_NFAPI_SLOT 20
|
||||
#define NR_NUM_LAYER 1
|
||||
extern slot_rnti_mcs_s slot_rnti_mcs[NUM_NFAPI_SLOT];
|
||||
|
||||
typedef struct NR_UL_TIME_ALIGNMENT NR_UL_TIME_ALIGNMENT_t;
|
||||
|
||||
typedef struct nr_phy_channel_params_t
|
||||
{
|
||||
uint16_t sfn_slot;
|
||||
uint16_t message_id;
|
||||
uint16_t nb_of_sinrs;
|
||||
float sinr[NR_NUM_LAYER];
|
||||
// Incomplete, need all channel parameters
|
||||
} nr_phy_channel_params_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t slot;
|
||||
uint16_t rnti[256];
|
||||
uint8_t mcs[256];
|
||||
uint8_t rvIndex[256];
|
||||
float sinr;
|
||||
uint16_t num_pdus;
|
||||
bool drop_flag[256];
|
||||
bool latest;
|
||||
|
||||
} slot_rnti_mcs_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t length;
|
||||
float bler_table[NUM_SINR][NUM_BLER_COL];
|
||||
} nr_bler_struct;
|
||||
|
||||
extern nr_bler_struct nr_bler_data[NR_NUM_MCS];
|
||||
|
||||
typedef enum {
|
||||
ONLY_PUSCH,
|
||||
NOT_PUSCH,
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "openair2/NR_UE_PHY_INTERFACE/NR_Packet_Drop.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
|
||||
slot_rnti_mcs_s slot_rnti_mcs[NUM_NFAPI_SLOT];
|
||||
void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, int slot, int index)
|
||||
{
|
||||
if (pdu == NULL)
|
||||
{
|
||||
LOG_E(NR_MAC,"PDU NULL\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
/* This function is executed for every pdsch pdu type in a dl_tti_request. We save
|
||||
the assocaited MCS and RNTI value for each. The 'index' passed in is a count of
|
||||
how many times we have called this function for a particular dl_tti_request. It
|
||||
allows us to save MCS/RNTI data in correct indicies when multiple pdsch pdu's are received.*/
|
||||
for (int i = 0; i < NUM_NFAPI_SLOT; i++)
|
||||
{
|
||||
slot_rnti_mcs[i].latest = false;
|
||||
}
|
||||
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].rnti, index);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].mcs, index);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].drop_flag, index);
|
||||
slot_rnti_mcs[slot].rnti[index] = pdu->rnti;
|
||||
slot_rnti_mcs[slot].mcs[index] = pdu->mcsIndex[0];
|
||||
slot_rnti_mcs[slot].rvIndex[index] = pdu->rvIndex[0];
|
||||
slot_rnti_mcs[slot].drop_flag[index] = false;
|
||||
slot_rnti_mcs[slot].num_pdus = index+1; //index starts at 0 so we incrament to get num of pdus
|
||||
slot_rnti_mcs[slot].latest = true;
|
||||
LOG_D(NR_MAC, "Adding MCS %d and RNTI %x for slot_rnti_mcs[%d]\n", slot_rnti_mcs[slot].mcs[index], slot_rnti_mcs[slot].rnti[index], slot);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
extern nr_bler_struct nr_bler_data[NR_NUM_MCS];
|
||||
float get_bler_val(uint8_t mcs, int sinr)
|
||||
{
|
||||
// 4th col = dropped packets, 5th col = total packets
|
||||
float bler_val = 0.0;
|
||||
CHECK_INDEX(nr_bler_data, mcs);
|
||||
LOG_D(NR_MAC, "sinr %d min %d max %d\n", sinr,
|
||||
(int)(nr_bler_data[mcs].bler_table[0][0] * 10),
|
||||
(int)(nr_bler_data[mcs].bler_table[nr_bler_data[mcs].length - 1][0] * 10)
|
||||
);
|
||||
|
||||
if (sinr < (int)(nr_bler_data[mcs].bler_table[0][0] * 10))
|
||||
{
|
||||
LOG_D(NR_MAC, "MCS %d table. SINR is smaller than lowest SINR, bler_val is set based on lowest SINR in table\n", mcs);
|
||||
bler_val = nr_bler_data[mcs].bler_table[0][4] / nr_bler_data[mcs].bler_table[0][5];
|
||||
return bler_val;
|
||||
}
|
||||
if (sinr > (int)(nr_bler_data[mcs].bler_table[nr_bler_data[mcs].length - 1][0] * 10))
|
||||
{
|
||||
LOG_D(NR_MAC, "MCS %d table. SINR is greater than largest SINR. bler_val is set based on largest SINR in table\n", mcs);
|
||||
bler_val = nr_bler_data[mcs].bler_table[(nr_bler_data[mcs].length - 1)][4] / nr_bler_data[mcs].bler_table[(nr_bler_data[mcs].length - 1)][5];
|
||||
return bler_val;
|
||||
}
|
||||
// Loop through bler table to find sinr_index
|
||||
for (int i = 0; i < nr_bler_data[mcs].length; i++)
|
||||
{
|
||||
int temp_sinr = (int)(nr_bler_data[mcs].bler_table[i][0] * 10);
|
||||
if (temp_sinr == sinr)
|
||||
{
|
||||
bler_val = nr_bler_data[mcs].bler_table[i][4] / nr_bler_data[mcs].bler_table[i][5];
|
||||
return bler_val;
|
||||
}
|
||||
// Linear interpolation when SINR is between indices
|
||||
if (temp_sinr > sinr)
|
||||
{
|
||||
float bler_val1 = nr_bler_data[mcs].bler_table[i - 1][4] / nr_bler_data[mcs].bler_table[i - 1][5];
|
||||
float bler_val2 = nr_bler_data[mcs].bler_table[i][4] / nr_bler_data[mcs].bler_table[i][5];
|
||||
LOG_D(NR_MAC, "sinr %d min %f max %f\n", sinr, bler_val1, bler_val2);
|
||||
return ((bler_val1 + bler_val2) / 2);
|
||||
}
|
||||
}
|
||||
LOG_E(NR_MAC, "NO SINR INDEX FOUND!\n");
|
||||
abort();
|
||||
|
||||
}
|
||||
|
||||
bool is_channel_modeling(void)
|
||||
{
|
||||
/* TODO: For now we enable channel modeling based on the node_number.
|
||||
Replace with a command line option to enable/disable channel modeling.
|
||||
The LTE UE will crash when channel modeling is conducted for NSA
|
||||
mode. It does not crash for LTE mode. We have not implemented channel
|
||||
modeling for NSA mode yet. For now, we ensure only do do channel modeling
|
||||
in LTE/NR mode. */
|
||||
return get_softmodem_params()->node_number == 0 && !get_softmodem_params()->nsa;
|
||||
}
|
||||
|
||||
bool should_drop_transport_block(int slot, uint16_t rnti)
|
||||
{
|
||||
if (!is_channel_modeling())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* We want to avoid dropping setup messages because this would be pathological. */
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
if (mac->ra.ra_state < RA_SUCCEEDED)
|
||||
{
|
||||
LOG_D(NR_MAC, "Not dropping because MAC state: %d", mac->ra.ra_state);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Get block error rate (bler_val) from table based on every saved
|
||||
MCS and SINR to be used as the cutoff rate for dropping packets.
|
||||
Generate random uniform vairable to compare against bler_val. */
|
||||
int num_pdus = slot_rnti_mcs[slot].num_pdus;
|
||||
assert(slot < 20 && slot >= 0);
|
||||
LOG_D(NR_MAC, "rnti: %x num_pdus %d state %d slot %u sinr %f\n",
|
||||
rnti, num_pdus, mac->ra.ra_state, slot, slot_rnti_mcs[slot].sinr);
|
||||
assert(num_pdus > 0);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].rnti, num_pdus);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].mcs, num_pdus);
|
||||
CHECK_INDEX(slot_rnti_mcs[slot].drop_flag, num_pdus);
|
||||
int n = 0;
|
||||
uint8_t mcs = 99;
|
||||
for (n = 0; n < num_pdus; n++)
|
||||
{
|
||||
if (slot_rnti_mcs[slot].rnti[n] == rnti)
|
||||
{
|
||||
mcs = slot_rnti_mcs[slot].mcs[n];
|
||||
}
|
||||
if (mcs != 99)
|
||||
{
|
||||
/* Use MCS to get the bler value. Since there can be multiple MCS
|
||||
values for a particular slot, we verify that all PDUs are not
|
||||
flagged for drop before returning. If even one is flagged for drop
|
||||
we return immediately because we drop the entire packet. */
|
||||
|
||||
LOG_D(NR_MAC, "rnti: %x mcs %u slot %u sinr %f\n",
|
||||
slot_rnti_mcs[slot].rnti[n], mcs, slot, slot_rnti_mcs[slot].sinr);
|
||||
|
||||
float bler_val;
|
||||
if (slot_rnti_mcs[slot].rvIndex[n] != 0)
|
||||
bler_val = 0;
|
||||
else
|
||||
bler_val = get_bler_val(mcs, ((int)(slot_rnti_mcs[slot].sinr * 10)));
|
||||
double drop_cutoff = ((double) rand() / (RAND_MAX));
|
||||
assert(drop_cutoff <= 1);
|
||||
LOG_D(NR_MAC, "SINR = %f, Bler_val = %f, MCS = %"PRIu8"\n", slot_rnti_mcs[slot].sinr, bler_val, slot_rnti_mcs[slot].mcs[n]);
|
||||
if (drop_cutoff <= bler_val)
|
||||
{
|
||||
slot_rnti_mcs[slot].drop_flag[n] = true;
|
||||
LOG_T(NR_MAC, "We are dropping this packet. Bler_val = %f, MCS = %"PRIu8", slot = %d\n", bler_val, slot_rnti_mcs[slot].mcs[n], slot);
|
||||
return slot_rnti_mcs[slot].drop_flag[n];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (mcs == 99)
|
||||
{
|
||||
LOG_E(NR_MAC, "NO MCS Found for rnti %x. slot_rnti_mcs[%d].mcs[%d] \n", rnti, slot, n);
|
||||
abort();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#ifndef __NR_CHAN_MODEL_H__
|
||||
#define __NR_CHAN_MODEL_H__
|
||||
|
||||
#include <platform_types.h>
|
||||
#include <nfapi_nr_interface_scf.h>
|
||||
#include <openair1/PHY/thread_NR_UE.h>
|
||||
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
|
||||
#define NR_NUM_MCS 29
|
||||
#define NUM_SINR 100
|
||||
#define NUM_BLER_COL 13
|
||||
#define NUM_NFAPI_SLOT 20
|
||||
#define NR_NUM_LAYER 1
|
||||
#define MAX_CHAN_PARAMS 256
|
||||
|
||||
typedef struct nr_phy_channel_params_t
|
||||
{
|
||||
uint16_t sfn_slot;
|
||||
uint16_t message_id;
|
||||
uint16_t nb_of_sinrs;
|
||||
float sinr[NR_NUM_LAYER];
|
||||
} nr_phy_channel_params_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t slot;
|
||||
uint16_t rnti[MAX_CHAN_PARAMS];
|
||||
uint8_t mcs[MAX_CHAN_PARAMS];
|
||||
uint8_t rvIndex[MAX_CHAN_PARAMS];
|
||||
float sinr;
|
||||
uint16_t num_pdus;
|
||||
bool drop_flag[MAX_CHAN_PARAMS];
|
||||
bool latest;
|
||||
} slot_rnti_mcs_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t length;
|
||||
float bler_table[NUM_SINR][NUM_BLER_COL];
|
||||
} nr_bler_struct;
|
||||
|
||||
void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, int sf, int index);
|
||||
void save_pdsch_pdu_for_crnti(nfapi_nr_dl_tti_request_t *dl_tti_request);
|
||||
float get_bler_val(uint8_t mcs, int sinr);
|
||||
bool should_drop_transport_block(int slot, uint16_t rnti);
|
||||
bool is_channel_modeling(void);
|
||||
|
||||
#endif
|
||||
@@ -1956,7 +1956,7 @@ static int get_mcs_from_sinr(float sinr)
|
||||
|
||||
static int get_cqi_from_mcs(void)
|
||||
{
|
||||
static const int mcs_to_cqi[] = {0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15};
|
||||
static const int mcs_to_cqi[] = {0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15};
|
||||
assert(NUM_ELEMENTS(mcs_to_cqi) == NUM_MCS);
|
||||
int sf = 0;
|
||||
while(sf < NUM_NFAPI_SUBFRAME)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
|
||||
#include "queue_t.h"
|
||||
|
||||
#define NUM_MCS 28
|
||||
#define NUM_MCS 29
|
||||
#define NUM_SINR 100
|
||||
#define NUM_BLER_COL 13
|
||||
#define LTE_NUM_LAYER 1
|
||||
|
||||
@@ -357,7 +357,8 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
|
||||
memcpy(msg->rrc_container, sduP, sdu_lenP);
|
||||
msg->rrc_container_length=sdu_lenP;
|
||||
itti_send_msg_to_task(TASK_DU_F1, 0, tmp);
|
||||
return(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
protocol_ctxt_t ctxt;
|
||||
@@ -370,7 +371,6 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
|
||||
nr_rrc_gNB_decode_ccch(&ctxt, sduP, sdu_lenP, NULL, CC_id);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <nr/nr_common.h>
|
||||
#include <softmodem-common.h>
|
||||
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "asn1_msg.h"
|
||||
#include "../nr_rrc_proto.h"
|
||||
@@ -198,8 +199,7 @@ int xer_nr_sprint (char *string, size_t string_size, asn_TYPE_descriptor_t *td,
|
||||
uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) {
|
||||
|
||||
asn_enc_rval_t enc_rval;
|
||||
rrc_gNB_carrier_data_t *carrier = &rrc->carrier;
|
||||
const gNB_RrcConfigurationReq *configuration = &rrc->configuration;
|
||||
rrc_gNB_carrier_data_t *carrier = &rrc->carrier;
|
||||
|
||||
NR_BCCH_BCH_Message_t *mib = &carrier->mib;
|
||||
NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon;
|
||||
@@ -226,11 +226,18 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) {
|
||||
AssertFatal(scc->ssbSubcarrierSpacing != NULL, "scc->ssbSubcarrierSpacing is null\n");
|
||||
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
frequency_range_t frequency_range = band<100?FR1:FR2;
|
||||
int ssb_subcarrier_offset;
|
||||
if(frequency_range == FR1)
|
||||
ssb_subcarrier_offset = (configuration->ssb_SubcarrierOffset<24) ? (configuration->ssb_SubcarrierOffset<<*scc->ssbSubcarrierSpacing) : configuration->ssb_SubcarrierOffset;
|
||||
else
|
||||
ssb_subcarrier_offset = configuration->ssb_SubcarrierOffset;
|
||||
int scs_scaling = 1<<*scc->ssbSubcarrierSpacing;
|
||||
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000)
|
||||
scs_scaling = scs_scaling*3;
|
||||
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA > 2016666)
|
||||
scs_scaling = scs_scaling>>2;
|
||||
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
|
||||
int ssb_subcarrier_offset = 31; // default value for NSA
|
||||
if (get_softmodem_params()->sa) {
|
||||
ssb_subcarrier_offset = absolute_diff%(12*scs_scaling);
|
||||
if(frequency_range == FR1)
|
||||
ssb_subcarrier_offset <<= *scc->ssbSubcarrierSpacing;
|
||||
}
|
||||
mib->message.choice.mib->ssb_SubcarrierOffset = ssb_subcarrier_offset&15;
|
||||
|
||||
/*
|
||||
@@ -1180,6 +1187,8 @@ void fill_default_uplinkBWP(NR_BWP_Uplink_t *ubwp,
|
||||
ubwp->bwp_Common->genericParameters.cyclicPrefix = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.cyclicPrefix;
|
||||
}
|
||||
|
||||
int curr_bwp = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
|
||||
ubwp->bwp_Common->rach_ConfigCommon = NULL;
|
||||
ubwp->bwp_Common->pusch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon;
|
||||
ubwp->bwp_Common->pucch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon;
|
||||
@@ -1192,125 +1201,17 @@ void fill_default_uplinkBWP(NR_BWP_Uplink_t *ubwp,
|
||||
ubwp->bwp_Dedicated->pucch_Config->present = NR_SetupRelease_PUCCH_Config_PR_setup;
|
||||
NR_PUCCH_Config_t *pucch_Config = calloc(1,sizeof(*pucch_Config));
|
||||
ubwp->bwp_Dedicated->pucch_Config->choice.setup=pucch_Config;
|
||||
|
||||
pucch_Config->resourceSetToAddModList = calloc(1,sizeof(*pucch_Config->resourceSetToAddModList));
|
||||
pucch_Config->resourceSetToReleaseList = NULL;
|
||||
NR_PUCCH_ResourceSet_t *pucchresset0=calloc(1,sizeof(*pucchresset0));
|
||||
NR_PUCCH_ResourceSet_t *pucchresset1=calloc(1,sizeof(*pucchresset1));
|
||||
pucchresset0->pucch_ResourceSetId = 0;
|
||||
NR_PUCCH_ResourceId_t *pucchresset0id0=calloc(1,sizeof(*pucchresset0id0));
|
||||
*pucchresset0id0=0;
|
||||
ASN_SEQUENCE_ADD(&pucchresset0->resourceList.list,pucchresset0id0);
|
||||
pucchresset0->maxPayloadSize=NULL;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset0);
|
||||
pucchresset1->pucch_ResourceSetId = 1;
|
||||
NR_PUCCH_ResourceId_t *pucchresset1id0=calloc(1,sizeof(*pucchresset1id0));
|
||||
*pucchresset1id0=1;
|
||||
ASN_SEQUENCE_ADD(&pucchresset1->resourceList.list,pucchresset1id0);
|
||||
pucchresset1->maxPayloadSize=NULL;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset1);
|
||||
pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList));
|
||||
pucch_Config->resourceToReleaseList = NULL;
|
||||
int curr_bwp = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
|
||||
pucchres0->pucch_ResourceId=0;
|
||||
pucchres0->startingPRB=(8+uid) % (curr_bwp/2);
|
||||
LOG_D(NR_RRC, "pucchres0->startPRB %ld uid %d curr_bwp %d\n", pucchres0->startingPRB, uid, curr_bwp);
|
||||
pucchres0->intraSlotFrequencyHopping=NULL;
|
||||
pucchres0->secondHopPRB=NULL;
|
||||
pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
|
||||
pucchres0->format.choice.format0=calloc(1,sizeof(*pucchres0->format.choice.format0));
|
||||
pucchres0->format.choice.format0->initialCyclicShift=0;
|
||||
pucchres0->format.choice.format0->nrofSymbols=1;
|
||||
pucchres0->format.choice.format0->startingSymbolIndex=13;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
|
||||
NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2));
|
||||
pucchres2->pucch_ResourceId=1;
|
||||
pucchres2->startingPRB=0;
|
||||
pucchres2->intraSlotFrequencyHopping=NULL;
|
||||
pucchres2->secondHopPRB=NULL;
|
||||
pucchres2->format.present= NR_PUCCH_Resource__format_PR_format2;
|
||||
pucchres2->format.choice.format2=calloc(1,sizeof(*pucchres2->format.choice.format2));
|
||||
pucchres2->format.choice.format2->nrofPRBs=8;
|
||||
pucchres2->format.choice.format2->nrofSymbols=1;
|
||||
pucchres2->format.choice.format2->startingSymbolIndex=13;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres2);
|
||||
pucch_Config->format2=calloc(1,sizeof(*pucch_Config->format2));
|
||||
pucch_Config->format2->present=NR_SetupRelease_PUCCH_FormatConfig_PR_setup;
|
||||
NR_PUCCH_FormatConfig_t *pucchfmt2 = calloc(1,sizeof(*pucchfmt2));
|
||||
pucch_Config->format2->choice.setup = pucchfmt2;
|
||||
pucchfmt2->interslotFrequencyHopping=NULL;
|
||||
pucchfmt2->additionalDMRS=NULL;
|
||||
pucchfmt2->maxCodeRate=calloc(1,sizeof(*pucchfmt2->maxCodeRate));
|
||||
*pucchfmt2->maxCodeRate=NR_PUCCH_MaxCodeRate_zeroDot35;
|
||||
pucchfmt2->nrofSlots=NULL;
|
||||
pucchfmt2->pi2BPSK=NULL;
|
||||
pucchfmt2->simultaneousHARQ_ACK_CSI=calloc(1,sizeof(*pucchfmt2->simultaneousHARQ_ACK_CSI));
|
||||
*pucchfmt2->simultaneousHARQ_ACK_CSI=NR_PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true;
|
||||
config_pucch_resset0(pucch_Config, uid, curr_bwp, NULL);
|
||||
config_pucch_resset1(pucch_Config, NULL);
|
||||
set_pucch_power_config(pucch_Config, configuration->do_CSIRS);
|
||||
|
||||
// PUCCH config - Scheduling request configuration
|
||||
pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
|
||||
NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
|
||||
schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
|
||||
schedulingRequestResourceConfig->schedulingRequestID = 0;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40; // 40 slot period
|
||||
// note: make sure that there is no issue here. Later choose the RNTI accordingly.
|
||||
// Here we would be limited to 3 UEs on this resource (1 1/2 Frames 30 kHz SCS, 5 ms TDD periodicity => slots 7,8,9).
|
||||
// This should be a temporary resource until the first RRCReconfiguration gives new pucch resources.
|
||||
// Check for above configuration and exit for now if it is not the case
|
||||
AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30,
|
||||
"SCS != 30kHz\n");
|
||||
AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity==NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5,
|
||||
"TDD period != 5ms : %ld\n",scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8;
|
||||
schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
|
||||
*schedulingRequestResourceConfig->resource = 0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
|
||||
pucch_Config->schedulingRequestResourceToReleaseList=NULL;
|
||||
|
||||
pucch_Config->multi_CSI_PUCCH_ResourceList=NULL;
|
||||
pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
|
||||
long *delay[8];
|
||||
for (int i=0;i<8;i++) {
|
||||
delay[i] = calloc(1,sizeof(*delay[i]));
|
||||
AssertFatal(configuration->minRXTXTIME >=2 && configuration->minRXTXTIME <7, "check minRXTXTIME %d\n",configuration->minRXTXTIME);
|
||||
*delay[i] = i+configuration->minRXTXTIME;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
|
||||
}
|
||||
pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
|
||||
NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
|
||||
pucchspatial->pucch_SpatialRelationInfoId = 1;
|
||||
pucchspatial->servingCellId = NULL;
|
||||
if(configuration->do_CSIRS) {
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
|
||||
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
|
||||
}
|
||||
else {
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
|
||||
pucchspatial->referenceSignal.choice.ssb_Index = 0;
|
||||
}
|
||||
pucchspatial->pucch_PathlossReferenceRS_Id = 0;
|
||||
pucchspatial->p0_PUCCH_Id = 1;
|
||||
pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial);
|
||||
pucch_Config->spatialRelationInfoToReleaseList=NULL;
|
||||
pucch_Config->pucch_PowerControl=calloc(1,sizeof(*pucch_Config->pucch_PowerControl));
|
||||
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0));
|
||||
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = 0;
|
||||
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1));
|
||||
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1 = 0;
|
||||
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2));
|
||||
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = 0;
|
||||
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3));
|
||||
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3 = 0;
|
||||
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4));
|
||||
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4 = 0;
|
||||
pucch_Config->pucch_PowerControl->p0_Set = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->p0_Set));
|
||||
NR_P0_PUCCH_t *p00 = calloc(1,sizeof(*p00));
|
||||
p00->p0_PUCCH_Id=1;
|
||||
p00->p0_PUCCH_Value = 0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->p0_Set->list,p00);
|
||||
pucch_Config->pucch_PowerControl->pathlossReferenceRSs = NULL;
|
||||
scheduling_request_config(scc, pucch_Config);
|
||||
set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME);
|
||||
|
||||
// PUSCH config
|
||||
ubwp->bwp_Dedicated->pusch_Config = calloc(1,sizeof(*ubwp->bwp_Dedicated->pusch_Config));
|
||||
@@ -1463,11 +1364,13 @@ void fill_default_uplinkBWP(NR_BWP_Uplink_t *ubwp,
|
||||
}
|
||||
|
||||
void fill_initial_SpCellConfig(int uid,
|
||||
NR_SpCellConfig_t *SpCellConfig,
|
||||
NR_CellGroupConfig_t *cellGroupConfig,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const gNB_RrcConfigurationReq *configuration)
|
||||
{
|
||||
const gNB_RrcConfigurationReq *configuration) {
|
||||
|
||||
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
|
||||
|
||||
// This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4.
|
||||
// However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources,
|
||||
// where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations.
|
||||
@@ -1490,81 +1393,11 @@ void fill_initial_SpCellConfig(int uid,
|
||||
initialUplinkBWP->pucch_Config->choice.setup=pucch_Config;
|
||||
pucch_Config->resourceSetToAddModList = calloc(1,sizeof(*pucch_Config->resourceSetToAddModList));
|
||||
pucch_Config->resourceSetToReleaseList = NULL;
|
||||
NR_PUCCH_ResourceSet_t *pucchresset0=calloc(1,sizeof(*pucchresset0));
|
||||
NR_PUCCH_ResourceSet_t *pucchresset1=calloc(1,sizeof(*pucchresset1));
|
||||
pucchresset0->pucch_ResourceSetId = 0;
|
||||
NR_PUCCH_ResourceId_t *pucchresset0id0=calloc(1,sizeof(*pucchresset0id0));
|
||||
*pucchresset0id0=0;
|
||||
ASN_SEQUENCE_ADD(&pucchresset0->resourceList.list,pucchresset0id0);
|
||||
pucchresset0->maxPayloadSize=NULL;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset0);
|
||||
|
||||
pucchresset1->pucch_ResourceSetId = 1;
|
||||
NR_PUCCH_ResourceId_t *pucchresset1id0=calloc(1,sizeof(*pucchresset1id0));
|
||||
*pucchresset1id0=1;
|
||||
ASN_SEQUENCE_ADD(&pucchresset1->resourceList.list,pucchresset1id0);
|
||||
pucchresset1->maxPayloadSize=NULL;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset1);
|
||||
|
||||
pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList));
|
||||
pucch_Config->resourceToReleaseList = NULL;
|
||||
// configure one single PUCCH0 opportunity for initial connection procedure
|
||||
// one symbol (13)
|
||||
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
|
||||
pucchres0->pucch_ResourceId=0;
|
||||
//pucchres0->startingPRB=0;
|
||||
pucchres0->startingPRB=(8+uid) % (curr_bwp/2);
|
||||
LOG_D(NR_RRC, "pucchres0->startPRB %ld uid %d curr_bwp %d\n", pucchres0->startingPRB, uid, curr_bwp);
|
||||
pucchres0->intraSlotFrequencyHopping=NULL;
|
||||
pucchres0->secondHopPRB=NULL;
|
||||
pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
|
||||
pucchres0->format.choice.format0=calloc(1,sizeof(*pucchres0->format.choice.format0));
|
||||
pucchres0->format.choice.format0->initialCyclicShift=0;
|
||||
pucchres0->format.choice.format0->nrofSymbols=1;
|
||||
pucchres0->format.choice.format0->startingSymbolIndex=13;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
|
||||
|
||||
NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2));
|
||||
pucchres2->pucch_ResourceId=1;
|
||||
pucchres2->startingPRB=0;
|
||||
pucchres2->intraSlotFrequencyHopping=NULL;
|
||||
pucchres2->secondHopPRB=NULL;
|
||||
pucchres2->format.present= NR_PUCCH_Resource__format_PR_format2;
|
||||
pucchres2->format.choice.format2=calloc(1,sizeof(*pucchres2->format.choice.format2));
|
||||
pucchres2->format.choice.format2->nrofPRBs=8;
|
||||
pucchres2->format.choice.format2->nrofSymbols=1;
|
||||
pucchres2->format.choice.format2->startingSymbolIndex=13;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres2);
|
||||
|
||||
pucch_Config->format2=calloc(1,sizeof(*pucch_Config->format2));
|
||||
pucch_Config->format2->present=NR_SetupRelease_PUCCH_FormatConfig_PR_setup;
|
||||
NR_PUCCH_FormatConfig_t *pucchfmt2 = calloc(1,sizeof(*pucchfmt2));
|
||||
pucch_Config->format2->choice.setup = pucchfmt2;
|
||||
pucchfmt2->interslotFrequencyHopping=NULL;
|
||||
pucchfmt2->additionalDMRS=NULL;
|
||||
pucchfmt2->maxCodeRate=calloc(1,sizeof(*pucchfmt2->maxCodeRate));
|
||||
*pucchfmt2->maxCodeRate=NR_PUCCH_MaxCodeRate_zeroDot35;
|
||||
pucchfmt2->nrofSlots=NULL;
|
||||
pucchfmt2->pi2BPSK=NULL;
|
||||
pucchfmt2->simultaneousHARQ_ACK_CSI=calloc(1,sizeof(*pucchfmt2->simultaneousHARQ_ACK_CSI));
|
||||
*pucchfmt2->simultaneousHARQ_ACK_CSI=NR_PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true;
|
||||
|
||||
pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
|
||||
NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
|
||||
pucchspatial->pucch_SpatialRelationInfoId = 1;
|
||||
pucchspatial->servingCellId = NULL;
|
||||
if(configuration->do_CSIRS) {
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
|
||||
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
|
||||
}
|
||||
else {
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
|
||||
pucchspatial->referenceSignal.choice.ssb_Index = 0;
|
||||
}
|
||||
pucchspatial->pucch_PathlossReferenceRS_Id = 0;
|
||||
pucchspatial->p0_PUCCH_Id = 1;
|
||||
pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial);
|
||||
config_pucch_resset0(pucch_Config, uid, curr_bwp, NULL);
|
||||
config_pucch_resset1(pucch_Config, NULL);
|
||||
set_pucch_power_config(pucch_Config, configuration->do_CSIRS);
|
||||
|
||||
initialUplinkBWP->pusch_Config = calloc(1,sizeof(*initialUplinkBWP->pusch_Config));
|
||||
initialUplinkBWP->pusch_Config->present = NR_SetupRelease_PUSCH_Config_PR_setup;
|
||||
@@ -1713,31 +1546,9 @@ void fill_initial_SpCellConfig(int uid,
|
||||
srs_res0->spatialRelationInfo->referenceSignal.choice.csi_RS_Index=0;
|
||||
ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceToAddModList->list,srs_res0);
|
||||
|
||||
// configure Scheduling request
|
||||
// 40 slot period
|
||||
pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
|
||||
NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
|
||||
schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
|
||||
schedulingRequestResourceConfig->schedulingRequestID = 0;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40;
|
||||
AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30,
|
||||
"SCS != 30kHz\n");
|
||||
scheduling_request_config(scc, pucch_Config);
|
||||
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8;
|
||||
schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
|
||||
*schedulingRequestResourceConfig->resource = 0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
|
||||
|
||||
pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
|
||||
long *delay[8];
|
||||
for (int i=0;i<8;i++) {
|
||||
delay[i] = calloc(1,sizeof(*delay[i]));
|
||||
AssertFatal(configuration->minRXTXTIME >= 2 && configuration->minRXTXTIME < 7,
|
||||
"minRXTXTIME is %d but should be within [2,7)\n", configuration->minRXTXTIME);
|
||||
*delay[i] = i + configuration->minRXTXTIME;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
|
||||
}
|
||||
set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME);
|
||||
|
||||
SpCellConfig->spCellConfigDedicated->initialDownlinkBWP = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->initialDownlinkBWP));
|
||||
NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
@@ -1893,7 +1704,7 @@ void fill_initial_SpCellConfig(int uid,
|
||||
csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList));
|
||||
NR_CSI_SSB_ResourceSetId_t *ssbres00 = calloc(1,sizeof(*ssbres00));
|
||||
*ssbres00 = 0;
|
||||
*ssbres00 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list,ssbres00);
|
||||
csires1->bwp_Id = 0;
|
||||
csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
@@ -1913,8 +1724,8 @@ void fill_initial_SpCellConfig(int uid,
|
||||
}
|
||||
|
||||
NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1));
|
||||
pucchcsires1->uplinkBandwidthPartId=0;
|
||||
pucchcsires1->pucch_Resource=1;
|
||||
pucchcsires1->uplinkBandwidthPartId = 0;
|
||||
pucchcsires1->pucch_Resource = *pucch_Config->resourceSetToAddModList->list.array[1]->resourceList.list.array[0];
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList));
|
||||
csi_MeasConfig->csi_ReportConfigToReleaseList = NULL;
|
||||
if (pdsch_AntennaPorts > 1) {
|
||||
@@ -2139,7 +1950,7 @@ NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR
|
||||
return rlc_BearerConfig;
|
||||
}
|
||||
|
||||
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup, int use_rlc_um_for_drb, uint8_t configure_srb, uint8_t bearer_id_start, uint8_t nb_bearers_to_setup, long *priority ) {
|
||||
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup, int use_rlc_um_for_drb, uint8_t configure_srb, uint8_t bearer_id_start, uint8_t nb_bearers_to_setup, long *priority) {
|
||||
|
||||
cellGroupConfig->cellGroupId = 0;
|
||||
cellGroupConfig->rlc_BearerToReleaseList = NULL;
|
||||
@@ -2167,6 +1978,7 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
const gNB_RrcConfigurationReq* configuration) {
|
||||
|
||||
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
|
||||
|
||||
if (SpCellConfig == NULL) return;
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc = configuration ? configuration->scc : NULL;
|
||||
@@ -2185,9 +1997,9 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void fill_initial_cellGroupConfig(int uid,
|
||||
NR_CellGroupConfig_t *cellGroupConfig,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
@@ -2208,36 +2020,33 @@ void fill_initial_cellGroupConfig(int uid,
|
||||
cellGroupConfig->rlc_BearerToReleaseList = NULL;
|
||||
|
||||
/* mac CellGroup Config */
|
||||
if (1) {
|
||||
mac_CellGroupConfig = calloc(1, sizeof(*mac_CellGroupConfig));
|
||||
if (1) {
|
||||
mac_CellGroupConfig->schedulingRequestConfig = calloc(1, sizeof(*mac_CellGroupConfig->schedulingRequestConfig));
|
||||
mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = CALLOC(1,sizeof(*mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
|
||||
struct NR_SchedulingRequestToAddMod *schedulingrequestlist;
|
||||
schedulingrequestlist = CALLOC(1,sizeof(*schedulingrequestlist));
|
||||
schedulingrequestlist->schedulingRequestId = 0;
|
||||
schedulingrequestlist->sr_ProhibitTimer = CALLOC(1,sizeof(*schedulingrequestlist->sr_ProhibitTimer));
|
||||
*(schedulingrequestlist->sr_ProhibitTimer) = 0;
|
||||
schedulingrequestlist->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n64;
|
||||
ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist);
|
||||
}
|
||||
mac_CellGroupConfig->bsr_Config = calloc(1, sizeof(*mac_CellGroupConfig->bsr_Config));
|
||||
mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf10;
|
||||
mac_CellGroupConfig->bsr_Config->retxBSR_Timer = NR_BSR_Config__retxBSR_Timer_sf80;
|
||||
mac_CellGroupConfig->tag_Config = calloc(1, sizeof(*mac_CellGroupConfig->tag_Config));
|
||||
mac_CellGroupConfig->tag_Config->tag_ToReleaseList = NULL;
|
||||
mac_CellGroupConfig->tag_Config->tag_ToAddModList = calloc(1,sizeof(*mac_CellGroupConfig->tag_Config->tag_ToAddModList));
|
||||
struct NR_TAG *tag=calloc(1,sizeof(*tag));
|
||||
tag->tag_Id = 0;
|
||||
tag->timeAlignmentTimer = NR_TimeAlignmentTimer_infinity;
|
||||
ASN_SEQUENCE_ADD(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag);
|
||||
mac_CellGroupConfig->phr_Config = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config));
|
||||
mac_CellGroupConfig->phr_Config->present = NR_SetupRelease_PHR_Config_PR_setup;
|
||||
mac_CellGroupConfig->phr_Config->choice.setup = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config->choice.setup));
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_PeriodicTimer = NR_PHR_Config__phr_PeriodicTimer_sf10;
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_ProhibitTimer = NR_PHR_Config__phr_ProhibitTimer_sf10;
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_Tx_PowerFactorChange = NR_PHR_Config__phr_Tx_PowerFactorChange_dB1;
|
||||
}
|
||||
mac_CellGroupConfig = calloc(1, sizeof(*mac_CellGroupConfig));
|
||||
|
||||
mac_CellGroupConfig->bsr_Config = calloc(1, sizeof(*mac_CellGroupConfig->bsr_Config));
|
||||
mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf10;
|
||||
mac_CellGroupConfig->bsr_Config->retxBSR_Timer = NR_BSR_Config__retxBSR_Timer_sf80;
|
||||
mac_CellGroupConfig->tag_Config = calloc(1, sizeof(*mac_CellGroupConfig->tag_Config));
|
||||
mac_CellGroupConfig->tag_Config->tag_ToReleaseList = NULL;
|
||||
mac_CellGroupConfig->tag_Config->tag_ToAddModList = calloc(1,sizeof(*mac_CellGroupConfig->tag_Config->tag_ToAddModList));
|
||||
struct NR_TAG *tag=calloc(1,sizeof(*tag));
|
||||
tag->tag_Id = 0;
|
||||
tag->timeAlignmentTimer = NR_TimeAlignmentTimer_infinity;
|
||||
ASN_SEQUENCE_ADD(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag);
|
||||
mac_CellGroupConfig->phr_Config = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config));
|
||||
mac_CellGroupConfig->phr_Config->present = NR_SetupRelease_PHR_Config_PR_setup;
|
||||
mac_CellGroupConfig->phr_Config->choice.setup = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config->choice.setup));
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_PeriodicTimer = NR_PHR_Config__phr_PeriodicTimer_sf10;
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_ProhibitTimer = NR_PHR_Config__phr_ProhibitTimer_sf10;
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_Tx_PowerFactorChange = NR_PHR_Config__phr_Tx_PowerFactorChange_dB1;
|
||||
|
||||
mac_CellGroupConfig->schedulingRequestConfig = calloc(1, sizeof(*mac_CellGroupConfig->schedulingRequestConfig));
|
||||
mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = CALLOC(1,sizeof(*mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
|
||||
struct NR_SchedulingRequestToAddMod *schedulingrequestlist = CALLOC(1,sizeof(*schedulingrequestlist));
|
||||
schedulingrequestlist->schedulingRequestId = 0;
|
||||
schedulingrequestlist->sr_ProhibitTimer = NULL;
|
||||
schedulingrequestlist->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n64;
|
||||
ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist);
|
||||
|
||||
cellGroupConfig->mac_CellGroupConfig = mac_CellGroupConfig;
|
||||
|
||||
physicalCellGroupConfig = calloc(1,sizeof(*physicalCellGroupConfig));
|
||||
@@ -2247,8 +2056,8 @@ void fill_initial_cellGroupConfig(int uid,
|
||||
cellGroupConfig->physicalCellGroupConfig = physicalCellGroupConfig;
|
||||
|
||||
cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig));
|
||||
|
||||
fill_initial_SpCellConfig(uid,cellGroupConfig->spCellConfig,scc,servingcellconfigdedicated,configuration);
|
||||
|
||||
fill_initial_SpCellConfig(uid,cellGroupConfig,scc,servingcellconfigdedicated,configuration);
|
||||
|
||||
cellGroupConfig->sCellToAddModList = NULL;
|
||||
cellGroupConfig->sCellToReleaseList = NULL;
|
||||
|
||||
@@ -102,7 +102,7 @@ uint8_t do_RRCReject(uint8_t Mod_id,
|
||||
uint8_t *const buffer);
|
||||
|
||||
void fill_initial_SpCellConfig(int uid,
|
||||
NR_SpCellConfig_t *SpCellConfig,
|
||||
NR_CellGroupConfig_t *cellGroupConfig,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const gNB_RrcConfigurationReq *configuration);
|
||||
|
||||
@@ -331,6 +331,7 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
|
||||
int rbsize,
|
||||
int mcs_table) {
|
||||
|
||||
NR_Phy_Parameters_t *phy_Parameters = &cap->phy_Parameters;
|
||||
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
NR_BandNR_t *nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t));
|
||||
nr_bandnr->bandNR = band;
|
||||
@@ -344,8 +345,8 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
|
||||
*bandNRinfo->pdsch_256QAM_FR2 = NR_BandNR__pdsch_256QAM_FR2_supported;
|
||||
}
|
||||
else{
|
||||
cap->phy_Parameters.phy_ParametersFR1 = CALLOC(1,sizeof(*cap->phy_Parameters.phy_ParametersFR1));
|
||||
NR_Phy_ParametersFR1_t *phy_fr1 = cap->phy_Parameters.phy_ParametersFR1;
|
||||
phy_Parameters->phy_ParametersFR1 = CALLOC(1,sizeof(*phy_Parameters->phy_ParametersFR1));
|
||||
NR_Phy_ParametersFR1_t *phy_fr1 = phy_Parameters->phy_ParametersFR1;
|
||||
phy_fr1->pdsch_256QAM_FR1 = CALLOC(1,sizeof(*phy_fr1->pdsch_256QAM_FR1));
|
||||
*phy_fr1->pdsch_256QAM_FR1 = NR_Phy_ParametersFR1__pdsch_256QAM_FR1_supported;
|
||||
}
|
||||
@@ -366,6 +367,9 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
|
||||
*fs_cc->supportedModulationOrderDL = NR_ModulationOrder_qam256;
|
||||
ASN_SEQUENCE_ADD(&fs->featureSetsDownlinkPerCC->list, fs_cc);
|
||||
}
|
||||
|
||||
phy_Parameters->phy_ParametersFRX_Diff = CALLOC(1,sizeof(*phy_Parameters->phy_ParametersFRX_Diff));
|
||||
phy_Parameters->phy_ParametersFRX_Diff->pucch_F0_2WithoutFH = NULL;
|
||||
}
|
||||
|
||||
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc,
|
||||
@@ -454,6 +458,205 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){
|
||||
}
|
||||
}
|
||||
|
||||
void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time) {
|
||||
|
||||
pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
|
||||
long *delay[8];
|
||||
for (int i=0;i<8;i++) {
|
||||
delay[i] = calloc(1,sizeof(*delay[i]));
|
||||
*delay[i] = i+min_feedback_time;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// PUCCH resource set 0 for configuration with O_uci <= 2 bits and/or a positive or negative SR (section 9.2.1 of 38.213)
|
||||
void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp, NR_UE_NR_Capability_t *uecap) {
|
||||
|
||||
NR_PUCCH_ResourceSet_t *pucchresset = calloc(1,sizeof(*pucchresset));
|
||||
pucchresset->pucch_ResourceSetId = 0;
|
||||
NR_PUCCH_ResourceId_t *pucchid=calloc(1,sizeof(*pucchid));
|
||||
*pucchid=0;
|
||||
ASN_SEQUENCE_ADD(&pucchresset->resourceList.list,pucchid);
|
||||
pucchresset->maxPayloadSize=NULL;
|
||||
|
||||
if(uecap) {
|
||||
long *pucch_F0_2WithoutFH = uecap->phy_Parameters.phy_ParametersFRX_Diff->pucch_F0_2WithoutFH;
|
||||
AssertFatal(pucch_F0_2WithoutFH == NULL,"UE does not support PUCCH F0 without frequency hopping. Current configuration is without FH\n");
|
||||
}
|
||||
|
||||
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
|
||||
pucchres0->pucch_ResourceId=*pucchid;
|
||||
pucchres0->startingPRB= (8 + uid) % curr_bwp;
|
||||
pucchres0->intraSlotFrequencyHopping=NULL;
|
||||
pucchres0->secondHopPRB=NULL;
|
||||
pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
|
||||
pucchres0->format.choice.format0=calloc(1,sizeof(*pucchres0->format.choice.format0));
|
||||
pucchres0->format.choice.format0->initialCyclicShift=0;
|
||||
pucchres0->format.choice.format0->nrofSymbols=1;
|
||||
pucchres0->format.choice.format0->startingSymbolIndex=13;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
|
||||
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset);
|
||||
}
|
||||
|
||||
|
||||
// PUCCH resource set 1 for configuration with O_uci > 2 bits (currently format2)
|
||||
void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t *uecap) {
|
||||
|
||||
NR_PUCCH_ResourceSet_t *pucchresset=calloc(1,sizeof(*pucchresset));
|
||||
pucchresset->pucch_ResourceSetId = 1;
|
||||
NR_PUCCH_ResourceId_t *pucchressetid=calloc(1,sizeof(*pucchressetid));
|
||||
*pucchressetid=2;
|
||||
ASN_SEQUENCE_ADD(&pucchresset->resourceList.list,pucchressetid);
|
||||
pucchresset->maxPayloadSize=NULL;
|
||||
|
||||
if(uecap) {
|
||||
long *pucch_F0_2WithoutFH = uecap->phy_Parameters.phy_ParametersFRX_Diff->pucch_F0_2WithoutFH;
|
||||
AssertFatal(pucch_F0_2WithoutFH == NULL,"UE does not support PUCCH F2 without frequency hopping. Current configuration is without FH\n");
|
||||
}
|
||||
|
||||
NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2));
|
||||
pucchres2->pucch_ResourceId=*pucchressetid;
|
||||
pucchres2->startingPRB=0;
|
||||
pucchres2->intraSlotFrequencyHopping=NULL;
|
||||
pucchres2->secondHopPRB=NULL;
|
||||
pucchres2->format.present= NR_PUCCH_Resource__format_PR_format2;
|
||||
pucchres2->format.choice.format2=calloc(1,sizeof(*pucchres2->format.choice.format2));
|
||||
pucchres2->format.choice.format2->nrofPRBs=8;
|
||||
pucchres2->format.choice.format2->nrofSymbols=1;
|
||||
pucchres2->format.choice.format2->startingSymbolIndex=13;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres2);
|
||||
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset);
|
||||
|
||||
pucch_Config->format2=calloc(1,sizeof(*pucch_Config->format2));
|
||||
pucch_Config->format2->present=NR_SetupRelease_PUCCH_FormatConfig_PR_setup;
|
||||
NR_PUCCH_FormatConfig_t *pucchfmt2 = calloc(1,sizeof(*pucchfmt2));
|
||||
pucch_Config->format2->choice.setup = pucchfmt2;
|
||||
pucchfmt2->interslotFrequencyHopping=NULL;
|
||||
pucchfmt2->additionalDMRS=NULL;
|
||||
pucchfmt2->maxCodeRate=calloc(1,sizeof(*pucchfmt2->maxCodeRate));
|
||||
*pucchfmt2->maxCodeRate=NR_PUCCH_MaxCodeRate_zeroDot35;
|
||||
pucchfmt2->nrofSlots=NULL;
|
||||
pucchfmt2->pi2BPSK=NULL;
|
||||
|
||||
// to check UE capabilities for that in principle
|
||||
pucchfmt2->simultaneousHARQ_ACK_CSI=calloc(1,sizeof(*pucchfmt2->simultaneousHARQ_ACK_CSI));
|
||||
*pucchfmt2->simultaneousHARQ_ACK_CSI=NR_PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true;
|
||||
|
||||
}
|
||||
|
||||
void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs) {
|
||||
|
||||
pucch_Config->pucch_PowerControl = calloc(1,sizeof(*pucch_Config->pucch_PowerControl));
|
||||
NR_P0_PUCCH_t *p00 = calloc(1,sizeof(*p00));
|
||||
p00->p0_PUCCH_Id = 1;
|
||||
p00->p0_PUCCH_Value = 0;
|
||||
pucch_Config->pucch_PowerControl->p0_Set = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->p0_Set));
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->p0_Set->list,p00);
|
||||
|
||||
pucch_Config->pucch_PowerControl->pathlossReferenceRSs = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->pathlossReferenceRSs));
|
||||
struct NR_PUCCH_PathlossReferenceRS *PL_ref_RS = calloc(1,sizeof(*PL_ref_RS));
|
||||
PL_ref_RS->pucch_PathlossReferenceRS_Id = 0;
|
||||
if(do_csirs) {
|
||||
PL_ref_RS->referenceSignal.present = NR_PUCCH_PathlossReferenceRS__referenceSignal_PR_csi_RS_Index;
|
||||
PL_ref_RS->referenceSignal.choice.csi_RS_Index = 0;
|
||||
}
|
||||
else {
|
||||
PL_ref_RS->referenceSignal.present = NR_PUCCH_PathlossReferenceRS__referenceSignal_PR_ssb_Index;
|
||||
PL_ref_RS->referenceSignal.choice.ssb_Index = 0;
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->pathlossReferenceRSs->list,PL_ref_RS);
|
||||
|
||||
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0));
|
||||
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = 0;
|
||||
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2));
|
||||
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = 0;
|
||||
|
||||
pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
|
||||
pucch_Config->spatialRelationInfoToReleaseList=NULL;
|
||||
NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
|
||||
pucchspatial->pucch_SpatialRelationInfoId = 1;
|
||||
pucchspatial->servingCellId = NULL;
|
||||
if(do_csirs) {
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
|
||||
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
|
||||
}
|
||||
else {
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
|
||||
pucchspatial->referenceSignal.choice.ssb_Index = 0;
|
||||
}
|
||||
|
||||
pucchspatial->pucch_PathlossReferenceRS_Id = PL_ref_RS->pucch_PathlossReferenceRS_Id;
|
||||
pucchspatial->p0_PUCCH_Id = p00->p0_PUCCH_Id;
|
||||
pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial);
|
||||
}
|
||||
|
||||
void set_SR_periodandoffset(NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig,
|
||||
NR_ServingCellConfigCommon_t *scc) {
|
||||
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
|
||||
int sr_slot = 1; // in FDD SR in slot 1
|
||||
if(tdd)
|
||||
sr_slot = tdd->nrofDownlinkSlots; // SR in the first uplink slot
|
||||
|
||||
schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
|
||||
|
||||
if(sr_slot<10){
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl10;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl10 = sr_slot;
|
||||
return;
|
||||
}
|
||||
if(sr_slot<20){
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl20;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl20 = sr_slot;
|
||||
return;
|
||||
}
|
||||
if(sr_slot<40){
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = sr_slot;
|
||||
return;
|
||||
}
|
||||
if(sr_slot<80){
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl80;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl80 = sr_slot;
|
||||
return;
|
||||
}
|
||||
if(sr_slot<160){
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl160;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl160 = sr_slot;
|
||||
return;
|
||||
}
|
||||
if(sr_slot<320){
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl320;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl320 = sr_slot;
|
||||
return;
|
||||
}
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl640;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl640 = sr_slot;
|
||||
}
|
||||
|
||||
void scheduling_request_config(NR_ServingCellConfigCommon_t *scc,
|
||||
NR_PUCCH_Config_t *pucch_Config) {
|
||||
|
||||
// format with <=2 bits in pucch resource set 0
|
||||
NR_PUCCH_ResourceSet_t *pucchresset = pucch_Config->resourceSetToAddModList->list.array[0];
|
||||
// assigning the 1st pucch resource in the set to scheduling request
|
||||
NR_PUCCH_ResourceId_t *pucchressetid = pucchresset->resourceList.list.array[0];
|
||||
|
||||
pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
|
||||
NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
|
||||
schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
|
||||
schedulingRequestResourceConfig->schedulingRequestID = 0;
|
||||
|
||||
set_SR_periodandoffset(schedulingRequestResourceConfig, scc);
|
||||
|
||||
schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
|
||||
*schedulingRequestResourceConfig->resource = *pucchressetid;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
|
||||
}
|
||||
|
||||
void set_dl_mcs_table(int scs,
|
||||
NR_UE_NR_Capability_t *cap,
|
||||
NR_SpCellConfig_t *SpCellConfig,
|
||||
|
||||
@@ -120,6 +120,12 @@ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc,
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList,
|
||||
int curr_bwp);
|
||||
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
|
||||
void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp, NR_UE_NR_Capability_t *uecap);
|
||||
void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t *uecap);
|
||||
void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time);
|
||||
void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs);
|
||||
void scheduling_request_config(NR_ServingCellConfigCommon_t *scc,
|
||||
NR_PUCCH_Config_t *pucch_Config);
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
int uid,
|
||||
@@ -139,5 +145,4 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
|
||||
int rbsize,
|
||||
int mcs_table);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -447,7 +447,8 @@ typedef struct {
|
||||
|
||||
NR_BCCH_BCH_Message_t mib;
|
||||
NR_BCCH_BCH_Message_t *mib_DU;
|
||||
NR_BCCH_DL_SCH_Message_t *siblock1_DU;
|
||||
NR_SIB1_t *siblock1_DU;
|
||||
//NR_BCCH_DL_SCH_Message_t *siblock1_DU;
|
||||
NR_SIB1_t *sib1;
|
||||
NR_SIB2_t *sib2;
|
||||
NR_SIB3_t *sib3;
|
||||
|
||||
@@ -120,7 +120,7 @@ rrc_gNB_generate_SecurityModeCommand(
|
||||
rrc_gNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
uint8_t
|
||||
uint8_t
|
||||
rrc_gNB_get_next_transaction_identifier(
|
||||
module_id_t gnb_mod_idP
|
||||
);
|
||||
@@ -209,7 +209,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
|
||||
void
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *ue_context_pP);
|
||||
rrc_gNB_ue_context_t *ue_context_pP,
|
||||
NR_CellGroupConfig_t *cell_groupConfig_from_DU);
|
||||
|
||||
rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
|
||||
+476
-100
@@ -99,6 +99,7 @@
|
||||
#include <openair2/X2AP/x2ap_eNB.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include <openair2/RRC/NR/nr_rrc_proto.h>
|
||||
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
|
||||
#include "BIT_STRING.h"
|
||||
#include "assertions.h"
|
||||
@@ -164,9 +165,8 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
|
||||
|
||||
LOG_I(NR_RRC,"Done init_NR_SI\n");
|
||||
|
||||
if (NODE_IS_MONOLITHIC(rrc->node_type)){
|
||||
if (NODE_IS_MONOLITHIC(rrc->node_type) || NODE_IS_DU(rrc->node_type)){
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->configuration.ssb_SubcarrierOffset,
|
||||
rrc->configuration.pdsch_AntennaPorts,
|
||||
rrc->configuration.pusch_AntennaPorts,
|
||||
rrc->configuration.sib1_tda,
|
||||
@@ -276,7 +276,6 @@ void apply_macrlc_config(gNB_RRC_INST *rrc,
|
||||
|
||||
NR_CellGroupConfig_t *cgc = get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : NULL;
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->configuration.ssb_SubcarrierOffset,
|
||||
rrc->configuration.pdsch_AntennaPorts,
|
||||
rrc->configuration.pusch_AntennaPorts,
|
||||
rrc->configuration.sib1_tda,
|
||||
@@ -472,7 +471,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
|
||||
rrc_mac_config_req_gNB(rrc_instance_p->module_id,
|
||||
rrc_instance_p->configuration.ssb_SubcarrierOffset,
|
||||
rrc_instance_p->configuration.pdsch_AntennaPorts,
|
||||
rrc_instance_p->configuration.pusch_AntennaPorts,
|
||||
rrc_instance_p->configuration.sib1_tda,
|
||||
@@ -808,8 +806,8 @@ rrc_gNB_generate_defaultRRCReconfiguration(
|
||||
}
|
||||
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->configuration.ssb_SubcarrierOffset,
|
||||
rrc->configuration.pdsch_AntennaPorts,
|
||||
rrc->configuration.pusch_AntennaPorts,
|
||||
rrc->configuration.sib1_tda,
|
||||
@@ -838,7 +836,8 @@ rrc_gNB_generate_defaultRRCReconfiguration(
|
||||
void
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *ue_context_pP
|
||||
rrc_gNB_ue_context_t *ue_context_pP,
|
||||
NR_CellGroupConfig_t *cell_groupConfig_from_DU
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
@@ -861,7 +860,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
uint8_t drb_id_to_setup_start = 1;
|
||||
uint8_t nb_drb_to_setup = 0;
|
||||
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu sessions with a default preiority (will be dynamique in future)
|
||||
NR_CellGroupConfig_t *cellGroupConfig;
|
||||
NR_CellGroupConfig_t *cellGroupConfig = NULL;
|
||||
|
||||
uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id);
|
||||
|
||||
@@ -1017,9 +1016,17 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
}
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
|
||||
if(cell_groupConfig_from_DU == NULL){
|
||||
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
|
||||
// FIXME: fill_mastercellGroupConfig() won't fill the right priorities or
|
||||
// bearer IDs for the DRBs
|
||||
fill_mastercellGroupConfig(cellGroupConfig, ue_context_pP->ue_context.masterCellGroup, rrc->um_on_default_drb, (drb_id_to_setup_start < 2) ? 1 : 0, drb_id_to_setup_start, nb_drb_to_setup, drb_priority);
|
||||
}
|
||||
else{
|
||||
LOG_I(NR_RRC, "Master cell group originating from the DU \n");
|
||||
cellGroupConfig = cell_groupConfig_from_DU;
|
||||
}
|
||||
|
||||
fill_mastercellGroupConfig(cellGroupConfig, ue_context_pP->ue_context.masterCellGroup, rrc->um_on_default_drb, (drb_id_to_setup_start < 2) ? 1 : 0, drb_id_to_setup_start, nb_drb_to_setup, drb_priority);
|
||||
size = do_RRCReconfiguration(ctxt_pP, buffer, sizeof(buffer),
|
||||
xid,
|
||||
*SRB_configList2,
|
||||
@@ -1075,7 +1082,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->configuration.ssb_SubcarrierOffset,
|
||||
rrc->configuration.pdsch_AntennaPorts,
|
||||
rrc->configuration.pusch_AntennaPorts,
|
||||
rrc->configuration.sib1_tda,
|
||||
@@ -1420,7 +1426,6 @@ rrc_gNB_process_RRCReconfigurationComplete(
|
||||
NR_DRB_ToReleaseList_t *DRB_Release_configList2 = ue_context_pP->ue_context.DRB_Release_configList2[xid];
|
||||
NR_DRB_Identity_t *drb_id_p = NULL;
|
||||
// uint8_t nr_DRB2LCHAN[8];
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
|
||||
|
||||
ue_context_pP->ue_context.ue_reestablishment_timer = 0;
|
||||
|
||||
@@ -1459,7 +1464,6 @@ rrc_gNB_process_RRCReconfigurationComplete(
|
||||
NULL,
|
||||
get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList : NULL);
|
||||
/* Refresh SRBs/DRBs */
|
||||
|
||||
if (!NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)) {
|
||||
LOG_D(NR_RRC,"Configuring RLC DRBs/SRBs for UE %x\n",ue_context_pP->ue_context.rnti);
|
||||
nr_rrc_rlc_config_asn1_req(ctxt_pP,
|
||||
@@ -1469,49 +1473,6 @@ rrc_gNB_process_RRCReconfigurationComplete(
|
||||
NULL,
|
||||
get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList : NULL);
|
||||
}
|
||||
else if(SRB_configList!=NULL || DRB_configList!=NULL){
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_SETUP_REQ);
|
||||
f1ap_ue_context_setup_t *req=&F1AP_UE_CONTEXT_SETUP_REQ (message_p);
|
||||
req->gNB_CU_ue_id = 0;
|
||||
req->gNB_DU_ue_id = 0;
|
||||
req->rnti = ue_context_pP->ue_context.rnti;
|
||||
req->mcc = rrc->configuration.mcc[0];
|
||||
req->mnc = rrc->configuration.mnc[0];
|
||||
req->mnc_digit_length = rrc->configuration.mnc_digit_length[0];
|
||||
req->nr_cellid = rrc->nr_cellid;
|
||||
if(SRB_configList!=NULL){
|
||||
req->srbs_to_be_setup = malloc(SRB_configList->list.count*sizeof(f1ap_srb_to_be_setup_t));
|
||||
req->srbs_to_be_setup_length = SRB_configList->list.count;
|
||||
f1ap_srb_to_be_setup_t *SRBs=req->srbs_to_be_setup;
|
||||
for (int i = 0; i < SRB_configList->list.count; i++){
|
||||
if(SRB_configList->list.array[i]->srb_Identity > 1){
|
||||
SRBs[i].srb_id = SRB_configList->list.array[i]->srb_Identity;
|
||||
SRBs[i].lcid = SRB_configList->list.array[i]->srb_Identity;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(DRB_configList!=NULL){
|
||||
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req;
|
||||
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
|
||||
req->drbs_to_be_setup = malloc(DRB_configList->list.count*sizeof(f1ap_drb_to_be_setup_t));
|
||||
req->drbs_to_be_setup_length = DRB_configList->list.count;
|
||||
f1ap_drb_to_be_setup_t *DRBs=req->drbs_to_be_setup;
|
||||
LOG_I(RRC, "Length of DRB list:%d, %d \n", DRB_configList->list.count, req->drbs_to_be_setup_length);
|
||||
for (int i = 0; i < DRB_configList->list.count; i++){
|
||||
DRBs[i].drb_id = DRB_configList->list.array[i]->drb_Identity;
|
||||
DRBs[i].rlc_mode = RLC_MODE_AM;
|
||||
DRBs[i].up_ul_tnl[0].tl_address = inet_addr(rrc->eth_params_s.my_addr);
|
||||
DRBs[i].up_ul_tnl[0].port=rrc->eth_params_s.my_portd;
|
||||
DRBs[i].up_ul_tnl_length = 1;
|
||||
DRBs[i].up_dl_tnl[0].tl_address = inet_addr(rrc->eth_params_s.remote_addr);
|
||||
DRBs[i].up_dl_tnl[0].port=rrc->eth_params_s.remote_portd;
|
||||
DRBs[i].up_dl_tnl_length = 1;
|
||||
}
|
||||
LOG_I(RRC, "Send F1AP_UE_CONTEXT_SETUP_REQ with ITTI\n");
|
||||
}
|
||||
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set the SRB active in UE context */
|
||||
@@ -1996,7 +1957,6 @@ int nr_rrc_reconfiguration_req(rrc_gNB_ue_context_t *const ue_context_pP
|
||||
|
||||
gNB_RrcConfigurationReq *configuration = &RC.nrrrc[ctxt_pP->module_id]->configuration;
|
||||
rrc_mac_config_req_gNB(ctxt_pP->module_id,
|
||||
configuration->ssb_SubcarrierOffset,
|
||||
configuration->pdsch_AntennaPorts,
|
||||
configuration->pusch_AntennaPorts,
|
||||
configuration->sib1_tda,
|
||||
@@ -2814,11 +2774,76 @@ rrc_gNB_decode_dcch(
|
||||
ul_dcch_msg);
|
||||
}
|
||||
|
||||
if (ue_context_p->ue_context.established_pdu_sessions_flag == 1) {
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration(ctxt_pP, ue_context_p);
|
||||
} else {
|
||||
rrc_gNB_generate_defaultRRCReconfiguration(ctxt_pP, ue_context_p);
|
||||
if(!NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)){
|
||||
if (ue_context_p->ue_context.established_pdu_sessions_flag == 1) {
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration(ctxt_pP, ue_context_p, NULL);
|
||||
} else {
|
||||
rrc_gNB_generate_defaultRRCReconfiguration(ctxt_pP, ue_context_p);
|
||||
}
|
||||
}
|
||||
else{
|
||||
/*Generate a UE context setup request message towards the DU to provide the UE
|
||||
*capability info and get the updates on master cell group config from the DU*/
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_SETUP_REQ);
|
||||
f1ap_ue_context_setup_t *req=&F1AP_UE_CONTEXT_SETUP_REQ (message_p);
|
||||
//UE_IDs will be extracted from F1AP layer
|
||||
req->gNB_CU_ue_id = 0;
|
||||
req->gNB_DU_ue_id = 0;
|
||||
req->rnti = ue_context_p->ue_context.rnti;
|
||||
req->mcc = RC.nrrrc[ctxt_pP->module_id]->configuration.mcc[0];
|
||||
req->mnc = RC.nrrrc[ctxt_pP->module_id]->configuration.mnc[0];
|
||||
req->mnc_digit_length = RC.nrrrc[ctxt_pP->module_id]->configuration.mnc_digit_length[0];
|
||||
req->nr_cellid = RC.nrrrc[ctxt_pP->module_id]->nr_cellid;
|
||||
|
||||
if (ue_context_p->ue_context.established_pdu_sessions_flag == 1) {
|
||||
/*Instruction towards the DU for SRB2 configuration*/
|
||||
req->srbs_to_be_setup = malloc(1*sizeof(f1ap_srb_to_be_setup_t));
|
||||
req->srbs_to_be_setup_length = 1;
|
||||
f1ap_srb_to_be_setup_t *SRBs=req->srbs_to_be_setup;
|
||||
SRBs[0].srb_id = 2;
|
||||
SRBs[0].lcid = 2;
|
||||
|
||||
/*Instruction towards the DU for DRB configuration and tunnel creation*/
|
||||
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req;
|
||||
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
|
||||
req->drbs_to_be_setup = malloc(1*sizeof(f1ap_drb_to_be_setup_t));
|
||||
req->drbs_to_be_setup_length = 1;
|
||||
f1ap_drb_to_be_setup_t *DRBs=req->drbs_to_be_setup;
|
||||
LOG_I(RRC, "Length of DRB list:%d \n", req->drbs_to_be_setup_length);
|
||||
DRBs[0].drb_id = 1;
|
||||
DRBs[0].rlc_mode = RLC_MODE_AM;
|
||||
DRBs[0].up_ul_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt_pP->module_id]->eth_params_s.my_addr);
|
||||
DRBs[0].up_ul_tnl[0].port=RC.nrrrc[ctxt_pP->module_id]->eth_params_s.my_portd;
|
||||
DRBs[0].up_ul_tnl_length = 1;
|
||||
DRBs[0].up_dl_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt_pP->module_id]->eth_params_s.remote_addr);
|
||||
DRBs[0].up_dl_tnl[0].port=RC.nrrrc[ctxt_pP->module_id]->eth_params_s.remote_portd;
|
||||
DRBs[0].up_dl_tnl_length = 1;
|
||||
}
|
||||
if( ul_dcch_msg->message.choice.c1->choice.ueCapabilityInformation->criticalExtensions.present ==
|
||||
NR_UECapabilityInformation__criticalExtensions_PR_ueCapabilityInformation ) {
|
||||
struct NR_UE_CapabilityRAT_ContainerList *ue_CapabilityRAT_ContainerList =
|
||||
ul_dcch_msg->message.choice.c1->choice.ueCapabilityInformation->criticalExtensions.choice.ueCapabilityInformation->ue_CapabilityRAT_ContainerList;
|
||||
if(ue_CapabilityRAT_ContainerList!=NULL){
|
||||
LOG_I(NR_RRC, "ue_CapabilityRAT_ContainerList is present \n");
|
||||
req->cu_to_du_rrc_information = calloc(1,sizeof(cu_to_du_rrc_information_t));
|
||||
req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList = calloc(1,4096);
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UE_CapabilityRAT_ContainerList,
|
||||
NULL,
|
||||
ue_CapabilityRAT_ContainerList,
|
||||
req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList,
|
||||
4096);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 ue_CapabilityRAT_ContainerList encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList_length = (enc_rval.encoded+7)>>3;
|
||||
}
|
||||
else{
|
||||
LOG_I(NR_RRC, "ue_CapabilityRAT_ContainerList is not present \n");
|
||||
}
|
||||
}
|
||||
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
@@ -2931,11 +2956,8 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
memset(mib->message.choice.mib,0,sizeof(struct NR_MIB));
|
||||
memcpy(mib->message.choice.mib, mib_DU->message.choice.mib, sizeof(struct NR_MIB));
|
||||
|
||||
rrc->carrier.SIB1 = malloc(f1_setup_req->sib1_length[i]);
|
||||
rrc->carrier.sizeof_SIB1 = f1_setup_req->sib1_length[i];
|
||||
memcpy((void *)rrc->carrier.SIB1,f1_setup_req->sib1[i],f1_setup_req->sib1_length[i]);
|
||||
dec_rval = uper_decode_complete(NULL,
|
||||
&asn_DEF_NR_BCCH_DL_SCH_Message,
|
||||
&asn_DEF_NR_SIB1, //&asn_DEF_NR_BCCH_DL_SCH_Message,
|
||||
(void **)&rrc->carrier.siblock1_DU,
|
||||
f1_setup_req->sib1[i],
|
||||
f1_setup_req->sib1_length[i]);
|
||||
@@ -2945,12 +2967,12 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
dec_rval.consumed );
|
||||
|
||||
// Parse message and extract SystemInformationBlockType1 field
|
||||
NR_BCCH_DL_SCH_Message_t *bcch_message = rrc->carrier.siblock1_DU;
|
||||
AssertFatal(bcch_message->message.present == NR_BCCH_DL_SCH_MessageType_PR_c1,
|
||||
"bcch_message->message.present != NR_BCCH_DL_SCH_MessageType_PR_c1\n");
|
||||
AssertFatal(bcch_message->message.choice.c1->present == NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1,
|
||||
"bcch_message->message.choice.c1->present != NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1\n");
|
||||
rrc->carrier.sib1 = bcch_message->message.choice.c1->choice.systemInformationBlockType1;
|
||||
rrc->carrier.sib1 = rrc->carrier.siblock1_DU;
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1)){
|
||||
LOG_I(NR_RRC, "Printing received SIB1 container inside F1 setup request message:\n");
|
||||
xer_fprint(stdout, &asn_DEF_NR_SIB1,(void *)rrc->carrier.sib1);
|
||||
}
|
||||
|
||||
rrc->carrier.physCellId = f1_setup_req->cell[i].nr_pci;
|
||||
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).gNB_CU_name = rrc->node_name;
|
||||
@@ -3278,6 +3300,94 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
|
||||
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(message_p);
|
||||
uint32_t incoming_teid = 0;
|
||||
|
||||
if(req->cu_to_du_rrc_information!=NULL){
|
||||
if(req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList!=NULL){
|
||||
LOG_I(NR_RRC, "Length of ue_CapabilityRAT_ContainerList is: %d \n", (int) req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList_length);
|
||||
struct NR_UE_CapabilityRAT_ContainerList *ue_CapabilityRAT_ContainerList = NULL;
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_UE_CapabilityRAT_ContainerList,
|
||||
(void **)&ue_CapabilityRAT_ContainerList,
|
||||
(uint8_t *)req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList,
|
||||
(int) req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList_length);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"UE Capability RAT ContainerList decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_NR_UE_CapabilityRAT_ContainerList, ue_CapabilityRAT_ContainerList, 1 );
|
||||
return;
|
||||
}
|
||||
//To fill ue_context.UE_Capability_MRDC, ue_context.UE_Capability_nr ...
|
||||
int NR_index = -1;
|
||||
for(int i = 0;i < ue_CapabilityRAT_ContainerList->list.count; i++){
|
||||
if(ue_CapabilityRAT_ContainerList->list.array[i]->rat_Type ==
|
||||
NR_RAT_Type_nr){
|
||||
LOG_I(NR_RRC, "DU received NR_RAT_Type_nr UE capabilities Info through the UE Context Setup Request from the CU \n");
|
||||
if(ue_context_p->ue_context.UE_Capability_nr){
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability,ue_context_p->ue_context.UE_Capability_nr);
|
||||
ue_context_p->ue_context.UE_Capability_nr = 0;
|
||||
}
|
||||
|
||||
dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_NR_UE_NR_Capability,
|
||||
(void**)&ue_context_p->ue_context.UE_Capability_nr,
|
||||
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.buf,
|
||||
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.size,
|
||||
0,0);
|
||||
if(LOG_DEBUGFLAG(DEBUG_ASN1)){
|
||||
xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,ue_context_p->ue_context.UE_Capability_nr);
|
||||
}
|
||||
|
||||
if((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)){
|
||||
LOG_E(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" Failed to decode nr UE capabilities (%zu bytes)\n",
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(&ctxt),dec_rval.consumed);
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability,ue_context_p->ue_context.UE_Capability_nr);
|
||||
ue_context_p->ue_context.UE_Capability_nr = 0;
|
||||
}
|
||||
|
||||
ue_context_p->ue_context.UE_Capability_size =
|
||||
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.size;
|
||||
if(NR_index != -1){
|
||||
LOG_E(NR_RRC,"fatal: more than 1 eutra capability\n");
|
||||
exit(1);
|
||||
}
|
||||
NR_index = i;
|
||||
}
|
||||
|
||||
if(ue_CapabilityRAT_ContainerList->list.array[i]->rat_Type ==
|
||||
NR_RAT_Type_eutra_nr){
|
||||
LOG_I(NR_RRC, "DU received NR_RAT_Type_eutra_nr UE capabilities Info through the UE Context Setup Request from the CU \n");
|
||||
if(ue_context_p->ue_context.UE_Capability_MRDC){
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_UE_MRDC_Capability,ue_context_p->ue_context.UE_Capability_MRDC);
|
||||
ue_context_p->ue_context.UE_Capability_MRDC = 0;
|
||||
}
|
||||
dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_NR_UE_MRDC_Capability,
|
||||
(void**)&ue_context_p->ue_context.UE_Capability_MRDC,
|
||||
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.buf,
|
||||
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.size,
|
||||
0,0);
|
||||
if(LOG_DEBUGFLAG(DEBUG_ASN1)){
|
||||
xer_fprint(stdout,&asn_DEF_NR_UE_MRDC_Capability,ue_context_p->ue_context.UE_Capability_MRDC);
|
||||
}
|
||||
|
||||
if((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)){
|
||||
LOG_E(NR_RRC,PROTOCOL_NR_RRC_CTXT_FMT" Failed to decode nr UE capabilities (%zu bytes)\n",
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(&ctxt),dec_rval.consumed);
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_UE_MRDC_Capability,ue_context_p->ue_context.UE_Capability_MRDC);
|
||||
ue_context_p->ue_context.UE_Capability_MRDC = 0;
|
||||
}
|
||||
ue_context_p->ue_context.UE_MRDC_Capability_size =
|
||||
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.size;
|
||||
}
|
||||
|
||||
if(ue_CapabilityRAT_ContainerList->list.array[i]->rat_Type ==
|
||||
NR_RAT_Type_eutra){
|
||||
//TODO
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t drb_id_to_setup_start = 0;
|
||||
uint8_t nb_drb_to_setup = 0;
|
||||
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu sessions with a default preiority (will be dynamique in future)
|
||||
@@ -3331,11 +3441,25 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
|
||||
}
|
||||
}
|
||||
|
||||
NR_CellGroupConfig_t *cellGroupConfig;
|
||||
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
|
||||
fill_mastercellGroupConfig(cellGroupConfig, ue_context_p->ue_context.masterCellGroup, rrc->um_on_default_drb, SRB2_config ? 1 : 0, drb_id_to_setup_start, nb_drb_to_setup, drb_priority);
|
||||
NR_CellGroupConfig_t *cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
|
||||
if (req->srbs_to_be_setup_length > 0 || req->drbs_to_be_setup_length>0)
|
||||
// FIXME: fill_mastercellGroupConfig() won't fill the right priorities or
|
||||
// bearer IDs for the DRBs
|
||||
fill_mastercellGroupConfig(cellGroupConfig, ue_context_p->ue_context.masterCellGroup, rrc->um_on_default_drb, SRB2_config ? 1 : 0, drb_id_to_setup_start, nb_drb_to_setup, drb_priority);
|
||||
|
||||
apply_macrlc_config(rrc, ue_context_p, &ctxt);
|
||||
|
||||
if(req->rrc_container_length > 0){
|
||||
mem_block_t *pdcp_pdu_p = get_free_mem_block(req->rrc_container_length, __func__);
|
||||
memcpy(&pdcp_pdu_p->data[0], req->rrc_container, req->rrc_container_length);
|
||||
du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, req->rrc_container_length, pdcp_pdu_p);
|
||||
LOG_I(F1AP, "Printing RRC Container of UE context setup request: \n");
|
||||
for (int j=0; j<req->rrc_container_length; j++){
|
||||
printf("%02x ", pdcp_pdu_p->data[j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* Fill the UE context setup response ITTI message to send to F1AP */
|
||||
resp->gNB_CU_ue_id = req->gNB_CU_ue_id;
|
||||
resp->rnti = ctxt.rnti;
|
||||
@@ -3370,17 +3494,174 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
|
||||
else{
|
||||
LOG_W(NR_RRC, "No SRB added upon reception of F1 UE Context setup request at the DU\n");
|
||||
}
|
||||
resp->du_to_cu_rrc_information = calloc(1,1024*sizeof(uint8_t));
|
||||
/* fixme:
|
||||
* Here we should be encoding the updates on cellgroupconfig based on the content of UE capabilities
|
||||
*/
|
||||
resp->du_to_cu_rrc_information = calloc(1, sizeof(du_to_cu_rrc_information_t));
|
||||
resp->du_to_cu_rrc_information->cellGroupConfig = calloc(1,1024);
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
|
||||
NULL,
|
||||
(void *)cellGroupConfig,
|
||||
resp->du_to_cu_rrc_information,
|
||||
ue_context_p->ue_context.masterCellGroup, //(void *)cellGroupConfig,
|
||||
resp->du_to_cu_rrc_information->cellGroupConfig,
|
||||
1024);
|
||||
resp->du_to_cu_rrc_information_length = (enc_rval.encoded+7)>>3;
|
||||
if (enc_rval.encoded == -1) {
|
||||
LOG_E(F1AP,"Could not encode ue_context.masterCellGroup, failed element %s\n",enc_rval.failed_type->name);
|
||||
exit(-1);
|
||||
}
|
||||
resp->du_to_cu_rrc_information->cellGroupConfig_length = (enc_rval.encoded+7)>>3;
|
||||
free(cellGroupConfig);
|
||||
itti_send_msg_to_task (TASK_DU_F1, ctxt.module_id, message_p);
|
||||
}
|
||||
|
||||
static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, const char *msg_name, instance_t instance){
|
||||
|
||||
f1ap_ue_context_setup_t * req=&F1AP_UE_CONTEXT_MODIFICATION_REQ(msg_p);
|
||||
protocol_ctxt_t ctxt;
|
||||
ctxt.rnti = req->rnti;
|
||||
ctxt.module_id = instance;
|
||||
ctxt.instance = instance;
|
||||
ctxt.enb_flag = 1;
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
|
||||
gNB_MAC_INST *mac = RC.nrmac[ctxt.module_id];
|
||||
struct rrc_gNB_ue_context_s *ue_context_p =
|
||||
rrc_gNB_get_ue_context(rrc, ctxt.rnti);
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_MODIFICATION_RESP);
|
||||
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_MODIFICATION_RESP(message_p);
|
||||
uint32_t incoming_teid = 0;
|
||||
NR_CellGroupConfig_t *cellGroupConfig = NULL;
|
||||
|
||||
/* Configure SRB2 */
|
||||
NR_SRB_ToAddMod_t *SRB2_config = NULL;
|
||||
NR_SRB_ToAddModList_t *SRB_configList = NULL;
|
||||
uint8_t SRBs_before_new_addition = 0;
|
||||
|
||||
if(req->srbs_to_be_setup_length>0){
|
||||
if(ue_context_p->ue_context.SRB_configList == NULL){
|
||||
LOG_W(NR_RRC, "The SRB list of the UE context is empty before the addition of new SRB at the DU \n");
|
||||
ue_context_p->ue_context.SRB_configList = CALLOC(1, sizeof(*ue_context_p->ue_context.SRB_configList));
|
||||
}
|
||||
SRB_configList = ue_context_p->ue_context.SRB_configList;
|
||||
SRBs_before_new_addition = SRB_configList->list.count;
|
||||
for (int i=0; i<req->srbs_to_be_setup_length; i++){
|
||||
SRB2_config = CALLOC(1, sizeof(*SRB2_config));
|
||||
SRB2_config->srb_Identity = req->srbs_to_be_setup[i].srb_id;
|
||||
ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config);
|
||||
}
|
||||
}
|
||||
|
||||
/* Configure DRB */
|
||||
NR_DRB_ToAddMod_t *DRB_config = NULL;
|
||||
NR_DRB_ToAddModList_t *DRB_configList = NULL;
|
||||
if(req->drbs_to_be_setup_length>0){
|
||||
if(ue_context_p->ue_context.DRB_configList == NULL){
|
||||
ue_context_p->ue_context.DRB_configList = CALLOC(1, sizeof(*ue_context_p->ue_context.DRB_configList));
|
||||
}
|
||||
DRB_configList = ue_context_p->ue_context.DRB_configList;
|
||||
for (int i=0; i<req->drbs_to_be_setup_length; i++){
|
||||
DRB_config = CALLOC(1, sizeof(*DRB_config));
|
||||
DRB_config->drb_Identity = req->drbs_to_be_setup[i].drb_id;
|
||||
ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config);
|
||||
f1ap_drb_to_be_setup_t drb_p = req->drbs_to_be_setup[i];
|
||||
transport_layer_addr_t addr;
|
||||
memcpy(addr.buffer, &drb_p.up_ul_tnl[0].tl_address, sizeof(drb_p.up_ul_tnl[0].tl_address));
|
||||
addr.length=sizeof(drb_p.up_ul_tnl[0].tl_address)*8;
|
||||
extern instance_t DUuniqInstance;
|
||||
incoming_teid=newGtpuCreateTunnel(DUuniqInstance,
|
||||
req->rnti,
|
||||
drb_p.drb_id,
|
||||
drb_p.drb_id,
|
||||
drb_p.up_ul_tnl[0].teid,
|
||||
addr,
|
||||
drb_p.up_ul_tnl[0].port,
|
||||
DURecvCb);
|
||||
}
|
||||
}
|
||||
|
||||
if(req->srbs_to_be_setup_length>0 || req->drbs_to_be_setup_length>0){
|
||||
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
|
||||
uint8_t drb_id_to_setup_start = 1;
|
||||
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu sessions with a default preiority (will be dynamique in future)
|
||||
fill_mastercellGroupConfig(cellGroupConfig,
|
||||
ue_context_p->ue_context.masterCellGroup,
|
||||
rrc->um_on_default_drb,
|
||||
drb_id_to_setup_start < 2 ? 1 : 0,
|
||||
drb_id_to_setup_start,
|
||||
req->drbs_to_be_setup_length,
|
||||
drb_priority);
|
||||
apply_macrlc_config(rrc, ue_context_p, &ctxt);
|
||||
}
|
||||
if(req->ReconfigComplOutcome == RRCreconf_failure){
|
||||
LOG_W(NR_RRC, "CU reporting RRC Reconfiguration failure \n");
|
||||
}
|
||||
else if(req->ReconfigComplOutcome == RRCreconf_success){
|
||||
LOG_I(NR_RRC, "CU reporting RRC Reconfiguration success \n");
|
||||
if(ue_context_p->ue_context.DRB_configList!=NULL){
|
||||
LOG_I(NR_RRC, "Send first DDD buffer status reporting towards the CU through an ITTI message to gtp-u \n");
|
||||
uint8_t drb_id = ue_context_p->ue_context.DRB_configList->list.array[0]->drb_Identity;
|
||||
rnti_t rnti = ue_context_p->ue_context.rnti;
|
||||
int rlc_tx_buffer_space = nr_rlc_get_available_tx_space(rnti, drb_id);
|
||||
LOG_I(NR_RRC, "Reported in DDD drb_id:%d, rnti:%d\n", drb_id, rnti);
|
||||
MessageDef *msg = itti_alloc_new_message_sized(TASK_RRC_GNB, 0, GTPV1U_DU_BUFFER_REPORT_REQ,
|
||||
sizeof(gtpv1u_gnb_tunnel_data_req_t));
|
||||
gtpv1u_DU_buffer_report_req_t *req=>PV1U_DU_BUFFER_REPORT_REQ(msg);
|
||||
req->pdusession_id = drb_id;
|
||||
req->rnti = rnti;
|
||||
req->buffer_availability = rlc_tx_buffer_space; //10000000; //Hardcoding to be removed and read the actual RLC buffer availability instead
|
||||
extern instance_t DUuniqInstance;
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Fill the UE context setup response ITTI message to send to F1AP */
|
||||
resp->gNB_CU_ue_id = req->gNB_CU_ue_id;
|
||||
resp->rnti = ctxt.rnti;
|
||||
if(DRB_configList){
|
||||
if(DRB_configList->list.count > 0){
|
||||
resp->drbs_to_be_setup = calloc(1,DRB_configList->list.count*sizeof(f1ap_drb_to_be_setup_t));
|
||||
resp->drbs_to_be_setup_length = DRB_configList->list.count;
|
||||
for (int i=0; i<DRB_configList->list.count; i++){
|
||||
resp->drbs_to_be_setup[i].drb_id = DRB_configList->list.array[i]->drb_Identity;
|
||||
resp->drbs_to_be_setup[i].rlc_mode = RLC_MODE_AM;
|
||||
resp->drbs_to_be_setup[i].up_dl_tnl[0].teid = incoming_teid;
|
||||
resp->drbs_to_be_setup[i].up_dl_tnl[0].tl_address = inet_addr(mac->eth_params_n.my_addr);
|
||||
resp->drbs_to_be_setup[i].up_dl_tnl_length = 1;
|
||||
}
|
||||
}
|
||||
else{
|
||||
LOG_W(NR_RRC, "No DRB added upon reception of F1 UE context modification request with a DRB to setup list\n");
|
||||
}
|
||||
}
|
||||
if(SRB_configList){
|
||||
if(SRB_configList->list.count >0 && SRBs_before_new_addition < SRB_configList->list.count){
|
||||
resp->srbs_to_be_setup = calloc(1,req->srbs_to_be_setup_length*sizeof(f1ap_srb_to_be_setup_t));
|
||||
resp->srbs_to_be_setup_length = req->srbs_to_be_setup_length;
|
||||
for (int i=SRBs_before_new_addition; i<SRB_configList->list.count; i++){
|
||||
resp->srbs_to_be_setup[i-SRBs_before_new_addition].srb_id = SRB_configList->list.array[i]->srb_Identity;
|
||||
}
|
||||
}
|
||||
else{
|
||||
LOG_W(NR_RRC, "No SRB added upon reception of F1 UE Context modification request at the DU\n");
|
||||
}
|
||||
}
|
||||
else{
|
||||
LOG_W(NR_RRC, "No SRB added upon reception of F1 UE Context modification request at the DU\n");
|
||||
}
|
||||
|
||||
//if(cellGroupConfig != NULL) {
|
||||
resp->du_to_cu_rrc_information = calloc(1,sizeof(du_to_cu_rrc_information_t));
|
||||
resp->du_to_cu_rrc_information->cellGroupConfig = calloc(1,1024);
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
|
||||
NULL,
|
||||
ue_context_p->ue_context.masterCellGroup, //(void *)cellGroupConfig,
|
||||
resp->du_to_cu_rrc_information->cellGroupConfig,
|
||||
1024);
|
||||
resp->du_to_cu_rrc_information->cellGroupConfig_length = (enc_rval.encoded+7)>>3;
|
||||
//}
|
||||
itti_send_msg_to_task (TASK_DU_F1, ctxt.module_id, message_p);
|
||||
}
|
||||
|
||||
static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const char *msg_name, instance_t instance){
|
||||
|
||||
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(msg_p);
|
||||
@@ -3396,8 +3677,8 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const ch
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_CellGroupConfig,
|
||||
(void **)&cellGroupConfig,
|
||||
(uint8_t *)resp->du_to_cu_rrc_information,
|
||||
(int) resp->du_to_cu_rrc_information_length);
|
||||
(uint8_t *)resp->du_to_cu_rrc_information->cellGroupConfig,
|
||||
(int) resp->du_to_cu_rrc_information->cellGroupConfig_length);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"Cell group config decode error\n");
|
||||
@@ -3412,20 +3693,89 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const ch
|
||||
}
|
||||
if(cellGroupConfig->rlc_BearerToAddModList!=NULL){
|
||||
if(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList != NULL){
|
||||
LOG_I(NR_RRC, "rlc_BearerToAddModList not empty before filling it \n");
|
||||
free(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList);
|
||||
int ue_ctxt_rlc_Bearers = ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list.count;
|
||||
for(int i=ue_ctxt_rlc_Bearers; i<ue_ctxt_rlc_Bearers + cellGroupConfig->rlc_BearerToAddModList->list.count; i++){
|
||||
ASN_SEQUENCE_ADD(&ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list,
|
||||
cellGroupConfig->rlc_BearerToAddModList->list.array[i-ue_ctxt_rlc_Bearers]);
|
||||
}
|
||||
}
|
||||
ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
|
||||
memcpy(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList, cellGroupConfig->rlc_BearerToAddModList,
|
||||
else{
|
||||
LOG_W(NR_RRC, "Empty rlc_BearerToAddModList at ue_context of the CU before filling the updates from UE context setup response \n");
|
||||
ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
|
||||
memcpy(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList, cellGroupConfig->rlc_BearerToAddModList,
|
||||
sizeof(*cellGroupConfig->rlc_BearerToAddModList));
|
||||
}
|
||||
}
|
||||
xer_fprint(stdout,&asn_DEF_NR_CellGroupConfig, ue_context_p->ue_context.masterCellGroup);
|
||||
|
||||
if (ue_context_p->ue_context.established_pdu_sessions_flag == 1) {
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, cellGroupConfig);
|
||||
} else {
|
||||
rrc_gNB_generate_defaultRRCReconfiguration(&ctxt, ue_context_p);
|
||||
}
|
||||
|
||||
free(cellGroupConfig->rlc_BearerToAddModList);
|
||||
free(cellGroupConfig);
|
||||
|
||||
}
|
||||
|
||||
static void rrc_CU_process_ue_context_modification_response(MessageDef *msg_p, const char *msg_name, instance_t instance){
|
||||
|
||||
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(msg_p);
|
||||
protocol_ctxt_t ctxt;
|
||||
ctxt.rnti = resp->rnti;
|
||||
ctxt.module_id = instance;
|
||||
ctxt.instance = instance;
|
||||
ctxt.enb_flag = 1;
|
||||
ctxt.eNB_index = instance;
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(rrc, ctxt.rnti);
|
||||
NR_CellGroupConfig_t *cellGroupConfig = NULL;
|
||||
|
||||
if(resp->du_to_cu_rrc_information->cellGroupConfig!=NULL){
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_CellGroupConfig,
|
||||
(void **)&cellGroupConfig,
|
||||
(uint8_t *)resp->du_to_cu_rrc_information->cellGroupConfig,
|
||||
(int) resp->du_to_cu_rrc_information->cellGroupConfig_length);
|
||||
|
||||
if((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"Cell group config decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_NR_CellGroupConfig, cellGroupConfig, 1 );
|
||||
return;
|
||||
}
|
||||
//xer_fprint(stdout,&asn_DEF_NR_CellGroupConfig, cellGroupConfig);
|
||||
|
||||
if(ue_context_p->ue_context.masterCellGroup == NULL){
|
||||
ue_context_p->ue_context.masterCellGroup = calloc(1, sizeof(NR_CellGroupConfig_t));
|
||||
}
|
||||
|
||||
if(cellGroupConfig->rlc_BearerToAddModList!=NULL){
|
||||
if(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList != NULL){
|
||||
int ue_ctxt_rlc_Bearers = ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list.count;
|
||||
for(int i=ue_ctxt_rlc_Bearers; i<ue_ctxt_rlc_Bearers + cellGroupConfig->rlc_BearerToAddModList->list.count; i++){
|
||||
ASN_SEQUENCE_ADD(&ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list,
|
||||
cellGroupConfig->rlc_BearerToAddModList->list.array[i-ue_ctxt_rlc_Bearers]);
|
||||
}
|
||||
}
|
||||
else{
|
||||
LOG_W(NR_RRC, "Empty rlc_BearerToAddModList at ue_context of the CU before filling the updates from UE context setup response \n");
|
||||
ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
|
||||
memcpy(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList, cellGroupConfig->rlc_BearerToAddModList,
|
||||
sizeof(*cellGroupConfig->rlc_BearerToAddModList));
|
||||
}
|
||||
}
|
||||
LOG_I(NR_RRC, "Updated master cell group configuration stored at the UE context of the CU:\n");
|
||||
xer_fprint(stdout,&asn_DEF_NR_CellGroupConfig, ue_context_p->ue_context.masterCellGroup);
|
||||
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, cellGroupConfig);
|
||||
|
||||
free(cellGroupConfig->rlc_BearerToAddModList);
|
||||
free(cellGroupConfig);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int mask_flip(unsigned int x) {
|
||||
return((((x>>8) + (x<<8))&0xffff)>>6);
|
||||
}
|
||||
@@ -3627,15 +3977,27 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
|
||||
// Remove here the MAC and RRC context when RRC is not connected or gNB is not connected to CN5G
|
||||
if(ue_context_p->ue_context.StatusRrc < NR_RRC_CONNECTED || ue_context_p->ue_context.gNB_ue_ngap_id == 0) {
|
||||
mac_remove_nr_ue(nrmac, ctxt_pP->rnti);
|
||||
rrc_rlc_remove_ue(ctxt_pP);
|
||||
pdcp_remove_UE(ctxt_pP);
|
||||
if(!NODE_IS_CU(RC.nrrrc[ctxt_pP->instance]->node_type)){
|
||||
mac_remove_nr_ue(nrmac, ctxt_pP->rnti);
|
||||
rrc_rlc_remove_ue(ctxt_pP);
|
||||
pdcp_remove_UE(ctxt_pP);
|
||||
|
||||
/* remove RRC UE Context */
|
||||
ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti);
|
||||
if (ue_context_p) {
|
||||
rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p);
|
||||
LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti);
|
||||
/* remove RRC UE Context */
|
||||
ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti);
|
||||
if (ue_context_p) {
|
||||
rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p);
|
||||
LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti);
|
||||
}
|
||||
}
|
||||
// In case of CU trigger UE context release command towards the DU
|
||||
else{
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_RELEASE_CMD);
|
||||
f1ap_ue_context_release_cmd_t *rel_cmd=&F1AP_UE_CONTEXT_RELEASE_CMD (message_p);
|
||||
rel_cmd->rnti = ctxt_pP->rnti;
|
||||
rel_cmd->cause = F1AP_CAUSE_RADIO_NETWORK;
|
||||
rel_cmd->cause_value = 10; // 10 = F1AP_CauseRadioNetwork_normal_release
|
||||
itti_send_msg_to_task(TASK_CU_F1, ctxt_pP->module_id, message_p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3821,17 +4183,30 @@ void *rrc_gnb_task(void *args_p) {
|
||||
rrc_gNB_process_f1_setup_req(&F1AP_SETUP_REQ(msg_p));
|
||||
break;
|
||||
|
||||
case NR_DU_RRC_DL_INDICATION:
|
||||
rrc_process_DU_DL(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
case NR_DU_RRC_DL_INDICATION:
|
||||
rrc_process_DU_DL(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_SETUP_REQ:
|
||||
rrc_DU_process_ue_context_setup_request(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
case F1AP_UE_CONTEXT_SETUP_REQ:
|
||||
rrc_DU_process_ue_context_setup_request(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_SETUP_RESP:
|
||||
rrc_CU_process_ue_context_setup_response(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
case F1AP_UE_CONTEXT_SETUP_RESP:
|
||||
rrc_CU_process_ue_context_setup_response(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_MODIFICATION_RESP:
|
||||
rrc_CU_process_ue_context_modification_response(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_MODIFICATION_REQ:
|
||||
rrc_DU_process_ue_context_modification_request(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_RELEASE_CMD:
|
||||
LOG_W(NR_RRC, "Received F1AP_UE_CONTEXT_RELEASE_CMD for processing at the RRC layer of the DU. Processing function "
|
||||
"implementation is pending\n");
|
||||
break;
|
||||
|
||||
/* Messages from X2AP */
|
||||
case X2AP_ENDC_SGNB_ADDITION_REQ:
|
||||
@@ -4102,5 +4477,6 @@ void nr_rrc_trigger(protocol_ctxt_t *ctxt, int CC_id, int frame, int subframe)
|
||||
message_p = itti_alloc_new_message(TASK_RRC_GNB, 0, RRC_SUBFRAME_PROCESS);
|
||||
RRC_SUBFRAME_PROCESS(message_p).ctxt = *ctxt;
|
||||
RRC_SUBFRAME_PROCESS(message_p).CC_id = CC_id;
|
||||
LOG_D(NR_RRC, "Time in RRC: %u/ %u \n", frame, subframe);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, ctxt->module_id, message_p);
|
||||
}
|
||||
|
||||
@@ -307,7 +307,6 @@ nr_rrc_pdcp_config_security(
|
||||
//uint8_t *k_kdf = NULL;
|
||||
static int print_keys= 1;
|
||||
|
||||
|
||||
/* Derive the keys from kgnb */
|
||||
if (SRB_configList != NULL) {
|
||||
nr_derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm,
|
||||
@@ -1050,7 +1049,46 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
|
||||
// TEST
|
||||
// ue_context_p->ue_context.pdusession[0].status = PDU_SESSION_STATUS_DONE;
|
||||
// rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(&ctxt, ue_context_p, 0);
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p);
|
||||
if(!NODE_IS_CU(RC.nrrrc[ctxt.module_id]->node_type)){
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, NULL);
|
||||
}
|
||||
else{
|
||||
/*Generate a UE context modification request message towards the DU to instruct the DU
|
||||
*for SRB2 and DRB configuration and get the updates on master cell group config from the DU*/
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_MODIFICATION_REQ);
|
||||
f1ap_ue_context_setup_t *req=&F1AP_UE_CONTEXT_MODIFICATION_REQ (message_p);
|
||||
req->rnti = ue_context_p->ue_context.rnti;
|
||||
req->mcc = RC.nrrrc[ctxt.module_id]->configuration.mcc[0];
|
||||
req->mnc = RC.nrrrc[ctxt.module_id]->configuration.mnc[0];
|
||||
req->mnc_digit_length = RC.nrrrc[ctxt.module_id]->configuration.mnc_digit_length[0];
|
||||
req->nr_cellid = RC.nrrrc[ctxt.module_id]->nr_cellid;
|
||||
|
||||
/*Instruction towards the DU for SRB2 configuration*/
|
||||
req->srbs_to_be_setup = malloc(1*sizeof(f1ap_srb_to_be_setup_t));
|
||||
req->srbs_to_be_setup_length = 1;
|
||||
f1ap_srb_to_be_setup_t *SRBs=req->srbs_to_be_setup;
|
||||
SRBs[0].srb_id = 2;
|
||||
SRBs[0].lcid = 2;
|
||||
|
||||
/*Instruction towards the DU for DRB configuration and tunnel creation*/
|
||||
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req;
|
||||
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
|
||||
req->drbs_to_be_setup = malloc(1*sizeof(f1ap_drb_to_be_setup_t));
|
||||
req->drbs_to_be_setup_length = 1;
|
||||
f1ap_drb_to_be_setup_t *DRBs=req->drbs_to_be_setup;
|
||||
LOG_D(RRC, "Length of DRB list:%d \n", req->drbs_to_be_setup_length);
|
||||
DRBs[0].drb_id = 1;
|
||||
DRBs[0].rlc_mode = RLC_MODE_AM;
|
||||
DRBs[0].up_ul_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt.module_id]->eth_params_s.my_addr);
|
||||
DRBs[0].up_ul_tnl[0].port=RC.nrrrc[ctxt.module_id]->eth_params_s.my_portd;
|
||||
DRBs[0].up_ul_tnl_length = 1;
|
||||
DRBs[0].up_dl_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt.module_id]->eth_params_s.remote_addr);
|
||||
DRBs[0].up_dl_tnl[0].port=RC.nrrrc[ctxt.module_id]->eth_params_s.remote_portd;
|
||||
DRBs[0].up_dl_tnl_length = 1;
|
||||
|
||||
itti_send_msg_to_task (TASK_CU_F1, ctxt.module_id, message_p);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user