LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_idP,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup);
LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_idP,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup);
/*! \fn locate_BsrIndexByBufferSize (int *table, int size, int value)
/*! \fn locate_BsrIndexByBufferSize (int *table, int size, int value)
\brief locate the BSR level in the table as defined in 36.321. This function requires that he values in table to be monotonic, either increasing or decreasing. The returned value is not less than 0, nor greater than n-1, where n is the size of table.
\brief locate the BSR level in the table as defined in 36.321. This function requires that he values in table to be monotonic, either increasing or decreasing. The returned value is not less than 0, nor greater than n-1, where n is the size of table.
LOG_I(MAC,"[UE %d] MAC BSR Triggered PeriodicBSR Timer expiry at frame%d subframe %d TBS=%d\n",
LOG_I(MAC,"[UE %d] MAC BSR Triggered PeriodicBSR Timer expiry at frame%d subframe %d TBS=%d\n",
module_idP,frameP,subframe,buflen);
module_idP,frameP,subframe,buflen);
}
}
//Compute BSR Length
//Compute BSR Length if Regular or Periodic BSR is triggered
//WARNING: if BSR long is computed, it may be changed to BSR short during or after multiplexing if there remains less than 1 LCGROUP with data after Tx
if(UE_mac_inst[module_idP].BSR_reporting_active){
if(UE_mac_inst[module_idP].BSR_reporting_active){
if(buflen>=4){
if(num_lcg_id_with_data<=1){
// If there are no data to transmit Set LCGID short to the group of the first DTCH configured else it will be SRB
AssertFatal(UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[DCCH]>=sdu_lengths[0],"LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
AssertFatal(UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[DCCH1]>=sdu_lengths[num_sdus],"LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
AssertFatal(UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid]>=sdu_lengths[num_sdus],"LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
// Check BSR padding: it is done after PHR according to Logical Channel Prioritization order
/* For Padding BSR:
- if the number of padding bits is equal to or larger than the size of the Short BSR plus its subheader but smaller than the size of the Long BSR plus its subheader:
- if more than one LCG has data available for transmission in the TTI where the BSR is transmitted: report Truncated BSR of the LCG with the highest priority logical channel with data available for transmission;
- else report Short BSR.
- else if the number of padding bits is equal to or larger than the size of the Long BSR plus its subheader, report Long BSR.