Commit 66ae679d authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

update SidelinkUEInformation (UE's side), RRCConnectionReconfiguration (eNB's...

update SidelinkUEInformation (UE's side), RRCConnectionReconfiguration (eNB's side), add rrc_ue_process_radioResourceConfig to process RPs and configure MAC/PHY
parent 511c48c7
This diff is collapsed.
......@@ -164,6 +164,23 @@ void rrc_ue_process_radioResourceConfigDedicated(
uint8_t eNB_index,
RadioResourceConfigDedicated_t *radioResourceConfigDedicated);
/** \brief Process a RadioResourceConfig and configure PHY/MAC for SL communication/discovery
\param Mod_idP
\param eNB_index Index of corresponding CH/eNB
\param sib18 Pointer to SIB18 from SI message
\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(
module_id_t Mod_idP,
uint8_t eNB_index,
SystemInformationBlockType18_r12_t *sib18,
SystemInformationBlockType19_r12_t *sib19,
SL_CommConfig_r12_t* sl_CommConfig,
SL_DiscConfig_r12_t* sl_DiscConfig);
// eNB/CH RRC Procedures
/**\brief Function to get the next transaction identifier.
......@@ -310,7 +327,7 @@ rrc_eNB_process_SidelinkUEInformation(
SidelinkUEInformation_r12_t* sidelinkUEInformation
);
/** \brief Get a Resource Pool for TX
/** \brief Get a Resource Pool to transmit SL communication
\param ctxt_pP Running context
\param ue_context_pP UE context
\param destinationInfoList Pointer to the list of SL destinations*/
......@@ -320,6 +337,18 @@ SL_CommConfig_r12_t rrc_eNB_get_sidelink_commTXPool(
SL_DestinationInfoList_r12_t *destinationInfoList
);
/** \brief Get a Resource Pool for Discovery
\param ctxt_pP Running context
\param ue_context_pP UE context
\param n_discoveryMessages Number of discovery messages*/
SL_DiscConfig_r12_t rrc_eNB_get_sidelink_discTXPool(
const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* const ue_context_pP,
int n_discoveryMessages
);
//L2_interface.c
int8_t
mac_rrc_data_req(
......
......@@ -1902,12 +1902,24 @@ rrc_ue_process_rrcConnectionReconfiguration(
//if RRCConnectionReconfiguration message includes the sl-CommConfig
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");
//rrc_ue_process_sidelink_commTxPool()
//process sl-CommConfig
rrc_ue_process_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,
(SL_DiscConfig_r12_t *)NULL
);
}
//if RRCConnectionReconfiguration message includes the sl-DiscConfig
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-CommConfig is present\n");
//rrc_ue_process_sidelink_discTxPool()
LOG_I(RRC,"sl-DiscConfig is present\n");
//process sl-DiscConfig
rrc_ue_process_radioResourceConfig(ctxt_pP->module_id,eNB_index,
(SystemInformationBlockType18_r12_t *)NULL,
(SystemInformationBlockType19_r12_t *)NULL,
(SL_CommConfig_r12_t* )NULL,
rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12
);
}
......@@ -3828,8 +3840,14 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in
// adding here function to store necessary parameters to transfer to PHY layer
LOG_I( RRC, "[FRAME %05"PRIu32"][RRC_UE][MOD %02"PRIu8"][][--- MAC_CONFIG_REQ (SIB18 params eNB %"PRIu8") --->][MAC_UE][MOD %02"PRIu8"][]\n",
ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id);
//should modify function rrc_mac_config_req_ue() to transfer SL-related parameters to PHY
//rrc_mac_config_req_ue();
//process SIB18 to transfer SL-related parameters to PHY
rrc_ue_process_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,
(SL_DiscConfig_r12_t *)NULL
);
}
break;
......@@ -3846,8 +3864,13 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in
// adding here function to store necessary parameters to transfer to PHY layer
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);
//should modify function rrc_mac_config_req_ue() to transfer SL-related parameters to PHY
//rrc_mac_config_req_ue();
//process SIB19 to transfer SL-related parameters to PHY
rrc_ue_process_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,
(SL_DiscConfig_r12_t *)NULL
);
}
break;
......@@ -4880,24 +4903,24 @@ rrc_top_cleanup_ue(
//-----------------------------------------------------------------------------
void rrc_ue_generate_SidelinkUEInformation( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,SL_DestinationInfoList_r12_t *destinationInfoList, long *discTxResourceReq, SL_TRIGGER_t mode)
uint8_t rrc_ue_generate_SidelinkUEInformation( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,SL_DestinationInfoList_r12_t *destinationInfoList, long *discTxResourceReq, SL_TRIGGER_t mode)
{
uint8_t size;
uint8_t buffer[100];
//Generate SidelinkUEInformation
if (((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&8192) > 0) && (destinationInfoList != NULL)) {//if SIB18 is available
size = do_SidelinkUEInformation(ctxt_pP->module_id, buffer, destinationInfoList, NULL, mode);
LOG_I(RRC,"[UE %d][RRC_UE] Frame %d : Logical Channel UL-DCCH, Generating SidelinkUEInformation (bytes%d, eNB %d)\n",
ctxt_pP->module_id,ctxt_pP->frame, size, eNB_index);
return size;
}
if (((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&16384) > 0) && (discTxResourceReq != NULL)) {//if SIB19 is available
size = do_SidelinkUEInformation(ctxt_pP->module_id, buffer, NULL, discTxResourceReq, mode);
LOG_I(RRC,"[UE %d][RRC_UE] Frame %d : Logical Channel UL-DCCH, Generating SidelinkUEInformation (bytes%d, eNB %d)\n",
ctxt_pP->module_id,ctxt_pP->frame, size, eNB_index);
return size;
}
}
......@@ -4947,3 +4970,93 @@ uint8_t fill_SLSS(const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,
}
return 0;
}
//-----------------------------------------------------------------------------
void
rrc_ue_process_radioResourceConfig(
module_id_t Mod_idP,
uint8_t eNB_index,
SystemInformationBlockType18_r12_t *sib18,
SystemInformationBlockType19_r12_t *sib19,
SL_CommConfig_r12_t* sl_CommConfig,
SL_DiscConfig_r12_t* sl_DiscConfig
)
//-----------------------------------------------------------------------------
{
//process SIB18
if (sib18 != NULL) {
//commRxPool - to receive SL communication
//commTxPoolNormalCommon - to transmit SL communication in RRC_IDLE
//do not consider commTXPoolExceptional for the moment
}
//process SIB19
if (sib19 != NULL) {
}
//process sl_CommConfig
if (sl_CommConfig != NULL) {
if (sl_CommConfig->commTxResources_r12 != NULL) {
switch (sl_CommConfig->commTxResources_r12->present){
case SL_CommConfig_r12__commTxResources_r12_PR_setup:
if (sl_CommConfig->commTxResources_r12->choice.setup.present == SL_CommConfig_r12__commTxResources_r12__setup_PR_scheduled_r12 ){
//configure scheduled resource for SL
//sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.sl_RNTI_r12;
//sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.mcs_r12;
//sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.mac_MainConfig_r12;
//sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.sc_CommTxConfig_r12;
} else if (sl_CommConfig->commTxResources_r12->choice.setup.present == SL_CommConfig_r12__commTxResources_r12__setup_PR_ue_Selected_r12){
//configure dedicated resources (commTxPoolNormalDedicated) for SL from which UE can autonomously select
//sl_CommConfig->commTxResources_r12->choice.setup.choice.ue_Selected_r12.commTxPoolNormalDedicated_r12;
//for the moment, only pass the first entry (e.g., do not consider priorityList in commTxPoolNormalDedicated (3GPP 36.331 Section 5.10.4 1>2>3>4))
//sl_CommConfig->commTxResources_r12->choice.setup.choice.ue_Selected_r12.commTxPoolNormalDedicated_r12.poolToAddModList_r12->list.array[0];
} else {
//SL_CommConfig_r12__commTxResources_r12__setup_PR_NOTHING /* No components present */
}
break;
case SL_CommConfig_r12__commTxResources_r12_PR_release:
//release dedicated resources for SL
break;
case SL_CommConfig_r12__commTxResources_r12_PR_NOTHING: /* No components present */
break;
default:
break;
}
}
}
if (sl_DiscConfig != NULL) {
if (sl_DiscConfig->discTxResources_r12 != NULL) {
switch (sl_DiscConfig->discTxResources_r12->present) {
case SL_DiscConfig_r12__discTxResources_r12_PR_setup:
if (sl_DiscConfig->discTxResources_r12->choice.setup.present == SL_DiscConfig_r12__discTxResources_r12__setup_PR_scheduled_r12) {
//sl_DiscConfig->discTxResources_r12->choice.setup.choice.scheduled_r12.discHoppingConfig_r12;
//sl_DiscConfig->discTxResources_r12->choice.setup.choice.scheduled_r12.discTF_IndexList_r12;
//sl_DiscConfig->discTxResources_r12->choice.setup.choice.scheduled_r12.discTxConfig_r12;
} else if (sl_DiscConfig->discTxResources_r12->choice.setup.present == SL_DiscConfig_r12__discTxResources_r12__setup_PR_ue_Selected_r12) {
//sl_DiscConfig->discTxResources_r12->choice.setup.choice.ue_Selected_r12.discTxPoolDedicated_r12;
} else {
//SL_DiscConfig_r12__discTxResources_r12__setup_PR_NOTHING, /* No components present */
}
break;
case SL_DiscConfig_r12__discTxResources_r12_PR_release:
//sl_DiscConfig->discTxResources_r12->choice.release;
break;
case SL_DiscConfig_r12__discTxResources_r12_PR_NOTHING: /* No components present */
break;
default:
break;
}
}
}
}
......@@ -57,6 +57,8 @@
#include "platform_types.h"
#include "msc.h"
#include "SL-CommConfig-r12.h"
#include "PeriodicBSR-Timer-r12.h"
#include "RetxBSR-Timer-r12.h"
#include "T.h"
......@@ -5257,7 +5259,6 @@ rrc_eNB_process_SidelinkUEInformation(
)
//-----------------------------------------------------------------------------
{
//SL_DestinationIdentity_r12_t sl_DestinationIdentityList[16];
SL_DestinationInfoList_r12_t *destinationInfoList;
int n_destinations = 0;
int ue_type = 0;
......@@ -5269,12 +5270,12 @@ rrc_eNB_process_SidelinkUEInformation(
//For SL Communication
// express its interest to receive SL communication
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commRxInterestedFreq_r12){
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commRxInterestedFreq_r12 != NULL){
}
// express its interest to transmit non-relay one-to-many SL communication
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->carrierFreq_r12){
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->carrierFreq_r12 != NULL){
n_destinations = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->destinationInfoList_r12.list.count;
destinationInfoList = CALLOC(1, sizeof(SL_DestinationInfoList_r12_t));
for (int i=0; i< n_destinations; i++ ){
......@@ -5288,7 +5289,7 @@ rrc_eNB_process_SidelinkUEInformation(
}
// express its interest to transmit non-relay one-to-one SL communication
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->carrierFreq_r12){
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->carrierFreq_r12 != NULL){
n_destinations = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->destinationInfoList_r12.list.count;
destinationInfoList = CALLOC(1, sizeof(SL_DestinationInfoList_r12_t));
for (int i=0; i< n_destinations; i++ ){
......@@ -5301,7 +5302,7 @@ rrc_eNB_process_SidelinkUEInformation(
}
// express its interest to transmit relay related one-to-one SL communication
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13->destinationInfoList_r12.list.count>0){
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13->destinationInfoList_r12.list.count > 0){
n_destinations = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13->destinationInfoList_r12.list.count;
ue_type = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->ue_Type_r13;
destinationInfoList = CALLOC(1, sizeof(SL_DestinationInfoList_r12_t));
......@@ -5315,7 +5316,7 @@ rrc_eNB_process_SidelinkUEInformation(
}
//express its interest to transmit relay related one-to-many SL communication
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13->destinationInfoList_r12.list.count>0){
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13->destinationInfoList_r12.list.count > 0){
n_destinations = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13->destinationInfoList_r12.list.count;
ue_type = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->ue_Type_r13;
destinationInfoList = CALLOC(1, sizeof(SL_DestinationInfoList_r12_t));
......@@ -5331,8 +5332,8 @@ rrc_eNB_process_SidelinkUEInformation(
//express its interest to receive SL discovery announcements
//express its interest to transmit non-PS related discovery announcements
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discTxResourceReq_r12 > 0){
n_discoveryMessages = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discTxResourceReq_r12;
if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discTxResourceReq_r12 != NULL){
n_discoveryMessages = *(sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discTxResourceReq_r12);
//generate RRC Reconfiguration
rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(ctxt_pP, ue_context_pP, NULL, n_discoveryMessages);
return 0;
......@@ -5365,7 +5366,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(
// allocate dedicated pools for UE -sl-CommConfig/sl-DiscConfig (sl-V2X-ConfigDedicated)
//populate dedicated resources for SL communication (sl-CommConfig)
if (destinationInfoList->list.count > 0) {
if ((destinationInfoList != NULL) && (destinationInfoList->list.count > 0)) {
//get dedicated resources from available pool and assign to the UE
SL_CommConfig_r12_t sl_CommConfig[destinationInfoList->list.count];
//get a RP from the available RPs
......@@ -5390,10 +5391,10 @@ rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(
//
}
//populate dedicated resources for SL discovery (sl-DiscConfig)
if (n_discoveryMessages > 0){
if (n_discoveryMessages > 0) {
SL_DiscConfig_r12_t sl_DiscConfig[n_discoveryMessages];
//get a RP from the available RPs
//SL_DiscConfig[0] = rrc_eNB_get_sidelink_discTXPool(ctxt_pP, ue_context_pP, n_discoveryMessages );
sl_DiscConfig[0] = rrc_eNB_get_sidelink_discTXPool(ctxt_pP, ue_context_pP, n_discoveryMessages );
size = do_RRCConnectionReconfiguration(ctxt_pP,
buffer,
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id), //Transaction_id
......@@ -5418,11 +5419,35 @@ rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(
// rrc_data_req();
return(0);
return size;
}
SL_CommConfig_r12_t rrc_eNB_get_sidelink_commTXPool( const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, SL_DestinationInfoList_r12_t *destinationInfoList ){
// for the moment, use scheduled resource allocation
SL_CommConfig_r12_t sl_CommConfig;
sl_CommConfig.commTxResources_r12 = CALLOC(1, sizeof(*sl_CommConfig.commTxResources_r12));
sl_CommConfig.commTxResources_r12->present = SL_CommConfig_r12__commTxResources_r12_PR_setup;
sl_CommConfig.commTxResources_r12->choice.setup.present = SL_CommConfig_r12__commTxResources_r12__setup_PR_scheduled_r12;
//sl_CommConfig.commTxResources_r12->choice.setup.choice.scheduled_r12.sl_RNTI_r12 = ue_context_pP->ue_context.rnti;//rnti
//sl_CommConfig.commTxResources_r12->choice.setup.choice.scheduled_r12.mcs_r12; //Msc
sl_CommConfig.commTxResources_r12->choice.setup.choice.scheduled_r12.mac_MainConfig_r12.retx_BSR_TimerSL = RetxBSR_Timer_r12_sf320; //MacConfig, for testing only
sl_CommConfig.commTxResources_r12->choice.setup.choice.scheduled_r12.mac_MainConfig_r12.periodic_BSR_TimerSL = CALLOC(1,
sizeof(*sl_CommConfig.commTxResources_r12->choice.setup.choice.scheduled_r12.mac_MainConfig_r12.periodic_BSR_TimerSL));
*(sl_CommConfig.commTxResources_r12->choice.setup.choice.scheduled_r12.mac_MainConfig_r12.periodic_BSR_TimerSL) = PeriodicBSR_Timer_r12_sf40; //MacConfig, for testing only
//sl_CommConfig.commTxResources_r12->choice.setup.choice.scheduled_r12.sc_CommTxConfig_r12; //RP
return sl_CommConfig;
}
SL_DiscConfig_r12_t rrc_eNB_get_sidelink_discTXPool( const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, int n_discoveryMessages ){
//TODO
SL_DiscConfig_r12_t sl_DiscConfig;
sl_DiscConfig.discTxResources_r12 = CALLOC(1,sizeof(*sl_DiscConfig.discTxResources_r12));
sl_DiscConfig.discTxResources_r12->present = SL_DiscConfig_r12__discTxResources_r12_PR_setup;
sl_DiscConfig.discTxResources_r12->choice.setup.present = SL_DiscConfig_r12__discTxResources_r12__setup_PR_scheduled_r12;
//sl_DiscConfig.discTxResources_r12->choice.setup.choice.scheduled_r12.discHoppingConfig_r12;
//sl_DiscConfig.discTxResources_r12->choice.setup.choice.scheduled_r12.discTF_IndexList_r12;
//sl_DiscConfig.discTxResources_r12->choice.setup.choice.scheduled_r12.discTxConfig_r12;
return sl_DiscConfig;
}
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