Commit 8eb94115 authored by Matthieu Kanj's avatar Matthieu Kanj

removing some included files in openair2/LAYER2/MAC/eNB_scheduler_dlsch_NB_IoT.c

+renaming functions and variables
+adding missing NB_IoT functions
parent 84c9c889
...@@ -8,6 +8,15 @@ ...@@ -8,6 +8,15 @@
//#include "openair2/PHY_INTERFACE/IF_Module_nb_iot.h" //#include "openair2/PHY_INTERFACE/IF_Module_nb_iot.h"
#include "openair2/PHY_INTERFACE/nfapi_interface.h" #include "openair2/PHY_INTERFACE/nfapi_interface.h"
enum openair_HARQ_TYPE_NB_IoT {
openair_harq_DL_NB_IoT = 0,
openair_harq_UL_NB_IoT,
openair_harq_RA_NB_IoT
};
void process_schedule_rsp_NB_IoT(Sched_Rsp_t *sched_rsp, void process_schedule_rsp_NB_IoT(Sched_Rsp_t *sched_rsp,
PHY_VARS_eNB_NB_IoT *eNB, PHY_VARS_eNB_NB_IoT *eNB,
eNB_rxtx_proc_NB_IoT_t *proc); eNB_rxtx_proc_NB_IoT_t *proc);
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
#include "defs_NB_IoT.h"
......
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
#include "msc.h" #include "msc.h"
//#include "SCHED/defs.h" //#include "SCHED/defs.h"
#include "SCHED/extern.h" #include "SCHED/extern_NB_IoT.h"
//#include "LAYER2/MAC/defs.h" //#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern_NB_IoT.h"
#include "LAYER2/MAC/proto.h" //#include "LAYER2/MAC/proto_NB_IoT.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
//#include "UTIL/OPT/opt.h" //#include "UTIL/OPT/opt.h"
...@@ -188,7 +188,7 @@ void schedule_RA_NB_IoT(module_id_t module_idP,frame_t frameP, sub_frame_t subfr ...@@ -188,7 +188,7 @@ void schedule_RA_NB_IoT(module_id_t module_idP,frame_t frameP, sub_frame_t subfr
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \n", LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \n",
module_idP,CC_id,frameP,subframeP); module_idP,CC_id,frameP,subframeP);
// Get candidate harq_pid from PHY // Get candidate harq_pid from PHY
mac_xface->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,openair_harq_RA); mac_xface->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,openair_harq_RA_NB_IoT);
if (round>0) { if (round>0) {
//RA_template->wait_ack_Msg4++; //RA_template->wait_ack_Msg4++;
......
...@@ -29,40 +29,44 @@ ...@@ -29,40 +29,44 @@
*/ */
#include "assertions.h" //#include "assertions.h"
//#include "PHY/defs.h" //#include "PHY/defs.h"
#include "PHY/extern.h" //#include "PHY/extern_NB_IoT.h"
#include "SCHED/defs.h" //#include "SCHED/defs.h"
#include "SCHED/extern.h" //#include "SCHED/extern.h"
#include "LAYER2/MAC/defs.h" //#include "SCHED/defs_NB_IoT.h"
#include "LAYER2/MAC/proto.h" //#include "SCHED/extern_NB_IoT.h"
#include "LAYER2/MAC/extern.h"
//#include "LAYER2/MAC/defs.h"
//#include "LAYER2/MAC/proto.h"
//#include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h" //#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h" //#include "UTIL/OPT/opt.h"
#include "OCG.h" //#include "OCG.h"
#include "OCG_extern.h" //#include "OCG_extern.h"
//NB-IoT //NB-IoT
#include "PHY/defs_NB_IoT.h" //#include "PHY/defs_NB_IoT.h"
#include "defs_NB_IoT.h" //#include "LAYER2/MAC/defs_NB_IoT.h"
#include "proto_NB_IoT.h" #include "LAYER2/MAC/proto_NB_IoT.h"
#include "LAYER2/MAC/extern_NB_IoT.h"
#include "RRC/LITE/extern.h" //#include "RRC/LITE/extern_NB_IoT.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" //#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
//#include "LAYER2/MAC/pre_processor.c" //#include "LAYER2/MAC/pre_processor.c"
#include "pdcp.h" //#include "pdcp.h"
//#include "COMMON/platform_types.h"
#include "SIMULATION/TOOLS/defs.h" // for taus //#include "SIMULATION/TOOLS/defs.h" // for taus
/*
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
# include "intertask_interface.h" # include "intertask_interface.h"
#endif #endif
#include "T.h" #include "T.h"
*/
#define ENABLE_MAC_PAYLOAD_DEBUG #define ENABLE_MAC_PAYLOAD_DEBUG
//#define DEBUG_eNB_SCHEDULER 1 //#define DEBUG_eNB_SCHEDULER 1
...@@ -87,7 +91,7 @@ uint8_t *get_dlsch_sdu_NB_IoT( ...@@ -87,7 +91,7 @@ uint8_t *get_dlsch_sdu_NB_IoT(
return((unsigned char *)&eNB->common_channels[CC_id].BCCH_pdu.payload[0]); return((unsigned char *)&eNB->common_channels[CC_id].BCCH_pdu.payload[0]);
} }
UE_id = find_UE_id(module_idP,rntiP); UE_id = find_UE_id_NB_IoT(module_idP,rntiP);
if (UE_id != -1) { if (UE_id != -1) {
LOG_D(MAC,"[eNB %d] Frame %d: CC_id %d Get DLSCH sdu for rnti %x => UE_id %d\n",module_idP,frameP,CC_id,rntiP,UE_id); LOG_D(MAC,"[eNB %d] Frame %d: CC_id %d Get DLSCH sdu for rnti %x => UE_id %d\n",module_idP,frameP,CC_id,rntiP,UE_id);
......
...@@ -64,6 +64,31 @@ ...@@ -64,6 +64,31 @@
/*TODO NB_mac_phy_remove_ue*/ /*TODO NB_mac_phy_remove_ue*/
//------------------------------------------------------------------------------
int find_UE_id_NB_IoT(module_id_t mod_idP, rnti_t rntiP)
//------------------------------------------------------------------------------
{
int UE_id;
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX_NB_IoT; UE_id++) {
if (UE_list->active[UE_id] != TRUE) continue;
if (UE_list->UE_template[UE_PCCID_NB_IoT(mod_idP,UE_id)][UE_id].rnti==rntiP) {
return(UE_id);
}
}
return(-1);
}
//------------------------------------------------------------------------------
int UE_PCCID_NB_IoT(module_id_t mod_idP,int ue_idP)
//------------------------------------------------------------------------------
{
return(eNB_mac_inst_NB_IoT[mod_idP].UE_list.pCC_id[ue_idP]);
}
int rrc_mac_remove_ue_NB_IoT( int rrc_mac_remove_ue_NB_IoT(
module_id_t mod_idP, module_id_t mod_idP,
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
// #ifdef PHY_EMUL // #ifdef PHY_EMUL
// //#include "SIMULATION/simulation_defs.h" // //#include "SIMULATION/simulation_defs.h"
// #endif //PHY_EMUL // #endif //PHY_EMUL
#include "PHY_INTERFACE/defs.h" #include "PHY_INTERFACE/defs.h" // should be replaced by PHY_INTERFACE/defs_NB_IoT.h (create MAC_xface for NB_IoT)
#include "RRC/LITE/defs.h" //#include "RRC/LITE/defs.h"
#ifdef NB_IOT #ifdef NB_IOT
#include "defs_NB_IoT.h" #include "defs_NB_IoT.h"
...@@ -79,10 +79,10 @@ extern eNB_MAC_INST_NB_IoT *eNB_mac_inst_NB_IoT; ...@@ -79,10 +79,10 @@ extern eNB_MAC_INST_NB_IoT *eNB_mac_inst_NB_IoT;
// //#ifndef USER_MODE // //#ifndef USER_MODE
// extern MAC_xface *mac_xface; extern MAC_xface *mac_xface;
// extern RRC_XFACE *Rrc_xface; // extern RRC_XFACE *Rrc_xface;
// extern uint8_t Is_rrc_registered; extern uint8_t Is_rrc_registered;
#ifndef PHY_EMUL #ifndef PHY_EMUL
#ifndef PHYSIM #ifndef PHYSIM
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file LAYER2/MAC/proto.h /*! \file LAYER2/MAC/proto_NB_IoT.h
* \brief MAC functions prototypes for eNB and UE * \brief MAC functions prototypes for eNB and UE
* \author Navid Nikaein and Raymond Knopp * \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014 * \date 2010 - 2014
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
#ifndef __LAYER2_MAC_PROTO_NB_IoT_H__ #ifndef __LAYER2_MAC_PROTO_NB_IoT_H__
#define __LAYER2_MAC_PROTO_NB_IoT_H__ #define __LAYER2_MAC_PROTO_NB_IoT_H__
#include "openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h"
#include "COMMON/platform_types.h"
/** \addtogroup _mac /** \addtogroup _mac
* @{ * @{
*/ */
...@@ -70,4 +71,7 @@ int l2_init_eNB_NB_IoT(void); ...@@ -70,4 +71,7 @@ int l2_init_eNB_NB_IoT(void);
int mac_init_global_param_NB_IoT(void); int mac_init_global_param_NB_IoT(void);
int mac_top_init_NB_IoT(void); int mac_top_init_NB_IoT(void);
int find_UE_id_NB_IoT (module_id_t module_idP, rnti_t rnti) ;
int UE_PCCID_NB_IoT (module_id_t module_idP, int UE_id);
#endif #endif
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
*/ */
//#include "PHY/defs.h" //#include "PHY/defs.h"
#include "PHY/defs_NB_IoT.h" #include "PHY/defs_NB_IoT.h"
#include "openair2/LAYER2/MAC/proto_NB_IoT.h"
#include "PHY/INIT/defs_NB_IoT.h" #include "PHY/INIT/defs_NB_IoT.h"
#include "SCHED/defs.h" #include "SCHED/defs.h"
#include "platform_types.h" #include "platform_types.h"
...@@ -588,7 +589,7 @@ int rrc_mac_config_req_eNB_NB_IoT( ...@@ -588,7 +589,7 @@ int rrc_mac_config_req_eNB_NB_IoT(
int UE_id = -1; int UE_id = -1;
//UE_list_NB_IoT_t *UE_list= &eNB_mac_inst_NB_IoT->UE_list; //UE_list_NB_IoT_t *UE_list= &eNB_mac_inst_NB_IoT->UE_list;
UE_id = find_UE_id(Mod_idP, rntiP); UE_id = find_UE_id_NB_IoT(Mod_idP, rntiP);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
...@@ -1371,13 +1372,14 @@ void dump_ue_list_NB_IoT(UE_list_NB_IoT_t *listP, int ul_flag) ...@@ -1371,13 +1372,14 @@ void dump_ue_list_NB_IoT(UE_list_NB_IoT_t *listP, int ul_flag)
//defined in eNB_scheduler_primitives.c //defined in eNB_scheduler_primitives.c
/*
int rrc_mac_remove_ue_NB_IoT( int rrc_mac_remove_ue_NB_IoT(
module_id_t mod_idP, module_id_t mod_idP,
rnti_t rntiP) rnti_t rntiP)
{ {
int i; int i;
UE_list_NB_IoT_t *UE_list = &eNB_mac_inst_NB_IoT[mod_idP].UE_list; UE_list_NB_IoT_t *UE_list = &eNB_mac_inst_NB_IoT[mod_idP].UE_list;
int UE_id = find_UE_id(mod_idP,rntiP); //may should be changed int UE_id = find_UE_id_NB_IoT(mod_idP,rntiP); //may should be changed
int pCC_id; int pCC_id;
if (UE_id == -1) { if (UE_id == -1) {
...@@ -1431,7 +1433,7 @@ printf("MAC: remove UE %d rnti %x\n", UE_id, rntiP); ...@@ -1431,7 +1433,7 @@ printf("MAC: remove UE %d rnti %x\n", UE_id, rntiP);
return 0; return 0;
} }
*/
//defined in L2_interface //defined in L2_interface
void mac_eNB_rrc_ul_in_sync_NB_IoT( void mac_eNB_rrc_ul_in_sync_NB_IoT(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment