use BWP specific SS and coreset structures
This commit is contained in:
@@ -434,18 +434,6 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
|||||||
cfg->prach_config.ssb_per_rach = rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present-1;
|
cfg->prach_config.ssb_per_rach = rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief This function is relavant for the UE procedures for control. It loads the search spaces, the BWPs and the CORESETs into the MAC instance and
|
|
||||||
\brief performs assert checks on the relevant RRC configuration.
|
|
||||||
@param NR_UE_MAC_INST_t mac: pointer to local MAC instance
|
|
||||||
@returns void
|
|
||||||
*/
|
|
||||||
void config_control_ue(NR_UE_MAC_INST_t *mac)
|
|
||||||
{
|
|
||||||
NR_ServingCellConfig_t *scd = mac->cg->spCellConfig->spCellConfigDedicated;
|
|
||||||
NR_BWP_Id_t dl_bwp_id = mac->current_DL_BWP.bwp_id;
|
|
||||||
|
|
||||||
configure_ss_coreset(mac, scd, dl_bwp_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
NR_SearchSpace_t *get_common_search_space(struct NR_PDCCH_ConfigCommon__commonSearchSpaceList *commonSearchSpaceList,
|
NR_SearchSpace_t *get_common_search_space(struct NR_PDCCH_ConfigCommon__commonSearchSpaceList *commonSearchSpaceList,
|
||||||
NR_UE_MAC_INST_t *mac,
|
NR_UE_MAC_INST_t *mac,
|
||||||
@@ -465,9 +453,12 @@ NR_SearchSpace_t *get_common_search_space(struct NR_PDCCH_ConfigCommon__commonSe
|
|||||||
return css;
|
return css;
|
||||||
}
|
}
|
||||||
|
|
||||||
void configure_common_ss(NR_UE_MAC_INST_t *mac,
|
void configure_ss_coreset(NR_UE_MAC_INST_t *mac,
|
||||||
NR_PDCCH_ConfigCommon_t *pdcch_ConfigCommon)
|
NR_PDCCH_ConfigCommon_t *pdcch_ConfigCommon,
|
||||||
|
NR_PDCCH_Config_t *pdcch_Config)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// configuration of search spaces
|
||||||
if (pdcch_ConfigCommon) {
|
if (pdcch_ConfigCommon) {
|
||||||
mac->otherSI_SS = pdcch_ConfigCommon->searchSpaceOtherSystemInformation ?
|
mac->otherSI_SS = pdcch_ConfigCommon->searchSpaceOtherSystemInformation ?
|
||||||
get_common_search_space(pdcch_ConfigCommon->commonSearchSpaceList, mac,
|
get_common_search_space(pdcch_ConfigCommon->commonSearchSpaceList, mac,
|
||||||
@@ -482,75 +473,47 @@ void configure_common_ss(NR_UE_MAC_INST_t *mac,
|
|||||||
*pdcch_ConfigCommon->pagingSearchSpace) :
|
*pdcch_ConfigCommon->pagingSearchSpace) :
|
||||||
NULL;
|
NULL;
|
||||||
}
|
}
|
||||||
}
|
if(pdcch_Config &&
|
||||||
|
pdcch_Config->searchSpacesToAddModList) {
|
||||||
|
int ss_configured = 0;
|
||||||
void configure_ss_coreset(NR_UE_MAC_INST_t *mac,
|
struct NR_PDCCH_Config__searchSpacesToAddModList *searchSpacesToAddModList = pdcch_Config->searchSpacesToAddModList;
|
||||||
NR_ServingCellConfig_t *scd,
|
for (int i = 0; i < searchSpacesToAddModList->list.count; i++) {
|
||||||
NR_BWP_Id_t dl_bwp_id)
|
AssertFatal(ss_configured < FAPI_NR_MAX_SS, "Attempting to configure %d SS but only %d per BWP are allowed",
|
||||||
{
|
ss_configured + 1, FAPI_NR_MAX_SS);
|
||||||
NR_BWP_DownlinkCommon_t *bwp_Common = get_bwp_downlink_common(mac, dl_bwp_id);
|
mac->BWP_searchspaces[ss_configured] = searchSpacesToAddModList->list.array[i];
|
||||||
AssertFatal(bwp_Common != NULL, "bwp_Common is null\n");
|
ss_configured++;
|
||||||
|
}
|
||||||
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
|
for (int i = ss_configured; i < FAPI_NR_MAX_SS; i++)
|
||||||
AssertFatal(pdcch_ConfigCommon != NULL, "pdcch_ConfigCommon is null\n");
|
mac->BWP_searchspaces[i] = NULL;
|
||||||
|
|
||||||
// configuring eventual common coreset
|
|
||||||
NR_ControlResourceSet_t *coreset = pdcch_ConfigCommon->choice.setup->commonControlResourceSet;
|
|
||||||
if (coreset)
|
|
||||||
mac->coreset[dl_bwp_id][coreset->controlResourceSetId - 1] = coreset;
|
|
||||||
|
|
||||||
NR_BWP_DownlinkDedicated_t *dl_bwp_Dedicated = dl_bwp_id>0 ? scd->downlinkBWP_ToAddModList->list.array[dl_bwp_id - 1]->bwp_Dedicated:
|
|
||||||
scd->initialDownlinkBWP;
|
|
||||||
|
|
||||||
AssertFatal(dl_bwp_Dedicated != NULL, "dl_bwp_Dedicated is null\n");
|
|
||||||
|
|
||||||
NR_SetupRelease_PDCCH_Config_t *pdcch_Config = dl_bwp_Dedicated->pdcch_Config;
|
|
||||||
AssertFatal(pdcch_Config != NULL, "pdcch_Config is null\n");
|
|
||||||
|
|
||||||
struct NR_PDCCH_Config__controlResourceSetToAddModList *controlResourceSetToAddModList = pdcch_Config->choice.setup->controlResourceSetToAddModList;
|
|
||||||
AssertFatal(controlResourceSetToAddModList != NULL, "controlResourceSetToAddModList is null\n");
|
|
||||||
|
|
||||||
// configuring dedicated coreset
|
|
||||||
// In case network reconfigures control resource set with the same ControlResourceSetId as used for commonControlResourceSet configured via PDCCH-ConfigCommon,
|
|
||||||
// the configuration from PDCCH-Config always takes precedence
|
|
||||||
for (int i=0; i<controlResourceSetToAddModList->list.count; i++) {
|
|
||||||
coreset = controlResourceSetToAddModList->list.array[i];
|
|
||||||
mac->coreset[dl_bwp_id][coreset->controlResourceSetId - 1] = coreset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct NR_PDCCH_Config__searchSpacesToAddModList *searchSpacesToAddModList = pdcch_Config->choice.setup->searchSpacesToAddModList;
|
// configuration of coresets
|
||||||
AssertFatal(searchSpacesToAddModList != NULL, "searchSpacesToAddModList is null\n");
|
int cset_configured = 0;
|
||||||
AssertFatal(searchSpacesToAddModList->list.count > 0, "list of UE specifically configured Search Spaces is empty\n");
|
int common_cset_id = -1;
|
||||||
AssertFatal(searchSpacesToAddModList->list.count < FAPI_NR_MAX_SS_PER_BWP, "too many searchpaces per coreset %d\n", searchSpacesToAddModList->list.count);
|
if (pdcch_ConfigCommon &&
|
||||||
|
pdcch_ConfigCommon->commonControlResourceSet) {
|
||||||
// check available Search Spaces in the searchSpacesToAddModList and pass to MAC
|
mac->BWP_coresets[cset_configured] = pdcch_ConfigCommon->commonControlResourceSet;
|
||||||
// note: the network configures at most 10 Search Spaces per BWP per cell (including UE-specific and common Search Spaces).
|
common_cset_id = pdcch_ConfigCommon->commonControlResourceSet->controlResourceSetId;
|
||||||
for (int ss_id = 0; ss_id < searchSpacesToAddModList->list.count; ss_id++) {
|
cset_configured++;
|
||||||
NR_SearchSpace_t *ss = searchSpacesToAddModList->list.array[ss_id];
|
|
||||||
AssertFatal(ss->controlResourceSetId != NULL, "ss->controlResourceSetId is null\n");
|
|
||||||
AssertFatal(ss->searchSpaceType != NULL, "ss->searchSpaceType is null\n");
|
|
||||||
AssertFatal(ss->monitoringSymbolsWithinSlot != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot is null\n");
|
|
||||||
AssertFatal(ss->monitoringSymbolsWithinSlot->buf != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot->buf is null\n");
|
|
||||||
AssertFatal(ss->searchSpaceId <= FAPI_NR_MAX_SS, "Invalid searchSpaceId\n");
|
|
||||||
mac->SSpace[dl_bwp_id][ss->searchSpaceId - 1] = ss;
|
|
||||||
}
|
}
|
||||||
|
if(pdcch_Config &&
|
||||||
struct NR_PDCCH_ConfigCommon__commonSearchSpaceList *commonSearchSpaceList = pdcch_ConfigCommon->choice.setup->commonSearchSpaceList;
|
pdcch_Config->controlResourceSetToAddModList) {
|
||||||
AssertFatal(commonSearchSpaceList != NULL, "commonSearchSpaceList is null\n");
|
struct NR_PDCCH_Config__controlResourceSetToAddModList *controlResourceSetToAddModList = pdcch_Config->controlResourceSetToAddModList;
|
||||||
AssertFatal(commonSearchSpaceList->list.count > 0, "PDCCH CSS list has 0 elements\n");
|
for (int i = 0; i < controlResourceSetToAddModList->list.count; i++) {
|
||||||
|
AssertFatal(cset_configured < FAPI_NR_MAX_CORESET_PER_BWP, "Attempting to configure %d CORESET but only %d per BWP are allowed",
|
||||||
// Check available CSSs in the commonSearchSpaceList (list of additional common search spaces)
|
cset_configured + 1, FAPI_NR_MAX_CORESET_PER_BWP);
|
||||||
// note: commonSearchSpaceList SIZE(1..4)
|
// In case network reconfigures control resource set with the same ControlResourceSetId as used for commonControlResourceSet
|
||||||
for (int css_id = 0; css_id < commonSearchSpaceList->list.count; css_id++) {
|
// configured via PDCCH-ConfigCommon, the configuration from PDCCH-Config always takes precedence
|
||||||
NR_SearchSpace_t *css = commonSearchSpaceList->list.array[css_id];
|
if (controlResourceSetToAddModList->list.array[i]->controlResourceSetId == common_cset_id)
|
||||||
AssertFatal(css->controlResourceSetId != NULL, "ss->controlResourceSetId is null\n");
|
mac->BWP_coresets[0] = controlResourceSetToAddModList->list.array[i];
|
||||||
AssertFatal(css->searchSpaceType != NULL, "css->searchSpaceType is null\n");
|
else {
|
||||||
AssertFatal(css->monitoringSymbolsWithinSlot != NULL, "css->monitoringSymbolsWithinSlot is null\n");
|
mac->BWP_coresets[cset_configured] = controlResourceSetToAddModList->list.array[i];
|
||||||
AssertFatal(css->monitoringSymbolsWithinSlot->buf != NULL, "css->monitoringSymbolsWithinSlot->buf is null\n");
|
cset_configured++;
|
||||||
AssertFatal(css->searchSpaceId <= FAPI_NR_MAX_SS, "Invalid searchSpaceId\n");
|
}
|
||||||
mac->SSpace[dl_bwp_id][css->searchSpaceId - 1] = css;
|
}
|
||||||
}
|
}
|
||||||
|
for (int i = cset_configured; i < FAPI_NR_MAX_CORESET_PER_BWP; i++)
|
||||||
|
mac->BWP_coresets[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo handle mac_LogicalChannelConfig
|
// todo handle mac_LogicalChannelConfig
|
||||||
@@ -602,7 +565,7 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac,
|
|||||||
if (bwp_ulcommon->rach_ConfigCommon)
|
if (bwp_ulcommon->rach_ConfigCommon)
|
||||||
UL_BWP->rach_ConfigCommon = bwp_ulcommon->rach_ConfigCommon->choice.setup;
|
UL_BWP->rach_ConfigCommon = bwp_ulcommon->rach_ConfigCommon->choice.setup;
|
||||||
if (bwp_dlcommon->pdcch_ConfigCommon)
|
if (bwp_dlcommon->pdcch_ConfigCommon)
|
||||||
configure_common_ss(mac, bwp_dlcommon->pdcch_ConfigCommon->choice.setup);
|
configure_ss_coreset(mac, bwp_dlcommon->pdcch_ConfigCommon->choice.setup, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cell_group_config) {
|
if(cell_group_config) {
|
||||||
@@ -648,15 +611,19 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac,
|
|||||||
dl_genericParameters = bwp_downlink->bwp_Common->genericParameters;
|
dl_genericParameters = bwp_downlink->bwp_Common->genericParameters;
|
||||||
DL_BWP->pdsch_Config = bwp_downlink->bwp_Dedicated->pdsch_Config->choice.setup;
|
DL_BWP->pdsch_Config = bwp_downlink->bwp_Dedicated->pdsch_Config->choice.setup;
|
||||||
DL_BWP->tdaList_Common = bwp_downlink->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
DL_BWP->tdaList_Common = bwp_downlink->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||||
if (bwp_downlink->bwp_Common->pdcch_ConfigCommon)
|
configure_ss_coreset(mac,
|
||||||
configure_common_ss(mac, bwp_downlink->bwp_Common->pdcch_ConfigCommon->choice.setup);
|
bwp_downlink->bwp_Common->pdcch_ConfigCommon ? bwp_downlink->bwp_Common->pdcch_ConfigCommon->choice.setup : NULL,
|
||||||
|
bwp_downlink->bwp_Dedicated->pdcch_Config ? bwp_downlink->bwp_Dedicated->pdcch_Config->choice.setup : NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dl_genericParameters = bwp_dlcommon->genericParameters;
|
dl_genericParameters = bwp_dlcommon->genericParameters;
|
||||||
DL_BWP->pdsch_Config = spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup;
|
DL_BWP->pdsch_Config = spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup;
|
||||||
DL_BWP->tdaList_Common = bwp_dlcommon->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
DL_BWP->tdaList_Common = bwp_dlcommon->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||||
if (bwp_dlcommon->pdcch_ConfigCommon)
|
configure_ss_coreset(mac,
|
||||||
configure_common_ss(mac, bwp_dlcommon->pdcch_ConfigCommon->choice.setup);
|
bwp_dlcommon->pdcch_ConfigCommon ? bwp_dlcommon->pdcch_ConfigCommon->choice.setup : NULL,
|
||||||
|
spCellConfigDedicated->initialDownlinkBWP->pdcch_Config ? spCellConfigDedicated->initialDownlinkBWP->pdcch_Config->choice.setup : NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UL_BWP->msg3_DeltaPreamble = bwp_ulcommon->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble;
|
UL_BWP->msg3_DeltaPreamble = bwp_ulcommon->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble;
|
||||||
@@ -783,7 +750,6 @@ void nr_rrc_mac_config_req_mcg(module_id_t module_id,
|
|||||||
mac->scheduling_info.retxBSR_SF);
|
mac->scheduling_info.retxBSR_SF);
|
||||||
|
|
||||||
configure_current_BWP(mac, NULL, cell_group_config);
|
configure_current_BWP(mac, NULL, cell_group_config);
|
||||||
config_control_ue(mac);
|
|
||||||
|
|
||||||
RA_config_t *ra = &mac->ra;
|
RA_config_t *ra = &mac->ra;
|
||||||
if (cell_group_config->spCellConfig && cell_group_config->spCellConfig->reconfigurationWithSync) {
|
if (cell_group_config->spCellConfig && cell_group_config->spCellConfig->reconfigurationWithSync) {
|
||||||
@@ -845,7 +811,6 @@ void nr_rrc_mac_config_req_scg(module_id_t module_id,
|
|||||||
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
|
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
|
||||||
}
|
}
|
||||||
configure_current_BWP(mac, NULL, scell_group_config);
|
configure_current_BWP(mac, NULL, scell_group_config);
|
||||||
config_control_ue(mac);
|
|
||||||
// Setup the SSB to Rach Occasions mapping according to the config
|
// Setup the SSB to Rach Occasions mapping according to the config
|
||||||
build_ssb_to_ro_map(mac);
|
build_ssb_to_ro_map(mac);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -409,11 +409,13 @@ typedef struct {
|
|||||||
NR_UE_UL_BWP_t current_UL_BWP;
|
NR_UE_UL_BWP_t current_UL_BWP;
|
||||||
NR_UL_TIME_ALIGNMENT_t ul_time_alignment;
|
NR_UL_TIME_ALIGNMENT_t ul_time_alignment;
|
||||||
|
|
||||||
NR_ControlResourceSet_t *coreset[MAX_NUM_BWP_UE][FAPI_NR_MAX_CORESET_PER_BWP];
|
|
||||||
NR_SearchSpace_t *SSpace[MAX_NUM_BWP_UE][FAPI_NR_MAX_SS];
|
|
||||||
NR_SearchSpace_t *otherSI_SS;
|
NR_SearchSpace_t *otherSI_SS;
|
||||||
NR_SearchSpace_t *ra_SS;
|
NR_SearchSpace_t *ra_SS;
|
||||||
NR_SearchSpace_t *paging_SS;
|
NR_SearchSpace_t *paging_SS;
|
||||||
|
NR_ControlResourceSet_t *BWP_coresets[FAPI_NR_MAX_CORESET_PER_BWP];
|
||||||
|
NR_ControlResourceSet_t *coreset0;
|
||||||
|
NR_SearchSpace_t *BWP_searchspaces[FAPI_NR_MAX_SS];
|
||||||
|
NR_SearchSpace_t *search_space_zero;
|
||||||
|
|
||||||
bool phy_config_request_sent;
|
bool phy_config_request_sent;
|
||||||
frame_type_t frame_type;
|
frame_type_t frame_type;
|
||||||
@@ -467,8 +469,6 @@ typedef struct {
|
|||||||
uint8_t PHR_reporting_active;
|
uint8_t PHR_reporting_active;
|
||||||
|
|
||||||
NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config;
|
NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config;
|
||||||
NR_SearchSpace_t *search_space_zero;
|
|
||||||
NR_ControlResourceSet_t *coreset0;
|
|
||||||
frequency_range_t frequency_range;
|
frequency_range_t frequency_range;
|
||||||
uint16_t nr_band;
|
uint16_t nr_band;
|
||||||
uint8_t ssb_subcarrier_offset;
|
uint8_t ssb_subcarrier_offset;
|
||||||
|
|||||||
@@ -250,11 +250,10 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
|
|||||||
NR_BSR_LONG *long_bsr);
|
NR_BSR_LONG *long_bsr);
|
||||||
|
|
||||||
void config_dci_pdu(NR_UE_MAC_INST_t *mac,
|
void config_dci_pdu(NR_UE_MAC_INST_t *mac,
|
||||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15,
|
|
||||||
fapi_nr_dl_config_request_t *dl_config,
|
fapi_nr_dl_config_request_t *dl_config,
|
||||||
int rnti_type,
|
int rnti_type,
|
||||||
int slot,
|
int slot,
|
||||||
int ss_id);
|
NR_SearchSpace_t *ss);
|
||||||
|
|
||||||
void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, frame_t frame, int slot);
|
void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, frame_t frame, int slot);
|
||||||
|
|
||||||
@@ -429,10 +428,6 @@ void build_ssb_to_ro_map(NR_UE_MAC_INST_t *mac);
|
|||||||
|
|
||||||
void ue_init_config_request(NR_UE_MAC_INST_t *mac, int scs);
|
void ue_init_config_request(NR_UE_MAC_INST_t *mac, int scs);
|
||||||
|
|
||||||
void configure_ss_coreset(NR_UE_MAC_INST_t *mac,
|
|
||||||
NR_ServingCellConfig_t *scd,
|
|
||||||
NR_BWP_Id_t dl_bwp_id);
|
|
||||||
|
|
||||||
static uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
static uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||||
nr_dci_format_t dci_format,
|
nr_dci_format_t dci_format,
|
||||||
uint8_t dci_size,
|
uint8_t dci_size,
|
||||||
|
|||||||
@@ -83,12 +83,26 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NR_ControlResourceSet_t *ue_get_coreset(NR_UE_MAC_INST_t *mac, int coreset_id)
|
||||||
|
{
|
||||||
|
NR_ControlResourceSet_t *coreset = NULL;
|
||||||
|
for (int i = 0; i < FAPI_NR_MAX_CORESET_PER_BWP; i++) {
|
||||||
|
if (mac->BWP_coresets[i] != NULL &&
|
||||||
|
mac->BWP_coresets[i]->controlResourceSetId == coreset_id) {
|
||||||
|
coreset = mac->BWP_coresets[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AssertFatal(coreset, "Couldn't find coreset with id %d\n", coreset_id);
|
||||||
|
return coreset;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void config_dci_pdu(NR_UE_MAC_INST_t *mac,
|
void config_dci_pdu(NR_UE_MAC_INST_t *mac,
|
||||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15,
|
|
||||||
fapi_nr_dl_config_request_t *dl_config,
|
fapi_nr_dl_config_request_t *dl_config,
|
||||||
int rnti_type,
|
int rnti_type,
|
||||||
int slot,
|
int slot,
|
||||||
int ss_id)
|
NR_SearchSpace_t *ss)
|
||||||
{
|
{
|
||||||
|
|
||||||
uint16_t monitoringSymbolsWithinSlot = 0;
|
uint16_t monitoringSymbolsWithinSlot = 0;
|
||||||
@@ -98,33 +112,16 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac,
|
|||||||
NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP;
|
NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP;
|
||||||
NR_BWP_Id_t dl_bwp_id = current_DL_BWP ? current_DL_BWP->bwp_id : 0;
|
NR_BWP_Id_t dl_bwp_id = current_DL_BWP ? current_DL_BWP->bwp_id : 0;
|
||||||
|
|
||||||
NR_SearchSpace_t *ss;
|
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
||||||
|
|
||||||
|
int coreset_id = *ss->controlResourceSetId;
|
||||||
NR_ControlResourceSet_t *coreset;
|
NR_ControlResourceSet_t *coreset;
|
||||||
if(ss_id>=0) {
|
|
||||||
if (rnti_type == NR_RNTI_TC || rnti_type == NR_RNTI_RA) {
|
|
||||||
ss = mac->ra_SS;
|
|
||||||
AssertFatal(mac->ra_SS->searchSpaceId == ss_id,
|
|
||||||
"Search Space id %d does not correspond to the one in ra_ss %ld for RA procedures\n",
|
|
||||||
ss_id, mac->ra_SS->searchSpaceId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ss = mac->SSpace[dl_bwp_id][ss_id-1];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ss = mac->search_space_zero;
|
|
||||||
|
|
||||||
uint8_t coreset_id = *ss->controlResourceSetId;
|
|
||||||
|
|
||||||
if(coreset_id > 0) {
|
if(coreset_id > 0) {
|
||||||
coreset = mac->coreset[dl_bwp_id][coreset_id - 1];
|
coreset = ue_get_coreset(mac, coreset_id);
|
||||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG;
|
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG;
|
||||||
} else {
|
} else {
|
||||||
coreset = mac->coreset0;
|
coreset = mac->coreset0;
|
||||||
if(rnti_type == NR_RNTI_SI) {
|
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
|
||||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
|
|
||||||
} else {
|
|
||||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG_CSET_0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rel15->coreset.duration = coreset->duration;
|
rel15->coreset.duration = coreset->duration;
|
||||||
@@ -293,9 +290,8 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac,
|
|||||||
void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, frame_t frame, int slot) {
|
void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, frame_t frame, int slot) {
|
||||||
|
|
||||||
RA_config_t *ra = &mac->ra;
|
RA_config_t *ra = &mac->ra;
|
||||||
int ss_id;
|
|
||||||
|
|
||||||
uint8_t bwp_id = mac->current_DL_BWP.bwp_id;
|
uint8_t bwp_id = mac->current_DL_BWP.bwp_id;
|
||||||
|
|
||||||
NR_ServingCellConfig_t *scd = mac->cg->spCellConfig->spCellConfigDedicated;
|
NR_ServingCellConfig_t *scd = mac->cg->spCellConfig->spCellConfigDedicated;
|
||||||
NR_BWP_DownlinkDedicated_t *bwpd = bwp_id > 0 ? scd->downlinkBWP_ToAddModList->list.array[bwp_id - 1]->bwp_Dedicated:
|
NR_BWP_DownlinkDedicated_t *bwpd = bwp_id > 0 ? scd->downlinkBWP_ToAddModList->list.array[bwp_id - 1]->bwp_Dedicated:
|
||||||
scd->initialDownlinkBWP;
|
scd->initialDownlinkBWP;
|
||||||
@@ -305,16 +301,14 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
|||||||
|
|
||||||
// loop over all available SS for bwp_id
|
// loop over all available SS for bwp_id
|
||||||
if (bwpd) {
|
if (bwpd) {
|
||||||
for (ss_id = 1; ss_id <= FAPI_NR_MAX_SS; ss_id++){
|
for (int ss_id = 0; ss_id < FAPI_NR_MAX_SS; ss_id++){
|
||||||
|
|
||||||
if(mac->SSpace[bwp_id][ss_id-1]==NULL) {
|
if(mac->BWP_searchspaces[ss_id]==NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_D(NR_MAC, "[DCI_CONFIG] ss_id %d\n",ss_id);
|
LOG_D(NR_MAC, "[DCI_CONFIG] ss_id %d\n",ss_id);
|
||||||
NR_SearchSpace_t *ss = mac->SSpace[bwp_id][ss_id-1];
|
NR_SearchSpace_t *ss = mac->BWP_searchspaces[ss_id];
|
||||||
AssertFatal(ss_id == ss->searchSpaceId,"SS IDs don't correspond\n");
|
|
||||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
|
||||||
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
|
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
|
||||||
struct NR_PhysicalCellGroupConfig *phy_cgc = mac->cg->physicalCellGroupConfig;
|
struct NR_PhysicalCellGroupConfig *phy_cgc = mac->cg->physicalCellGroupConfig;
|
||||||
switch (ss->searchSpaceType->present){
|
switch (ss->searchSpaceType->present){
|
||||||
@@ -329,14 +323,14 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
|||||||
case WAIT_RAR:
|
case WAIT_RAR:
|
||||||
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space (RA-Msg2)\n");
|
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space (RA-Msg2)\n");
|
||||||
if (get_softmodem_params()->sa) {
|
if (get_softmodem_params()->sa) {
|
||||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_RA, slot, -1);
|
config_dci_pdu(mac, dl_config, NR_RNTI_RA, slot, mac->ra_SS);
|
||||||
} else {
|
} else {
|
||||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_RA, slot, ss_id);
|
config_dci_pdu(mac, dl_config, NR_RNTI_RA, slot, ss);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WAIT_CONTENTION_RESOLUTION:
|
case WAIT_CONTENTION_RESOLUTION:
|
||||||
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space (RA-Msg4)\n");
|
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space (RA-Msg4)\n");
|
||||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_TC, slot, -1);
|
config_dci_pdu(mac, dl_config, NR_RNTI_TC, slot, mac->ra_SS);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -404,7 +398,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
|||||||
mac->crnti > 0) {
|
mac->crnti > 0) {
|
||||||
// Monitors DCI 01 and 11 scrambled with C-RNTI, or CS-RNTI(s), or SP-CSI-RNTI
|
// Monitors DCI 01 and 11 scrambled with C-RNTI, or CS-RNTI(s), or SP-CSI-RNTI
|
||||||
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in the user specific search space\n");
|
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in the user specific search space\n");
|
||||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_C, slot, ss_id);
|
config_dci_pdu(mac, dl_config, NR_RNTI_C, slot, ss);
|
||||||
|
|
||||||
//#ifdef DEBUG_DCI
|
//#ifdef DEBUG_DCI
|
||||||
LOG_D(NR_MAC, "[DCI_CONFIG] ss %d ue_Specific %p searchSpaceType->present %d dci_Formats %d\n",
|
LOG_D(NR_MAC, "[DCI_CONFIG] ss %d ue_Specific %p searchSpaceType->present %d dci_Formats %d\n",
|
||||||
|
|||||||
@@ -978,9 +978,8 @@ void nr_ue_dl_scheduler(nr_downlink_indication_t *dl_info)
|
|||||||
if (mac->ra.ra_state >= WAIT_RAR) {
|
if (mac->ra.ra_state >= WAIT_RAR) {
|
||||||
if(mac->ul_time_alignment.ta_apply)
|
if(mac->ul_time_alignment.ta_apply)
|
||||||
schedule_ta_command(dl_config, &mac->ul_time_alignment);
|
schedule_ta_command(dl_config, &mac->ul_time_alignment);
|
||||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
config_dci_pdu(mac, dl_config, mac->ra.ra_state == WAIT_RAR ? NR_RNTI_RA : NR_RNTI_TC , rx_slot, mac->ra_SS);
|
||||||
config_dci_pdu(mac, rel15, dl_config, mac->ra.ra_state == WAIT_RAR ? NR_RNTI_RA : NR_RNTI_TC , rx_slot, mac->ra_SS->searchSpaceId);
|
LOG_D(MAC,"mac->cg %p: Calling fill_scheduled_response for type0_pdcch, num_pdus %d\n", mac->cg, dl_config->number_pdus);
|
||||||
LOG_D(MAC,"mac->cg %p: Calling fill_scheduled_response rnti %x, type0_pdcch, num_pdus %d\n",mac->cg,rel15->rnti,dl_config->number_pdus);
|
|
||||||
fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->phy_data);
|
fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->phy_data);
|
||||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||||
mac->if_module->scheduled_response(&scheduled_response);
|
mac->if_module->scheduled_response(&scheduled_response);
|
||||||
@@ -2622,18 +2621,18 @@ void nr_ue_sib1_scheduler(module_id_t module_idP,
|
|||||||
frame_s = 0; // same frame as ssb
|
frame_s = 0; // same frame as ssb
|
||||||
slot_s = mac->type0_PDCCH_CSS_config.n_c;
|
slot_s = mac->type0_PDCCH_CSS_config.n_c;
|
||||||
}
|
}
|
||||||
fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request[0]; // Take the first dl_config_request for SIB1
|
|
||||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15;
|
|
||||||
|
|
||||||
if(mac->search_space_zero == NULL) mac->search_space_zero=calloc(1,sizeof(*mac->search_space_zero));
|
|
||||||
if(mac->coreset0 == NULL) mac->coreset0 = calloc(1,sizeof(*mac->coreset0));
|
|
||||||
|
|
||||||
|
if(mac->search_space_zero == NULL)
|
||||||
|
mac->search_space_zero=calloc(1,sizeof(*mac->search_space_zero));
|
||||||
|
if(mac->coreset0 == NULL)
|
||||||
|
mac->coreset0 = calloc(1,sizeof(*mac->coreset0));
|
||||||
fill_coresetZero(mac->coreset0, &mac->type0_PDCCH_CSS_config);
|
fill_coresetZero(mac->coreset0, &mac->type0_PDCCH_CSS_config);
|
||||||
fill_searchSpaceZero(mac->search_space_zero, &mac->type0_PDCCH_CSS_config);
|
fill_searchSpaceZero(mac->search_space_zero, &mac->type0_PDCCH_CSS_config);
|
||||||
rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
|
||||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_SI, slot_s, -1);
|
|
||||||
|
|
||||||
LOG_D(MAC,"Calling fill_scheduled_response, type0_pdcch, num_pdus %d\n",dl_config->number_pdus);
|
fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request[0]; // Take the first dl_config_request for SIB1
|
||||||
|
config_dci_pdu(mac, dl_config, NR_RNTI_SI, slot_s, mac->search_space_zero);
|
||||||
|
|
||||||
|
LOG_D(MAC,"Calling fill_scheduled_response, type0_pdcch, num_pdus %d\n", dl_config->number_pdus);
|
||||||
fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, module_idP, cc_id, frame_s, slot_s, phy_data);
|
fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, module_idP, cc_id, frame_s, slot_s, phy_data);
|
||||||
|
|
||||||
if (dl_config->number_pdus) {
|
if (dl_config->number_pdus) {
|
||||||
|
|||||||
Reference in New Issue
Block a user