Commit 99962b55 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/reworking_BWP_configuration' into integration_2025_w37 (!3607)

Reworking BWP configuration

This MR reworks the configuration via fail of additional BWPs. Moreover, it
allows for a single BWP to be configured for a given UE at a given time (BWP
switch possible only via reconfiguration). It also reworks PTRS configuration
for consistency with the BWP one.
parents 743d342a 18041e3c
...@@ -146,18 +146,8 @@ gNBs = ...@@ -146,18 +146,8 @@ gNBs =
); );
servingCellConfigDedicated = ({ first_active_bwp = 1;
dl_bwp-Id_1 = 1; bwp_list = ({ scs = 1; bwpStart = 0; bwpSize = 106;});
dl_bwp1_locationAndBandwidth = 28875; # RBstart=0, L=106 (275*(L-1))+RBstart
dl_bwp1_subcarrierSpacing = 1;
firstActiveDownlinkBWP-Id = 1;
defaultDownlinkBWP-Id = 1;
ul_bwp-Id_1 = 1;
ul_bwp1_locationAndBandwidth = 28875; # RBstart=0, L=106 (275*(L-1))+RBstart
ul_bwp1_subcarrierSpacing = 1;
firstActiveUplinkBWP-Id = 1;
});
# ------- SCTP definitions # ------- SCTP definitions
SCTP : SCTP :
......
...@@ -145,64 +145,10 @@ gNBs = ...@@ -145,64 +145,10 @@ gNBs =
); );
# Dedicated Serving Cell Configuration first_active_bwp = 1;
servingCellConfigDedicated = ({ bwp_list = ({ scs = 1; bwpStart = 0; bwpSize = 106;},
# BWP-Downlink { scs = 1; bwpStart = 0; bwpSize = 51;},
# BWP 1 Configuration { scs = 1; bwpStart = 0; bwpSize = 24;});
dl_bwp-Id_1 = 1;
dl_bwp1_locationAndBandwidth = 28875; // RBstart=0, L=106 (40 MHz BW)
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
dl_bwp1_subcarrierSpacing = 1;
# BWP 2 Configuration
dl_bwp-Id_2 = 2;
dl_bwp2_locationAndBandwidth = 13750; // RBstart=0, L=51 (20 MHz BW)
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
dl_bwp2_subcarrierSpacing = 1;
# BWP 3 Configuration
dl_bwp-Id_3 = 3;
dl_bwp3_locationAndBandwidth = 6325; // RBstart=0, L=24 (10 MHz BW)
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
dl_bwp3_subcarrierSpacing = 1;
firstActiveDownlinkBWP-Id = 1; #BWP-Id
defaultDownlinkBWP-Id = 1; #BWP-Id
# bwp-InactivityTimer ENUMERATED {ms2, ms3, ms4, ms5, ms6, ms8, ms10, ms20, ms30,
# ms40,ms50, ms60, ms80,ms100, ms200,ms300, ms500,
# ms750, ms1280, ms1920, ms2560, spare10, spare9, spare8,
# spare7, spare6, spare5, spare4, spare3, spare2, spare1 }
# UplinkConfig
# BWP-Uplink
# BWP 1 Configuration
ul_bwp-Id_1 = 1;
ul_bwp1_locationAndBandwidth = 28875; // RBstart=0, L=106 (40 MHz BW)
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
ul_bwp1_subcarrierSpacing = 1;
# BWP 2 Configuration
ul_bwp-Id_2 = 2;
ul_bwp2_locationAndBandwidth = 13750; // RBstart=0, L=51 (20 MHz BW)
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
ul_bwp2_subcarrierSpacing = 1;
# BWP 3 Configuration
ul_bwp-Id_3 = 3;
ul_bwp3_locationAndBandwidth = 6325; // RBstart=0, L=24 (10 MHz BW)
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
ul_bwp3_subcarrierSpacing = 1;
firstActiveUplinkBWP-Id = 1; #BWP-Id
}
);
# ------- SCTP definitions # ------- SCTP definitions
......
...@@ -17,35 +17,28 @@ A UE can be configured with a set of 4 BWPs in uplink (UL) and downlink (DL) dir ...@@ -17,35 +17,28 @@ A UE can be configured with a set of 4 BWPs in uplink (UL) and downlink (DL) dir
A maximum of 4 dedicated BWPs can be configured for a UE. A maximum of 4 dedicated BWPs can be configured for a UE.
To configure multiple BWPs, add the following parameters to the gNB configuration file under "servingCellConfigDedicated": To configure multiple BWPs, add the following parameters in the physical parameters section:
## Setup of the Configuration files ## ## Setup of the Configuration files ##
In the configuration file you have the option to select the 1st active BWP, the RIV and SCS of each BWP in the following way (example with 3 additional BWPs):
``` ```
firstActiveDownlinkBWP-Id = 1; #BWP-Id first_active_bwp = 1;
defaultDownlinkBWP-Id = 1; #BWP-Id bwp_list = ({ scs = 1; bwpStart = 0; bwpSize = 106;},
firstActiveUplinkBWP-Id = 1; #BWP-Id { scs = 1; bwpStart = 0; bwpSize = 51;},
{ scs = 1; bwpStart = 0; bwpSize = 24;});
``` ```
Each dedicated BWP must have: This example configures 3 additional BWPs, with IDs from 1 to 3. Find these parameters in this configuration file: "ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf"
```
# BWP 1 Configuration
dl_bwp-Id_1 = 1;
dl_bwp1_locationAndBandwidth = 28875; // RBstart=0, L=106 (40 MHz BW)
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
dl_bwp1_subcarrierSpacing = 1;
```
Find these parameters in this configuration file: "targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf"
# Testing gNB and UE in RF simulator # Testing gNB and UE in RF simulator
## gNB command: ## gNB command:
``` ```
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim sudo ./nr-softmodem -O ../../../ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf --rfsim --rfsimulator.serveraddr server
``` ```
## UE command: ## UE command:
``` ```
sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 208990000000001 --rfsimulator.serveraddr 127.0.0.1 sudo ./nr-uesoftmodem -C 3319680000 -r 106 --numerology 1 --ssb 516 --band 78 --rfsim --rfsimulator.serveraddr 127.0.0.1
``` ```
...@@ -701,6 +701,8 @@ printf("%d\n", slot); ...@@ -701,6 +701,8 @@ printf("%d\n", slot);
.minRXTXTIME = 6, .minRXTXTIME = 6,
.do_CSIRS = 0, .do_CSIRS = 0,
.do_SRS = 0, .do_SRS = 0,
.num_dlharq = 16,
.num_ulharq = 16,
.maxMIMO_layers = g_nrOfLayers, .maxMIMO_layers = g_nrOfLayers,
.force_256qam_off = false, .force_256qam_off = false,
.timer_config.sr_ProhibitTimer = 0, .timer_config.sr_ProhibitTimer = 0,
...@@ -743,7 +745,7 @@ printf("%d\n", slot); ...@@ -743,7 +745,7 @@ printf("%d\n", slot);
RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int)); RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int));
for (i = 0; i < RC.nb_nr_macrlc_inst; i++) for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
RC.nb_nr_mac_CC[i] = 1; RC.nb_nr_mac_CC[i] = 1;
mac_top_init_gNB(ngran_gNB, scc, NULL, &conf, &rlc_config); mac_top_init_gNB(ngran_gNB, scc, &conf, &rlc_config);
gNB_mac = RC.nrmac[0]; gNB_mac = RC.nrmac[0];
nr_mac_config_scc(RC.nrmac[0], scc, &conf); nr_mac_config_scc(RC.nrmac[0], scc, &conf);
...@@ -791,11 +793,6 @@ printf("%d\n", slot); ...@@ -791,11 +793,6 @@ printf("%d\n", slot);
NR_ServingCellConfigCommon_t *scc = secondaryCellGroup->spCellConfig->reconfigurationWithSync->spCellConfigCommon; NR_ServingCellConfigCommon_t *scc = secondaryCellGroup->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
*/ */
NR_ServingCellConfig_t *scd = calloc(1,sizeof(*scd));
prepare_scd(scd);
/* removes unnecessary BWPs, if any */
fix_scd(scd);
gNB->ap_N1 = pdsch_AntennaPorts.N1; gNB->ap_N1 = pdsch_AntennaPorts.N1;
gNB->ap_N2 = pdsch_AntennaPorts.N2; gNB->ap_N2 = pdsch_AntennaPorts.N2;
gNB->ap_XP = pdsch_AntennaPorts.XP; gNB->ap_XP = pdsch_AntennaPorts.XP;
...@@ -806,7 +803,7 @@ printf("%d\n", slot); ...@@ -806,7 +803,7 @@ printf("%d\n", slot);
prepare_sim_uecap(UE_Capability_nr, scc, mu, N_RB_DL, g_mcsTableIdx, 0); prepare_sim_uecap(UE_Capability_nr, scc, mu, N_RB_DL, g_mcsTableIdx, 0);
rnti_t rnti = 0x1234; rnti_t rnti = 0x1234;
int uid = 0; int uid = 0;
NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, UE_Capability_nr, 0, 1, &conf, uid); NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, UE_Capability_nr, 0, 1, &conf, uid);
secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc); secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc);
/* -U option modify DMRS */ /* -U option modify DMRS */
......
...@@ -658,6 +658,8 @@ int main(int argc, char *argv[]) ...@@ -658,6 +658,8 @@ int main(int argc, char *argv[])
.minRXTXTIME = 0, .minRXTXTIME = 0,
.do_CSIRS = 0, .do_CSIRS = 0,
.do_SRS = 0, .do_SRS = 0,
.num_dlharq = 16,
.num_ulharq = 16,
.force_256qam_off = false, .force_256qam_off = false,
.timer_config.sr_ProhibitTimer = 0, .timer_config.sr_ProhibitTimer = 0,
.timer_config.sr_TransMax = 64, .timer_config.sr_TransMax = 64,
...@@ -698,19 +700,14 @@ int main(int argc, char *argv[]) ...@@ -698,19 +700,14 @@ int main(int argc, char *argv[])
RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int)); RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int));
for (i = 0; i < RC.nb_nr_macrlc_inst; i++) for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
RC.nb_nr_mac_CC[i] = 1; RC.nb_nr_mac_CC[i] = 1;
mac_top_init_gNB(ngran_gNB, scc, NULL /* scd will be updated further below */, &conf, &rlc_config); mac_top_init_gNB(ngran_gNB, scc, &conf, &rlc_config);
nr_mac_config_scc(RC.nrmac[0], scc, &conf); nr_mac_config_scc(RC.nrmac[0], scc, &conf);
NR_ServingCellConfig_t *scd = calloc(1,sizeof(NR_ServingCellConfig_t));
prepare_scd(scd);
/* removes unnecessary BWPs, if any */
fix_scd(scd);
NR_UE_NR_Capability_t* UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); NR_UE_NR_Capability_t* UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t));
prepare_sim_uecap(UE_Capability_nr, scc, mu, N_RB_UL, 0, mcs_table); prepare_sim_uecap(UE_Capability_nr, scc, mu, N_RB_UL, 0, mcs_table);
rnti_t rnti = 0x1234; rnti_t rnti = 0x1234;
int uid = 0; int uid = 0;
NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, UE_Capability_nr, 0, 1, &conf, uid); NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, UE_Capability_nr, 0, 1, &conf, uid);
secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc); secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc);
NR_BCCH_BCH_Message_t *mib = get_new_MIB_NR(scc); NR_BCCH_BCH_Message_t *mib = get_new_MIB_NR(scc);
......
This diff is collapsed.
This diff is collapsed.
...@@ -138,6 +138,7 @@ typedef enum { ...@@ -138,6 +138,7 @@ typedef enum {
#define GNB_CONFIG_STRING_CU_SIB_LIST "cu_sibs" #define GNB_CONFIG_STRING_CU_SIB_LIST "cu_sibs"
#define GNB_CONFIG_STRING_DU_SIB_LIST "du_sibs" #define GNB_CONFIG_STRING_DU_SIB_LIST "du_sibs"
#define GNB_CONFIG_STRING_DOSINR "do_SINR" #define GNB_CONFIG_STRING_DOSINR "do_SINR"
#define GNB_CONFIG_STRING_1ST_ACTIVE_BWP "first_active_bwp"
#define GNB_CONFIG_HLP_STRING_ENABLE_SDAP "enable the SDAP layer\n" #define GNB_CONFIG_HLP_STRING_ENABLE_SDAP "enable the SDAP layer\n"
#define GNB_CONFIG_HLP_FORCE256QAMOFF "suppress activation of 256 QAM despite UE support" #define GNB_CONFIG_HLP_FORCE256QAMOFF "suppress activation of 256 QAM despite UE support"
...@@ -153,6 +154,7 @@ typedef enum { ...@@ -153,6 +154,7 @@ typedef enum {
#define GNB_CONFIG_HLP_DU_SIBS "List of DU generated SIBs to be transmitted" #define GNB_CONFIG_HLP_DU_SIBS "List of DU generated SIBs to be transmitted"
#define GNB_CONFIG_HLP_DOSINR "Enable CSI feedback using SINR measurements on SSB" #define GNB_CONFIG_HLP_DOSINR "Enable CSI feedback using SINR measurements on SSB"
/*-----------------------------------------------------------------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------------------------------------------------------------*/
/* cell configuration parameters */ /* cell configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
...@@ -199,6 +201,7 @@ typedef enum { ...@@ -199,6 +201,7 @@ typedef enum {
{GNB_CONFIG_STRING_CU_SIB_LIST, GNB_CONFIG_HLP_CU_SIBS, 0, .iptr=NULL, .defintarrayval=0, TYPE_INTARRAY, 0}, \ {GNB_CONFIG_STRING_CU_SIB_LIST, GNB_CONFIG_HLP_CU_SIBS, 0, .iptr=NULL, .defintarrayval=0, TYPE_INTARRAY, 0}, \
{GNB_CONFIG_STRING_DU_SIB_LIST, GNB_CONFIG_HLP_DU_SIBS, 0, .iptr=NULL, .defintarrayval=0, TYPE_INTARRAY, 0}, \ {GNB_CONFIG_STRING_DU_SIB_LIST, GNB_CONFIG_HLP_DU_SIBS, 0, .iptr=NULL, .defintarrayval=0, TYPE_INTARRAY, 0}, \
{GNB_CONFIG_STRING_DOSINR, GNB_CONFIG_HLP_DOSINR, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOSINR, GNB_CONFIG_HLP_DOSINR, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_1ST_ACTIVE_BWP, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
} }
// clang-format on // clang-format on
...@@ -242,6 +245,7 @@ typedef enum { ...@@ -242,6 +245,7 @@ typedef enum {
#define GNB_CU_SIBS_IDX 36 #define GNB_CU_SIBS_IDX 36
#define GNB_DU_SIBS_IDX 37 #define GNB_DU_SIBS_IDX 37
#define GNB_DO_SINR_IDX 38 #define GNB_DO_SINR_IDX 38
#define GNB_1ST_ACTIVE_BWP_IDX 39
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
#define NUM_DL_HARQ_OKVALUES {2,4,6,8,10,12,16,32} #define NUM_DL_HARQ_OKVALUES {2,4,6,8,10,12,16,32}
...@@ -287,9 +291,33 @@ typedef enum { ...@@ -287,9 +291,33 @@ typedef enum {
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
} }
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------------------------------------------------------------------*/
#define GNB_CONFIG_STRING_BWP_LIST "bwp_list"
#define GNB_CONFIG_STRING_BWP_SCS "scs"
#define GNB_CONFIG_STRING_BWP_START "bwpStart"
#define GNB_CONFIG_STRING_BWP_SIZE "bwpSize"
#define GNB_BWP_SCS_IDX 0
#define GNB_BWP_START_IDX 1
#define GNB_BWP_SIZE_IDX 2
#define GNBBWPPARAMS_DESC { \
{GNB_CONFIG_STRING_BWP_SCS, NULL, 0, .iptr=NULL, .defintarrayval=0, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_BWP_START, NULL, 0, .iptr=NULL, .defintarrayval=0, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_BWP_SIZE, NULL, 0, .iptr=NULL, .defintarrayval=0, TYPE_INT, 0}, \
}
#define BWPPARAMS_CHECK { \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Neighbour Cell Configurations*/ /* Neighbour Cell Configurations*/
...@@ -516,6 +544,60 @@ typedef enum { ...@@ -516,6 +544,60 @@ typedef enum {
#define GNB_REDCAP_CELL_BARRED_REDCAP2_RX_R17_IDX 1 #define GNB_REDCAP_CELL_BARRED_REDCAP2_RX_R17_IDX 1
#define GNB_REDCAP_INTRA_FREQ_RESELECTION_REDCAP_R17_IDX 2 #define GNB_REDCAP_INTRA_FREQ_RESELECTION_REDCAP_R17_IDX 2
/*-------------------------------------------------------------------------------------------------------------------------------------*/
/* PTRS configuration parameters */
/*-------------------------------------------------------------------------------------------------------------------------------------*/
#define GNB_CONFIG_STRING_PTRS "phaseTrackingRS"
#define GNB_CONFIG_STRING_DLPTRSFREQDENSITY0_0 "dl_ptrsFreqDensity0_0"
#define GNB_CONFIG_STRING_DLPTRSFREQDENSITY1_0 "dl_ptrsFreqDensity1_0"
#define GNB_CONFIG_STRING_DLPTRSTIMEDENSITY0_0 "dl_ptrsTimeDensity0_0"
#define GNB_CONFIG_STRING_DLPTRSTIMEDENSITY1_0 "dl_ptrsTimeDensity1_0"
#define GNB_CONFIG_STRING_DLPTRSTIMEDENSITY2_0 "dl_ptrsTimeDensity2_0"
#define GNB_CONFIG_STRING_DLPTRSEPRERATIO_0 "dl_ptrsEpreRatio_0"
#define GNB_CONFIG_STRING_DLPTRSREOFFSET_0 "dl_ptrsReOffset_0"
#define GNB_CONFIG_STRING_ULPTRSFREQDENSITY0_0 "ul_ptrsFreqDensity0_0"
#define GNB_CONFIG_STRING_ULPTRSFREQDENSITY1_0 "ul_ptrsFreqDensity1_0"
#define GNB_CONFIG_STRING_ULPTRSTIMEDENSITY0_0 "ul_ptrsTimeDensity0_0"
#define GNB_CONFIG_STRING_ULPTRSTIMEDENSITY1_0 "ul_ptrsTimeDensity1_0"
#define GNB_CONFIG_STRING_ULPTRSTIMEDENSITY2_0 "ul_ptrsTimeDensity2_0"
#define GNB_CONFIG_STRING_ULPTRSREOFFSET_0 "ul_ptrsReOffset_0"
#define GNB_CONFIG_STRING_ULPTRSMAXPORTS_0 "ul_ptrsMaxPorts_0"
#define GNB_CONFIG_STRING_ULPTRSPOWER_0 "ul_ptrsPower_0"
#define GNB_PTRS_PARAMS_DESC { \
{GNB_CONFIG_STRING_DLPTRSFREQDENSITY0_0, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_DLPTRSFREQDENSITY1_0, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_DLPTRSTIMEDENSITY0_0, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_DLPTRSTIMEDENSITY1_0, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_DLPTRSTIMEDENSITY2_0, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_DLPTRSEPRERATIO_0, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_DLPTRSREOFFSET_0, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_ULPTRSFREQDENSITY0_0, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_ULPTRSFREQDENSITY1_0, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_ULPTRSTIMEDENSITY0_0, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_ULPTRSTIMEDENSITY1_0, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_ULPTRSTIMEDENSITY2_0, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_ULPTRSREOFFSET_0, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_ULPTRSMAXPORTS_0, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_ULPTRSPOWER_0, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}}
#define GNB_DLPTRSFREQDENSITY0_0_IDX 0
#define GNB_DLPTRSFREQDENSITY1_0_IDX 1
#define GNB_DLPTRSTIMEDENSITY0_0_IDX 2
#define GNB_DLPTRSTIMEDENSITY1_0_IDX 3
#define GNB_DLPTRSTIMEDENSITY2_0_IDX 4
#define GNB_DLPTRSEPRERATIO_0_IDX 5
#define GNB_DLPTRSREOFFSET_0_IDX 6
#define GNB_ULPTRSFREQDENSITY0_0_IDX 7
#define GNB_ULPTRSFREQDENSITY1_0_IDX 8
#define GNB_ULPTRSTIMEDENSITY0_0_IDX 9
#define GNB_ULPTRSTIMEDENSITY1_0_IDX 10
#define GNB_ULPTRSTIMEDENSITY2_0_IDX 11
#define GNB_ULPTRSREOFFSET_0_IDX 12
#define GNB_ULPTRSMAXPORTS_0_IDX 13
#define GNB_ULPTRSPOWER_0_IDX 14
/*---------------------------------------------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------------------------------------------*/
/* SCTP configuration parameters section name */ /* SCTP configuration parameters section name */
......
...@@ -2680,8 +2680,8 @@ static void configure_BWPs(NR_UE_MAC_INST_t *mac, NR_ServingCellConfig_t *scd) ...@@ -2680,8 +2680,8 @@ static void configure_BWPs(NR_UE_MAC_INST_t *mac, NR_ServingCellConfig_t *scd)
if (scd->downlinkBWP_ToReleaseList) { if (scd->downlinkBWP_ToReleaseList) {
for (int i = 0; i < scd->downlinkBWP_ToReleaseList->list.count; i++) { for (int i = 0; i < scd->downlinkBWP_ToReleaseList->list.count; i++) {
for (int j = 0; j < mac->dl_BWPs.count; j++) { for (int j = 0; j < mac->dl_BWPs.count; j++) {
if (*scd->downlinkBWP_ToReleaseList->list.array[i] == mac->dl_BWPs.array[i]->bwp_id) if (*scd->downlinkBWP_ToReleaseList->list.array[i] == mac->dl_BWPs.array[j]->bwp_id)
release_dl_BWP(mac, i); release_dl_BWP(mac, j);
} }
} }
} }
...@@ -2702,8 +2702,8 @@ static void configure_BWPs(NR_UE_MAC_INST_t *mac, NR_ServingCellConfig_t *scd) ...@@ -2702,8 +2702,8 @@ static void configure_BWPs(NR_UE_MAC_INST_t *mac, NR_ServingCellConfig_t *scd)
if (scd->uplinkConfig->uplinkBWP_ToReleaseList) { if (scd->uplinkConfig->uplinkBWP_ToReleaseList) {
for (int i = 0; i < scd->uplinkConfig->uplinkBWP_ToReleaseList->list.count; i++) { for (int i = 0; i < scd->uplinkConfig->uplinkBWP_ToReleaseList->list.count; i++) {
for (int j = 0; j < mac->ul_BWPs.count; j++) { for (int j = 0; j < mac->ul_BWPs.count; j++) {
if (*scd->uplinkConfig->uplinkBWP_ToReleaseList->list.array[i] == mac->ul_BWPs.array[i]->bwp_id) if (*scd->uplinkConfig->uplinkBWP_ToReleaseList->list.array[i] == mac->ul_BWPs.array[j]->bwp_id)
release_ul_BWP(mac, i); release_ul_BWP(mac, j);
} }
} }
} }
......
...@@ -3473,13 +3473,59 @@ void nr_measgap_scheduling(gNB_MAC_INST *nr_mac, frame_t frame, sub_frame_t slot ...@@ -3473,13 +3473,59 @@ void nr_measgap_scheduling(gNB_MAC_INST *nr_mac, frame_t frame, sub_frame_t slot
} }
} }
void clean_bwp_structures(NR_SpCellConfig_t *spCellConfig)
{
NR_ServingCellConfig_t *spCellConfigDedicated = spCellConfig->spCellConfigDedicated;
if (spCellConfigDedicated->downlinkBWP_ToReleaseList) {
struct NR_ServingCellConfig__downlinkBWP_ToReleaseList *rel_dl = spCellConfigDedicated->downlinkBWP_ToReleaseList;
struct NR_ServingCellConfig__downlinkBWP_ToAddModList *add_dl = spCellConfigDedicated->downlinkBWP_ToAddModList;
int num_rel = rel_dl->list.count;
int num_add = add_dl->list.count;
for (int i = 0; i < num_rel; i++) {
NR_BWP_Id_t *rel_id = rel_dl->list.array[i];
for (int j = 0; j < num_add; j++) {
NR_BWP_Downlink_t *dl_bwp = add_dl->list.array[j];
if (*rel_id == dl_bwp->bwp_Id) {
asn_sequence_del(&add_dl->list, j, 1);
}
}
asn_sequence_del(&rel_dl->list, i, 1);
}
if (rel_dl->list.count == 0)
free_and_zero(rel_dl);
if (add_dl->list.count == 0)
free_and_zero(add_dl);
}
if (spCellConfigDedicated->uplinkConfig->uplinkBWP_ToReleaseList) {
struct NR_UplinkConfig__uplinkBWP_ToReleaseList *rel_ul = spCellConfigDedicated->uplinkConfig->uplinkBWP_ToReleaseList;
struct NR_UplinkConfig__uplinkBWP_ToAddModList *add_ul = spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList;
int num_rel = rel_ul->list.count;
int num_add = add_ul->list.count;
for (int i = 0; i < num_rel; i++) {
NR_BWP_Id_t *rel_id = rel_ul->list.array[i];
for (int j = 0; j < num_add; j++) {
NR_BWP_Uplink_t *ul_bwp = add_ul->list.array[j];
if (*rel_id == ul_bwp->bwp_Id) {
asn_sequence_del(&add_ul->list, j, 1);
}
}
asn_sequence_del(&rel_ul->list, i, 1);
}
if (rel_ul->list.count == 0)
free_and_zero(rel_ul);
if (add_ul->list.count == 0)
free_and_zero(add_ul);
}
}
void nr_mac_clean_cellgroup(NR_CellGroupConfig_t *cell_group) void nr_mac_clean_cellgroup(NR_CellGroupConfig_t *cell_group)
{ {
DevAssert(cell_group != NULL); DevAssert(cell_group != NULL);
NR_SpCellConfig_t *spCellConfig = cell_group->spCellConfig;
/* remove a reconfigurationWithSync, we don't need it anymore */ /* remove a reconfigurationWithSync, we don't need it anymore */
if (cell_group->spCellConfig && cell_group->spCellConfig->reconfigurationWithSync != NULL) { if (spCellConfig && spCellConfig->reconfigurationWithSync != NULL) {
ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, cell_group->spCellConfig->reconfigurationWithSync); ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, spCellConfig->reconfigurationWithSync);
cell_group->spCellConfig->reconfigurationWithSync = NULL; spCellConfig->reconfigurationWithSync = NULL;
} }
/* remove the rlc_BearerToReleaseList, we don't need it anymore */ /* remove the rlc_BearerToReleaseList, we don't need it anymore */
if (cell_group->rlc_BearerToReleaseList != NULL) { if (cell_group->rlc_BearerToReleaseList != NULL) {
...@@ -3491,6 +3537,8 @@ void nr_mac_clean_cellgroup(NR_CellGroupConfig_t *cell_group) ...@@ -3491,6 +3537,8 @@ void nr_mac_clean_cellgroup(NR_CellGroupConfig_t *cell_group)
/* remove reestablishRLC, we don't need it anymore */ /* remove reestablishRLC, we don't need it anymore */
for (int i = 0; i < cell_group->rlc_BearerToAddModList->list.count; ++i) for (int i = 0; i < cell_group->rlc_BearerToAddModList->list.count; ++i)
free_and_zero(cell_group->rlc_BearerToAddModList->list.array[i]->reestablishRLC); free_and_zero(cell_group->rlc_BearerToAddModList->list.array[i]->reestablishRLC);
/* clean BWP structures */
clean_bwp_structures(spCellConfig);
} }
int nr_mac_get_reconfig_delay_slots(NR_SubcarrierSpacing_t scs) int nr_mac_get_reconfig_delay_slots(NR_SubcarrierSpacing_t scs)
...@@ -3776,8 +3824,7 @@ bool prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE) ...@@ -3776,8 +3824,7 @@ bool prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE)
int CC_id = 0; int CC_id = 0;
int srb_id = 1; int srb_id = 1;
const NR_ServingCellConfigCommon_t *scc = mac->common_channels[CC_id].ServingCellConfigCommon; const NR_ServingCellConfigCommon_t *scc = mac->common_channels[CC_id].ServingCellConfigCommon;
const NR_ServingCellConfig_t *sccd = UE->is_redcap ? NULL : mac->common_channels[CC_id].pre_ServingCellConfig; NR_CellGroupConfig_t *cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, &mac->radio_config, &mac->rlc_config);
NR_CellGroupConfig_t *cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, sccd, &mac->radio_config, &mac->rlc_config);
ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->CellGroup); ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->CellGroup);
UE->CellGroup = cellGroupConfig; UE->CellGroup = cellGroupConfig;
...@@ -3873,11 +3920,29 @@ bool nr_mac_check_ul_failure(gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ctrl_t * ...@@ -3873,11 +3920,29 @@ bool nr_mac_check_ul_failure(gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ctrl_t *
return false; return false;
} }
void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_t *UE) void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_t *UE, int new_bwp_id)
{ {
DevAssert(UE->CellGroup != NULL); DevAssert(UE->CellGroup != NULL);
NR_CellGroupConfig_t *cellGroup_for_UE = NULL;
if (new_bwp_id >= 0) {
AssertFatal(UE->current_DL_BWP.bwp_id == UE->current_UL_BWP.bwp_id, "We only support same BWP for UL and DL\n");
if (new_bwp_id == UE->current_DL_BWP.bwp_id)
LOG_E(NR_MAC, "Source BWP ID and target BWP ID are the same, can't perform switch\n");
else
cellGroup_for_UE = update_cellGroupConfig_for_BWP_switch(UE->CellGroup,
&nrmac->radio_config,
UE->capability,
nrmac->common_channels[0].ServingCellConfigCommon,
UE->uid,
UE->current_DL_BWP.bwp_id,
new_bwp_id);
}
uint8_t buf[2048]; uint8_t buf[2048];
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, UE->CellGroup, buf, sizeof(buf)); asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
NULL,
cellGroup_for_UE ? cellGroup_for_UE : UE->CellGroup,
buf,
sizeof(buf));
AssertFatal(enc_rval.encoded > 0, "ASN1 encoding of CellGroupConfig failed, failed type %s\n", enc_rval.failed_type->name); AssertFatal(enc_rval.encoded > 0, "ASN1 encoding of CellGroupConfig failed, failed type %s\n", enc_rval.failed_type->name);
du_to_cu_rrc_information_t du2cu = { du_to_cu_rrc_information_t du2cu = {
.cellGroupConfig = buf, .cellGroupConfig = buf,
...@@ -3892,6 +3957,8 @@ void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_ ...@@ -3892,6 +3957,8 @@ void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_
.cause_value = F1AP_CauseRadioNetwork_action_desirable_for_radio_reasons, .cause_value = F1AP_CauseRadioNetwork_action_desirable_for_radio_reasons,
}; };
nrmac->mac_rrc.ue_context_modification_required(&required); nrmac->mac_rrc.ue_context_modification_required(&required);
if (cellGroup_for_UE)
free_cellGroupConfig(cellGroup_for_UE);
} }
/* \brief add bearers from CellGroupConfig. /* \brief add bearers from CellGroupConfig.
......
...@@ -882,7 +882,7 @@ static void nr_rx_ra_sdu(const module_id_t mod_id, ...@@ -882,7 +882,7 @@ static void nr_rx_ra_sdu(const module_id_t mod_id,
if (!old_UE->reconfigSpCellConfig) { if (!old_UE->reconfigSpCellConfig) {
LOG_I(NR_MAC, "Received UL_SCH_LCID_C_RNTI with C-RNTI 0x%04x, triggering RRC Reconfiguration\n", crnti); LOG_I(NR_MAC, "Received UL_SCH_LCID_C_RNTI with C-RNTI 0x%04x, triggering RRC Reconfiguration\n", crnti);
// Trigger RRCReconfiguration // Trigger RRCReconfiguration
nr_mac_trigger_reconfiguration(mac, old_UE); nr_mac_trigger_reconfiguration(mac, old_UE, -1);
// we configure the UE using common search space with DCIX0 while waiting for a reconfiguration // we configure the UE using common search space with DCIX0 while waiting for a reconfiguration
configure_UE_BWP(mac, scc, old_UE, false, NR_SearchSpace__searchSpaceType_PR_common, -1, -1); configure_UE_BWP(mac, scc, old_UE, false, NR_SearchSpace__searchSpaceType_PR_common, -1, -1);
} }
......
...@@ -52,7 +52,6 @@ void delete_nr_ue_data(NR_UE_info_t *UE, NR_COMMON_channels_t *ccPtr, uid_alloca ...@@ -52,7 +52,6 @@ void delete_nr_ue_data(NR_UE_info_t *UE, NR_COMMON_channels_t *ccPtr, uid_alloca
void mac_top_init_gNB(ngran_node_t node_type, void mac_top_init_gNB(ngran_node_t node_type,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
NR_ServingCellConfig_t *scd,
const nr_mac_config_t *conf, const nr_mac_config_t *conf,
const nr_rlc_configuration_t *default_rlc_config); const nr_rlc_configuration_t *default_rlc_config);
void mac_top_destroy_gNB(gNB_MAC_INST *mac); void mac_top_destroy_gNB(gNB_MAC_INST *mac);
...@@ -478,12 +477,12 @@ bool nr_mac_check_release(NR_UE_sched_ctrl_t *sched_ctrl, int rnti); ...@@ -478,12 +477,12 @@ bool nr_mac_check_release(NR_UE_sched_ctrl_t *sched_ctrl, int rnti);
void nr_mac_trigger_release_complete(gNB_MAC_INST *mac, int rnti); void nr_mac_trigger_release_complete(gNB_MAC_INST *mac, int rnti);
void nr_mac_release_ue(gNB_MAC_INST *mac, int rnti); void nr_mac_release_ue(gNB_MAC_INST *mac, int rnti);
bool nr_mac_request_release_ue(const gNB_MAC_INST *nrmac, int rnti); bool nr_mac_request_release_ue(const gNB_MAC_INST *nrmac, int rnti);
void clean_bwp_structures(NR_SpCellConfig_t *spCellConfig);
void nr_mac_trigger_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing); void nr_mac_trigger_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing);
void nr_mac_reset_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl); void nr_mac_reset_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl);
bool nr_mac_check_ul_failure(gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ctrl_t *sched_ctrl); bool nr_mac_check_ul_failure(gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ctrl_t *sched_ctrl);
void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_t *UE); void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_t *UE, int new_bwp_id);
void process_addmod_bearers_cellGroupConfig(NR_UE_sched_ctrl_t *sched_ctrl, void process_addmod_bearers_cellGroupConfig(NR_UE_sched_ctrl_t *sched_ctrl,
const struct NR_CellGroupConfig__rlc_BearerToAddModList *addmod); const struct NR_CellGroupConfig__rlc_BearerToAddModList *addmod);
......
...@@ -569,14 +569,13 @@ static NR_UE_info_t *create_new_UE(gNB_MAC_INST *mac, uint32_t cu_id, const NR_C ...@@ -569,14 +569,13 @@ static NR_UE_info_t *create_new_UE(gNB_MAC_INST *mac, uint32_t cu_id, const NR_C
NR_CellGroupConfig_t *cellGroupConfig = NULL; NR_CellGroupConfig_t *cellGroupConfig = NULL;
NR_COMMON_channels_t *cc = &mac->common_channels[CC_id]; NR_COMMON_channels_t *cc = &mac->common_channels[CC_id];
const NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; const NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
const NR_ServingCellConfig_t *sccd = cc->pre_ServingCellConfig;
const nr_mac_config_t *configuration = &mac->radio_config; const nr_mac_config_t *configuration = &mac->radio_config;
if (is_SA) { if (is_SA) {
cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, sccd, &mac->radio_config, &mac->rlc_config); cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, &mac->radio_config, &mac->rlc_config);
cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc); cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc);
} else { } else {
NR_UE_NR_Capability_t *cap = get_ue_nr_cap_from_cg_config_info(cgci); NR_UE_NR_Capability_t *cap = get_ue_nr_cap_from_cg_config_info(cgci);
cellGroupConfig = get_default_secondaryCellGroup(scc, sccd, cap, 1, 1, configuration, UE->uid); cellGroupConfig = get_default_secondaryCellGroup(scc, cap, 1, 1, configuration, UE->uid);
cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc); cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc);
// TODO: in NSA we assign capabilities here, otherwise outside => not logic // TODO: in NSA we assign capabilities here, otherwise outside => not logic
UE->capability = cap; UE->capability = cap;
...@@ -786,8 +785,8 @@ void ue_context_modification_request(const f1ap_ue_context_mod_req_t *req) ...@@ -786,8 +785,8 @@ void ue_context_modification_request(const f1ap_ue_context_mod_req_t *req)
} }
} }
// we re-configure the BWP to apply the CellGroup and to use UE specific Search Space with DCIX1 // we re-configure the BWP to apply the CellGroup and to use UE specific Search Space with DCIX1
nr_mac_clean_cellgroup(UE->CellGroup);
configure_UE_BWP(mac, scc, UE, false, NR_SearchSpace__searchSpaceType_PR_ue_Specific, -1, -1); configure_UE_BWP(mac, scc, UE, false, NR_SearchSpace__searchSpaceType_PR_ue_Specific, -1, -1);
nr_mac_clean_cellgroup(UE->CellGroup);
} }
if (ue_cap != NULL) { if (ue_cap != NULL) {
......
...@@ -255,7 +255,6 @@ static void mac_rrc_init(gNB_MAC_INST *mac, ngran_node_t node_type) ...@@ -255,7 +255,6 @@ static void mac_rrc_init(gNB_MAC_INST *mac, ngran_node_t node_type)
void mac_top_init_gNB(ngran_node_t node_type, void mac_top_init_gNB(ngran_node_t node_type,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
NR_ServingCellConfig_t *scd,
const nr_mac_config_t *config, const nr_mac_config_t *config,
const nr_rlc_configuration_t *default_rlc_config) const nr_rlc_configuration_t *default_rlc_config)
{ {
...@@ -290,8 +289,6 @@ void mac_top_init_gNB(ngran_node_t node_type, ...@@ -290,8 +289,6 @@ void mac_top_init_gNB(ngran_node_t node_type,
RC.nrmac[i]->radio_config = *config; RC.nrmac[i]->radio_config = *config;
RC.nrmac[i]->rlc_config = *default_rlc_config; RC.nrmac[i]->rlc_config = *default_rlc_config;
RC.nrmac[i]->common_channels[0].pre_ServingCellConfig = scd;
RC.nrmac[i]->first_MIB = true; RC.nrmac[i]->first_MIB = true;
RC.nrmac[i]->num_scheduled_prach_rx = 0; RC.nrmac[i]->num_scheduled_prach_rx = 0;
RC.nrmac[i]->common_channels[0].mib = get_new_MIB_NR(scc); RC.nrmac[i]->common_channels[0].mib = get_new_MIB_NR(scc);
...@@ -345,7 +342,6 @@ void mac_top_destroy_gNB(gNB_MAC_INST *mac) ...@@ -345,7 +342,6 @@ void mac_top_destroy_gNB(gNB_MAC_INST *mac)
NR_COMMON_channels_t *cc = &mac->common_channels[0]; NR_COMMON_channels_t *cc = &mac->common_channels[0];
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, cc->mib); ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, cc->mib);
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_DL_SCH_Message, cc->sib1); ASN_STRUCT_FREE(asn_DEF_NR_BCCH_DL_SCH_Message, cc->sib1);
ASN_STRUCT_FREE(asn_DEF_NR_ServingCellConfig, cc->pre_ServingCellConfig);
ASN_STRUCT_FREE(asn_DEF_NR_ServingCellConfigCommon, cc->ServingCellConfigCommon); ASN_STRUCT_FREE(asn_DEF_NR_ServingCellConfigCommon, cc->ServingCellConfigCommon);
NR_UEs_t *UE_info = &mac->UE_info; NR_UEs_t *UE_info = &mac->UE_info;
for (int i = 0; i < sizeofArray(UE_info->connected_ue_list); ++i) for (int i = 0; i < sizeofArray(UE_info->connected_ue_list); ++i)
......
...@@ -155,6 +155,30 @@ typedef struct nr_redcap_config { ...@@ -155,6 +155,30 @@ typedef struct nr_redcap_config {
uint8_t intraFreqReselectionRedCap_r17; uint8_t intraFreqReselectionRedCap_r17;
} nr_redcap_config_t; } nr_redcap_config_t;
typedef struct {
int dl_FreqDensity0_0;
int dl_FreqDensity1_0;
int dl_TimeDensity0_0;
int dl_TimeDensity1_0;
int dl_TimeDensity2_0;
int dl_EpreRatio_0;
int dl_ReOffset_0;
int ul_FreqDensity0_0;
int ul_FreqDensity1_0;
int ul_TimeDensity0_0;
int ul_TimeDensity1_0;
int ul_TimeDensity2_0;
int ul_ReOffset_0;
int ul_MaxPorts_0;
int ul_Power_0;
} nr_ptrs_config_t;
typedef struct {
int id;
int scs;
int location_and_bw;
} nr_bwp_config_t;
typedef struct nr_mac_config_t { typedef struct nr_mac_config_t {
int sib1_tda; int sib1_tda;
nr_pdsch_AntennaPorts_t pdsch_AntennaPorts; nr_pdsch_AntennaPorts_t pdsch_AntennaPorts;
...@@ -172,11 +196,16 @@ typedef struct nr_mac_config_t { ...@@ -172,11 +196,16 @@ typedef struct nr_mac_config_t {
nr_mac_timers_t timer_config; nr_mac_timers_t timer_config;
int num_dlharq; int num_dlharq;
int num_ulharq; int num_ulharq;
// BWP information
int num_additional_bwps;
int first_active_bwp;
nr_bwp_config_t bwp_config[4];
/// beamforming weight matrix size /// beamforming weight matrix size
int nb_bfw[2]; int nb_bfw[2];
int32_t *bw_list; int32_t *bw_list;
int num_agg_level_candidates[NUM_PDCCH_AGG_LEVELS]; int num_agg_level_candidates[NUM_PDCCH_AGG_LEVELS];
nr_redcap_config_t *redcap; nr_redcap_config_t *redcap;
nr_ptrs_config_t *ptrs;
bool do_SINR; bool do_SINR;
} nr_mac_config_t; } nr_mac_config_t;
...@@ -263,8 +292,6 @@ typedef struct { ...@@ -263,8 +292,6 @@ typedef struct {
NR_BCCH_DL_SCH_Message_t *sib1; NR_BCCH_DL_SCH_Message_t *sib1;
seq_arr_t *du_SIBs; seq_arr_t *du_SIBs;
NR_ServingCellConfigCommon_t *ServingCellConfigCommon; NR_ServingCellConfigCommon_t *ServingCellConfigCommon;
/// pre-configured ServingCellConfig that is default for every UE
NR_ServingCellConfig_t *pre_ServingCellConfig;
/// Outgoing MIB PDU for PHY /// Outgoing MIB PDU for PHY
uint8_t MIB_pdu[3]; uint8_t MIB_pdu[3];
/// Outgoing BCCH pdu for PHY /// Outgoing BCCH pdu for PHY
......
...@@ -89,7 +89,6 @@ NR_SIB19_r17_t *get_SIB19_NR(const NR_ServingCellConfigCommon_t *scc); ...@@ -89,7 +89,6 @@ NR_SIB19_r17_t *get_SIB19_NR(const NR_ServingCellConfigCommon_t *scc);
NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid, NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid,
const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfigCommon_t *scc,
const NR_ServingCellConfig_t *servingcellconfigdedicated,
const nr_mac_config_t *configuration, const nr_mac_config_t *configuration,
const nr_rlc_configuration_t *default_rlc_config); const nr_rlc_configuration_t *default_rlc_config);
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
...@@ -105,7 +104,6 @@ NR_CellGroupConfig_t *decode_cellGroupConfig(const uint8_t *buffer, int max_buff ...@@ -105,7 +104,6 @@ NR_CellGroupConfig_t *decode_cellGroupConfig(const uint8_t *buffer, int max_buff
* configuration, but it will also overwrite the ServingCellConfig passed in * configuration, but it will also overwrite the ServingCellConfig passed in
* parameter servingcellconfigdedicated! */ * parameter servingcellconfigdedicated! */
NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigCommon_t *servingcellconfigcommon,
const NR_ServingCellConfig_t *servingcellconfigdedicated,
const NR_UE_NR_Capability_t *uecap, const NR_UE_NR_Capability_t *uecap,
int scg_id, int scg_id,
int servCellIndex, int servCellIndex,
...@@ -123,7 +121,13 @@ NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, ...@@ -123,7 +121,13 @@ NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId,
NR_RLC_Config_PR rlc_conf, NR_RLC_Config_PR rlc_conf,
long priority, long priority,
const nr_rlc_configuration_t *default_rlc_config); const nr_rlc_configuration_t *default_rlc_config);
NR_CellGroupConfig_t * update_cellGroupConfig_for_BWP_switch(NR_CellGroupConfig_t *cellGroupConfig,
const nr_mac_config_t *configuration,
const NR_UE_NR_Capability_t *uecap,
const NR_ServingCellConfigCommon_t *scc,
int uid,
int old_bwp,
int new_bwp);
NR_MeasurementTimingConfiguration_t *get_nr_mtc(uint8_t *buf, uint32_t len); NR_MeasurementTimingConfiguration_t *get_nr_mtc(uint8_t *buf, uint32_t len);
measgap_config_t create_measgap_config(const NR_MeasurementTimingConfiguration_t *mtc, int scs, int min_rxtxtime); measgap_config_t create_measgap_config(const NR_MeasurementTimingConfiguration_t *mtc, int scs, int min_rxtxtime);
int encode_measgap_config(const measgap_config_t *c, uint8_t *buf); int encode_measgap_config(const measgap_config_t *c, uint8_t *buf);
......
...@@ -144,8 +144,8 @@ gNBs = ...@@ -144,8 +144,8 @@ gNBs =
); );
# Dedicated Serving Cell Configuration # PTRS Configuration
servingCellConfigDedicated = ( phaseTrackingRS = (
{ {
# DL PTRS related parameters. # DL PTRS related parameters.
# 3GPP TS 38.331 PTRS-DownlinkConfig # 3GPP TS 38.331 PTRS-DownlinkConfig
......
...@@ -19,6 +19,12 @@ gNBs: ...@@ -19,6 +19,12 @@ gNBs:
# Physical parameters: # Physical parameters:
do_CSIRS: 1 do_CSIRS: 1
do_SRS: 1 do_SRS: 1
first_active_bwp: 1;
bwp_list:
-
scs: 1
bwpStart: 0
bwpSize: 106
#uess_agg_levels: [0,1,1,1,1] #uess_agg_levels: [0,1,1,1,1]
servingCellConfigCommon: servingCellConfigCommon:
#spCellConfigCommon #spCellConfigCommon
...@@ -132,17 +138,6 @@ gNBs: ...@@ -132,17 +138,6 @@ gNBs:
ssPBCH_BlockPower: -25 ssPBCH_BlockPower: -25
servingCellConfigDedicated:
- dl_bwp-Id_1: 1
dl_bwp1_locationAndBandwidth: 28875
dl_bwp1_subcarrierSpacing: 1
firstActiveDownlinkBWP-Id: 1
defaultDownlinkBWP-Id: 1
ul_bwp-Id_1: 1
ul_bwp1_locationAndBandwidth: 28875
ul_bwp1_subcarrierSpacing: 1
firstActiveUplinkBWP-Id: 1
RedCap: RedCap:
cellBarredRedCap1Rx_r17: 1 cellBarredRedCap1Rx_r17: 1
cellBarredRedCap2Rx_r17: 1 cellBarredRedCap2Rx_r17: 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment