Commit 9e789c84 authored by Javier Morgade's avatar Javier Morgade

fembms: - added suppor for FeMBMS RRC sublayer / l2 interface

	- added primitives to build asn1 messages for FeMBMS eNB
Signed-off-by: default avatarJavier Morgade <javier.morgade@ieee.org>
parent 6db9fca1
......@@ -28,6 +28,15 @@
* \email: raymond.knopp@eurecom.fr
*/
/*! \file l2_interface.c
* \brief layer 2 interface, added support for FeMBMS RRC sublayer
* \author J. Morgade
* \date 2020
* \version 1.0
* \email: javier.morgade@ieee.org
*/
#include "platform_types.h"
#include "rrc_defs.h"
#include "rrc_extern.h"
......@@ -65,6 +74,9 @@ mac_rrc_data_req(
uint8_t Sdu_size = 0;
uint8_t sfn = (uint8_t)((frameP>>2)&0xff);
uint8_t sfn_fembms = (uint8_t)((frameP>>4)&0xff);
sfn_fembms = sfn_fembms<<2;
if (LOG_DEBUGFLAG(DEBUG_RRC)) {
LOG_D(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%ld\n",Mod_idP,Srb_id);
}
......@@ -72,12 +84,14 @@ mac_rrc_data_req(
eNB_RRC_INST *rrc;
rrc_eNB_carrier_data_t *carrier;
LTE_BCCH_BCH_Message_t *mib;
LTE_BCCH_BCH_Message_MBMS_t *mib_fembms;
rrc = RC.rrc[Mod_idP];
carrier = &rrc->carrier[0];
mib = &carrier->mib;
mib_fembms = &carrier->mib_fembms;
if((Srb_id & RAB_OFFSET) == BCCH_SI_MBMS){
if (frameP%4 == 0) {
if (frameP%8 == 0) {
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB1_MBMS,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_MBMS);
......@@ -159,6 +173,22 @@ mac_rrc_data_req(
return(3);
}
if( (Srb_id & RAB_OFFSET ) == MIBCH_MBMS) {
mib_fembms->message.systemFrameNumber_r14.buf = &sfn_fembms;
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_BCH_Message_MBMS,
NULL,
(void *)mib_fembms,
carrier->MIB_FeMBMS,
24);
LOG_I(RRC,"Encoded MIB MBMS for frame %d (%p), bits %lu %x,%x,%x %x bits_unused %d\n",sfn_fembms>>2,carrier->MIB_FeMBMS,enc_rval.encoded,carrier->MIB_FeMBMS[0],carrier->MIB_FeMBMS[1],carrier->MIB_FeMBMS[2],mib_fembms->message.systemFrameNumber_r14.buf[0],mib_fembms->message.systemFrameNumber_r14.bits_unused);
buffer_pP[0]=carrier->MIB_FeMBMS[0];
buffer_pP[1]=carrier->MIB_FeMBMS[1];
buffer_pP[2]=carrier->MIB_FeMBMS[2];
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
return(3);
}
if( (Srb_id & RAB_OFFSET ) == CCCH) {
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[Mod_idP],rnti);
......@@ -203,6 +233,8 @@ mac_rrc_data_req(
RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
LOG_W(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_idP,frameP);
if (LOG_DEBUGFLAG(DEBUG_RRC)) {
LOG_W(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_idP,frameP);
......@@ -216,6 +248,29 @@ mac_rrc_data_req(
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
}
if((Srb_id & RAB_OFFSET) == MCCH_COUNTING) {
if(RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESS_COUNTING[mbsfn_sync_area].Active==0) {
return 0; // this parameter is set in function init_mcch in rrc_eNB.c
}
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE_COUNTING[mbsfn_sync_area],
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE_COUNTING[mbsfn_sync_area]);
if (LOG_DEBUGFLAG(DEBUG_RRC)) {
LOG_W(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE_COUNTING \n",Mod_idP,frameP);
for (int i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE_COUNTING[mbsfn_sync_area]; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
} /* LOG_DEBUGFLAG(DEBUG_RRC) */
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE_COUNTING[mbsfn_sync_area]);
}
if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR) {
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB1_BR,
......
......@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
/*! \file l2_interface.c
/*! \file l2_interface_ue.c
* \brief layer 2 interface, used to support different RRC sublayer
* \author Raymond Knopp and Navid Nikaein
* \date 2010-2014
......@@ -28,6 +28,16 @@
* \email: raymond.knopp@eurecom.fr
*/
/*! \file l2_interface_ue.c
* \brief layer 2 interface, added support for FeMBMS RRC sublayer
* \author J. Morgade
* \date 2020
* \version 1.0
* \email: javier.morgade@ieee.org
*/
#include "platform_types.h"
#include "rrc_defs.h"
#include "rrc_extern.h"
......@@ -217,7 +227,10 @@ mac_rrc_data_ind_ue(
}
if ((srb_idP & RAB_OFFSET) == MCCH) {
LOG_T(RRC,"[UE %d] Frame %d: Received SDU on MBSFN sync area %d for MCCH on SRB %ld from eNB %d\n",
//LOG_T(RRC,"[UE %d] Frame %d: Received SDU on MBSFN sync area %d for MCCH on SRB %ld from eNB %d\n",
//module_idP,frameP, mbsfn_sync_areaP, srb_idP & RAB_OFFSET,eNB_indexP);
LOG_W(RRC,"[UE %d] Frame %d: Received SDU on MBSFN sync area %d for MCCH on SRB %ld from eNB %d\n",
module_idP,frameP, mbsfn_sync_areaP, srb_idP & RAB_OFFSET,eNB_indexP);
{
MessageDef *message_p;
......
......@@ -28,6 +28,14 @@
* \email: raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr
*/
/*! \file asn1_msg.c
* \brief added primitives to build the asn1 messages for FeMBMS
* \author Javier Morgade
* \date 2019-2020
* \version 1.0
* \email: javier.morgade@ieee.org
*/
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h> /* for atoi(3) */
......@@ -185,7 +193,8 @@ uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId) {
uint8_t do_MIB_FeMBMS(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t additionalNonMBSFN, uint32_t frame) {
asn_enc_rval_t enc_rval;
LTE_BCCH_BCH_Message_MBMS_t *mib_fembms=&carrier->mib_fembms;
uint8_t sfn = (uint8_t)((frame>>2)&0xff);
frame=198;
uint8_t sfn = (uint8_t)((frame>>4)&0xff);
uint16_t *spare = calloc(1,sizeof(uint16_t));
if( spare == NULL ) abort();
......@@ -223,15 +232,16 @@ uint8_t do_MIB_FeMBMS(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_
(uint32_t)mib_fembms->message.dl_Bandwidth_MBMS_r14,
(uint32_t)additionalNonMBSFN,
(uint32_t)sfn);
sfn = sfn<<2;
mib_fembms->message.systemFrameNumber_r14.buf = &sfn;
mib_fembms->message.systemFrameNumber_r14.size = 1;
mib_fembms->message.systemFrameNumber_r14.bits_unused=0;
mib_fembms->message.systemFrameNumber_r14.bits_unused=2;
mib_fembms->message.spare.buf = (uint8_t *)spare;
mib_fembms->message.spare.size = 2;
mib_fembms->message.spare.bits_unused = 6; // This makes a spare of 10 bits
mib_fembms->message.spare.bits_unused = 3; // This makes a spare of 10 bits
//TODO additionalNonBMSFNSubframes-r14 INTEGER (0..3) ?
//if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
//xer_fprint(stdout, &asn_DEF_LTE_BCCH_BCH_Message_MBMS, (void *)mib_fembms);
xer_fprint(stdout, &asn_DEF_LTE_BCCH_BCH_Message_MBMS, (void *)mib_fembms);
//}
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_BCH_Message_MBMS,
NULL,
......@@ -387,7 +397,11 @@ uint8_t do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier,
// SystemInformation_t systemInformation;
int num_plmn = configuration->num_plmn;
LTE_PLMN_IdentityInfo_t *PLMN_identity_info;
//LTE_PLMN_IdentityInfo_t *PLMN_identity_info;
LTE_PLMN_IdentityInfo_t * PLMN_identity_info = &carrier->PLMN_identity_info_MBMS[0];
//LTE_MCC_MNC_Digit_t dummy_mcc[num_plmn][3], dummy_mnc[num_plmn][3];
//LTE_MCC_MNC_Digit_t *dummy_mcc = &carrier->dummy_mcc_MBMS[0][0];
//LTE_MCC_MNC_Digit_t *dummy_mnc = &carrier->dummy_mnc_MBMS[0][0];
LTE_MCC_MNC_Digit_t *dummy_mcc_0;
LTE_MCC_MNC_Digit_t *dummy_mcc_1;
LTE_MCC_MNC_Digit_t *dummy_mcc_2;
......@@ -395,7 +409,9 @@ uint8_t do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier,
LTE_MCC_MNC_Digit_t *dummy_mnc_1;
LTE_MCC_MNC_Digit_t *dummy_mnc_2;
asn_enc_rval_t enc_rval;
LTE_SchedulingInfo_MBMS_r14_t *schedulingInfo;
//LTE_SchedulingInfo_MBMS_r14_t *schedulingInfo;
//LTE_SchedulingInfo_MBMS_r14_t schedulingInfo;
LTE_SchedulingInfo_MBMS_r14_t *schedulingInfo = &carrier->schedulingInfo_MBMS;
LTE_SIB_Type_t *sib_type;
uint8_t *buffer = carrier->SIB1_MBMS;
LTE_BCCH_DL_SCH_Message_MBMS_t *bcch_message = &carrier->siblock1_MBMS;
......@@ -408,6 +424,8 @@ uint8_t do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier,
// memcpy(&bcch_message.message.choice.c1.choice.systemInformationBlockType1,sib1,sizeof(SystemInformationBlockType1_t));
*sib1_MBMS = &bcch_message->message.choice.c1.choice.systemInformationBlockType1_MBMS_r14;
PLMN_identity_info = CALLOC(1, sizeof(LTE_PLMN_IdentityInfo_t) * num_plmn);
//memset(&schedulingInfo,0,sizeof(LTE_SchedulingInfo_MBMS_r14_t));
memset(schedulingInfo,0,sizeof(LTE_SchedulingInfo_MBMS_r14_t));
if (PLMN_identity_info == NULL)
exit(1);
......@@ -528,7 +546,7 @@ uint8_t do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier,
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.size= 1;
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x20<<2; // FDD: SF1
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= LTE_MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n7;
MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= LTE_MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n2;
(MBSFN_Area1)->ext1 = CALLOC (1, sizeof(*(MBSFN_Area1)->ext1));
memset((MBSFN_Area1)->ext1,0,sizeof(*(MBSFN_Area1)->ext1));
MBSFN_Area1->ext1->subcarrierSpacingMBMS_r14 = CALLOC(1,sizeof(*( MBSFN_Area1->ext1)->subcarrierSpacingMBMS_r14));
......@@ -541,18 +559,18 @@ uint8_t do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier,
if(1) {
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14 = CALLOC(1,sizeof(struct LTE_NonMBSFN_SubframeConfig_r14));
memset((*sib1_MBMS)->nonMBSFN_SubframeConfig_r14,0,sizeof(struct LTE_NonMBSFN_SubframeConfig_r14));
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14->radioFrameAllocationPeriod_r14 = LTE_NonMBSFN_SubframeConfig_r14__radioFrameAllocationPeriod_r14_rf8;
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14->radioFrameAllocationPeriod_r14 = LTE_NonMBSFN_SubframeConfig_r14__radioFrameAllocationPeriod_r14_rf4;
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14->radioFrameAllocationOffset_r14 = 0;
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14->subframeAllocation_r14.buf = MALLOC(2);
//100000001 byte(0)=10000000 byte(1)=xxxxxxx1
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14->subframeAllocation_r14.buf[0] = 0x80<<0;
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14->subframeAllocation_r14.buf[1] = 0x1<<7;
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14->subframeAllocation_r14.buf[0] = 0x8<<0;
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14->subframeAllocation_r14.buf[1] = 0;
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14->subframeAllocation_r14.size = 2;
(*sib1_MBMS)->nonMBSFN_SubframeConfig_r14->subframeAllocation_r14.bits_unused = 7;
}
//if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
//xer_fprint(stdout, &asn_DEF_LTE_BCCH_DL_SCH_Message_MBMS, (void *)bcch_message);
xer_fprint(stdout, &asn_DEF_LTE_BCCH_DL_SCH_Message_MBMS, (void *)bcch_message);
//}
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_DL_SCH_Message_MBMS,
NULL,
......
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