Commit 5da8195d authored by Luis Pereira's avatar Luis Pereira

Revert "Improved fix gNB downlink MAC short/long header accordingly with RLC buffer size"

This reverts commit 88d7ad11
parent 88d7ad11
...@@ -1101,22 +1101,20 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1101,22 +1101,20 @@ void nr_schedule_ue_spec(module_id_t module_id,
int dlsch_total_bytes = 0; int dlsch_total_bytes = 0;
if (sched_ctrl->num_total_bytes > 0) { if (sched_ctrl->num_total_bytes > 0) {
tbs_size_t len = 0; tbs_size_t len = 0;
while (size > 3) {
// Check MAC header short/long format and size // Reserve space for short or long header.
// Check if data from RLC is equal or longer than 256B or not. // Check if data from RLC is equal or longer than 256B or not.
// Data from RLC was checked before, in function nr_store_dlsch_buffer // Data from RLC was checked before, in function nr_store_dlsch_buffer
int header_size = sizeof(NR_MAC_SUBHEADER_SHORT); uint8_t *header = buf;
if (sched_ctrl->num_total_bytes >= 256) { if (sched_ctrl->num_total_bytes >= 256) {
header_size = sizeof(NR_MAC_SUBHEADER_LONG); buf += sizeof(NR_MAC_SUBHEADER_LONG);
size -= sizeof(NR_MAC_SUBHEADER_LONG);
} else {
buf += sizeof(NR_MAC_SUBHEADER_SHORT);
size -= sizeof(NR_MAC_SUBHEADER_SHORT);
} }
while (size > header_size) {
// Reserve space for short or long header.
uint8_t *header = buf;
buf += header_size;
size -= header_size;
/* limit requested number of bytes to what preprocessor specified, or /* limit requested number of bytes to what preprocessor specified, or
* such that TBS is full */ * such that TBS is full */
const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size); const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size);
...@@ -1145,7 +1143,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1145,7 +1143,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
if (len == 0) if (len == 0)
break; break;
if (header_size == sizeof(NR_MAC_SUBHEADER_LONG)) { if (sched_ctrl->num_total_bytes >= 256) {
((NR_MAC_SUBHEADER_LONG *) header)->R = 0; ((NR_MAC_SUBHEADER_LONG *) header)->R = 0;
((NR_MAC_SUBHEADER_LONG *) header)->F = 1; ((NR_MAC_SUBHEADER_LONG *) header)->F = 1;
((NR_MAC_SUBHEADER_LONG *) header)->LCID = lcid; ((NR_MAC_SUBHEADER_LONG *) header)->LCID = lcid;
...@@ -1164,8 +1162,13 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1164,8 +1162,13 @@ void nr_schedule_ue_spec(module_id_t module_id,
} }
if (len == 0) { if (len == 0) {
/* RLC did not have data anymore, mark buffer as unused */ /* RLC did not have data anymore, mark buffer as unused */
buf -= header_size; if (sched_ctrl->num_total_bytes >= 256) {
size += header_size; buf -= sizeof(NR_MAC_SUBHEADER_LONG);
size += sizeof(NR_MAC_SUBHEADER_LONG);
} else {
buf -= sizeof(NR_MAC_SUBHEADER_SHORT);
size += sizeof(NR_MAC_SUBHEADER_SHORT);
}
} }
} }
else if (get_softmodem_params()->phy_test || get_softmodem_params()->do_ra || get_softmodem_params()->sa) { else if (get_softmodem_params()->phy_test || get_softmodem_params()->do_ra || get_softmodem_params()->sa) {
......
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