diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 3438f31373f193117ee53f5dac00773577a78a3a..77f55fa75bb789836704e13a6cd17e3dfbd4d2db 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -4,7 +4,6 @@ #include <executables/softmodem-common.h> #include "PHY/defs_nr_UE.h" #include "SIMULATION/ETH_TRANSPORT/proto.h" -#include "NR_MAC_gNB/mac_proto.h" /***************************************************************************************************************************************/ /* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index ca87ed1faeca78d04d94bb8ea4963d879ef3ff45..f976da0a3a83adaf1d069ea70a49e2cf2b5111a0 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -42,8 +42,6 @@ #include "UTIL/LISTS/list.h" #endif -#include "LAYER2/NR_MAC_gNB/mac_proto.h" - //#include "../LTE_TRANSPORT/transport_common.h" // structures below implement 36-211 and 36-212 diff --git a/openair1/PHY/TOOLS/nr_phy_scope.h b/openair1/PHY/TOOLS/nr_phy_scope.h index 4877b93007ccc6a10f1be9e07f7a303daeb1b8f8..3df6b81a0308482a4012ec4e030bda7050eaf26c 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.h +++ b/openair1/PHY/TOOLS/nr_phy_scope.h @@ -26,7 +26,6 @@ #include <simple_executable.h> #include <common/utils/system.h> #include <openairinterface5g_limits.h> -#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #include "common/ran_context.h" #include <openair1/PHY/defs_gNB.h> #include <forms.h> diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 9a3168a33e5734b64dca66c8074ed9b4cc889e5c..cb7625f10ffb09a68ff083cd01f26caa05f8b63b 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -256,23 +256,6 @@ unsigned int gain_table[31] = {100,112,126,141,158,178,200,224,251,282,316,359,3 #if 0 -unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb) // TbD -{ - - int gain_dB = power_dBm - power_max_dBm; - double gain_lin; - - gain_lin = pow(10,.1*gain_dB); - if ((nb_rb >0) && (nb_rb <= N_RB_UL)) { - return((int)(AMP*sqrt(gain_lin*N_RB_UL/(double)nb_rb))); - } - else { - LOG_E(PHY,"Illegal nb_rb/N_RB_UL combination (%d/%d)\n",nb_rb,N_RB_UL); - //mac_xface->macphy_exit(""); - } - return(0); -} - void nr_dump_dlsch_ra(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t nr_tti_rx) { unsigned int coded_bits_per_codeword; @@ -2329,8 +2312,6 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, // check if we have PRACH opportunity if (is_nr_prach_subframe(&ue->frame_parms, frame_tx, slot_tx)) { - // TBR TODO FIX this works only for TDD but it enters phy_procedures_nrUE_TX only when mode is FDD - printf(" is_nr_prach_subframe is %d\n", is_nr_prach_subframe(&ue->frame_parms, frame_tx, slot_tx)); // TBR debug nr_ue_prach_procedures(ue, proc, gNB_id, mode); } } @@ -4579,7 +4560,7 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t // if we're calibrating the PRACH kill the pointer to its resources so that the RA protocol doesn't continue if (runmode == calib_prach_tx) - ue->prach_resources[gNB_id]=NULL; + ue->prach_resources[gNB_id] = NULL; LOG_D(PHY,"[UE %d] frame %d nr_tti_rx %d : generate_nr_prach %d, prach_cnt %d\n", ue->Mod_id,frame_tx,nr_tti_tx, ue->generate_nr_prach, ue->prach_cnt); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 2999f4d8eeb6d4136c2be2fa36d570f18c4395ee..2342d83ed9f37238d50a312ab1d2a95a449b5f73 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -44,6 +44,9 @@ /*TAG*/ #include "NR_TAG-Id.h" +//////////////////////////////////////////////////////// +/////* DLSCH MAC PDU generation (6.1.2 TS 38.321) *///// +//////////////////////////////////////////////////////// int nr_generate_dlsch_pdu(module_id_t module_idP, unsigned char *sdus_payload, @@ -106,7 +109,6 @@ int nr_generate_dlsch_pdu(module_id_t module_idP, mac_pdu_ptr += (unsigned char) mac_ce_size; } - // Contention resolution fixed subheader and MAC CE if (ue_cont_res_id) { mac_pdu_ptr->R = 0; @@ -131,8 +133,7 @@ int nr_generate_dlsch_pdu(module_id_t module_idP, mac_pdu_ptr += (unsigned char) mac_ce_size; } - - // 2) Generation of DLSCH MAC SDU subheaders + // 2) Generation of DLSCH MAC subPDUs including subheaders and MAC SDUs for (i = 0; i < num_sdus; i++) { LOG_D(MAC, "[gNB] Generate DLSCH header num sdu %d len sdu %d\n", num_sdus, sdu_lengths[i]); @@ -153,14 +154,14 @@ int nr_generate_dlsch_pdu(module_id_t module_idP, mac_pdu_ptr += last_size; - // 3) cycle through SDUs, compute each relevant and place dlsch_buffer in + // 3) cycle through SDUs, compute each relevant and place dlsch_buffer in memcpy((void *) mac_pdu_ptr, (void *) dlsch_buffer_ptr, sdu_lengths[i]); dlsch_buffer_ptr+= sdu_lengths[i]; mac_pdu_ptr += sdu_lengths[i]; } // 4) Compute final offset for padding - if (post_padding > 0) { + if (post_padding > 0) { ((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->R = 0; ((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->LCID = DL_SCH_LCID_PADDING; mac_pdu_ptr++; @@ -171,7 +172,7 @@ int nr_generate_dlsch_pdu(module_id_t module_idP, // compute final offset offset = ((unsigned char *) mac_pdu_ptr - mac_pdu); - + //printf("Offset %d \n", ((unsigned char *) mac_pdu_ptr - mac_pdu)); return offset; diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index 8b2966e0c5059d8b815f1262b58bd7aae72cc7ef..ea1bccef9713c8ab070a07f7bb7889cbf8a6c9c9 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -91,7 +91,7 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP, /* TODO BCCH SIB1 SIBs */ - /* CCCH */ // TBR lte code + /* CCCH */ if( (Srb_id & RAB_OFFSET ) == CCCH) { //struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[Mod_idP],rnti); //if (ue_context_p == NULL) return(0);