Fixed some warnings + cleanup
- replaced nr_slot_t with int as it was barely used in the code (also is defined after an lte struct) - removed use of phy_frame_config_nr from the UE (another file was created in SCHED_NR_UE, still the gNB file is used in some tests file at UE side)
This commit is contained in:
@@ -1252,7 +1252,7 @@ set(SCHED_SRC_NR_UE
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c
|
||||
${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_common.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/fapi_nr_ue_l1.c
|
||||
${OPENAIR1_DIR}/SCHED_NR/phy_frame_config_nr.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/phy_frame_config_nr_ue.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/harq_nr.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/pucch_uci_ue_nr.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/pucch_power_control_ue_nr.c
|
||||
|
||||
+1
-3
@@ -35,9 +35,7 @@
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
#include "RRC/NR_UE/rrc_proto.h"
|
||||
|
||||
//#ifndef NO_RAT_NR
|
||||
#include "SCHED_NR/phy_frame_config_nr.h"
|
||||
//#endif
|
||||
#include "SCHED_NR_UE/phy_frame_config_nr.h"
|
||||
#include "SCHED_NR_UE/defs.h"
|
||||
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
|
||||
@@ -29,11 +29,9 @@
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#include "SCHED_NR_UE/defs.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "SCHED_NR_UE/phy_frame_config_nr.h"
|
||||
#include "PHY/impl_defs_nr.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
#include "SCHED_NR/phy_frame_config_nr.h"
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
@@ -369,73 +367,6 @@ int nr_slot_select(nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_tti)
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : nr_ue_slot_select
|
||||
*
|
||||
* DESCRIPTION : function for the UE equivalent to nr_slot_select
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
int nr_ue_slot_select(fapi_nr_config_request_t *cfg, int nr_frame, int nr_tti) {
|
||||
/* for FFD all slot can be considered as an uplink */
|
||||
int mu = cfg->ssb_config.scs_common, check_slot = 0;
|
||||
|
||||
if (cfg->cell_config.frame_duplex_type == FDD) {
|
||||
return (NR_UPLINK_SLOT | NR_DOWNLINK_SLOT);
|
||||
}
|
||||
|
||||
if (nr_frame%2 == 0) {
|
||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config == 1) {
|
||||
check_slot++;
|
||||
}
|
||||
}
|
||||
|
||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
return (NR_UPLINK_SLOT);
|
||||
}
|
||||
|
||||
check_slot = 0;
|
||||
|
||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config == 0) {
|
||||
check_slot++;
|
||||
}
|
||||
}
|
||||
|
||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
return (NR_DOWNLINK_SLOT);
|
||||
} else {
|
||||
return (NR_MIXED_SLOT);
|
||||
}
|
||||
} else {
|
||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[((1<<mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME) + nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config == 1) {
|
||||
check_slot++;
|
||||
}
|
||||
}
|
||||
|
||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
return (NR_UPLINK_SLOT);
|
||||
}
|
||||
|
||||
check_slot = 0;
|
||||
|
||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[((1<<mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME) + nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config == 0) {
|
||||
check_slot++;
|
||||
}
|
||||
}
|
||||
|
||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
return (NR_DOWNLINK_SLOT);
|
||||
} else {
|
||||
return (NR_MIXED_SLOT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : free_tdd_configuration_nr
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#ifndef PHY_FRAME_CONFIG_NR_H
|
||||
#define PHY_FRAME_CONFIG_NR_H
|
||||
|
||||
#include <nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h>
|
||||
/************** DEFINE ********************************************/
|
||||
|
||||
#define TDD_CONFIG_NB_FRAMES (2)
|
||||
@@ -77,10 +76,9 @@ int set_tdd_configuration_dedicated_nr(NR_DL_FRAME_PARMS *frame_parms);
|
||||
* @param frame_parms NR DL Frame parameters
|
||||
* @param nr_frame : frame number
|
||||
* @param nr_tti : slot number
|
||||
@returns nr_slot_t : downlink or uplink */
|
||||
@returns int : downlink, uplink or mixed slot type*/
|
||||
|
||||
nr_slot_t nr_slot_select(nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_tti);
|
||||
int nr_ue_slot_select(fapi_nr_config_request_t *cfg, int nr_frame, int nr_tti);
|
||||
int nr_slot_select(nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_tti);
|
||||
|
||||
/** \brief This function frees tdd configuration for nr
|
||||
* @param frame_parms NR DL Frame parameters
|
||||
|
||||
@@ -62,10 +62,18 @@ int set_tdd_configuration_dedicated_nr(NR_DL_FRAME_PARMS *frame_parms);
|
||||
* @param frame_parms NR DL Frame parameters
|
||||
* @param nr_frame : frame number
|
||||
* @param nr_tti : slot number
|
||||
@returns nr_slot_t : downlink or uplink */
|
||||
@returns int : downlink or uplink */
|
||||
|
||||
int slot_select_nr(NR_DL_FRAME_PARMS *frame_parms, int nr_frame, int nr_tti);
|
||||
|
||||
/** \brief This function checks nr UE slot direction : downlink or uplink
|
||||
* @param cfg : FAPI Config Request
|
||||
* @param nr_frame : frame number
|
||||
* @param nr_tti : slot number
|
||||
@returns int : downlink, uplink or mixed slot type */
|
||||
|
||||
int nr_ue_slot_select(fapi_nr_config_request_t *cfg, int nr_frame, int nr_tti);
|
||||
|
||||
/** \brief This function frees tdd configuration for nr
|
||||
* @param frame_parms NR DL Frame parameters
|
||||
@returns none */
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* FILENAME : phy_frame_configuration_nr_ue.c
|
||||
*
|
||||
* DESCRIPTION : functions related to FDD/TDD configuration for NR
|
||||
* see TS 38.213 11.1 Slot configuration
|
||||
* and TS 38.331 for RRC configuration
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : nr_ue_slot_select
|
||||
*
|
||||
* DESCRIPTION : function for the UE equivalent to nr_slot_select
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
int nr_ue_slot_select(fapi_nr_config_request_t *cfg, int nr_frame, int nr_tti) {
|
||||
/* for FFD all slot can be considered as an uplink */
|
||||
int mu = cfg->ssb_config.scs_common, check_slot = 0;
|
||||
|
||||
if (cfg->cell_config.frame_duplex_type == FDD) {
|
||||
return (NR_UPLINK_SLOT | NR_DOWNLINK_SLOT);
|
||||
}
|
||||
|
||||
if (nr_frame%2 == 0) {
|
||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config == 1) {
|
||||
check_slot++;
|
||||
}
|
||||
}
|
||||
|
||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
return (NR_UPLINK_SLOT);
|
||||
}
|
||||
|
||||
check_slot = 0;
|
||||
|
||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config == 0) {
|
||||
check_slot++;
|
||||
}
|
||||
}
|
||||
|
||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
return (NR_DOWNLINK_SLOT);
|
||||
} else {
|
||||
return (NR_MIXED_SLOT);
|
||||
}
|
||||
} else {
|
||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[((1<<mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME) + nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config == 1) {
|
||||
check_slot++;
|
||||
}
|
||||
}
|
||||
|
||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
return (NR_UPLINK_SLOT);
|
||||
}
|
||||
|
||||
check_slot = 0;
|
||||
|
||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[((1<<mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME) + nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config == 0) {
|
||||
check_slot++;
|
||||
}
|
||||
}
|
||||
|
||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
return (NR_DOWNLINK_SLOT);
|
||||
} else {
|
||||
return (NR_MIXED_SLOT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -620,7 +620,8 @@ int main(int argc, char **argv)
|
||||
scheduled_response.slot = slot;
|
||||
scheduled_response.dl_config = NULL;
|
||||
scheduled_response.ul_config = &ul_config;
|
||||
scheduled_response.dl_config = NULL;
|
||||
scheduled_response.tx_request = (fapi_nr_tx_request_t *) malloc(sizeof(fapi_nr_tx_request_t));
|
||||
scheduled_response.tx_request->tx_request_body = (fapi_nr_tx_request_body_t *) malloc(sizeof(fapi_nr_tx_request_body_t));
|
||||
|
||||
ul_config.slot = slot;
|
||||
ul_config.number_pdus = 1;
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
#include "NR_MAC-CellGroupConfig.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "SCHED_NR/phy_frame_config_nr.h"
|
||||
|
||||
int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg,
|
||||
int mu,
|
||||
|
||||
@@ -892,8 +892,6 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
scheduled_response.frame = rx_frame;
|
||||
scheduled_response.slot = rx_slot;
|
||||
|
||||
printf("DEGUG nr_ue_scheduler Scheduling FAPI_NR_UL_CONFIG_TYPE_PUSCH \n");
|
||||
|
||||
scheduled_response.ul_config->slot = ul_info->slot_tx;
|
||||
scheduled_response.ul_config->number_pdus = 1;
|
||||
scheduled_response.ul_config->ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
||||
|
||||
@@ -107,9 +107,10 @@ uint16_t nr_ue_process_rar(module_id_t mod_id,
|
||||
uint8_t n_subPDUs = 0; // number of RAR payloads
|
||||
uint8_t n_subheaders = 0; // number of MAC RAR subheaders
|
||||
//uint8_t best_rx_rapid = -1; // the closest RAPID receive from all RARs
|
||||
unsigned char freq_hopping, msg3_t_alloc, mcs, tpc_command, csi_req;
|
||||
uint16_t ta_command = 0, msg3_f_alloc, bwp_size;
|
||||
int f_alloc, mask;
|
||||
//unsigned char freq_hopping, msg3_t_alloc, mcs, tpc_command, csi_req; // WIP
|
||||
//uint16_t ta_command = 0, msg3_f_alloc, bwp_size; // WIP
|
||||
uint16_t ta_command = 0;
|
||||
//int f_alloc, mask; // WIP
|
||||
|
||||
AssertFatal(CC_id == 0, "RAR reception on secondary CCs is not supported yet\n");
|
||||
|
||||
@@ -143,6 +144,7 @@ uint16_t nr_ue_process_rar(module_id_t mod_id,
|
||||
// LOG_I(MAC, "[UE %d][RAPROC] Frame %d Received RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for preamble %d/%d\n",
|
||||
// mod_id, frameP, *(uint8_t *) rarh, rar[0], rar[1], rar[2], rar[3], rar[4], rar[5], rarh->RAPID, preamble_index);
|
||||
|
||||
#if 0 // TbD WIP Msg3 development ongoing
|
||||
if (ue_mac->RA_RAPID_found) {
|
||||
// TC-RNTI
|
||||
*t_crnti = rar->TCRNTI_2 + (rar->TCRNTI_1 << 8);
|
||||
@@ -200,6 +202,7 @@ uint16_t nr_ue_process_rar(module_id_t mod_id,
|
||||
ue_mac->t_crnti = 0;
|
||||
ta_command = (0xffff);
|
||||
}
|
||||
#endif
|
||||
|
||||
// move the selected RAR to the front of the RA_PDSCH buffer
|
||||
memcpy((void *) (selected_rar_buffer + 0), (void *) rarh, 1);
|
||||
|
||||
@@ -276,8 +276,6 @@ int nr_ue_dcireq(nr_dcireq_t *dcireq) {
|
||||
dl_config->slot=UE_mac->dl_config_request.slot;
|
||||
dl_config->number_pdus=0;
|
||||
|
||||
printf(" UE_mac->dl_config_request.slot %d VS dcireq->slot %d \n", UE_mac->dl_config_request.slot, dcireq->slot);
|
||||
|
||||
LOG_D(PHY, "Entering UE DCI configuration frame %d slot %d \n", dcireq->frame, dcireq->slot);
|
||||
|
||||
ue_dci_configuration(UE_mac, dl_config, dcireq->frame, dcireq->slot);
|
||||
|
||||
Reference in New Issue
Block a user