Commit 3aaa152e authored by Javier Morgade's avatar Javier Morgade

fembms: new FeMBMS/eMBMS MCH eNB/UE scheduler implemented

	- MBMS scheduler re-worked to enable dedicated MBMS serving cells
	- added support for multiple eMBMS MCH sessions
	- added support for multiple FeMBMS MCH sessions
Signed-off-by: default avatarJavier Morgade <javier.morgade@ieee.org>
parent 9b37dcec
...@@ -904,6 +904,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -904,6 +904,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
} }
#endif #endif
int do_fembms_si=0;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
if (cc[CC_id].MBMS_flag > 0) { if (cc[CC_id].MBMS_flag > 0) {
start_meas(&RC.mac[module_idP]->schedule_mch); start_meas(&RC.mac[module_idP]->schedule_mch);
...@@ -914,6 +915,10 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -914,6 +915,10 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
} }
stop_meas(&RC.mac[module_idP]->schedule_mch); stop_meas(&RC.mac[module_idP]->schedule_mch);
} }
if (cc[CC_id].FeMBMS_flag > 0) {
do_fembms_si = 1;
}
} }
static int debug_flag = 0; static int debug_flag = 0;
...@@ -935,12 +940,22 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -935,12 +940,22 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
} }
/* This schedules MIB */ /* This schedules MIB */
if(!do_fembms_si/*get_softmodem_params()->fembms*/){
if ((subframeP == 0) && (frameP & 3) == 0) if ((subframeP == 0) && (frameP & 3) == 0)
schedule_mib(module_idP, frameP, subframeP); schedule_mib(module_idP, frameP, subframeP);
}else{
if ((subframeP == 0) && (frameP & 15) == 0 ){
schedule_fembms_mib(module_idP, frameP, subframeP);
//schedule_SI_MBMS(module_idP, frameP, subframeP);
}
}
if (get_softmodem_params()->phy_test == 0) { if (get_softmodem_params()->phy_test == 0) {
/* This schedules SI for legacy LTE and eMTC starting in subframeP */ /* This schedules SI for legacy LTE and eMTC starting in subframeP */
if(!do_fembms_si/*get_softmodem_params()->fembms*/)
schedule_SI(module_idP, frameP, subframeP); schedule_SI(module_idP, frameP, subframeP);
else
schedule_SI_MBMS(module_idP, frameP, subframeP);
/* This schedules Paging in subframeP */ /* This schedules Paging in subframeP */
schedule_PCH(module_idP,frameP,subframeP); schedule_PCH(module_idP,frameP,subframeP);
/* This schedules Random-Access for legacy LTE and eMTC starting in subframeP */ /* This schedules Random-Access for legacy LTE and eMTC starting in subframeP */
......
...@@ -731,6 +731,7 @@ schedule_SI_MBMS(module_id_t module_idP, frame_t frameP, ...@@ -731,6 +731,7 @@ schedule_SI_MBMS(module_id_t module_idP, frame_t frameP,
if (subframeP == 0) { if (subframeP == 0) {
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
cc = &eNB->common_channels[CC_id]; cc = &eNB->common_channels[CC_id];
//printf("*cc->sib1_MBMS->si_WindowLength_r14 %d \n", *cc->sib1_MBMS->si_WindowLength_r14);
vrb_map = (void *) &cc->vrb_map; vrb_map = (void *) &cc->vrb_map;
N_RB_DL = to_prb(cc->mib->message.dl_Bandwidth); N_RB_DL = to_prb(cc->mib->message.dl_Bandwidth);
dl_config_request = &eNB->DL_req[CC_id]; dl_config_request = &eNB->DL_req[CC_id];
...@@ -911,6 +912,64 @@ schedule_SI_MBMS(module_id_t module_idP, frame_t frameP, ...@@ -911,6 +912,64 @@ schedule_SI_MBMS(module_id_t module_idP, frame_t frameP,
stop_meas(&eNB->schedule_si_mbms); stop_meas(&eNB->schedule_si_mbms);
} }
void
schedule_fembms_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) {
eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc;
nfapi_dl_config_request_pdu_t *dl_config_pdu;
nfapi_tx_request_pdu_t *TX_req;
int mib_sdu_length;
int CC_id;
nfapi_dl_config_request_t *dl_config_request;
nfapi_dl_config_request_body_t *dl_req;
uint16_t sfn_sf = frameP << 4 | subframeP;
AssertFatal(subframeP == 0, "Subframe must be 0\n");
AssertFatal((frameP & 15) == 0, "Frame must be a multiple of 16\n");
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
dl_config_request = &eNB->DL_req[CC_id];
dl_req = &dl_config_request->dl_config_request_body;
cc = &eNB->common_channels[CC_id];
mib_sdu_length = mac_rrc_data_req(module_idP, CC_id, frameP, MIBCH_MBMS, 0xFFFF, 1, &cc->MIB_pdu.payload[0], 0); // not used in this case
LOG_D(MAC, "Frame %d, subframe %d: BCH PDU length %d\n", frameP, subframeP, mib_sdu_length);
if (mib_sdu_length > 0) {
LOG_D(MAC, "Frame %d, subframe %d: Adding BCH PDU in position %d (length %d)\n", frameP, subframeP, dl_req->number_pdu, mib_sdu_length);
if ((frameP & 1023) < 40)
LOG_D(MAC,
"[eNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes (cc->mib->message.schedulingInfoSIB1_BR_r13 %d)\n",
module_idP, frameP, CC_id, mib_sdu_length,
(int) cc->mib->message.schedulingInfoSIB1_BR_r13);
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
memset((void *) dl_config_pdu, 0,
sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_BCH_PDU_TYPE, dl_config_pdu->pdu_size =
2 + sizeof(nfapi_dl_config_bch_pdu);
dl_config_pdu->bch_pdu.bch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG;
dl_config_pdu->bch_pdu.bch_pdu_rel8.length = mib_sdu_length;
dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id];
dl_config_pdu->bch_pdu.bch_pdu_rel8.transmission_power = 6000;
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
dl_req->number_pdu++;
dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST;
dl_config_request->sfn_sf = sfn_sf;
LOG_D(MAC, "eNB->DL_req[0].number_pdu %d (%p)\n", dl_req->number_pdu, &dl_req->number_pdu);
// DL request
TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus];
TX_req->pdu_length = 3;
TX_req->pdu_index = eNB->pdu_index[CC_id]++;
TX_req->num_segments = 1;
TX_req->segments[0].segment_length = 3;
TX_req->segments[0].segment_data = cc[CC_id].MIB_pdu.payload;
eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
eNB->TX_req[CC_id].sfn_sf = sfn_sf;
eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
}
}
}
void void
schedule_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) { schedule_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) {
......
This diff is collapsed.
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include "LTE_MobilityControlInfo.h" #include "LTE_MobilityControlInfo.h"
#include "LTE_MBSFN-AreaInfoList-r9.h" #include "LTE_MBSFN-AreaInfoList-r9.h"
#include "LTE_MBSFN-SubframeConfigList.h" #include "LTE_MBSFN-SubframeConfigList.h"
#include "LTE_MBSFNAreaConfiguration-r9.h"
#include "LTE_PMCH-InfoList-r9.h" #include "LTE_PMCH-InfoList-r9.h"
#include "LTE_SCellToAddMod-r10.h" #include "LTE_SCellToAddMod-r10.h"
#include "LTE_SystemInformationBlockType1-v1310-IEs.h" #include "LTE_SystemInformationBlockType1-v1310-IEs.h"
...@@ -412,9 +413,11 @@ typedef struct { ...@@ -412,9 +413,11 @@ typedef struct {
/*!\brief Values of BCCH SIB_BR logical channel (fake) */ /*!\brief Values of BCCH SIB_BR logical channel (fake) */
#define BCCH_SI_BR 7 // SI-BR #define BCCH_SI_BR 7 // SI-BR
/*!\brief Values of BCCH SIB1_MBMS logical channel (fake) */ /*!\brief Values of BCCH SIB1_MBMS logical channel (fake) */
#define BCCH_SIB1_MBMS 60 // SIB1_MBMS //TODO better armonize index #define MIBCH_MBMS 10 // SIB1_MBMS //TODO better armonize index
#define BCCH_SIB1_MBMS 12 // SIB1_MBMS //TODO better armonize index
/*!\brief Values of BCCH SI_MBMS logical channel (fake) */ /*!\brief Values of BCCH SI_MBMS logical channel (fake) */
#define BCCH_SI_MBMS 61 // SIB_MBMS //TODO better armonize index #define BCCH_SI_MBMS 13 // SIB_MBMS //TODO better armonize index
#define MCCH_COUNTING 14
/*!\brief Value of CCCH / SRB0 logical channel */ /*!\brief Value of CCCH / SRB0 logical channel */
#define CCCH 0 // srb0 #define CCCH 0 // srb0
/*!\brief DCCH / SRB1 logical channel */ /*!\brief DCCH / SRB1 logical channel */
...@@ -1312,6 +1315,8 @@ typedef struct { ...@@ -1312,6 +1315,8 @@ typedef struct {
/// MBSFN SubframeConfig /// MBSFN SubframeConfig
struct LTE_MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; struct LTE_MBSFN_SubframeConfig *mbsfn_SubframeConfig[8];
struct LTE_NonMBSFN_SubframeConfig_r14 *non_mbsfn_SubframeConfig; struct LTE_NonMBSFN_SubframeConfig_r14 *non_mbsfn_SubframeConfig;
struct LTE_MBSFN_SubframeConfig *commonSF_Alloc_r9_mbsfn_SubframeConfig[8]; // FIXME replace 8 by MAX_MBSFN_AREA?
uint8_t commonSF_AllocPeriod_r9;
/// number of subframe allocation pattern available for MBSFN sync area /// number of subframe allocation pattern available for MBSFN sync area
uint8_t num_sf_allocation_pattern; uint8_t num_sf_allocation_pattern;
/// MBMS Flag /// MBMS Flag
......
...@@ -33,6 +33,16 @@ ...@@ -33,6 +33,16 @@
#include "PHY/defs_common.h" // for PRACH_RESOURCES_t and lte_subframe_t #include "PHY/defs_common.h" // for PRACH_RESOURCES_t and lte_subframe_t
#include "openair2/COMMON/mac_messages_types.h" #include "openair2/COMMON/mac_messages_types.h"
/** \fn void schedule_fembms_mib(module_id_t module_idP,frame_t frameP,sub_frame_t subframe);
\brief MIB scheduling for PBCH. This function requests the MIB from RRC and provides it to L1.
@param Mod_id Instance ID of eNB
@param frame Frame index
@param subframe Subframe number on which to act
*/
void schedule_fembms_mib(module_id_t module_idP,
frame_t frameP, sub_frame_t subframeP);
/** \addtogroup _mac /** \addtogroup _mac
* @{ * @{
...@@ -534,6 +544,10 @@ int ue_query_mch(module_id_t Mod_id, uint8_t CC_id, uint32_t frame, ...@@ -534,6 +544,10 @@ int ue_query_mch(module_id_t Mod_id, uint8_t CC_id, uint32_t frame,
sub_frame_t subframe, uint8_t eNB_index, sub_frame_t subframe, uint8_t eNB_index,
uint8_t *sync_area, uint8_t *mcch_active); uint8_t *sync_area, uint8_t *mcch_active);
int ue_query_mch_fembms(module_id_t Mod_id, uint8_t CC_id, uint32_t frame,
sub_frame_t subframe, uint8_t eNB_index,
uint8_t * sync_area, uint8_t * mcch_active);
/* \brief Called by PHY to get sdu for PUSCH transmission. It performs the following operations: Checks BSR for DCCH, DCCH1 and DTCH corresponding to previous values computed either in SR or BSR procedures. It gets rlc status indications on DCCH,DCCH1 and DTCH and forms BSR elements and PHR in MAC header. CRNTI element is not supported yet. It computes transport block for up to 3 SDUs and generates header and forms the complete MAC SDU. /* \brief Called by PHY to get sdu for PUSCH transmission. It performs the following operations: Checks BSR for DCCH, DCCH1 and DTCH corresponding to previous values computed either in SR or BSR procedures. It gets rlc status indications on DCCH,DCCH1 and DTCH and forms BSR elements and PHR in MAC header. CRNTI element is not supported yet. It computes transport block for up to 3 SDUs and generates header and forms the complete MAC SDU.
@param Mod_id Instance id of UE in machine @param Mod_id Instance id of UE in machine
...@@ -900,6 +914,7 @@ int generate_dlsch_header(unsigned char *mac_header, ...@@ -900,6 +914,7 @@ int generate_dlsch_header(unsigned char *mac_header,
@param non_MBSFN_SubframeConfig pointer to FeMBMS Non MBSFN Subframe Config @param non_MBSFN_SubframeConfig pointer to FeMBMS Non MBSFN Subframe Config
@param sib1_mbms_r14_fembms pointer SI Scheduling infomration for SI-MBMS @param sib1_mbms_r14_fembms pointer SI Scheduling infomration for SI-MBMS
@param mbsfn_AreaInfoList_fembms pointer to FeMBMS MBSFN Area Info list from SIB1-MBMS @param mbsfn_AreaInfoList_fembms pointer to FeMBMS MBSFN Area Info list from SIB1-MBMS
@param mbms_AreaConfiguration pointer to eMBMS MBSFN Area Configuration
*/ */
int rrc_mac_config_req_eNB(module_id_t module_idP, int rrc_mac_config_req_eNB(module_id_t module_idP,
...@@ -936,7 +951,8 @@ int rrc_mac_config_req_eNB(module_id_t module_idP, ...@@ -936,7 +951,8 @@ int rrc_mac_config_req_eNB(module_id_t module_idP,
LTE_SchedulingInfo_MBMS_r14_t *schedulingInfo_fembms, LTE_SchedulingInfo_MBMS_r14_t *schedulingInfo_fembms,
struct LTE_NonMBSFN_SubframeConfig_r14 *nonMBSFN_SubframeConfig, struct LTE_NonMBSFN_SubframeConfig_r14 *nonMBSFN_SubframeConfig,
LTE_SystemInformationBlockType1_MBMS_r14_t *sib1_mbms_r14_fembms, LTE_SystemInformationBlockType1_MBMS_r14_t *sib1_mbms_r14_fembms,
LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList_fembms LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList_fembms,
LTE_MBSFNAreaConfiguration_r9_t * mbms_AreaConfiguration
); );
/** \brief RRC eNB Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages. /** \brief RRC eNB Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
......
This diff is collapsed.
...@@ -308,7 +308,7 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p ...@@ -308,7 +308,7 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p
ctxt.module_id, ctxt.rnti, ctxt.enb_flag); ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
LOG_I(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d on Rab %ld \n", LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d on Rab %ld \n",
ctxt.frame, ctxt.instance, len, rab_id); ctxt.frame, ctxt.instance, len, rab_id);
LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %ld][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %04x][RB %ld]\n", LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %ld][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %04x][RB %ld]\n",
ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id, ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id,
......
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