Commit e46fb846 authored by nguyennd's avatar nguyennd
Browse files

Update and validate the eMBMS operation and its interface to OTG, pre-ci test passed

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4148 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent f66750b1
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
extern inline unsigned int taus(void); extern inline unsigned int taus(void);
extern int exit_openair; extern int exit_openair;
extern void do_OFDM_mod(mod_sym_t **txdataF, s32 **txdata, uint32_t frame, u16 next_slot, LTE_DL_FRAME_PARMS *frame_parms); //extern void do_OFDM_mod(mod_sym_t **txdataF, s32 **txdata, uint32_t frame, u16 next_slot, LTE_DL_FRAME_PARMS *frame_parms);
unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(16))); unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(16)));
......
...@@ -2989,6 +2989,7 @@ int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs ...@@ -2989,6 +2989,7 @@ int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
if (ret == (1+phy_vars_ue->dlsch_ue_MCH[0]->max_turbo_iterations)) { if (ret == (1+phy_vars_ue->dlsch_ue_MCH[0]->max_turbo_iterations)) {
phy_vars_ue->dlsch_mch_errors[0]++; phy_vars_ue->dlsch_mch_errors[0]++;
LOG_D(PHY,"number of errors: %d\n",phy_vars_ue->dlsch_mch_errors[0]);
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error, not passing to L2 (TBS %d, iter %d,G %d)\n",phy_vars_ue->Mod_id,((last_slot>>1)==9?-1:0)+phy_vars_ue->frame,last_slot>>1,phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->TBS>>3,phy_vars_ue->dlsch_ue_MCH[0]->max_turbo_iterations,phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->G); LOG_D(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error, not passing to L2 (TBS %d, iter %d,G %d)\n",phy_vars_ue->Mod_id,((last_slot>>1)==9?-1:0)+phy_vars_ue->frame,last_slot>>1,phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->TBS>>3,phy_vars_ue->dlsch_ue_MCH[0]->max_turbo_iterations,phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->G);
dump_mch(phy_vars_ue,0,phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->G,(last_slot>>1)); dump_mch(phy_vars_ue,0,phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->G,(last_slot>>1));
#ifdef DEBUG_DLSCH #ifdef DEBUG_DLSCH
......
...@@ -9,7 +9,7 @@ OPENAIR1_TOP = $(OPENAIR1_DIR) ...@@ -9,7 +9,7 @@ OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR) OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR) OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS = -g -O2 -Wno-strict-aliasing -rdynamic -Wall -DPHYSIM -DNODE_RG -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 $(CPUFLAGS) -DMALLOC_CHECK_=1 # -Wno-packed-bitfield-compat CFLAGS = -g -O -Wno-strict-aliasing -rdynamic -Wall -DPHYSIM -DNODE_RG -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 $(CPUFLAGS) -DMALLOC_CHECK_=1 # -Wno-packed-bitfield-compat
# DCI Debug # DCI Debug
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
*/ */
# define MAX_IP_PACKET_SIZE 1512 # define MAX_IP_PACKET_SIZE 1512
# else # else
# define MAX_IP_PACKET_SIZE 1500 # define MAX_IP_PACKET_SIZE 1500 // 3000
# endif # endif
#endif #endif
// overwrite the previous deinitions // overwrite the previous deinitions
......
...@@ -70,7 +70,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index, ...@@ -70,7 +70,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
mac_xface->phy_config_sib1_ue(Mod_id,eNB_index,tdd_Config,*SIwindowsize,*SIperiod); mac_xface->phy_config_sib1_ue(Mod_id,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
} }
if (radioResourceConfigCommon) { if (radioResourceConfigCommon!=NULL) {
if (eNB_flag==1) { if (eNB_flag==1) {
LOG_I(MAC,"[CONFIG]SIB2/3 Contents (partial)\n"); LOG_I(MAC,"[CONFIG]SIB2/3 Contents (partial)\n");
...@@ -185,7 +185,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index, ...@@ -185,7 +185,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
} }
if (eNB_flag == 0) { if (eNB_flag == 0) {
if (measObj!= NULL) if (measObj!= NULL) {
if (measObj[0]!= NULL){ if (measObj[0]!= NULL){
UE_mac_inst[Mod_id].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count; UE_mac_inst[Mod_id].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count;
LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_id].n_adj_cells); LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_id].n_adj_cells);
...@@ -195,6 +195,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index, ...@@ -195,6 +195,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
} }
mac_xface->phy_config_meas_ue(Mod_id,eNB_index,UE_mac_inst[Mod_id].n_adj_cells,UE_mac_inst[Mod_id].adj_cell_id); mac_xface->phy_config_meas_ue(Mod_id,eNB_index,UE_mac_inst[Mod_id].n_adj_cells,UE_mac_inst[Mod_id].adj_cell_id);
} }
}
} }
...@@ -243,8 +244,13 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index, ...@@ -243,8 +244,13 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
if (pmch_InfoList != NULL) { if (pmch_InfoList != NULL) {
// LOG_I(MAC,"DUY: lcid when entering rrc_mac config_req is %02d\n",(pmch_InfoList->list.array[0]->mbms_SessionInfoList_r9.list.array[0]->logicalChannelIdentity_r9));
if (eNB_flag == 1) { if (eNB_flag == 1) {
LOG_I(MAC, "[CONFIG] Number of PMCH in this MBSFN Area %d\n", pmch_InfoList->list.count); LOG_I(MAC, "[CONFIG] Number of PMCH in this MBSFN Area %d\n", pmch_InfoList->list.count);
for (i =0; i< pmch_InfoList->list.count; i++) { for (i =0; i< pmch_InfoList->list.count; i++) {
eNB_mac_inst[Mod_id].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9; eNB_mac_inst[Mod_id].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
...@@ -256,17 +262,15 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index, ...@@ -256,17 +262,15 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
eNB_mac_inst[Mod_id].pmch_Config[i]->dataMCS_r9); eNB_mac_inst[Mod_id].pmch_Config[i]->dataMCS_r9);
// MBMS session info list in each MCH // MBMS session info list in each MCH
// for (j=0;j< pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9.list.count;j++) { eNB_mac_inst[Mod_id].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9;
eNB_mac_inst[Mod_id].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9; LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_id].mbms_SessionList[i]->list.count);
LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_id].mbms_SessionList[i]->list.count);
// }
} }
} }
else { // UE else { // UE
LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_id); LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_id);
for (i =0; i< pmch_InfoList->list.count; i++) { for (i =0; i< pmch_InfoList->list.count; i++) {
UE_mac_inst[Mod_id].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9; UE_mac_inst[Mod_id].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n", Mod_id, LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n", Mod_id, i,
UE_mac_inst[Mod_id].pmch_Config[i]->mch_SchedulingPeriod_r9); UE_mac_inst[Mod_id].pmch_Config[i]->mch_SchedulingPeriod_r9);
} }
UE_mac_inst[Mod_id].mcch_status = 1; UE_mac_inst[Mod_id].mcch_status = 1;
......
...@@ -86,8 +86,8 @@ ...@@ -86,8 +86,8 @@
#define MCCH 4 // MCCH #define MCCH 4 // MCCH
#define MTCH 1 // MTCH
#define MTCH 5 // MTCH
#ifdef Rel10 #ifdef Rel10
// Mask for identifying subframe for MBMS // Mask for identifying subframe for MBMS
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
#define MAX_PMCH_perMBSFN 15 #define MAX_PMCH_perMBSFN 15
#define MCCH_PAYLOAD_SIZE_MAX 128 #define MCCH_PAYLOAD_SIZE_MAX 128
#define MCH_PAYLOAD_SIZE_MAX 1024 //#define MCH_PAYLOAD_SIZE_MAX 16384// this value is using in case mcs and TBS index are high
#endif #endif
#ifdef USER_MODE #ifdef USER_MODE
......
...@@ -1091,6 +1091,12 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) { ...@@ -1091,6 +1091,12 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
int mcch_mcs; int mcch_mcs;
u16 TBS,j,padding=0,post_padding=0; u16 TBS,j,padding=0,post_padding=0;
mac_rlc_status_resp_t rlc_status; mac_rlc_status_resp_t rlc_status;
int num_mtch;
int msi_length,i;
unsigned char sdu_lcids[11], num_sdus=0, offset=0;
u16 sdu_lengths[11], sdu_length_total=0;
unsigned char mch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; // check the max value, this is for dlsch only
switch (eNB_mac_inst[Mod_id].mbsfn_AreaInfo[0]->mcch_Config_r9.signallingMCS_r9) { switch (eNB_mac_inst[Mod_id].mbsfn_AreaInfo[0]->mcch_Config_r9.signallingMCS_r9) {
case 0: case 0:
mcch_mcs = 2; mcch_mcs = 2;
...@@ -1259,22 +1265,17 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) { ...@@ -1259,22 +1265,17 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
} }
} }
// Calculate the mcs // Calculate the mcs
if ((msi_flag==1) || (mcch_flag==1)) { if ((msi_flag==1) || (mcch_flag==1)) {
eNB_mac_inst[Mod_id].MCH_pdu.mcs = mcch_mcs; eNB_mac_inst[Mod_id].MCH_pdu.mcs = mcch_mcs;
} }
else if (mtch_flag == 1) { // only MTCH in this subframe else if (mtch_flag == 1) { // only MTCH in this subframe
eNB_mac_inst[Mod_id].MCH_pdu.mcs = eNB_mac_inst[Mod_id].pmch_Config[0]->dataMCS_r9; eNB_mac_inst[Mod_id].MCH_pdu.mcs = eNB_mac_inst[Mod_id].pmch_Config[0]->dataMCS_r9;
} }
// 2nd: Create MSI, get MCCH from RRC and MTCHs from RLC // 2nd: Create MSI, get MCCH from RRC and MTCHs from RLC
int num_mtch;
int msi_length,i;
unsigned char sdu_lcids[11], num_sdus=0, offset;
u16 sdu_lengths[11], sdu_length_total=0;
unsigned char mch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; // check the max value, this is for dlsch only
// there is MSI (MCH Scheduling Info) // there is MSI (MCH Scheduling Info)
if (msi_flag == 1) { if (msi_flag == 1) {
// Create MSI here // Create MSI here
...@@ -1292,7 +1293,7 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) { ...@@ -1292,7 +1293,7 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
} }
msi_ptr+= sizeof(MSI_ELEMENT); msi_ptr+= sizeof(MSI_ELEMENT);
//MTCHs //Header for MTCHs
num_mtch = eNB_mac_inst[Mod_id].mbms_SessionList[0]->list.count; num_mtch = eNB_mac_inst[Mod_id].mbms_SessionList[0]->list.count;
for (i=0;i<num_mtch;i++) { // loop for all session in this MCH (MCH[0]) at this moment for (i=0;i<num_mtch;i++) { // loop for all session in this MCH (MCH[0]) at this moment
((MSI_ELEMENT *) msi_ptr)->lcid = eNB_mac_inst[Mod_id].mbms_SessionList[0]->list.array[i]->logicalChannelIdentity_r9;//mtch_lcid; ((MSI_ELEMENT *) msi_ptr)->lcid = eNB_mac_inst[Mod_id].mbms_SessionList[0]->list.array[i]->logicalChannelIdentity_r9;//mtch_lcid;
...@@ -1306,7 +1307,9 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) { ...@@ -1306,7 +1307,9 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
else else
header_len_msi = 3; header_len_msi = 3;
LOG_D(MAC,"Scheduler: MSI is transmitted in this subframe \n" ); LOG_D(MAC,"[eNB %d] Frame %d : MSI->MCH, length of MSI is %d bytes \n",Mod_id,frame,msi_length);
//LOG_D(MAC,"Scheduler: MSI is transmitted in this subframe \n" );
// LOG_D(MAC,"Scheduler: MSI length is %d bytes\n",msi_length); // LOG_D(MAC,"Scheduler: MSI length is %d bytes\n",msi_length);
// Store MSI data to mch_buffer[0] // Store MSI data to mch_buffer[0]
memcpy((char *)&mch_buffer[sdu_length_total], memcpy((char *)&mch_buffer[sdu_length_total],
...@@ -1363,48 +1366,61 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) { ...@@ -1363,48 +1366,61 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
} }
eNB_mac_inst[Mod_id].mcch_active=0; eNB_mac_inst[Mod_id].mcch_active=0;
} }
// there is MTCHs, loop if there are more than 1 // there is MTCHs, loop if there are more than 1
if (mtch_flag == 1) { if (mtch_flag == 1) {
// Calculate TBS
// Calculate TBS /* if ((msi_flag==1) || (mcch_flag==1)) {
TBS = mac_xface->get_TBS(mcch_mcs, mac_xface->lte_frame_parms->N_RB_DL);
}
else { // only MTCH in this subframe
TBS = mac_xface->get_TBS(eNB_mac_inst[Mod_id].pmch_Config[0]->dataMCS_r9, mac_xface->lte_frame_parms->N_RB_DL);
}
*/
TBS = mac_xface->get_TBS_DL(eNB_mac_inst[Mod_id].MCH_pdu.mcs, mac_xface->lte_frame_parms->N_RB_DL); TBS = mac_xface->get_TBS_DL(eNB_mac_inst[Mod_id].MCH_pdu.mcs, mac_xface->lte_frame_parms->N_RB_DL);
// get MTCH data from RLC (like for DTCH)
LOG_D(MAC,"[eNB %d] Frame %d : MTCH data is transmitted on this subframe\n",Mod_id,frame);
/* header_len_mtch = 3;
LOG_D(MAC,"[eNB %d], Frame %d, MTCH->MCH, Checking RLC status (rab %d, tbs %d, len %d)\n",
Mod_id,frame,MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)),TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(Mod_id,frame,1,MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), // get MTCH data from RLC (like for DTCH)
LOG_D(MAC,"[eNB %d] Frame %d : MTCH data is transmitted on subframe %d\n",Mod_id,frame,subframe);
header_len_mtch = 3;
LOG_D(MAC,"[eNB %d], Frame %d, MTCH->MCH, Checking RLC status (rab %d, tbs %d, len %d)\n",
Mod_id,frame,MTCH,TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch); TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
if (rlc_status.bytes_in_buffer >0) { rlc_status = mac_rlc_status_ind(Mod_id,frame,1,RLC_MBMS_YES,MTCH+ (maxDRB + 3) * MAX_MOBILES_PER_RG,
// LOG_I(MAC,"[eNB %d][MBMS USER-PLANE], Frame %d, MTCH->MCH, Requesting %d bytes from RLC (header len mtch %d)\n", TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
// Mod_id,frame,TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch,header_len_mtch); printf("frame %d, subframe %d, rlc_status.bytes_in_buffer is %d\n",frame,subframe, rlc_status.bytes_in_buffer);
sdu_lengths[num_sdus] = mac_rlc_data_req(Mod_id,frame, RLC_MBMS_NO if (rlc_status.bytes_in_buffer >0) {
MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), LOG_I(MAC,"[eNB %d][MBMS USER-PLANE], Frame %d, MTCH->MCH, Requesting %d bytes from RLC (header len mtch %d)\n",
(char*)&mch_buffer[sdu_length_total]); Mod_id,frame,TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch,header_len_mtch);
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] Got %d bytes for MTCH %d\n",Mod_id,sdu_lengths[num_sdus],MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)));
sdu_lcids[num_sdus] = MTCH; sdu_lengths[num_sdus] = mac_rlc_data_req(Mod_id,frame, RLC_MBMS_YES,
sdu_length_total += sdu_lengths[num_sdus]; MTCH + (maxDRB + 3) * MAX_MOBILES_PER_RG,
if (sdu_lengths[num_sdus] < 128) (char*)&mch_buffer[sdu_length_total]);
header_len_mtch = 2; //sdu_lengths[num_sdus] = mac_rlc_data_req(Mod_id,frame, RLC_MBMS_NO, MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]);
num_sdus++; LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] Got %d bytes for MTCH %d\n",Mod_id,sdu_lengths[num_sdus],MTCH);
} sdu_lcids[num_sdus] = MTCH;
else { sdu_length_total += sdu_lengths[num_sdus];
header_len_mtch = 0; if (sdu_lengths[num_sdus] < 128)
} header_len_mtch = 2;
*/ num_sdus++;
}
else {
header_len_mtch = 0;
}
} }
// FINAL STEP: Prepare and multiplexe MSI, MCCH and MTCHs // FINAL STEP: Prepare and multiplexe MSI, MCCH and MTCHs
if ((sdu_length_total + header_len_msi + header_len_mcch + header_len_mtch) >0) { if ((sdu_length_total + header_len_msi + header_len_mcch + header_len_mtch) >0) {
// Adjust the last subheader // Adjust the last subheader
/* if ((msi_flag==1) || (mcch_flag==1)) {
eNB_mac_inst[Mod_id].MCH_pdu.mcs = mcch_mcs;
}
else if (mtch_flag == 1) { // only MTCH in this subframe
eNB_mac_inst[Mod_id].MCH_pdu.mcs = eNB_mac_inst[Mod_id].pmch_Config[0]->dataMCS_r9;
}
*/
header_len_mtch_temp = header_len_mtch; header_len_mtch_temp = header_len_mtch;
header_len_mcch_temp = header_len_mcch; header_len_mcch_temp = header_len_mcch;
header_len_msi_temp = header_len_msi; header_len_msi_temp = header_len_msi;
...@@ -1439,7 +1455,7 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) { ...@@ -1439,7 +1455,7 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
padding, padding,
post_padding); post_padding);
LOG_D(MAC,"[DUY] MCS for this sf is %d\n", eNB_mac_inst[Mod_id].MCH_pdu.mcs); LOG_D(MAC," MCS for this sf is %d\n", eNB_mac_inst[Mod_id].MCH_pdu.mcs);
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE ] Generate header : sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,padding %d,post_padding %d (mcs %d, TBS %d), header MTCH %d, header MCCH %d, header MSI %d\n", LOG_I(MAC,"[eNB %d][MBMS USER-PLANE ] Generate header : sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,padding %d,post_padding %d (mcs %d, TBS %d), header MTCH %d, header MCCH %d, header MSI %d\n",
Mod_id,sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset,padding,post_padding,eNB_mac_inst[Mod_id].MCH_pdu.mcs,TBS,header_len_mtch, header_len_mcch, header_len_msi); Mod_id,sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset,padding,post_padding,eNB_mac_inst[Mod_id].MCH_pdu.mcs,TBS,header_len_mtch, header_len_mcch, header_len_msi);
...@@ -1448,14 +1464,21 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) { ...@@ -1448,14 +1464,21 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
// filling remainder of MCH with random data if necessery // filling remainder of MCH with random data if necessery
for (j=0;j<(TBS-sdu_length_total-offset);j++) for (j=0;j<(TBS-sdu_length_total-offset);j++)
eNB_mac_inst[Mod_id].MCH_pdu.payload[offset+sdu_length_total+j] = (char)(taus()&0xff); eNB_mac_inst[Mod_id].MCH_pdu.payload[offset+sdu_length_total+j] = (char)(taus()&0xff);
/*
for (j=0;j<sdu_length_total;j++)
printf("%2x.",eNB_mac_inst[Mod_id].MCH_pdu.payload[j+offset]);
printf(" \n");*/
return 1; return 1;
} }
else else {
// for testing purpose, fill with random data
//for (j=0;j<(TBS-sdu_length_total-offset);j++)
// eNB_mac_inst[Mod_id].MCH_pdu.payload[offset+sdu_length_total+j] = (char)(taus()&0xff);
return 0; return 0;
}
//this is for testing //this is for testing
/* if (mtch_flag == 1) { /*
if (mtch_flag == 1) {
// LOG_D(MAC,"DUY: mch_buffer length so far is : %ld\n", &mch_buffer[sdu_length_total]-&mch_buffer[0]); // LOG_D(MAC,"DUY: mch_buffer length so far is : %ld\n", &mch_buffer[sdu_length_total]-&mch_buffer[0]);
return 1; return 1;
} }
...@@ -1466,12 +1489,12 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) { ...@@ -1466,12 +1489,12 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
MCH_PDU *get_mch_sdu(uint8_t Mod_id,uint32_t frame, uint32_t subframe) { MCH_PDU *get_mch_sdu(uint8_t Mod_id,uint32_t frame, uint32_t subframe) {
// eNB_mac_inst[Mod_id].MCH_pdu.mcs=0; // eNB_mac_inst[Mod_id].MCH_pdu.mcs=0;
LOG_D(MAC,"[DUY] MCH_pdu.mcs is %d\n", eNB_mac_inst[Mod_id].MCH_pdu.mcs); LOG_D(MAC," MCH_pdu.mcs is %d\n", eNB_mac_inst[Mod_id].MCH_pdu.mcs);
return(&eNB_mac_inst[Mod_id].MCH_pdu); return(&eNB_mac_inst[Mod_id].MCH_pdu);
} }
#endif #endif
// First stage of Random-Access Scheduling // First stage of Random-Access Scheduling
void schedule_RA(unsigned char Mod_id,u32 frame, unsigned char subframe,unsigned char Msg3_subframe,unsigned char *nprb,unsigned int *nCCE) { void schedule_RA(unsigned char Mod_id,u32 frame, unsigned char subframe,unsigned char Msg3_subframe,unsigned char *nprb,unsigned int *nCCE) {
...@@ -4226,7 +4249,7 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf ...@@ -4226,7 +4249,7 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf
#endif #endif
#ifdef Rel10 #ifdef Rel10
if (eNB_mac_inst[Mod_id].MBMS_flag ==1) { if (eNB_mac_inst[Mod_id].MBMS_flag >0) {
mbsfn_status = schedule_MBMS(Mod_id,frame,subframe); mbsfn_status = schedule_MBMS(Mod_id,frame,subframe);
} }
......
...@@ -173,12 +173,12 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active){ ...@@ -173,12 +173,12 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active){
#ifdef PHY_EMUL #ifdef PHY_EMUL
Mac_rlc_xface->Is_cluster_head[Mod_id]=2;//0: MR, 1: CH, 2: not CH neither MR Mac_rlc_xface->Is_cluster_head[Mod_id]=2;//0: MR, 1: CH, 2: not CH neither MR
#endif #endif
#ifdef Rel10 /*#ifdef Rel10
int n; int n;
for (n=0;n<4096;n++) for (n=0;n<4096;n++)
eNB_mac_inst[Mod_id].MCH_pdu.payload[n] = taus(); eNB_mac_inst[Mod_id].MCH_pdu.payload[n] = taus();
// Mac_rlc_xface->Node_id[Mod_id]=NODE_ID[Mod_id]; // Mac_rlc_xface->Node_id[Mod_id]=NODE_ID[Mod_id];
#endif #endif*/
} }
// Mac_rlc_xface->frame=Mac_rlc_xface->frame; // Mac_rlc_xface->frame=Mac_rlc_xface->frame;
......
...@@ -485,7 +485,7 @@ void ue_send_mch_sdu(u8 Mod_id, u32 frame, u8 *sdu, u16 sdu_len, u8 eNB_index) { ...@@ -485,7 +485,7 @@ void ue_send_mch_sdu(u8 Mod_id, u32 frame, u8 *sdu, u16 sdu_len, u8 eNB_index) {
for (i=0; i<num_sdu; i++) { for (i=0; i<num_sdu; i++) {
if (rx_lcids[i] == MCH_SCHDL_INFO) { if (rx_lcids[i] == MCH_SCHDL_INFO) {
if (UE_mac_inst[Mod_id].mcch_status==1) { if (UE_mac_inst[Mod_id].mcch_status==1) {
LOG_D(MAC,"[UE %d] Frame %d : MCH -> MSI (eNB %d, %d bytes)\n",Mod_id,frame, eNB_index, rx_lengths[i]); LOG_I(MAC,"[UE %d] Frame %d : MCH -> MSI (eNB %d, %d bytes)\n",Mod_id,frame, eNB_index, rx_lengths[i]);
// ??store necessary scheduling info to ue_mac_inst in order to // ??store necessary scheduling info to ue_mac_inst in order to
// calculate exact position of interested service (for the complex case has >1 mtch) // calculate exact position of interested service (for the complex case has >1 mtch)
// set msi_status to 1 // set msi_status to 1
...@@ -501,8 +501,18 @@ void ue_send_mch_sdu(u8 Mod_id, u32 frame, u8 *sdu, u16 sdu_len, u8 eNB_index) { ...@@ -501,8 +501,18 @@ void ue_send_mch_sdu(u8 Mod_id, u32 frame, u8 *sdu, u16 sdu_len, u8 eNB_index) {
} }
else if (rx_lcids[i] == MTCH) { else if (rx_lcids[i] == MTCH) {
if (UE_mac_inst[Mod_id].msi_status==1) { if (UE_mac_inst[Mod_id].msi_status==1) {
// LOG_I(MAC,"[UE %d] Frame %d : MCH -> MTCH (eNB %d, %d bytes)\n",Mod_id,frame, eNB_index, rx_lengths[i]); LOG_I(MAC,"[UE %d] Frame %d : MCH -> MTCH (eNB %d, %d bytes)\n",Mod_id,frame, eNB_index, rx_lengths[i]);
// mac_rlc_data_ind(); check for this function
mac_rlc_data_ind(Mod_id+NB_eNB_INST, // because rlc[module_idP] (to differential between eNB and UE)
frame,
0,
RLC_MBMS_YES,
MTCH + (maxDRB + 3),
(char *)payload_ptr,
rx_lengths[i],
1,
NULL);
} }
} }
payload_ptr += rx_lengths[i]; payload_ptr += rx_lengths[i];
...@@ -528,13 +538,13 @@ int ue_query_mch(uint8_t Mod_id, uint32_t frame, uint32_t subframe) { ...@@ -528,13 +538,13 @@ int ue_query_mch(uint8_t Mod_id, uint32_t frame, uint32_t subframe) {
if (UE_mac_inst[Mod_id].mbsfn_SubframeConfig[0]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame){// one-frame format if (UE_mac_inst[Mod_id].mbsfn_SubframeConfig[0]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame){// one-frame format
if (UE_mac_inst[Mod_id].pmch_Config[0]) { if (UE_mac_inst[Mod_id].pmch_Config[0]) {
// Find the first subframe in this MCH to transmit MSI // Find the first subframe in this MCH to transmit MSI
if (frame % mch_scheduling_period == UE_mac_inst[Mod_id].mbsfn_SubframeConfig[0]->radioframeAllocationOffset ) { if (frame % mch_scheduling_period == UE_mac_inst[Mod_id].mbsfn_SubframeConfig[0]->radioframeAllocationOffset ) {
while (ii == 0) { while (ii == 0) {
ii = UE_mac_inst[Mod_id].mbsfn_SubframeConfig[0]->subframeAllocation.choice.oneFrame.buf[0] & (0x80>>msi_pos); ii = UE_mac_inst[Mod_id].mbsfn_SubframeConfig[0]->subframeAllocation.choice.oneFrame.buf[0] & (0x80>>msi_pos);
msi_pos++; msi_pos++;
}
} }
}
} }
// Check if the subframe is for MSI, MCCH or MTCHs and Set the correspoding flag to 1 // Check if the subframe is for MSI, MCCH or MTCHs and Set the correspoding flag to 1
......
...@@ -94,7 +94,7 @@ BOOL pdcp_data_req(module_id_t module_id, u32_t frame, u8_t eNB_flag, rb_id_t rb ...@@ -94,7 +94,7 @@ BOOL pdcp_data_req(module_id_t module_id, u32_t frame, u8_t eNB_flag, rb_id_t rb
mem_block_t* pdcp_pdu = NULL; mem_block_t* pdcp_pdu = NULL;
rlc_op_status_t rlc_status; rlc_op_status_t rlc_status;
if (pdcp->instanciated_instance == 0) { if ((pdcp->instanciated_instance == 0) && (mode != PDCP_TM)) {
LOG_W(PDCP, "Instance is not configured, Ignoring SDU...\n"); LOG_W(PDCP, "Instance is not configured, Ignoring SDU...\n");
return FALSE; return FALSE;
} }
...@@ -119,7 +119,7 @@ BOOL pdcp_data_req(module_id_t module_id, u32_t frame, u8_t eNB_flag, rb_id_t rb ...@@ -119,7 +119,7 @@ BOOL pdcp_data_req(module_id_t module_id, u32_t frame, u8_t eNB_flag, rb_id_t rb
LOG_D(PDCP, " [TM] Asking for a new mem_block of size %d\n",sdu_buffer_size); LOG_D(PDCP, " [TM] Asking for a new mem_block of size %d\n",sdu_buffer_size);
pdcp_pdu = get_free_mem_block(sdu_buffer_size); pdcp_pdu = get_free_mem_block(sdu_buffer_size);
if (pdcp_pdu != NULL) { if (pdcp_pdu != NULL) {
memcpy(&pdcp_pdu->data, sdu_buffer, sdu_buffer_size); memcpy(&pdcp_pdu->data[0], sdu_buffer, sdu_buffer_size);
rlc_status = rlc_data_req(module_id, frame, eNB_flag, RLC_MBMS_YES, rb_id, muiP, confirmP, sdu_buffer_size, pdcp_pdu); rlc_status = rlc_data_req(module_id, frame, eNB_flag, RLC_MBMS_YES, rb_id, muiP, confirmP, sdu_buffer_size, pdcp_pdu);
} else } else
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES; rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
......
...@@ -638,12 +638,12 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index ...@@ -638,12 +638,12 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
int pkt_size=0, pkt_cnt=0; int pkt_size=0, pkt_cnt=0;
u8 pdcp_mode; u8 pdcp_mode;
Packet_otg_elt * otg_pkt_info; Packet_otg_elt * otg_pkt_info;
// we need to add conditions to avoid transmitting data when the UE is not RRC connected. // we need to add conditions to avoid transmitting data when the UE is not RRC connected.
#if defined(USER_MODE) && defined(OAI_EMU) #if defined(USER_MODE) && defined(OAI_EMU)
if (oai_emulation.info.otg_enabled ==1 ){ if (oai_emulation.info.otg_enabled ==1 ){
module_id = (eNB_flag == 1) ? eNB_index : NB_eNB_INST + UE_index ; module_id = (eNB_flag == 1) ? eNB_index : NB_eNB_INST + UE_index ;
//rb_id = (eNB_flag == 1) ? eNB_index * MAX_NUM_RB + DTCH : (NB_eNB_INST + UE_index -1 ) * MAX_NUM_RB + DTCH ; //rb_id = (eNB_flag == 1) ? eNB_index * MAX_NUM_RB + DTCH : (NB_eNB_INST + UE_index -1 ) * MAX_NUM_RB + DTCH ;
if (eNB_flag == 1) { // search for DL traffic if (eNB_flag == 1) { // search for DL traffic
//for (dst_id = NB_eNB_INST; dst_id < NB_UE_INST + NB_eNB_INST; dst_id++) { //for (dst_id = NB_eNB_INST; dst_id < NB_UE_INST + NB_eNB_INST; dst_id++) {
while ((otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[module_id]))) != NULL) { while ((otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[module_id]))) != NULL) {
...@@ -653,6 +653,8 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index ...@@ -653,6 +653,8 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
module_id = (otg_pkt_info->otg_pkt).module_id; module_id = (otg_pkt_info->otg_pkt).module_id;
rb_id = (otg_pkt_info->otg_pkt).rb_id; rb_id = (otg_pkt_info->otg_pkt).rb_id;
pdcp_mode = (otg_pkt_info->otg_pkt).mode; pdcp_mode = (otg_pkt_info->otg_pkt).mode;
// LOG_I(PDCP,"pdcp_fifo, pdcp mode is= %d\n",pdcp_mode);
// generate traffic if the ue is rrc reconfigured state // generate traffic if the ue is rrc reconfigured state