Commit b6b3cc51 authored by Roberto Rosca's avatar Roberto Rosca

Refactor SIB scheduling

  - refactor nr_fill_nfapi_dl_SIB_pdu to use it on both SIB1 and OtherSI
  - extract tbs related calculations into function get_tbs to avoid duplicates
  - moved OtherSI search space initializations to nr_mac_config_scc
parent 8bc22710
......@@ -694,9 +694,29 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, c
NR_RA_t *ra = &cc->ra[n];
nr_clear_ra_proc(ra);
}
nr_fill_sched_osi(nrmac, scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon);
NR_SCHED_UNLOCK(&nrmac->sched_lock);
}
void nr_fill_sched_osi(gNB_MAC_INST *nrmac, const struct NR_SetupRelease_PDCCH_ConfigCommon *pdcch_ConfigCommon)
{
NR_SearchSpaceId_t *osi_SearchSpace = pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation;
if (osi_SearchSpace) {
nrmac->sched_osi = CALLOC(1, sizeof(*nrmac->sched_osi));
struct NR_PDCCH_ConfigCommon__commonSearchSpaceList *commonSearchSpaceList =
pdcch_ConfigCommon->choice.setup->commonSearchSpaceList;
AssertFatal(commonSearchSpaceList->list.count > 0, "common SearchSpace list has 0 elements\n");
for (int i = 0; i < commonSearchSpaceList->list.count; i++) {
NR_SearchSpace_t *ss = commonSearchSpaceList->list.array[i];
if (ss->searchSpaceId == *osi_SearchSpace)
nrmac->sched_osi->search_space = ss;
}
AssertFatal(nrmac->sched_osi->search_space != NULL, "SearchSpace cannot be null for OSI\n");
}
}
void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_t cellID, int tac)
{
AssertFatal(get_softmodem_params()->sa > 0, "error: SIB1 only applicable for SA\n");
......
......@@ -267,7 +267,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_
if (get_softmodem_params()->sa == 1) {
schedule_nr_sib1(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req);
if (cc->sib19)
schedule_nr_sib19(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req);
schedule_nr_sib19(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req, cc->sib19_bcch_length, cc->sib19_bcch_pdu);
}
// This schedule PRACH if we are not in phy_test mode
......
......@@ -893,17 +893,9 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu,
pdcch_pdu->InterleaverSize = pdcch->InterleaverSize;
pdcch_pdu->ShiftIndex = pdcch->ShiftIndex;
if (otherSI) {
pdcch_pdu->CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG;
}
else {
if (coreset->controlResourceSetId == 0) {
pdcch_pdu->CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
} else {
pdcch_pdu->CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG;
}
}
pdcch_pdu->CoreSetType =
(otherSI || coreset->controlResourceSetId != 0) ? NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG : NFAPI_NR_CSET_CONFIG_MIB_SIB1;
//precoderGranularity
pdcch_pdu->precoderGranularity = coreset->precoderGranularity;
}
......
......@@ -46,6 +46,7 @@ void mac_top_init_gNB(ngran_node_t node_type,
void nr_mac_send_f1_setup_req(void);
void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, const nr_mac_config_t *mac_config);
void nr_fill_sched_osi(gNB_MAC_INST *nrmac, const struct NR_SetupRelease_PDCCH_ConfigCommon *pdcch_ConfigCommon);
void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_t cellID, int tac);
void nr_mac_configure_sib19(gNB_MAC_INST *nrmac);
......@@ -91,7 +92,11 @@ void schedule_nr_sib19(module_id_t module_idP,
frame_t frameP,
sub_frame_t slotP,
nfapi_nr_dl_tti_request_t *DL_req,
nfapi_nr_tx_data_request_t *TX_req);
nfapi_nr_tx_data_request_t *TX_req,
int sib19_bcch_length,
uint8_t *sib19_bcch_pdu);
struct NR_SchedulingInfo2_r17* find_sib19_sched_info(const struct NR_SI_SchedulingInfo_v1700*);
void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, nfapi_nr_dl_tti_request_t *DL_req);
......
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