Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
08e25bf3
Commit
08e25bf3
authored
Feb 19, 2016
by
MKassem
Committed by
Xenofon Foukas
Feb 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added eNB configuration message
Signed-off-by:
Xenofon Foukas
<
x.foukas@sms.ed.ac.uk
>
parent
258a71ff
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
556 additions
and
8 deletions
+556
-8
openair2/ENB_APP/enb_agent_common.c
openair2/ENB_APP/enb_agent_common.c
+511
-8
openair2/ENB_APP/enb_agent_common.h
openair2/ENB_APP/enb_agent_common.h
+43
-0
openair2/LAYER2/MAC/extern.h
openair2/LAYER2/MAC/extern.h
+2
-0
No files found.
openair2/ENB_APP/enb_agent_common.c
View file @
08e25bf3
...
...
@@ -36,11 +36,13 @@
#include "enb_agent_common.h"
#include "PHY/extern.h"
#include "log.h"
void
*
enb
[
NUM_MAX_ENB
];
void
*
enb_ue
[
NUM_MAX_ENB
];
void
*
enb_rrc
[
NUM_MAX_ENB
];
/*
* message primitives
*/
...
...
@@ -261,14 +263,33 @@ int enb_agent_destroy_echo_reply(Protocol__ProgranMessage *msg) {
return
-
1
;
}
int
enb_agent_enb_config_reply
(
mid_t
mod_id
,
const
void
*
params
,
Protocol__ProgranMessage
**
msg
)
{
/* TODO: Create a reply progRAN message with the current eNB configuration */
return
0
;
}
int
enb_agent_destroy_enb_config_reply
(
Protocol__ProgranMessage
*
msg
)
{
/* TODO: Deallocate memory for a dynamically allocated eNB config message */
if
(
msg
->
msg_case
!=
PROTOCOL__PROGRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG
)
goto
error
;
free
(
msg
->
enb_config_reply_msg
->
header
);
int
i
,
j
;
Protocol__PrpEnbConfigReply
*
reply
=
msg
->
enb_config_reply_msg
;
for
(
i
=
0
;
i
<
reply
->
n_cell_config
;
i
++
){
free
(
reply
->
cell_config
[
i
]
->
mbsfn_subframe_config_rfoffset
);
free
(
reply
->
cell_config
[
i
]
->
mbsfn_subframe_config_rfperiod
);
free
(
reply
->
cell_config
[
i
]
->
mbsfn_subframe_config_sfalloc
);
for
(
j
=
0
;
j
<
reply
->
cell_config
[
i
]
->
si_config
->
n_si_message
;
j
++
){
free
(
reply
->
cell_config
[
i
]
->
si_config
->
si_message
[
j
]);
}
free
(
reply
->
cell_config
[
i
]
->
si_config
->
si_message
);
free
(
reply
->
cell_config
[
i
]
->
si_config
);
free
(
reply
->
cell_config
[
i
]);
}
free
(
reply
->
cell_config
);
free
(
reply
);
free
(
msg
);
return
0
;
error:
//LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return
-
1
;
}
int
enb_agent_ue_config_reply
(
mid_t
mod_id
,
const
void
*
params
,
Protocol__ProgranMessage
**
msg
)
{
...
...
@@ -292,8 +313,16 @@ int enb_agent_destroy_lc_config_reply(Protocol__ProgranMessage *msg) {
}
int
enb_agent_destroy_enb_config_request
(
Protocol__ProgranMessage
*
msg
)
{
/* TODO: Deallocate memory for a dynamically allocated eNB config message */
if
(
msg
->
msg_case
!=
PROTOCOL__PROGRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG
)
goto
error
;
free
(
msg
->
enb_config_request_msg
->
header
);
free
(
msg
->
enb_config_request_msg
);
free
(
msg
);
return
0
;
error:
//LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return
-
1
;
}
int
enb_agent_destroy_ue_config_request
(
Protocol__ProgranMessage
*
msg
)
{
...
...
@@ -316,6 +345,7 @@ void set_enb_vars(mid_t mod_id, ran_name_t ran){
case
RAN_LTE_OAI
:
enb
[
mod_id
]
=
(
void
*
)
&
eNB_mac_inst
[
mod_id
];
enb_ue
[
mod_id
]
=
(
void
*
)
&
eNB_mac_inst
[
mod_id
].
UE_list
;
enb_rrc
[
mod_id
]
=
(
void
*
)
&
eNB_rrc_inst
[
mod_id
];
break
;
default
:
goto
error
;
...
...
@@ -425,10 +455,483 @@ int get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id)
return
eNB_UE_stats
[
CC_id
].
rank
;
}
/*
* ************************************
* Get Messages for eNB Configuration Reply
* ************************************
*/
int
get_hopping_offset
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
pusch_config_common
.
pusch_HoppingOffset
;
}
int
get_hopping_mode
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
pusch_config_common
.
hoppingMode
;
}
int
get_n_SB
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
pusch_config_common
.
n_SB
;
}
int
get_enable64QAM
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
pusch_config_common
.
enable64QAM
;
}
int
get_phich_duration
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
phich_config_common
.
phich_duration
;
}
int
get_phich_resource
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
if
(
frame_parms
->
phich_config_common
.
phich_resource
==
oneSixth
)
return
0
;
else
if
(
frame_parms
->
phich_config_common
.
phich_resource
==
half
)
return
1
;
else
if
(
frame_parms
->
phich_config_common
.
phich_resource
==
one
)
return
2
;
else
if
(
frame_parms
->
phich_config_common
.
phich_resource
==
two
)
return
3
;
return
-
1
;
}
int
get_n1pucch_an
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
pucch_config_common
.
n1PUCCH_AN
;
}
int
get_nRB_CQI
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
pucch_config_common
.
nRB_CQI
;
}
int
get_deltaPUCCH_Shift
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
pucch_config_common
.
deltaPUCCH_Shift
;
}
int
get_prach_ConfigIndex
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
prach_config_common
.
prach_ConfigInfo
.
prach_ConfigIndex
;
}
int
get_prach_FreqOffset
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
prach_config_common
.
prach_ConfigInfo
.
prach_FreqOffset
;
}
int
get_maxHARQ_Msg3Tx
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
maxHARQ_Msg3Tx
;
}
int
get_ul_cyclic_prefix_length
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
Ncp_UL
;
}
int
get_dl_cyclic_prefix_length
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
Ncp
;
}
int
get_cell_id
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
Nid_cell
;
}
int
get_srs_BandwidthConfig
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
soundingrs_ul_config_common
.
srs_BandwidthConfig
;
}
int
get_srs_SubframeConfig
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
soundingrs_ul_config_common
.
srs_SubframeConfig
;
}
int
get_srs_MaxUpPts
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
soundingrs_ul_config_common
.
srs_MaxUpPts
;
}
int
get_N_RB_DL
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
N_RB_DL
;
}
int
get_N_RB_UL
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
N_RB_UL
;
}
int
get_subframe_assignment
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
tdd_config
;
}
int
get_special_subframe_assignment
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
return
frame_parms
->
tdd_config_S
;
}
int
get_ra_ResponseWindowSize
(
mid_t
mod_id
,
int
CC_id
)
{
Enb_properties_array_t
*
enb_properties
;
enb_properties
=
enb_config_get
();
return
enb_properties
->
properties
[
mod_id
]
->
rach_raResponseWindowSize
[
CC_id
];
}
int
get_mac_ContentionResolutionTimer
(
mid_t
mod_id
,
int
CC_id
)
{
Enb_properties_array_t
*
enb_properties
;
enb_properties
=
enb_config_get
();
return
enb_properties
->
properties
[
mod_id
]
->
rach_macContentionResolutionTimer
[
CC_id
];
}
int
get_duplex_mode
(
mid_t
mod_id
,
int
CC_id
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
frame_parms
=
mac_xface
->
get_lte_frame_parms
(
mod_id
,
CC_id
);
if
(
frame_parms
->
frame_type
==
0
)
return
1
;
else
if
(
frame_parms
->
frame_type
==
1
)
return
0
;
return
-
1
;
}
long
get_si_window_length
(
mid_t
mod_id
,
int
CC_id
)
{
return
((
eNB_RRC_INST
*
)
enb_rrc
[
mod_id
])
->
carrier
[
CC_id
].
sib1
->
si_WindowLength
;
}
int
get_sib1_length
(
mid_t
mod_id
,
int
CC_id
)
{
return
((
eNB_RRC_INST
*
)
enb_rrc
[
mod_id
])
->
carrier
[
CC_id
].
sizeof_SIB1
;
}
int
get_num_pdcch_symb
(
mid_t
mod_id
,
int
CC_id
)
{
/*TODO: add these values to some struct in MAC
LTE_UE_PDCCH *lte_ue_pdcch;
lte_ue_pdcch = mac_xface->get_lte_ue_pdcch(mod_id, CC_id, mod_id);
*/
return
(
PHY_vars_UE_g
[
mod_id
][
CC_id
]
->
lte_ue_pdcch_vars
[
mod_id
]
->
num_pdcch_symbols
);
}
/*
* timer primitives
*/
/*
* ************************************
* eNB Configuration Request and Reply
* ************************************
*/
int
enb_agent_enb_config_request
(
mid_t
mod_id
,
const
void
*
params
,
Protocol__ProgranMessage
**
msg
)
{
Protocol__PrpHeader
*
header
;
xid_t
xid
=
1
;
if
(
prp_create_header
(
xid
,
PROTOCOL__PRP_TYPE__PRPT_GET_ENB_CONFIG_REQUEST
,
&
header
)
!=
0
)
goto
error
;
Protocol__PrpEnbConfigRequest
*
enb_config_request_msg
;
enb_config_request_msg
=
malloc
(
sizeof
(
Protocol__PrpEnbConfigRequest
));
if
(
enb_config_request_msg
==
NULL
)
goto
error
;
protocol__prp_enb_config_request__init
(
enb_config_request_msg
);
enb_config_request_msg
->
header
=
header
;
*
msg
=
malloc
(
sizeof
(
Protocol__ProgranMessage
));
if
(
*
msg
==
NULL
)
goto
error
;
protocol__progran_message__init
(
*
msg
);
(
*
msg
)
->
msg_case
=
PROTOCOL__PROGRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG
;
(
*
msg
)
->
msg_dir
=
PROTOCOL__PROGRAN_DIRECTION__INITIATING_MESSAGE
;
(
*
msg
)
->
enb_config_request_msg
=
enb_config_request_msg
;
return
0
;
error:
// TODO: Need to make proper error handling
if
(
header
!=
NULL
)
free
(
header
);
if
(
enb_config_request_msg
!=
NULL
)
free
(
enb_config_request_msg
);
if
(
*
msg
!=
NULL
)
free
(
*
msg
);
//LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return
-
1
;
}
int
enb_agent_enb_config_reply
(
mid_t
mod_id
,
const
void
*
params
,
Protocol__ProgranMessage
**
msg
)
{
xid_t
xid
;
Protocol__ProgranMessage
*
input
=
(
Protocol__ProgranMessage
*
)
params
;
Protocol__PrpEnbConfigReply
*
enb_config_req_msg
=
input
->
enb_config_request_msg
;
xid
=
(
enb_config_req_msg
->
header
)
->
xid
;
int
i
,
j
,
k
;
int
cc_id
=
0
;
int
enb_id
=
mod_id
;
Protocol__PrpHeader
*
header
;
if
(
prp_create_header
(
xid
,
PROTOCOL__PRP_TYPE__PRPT_GET_ENB_CONFIG_REPLY
,
&
header
)
!=
0
)
goto
error
;
Protocol__PrpEnbConfigReply
*
enb_config_reply_msg
;
enb_config_reply_msg
=
malloc
(
sizeof
(
Protocol__PrpEnbConfigReply
));
if
(
enb_config_reply_msg
==
NULL
)
goto
error
;
protocol__prp_enb_config_reply__init
(
enb_config_reply_msg
);
enb_config_reply_msg
->
header
=
header
;
enb_config_reply_msg
->
enb_id
=
mod_id
;
enb_config_reply_msg
->
n_cell_config
=
MAX_NUM_CCs
;
Protocol__PrpCellConfig
**
cell_conf
;
if
(
enb_config_reply_msg
->
n_cell_config
>
0
){
cell_conf
=
malloc
(
sizeof
(
Protocol__PrpCellConfig
*
)
*
enb_config_reply_msg
->
n_cell_config
);
if
(
cell_conf
==
NULL
)
goto
error
;
for
(
i
=
0
;
i
<
enb_config_reply_msg
->
n_cell_config
;
i
++
){
cell_conf
[
i
]
=
malloc
(
sizeof
(
Protocol__PrpCellConfig
));
protocol__prp_cell_config__init
(
cell_conf
[
i
]);
//TODO: Fill in with actual value, the PCI of this cell
cell_conf
[
i
]
->
phy_cell_id
=
1
;
cell_conf
[
i
]
->
has_phy_cell_id
=
1
;
//TODO: Fill in with actual value, the PLMN cell id of this cell
cell_conf
[
i
]
->
cell_id
=
get_cell_id
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_cell_id
=
1
;
//TODO: Fill in with actual value, PUSCH resources in RBs for hopping
cell_conf
[
i
]
->
pusch_hopping_offset
=
get_hopping_offset
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_pusch_hopping_offset
=
1
;
//TODO: Fill in with actual value
cell_conf
[
i
]
->
hopping_mode
=
get_hopping_mode
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_hopping_mode
=
1
;
//TODO: Fill in with actual value, the number of subbands
cell_conf
[
i
]
->
n_sb
=
get_n_SB
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_n_sb
=
1
;
//TODO: Fill in with actual value, The number of resource element groups used for PHICH. One of PRPR_
cell_conf
[
i
]
->
phich_resource
=
get_phich_resource
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_phich_resource
=
1
;
//TODO: Fill in with actual value, one of the PRPD_ values
cell_conf
[
i
]
->
phich_duration
=
get_phich_duration
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_phich_duration
=
1
;
//TODO: Fill in with actual value, See TS 36.211, section 6.9
cell_conf
[
i
]
->
init_nr_pdcch_ofdm_sym
=
get_num_pdcch_symb
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_init_nr_pdcch_ofdm_sym
=
1
;
//TODO: Fill in with actual value
Protocol__PrpSiConfig
*
si_config
;
si_config
=
malloc
(
sizeof
(
Protocol__PrpSiConfig
));
if
(
si_config
==
NULL
)
goto
error
;
protocol__prp_si_config__init
(
si_config
);
//TODO: Fill in with actual value, Frame number to apply the SI configuration
si_config
->
sfn
=
1
;
si_config
->
has_sfn
=
1
;
//TODO: Fill in with actual value, the length of SIB1 in bytes
si_config
->
sib1_length
=
get_sib1_length
(
enb_id
,
i
);
si_config
->
has_sib1_length
=
1
;
//TODO: Fill in with actual value, Scheduling window for all SIs in SF
si_config
->
si_window_length
=
(
uint32_t
)
get_si_window_length
(
enb_id
,
i
);
si_config
->
has_si_window_length
=
1
;
//TODO: Fill in with actual value, the number of SI messages
si_config
->
n_si_message
=
1
;
Protocol__PrpSiMessage
**
si_message
;
si_message
=
malloc
(
sizeof
(
Protocol__PrpSiMessage
*
)
*
si_config
->
n_si_message
);
if
(
si_message
==
NULL
)
goto
error
;
for
(
j
=
0
;
j
<
si_config
->
n_si_message
;
j
++
){
si_message
[
j
]
=
malloc
(
sizeof
(
Protocol__PrpSiMessage
));
if
(
si_message
[
j
]
==
NULL
)
goto
error
;
protocol__prp_si_message__init
(
si_message
[
j
]);
//TODO: Fill in with actual value, Periodicity of SI msg in radio frames
si_message
[
j
]
->
periodicity
=
1
;
//SIPeriod
si_message
[
j
]
->
has_periodicity
=
1
;
//TODO: Fill in with actual value, rhe length of the SI message in bytes
si_message
[
j
]
->
length
=
10
;
si_message
[
j
]
->
has_length
=
1
;
}
if
(
si_config
->
n_si_message
>
0
){
si_config
->
si_message
=
si_message
;
}
cell_conf
[
i
]
->
si_config
=
si_config
;
//TODO: Fill in with actual value, the DL transmission bandwidth in RBs
cell_conf
[
i
]
->
dl_bandwidth
=
get_N_RB_DL
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_dl_bandwidth
=
1
;
//TODO: Fill in with actual value, the UL transmission bandwidth in RBs
cell_conf
[
i
]
->
ul_bandwidth
=
get_N_RB_UL
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_ul_bandwidth
=
1
;
//TODO: Fill in with actual value, one of PRUCPL values
cell_conf
[
i
]
->
ul_cyclic_prefix_length
=
get_ul_cyclic_prefix_length
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_ul_cyclic_prefix_length
=
1
;
//TODO: Fill in with actual value, one of PRUCPL values
cell_conf
[
i
]
->
dl_cyclic_prefix_length
=
get_dl_cyclic_prefix_length
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_dl_cyclic_prefix_length
=
1
;
//TODO: Fill in with actual value, number of cell specific antenna ports
cell_conf
[
i
]
->
antenna_ports_count
=
1
;
cell_conf
[
i
]
->
has_antenna_ports_count
=
1
;
//TODO: Fill in with actual value, one of PRDM values
cell_conf
[
i
]
->
duplex_mode
=
get_duplex_mode
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_duplex_mode
=
1
;
//TODO: Fill in with actual value, DL/UL subframe assignment. TDD only
cell_conf
[
i
]
->
subframe_assignment
=
get_subframe_assignment
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_subframe_assignment
=
1
;
//TODO: Fill in with actual value, TDD only. See TS 36.211, table 4.2.1
cell_conf
[
i
]
->
special_subframe_patterns
=
get_special_subframe_assignment
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_special_subframe_patterns
=
1
;
//TODO: Fill in with actual value, The MBSFN radio frame period
cell_conf
[
i
]
->
n_mbsfn_subframe_config_rfperiod
=
5
;
uint32_t
*
elem_rfperiod
;
elem_rfperiod
=
(
uint32_t
*
)
malloc
(
sizeof
(
uint32_t
)
*
cell_conf
[
i
]
->
n_mbsfn_subframe_config_rfperiod
);
if
(
elem_rfperiod
==
NULL
)
goto
error
;
for
(
j
=
0
;
j
<
cell_conf
[
i
]
->
n_mbsfn_subframe_config_rfperiod
;
j
++
){
elem_rfperiod
[
j
]
=
1
;
}
cell_conf
[
i
]
->
mbsfn_subframe_config_rfperiod
=
elem_rfperiod
;
//TODO: Fill in with actual value, The MBSFN radio frame offset
cell_conf
[
i
]
->
n_mbsfn_subframe_config_rfoffset
=
5
;
uint32_t
*
elem_rfoffset
;
elem_rfoffset
=
(
uint32_t
*
)
malloc
(
sizeof
(
uint32_t
)
*
cell_conf
[
i
]
->
n_mbsfn_subframe_config_rfoffset
);
if
(
elem_rfoffset
==
NULL
)
goto
error
;
for
(
j
=
0
;
j
<
cell_conf
[
i
]
->
n_mbsfn_subframe_config_rfoffset
;
j
++
){
elem_rfoffset
[
j
]
=
1
;
}
cell_conf
[
i
]
->
mbsfn_subframe_config_rfoffset
=
elem_rfoffset
;
//TODO: Fill in with actual value, Bitmap indicating the MBSFN subframes
cell_conf
[
i
]
->
n_mbsfn_subframe_config_sfalloc
=
5
;
uint32_t
*
elem_sfalloc
;
elem_sfalloc
=
(
uint32_t
*
)
malloc
(
sizeof
(
uint32_t
)
*
cell_conf
[
i
]
->
n_mbsfn_subframe_config_sfalloc
);
if
(
elem_sfalloc
==
NULL
)
goto
error
;
for
(
j
=
0
;
j
<
cell_conf
[
i
]
->
n_mbsfn_subframe_config_sfalloc
;
j
++
){
elem_sfalloc
[
j
]
=
1
;
}
cell_conf
[
i
]
->
mbsfn_subframe_config_sfalloc
=
elem_sfalloc
;
//TODO: Fill in with actual value, See TS 36.211, section 5.7.1
cell_conf
[
i
]
->
prach_config_index
=
get_prach_ConfigIndex
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_prach_config_index
=
1
;
//TODO: Fill in with actual value, See TS 36.211, section 5.7.1
cell_conf
[
i
]
->
prach_freq_offset
=
get_prach_FreqOffset
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_prach_freq_offset
=
1
;
//TODO: Fill in with actual value, Duration of RA response window in SF
cell_conf
[
i
]
->
ra_response_window_size
=
get_ra_ResponseWindowSize
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_ra_response_window_size
=
1
;
//TODO: Fill in with actual value, Timer used for RA
cell_conf
[
i
]
->
mac_contention_resolution_timer
=
get_mac_ContentionResolutionTimer
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_mac_contention_resolution_timer
=
1
;
//TODO: Fill in with actual value, See TS 36.321
cell_conf
[
i
]
->
max_harq_msg3tx
=
get_maxHARQ_Msg3Tx
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_max_harq_msg3tx
=
1
;
//TODO: Fill in with actual value, See TS 36.213, section 10.1
cell_conf
[
i
]
->
n1pucch_an
=
get_n1pucch_an
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_n1pucch_an
=
1
;
//TODO: Fill in with actual value, See TS 36.211, section 5.4
cell_conf
[
i
]
->
deltapucch_shift
=
get_deltaPUCCH_Shift
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_deltapucch_shift
=
1
;
//TODO: Fill in with actual value, See TS 36.211, section 5.4
cell_conf
[
i
]
->
nrb_cqi
=
get_nRB_CQI
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_nrb_cqi
=
1
;
//TODO: Fill in with actual value, See TS 36.211, table 5.5.3.3-1 and 2
cell_conf
[
i
]
->
srs_subframe_config
=
get_srs_SubframeConfig
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_srs_subframe_config
=
1
;
//TODO: Fill in with actual value, See TS 36.211, section 5.5.3.2
cell_conf
[
i
]
->
srs_bw_config
=
get_srs_BandwidthConfig
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_srs_bw_config
=
1
;
//TODO: Fill in with actual value, Boolean value. See TS 36.211, section 5.5.3.2. TDD only
cell_conf
[
i
]
->
srs_mac_up_pts
=
get_srs_MaxUpPts
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_srs_mac_up_pts
=
1
;
//TODO: Fill in with actual value, One of the PREQ_ values
cell_conf
[
i
]
->
enable_64qam
=
get_enable64QAM
(
enb_id
,
i
);
cell_conf
[
i
]
->
has_enable_64qam
=
1
;
//TODO: Fill in with actual value, Carrier component index
cell_conf
[
i
]
->
carrier_index
=
i
;
cell_conf
[
i
]
->
has_carrier_index
=
1
;
}
enb_config_reply_msg
->
cell_config
=
cell_conf
;
}
*
msg
=
malloc
(
sizeof
(
Protocol__ProgranMessage
));
if
(
*
msg
==
NULL
)
goto
error
;
protocol__progran_message__init
(
*
msg
);
(
*
msg
)
->
msg_case
=
PROTOCOL__PROGRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG
;
(
*
msg
)
->
msg_dir
=
PROTOCOL__PROGRAN_DIRECTION__SUCCESSFUL_OUTCOME
;
(
*
msg
)
->
enb_config_reply_msg
=
enb_config_reply_msg
;
return
0
;
error:
// TODO: Need to make proper error handling
if
(
header
!=
NULL
)
free
(
header
);
if
(
enb_config_reply_msg
!=
NULL
)
free
(
enb_config_reply_msg
);
if
(
*
msg
!=
NULL
)
free
(
*
msg
);
//LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return
-
1
;
}
//struct enb_agent_map agent_map;
enb_agent_timer_instance_t
timer_instance
;
...
...
openair2/ENB_APP/enb_agent_common.h
View file @
08e25bf3
...
...
@@ -47,6 +47,7 @@
#include "stats_common.pb-c.h"
# include "enb_agent_defs.h"
#include "enb_config.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/RLC/rlc.h"
...
...
@@ -100,6 +101,7 @@ int enb_agent_destroy_ue_config_reply(Protocol__ProgranMessage *msg);
int
enb_agent_lc_config_reply
(
mid_t
mod_id
,
const
void
*
params
,
Protocol__ProgranMessage
**
msg
);
int
enb_agent_destroy_lc_config_reply
(
Protocol__ProgranMessage
*
msg
);
int
enb_agent_enb_config_request
(
mid_t
mod_id
,
const
void
*
params
,
Protocol__ProgranMessage
**
msg
);
int
enb_agent_destroy_enb_config_request
(
Protocol__ProgranMessage
*
msg
);
int
enb_agent_destroy_ue_config_request
(
Protocol__ProgranMessage
*
msg
);
...
...
@@ -156,6 +158,47 @@ int get_active_CC(mid_t mod_id, mid_t ue_id);
int
get_current_RI
(
mid_t
mod_id
,
mid_t
ue_id
,
int
CC_id
);
int
get_n1pucch_an
(
mid_t
mod_id
,
int
CC_id
);
int
get_nRB_CQI
(
mid_t
mod_id
,
int
CC_id
);
int
get_deltaPUCCH_Shift
(
mid_t
mod_id
,
int
CC_id
);
int
get_prach_ConfigIndex
(
mid_t
mod_id
,
int
CC_id
);
int
get_prach_FreqOffset
(
mid_t
mod_id
,
int
CC_id
);
int
get_maxHARQ_Msg3Tx
(
mid_t
mod_id
,
int
CC_id
);
int
get_ul_cyclic_prefix_length
(
mid_t
mod_id
,
int
CC_id
);
int
get_dl_cyclic_prefix_length
(
mid_t
mod_id
,
int
CC_id
);
int
get_cell_id
(
mid_t
mod_id
,
int
CC_id
);
int
get_srs_BandwidthConfig
(
mid_t
mod_id
,
int
CC_id
);
int
get_srs_SubframeConfig
(
mid_t
mod_id
,
int
CC_id
);
int
get_srs_MaxUpPts
(
mid_t
mod_id
,
int
CC_id
);
int
get_N_RB_DL
(
mid_t
mod_id
,
int
CC_id
);
int
get_N_RB_UL
(
mid_t
mod_id
,
int
CC_id
);
int
get_subframe_assignment
(
mid_t
mod_id
,
int
CC_id
);
int
get_special_subframe_assignment
(
mid_t
mod_id
,
int
CC_id
);
int
get_ra_ResponseWindowSize
(
mid_t
mod_id
,
int
CC_id
);
int
get_mac_ContentionResolutionTimer
(
mid_t
mod_id
,
int
CC_id
);
int
get_duplex_mode
(
mid_t
mod_id
,
int
CC_id
);
long
get_si_window_length
(
mid_t
mod_id
,
int
CC_id
);
int
get_num_pdcch_symb
(
mid_t
mod_id
,
int
CC_id
);
/*******************
...
...
openair2/LAYER2/MAC/extern.h
View file @
08e25bf3
...
...
@@ -50,12 +50,14 @@
//#include "SIMULATION/simulation_defs.h"
#endif //PHY_EMUL
#include "PHY_INTERFACE/defs.h"
#include "RRC/LITE/defs.h"
extern
const
uint32_t
BSR_TABLE
[
BSR_TABLE_SIZE
];
//extern uint32_t EBSR_Level[63];
extern
UE_MAC_INST
*
UE_mac_inst
;
extern
eNB_MAC_INST
*
eNB_mac_inst
;
extern
eNB_RRC_INST
*
eNB_rrc_inst
;
extern
MAC_RLC_XFACE
*
Mac_rlc_xface
;
extern
uint8_t
Is_rrc_registered
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment