Commit 35ba974c authored by Javier Morgade's avatar Javier Morgade

MBMS Scheduler code cleanup

	MCH channel level calculation reformulated according to DLSCH

	ACKNOWLEDGEMENT:
 	1. This commit was developed at Vicomtech (https://www.vicomtech.org) under UE project CDN-X-ALL: "CDN edge-cloud computing for efficient cache and reliable streaming aCROSS Aggregated unicast-multicast LinkS"
 	2. Project funded by Fed4FIRE+ OC5 (https://www.fed4fire.eu)
Signed-off-by: default avatarJavier Morgade <javier.morgade@ieee.org>
parent 5c306f25
......@@ -265,16 +265,16 @@ void mch_channel_level(int **dl_ch_estimates_ext,
for (i=0; i<(nre>>2); i++) {
#if defined(__x86_64__) || defined(__i386__)
avg128 = _mm_add_epi32(avg128,_mm_madd_epi16(dl_ch128[0],dl_ch128[0]));
avg128 = _mm_add_epi32(avg128,_mm_srai_epi32(_mm_madd_epi16(dl_ch128[0],dl_ch128[0]),log2_approx(nre>>2)-1));
#elif defined(__arm__)
#endif
}
avg[aarx] = (((int*)&avg128)[0] +
avg[aarx] = (((((int*)&avg128)[0] +
((int*)&avg128)[1] +
((int*)&avg128)[2] +
((int*)&avg128)[3])/nre;
((int*)&avg128)[3])/(nre>>factor2(nre)))*(1<<(log2_approx(nre>>2)-1-factor2(nre))));
// printf("Channel level : %d\n",avg[(aatx<<1)+aarx]);
}
......
......@@ -166,7 +166,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
{
if ((eNB->prach_energy_counter == 100) &&
(max_preamble_energy[0] > eNB->measurements.prach_I0+eNB->prach_DTX_threshold)) {
LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
eNB->Mod_id,
eNB->CC_id,
frame,
......
......@@ -82,14 +82,12 @@ get_mbsfn_sf_alloction(module_id_t module_idP, uint8_t CC_id,
}
}
uint32_t bytes_in_buffer=0;
uint8_t msi_active=0;
uint8_t msi_pmch_stop=0;
uint8_t msi_pmch_stop2=0;
static uint32_t bytes_in_buffer=0;
static uint8_t msi_pmch_stop=0;
//static uint8_t msi_active=0;
//static uint8_t msi_pmch_stop2=0;
uint16_t mbms_rab_id = 2047;
uint8_t msi_sfs=0;
static uint8_t msi_sfs=0;
//MSI_ELEMENT * ptr =NULL;
......@@ -534,60 +532,30 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
//l=0;
for (k = 0; k < num_mtch; k++) { // loop for all session in this MCH (MCH[0]) at this moment
((MSI_ELEMENT *) msi_ptr)->lcid = cc->mbms_SessionList[0]->list.array[k]->logicalChannelIdentity_r9; //mtch_lcid;
((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB = 0; // last subframeP of this mtch (only one mtch now)
((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = 0xB;
//((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = 0x2; //100
((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB = 0x7; // last subframeP of this mtch (only one mtch now)
//((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = 0xB;
((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = 0xFF; //100
((MSI_ELEMENT *) msi_ptr)->lcid = cc->mbms_SessionList[0]->list.array[k]->logicalChannelIdentity_r9; //mtch_lcid;
// ((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB = 0x0; // last subframeP of this mtch (only one mtch now)
// ((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = 0x2; //100
//while((++l)*TBS<=bytes_in_buffer && l<=cc->pmch_Config[0]->sf_AllocEnd_r9){
// if(l>=6 && l<=cc->pmch_Config[0]->sf_AllocEnd_r9){
// ((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB = 0; //we limite till 256 TOFIX
// ((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = l;
// }
//}
//ptr = (MSI_ELEMENT *) msi_ptr;
if( msi_sfs != 0 )
msi_pmch_stop = msi_sfs-1;
else
msi_pmch_stop = msi_sfs;
//msi_pmch_stop = bytes_in_buffer/TBS;
//if(bytes_in_buffer%TBS)
//msi_pmch_stop++;
//
//msi_pmch_stop = 20;
if( msi_pmch_stop > cc->pmch_Config[0]->sf_AllocEnd_r9)
LOG_W(MAC,"e-MBMS Buffer Overflow\n");
if(msi_pmch_stop>=num_sf_alloc /*&& msi_pmch_stop <=cc->pmch_Config[0]->sf_AllocEnd_r9*/) {
((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB = 0; // last subframeP of this mtch (only one mtch now)
((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB = 0; // last subframeP of this mtch (only one mtch now) & stop_sf limited to 256
//((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = msi_pmch_stop;
((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = (msi_pmch_stop <=cc->pmch_Config[0]->sf_AllocEnd_r9 ? msi_pmch_stop: cc->pmch_Config[0]->sf_AllocEnd_r9);
msi_pmch_stop = (msi_pmch_stop <=cc->pmch_Config[0]->sf_AllocEnd_r9 ? msi_pmch_stop: cc->pmch_Config[0]->sf_AllocEnd_r9);
}else{
((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB = 0x7; // last subframeP of this mtch (only one mtch now)
((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = 0xFF; //100
((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = 0xFF;
msi_pmch_stop=0;
}
// do{
// if(l>=0 && l<=cc->pmch_Config[0]->sf_AllocEnd_r9){
// ((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB = 0; //we limite till 256 TOFIX
// ((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = l;
// }
// }while((l++)*TBS<=bytes_in_buffer);
//
// if(((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB !=0x7 && ((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB != 0xFF )
// msi_active=1;
// else
// msi_active=1;
//((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = l;
// l++;
// }
msi_ptr += sizeof(MSI_ELEMENT);
}
......
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