Commit 899c178d authored by gauthier's avatar gauthier

Now virtualization should be OK.

TO DO :test RF and ethernet emulation.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5086 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 791d449b
......@@ -144,6 +144,7 @@
#include "PHY/TOOLS/time_meas.h"
#include "PHY/CODING/defs.h"
#include "PHY/TOOLS/defs.h"
#include "platform_types.h"
#ifdef OPENAIR_LTE
......@@ -180,10 +181,10 @@ enum transmission_access_mode{
/// Top-level PHY Data Structure for eNB
typedef struct {
/// Module ID indicator for this instance
u8 Mod_id;
module_id_t Mod_id;
u8 local_flag;
unsigned int rx_total_gain_eNB_dB;
u32 frame;
frame_t frame;
LTE_DL_FRAME_PARMS lte_frame_parms;
PHY_MEASUREMENTS_eNB PHY_measurements_eNB[NUMBER_OF_eNB_SECTORS_MAX]; /// Measurement variables
LTE_eNB_COMMON lte_eNB_common_vars;
......
......@@ -1010,7 +1010,7 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
// Check for SR and do ACK/NACK accordingly
if (is_SR_TXOp(phy_vars_ue,eNB_id,next_slot>>1)==1) {
LOG_I(PHY,"[UE %d][SR %x] Frame %d subframe %d: got SR_TXOp, Checking for SR for PUSCH from MAC\n",
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d: got SR_TXOp, Checking for SR for PUSCH from MAC\n",
phy_vars_ue->Mod_id,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,phy_vars_ue->frame,next_slot>>1);
#ifdef OPENAIR2
SR_payload = mac_xface->ue_get_SR(phy_vars_ue->Mod_id,
......@@ -1024,7 +1024,7 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
if (SR_payload>0) {
generate_ul_signal = 1;
LOG_I(PHY,"[UE %d][SR %x] Frame %d subframe %d got the SR for PUSCH is %d\n",
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d got the SR for PUSCH is %d\n",
phy_vars_ue->Mod_id,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,phy_vars_ue->frame,next_slot>>1,SR_payload);
}
else {
......
......@@ -333,8 +333,8 @@ typedef struct{ //RRC_INTERFACE_FUNCTIONS
char (*openair_rrc_eNB_init)(u8 );
char (*openair_rrc_UE_init)(u8, u8);
RRC_status_t (*rrc_rx_tx)(u8,u32,u8,u8);
u8 (*mac_rrc_data_ind)(u8,u32,u16,u8 *,u16,u8 eNB_flag, u8 eNB_index);
u8 (*mac_rrc_data_req)(u8,u32,u16,u8,u8 *,u8 eNB_flag, u8 eNB_index);
u8 (*mac_rrc_data_ind)(u8,u32,u16,u8 *,u16,eNB_flag_t eNB_flag, u8 eNB_index);
u8 (*mac_rrc_data_req)(u8,u32,u16,u8,u8 *,eNB_flag_t eNB_flag, u8 eNB_index);
void (*mac_rrc_meas_ind)(u8,MAC_MEAS_REQ_ENTRY*);
void (*def_meas_ind)(u8, u8);
void (*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , char*);
......@@ -352,12 +352,7 @@ typedef struct{
unsigned short (*mac_config_req)(u8,u8,MAC_CONFIG_REQ*);
MAC_MEAS_REQ_ENTRY* (*mac_meas_req)(u8 , MAC_MEAS_REQ*);
void (*mac_out_of_sync_ind)(u8,u32,unsigned short);
//u8 (*mac_rrc_data_ind)(u8,unsigned short,char *,u8);
//u8 (*mac_rrc_data_req)( u8, unsigned short, u8,char *);
//void (*mac_switch_node_function)(u8);
// void (*mac_rlc_exit)(void);
//RLC_INTERFACE_FUNCTIONS
// void (*pdcp_run)(unsigned int);
void (*pdcp_run)(void);
void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char*);
signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t );
......@@ -373,21 +368,18 @@ typedef struct{
u16 *SIperiod
#ifdef Rel10
,
u8 MBMS_Flag,
MBMS_flag_t MBMS_Flag,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList,
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
struct PMCH_InfoList_r9 *pmch_InfoList
#endif
);
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, char*);
void (*mac_rlc_data_ind)(module_id_t, chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t, chan_id_t, tb_size_t, num_tb_t);
void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t, logical_chan_id_t, tb_size_t, num_tb_t);
signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *);
void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ),
void (*rrc_data_confP) (module_id_t , rb_id_t , mui_t ) ) ;
//rlc_op_status_t rrc_rlc_config_req (module_id_t, rb_id_t, rb_type_t, rlc_info_t );
//rlc_op_status_t rrc_rlc_data_req (module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, mem_block_t*);
//void rrc_rlc_register_rrc ( void(*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , mem_block_t*),void(*rrc_data_conf) (module_id_t , rb_id_t , mui_t) );
void (*mrbch_phy_sync_failure) (u8 Mod_id, u32 frame, u8 Free_ch_index);
void (*dl_phy_sync_success) (u8 Mod_id, u32 frame, u8 eNB_index);
}MAC_RLC_XFACE;
......
......@@ -55,8 +55,8 @@
#define MAX_MANAGED_RG_PER_MOBILE 2
#define DEFAULT_RAB_ID 3
#define NB_RB_MAX 11
#define NB_RAB_MAX 8
#define NB_RB_MAX (maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#define NB_RAB_MAX maxDRB /* was 8, now 11 */
#define RAB_SHIFT1 9
#define RAB_SHIFT2 3
#define RAB_OFFSET 0x0007
......@@ -69,36 +69,36 @@
#ifdef MESH
# define MAX_RB_MOBILE NB_RB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
# define MAX_RAB_MOBILE NB_RAB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
# define MAX_RB_RG MAX_RB_MOBILE //NB_RB_MAX * MAX_MOBILES_PER_RG
# define MAX_RAB_RG (NB_RB_MAX+1) * (MAX_MOBILES_PER_RG + 1)
# define MAX_RAB MAX_RAB_RG
# define MAX_RB MAX_RB_RG
//# define MAX_RB_MOBILE NB_RB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
//# define MAX_RAB_MOBILE NB_RAB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
//# define MAX_RB_RG MAX_RB_MOBILE //NB_RB_MAX * MAX_MOBILES_PER_RG
//# define MAX_RAB_RG (NB_RB_MAX+1) * (MAX_MOBILES_PER_RG + 1)
//# define MAX_RAB MAX_RAB_RG
//# define MAX_RB MAX_RB_RG
#else
# define MAX_RB_MOBILE NB_RB_MAX * MAX_MANAGED_RG_PER_MOBILE
# define MAX_RAB_MOBILE NB_RAB_MAX * MAX_MANAGED_RG_PER_MOBILE
# define MAX_RB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
# define MAX_RAB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
# //ifdef NODE_RG
# define MAX_RAB MAX_RAB_RG
# define MAX_RB MAX_RB_RG
# //else
# // ifdef NODE_MT
# // define MAX_RAB MAX_RAB_MOBILE
# // define MAX_RB MAX_RB_MOBILE
# //else
# //error NODE_RG or NODE_MT must be defined
# //endif
//# define MAX_RB_MOBILE NB_RB_MAX * MAX_MANAGED_RG_PER_MOBILE
//# define MAX_RAB_MOBILE NB_RAB_MAX * MAX_MANAGED_RG_PER_MOBILE
//# define MAX_RB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
//# define MAX_RAB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
//# ifdef NODE_RG
//# define MAX_RAB MAX_RAB_RG
//# define MAX_RB MAX_RB_RG
//# else
//# // ifdef NODE_MT
//# // define MAX_RAB MAX_RAB_MOBILE
//# // define MAX_RB MAX_RB_MOBILE
//# //else
//# //error NODE_RG or NODE_MT must be defined
//# //endif
//# endif
#endif //MESH
// RLC_MODE
# define RLC_NONE 0
# define RLC_MODE_AM 1
# define RLC_MODE_TM 2
# define RLC_MODE_UM 3
# define RLC_NONE (rlc_mode_t)0
# define RLC_MODE_AM (rlc_mode_t)1
# define RLC_MODE_TM (rlc_mode_t)2
# define RLC_MODE_UM (rlc_mode_t)3
//E_R
# define E_R_RLC_ER_RELEASE 1
......
......@@ -25,19 +25,29 @@ typedef signed long int s64_t;
typedef unsigned int config_action_t;
typedef unsigned int sdu_size_t;
typedef u16_t sdu_size_t;
typedef s16_t sdu_ssize_t;
typedef unsigned int tbs_size_t;
typedef unsigned int tb_size_t;
typedef unsigned int rb_id_t;
typedef unsigned int module_id_t;
typedef u16_t rb_id_t;
typedef u16_t srb_id_t;
typedef u32_t frame_t;
typedef u32_t sub_frame_t;
typedef u8_t module_id_t;
typedef unsigned int mui_t;
typedef unsigned int confirm_t;
typedef unsigned int rb_type_t;
typedef rb_id_t chan_id_t;
typedef unsigned int logical_chan_id_t;
typedef unsigned int num_tb_t;
typedef unsigned int crc_t;
typedef unsigned int rlc_tx_status_t;
typedef unsigned int rlc_mode_t;
typedef s16_t rlc_sn_t;
typedef u16_t rlc_usn_t;
typedef int traffic_type_t;
typedef u32_t mbms_session_id_t;
typedef u16_t mbms_service_id_t;
typedef u16_t rnti_t;
typedef signed int rlc_op_status_t;
......@@ -47,8 +57,17 @@ typedef unsigned int crc32_t;
typedef signed char boolean_t;
typedef enum MBMS_flag_e {
MBMS_FLAG_NO = 0,
MBMS_FLAG_YES = 1,
} MBMS_flag_t;
typedef enum eNB_flag_e {
ENB_FLAG_NO = 0,
ENB_FLAG_YES = 1,
} eNB_flag_t;
// just for integration
extern unsigned int frame;
extern frame_t frame;
#endif
......@@ -10,7 +10,7 @@
***************************************************************************/
#ifdef OLD_RRC_CELLULAR
# ifndef __RRM_CONFIG_STRUCTS_H__
# define __RRM_CONFIG_STRUCTS_H__
......@@ -171,4 +171,4 @@ typedef volatile struct {
//typedef RG_CONFIG MAIN_RADIO_GATEWAY;
# endif
#endif
......@@ -25,16 +25,16 @@
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
*******************************************************************************/
/*! \file config.c
* \brief UE and eNB configuration
* \author Raymond Knopp, Navid Nikaein
* \date 2013
* \version 0.1
* \email: navid.nikaein@eurecom.fr
* @ingroup _mac
* \brief UE and eNB configuration
* \author Raymond Knopp, Navid Nikaein
* \date 2013
* \version 0.1
* \email: navid.nikaein@eurecom.fr
* @ingroup _mac
*/
*/
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
......@@ -56,35 +56,35 @@
#endif
/* sec 5.9, 36.321: MAC Reset Procedure */
void ue_mac_reset(u8 Mod_id,u8 eNB_index) {
void ue_mac_reset(module_id_t module_idP,u8 eNB_index) {
//Resetting Bj
UE_mac_inst[Mod_id].scheduling_info.Bj[0] = 0;
UE_mac_inst[Mod_id].scheduling_info.Bj[1] = 0;
UE_mac_inst[Mod_id].scheduling_info.Bj[2] = 0;
UE_mac_inst[module_idP].scheduling_info.Bj[0] = 0;
UE_mac_inst[module_idP].scheduling_info.Bj[1] = 0;
UE_mac_inst[module_idP].scheduling_info.Bj[2] = 0;
//Stopping all timers
//timeAlignmentTimer expires
// PHY changes for UE MAC reset
mac_xface->phy_reset_ue(Mod_id,eNB_index);
mac_xface->phy_reset_ue(module_idP,eNB_index);
// notify RRC to relase PUCCH/SRS
// cancel all pending SRs
UE_mac_inst[Mod_id].scheduling_info.SR_pending=0;
UE_mac_inst[Mod_id].scheduling_info.SR_COUNTER=0;
UE_mac_inst[module_idP].scheduling_info.SR_pending=0;
UE_mac_inst[module_idP].scheduling_info.SR_COUNTER=0;
// stop ongoing RACH procedure
// discard explicitly signaled ra_PreambleIndex and ra_RACH_MaskIndex, if any
UE_mac_inst[Mod_id].RA_prach_resources.ra_PreambleIndex = 0; // check!
UE_mac_inst[Mod_id].RA_prach_resources.ra_RACH_MaskIndex = 0;
UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex = 0; // check!
UE_mac_inst[module_idP].RA_prach_resources.ra_RACH_MaskIndex = 0;
ue_init_mac(Mod_id); //This will hopefully do the rest of the MAC reset procedure
ue_init_mac(module_idP); //This will hopefully do the rest of the MAC reset procedure
}
int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,u8 UE_id,u8 eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated,
MeasObjectToAddMod_t **measObj,
......@@ -109,13 +109,13 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
,u8 num_active_cba_groups,
u16 cba_rnti
#endif
) {
) {
int i;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
if (eNB_flag==0) {
if (eNB_flagP==0) {
LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_id,eNB_index);
if (tdd_Config != NULL)
UE_mac_inst[Mod_id].tdd_Config = tdd_Config;
......@@ -128,14 +128,14 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
}
if ((tdd_Config!=NULL)||(SIwindowsize!=NULL)||(SIperiod!=NULL)){
if (eNB_flag==1)
if (eNB_flagP==1)
mac_xface->phy_config_sib1_eNB(Mod_id,tdd_Config,*SIwindowsize,*SIperiod);
else
mac_xface->phy_config_sib1_ue(Mod_id,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
}
if (radioResourceConfigCommon!=NULL) {
if (eNB_flag==1) {
if (eNB_flagP==1) {
LOG_I(MAC,"[CONFIG]SIB2/3 Contents (partial)\n");
LOG_I(MAC,"[CONFIG]pusch_config_common.n_SB = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB);
LOG_I(MAC,"[CONFIG]pusch_config_common.hoppingMode = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode);
......@@ -154,7 +154,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
}
// SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
if (logicalChannelConfig!= NULL) {
if (eNB_flag==0){
if (eNB_flagP==0){
LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_id,eNB_index);
UE_mac_inst[Mod_id].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig;
UE_mac_inst[Mod_id].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid
......@@ -171,7 +171,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
}
if (mac_MainConfig != NULL){
if (eNB_flag==0){
if (eNB_flagP==0){
LOG_I(MAC,"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",Mod_id,eNB_index);
UE_mac_inst[Mod_id].macConfig=mac_MainConfig;
UE_mac_inst[Mod_id].measGapConfig=measGapConfig;
......@@ -227,7 +227,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
}
if (physicalConfigDedicated != NULL) {
if (eNB_flag==1){
if (eNB_flagP==1){
mac_xface->phy_config_dedicated_eNB(Mod_id,find_UE_RNTI(Mod_id,UE_id),physicalConfigDedicated);
}else{
mac_xface->phy_config_dedicated_ue(Mod_id,eNB_index,physicalConfigDedicated);
......@@ -235,7 +235,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
}
}
if (eNB_flag == 0) {
if (eNB_flagP == 0) {
if (measObj!= NULL) {
if (measObj[0]!= NULL){
UE_mac_inst[Mod_id].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count;
......@@ -257,7 +257,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
*/
}
}
if (eNB_flag==0) {
if (eNB_flagP==0) {
if(mobilityControlInfo != NULL) {
LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_id,eNB_index);
......@@ -331,7 +331,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
}
if (mbsfn_SubframeConfigList != NULL) {
if (eNB_flag == 1) {
if (eNB_flagP == 1) {
LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count);
eNB_mac_inst[Mod_id].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
......@@ -357,7 +357,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
#ifdef Rel10
if (mbsfn_AreaInfoList != NULL) {
if (eNB_flag == 1) {
if (eNB_flagP == 1) {
// One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time
LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count);
eNB_mac_inst[Mod_id].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
......@@ -385,7 +385,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
// LOG_I(MAC,"DUY: lcid when entering rrc_mac config_req is %02d\n",(pmch_InfoList->list.array[0]->mbms_SessionInfoList_r9.list.array[0]->logicalChannelIdentity_r9));
if (eNB_flag == 1) {
if (eNB_flagP == 1) {
LOG_I(MAC, "[CONFIG] Number of PMCH in this MBSFN Area %d\n", pmch_InfoList->list.count);
......@@ -417,12 +417,12 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
#endif
#ifdef CBA
if (eNB_flag == 0){
if (eNB_flagP == 0){
if (cba_rnti) {
UE_mac_inst[Mod_id].cba_rnti[num_active_cba_groups-1] = cba_rnti;
LOG_D(MAC,"[UE %d] configure CBA group %d RNTI %x for eNB %d (total active cba group %d)\n",
Mod_id,Mod_id%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups);
mac_xface->phy_config_cba_rnti(Mod_id,eNB_flag,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
mac_xface->phy_config_cba_rnti(Mod_id,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
}
}else {
if (cba_rnti) {
......@@ -435,7 +435,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
//only configure UE ids up to num_active_cba_groups
//we use them as candidates for the transmission of dci format0)
if (UE_id%num_active_cba_groups == i){
mac_xface->phy_config_cba_rnti(Mod_id,eNB_flag,UE_id,cba_rnti + i,i,num_active_cba_groups );
mac_xface->phy_config_cba_rnti(Mod_id,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups );
LOG_D(MAC,"[eNB %d] configure CBA groups %d with RNTI %x for UE %d (total active cba groups %d)\n",
Mod_id, i, eNB_mac_inst[Mod_id].cba_rnti[i],UE_id, num_active_cba_groups);
}
......
......@@ -333,7 +333,7 @@ typedef enum {
// temp struct for sched
typedef struct {
u16 rnti;
rnti_t rnti;
u16 subframe;
u16 serving_num;
UE_ULSCH_STATUS status;
......@@ -341,7 +341,7 @@ typedef struct {
// temp struct for sched
typedef struct {
u16 rnti;
rnti_t rnti;
u16 weight;
u16 subframe;
u16 serving_num;
......@@ -383,7 +383,7 @@ typedef struct{
typedef struct{
/// CRNTI of UE
uint16_t crnti; ///user id (rnti) of connected UEs
rnti_t crnti; ///user id (rnti) of connected UEs
// rrc status
uint8_t rrc_status;
/// harq pid
......@@ -466,7 +466,7 @@ typedef struct{
typedef struct{
/// C-RNTI of UE
u16 rnti;
rnti_t rnti;
/// NDI from last scheduling
uint8_t oldNDI[8];
/// NDI from last UL scheduling
......@@ -566,7 +566,7 @@ typedef struct {
/// Flag to indicate that eNB is waiting for ACK that UE has received Msg3.
u8 wait_ack_Msg4;
/// UE RNTI allocated during RAR
u16 rnti;
rnti_t rnti;
/// RA RNTI allocated from received PRACH
u16 RA_rnti;
/// Received preamble_index
......@@ -597,9 +597,9 @@ typedef struct{
///
u16 Node_id;
/// frame counter
u32 frame;
frame_t frame;
/// subframe counter
u32 subframe;
sub_frame_t subframe;
/// Outgoing DCI for PHY generated by eNB scheduler
DCI_PDU DCI_pdu;
/// Outgoing BCCH pdu for PHY
......@@ -711,13 +711,13 @@ typedef struct {
typedef struct{
u16 Node_id;
/// frame counter
u32 frame;
frame_t frame;
/// subframe counter
u32 subframe;
sub_frame_t subframe;
/// C-RNTI of UE
u16 crnti;
/// C-RNTI of UE before HO
uint16_t crnti_before_ho; ///user id (rnti) of connected UEs
rnti_t crnti_before_ho; ///user id (rnti) of connected UEs
/// uplink active flag
uint8_t ul_active;
/// pointer to RRC PHY configuration
......@@ -858,7 +858,10 @@ unsigned char generate_dlsch_header(unsigned char *mac_header,
@param mbsfn_AreaInfoList pointer to MBSFN Area Info list from SIB13
@param pmch_InfoList pointer to PMCH_InfoList from MBSFNAreaConfiguration Message (MCCH Message)
*/
int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
int rrc_mac_config_req(module_id_t module_idP,
eNB_flag_t eNB_flag,
u8 UE_id,
u8 eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated,
MeasObjectToAddMod_t **measObj,
......@@ -897,7 +900,7 @@ for the message.
@param nprb Pointer to current PRB count
@param nCCE Pointer to current nCCE count
*/
void schedule_RA(u8 Mod_id,u32 frame,u8 subframe,u8 Msg3_subframe,u8 *nprb,unsigned int *nCCE);
void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,u8 Msg3_subframe,u8 *nprb,unsigned int *nCCE);
/** \brief First stage of SI Scheduling. Gets a SI SDU from RRC if available and computes the MCS required to transport it as a function of the SDU length. It assumes a length less than or equal to 64 bytes (MCS 6, 3 PRBs).
@param Mod_id Instance ID of eNB
......@@ -907,21 +910,21 @@ void schedule_RA(u8 Mod_id,u32 frame,u8 subframe,u8 Msg3_subframe,u8 *nprb,unsig
@param nprb Pointer to current PRB count
@param nCCE Pointer to current nCCE count
*/
void schedule_SI(u8 Mod_id,u32 frame,u8 *nprb,unsigned int *nCCE);
void schedule_SI(module_id_t module_idP,frame_t frameP,u8 *nprb,unsigned int *nCCE);
/** \brief MBMS scheduling: Checking the position for MBSFN subframes. Create MSI, transfer MCCH from RRC to MAC, transfer MTCHs from RLC to MAC. Multiplexing MSI,MCCH&MTCHs. Return 1 if there are MBSFN data being allocated, otherwise return 0;
@param Mod_id Instance ID of eNB
@param frame Frame index
@param subframe Subframe number on which to act
*/
int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe);
int schedule_MBMS(module_id_t module_idP,frame_t frameP, sub_frame_t subframe);
/** \brief check the mapping between sf allocation and sync area, Currently only supports 1:1 mapping
@param Mod_id Instance ID of eNB
@param mbsfn_sync_area index of mbsfn sync area
@param[out] index of sf pattern
*/
s8 get_mbsfn_sf_alloction (unsigned char Mod_id, u8 mbsfn_sync_area);
s8 get_mbsfn_sf_alloction (module_id_t module_idP, u8 mbsfn_sync_area);
/** \brief check the mapping between sf allocation and sync area, Currently only supports 1:1 mapping
@param Mod_id Instance ID of eNB
......@@ -929,7 +932,7 @@ s8 get_mbsfn_sf_alloction (unsigned char Mod_id, u8 mbsfn_sync_area);
@param eNB_index index of eNB
@param[out] index of sf pattern
*/
s8 ue_get_mbsfn_sf_alloction (unsigned char Mod_id, u8 mbsfn_sync_area, unsigned char eNB_index);
s8 ue_get_mbsfn_sf_alloction (module_id_t module_idP, u8 mbsfn_sync_area, unsigned char eNB_index);
/** \brief top ULSCH Scheduling for TDD (config 1-6).
@param Mod_id Instance ID of eNB
......@@ -938,7 +941,7 @@ s8 ue_get_mbsfn_sf_alloction (unsigned char Mod_id, u8 mbsfn_sync_area, unsigned
@param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup)
@param nCCE Pointer to current nCCE count
*/
void schedule_ulsch(unsigned char Mod_id,u32 frame,unsigned char cooperation_flag,unsigned char subframe,unsigned char sched_subframe,unsigned int *nCCE);
void schedule_ulsch(module_id_t module_idP,frame_t frameP,unsigned char cooperation_flag,sub_frame_t subframe,unsigned char sched_subframe,unsigned int *nCCE);
/** \brief ULSCH Scheduling per RNTI TDD config (config 1-6).
@param Mod_id Instance ID of eNB
......@@ -947,7 +950,7 @@ void schedule_ulsch(unsigned char Mod_id,u32 frame,unsigned char cooperation_fla
@param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup)
@param nCCE Pointer to current nCCE count
*/
void schedule_ulsch_rnti(u8 Mod_id, unsigned char cooperation_flag, u32 frame, unsigned char subframe, unsigned char sched_subframe, u8 granted_UEs, unsigned int *nCCE, unsigned int *nCCE_available, u16 *first_rb);
void schedule_ulsch_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, u8 granted_UEs, unsigned int *nCCE, unsigned int *nCCE_available, u16 *first_rb);
/** \brief ULSCH Scheduling for CBA RNTI TDD config (config 1-6).
@param Mod_id Instance ID of eNB
......@@ -956,7 +959,7 @@ void schedule_ulsch_rnti(u8 Mod_id, unsigned char cooperation_flag, u32 frame, u
@param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup)
@param nCCE Pointer to current nCCE count
*/
void schedule_ulsch_cba_rnti(u8 Mod_id, unsigned char cooperation_flag, u32 frame, unsigned char subframe, unsigned char sched_subframe, u8 granted_UEs, unsigned int *nCCE, unsigned int *nCCE_available, u16 *first_rb);
void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, u8 granted_UEs, unsigned int *nCCE, unsigned int *nCCE_available, u16 *first_rb);
/** \brief Second stage of DLSCH scheduling, after schedule_SI, schedule_RA and schedule_dlsch have been called. This routine first allocates random frequency assignments for SI and RA SDUs using distributed VRB allocations and adds the corresponding DCI SDU to the DCI buffer for PHY. It then loops over the UE specific DCIs previously allocated and fills in the remaining DCI fields related to frequency allocation. It assumes localized allocation of type 0 (DCI.rah=0). The allocation is done for tranmission modes 1,2,4.
@param Mod_id Instance of eNB
......@@ -966,7 +969,7 @@ void schedule_ulsch_cba_rnti(u8 Mod_id, unsigned char cooperation_flag, u32 fram
@param RA_scheduled RA was scheduled in this subframe
@param mbsfn_flag Indicates that this subframe is for MCH/MCCH
*/
void fill_DLSCH_dci(u8 Mod_id,u32 frame,u8 subframe,u32 rballoc,u8 RA_scheduled,int mbsfn_flag);
void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,u32 rballoc,u8 RA_scheduled,int mbsfn_flag);