LOG_D(NR_MAC,"In %s:[%d.%d]: number of UL PDUs: %d with UL transmission in [%d.%d]\n",__FUNCTION__,frame_tx,slot_tx,ul_config->number_pdus,ul_config->sfn,ul_config->slot);
LOG_D(NR_MAC,"In %s:[%d.%d]: number of UL PDUs: %d with UL transmission in [%d.%d]\n",__FUNCTION__,frame_tx,slot_tx,ul_config->number_pdus,ul_config->sfn,ul_config->slot);
// - UL-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;
// F: length of L is 0:8 or 1:16 bits wide
// R: Reserved bit, set to zero.
voidnr_process_mac_pdu(module_id_tmodule_idP,
voidnr_process_mac_pdu(module_id_tmodule_idP,
intUE_id,
intUE_id,
uint8_tCC_id,
uint8_tCC_id,
frame_tframeP,
frame_tframeP,
sub_frame_tslot,
sub_frame_tslot,
uint8_t*pduP,
uint8_t*pduP,
uint16_tmac_pdu_len)
intpdu_len)
{
{
// This function is adapting code from the old
uint8_trx_lcid;
// parse_header(...) and ue_send_sdu(...) functions of OAI LTE
LOG_I(NR_MAC,"In %s: dumping MAC PDU in %d.%d:\n",__func__,frameP,slot);
// - UL/DL-SCH: fixed-size MAC CE(known by LCID)
log_dump(NR_MAC,pduP,pdu_len,LOG_DUMP_CHAR,"\n");
// - UL/DL-SCH: padding
#endif
// - UL-SCH: MSG3 48-bits
// |0|1|2|3|4|5|6|7| bit-wise
// |R|F| LCID |
// | L |
// |0|1|2|3|4|5|6|7| bit-wise
// |R|F| LCID |
// | L |
// | L |
// For both DL/UL-SCH
// For:
// - UL/DL-SCH: fixed-size MAC CE(known by LCID)
// - 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;
// F: lenght of L is 0:8 or 1:16 bits wide
// R: Reserved bit, set to zero.
while(!done&&pdu_len>0){
while(!done&&pdu_len>0){
mac_ce_len=0;
mac_ce_len=0;
mac_subheader_len=1;// default to fixed-length subheader = 1-oct
mac_subheader_len=sizeof(NR_MAC_SUBHEADER_FIXED);
mac_sdu_len=0;
mac_sdu_len=0;
rx_lcid=((NR_MAC_SUBHEADER_FIXED*)pdu_ptr)->LCID;
rx_lcid=((NR_MAC_SUBHEADER_FIXED*)pduP)->LCID;
LOG_D(NR_MAC,"LCID received at gNB side: %d \n",rx_lcid);
LOG_D(NR_MAC,"In %s: received UL-SCH sub-PDU with LCID 0x%x in %d.%d (remaining PDU length %d)\n",__func__,rx_lcid,frameP,slot,pdu_len);