Commit 13401a5f authored by Melissa Elkadi's avatar Melissa Elkadi

Comments from OAI:

This commit include dynamically setting the slots_per_frame
value based on configuration. It also includes some comments.
Lastly, simplified bug fix in MAC layer related to sched_frame
calculation.
parent 5f7f56f0
......@@ -1335,9 +1335,11 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
current_harq->dl_frame = frame;
current_harq->dl_slot = slot;
if (get_softmodem_params()->emulate_l1) {
if (data_toul_fb + slot > 19) {
uint8_t scs = get_softmodem_params()->numerology;
int slots_per_frame = nr_slots_per_frame[scs];
if (data_toul_fb + slot >= slots_per_frame) {
frame = (frame + 1) % 1024;
slot = (data_toul_fb + slot) - 20;
slot = (data_toul_fb + slot) - slots_per_frame;
}
else {
slot = data_toul_fb + slot;
......@@ -2024,13 +2026,12 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
current_harq = &mac->dl_harq_info[dl_harq_pid];
if (current_harq->active) {
sched_slot = current_harq->dl_slot + current_harq->feedback_to_ul;
sched_frame = current_harq->dl_frame;
if (current_harq->feedback_to_ul + current_harq->dl_slot > 19) {
if (sched_slot>=slots_per_frame){
sched_slot %= slots_per_frame;
sched_frame = (sched_frame + 1) % 1024;
sched_slot = (current_harq->feedback_to_ul + current_harq->dl_slot) - slots_per_frame;
}
else {
sched_slot = current_harq->feedback_to_ul + current_harq->dl_slot;
}
AssertFatal(sched_slot < slots_per_frame, "sched_slot was calculated incorrect %d\n", sched_slot);
LOG_D(PHY,"HARQ pid %d is active for %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d\n",dl_harq_pid, sched_frame,sched_slot,current_harq->dl_slot,current_harq->feedback_to_ul,current_harq->is_common);
......
......@@ -262,9 +262,10 @@ int nr_process_mac_pdu(module_id_t module_idP,
//38.321 section 6.1.3.1
//variable length
/* Several checks have been added to this function to
ensure that the casting of the pduP is possible. There
is an actual bug here, but it has not been resolved. This
means that the scheduled transport block size is invalid. */
ensure that the casting of the pduP is possible. There seems
to be a partial PDU at the end of this buffer, so here
we gracefully ignore that by returning 0. See:
https://gitlab.eurecom.fr/oai/openairinterface5g/-/issues/534 */
if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
return 0;
mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L;
......
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