Merge remote-tracking branch 'origin/NR_UE_SIB1_outside_of_initial_sync' into integration_2023_w30
This commit is contained in:
@@ -109,6 +109,7 @@ typedef struct NRRrcMacBcchDataInd_s {
|
||||
uint32_t sdu_size;
|
||||
uint8_t sdu[BCCH_SDU_SIZE];
|
||||
uint8_t gnb_index;
|
||||
bool is_bch;
|
||||
uint8_t rsrq;
|
||||
uint8_t rsrp;
|
||||
} NRRrcMacBcchDataInd;
|
||||
|
||||
@@ -492,7 +492,6 @@ typedef struct Type0_PDCCH_CSS_config_s {
|
||||
int sfn_c;
|
||||
uint32_t n_c;
|
||||
uint32_t n_0;
|
||||
uint32_t number_of_search_space_per_slot;
|
||||
uint32_t first_symbol_index;
|
||||
uint32_t search_space_duration;
|
||||
uint32_t search_space_frame_period; // in slots
|
||||
|
||||
@@ -4106,8 +4106,8 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
|
||||
int nr_band,
|
||||
uint32_t ssb_index,
|
||||
uint32_t ssb_period,
|
||||
uint32_t ssb_offset_point_a) {
|
||||
|
||||
uint32_t ssb_offset_point_a)
|
||||
{
|
||||
NR_SubcarrierSpacing_t scs_pdcch;
|
||||
|
||||
channel_bandwidth_t min_channel_bw;
|
||||
@@ -4303,7 +4303,6 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
|
||||
float big_m = 0.0f;
|
||||
type0_PDCCH_CSS_config->sfn_c = -1; // only valid for mux=1
|
||||
type0_PDCCH_CSS_config->n_c = UINT_MAX;
|
||||
type0_PDCCH_CSS_config->number_of_search_space_per_slot = UINT_MAX;
|
||||
type0_PDCCH_CSS_config->first_symbol_index = UINT_MAX;
|
||||
type0_PDCCH_CSS_config->search_space_duration = 0; // element of search space
|
||||
// 38.213 table 10.1-1
|
||||
@@ -4311,7 +4310,6 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
|
||||
/// MUX PATTERN 1
|
||||
if(type0_PDCCH_CSS_config->type0_pdcch_ss_mux_pattern == 1 && frequency_range == FR1){
|
||||
big_o = table_38213_13_11_c1[index_4lsb];
|
||||
type0_PDCCH_CSS_config->number_of_search_space_per_slot = table_38213_13_11_c2[index_4lsb];
|
||||
big_m = table_38213_13_11_c3[index_4lsb];
|
||||
|
||||
uint32_t temp = (uint32_t)(big_o*(1<<scs_pdcch)) + (uint32_t)(type0_PDCCH_CSS_config->ssb_index*big_m);
|
||||
@@ -4331,7 +4329,6 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
|
||||
|
||||
if(type0_PDCCH_CSS_config->type0_pdcch_ss_mux_pattern == 1 && frequency_range == FR2){
|
||||
big_o = table_38213_13_12_c1[index_4lsb];
|
||||
type0_PDCCH_CSS_config->number_of_search_space_per_slot = table_38213_13_12_c2[index_4lsb];
|
||||
big_m = table_38213_13_12_c3[index_4lsb];
|
||||
|
||||
uint32_t temp = (uint32_t)(big_o*(1<<scs_pdcch)) + (uint32_t)(type0_PDCCH_CSS_config->ssb_index*big_m);
|
||||
@@ -4448,25 +4445,11 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
|
||||
type0_PDCCH_CSS_config->search_space_frame_period = ssb_period*nr_slots_per_frame[scs_ssb];
|
||||
}
|
||||
|
||||
AssertFatal(type0_PDCCH_CSS_config->number_of_search_space_per_slot!=UINT_MAX,"");
|
||||
|
||||
// uint32_t coreset_duration = num_symbols * number_of_search_space_per_slot;
|
||||
// mac->type0_pdcch_dci_config.number_of_candidates[0] = table_38213_10_1_1_c2[0];
|
||||
// mac->type0_pdcch_dci_config.number_of_candidates[1] = table_38213_10_1_1_c2[1];
|
||||
// mac->type0_pdcch_dci_config.number_of_candidates[2] = table_38213_10_1_1_c2[2]; // CCE aggregation level = 4
|
||||
// mac->type0_pdcch_dci_config.number_of_candidates[3] = table_38213_10_1_1_c2[3]; // CCE aggregation level = 8
|
||||
// mac->type0_pdcch_dci_config.number_of_candidates[4] = table_38213_10_1_1_c2[4]; // CCE aggregation level = 16
|
||||
// mac->type0_pdcch_dci_config.duration = search_space_duration;
|
||||
// mac->type0_pdcch_dci_config.coreset.duration = coreset_duration; // coreset
|
||||
// AssertFatal(first_symbol_index!=UINT_MAX,"");
|
||||
// mac->type0_pdcch_dci_config.monitoring_symbols_within_slot = (0x3fff << first_symbol_index) & (0x3fff >> (14-coreset_duration-first_symbol_index)) & 0x3fff;
|
||||
|
||||
AssertFatal(type0_PDCCH_CSS_config->sfn_c >= 0, "");
|
||||
AssertFatal(type0_PDCCH_CSS_config->n_c != UINT_MAX, "");
|
||||
|
||||
type0_PDCCH_CSS_config->n_0 = ((uint32_t)(big_o*(1<<scs_pdcch)) + (uint32_t)(type0_PDCCH_CSS_config->ssb_index*big_m))%num_slot_per_frame;
|
||||
type0_PDCCH_CSS_config->cset_start_rb = ssb_offset_point_a - type0_PDCCH_CSS_config->rb_offset;
|
||||
|
||||
}
|
||||
|
||||
void fill_coresetZero(NR_ControlResourceSet_t *coreset0, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) {
|
||||
@@ -4522,7 +4505,10 @@ void fill_coresetZero(NR_ControlResourceSet_t *coreset0, NR_Type0_PDCCH_CSS_conf
|
||||
|
||||
}
|
||||
|
||||
void fill_searchSpaceZero(NR_SearchSpace_t *ss0, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) {
|
||||
void fill_searchSpaceZero(NR_SearchSpace_t *ss0,
|
||||
int slots_per_frame,
|
||||
NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config)
|
||||
{
|
||||
|
||||
if(ss0 == NULL) ss0=calloc(1,sizeof(*ss0));
|
||||
if(ss0->controlResourceSetId == NULL) ss0->controlResourceSetId=calloc(1,sizeof(*ss0->controlResourceSetId));
|
||||
@@ -4537,8 +4523,9 @@ void fill_searchSpaceZero(NR_SearchSpace_t *ss0, NR_Type0_PDCCH_CSS_config_t *ty
|
||||
AssertFatal(type0_PDCCH_CSS_config!=NULL,"No type0 CSS configuration\n");
|
||||
|
||||
const uint32_t periodicity = type0_PDCCH_CSS_config->search_space_frame_period;
|
||||
const uint32_t offset = type0_PDCCH_CSS_config->type0_pdcch_ss_mux_pattern == 1
|
||||
? type0_PDCCH_CSS_config->n_0 : type0_PDCCH_CSS_config->n_c;
|
||||
const uint32_t offset = type0_PDCCH_CSS_config->type0_pdcch_ss_mux_pattern == 1 ?
|
||||
type0_PDCCH_CSS_config->n_0 + (slots_per_frame * type0_PDCCH_CSS_config->sfn_c) :
|
||||
type0_PDCCH_CSS_config->n_c;
|
||||
|
||||
ss0->searchSpaceId = 0;
|
||||
*ss0->controlResourceSetId = 0;
|
||||
|
||||
@@ -228,7 +228,9 @@ NR_tda_info_t get_info_from_tda_tables(default_table_type_t table_type,
|
||||
default_table_type_t get_default_table_type(int mux_pattern);
|
||||
|
||||
void fill_coresetZero(NR_ControlResourceSet_t *coreset0, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config);
|
||||
void fill_searchSpaceZero(NR_SearchSpace_t *ss0, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config);
|
||||
void fill_searchSpaceZero(NR_SearchSpace_t *ss0,
|
||||
int slots_per_frame,
|
||||
NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config);
|
||||
|
||||
uint8_t get_pusch_nb_antenna_ports(NR_PUSCH_Config_t *pusch_Config,
|
||||
NR_SRS_Config_t *srs_config,
|
||||
|
||||
@@ -713,6 +713,8 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
|
||||
mac->get_sib1 = true;
|
||||
else if (sched_sib == 2)
|
||||
mac->get_otherSI = true;
|
||||
nr_ue_decode_mib(module_id,
|
||||
cc_idP);
|
||||
}
|
||||
|
||||
void nr_rrc_mac_config_req_sib1(module_id_t module_id,
|
||||
|
||||
@@ -477,6 +477,8 @@ typedef struct {
|
||||
RA_config_t ra;
|
||||
/// SSB index from MIB decoding
|
||||
uint8_t mib_ssb;
|
||||
uint32_t mib_additional_bits;
|
||||
int mib_frame;
|
||||
|
||||
nr_csi_report_t csi_report_template[MAX_CSI_REPORTCONFIG];
|
||||
|
||||
@@ -510,6 +512,7 @@ typedef struct {
|
||||
frequency_range_t frequency_range;
|
||||
uint16_t nr_band;
|
||||
uint8_t ssb_subcarrier_offset;
|
||||
int ssb_start_subcarrier;
|
||||
|
||||
NR_SSB_meas_t ssb_measurements;
|
||||
|
||||
|
||||
@@ -47,27 +47,7 @@ void nr_ue_init_mac(module_id_t module_idP);
|
||||
\param mac mac instance */
|
||||
void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac);
|
||||
|
||||
/**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message
|
||||
\param module_id module id
|
||||
\param cc_id component carrier id
|
||||
\param gNB_index gNB index
|
||||
\param phy_data PHY structure to be filled in by the callee in the FAPI call (L1 caller -> indication to L2 -> FAPI call to L1 callee)
|
||||
\param extra_bits extra bits for frame calculation
|
||||
\param l_ssb_equal_64 check if ssb number of candicate is equal 64, 1=equal; 0=non equal. Reference 38.212 7.1.1
|
||||
\param pduP pointer to pdu
|
||||
\param pdu_length length of pdu
|
||||
\param cell_id cell id */
|
||||
int8_t nr_ue_decode_mib(
|
||||
module_id_t module_id,
|
||||
int cc_id,
|
||||
uint8_t gNB_index,
|
||||
void *phy_data,
|
||||
uint8_t extra_bits,
|
||||
uint32_t ssb_length,
|
||||
uint32_t ssb_index,
|
||||
void *pduP,
|
||||
uint16_t ssb_start_subcarrier,
|
||||
uint16_t cell_id );
|
||||
int8_t nr_ue_decode_mib(module_id_t module_id, int cc_id);
|
||||
|
||||
/**\brief decode SIB1 and other SIs pdus in NR_UE, from if_module dl_ind
|
||||
\param module_id module id
|
||||
@@ -341,16 +321,6 @@ void nr_ue_msg3_scheduler(NR_UE_MAC_INST_t *mac,
|
||||
sub_frame_t current_slot,
|
||||
uint8_t Msg3_tda_id);
|
||||
|
||||
void nr_ue_sib1_scheduler(module_id_t module_idP,
|
||||
int cc_id,
|
||||
uint16_t ssb_start_symbol,
|
||||
uint16_t frame,
|
||||
uint8_t ssb_subcarrier_offset,
|
||||
uint32_t ssb_index,
|
||||
uint16_t ssb_start_subcarrier,
|
||||
frequency_range_t frequency_range,
|
||||
void *phy_data);
|
||||
|
||||
/* \brief Function called by PHY to process the received RAR and check that the preamble matches what was sent by the gNB. It provides the timing advance and t-CRNTI.
|
||||
@param Mod_id Index of UE instance
|
||||
@param CC_id Index to a component carrier
|
||||
|
||||
@@ -425,7 +425,39 @@ bool monitior_dci_for_other_SI(NR_UE_MAC_INST_t *mac,
|
||||
void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, const frame_t frame, const int slot)
|
||||
{
|
||||
const NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP;
|
||||
const int slots_per_frame = nr_slots_per_frame[current_DL_BWP->scs];
|
||||
int scs = mac->get_sib1 ? get_softmodem_params()->numerology : current_DL_BWP->scs;
|
||||
const int slots_per_frame = nr_slots_per_frame[scs];
|
||||
if (mac->get_sib1) {
|
||||
int ssb_sc_offset_norm;
|
||||
if (mac->ssb_subcarrier_offset < 24 && mac->frequency_range == FR1)
|
||||
ssb_sc_offset_norm = mac->ssb_subcarrier_offset >> scs;
|
||||
else
|
||||
ssb_sc_offset_norm = mac->ssb_subcarrier_offset;
|
||||
uint16_t ssb_offset_point_a = (mac->ssb_start_subcarrier - ssb_sc_offset_norm) / 12;
|
||||
int ssb_start_symbol = get_ssb_start_symbol(mac->nr_band, scs, mac->mib_ssb);
|
||||
get_type0_PDCCH_CSS_config_parameters(&mac->type0_PDCCH_CSS_config,
|
||||
mac->mib_frame,
|
||||
mac->mib,
|
||||
slots_per_frame,
|
||||
ssb_sc_offset_norm,
|
||||
ssb_start_symbol,
|
||||
scs,
|
||||
mac->frequency_range,
|
||||
mac->nr_band,
|
||||
mac->mib_ssb,
|
||||
1, // If the UE is not configured with a periodicity, the UE assumes a periodicity of a half frame
|
||||
ssb_offset_point_a);
|
||||
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_searchSpaceZero(mac->search_space_zero, slots_per_frame, &mac->type0_PDCCH_CSS_config);
|
||||
if (is_ss_monitor_occasion(frame, slot, slots_per_frame, mac->search_space_zero)) {
|
||||
LOG_D(NR_MAC, "Monitoring DCI for SIB1 in frame %d slot %d\n", frame, slot);
|
||||
config_dci_pdu(mac, dl_config, NR_RNTI_SI, slot, mac->search_space_zero);
|
||||
}
|
||||
}
|
||||
if (mac->get_otherSI) {
|
||||
// If searchSpaceOtherSystemInformation is set to zero,
|
||||
// PDCCH monitoring occasions for SI message reception in SI-window
|
||||
|
||||
@@ -246,51 +246,36 @@ int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti)
|
||||
|
||||
|
||||
int8_t nr_ue_decode_mib(module_id_t module_id,
|
||||
int cc_id,
|
||||
uint8_t gNB_index,
|
||||
void *phy_data,
|
||||
uint8_t extra_bits, // 8bits 38.212 c7.1.1
|
||||
uint32_t ssb_length,
|
||||
uint32_t ssb_index,
|
||||
void *pduP,
|
||||
uint16_t ssb_start_subcarrier,
|
||||
uint16_t cell_id)
|
||||
int cc_id)
|
||||
{
|
||||
LOG_D(MAC,"[L2][MAC] decode mib\n");
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||
mac->physCellId = cell_id;
|
||||
|
||||
nr_mac_rrc_data_ind_ue(module_id, cc_id, gNB_index, 0, 0, 0, NR_BCCH_BCH, (uint8_t *) pduP, 3); // fixed 3 bytes MIB PDU
|
||||
|
||||
AssertFatal(mac->mib != NULL, "nr_ue_decode_mib() mac->mib == NULL\n");
|
||||
|
||||
uint16_t frame = (mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused);
|
||||
uint16_t frame_number_4lsb = 0;
|
||||
|
||||
for (int i=0; i<4; i++)
|
||||
frame_number_4lsb |= ((extra_bits>>i)&1)<<(3-i);
|
||||
int extra_bits = mac->mib_additional_bits;
|
||||
for (int i = 0; i < 4; i++)
|
||||
frame_number_4lsb |= ((extra_bits >> i) & 1) << (3 - i);
|
||||
|
||||
uint8_t ssb_subcarrier_offset_msb = ( extra_bits >> 5 ) & 0x1; // extra bits[5]
|
||||
uint8_t ssb_subcarrier_offset_msb = (extra_bits >> 5) & 0x1; // extra bits[5]
|
||||
uint8_t ssb_subcarrier_offset = (uint8_t)mac->mib->ssb_SubcarrierOffset;
|
||||
|
||||
frame = frame << 4;
|
||||
frame = frame | frame_number_4lsb;
|
||||
if(ssb_length == 64){
|
||||
mac->frequency_range = FR2;
|
||||
for (int i=0; i<3; i++)
|
||||
ssb_index += (((extra_bits>>(7-i))&0x01)<<(3+i));
|
||||
}else{
|
||||
mac->frequency_range = FR1;
|
||||
if(ssb_subcarrier_offset_msb){
|
||||
mac->mib_frame = frame | frame_number_4lsb;
|
||||
if (mac->frequency_range == FR2) {
|
||||
for (int i = 0; i < 3; i++)
|
||||
mac->mib_ssb += (((extra_bits >> (7 - i)) & 0x01) << (3 + i));
|
||||
} else{
|
||||
if(ssb_subcarrier_offset_msb)
|
||||
ssb_subcarrier_offset = ssb_subcarrier_offset | 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MIB
|
||||
uint8_t half_frame_bit = ( extra_bits >> 4 ) & 0x1; // extra bits[4]
|
||||
uint8_t half_frame_bit = (extra_bits >> 4) & 0x1; // extra bits[4]
|
||||
LOG_I(MAC,"system frame number(6 MSB bits): %d\n", mac->mib->systemFrameNumber.buf[0]);
|
||||
LOG_I(MAC,"system frame number(with LSB): %d\n", (int)frame);
|
||||
LOG_I(MAC,"system frame number(with LSB): %d\n", (int) mac->mib_frame);
|
||||
LOG_I(MAC,"subcarrier spacing (0=15or60, 1=30or120): %d\n", (int)mac->mib->subCarrierSpacingCommon);
|
||||
LOG_I(MAC,"ssb carrier offset(with MSB): %d\n", (int)ssb_subcarrier_offset);
|
||||
LOG_I(MAC,"dmrs type A position (0=pos2,1=pos3): %d\n", (int)mac->mib->dmrs_TypeA_Position);
|
||||
@@ -299,49 +284,13 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
|
||||
LOG_I(MAC,"cell barred (0=barred,1=notBarred): %d\n", (int)mac->mib->cellBarred);
|
||||
LOG_I(MAC,"intra frequency reselection (0=allowed,1=notAllowed): %d\n", (int)mac->mib->intraFreqReselection);
|
||||
LOG_I(MAC,"half frame bit(extra bits): %d\n", (int)half_frame_bit);
|
||||
LOG_I(MAC,"ssb index(extra bits): %d\n", (int)ssb_index);
|
||||
LOG_I(MAC,"ssb index(extra bits): %d\n", (int)mac->mib_ssb);
|
||||
#endif
|
||||
|
||||
//storing ssb index in the mac structure
|
||||
mac->mib_ssb = ssb_index;
|
||||
mac->ssb_subcarrier_offset = ssb_subcarrier_offset;
|
||||
|
||||
uint8_t scs_ssb;
|
||||
uint32_t band;
|
||||
uint16_t ssb_start_symbol;
|
||||
|
||||
if (get_softmodem_params()->sa == 1) {
|
||||
|
||||
scs_ssb = get_softmodem_params()->numerology;
|
||||
band = mac->nr_band;
|
||||
ssb_start_symbol = get_ssb_start_symbol(band,scs_ssb,ssb_index);
|
||||
int ssb_sc_offset_norm;
|
||||
if (ssb_subcarrier_offset<24 && mac->frequency_range == FR1)
|
||||
ssb_sc_offset_norm = ssb_subcarrier_offset>>scs_ssb;
|
||||
else
|
||||
ssb_sc_offset_norm = ssb_subcarrier_offset;
|
||||
|
||||
if (mac->get_sib1) {
|
||||
nr_ue_sib1_scheduler(module_id,
|
||||
cc_id,
|
||||
ssb_start_symbol,
|
||||
frame,
|
||||
ssb_sc_offset_norm,
|
||||
ssb_index,
|
||||
ssb_start_subcarrier,
|
||||
mac->frequency_range,
|
||||
phy_data);
|
||||
mac->first_sync_frame = frame;
|
||||
}
|
||||
}
|
||||
else {
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
scs_ssb = *scc->ssbSubcarrierSpacing;
|
||||
band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
ssb_start_symbol = get_ssb_start_symbol(band,scs_ssb,ssb_index);
|
||||
if (mac->first_sync_frame == -1)
|
||||
mac->first_sync_frame = frame;
|
||||
}
|
||||
if (mac->first_sync_frame == -1)
|
||||
mac->first_sync_frame = frame;
|
||||
|
||||
if(get_softmodem_params()->phy_test)
|
||||
mac->state = UE_CONNECTED;
|
||||
|
||||
@@ -2648,72 +2648,6 @@ static void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_fr
|
||||
} // if is_nr_UL_slot
|
||||
}
|
||||
|
||||
// This function schedules the reception of SIB1 after initial sync and before going to real time state
|
||||
void nr_ue_sib1_scheduler(module_id_t module_idP,
|
||||
int cc_id,
|
||||
uint16_t ssb_start_symbol,
|
||||
uint16_t frame,
|
||||
uint8_t ssb_subcarrier_offset,
|
||||
uint32_t ssb_index,
|
||||
uint16_t ssb_start_subcarrier,
|
||||
frequency_range_t frequency_range,
|
||||
void *phy_data) {
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
|
||||
uint8_t scs_ssb = get_softmodem_params()->numerology;
|
||||
uint16_t ssb_offset_point_a = (ssb_start_subcarrier - ssb_subcarrier_offset)/12;
|
||||
|
||||
get_type0_PDCCH_CSS_config_parameters(&mac->type0_PDCCH_CSS_config,
|
||||
frame,
|
||||
mac->mib,
|
||||
nr_slots_per_frame[scs_ssb],
|
||||
ssb_subcarrier_offset,
|
||||
ssb_start_symbol,
|
||||
scs_ssb,
|
||||
frequency_range,
|
||||
mac->nr_band,
|
||||
ssb_index,
|
||||
1, // If the UE is not configured with a periodicity, the UE assumes a periodicity of a half frame
|
||||
ssb_offset_point_a);
|
||||
|
||||
int frame_s,slot_s;
|
||||
if(mac->type0_PDCCH_CSS_config.type0_pdcch_ss_mux_pattern == 1){
|
||||
// same frame as ssb
|
||||
if ((mac->type0_PDCCH_CSS_config.frame & 0x1) == mac->type0_PDCCH_CSS_config.sfn_c)
|
||||
frame_s = 0;
|
||||
else
|
||||
frame_s = 1;
|
||||
slot_s = mac->type0_PDCCH_CSS_config.n_0;
|
||||
}
|
||||
else{
|
||||
frame_s = 0; // same frame as ssb
|
||||
slot_s = mac->type0_PDCCH_CSS_config.n_c;
|
||||
}
|
||||
|
||||
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_searchSpaceZero(mac->search_space_zero, &mac->type0_PDCCH_CSS_config);
|
||||
|
||||
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);
|
||||
|
||||
if (dl_config->number_pdus) {
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
}
|
||||
else
|
||||
AssertFatal(1==0,"Unable to find aggregation level for type0 CSS\n");
|
||||
}
|
||||
|
||||
|
||||
#define MAX_LCID 8 // NR_MAX_NUM_LCID shall be used but the mac_rlc_data_req function can fetch data for max 8 LCID
|
||||
typedef struct {
|
||||
uint8_t bsr_len;
|
||||
|
||||
@@ -290,8 +290,10 @@ static uint32_t schedule_control_sib1(module_id_t module_id,
|
||||
gNB_mac->sched_ctrlCommon = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon));
|
||||
gNB_mac->sched_ctrlCommon->search_space = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->search_space));
|
||||
gNB_mac->sched_ctrlCommon->coreset = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->coreset));
|
||||
fill_searchSpaceZero(gNB_mac->sched_ctrlCommon->search_space,type0_PDCCH_CSS_config);
|
||||
fill_coresetZero(gNB_mac->sched_ctrlCommon->coreset,type0_PDCCH_CSS_config);
|
||||
fill_searchSpaceZero(gNB_mac->sched_ctrlCommon->search_space,
|
||||
nr_slots_per_frame[*scc->ssbSubcarrierSpacing],
|
||||
type0_PDCCH_CSS_config);
|
||||
fill_coresetZero(gNB_mac->sched_ctrlCommon->coreset, type0_PDCCH_CSS_config);
|
||||
gNB_mac->cset0_bwp_start = type0_PDCCH_CSS_config->cset_start_rb;
|
||||
gNB_mac->cset0_bwp_size = type0_PDCCH_CSS_config->num_rbs;
|
||||
gNB_mac->sched_ctrlCommon->sched_pdcch = set_pdcch_structure(NULL,
|
||||
|
||||
@@ -327,35 +327,37 @@ static void fill_mib_in_rx_ind(nfapi_nr_dl_tti_request_pdu_t *pdu_list, fapi_nr_
|
||||
|
||||
static bool is_my_dci(NR_UE_MAC_INST_t *mac, nfapi_nr_dl_dci_pdu_t *received_pdu)
|
||||
{
|
||||
/* For multiple UEs, we need to be able to filter the rx'd messages by
|
||||
the RNTI. The filtering is different between NSA mode and SA mode.
|
||||
NSA mode has a two step CFRA procedure and SA has a 4 step procedure.
|
||||
We only need to check if the rx'd RNTI doesnt match the CRNTI if the RAR
|
||||
has been processed already, in NSA mode.
|
||||
In SA, depending on the RA state, we can have a SIB (0xffff), RAR (0x10b),
|
||||
Msg3 (TC_RNTI) or an actual DCI message (CRNTI). When we get Msg3, the
|
||||
MAC instance of the UE still has a CRNTI = 0. We should only check if the
|
||||
CRNTI doesnt match the received RNTI in SA mode if Msg3 has been processed
|
||||
already. Only once the RA procedure succeeds is the CRNTI value updated
|
||||
to the TC_RNTI. */
|
||||
if (get_softmodem_params()->nsa)
|
||||
{
|
||||
if (received_pdu->RNTI != mac->crnti &&
|
||||
(received_pdu->RNTI != mac->ra.ra_rnti || mac->ra.RA_RAPID_found))
|
||||
return false;
|
||||
}
|
||||
if (get_softmodem_params()->sa)
|
||||
{
|
||||
if (received_pdu->RNTI != mac->crnti && mac->ra.ra_state == RA_SUCCEEDED)
|
||||
return false;
|
||||
if (received_pdu->RNTI != mac->ra.t_crnti && mac->ra.ra_state == WAIT_CONTENTION_RESOLUTION)
|
||||
return false;
|
||||
if (received_pdu->RNTI != 0x10b && mac->ra.ra_state == WAIT_RAR)
|
||||
return false;
|
||||
if (received_pdu->RNTI != 0xFFFF && mac->ra.ra_state <= GENERATE_PREAMBLE)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
/* For multiple UEs, we need to be able to filter the rx'd messages by
|
||||
the RNTI. The filtering is different between NSA mode and SA mode.
|
||||
NSA mode has a two step CFRA procedure and SA has a 4 step procedure.
|
||||
We only need to check if the rx'd RNTI doesnt match the CRNTI if the RAR
|
||||
has been processed already, in NSA mode.
|
||||
In SA, depending on the RA state, we can have a SIB (0xffff), RAR (0x10b),
|
||||
Msg3 (TC_RNTI) or an actual DCI message (CRNTI). When we get Msg3, the
|
||||
MAC instance of the UE still has a CRNTI = 0. We should only check if the
|
||||
CRNTI doesnt match the received RNTI in SA mode if Msg3 has been processed
|
||||
already. Only once the RA procedure succeeds is the CRNTI value updated
|
||||
to the TC_RNTI. */
|
||||
if (get_softmodem_params()->nsa) {
|
||||
if (received_pdu->RNTI != mac->crnti &&
|
||||
(received_pdu->RNTI != mac->ra.ra_rnti || mac->ra.RA_RAPID_found))
|
||||
return false;
|
||||
}
|
||||
if (get_softmodem_params()->sa) {
|
||||
if (mac->state == UE_NOT_SYNC)
|
||||
return false;
|
||||
if (received_pdu->RNTI == 0xFFFF && mac->scc_SIB)
|
||||
return false;
|
||||
if (received_pdu->RNTI != mac->crnti && mac->ra.ra_state == RA_SUCCEEDED)
|
||||
return false;
|
||||
if (received_pdu->RNTI != mac->ra.t_crnti && mac->ra.ra_state == WAIT_CONTENTION_RESOLUTION)
|
||||
return false;
|
||||
if (received_pdu->RNTI != 0x10b && mac->ra.ra_state == WAIT_RAR)
|
||||
return false;
|
||||
if (received_pdu->RNTI != 0xFFFF && mac->ra.ra_state <= GENERATE_PREAMBLE)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_nr_dl_tti_request_t *dl_tti_request)
|
||||
@@ -1037,19 +1039,18 @@ int handle_bcch_bch(module_id_t module_id, int cc_id,
|
||||
unsigned int gNB_index, void *phy_data, uint8_t *pduP,
|
||||
unsigned int additional_bits,
|
||||
uint32_t ssb_index, uint32_t ssb_length,
|
||||
uint16_t ssb_start_subcarrier, uint16_t cell_id){
|
||||
|
||||
return nr_ue_decode_mib(module_id,
|
||||
cc_id,
|
||||
gNB_index,
|
||||
phy_data,
|
||||
additional_bits,
|
||||
ssb_length, // Lssb = 64 is not support
|
||||
ssb_index,
|
||||
pduP,
|
||||
ssb_start_subcarrier,
|
||||
cell_id);
|
||||
|
||||
uint16_t ssb_start_subcarrier, uint16_t cell_id)
|
||||
{
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||
mac->mib_ssb = ssb_index;
|
||||
mac->physCellId = cell_id;
|
||||
mac->mib_additional_bits = additional_bits;
|
||||
if(ssb_length == 64)
|
||||
mac->frequency_range = FR2;
|
||||
else
|
||||
mac->frequency_range = FR1;
|
||||
nr_mac_rrc_data_ind_ue(module_id, cc_id, gNB_index, 0, 0, 0, NR_BCCH_BCH, (uint8_t *) pduP, 3); // fixed 3 bytes MIB PDU
|
||||
return 0;
|
||||
}
|
||||
|
||||
// L2 Abstraction Layer
|
||||
@@ -1149,11 +1150,9 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info)
|
||||
uint32_t ret_mask = 0x0;
|
||||
module_id_t module_id = dl_info->module_id;
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||
|
||||
if ((!dl_info->dci_ind && !dl_info->rx_ind)) {
|
||||
// UL indication to schedule DCI reception
|
||||
if (mac->phy_config_request_sent)
|
||||
nr_ue_dl_scheduler(dl_info);
|
||||
nr_ue_dl_scheduler(dl_info);
|
||||
} else {
|
||||
// UL indication after reception of DCI or DL PDU
|
||||
if (dl_info && dl_info->dci_ind && dl_info->dci_ind->number_of_dcis) {
|
||||
|
||||
@@ -61,11 +61,8 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
{
|
||||
sdu_size_t sdu_size = 0;
|
||||
|
||||
switch(channel){
|
||||
switch(channel) {
|
||||
case NR_BCCH_BCH:
|
||||
AssertFatal(nr_rrc_ue_decode_NR_BCCH_BCH_Message(module_id, gNB_index, (uint8_t*)pduP, pdu_len) == 0, "UE decode BCCH-BCH error!\n");
|
||||
break;
|
||||
|
||||
case NR_BCCH_DL_SCH:
|
||||
if (pdu_len>0) {
|
||||
LOG_T(NR_RRC, "[UE %d] Received SDU for NR-BCCH-DL-SCH on SRB %u from gNB %d\n", module_id, channel & RAB_OFFSET,
|
||||
@@ -88,6 +85,7 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
NR_RRC_MAC_BCCH_DATA_IND (message_p).slot = slot;
|
||||
NR_RRC_MAC_BCCH_DATA_IND (message_p).sdu_size = sdu_size;
|
||||
NR_RRC_MAC_BCCH_DATA_IND (message_p).gnb_index = gNB_index;
|
||||
NR_RRC_MAC_BCCH_DATA_IND (message_p).is_bch = (channel == NR_BCCH_BCH);
|
||||
itti_send_msg_to_task(TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE(module_id), message_p);
|
||||
}
|
||||
break;
|
||||
|
||||
+19
-10
@@ -547,6 +547,8 @@ bool check_si_validity(NR_UE_RRC_SI_INFO *SI_info, int si_type)
|
||||
|
||||
int check_si_status(NR_UE_RRC_SI_INFO *SI_info)
|
||||
{
|
||||
if (!get_softmodem_params()->sa)
|
||||
return 0;
|
||||
// schedule reception of SIB1 if RRC doesn't have it
|
||||
if (!SI_info->sib1)
|
||||
return 1;
|
||||
@@ -2046,15 +2048,22 @@ void *rrc_nrue_task(void *args_p)
|
||||
break;
|
||||
|
||||
case NR_RRC_MAC_BCCH_DATA_IND:
|
||||
LOG_D(NR_RRC, "[UE %d] Received %s: frameP %d, gNB %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p),
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).frame, NR_RRC_MAC_BCCH_DATA_IND (msg_p).gnb_index);
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NOT_A_RNTI, NR_RRC_MAC_BCCH_DATA_IND (msg_p).frame, 0,NR_RRC_MAC_BCCH_DATA_IND (msg_p).gnb_index);
|
||||
nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message (ctxt.module_id,
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).gnb_index,
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).sdu,
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).sdu_size,
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).rsrq,
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).rsrp);
|
||||
LOG_D(NR_RRC, "[UE %d] Received %s: gNB %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p),
|
||||
NR_RRC_MAC_BCCH_DATA_IND (msg_p).gnb_index);
|
||||
NRRrcMacBcchDataInd *bcch = &NR_RRC_MAC_BCCH_DATA_IND (msg_p);
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NOT_A_RNTI, bcch->frame, 0, bcch->gnb_index);
|
||||
if (bcch->is_bch)
|
||||
nr_rrc_ue_decode_NR_BCCH_BCH_Message(ue_mod_id,
|
||||
bcch->gnb_index,
|
||||
bcch->sdu,
|
||||
bcch->sdu_size);
|
||||
else
|
||||
nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(ctxt.module_id,
|
||||
bcch->gnb_index,
|
||||
bcch->sdu,
|
||||
bcch->sdu_size,
|
||||
bcch->rsrq,
|
||||
bcch->rsrp);
|
||||
break;
|
||||
|
||||
case NR_RRC_MAC_CCCH_DATA_IND:
|
||||
@@ -2144,7 +2153,7 @@ void *rrc_nrue_task(void *args_p)
|
||||
break;
|
||||
}
|
||||
LOG_D(NR_RRC, "[UE %d] RRC Status %d\n", ue_mod_id, nr_rrc_get_state(ue_mod_id));
|
||||
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
msg_p = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user