Commit 0f98cad8 authored by Raymond Knopp's avatar Raymond Knopp

UE Configuration after SIB1 ok, RAR configuraiton/reception ok, Msg3...

UE Configuration after SIB1 ok, RAR configuraiton/reception ok, Msg3 transmission / reception ok, CU fails when needing to at SRB1
parent 9be7c35f
......@@ -265,9 +265,11 @@ int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config){
fapi_nr_config_request_t *nrUE_config = &PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->nrUE_config;
if(phy_config != NULL)
if(phy_config != NULL) {
memcpy(nrUE_config,&phy_config->config_req,sizeof(fapi_nr_config_request_t));
if (PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->UE_mode[0] == NOT_SYNCHED)
PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->UE_mode[0] = PRACH;
}
return 0;
}
......
......@@ -276,14 +276,12 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
}
if (get_softmodem_params()->usim_test==0) {
LOG_D(PHY, "Generating PUCCH\n");
pucch_procedures_ue_nr(ue,
gNB_id,
proc,
FALSE);
}
LOG_D(PHY, "Sending Uplink data \n");
nr_ue_pusch_common_procedures(ue,
slot_tx,
&ue->frame_parms,1);
......@@ -2065,9 +2063,9 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
} else {
LOG_I(PHY, "In %s:[%d.%d] getting PRACH resources\n", __FUNCTION__, frame_tx, nr_slot_tx);
nr_prach = nr_ue_get_rach(prach_resources, &ue->prach_vars[0]->prach_pdu, mod_id, ue->CC_id, frame_tx, gNB_id, nr_slot_tx);
nr_prach = nr_ue_get_rach(prach_resources, &ue->prach_vars[0]->prach_pdu, mod_id, ue->CC_id, frame_tx, gNB_id, nr_slot_tx);
LOG_I(PHY, "In %s:[%d.%d] getting PRACH resources : %d\n", __FUNCTION__, frame_tx, nr_slot_tx,nr_prach);
}
if (nr_prach == GENERATE_PREAMBLE) {
......
......@@ -236,6 +236,8 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
/* update current context */
if (!mac->cg) return(TRUE);
int subframe_number = proc->nr_slot_rx / ue->frame_parms.slots_per_subframe;
nb_pucch_format_4_in_subframes[subframe_number] = 0; /* reset pucch format 4 counter at current rx position */
......
......@@ -1026,12 +1026,12 @@ int get_format0(uint8_t index,
return format;
}
int64_t *get_prach_config_info(uint32_t pointa,
int64_t *get_prach_config_info(int fr2_flag,
uint8_t index,
uint8_t unpaired) {
int64_t *prach_config_info_p;
if (pointa > 2016666) { //FR2
if (fr2_flag > 0) { //FR2
prach_config_info_p = table_6_3_3_2_4_prachConfig_Index[index];
}
else { // FR1
......@@ -2328,7 +2328,7 @@ uint8_t get_transformPrecoding(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
}
}
if (rnti_type != NR_RNTI_RA) {
if (rnti_type != NR_RNTI_RA && rnti_type != NR_RNTI_TC) {
if (*dci_format != NR_UL_DCI_FORMAT_0_0) {
if (pusch_config->transformPrecoder != NULL) {
return *pusch_config->transformPrecoder;
......
......@@ -113,7 +113,7 @@ int ul_ant_bits(NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig,long transformPreco
int get_format0(uint8_t index, uint8_t unpaired,frequency_range_t);
int64_t *get_prach_config_info(uint32_t pointa,
int64_t *get_prach_config_info(int fr2_flag,
uint8_t index,
uint8_t unpaired);
......
......@@ -476,10 +476,6 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
}
}
/** \brief This function performs some configuration routines according to clause 12 "Bandwidth part operation" 3GPP TS 38.213 version 16.3.0 Release 16
......@@ -709,6 +705,14 @@ int nr_rrc_mac_config_req_ue(
mac->scc_SIB=sccP;
LOG_I(MAC,"Keeping ServingCellConfigCommonSIB\n");
config_common_ue(mac,module_id,cc_idP);
int num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0) num_slots_ul++;
LOG_I(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul);
mac->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t));
// Setup the SSB to Rach Occasions mapping according to the config
build_ssb_to_ro_map(mac);//->scc, mac->phy_config.config_req.cell_config.frame_duplex_type);
mac->if_module->phy_config_request(&mac->phy_config);
mac->common_configuration_complete = 1;
}
if(scell_group_config != NULL ){
mac->cg = cell_group_config;
......@@ -726,7 +730,7 @@ int nr_rrc_mac_config_req_ue(
}
// Setup the SSB to Rach Occasions mapping according to the config
build_ssb_to_ro_map(mac->scc, mac->phy_config.config_req.cell_config.frame_duplex_type);
build_ssb_to_ro_map(mac);
}
else if (cell_group_config != NULL ){
mac->cg = cell_group_config;
......
......@@ -321,6 +321,7 @@ typedef struct {
NR_CSI_ReportConfig_t *csirc;
long physCellId;
//// MAC config
int common_configuration_complete;
NR_DRX_Config_t *drx_Config;
NR_SchedulingRequestConfig_t *schedulingRequestConfig;
NR_BSR_Config_t *bsr_Config;
......
......@@ -302,7 +302,7 @@ void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu,
uint8_t *nb_dmrs_re_per_rb,
uint16_t *number_dmrs_symbols);
void build_ssb_to_ro_map(NR_ServingCellConfigCommon_t *scc, uint8_t unpaired);
void build_ssb_to_ro_map(NR_UE_MAC_INST_t *mac);
void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint16_t *bwp_ind, uint8_t *dci_format);
......
......@@ -225,7 +225,7 @@ long nr_get_Pcmax(module_id_t mod_id){
delta_MPR_c = 0.5;
}
if (mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->ext1){
if (mac->cg && mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->ext1){
if (*mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->ext1->powerBoostPi2BPSK == 1){
// TbD: assuming power class 3 capable UE operating in TDD bands n40, n41, n77, n78, and n79 with Pi/2 BPSK modulation
delta_P_powerclass = -3;
......
......@@ -63,7 +63,7 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
//#define ENABLE_MAC_PAYLOAD_DEBUG 1
//#define DEBUG_EXTRACT_DCI
#define DEBUG_EXTRACT_DCI
//#define DEBUG_RAR
int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti){
......@@ -365,6 +365,8 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList->choice.setup;
else if (mac->DLbwp[0] && mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList)
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
else if (mac->scc_SIB && mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup)
pdsch_TimeDomainAllocationList = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
if (pdsch_TimeDomainAllocationList) {
if (time_domain_ind >= pdsch_TimeDomainAllocationList->list.count) {
......@@ -650,10 +652,16 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
}
if( (ra->RA_window_cnt >= 0 && rnti == ra->ra_rnti) || (rnti == ra->t_crnti) ) {
dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
if (get_softmodem_params()->sa) {
if (mac->scc == NULL) {
dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
}
else {
dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NULL;
}
if (get_softmodem_params()->sa) {
} else { // NSA mode is not using the Initial BWP
dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
if(pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition == NULL)
......@@ -1161,6 +1169,10 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
case NR_DL_DCI_FORMAT_1_0:
switch(rnti_type) {
case NR_RNTI_RA:
// check BWP id
if (mac->cg) N_RB=NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
else N_RB=NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
// Freq domain assignment
fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
pos=fsize;
......@@ -1205,6 +1217,11 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
#ifdef DEBUG_EXTRACT_DCI
LOG_D(MAC,"Format indicator %d (%d bits) N_RB_BWP %d => %d (0x%lx)\n",dci_pdu_rel15->format_indicator,1,N_RB,dci_size-pos,*dci_pdu);
#endif
// check BWP id
if (mac->cg) N_RB=NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
else N_RB=NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
// Freq domain assignment (275rb >> fsize = 16)
fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
pos+=fsize;
......@@ -1384,6 +1401,10 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
case NR_RNTI_TC:
// check BWP id
if (mac->cg) N_RB=NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
else N_RB=NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
// indicating a DL DCI format - 1 bit
pos++;
dci_pdu_rel15->format_indicator = (*dci_pdu>>(dci_size-pos))&1;
......
This diff is collapsed.
......@@ -930,7 +930,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
const int startSymbolAndLength = bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[time_domain_assignment]->startSymbolAndLength;
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
AssertFatal(startSymbolIndex >= 0, "StartSymbolIndex is negative\n");
LOG_D(MAC,"Msg2 startSymbolIndex.nrOfSymbols %d.%d\n",startSymbolIndex,nrOfSymbols);
if (nrOfSymbols == 2) {
nr_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData = 1;
} else {
......@@ -1042,6 +1042,9 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
dci_payload.frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0(pdsch_pdu_rel15->rbSize,
pdsch_pdu_rel15->rbStart,
pdsch_pdu_rel15->BWPSize);
LOG_D(MAC,"Msg2 rbSize.rbStart.BWPsize %d.%d.%d\n",pdsch_pdu_rel15->rbSize,
pdsch_pdu_rel15->rbStart,
pdsch_pdu_rel15->BWPSize);
dci_payload.time_domain_assignment.val = time_domain_assignment;
dci_payload.vrb_to_prb_mapping.val = 0;
......
......@@ -92,7 +92,8 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon = mac->scc != NULL ? mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon;
if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && get_softmodem_params()->do_ra)
if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) /*&& get_softmodem_params()->do_ra*/)
nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id);
switch(ret){
......
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