Remove dead code
This commit is contained in:
@@ -652,7 +652,6 @@ add_library(SCHED_LIB ${SCHED_SRC})
|
|||||||
target_link_libraries(SCHED_LIB PRIVATE asn1_lte_rrc_hdrs)
|
target_link_libraries(SCHED_LIB PRIVATE asn1_lte_rrc_hdrs)
|
||||||
|
|
||||||
set(SCHED_NR_SRC
|
set(SCHED_NR_SRC
|
||||||
${OPENAIR1_DIR}/SCHED_NR/fapi_nr_l1.c
|
|
||||||
${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_gNB.c
|
${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_gNB.c
|
||||||
${OPENAIR1_DIR}/SCHED_NR/nr_prach_procedures.c
|
${OPENAIR1_DIR}/SCHED_NR/nr_prach_procedures.c
|
||||||
${OPENAIR1_DIR}/SCHED_NR/phy_frame_config_nr.c
|
${OPENAIR1_DIR}/SCHED_NR/phy_frame_config_nr.c
|
||||||
@@ -939,7 +938,6 @@ set(PHY_SRC_UE
|
|||||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dci.c
|
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dci.c
|
||||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dci_tools.c
|
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dci_tools.c
|
||||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dlsch.c
|
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dlsch.c
|
||||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dlsch_tools.c
|
|
||||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dlsch_coding.c
|
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dlsch_coding.c
|
||||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
|
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
|
||||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch.c
|
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch.c
|
||||||
@@ -1215,7 +1213,6 @@ set (MAC_SRC
|
|||||||
|
|
||||||
set (MAC_NR_SRC
|
set (MAC_NR_SRC
|
||||||
${NR_PHY_INTERFACE_DIR}/NR_IF_Module.c
|
${NR_PHY_INTERFACE_DIR}/NR_IF_Module.c
|
||||||
${NR_PHY_INTERFACE_DIR}/nr_sched_response.c
|
|
||||||
${NR_GNB_MAC_DIR}/main.c
|
${NR_GNB_MAC_DIR}/main.c
|
||||||
${NR_GNB_MAC_DIR}/config.c
|
${NR_GNB_MAC_DIR}/config.c
|
||||||
${NR_GNB_MAC_DIR}/gNB_scheduler.c
|
${NR_GNB_MAC_DIR}/gNB_scheduler.c
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ Ref :
|
|||||||
DLSCH encoding : 200.0
|
DLSCH encoding : 200.0
|
||||||
L1 Rx processing : 530.0
|
L1 Rx processing : 530.0
|
||||||
PUSCH inner-receiver : 360.0
|
PUSCH inner-receiver : 360.0
|
||||||
Schedule Response : 1.0
|
|
||||||
DL & UL scheduling timing : 17.0
|
DL & UL scheduling timing : 17.0
|
||||||
UL Indication : 1.0
|
UL Indication : 1.0
|
||||||
Slot Indication : 13.0
|
Slot Indication : 13.0
|
||||||
@@ -31,7 +30,6 @@ DeviationThreshold :
|
|||||||
DLSCH encoding : 0.25
|
DLSCH encoding : 0.25
|
||||||
L1 Rx processing : 0.25
|
L1 Rx processing : 0.25
|
||||||
PUSCH inner-receiver : 0.25
|
PUSCH inner-receiver : 0.25
|
||||||
Schedule Response : 1.00
|
|
||||||
DL & UL scheduling timing : 0.25
|
DL & UL scheduling timing : 0.25
|
||||||
UL Indication : 1.00
|
UL Indication : 1.00
|
||||||
Slot Indication : 0.50
|
Slot Indication : 0.50
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ Ref :
|
|||||||
DLSCH encoding : 110.0
|
DLSCH encoding : 110.0
|
||||||
L1 Rx processing : 345.0
|
L1 Rx processing : 345.0
|
||||||
PUSCH inner-receiver : 150.0
|
PUSCH inner-receiver : 150.0
|
||||||
Schedule Response : 1.0
|
|
||||||
DL & UL scheduling timing : 5.0
|
DL & UL scheduling timing : 5.0
|
||||||
UL Indication : 1.0
|
UL Indication : 1.0
|
||||||
Slot Indication : 6.0
|
Slot Indication : 6.0
|
||||||
@@ -31,7 +30,6 @@ DeviationThreshold :
|
|||||||
DLSCH encoding : 0.25
|
DLSCH encoding : 0.25
|
||||||
L1 Rx processing : 0.25
|
L1 Rx processing : 0.25
|
||||||
PUSCH inner-receiver : 0.25
|
PUSCH inner-receiver : 0.25
|
||||||
Schedule Response : 1.00
|
|
||||||
DL & UL scheduling timing : 0.50
|
DL & UL scheduling timing : 0.50
|
||||||
UL Indication : 1.00
|
UL Indication : 1.00
|
||||||
Slot Indication : 0.50
|
Slot Indication : 0.50
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ Ref :
|
|||||||
DLSCH encoding : 230.0
|
DLSCH encoding : 230.0
|
||||||
L1 Rx processing : 175.0
|
L1 Rx processing : 175.0
|
||||||
PUSCH inner-receiver : 100.0
|
PUSCH inner-receiver : 100.0
|
||||||
Schedule Response : 3.0
|
|
||||||
DL & UL scheduling timing : 11.0
|
DL & UL scheduling timing : 11.0
|
||||||
UL Indication : 3.0
|
UL Indication : 3.0
|
||||||
Slot Indication : 14.0
|
Slot Indication : 14.0
|
||||||
@@ -28,7 +27,6 @@ DeviationThreshold :
|
|||||||
DLSCH encoding : 0.25
|
DLSCH encoding : 0.25
|
||||||
L1 Rx processing : 0.25
|
L1 Rx processing : 0.25
|
||||||
PUSCH inner-receiver : 0.25
|
PUSCH inner-receiver : 0.25
|
||||||
Schedule Response : 1.00
|
|
||||||
DL & UL scheduling timing : 0.50
|
DL & UL scheduling timing : 0.50
|
||||||
UL Indication : 1.00
|
UL Indication : 1.00
|
||||||
Slot Indication : 0.25
|
Slot Indication : 0.25
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ Ref :
|
|||||||
DLSCH encoding : 140.0
|
DLSCH encoding : 140.0
|
||||||
L1 Rx processing : 345.0
|
L1 Rx processing : 345.0
|
||||||
PUSCH inner-receiver : 155.0
|
PUSCH inner-receiver : 155.0
|
||||||
Schedule Response : 1.0
|
|
||||||
DL & UL scheduling timing : 8.0
|
DL & UL scheduling timing : 8.0
|
||||||
UL Indication : 3.0
|
UL Indication : 3.0
|
||||||
Slot Indication : 9.0
|
Slot Indication : 9.0
|
||||||
@@ -31,7 +30,6 @@ DeviationThreshold :
|
|||||||
DLSCH encoding : 0.25
|
DLSCH encoding : 0.25
|
||||||
L1 Rx processing : 0.25
|
L1 Rx processing : 0.25
|
||||||
PUSCH inner-receiver : 0.25
|
PUSCH inner-receiver : 0.25
|
||||||
Schedule Response : 1.00
|
|
||||||
DL & UL scheduling timing : 0.35
|
DL & UL scheduling timing : 0.35
|
||||||
UL Indication : 1.00
|
UL Indication : 1.00
|
||||||
Slot Indication : 0.35
|
Slot Indication : 0.35
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ Ref :
|
|||||||
DLSCH encoding : 90.0
|
DLSCH encoding : 90.0
|
||||||
L1 Rx processing : 290.0
|
L1 Rx processing : 290.0
|
||||||
PUSCH inner-receiver : 115.0
|
PUSCH inner-receiver : 115.0
|
||||||
Schedule Response : 1.0
|
|
||||||
DL & UL scheduling timing : 4.0
|
DL & UL scheduling timing : 4.0
|
||||||
UL Indication : 2.0
|
UL Indication : 2.0
|
||||||
Slot Indication : 5.0
|
Slot Indication : 5.0
|
||||||
@@ -31,7 +30,6 @@ DeviationThreshold :
|
|||||||
DLSCH encoding : 0.25
|
DLSCH encoding : 0.25
|
||||||
L1 Rx processing : 0.25
|
L1 Rx processing : 0.25
|
||||||
PUSCH inner-receiver : 0.25
|
PUSCH inner-receiver : 0.25
|
||||||
Schedule Response : 1.00
|
|
||||||
DL & UL scheduling timing : 0.50
|
DL & UL scheduling timing : 0.50
|
||||||
UL Indication : 1.00
|
UL Indication : 1.00
|
||||||
Slot Indication : 0.50
|
Slot Indication : 0.50
|
||||||
|
|||||||
@@ -1916,8 +1916,6 @@ INPUT = \
|
|||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/E1AP/e1ap_api.h \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/E1AP/e1ap_api.h \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/E1AP/e1ap_setup.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/E1AP/e1ap_setup.c \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/E1AP/e1ap_asnc.h \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/E1AP/e1ap_asnc.h \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/NR_PHY_INTERFACE/nr_sched_response.h \
|
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/NR_PHY_INTERFACE/nr_sched_response.c \
|
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/NR_PHY_INTERFACE/NR_IF_Module.h \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/NR_PHY_INTERFACE/NR_IF_Module.h \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/NR_PHY_INTERFACE/NR_IF_Module.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/NR_PHY_INTERFACE/NR_IF_Module.c \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/SDAP/nr_sdap/nr_sdap.h \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/SDAP/nr_sdap/nr_sdap.h \
|
||||||
@@ -2012,7 +2010,6 @@ INPUT = \
|
|||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_sss.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_sss.c \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_uci_tools_common.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_uci_tools_common.c \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c \
|
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_prach.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_prach.c \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_scrambling.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_TRANSPORT/nr_scrambling.c \
|
||||||
@@ -2294,10 +2291,8 @@ INPUT = \
|
|||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/phy_frame_config_nr.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/phy_frame_config_nr.c \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/phy_frame_config_nr.h \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/phy_frame_config_nr.h \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/nr_prach_procedures.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/nr_prach_procedures.c \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/fapi_nr_l1.h \
|
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/phy_procedures_nr_gNB.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/phy_procedures_nr_gNB.c \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/sched_nr.h \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/sched_nr.h \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/fapi_nr_l1.c \
|
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/nr_ru_procedures.c \
|
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/nr_ru_procedures.c \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../radio/ETHERNET/if_defs.h \
|
@CMAKE_CURRENT_SOURCE_DIR@/../radio/ETHERNET/if_defs.h \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/../radio/ETHERNET/ethernet_lib.h \
|
@CMAKE_CURRENT_SOURCE_DIR@/../radio/ETHERNET/ethernet_lib.h \
|
||||||
|
|||||||
@@ -194,10 +194,6 @@ void handle_nr_srs_measurements(const module_id_t module_id,
|
|||||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||||
|
|
||||||
/* TODO these declarations are to be removed */
|
/* TODO these declarations are to be removed */
|
||||||
void nr_schedule_dl_tti_req(void) {};
|
|
||||||
void nr_schedule_ul_dci_req() {};
|
|
||||||
void nr_schedule_tx_req() {};
|
|
||||||
void nr_schedule_ul_tti_req() {};
|
|
||||||
void nr_slot_select() {};
|
void nr_slot_select() {};
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|||||||
@@ -156,10 +156,6 @@ extern char uecap_xer[1024];
|
|||||||
char uecap_xer_in=0;
|
char uecap_xer_in=0;
|
||||||
|
|
||||||
/* TODO these declarations are to be removed */
|
/* TODO these declarations are to be removed */
|
||||||
void nr_schedule_dl_tti_req(void) {};
|
|
||||||
void nr_schedule_ul_dci_req() {};
|
|
||||||
void nr_schedule_tx_req() {};
|
|
||||||
void nr_schedule_ul_tti_req() {};
|
|
||||||
void nr_slot_select() {};
|
void nr_slot_select() {};
|
||||||
|
|
||||||
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
|
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
|
||||||
|
|||||||
@@ -55,7 +55,6 @@
|
|||||||
#include "PHY/defs_gNB.h"
|
#include "PHY/defs_gNB.h"
|
||||||
#include "PHY/defs_nr_common.h"
|
#include "PHY/defs_nr_common.h"
|
||||||
#include "PHY/impl_defs_nr.h"
|
#include "PHY/impl_defs_nr.h"
|
||||||
#include "SCHED_NR/fapi_nr_l1.h"
|
|
||||||
#include "SCHED_NR/phy_frame_config_nr.h"
|
#include "SCHED_NR/phy_frame_config_nr.h"
|
||||||
#include "SCHED_NR/sched_nr.h"
|
#include "SCHED_NR/sched_nr.h"
|
||||||
#include "assertions.h"
|
#include "assertions.h"
|
||||||
@@ -65,7 +64,6 @@
|
|||||||
#include "nfapi/oai_integration/vendor_ext.h"
|
#include "nfapi/oai_integration/vendor_ext.h"
|
||||||
#include "nfapi_nr_interface_scf.h"
|
#include "nfapi_nr_interface_scf.h"
|
||||||
#include "notified_fifo.h"
|
#include "notified_fifo.h"
|
||||||
#include "openair2/NR_PHY_INTERFACE/nr_sched_response.h"
|
|
||||||
#include "thread-pool.h"
|
#include "thread-pool.h"
|
||||||
#include "time_meas.h"
|
#include "time_meas.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
@@ -251,7 +249,6 @@ static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size
|
|||||||
output += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output, end - output);
|
output += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output, end - output);
|
||||||
output += print_meas_log(&gNB->slot_indication_stats, "Slot Indication", NULL, NULL, output, end - output);
|
output += print_meas_log(&gNB->slot_indication_stats, "Slot Indication", NULL, NULL, output, end - output);
|
||||||
output += print_meas_log(&gNB->rx_pusch_stats, "PUSCH inner-receiver", NULL, NULL, output, end - output);
|
output += print_meas_log(&gNB->rx_pusch_stats, "PUSCH inner-receiver", NULL, NULL, output, end - output);
|
||||||
output += print_meas_log(&gNB->schedule_response_stats, "Schedule Response", NULL, NULL, output, end - output);
|
|
||||||
output += print_meas_log(&gNB->rx_prach, "PRACH RX", NULL, NULL, output, end - output);
|
output += print_meas_log(&gNB->rx_prach, "PRACH RX", NULL, NULL, output, end - output);
|
||||||
if (ru->feprx)
|
if (ru->feprx)
|
||||||
output += print_meas_log(&ru->ofdm_demod_stats, "feprx", NULL, NULL, output, end - output);
|
output += print_meas_log(&ru->ofdm_demod_stats, "feprx", NULL, NULL, output, end - output);
|
||||||
@@ -313,7 +310,6 @@ void *nrL1_stats_thread(void *param) {
|
|||||||
reset_meas(&gNB->ul_indication_stats);
|
reset_meas(&gNB->ul_indication_stats);
|
||||||
reset_meas(&gNB->slot_indication_stats);
|
reset_meas(&gNB->slot_indication_stats);
|
||||||
reset_meas(&gNB->rx_pusch_stats);
|
reset_meas(&gNB->rx_pusch_stats);
|
||||||
reset_meas(&gNB->schedule_response_stats);
|
|
||||||
reset_meas(&gNB->dlsch_scrambling_stats);
|
reset_meas(&gNB->dlsch_scrambling_stats);
|
||||||
reset_meas(&gNB->dlsch_modulation_stats);
|
reset_meas(&gNB->dlsch_modulation_stats);
|
||||||
reset_meas(&gNB->dlsch_resource_mapping_stats);
|
reset_meas(&gNB->dlsch_resource_mapping_stats);
|
||||||
@@ -361,12 +357,6 @@ void init_gNB_Tpool(int inst)
|
|||||||
// create the TX thread responsible for TX processing start event (L1_tx_out msg queue), then launch tx_func()
|
// create the TX thread responsible for TX processing start event (L1_tx_out msg queue), then launch tx_func()
|
||||||
threadCreate(&gNB->L1_tx_thread, L1_tx_thread, (void *)gNB, "L1_tx_thread", gNB->L1_tx_thread_core, OAI_PRIORITY_RT_MAX);
|
threadCreate(&gNB->L1_tx_thread, L1_tx_thread, (void *)gNB, "L1_tx_thread", gNB->L1_tx_thread_core, OAI_PRIORITY_RT_MAX);
|
||||||
|
|
||||||
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t), 0, &gNB->L1_tx_out, NULL);
|
|
||||||
processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
|
|
||||||
memset(msgDataTx, 0, sizeof(processingData_L1tx_t));
|
|
||||||
// this will be removed when the msgDataTx is not necessary anymore
|
|
||||||
gNB->msgDataTx = msgDataTx;
|
|
||||||
|
|
||||||
if (!IS_SOFTMODEM_NOSTATS)
|
if (!IS_SOFTMODEM_NOSTATS)
|
||||||
threadCreate(&proc->L1_stats_thread, nrL1_stats_thread, (void *)gNB, "L1_stats", -1, OAI_PRIORITY_RT_LOW);
|
threadCreate(&proc->L1_stats_thread, nrL1_stats_thread, (void *)gNB, "L1_stats", -1, OAI_PRIORITY_RT_LOW);
|
||||||
}
|
}
|
||||||
@@ -443,7 +433,6 @@ void init_gNB()
|
|||||||
AssertFatal((gNB->if_inst = NR_IF_Module_init(inst)) != NULL, "Cannot register interface");
|
AssertFatal((gNB->if_inst = NR_IF_Module_init(inst)) != NULL, "Cannot register interface");
|
||||||
|
|
||||||
LOG_I(NR_PHY, "Registered with MAC interface module (%p)\n", gNB->if_inst);
|
LOG_I(NR_PHY, "Registered with MAC interface module (%p)\n", gNB->if_inst);
|
||||||
gNB->if_inst->NR_Schedule_response = nr_schedule_response;
|
|
||||||
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||||
|
|
||||||
gNB->prach_energy_counter = 0;
|
gNB->prach_energy_counter = 0;
|
||||||
|
|||||||
@@ -423,8 +423,6 @@ int start_L1L2(module_id_t gnb_id)
|
|||||||
/* block threads */
|
/* block threads */
|
||||||
oai_exit = 0;
|
oai_exit = 0;
|
||||||
sync_var = -1;
|
sync_var = -1;
|
||||||
extern void init_sched_response(void);
|
|
||||||
init_sched_response();
|
|
||||||
|
|
||||||
/* update config */
|
/* update config */
|
||||||
gNB_MAC_INST *mac = RC.nrmac[0];
|
gNB_MAC_INST *mac = RC.nrmac[0];
|
||||||
|
|||||||
@@ -55,7 +55,6 @@
|
|||||||
#include "PHY/INIT/phy_init.h"
|
#include "PHY/INIT/phy_init.h"
|
||||||
#include "PHY/INIT/nr_phy_init.h"
|
#include "PHY/INIT/nr_phy_init.h"
|
||||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||||
#include "openair1/SCHED_NR/fapi_nr_l1.h"
|
|
||||||
#include "openair1/PHY/NR_TRANSPORT/nr_dlsch.h"
|
#include "openair1/PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||||
#include "openair1/PHY/defs_gNB.h"
|
#include "openair1/PHY/defs_gNB.h"
|
||||||
#include <openair1/SCHED/fapi_l1.h>
|
#include <openair1/SCHED/fapi_l1.h>
|
||||||
@@ -1108,17 +1107,6 @@ void pnf_nr_phy_deallocate_p7_vendor_ext(void *header)
|
|||||||
free(header);
|
free(header);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void nr_schedule_ul_dci_req(PHY_VARS_gNB *gNB, nfapi_nr_ul_dci_request_t *UL_dci_req);
|
|
||||||
int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_ul_dci_request_t *req)
|
|
||||||
{
|
|
||||||
DevAssert(RC.gNB != NULL && RC.gNB[0] != NULL);
|
|
||||||
PHY_VARS_gNB *gNB = RC.gNB[0]; // phy_inst?
|
|
||||||
|
|
||||||
nr_schedule_ul_dci_req(gNB, req);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int pnf_phy_hi_dci0_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_hi_dci0_request_t *req) {
|
int pnf_phy_hi_dci0_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_hi_dci0_request_t *req) {
|
||||||
if (req->hi_dci0_request_body.number_of_dci == 0 && req->hi_dci0_request_body.number_of_hi == 0)
|
if (req->hi_dci0_request_body.number_of_dci == 0 && req->hi_dci0_request_body.number_of_hi == 0)
|
||||||
@@ -1149,21 +1137,6 @@ int pnf_phy_hi_dci0_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfa
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// from dl_tti_req_fn fptr
|
|
||||||
extern void nr_schedule_dl_tti_req(PHY_VARS_gNB *gNB, nfapi_nr_dl_tti_request_t *DL_req);
|
|
||||||
int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_dl_tti_request_t *DL_req)
|
|
||||||
{
|
|
||||||
DevAssert(proc == NULL);
|
|
||||||
DevAssert(sync_var == 0);
|
|
||||||
DevAssert(RC.gNB != NULL && RC.gNB[0] != NULL);
|
|
||||||
PHY_VARS_gNB *gNB = RC.gNB[0]; // phy_inst?
|
|
||||||
|
|
||||||
nr_schedule_dl_tti_req(gNB, DL_req);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int pnf_phy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_dl_config_request_t *req) {
|
int pnf_phy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_dl_config_request_t *req) {
|
||||||
|
|
||||||
if (RC.eNB == 0) {
|
if (RC.eNB == 0) {
|
||||||
@@ -1256,18 +1229,6 @@ int pnf_phy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, n
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern void nr_schedule_tx_req(PHY_VARS_gNB *gNB, nfapi_nr_tx_data_request_t *TX_req);
|
|
||||||
int pnf_phy_tx_data_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_tx_data_request_t *req)
|
|
||||||
{
|
|
||||||
DevAssert(RC.gNB != NULL && RC.gNB[0] != NULL);
|
|
||||||
PHY_VARS_gNB *gNB = RC.gNB[0]; // phy_inst?
|
|
||||||
|
|
||||||
nr_schedule_tx_req(gNB, req);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int pnf_phy_tx_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_tx_request_t *req) {
|
int pnf_phy_tx_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_tx_request_t *req) {
|
||||||
uint16_t sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
|
uint16_t sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
|
||||||
uint16_t sf = NFAPI_SFNSF2SF(req->sfn_sf);
|
uint16_t sf = NFAPI_SFNSF2SF(req->sfn_sf);
|
||||||
@@ -1293,16 +1254,6 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_tx_request_t *req) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void nr_schedule_ul_tti_req(PHY_VARS_gNB *gNB, nfapi_nr_ul_tti_request_t *UL_tti_req);
|
|
||||||
int pnf_phy_ul_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_ul_tti_request_t *req)
|
|
||||||
{
|
|
||||||
DevAssert(RC.gNB != NULL && RC.gNB[0] != NULL);
|
|
||||||
PHY_VARS_gNB *gNB = RC.gNB[0]; // phy_inst?
|
|
||||||
|
|
||||||
nr_schedule_ul_tti_req(gNB, req);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int pnf_phy_ul_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_ul_config_request_t *req) {
|
int pnf_phy_ul_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_ul_config_request_t *req) {
|
||||||
if (0)LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n",
|
if (0)LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n",
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
@@ -1711,10 +1662,10 @@ int nr_start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nf
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NR
|
// NR
|
||||||
p7_config->dl_tti_req_fn = &pnf_phy_dl_tti_req;
|
p7_config->dl_tti_req_fn = NULL;
|
||||||
p7_config->ul_tti_req_fn = &pnf_phy_ul_tti_req;
|
p7_config->ul_tti_req_fn = NULL;
|
||||||
p7_config->ul_dci_req_fn = &pnf_phy_ul_dci_req;
|
p7_config->ul_dci_req_fn = NULL;
|
||||||
p7_config->tx_data_req_fn = &pnf_phy_tx_data_req;
|
p7_config->tx_data_req_fn = NULL;
|
||||||
|
|
||||||
// LTE
|
// LTE
|
||||||
p7_config->dl_config_req = &pnf_phy_dl_config_req;
|
p7_config->dl_config_req = &pnf_phy_dl_config_req;
|
||||||
|
|||||||
-1
@@ -36,7 +36,6 @@
|
|||||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||||
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||||
#include "SCHED_NR/sched_nr.h"
|
#include "SCHED_NR/sched_nr.h"
|
||||||
#include "SCHED_NR/fapi_nr_l1.h"
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||||
#include "common/utils/LOG/log.h"
|
#include "common/utils/LOG/log.h"
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||||
#include "PHY/defs_gNB.h"
|
#include "PHY/defs_gNB.h"
|
||||||
#include "SCHED_NR/fapi_nr_l1.h"
|
|
||||||
#include "SCHED_NR/sched_nr.h"
|
#include "SCHED_NR/sched_nr.h"
|
||||||
#include "common/utils/LOG/log.h"
|
#include "common/utils/LOG/log.h"
|
||||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||||
|
|||||||
@@ -39,7 +39,6 @@
|
|||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||||
#include "SCHED_NR/fapi_nr_l1.h"
|
|
||||||
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "nfapi/open-nFAPI/fapi/inc/nr_fapi_p5_utils.h"
|
#include "nfapi/open-nFAPI/fapi/inc/nr_fapi_p5_utils.h"
|
||||||
@@ -61,7 +60,6 @@ int l1_north_init_gNB()
|
|||||||
|
|
||||||
LOG_D(NR_PHY, "RC.gNB[%d]: installing callbacks\n", i);
|
LOG_D(NR_PHY, "RC.gNB[%d]: installing callbacks\n", i);
|
||||||
RC.gNB[i]->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
RC.gNB[i]->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||||
RC.gNB[i]->if_inst->NR_Schedule_response = nr_schedule_response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -292,7 +290,6 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
|||||||
void install_nr_schedule_handlers(NR_IF_Module_t *if_inst)
|
void install_nr_schedule_handlers(NR_IF_Module_t *if_inst)
|
||||||
{
|
{
|
||||||
if_inst->NR_PHY_config_req = nr_phy_config_request;
|
if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||||
if_inst->NR_Schedule_response = nr_schedule_response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
|
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
|
||||||
|
|||||||
@@ -35,9 +35,6 @@
|
|||||||
|
|
||||||
#include "PHY/defs_gNB.h"
|
#include "PHY/defs_gNB.h"
|
||||||
|
|
||||||
void nr_fill_dlsch_dl_tti_req(processingData_L1tx_t *msgTx, nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu);
|
|
||||||
void nr_fill_dlsch_tx_req(processingData_L1tx_t *msgTx, int idx, uint8_t *sdu);
|
|
||||||
|
|
||||||
void nr_generate_pdsch(PHY_VARS_gNB *gNB, int n_dlsch, NR_gNB_DLSCH_t *dlsch_array, int frame, int slot);
|
void nr_generate_pdsch(PHY_VARS_gNB *gNB, int n_dlsch, NR_gNB_DLSCH_t *dlsch_array, int frame, int slot);
|
||||||
|
|
||||||
int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \file PHY/NR_TRANSPORT/nr_dlsch_tools.c
|
|
||||||
* \brief Top-level routines for decoding DLSCH transport channel from 38-214, V15.2.0 2018-06
|
|
||||||
* \author Guy De Souza
|
|
||||||
* \date 2018
|
|
||||||
* \version 0.1
|
|
||||||
* \company Eurecom
|
|
||||||
* \email: desouza@eurecom.fr
|
|
||||||
* \note
|
|
||||||
|
|
||||||
* \warning
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "nr_dlsch.h"
|
|
||||||
#include "../../../nfapi/oai_integration/vendor_ext.h"
|
|
||||||
|
|
||||||
void nr_fill_dlsch_dl_tti_req(processingData_L1tx_t *msgTx, nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu)
|
|
||||||
{
|
|
||||||
NR_gNB_DLSCH_t *dlsch = &msgTx->gNB->dlsch[msgTx->num_pdsch_slot];
|
|
||||||
/// DLSCH struct
|
|
||||||
memcpy((void*)&dlsch->pdsch_pdu, (void*)pdsch_pdu, sizeof(nfapi_nr_dl_tti_pdsch_pdu));
|
|
||||||
AssertFatal(msgTx->num_pdsch_slot == pdsch_pdu->pdsch_pdu_rel15.pduIndex,
|
|
||||||
"PDSCH PDU index %d does not match msgTx index %d\n",
|
|
||||||
pdsch_pdu->pdsch_pdu_rel15.pduIndex,
|
|
||||||
msgTx->num_pdsch_slot);
|
|
||||||
msgTx->num_pdsch_slot++;
|
|
||||||
dlsch->pdu = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void nr_fill_dlsch_tx_req(processingData_L1tx_t *msgTx, int idx, uint8_t *sdu)
|
|
||||||
{
|
|
||||||
AssertFatal(sdu != NULL, "sdu is null\n");
|
|
||||||
|
|
||||||
/* not sure if FAPI could transmit DL_TTI_req and TX_req in different orders.
|
|
||||||
* for the moment, assume they are in the same order (and check!) */
|
|
||||||
NR_gNB_DLSCH_t *dlsch = &msgTx->gNB->dlsch[idx];
|
|
||||||
const nfapi_nr_dl_tti_pdsch_pdu *pdsch = dlsch->pdsch_pdu;
|
|
||||||
AssertFatal(pdsch->pdsch_pdu_rel15.pduIndex == idx, "PDSCH PDU index %d does not match %d\n", pdsch->pdsch_pdu_rel15.pduIndex, idx);
|
|
||||||
dlsch->pdu = sdu;
|
|
||||||
}
|
|
||||||
@@ -35,7 +35,6 @@
|
|||||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||||
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||||
#include "SCHED_NR/sched_nr.h"
|
#include "SCHED_NR/sched_nr.h"
|
||||||
#include "SCHED_NR/fapi_nr_l1.h"
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||||
#include "common/utils/LOG/log.h"
|
#include "common/utils/LOG/log.h"
|
||||||
|
|||||||
@@ -473,7 +473,6 @@ typedef struct PHY_VARS_gNB_s {
|
|||||||
time_stats_t rx_pusch_symbol_processing_stats;
|
time_stats_t rx_pusch_symbol_processing_stats;
|
||||||
time_stats_t ul_indication_stats;
|
time_stats_t ul_indication_stats;
|
||||||
time_stats_t slot_indication_stats;
|
time_stats_t slot_indication_stats;
|
||||||
time_stats_t schedule_response_stats;
|
|
||||||
time_stats_t ulsch_decoding_stats;
|
time_stats_t ulsch_decoding_stats;
|
||||||
time_stats_t ts_deinterleave;
|
time_stats_t ts_deinterleave;
|
||||||
time_stats_t ts_rate_unmatch;
|
time_stats_t ts_rate_unmatch;
|
||||||
@@ -501,7 +500,6 @@ typedef struct PHY_VARS_gNB_s {
|
|||||||
int L1_rx_thread_core;
|
int L1_rx_thread_core;
|
||||||
pthread_t L1_tx_thread;
|
pthread_t L1_tx_thread;
|
||||||
int L1_tx_thread_core;
|
int L1_tx_thread_core;
|
||||||
struct processingData_L1tx *msgDataTx;
|
|
||||||
void *scopeData;
|
void *scopeData;
|
||||||
} PHY_VARS_gNB;
|
} PHY_VARS_gNB;
|
||||||
|
|
||||||
@@ -578,18 +576,6 @@ typedef struct processingData_L1tx {
|
|||||||
int slot_rx;
|
int slot_rx;
|
||||||
openair0_timestamp timestamp_tx;
|
openair0_timestamp timestamp_tx;
|
||||||
PHY_VARS_gNB *gNB;
|
PHY_VARS_gNB *gNB;
|
||||||
nfapi_nr_dl_tti_pdcch_pdu pdcch_pdu[NFAPI_NR_MAX_NB_CORESETS];
|
|
||||||
/// corresponds to UL_dci_req->ul_dci_pdu_list
|
|
||||||
nfapi_nr_dl_tti_pdcch_pdu ul_pdcch_pdu[NFAPI_NR_MAX_NB_CORESETS];
|
|
||||||
nfapi_nr_dl_tti_csi_rs_pdu csirs_pdu[NFAPI_NR_MAX_NB_CORESETS];
|
|
||||||
nfapi_nr_dl_tti_ssb_pdu ssb_pdu[64];
|
|
||||||
int n_ssb_pdu;
|
|
||||||
int n_csirs_pdu;
|
|
||||||
uint16_t num_pdsch_slot;
|
|
||||||
int num_dl_pdcch;
|
|
||||||
int num_ul_pdcch;
|
|
||||||
/* a reference to the sched_response, to release it when not needed anymore */
|
|
||||||
int sched_response_id;
|
|
||||||
} processingData_L1tx_t;
|
} processingData_L1tx_t;
|
||||||
|
|
||||||
typedef struct processingData_L1rx {
|
typedef struct processingData_L1rx {
|
||||||
|
|||||||
@@ -1,213 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \file fapi_nr_l1.c
|
|
||||||
* \brief functions for FAPI L1 interface
|
|
||||||
* \author R. Knopp, WEI-TAI CHEN
|
|
||||||
* \date 2017, 2018
|
|
||||||
* \version 0.1
|
|
||||||
* \company Eurecom, NTUST
|
|
||||||
* \email: knopp@eurecom.fr, kroempa@gmail.com
|
|
||||||
* \note
|
|
||||||
* \warning
|
|
||||||
*/
|
|
||||||
#include "fapi_nr_l1.h"
|
|
||||||
#include "common/ran_context.h"
|
|
||||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
|
||||||
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
|
||||||
#include "PHY/NR_TRANSPORT/nr_dci.h"
|
|
||||||
#include "nfapi/oai_integration/vendor_ext.h"
|
|
||||||
#include "openair2/NR_PHY_INTERFACE/nr_sched_response.h"
|
|
||||||
#include "nfapi/oai_integration/nfapi_vnf.h"
|
|
||||||
|
|
||||||
static void handle_nr_nfapi_ssb_pdu(processingData_L1tx_t *msgTx, int frame, int slot, nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu)
|
|
||||||
{
|
|
||||||
|
|
||||||
AssertFatal(dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag== 1, "bchPayloadFlat %d != 1\n",
|
|
||||||
dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag);
|
|
||||||
|
|
||||||
uint8_t i_ssb = dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.SsbBlockIndex;
|
|
||||||
|
|
||||||
LOG_D(NR_PHY,"%d.%d : ssb index %d pbch_pdu: %x\n",frame,slot,i_ssb,dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayload);
|
|
||||||
msgTx->ssb_pdu[msgTx->n_ssb_pdu++] = dl_tti_pdu->ssb_pdu;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void handle_nfapi_nr_csirs_pdu(processingData_L1tx_t *msgTx, int frame, int slot, nfapi_nr_dl_tti_csi_rs_pdu *csirs_pdu)
|
|
||||||
{
|
|
||||||
msgTx->csirs_pdu[msgTx->n_csirs_pdu++] = *csirs_pdu;
|
|
||||||
}
|
|
||||||
|
|
||||||
void nr_schedule_dl_tti_req(PHY_VARS_gNB *gNB, nfapi_nr_dl_tti_request_t *DL_req)
|
|
||||||
{
|
|
||||||
DevAssert(gNB != NULL);
|
|
||||||
DevAssert(DL_req != NULL);
|
|
||||||
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
|
||||||
|
|
||||||
int frame = DL_req->SFN;
|
|
||||||
int slot = DL_req->Slot;
|
|
||||||
|
|
||||||
int slot_type = nr_slot_select(cfg, frame, slot);
|
|
||||||
DevAssert(slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT);
|
|
||||||
|
|
||||||
processingData_L1tx_t *msgTx = gNB->msgDataTx;
|
|
||||||
msgTx->slot = slot;
|
|
||||||
msgTx->frame = frame;
|
|
||||||
|
|
||||||
uint8_t number_dl_pdu = DL_req->dl_tti_request_body.nPDUs;
|
|
||||||
|
|
||||||
for (int i = 0; i < number_dl_pdu; i++) {
|
|
||||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu = &DL_req->dl_tti_request_body.dl_tti_pdu_list[i];
|
|
||||||
LOG_D(NR_PHY, "NFAPI: dl_pdu %d : type %d\n", i, dl_tti_pdu->PDUType);
|
|
||||||
switch (dl_tti_pdu->PDUType) {
|
|
||||||
case NFAPI_NR_DL_TTI_SSB_PDU_TYPE:
|
|
||||||
handle_nr_nfapi_ssb_pdu(msgTx, frame, slot, dl_tti_pdu);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE:
|
|
||||||
LOG_D(NR_PHY, "frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE for %d.%d\n", frame, slot, DL_req->SFN, DL_req->Slot);
|
|
||||||
msgTx->pdcch_pdu[msgTx->num_dl_pdcch] = dl_tti_pdu->pdcch_pdu;
|
|
||||||
msgTx->num_dl_pdcch++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE:
|
|
||||||
LOG_D(NR_PHY, "frame %d, slot %d, Got NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE for %d.%d\n", frame, slot, DL_req->SFN, DL_req->Slot);
|
|
||||||
handle_nfapi_nr_csirs_pdu(msgTx, frame, slot, &dl_tti_pdu->csi_rs_pdu);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE:
|
|
||||||
LOG_D(NR_PHY, "frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE for %d.%d\n", frame, slot, DL_req->SFN, DL_req->Slot);
|
|
||||||
nr_fill_dlsch_dl_tti_req(msgTx, &dl_tti_pdu->pdsch_pdu);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void nr_schedule_ul_tti_req(PHY_VARS_gNB *gNB, nfapi_nr_ul_tti_request_t *UL_tti_req)
|
|
||||||
{
|
|
||||||
DevAssert(gNB != NULL);
|
|
||||||
DevAssert(UL_tti_req != NULL);
|
|
||||||
|
|
||||||
int frame = UL_tti_req->SFN;
|
|
||||||
int slot = UL_tti_req->Slot;
|
|
||||||
|
|
||||||
for (int i = 0; i < UL_tti_req->n_pdus; i++) {
|
|
||||||
int type = UL_tti_req->pdus_list[i].pdu_type;
|
|
||||||
LOG_D(NR_PHY,
|
|
||||||
"frame %d, slot %d got %s for %d.%d\n",
|
|
||||||
frame,
|
|
||||||
slot,
|
|
||||||
txt_nfapi_nr_ul_config_pdu_type[type],
|
|
||||||
UL_tti_req->SFN,
|
|
||||||
UL_tti_req->Slot);
|
|
||||||
switch (type) {
|
|
||||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
|
||||||
nr_fill_ulsch(gNB, UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pusch_pdu);
|
|
||||||
break;
|
|
||||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
|
||||||
nr_fill_pucch(gNB, UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pucch_pdu);
|
|
||||||
break;
|
|
||||||
case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE: {
|
|
||||||
nfapi_nr_prach_pdu_t *prach_pdu = &UL_tti_req->pdus_list[i].prach_pdu;
|
|
||||||
prach_item_t *prach = nr_schedule_rx_prach(gNB, UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
|
||||||
if (!prach)
|
|
||||||
LOG_W(NR_PHY_RACH, "Error in scheduling rach\n");
|
|
||||||
} break;
|
|
||||||
case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE:
|
|
||||||
nr_fill_srs(gNB, UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].srs_pdu);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void nr_schedule_tx_req(PHY_VARS_gNB *gNB, nfapi_nr_tx_data_request_t *TX_req)
|
|
||||||
{
|
|
||||||
DevAssert(gNB != NULL);
|
|
||||||
DevAssert(TX_req != NULL);
|
|
||||||
processingData_L1tx_t *msgTx = gNB->msgDataTx;
|
|
||||||
|
|
||||||
for (int idx = 0; idx < TX_req->Number_of_PDUs; ++idx) {
|
|
||||||
uint8_t *sdu = (uint8_t *)TX_req->pdu_list[idx].TLVs[0].value.direct;
|
|
||||||
nr_fill_dlsch_tx_req(msgTx, idx, sdu);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void nr_schedule_ul_dci_req(PHY_VARS_gNB *gNB, nfapi_nr_ul_dci_request_t *UL_dci_req)
|
|
||||||
{
|
|
||||||
DevAssert(gNB != NULL);
|
|
||||||
DevAssert(UL_dci_req != NULL);
|
|
||||||
processingData_L1tx_t *msgTx = gNB->msgDataTx;
|
|
||||||
|
|
||||||
msgTx->num_ul_pdcch = UL_dci_req->numPdus;
|
|
||||||
for (int i = 0; i < UL_dci_req->numPdus; i++)
|
|
||||||
msgTx->ul_pdcch_pdu[i] = UL_dci_req->ul_dci_pdu_list[i].pdcch_pdu;
|
|
||||||
}
|
|
||||||
|
|
||||||
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO)
|
|
||||||
{
|
|
||||||
// copy data from L2 interface into L1 structures
|
|
||||||
module_id_t Mod_id = Sched_INFO->module_id;
|
|
||||||
frame_t frame = Sched_INFO->frame;
|
|
||||||
slot_t slot = Sched_INFO->slot;
|
|
||||||
|
|
||||||
AssertFatal(RC.gNB != NULL, "RC.gNB is null\n");
|
|
||||||
AssertFatal(RC.gNB[Mod_id] != NULL, "RC.gNB[%d] is null\n", Mod_id);
|
|
||||||
|
|
||||||
PHY_VARS_gNB *gNB = RC.gNB[Mod_id];
|
|
||||||
start_meas(&gNB->schedule_response_stats);
|
|
||||||
|
|
||||||
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
|
||||||
|
|
||||||
int slot_type = nr_slot_select(cfg, frame, slot);
|
|
||||||
|
|
||||||
clear_slot_beamid(gNB, slot); // reset beam_id information for the slot to be processed
|
|
||||||
DevAssert(NFAPI_MODE == NFAPI_MONOLITHIC);
|
|
||||||
bool is_dl = slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT;
|
|
||||||
|
|
||||||
processingData_L1tx_t *msgTx = gNB->msgDataTx;
|
|
||||||
/* store the sched_response_id for the TX thread to release it when done */
|
|
||||||
msgTx->sched_response_id = Sched_INFO->sched_response_id;
|
|
||||||
|
|
||||||
DevAssert(Sched_INFO->DL_req.SFN == frame);
|
|
||||||
DevAssert(Sched_INFO->DL_req.Slot == slot);
|
|
||||||
|
|
||||||
if (is_dl) {
|
|
||||||
nr_schedule_dl_tti_req(gNB, &Sched_INFO->DL_req);
|
|
||||||
}
|
|
||||||
|
|
||||||
nr_schedule_ul_tti_req(gNB, &Sched_INFO->UL_tti_req);
|
|
||||||
|
|
||||||
if (is_dl) {
|
|
||||||
nr_schedule_tx_req(gNB, &Sched_INFO->TX_req);
|
|
||||||
|
|
||||||
nr_schedule_ul_dci_req(gNB, &Sched_INFO->UL_dci_req);
|
|
||||||
/* Both the current thread and the TX thread will access the sched_info
|
|
||||||
* at the same time, so increase its reference counter, so that it is
|
|
||||||
* released only when both threads are done with it.
|
|
||||||
*/
|
|
||||||
inc_ref_sched_response(Sched_INFO->sched_response_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this thread is done with the sched_info, decrease the reference counter */
|
|
||||||
if ((slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT) && NFAPI_MODE == NFAPI_MONOLITHIC) {
|
|
||||||
LOG_D(NR_PHY, "Calling dref_sched_response for id %d in %d.%d (sched_response)\n", Sched_INFO->sched_response_id, frame, slot);
|
|
||||||
deref_sched_response(Sched_INFO->sched_response_id);
|
|
||||||
}
|
|
||||||
stop_meas(&gNB->schedule_response_stats);
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \file fapi_nr_l1.h
|
|
||||||
* \brief function prototypes for FAPI L1 interface
|
|
||||||
* \author R. Knopp, WEI-TAI CHEN
|
|
||||||
* \date 2017, 2018
|
|
||||||
* \version 0.1
|
|
||||||
* \company Eurecom, NTUST
|
|
||||||
* \email: knopp@eurecom.fr, kroempa@gmail.com
|
|
||||||
* \note
|
|
||||||
* \warning
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "PHY/defs_gNB.h"
|
|
||||||
#include "SCHED_NR/sched_nr.h"
|
|
||||||
#include "nfapi_nr_interface_scf.h"
|
|
||||||
|
|
||||||
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO);
|
|
||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "PHY/defs_gNB.h"
|
#include "PHY/defs_gNB.h"
|
||||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||||
#include "nfapi_nr_interface_scf.h"
|
#include "nfapi_nr_interface_scf.h"
|
||||||
#include "fapi_nr_l1.h"
|
|
||||||
#include "nfapi_pnf.h"
|
#include "nfapi_pnf.h"
|
||||||
#include "common/utils/LOG/log.h"
|
#include "common/utils/LOG/log.h"
|
||||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
#include "PHY/NR_TRANSPORT/nr_dci.h"
|
#include "PHY/NR_TRANSPORT/nr_dci.h"
|
||||||
#include "PHY/NR_ESTIMATION/nr_ul_estimation.h"
|
#include "PHY/NR_ESTIMATION/nr_ul_estimation.h"
|
||||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h"
|
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h"
|
||||||
#include "fapi_nr_l1.h"
|
|
||||||
#include "common/utils/LOG/log.h"
|
#include "common/utils/LOG/log.h"
|
||||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||||
#include "PHY/INIT/nr_phy_init.h"
|
#include "PHY/INIT/nr_phy_init.h"
|
||||||
|
|||||||
@@ -41,7 +41,6 @@
|
|||||||
#include "nfapi/oai_integration/gnb_ind_vars.h"
|
#include "nfapi/oai_integration/gnb_ind_vars.h"
|
||||||
#include "nfapi/oai_integration/vendor_ext.h"
|
#include "nfapi/oai_integration/vendor_ext.h"
|
||||||
#include "nfapi_interface.h"
|
#include "nfapi_interface.h"
|
||||||
#include "openair2/NR_PHY_INTERFACE/nr_sched_response.h"
|
|
||||||
#include "openair2/PHY_INTERFACE/queue_t.h"
|
#include "openair2/PHY_INTERFACE/queue_t.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "nfapi/oai_integration/nfapi_pnf.h"
|
#include "nfapi/oai_integration/nfapi_pnf.h"
|
||||||
@@ -486,8 +485,6 @@ NR_IF_Module_t *NR_IF_Module_init(int Mod_id) {
|
|||||||
"allocation of nr_if_inst[%d]->if_mutex fails\n",Mod_id);
|
"allocation of nr_if_inst[%d]->if_mutex fails\n",Mod_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
init_sched_response();
|
|
||||||
|
|
||||||
return nr_if_inst[Mod_id];
|
return nr_if_inst[Mod_id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ typedef struct {
|
|||||||
typedef struct NR_IF_Module_s {
|
typedef struct NR_IF_Module_s {
|
||||||
//define the function pointer
|
//define the function pointer
|
||||||
void (*NR_UL_indication)(NR_UL_IND_t *UL_INFO);
|
void (*NR_UL_indication)(NR_UL_IND_t *UL_INFO);
|
||||||
void (*NR_Schedule_response)(NR_Sched_Rsp_t *Sched_INFO);
|
|
||||||
void (*NR_slot_indication)(const nfapi_nr_slot_indication_scf_t *ind, NR_Sched_Rsp_t *rsp);
|
void (*NR_slot_indication)(const nfapi_nr_slot_indication_scf_t *ind, NR_Sched_Rsp_t *rsp);
|
||||||
void (*NR_PHY_config_req)(NR_PHY_Config_t *config_INFO);
|
void (*NR_PHY_config_req)(NR_PHY_Config_t *config_INFO);
|
||||||
uint32_t CC_mask;
|
uint32_t CC_mask;
|
||||||
@@ -137,7 +136,4 @@ NR_IF_Module_t *NR_IF_Module_init(int Mod_id);
|
|||||||
|
|
||||||
void NR_IF_Module_kill(int Mod_id);
|
void NR_IF_Module_kill(int Mod_id);
|
||||||
|
|
||||||
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
|
|
||||||
void NR_Schedule_Response(NR_Sched_Rsp_t *Sched_INFO);
|
|
||||||
|
|
||||||
#endif /*_NFAPI_INTERFACE_NR_H_*/
|
#endif /*_NFAPI_INTERFACE_NR_H_*/
|
||||||
|
|||||||
@@ -1,157 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* sched response memory management */
|
|
||||||
|
|
||||||
/* A system with reference counting is implemented.
|
|
||||||
* It is needed because several threads will access the structure,
|
|
||||||
* which has to be released only when all the threads are done with it.
|
|
||||||
* So the main thread allocates a sched_response with allocate_sched_response()
|
|
||||||
* which allocates a sched_response with a reference counter == 1
|
|
||||||
* and then for each other thread that will access sched_response, a
|
|
||||||
* call to inc_ref_sched_response() is done. When a thread has finished
|
|
||||||
* using the sched_response, it calls deref_sched_response() which will
|
|
||||||
* in turn call release_sched_response() when the reference counter becomes 0.
|
|
||||||
*
|
|
||||||
* The several threads in question are accessing the _same_ sched_response,
|
|
||||||
* it has not to be confused with the various TX processes that may run in
|
|
||||||
* parallel and which are accessing _different_ sched_response (the maximum
|
|
||||||
* number of parallel processes is N_RESP).
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "nr_sched_response.h"
|
|
||||||
#include <pthread.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "NR_PHY_INTERFACE/NR_IF_Module.h"
|
|
||||||
#include "common/utils/LOG/log.h"
|
|
||||||
#include "common/utils/assertions.h"
|
|
||||||
|
|
||||||
#define N_RESP 3
|
|
||||||
static NR_Sched_Rsp_t resp[N_RESP];
|
|
||||||
static int resp_refcount[N_RESP];
|
|
||||||
static int resp_freelist_next[N_RESP];
|
|
||||||
static int resp_freelist_head;
|
|
||||||
static pthread_mutex_t resp_mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
||||||
static bool resp_freelist_inited = false;
|
|
||||||
|
|
||||||
void init_sched_response(void)
|
|
||||||
{
|
|
||||||
/* init only once */
|
|
||||||
if (pthread_mutex_lock(&resp_mutex))
|
|
||||||
AssertFatal(0, "pthread_mutex_lock failed\n");
|
|
||||||
if (resp_freelist_inited) {
|
|
||||||
if (pthread_mutex_unlock(&resp_mutex))
|
|
||||||
AssertFatal(0, "pthread_mutex_unlock failed\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
resp_freelist_inited = true;
|
|
||||||
if (pthread_mutex_unlock(&resp_mutex))
|
|
||||||
AssertFatal(0, "pthread_mutex_unlock failed\n");
|
|
||||||
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < N_RESP - 1; i++)
|
|
||||||
resp_freelist_next[i] = i + 1;
|
|
||||||
resp_freelist_next[N_RESP - 1] = -1;
|
|
||||||
resp_freelist_head = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
NR_Sched_Rsp_t *allocate_sched_response(void)
|
|
||||||
{
|
|
||||||
NR_Sched_Rsp_t *ret;
|
|
||||||
int new_head;
|
|
||||||
|
|
||||||
if (pthread_mutex_lock(&resp_mutex))
|
|
||||||
AssertFatal(0, "pthread_mutex_lock failed\n");
|
|
||||||
|
|
||||||
AssertFatal(resp_freelist_inited, "sched_response used before init\n");
|
|
||||||
|
|
||||||
if (resp_freelist_head == -1) {
|
|
||||||
LOG_E(PHY, "fatal: sched_response cannot be allocated, increase N_RESP\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = &resp[resp_freelist_head];
|
|
||||||
ret->sched_response_id = resp_freelist_head;
|
|
||||||
resp_refcount[resp_freelist_head] = 1;
|
|
||||||
|
|
||||||
new_head = resp_freelist_next[resp_freelist_head];
|
|
||||||
resp_freelist_next[resp_freelist_head] = -1;
|
|
||||||
resp_freelist_head = new_head;
|
|
||||||
|
|
||||||
if (pthread_mutex_unlock(&resp_mutex))
|
|
||||||
AssertFatal(0, "pthread_mutex_unlock failed\n");
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void release_sched_response(int sched_response_id)
|
|
||||||
{
|
|
||||||
LOG_D(NR_MAC,"Releasing sched_response %d\n",sched_response_id);
|
|
||||||
resp_freelist_next[sched_response_id] = resp_freelist_head;
|
|
||||||
resp_freelist_head = sched_response_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
void deref_sched_response(int sched_response_id)
|
|
||||||
{
|
|
||||||
/* simulators (ulsim/dlsim) deal with their own sched_response but call
|
|
||||||
* functions that call this one, let's handle this case with a special
|
|
||||||
* value -1 where we do nothing (yes it's a hack)
|
|
||||||
*/
|
|
||||||
if (sched_response_id == -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (pthread_mutex_lock(&resp_mutex))
|
|
||||||
AssertFatal(0, "pthread_mutex_lock failed\n");
|
|
||||||
|
|
||||||
AssertFatal(resp_freelist_inited, "sched_response used before init\n");
|
|
||||||
AssertFatal(resp_refcount[sched_response_id] > 0, "sched_reponse decreased too much\n");
|
|
||||||
|
|
||||||
LOG_D(NR_MAC,"resp_refcount[%d] %d\n",sched_response_id,resp_refcount[sched_response_id]);
|
|
||||||
resp_refcount[sched_response_id]--;
|
|
||||||
if (resp_refcount[sched_response_id] == 0)
|
|
||||||
release_sched_response(sched_response_id);
|
|
||||||
|
|
||||||
if (pthread_mutex_unlock(&resp_mutex))
|
|
||||||
AssertFatal(0, "pthread_mutex_unlock failed\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void inc_ref_sched_response(int sched_response_id)
|
|
||||||
{
|
|
||||||
/* simulators (ulsim/dlsim) deal with their own sched_response but call
|
|
||||||
* functions that call this one, let's handle this case with a special
|
|
||||||
* value -1 where we do nothing (yes it's a hack)
|
|
||||||
*/
|
|
||||||
if (sched_response_id == -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
LOG_D(NR_MAC,"Incrementing sched_resp resp_refounct[%d] = %d\n",
|
|
||||||
sched_response_id,resp_refcount[sched_response_id]);
|
|
||||||
if (pthread_mutex_lock(&resp_mutex))
|
|
||||||
AssertFatal(0, "pthread_mutex_lock failed\n");
|
|
||||||
|
|
||||||
AssertFatal(resp_freelist_inited, "sched_response used before init\n");
|
|
||||||
|
|
||||||
resp_refcount[sched_response_id]++;
|
|
||||||
|
|
||||||
if (pthread_mutex_unlock(&resp_mutex))
|
|
||||||
AssertFatal(0, "pthread_mutex_unlock failed\n");
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef OPENAIR2_NR_PHY_INTERFACE_NR_SCHED_RESPONSE_H
|
|
||||||
#define OPENAIR2_NR_PHY_INTERFACE_NR_SCHED_RESPONSE_H
|
|
||||||
|
|
||||||
#include "NR_IF_Module.h"
|
|
||||||
|
|
||||||
void init_sched_response(void);
|
|
||||||
NR_Sched_Rsp_t *allocate_sched_response(void);
|
|
||||||
void deref_sched_response(int sched_response_id);
|
|
||||||
void inc_ref_sched_response(int sched_response_id);
|
|
||||||
|
|
||||||
#endif /* OPENAIR2_NR_PHY_INTERFACE_NR_SCHED_RESPONSE_H */
|
|
||||||
Reference in New Issue
Block a user