Commit a717f47d authored by Laurent THOMAS's avatar Laurent THOMAS

MR2416 split nr_ue_dl_indication in two different functions, that have little...

MR2416 split nr_ue_dl_indication in two different functions, that have little interaction: nr_ue_dl_processing and nr_ue_dl_scheduler. the call remain nr_ue_dl_indication
parent f82e6bd8
......@@ -1157,19 +1157,15 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info)
return 0;
}
int nr_ue_dl_indication(nr_downlink_indication_t *dl_info)
static uint32_t nr_ue_dl_processing(nr_downlink_indication_t *dl_info)
{
pthread_mutex_lock(&mac_IF_mutex);
uint32_t ret_mask = 0x0;
module_id_t module_id = dl_info->module_id;
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
if ((!dl_info->dci_ind && !dl_info->rx_ind)) {
// UL indication to schedule DCI reception
nr_ue_dl_scheduler(dl_info);
} else {
// UL indication after reception of DCI or DL PDU
// DL indication after reception of DCI or DL PDU
if (dl_info && dl_info->dci_ind && dl_info->dci_ind->number_of_dcis) {
LOG_T(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n");
LOG_T(MAC, "[L2][IF MODULE][DL INDICATION][DCI_IND]\n");
for (int i = 0; i < dl_info->dci_ind->number_of_dcis; i++) {
LOG_T(MAC, ">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n", i, dl_info->dci_ind->number_of_dcis);
int8_t ret = handle_dci(dl_info->module_id,
......@@ -1177,10 +1173,10 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info)
dl_info->gNB_index,
dl_info->frame,
dl_info->slot,
dl_info->dci_ind->dci_list+i);
dl_info->dci_ind->dci_list + i);
if (ret < 0)
continue;
fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i;
fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list + i;
/* The check below filters out UL_DCIs which are being processed as DL_DCIs. */
if (dci_index->dci_format != NR_DL_DCI_FORMAT_1_0 && dci_index->dci_format != NR_DL_DCI_FORMAT_1_1) {
......@@ -1263,11 +1259,24 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info)
}
dl_info->rx_ind = NULL;
}
}
pthread_mutex_unlock(&mac_IF_mutex);
return ret_mask;
}
int nr_ue_dl_indication(nr_downlink_indication_t *dl_info)
{
int ret = pthread_mutex_lock(&mac_IF_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
uint32_t ret2 = 0;
if (!dl_info->dci_ind && !dl_info->rx_ind)
// DL indication to process DCI reception
nr_ue_dl_scheduler(dl_info);
else
// DL indication to process data channels
ret2 = nr_ue_dl_processing(dl_info);
pthread_mutex_unlock(&mac_IF_mutex);
return ret2;
}
nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id)
{
if (nr_ue_if_module_inst[module_id] == NULL) {
......
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