Commit 9355495a authored by Melissa Elkadi's avatar Melissa Elkadi

Unqueueing UL_TTI_REQs based on active harq sfn sf

Also fixed some silly spelling errors.
parent 39563f3c
...@@ -257,14 +257,17 @@ static bool sfn_slot_matcher(void *wanted, void *candidate) ...@@ -257,14 +257,17 @@ static bool sfn_slot_matcher(void *wanted, void *candidate)
return false; return false;
} }
static void process_queued_nr_nfapi_msgs(int sfn_slot) static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot)
{ {
nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue); nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue);
nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue); nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue);
nfapi_nr_ul_tti_request_t *ul_tti_request = get_queue(&nr_ul_tti_req_queue);
LOG_D(NR_MAC, "Try to get a ul_tti_req for sfn/slot %d %d from queue with %d items\n",
NFAPI_SFNSLOT2SFN(mac->active_harq_sfn_sf),NFAPI_SFNSLOT2SLOT(mac->active_harq_sfn_sf), nr_ul_tti_req_queue.num_items);
nfapi_nr_ul_tti_request_t *ul_tti_request = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->active_harq_sfn_sf);
if (rach_ind && rach_ind->number_of_pdus > 0) if (rach_ind && rach_ind->number_of_pdus > 0)
{ {
...@@ -318,6 +321,11 @@ static void process_queued_nr_nfapi_msgs(int sfn_slot) ...@@ -318,6 +321,11 @@ static void process_queued_nr_nfapi_msgs(int sfn_slot)
save_nr_measurement_info(dl_tti_request); save_nr_measurement_info(dl_tti_request);
check_and_process_dci(dl_tti_request, tx_data_request, NULL, NULL); check_and_process_dci(dl_tti_request, tx_data_request, NULL, NULL);
} }
else
{
AssertFatal(false, "We dont have PDUs in either dl_tti %d or tx_req %d\n",
dl_tti_request->dl_tti_request_body.nPDUs, tx_data_request->Number_of_PDUs);
}
} }
if (ul_dci_request && ul_dci_request->numPdus > 0) if (ul_dci_request && ul_dci_request->numPdus > 0)
{ {
...@@ -373,6 +381,10 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ...@@ -373,6 +381,10 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
reset_queue(&nr_rx_ind_queue); reset_queue(&nr_rx_ind_queue);
reset_queue(&nr_crc_ind_queue); reset_queue(&nr_crc_ind_queue);
reset_queue(&nr_uci_ind_queue); reset_queue(&nr_uci_ind_queue);
reset_queue(&nr_dl_tti_req_queue);
reset_queue(&nr_tx_req_queue);
reset_queue(&nr_ul_dci_req_queue);
reset_queue(&nr_ul_tti_req_queue);
NR_PRACH_RESOURCES_t prach_resources; NR_PRACH_RESOURCES_t prach_resources;
memset(&prach_resources, 0, sizeof(prach_resources)); memset(&prach_resources, 0, sizeof(prach_resources));
...@@ -452,7 +464,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ...@@ -452,7 +464,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
nr_ue_ul_indication(&ul_info); nr_ue_ul_indication(&ul_info);
check_nr_prach(mac, &ul_info, &prach_resources); check_nr_prach(mac, &ul_info, &prach_resources);
} }
process_queued_nr_nfapi_msgs(sfn_slot); process_queued_nr_nfapi_msgs(mac, sfn_slot);
} }
return NULL; return NULL;
} }
......
...@@ -437,6 +437,7 @@ typedef struct { ...@@ -437,6 +437,7 @@ typedef struct {
bool expected_dci; bool expected_dci;
bool index_has_dci[16]; bool index_has_dci[16];
int active_harq_sfn_sf;
pthread_mutex_t mutex_dl_info; pthread_mutex_t mutex_dl_info;
......
...@@ -1283,8 +1283,10 @@ void set_harq_status(NR_UE_MAC_INST_t *mac, ...@@ -1283,8 +1283,10 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
// FIXME k0 != 0 currently not taken into consideration // FIXME k0 != 0 currently not taken into consideration
current_harq->dl_frame = frame; current_harq->dl_frame = frame;
current_harq->dl_slot = slot; current_harq->dl_slot = slot;
mac->active_harq_sfn_sf = NFAPI_SFNSLOT2HEX(frame, (slot + data_toul_fb));
LOG_D(PHY,"Setting harq_status for harq_id %d, dl %d.%d\n",harq_id,frame,slot); LOG_D(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n",
harq_id, frame, slot, frame, (slot + data_toul_fb));
} }
......
...@@ -93,7 +93,7 @@ void nrue_init_standalone_socket(int tx_port, int rx_port) ...@@ -93,7 +93,7 @@ void nrue_init_standalone_socket(int tx_port, int rx_port)
} }
assert(ue_tx_sock_descriptor == -1); assert(ue_tx_sock_descriptor == -1);
ue_tx_sock_descriptor = sd; ue_tx_sock_descriptor = sd;
LOG_D(NR_RRC, "Sucessfully set up tx_socket in %s.\n", __FUNCTION__); LOG_D(NR_RRC, "Successfully set up tx_socket in %s.\n", __FUNCTION__);
} }
{ {
...@@ -119,7 +119,7 @@ void nrue_init_standalone_socket(int tx_port, int rx_port) ...@@ -119,7 +119,7 @@ void nrue_init_standalone_socket(int tx_port, int rx_port)
} }
assert(ue_rx_sock_descriptor == -1); assert(ue_rx_sock_descriptor == -1);
ue_rx_sock_descriptor = sd; ue_rx_sock_descriptor = sd;
LOG_D(NR_RRC, "Sucessfully set up rx_socket in %s.\n", __FUNCTION__); LOG_D(NR_RRC, "Successfully set up rx_socket in %s.\n", __FUNCTION__);
} }
LOG_I(NR_RRC, "NRUE standalone socket info: tx_port %d rx_port %d on %s.\n", LOG_I(NR_RRC, "NRUE standalone socket info: tx_port %d rx_port %d on %s.\n",
tx_port, rx_port, stub_eth_params.remote_addr); tx_port, rx_port, stub_eth_params.remote_addr);
...@@ -745,7 +745,7 @@ void *nrue_standalone_pnf_task(void *context) ...@@ -745,7 +745,7 @@ void *nrue_standalone_pnf_task(void *context)
int slot = 0; int slot = 0;
LOG_I(NR_RRC, "Sucessfully started %s.\n", __FUNCTION__); LOG_I(NR_RRC, "Successfully started %s.\n", __FUNCTION__);
while (true) while (true)
{ {
......
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