[GITLAB] - UPGRADE TO v12 on Wednesday the 18th of December at 11.30AM

Commit e46fb846 authored by nguyennd's avatar nguyennd

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 @@
extern inline unsigned int taus(void);
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)));
......
......@@ -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)) {
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);
dump_mch(phy_vars_ue,0,phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->G,(last_slot>>1));
#ifdef DEBUG_DLSCH
......
......@@ -9,7 +9,7 @@ OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_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
......
......@@ -37,7 +37,7 @@
*/
# define MAX_IP_PACKET_SIZE 1512
# else
# define MAX_IP_PACKET_SIZE 1500
# define MAX_IP_PACKET_SIZE 1500 // 3000
# endif
#endif
// 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,
mac_xface->phy_config_sib1_ue(Mod_id,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
}
if (radioResourceConfigCommon) {
if (radioResourceConfigCommon!=NULL) {
if (eNB_flag==1) {
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,
}
if (eNB_flag == 0) {
if (measObj!= NULL)
if (measObj!= NULL) {
if (measObj[0]!= NULL){
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);
......@@ -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);
}
}
}
......@@ -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) {
// 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) {
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++) {
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,
eNB_mac_inst[Mod_id].pmch_Config[i]->dataMCS_r9);
// 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;
LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_id].mbms_SessionList[i]->list.count);
// }
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);
}
}
else { // UE
LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_id);
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;
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].mcch_status = 1;
......
......@@ -86,8 +86,8 @@
#define MCCH 4 // MCCH
#define MTCH 1 // MTCH
#define MTCH 5 // MTCH
#ifdef Rel10
// Mask for identifying subframe for MBMS
......@@ -107,7 +107,7 @@
#define MAX_PMCH_perMBSFN 15
#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
#ifdef USER_MODE
......
......@@ -1091,6 +1091,12 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
int mcch_mcs;
u16 TBS,j,padding=0,post_padding=0;
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) {
case 0:
mcch_mcs = 2;
......@@ -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)) {
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;
}
// 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)
if (msi_flag == 1) {
// Create MSI here
......@@ -1292,7 +1293,7 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
}
msi_ptr+= sizeof(MSI_ELEMENT);
//MTCHs
//Header for MTCHs
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
((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) {
else
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);
// Store MSI data to mch_buffer[0]
memcpy((char *)&mch_buffer[sdu_length_total],
......@@ -1363,48 +1366,61 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
}
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) {
// 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);
// 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);
if (rlc_status.bytes_in_buffer >0) {
// LOG_I(MAC,"[eNB %d][MBMS USER-PLANE], Frame %d, MTCH->MCH, Requesting %d bytes from RLC (header len mtch %d)\n",
// Mod_id,frame,TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch,header_len_mtch);
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]);
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_length_total += sdu_lengths[num_sdus];
if (sdu_lengths[num_sdus] < 128)
header_len_mtch = 2;
num_sdus++;
}
else {
header_len_mtch = 0;
}
*/
rlc_status = mac_rlc_status_ind(Mod_id,frame,1,RLC_MBMS_YES,MTCH+ (maxDRB + 3) * MAX_MOBILES_PER_RG,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
printf("frame %d, subframe %d, rlc_status.bytes_in_buffer is %d\n",frame,subframe, rlc_status.bytes_in_buffer);
if (rlc_status.bytes_in_buffer >0) {
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE], Frame %d, MTCH->MCH, Requesting %d bytes from RLC (header len mtch %d)\n",
Mod_id,frame,TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch,header_len_mtch);
sdu_lengths[num_sdus] = mac_rlc_data_req(Mod_id,frame, RLC_MBMS_YES,
MTCH + (maxDRB + 3) * MAX_MOBILES_PER_RG,
(char*)&mch_buffer[sdu_length_total]);
//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]);
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;
sdu_length_total += sdu_lengths[num_sdus];
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
if ((sdu_length_total + header_len_msi + header_len_mcch + header_len_mtch) >0) {
// 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_mcch_temp = header_len_mcch;
header_len_msi_temp = header_len_msi;
......@@ -1439,7 +1455,7 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
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",
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) {
// filling remainder of MCH with random data if necessery
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);
/*
for (j=0;j<sdu_length_total;j++)
printf("%2x.",eNB_mac_inst[Mod_id].MCH_pdu.payload[j+offset]);
printf(" \n");*/
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;
}
//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]);
return 1;
}
......@@ -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) {
// 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);
}
#endif
// 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) {
......@@ -4226,7 +4249,7 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf
#endif
#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);
}
......
......@@ -173,12 +173,12 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active){
#ifdef PHY_EMUL
Mac_rlc_xface->Is_cluster_head[Mod_id]=2;//0: MR, 1: CH, 2: not CH neither MR
#endif
#ifdef Rel10
/*#ifdef Rel10
int n;
for (n=0;n<4096;n++)
eNB_mac_inst[Mod_id].MCH_pdu.payload[n] = taus();
// Mac_rlc_xface->Node_id[Mod_id]=NODE_ID[Mod_id];
#endif
#endif*/
}
// 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) {
for (i=0; i<num_sdu; i++) {
if (rx_lcids[i] == MCH_SCHDL_INFO) {
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
// calculate exact position of interested service (for the complex case has >1 mtch)
// 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) {
}
else if (rx_lcids[i] == MTCH) {
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]);
// mac_rlc_data_ind(); check for this function
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(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];
......@@ -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].pmch_Config[0]) {
// Find the first subframe in this MCH to transmit MSI
if (frame % mch_scheduling_period == UE_mac_inst[Mod_id].mbsfn_SubframeConfig[0]->radioframeAllocationOffset ) {
while (ii == 0) {
ii = UE_mac_inst[Mod_id].mbsfn_SubframeConfig[0]->subframeAllocation.choice.oneFrame.buf[0] & (0x80>>msi_pos);
msi_pos++;
}
// Find the first subframe in this MCH to transmit MSI
if (frame % mch_scheduling_period == UE_mac_inst[Mod_id].mbsfn_SubframeConfig[0]->radioframeAllocationOffset ) {
while (ii == 0) {
ii = UE_mac_inst[Mod_id].mbsfn_SubframeConfig[0]->subframeAllocation.choice.oneFrame.buf[0] & (0x80>>msi_pos);
msi_pos++;
}
}
}
// 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
mem_block_t* pdcp_pdu = NULL;
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");
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
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);
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);
} else
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
int pkt_size=0, pkt_cnt=0;
u8 pdcp_mode;
Packet_otg_elt * otg_pkt_info;
// we need to add conditions to avoid transmitting data when the UE is not RRC connected.
#if defined(USER_MODE) && defined(OAI_EMU)
if (oai_emulation.info.otg_enabled ==1 ){
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 ;
if (eNB_flag == 1) { // search for DL traffic
//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) {
......@@ -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;
rb_id = (otg_pkt_info->otg_pkt).rb_id;
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
// if (mac_get_rrc_status(module_id, eNB_flag, dst_id ) > 2 /*RRC_CONNECTED*/) { // not needed: this test is already done in update_otg_enb
otg_pkt = (u8*) (otg_pkt_info->otg_pkt).sdu_buffer;
......@@ -664,6 +666,7 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
free(otg_pkt);
}
// } //else LOG_D(OTG,"frame %d enb %d-> ue %d link not yet established state %d \n", frame, eNB_index,dst_id - NB_eNB_INST, mac_get_rrc_status(module_id, eNB_flag, dst_id - NB_eNB_INST));
}
}
else {
......@@ -678,7 +681,7 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
otg_pkt = (u8*) (otg_pkt_info->otg_pkt).sdu_buffer;
pkt_size = (otg_pkt_info->otg_pkt).sdu_buffer_size;
if (otg_pkt != NULL){
//rb_id= eNB_index * MAX_NUM_RB + DTCH;
//rb_id= eNB_index * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[UE %d] sending packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n", UE_index, src_id, rb_id, src_id, dst_id, pkt_size);
pdcp_data_req(src_id, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO,pkt_size, otg_pkt, PDCP_DATA_PDU);
free(otg_pkt);
......@@ -692,9 +695,9 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
unsigned int ctime=0;
src_id = eNB_index;
ctime = frame * 100;
/*if ((mac_get_rrc_status(eNB_index, eNB_flag, 0 ) > 2) &&
(mac_get_rrc_status(eNB_index, eNB_flag, 1 ) > 2)) { */
(mac_get_rrc_status(eNB_index, eNB_flag, 1 ) > 2)) { */
for (dst_id = 0; dst_id<NUMBER_OF_UE_MAX; dst_id++) {
if (mac_get_rrc_status(eNB_index, eNB_flag, dst_id ) > 2) {
otg_pkt=packet_gen(src_id, dst_id, ctime, &pkt_size);
......@@ -705,12 +708,12 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
free(otg_pkt);
}
/*else {
LOG_I(OTG,"nothing generated (src %d, dst %d)\n",src_id, dst_id);
}*/
LOG_I(OTG,"nothing generated (src %d, dst %d)\n",src_id, dst_id);
}*/
}
/*else {
LOG_I(OTG,"rrc_status (src %d, dst %d) = %d\n",src_id, dst_id, mac_get_rrc_status(src_id, eNB_flag, dst_id ));
}*/
LOG_I(OTG,"rrc_status (src %d, dst %d) = %d\n",src_id, dst_id, mac_get_rrc_status(src_id, eNB_flag, dst_id ));
}*/
}
}
#endif
......
......@@ -423,6 +423,7 @@ rlc_um_segment_5 (struct rlc_um_entity *rlcP,u32_t frame)
test_remaining_size_to_substract = 0;
test_remaining_num_li_to_substract = 0;
pdu_remaining_size = pdu_remaining_size - (test_li_length_in_bytes ^ 3);
data_pdu_size -= (test_li_length_in_bytes ^ 3);//modifier pour duy
} else if ((sdu_mngt->sdu_remaining_size + (test_li_length_in_bytes ^ 3)) < test_pdu_remaining_size ) {
test_num_li += 1;
num_fill_sdu += 1;
......@@ -439,6 +440,7 @@ rlc_um_segment_5 (struct rlc_um_entity *rlcP,u32_t frame)
test_remaining_size_to_substract = 0;
test_remaining_num_li_to_substract = 0;
pdu_remaining_size = pdu_remaining_size - 1;
data_pdu_size -= 1;//modifier pour duy
}
sdu_buffer_index = (sdu_buffer_index + 1) % rlcP->size_input_sdus_buffer;
}
......
......@@ -438,20 +438,18 @@ rlc_op_status_t rlc_data_req (module_id_t module_idP, u32_t frame, u8_t eNB_
} else {
mbms_rb_id = rb_idP + (maxDRB + 3);
}
// LOG_I(RLC,"DUY rlc_data_req: mbms_rb_id in RLC instant is: %d\n", mbms_rb_id);
if (sduP != NULL) {
if (sdu_sizeP > 0) {
LOG_I(RLC,"received a packet with size %d for MBMS \n", sdu_sizeP);
new_sdu = get_free_mem_block (sdu_sizeP + sizeof (struct rlc_um_data_req_alloc));
if (new_sdu != NULL) {
// PROCESS OF COMPRESSION HERE:
memset (new_sdu->data, 0, sizeof (struct rlc_um_data_req_alloc));
memcpy (&new_sdu->data[sizeof (struct rlc_um_data_req_alloc)], &sduP->data[0], sdu_sizeP);
((struct rlc_um_data_req *) (new_sdu->data))->data_size = sdu_sizeP;
((struct rlc_um_data_req *) (new_sdu->data))->data_offset = sizeof (struct rlc_um_data_req_alloc);
free_mem_block(sduP);
LOG_D(RLC, "%s\n",RLC_FG_BRIGHT_COLOR_RED);
if (rlc[module_idP].m_rlc_um_array[rlc[module_idP].m_rlc_pointer[mbms_rb_id].rlc_index].is_data_plane) {
LOG_D(RLC, "[MSC_MSG][FRAME %05d][PDCP][MOD %02d][RB %02d][--- RLC_UM_DATA_REQ/%d Bytes (MBMS) --->][RLC_UM][MOD %02d][RB %02d]\n",
......@@ -480,13 +478,13 @@ rlc_op_status_t rlc_data_req (module_id_t module_idP, u32_t frame, u8_t eNB_
return RLC_OP_STATUS_BAD_PARAMETER;
}
} else {
return RLC_OP_STATUS_BAD_PARAMETER;
return RLC_OP_STATUS_BAD_PARAMETER;
}
#endif
} else {
free_mem_block(sduP);
//handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : parameter module_id out of bounds :%d\n", __FILE__, __LINE__, module_idP);
return RLC_OP_STATUS_BAD_PARAMETER;
free_mem_block(sduP);
//handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : parameter module_id out of bounds :%d\n", __FILE__, __LINE__, module_idP);
return RLC_OP_STATUS_BAD_PARAMETER;
}
}
......
......@@ -40,7 +40,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t module_idP, u32_t frameP, u
rlc_mode_t rlc_type;
#ifdef Rel10
long int cnt2 = 0;
long int mrb_id = 0;
// long int mrb_id = 0;
long int mbms_service_id = 0;
long int mbms_session_id = 0;
PMCH_Info_r9_t* pmch_info_r9 = NULL;
......@@ -264,61 +264,66 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t module_idP, u32_t frameP, u
#ifdef Rel10
if (pmch_info_listP != NULL) {
for (cnt=0;cnt<pmch_info_listP->list.count;cnt++) {
pmch_info_r9 = pmch_info_listP->list.array[cnt];
for (cnt2=0;cnt2<pmch_info_r9->mbms_SessionInfoList_r9.list.count;cnt2++) {
mbms_session = pmch_info_r9->mbms_SessionInfoList_r9.list.array[cnt2];
if (mbms_session->logicalChannelIdentity_r9 > 0) {
//lc_id = (NUMBER_OF_UE_MAX*NB_RB_MAX) + mbms_session->logicalChannelIdentity_r9;
if (eNB_flagP) {
lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3) * MAX_MOBILES_PER_RG;
} else {
lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3);
}
if (mbms_session->sessionId_r9 != NULL) {
mbms_session_id = mbms_session->sessionId_r9->buf[0];
} else {
mbms_session_id = mbms_session->logicalChannelIdentity_r9;
}
mbms_service_id = mbms_session->tmgi_r9.serviceId_r9.buf[0];
rb_id = (mbms_service_id * maxSessionPerPMCH) + lc_id;
if (rlc[module_idP].m_rlc_pointer[rb_id].rlc_type == RLC_NONE) {
rlc_status = rrc_rlc_add_rlc (module_idP, frameP, rb_id, lc_id, RLC_UM);
if (rlc_status != RLC_OP_STATUS_OK ) {
LOG_D(RLC, "[RLC_RRC] COULD NOT ALLOCATE RLC UM INSTANCE\n");
continue;//? return rlc_status;
}
} else if (rlc[module_idP].m_rlc_pointer[rb_id].rlc_type != RLC_UM) {
LOG_E(RLC, "[RLC_RRC] MBMS ERROR IN CONFIG, RLC FOUND ALREADY CONFIGURED FOR MBMS BEARER IS NOT UM\n");
continue;
}
dl_um_rlc.sn_FieldLength = SN_FieldLength_size10;
dl_um_rlc.t_Reordering = T_Reordering_ms5;
if (pmch_info_listP != NULL) {
LOG_I(RRC,"[%s %d] Config RLC instant for MBMS\n", (eNB_flagP) ? "eNB" : "UE", module_idP);
for (cnt=0;cnt<pmch_info_listP->list.count;cnt++) {
pmch_info_r9 = pmch_info_listP->list.array[cnt];
for (cnt2=0;cnt2<pmch_info_r9->mbms_SessionInfoList_r9.list.count;cnt2++) {
mbms_session = pmch_info_r9->mbms_SessionInfoList_r9.list.array[cnt2];
if (mbms_session->logicalChannelIdentity_r9 > 0) {
// lc_id = (NUMBER_OF_UE_MAX*NB_RB_MAX) + mbms_session->logicalChannelIdentity_r9;
// test this one and tell Lionel
if (eNB_flagP) {
lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3) * MAX_MOBILES_PER_RG;
} else {
lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3);
}
config_req_rlc_um_asn1 (&rlc[module_idP].m_rlc_um_array[rlc[module_idP].m_rlc_pointer[rb_id].rlc_index],
frameP,
eNB_flagP,
RLC_MBMS_YES,
module_idP,
NULL,
&dl_um_rlc,
rb_id,
RADIO_ACCESS_BEARER);
} else {
LOG_D(RLC, "[RLC_RRC] Invalid LogicalChannelIdentity for MTCH --- Value 0 is reserved for MCCH\n");
lc_id = -1;
}
}
}
if (mbms_session->sessionId_r9 != NULL) {
mbms_session_id = mbms_session->sessionId_r9->buf[0];
} else {
mbms_session_id = mbms_session->logicalChannelIdentity_r9;
}
mbms_service_id = mbms_session->tmgi_r9.serviceId_r9.buf[2];// can use the pmch_index, here is the value 'cnt'
rb_id = (mbms_service_id * maxSessionPerPMCH) + lc_id;
if (rlc[module_idP].m_rlc_pointer[rb_id].rlc_type == RLC_NONE) {
rlc_status = rrc_rlc_add_rlc (module_idP, frameP, rb_id, lc_id, RLC_UM);
if (rlc_status != RLC_OP_STATUS_OK ) {
LOG_D(RLC, "[RLC_RRC] COULD NOT ALLOCATE RLC UM INSTANCE\n");
continue;//? return rlc_status;
}
} else if (rlc[module_idP].m_rlc_pointer[rb_id].rlc_type != RLC_UM) {
LOG_E(RLC, "[RLC_RRC] MBMS ERROR IN CONFIG, RLC FOUND ALREADY CONFIGURED FOR MBMS BEARER IS NOT UM\n");
continue;
}
dl_um_rlc.sn_FieldLength = SN_FieldLength_size5;
dl_um_rlc.t_Reordering = T_Reordering_ms0;
config_req_rlc_um_asn1 (&rlc[module_idP].m_rlc_um_array[rlc[module_idP].m_rlc_pointer[rb_id].rlc_index],
frameP,
eNB_flagP,
RLC_MBMS_YES,
module_idP,
NULL,
&dl_um_rlc,
rb_id,
RADIO_ACCESS_BEARER);
} else {
LOG_D(RLC, "[RLC_RRC] Invalid LogicalChannelIdentity for MTCH --- Value 0 is reserved for MCCH\n");
lc_id = -1;
}
}
}
}
#endif
LOG_D(RLC, "[RLC_RRC][MOD_id %d]CONFIG REQ ASN1 END \n",module_idP);
return RLC_OP_STATUS_OK;
}
......
......@@ -30,3 +30,4 @@ regen: regenerate-from-asn1-source
regenerate-from-asn1-source:
asn1c -gen-PER -fcompound-names -fnative-types -fskeletons-copy asn1c/ASN1_files/EUTRA-RRC-Definitions.asn
......@@ -29,7 +29,7 @@
#include "DRB-ToAddModList.h"
#ifdef Rel10
#include "MCCH-Message.h"
#define MRB1 1
//#define MRB1 1
#endif
#include "RRC/LITE/defs.h"
......@@ -596,7 +596,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
*sib3 = &sib3_part->choice.sib3;
#ifdef Rel10
if (MBMS_flag == 1) {
if (MBMS_flag > 0) {
sib13_part = CALLOC(1,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
memset(sib13_part,0,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
sib13_part->present = SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920;
......@@ -722,7 +722,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
// (*sib2)->mbsfn_SubframeConfigList = NULL;
#ifdef Rel10
if (MBMS_flag == 1) {
if (MBMS_flag > 0) {
LOG_I(RRC,"Adding MBSFN Configuration to SIB2\n");
MBSFN_SubframeConfig_t *sib2_mbsfn_SubframeConfig1;
(*sib2)->mbsfn_SubframeConfigList = CALLOC(1,sizeof(struct MBSFN_SubframeConfigList));
......@@ -738,10 +738,10 @@ uint8_t do_SIB23(uint8_t Mod_id,
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2;
if (frame_parms->frame_type == TDD) {// pattern 001110 for TDD
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x0e<<2;// shift 2 cuz 2last bits are unused.
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2 cuz 2last bits are unused.
}
else { // pattern 101010 for FDD)
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x2a<<2;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x30<<2;
}
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1);
}
......@@ -785,7 +785,7 @@ uint8_t do_SIB23(uint8_t Mod_id,