Commit c645a308 authored by Luis Pereira's avatar Luis Pereira

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

This reverts commit 081a2879290d6fa806a4746f7dcfc28cc5e9c255
parent 40880ebc
...@@ -1102,18 +1102,12 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1102,18 +1102,12 @@ void nr_schedule_ue_spec(module_id_t module_id,
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) { while (size > 3) {
// we do not know how much data we will get from RLC, i.e., whether it
// Reserve space for short or long header. // will be longer than 256B or not. Therefore, reserve space for long header, then
// Check if data from RLC is equal or longer than 256B or not. // fetch data, then fill real length
// Data from RLC was checked before, in function nr_store_dlsch_buffer NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf;
uint8_t *header = buf; buf += 3;
if (sched_ctrl->num_total_bytes >= 256) { size -= 3;
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);
}
/* 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 */
...@@ -1143,32 +1137,19 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1143,32 +1137,19 @@ void nr_schedule_ue_spec(module_id_t module_id,
if (len == 0) if (len == 0)
break; break;
if (sched_ctrl->num_total_bytes >= 256) { header->R = 0;
((NR_MAC_SUBHEADER_LONG *) header)->R = 0; header->F = 1;
((NR_MAC_SUBHEADER_LONG *) header)->F = 1; header->LCID = lcid;
((NR_MAC_SUBHEADER_LONG *) header)->LCID = lcid; header->L1 = (len >> 8) & 0xff;
((NR_MAC_SUBHEADER_LONG *) header)->L1 = (len >> 8) & 0xff; header->L2 = len & 0xff;
((NR_MAC_SUBHEADER_LONG *) header)->L2 = len & 0xff;
} else {
((NR_MAC_SUBHEADER_SHORT *) header)->R = 0;
((NR_MAC_SUBHEADER_SHORT *) header)->F = 0;
((NR_MAC_SUBHEADER_SHORT *) header)->LCID = lcid;
((NR_MAC_SUBHEADER_SHORT *) header)->L = len & 0xff;
}
size -= len; size -= len;
buf += len; buf += len;
dlsch_total_bytes += len; dlsch_total_bytes += len;
} }
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 */
if (sched_ctrl->num_total_bytes >= 256) { buf -= 3;
buf -= sizeof(NR_MAC_SUBHEADER_LONG); size += 3;
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