fix some of the unused function arguments (found using -Wunused-parameter)
This commit is contained in:
@@ -816,7 +816,7 @@ void RCconfig_nr_prs(void)
|
||||
/**
|
||||
* @brief Get number or blacklisted UL PRBs and their mapping from gNB config
|
||||
*/
|
||||
static int get_prb_blacklist(uint8_t instance, uint16_t *prbbl)
|
||||
static int get_prb_blacklist(uint16_t *prbbl)
|
||||
{
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST, NULL, 0};
|
||||
@@ -870,7 +870,7 @@ void RCconfig_NR_L1(void)
|
||||
|
||||
// PRB Blacklist
|
||||
uint16_t prbbl[MAX_BWP_SIZE] = {0};
|
||||
int num_ulprbbl = get_prb_blacklist(j, prbbl);
|
||||
int num_ulprbbl = get_prb_blacklist(prbbl);
|
||||
if (num_ulprbbl != -1) {
|
||||
RC.gNB[j]->num_ulprbbl = num_ulprbbl;
|
||||
LOG_D(NR_PHY, "Copying %d blacklisted PRB to L1 context\n", RC.gNB[j]->num_ulprbbl);
|
||||
@@ -943,7 +943,7 @@ bool is_pattern2_config(paramdef_t *param)
|
||||
return true;
|
||||
}
|
||||
|
||||
static NR_ServingCellConfigCommon_t *get_scc_config(configmodule_interface_t *cfg, int minRXTXTIME, int do_SRS)
|
||||
static NR_ServingCellConfigCommon_t *get_scc_config(int minRXTXTIME, int do_SRS)
|
||||
{
|
||||
NR_ServingCellConfigCommon_t *scc = calloc_or_fail(1, sizeof(*scc));
|
||||
uint64_t ssb_bitmap=0xff;
|
||||
@@ -1039,8 +1039,7 @@ static NR_ServingCellConfigCommon_t *get_scc_config(configmodule_interface_t *cf
|
||||
return scc;
|
||||
}
|
||||
|
||||
static int read_du_cell_info(configmodule_interface_t *cfg,
|
||||
bool separate_du,
|
||||
static int read_du_cell_info(bool separate_du,
|
||||
uint32_t *gnb_id,
|
||||
uint64_t *gnb_du_id,
|
||||
char **name,
|
||||
@@ -1211,7 +1210,7 @@ static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id,
|
||||
return req;
|
||||
}
|
||||
|
||||
static nr_ptrs_config_t *get_ptrs_config(int gnb_idx)
|
||||
static nr_ptrs_config_t *get_ptrs_config()
|
||||
{
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
@@ -1471,7 +1470,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
|
||||
AssertFatal(config.maxMIMO_layers != 0 && config.maxMIMO_layers <= tot_ant, "Invalid maxMIMO_layers %d\n", config.maxMIMO_layers);
|
||||
|
||||
config.redcap = get_redcap_config(0);
|
||||
config.ptrs = get_ptrs_config(0);
|
||||
config.ptrs = get_ptrs_config();
|
||||
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_TIMERS_CONFIG);
|
||||
@@ -1523,7 +1522,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
|
||||
config.num_agg_level_candidates[PDCCH_AGG_LEVEL8],
|
||||
config.num_agg_level_candidates[PDCCH_AGG_LEVEL16]);
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc = get_scc_config(cfg, config.minRXTXTIME, config.do_SRS);
|
||||
NR_ServingCellConfigCommon_t *scc = get_scc_config(config.minRXTXTIME, config.do_SRS);
|
||||
// BWP
|
||||
get_bwp_config(&config, scc);
|
||||
AssertFatal(config.num_additional_bwps <= 4, "Impossible to configure more than 4 additional BWPs\n");
|
||||
@@ -1622,7 +1621,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
|
||||
RC.nrmac[j]->identity_pm = *(MacRLC_ParamList.paramarray[j][MACRLC_IDENTITY_PM_IDX].u8ptr);
|
||||
// PRB Blacklist
|
||||
uint16_t prbbl[MAX_BWP_SIZE] = {0};
|
||||
int num_ulprbbl = get_prb_blacklist(j, prbbl);
|
||||
int num_ulprbbl = get_prb_blacklist(prbbl);
|
||||
if (num_ulprbbl != -1) {
|
||||
LOG_I(NR_PHY, "Copying %d blacklisted PRB to L1 context\n", num_ulprbbl);
|
||||
memcpy(RC.nrmac[j]->ulprbbl, prbbl, MAX_BWP_SIZE * sizeof(prbbl[0]));
|
||||
@@ -1667,7 +1666,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
|
||||
uint32_t gnb_id = 0;
|
||||
char *name = NULL;
|
||||
f1ap_served_cell_info_t info;
|
||||
read_du_cell_info(cfg, NODE_IS_DU(node_type), &gnb_id, &gnb_du_id, &name, &info, 1);
|
||||
read_du_cell_info(NODE_IS_DU(node_type), &gnb_id, &gnb_du_id, &name, &info, 1);
|
||||
|
||||
NR_COMMON_channels_t *cc = &RC.nrmac[0]->common_channels[0];
|
||||
cc->du_SIBs = fill_du_sibs(GNBParamList.paramarray[0]);
|
||||
|
||||
@@ -717,9 +717,7 @@ static void update_ss(void *ue_ss_in, void *nw_ss_in)
|
||||
}
|
||||
}
|
||||
|
||||
static void configure_common_ss_coreset(const NR_UE_MAC_INST_t *mac,
|
||||
NR_BWP_PDCCH_t *pdcch,
|
||||
NR_PDCCH_ConfigCommon_t *pdcch_ConfigCommon)
|
||||
static void configure_common_ss_coreset(NR_BWP_PDCCH_t *pdcch, NR_PDCCH_ConfigCommon_t *pdcch_ConfigCommon)
|
||||
{
|
||||
if (!pdcch_ConfigCommon)
|
||||
return;
|
||||
@@ -1778,7 +1776,7 @@ static void configure_common_BWP_dl(NR_UE_MAC_INST_t *mac, int bwp_id, NR_BWP_Do
|
||||
NR_BWP_PDCCH_t *pdcch = &mac->config_BWP_PDCCH[bwp_id];
|
||||
if (dl_common->pdcch_ConfigCommon) {
|
||||
if (dl_common->pdcch_ConfigCommon->present == NR_SetupRelease_PDCCH_ConfigCommon_PR_setup)
|
||||
configure_common_ss_coreset(mac, pdcch, dl_common->pdcch_ConfigCommon->choice.setup);
|
||||
configure_common_ss_coreset(pdcch, dl_common->pdcch_ConfigCommon->choice.setup);
|
||||
if (dl_common->pdcch_ConfigCommon->present == NR_SetupRelease_PDCCH_ConfigCommon_PR_release)
|
||||
release_common_ss_cset(pdcch);
|
||||
}
|
||||
|
||||
@@ -394,8 +394,7 @@ int nr_rrc_mac_config_req_sl_preconfig(module_id_t module_id,
|
||||
|
||||
|
||||
//Copies the values of SSB time allocation from ASN format to MAC context
|
||||
static void sl_mac_config_ssb_time_alloc(uint8_t module_id,
|
||||
NR_SL_SSB_TimeAllocation_r16_t *sl_SSB_TimeAllocation_r16,
|
||||
static void sl_mac_config_ssb_time_alloc(NR_SL_SSB_TimeAllocation_r16_t *sl_SSB_TimeAllocation_r16,
|
||||
sl_ssb_timealloc_t *ssb_time_alloc)
|
||||
{
|
||||
|
||||
@@ -432,9 +431,7 @@ void nr_rrc_mac_transmit_slss_req(module_id_t module_id,
|
||||
sl_mac->tx_sl_bch.num_ssb = 0;
|
||||
sl_mac->tx_sl_bch.ssb_slot = 0;
|
||||
|
||||
sl_mac_config_ssb_time_alloc(module_id,
|
||||
ssb_ta,
|
||||
&sl_mac->tx_sl_bch.ssb_time_alloc);
|
||||
sl_mac_config_ssb_time_alloc(ssb_ta, &sl_mac->tx_sl_bch.ssb_time_alloc);
|
||||
|
||||
LOG_I(NR_MAC,"[UE%d]SL RRC->MAC: TX SLSS REQ SLSS-id:%d, SL-MIB:%x, numssb:%d, offset:%d, interval:%d\n",
|
||||
module_id, sl_mac->tx_sl_bch.slss_id,
|
||||
@@ -489,9 +486,7 @@ void nr_rrc_mac_config_req_sl_mib(module_id_t module_id,
|
||||
sl_mac->rx_sl_bch.num_ssb = 0;
|
||||
sl_mac->rx_sl_bch.ssb_slot = 0;
|
||||
|
||||
sl_mac_config_ssb_time_alloc(module_id,
|
||||
ssb_ta,
|
||||
&sl_mac->rx_sl_bch.ssb_time_alloc);
|
||||
sl_mac_config_ssb_time_alloc(ssb_ta, &sl_mac->rx_sl_bch.ssb_time_alloc);
|
||||
|
||||
LOG_I(NR_MAC,"[UE%d]SL RRC->MAC: RX SLSS REQ SLSS-id:%d, SL-MIB:%x, numssb:%d, offset:%d, interval:%d\n",
|
||||
module_id, sl_mac->rx_sl_bch.slss_id,
|
||||
|
||||
@@ -166,11 +166,7 @@ typedef struct {
|
||||
enum { b_none, b_long, b_short, b_short_trunc, b_long_trunc } type_bsr;
|
||||
} type_bsr_t;
|
||||
|
||||
int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
|
||||
NR_UE_MAC_INST_t *mac,
|
||||
NR_SINGLE_ENTRY_PHR_MAC_CE *power_headroom,
|
||||
const type_bsr_t *bsr,
|
||||
uint8_t *mac_ce_end);
|
||||
int nr_write_ce_ulsch_pdu(uint8_t *mac_ce, NR_SINGLE_ENTRY_PHR_MAC_CE *power_headroom, const type_bsr_t *bsr, uint8_t *mac_ce_end);
|
||||
|
||||
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);
|
||||
void set_precoding_information_parameters(nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
@@ -241,10 +237,9 @@ int get_sum_delta_pucch(NR_UE_MAC_INST_t *mac, int slot, frame_t frame);
|
||||
void ul_ports_config(NR_UE_MAC_INST_t *mac,
|
||||
int *n_front_load_symb,
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
dci_pdu_rel15_t *dci,
|
||||
nr_dci_format_t dci_format);
|
||||
dci_pdu_rel15_t *dci);
|
||||
|
||||
bool init_RA(NR_UE_MAC_INST_t *mac, int frame);
|
||||
bool init_RA(NR_UE_MAC_INST_t *mac);
|
||||
|
||||
/* Random Access */
|
||||
/* \brief This function schedules the PRACH according to prach_ConfigurationIndex and TS 38.211 tables 6.3.3.2.x
|
||||
@@ -262,7 +257,7 @@ void configure_csi_resource_mapping(fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_c
|
||||
|
||||
bool is_lcid_suspended(NR_UE_MAC_INST_t *mac, int lcid);
|
||||
void nr_ra_contention_resolution_failed(NR_UE_MAC_INST_t *mac);
|
||||
void nr_ra_succeeded(NR_UE_MAC_INST_t *mac, const uint8_t gNB_index, const frame_t frame, const int slot);
|
||||
void nr_ra_succeeded(NR_UE_MAC_INST_t *mac, const frame_t frame, const int slot);
|
||||
void nr_ra_backoff_setting(RA_config_t *ra);
|
||||
void nr_get_RA_window(NR_UE_MAC_INST_t *mac);
|
||||
void prepare_msg4_msgb_feedback(NR_UE_MAC_INST_t *mac, int pid, int ack_nack);
|
||||
@@ -283,7 +278,7 @@ int16_t get_prach_tx_power(NR_UE_MAC_INST_t *mac);
|
||||
void schedule_RA_after_SR_failure(NR_UE_MAC_INST_t *mac);
|
||||
void nr_rar_not_successful(NR_UE_MAC_INST_t *mac);
|
||||
void ra_resource_selection(NR_UE_MAC_INST_t *mac);
|
||||
void nr_Msg3_transmitted(NR_UE_MAC_INST_t *mac, uint8_t CC_id, frame_t frameP, slot_t slotP, uint8_t gNB_id);
|
||||
void nr_Msg3_transmitted(NR_UE_MAC_INST_t *mac);
|
||||
void trigger_MAC_UE_RA(NR_UE_MAC_INST_t *mac, dci_pdu_rel15_t *pdcch_order);
|
||||
void nr_get_Msg3_MsgA_PUSCH_payload(NR_UE_MAC_INST_t *mac, uint8_t *buf, int TBS_max);
|
||||
void handle_time_alignment_timer_expired(NR_UE_MAC_INST_t *mac);
|
||||
|
||||
@@ -470,8 +470,7 @@ void set_antenna_port_parameters(fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_pdu,
|
||||
void ul_ports_config(NR_UE_MAC_INST_t *mac,
|
||||
int *n_front_load_symb,
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
dci_pdu_rel15_t *dci,
|
||||
nr_dci_format_t dci_format)
|
||||
dci_pdu_rel15_t *dci)
|
||||
{
|
||||
uint8_t rank = pusch_config_pdu->nrOfLayers;
|
||||
NR_PUSCH_Config_t *pusch_Config = mac->current_UL_BWP->pusch_Config;
|
||||
|
||||
@@ -819,7 +819,7 @@ static void setup_ra_response_window(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
// Random Access procedure initialization as per 5.1.1 and initialization of variables specific
|
||||
// to Random Access type as specified in clause 5.1.1a (3GPP TS 38.321 version 16.2.1 Release 16)
|
||||
bool init_RA(NR_UE_MAC_INST_t *mac, int frame)
|
||||
bool init_RA(NR_UE_MAC_INST_t *mac)
|
||||
{
|
||||
RA_config_t *ra = &mac->ra;
|
||||
LOG_D(NR_MAC, "Initialization of RA\n");
|
||||
@@ -1023,7 +1023,7 @@ bool init_RA(NR_UE_MAC_INST_t *mac, int frame)
|
||||
return true;
|
||||
}
|
||||
|
||||
void nr_Msg3_transmitted(NR_UE_MAC_INST_t *mac, uint8_t CC_id, frame_t frameP, slot_t slotP, uint8_t gNB_id)
|
||||
void nr_Msg3_transmitted(NR_UE_MAC_INST_t *mac)
|
||||
{
|
||||
RA_config_t *ra = &mac->ra;
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = mac->current_UL_BWP->rach_ConfigCommon;
|
||||
@@ -1109,7 +1109,7 @@ void nr_get_Msg3_MsgA_PUSCH_payload(NR_UE_MAC_INST_t *mac, uint8_t *buf, int TBS
|
||||
// according to section 5 of 3GPP TS 38.321 version 16.2.1 Release 16
|
||||
// todo:
|
||||
// - complete handling of received contention-based RA preamble
|
||||
void nr_ra_succeeded(NR_UE_MAC_INST_t *mac, const uint8_t gNB_index, const frame_t frame, const int slot)
|
||||
void nr_ra_succeeded(NR_UE_MAC_INST_t *mac, const frame_t frame, const int slot)
|
||||
{
|
||||
RA_config_t *ra = &mac->ra;
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ static const int nb_symbols_excluding_dmrs[11][2][2]
|
||||
};
|
||||
|
||||
// ∆MPR according to Table 6.2.2-3 38.101-1
|
||||
static float get_delta_mpr(uint16_t nr_band, frame_type_t frame_type, int scs, int channel_bandwidth, int n_prbs, int start_prb, int power_class)
|
||||
static float get_delta_mpr(uint16_t nr_band, frame_type_t frame_type, int scs, int channel_bandwidth, int power_class)
|
||||
{
|
||||
if (compare_relative_ul_channel_bw(nr_band, scs, channel_bandwidth, frame_type)) {
|
||||
if (power_class == 3) {
|
||||
@@ -191,7 +191,7 @@ float nr_get_Pcmax(int p_Max,
|
||||
int delta_TC = 0;
|
||||
|
||||
float MPR = get_mpr(Qm, N_RB_UL, is_transform_precoding, n_prbs, start_prb, power_class);
|
||||
float delta_MPR = get_delta_mpr(nr_band, frame_type, scs, channel_bandwidth, n_prbs, start_prb, power_class);
|
||||
float delta_MPR = get_delta_mpr(nr_band, frame_type, scs, channel_bandwidth, power_class);
|
||||
int A_MPR = 0; // TODO too complicated to implement for now (see 6.2.3 in 38.101-1)
|
||||
int delta_rx_SRS = 0; // TODO for SRS
|
||||
int P_MPR = 0; // to ensure compliance with applicable electromagnetic energy absorption requirements
|
||||
|
||||
@@ -3296,7 +3296,7 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d
|
||||
rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR));
|
||||
handle_rar_reception(mac, rar, frame, slot);
|
||||
if (ra->cfra)
|
||||
nr_ra_succeeded(mac, dl_info->gNB_index, frame, slot);
|
||||
nr_ra_succeeded(mac, frame, slot);
|
||||
break;
|
||||
}
|
||||
if (rarh->E == 0) {
|
||||
@@ -3818,12 +3818,7 @@ static bool check_ra_contention_resolution(const uint8_t *pdu, const uint8_t *co
|
||||
return true;
|
||||
}
|
||||
|
||||
static int nr_ue_validate_successrar(uint8_t *pduP,
|
||||
int32_t pdu_len,
|
||||
NR_UE_MAC_INST_t *mac,
|
||||
uint8_t gNB_index,
|
||||
frame_t frameP,
|
||||
int slot)
|
||||
static int nr_ue_validate_successrar(uint8_t *pduP, int32_t pdu_len, NR_UE_MAC_INST_t *mac, frame_t frameP, int slot)
|
||||
{
|
||||
// TS 38.321 - Figure 6.1.5a-1: BI MAC subheader
|
||||
// TS 38.321 - Figure 6.1.5a-3: SuccessRAR MAC subheader
|
||||
@@ -3885,7 +3880,7 @@ static int nr_ue_validate_successrar(uint8_t *pduP,
|
||||
|
||||
if (ra->RA_active && ra_success) {
|
||||
nr_timer_stop(&ra->response_window_timer);
|
||||
nr_ra_succeeded(mac, gNB_index, frameP, slot);
|
||||
nr_ra_succeeded(mac, frameP, slot);
|
||||
} else if (!ra_success) {
|
||||
nr_ra_backoff_setting(ra);
|
||||
}
|
||||
@@ -3943,7 +3938,6 @@ static void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_
|
||||
fapi_nr_pdsch_pdu_t *pdsch_pdu = &(dl_info->rx_ind->rx_indication_body + pdu_id)->pdsch_pdu;
|
||||
uint8_t *pduP = pdsch_pdu->pdu;
|
||||
int32_t pdu_len = (int32_t)pdsch_pdu->pdu_length;
|
||||
uint8_t gNB_index = dl_info->gNB_index;
|
||||
uint8_t CC_id = dl_info->cc_id;
|
||||
uint8_t done = 0;
|
||||
RA_config_t *ra = &mac->ra;
|
||||
@@ -3963,7 +3957,7 @@ static void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_
|
||||
dl_info->rx_ind->number_pdus);
|
||||
|
||||
if (ra->ra_type == RA_2_STEP && ra->ra_state == nrRA_WAIT_MSGB) {
|
||||
int n = nr_ue_validate_successrar(pduP, pdu_len, mac, gNB_index, frameP, slot);
|
||||
int n = nr_ue_validate_successrar(pduP, pdu_len, mac, frameP, slot);
|
||||
pduP += n;
|
||||
pdu_len -= n;
|
||||
}
|
||||
@@ -4095,7 +4089,7 @@ static void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_
|
||||
bool ra_success = check_ra_contention_resolution(&pduP[1], ra->cont_res_id);
|
||||
|
||||
if (ra->RA_active && ra_success) {
|
||||
nr_ra_succeeded(mac, gNB_index, frameP, slot);
|
||||
nr_ra_succeeded(mac, frameP, slot);
|
||||
} else if (!ra_success) {
|
||||
// consider this Contention Resolution not successful and discard the successfully decoded MAC PDU
|
||||
nr_ra_contention_resolution_failed(mac);
|
||||
@@ -4135,14 +4129,9 @@ static void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_
|
||||
* Function: generating MAC CEs (MAC CE and subheader) for the ULSCH PDU
|
||||
* Parameters:
|
||||
* @mac_ce pointer to the MAC sub-PDUs including the MAC CEs
|
||||
* @mac pointer to the MAC instance
|
||||
* Return: number of written bytes
|
||||
*/
|
||||
int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
|
||||
NR_UE_MAC_INST_t *mac,
|
||||
NR_SINGLE_ENTRY_PHR_MAC_CE *power_headroom,
|
||||
const type_bsr_t *bsr,
|
||||
uint8_t *mac_ce_end)
|
||||
int nr_write_ce_ulsch_pdu(uint8_t *mac_ce, NR_SINGLE_ENTRY_PHR_MAC_CE *power_headroom, const type_bsr_t *bsr, uint8_t *mac_ce_end)
|
||||
{
|
||||
uint8_t *pdu = mac_ce;
|
||||
if (power_headroom) {
|
||||
|
||||
@@ -324,7 +324,7 @@ fapi_nr_dl_config_request_t *get_dl_config_request(NR_UE_MAC_INST_t *mac, int sl
|
||||
return &mac->dl_config_request[slot];
|
||||
}
|
||||
|
||||
void ul_layers_config(NR_UE_MAC_INST_t *mac, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, dci_pdu_rel15_t *dci, nr_dci_format_t dci_format)
|
||||
static void ul_layers_config(NR_UE_MAC_INST_t *mac, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, dci_pdu_rel15_t *dci)
|
||||
{
|
||||
NR_UE_UL_BWP_t *current_UL_BWP = mac->current_UL_BWP;
|
||||
NR_SRS_Config_t *srs_config = current_UL_BWP->srs_Config;
|
||||
@@ -583,8 +583,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
else
|
||||
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 2;
|
||||
} else if (dci_format == NR_UL_DCI_FORMAT_0_1) {
|
||||
ul_layers_config(mac, pusch_config_pdu, dci, dci_format);
|
||||
ul_ports_config(mac, &dmrslength, pusch_config_pdu, dci, dci_format);
|
||||
ul_layers_config(mac, pusch_config_pdu, dci);
|
||||
ul_ports_config(mac, &dmrslength, pusch_config_pdu, dci);
|
||||
} else {
|
||||
LOG_E(NR_MAC, "UL grant from DCI format %d is not handled...\n", dci_format);
|
||||
mac->stats.bad_dci++;
|
||||
@@ -1459,7 +1459,7 @@ static void nr_update_sr(NR_UE_MAC_INST_t *mac, bool BSRsent)
|
||||
}
|
||||
}
|
||||
|
||||
static void nr_update_rlc_buffers_status(NR_UE_MAC_INST_t *mac, frame_t frameP, slot_t slotP, uint8_t gNB_index)
|
||||
static void nr_update_rlc_buffers_status(NR_UE_MAC_INST_t *mac, frame_t frameP, slot_t slotP)
|
||||
{
|
||||
for (int i = 0; i < mac->lc_ordered_list.count; i++) {
|
||||
nr_lcordered_info_t *lc_info = mac->lc_ordered_list.array[i];
|
||||
@@ -1987,10 +1987,8 @@ static uint8_t nr_locate_BsrIndexByBufferSize(int size, int value)
|
||||
}
|
||||
|
||||
static void nr_ue_get_sdu_mac_ce_pre(NR_UE_MAC_INST_t *mac,
|
||||
int CC_id,
|
||||
frame_t frame,
|
||||
slot_t slot,
|
||||
uint8_t gNB_index,
|
||||
uint8_t *ulsch_buffer,
|
||||
uint32_t buflen,
|
||||
uint32_t *LCG_bytes,
|
||||
@@ -2172,8 +2170,7 @@ static void nr_ue_get_sdu_mac_ce_post(NR_UE_MAC_INST_t *mac,
|
||||
}
|
||||
}
|
||||
|
||||
int size =
|
||||
nr_write_ce_ulsch_pdu(mac_ce_p->cur_ptr, mac, mac_ce_p->phr_len ? &mac_ce_p->phr : NULL, &mac_ce_p->bsr, mac_ce_p->pdu_end);
|
||||
int size = nr_write_ce_ulsch_pdu(mac_ce_p->cur_ptr, mac_ce_p->phr_len ? &mac_ce_p->phr : NULL, &mac_ce_p->bsr, mac_ce_p->pdu_end);
|
||||
LOG_D(NR_MAC, "Added %d bytes of BSR\n", size);
|
||||
mac_ce_p->cur_ptr += size;
|
||||
}
|
||||
@@ -2272,7 +2269,6 @@ static uint select_logical_channels(NR_UE_MAC_INST_t *mac, nr_lcordered_info_t *
|
||||
static bool fill_mac_sdu(NR_UE_MAC_INST_t *mac,
|
||||
frame_t frame,
|
||||
slot_t slot,
|
||||
uint8_t gNB_index,
|
||||
int lcid,
|
||||
uint count_same_priority_lcids,
|
||||
uint32_t buflen_ep,
|
||||
@@ -2406,18 +2402,14 @@ static bool fill_mac_sdu(NR_UE_MAC_INST_t *mac,
|
||||
to generate the complete MAC PDU with sub-headers and MAC CEs according to ULSCH MAC PDU generation (6.1.2 TS 38.321)
|
||||
the selected sub-header for the payload sub-PDUs is NR_MAC_SUBHEADER_LONG
|
||||
* @module_idP Module ID
|
||||
* @CC_id Component Carrier index
|
||||
* @frame current UL frame
|
||||
* @slot current UL slot
|
||||
* @gNB_index gNB index
|
||||
* @ulsch_buffer Pointer to ULSCH PDU
|
||||
* @buflen TBS
|
||||
*/
|
||||
static uint8_t nr_ue_get_sdu(NR_UE_MAC_INST_t *mac,
|
||||
int CC_id,
|
||||
frame_t frame,
|
||||
slot_t slot,
|
||||
uint8_t gNB_index,
|
||||
uint8_t *ulsch_buffer,
|
||||
const uint32_t buflen,
|
||||
int tx_power,
|
||||
@@ -2436,7 +2428,7 @@ static uint8_t nr_ue_get_sdu(NR_UE_MAC_INST_t *mac,
|
||||
uint32_t LCG_bytes[NR_MAX_NUM_LCGID] = {0};
|
||||
nr_update_bsr(mac, LCG_bytes);
|
||||
|
||||
nr_ue_get_sdu_mac_ce_pre(mac, CC_id, frame, slot, gNB_index, ulsch_buffer, buflen, LCG_bytes, &mac_ce_info, tx_power, P_CMAX);
|
||||
nr_ue_get_sdu_mac_ce_pre(mac, frame, slot, ulsch_buffer, buflen, LCG_bytes, &mac_ce_info, tx_power, P_CMAX);
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"[UE %d] [%d.%d] process UL transport block with size TBS = %d bytes, number of existing LCids %d \n",
|
||||
@@ -2510,7 +2502,6 @@ static uint8_t nr_ue_get_sdu(NR_UE_MAC_INST_t *mac,
|
||||
if (!fill_mac_sdu(mac,
|
||||
frame,
|
||||
slot,
|
||||
gNB_index,
|
||||
lcid,
|
||||
count_same_priority_lcids,
|
||||
buflen_ep,
|
||||
@@ -2563,12 +2554,10 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
|
||||
int cc_id = ul_info->cc_id;
|
||||
frame_t frame_tx = ul_info->frame;
|
||||
slot_t slot_tx = ul_info->slot;
|
||||
uint32_t gNB_index = ul_info->gNB_index;
|
||||
|
||||
RA_config_t *ra = &mac->ra;
|
||||
|
||||
if (mac->state == UE_PERFORMING_RA && ra->ra_state == nrRA_UE_IDLE) {
|
||||
init_RA(mac, frame_tx);
|
||||
init_RA(mac);
|
||||
// perform the Random Access Resource selection procedure (see clause 5.1.2 and .2a)
|
||||
ra_resource_selection(mac);
|
||||
}
|
||||
@@ -2579,7 +2568,7 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
|
||||
bool BSRsent = false;
|
||||
if (mac->state == UE_CONNECTED) {
|
||||
nr_ue_periodic_srs_scheduling(mac, frame_tx, slot_tx);
|
||||
nr_update_rlc_buffers_status(mac, frame_tx, slot_tx, gNB_index);
|
||||
nr_update_rlc_buffers_status(mac, frame_tx, slot_tx);
|
||||
}
|
||||
|
||||
// Schedule ULSCH only if the current frame and slot match those in ul_config_req
|
||||
@@ -2637,7 +2626,7 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
|
||||
pdu->rb_size,
|
||||
pdu->rb_start);
|
||||
|
||||
nr_ue_get_sdu(mac, cc_id, frame_tx, slot_tx, gNB_index, ulsch_input_buffer, TBS_bytes, tx_power, P_CMAX, &BSRsent);
|
||||
nr_ue_get_sdu(mac, frame_tx, slot_tx, ulsch_input_buffer, TBS_bytes, tx_power, P_CMAX, &BSRsent);
|
||||
pdu->tx_request_body.fapiTxPdu = ulsch_input_buffer;
|
||||
pdu->tx_request_body.pdu_length = TBS_bytes;
|
||||
number_of_pdus++;
|
||||
@@ -2654,11 +2643,11 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
|
||||
LOG_I(NR_MAC, "[RAPROC][%d.%d] RA-Msg3 retransmitted\n", frame_tx, slot_tx);
|
||||
// 38.321 restart the ra-ContentionResolutionTimer at each HARQ retransmission in the first symbol after the end of the Msg3
|
||||
// transmission
|
||||
nr_Msg3_transmitted(mac, cc_id, frame_tx, slot_tx, gNB_index);
|
||||
nr_Msg3_transmitted(mac);
|
||||
}
|
||||
if (ra->ra_state == nrRA_WAIT_RAR && !ra->cfra) {
|
||||
LOG_A(NR_MAC, "[RAPROC][%d.%d] RA-Msg3 transmitted\n", frame_tx, slot_tx);
|
||||
nr_Msg3_transmitted(mac, cc_id, frame_tx, slot_tx, gNB_index);
|
||||
nr_Msg3_transmitted(mac);
|
||||
}
|
||||
if (ra->ra_state == nrRA_WAIT_MSGB && !ra->cfra) {
|
||||
LOG_A(NR_MAC, "[RAPROC][%d.%d] RA-MsgA-PUSCH transmitted\n", frame_tx, slot_tx);
|
||||
|
||||
@@ -101,9 +101,8 @@ TEST(test_init_ra, four_step_cbra)
|
||||
mac.frame_structure.frame_type = TDD;
|
||||
mac.frame_structure.numb_slots_frame = 20;
|
||||
mac.frequency_range = FR1;
|
||||
int frame = 151;
|
||||
|
||||
init_RA(&mac, frame);
|
||||
init_RA(&mac);
|
||||
|
||||
EXPECT_EQ(mac.ra.ra_type, RA_4_STEP);
|
||||
EXPECT_EQ(mac.state, UE_PERFORMING_RA);
|
||||
@@ -135,14 +134,13 @@ TEST(test_init_ra, four_step_cfra)
|
||||
mac.frame_structure.frame_type = TDD;
|
||||
mac.frame_structure.numb_slots_frame = 20;
|
||||
mac.frequency_range = FR1;
|
||||
int frame = 151;
|
||||
|
||||
NR_RACH_ConfigDedicated_t rach_ConfigDedicated = {0};
|
||||
NR_CFRA_t cfra;
|
||||
rach_ConfigDedicated.cfra = &cfra;
|
||||
ra->rach_ConfigDedicated = &rach_ConfigDedicated;
|
||||
|
||||
init_RA(&mac, frame);
|
||||
init_RA(&mac);
|
||||
|
||||
EXPECT_EQ(mac.ra.ra_type, RA_4_STEP);
|
||||
EXPECT_EQ(mac.state, UE_PERFORMING_RA);
|
||||
|
||||
@@ -106,7 +106,6 @@ void print_ue_mac_stats(const module_id_t mod, const int frame_rx, const int slo
|
||||
static int handle_bcch_bch(NR_UE_MAC_INST_t *mac,
|
||||
int cc_id,
|
||||
unsigned int gNB_index,
|
||||
void *phy_data,
|
||||
uint8_t *pduP,
|
||||
unsigned int additional_bits,
|
||||
uint32_t ssb_index_mod8,
|
||||
@@ -149,17 +148,13 @@ static int handle_bcch_dlsch(NR_UE_MAC_INST_t *mac,
|
||||
}
|
||||
|
||||
// L2 Abstraction Layer
|
||||
static nr_dci_format_t handle_dci(NR_UE_MAC_INST_t *mac,
|
||||
unsigned int gNB_index,
|
||||
frame_t frame,
|
||||
int slot,
|
||||
fapi_nr_dci_indication_pdu_t *dci)
|
||||
static nr_dci_format_t handle_dci(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, fapi_nr_dci_indication_pdu_t *dci)
|
||||
{
|
||||
// if notification of a reception of a PDCCH transmission of the SpCell is received from lower layers
|
||||
// if the C-RNTI MAC CE was included in Msg3
|
||||
// consider this Contention Resolution successful
|
||||
if (mac->msg3_C_RNTI && mac->ra.ra_state == nrRA_WAIT_CONTENTION_RESOLUTION)
|
||||
nr_ra_succeeded(mac, gNB_index, frame, slot);
|
||||
nr_ra_succeeded(mac, frame, slot);
|
||||
|
||||
// suspend RAR response window timer
|
||||
// (in RFsim running multiple slot in parallel it might expire while decoding MSG2)
|
||||
@@ -245,11 +240,7 @@ static uint32_t nr_ue_dl_processing(NR_UE_MAC_INST_t *mac, nr_downlink_indicatio
|
||||
LOG_T(MAC, "[L2][IF MODULE][DL INDICATION][DCI_IND]\n");
|
||||
for (int i = 0; i < dl_info->dci_ind->number_of_dcis; i++) {
|
||||
LOG_T(MAC, ">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n", i, dl_info->dci_ind->number_of_dcis);
|
||||
nr_dci_format_t dci_format = handle_dci(mac,
|
||||
dl_info->gNB_index,
|
||||
dl_info->frame,
|
||||
dl_info->slot,
|
||||
dl_info->dci_ind->dci_list + i);
|
||||
nr_dci_format_t dci_format = handle_dci(mac, dl_info->frame, dl_info->slot, dl_info->dci_ind->dci_list + i);
|
||||
|
||||
/* The check below filters out UL_DCIs which are being processed as DL_DCIs. */
|
||||
if (dci_format != NR_DL_DCI_FORMAT_1_0 && dci_format != NR_DL_DCI_FORMAT_1_1) {
|
||||
@@ -291,7 +282,6 @@ static uint32_t nr_ue_dl_processing(NR_UE_MAC_INST_t *mac, nr_downlink_indicatio
|
||||
ret_mask |= (handle_bcch_bch(mac,
|
||||
dl_info->cc_id,
|
||||
dl_info->gNB_index,
|
||||
dl_info->phy_data,
|
||||
rx_indication_body.ssb_pdu.pdu,
|
||||
rx_indication_body.ssb_pdu.additional_bits,
|
||||
rx_indication_body.ssb_pdu.ssb_index,
|
||||
|
||||
Reference in New Issue
Block a user