Commit 6d93b6a6 authored by Melissa Elkadi's avatar Melissa Elkadi

Removed change to gNB scheduler

Changed NFAPI_mode check in the gNB scheduler
to ensure that the frame is correctly updated for
msg3. Also added comments in NR UE for handling
the RAR and implementing the dci/rx_ind handover
for the RAR procedure.
parent 0dfffed0
...@@ -108,7 +108,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, ...@@ -108,7 +108,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
{ {
memset(pdcch, 0, sizeof(**pdcch) * MAX_NUM_BWP * MAX_NUM_CORESET); memset(pdcch, 0, sizeof(**pdcch) * MAX_NUM_BWP * MAX_NUM_CORESET);
} }
if (NFAPI_MODE == NFAPI_MONOLITHIC || NFAPI_MODE == NFAPI_MODE_PNF) { // monolithic or PNF if (1) { // Melissa. NFAPI_MODE == NFAPI_MONOLITHIC || NFAPI_MODE == NFAPI_MODE_PNF
DL_req[CC_idP].SFN = frameP; DL_req[CC_idP].SFN = frameP;
DL_req[CC_idP].Slot = slotP; DL_req[CC_idP].Slot = slotP;
......
...@@ -286,11 +286,6 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP ...@@ -286,11 +286,6 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
}else if (N_RA_slot <= 1) { //1 PRACH slot in a subframe }else if (N_RA_slot <= 1) { //1 PRACH slot in a subframe
slot_index = 0; slot_index = 0;
} }
const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160};
const int n = slots_per_frame[*scc->ssbSubcarrierSpacing];
for (int i = 0; i < n; ++i) {
RC.nrmac[module_idP]->UL_tti_req_ahead[0][i].SFN = (frameP != 1023) ? frameP + 1 : 0;
}
UL_tti_req->SFN = frameP; UL_tti_req->SFN = frameP;
UL_tti_req->Slot = slotP; UL_tti_req->Slot = slotP;
for (int fdm_index=0; fdm_index < fdm; fdm_index++) { // one structure per frequency domain occasion for (int fdm_index=0; fdm_index < fdm; fdm_index++) { // one structure per frequency domain occasion
......
...@@ -148,7 +148,6 @@ void send_nsa_standalone_msg(nfapi_nr_rach_indication_t *rach_ind) ...@@ -148,7 +148,6 @@ void send_nsa_standalone_msg(nfapi_nr_rach_indication_t *rach_ind)
static void check_and_process_rar(nfapi_nr_dl_tti_request_t *dl_tti_request) static void check_and_process_rar(nfapi_nr_dl_tti_request_t *dl_tti_request)
{ {
bool filled_pdsch_pdu = false;
bool filled_pdcch_pdu = false; bool filled_pdcch_pdu = false;
int num_pdus = dl_tti_request->dl_tti_request_body.nPDUs; int num_pdus = dl_tti_request->dl_tti_request_body.nPDUs;
if (num_pdus <= 0) if (num_pdus <= 0)
...@@ -158,17 +157,20 @@ static void check_and_process_rar(nfapi_nr_dl_tti_request_t *dl_tti_request) ...@@ -158,17 +157,20 @@ static void check_and_process_rar(nfapi_nr_dl_tti_request_t *dl_tti_request)
} }
nr_downlink_indication_t dl_info; nr_downlink_indication_t dl_info;
dl_info.rx_ind = CALLOC(1, sizeof(fapi_nr_rx_indication_t));
dl_info.dci_ind = CALLOC(1, sizeof(fapi_nr_dci_indication_t));
for (int i = 0; i < num_pdus; i++) for (int i = 0; i < num_pdus; i++)
{ {
nfapi_nr_dl_tti_request_pdu_t *pdu_list = &dl_tti_request->dl_tti_request_body.dl_tti_pdu_list[i]; nfapi_nr_dl_tti_request_pdu_t *pdu_list = &dl_tti_request->dl_tti_request_body.dl_tti_pdu_list[i];
if (pdu_list->PDUType == NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE) if (pdu_list->PDUType == NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE)
{ {
LOG_I(NR_PHY, "Melissa in [%d, %d], we got the PDSCH (RAR payload)for rnti %x in \n", LOG_I(NR_PHY, "Melissa in [%d, %d], we got the PDSCH (RAR transmission configuration)for rnti %x in \n",
dl_tti_request->SFN, dl_tti_request->Slot, pdu_list->pdsch_pdu.pdsch_pdu_rel15.rnti); dl_tti_request->SFN, dl_tti_request->Slot, pdu_list->pdsch_pdu.pdsch_pdu_rel15.rnti);
// Melissa, what can I fill pdu with? dl_info.rx_ind->rx_indication_body->pdsch_pdu.pdu = pdu_list->pdsch_pdu.pdsch_pdu_rel15. /* Copy from tx_req the pdu put it in the rx_ind pdsch.pdu thing and then call nr_ue_dl_indication */
dl_info.rx_ind->rx_indication_body->pdsch_pdu.pdu_length = pdu_list->PDUSize;
filled_pdsch_pdu = true;
} }
//int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t frame, int slot, fapi_nr_dci_indication_pdu_t *dci){
if (pdu_list->PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) if (pdu_list->PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE)
{ {
if (pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci > 0) if (pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci > 0)
...@@ -176,18 +178,22 @@ static void check_and_process_rar(nfapi_nr_dl_tti_request_t *dl_tti_request) ...@@ -176,18 +178,22 @@ static void check_and_process_rar(nfapi_nr_dl_tti_request_t *dl_tti_request)
for (int j = 0; j < pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci; j++) for (int j = 0; j < pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci; j++)
{ {
nfapi_nr_dl_dci_pdu_t *dci_pdu_list = &pdu_list->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[j]; nfapi_nr_dl_dci_pdu_t *dci_pdu_list = &pdu_list->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[j];
LOG_I(NR_PHY, "Melissa in [%d, %d], we got the PDCCH DCI (control data) for rnti %x\n", LOG_I(NR_PHY, "Melissa in [%d, %d], we got the PDCCH DCI (Payload) for rnti %x\n",
dl_tti_request->SFN, dl_tti_request->Slot, dci_pdu_list->RNTI); dl_tti_request->SFN, dl_tti_request->Slot, dci_pdu_list->RNTI);
for (int k = 0; k < DCI_PAYLOAD_BYTE_LEN; k++) for (int k = 0; k < DCI_PAYLOAD_BYTE_LEN; k++)
{ {
// Melissa, why is dl_info payload 16 elements and received dl_tti_req payload is 8 elements? /* This has to happen first. Dont call nr_ue_dl_indication, instead you need to send dci_ind to mac layer
then you get back a scheduled response (the one we made a new one return 0;) and
then we send up payload. Then the phy layer will receive a PDSCH and then we extract
the tx_tti pdu and fill the dl_indication pdsch pdu from tx_tti and that should tell NR UE we got RAR */
dl_info.dci_ind->dci_list->payloadBits[k] = dci_pdu_list->Payload[k]; dl_info.dci_ind->dci_list->payloadBits[k] = dci_pdu_list->Payload[k];
} }
dl_info.dci_ind->dci_list->payloadSize = dci_pdu_list->PayloadSizeBits; dl_info.dci_ind->dci_list->payloadSize = dci_pdu_list->PayloadSizeBits;
filled_pdcch_pdu = true; filled_pdcch_pdu = true;
} }
} }
handle_dci(0, 0, 0, dl_tti_request->SFN, dl_tti_request->Slot, dl_info.dci_ind->dci_list);
} }
} }
...@@ -197,7 +203,7 @@ static void check_and_process_rar(nfapi_nr_dl_tti_request_t *dl_tti_request) ...@@ -197,7 +203,7 @@ static void check_and_process_rar(nfapi_nr_dl_tti_request_t *dl_tti_request)
if (mac->scc == NULL) { if (mac->scc == NULL) {
return; return;
} }
if (is_nr_UL_slot(mac->scc, dl_info.slot) && filled_pdsch_pdu && filled_pdcch_pdu) { if (0) { //(is_nr_UL_slot(mac->scc, dl_info.slot) && filled_pdcch_pdu
LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() from %s\n", dl_info.slot, __FUNCTION__); LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() from %s\n", dl_info.slot, __FUNCTION__);
nr_ue_dl_indication(&dl_info, NULL); nr_ue_dl_indication(&dl_info, 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