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
......@@ -1432,7 +1432,7 @@ uint8_t do_SidelinkUEInformation(uint8_t Mod_id, uint8_t *buffer, SL_Destinatio
UL_DCCH_Message_t ul_dcch_msg;
SidelinkUEInformation_r12_t *sidelinkUEInformation;
ARFCN_ValueEUTRA_r9_t carrierFreq[] = {2565000000.0};//sidelink communication frequency
ARFCN_ValueEUTRA_r9_t carrierFreq[] = {2565000000.0};//sidelink communication frequency (hardcoded - should come from SIB2)
memset((void *)&ul_dcch_msg,0,sizeof(UL_DCCH_Message_t));
......@@ -1445,49 +1445,99 @@ uint8_t do_SidelinkUEInformation(uint8_t Mod_id, uint8_t *buffer, SL_Destinatio
switch(mode) {
//if SIB18 is available case 1,2,3,4
case SL_RECEIVE_COMMUNICATION: // to receive sidelink communication
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commRxInterestedFreq_r12 = &carrierFreq[0];
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commRxInterestedFreq_r12[0] = carrierFreq[0];
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commRxInterestedFreq_r12 = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commRxInterestedFreq_r12));
memcpy((void*)sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commRxInterestedFreq_r12, (void*)carrierFreq,
sizeof(ARFCN_ValueEUTRA_r9_t));
break;
case SL_TRANSMIT_NON_RELAY_ONE_TO_MANY: //to transmit non-relay related one-to-many sidelink communication
//commTxResourceReq
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->carrierFreq_r12 = &carrierFreq[0];
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->destinationInfoList_r12 = *destinationInfoList;
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12 = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12));
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->carrierFreq_r12 = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->carrierFreq_r12));
memcpy((void*)sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->carrierFreq_r12, (void*)carrierFreq,
sizeof(ARFCN_ValueEUTRA_r9_t));
memcpy(&sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->destinationInfoList_r12,
destinationInfoList,
sizeof(*destinationInfoList));
break;
case SL_TRANSMIT_NON_RELAY_ONE_TO_ONE://transmit non-relay related one-to-one sidelink communication
//if commTxResourceUC-ReqAllowed is included in SIB18
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->carrierFreq_r12 = &carrierFreq[0];
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->destinationInfoList_r12 = *destinationInfoList;
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension));
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13 = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13));
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->carrierFreq_r12 = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->carrierFreq_r12));
memcpy((void*)sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->carrierFreq_r12, (void*)carrierFreq,
sizeof (ARFCN_ValueEUTRA_r9_t));
memcpy(&sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->destinationInfoList_r12,
destinationInfoList,
sizeof(*destinationInfoList));
break;
case SL_TRANSMIT_RELAY_ONE_TO_ONE: //transmit relay related one-to-one sidelink communication
//if SIB19 includes discConfigRelay and UE acts a relay or UE has a selected relay
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13->destinationInfoList_r12 = *destinationInfoList;
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension));
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13= CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13));
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13 = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13));
memcpy(&sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13->destinationInfoList_r12,
destinationInfoList,
sizeof(*destinationInfoList));
//set ue-type to relayUE or remoteUE
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->ue_Type_r13 =SidelinkUEInformation_v1310_IEs__commTxResourceInfoReqRelay_r13__ue_Type_r13_relayUE;
//sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12->nonCriticalExtension->commTxResourceInfoReqRelay_r13->ue_Type_r13 =SidelinkUEInformation_v1310_IEs__commTxResourceInfoReqRelay_r13__ue_Type_r13_remoteUE;
break;
case SL_TRANSMIT_RELAY_ONE_TO_MANY: //transmit relay related one-to-many sidelink communication
//if SIB19 includes discConfigRelay and UE acts a relay
//set ue-type to relayUE
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension));
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13= CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13));
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13 = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13));
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->ue_Type_r13 =SidelinkUEInformation_v1310_IEs__commTxResourceInfoReqRelay_r13__ue_Type_r13_relayUE;
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13->destinationInfoList_r12 = *destinationInfoList;
memcpy(&sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13->destinationInfoList_r12,
destinationInfoList,
sizeof(*destinationInfoList));
break;
//if SIB19 is available
//TTN - for case 6,7, and 8, 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 = SidelinkUEInformation_r12_IEs__discRxInterest_r12_true;
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discRxInterest_r12 = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discRxInterest_r12));
*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discRxInterest_r12 = SidelinkUEInformation_r12_IEs__discRxInterest_r12_true;
break;
case SL_TRANSMIT_NON_PS_DISCOVERY://to transmit non-PS related sidelink discovery announcements
//for the first frequency
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discTxResourceReq_r12 = discTxResourceReq;
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discTxResourceReq_r12 = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discTxResourceReq_r12));
memcpy((void*)sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.discTxResourceReq_r12,
(void*)discTxResourceReq,
sizeof(long));
//for additional frequency
break;
case SL_TRANSMIT_PS_DISCOVERY://to transmit PS related sidelink discovery announcements
//if to transmit non-relay PS related discovery announcements and SIB19 includes discConfigPS
//if UE is acting as relay UE and SIB includes discConfigRelay (relay threshold condition)
//if relay UE/has a selected relay UE and if SIB19 includes discConfigRelay
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->discTxResourceReqPS_r13->discTxResourceReq_r13 = discTxResourceReq;
//sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12->nonCriticalExtension->discTxResourceReqPS_r13->carrierFreqDiscTx_r13
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension));
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->discTxResourceReqPS_r13 = CALLOC(1,
sizeof(*sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->discTxResourceReqPS_r13));
sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->discTxResourceReqPS_r13->discTxResourceReq_r13 = *discTxResourceReq;
break;
//SIB21
case SL_RECEIVE_V2X:
......@@ -2356,13 +2406,42 @@ do_RRCConnectionReconfiguration(
//TTN for D2D
//allocate dedicated resource pools for SL communication (sl_CommConfig_r12)
if (sl_CommConfig != NULL) {
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12 = sl_CommConfig;
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12[0] = sl_CommConfig[0];
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension));
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension));
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension));
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension));
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension));
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12 = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12));
memcpy((void*)rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12, (void*)sl_CommConfig,
sizeof(SL_CommConfig_r12_t));
} else {
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12 = NULL;
}
//allocate dedicated resource pools for SL discovery (sl_DiscConfig)
if (sl_DiscConfig != NULL){
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12 = sl_DiscConfig;
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12[0] = sl_DiscConfig[0];
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension));
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension));
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension));
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension));
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension));
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12 = CALLOC(1,
sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12));
memcpy((void*)rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12, (void*)sl_DiscConfig,
sizeof(SL_DiscConfig_r12_t));
} else {
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12 = NULL;
}
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message,
......
......@@ -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