Commit f44dd631 authored by francescomani's avatar francescomani

nr_process_mac_pdu formatting

parent 478ea7ab
...@@ -87,7 +87,7 @@ const int get_ul_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon ...@@ -87,7 +87,7 @@ const int get_ul_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon
// F: length of L is 0:8 or 1:16 bits wide // F: length of L is 0:8 or 1:16 bits wide
// R: Reserved bit, set to zero. // R: Reserved bit, set to zero.
int nr_process_mac_pdu( instance_t module_idP, int nr_process_mac_pdu(instance_t module_idP,
NR_UE_info_t* UE, NR_UE_info_t* UE,
uint8_t CC_id, uint8_t CC_id,
frame_t frameP, frame_t frameP,
...@@ -96,7 +96,6 @@ int nr_process_mac_pdu( instance_t module_idP, ...@@ -96,7 +96,6 @@ int nr_process_mac_pdu( instance_t module_idP,
int pdu_len) int pdu_len)
{ {
uint8_t done = 0; uint8_t done = 0;
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
...@@ -104,10 +103,10 @@ int nr_process_mac_pdu( instance_t module_idP, ...@@ -104,10 +103,10 @@ int nr_process_mac_pdu( instance_t module_idP,
if ( pduP[0] != UL_SCH_LCID_PADDING ) if ( pduP[0] != UL_SCH_LCID_PADDING )
trace_NRpdu(DIRECTION_UPLINK, pduP, pdu_len, WS_C_RNTI, UE->rnti, frameP, 0, 0, 0); trace_NRpdu(DIRECTION_UPLINK, pduP, pdu_len, WS_C_RNTI, UE->rnti, frameP, 0, 0, 0);
#ifdef ENABLE_MAC_PAYLOAD_DEBUG #ifdef ENABLE_MAC_PAYLOAD_DEBUG
LOG_I(NR_MAC, "In %s: dumping MAC PDU in %d.%d:\n", __func__, frameP, slot); LOG_I(NR_MAC, "In %s: dumping MAC PDU in %d.%d:\n", __func__, frameP, slot);
log_dump(NR_MAC, pduP, pdu_len, LOG_DUMP_CHAR, "\n"); log_dump(NR_MAC, pduP, pdu_len, LOG_DUMP_CHAR, "\n");
#endif #endif
while (!done && pdu_len > 0){ while (!done && pdu_len > 0){
uint16_t mac_len=0; uint16_t mac_len=0;
...@@ -121,7 +120,6 @@ int nr_process_mac_pdu( instance_t module_idP, ...@@ -121,7 +120,6 @@ int nr_process_mac_pdu( instance_t module_idP,
switch(rx_lcid){ switch(rx_lcid){
// MAC CE // MAC CE
/*#ifdef DEBUG_HEADER_PARSING /*#ifdef DEBUG_HEADER_PARSING
LOG_D(NR_MAC, "[UE] LCID %d, PDU length %d\n", ((NR_MAC_SUBHEADER_FIXED *)pduP)->LCID, pdu_len); LOG_D(NR_MAC, "[UE] LCID %d, PDU length %d\n", ((NR_MAC_SUBHEADER_FIXED *)pduP)->LCID, pdu_len);
#endif*/ #endif*/
...@@ -132,7 +130,6 @@ int nr_process_mac_pdu( instance_t module_idP, ...@@ -132,7 +130,6 @@ int nr_process_mac_pdu( instance_t module_idP,
case UL_SCH_LCID_CONFIGURED_GRANT_CONFIRMATION: case UL_SCH_LCID_CONFIGURED_GRANT_CONFIRMATION:
// 38.321 Ch6.1.3.7 // 38.321 Ch6.1.3.7
break; break;
case UL_SCH_LCID_S_BSR: case UL_SCH_LCID_S_BSR:
case UL_SCH_LCID_S_TRUNCATED_BSR: case UL_SCH_LCID_S_TRUNCATED_BSR:
//38.321 section 6.1.3.1 //38.321 section 6.1.3.1
...@@ -152,7 +149,6 @@ int nr_process_mac_pdu( instance_t module_idP, ...@@ -152,7 +149,6 @@ int nr_process_mac_pdu( instance_t module_idP,
NR_SHORT_BSR_TABLE[bsr_s->Buffer_size], NR_SHORT_BSR_TABLE[bsr_s->Buffer_size],
sched_ctrl->estimated_ul_buffer); sched_ctrl->estimated_ul_buffer);
break; break;
case UL_SCH_LCID_L_BSR: case UL_SCH_LCID_L_BSR:
case UL_SCH_LCID_L_TRUNCATED_BSR: case UL_SCH_LCID_L_TRUNCATED_BSR:
//38.321 section 6.1.3.1 //38.321 section 6.1.3.1
...@@ -180,8 +176,7 @@ int nr_process_mac_pdu( instance_t module_idP, ...@@ -180,8 +176,7 @@ int nr_process_mac_pdu( instance_t module_idP,
LOG_D(NR_MAC, "LONG BSR, %d/%d (n/n_Lcg), BS Index %d, BS value < %d", LOG_D(NR_MAC, "LONG BSR, %d/%d (n/n_Lcg), BS Index %d, BS value < %d",
n, n_Lcg, pduP[mac_subheader_len + 1 + n], n, n_Lcg, pduP[mac_subheader_len + 1 + n],
NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]]); NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]]);
sched_ctrl->estimated_ul_buffer += sched_ctrl->estimated_ul_buffer += NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]];
NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]];
LOG_D(NR_MAC, LOG_D(NR_MAC,
"LONG BSR at %4d.%2d, %d/%d (n/n_Lcg), BS Index %d, BS value < %d, total %d\n", "LONG BSR at %4d.%2d, %d/%d (n/n_Lcg), BS Index %d, BS value < %d, total %d\n",
frameP, frameP,
...@@ -339,7 +334,6 @@ int nr_process_mac_pdu( instance_t module_idP, ...@@ -339,7 +334,6 @@ int nr_process_mac_pdu( instance_t module_idP,
if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len)) if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len))
return 0; return 0;
LOG_D(NR_MAC, "[UE %04x] %d.%d : ULSCH -> UL-%s %d (gNB %ld, %d bytes)\n", LOG_D(NR_MAC, "[UE %04x] %d.%d : ULSCH -> UL-%s %d (gNB %ld, %d bytes)\n",
UE->rnti, UE->rnti,
frameP, frameP,
...@@ -375,7 +369,7 @@ int nr_process_mac_pdu( instance_t module_idP, ...@@ -375,7 +369,7 @@ int nr_process_mac_pdu( instance_t module_idP,
break; break;
} }
#ifdef ENABLE_MAC_PAYLOAD_DEBUG #ifdef ENABLE_MAC_PAYLOAD_DEBUG
if (rx_lcid < 45 || rx_lcid == 52 || rx_lcid == 63) { if (rx_lcid < 45 || rx_lcid == 52 || rx_lcid == 63) {
LOG_I(NR_MAC, "In %s: dumping UL MAC SDU sub-header with length %d (LCID = 0x%02x):\n", __func__, mac_subheader_len, rx_lcid); LOG_I(NR_MAC, "In %s: dumping UL MAC SDU sub-header with length %d (LCID = 0x%02x):\n", __func__, mac_subheader_len, rx_lcid);
log_dump(NR_MAC, pduP, mac_subheader_len, LOG_DUMP_CHAR, "\n"); log_dump(NR_MAC, pduP, mac_subheader_len, LOG_DUMP_CHAR, "\n");
...@@ -385,7 +379,7 @@ int nr_process_mac_pdu( instance_t module_idP, ...@@ -385,7 +379,7 @@ int nr_process_mac_pdu( instance_t module_idP,
LOG_I(NR_MAC, "In %s: dumping UL MAC CE with length %d (LCID = 0x%02x):\n", __func__, mac_len, rx_lcid); LOG_I(NR_MAC, "In %s: dumping UL MAC CE with length %d (LCID = 0x%02x):\n", __func__, mac_len, rx_lcid);
log_dump(NR_MAC, pduP + mac_subheader_len + mac_len, mac_len, LOG_DUMP_CHAR, "\n"); log_dump(NR_MAC, pduP + mac_subheader_len + mac_len, mac_len, LOG_DUMP_CHAR, "\n");
} }
#endif #endif
pduP += ( mac_subheader_len + mac_len ); pduP += ( mac_subheader_len + mac_len );
pdu_len -= ( mac_subheader_len + mac_len ); pdu_len -= ( mac_subheader_len + mac_len );
......
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