Code cleanup and documentation update
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
|
||||
uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
|
||||
|
||||
uint8_t first_sched_entry = 1;
|
||||
uint8_t vnf_first_sched_entry = 1;
|
||||
|
||||
void clear_mac_stats(gNB_MAC_INST *gNB) {
|
||||
memset((void*)gNB->UE_info.mac_stats,0,MAX_MOBILES_PER_GNB*sizeof(NR_mac_stats_t));
|
||||
@@ -400,18 +400,19 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
|
||||
clear_nr_nfapi_information(RC.nrmac[module_idP], CC_id, frame, slot);
|
||||
|
||||
//first entry
|
||||
/*VNF first entry into scheduler. Since frame numbers for future_ul_tti_req of some future slots
|
||||
will not be set before we encounter them, set them here */
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF){
|
||||
if(first_sched_entry == 1)
|
||||
if(vnf_first_sched_entry == 1)
|
||||
{
|
||||
printf("First sched entry at slot %d \n", slot);
|
||||
for (int i = 0; i<num_slots; i++){
|
||||
if(i < slot)
|
||||
gNB->UL_tti_req_ahead[CC_id][i].SFN = (frame + 1) % 1024;
|
||||
else
|
||||
gNB->UL_tti_req_ahead[CC_id][i].SFN = frame;
|
||||
}
|
||||
first_sched_entry = 0;
|
||||
vnf_first_sched_entry = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -442,7 +443,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
schedule_nr_prach(module_idP, f, s);
|
||||
}
|
||||
|
||||
// This schedule SR
|
||||
// This schedule SR
|
||||
nr_sr_reporting(module_idP, frame, slot);
|
||||
|
||||
// Schedule CSI-RS transmission
|
||||
@@ -459,7 +460,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
}
|
||||
|
||||
// This schedules the DCI for Uplink and subsequently PUSCH
|
||||
|
||||
nr_schedule_ulsch(module_idP, frame, slot);
|
||||
|
||||
// This schedules the DCI for Downlink and PDSCH
|
||||
|
||||
@@ -1036,7 +1036,6 @@ static NR_UE_harq_t *find_harq(module_id_t mod_id, frame_t frame, sub_frame_t sl
|
||||
harq->feedback_slot,
|
||||
frame,
|
||||
slot);
|
||||
//printf("handling harq \n");
|
||||
remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
|
||||
handle_dl_harq(mod_id, UE_id, pid, 0);
|
||||
pid = sched_ctrl->feedback_dl_harq.head;
|
||||
@@ -1076,14 +1075,12 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
|
||||
for (int harq_bit = 0; harq_bit < uci_01->harq->num_harq; harq_bit++) {
|
||||
const uint8_t harq_value = uci_01->harq->harq_list[harq_bit].harq_value;
|
||||
const uint8_t harq_confidence = uci_01->harq->harq_confidence_level;
|
||||
//printf("handle uci 0_1 find harq SFN/slot %d.%d \n",frame,slot);
|
||||
NR_UE_harq_t *harq = find_harq(mod_id, frame, slot, UE_id);
|
||||
if (!harq)
|
||||
break;
|
||||
DevAssert(harq->is_waiting);
|
||||
const int8_t pid = sched_ctrl->feedback_dl_harq.head;
|
||||
remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
|
||||
//printf("handling harq \n");
|
||||
handle_dl_harq(mod_id, UE_id, pid, harq_value == 1 && harq_confidence == 0);
|
||||
}
|
||||
}
|
||||
@@ -1152,6 +1149,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// function to update pucch scheduling parameters in UE list when a USS DL is scheduled
|
||||
// this function returns an index to NR_sched_pucch structure
|
||||
// currently this structure contains PUCCH0 at index 0 and PUCCH2 at index 1
|
||||
@@ -1193,7 +1191,6 @@ int nr_acknack_scheduling(int mod_id,
|
||||
__func__,
|
||||
pucch->csi_bits);
|
||||
/* if the currently allocated PUCCH of this UE is full, allocate it */
|
||||
|
||||
if (pucch->dai_c == 2) {
|
||||
/* advance the UL slot information in PUCCH by one so we won't schedule in
|
||||
* the same slot again */
|
||||
@@ -1223,7 +1220,6 @@ int nr_acknack_scheduling(int mod_id,
|
||||
/* if the UE's next PUCCH occasion is after the possible UL slots (within the
|
||||
* same frame) or wrapped around to the next frame, then we assume there is
|
||||
* no possible PUCCH allocation anymore */
|
||||
|
||||
if ((pucch->frame == frame
|
||||
&& (pucch->ul_slot >= first_ul_slot_tdd + nr_ulmix_slots))
|
||||
|| (pucch->frame == frame + 1))
|
||||
@@ -1235,10 +1231,8 @@ int nr_acknack_scheduling(int mod_id,
|
||||
get_pdsch_to_harq_feedback(mod_id, UE_id, ss_type, pdsch_to_harq_feedback);
|
||||
|
||||
/* there is a HARQ. Check whether we can use it for this ACKNACK */
|
||||
|
||||
if (pucch->dai_c > 0) {
|
||||
/* this UE already has a PUCCH occasion */
|
||||
LOG_I(MAC,"pucch->frame = %d,frame=%d \n",pucch->frame,frame);
|
||||
DevAssert(pucch->frame == frame);
|
||||
|
||||
// Find the right timing_indicator value.
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include <openair2/UTIL/OPT/opt.h>
|
||||
|
||||
|
||||
@@ -1346,11 +1345,9 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
sched_ctrl->SR = false;
|
||||
|
||||
int8_t harq_id = sched_pusch->ul_harq_pid;
|
||||
|
||||
if (harq_id < 0) {
|
||||
/* PP has not selected a specific HARQ Process, get a new one */
|
||||
harq_id = sched_ctrl->available_ul_harq.head;
|
||||
//printf("SFN/slot %d.%d harq id = %d \n", frame, slot, harq_id);
|
||||
AssertFatal(harq_id >= 0,
|
||||
"no free HARQ process available for UE %d\n",
|
||||
UE_id);
|
||||
@@ -1358,8 +1355,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
sched_pusch->ul_harq_pid = harq_id;
|
||||
} else {
|
||||
/* PP selected a specific HARQ process. Check whether it will be a new
|
||||
* transmission or a retransmission, and remove from the corresponding
|
||||
* list */
|
||||
* transmission or a retransmission, and remove from the corresponding
|
||||
* list */
|
||||
if (sched_ctrl->ul_harq_processes[harq_id].round == 0)
|
||||
remove_nr_list(&sched_ctrl->available_ul_harq, harq_id);
|
||||
else
|
||||
@@ -1370,7 +1367,6 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
add_tail_nr_list(&sched_ctrl->feedback_ul_harq, harq_id);
|
||||
cur_harq->feedback_slot = sched_pusch->slot;
|
||||
cur_harq->is_waiting = true;
|
||||
|
||||
|
||||
int rnti_types[2] = { NR_RNTI_C, 0 };
|
||||
|
||||
|
||||
@@ -48,6 +48,12 @@ extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind);
|
||||
extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind);
|
||||
extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
|
||||
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
|
||||
int oai_nfapi_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind);
|
||||
int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind);
|
||||
int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind);
|
||||
int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind);
|
||||
int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind);
|
||||
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind);
|
||||
extern uint8_t nfapi_mode;
|
||||
extern uint16_t sf_ahead;
|
||||
extern uint16_t sl_ahead;
|
||||
|
||||
Reference in New Issue
Block a user