Merge branch 'develop' of https://gitlab.eurecom.fr/oai/openairinterface5g into noCore
This commit is contained in:
@@ -947,6 +947,24 @@ int get_format0(uint8_t index,
|
||||
return format;
|
||||
}
|
||||
|
||||
int64_t *get_prach_config_info(uint32_t pointa,
|
||||
uint8_t index,
|
||||
uint8_t unpaired) {
|
||||
int64_t *prach_config_info_p;
|
||||
|
||||
if (pointa > 2016666) { //FR2
|
||||
prach_config_info_p = table_6_3_3_2_4_prachConfig_Index[index];
|
||||
}
|
||||
else { // FR1
|
||||
if (unpaired)
|
||||
prach_config_info_p = table_6_3_3_2_3_prachConfig_Index[index];
|
||||
else
|
||||
prach_config_info_p = table_6_3_3_2_2_prachConfig_Index[index];
|
||||
} // FR2 / FR1
|
||||
|
||||
return prach_config_info_p;
|
||||
}
|
||||
|
||||
void find_monitoring_periodicity_offset_common(NR_SearchSpace_t *ss,
|
||||
uint16_t *slot_period,
|
||||
uint16_t *offset) {
|
||||
|
||||
@@ -36,6 +36,36 @@
|
||||
#include "NR_CellGroupConfig.h"
|
||||
#include "nr_mac.h"
|
||||
|
||||
|
||||
// ===============================================
|
||||
// SSB to RO mapping public defines and structures
|
||||
// ===============================================
|
||||
#define MAX_SSB_PER_RO (16) // Maximum number of SSBs that can be mapped to a single RO
|
||||
#define MAX_TDM (7) // Maximum nb of PRACH occasions TDMed in a slot
|
||||
#define MAX_FDM (8) // Maximum nb of PRACH occasions FDMed in a slot
|
||||
|
||||
// PRACH occasion details
|
||||
typedef struct prach_occasion_info {
|
||||
uint8_t start_symbol; // 0 - 13 (14 symbols in a slot)
|
||||
uint8_t fdm; // 0-7 (possible values of msg1-FDM: 1, 2, 4 or 8)
|
||||
uint8_t slot; // 0 - 159 (maximum number of slots in a 10ms frame - @ 240kHz)
|
||||
uint8_t frame; // 0 - 15 (maximum number of frames in a 160ms association pattern)
|
||||
uint8_t mapped_ssb_idx[MAX_SSB_PER_RO]; // List of mapped SSBs
|
||||
uint8_t nb_mapped_ssb;
|
||||
uint16_t format; // RO preamble format
|
||||
} prach_occasion_info_t;
|
||||
|
||||
// PRACH occasion slot details
|
||||
// A PRACH occasion slot is a series of PRACH occasions in time (symbols) and frequency
|
||||
typedef struct prach_occasion_slot {
|
||||
prach_occasion_info_t prach_occasion[MAX_TDM][MAX_FDM]; // Starting symbol of each PRACH occasions in a slot
|
||||
uint8_t nb_of_prach_occasion_in_time;
|
||||
uint8_t nb_of_prach_occasion_in_freq;
|
||||
} prach_occasion_slot_t;
|
||||
|
||||
// ========================================
|
||||
|
||||
|
||||
typedef enum {
|
||||
NR_DL_DCI_FORMAT_1_0 = 0,
|
||||
NR_DL_DCI_FORMAT_1_1,
|
||||
@@ -133,6 +163,10 @@ int ul_ant_bits(NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig,long transformPreco
|
||||
|
||||
int get_format0(uint8_t index, uint8_t unpaired);
|
||||
|
||||
int64_t *get_prach_config_info(uint32_t pointa,
|
||||
uint8_t index,
|
||||
uint8_t unpaired);
|
||||
|
||||
uint16_t get_NCS(uint8_t index, uint16_t format, uint8_t restricted_set_config);
|
||||
|
||||
int get_num_dmrs(uint16_t dmrs_mask );
|
||||
|
||||
@@ -204,7 +204,7 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
uint16_t band;
|
||||
int32_t offset;
|
||||
|
||||
get_band((cfg->carrier_config.dl_frequency)*1000,
|
||||
get_band((uint64_t)(cfg->carrier_config.dl_frequency)*1000,
|
||||
&band,
|
||||
&offset,
|
||||
&frame_type);
|
||||
@@ -243,8 +243,8 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask = 0;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask = 0;
|
||||
for (i=0; i<4; i++) {
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i+4]<<i*8);
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i]<<i*8);
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i]<<i*8);
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i+4]<<i*8);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -433,6 +433,9 @@ int nr_rrc_mac_config_req_ue(
|
||||
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
/*
|
||||
if(mac_cell_group_configP != NULL){
|
||||
if(mac_cell_group_configP->drx_Config != NULL ){
|
||||
|
||||
@@ -267,6 +267,7 @@ andom-access to transmit a BSR along with the C-RNTI control element (see 5.1.4
|
||||
@param nr_tti_tx slot for PRACH transmission
|
||||
@returns indication to generate PRACH to phy */
|
||||
uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
fapi_nr_ul_config_prach_pdu *prach_pdu,
|
||||
module_id_t mod_id,
|
||||
int CC_id,
|
||||
UE_MODE_t UE_mode,
|
||||
@@ -278,15 +279,14 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
@param module_idP Index of UE instance
|
||||
@param CC_id Component Carrier Index
|
||||
@param gNB_index gNB index
|
||||
@param t_id
|
||||
@param rach_ConfigDedicated
|
||||
@returns void */
|
||||
void nr_get_prach_resources(module_id_t mod_id,
|
||||
int CC_id,
|
||||
uint8_t gNB_id,
|
||||
uint8_t t_id,
|
||||
uint8_t first_Msg3,
|
||||
NR_PRACH_RESOURCES_t *prach_resources,
|
||||
fapi_nr_ul_config_prach_pdu *prach_pdu,
|
||||
NR_RACH_ConfigDedicated_t * rach_ConfigDedicated);
|
||||
|
||||
void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id);
|
||||
@@ -305,5 +305,8 @@ 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);
|
||||
|
||||
|
||||
#endif
|
||||
/** @}*/
|
||||
|
||||
@@ -75,9 +75,9 @@ void nr_get_RA_window(NR_UE_MAC_INST_t *mac);
|
||||
void nr_get_prach_resources(module_id_t mod_id,
|
||||
int CC_id,
|
||||
uint8_t gNB_id,
|
||||
uint8_t t_id,
|
||||
uint8_t first_Msg3,
|
||||
NR_PRACH_RESOURCES_t *prach_resources,
|
||||
fapi_nr_ul_config_prach_pdu *prach_pdu,
|
||||
NR_RACH_ConfigDedicated_t * rach_ConfigDedicated){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
@@ -87,8 +87,8 @@ void nr_get_prach_resources(module_id_t mod_id,
|
||||
|
||||
// NR_BeamFailureRecoveryConfig_t *beam_failure_recovery_config = &mac->RA_BeamFailureRecoveryConfig; // todo
|
||||
|
||||
int messagePowerOffsetGroupB = 0, messageSizeGroupA, PLThreshold, sizeOfRA_PreamblesGroupA = 0, numberOfRA_Preambles, i, deltaPreamble_Msg3 = 0;
|
||||
uint8_t noGroupB = 0, s_id, f_id, ul_carrier_id, prach_ConfigIndex, SFN_nbr, Msg3_size;
|
||||
int messagePowerOffsetGroupB = 0, messageSizeGroupA, PLThreshold, sizeOfRA_PreamblesGroupA = 0, numberOfRA_Preambles, deltaPreamble_Msg3 = 0;
|
||||
uint8_t noGroupB = 0, s_id, t_id, f_id, ul_carrier_id, Msg3_size;
|
||||
|
||||
AssertFatal(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup != NULL, "[UE %d] FATAL nr_rach_ConfigCommon is NULL !!!\n", mod_id);
|
||||
nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
@@ -100,6 +100,7 @@ void nr_get_prach_resources(module_id_t mod_id,
|
||||
//////////* UE Random Access Resource Selection *//////////
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// todo:
|
||||
// - switch initialisation cases
|
||||
// -- RA initiated by beam failure recovery operation (subclause 5.17 TS 38.321)
|
||||
@@ -129,12 +130,81 @@ void nr_get_prach_resources(module_id_t mod_id,
|
||||
|
||||
// rsrp_ThresholdSSB = *nr_rach_ConfigCommon->rsrp_ThresholdSSB;
|
||||
|
||||
// Determine the SSB to RACH mapping ratio
|
||||
// =======================================
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR ssb_perRACH_config = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present;
|
||||
boolean_t multiple_ssb_per_ro; // true if more than one or exactly one SSB per RACH occasion, false if more than one RO per SSB
|
||||
uint8_t ssb_rach_ratio; // Nb of SSBs per RACH or RACHs per SSB
|
||||
long cb_preambles_per_ssb; // Nb of preambles per SSB
|
||||
int total_preambles_per_ssb;
|
||||
int starting_preamble_nb = 0;
|
||||
uint8_t ssb_nb_in_ro;
|
||||
|
||||
switch (ssb_perRACH_config){
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 8;
|
||||
cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneEighth + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 4;
|
||||
cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneFourth + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 2;
|
||||
cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneHalf + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 1;
|
||||
cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 2;
|
||||
cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.two + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 4;
|
||||
cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.four;
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 8;
|
||||
cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.eight;
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 16;
|
||||
cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.sixteen;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Unsupported ssb_perRACH_config %d\n", ssb_perRACH_config);
|
||||
break;
|
||||
}
|
||||
|
||||
Msg3_size = mac->RA_Msg3_size;
|
||||
|
||||
numberOfRA_Preambles = 64;
|
||||
if(nr_rach_ConfigCommon->totalNumberOfRA_Preambles != NULL)
|
||||
numberOfRA_Preambles = *(nr_rach_ConfigCommon->totalNumberOfRA_Preambles);
|
||||
|
||||
// Compute the proper Preamble selection params according to the selected SSB and the ssb_perRACH_OccasionAndCB_PreamblesPerSSB configuration
|
||||
if ((true == multiple_ssb_per_ro) &&
|
||||
(ssb_rach_ratio > 1)) {
|
||||
total_preambles_per_ssb = numberOfRA_Preambles / ssb_rach_ratio;
|
||||
|
||||
ssb_nb_in_ro = prach_pdu->ssb_nb_in_ro;
|
||||
starting_preamble_nb = total_preambles_per_ssb * ssb_nb_in_ro;
|
||||
}
|
||||
else {
|
||||
total_preambles_per_ssb = numberOfRA_Preambles;
|
||||
starting_preamble_nb = 0;
|
||||
}
|
||||
|
||||
if (!nr_rach_ConfigCommon->groupBconfigured) {
|
||||
noGroupB = 1;
|
||||
} else {
|
||||
@@ -220,29 +290,30 @@ void nr_get_prach_resources(module_id_t mod_id,
|
||||
if (first_Msg3 == 1) {
|
||||
if (noGroupB == 1) {
|
||||
// use Group A preamble
|
||||
prach_resources->ra_PreambleIndex = (taus()) % numberOfRA_Preambles;
|
||||
prach_resources->ra_PreambleIndex = starting_preamble_nb + ((taus()) % cb_preambles_per_ssb);
|
||||
mac->RA_usedGroupA = 1;
|
||||
} else if ((Msg3_size < messageSizeGroupA) && (get_nr_PL(mod_id, CC_id, gNB_id) > PLThreshold)) {
|
||||
// Group B is configured and RA preamble Group A is used
|
||||
// - todo add condition on CCCH_sdu_size for initiation by CCCH
|
||||
prach_resources->ra_PreambleIndex = (taus()) % sizeOfRA_PreamblesGroupA;
|
||||
prach_resources->ra_PreambleIndex = starting_preamble_nb + ((taus()) % sizeOfRA_PreamblesGroupA);
|
||||
mac->RA_usedGroupA = 1;
|
||||
} else {
|
||||
// Group B preamble is configured and used
|
||||
// the first sizeOfRA_PreamblesGroupA RA preambles belong to RA Preambles Group A
|
||||
// the remaining belong to RA Preambles Group B
|
||||
prach_resources->ra_PreambleIndex = sizeOfRA_PreamblesGroupA + (taus()) % (numberOfRA_Preambles - sizeOfRA_PreamblesGroupA);
|
||||
prach_resources->ra_PreambleIndex = starting_preamble_nb + sizeOfRA_PreamblesGroupA + ((taus()) % (cb_preambles_per_ssb - sizeOfRA_PreamblesGroupA));
|
||||
mac->RA_usedGroupA = 0;
|
||||
}
|
||||
} else { // Msg3 is being retransmitted
|
||||
if (mac->RA_usedGroupA == 1 && noGroupB == 1) {
|
||||
prach_resources->ra_PreambleIndex = (taus()) % numberOfRA_Preambles;
|
||||
prach_resources->ra_PreambleIndex = starting_preamble_nb + ((taus()) % cb_preambles_per_ssb);
|
||||
} else if (mac->RA_usedGroupA == 1 && noGroupB == 0){
|
||||
prach_resources->ra_PreambleIndex = (taus()) % sizeOfRA_PreamblesGroupA;
|
||||
prach_resources->ra_PreambleIndex = starting_preamble_nb + ((taus()) % sizeOfRA_PreamblesGroupA);
|
||||
} else {
|
||||
prach_resources->ra_PreambleIndex = sizeOfRA_PreamblesGroupA + (taus()) % (numberOfRA_Preambles - sizeOfRA_PreamblesGroupA);
|
||||
prach_resources->ra_PreambleIndex = starting_preamble_nb + sizeOfRA_PreamblesGroupA + ((taus()) % (cb_preambles_per_ssb - sizeOfRA_PreamblesGroupA));
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(MAC, "[RAPROC] - Selected RA preamble index %d for contention-based random access procedure... \n", prach_resources->ra_PreambleIndex);
|
||||
}
|
||||
|
||||
@@ -268,27 +339,16 @@ void nr_get_prach_resources(module_id_t mod_id,
|
||||
// 1) this does not apply to contention-free RA Preamble for beam failure recovery request
|
||||
// 2) getting star_symb, SFN_nbr from table 6.3.3.2-3 (TDD and FR1 scenario)
|
||||
|
||||
prach_ConfigIndex = rach_ConfigGeneric->prach_ConfigurationIndex;
|
||||
|
||||
// ra_RNTI computation
|
||||
// - todo: this is for TDD FR1 only
|
||||
// - ul_carrier_id: UL carrier used for RA preamble transmission, hardcoded for NUL carrier
|
||||
// - f_id: index of the PRACH occasion in the frequency domain
|
||||
// - s_id is starting symbol of the PRACH occasion [0...14]
|
||||
// - t_id is the first slot of the PRACH occasion in a system frame [0...80]
|
||||
|
||||
ul_carrier_id = 0; // NUL
|
||||
f_id = rach_ConfigGeneric->msg1_FrequencyStart;
|
||||
SFN_nbr = table_6_3_3_2_3_prachConfig_Index[prach_ConfigIndex][4];
|
||||
s_id = table_6_3_3_2_3_prachConfig_Index[prach_ConfigIndex][5];
|
||||
f_id = prach_pdu->num_ra;
|
||||
t_id = prach_pdu->prach_slot;
|
||||
s_id = prach_pdu->prach_start_symbol;
|
||||
|
||||
// Pick the first slot of the PRACH occasion in a system frame
|
||||
for (i = 0; i < 10; i++){
|
||||
if (((SFN_nbr & (1 << i)) >> i) == 1){
|
||||
t_id = 2*i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
prach_resources->ra_RNTI = 1 + s_id + 14 * t_id + 1120 * f_id + 8960 * ul_carrier_id;
|
||||
mac->ra_rnti = prach_resources->ra_RNTI;
|
||||
|
||||
@@ -335,6 +395,7 @@ void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint
|
||||
// - add the backoff condition here if we have it from a previous RA reponse which failed (i.e. backoff indicator)
|
||||
|
||||
uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
fapi_nr_ul_config_prach_pdu *prach_pdu,
|
||||
module_id_t mod_id,
|
||||
int CC_id,
|
||||
UE_MODE_t UE_mode,
|
||||
@@ -363,7 +424,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
AssertFatal(CC_id == 0,"Transmission on secondary CCs is not supported yet\n");
|
||||
|
||||
if (UE_mode < PUSCH && prach_resources->init_msg1) {
|
||||
if (prach_resources->init_msg1) {
|
||||
|
||||
LOG_D(MAC, "nr_ue_get_rach, RA_active value: %d", mac->RA_active);
|
||||
|
||||
@@ -449,7 +510,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
// Fill in preamble and PRACH resources
|
||||
if (mac->generate_nr_prach == 1)
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, 1, prach_resources, rach_ConfigDedicated);
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
|
||||
offset = nr_generate_ulsch_pdu((uint8_t *) mac_sdus, // sdus buffer
|
||||
(uint8_t *) payload, // UL MAC pdu pointer
|
||||
@@ -576,7 +637,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
// Fill in preamble and PRACH resources
|
||||
if (mac->generate_nr_prach == 1)
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, 0, prach_resources, rach_ConfigDedicated);
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -590,7 +651,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
// Fill in preamble and PRACH resources
|
||||
if (mac->generate_nr_prach == 1)
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, 0, prach_resources, rach_ConfigDedicated);
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -274,15 +274,22 @@ uint16_t nr_ue_process_rar(module_id_t mod_id,
|
||||
if (ue_mac->RA_RAPID_found) {
|
||||
|
||||
uint8_t freq_hopping, mcs, Msg3_t_alloc, Msg3_f_alloc;
|
||||
unsigned char tpc_command, csi_req;
|
||||
unsigned char tpc_command;
|
||||
#ifdef DEBUG_RAR
|
||||
unsigned char csi_req;
|
||||
#endif
|
||||
|
||||
// TC-RNTI
|
||||
*t_crnti = rar->TCRNTI_2 + (rar->TCRNTI_1 << 8);
|
||||
ue_mac->t_crnti = *t_crnti;
|
||||
// TA command
|
||||
ta_command = rar->TA2 + (rar->TA1 << 5);
|
||||
|
||||
#ifdef DEBUG_RAR
|
||||
// CSI
|
||||
csi_req = (unsigned char) (rar->UL_GRANT_4 & 0x01);
|
||||
#endif
|
||||
|
||||
// TPC
|
||||
tpc_command = (unsigned char) ((rar->UL_GRANT_4 >> 1) & 0x07);
|
||||
switch (tpc_command){
|
||||
|
||||
@@ -128,7 +128,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
uint16_t band;
|
||||
int32_t offset;
|
||||
|
||||
get_band((cfg->carrier_config.dl_frequency.value)*1000,
|
||||
get_band((uint64_t)(cfg->carrier_config.dl_frequency.value)*1000,
|
||||
&band,
|
||||
&offset,
|
||||
&frame_type);
|
||||
|
||||
@@ -923,6 +923,10 @@ void nr_generate_Msg2(module_id_t module_idP,
|
||||
nr_mac->TX_req[CC_id].Slot = slotP;
|
||||
memcpy((void*)&tx_req->TLVs[0].value.direct[0], (void*)&cc[CC_id].RAR_pdu.payload[0], tx_req->TLVs[0].length);
|
||||
|
||||
T(T_GNB_MAC_DL_RAR_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id),
|
||||
T_INT(RA_rnti), T_INT(frameP), T_INT(slotP), T_INT(0) /* harq pid, meaningful? */,
|
||||
T_BUFFER(&cc[CC_id].RAR_pdu.payload[0], tx_req->TLVs[0].length));
|
||||
|
||||
/* mark the corresponding RBs as used */
|
||||
uint8_t *vrb_map = cc[CC_id].vrb_map;
|
||||
for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++)
|
||||
|
||||
@@ -840,6 +840,9 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
retInfo->mcs = sched_ctrl->mcs;
|
||||
retInfo->numDmrsCdmGrpsNoData = sched_ctrl->numDmrsCdmGrpsNoData;
|
||||
|
||||
T(T_GNB_MAC_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti),
|
||||
T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_BUFFER(buf, TBS));
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
if (frame%100 == 0) {
|
||||
LOG_I(MAC,
|
||||
|
||||
@@ -320,6 +320,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
|
||||
NR_RA_t *ra = &gNB_mac->common_channels[CC_idP].ra[0];
|
||||
|
||||
if (sduP != NULL) {
|
||||
T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP),
|
||||
T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(-1) /* harq_pid */,
|
||||
T_BUFFER(sduP, sdu_lenP));
|
||||
}
|
||||
|
||||
// random access pusch with TC-RNTI
|
||||
if (ra->state == WAIT_Msg3) {
|
||||
if (sduP != NULL) { // if the CRC passed
|
||||
|
||||
@@ -922,6 +922,7 @@ static missing_data_t next_missing(nr_rlc_entity_am_t *entity,
|
||||
*/
|
||||
ret.sn_start = entity->rx_next;
|
||||
ret.so_start = 0;
|
||||
ret.next = cur;
|
||||
goto set_end_different_sdu;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user