Commit 1e6c36d8 authored by francescomani's avatar francescomani

fix segfault in SA rfsim

parent 3186d45e
......@@ -496,14 +496,18 @@ void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint16_t *bwp_ind, uint8_t *dci_format
NR_ServingCellConfig_t *scd = mac->cg->spCellConfig->spCellConfigDedicated;
if (bwp_ind && dci_format){
int n_ubwp = 0;
if (scd && scd->uplinkConfig &&
scd->uplinkConfig->uplinkBWP_ToAddModList)
n_ubwp = scd->uplinkConfig->uplinkBWP_ToAddModList->list.count;
if (bwp_ind && dci_format){
switch(*dci_format){
case NR_UL_DCI_FORMAT_0_1:
mac->UL_BWP_Id = *bwp_ind +1 ;
mac->UL_BWP_Id = n_ubwp < 4 ? *bwp_ind : *bwp_ind + 1;;
break;
case NR_DL_DCI_FORMAT_1_1:
mac->DL_BWP_Id = *bwp_ind +1;
mac->DL_BWP_Id = n_ubwp < 4 ? *bwp_ind : *bwp_ind + 1;;
break;
default:
LOG_E(MAC, "In %s: failed to configure BWP Id from DCI with format %d \n", __FUNCTION__, *dci_format);
......
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