Commit f4d47b1e authored by cig's avatar cig Committed by Thomas Schlichter

Checking in dl_indication if scheduling is needed or any DL PDU was received:

- scheduling is needed only when whe it doesn´t fall in dci_ind or rx_ind cases
- cleaned up some old commented out code
parent 36f5e80e
...@@ -145,7 +145,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ ...@@ -145,7 +145,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
} }
int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment){ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment){
int32_t i; int32_t i;
uint32_t ret_mask = 0x0; uint32_t ret_mask = 0x0;
module_id_t module_id = dl_info->module_id; module_id_t module_id = dl_info->module_id;
...@@ -153,132 +153,99 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ ...@@ -153,132 +153,99 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request;
fapi_nr_ul_config_request_t *ul_config = &mac->ul_config_request; fapi_nr_ul_config_request_t *ul_config = &mac->ul_config_request;
nr_ue_scheduler(dl_info, NULL); if (!dl_info->dci_ind && !dl_info->rx_ind) {
// UL indication to schedule reception DCI reception
dl_config->number_pdus = 0; nr_ue_scheduler(dl_info, NULL);
ul_config->number_pdus = 0; } else {
//hook up pointers // UL indication after reception of DCI or DL PDU
mac->scheduled_response.dl_config = dl_config; dl_config->number_pdus = 0;
mac->scheduled_response.ul_config = ul_config; ul_config->number_pdus = 0;
mac->scheduled_response.tx_request = &mac->tx_request; //hook up pointers
mac->scheduled_response.module_id = dl_info->module_id; mac->scheduled_response.dl_config = dl_config;
mac->scheduled_response.CC_id = dl_info->cc_id; mac->scheduled_response.ul_config = ul_config;
mac->scheduled_response.frame = dl_info->frame; mac->scheduled_response.tx_request = &mac->tx_request;
mac->scheduled_response.slot = dl_info->slot; mac->scheduled_response.module_id = dl_info->module_id;
mac->scheduled_response.CC_id = dl_info->cc_id;
if(dl_info->dci_ind != NULL){ mac->scheduled_response.frame = dl_info->frame;
LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n"); mac->scheduled_response.slot = dl_info->slot;
for(i=0; i<dl_info->dci_ind->number_of_dcis; ++i){
LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis); if(dl_info->dci_ind != NULL){
// fapi_nr_dci_pdu_rel15_t *dci = &dl_info->dci_ind->dci_list[i].dci; LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n");
for(i=0; i<dl_info->dci_ind->number_of_dcis; ++i){
ret_mask |= (handle_dci(dl_info->module_id, LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis);
dl_info->cc_id,
dl_info->gNB_index, ret_mask |= (handle_dci(dl_info->module_id,
dl_info->dci_ind->dci_list+i)<< FAPI_NR_DCI_IND); dl_info->cc_id,
dl_info->gNB_index,
AssertFatal( nr_ue_if_module_inst[module_id] != NULL, "IF module is void!\n" ); dl_info->dci_ind->dci_list+i)<< FAPI_NR_DCI_IND);
nr_ue_if_module_inst[module_id]->scheduled_response(&mac->scheduled_response);
AssertFatal( nr_ue_if_module_inst[module_id] != NULL, "IF module is void!\n" );
nr_ue_if_module_inst[module_id]->scheduled_response(&mac->scheduled_response);
/*switch((dl_info->dci_ind->dci_list+i)->dci_type){ }
case FAPI_NR_DCI_TYPE_0_0:
case FAPI_NR_DCI_TYPE_0_1:
case FAPI_NR_DCI_TYPE_1_1:
case FAPI_NR_DCI_TYPE_2_0:
case FAPI_NR_DCI_TYPE_2_1:
case FAPI_NR_DCI_TYPE_2_2:
case FAPI_NR_DCI_TYPE_2_3:
AssertFatal(1==0, "Not yet support at this moment!\n");
break;
case FAPI_NR_DCI_TYPE_1_0:
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DLSCH;
// mapping into DL_CONFIG_REQ for DL-SCH
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.dlsch_config_rel15;
dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.rnti = 0x0000; // TX RNTI: UE-spec
memcpy(dlsch_config_pdu, dci, sizeof(fapi_nr_dci_pdu_rel15_t));
dl_config->number_pdus = dl_config->number_pdus + 1;
ret_mask |= (handle_dci(
dl_info->module_id,
dl_info->cc_id,
dl_info->gNB_index,
dci,
(dl_info->dci_ind->dci_list+i)->rnti,
(dl_info->dci_ind->dci_list+i)->dci_type)) << FAPI_NR_DCI_IND;
break;
default:
break;
}*/
//(dl_info->dci_list+i)->rnti
} }
}
if(dl_info->rx_ind != NULL){ if(dl_info->rx_ind != NULL){
LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
for(i=0; i<dl_info->rx_ind->number_pdus; ++i){ LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
switch(dl_info->rx_ind->rx_indication_body[i].pdu_type){
case FAPI_NR_RX_PDU_TYPE_MIB: for(i=0; i<dl_info->rx_ind->number_pdus; ++i){
ret_mask |= (handle_bcch_bch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index,
(dl_info->rx_ind->rx_indication_body+i)->mib_pdu.pdu, switch(dl_info->rx_ind->rx_indication_body[i].pdu_type){
(dl_info->rx_ind->rx_indication_body+i)->mib_pdu.additional_bits,
(dl_info->rx_ind->rx_indication_body+i)->mib_pdu.ssb_index, case FAPI_NR_RX_PDU_TYPE_MIB:
(dl_info->rx_ind->rx_indication_body+i)->mib_pdu.ssb_length, ret_mask |= (handle_bcch_bch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index,
(dl_info->rx_ind->rx_indication_body+i)->mib_pdu.cell_id )) << FAPI_NR_RX_PDU_TYPE_MIB; (dl_info->rx_ind->rx_indication_body+i)->mib_pdu.pdu,
LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], MIB case Number of PDUs: %d \n", dl_info->rx_ind->number_pdus); (dl_info->rx_ind->rx_indication_body+i)->mib_pdu.additional_bits,
/*ret_mask |= (handle_bcch_bch( dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, (dl_info->rx_ind->rx_indication_body+i)->mib_pdu.ssb_index,
dl_info->rx_ind->rx_indication_body[i].mib_pdu.pdu, (dl_info->rx_ind->rx_indication_body+i)->mib_pdu.ssb_length,
dl_info->rx_ind->rx_indication_body[i].mib_pdu.additional_bits, (dl_info->rx_ind->rx_indication_body+i)->mib_pdu.cell_id)) << FAPI_NR_RX_PDU_TYPE_MIB;
dl_info->rx_ind->rx_indication_body[i].mib_pdu.ssb_index,
dl_info->rx_ind->rx_indication_body[i].mib_pdu.ssb_length, LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], MIB case Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
dl_info->rx_ind->rx_indication_body[i].mib_pdu.cell_id )) << FAPI_NR_RX_PDU_TYPE_MIB;*/
break; break;
case FAPI_NR_RX_PDU_TYPE_SIB:
ret_mask |= (handle_bcch_dlsch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, case FAPI_NR_RX_PDU_TYPE_SIB:
(dl_info->rx_ind->rx_indication_body+i)->sib_pdu.sibs_mask,
(dl_info->rx_ind->rx_indication_body+i)->sib_pdu.pdu, ret_mask |= (handle_bcch_dlsch(dl_info->module_id,
(dl_info->rx_ind->rx_indication_body+i)->sib_pdu.pdu_length )) << FAPI_NR_RX_PDU_TYPE_SIB; dl_info->cc_id, dl_info->gNB_index,
break; (dl_info->rx_ind->rx_indication_body+i)->sib_pdu.sibs_mask,
case FAPI_NR_RX_PDU_TYPE_DLSCH: (dl_info->rx_ind->rx_indication_body+i)->sib_pdu.pdu,
// ret_mask |= (0) << FAPI_NR_RX_PDU_TYPE_DLSCH; (dl_info->rx_ind->rx_indication_body+i)->sib_pdu.pdu_length)) << FAPI_NR_RX_PDU_TYPE_SIB;
ret_mask |= (handle_dlsch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, dl_info->dci_ind,
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu, break;
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu_length, dl_info->frame, dl_info->slot, ul_time_alignment)) << FAPI_NR_RX_PDU_TYPE_DLSCH;
case FAPI_NR_RX_PDU_TYPE_DLSCH:
LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], DLSCH case Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
ret_mask |= (handle_dlsch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index,
/* dl_info->dci_ind,
// dl_config structure just stores what was received - not really needed (dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu,
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DLSCH; (dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu_length,
dl_config->number_pdus = dl_config->number_pdus + 1; dl_info->frame,
*/ dl_info->slot,
break; ul_time_alignment)) << FAPI_NR_RX_PDU_TYPE_DLSCH;
case FAPI_NR_RX_PDU_TYPE_RAR: LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], DLSCH case Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
ret_mask |= (handle_rar(dl_info)) << FAPI_NR_RX_PDU_TYPE_RAR;
break; break;
default: case FAPI_NR_RX_PDU_TYPE_RAR:
break;
ret_mask |= (handle_rar(dl_info)) << FAPI_NR_RX_PDU_TYPE_RAR;
break;
default:
break;
}
} }
} }
}
//clean up nr_downlink_indication_t *dl_info //clean up nr_downlink_indication_t *dl_info
dl_info->rx_ind = NULL; dl_info->rx_ind = NULL;
dl_info->dci_ind = NULL; dl_info->dci_ind = NULL;
return 0; return 0;
}
} }
nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id){ nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id){
......
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