diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 9822d26971be5ca2b1dba068a74a65937f4979df..01a9d83b46f34e726c8ee1596ae03c1c53e75b17 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -189,6 +189,7 @@ typedef struct RrcConfigurationReq_s { long rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs]; //SIB19 + //for discRxPool SL_CP_Len_r12_t discRxPool_cp_Len[MAX_NUM_CCs]; e_SL_DiscResourcePool_r12__discPeriod_r12 discRxPool_discPeriod[MAX_NUM_CCs]; long discRxPool_numRetx[MAX_NUM_CCs]; @@ -202,6 +203,20 @@ typedef struct RrcConfigurationReq_s { char* discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs]; long discRxPool_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs]; long discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs]; + //for discRxPoolPS + SL_CP_Len_r12_t discRxPoolPS_cp_Len[MAX_NUM_CCs]; + e_SL_DiscResourcePool_r12__discPeriod_r12 discRxPoolPS_discPeriod[MAX_NUM_CCs]; + long discRxPoolPS_numRetx[MAX_NUM_CCs]; + long discRxPoolPS_numRepetition[MAX_NUM_CCs]; + long discRxPoolPS_ResourceConfig_prb_Num[MAX_NUM_CCs]; + long discRxPoolPS_ResourceConfig_prb_Start[MAX_NUM_CCs]; + long discRxPoolPS_ResourceConfig_prb_End[MAX_NUM_CCs]; + SL_OffsetIndicator_r12_PR discRxPoolPS_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs]; + long discRxPoolPS_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs]; + SubframeBitmapSL_r12_PR discRxPoolPS_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs]; + char* discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs]; + long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs]; + long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs]; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 1bcfce02927aee796e51ccd9e9e44a4365c74926..daf644a662ac9f5dc3c31bd2c50ec9078f98cc33 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -574,6 +574,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { libconfig_int rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 0; libconfig_int rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; //SIB19 + //For discRxPool const char* discRxPool_cp_Len = NULL; const char* discRxPool_discPeriod = NULL; libconfig_int discRxPool_numRetx = 0; @@ -588,7 +589,21 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { const char* discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = NULL; libconfig_int discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 0; libconfig_int discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; - + //For discRxPoolPS + const char* discRxPoolPS_cp_Len = NULL; + const char* discRxPoolPS_discPeriod = NULL; + libconfig_int discRxPoolPS_numRetx = 0; + libconfig_int discRxPoolPS_numRepetition = 0; + + libconfig_int discRxPoolPS_ResourceConfig_prb_Num = 0; + libconfig_int discRxPoolPS_ResourceConfig_prb_Start = 0; + libconfig_int discRxPoolPS_ResourceConfig_prb_End = 0; + const char* discRxPoolPS_ResourceConfig_offsetIndicator_present = NULL; + libconfig_int discRxPoolPS_ResourceConfig_offsetIndicator_choice = 0; + const char* discRxPoolPS_ResourceConfig_subframeBitmap_present = NULL; + const char* discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf = NULL; + libconfig_int discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size = 0; + libconfig_int discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; int32_t srb1_timer_poll_retransmit = 0; @@ -1969,7 +1984,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_choice_bs_size[j] = rxPool_ResourceConfig_subframeBitmap_choice_bs_size; RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[j] = rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused; - //SIB19 + //SIB19 - for discRxPool if (strcmp(discRxPool_cp_Len,"normal")==0) { RRC_CONFIGURATION_REQ (msg_p).discRxPool_cp_Len[j] = SL_CP_Len_r12_normal; } else if (strcmp(discRxPool_cp_Len,"extended")==0) { @@ -2049,6 +2064,86 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_choice_bs_size[j] = discRxPool_ResourceConfig_subframeBitmap_choice_bs_size; RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[j] = discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused; + //SIB19 - For discRxPoolPS + if (strcmp(discRxPoolPS_cp_Len,"normal")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_cp_Len[j] = SL_CP_Len_r12_normal; + } else if (strcmp(discRxPoolPS_cp_Len,"extended")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_cp_Len[j] = SL_CP_Len_r12_extended; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_cp_Len choice: normal,extended!\n", + RC.config_file_name, i, discRxPoolPS_cp_Len); + + + if (strcmp(discRxPoolPS_discPeriod,"rf32")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[j] = SL_DiscResourcePool_r12__discPeriod_r12_rf32; + } else if (strcmp(discRxPoolPS_discPeriod,"rf64")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[j] = SL_DiscResourcePool_r12__discPeriod_r12_rf64; + } else if (strcmp(discRxPoolPS_discPeriod,"rf128")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[j] = SL_DiscResourcePool_r12__discPeriod_r12_rf128; + } else if (strcmp(discRxPoolPS_discPeriod,"rf256")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[j] = SL_DiscResourcePool_r12__discPeriod_r12_rf256; + } else if (strcmp(discRxPoolPS_discPeriod,"rf512")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[j] = SL_DiscResourcePool_r12__discPeriod_r12_rf512; + } else if (strcmp(discRxPoolPS_discPeriod,"rf1024")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[j] = SL_DiscResourcePool_r12__discPeriod_r12_rf1024; + } else if (strcmp(discRxPoolPS_discPeriod,"rf16")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[j] = SL_DiscResourcePool_r12__discPeriod_r12_rf16_v1310; + } else if (strcmp(discRxPoolPS_discPeriod,"spare")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[j] = SL_DiscResourcePool_r12__discPeriod_r12_spare; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_discPeriod choice: rf32,rf64,rf128,rf512,rf1024,rf16,spare!\n", + RC.config_file_name, i, discRxPoolPS_discPeriod); + + + + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_numRetx[j] = discRxPoolPS_numRetx; + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_numRepetition[j] = discRxPoolPS_numRepetition; + + + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_prb_Num[j] = discRxPoolPS_ResourceConfig_prb_Num; + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_prb_Start[j] = discRxPoolPS_ResourceConfig_prb_Start; + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_prb_End[j] = discRxPoolPS_ResourceConfig_prb_End; + + if (strcmp(discRxPoolPS_ResourceConfig_offsetIndicator_present,"prNothing")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_present[j] = SL_OffsetIndicator_r12_PR_NOTHING; + } else if (strcmp(discRxPoolPS_ResourceConfig_offsetIndicator_present,"prSmall")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_present[j] = SL_OffsetIndicator_r12_PR_small_r12; + } else if (strcmp(discRxPoolPS_ResourceConfig_offsetIndicator_present,"prLarge")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_present[j] = SL_OffsetIndicator_r12_PR_large_r12; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_ResourceConfig_offsetIndicator_present choice: prNothing,prSmal,prLarge!\n", + RC.config_file_name, i, discRxPoolPS_ResourceConfig_offsetIndicator_present); + + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_choice[j] = discRxPoolPS_ResourceConfig_offsetIndicator_choice; + + if (strcmp(discRxPoolPS_ResourceConfig_subframeBitmap_present,"prNothing")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[j] = SubframeBitmapSL_r12_PR_NOTHING; + } else if (strcmp(discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs4")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[j] = SubframeBitmapSL_r12_PR_bs4_r12; + } else if (strcmp(discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs8")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[j] = SubframeBitmapSL_r12_PR_bs8_r12; + } else if (strcmp(discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs12")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[j] = SubframeBitmapSL_r12_PR_bs12_r12; + } else if (strcmp(discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs16")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[j] = SubframeBitmapSL_r12_PR_bs16_r12; + } else if (strcmp(discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs30")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[j] = SubframeBitmapSL_r12_PR_bs30_r12; + } else if (strcmp(discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs40")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[j] = SubframeBitmapSL_r12_PR_bs40_r12; + } else if (strcmp(discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs42")==0) { + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[j] = SubframeBitmapSL_r12_PR_bs42_r12; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_ResourceConfig_subframeBitmap_present choice: prNothing,prBs4,prBs8,prBs12,prBs16,prBs30,prBs40,prBs42!\n", + RC.config_file_name, i, discRxPoolPS_ResourceConfig_subframeBitmap_present); + + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[j] = discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf; + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[j] = discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size; + RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[j] = discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused; + } } diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 82a5f40ca1bfd66402e8ad588845a85026084b48..bc25957e3d611912897ac763d107fdd445f192df 100755 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -386,7 +386,7 @@ static int DEFENBS[] = {0}; #define ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_CHOICE_BS_BUF "rxPool_ResourceConfig_subframeBitmap_choice_bs_buf" #define ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_CHOICE_BS_SIZE "rxPool_ResourceConfig_subframeBitmap_choice_bs_size" #define ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED "rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused" -//SIB19 +//SIB19 for DiscRxPool #define ENB_CONFIG_STRING_DISCRXPOOL_CP_LEN "discRxPool_cp_Len" #define ENB_CONFIG_STRING_DISCRXPOOL_DISCPERIOD "discRxPool_discPeriod" #define ENB_CONFIG_STRING_DISCRXPOOL_NUMRETX "discRxPool_numRetx" @@ -401,7 +401,20 @@ static int DEFENBS[] = {0}; #define ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_SIZE "discRxPool_ResourceConfig_subframeBitmap_choice_bs_size" #define ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED "discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused" - +//SIB19 for DiscRxPoolPS +#define ENB_CONFIG_STRING_DISCRXPOOLPS_CP_LEN "DISCRXPOOLPS_cp_Len" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_DISCPERIOD "DISCRXPOOLPS_discPeriod" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_NUMRETX "DISCRXPOOLPS_numRetx" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_NUMREPETITION "DISCRXPOOLPS_numRepetition" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_NUM "DISCRXPOOLPS_ResourceConfig_prb_Num" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_START "DISCRXPOOLPS_ResourceConfig_prb_Start" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_END "DISCRXPOOLPS_ResourceConfig_prb_End" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_RC_OFFSETIND_PRESENT "DISCRXPOOLPS_ResourceConfig_offsetIndicator_present" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_RC_OFFSETIND_CHOICE "DISCRXPOOLPS_ResourceConfig_offsetIndicator_choice" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_PRESENT "DISCRXPOOLPS_ResourceConfig_subframeBitmap_present" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_BUF "DISCRXPOOLPS_ResourceConfig_subframeBitmap_choice_bs_buf" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_SIZE "DISCRXPOOLPS_ResourceConfig_subframeBitmap_choice_bs_size" +#define ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED "DISCRXPOOLPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused" /*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* component carriers configuration parameters */ @@ -500,7 +513,20 @@ static int DEFENBS[] = {0}; {ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_PRESENT, NULL, 0, strptr:&discRxPool_ResourceConfig_subframeBitmap_present, defstrval:"prNothing", TYPE_STRING, 0}, \ {ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_BUF, NULL, 0, strptr:&discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf, defstrval:"001001", TYPE_STRING, 0}, \ {ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_SIZE, NULL, 0, iptr:&discRxPool_ResourceConfig_subframeBitmap_choice_bs_size, defintval:1, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED,NULL, 0, iptr:&discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused, defintval:1, TYPE_UINT, 0} \ +{ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED,NULL, 0, iptr:&discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_CP_LEN, NULL, 0, strptr:&discRxPoolPS_cp_Len, defstrval:"normal", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_DISCPERIOD, NULL, 0, strptr:&discRxPoolPS_discPeriod, defstrval:"rf32", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_NUMRETX, NULL, 0, iptr:&discRxPoolPS_numRetx, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_NUMREPETITION, NULL, 0, iptr:&discRxPoolPS_numRepetition, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_NUM, NULL, 0, iptr:&discRxPoolPS_ResourceConfig_prb_Num, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_START, NULL, 0, iptr:&discRxPoolPS_ResourceConfig_prb_Start, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_END, NULL, 0, iptr:&discRxPoolPS_ResourceConfig_prb_End, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_OFFSETIND_PRESENT, NULL, 0, strptr:&discRxPoolPS_ResourceConfig_offsetIndicator_present, defstrval:"prNothing", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_OFFSETIND_CHOICE, NULL, 0, iptr:&discRxPoolPS_ResourceConfig_offsetIndicator_choice, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_PRESENT, NULL, 0, strptr:&discRxPoolPS_ResourceConfig_subframeBitmap_present, defstrval:"prNothing", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_BUF, NULL, 0, strptr:&discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf, defstrval:"001001", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_SIZE, NULL, 0, iptr:&discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED,NULL, 0, iptr:&discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused, defintval:1, TYPE_UINT, 0} \ } /*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index c22ceef6bb689b63870eab1a1180b04d506ca46e..db31a7743631886d6f22775102aa4e05830f572c 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -581,8 +581,11 @@ uint8_t do_SIB23(uint8_t Mod_id, struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib18_part, *sib19_part, *sib21_part; SL_CommRxPoolList_r12_t *SL_CommRxPoolList; //for SIB18 struct SL_CommResourcePool_r12 *SL_CommResourcePool; //for SIB18 - SL_DiscRxPoolList_r12_t *SL_DiscRxPoolList; //for SIB19 - struct SL_DiscResourcePool_r12 *SL_DiscResourcePool; //for SIB19 + SL_DiscRxPoolList_r12_t *SL_DiscRxPoolList; //for SIB19 (discRxPool) + struct SL_DiscResourcePool_r12 *SL_DiscResourcePool; //for SIB19 (discRxPool) + SL_DiscRxPoolList_r12_t *SL_DiscRxPoolPSList; //for SIB19 (discRxPoolPS) + struct SL_DiscResourcePool_r12 *SL_DiscResourcePoolPS; //for SIB19 (discRxPoolPS) + #if defined(Rel10) || defined(Rel14) struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib13_part; @@ -1257,7 +1260,74 @@ uint8_t do_SIB23(uint8_t Mod_id, //add SL_DiscResourcePool to SL_DiscRxPoolList ASN_SEQUENCE_ADD(&SL_DiscRxPoolList->list,SL_DiscResourcePool); - (*sib19)->ext1 = NULL; + + //for DiscRxPoolPS + (*sib19)->ext1 = CALLOC (1, sizeof(*(*sib19)->ext1)); + (*sib19)->ext1->discConfigPS_13 = CALLOC (1, sizeof(*((*sib19)->ext1->discConfigPS_13))); + + SL_DiscRxPoolPSList = &(*sib19)->ext1->discConfigPS_13->discRxPoolPS_r13; + memset(SL_DiscRxPoolPSList,0,sizeof(*SL_DiscRxPoolPSList)); + //fill SL_DiscResourcePool + SL_DiscResourcePoolPS = CALLOC(1, sizeof(*SL_DiscResourcePoolPS)); + + SL_DiscResourcePoolPS->cp_Len_r12 = configuration->discRxPoolPS_cp_Len[CC_id]; + SL_DiscResourcePoolPS->discPeriod_r12 = configuration->discRxPoolPS_discPeriod[CC_id]; + //sc_TF_ResourceConfig_r12 + SL_DiscResourcePoolPS->numRetx_r12 = configuration->discRxPoolPS_numRetx[CC_id]; + SL_DiscResourcePoolPS->numRepetition_r12 = configuration->discRxPoolPS_numRepetition[CC_id]; + + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.prb_Num_r12 = configuration->discRxPoolPS_ResourceConfig_prb_Num[CC_id]; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.prb_Start_r12 = configuration->discRxPoolPS_ResourceConfig_prb_Start[CC_id]; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.prb_End_r12 = configuration->discRxPoolPS_ResourceConfig_prb_End[CC_id]; + + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.offsetIndicator_r12.present = configuration->discRxPoolPS_ResourceConfig_offsetIndicator_present[CC_id]; + if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.offsetIndicator_r12.present == SL_OffsetIndicator_r12_PR_small_r12 ) { + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.offsetIndicator_r12.choice.small_r12 = configuration->discRxPoolPS_ResourceConfig_offsetIndicator_choice[CC_id] ; + } else if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.offsetIndicator_r12.present == SL_OffsetIndicator_r12_PR_large_r12 ){ + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.offsetIndicator_r12.choice.large_r12 = configuration->discRxPoolPS_ResourceConfig_offsetIndicator_choice[CC_id] ; + } + + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.present = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_present[CC_id]; + if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.present == SubframeBitmapSL_r12_PR_bs4_r12){ + //for BS4 + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs4_r12.size = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[CC_id]; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs4_r12.buf = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[CC_id];; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs4_r12.bits_unused = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[CC_id]; + } else if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.present == SubframeBitmapSL_r12_PR_bs8_r12){ + //for BS8 + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs8_r12.size = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[CC_id]; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs8_r12.buf = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[CC_id];; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs8_r12.bits_unused = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[CC_id]; + } else if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.present == SubframeBitmapSL_r12_PR_bs12_r12){ + //for BS12 + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs12_r12.size = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[CC_id]; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs12_r12.buf = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[CC_id];; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs12_r12.bits_unused = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[CC_id]; + }else if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.present == SubframeBitmapSL_r12_PR_bs16_r12){ + //for BS16 + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs16_r12.size = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[CC_id]; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs16_r12.buf = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[CC_id];; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs16_r12.bits_unused = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[CC_id]; + }else if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.present == SubframeBitmapSL_r12_PR_bs30_r12){ + //for BS30 + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs30_r12.size = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[CC_id]; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs30_r12.buf = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[CC_id];; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs30_r12.bits_unused = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[CC_id]; + }else if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.present == SubframeBitmapSL_r12_PR_bs40_r12){ + //for BS40 + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.size = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[CC_id]; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[CC_id];; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.bits_unused = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[CC_id]; + }else if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.present == SubframeBitmapSL_r12_PR_bs42_r12){ + //for BS42 + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs42_r12.size = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[CC_id]; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs42_r12.buf = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[CC_id];; + SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs42_r12.bits_unused = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[CC_id]; + } + + //add SL_DiscResourcePool to SL_DiscRxPoolList + ASN_SEQUENCE_ADD(&SL_DiscRxPoolPSList->list,SL_DiscResourcePoolPS); + (*sib19)->lateNonCriticalExtension = NULL; //end SIB19 @@ -1443,7 +1513,7 @@ uint8_t do_SidelinkUEInformation(uint8_t Mod_id, uint8_t *buffer, SL_Destinatio //3GPP TS 36.331 (Section 5.10.2.3) sidelinkUEInformation->criticalExtensions.choice.c1.present = SidelinkUEInformation_r12__criticalExtensions__c1_PR_sidelinkUEInformation_r12; switch(mode) { - //if SIB18 is available case 1,2,3,4 + //if SIB18 is available case SL_RECEIVE_COMMUNICATION: // to receive sidelink communication sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commRxInterestedFreq_r12 = CALLOC(1, sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commRxInterestedFreq_r12)); @@ -1511,7 +1581,7 @@ uint8_t do_SidelinkUEInformation(uint8_t Mod_id, uint8_t *buffer, SL_Destinatio break; //if SIB19 is available - //TTN - for case 6,7, and 8, we consider only one frequency - a serving frequency + //we consider only one frequency - a serving frequency case SL_RECEIVE_DISCOVERY: //receive sidelink discovery announcements sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discRxInterest_r12 = CALLOC(1, diff --git a/openair2/RRC/LITE/proto.h b/openair2/RRC/LITE/proto.h index 99d42b133b0b56eb8d74068d0570ec1c6110ac9d..46ab00cbd3abcf2ca97f142ebfcdc05f958a2206 100644 --- a/openair2/RRC/LITE/proto.h +++ b/openair2/RRC/LITE/proto.h @@ -172,7 +172,7 @@ void rrc_ue_process_radioResourceConfigDedicated( \param sib19 Pointer to SIB19 from SI message \param sl_CommConfig Pointer to SL_CommConfig RRCConnectionConfiguration \param sl_DiscConfig Pointer to SL_DiscConfig RRCConnectionConfiguration */ -void rrc_ue_process_radioResourceConfig( +void rrc_ue_process_sidelink_radioResourceConfig( module_id_t Mod_idP, uint8_t eNB_index, SystemInformationBlockType18_r12_t *sib18, diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index 47cae8887a2a7a8e3909db2d76d8e030360d6d8b..1ffed72dc5f2e3336b2d9528da2abe9b8a8422c8 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -1903,7 +1903,7 @@ rrc_ue_process_rrcConnectionReconfiguration( if (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12->commTxResources_r12->present != SL_CommConfig_r12__commTxResources_r12_PR_NOTHING){ LOG_I(RRC,"sl-CommConfig is present\n"); //process sl-CommConfig - rrc_ue_process_radioResourceConfig(ctxt_pP->module_id,eNB_index, + rrc_ue_process_sidelink_radioResourceConfig(ctxt_pP->module_id,eNB_index, (SystemInformationBlockType18_r12_t *)NULL, (SystemInformationBlockType19_r12_t *)NULL, rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12, @@ -1914,7 +1914,7 @@ rrc_ue_process_rrcConnectionReconfiguration( if (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12->discTxResources_r12->present != SL_DiscConfig_r12__discTxResources_r12_PR_NOTHING ){ LOG_I(RRC,"sl-DiscConfig is present\n"); //process sl-DiscConfig - rrc_ue_process_radioResourceConfig(ctxt_pP->module_id,eNB_index, + rrc_ue_process_sidelink_radioResourceConfig(ctxt_pP->module_id,eNB_index, (SystemInformationBlockType18_r12_t *)NULL, (SystemInformationBlockType19_r12_t *)NULL, (SL_CommConfig_r12_t* )NULL, @@ -3842,7 +3842,7 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id); //process SIB18 to transfer SL-related parameters to PHY - rrc_ue_process_radioResourceConfig(ctxt_pP->module_id,eNB_index, + rrc_ue_process_sidelink_radioResourceConfig(ctxt_pP->module_id,eNB_index, UE_rrc_inst[ctxt_pP->module_id].sib18[eNB_index], (SystemInformationBlockType19_r12_t *)NULL, (SL_CommConfig_r12_t *)NULL, @@ -3865,7 +3865,7 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in LOG_I( RRC, "[FRAME %05"PRIu32"][RRC_UE][MOD %02"PRIu8"][][--- MAC_CONFIG_REQ (SIB19 params eNB %"PRIu8") --->][MAC_UE][MOD %02"PRIu8"][]\n", ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id); //process SIB19 to transfer SL-related parameters to PHY - rrc_ue_process_radioResourceConfig(ctxt_pP->module_id,eNB_index, + rrc_ue_process_sidelink_radioResourceConfig(ctxt_pP->module_id,eNB_index, (SystemInformationBlockType18_r12_t *)NULL, UE_rrc_inst[ctxt_pP->module_id].sib19[eNB_index], (SL_CommConfig_r12_t *)NULL, @@ -4941,7 +4941,7 @@ uint8_t fill_SLSS(const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, *slss_id = UE_rrc_inst[ctxt_pP->module_id].sib18[eNB_index]->commConfig_r12->commSyncConfig_r12->list.array[0]->slssid_r12; syncOffsetIndicator = UE_rrc_inst[ctxt_pP->module_id].sib18[eNB_index]->commConfig_r12->commSyncConfig_r12->list.array[0]->syncOffsetIndicator_r12; - //if RRC_CONNECTED (Todo: and if networkControlledSyncTx is configured and set to On) + //if RRC_CONNECTED (Todo: and if networkControlledSyncTx (RRCConnectionReconfiguration) is configured and set to On) if (UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State == RRC_CONNECTED){ //select subframe(s) indicated by syncOffsetIndicator subframe = syncOffsetIndicator; @@ -4974,7 +4974,7 @@ uint8_t fill_SLSS(const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, //----------------------------------------------------------------------------- void -rrc_ue_process_radioResourceConfig( +rrc_ue_process_sidelink_radioResourceConfig( module_id_t Mod_idP, uint8_t eNB_index, SystemInformationBlockType18_r12_t *sib18, @@ -4984,19 +4984,39 @@ rrc_ue_process_radioResourceConfig( ) //----------------------------------------------------------------------------- { - //process SIB18 + //process SIB18, configure MAC/PHY for receiving SL communication (RRC_IDLE and RRC_CONNECTED), for transmitting SL communication (RRC_IDLE) if (sib18 != NULL) { - //commRxPool - to receive SL communication - //commTxPoolNormalCommon - to transmit SL communication in RRC_IDLE - //do not consider commTXPoolExceptional for the moment + if (sib18->commConfig_r12 != NULL) { + //do not consider commTXPoolExceptional for the moment + //configure PHY/MAC to receive SL communication by using the RPs indicated by commRxPool + //sib18->commConfig_r12->commRxPool_r12 + //we can configure a default SLRB to receive one-to-many communication [should be verified] + + if (sib18->commConfig_r12->commTxPoolNormalCommon_r12 !=NULL) { //commTxPoolNormalCommon - to transmit SL communication in RRC_IDLE + //maybe we don't consider this case for the moment since UE will immediately establish a RRC connection after receiving SIB messages + //configure PHY/MAC to transmit SL communication using the RPs indicated by the first entry in commTxPoolNormalCommon + //SL_CommResourcePool_r12_t sl_CommResourcePool = sib18->commConfig_r12->commTxPoolNormalCommon_r12->list.array[0]; + } + } } - //process SIB19 + //process SIB19, configure MAC/PHY for receiving SL discovery (RRC_IDLE and RRC_CONNECTED), for transmitting SL discovery (RRC_IDLE) if (sib19 != NULL) { + //to receive non-PS related discovery announcements (discRxPool) + //sib19->discConfig_r12->discRxPool_r12; + + //to receive PS related discovery announcements (discRxPoolPS) + //sib19->ext1->discConfigPS_13->discRxPoolPS_r13; + //to transmit non-PS related discovery in RRC_IDLE + //sib19->discConfig_r12->discTxPoolCommon_r12; + + //to transmit PS related discovery in RRC_IDLE + //sib19->ext1->discConfigPS_13->discTxPoolPS_Common_r13; } - //process sl_CommConfig + + //process sl_CommConfig, configure MAC/PHY for transmitting SL communication (RRC_CONNECTED) if (sl_CommConfig != NULL) { if (sl_CommConfig->commTxResources_r12 != NULL) { @@ -5020,7 +5040,7 @@ rrc_ue_process_radioResourceConfig( break; case SL_CommConfig_r12__commTxResources_r12_PR_release: - //release dedicated resources for SL + //release dedicated resources for SL communication break; case SL_CommConfig_r12__commTxResources_r12_PR_NOTHING: /* No components present */ @@ -5033,7 +5053,9 @@ rrc_ue_process_radioResourceConfig( } + //process sl_DiscConfig, configure MAC/PHY for transmitting SL discovery announcements (RRC_CONNECTED) if (sl_DiscConfig != NULL) { + //dedicated resources for transmitting non-PS related discovery if (sl_DiscConfig->discTxResources_r12 != NULL) { switch (sl_DiscConfig->discTxResources_r12->present) { @@ -5049,7 +5071,7 @@ rrc_ue_process_radioResourceConfig( } break; case SL_DiscConfig_r12__discTxResources_r12_PR_release: - //sl_DiscConfig->discTxResources_r12->choice.release; + //release dedicated resources for SL discovery break; case SL_DiscConfig_r12__discTxResources_r12_PR_NOTHING: /* No components present */ break; @@ -5058,5 +5080,28 @@ rrc_ue_process_radioResourceConfig( } } + //dedicated resources for transmitting PS related discovery + if (sl_DiscConfig->ext2->discTxResourcesPS_r13 != NULL){ + switch (sl_DiscConfig->ext2->discTxResourcesPS_r13->present) { + case SL_DiscConfig_r12__ext2__discTxResourcesPS_r13_PR_setup: + if (sl_DiscConfig->ext2->discTxResourcesPS_r13->choice.setup.present == SL_DiscConfig_r12__ext2__discTxResourcesPS_r13__setup_PR_scheduled_r13) { + //sl_DiscConfig->ext2->discTxResourcesPS_r13->choice.setup.choice.scheduled_r13.discHoppingConfig_r13; + //sl_DiscConfig->ext2->discTxResourcesPS_r13->choice.setup.choice.scheduled_r13.discTxConfig_r13 + } else if (sl_DiscConfig->ext2->discTxResourcesPS_r13->choice.setup.present == SL_DiscConfig_r12__ext2__discTxResourcesPS_r13__setup_PR_ue_Selected_r13) { + //sl_DiscConfig->ext2->discTxResourcesPS_r13->choice.setup.choice.ue_Selected_r13.discTxPoolPS_Dedicated_r13; + } else { + //SL_DiscConfig_r12__ext2__discTxResourcesPS_r13__setup_PR_NOTHING, /* No components present */ + } + + break; + case SL_DiscConfig_r12__ext2__discTxResourcesPS_r13_PR_release: + break; + case SL_DiscConfig_r12__ext2__discTxResourcesPS_r13_PR_NOTHING: + /* No components present */ + break; + default: + break; + } + } } }