pthread_cond_wait(&proc->cond_RUs,&proc->mutex_RUs_tx);// this unlocks mutex_rxtx while waiting and then locks it again
clock_gettime(CLOCK_REALTIME,&now);
abstime.tv_sec=now.tv_sec;
abstime.tv_nsec=now.tv_nsec+time_ns;
if(abstime.tv_nsec>=1000*1000*1000){
abstime.tv_nsec-=1000*1000*1000;
abstime.tv_sec+=1;
}
if((waitret=pthread_cond_timedwait(&proc->cond_RUs,&proc->mutex_RUs_tx,&abstime))==0)break;// this unlocks mutex_rxtx while waiting and then locks it again
elseif(ue->dmrs_DownlinkConfig.pdsch_dmrs_AdditionalPosition==pdsch_dmrs_pos1||ue->dmrs_DownlinkConfig.pdsch_dmrs_AdditionalPosition==2)// TODO set to pdsch_dmrs_pos2 when available
N_1=pdsch_N_1_capability_1[numerology][2];
else
N_1=pdsch_N_1_capability_1[numerology][3];
/* PUSCH preapration time N_2 for processing capability 1 */
LOG_D(PHY,"Frame %d slot %d -- Starting UL time alignment procedures. TA update will be applied at frame %d slot %d\n",frame_rx,nr_tti_rx,ul_time_alignment->ta_frame,ul_time_alignment->ta_slot);
// - UL/DL-SCH: padding, for single/multiple 1-oct padding CE(s)
// - UL-SCH: MSG3 48-bits
// |0|1|2|3|4|5|6|7| bit-wise
// |R|R| LCID |
// LCID: The Logical Channel ID field identifies the logical channel instance of the corresponding MAC SDU or the type of the corresponding MAC CE or padding as described in Tables 6.2.1-1 and 6.2.1-2 for the DL-SCH and UL-SCH respectively. There is one LCID field per MAC subheader. The LCID field size is 6 bits;
// L: The Length field indicates the length of the corresponding MAC SDU or variable-sized MAC CE in bytes. There is one L field per MAC subheader except for subheaders corresponding to fixed-sized MAC CEs and padding. The size of the L field is indicated by the F field;
// L: The Length field indicates the length of the corresponding MAC SDU or variable-sized MAC CE in bytes. There is one L field per MAC subheader except for subheaders corresponding to fixed-sized MAC CEs and padding. The size of the L field is indicated by the F field;
// F: lenght of L is 0:8 or 1:16 bits wide
// R: Reserved bit, set to zero.
uint8_tdone=0;
while(!done||pdu_len<=0){
mac_ce_len=0x0000;
mac_subheader_len=0x0001;// default to fixed-length subheader = 1-oct
mac_sdu_len=0x0000;
switch(((NR_MAC_SUBHEADER_FIXED*)pdu_ptr)->LCID){
while(!done&&pdu_len>0){
mac_ce_len=0;
mac_subheader_len=1;// default to fixed-length subheader = 1-oct