New merge with develop-nr. DL IP traffic reaching up to UE's MAC layer now successfully.

This commit is contained in:
Raymond Knopp
2019-09-04 17:40:08 +02:00
1276 changed files with 202553 additions and 686845 deletions
+48
View File
@@ -0,0 +1,48 @@
/*
* 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
*/
/* F1AP -> SCTP */
MESSAGE_DEF(F1AP_CU_SCTP_REQ , MESSAGE_PRIORITY_MED, f1ap_cu_setup_req_t , f1ap_cu_setup_req)
/* eNB_DU application layer -> F1AP messages or CU F1AP -> RRC*/
MESSAGE_DEF(F1AP_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_setup_req_t , f1ap_setup_req)
/* F1AP -> eNB_DU or eNB_CU_RRC -> F1AP application layer messages */
MESSAGE_DEF(F1AP_SETUP_RESP , MESSAGE_PRIORITY_MED, f1ap_setup_resp_t , f1ap_setup_resp)
MESSAGE_DEF(F1AP_SETUP_FAILURE , MESSAGE_PRIORITY_MED, f1ap_setup_failure_t , f1ap_setup_failure)
/* MAC -> F1AP messages */
MESSAGE_DEF(F1AP_INITIAL_UL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_initial_ul_rrc_message_t , f1ap_initial_ul_rrc_message)
MESSAGE_DEF(F1AP_UL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_ul_rrc_message_t , f1ap_ul_rrc_message)
//MESSAGE_DEF(F1AP_INITIAL_CONTEXT_SETUP_RESP, MESSAGE_PRIORITY_MED, f1ap_initial_context_setup_resp_t, f1ap_initial_context_setup_resp)
//MESSAGE_DEF(F1AP_INITIAL_CONTEXT_SETUP_FAILURE, MESSAGE_PRIORITY_MED, f1ap_initial_context_setup_failure_t, f1ap_initial_context_setup_failure)
MESSAGE_DEF(F1AP_UE_CONTEXT_RELEASE_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_release_req_t, f1ap_ue_context_release_req)
MESSAGE_DEF(F1AP_UE_CONTEXT_RELEASE_CMD, MESSAGE_PRIORITY_MED, f1ap_ue_context_release_cmd_t, f1ap_ue_context_release_cmd)
/* RRC -> F1AP messages */
MESSAGE_DEF(F1AP_DL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_dl_rrc_message_t , f1ap_dl_rrc_message )
//MESSAGE_DEF(F1AP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_initial_context_setup_req_t , f1ap_initial_context_setup_req )
MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_req_t, f1ap_ue_context_setup_req)
+308
View File
@@ -0,0 +1,308 @@
/*
* 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 F1AP_MESSAGES_TYPES_H_
#define F1AP_MESSAGES_TYPES_H_
#include "rlc.h"
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define F1AP_CU_SCTP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_cu_sctp_req
#define F1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_req
#define F1AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_resp
#define F1AP_SETUP_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_failure
#define F1AP_INITIAL_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_initial_ul_rrc_message
#define F1AP_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ul_rrc_message
#define F1AP_UE_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_req
#define F1AP_UE_CONTEXT_RELEASE_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_resp
#define F1AP_UE_CONTEXT_MODIFICATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_resp
#define F1AP_UE_CONTEXT_MODIFICATION_FAIL(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_fail
#define F1AP_DL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_dl_rrc_message
#define F1AP_UE_CONTEXT_RELEASE_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_req
#define F1AP_UE_CONTEXT_RELEASE_CMD(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_req
#define F1AP_UE_CONTEXT_MODIFICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_req
/* Length of the transport layer address string
* 160 bits / 8 bits by char.
*/
#define F1AP_TRANSPORT_LAYER_ADDRESS_SIZE (160 / 8)
#define F1AP_MAX_NB_CU_IP_ADDRESS 10
// Note this should be 512 from maxval in 38.473
#define F1AP_MAX_NB_CELLS 2
typedef struct f1ap_net_ip_address_s {
unsigned ipv4:1;
unsigned ipv6:1;
char ipv4_address[16];
char ipv6_address[46];
} f1ap_net_ip_address_t;
typedef struct f1ap_cu_setup_req_s {
//
} f1ap_cu_setup_req_t;
typedef struct f1ap_setup_req_s {
// Midhaul networking parameters
/* Connexion id used between SCTP/F1AP */
uint16_t cnx_id;
/* SCTP association id */
int32_t assoc_id;
/* The eNB IP address to bind */
f1ap_net_ip_address_t CU_f1_ip_address;
f1ap_net_ip_address_t DU_f1_ip_address;
/* Number of SCTP streams used for a mme association */
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
uint16_t default_sctp_stream_id;
// F1_Setup_Req payload
uint64_t gNB_DU_id;
char *gNB_DU_name;
/* The type of the cell */
enum cell_type_e cell_type;
/// number of DU cells available
uint16_t num_cells_available; //0< num_cells_available <= 512;
// Served Cell Information
/* Tracking area code */
uint16_t tac[F1AP_MAX_NB_CELLS];
/* Mobile Country Codes
* Mobile Network Codes
*/
uint16_t mcc[F1AP_MAX_NB_CELLS];//[6];
uint16_t mnc[F1AP_MAX_NB_CELLS];//[6];
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];//[6];
// NR Global Cell Id
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
// NR Physical Cell Ids
uint16_t nr_pci[F1AP_MAX_NB_CELLS];
// Number of slide support items (max 16, could be increased to as much as 1024)
uint16_t num_ssi[F1AP_MAX_NB_CELLS];//[6];
uint8_t sst[F1AP_MAX_NB_CELLS];//[16][6];
uint8_t sd[F1AP_MAX_NB_CELLS];//[16][6];
// fdd_flag = 1 means FDD, 0 means TDD
int fdd_flag;
union {
struct {
uint32_t ul_nr_arfcn;
uint8_t ul_scs;
uint8_t ul_nrb;
uint32_t dl_nr_arfcn;
uint8_t dl_scs;
uint8_t dl_nrb;
uint32_t sul_active;
uint32_t sul_nr_arfcn;
uint8_t sul_scs;
uint8_t sul_nrb;
uint8_t ul_num_frequency_bands;
uint16_t ul_nr_band[32];
uint8_t ul_num_sul_frequency_bands;
uint16_t ul_nr_sul_band[32];
uint8_t dl_num_frequency_bands;
uint16_t dl_nr_band[32];
uint8_t dl_num_sul_frequency_bands;
uint16_t dl_nr_sul_band[32];
} fdd;
struct {
uint32_t nr_arfcn;
uint8_t scs;
uint8_t nrb;
uint32_t sul_active;
uint32_t sul_nr_arfcn;
uint8_t sul_scs;
uint8_t sul_nrb;
uint8_t num_frequency_bands;
uint16_t nr_band[32];
uint8_t num_sul_frequency_bands;
uint16_t nr_sul_band[32];
} tdd;
} nr_mode_info[F1AP_MAX_NB_CELLS];
char *measurement_timing_information[F1AP_MAX_NB_CELLS];
uint8_t ranac[F1AP_MAX_NB_CELLS];
// System Information
uint8_t *mib[F1AP_MAX_NB_CELLS];
int mib_length[F1AP_MAX_NB_CELLS];
uint8_t *sib1[F1AP_MAX_NB_CELLS];
int sib1_length[F1AP_MAX_NB_CELLS];
} f1ap_setup_req_t;
typedef struct f1ap_setup_resp_s {
/* Connexion id used between SCTP/F1AP */
uint16_t cnx_id;
/* SCTP association id */
int32_t assoc_id;
/* Number of SCTP streams used for a mme association */
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
/// string holding gNB_CU_name
char *gNB_CU_name;
/// number of DU cells to activate
uint16_t num_cells_to_activate; //0< num_cells_to_activate <= 512;
/// mcc of DU cells
uint16_t mcc[F1AP_MAX_NB_CELLS];
/// mnc of DU cells
uint16_t mnc[F1AP_MAX_NB_CELLS];
/// mnc digit length of DU cells
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];
// NR Global Cell Id
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
/// NRPCI
uint16_t nrpci[F1AP_MAX_NB_CELLS];
/// num SI messages per DU cell
uint8_t num_SI[F1AP_MAX_NB_CELLS];
/// SI message containers (up to 21 messages per cell)
uint8_t *SI_container[F1AP_MAX_NB_CELLS][21];
int SI_container_length[F1AP_MAX_NB_CELLS][21];
} f1ap_setup_resp_t;
typedef struct f1ap_setup_failure_s {
uint16_t cause;
uint16_t time_to_wait;
uint16_t criticality_diagnostics;
} f1ap_setup_failure_t;
typedef struct f1ap_dl_rrc_message_s {
uint32_t gNB_CU_ue_id;
uint32_t gNB_DU_ue_id;
uint32_t old_gNB_DU_ue_id;
uint16_t rnti;
uint8_t srb_id;
uint8_t execute_duplication;
uint8_t *rrc_container;
int rrc_container_length;
union {
// both map 0..255 => 1..256
uint8_t en_dc;
uint8_t ngran;
} RAT_frequency_priority_information;
} f1ap_dl_rrc_message_t;
typedef struct f1ap_initial_ul_rrc_message_s {
uint32_t gNB_DU_ue_id;
/// mcc of DU cell
uint16_t mcc;
/// mnc of DU cell
uint16_t mnc;
/// mnc digit length of DU cells
uint8_t mnc_digit_length;
/// nr cell id
uint64_t nr_cellid;
/// crnti
uint16_t crnti;
uint8_t *rrc_container;
int rrc_container_length;
uint8_t *du2cu_rrc_container;
int du2cu_rrc_container_length;
} f1ap_initial_ul_rrc_message_t;
typedef struct f1ap_ul_rrc_message_s {
uint16_t rnti;
uint8_t srb_id;
uint8_t *rrc_container;
int rrc_container_length;
} f1ap_ul_rrc_message_t;
typedef struct f1ap_up_tnl_s {
in_addr_t tl_address; // currently only IPv4 supported
uint32_t gtp_teid;
} f1ap_up_tnl_t;
typedef struct f1ap_drb_to_be_setup_s {
uint8_t drb_id;
f1ap_up_tnl_t up_ul_tnl[2];
uint8_t up_ul_tnl_length;
rlc_mode_t rlc_mode;
} f1ap_drb_to_be_setup_t;
typedef struct f1ap_ue_context_setup_req_s {
uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
uint32_t *gNB_DU_ue_id;
uint16_t rnti;
// SpCell Info
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
uint64_t nr_cellid;
uint8_t servCellIndex;
uint8_t *cellULConfigured;
uint32_t servCellId;
uint8_t *cu_to_du_rrc_information;
uint8_t cu_to_du_rrc_information_length;
f1ap_drb_to_be_setup_t *drbs_to_be_setup; // BK: need to replace by s1ap_initial_context_setup_req
uint8_t drbs_to_be_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
s1ap_initial_context_setup_req_t *s1ap_initial_context_setup_req;
// coniatner for the rrc_eNB_generate_SecurityModeCommand message
uint8_t *rrc_container;
int rrc_container_length;
} f1ap_ue_context_setup_req_t;
typedef enum F1ap_Cause_e {
F1AP_CAUSE_NOTHING, /* No components present */
F1AP_CAUSE_RADIO_NETWORK,
F1AP_CAUSE_TRANSPORT,
F1AP_CAUSE_PROTOCOL,
F1AP_CAUSE_MISC,
} f1ap_Cause_t;
typedef struct f1ap_ue_context_release_s {
uint16_t rnti;
f1ap_Cause_t cause;
long cause_value;
uint8_t *rrc_container;
int rrc_container_length;
} f1ap_ue_context_release_req_t, f1ap_ue_context_release_cmd_t,
f1ap_ue_context_release_cplt_t;
#endif /* F1AP_MESSAGES_TYPES_H_ */
+4
View File
@@ -25,4 +25,8 @@ MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_del
MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_resp_t, Gtpv1uDeleteTunnelResp)
MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_ind_t, Gtpv1uTunnelDataInd)
MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_req_t, Gtpv1uTunnelDataReq)
MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_req_t,Gtpv1uDataForwardingReq)
MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_ind_t,Gtpv1uDataForwardingInd)
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq)
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
MESSAGE_DEF(GTPV1U_ENB_S1_REQ, MESSAGE_PRIORITY_MED, Gtpv1uS1Req, gtpv1uS1Req)
+69 -2
View File
@@ -22,10 +22,10 @@
#ifndef GTPV1_U_MESSAGES_TYPES_H_
#define GTPV1_U_MESSAGES_TYPES_H_
#include "asn_constant.h"
#include "LTE_asn_constant.h"
#define GTPV1U_MAX_BEARERS_PER_UE max_val_DRB_Identity
#define GTPV1U_MAX_BEARERS_PER_UE max_val_LTE_DRB_Identity
#define GTPV1U_ENB_UPDATE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uUpdateTunnelReq
#define GTPV1U_ENB_UPDATE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uUpdateTunnelResp
@@ -33,10 +33,33 @@
#define GTPV1U_ENB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelResp
#define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd
#define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq
#define GTPV1U_ENB_DATA_FORWARDING_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingReq
#define GTPV1U_ENB_DATA_FORWARDING_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingInd
#define GTPV1U_ENB_END_MARKER_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerReq
#define GTPV1U_ENB_END_MARKER_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerInd
#define GTPV1U_ENB_S1_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uS1Req
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
typedef struct gtpv1u_enb_create_x2u_tunnel_req_s {
rnti_t rnti;
int num_tunnels;
teid_t tenb_X2u_teid[GTPV1U_MAX_BEARERS_PER_UE]; ///< Tunnel Endpoint Identifier
ebi_t eps_bearer_id[GTPV1U_MAX_BEARERS_PER_UE];
transport_layer_addr_t enb_addr[GTPV1U_MAX_BEARERS_PER_UE];
} gtpv1u_enb_create_x2u_tunnel_req_t;
typedef struct gtpv1u_enb_create_x2u_tunnel_resp_s {
uint8_t status; ///< Status of S1U endpoint creation (Failed = 0xFF or Success = 0x0)
rnti_t rnti;
int num_tunnels;
teid_t enb_X2u_teid[GTPV1U_MAX_BEARERS_PER_UE]; ///< Tunnel Endpoint Identifier
ebi_t eps_bearer_id[GTPV1U_MAX_BEARERS_PER_UE];
transport_layer_addr_t enb_addr;
} gtpv1u_enb_create_x2u_tunnel_resp_t;
typedef struct gtpv1u_enb_create_tunnel_req_s {
rnti_t rnti;
int num_tunnels;
@@ -99,6 +122,50 @@ typedef struct gtpv1u_enb_tunnel_data_req_s {
rb_id_t rab_id;
} gtpv1u_enb_tunnel_data_req_t;
typedef struct gtpv1u_enb_data_forwarding_req_s {
uint8_t *buffer;
uint32_t length;
uint32_t offset; ///< start of message offset in buffer
rnti_t rnti;
rb_id_t rab_id;
} gtpv1u_enb_data_forwarding_req_t;
typedef struct gtpv1u_enb_data_forwarding_ind_s {
uint32_t frame;
uint8_t enb_flag;
uint32_t rb_id;
uint32_t muip;
uint32_t confirmp;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t mode;
uint16_t rnti;
uint8_t module_id;
uint8_t eNB_index;
} gtpv1u_enb_data_forwarding_ind_t;
typedef struct gtpv1u_enb_end_marker_req_s {
uint8_t *buffer;
uint32_t length;
uint32_t offset; ///< start of message offset in buffer
rnti_t rnti;
rb_id_t rab_id;
} gtpv1u_enb_end_marker_req_t;
typedef struct gtpv1u_enb_end_marker_ind_s {
uint32_t frame;
uint8_t enb_flag;
uint32_t rb_id;
uint32_t muip;
uint32_t confirmp;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t mode;
uint16_t rnti;
uint8_t module_id;
uint8_t eNB_index;
} gtpv1u_enb_end_marker_ind_t;
typedef struct {
in_addr_t enb_ip_address_for_S1u_S12_S4_up;
tcp_udp_port_t enb_port_for_S1u_S12_S4_up;
+3
View File
@@ -34,6 +34,9 @@ MESSAGE_DEF(RRC_MAC_OUT_OF_SYNC_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacOutOfSy
MESSAGE_DEF(RRC_MAC_BCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacBcchDataReq, rrc_mac_bcch_data_req)
MESSAGE_DEF(RRC_MAC_BCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacBcchDataInd, rrc_mac_bcch_data_ind)
MESSAGE_DEF(RRC_MAC_BCCH_MBMS_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacBcchMbmsDataReq, rrc_mac_bcch_mbms_data_req)
MESSAGE_DEF(RRC_MAC_BCCH_MBMS_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacBcchMbmsDataInd, rrc_mac_bcch_mbms_data_ind)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataReq, rrc_mac_ccch_data_req)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_CNF, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataCnf, rrc_mac_ccch_data_cnf)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataInd, rrc_mac_ccch_data_ind)
+23
View File
@@ -37,6 +37,9 @@
#define RRC_MAC_BCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_data_req
#define RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_data_ind
#define RRC_MAC_BCCH_MBMS_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_mbms_data_req
#define RRC_MAC_BCCH_MBMS_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_mbms_data_ind
#define RRC_MAC_CCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_req
#define RRC_MAC_CCCH_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_cnf
#define RRC_MAC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_ind
@@ -47,6 +50,7 @@
// Some constants from "LAYER2/MAC/defs.h"
#define BCCH_SDU_SIZE (512)
#define BCCH_SDU_MBMS_SIZE (512)
#define CCCH_SDU_SIZE (512)
#define MCCH_SDU_SIZE (512)
#define PCCH_SDU_SIZE (512)
@@ -78,6 +82,25 @@ typedef struct RrcMacBcchDataInd_s {
uint8_t rsrp;
} RrcMacBcchDataInd;
typedef struct RrcMacBcchMbmsDataReq_s {
uint32_t frame;
uint32_t sdu_size;
uint8_t sdu[BCCH_SDU_MBMS_SIZE];
uint8_t enb_index;
} RrcMacBcchMbmsDataReq;
typedef struct RrcMacBcchMbmsDataInd_s {
uint32_t frame;
uint8_t sub_frame;
uint32_t sdu_size;
uint8_t sdu[BCCH_SDU_MBMS_SIZE];
uint8_t enb_index;
uint8_t rsrq;
uint8_t rsrp;
} RrcMacBcchMbmsDataInd;
typedef struct RrcMacCcchDataReq_s {
uint32_t frame;
uint32_t sdu_size;
+20 -20
View File
@@ -30,13 +30,13 @@
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "MeasGapConfig.h"
#include "TDD-Config.h"
#if (RRC_VERSION >= MAKE_VERSION(9, 0, 0))
#include "MBSFN-AreaInfoList-r9.h"
#include "MBSFN-SubframeConfigList.h"
#include "LTE_RadioResourceConfigCommonSIB.h"
#include "LTE_RadioResourceConfigDedicated.h"
#include "LTE_MeasGapConfig.h"
#include "LTE_TDD-Config.h"
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
#include "LTE_MBSFN-AreaInfoList-r9.h"
#include "LTE_MBSFN-SubframeConfigList.h"
#endif
//#include "rrm_config_structs.h"
//#include "platform_types.h"
@@ -347,25 +347,25 @@ typedef struct {
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 );
int (*rrc_mac_config_req)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t UE_id,uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated,
MAC_MainConfig_t *mac_MainConfig,
LTE_RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated,
LTE_MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity,
LogicalChannelConfig_t *logicalChannelConfig,
MeasGapConfig_t *measGapConfig,
TDD_Config_t *tdd_Config,
LTE_LogicalChannelConfig_t *logicalChannelConfig,
LTE_MeasGapConfig_t *measGapConfig,
LTE_TDD_Config_t *tdd_Config,
uint8_t *SIwindowsize,
uint16_t *SIperiod
#if (RRC_VERSION >= MAKE_VERSION(9, 0, 0))
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
,
MBMS_flag_t MBMS_Flag,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList,
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
struct PMCH_InfoList_r9 *pmch_InfoList
struct LTE_MBSFN_SubframeConfigList *mbsfn_SubframeConfigList,
LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
struct LTE_PMCH_InfoList_r9 *pmch_InfoList
#endif
);
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, const unsigned int,char*
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,uint32_t
,uint32_t
#endif
@@ -373,7 +373,7 @@ typedef struct {
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 enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, sub_frame_t subframeP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP,
logical_chan_id_t channel_idP, tb_size_t tb_sizeP
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,uint32_t sourceL2Id
,uint32_t destinationL2Id
#endif
@@ -390,7 +390,7 @@ typedef struct {
#define IDLE 0
//#define IDLE 0
#define NEED_RADIO_CONFIG 3
#define RADIO_CONFIG_TX 2
#define RADIO_CONFIG_OK 1
+1
View File
@@ -34,6 +34,7 @@
#include "ral_messages_def.h"
#endif
#include "s1ap_messages_def.h"
#include "f1ap_messages_def.h"
#include "x2ap_messages_def.h"
#include "sctp_messages_def.h"
#include "udp_messages_def.h"
+1 -2
View File
@@ -26,7 +26,6 @@
* Author: winckel
*/
#if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
//-------------------------------------------------------------------------------------------//
// Messages for NAS logging
MESSAGE_DEF(NAS_DL_EMM_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_dl_emm_raw_msg)
@@ -46,4 +45,4 @@ MESSAGE_DEF(NAS_DL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_
MESSAGE_DEF(NAS_UL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_protected_msg_t, nas_ul_esm_protected_msg)
//-------------------------------------------------------------------------------------------//
#endif /* ENABLE_USE_MME */
+1 -2
View File
@@ -29,7 +29,7 @@
#ifndef NAS_MESSAGES_TYPES_H_
#define NAS_MESSAGES_TYPES_H_
# if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
#include "nas_message.h"
@@ -142,5 +142,4 @@ typedef struct nas_esm_protected_msg_s {
ESM_msg choice;
} nas_esm_protected_msg_t;
# endif /* ENABLE_USE_MME */
#endif /* NAS_MESSAGES_TYPES_H_ */
+19 -10
View File
@@ -28,11 +28,7 @@
***************************************************************************/
#ifdef CMAKER
#include "asn_constant.h"
#else
#include "RRC/LTE/MESSAGES/asn1_constants.h"
#endif
#include "LTE_asn_constant.h"
#ifndef __PLATFORM_CONSTANTS_H__
# define __PLATFORM_CONSTANTS_H__
@@ -68,6 +64,16 @@
# define MAX_MODULES NB_MODULES_MAX
#ifndef UE_EXPANSION
// TODO:L2 FAPI simulator.
// UESIM_EXPANSION is used to be same value of MAX_MOBILES_PER_ENB
// in eNB and UE.
// now , if we use --mu option in UE, compiling error will occur.
// This problem will be fixed in the future.
# ifdef UESIM_EXPANSION
# define MAX_MOBILES_PER_ENB 256
# define MAX_MOBILES_PER_ENB_NB_IoT 256
# define MAX_eNB 2
# else
# ifdef LARGE_SCALE
# define MAX_MOBILES_PER_ENB 128
# define MAX_MOBILES_PER_ENB_NB_IoT 128
@@ -81,6 +87,7 @@
# define MAX_eNB 2
# define MAX_gNB 2
# endif
#endif
#else
# define MAX_MOBILES_PER_ENB 256
# define MAX_MOBILES_PER_ENB_NB_IoT 256
@@ -89,24 +96,26 @@
# define MAX_gNB 2
#endif
#define NUMBER_OF_NR_DLSCH_MAX 16
#define NUMBER_OF_NR_ULSCH_MAX 16
#define MAX_MANAGED_ENB_PER_MOBILE 2
#define MAX_MANAGED_GNB_PER_MOBILE 2
///NB-IOT
#define NB_RB_MAX_NB_IOT (maxDRB_NB_r13 + 3) //MP: NB_IoT --> 2(DRB)+3(SRBs - 2 is not used) = 5
#define NB_RB_MAX_NB_IOT (LTE_maxDRB_NB_r13 + 3) //MP: NB_IoT --> 2(DRB)+3(SRBs - 2 is not used) = 5
#define DEFAULT_RAB_ID 1
#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 */
#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0))
#define NB_RB_MBMS_MAX (maxSessionPerPMCH*maxServiceCount)
#define NB_RB_MAX (LTE_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 */
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
#define NB_RB_MBMS_MAX (LTE_maxSessionPerPMCH*LTE_maxServiceCount)
#else
// Do not allocate unused memory
#define NB_RB_MBMS_MAX 1
#endif
#define NB_RAB_MAX maxDRB /* was 8, now 11 */
#define NB_RAB_MAX LTE_maxDRB /* was 8, now 11 */
#define RAB_SHIFT1 9
#define RAB_SHIFT2 3
#define RAB_OFFSET 0x0007
+55 -54
View File
@@ -31,7 +31,7 @@
# define __PLATFORM_TYPES_H__
#if !defined(NAS_NETLINK)
#include <stdint.h>
#include <stdint.h>
#endif
//-----------------------------------------------------------------------------
@@ -42,19 +42,19 @@
* let's protect potential redefinition
*/
#ifndef _BOOLEAN_T_DEFINED_
#define _BOOLEAN_T_DEFINED_
#define _BOOLEAN_T_DEFINED_
typedef signed char boolean_t;
typedef signed char boolean_t;
#if !defined(TRUE)
#define TRUE (boolean_t)0x01
#endif
#if !defined(TRUE)
#define TRUE (boolean_t)0x01
#endif
#if !defined(FALSE)
#define FALSE (boolean_t)0x00
#endif
#if !defined(FALSE)
#define FALSE (boolean_t)0x00
#endif
#define BOOL_NOT(b) (b^TRUE)
#define BOOL_NOT(b) (b^TRUE)
#endif /* _BOOLEAN_T_DEFINED_ */
@@ -107,19 +107,19 @@ typedef enum rb_type_e {
} rb_type_t;
typedef enum {
CR_ROUND = 0,
CR_SRB12 = 1,
CR_HOL = 2,
CR_LC = 3,
CR_CQI = 4,
CR_LCP = 5,
CR_NUM = 6
CR_ROUND = 0,
CR_SRB12 = 1,
CR_HOL = 2,
CR_LC = 3,
CR_CQI = 4,
CR_LCP = 5,
CR_NUM = 6
} sorting_criterion_t;
typedef enum {
POL_FAIR = 0,
POL_GREEDY = 1,
POL_NUM = 2
POL_FAIR = 0,
POL_GREEDY = 1,
POL_NUM = 2
} accounting_policy_t;
//-----------------------------------------------------------------------------
// PHY TYPES
@@ -193,19 +193,19 @@ typedef uint32_t m_tmsi_t;
//Random UE identity length = 40 bits
#if ! defined(NOT_A_RANDOM_UE_IDENTITY)
#define NOT_A_RANDOM_UE_IDENTITY (uint64_t)0xFFFFFFFF
#define NOT_A_RANDOM_UE_IDENTITY (uint64_t)0xFFFFFFFF
#endif
#if ! defined(NOT_A_RNTI)
#define NOT_A_RNTI (rnti_t)0
#define NOT_A_RNTI (rnti_t)0
#endif
#if ! defined(M_RNTI)
#define M_RNTI (rnti_t)0xFFFD
#define M_RNTI (rnti_t)0xFFFD
#endif
#if ! defined(P_RNTI)
#define P_RNTI (rnti_t)0xFFFE
#define P_RNTI (rnti_t)0xFFFE
#endif
#if ! defined(SI_RNTI)
#define SI_RNTI (rnti_t)0xFFFF
#define SI_RNTI (rnti_t)0xFFFF
#endif
typedef enum config_action_e {
CONFIG_ACTION_NULL = 0,
@@ -230,7 +230,7 @@ typedef uint8_t ebi_t; // eps bearer id
//-----------------------------------------------------------------------------
// may be ITTI not enabled, but type instance is useful also for OTG,
#if !defined(instance_t)
typedef uint16_t instance_t;
typedef uint16_t instance_t;
#endif
typedef struct protocol_ctxt_s {
module_id_t module_id; /*!< \brief Virtualized module identifier */
@@ -241,6 +241,7 @@ typedef struct protocol_ctxt_s {
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */
boolean_t configured; /*!< \brief flag indicating whether the instance is configured or not */
boolean_t brOption;
} protocol_ctxt_t;
// warning time hardcoded
#define PROTOCOL_CTXT_TIME_MILLI_SECONDS(CtXt_h) ((CtXt_h)->frame*10+(CtXt_h)->subframe)
@@ -255,51 +256,51 @@ typedef struct protocol_ctxt_s {
#define GNB_INSTANCE_TO_MODULE_ID( iNSTANCE )iNSTANCE
#define MODULE_ID_TO_INSTANCE(mODULE_iD, iNSTANCE, eNB_fLAG) \
if(eNB_fLAG == ENB_FLAG_YES) \
iNSTANCE = ENB_MODULE_ID_TO_INSTANCE(mODULE_iD); \
else \
iNSTANCE = UE_MODULE_ID_TO_INSTANCE(mODULE_iD)
if(eNB_fLAG == ENB_FLAG_YES) \
iNSTANCE = ENB_MODULE_ID_TO_INSTANCE(mODULE_iD); \
else \
iNSTANCE = UE_MODULE_ID_TO_INSTANCE(mODULE_iD)
#define INSTANCE_TO_MODULE_ID(iNSTANCE, mODULE_iD, eNB_fLAG) \
if(eNB_fLAG == ENB_FLAG_YES) \
mODULE_iD = ENB_INSTANCE_TO_MODULE_ID(iNSTANCE); \
else \
mODULE_iD = UE_INSTANCE_TO_MODULE_ID(iNSTANCE)
if(eNB_fLAG == ENB_FLAG_YES) \
mODULE_iD = ENB_INSTANCE_TO_MODULE_ID(iNSTANCE); \
else \
mODULE_iD = UE_INSTANCE_TO_MODULE_ID(iNSTANCE)
#define PROTOCOL_CTXT_COMPUTE_MODULE_ID(CtXt_h) \
INSTANCE_TO_MODULE_ID( (CtXt_h)->instance , (CtXt_h)->module_id , (CtXt_h)->enb_flag )
INSTANCE_TO_MODULE_ID( (CtXt_h)->instance , (CtXt_h)->module_id , (CtXt_h)->enb_flag )
#define PROTOCOL_CTXT_COMPUTE_INSTANCE(CtXt_h) \
MODULE_ID_TO_INSTANCE( (CtXt_h)->module_id , (CtXt_h)->instance , (CtXt_h)->enb_flag )
MODULE_ID_TO_INSTANCE( (CtXt_h)->module_id , (CtXt_h)->instance , (CtXt_h)->enb_flag )
#define PROTOCOL_CTXT_SET_BY_MODULE_ID(Ctxt_Pp, mODULE_iD, eNB_fLAG, rNTI, fRAME, sUBfRAME, eNB_iNDEX) \
(Ctxt_Pp)->module_id = mODULE_iD; \
(Ctxt_Pp)->enb_flag = eNB_fLAG; \
(Ctxt_Pp)->rnti = rNTI; \
(Ctxt_Pp)->frame = fRAME; \
(Ctxt_Pp)->subframe = sUBfRAME; \
(Ctxt_Pp)->eNB_index = eNB_iNDEX; \
PROTOCOL_CTXT_COMPUTE_INSTANCE(Ctxt_Pp)
(Ctxt_Pp)->module_id = mODULE_iD; \
(Ctxt_Pp)->enb_flag = eNB_fLAG; \
(Ctxt_Pp)->rnti = rNTI; \
(Ctxt_Pp)->frame = fRAME; \
(Ctxt_Pp)->subframe = sUBfRAME; \
(Ctxt_Pp)->eNB_index = eNB_iNDEX; \
PROTOCOL_CTXT_COMPUTE_INSTANCE(Ctxt_Pp)
#define PROTOCOL_CTXT_SET_BY_INSTANCE(Ctxt_Pp, iNSTANCE, eNB_fLAG, rNTI, fRAME, sUBfRAME) \
(Ctxt_Pp)->instance = iNSTANCE; \
(Ctxt_Pp)->enb_flag = eNB_fLAG; \
(Ctxt_Pp)->rnti = rNTI; \
(Ctxt_Pp)->frame = fRAME; \
(Ctxt_Pp)->subframe = sUBfRAME; \
PROTOCOL_CTXT_COMPUTE_MODULE_ID(Ctxt_Pp)
(Ctxt_Pp)->instance = iNSTANCE; \
(Ctxt_Pp)->enb_flag = eNB_fLAG; \
(Ctxt_Pp)->rnti = rNTI; \
(Ctxt_Pp)->frame = fRAME; \
(Ctxt_Pp)->subframe = sUBfRAME; \
PROTOCOL_CTXT_COMPUTE_MODULE_ID(Ctxt_Pp)
#define PROTOCOL_CTXT_FMT "[FRAME %05u][%s][MOD %02u][RNTI %" PRIx16 "]"
#define PROTOCOL_CTXT_ARGS(CTXT_Pp) \
(CTXT_Pp)->frame, \
((CTXT_Pp)->enb_flag == ENB_FLAG_YES) ? "eNB":" UE", \
(CTXT_Pp)->module_id, \
(CTXT_Pp)->rnti
(CTXT_Pp)->frame, \
((CTXT_Pp)->enb_flag == ENB_FLAG_YES) ? "eNB":" UE", \
(CTXT_Pp)->module_id, \
(CTXT_Pp)->rnti
#define CHECK_CTXT_ARGS(CTXT_Pp)
#define exit_fun(msg) exit_function(__FILE__,__FUNCTION__,__LINE__,msg)
void exit_function(const char* file, const char* function, const int line, const char* s);
void exit_function(const char *file, const char *function, const int line, const char *s);
#endif
+3
View File
@@ -73,3 +73,6 @@ MESSAGE_DEF(NAS_CONN_ESTABLI_CNF, MESSAGE_PRIORITY_MED, NasConnEstab
MESSAGE_DEF(NAS_CONN_RELEASE_IND, MESSAGE_PRIORITY_MED, NasConnReleaseInd, nas_conn_release_ind)
MESSAGE_DEF(NAS_UPLINK_DATA_CNF, MESSAGE_PRIORITY_MED, NasUlDataCnf, nas_ul_data_cnf)
MESSAGE_DEF(NAS_DOWNLINK_DATA_IND, MESSAGE_PRIORITY_MED, NasDlDataInd, nas_dl_data_ind)
// eNB: realtime -> RRC messages
MESSAGE_DEF(RRC_SUBFRAME_PROCESS, MESSAGE_PRIORITY_MED, RrcSubframeProcess, rrc_subframe_process)
+213 -111
View File
@@ -32,34 +32,32 @@
#include "as_message.h"
#include "rrc_types.h"
#include "s1ap_messages_types.h"
#ifdef CMAKER
#include "SystemInformationBlockType2.h"
#else
#include "RRC/LTE/MESSAGES/SystemInformationBlockType2.h"
#endif
#include "SL-OffsetIndicator-r12.h"
#include "SubframeBitmapSL-r12.h"
#include "SL-CP-Len-r12.h"
#include "SL-PeriodComm-r12.h"
#include "SL-DiscResourcePool-r12.h"
#include "f1ap_messages_types.h"
#include "LTE_SystemInformationBlockType2.h"
#include "LTE_SL-OffsetIndicator-r12.h"
#include "LTE_SubframeBitmapSL-r12.h"
#include "LTE_DRX-Config.h"
#include "LTE_SL-CP-Len-r12.h"
#include "LTE_SL-PeriodComm-r12.h"
#include "LTE_SL-DiscResourcePool-r12.h"
#include "NR_RACH-ConfigCommon.h"
//-------------------------------------------------------------------------------------------//
// Messages for RRC logging
#if defined(DISABLE_ITTI_XER_PRINT)
#include "BCCH-DL-SCH-Message.h"
#include "DL-CCCH-Message.h"
#include "DL-DCCH-Message.h"
#include "UE-EUTRA-Capability.h"
#include "UL-CCCH-Message.h"
#include "UL-DCCH-Message.h"
#include "LTE_BCCH-DL-SCH-Message.h"
#include "LTE_DL-CCCH-Message.h"
#include "LTE_DL-DCCH-Message.h"
#include "LTE_UE-EUTRA-Capability.h"
#include "LTE_UL-CCCH-Message.h"
#include "LTE_UL-DCCH-Message.h"
typedef BCCH_DL_SCH_Message_t RrcDlBcchMessage;
typedef DL_CCCH_Message_t RrcDlCcchMessage;
typedef DL_DCCH_Message_t RrcDlDcchMessage;
typedef UE_EUTRA_Capability_t RrcUeEutraCapability;
typedef UL_CCCH_Message_t RrcUlCcchMessage;
typedef UL_DCCH_Message_t RrcUlDcchMessage;
typedef LTE_BCCH_DL_SCH_Message_t RrcDlBcchMessage;
typedef LTE_DL_CCCH_Message_t RrcDlCcchMessage;
typedef LTE_DL_DCCH_Message_t RrcDlDcchMessage;
typedef LTE_UE_EUTRA_Capability_t RrcUeEutraCapability;
typedef LTE_UL_CCCH_Message_t RrcUlCcchMessage;
typedef LTE_UL_DCCH_Message_t RrcUlDcchMessage;
#endif
//-------------------------------------------------------------------------------------------//
@@ -87,24 +85,103 @@ typedef UL_DCCH_Message_t RrcUlDcchMessage;
#define NAS_UPLINK_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_cnf
#define NAS_DOWNLINK_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_ind
#define RRC_SUBFRAME_PROCESS(mSGpTR) (mSGpTR)->ittiMsg.rrc_subframe_process
//-------------------------------------------------------------------------------------------//
typedef struct RrcStateInd_s {
Rrc_State_t state;
Rrc_Sub_State_t sub_state;
} RrcStateInd;
typedef struct RadioResourceConfig_s {
long prach_root;
long prach_config_index;
BOOLEAN_t prach_high_speed;
long prach_zero_correlation;
long prach_freq_offset;
long pucch_delta_shift;
long pucch_nRB_CQI;
long pucch_nCS_AN;
long pucch_n1_AN;
long pdsch_referenceSignalPower;
long pdsch_p_b;
long pusch_n_SB;
long pusch_hoppingMode;
long pusch_hoppingOffset;
BOOLEAN_t pusch_enable64QAM;
BOOLEAN_t pusch_groupHoppingEnabled;
long pusch_groupAssignment;
BOOLEAN_t pusch_sequenceHoppingEnabled;
long pusch_nDMRS1;
long phich_duration;
long phich_resource;
BOOLEAN_t srs_enable;
long srs_BandwidthConfig;
long srs_SubframeConfig;
BOOLEAN_t srs_ackNackST;
BOOLEAN_t srs_MaxUpPts;
long pusch_p0_Nominal;
long pusch_alpha;
long pucch_p0_Nominal;
long msg3_delta_Preamble;
long ul_CyclicPrefixLength;
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1 pucch_deltaF_Format1;
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b pucch_deltaF_Format1b;
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2 pucch_deltaF_Format2;
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a pucch_deltaF_Format2a;
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b pucch_deltaF_Format2b;
long rach_numberOfRA_Preambles;
BOOLEAN_t rach_preamblesGroupAConfig;
long rach_sizeOfRA_PreamblesGroupA;
long rach_messageSizeGroupA;
e_LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB;
long rach_powerRampingStep;
long rach_preambleInitialReceivedTargetPower;
long rach_preambleTransMax;
long rach_raResponseWindowSize;
long rach_macContentionResolutionTimer;
long rach_maxHARQ_Msg3Tx;
long bcch_modificationPeriodCoeff;
long pcch_defaultPagingCycle;
long pcch_nB;
LTE_DRX_Config_PR drx_Config_present;
long drx_onDurationTimer;
long drx_InactivityTimer;
long drx_RetransmissionTimer;
LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR drx_longDrx_CycleStartOffset_present;
long drx_longDrx_CycleStartOffset;
long drx_shortDrx_Cycle;
long drx_shortDrx_ShortCycleTimer;
long ue_TimersAndConstants_t300;
long ue_TimersAndConstants_t301;
long ue_TimersAndConstants_t310;
long ue_TimersAndConstants_t311;
long ue_TimersAndConstants_n310;
long ue_TimersAndConstants_n311;
long ue_TransmissionMode;
long ue_multiple_max;
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
//SIB2 BR Options
long* preambleTransMax_CE_r13;
BOOLEAN_t prach_ConfigCommon_v1310;
BOOLEAN_t* mpdcch_startSF_CSS_RA_r13;
long mpdcch_startSF_CSS_RA_r13_val;
long* prach_HoppingOffset_r13;
#endif
BOOLEAN_t mbms_dedicated_serving_cell;
} RadioResourceConfig;
// eNB: ENB_APP -> RRC messages
typedef struct RrcConfigurationReq_s {
uint32_t cell_identity;
uint16_t tac;
uint16_t mcc[PLMN_LIST_MAX_SIZE];
uint16_t mnc[PLMN_LIST_MAX_SIZE];
uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE];
uint8_t num_plmn;
uint16_t mcc[PLMN_LIST_MAX_SIZE];
uint16_t mnc[PLMN_LIST_MAX_SIZE];
uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE];
uint8_t num_plmn;
int enable_measurement_reports;
int enable_x2;
uint32_t rrc_inactivity_timer_thres; // for testing, maybe change later
paging_drx_t default_drx;
int16_t nb_cc;
lte_frame_type_t frame_type[MAX_NUM_CCs];
@@ -118,109 +195,130 @@ typedef struct RrcConfigurationReq_s {
int16_t Nid_cell[MAX_NUM_CCs];// for testing, change later
int16_t N_RB_DL[MAX_NUM_CCs];// for testing, change later
int nb_antenna_ports[MAX_NUM_CCs];
long prach_root[MAX_NUM_CCs];
long prach_config_index[MAX_NUM_CCs];
BOOLEAN_t prach_high_speed[MAX_NUM_CCs];
long prach_zero_correlation[MAX_NUM_CCs];
long prach_freq_offset[MAX_NUM_CCs];
long pucch_delta_shift[MAX_NUM_CCs];
long pucch_nRB_CQI[MAX_NUM_CCs];
long pucch_nCS_AN[MAX_NUM_CCs];
//#if (RRC_VERSION < MAKE_VERSION(10, 0, 0))
long pucch_n1_AN[MAX_NUM_CCs];
//#endif
long pdsch_referenceSignalPower[MAX_NUM_CCs];
long pdsch_p_b[MAX_NUM_CCs];
long pusch_n_SB[MAX_NUM_CCs];
long pusch_hoppingMode[MAX_NUM_CCs];
long pusch_hoppingOffset[MAX_NUM_CCs];
BOOLEAN_t pusch_enable64QAM[MAX_NUM_CCs];
BOOLEAN_t pusch_groupHoppingEnabled[MAX_NUM_CCs];
long pusch_groupAssignment[MAX_NUM_CCs];
BOOLEAN_t pusch_sequenceHoppingEnabled[MAX_NUM_CCs];
long pusch_nDMRS1[MAX_NUM_CCs];
long phich_duration[MAX_NUM_CCs];
long phich_resource[MAX_NUM_CCs];
BOOLEAN_t srs_enable[MAX_NUM_CCs];
long srs_BandwidthConfig[MAX_NUM_CCs];
long srs_SubframeConfig[MAX_NUM_CCs];
BOOLEAN_t srs_ackNackST[MAX_NUM_CCs];
BOOLEAN_t srs_MaxUpPts[MAX_NUM_CCs];
long pusch_p0_Nominal[MAX_NUM_CCs];
long pusch_alpha[MAX_NUM_CCs];
long pucch_p0_Nominal[MAX_NUM_CCs];
long msg3_delta_Preamble[MAX_NUM_CCs];
long ul_CyclicPrefixLength[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format1 pucch_deltaF_Format1[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format1b pucch_deltaF_Format1b[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2 pucch_deltaF_Format2[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2a pucch_deltaF_Format2a[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2b pucch_deltaF_Format2b[MAX_NUM_CCs];
long rach_numberOfRA_Preambles[MAX_NUM_CCs];
BOOLEAN_t rach_preamblesGroupAConfig[MAX_NUM_CCs];
long rach_sizeOfRA_PreamblesGroupA[MAX_NUM_CCs];
long rach_messageSizeGroupA[MAX_NUM_CCs];
e_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
long rach_powerRampingStep[MAX_NUM_CCs];
long rach_preambleInitialReceivedTargetPower[MAX_NUM_CCs];
long rach_preambleTransMax[MAX_NUM_CCs];
long rach_raResponseWindowSize[MAX_NUM_CCs];
long rach_macContentionResolutionTimer[MAX_NUM_CCs];
long rach_maxHARQ_Msg3Tx[MAX_NUM_CCs];
long bcch_modificationPeriodCoeff[MAX_NUM_CCs];
long pcch_defaultPagingCycle[MAX_NUM_CCs];
long pcch_nB[MAX_NUM_CCs];
long ue_TimersAndConstants_t300[MAX_NUM_CCs];
long ue_TimersAndConstants_t301[MAX_NUM_CCs];
long ue_TimersAndConstants_t310[MAX_NUM_CCs];
long ue_TimersAndConstants_t311[MAX_NUM_CCs];
long ue_TimersAndConstants_n310[MAX_NUM_CCs];
long ue_TimersAndConstants_n311[MAX_NUM_CCs];
long ue_TransmissionMode[MAX_NUM_CCs];
long ue_multiple_max[MAX_NUM_CCs];
int eMBMS_configured;
int eMTC_configured;
int SL_configured;
//TTN - for D2D
RadioResourceConfig radioresourceconfig[MAX_NUM_CCs];
RadioResourceConfig radioresourceconfig_BR[MAX_NUM_CCs];
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
//MIB
long schedulingInfoSIB1_BR_r13[MAX_NUM_CCs];
//SIB1 BR options
uint16_t* hyperSFN_r13 [MAX_NUM_CCs];
long* eDRX_Allowed_r13 [MAX_NUM_CCs];
BOOLEAN_t cellSelectionInfoCE_r13 [MAX_NUM_CCs];
long q_RxLevMinCE_r13 [MAX_NUM_CCs];
long* q_QualMinRSRQ_CE_r13 [MAX_NUM_CCs];
BOOLEAN_t bandwidthReducedAccessRelatedInfo_r13 [MAX_NUM_CCs];
long si_Narrowband_r13 [MAX_NUM_CCs][32];
long si_TBS_r13 [MAX_NUM_CCs][32];
int scheduling_info_br_size [MAX_NUM_CCs];
long si_WindowLength_BR_r13 [MAX_NUM_CCs];
long si_RepetitionPattern_r13 [MAX_NUM_CCs];
BOOLEAN_t * fdd_DownlinkOrTddSubframeBitmapBR_r13 [MAX_NUM_CCs];
uint64_t fdd_DownlinkOrTddSubframeBitmapBR_val_r13 [MAX_NUM_CCs];
uint16_t *fdd_UplinkSubframeBitmapBR_r13 [MAX_NUM_CCs];
long startSymbolBR_r13 [MAX_NUM_CCs];
long si_HoppingConfigCommon_r13 [MAX_NUM_CCs];
long* si_ValidityTime_r13 [MAX_NUM_CCs];
long systemInfoValueTagSi_r13 [MAX_NUM_CCs][10];
int system_info_value_tag_SI_size [MAX_NUM_CCs];
BOOLEAN_t freqHoppingParametersDL_r13 [MAX_NUM_CCs];
long* mpdcch_pdsch_HoppingNB_r13 [MAX_NUM_CCs];
BOOLEAN_t interval_DLHoppingConfigCommonModeA_r13 [MAX_NUM_CCs];
long interval_DLHoppingConfigCommonModeA_r13_val [MAX_NUM_CCs];
BOOLEAN_t interval_DLHoppingConfigCommonModeB_r13 [MAX_NUM_CCs];
long interval_DLHoppingConfigCommonModeB_r13_val [MAX_NUM_CCs];
long* mpdcch_pdsch_HoppingOffset_r13 [MAX_NUM_CCs];
long firstPreamble_r13 [MAX_NUM_CCs][4];
long lastPreamble_r13 [MAX_NUM_CCs][4];
long ra_ResponseWindowSize_r13 [MAX_NUM_CCs][4];
long mac_ContentionResolutionTimer_r13 [MAX_NUM_CCs][4];
long rar_HoppingConfig_r13 [MAX_NUM_CCs][4];
int rach_CE_LevelInfoList_r13_size [MAX_NUM_CCs];
// long pcch_defaultPagingCycle_br;
long rsrp_range [MAX_NUM_CCs][3];
int rsrp_range_list_size [MAX_NUM_CCs];
long prach_config_index [MAX_NUM_CCs][4];
long prach_freq_offset [MAX_NUM_CCs][4];
long *prach_StartingSubframe_r13 [MAX_NUM_CCs][4];
long *maxNumPreambleAttemptCE_r13 [MAX_NUM_CCs][4];
long numRepetitionPerPreambleAttempt_r13 [MAX_NUM_CCs][4];
long mpdcch_NumRepetition_RA_r13 [MAX_NUM_CCs][4];
long prach_HoppingConfig_r13 [MAX_NUM_CCs][4];
int prach_parameters_list_size [MAX_NUM_CCs];
long max_available_narrow_band [MAX_NUM_CCs][4][2];
int max_available_narrow_band_size [MAX_NUM_CCs][4];
long pucch_info_value [MAX_NUM_CCs][4];
int pucch_info_value_size [MAX_NUM_CCs];
bool pcch_config_v1310 [MAX_NUM_CCs];
long paging_narrowbands_r13 [MAX_NUM_CCs];
long mpdcch_numrepetition_paging_r13 [MAX_NUM_CCs];
long *nb_v1310 [MAX_NUM_CCs];
long *pucch_NumRepetitionCE_Msg4_Level0_r13 [MAX_NUM_CCs];
long *pucch_NumRepetitionCE_Msg4_Level1_r13 [MAX_NUM_CCs];
long *pucch_NumRepetitionCE_Msg4_Level2_r13 [MAX_NUM_CCs];
long *pucch_NumRepetitionCE_Msg4_Level3_r13 [MAX_NUM_CCs];
bool sib2_freq_hoppingParameters_r13_exists [MAX_NUM_CCs];
long *sib2_mpdcch_pdsch_hoppingNB_r13 [MAX_NUM_CCs];
long *sib2_interval_DLHoppingConfigCommonModeA_r13 [MAX_NUM_CCs];
long sib2_interval_DLHoppingConfigCommonModeA_r13_val [MAX_NUM_CCs];
long *sib2_interval_DLHoppingConfigCommonModeB_r13 [MAX_NUM_CCs];
long sib2_interval_DLHoppingConfigCommonModeB_r13_val [MAX_NUM_CCs];
long *sib2_interval_ULHoppingConfigCommonModeA_r13 [MAX_NUM_CCs];
long sib2_interval_ULHoppingConfigCommonModeA_r13_val [MAX_NUM_CCs];
long *sib2_interval_ULHoppingConfigCommonModeB_r13 [MAX_NUM_CCs];
long sib2_interval_ULHoppingConfigCommonModeB_r13_val [MAX_NUM_CCs];
long *sib2_mpdcch_pdsch_hoppingOffset_r13 [MAX_NUM_CCs];
long *pdsch_maxNumRepetitionCEmodeA_r13 [MAX_NUM_CCs];
long *pdsch_maxNumRepetitionCEmodeB_r13 [MAX_NUM_CCs];
long *pusch_maxNumRepetitionCEmodeA_r13 [MAX_NUM_CCs];
long *pusch_maxNumRepetitionCEmodeB_r13 [MAX_NUM_CCs];
long *pusch_HoppingOffset_v1310 [MAX_NUM_CCs];
#endif
//SIB18
e_SL_CP_Len_r12 rxPool_sc_CP_Len[MAX_NUM_CCs];
e_SL_PeriodComm_r12 rxPool_sc_Period[MAX_NUM_CCs];
e_SL_CP_Len_r12 rxPool_data_CP_Len[MAX_NUM_CCs];
e_LTE_SL_CP_Len_r12 rxPool_sc_CP_Len[MAX_NUM_CCs];
e_LTE_SL_PeriodComm_r12 rxPool_sc_Period[MAX_NUM_CCs];
e_LTE_SL_CP_Len_r12 rxPool_data_CP_Len[MAX_NUM_CCs];
long rxPool_ResourceConfig_prb_Num[MAX_NUM_CCs];
long rxPool_ResourceConfig_prb_Start[MAX_NUM_CCs];
long rxPool_ResourceConfig_prb_End[MAX_NUM_CCs];
SL_OffsetIndicator_r12_PR rxPool_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
LTE_SL_OffsetIndicator_r12_PR rxPool_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
long rxPool_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
SubframeBitmapSL_r12_PR rxPool_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
char* rxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
LTE_SubframeBitmapSL_r12_PR rxPool_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
char *rxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
long rxPool_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
long rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
//SIB19
//for discRxPool
SL_CP_Len_r12_t discRxPool_cp_Len[MAX_NUM_CCs];
e_SL_DiscResourcePool_r12__discPeriod_r12 discRxPool_discPeriod[MAX_NUM_CCs];
LTE_SL_CP_Len_r12_t discRxPool_cp_Len[MAX_NUM_CCs];
e_LTE_SL_DiscResourcePool_r12__discPeriod_r12 discRxPool_discPeriod[MAX_NUM_CCs];
long discRxPool_numRetx[MAX_NUM_CCs];
long discRxPool_numRepetition[MAX_NUM_CCs];
long discRxPool_ResourceConfig_prb_Num[MAX_NUM_CCs];
long discRxPool_ResourceConfig_prb_Start[MAX_NUM_CCs];
long discRxPool_ResourceConfig_prb_End[MAX_NUM_CCs];
SL_OffsetIndicator_r12_PR discRxPool_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
LTE_SL_OffsetIndicator_r12_PR discRxPool_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
long discRxPool_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
SubframeBitmapSL_r12_PR discRxPool_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
char* discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
LTE_SubframeBitmapSL_r12_PR discRxPool_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
char *discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
long discRxPool_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
long discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
//for discRxPoolPS
SL_CP_Len_r12_t discRxPoolPS_cp_Len[MAX_NUM_CCs];
e_SL_DiscResourcePool_r12__discPeriod_r12 discRxPoolPS_discPeriod[MAX_NUM_CCs];
LTE_SL_CP_Len_r12_t discRxPoolPS_cp_Len[MAX_NUM_CCs];
e_LTE_SL_DiscResourcePool_r12__discPeriod_r12 discRxPoolPS_discPeriod[MAX_NUM_CCs];
long discRxPoolPS_numRetx[MAX_NUM_CCs];
long discRxPoolPS_numRepetition[MAX_NUM_CCs];
long discRxPoolPS_ResourceConfig_prb_Num[MAX_NUM_CCs];
long discRxPoolPS_ResourceConfig_prb_Start[MAX_NUM_CCs];
long discRxPoolPS_ResourceConfig_prb_End[MAX_NUM_CCs];
SL_OffsetIndicator_r12_PR discRxPoolPS_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
LTE_SL_OffsetIndicator_r12_PR discRxPoolPS_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
long discRxPoolPS_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
SubframeBitmapSL_r12_PR discRxPoolPS_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
char* discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
LTE_SubframeBitmapSL_r12_PR discRxPoolPS_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
char *discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
} RrcConfigurationReq;
@@ -229,9 +327,7 @@ typedef struct RrcConfigurationReq_s {
typedef struct NbIoTRrcConfigurationReq_s {
uint32_t cell_identity;
uint16_t tac;
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
@@ -389,7 +485,7 @@ typedef struct NRRrcConfigurationReq_s {
uint32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen[MAX_NUM_CCs];
BOOLEAN_t rach_groupBconfigured[MAX_NUM_CCs];
long rach_ra_Msg3SizeGroupA[MAX_NUM_CCs];
long rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
e_NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
long rach_numberOfRA_PreamblesGroupA[MAX_NUM_CCs];
long rach_ra_ContentionResolutionTimer[MAX_NUM_CCs];
long rsrp_ThresholdSSB[MAX_NUM_CCs];
@@ -512,4 +608,10 @@ typedef nas_release_ind_t NasConnReleaseInd;
typedef ul_info_transfer_cnf_t NasUlDataCnf;
typedef dl_info_transfer_ind_t NasDlDataInd;
// eNB: realtime -> RRC messages
typedef struct rrc_subframe_process_s {
protocol_ctxt_t ctxt;
int CC_id;
} RrcSubframeProcess;
#endif /* RRC_MESSAGES_TYPES_H_ */
+4
View File
@@ -39,6 +39,8 @@ MESSAGE_DEF(S1AP_PAGING_LOG , MESSAGE_PRIORITY_MED, IttiMsgText
MESSAGE_DEF(S1AP_E_RAB_RELEASE_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_release_request_log)
MESSAGE_DEF(S1AP_E_RAB_RELEASE_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_release_response_log)
MESSAGE_DEF(S1AP_ERROR_INDICATION_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_error_indication_log)
MESSAGE_DEF(S1AP_PATH_SWITCH_REQ_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_path_switch_req_log)
MESSAGE_DEF(S1AP_PATH_SWITCH_REQ_ACK_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_path_switch_req_ack_log)
/* eNB application layer -> S1AP messages */
MESSAGE_DEF(S1AP_REGISTER_ENB_REQ , MESSAGE_PRIORITY_MED, s1ap_register_enb_req_t , s1ap_register_enb_req)
@@ -62,6 +64,8 @@ MESSAGE_DEF(S1AP_E_RAB_SETUP_RESP , MESSAGE_PRIORITY_MED, s1ap_e_rab_se
MESSAGE_DEF(S1AP_E_RAB_SETUP_REQUEST_FAIL , MESSAGE_PRIORITY_MED, s1ap_e_rab_setup_req_fail_t , s1ap_e_rab_setup_request_fail)
MESSAGE_DEF(S1AP_E_RAB_MODIFY_RESP , MESSAGE_PRIORITY_MED, s1ap_e_rab_modify_resp_t , s1ap_e_rab_modify_resp)
MESSAGE_DEF(S1AP_E_RAB_RELEASE_RESPONSE , MESSAGE_PRIORITY_MED, s1ap_e_rab_release_resp_t , s1ap_e_rab_release_resp)
MESSAGE_DEF(S1AP_PATH_SWITCH_REQ , MESSAGE_PRIORITY_MED, s1ap_path_switch_req_t , s1ap_path_switch_req)
MESSAGE_DEF(S1AP_PATH_SWITCH_REQ_ACK , MESSAGE_PRIORITY_MED, s1ap_path_switch_req_ack_t , s1ap_path_switch_req_ack)
/* S1AP -> RRC messages */
MESSAGE_DEF(S1AP_DOWNLINK_NAS , MESSAGE_PRIORITY_MED, s1ap_downlink_nas_t , s1ap_downlink_nas )
+73 -5
View File
@@ -22,6 +22,7 @@
#ifndef S1AP_MESSAGES_TYPES_H_
#define S1AP_MESSAGES_TYPES_H_
#include "LTE_asn_constant.h"
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
@@ -42,6 +43,8 @@
#define S1AP_E_RAB_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_setup_resp
#define S1AP_E_RAB_SETUP_FAIL(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_setup_req_fail
#define S1AP_E_RAB_MODIFY_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_modify_resp
#define S1AP_PATH_SWITCH_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_path_switch_req
#define S1AP_PATH_SWITCH_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.s1ap_path_switch_req_ack
#define S1AP_DOWNLINK_NAS(mSGpTR) (mSGpTR)->ittiMsg.s1ap_downlink_nas
#define S1AP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_req
@@ -60,7 +63,7 @@
/* Maximum number of e-rabs to be setup/deleted in a single message.
* Even if only one bearer will be modified by message.
*/
#define S1AP_MAX_E_RAB 11
#define S1AP_MAX_E_RAB (LTE_maxDRB + 3)
/* Length of the transport layer address string
* 160 bits / 8 bits by char.
@@ -269,6 +272,17 @@ typedef struct e_rab_setup_s {
uint32_t gtp_teid;
} e_rab_setup_t;
typedef struct e_rab_tobeswitched_s {
/* Unique e_rab_id for the UE. */
uint8_t e_rab_id;
/* The transport layer address for the IP packets */
transport_layer_addr_t sgw_addr;
/* S-GW Tunnel endpoint identifier */
uint32_t gtp_teid;
} e_rab_tobeswitched_t;
typedef struct e_rab_modify_s {
/* Unique e_rab_id for the UE. */
uint8_t e_rab_id;
@@ -480,6 +494,8 @@ typedef struct s1ap_initial_context_setup_req_s {
/* eNB ue s1ap id as initialized by S1AP layer */
unsigned eNB_ue_s1ap_id:24;
uint32_t mme_ue_s1ap_id;
/* UE aggregate maximum bitrate */
ambr_t ue_ambr;
@@ -533,7 +549,7 @@ typedef struct s1ap_e_rab_setup_req_s {
uint16_t ue_initial_id;
/* MME UE id */
uint16_t mme_ue_s1ap_id;
uint32_t mme_ue_s1ap_id;
/* eNB ue s1ap id as initialized by S1AP layer */
unsigned eNB_ue_s1ap_id:24;
@@ -560,6 +576,58 @@ typedef struct s1ap_e_rab_setup_resp_s {
e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB];
} s1ap_e_rab_setup_resp_t;
typedef struct s1ap_path_switch_req_s {
unsigned eNB_ue_s1ap_id:24;
/* Number of e_rab setup-ed in the list */
uint8_t nb_of_e_rabs;
/* list of e_rab setup-ed by RRC layers */
e_rab_setup_t e_rabs_tobeswitched[S1AP_MAX_E_RAB];
/* MME UE id */
uint32_t mme_ue_s1ap_id;
s1ap_gummei_t ue_gummei;
uint16_t ue_initial_id;
/* Security algorithms */
security_capabilities_t security_capabilities;
} s1ap_path_switch_req_t;
typedef struct s1ap_path_switch_req_ack_s {
/* UE id for initial connection to S1AP */
uint16_t ue_initial_id;
unsigned eNB_ue_s1ap_id:24;
/* MME UE id */
uint32_t mme_ue_s1ap_id;
/* UE aggregate maximum bitrate */
ambr_t ue_ambr;
/* Number of e_rab setup-ed in the list */
uint8_t nb_e_rabs_tobeswitched;
/* list of e_rab to be switched by RRC layers */
e_rab_tobeswitched_t e_rabs_tobeswitched[S1AP_MAX_E_RAB];
/* Number of e_rabs to be released by RRC */
uint8_t nb_e_rabs_tobereleased;
/* list of e_rabs to be released */
e_rab_failed_t e_rabs_tobereleased[S1AP_MAX_E_RAB];
/* Security key */
int next_hop_chain_count;
uint8_t next_security_key[SECURITY_KEY_LENGTH];
} s1ap_path_switch_req_ack_t;
// S1AP --> RRC messages
typedef struct s1ap_ue_release_command_s {
@@ -582,7 +650,7 @@ typedef struct s1ap_e_rab_modify_req_s {
uint16_t ue_initial_id;
/* MME UE id */
uint16_t mme_ue_s1ap_id;
uint32_t mme_ue_s1ap_id;
/* eNB ue s1ap id as initialized by S1AP layer */
unsigned eNB_ue_s1ap_id:24;
@@ -615,7 +683,7 @@ typedef struct e_rab_release_s {
typedef struct s1ap_e_rab_release_command_s {
/* MME UE id */
uint16_t mme_ue_s1ap_id;
uint32_t mme_ue_s1ap_id;
/* eNB ue s1ap id as initialized by S1AP layer */
unsigned eNB_ue_s1ap_id:24;
@@ -633,7 +701,7 @@ typedef struct s1ap_e_rab_release_command_s {
typedef struct s1ap_e_rab_release_resp_s {
/* MME UE id */
uint16_t mme_ue_s1ap_id;
uint32_t mme_ue_s1ap_id;
/* eNB ue s1ap id as initialized by S1AP layer */
unsigned eNB_ue_s1ap_id:24;
+3 -13
View File
@@ -25,18 +25,11 @@ TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10)
// Other possible tasks in the process
// Common tasks:
/// Layer 2 and Layer 1 task supporting all the synchronous processing
TASK_DEF(TASK_L2L1, TASK_PRIORITY_MAX_LEAST, 200)
/// Bearers Manager task
TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200)
// eNodeB tasks and sub-tasks:
//// Layer 2 and Layer 1 sub-tasks
SUB_TASK_DEF(TASK_L2L1, TASK_PHY_ENB, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_MAC_ENB, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_RLC_ENB, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_ENB, 200)
/// Radio Resource Control task
TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200)
@@ -55,6 +48,8 @@ TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000)
// GTP_V1U task
TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000)
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200)
/// X2ap task, acts as both source and target
TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200)
/// Sctp task (Used by both S1AP and X2AP)
@@ -65,13 +60,8 @@ TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_GNB_APP, TASK_PRIORITY_MED, 200)
/// eNB Agent task
TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_PROTO_AGENT, TASK_PRIORITY_MED, 200)
// UE tasks and sub-tasks:
//// Layer 2 and Layer 1 sub-tasks
SUB_TASK_DEF(TASK_L2L1, TASK_PHY_UE, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_MAC_UE, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_RLC_UE, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_UE, 200)
/// Radio Resource Control task
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
+10
View File
@@ -32,11 +32,21 @@ MESSAGE_DEF(X2AP_SETUP_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgT
/* eNB application layer -> X2AP messages */
MESSAGE_DEF(X2AP_REGISTER_ENB_REQ , MESSAGE_PRIORITY_MED, x2ap_register_enb_req_t , x2ap_register_enb_req)
MESSAGE_DEF(X2AP_SUBFRAME_PROCESS , MESSAGE_PRIORITY_MED, x2ap_subframe_process_t , x2ap_subframe_process)
/* X2AP -> eNB application layer messages */
MESSAGE_DEF(X2AP_REGISTER_ENB_CNF , MESSAGE_PRIORITY_MED, x2ap_register_enb_cnf_t , x2ap_register_enb_cnf)
MESSAGE_DEF(X2AP_DEREGISTERED_ENB_IND , MESSAGE_PRIORITY_MED, x2ap_deregistered_enb_ind_t , x2ap_deregistered_enb_ind)
/* handover messages X2AP <-> RRC */
MESSAGE_DEF(X2AP_SETUP_REQ , MESSAGE_PRIORITY_MED, x2ap_setup_req_t , x2ap_setup_req)
MESSAGE_DEF(X2AP_SETUP_RESP , MESSAGE_PRIORITY_MED, x2ap_setup_resp_t , x2ap_setup_resp)
MESSAGE_DEF(X2AP_HANDOVER_REQ , MESSAGE_PRIORITY_MED, x2ap_handover_req_t , x2ap_handover_req)
MESSAGE_DEF(X2AP_HANDOVER_REQ_ACK , MESSAGE_PRIORITY_MED, x2ap_handover_req_ack_t , x2ap_handover_req_ack)
MESSAGE_DEF(X2AP_HANDOVER_CANCEL , MESSAGE_PRIORITY_MED, x2ap_handover_cancel_t , x2ap_handover_cancel)
/* handover messages X2AP <-> S1AP */
MESSAGE_DEF(X2AP_UE_CONTEXT_RELEASE , MESSAGE_PRIORITY_MED, x2ap_ue_context_release_t , x2ap_ue_context_release)
/*Senb bearer addition messages X2AP <-> RRC */
MESSAGE_DEF(X2AP_SENB_ADDITION_REQ , MESSAGE_PRIORITY_MED, x2ap_senb_addition_req_t , x2ap_senb_addition_req)
+146 -20
View File
@@ -22,21 +22,55 @@
#ifndef X2AP_MESSAGES_TYPES_H_
#define X2AP_MESSAGES_TYPES_H_
#include "PhysCellId.h"
#include "s1ap_messages_types.h"
#include "LTE_PhysCellId.h"
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define X2AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_req
#define X2AP_HANDOVER_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req
#define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack
#define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
#define X2AP_DEREGISTERED_ENB_IND(mSGpTR) (mSGpTR)->ittiMsg.x2ap_deregistered_enb_ind
#define X2AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_req
#define X2AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_req
#define X2AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_resp
#define X2AP_HANDOVER_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req
#define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack
#define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
#define X2AP_DEREGISTERED_ENB_IND(mSGpTR) (mSGpTR)->ittiMsg.x2ap_deregistered_enb_ind
#define X2AP_UE_CONTEXT_RELEASE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ue_context_release
#define X2AP_HANDOVER_CANCEL(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_cancel
#define X2AP_SENB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_senb_addition_req
#define X2AP_MAX_NB_ENB_IP_ADDRESS 2
// eNB application layer -> X2AP messages
typedef struct x2ap_setup_req_s {
uint32_t Nid_cell[MAX_NUM_CCs];
int num_cc;
} x2ap_setup_req_t;
typedef struct x2ap_setup_resp_s {
uint32_t Nid_cell[MAX_NUM_CCs];
int num_cc;
} x2ap_setup_resp_t;
/* X2AP UE CONTEXT RELEASE */
typedef struct x2ap_ue_context_release_s {
/* used for X2AP->RRC in source and RRC->X2AP in target */
int rnti;
int source_assoc_id;
} x2ap_ue_context_release_t;
typedef enum {
X2AP_T_RELOC_PREP_TIMEOUT,
X2AP_TX2_RELOC_OVERALL_TIMEOUT
} x2ap_handover_cancel_cause_t;
typedef struct x2ap_handover_cancel_s {
int rnti;
x2ap_handover_cancel_cause_t cause;
} x2ap_handover_cancel_t;
typedef struct x2ap_register_enb_req_s {
/* Unique eNB_id to identify the eNB within EPC.
* For macro eNB ids this field should be 20 bits long.
@@ -73,6 +107,8 @@ typedef struct x2ap_register_enb_req_s {
lte_frame_type_t frame_type[MAX_NUM_CCs];
uint32_t fdd_earfcn_DL[MAX_NUM_CCs];
uint32_t fdd_earfcn_UL[MAX_NUM_CCs];
uint32_t subframeAssignment[MAX_NUM_CCs];
uint32_t specialSubframe[MAX_NUM_CCs];
int num_cc;
/* To be considered for TDD */
@@ -94,8 +130,16 @@ typedef struct x2ap_register_enb_req_s {
/* eNB port for X2C*/
uint32_t enb_port_for_X2C;
/* timers (unit: millisecond) */
int t_reloc_prep;
int tx2_reloc_overall;
} x2ap_register_enb_req_t;
typedef struct x2ap_subframe_process_s {
/* nothing, we simply use the module ID in the header */
} x2ap_subframe_process_t;
//-------------------------------------------------------------------------------------------//
// X2AP -> eNB application layer messages
typedef struct x2ap_register_enb_cnf_s {
@@ -122,19 +166,19 @@ typedef struct x2ap_lastvisitedcell_info_s {
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_len;
PhysCellId_t target_physCellId;
LTE_PhysCellId_t target_physCellId;
cell_type_t cell_type;
uint64_t time_UE_StayedInCell;
}x2ap_lastvisitedcell_info_t;
//used for src
typedef struct x2ap_handover_req_s {
int source_rnti; /* TODO: to be fixed/remove */
int source_x2id; /* TODO: to be fixed/remove */
/* used for RRC->X2AP in source eNB */
int rnti;
unsigned old_eNB_ue_s1ap_id:24;
/* used for X2AP->RRC in target eNB */
int x2_id;
PhysCellId_t target_physCellId;
LTE_PhysCellId_t target_physCellId;
x2ap_gummei_t ue_gummei;
@@ -158,23 +202,105 @@ typedef struct x2ap_handover_req_s {
/* list of e_rab setup-ed by RRC layers */
e_rab_setup_t e_rabs_tobesetup[S1AP_MAX_E_RAB];
/* ue_context_pP->ue_context.e_rab[i].param.sgw_addr; */
/* list of e_rab to be setup by RRC layers */
e_rab_t e_rab_param[S1AP_MAX_E_RAB];
x2ap_lastvisitedcell_info_t lastvisitedcell_info;
/* TODO: this parameter has to be removed */
int target_mod_id;
uint8_t rrc_buffer[8192 /* arbitrary, big enough */];
int rrc_buffer_size;
int target_assoc_id;
} x2ap_handover_req_t;
typedef struct x2ap_handover_req_ack_s {
int source_rnti; /* TODO: to be fixed/remove */
int source_x2id; /* TODO: to be fixed/remove */
/* TODO: this parameter has to be removed */
int target_mod_id;
/* used for RRC->X2AP in target and X2AP->RRC in source */
int rnti;
/* used for RRC->X2AP in target */
int x2_id_target;
int source_assoc_id;
uint8_t nb_e_rabs_tobesetup;
/* list of e_rab setup-ed by RRC layers */
e_rab_setup_t e_rabs_tobesetup[S1AP_MAX_E_RAB];
/* list of e_rab to be setup by RRC layers */
e_rab_t e_rab_param[S1AP_MAX_E_RAB];
uint8_t rrc_buffer[1024 /* arbitrary, big enough */];
int rrc_buffer_size;
uint32_t mme_ue_s1ap_id;
} x2ap_handover_req_ack_t;
typedef struct x2ap_senb_addition_req_s {
/* MeNB UE X2AP ID*/
int x2_MeNB_UE_id;
/*SCG Bearer option*/
security_capabilities_t UE_security_capabilities;
/*SCG Bearer option*/
uint8_t SeNB_security_key[256];
/*SeNB UE aggregate maximum bitrate */
ambr_t SeNB_ue_ambr;
uint8_t total_nb_e_rabs_tobeadded;
uint8_t nb_sCG_e_rabs_tobeadded;
uint8_t nb_split_e_rabs_tobeadded;
/*list of total e_rabs (SCG or split) to be added*/
//e_rab_setup_t total_e_rabs_tobeadded[S1AP_MAX_E_RAB];
/* list of SCG e_rab to be added by RRC layers */
e_rab_setup_t e_sCG_rabs_tobeadded[S1AP_MAX_E_RAB];
/* list of split e_rab to be added by RRC layers */
e_rab_setup_t e_split_rabs_tobeadded[S1AP_MAX_E_RAB];
/* list of SCG e_rab to be added by RRC layers */
e_rab_t e_sCG_rab_param[S1AP_MAX_E_RAB];
/* list of split e_rab to be added by RRC layers */
e_rab_t e_split_rab_param[S1AP_MAX_E_RAB];
/*Used for the MeNB to SeNB Container to include the SCG-ConfigInfo as per 36.331*/
uint8_t rrc_buffer[1024 /* arbitrary, big enough */];
int rrc_buffer_size;
}x2ap_senb_addition_req_t;
//Panos: Have to see what should be the additional/different elements comparing to handover req ack
typedef struct x2ap_senb_addition_req_ack_s {
int MeNB_UE_X2_id;
int SeNB_UE_X2_id;
uint8_t nb_sCG_e_rabs_tobeadded;
uint8_t nb_split_e_rabs_tobeadded;
/* list of SCG e_rab to be added by RRC layers */
e_rab_setup_t e_sCG_rabs_tobeadded[S1AP_MAX_E_RAB];
/* list of split e_rab to be added by RRC layers */
e_rab_setup_t e_split_rabs_tobeadded[S1AP_MAX_E_RAB];
uint8_t rrc_buffer[1024 /* arbitrary, big enough */];
int rrc_buffer_size;
} x2ap_senb_addition_req_ack_t;
#endif /* X2AP_MESSAGES_TYPES_H_ */
Executable → Regular
View File
View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File
View File
View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File
View File
View File
View File
View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File
View File
View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File
View File
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File
View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File
View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File
View File
View File
View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File
View File

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File
View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 MiB

After

Width:  |  Height:  |  Size: 3.4 MiB

View File
View File

Before

Width:  |  Height:  |  Size: 625 KiB

After

Width:  |  Height:  |  Size: 625 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File
View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File
View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File
View File

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File
View File
View File

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File
View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File
View File
@@ -40,9 +40,6 @@
#include "common/utils/LOG/log.h"
/*Flags showing if a mac agent has already been registered*/
unsigned int mac_agent_registered[NUM_MAX_ENB];
/*Array containing the Agent-MAC interfaces*/
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
@@ -83,7 +80,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
for (i = 0; i < report_config->nr_ue; i++) {
UE_id = flexran_get_ue_id(mod_id, i);
UE_id = flexran_get_mac_ue_id(mod_id, i);
ue_report[i]->rnti = report_config->ue_report_type[i].ue_rnti;
ue_report[i]->has_rnti = 1;
@@ -102,12 +99,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
}
ue_report[i]->bsr = elem;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_BSR;
}
/* Check flag for creation of PHR report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PHR) {
ue_report[i]->phr = flexran_get_ue_phr (enb_id, UE_id); // eNB_UE_list->UE_template[UE_PCCID(enb_id,UE_id)][UE_id].phr_info;
ue_report[i]->has_phr = 1;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PHR;
}
@@ -123,8 +122,13 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
for (j = 0; j < ue_report[i]->n_rlc_report; j++) {
rlc_reports[j] = malloc(sizeof(Protocol__FlexRlcBsr));
if (rlc_reports[j] == NULL)
if (rlc_reports[j] == NULL){
for (k = 0; k < j; k++){
free(rlc_reports[k]);
}
free(rlc_reports);
goto error;
}
protocol__flex_rlc_bsr__init(rlc_reports[j]);
rlc_reports[j]->lc_id = j+1;
rlc_reports[j]->has_lc_id = 1;
@@ -148,7 +152,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
// Add RLC buffer status reports to the full report
if (ue_report[i]->n_rlc_report > 0)
ue_report[i]->rlc_report = rlc_reports;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RLC_BS;
}
@@ -161,7 +165,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
// found in stats_common.pb-c.h. See
// flex_ce_type in FlexRAN specification
ue_report[i]->has_pending_mac_ces = 1;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_CE_BS;
}
/* Check flag for creation of DL CQI report */
@@ -181,13 +185,21 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
//Create the actual CSI reports.
Protocol__FlexDlCsi **csi_reports;
csi_reports = malloc(sizeof(Protocol__FlexDlCsi *)*dl_report->n_csi_report);
if (csi_reports == NULL)
if (csi_reports == NULL) {
free(dl_report);
goto error;
}
for (j = 0; j < dl_report->n_csi_report; j++) {
csi_reports[j] = malloc(sizeof(Protocol__FlexDlCsi));
if (csi_reports[j] == NULL)
if (csi_reports[j] == NULL) {
for (k = 0; k < j; k++) {
free(csi_reports[k]);
}
free(csi_reports);
csi_reports = NULL;
goto error;
}
protocol__flex_dl_csi__init(csi_reports[j]);
//The servCellIndex for this report
csi_reports[j]->serv_cell_index = j;
@@ -207,8 +219,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
Protocol__FlexCsiP10 *csi10;
csi10 = malloc(sizeof(Protocol__FlexCsiP10));
if (csi10 == NULL)
goto error;
if (csi10 == NULL) {
for (k = 0; k <= j; k++) {
free(csi_reports[k]);
}
free(csi_reports);
csi_reports = NULL;
goto error;
}
protocol__flex_csi_p10__init(csi10);
//TODO: set the wideband value
// NN: this is also depends on cc_id
@@ -223,8 +241,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
Protocol__FlexCsiP11 *csi11;
csi11 = malloc(sizeof(Protocol__FlexCsiP11));
if (csi11 == NULL)
goto error;
if (csi11 == NULL) {
for (k = 0; k <= j; k++) {
free(csi_reports[k]);
}
free(csi_reports);
csi_reports = NULL;
goto error;
}
protocol__flex_csi_p11__init(csi11);
csi11->wb_cqi = malloc(sizeof(csi11->wb_cqi));
@@ -268,8 +292,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
Protocol__FlexCsiP20 *csi20;
csi20 = malloc(sizeof(Protocol__FlexCsiP20));
if (csi20 == NULL)
goto error;
if (csi20 == NULL) {
for (k = 0; k <= j; k++) {
free(csi_reports[k]);
}
free(csi_reports);
csi_reports = NULL;
goto error;
}
protocol__flex_csi_p20__init(csi20);
csi20->wb_cqi = flexran_get_ue_wcqi (enb_id, UE_id);
@@ -386,7 +416,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
dl_report->csi_report = csi_reports;
//Add the DL CQI report to the stats report
ue_report[i]->dl_cqi_report = dl_report;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_DL_CQI;
}
/* Check flag for creation of paging buffer status report */
@@ -403,14 +433,23 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
//Provide a report for each pending paging message
Protocol__FlexPagingInfo **p_info;
p_info = malloc(sizeof(Protocol__FlexPagingInfo *) * paging_report->n_paging_info);
if (p_info == NULL)
if (p_info == NULL){
free(paging_report);
goto error;
}
for (j = 0; j < paging_report->n_paging_info; j++) {
p_info[j] = malloc(sizeof(Protocol__FlexPagingInfo));
if(p_info[j] == NULL)
if (p_info[j] == NULL) {
for (k = 0; k < j; k++) {
free(p_info[k]);
}
free(p_info);
p_info = NULL;
free(paging_report);
goto error;
}
protocol__flex_paging_info__init(p_info[j]);
//TODO: Set paging index. This index is the same that will be used for the scheduling of the
//paging message by the controller
@@ -431,6 +470,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
paging_report->paging_info = p_info;
//Add the paging report to the UE report
ue_report[i]->pbr = paging_report;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PBS;
}
/* Check flag for creation of UL CQI report */
@@ -450,14 +490,22 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
full_ul_report->n_cqi_meas = 1;
Protocol__FlexUlCqi **ul_report;
ul_report = malloc(sizeof(Protocol__FlexUlCqi *) * full_ul_report->n_cqi_meas);
if(ul_report == NULL)
if(ul_report == NULL) {
free(full_ul_report);
goto error;
}
//Fill each UL report of the UE for each of the configured report types
for(j = 0; j < full_ul_report->n_cqi_meas; j++) {
ul_report[j] = malloc(sizeof(Protocol__FlexUlCqi));
if(ul_report[j] == NULL)
goto error;
if(ul_report[j] == NULL) {
for (k = 0; k < j; k++) {
free(ul_report[k]);
}
free(ul_report);
free(full_ul_report);
goto error;
}
protocol__flex_ul_cqi__init(ul_report[j]);
//TODO: Set the type of the UL report. As an example set it to SRS UL report
// See enum flex_ul_cqi_type in FlexRAN specification for more details
@@ -468,8 +516,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
ul_report[j]->n_sinr = 0;
uint32_t *sinr_meas;
sinr_meas = (uint32_t *) malloc(sizeof(uint32_t) * ul_report[j]->n_sinr);
if (sinr_meas == NULL)
if (sinr_meas == NULL) {
for (k = 0; k < j; k++) {
free(ul_report[k]);
}
free(ul_report);
free(full_ul_report);
goto error;
}
//TODO:Set the SINR measurements for the specified type
for (k = 0; k < ul_report[j]->n_sinr; k++) {
sinr_meas[k] = 10;
@@ -502,7 +556,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
}
// Add full UL CQI report to the UE report
ue_report[i]->ul_cqi_report = full_ul_report;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_UL_CQI;
}
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_STATS) {
@@ -573,8 +627,10 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
Protocol__FlexMacSdusDl ** mac_sdus;
mac_sdus = malloc(sizeof(Protocol__FlexMacSdusDl) * flexran_get_num_mac_sdu_tx(mod_id, UE_id, cc_id));
if (mac_sdus == NULL)
if (mac_sdus == NULL) {
free(macstats);
goto error;
}
macstats->n_mac_sdus_dl = flexran_get_num_mac_sdu_tx(mod_id, UE_id, cc_id);
@@ -598,7 +654,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
ue_report[i]->mac_stats = macstats;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_STATS;
}
@@ -640,6 +696,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
ni_report->p0_nominal_pucch = flexran_get_p0_nominal_pucch(enb_id, 0);
ni_report->has_p0_nominal_pucch = 1;
cell_report[i]->noise_inter_report = ni_report;
cell_report[i]->flags |= PROTOCOL__FLEX_CELL_STATS_TYPE__FLCST_NOISE_INTERFERENCE;
}
}
@@ -652,22 +709,131 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
error:
if (cell_report != NULL)
free(cell_report);
if (ue_report != NULL)
free(ue_report);
if (cell_report != NULL) {
if (report_config->nr_cc > 0) {
for (i = 0; i < report_config->nr_cc; i++) {
if (cell_report[i]->noise_inter_report != NULL) {
free(cell_report[i]->noise_inter_report);
cell_report[i]->noise_inter_report = NULL;
}
}
}
free(cell_report);
cell_report = NULL;
}
if (ue_report != NULL) {
if (report_config->nr_ue > 0) {
for (i = 0; i < report_config->nr_ue; i++) {
if (ue_report[i]->bsr != NULL) {
free(ue_report[i]->bsr);
ue_report[i]->bsr = NULL;
}
if (ue_report[i]->rlc_report != NULL) {
for (j = 0; j < ue_report[i]->n_rlc_report; j++) {
if (ue_report[i]->rlc_report[j] != NULL) {
free(ue_report[i]->rlc_report[j]);
ue_report[i]->rlc_report[j] = NULL;
}
}
free(ue_report[i]->rlc_report);
ue_report[i]->rlc_report = NULL;
}
if (ue_report[i]->dl_cqi_report != NULL) {
if (ue_report[i]->dl_cqi_report->csi_report != NULL) {
for (j = 0; j < ue_report[i]->dl_cqi_report->n_csi_report; j++) {
if (ue_report[i]->dl_cqi_report->csi_report[j] != NULL) {
if (ue_report[i]->dl_cqi_report->csi_report[j]->p10csi != NULL) {
free(ue_report[i]->dl_cqi_report->csi_report[j]->p10csi);
ue_report[i]->dl_cqi_report->csi_report[j]->p10csi = NULL;
}
if (ue_report[i]->dl_cqi_report->csi_report[j]->p11csi != NULL) {
if (ue_report[i]->dl_cqi_report->csi_report[j]->p11csi->wb_cqi != NULL) {
free(ue_report[i]->dl_cqi_report->csi_report[j]->p11csi->wb_cqi);
ue_report[i]->dl_cqi_report->csi_report[j]->p11csi->wb_cqi = NULL;
}
free(ue_report[i]->dl_cqi_report->csi_report[j]->p11csi);
ue_report[i]->dl_cqi_report->csi_report[j]->p11csi = NULL;
}
if (ue_report[i]->dl_cqi_report->csi_report[j]->p20csi != NULL) {
free(ue_report[i]->dl_cqi_report->csi_report[j]->p20csi);
ue_report[i]->dl_cqi_report->csi_report[j]->p20csi = NULL;
}
free(ue_report[i]->dl_cqi_report->csi_report[j]);
ue_report[i]->dl_cqi_report->csi_report[j] = NULL;
}
}
free(ue_report[i]->dl_cqi_report->csi_report);
ue_report[i]->dl_cqi_report->csi_report = NULL;
}
free(ue_report[i]->dl_cqi_report);
ue_report[i]->dl_cqi_report = NULL;
}
if (ue_report[i]->pbr != NULL) {
if (ue_report[i]->pbr->paging_info != NULL) {
for (j = 0; j < ue_report[i]->pbr->n_paging_info; j++) {
free(ue_report[i]->pbr->paging_info[j]);
ue_report[i]->pbr->paging_info[j] = NULL;
}
free(ue_report[i]->pbr->paging_info);
ue_report[i]->pbr->paging_info = NULL;
}
free(ue_report[i]->pbr);
ue_report[i]->pbr = NULL;
}
if (ue_report[i]->ul_cqi_report != NULL) {
if (ue_report[i]->ul_cqi_report->cqi_meas != NULL) {
for (j = 0; j < ue_report[i]->ul_cqi_report->n_cqi_meas; j++) {
if (ue_report[i]->ul_cqi_report->cqi_meas[j] != NULL) {
if (ue_report[i]->ul_cqi_report->cqi_meas[j]->sinr != NULL) {
free(ue_report[i]->ul_cqi_report->cqi_meas[j]->sinr);
ue_report[i]->ul_cqi_report->cqi_meas[j]->sinr = NULL;
}
free(ue_report[i]->ul_cqi_report->cqi_meas[j]);
ue_report[i]->ul_cqi_report->cqi_meas[j] = NULL;
}
}
free(ue_report[i]->ul_cqi_report->cqi_meas);
ue_report[i]->ul_cqi_report->cqi_meas = NULL;
}
if (ue_report[i]->ul_cqi_report->pucch_dbm != NULL) {
for (j = 0; j < MAX_NUM_CCs; j++) {
if (ue_report[i]->ul_cqi_report->pucch_dbm[j] != NULL) {
free(ue_report[i]->ul_cqi_report->pucch_dbm[j]);
ue_report[i]->ul_cqi_report->pucch_dbm[j] = NULL;
}
}
free(ue_report[i]->ul_cqi_report->pucch_dbm);
ue_report[i]->ul_cqi_report->pucch_dbm = NULL;
}
free(ue_report[i]->ul_cqi_report);
ue_report[i]->ul_cqi_report = NULL;
}
if (ue_report[i]->mac_stats != NULL) {
if (ue_report[i]->mac_stats->mac_sdus_dl != NULL) {
for (j = 0; j < ue_report[i]->mac_stats->n_mac_sdus_dl; j++) {
if (ue_report[i]->mac_stats->mac_sdus_dl[j] != NULL) {
free(ue_report[i]->mac_stats->mac_sdus_dl[j]);
ue_report[i]->mac_stats->mac_sdus_dl[j] = NULL;
}
}
free(ue_report[i]->mac_stats->mac_sdus_dl);
ue_report[i]->mac_stats->mac_sdus_dl = NULL;
}
free(ue_report[i]->mac_stats);
ue_report[i]->mac_stats = NULL;
}
}
}
free(ue_report);
}
return -1;
}
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg) {
//TODO: Need to deallocate memory for the stats reply message
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG)
goto error;
free(msg->stats_reply_msg->header);
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexStatsReply *reply) {
int i, j, k;
Protocol__FlexStatsReply *reply = msg->stats_reply_msg;
Protocol__FlexDlCqiReport *dl_report;
Protocol__FlexUlCqiReport *ul_report;
Protocol__FlexPagingBufferReport *paging_report;
@@ -758,25 +924,24 @@ int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg) {
free(ul_report->pucch_dbm[j]);
}
free(ul_report->pucch_dbm);
free(ul_report);
}
if (reply->ue_report[i]->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_STATS) {
for (j = 0; j < reply->ue_report[i]->mac_stats->n_mac_sdus_dl; j++)
free(reply->ue_report[i]->mac_stats->mac_sdus_dl[j]);
free(reply->ue_report[i]->mac_stats->mac_sdus_dl);
free(reply->ue_report[i]->mac_stats);
}
free(reply->ue_report[i]);
}
free(reply->ue_report);
// Free memory for all Cell reports
for (i = 0; i < reply->n_cell_report; i++) {
free(reply->cell_report[i]->noise_inter_report);
free(reply->cell_report[i]);
if (reply->cell_report[i]->flags & PROTOCOL__FLEX_CELL_STATS_TYPE__FLCST_NOISE_INTERFERENCE) {
free(reply->cell_report[i]->noise_inter_report);
}
}
free(reply->cell_report);
free(reply);
free(msg);
return 0;
error:
//LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return -1;
}
int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
@@ -905,7 +1070,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
// LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10);
sf_trigger_msg->n_dl_info = flexran_get_num_ues(mod_id);
sf_trigger_msg->n_dl_info = flexran_get_mac_num_ues(mod_id);
Protocol__FlexDlInfo **dl_info = NULL;
@@ -921,9 +1086,9 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
dl_info[i] = malloc(sizeof(Protocol__FlexDlInfo));
if(dl_info[i] == NULL)
goto error;
UE_id = flexran_get_ue_id(mod_id, i);
UE_id = flexran_get_mac_ue_id(mod_id, i);
protocol__flex_dl_info__init(dl_info[i]);
dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, UE_id);
dl_info[i]->rnti = flexran_get_mac_ue_crnti(mod_id, UE_id);
dl_info[i]->has_rnti = 1;
/*Fill in the right id of this round's HARQ process for this UE*/
// uint8_t harq_id;
@@ -957,7 +1122,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
/* Fill in the number of UL reception status related info, based on the number of currently
* transmitting UEs
*/
sf_trigger_msg->n_ul_info = flexran_get_num_ues(mod_id);
sf_trigger_msg->n_ul_info = flexran_get_mac_num_ues(mod_id);
Protocol__FlexUlInfo **ul_info = NULL;
@@ -972,9 +1137,9 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
goto error;
protocol__flex_ul_info__init(ul_info[i]);
UE_id = flexran_get_ue_id(mod_id, i);
UE_id = flexran_get_mac_ue_id(mod_id, i);
ul_info[i]->rnti = flexran_get_ue_crnti(mod_id, UE_id);
ul_info[i]->rnti = flexran_get_mac_ue_crnti(mod_id, UE_id);
ul_info[i]->has_rnti = 1;
/* Fill in the Tx power control command for this UE (if available),
* primary carrier */
@@ -1019,11 +1184,28 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
if (header != NULL)
free(header);
if (sf_trigger_msg != NULL) {
for (i = 0; i < sf_trigger_msg->n_dl_info; i++) {
free(sf_trigger_msg->dl_info[i]->harq_status);
if (sf_trigger_msg->dl_info != NULL) {
for (i = 0; i < sf_trigger_msg->n_dl_info; i++) {
if (sf_trigger_msg->dl_info[i] != NULL) {
if (sf_trigger_msg->dl_info[i]->harq_status != NULL) {
free(sf_trigger_msg->dl_info[i]->harq_status);
}
free(sf_trigger_msg->dl_info[i]);
}
}
free(sf_trigger_msg->dl_info);
}
if (sf_trigger_msg->ul_info != NULL) {
for (i = 0; i < sf_trigger_msg->n_ul_info; i++) {
if (sf_trigger_msg->ul_info[i] != NULL) {
if (sf_trigger_msg->ul_info[i]->ul_reception != NULL) {
free(sf_trigger_msg->ul_info[i]->ul_reception);
}
free(sf_trigger_msg->ul_info[i]);
}
}
free(sf_trigger_msg->ul_info);
}
free(sf_trigger_msg->dl_info);
free(sf_trigger_msg->ul_info);
free(sf_trigger_msg);
}
if(*msg != NULL)
@@ -1068,6 +1250,7 @@ int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMess
Protocol__FlexDlMacConfig *dl_mac_config_msg;
dl_mac_config_msg = malloc(sizeof(Protocol__FlexDlMacConfig));
if (dl_mac_config_msg == NULL) {
free(header);
goto error;
}
protocol__flex_dl_mac_config__init(dl_mac_config_msg);
@@ -1077,8 +1260,11 @@ int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMess
dl_mac_config_msg->sfn_sf = flexran_get_sfn_sf(mod_id);
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
if(*msg == NULL) {
free(dl_mac_config_msg);
free(header);
goto error;
}
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
@@ -1172,8 +1358,10 @@ int flexran_agent_mac_create_empty_ul_config(mid_t mod_id, Protocol__FlexranMess
ul_mac_config_msg->sfn_sf = flexran_get_sfn_sf(mod_id);
*msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL)
if(*msg == NULL) {
free(ul_mac_config_msg);
goto error;
}
protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_MAC_CONFIG_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
@@ -1182,6 +1370,10 @@ int flexran_agent_mac_create_empty_ul_config(mid_t mod_id, Protocol__FlexranMess
return 0;
error:
if(header){
free(header);
header = NULL;
}
return -1;
}
@@ -1297,7 +1489,7 @@ void flexran_agent_init_mac_agent(mid_t mod_id) {
void flexran_agent_send_sr_info(mid_t mod_id) {
int size;
Protocol__FlexranMessage *msg;
Protocol__FlexranMessage *msg = NULL;
void *data;
int priority = 0;
err_code_t err_code;
@@ -1327,7 +1519,7 @@ void flexran_agent_send_sr_info(mid_t mod_id) {
void flexran_agent_send_sf_trigger(mid_t mod_id) {
int size;
Protocol__FlexranMessage *msg;
Protocol__FlexranMessage *msg = NULL;
void *data;
int priority = 0;
err_code_t err_code;
@@ -1357,11 +1549,17 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) {
int flexran_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
if (mac_agent_registered[mod_id]) {
int flexran_agent_register_mac_xface(mid_t mod_id)
{
if (agent_mac_xface[mod_id]) {
LOG_E(MAC, "MAC agent for eNB %d is already registered\n", mod_id);
return -1;
}
AGENT_MAC_xface *xface = malloc(sizeof(AGENT_MAC_xface));
if (!xface) {
LOG_E(FLEXRAN_AGENT, "could not allocate memory for MAC agent xface %d\n", mod_id);
return -1;
}
//xface->agent_ctxt = &shared_ctxt[mod_id];
xface->flexran_agent_send_sr_info = flexran_agent_send_sr_info;
@@ -1371,14 +1569,125 @@ int flexran_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
xface->dl_scheduler_loaded_lib = NULL;
xface->ul_scheduler_loaded_lib = NULL;
mac_agent_registered[mod_id] = 1;
agent_mac_xface[mod_id] = xface;
return 0;
}
int flexran_agent_unregister_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
void flexran_agent_fill_mac_cell_config(mid_t mod_id, uint8_t cc_id,
Protocol__FlexCellConfig *conf) {
if (!conf->si_config) {
conf->si_config = malloc(sizeof(Protocol__FlexSiConfig));
if (conf->si_config)
protocol__flex_si_config__init(conf->si_config);
}
if (conf->si_config) {
conf->si_config->sfn = flexran_get_current_system_frame_num(mod_id);
conf->si_config->has_sfn = 1;
}
/* get a pointer to the config which is maintained in the agent throughout
* its lifetime */
conf->slice_config = flexran_agent_get_slice_config(mod_id);
}
void flexran_agent_fill_mac_ue_config(mid_t mod_id, mid_t ue_id,
Protocol__FlexUeConfig *ue_conf)
{
if (ue_conf->has_rnti && ue_conf->rnti != flexran_get_mac_ue_crnti(mod_id, ue_id)) {
LOG_E(FLEXRAN_AGENT, "ue_config existing RNTI %x does not match MAC RNTI %x\n",
ue_conf->rnti, flexran_get_mac_ue_crnti(mod_id, ue_id));
return;
}
ue_conf->rnti = flexran_get_mac_ue_crnti(mod_id, ue_id);
ue_conf->has_rnti = 1;
ue_conf->dl_slice_id = flexran_get_ue_dl_slice_id(mod_id, ue_id);
ue_conf->has_dl_slice_id = 1;
ue_conf->ul_slice_id = flexran_get_ue_ul_slice_id(mod_id, ue_id);
ue_conf->has_ul_slice_id = 1;
ue_conf->ue_aggregated_max_bitrate_ul = flexran_get_ue_aggregated_max_bitrate_ul(mod_id, ue_id);
ue_conf->has_ue_aggregated_max_bitrate_ul = 1;
ue_conf->ue_aggregated_max_bitrate_dl = flexran_get_ue_aggregated_max_bitrate_dl(mod_id, ue_id);
ue_conf->has_ue_aggregated_max_bitrate_dl = 1;
/* TODO update through RAN API */
//config->has_pcell_carrier_index = 1;
//config->pcell_carrier_index = UE_PCCID(mod_id, i);
//TODO: Set carrier aggregation support (boolean)
}
void flexran_agent_fill_mac_lc_ue_config(mid_t mod_id, mid_t ue_id,
Protocol__FlexLcUeConfig *lc_ue_conf)
{
lc_ue_conf->rnti = flexran_get_mac_ue_crnti(mod_id, ue_id);
lc_ue_conf->has_rnti = 1;
lc_ue_conf->n_lc_config = flexran_get_num_ue_lcs(mod_id, ue_id);
if (lc_ue_conf->n_lc_config == 0)
return;
Protocol__FlexLcConfig **lc_config =
calloc(lc_ue_conf->n_lc_config, sizeof(Protocol__FlexLcConfig *));
if (!lc_config) {
LOG_E(FLEXRAN_AGENT, "could not allocate memory for lc_config of UE %x\n", lc_ue_conf->rnti);
lc_ue_conf->n_lc_config = 0;
return; // can not allocate memory, skip rest
}
for (int j = 0; j < lc_ue_conf->n_lc_config; j++) {
lc_config[j] = malloc(sizeof(Protocol__FlexLcConfig));
if (!lc_config[j]) continue; // go over this error, try entry
protocol__flex_lc_config__init(lc_config[j]);
lc_config[j]->has_lcid = 1;
lc_config[j]->lcid = j+1;
const int lcg = flexran_get_lcg(mod_id, ue_id, j+1);
if (lcg >= 0 && lcg <= 3) {
lc_config[j]->has_lcg = 1;
lc_config[j]->lcg = flexran_get_lcg(mod_id, ue_id, j+1);
}
lc_config[j]->has_direction = 1;
lc_config[j]->direction = flexran_get_direction(ue_id, j+1);
//TODO: Bearer type. One of FLQBT_* values. Currently only default bearer supported
lc_config[j]->has_qos_bearer_type = 1;
lc_config[j]->qos_bearer_type = PROTOCOL__FLEX_QOS_BEARER_TYPE__FLQBT_NON_GBR;
//TODO: Set the QCI defined in TS 23.203, coded as defined in TS 36.413
// One less than the actual QCI value. Needs to be generalized
lc_config[j]->has_qci = 1;
lc_config[j]->qci = 1;
if (lc_config[j]->direction == PROTOCOL__FLEX_QOS_BEARER_TYPE__FLQBT_GBR) {
/* TODO all of the need to be taken from API */
//TODO: Set the max bitrate (UL)
lc_config[j]->has_e_rab_max_bitrate_ul = 0;
lc_config[j]->e_rab_max_bitrate_ul = 0;
//TODO: Set the max bitrate (DL)
lc_config[j]->has_e_rab_max_bitrate_dl = 0;
lc_config[j]->e_rab_max_bitrate_dl = 0;
//TODO: Set the guaranteed bitrate (UL)
lc_config[j]->has_e_rab_guaranteed_bitrate_ul = 0;
lc_config[j]->e_rab_guaranteed_bitrate_ul = 0;
//TODO: Set the guaranteed bitrate (DL)
lc_config[j]->has_e_rab_guaranteed_bitrate_dl = 0;
lc_config[j]->e_rab_guaranteed_bitrate_dl = 0;
}
}
lc_ue_conf->lc_config = lc_config;
}
int flexran_agent_unregister_mac_xface(mid_t mod_id)
{
if (!agent_mac_xface[mod_id]) {
LOG_E(FLEXRAN_AGENT, "MAC agent CM for eNB %d is not registered\n", mod_id);
return -1;
}
AGENT_MAC_xface *xface = agent_mac_xface[mod_id];
//xface->agent_ctxt = NULL;
xface->flexran_agent_send_sr_info = NULL;
xface->flexran_agent_send_sf_trigger = NULL;
@@ -1387,12 +1696,17 @@ int flexran_agent_unregister_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
xface->dl_scheduler_loaded_lib = NULL;
xface->ul_scheduler_loaded_lib = NULL;
mac_agent_registered[mod_id] = 0;
free(xface);
agent_mac_xface[mod_id] = NULL;
return 0;
}
AGENT_MAC_xface *flexran_agent_get_mac_xface(mid_t mod_id)
{
return agent_mac_xface[mod_id];
}
void flexran_create_config_structures(mid_t mod_id)
{
int i;
@@ -36,6 +36,8 @@
#include "flexran_agent_common.h"
#include "flexran_agent_extern.h"
// for flexran_agent_get_mac_xface()
#include "flexran_agent_extern.h"
/* Initialization function for the agent structures etc */
@@ -51,7 +53,7 @@ int flexran_agent_mac_destroy_sf_trigger(Protocol__FlexranMessage *msg);
/* Statistics reply protocol message constructor and destructor */
int flexran_agent_mac_stats_reply(mid_t mod_id, const report_config_t *report_config, Protocol__FlexUeStatsReport **ue_report, Protocol__FlexCellStatsReport **cell_report);
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg);
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexStatsReply *reply);
/* DL MAC scheduling decision protocol message constructor (empty command) and destructor */
int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg);
@@ -81,11 +83,23 @@ void flexran_agent_send_update_mac_stats(mid_t mod_id);
/// Provide to the scheduler a pending dl_mac_config message
void flexran_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__FlexranMessage **msg);
/* Fill the MAC part of an cell_config message */
void flexran_agent_fill_mac_cell_config(mid_t mod_id, uint8_t cc_id,
Protocol__FlexCellConfig *conf);
/* Fill the MAC part of a ue_config message */
void flexran_agent_fill_mac_ue_config(mid_t mod_id, mid_t ue_id,
Protocol__FlexUeConfig *ue_conf);
/* Fill the lc_ue_config->lc_config message */
void flexran_agent_fill_mac_lc_ue_config(mid_t mod_id, mid_t ue_id,
Protocol__FlexLcUeConfig *lc_ue_conf);
/*Register technology specific interface callbacks*/
int flexran_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface);
int flexran_agent_register_mac_xface(mid_t mod_id);
/*Unregister technology specific callbacks*/
int flexran_agent_unregister_mac_xface(mid_t mod_id, AGENT_MAC_xface*xface);
int flexran_agent_unregister_mac_xface(mid_t mod_id);
/***************************************
* FlexRAN agent - slice configuration *
@@ -151,6 +151,15 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
return msg;
error:
if (stats_reply_msg) {
if (stats_reply_msg->ue_report) {
free(stats_reply_msg->ue_report);
}
if (stats_reply_msg->cell_report) {
free(stats_reply_msg->cell_report);
}
free(stats_reply_msg);
}
return NULL;
}
@@ -233,6 +242,12 @@ Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport *
return copy;
error:
if (copy){
if (copy->bsr){
free(copy->bsr);
}
free(copy);
}
return NULL;
}
@@ -303,6 +318,20 @@ Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * origi
return full_ul_report;
error:
if (full_ul_report){
if (ul_report){
for (i = 0; i < full_ul_report->n_cqi_meas; i++){
if (ul_report[i]){
if ( ul_report[i]->sinr ){
free(ul_report[i]->sinr);
}
free(ul_report[i]);
}
}
free(ul_report);
}
free(full_ul_report);
}
return NULL;
}
@@ -332,6 +361,14 @@ Protocol__FlexDlCqiReport * copy_dl_cqi_report(Protocol__FlexDlCqiReport * origi
error:
/*TODO: Must free memory properly*/
if (dl_report != NULL) {
if (csi_reports != NULL) {
free(csi_reports);
csi_reports = NULL;
}
free(dl_report);
dl_report = NULL;
}
return NULL;
}
@@ -369,6 +406,18 @@ Protocol__FlexPagingBufferReport * copy_paging_buffer_report(Protocol__FlexPagin
error:
/*TODO: free memory properly*/
if (copy){
if (p_info){
for (i = 0; i < copy->n_paging_info; i++){
if (p_info[i]){
free(p_info[i]);
}
}
free(p_info);
}
free(copy);
copy = NULL;
}
return NULL;
}
@@ -514,6 +563,74 @@ Protocol__FlexDlCsi * copy_csi_report(Protocol__FlexDlCsi * original) {
return copy;
error:
if (copy != NULL) {
if ((copy->p11csi != NULL) && (copy->p11csi->wb_cqi != NULL)) {
free(copy->p11csi->wb_cqi);
copy->p11csi->wb_cqi = NULL;
}
if (copy->p21csi != NULL) {
if (copy->p21csi->wb_cqi != NULL) {
free(copy->p21csi->wb_cqi);
copy->p21csi->wb_cqi = NULL;
}
if (copy->p21csi->sb_cqi != NULL) {
free(copy->p21csi->sb_cqi);
copy->p21csi->sb_cqi = NULL;
}
}
if (copy->a12csi != NULL) {
if (copy->a12csi->wb_cqi != NULL) {
free(copy->a12csi->wb_cqi);
copy->a12csi->wb_cqi = NULL;
}
if (copy->a12csi->sb_pmi != NULL) {
free(copy->a12csi->sb_pmi);
copy->a12csi->sb_pmi = NULL;
}
}
if (copy->a22csi != NULL) {
if (copy->a22csi->wb_cqi != NULL) {
free(copy->a22csi->wb_cqi);
copy->a22csi->wb_cqi = NULL;
}
if (copy->a22csi->sb_cqi != NULL) {
free(copy->a22csi->sb_cqi);
copy->a22csi->sb_cqi = NULL;
}
if (copy->a22csi->sb_list != NULL) {
free(copy->a22csi->sb_list);
copy->a22csi->sb_list = NULL;
}
}
if ((copy->a20csi != NULL) && (copy->a20csi->sb_list != NULL)) {
free(copy->a20csi->sb_list);
copy->a20csi->sb_list = NULL;
}
if ((copy->a30csi != NULL) && (copy->a30csi->sb_cqi != NULL)) {
free(copy->a30csi->sb_cqi);
copy->a30csi->sb_cqi = NULL;
}
if (copy->a31csi != NULL) {
if (copy->a31csi->wb_cqi != NULL) {
free(copy->a31csi->wb_cqi);
copy->a31csi->wb_cqi = NULL;
}
if (copy->a31csi->sb_cqi != NULL) {
for (i = 0; i < copy->a31csi->n_sb_cqi; i++) {
if (copy->a31csi->sb_cqi[i] != NULL) {
if (copy->a31csi->sb_cqi[i]->sb_cqi != NULL) {
free(copy->a31csi->sb_cqi[i]->sb_cqi);
}
free(copy->a31csi->sb_cqi[i]);
}
}
free(copy->a31csi->sb_cqi);
copy->a31csi->sb_cqi = NULL;
}
}
free(copy);
copy = NULL;
}
return NULL;
}
@@ -790,9 +907,9 @@ int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) {
goto error;
}
// Check what key needs to be set
if (mac_agent_registered[mod_id]) {
if (flexran_agent_get_mac_xface(mod_id)) {
LOG_D(ENB_APP, "Setting parameter %s\n", event.data.scalar.value);
param = dlsym(agent_mac_xface[mod_id]->dl_scheduler_loaded_lib,
param = dlsym(flexran_agent_get_mac_xface(mod_id)->dl_scheduler_loaded_lib,
(char *) event.data.scalar.value);
if (param == NULL) {
goto error;
@@ -845,9 +962,9 @@ int parse_ul_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) {
goto error;
}
// Check what key needs to be set
if (mac_agent_registered[mod_id]) {
if (flexran_agent_get_mac_xface(mod_id)) {
LOG_D(ENB_APP, "Setting parameter %s\n", event.data.scalar.value);
param = dlsym(agent_mac_xface[mod_id]->ul_scheduler_loaded_lib,
param = dlsym(flexran_agent_get_mac_xface(mod_id)->ul_scheduler_loaded_lib,
(char *) event.data.scalar.value);
if (param == NULL) {
goto error;
@@ -891,17 +1008,24 @@ int load_dl_scheduler_function(mid_t mod_id, const char *function_name) {
LOG_I(FLEXRAN_AGENT, "Loading function: %s\n", function_name);
void *loaded_scheduler = dlsym(lib, function_name);
if (loaded_scheduler) {
if (mac_agent_registered[mod_id]) {
if (agent_mac_xface[mod_id]->dl_scheduler_loaded_lib != NULL) {
dlclose(agent_mac_xface[mod_id]->dl_scheduler_loaded_lib);
if (flexran_agent_get_mac_xface(mod_id)) {
if (flexran_agent_get_mac_xface(mod_id)->dl_scheduler_loaded_lib != NULL) {
dlclose(flexran_agent_get_mac_xface(mod_id)->dl_scheduler_loaded_lib);
}
agent_mac_xface[mod_id]->dl_scheduler_loaded_lib = lib;
flexran_agent_get_mac_xface(mod_id)->dl_scheduler_loaded_lib = lib;
LOG_I(FLEXRAN_AGENT, "New DL UE scheduler: %s\n", function_name);
}
} else {
LOG_I(FLEXRAN_AGENT, "Scheduler could not be loaded\n");
}
if (flexran_agent_get_mac_xface(mod_id)) {
if (flexran_agent_get_mac_xface(mod_id)->dl_scheduler_loaded_lib != lib) {
dlclose(lib);
}
} else {
dlclose(lib);
}
return 0;
error:
@@ -1602,6 +1726,10 @@ int apply_ue_slice_assoc_update(mid_t mod_id)
int changes = 0;
for (i = 0; i < n_ue_slice_assoc_updates; i++) {
int ue_id = find_UE_id(mod_id, ue_slice_assoc_update[i]->rnti);
if (ue_id < 0 || ue_id > MAX_MOBILES_PER_ENB){
LOG_E(FLEXRAN_AGENT,"UE_id %d is wrong!!\n",ue_id);
continue;
}
if (ue_slice_assoc_update[i]->has_dl_slice_id) {
int slice_idx = flexran_find_dl_slice(mod_id, ue_slice_assoc_update[i]->dl_slice_id);
if (flexran_dl_slice_exists(mod_id, slice_idx)) {
@@ -28,42 +28,36 @@
#include "flexran_agent_pdcp.h"
/*Trigger boolean for PDCP measurement*/
bool triggered_pdcp = false;
/*Flags showing if a pdcp agent has already been registered*/
unsigned int pdcp_agent_registered[NUM_MAX_ENB];
/*Array containing the Agent-PDCP interfaces*/
AGENT_PDCP_xface *agent_pdcp_xface[NUM_MAX_ENB];
// MAX_MOBILES_PER_ENB
void flexran_agent_pdcp_aggregate_stats(const mid_t mod_id,
const mid_t ue_id,
uint16_t uid,
Protocol__FlexPdcpStats *pdcp_aggr_stats){
int lcid=0;
/* only calculate the DRBs */
//LOG_I(FLEXRAN_AGENT, "enb %d ue %d \n", mod_id, ue_id);
//LOG_I(FLEXRAN_AGENT, "enb %d ue %d \n", mod_id, uid);
for (lcid=NUM_MAX_SRB ; lcid < NUM_MAX_SRB + NUM_MAX_DRB; lcid++){
pdcp_aggr_stats->pkt_tx += flexran_get_pdcp_tx(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_tx_bytes += flexran_get_pdcp_tx_bytes(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_tx_w += flexran_get_pdcp_tx_w(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_tx_bytes_w += flexran_get_pdcp_tx_bytes_w(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_tx_aiat += flexran_get_pdcp_tx_aiat(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_tx_aiat_w += flexran_get_pdcp_tx_aiat_w(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_tx += flexran_get_pdcp_tx(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_tx_bytes += flexran_get_pdcp_tx_bytes(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_tx_w += flexran_get_pdcp_tx_w(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_tx_bytes_w += flexran_get_pdcp_tx_bytes_w(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_tx_aiat += flexran_get_pdcp_tx_aiat(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_tx_aiat_w += flexran_get_pdcp_tx_aiat_w(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_rx += flexran_get_pdcp_rx(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_rx_bytes += flexran_get_pdcp_rx_bytes(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_rx_w += flexran_get_pdcp_rx_w(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_rx_bytes_w += flexran_get_pdcp_rx_bytes_w(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_rx_aiat += flexran_get_pdcp_rx_aiat(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_rx_aiat_w += flexran_get_pdcp_rx_aiat_w(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_rx_oo += flexran_get_pdcp_rx_oo(mod_id,ue_id,lcid);
pdcp_aggr_stats->pkt_rx += flexran_get_pdcp_rx(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_rx_bytes += flexran_get_pdcp_rx_bytes(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_rx_w += flexran_get_pdcp_rx_w(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_rx_bytes_w += flexran_get_pdcp_rx_bytes_w(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_rx_aiat += flexran_get_pdcp_rx_aiat(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_rx_aiat_w += flexran_get_pdcp_rx_aiat_w(mod_id, uid, lcid);
pdcp_aggr_stats->pkt_rx_oo += flexran_get_pdcp_rx_oo(mod_id, uid, lcid);
}
@@ -78,7 +72,6 @@ int flexran_agent_pdcp_stats_reply(mid_t mod_id,
// Protocol__FlexHeader *header;
int i;
int UE_id;
// int cc_id = 0;
@@ -86,7 +79,8 @@ int flexran_agent_pdcp_stats_reply(mid_t mod_id,
if (report_config->nr_ue > 0) {
for (i = 0; i < report_config->nr_ue; i++) {
UE_id = flexran_get_ue_id(mod_id, i);
const rnti_t rnti = report_config->ue_report_type[i].ue_rnti;
const uint16_t uid = flexran_get_pdcp_uid_from_rnti(mod_id, rnti);
/* Check flag for creation of buffer status report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PDCP_STATS) {
@@ -97,7 +91,7 @@ int flexran_agent_pdcp_stats_reply(mid_t mod_id,
goto error;
protocol__flex_pdcp_stats__init(pdcp_aggr_stats);
flexran_agent_pdcp_aggregate_stats(mod_id, UE_id, pdcp_aggr_stats);
flexran_agent_pdcp_aggregate_stats(mod_id, uid, pdcp_aggr_stats);
pdcp_aggr_stats->has_pkt_tx=1;
pdcp_aggr_stats->has_pkt_tx_bytes =1;
@@ -106,7 +100,7 @@ int flexran_agent_pdcp_stats_reply(mid_t mod_id,
pdcp_aggr_stats->has_pkt_tx_aiat =1;
pdcp_aggr_stats->has_pkt_tx_aiat_w =1;
pdcp_aggr_stats->pkt_tx_sn = flexran_get_pdcp_tx_sn(mod_id, UE_id, DEFAULT_DRB);
pdcp_aggr_stats->pkt_tx_sn = flexran_get_pdcp_tx_sn(mod_id, uid, DEFAULT_DRB);
pdcp_aggr_stats->has_pkt_tx_sn =1;
pdcp_aggr_stats->has_pkt_rx =1;
@@ -117,14 +111,14 @@ int flexran_agent_pdcp_stats_reply(mid_t mod_id,
pdcp_aggr_stats->has_pkt_rx_aiat_w =1;
pdcp_aggr_stats->has_pkt_rx_oo =1;
pdcp_aggr_stats->pkt_rx_sn = flexran_get_pdcp_rx_sn(mod_id, UE_id, DEFAULT_DRB);
pdcp_aggr_stats->pkt_rx_sn = flexran_get_pdcp_rx_sn(mod_id, uid, DEFAULT_DRB);
pdcp_aggr_stats->has_pkt_rx_sn =1;
pdcp_aggr_stats->sfn = flexran_get_pdcp_sfn(mod_id);
pdcp_aggr_stats->has_sfn =1;
ue_report[i]->pdcp_stats = pdcp_aggr_stats;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PDCP_STATS;
}
}
} else {
@@ -144,30 +138,51 @@ int flexran_agent_pdcp_stats_reply(mid_t mod_id,
return -1;
}
int flexran_agent_pdcp_destroy_stats_reply(Protocol__FlexStatsReply *reply)
{
for (int i = 0; i < reply->n_ue_report; ++i) {
if (reply->ue_report[i]->pdcp_stats)
free(reply->ue_report[i]->pdcp_stats);
}
return 0;
}
int flexran_agent_register_pdcp_xface(mid_t mod_id, AGENT_PDCP_xface *xface) {
if (pdcp_agent_registered[mod_id]) {
LOG_E(PDCP, "PDCP agent for eNB %d is already registered\n", mod_id);
int flexran_agent_register_pdcp_xface(mid_t mod_id)
{
if (agent_pdcp_xface[mod_id]) {
LOG_E(FLEXRAN_AGENT, "PDCP agent CM for eNB %d is already registered\n", mod_id);
return -1;
}
AGENT_PDCP_xface *xface = malloc(sizeof(AGENT_PDCP_xface));
if (!xface) {
LOG_E(FLEXRAN_AGENT, "could not allocate memory for PDCP agent xface %d\n", mod_id);
return -1;
}
//xface->flexran_pdcp_stats_measurement = NULL;
pdcp_agent_registered[mod_id] = 1;
agent_pdcp_xface[mod_id] = xface;
return 0;
}
int flexran_agent_unregister_pdcp_xface(mid_t mod_id, AGENT_PDCP_xface *xface) {
int flexran_agent_unregister_pdcp_xface(mid_t mod_id)
{
if (!agent_pdcp_xface[mod_id]) {
LOG_E(FLEXRAN_AGENT, "PDCP agent CM for eNB %d is not registered\n", mod_id);
return -1;
}
//xface->agent_ctxt = NULL;
//xface->flexran_pdcp_stats_measurement = NULL;
pdcp_agent_registered[mod_id] = 0;
free(agent_pdcp_xface[mod_id]);
agent_pdcp_xface[mod_id] = NULL;
return 0;
}
AGENT_PDCP_xface *flexran_agent_get_pdcp_xface(mid_t mod_id)
{
return agent_pdcp_xface[mod_id];
}
@@ -39,6 +39,8 @@
#include "flexran_agent_defs.h"
#include "flexran_agent_pdcp_defs.h"
#include "flexran_agent_ran_api.h"
// for flexran_agent_get_pdcp_xface()
#include "flexran_agent_extern.h"
/**********************************
* FlexRAN agent - technology PDCP API
@@ -49,16 +51,17 @@ int flexran_agent_pdcp_stats_reply(mid_t mod_id,
const report_config_t *report_config,
Protocol__FlexUeStatsReport **ue_report,
Protocol__FlexCellStatsReport **cell_report);
int flexran_agent_pdcp_destroy_stats_reply(Protocol__FlexStatsReply *reply);
/* Get the stats from RAN API and aggregate them per USER*/
void flexran_agent_pdcp_aggregate_stats(const mid_t mod_id,
const mid_t ue_id,
uint16_t uid,
Protocol__FlexPdcpStats *pdcp_aggr_stats);
/*Register technology specific interface callbacks*/
int flexran_agent_register_pdcp_xface(mid_t mod_id, AGENT_PDCP_xface *xface);
int flexran_agent_register_pdcp_xface(mid_t mod_id);
/*Unregister technology specific callbacks*/
int flexran_agent_unregister_pdcp_xface(mid_t mod_id, AGENT_PDCP_xface*xface);
int flexran_agent_unregister_pdcp_xface(mid_t mod_id);
#endif
@@ -0,0 +1,179 @@
/*
* 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 flexran_agent_phy.c
* \brief FlexRAN agent Control Module PHY
* \author Robert Schmidt
* \date Oct 2018
*/
#include "flexran_agent_phy.h"
#include "flexran_agent_ran_api.h"
/* Array containing the Agent-PHY interfaces */
AGENT_PHY_xface *agent_phy_xface[NUM_MAX_ENB];
void flexran_agent_fill_phy_cell_config(mid_t mod_id, uint8_t cc_id,
Protocol__FlexCellConfig *conf) {
conf->phy_cell_id = flexran_get_cell_id(mod_id, cc_id);
conf->has_phy_cell_id = 1;
conf->pusch_hopping_offset = flexran_get_hopping_offset(mod_id, cc_id);
conf->has_pusch_hopping_offset = 1;
conf->hopping_mode = flexran_get_hopping_mode(mod_id, cc_id);
conf->has_hopping_mode = 1;
conf->n_sb = flexran_get_n_SB(mod_id, cc_id);
conf->has_n_sb = 1;
conf->phich_resource = flexran_get_phich_resource(mod_id, cc_id);
conf->has_phich_resource = 1;
conf->phich_duration = flexran_get_phich_duration(mod_id, cc_id);
conf->has_phich_duration = 1;
conf->init_nr_pdcch_ofdm_sym = flexran_get_num_pdcch_symb(mod_id, cc_id);
conf->has_init_nr_pdcch_ofdm_sym = 1;
conf->dl_bandwidth = flexran_get_N_RB_DL(mod_id, cc_id);
conf->has_dl_bandwidth = 1;
conf->ul_bandwidth = flexran_get_N_RB_UL(mod_id, cc_id);
conf->has_ul_bandwidth = 1;
conf->ul_cyclic_prefix_length = flexran_get_ul_cyclic_prefix_length(mod_id, cc_id);
conf->has_ul_cyclic_prefix_length = 1;
conf->dl_cyclic_prefix_length = flexran_get_dl_cyclic_prefix_length(mod_id, cc_id);
conf->has_dl_cyclic_prefix_length = 1;
conf->antenna_ports_count = flexran_get_antenna_ports(mod_id, cc_id);
conf->has_antenna_ports_count = 1;
conf->duplex_mode = flexran_get_duplex_mode(mod_id, cc_id);
conf->has_duplex_mode = 1;
conf->subframe_assignment = flexran_get_subframe_assignment(mod_id, cc_id);
conf->has_subframe_assignment = 1;
conf->special_subframe_patterns = flexran_get_special_subframe_assignment(mod_id, cc_id);
conf->has_special_subframe_patterns = 1;
//TODO: Fill in with actual value, The MBSFN radio frame period
conf->n_mbsfn_subframe_config_rfperiod = 0;
uint32_t *elem_rfperiod = malloc(sizeof(uint32_t) * conf->n_mbsfn_subframe_config_rfperiod);
if (elem_rfperiod)
for(int j = 0; j < conf->n_mbsfn_subframe_config_rfperiod; j++)
elem_rfperiod[j] = 1;
conf->mbsfn_subframe_config_rfperiod = elem_rfperiod;
//TODO: Fill in with actual value, The MBSFN radio frame offset
conf->n_mbsfn_subframe_config_rfoffset = 0;
uint32_t *elem_rfoffset = malloc(sizeof(uint32_t) * conf->n_mbsfn_subframe_config_rfoffset);
if (elem_rfoffset)
for(int j = 0; j < conf->n_mbsfn_subframe_config_rfoffset; j++)
elem_rfoffset[j] = 1;
conf->mbsfn_subframe_config_rfoffset = elem_rfoffset;
//TODO: Fill in with actual value, Bitmap indicating the MBSFN subframes
conf->n_mbsfn_subframe_config_sfalloc = 0;
uint32_t *elem_sfalloc = malloc(sizeof(uint32_t) * conf->n_mbsfn_subframe_config_sfalloc);
if (elem_sfalloc)
for(int j = 0; j < conf->n_mbsfn_subframe_config_sfalloc; j++)
elem_sfalloc[j] = 1;
conf->mbsfn_subframe_config_sfalloc = elem_sfalloc;
conf->prach_config_index = flexran_get_prach_ConfigIndex(mod_id, cc_id);
conf->has_prach_config_index = 1;
conf->prach_freq_offset = flexran_get_prach_FreqOffset(mod_id, cc_id);
conf->has_prach_freq_offset = 1;
conf->max_harq_msg3tx = flexran_get_maxHARQ_Msg3Tx(mod_id, cc_id);
conf->has_max_harq_msg3tx = 1;
conf->n1pucch_an = flexran_get_n1pucch_an(mod_id, cc_id);
conf->has_n1pucch_an = 1;
conf->deltapucch_shift = flexran_get_deltaPUCCH_Shift(mod_id, cc_id);
conf->has_deltapucch_shift = 1;
conf->nrb_cqi = flexran_get_nRB_CQI(mod_id, cc_id);
conf->has_nrb_cqi = 1;
conf->srs_subframe_config = flexran_get_srs_SubframeConfig(mod_id, cc_id);
conf->has_srs_subframe_config = 1;
conf->srs_bw_config = flexran_get_srs_BandwidthConfig(mod_id, cc_id);
conf->has_srs_bw_config = 1;
conf->srs_mac_up_pts = flexran_get_srs_MaxUpPts(mod_id, cc_id);
conf->has_srs_mac_up_pts = 1;
conf->dl_freq = flexran_agent_get_operating_dl_freq (mod_id, cc_id);
conf->has_dl_freq = 1;
conf->ul_freq = flexran_agent_get_operating_ul_freq (mod_id, cc_id);
conf->has_ul_freq = 1;
conf->eutra_band = flexran_agent_get_operating_eutra_band (mod_id, cc_id);
conf->has_eutra_band = 1;
conf->dl_pdsch_power = flexran_agent_get_operating_pdsch_refpower(mod_id, cc_id);
conf->has_dl_pdsch_power = 1;
conf->enable_64qam = flexran_get_enable64QAM(mod_id, cc_id);
conf->has_enable_64qam = 1;
}
int flexran_agent_register_phy_xface(mid_t mod_id) {
if (agent_phy_xface[mod_id]) {
LOG_E(PHY, "PHY agent for eNB %d is already registered\n", mod_id);
return -1;
}
AGENT_PHY_xface *xface = malloc(sizeof(AGENT_PHY_xface));
if (!xface) {
LOG_E(FLEXRAN_AGENT, "could not allocate memory for PHY agent xface %d\n", mod_id);
return -1;
}
agent_phy_xface[mod_id] = xface;
return 0;
}
int flexran_agent_unregister_phy_xface(mid_t mod_id)
{
if (!agent_phy_xface[mod_id]) {
LOG_E(FLEXRAN_AGENT, "PHY agent for eNB %d is not registered\n", mod_id);
return -1;
}
free(agent_phy_xface[mod_id]);
agent_phy_xface[mod_id] = NULL;
return 0;
}
AGENT_PHY_xface *flexran_agent_get_phy_xface(mid_t mod_id)
{
return agent_phy_xface[mod_id];
}
@@ -19,49 +19,40 @@
* contact@openairinterface.org
*/
#include "defs.h"
#include "linux/module.h"
/*! \file flexran_agent_phy.h
* \brief FlexRAN agent Control Module PHY header
* \author Robert Schmidt
* \date Oct 2018
*/
#ifdef BIGPHYSAREA
#ifdef ARCH_64
char *bigphys_ptr,*bigphys_current;
#else //ARCH_64
unsigned int bigphys_ptr,bigphys_current;
#endif //ARCH_64
#ifndef FLEXRAN_AGENT_PHY_H_
#define FLEXRAN_AGENT_PHY_H_
// return pointer to memory in big physical area aligned to 16 bytes
void* bigphys_malloc(int n)
{
#include "header.pb-c.h"
#include "flexran.pb-c.h"
#include "stats_messages.pb-c.h"
#include "stats_common.pb-c.h"
#include "flexran_agent_common.h"
#include "flexran_agent_defs.h"
#include "flexran_agent_phy_defs.h"
#include "flexran_agent_ran_api.h"
// for flexran_agent_get_phy_xface()
#include "flexran_agent_extern.h"
/**********************************
* FlexRAN agent - technology PHY API
**********************************/
/* Fill the PHY part of an cell_config message */
void flexran_agent_fill_phy_cell_config(mid_t mod_id, uint8_t cc_id,
Protocol__FlexCellConfig *conf);
/* Register technology specific interface callbacks */
int flexran_agent_register_phy_xface(mid_t mod_id);
/* Unregister technology specific callbacks */
int flexran_agent_unregister_phy_xface(mid_t mod_id);
int n2 = n + ((16-(n%16))%16);
#ifdef ARCH_64
char *bigphys_old;
#else
unsigned int bigphys_old;
#endif
printk("[BIGPHYSAREA] Calling bigphys_malloc for %d (%d) bytes\n",n,n2);
#ifdef ARCH_64
printk("[BIGPHYSAREA] Allocated Memory @ %p\n",bigphys_current);
#endif
bigphys_old = bigphys_current;
bigphys_current += n2;
#ifdef ARCH_64
printk("[BIGPHYSAREA] Allocated Memory top now @ %p\n",bigphys_current);
return ((void *)(bigphys_old));
#else //ARCH_64
//printk("[BIGPHYSAREA] Allocated Memory %d\n",bigphys_current-bigphys_ptr);
return ((void *)(bigphys_old));
#endif //ARCH_64
}
EXPORT_SYMBOL(bigphys_malloc);
#endif
@@ -0,0 +1,35 @@
/*
* 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 __FLEXRAN_AGENT_PHY_PRIMITIVES_H__
#define __FLEXRAN_AGENT_PHY_PRIMITIVES_H__
#include "flexran_agent_defs.h"
#include "flexran.pb-c.h"
#include "header.pb-c.h"
/* FLEXRAN AGENT-PHY Interface */
typedef struct {
/* currently empty, will be used to control RU */
} AGENT_PHY_xface;
#endif /* __FLEXRAN_AGENT_PHY_PRIMITIVES_H__ */
@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
/*! \file flexran_agent_mac.c
/*! \file flexran_agent_rrc.c
* \brief FlexRAN agent Control Module RRC
* \author shahab SHARIAT BAGHERI
* \date 2017
@@ -27,7 +27,7 @@
*/
#include "flexran_agent_rrc.h"
#include "flexran_agent_ran_api.h"
#include "liblfds700.h"
@@ -36,9 +36,6 @@
/*Trigger boolean for RRC measurement*/
bool triggered_rrc = false;
/*Flags showing if an rrc agent has already been registered*/
unsigned int rrc_agent_registered[NUM_MAX_ENB];
/*Array containing the Agent-RRC interfaces*/
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB];
@@ -47,6 +44,8 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch
int size;
Protocol__FlexranMessage *msg = NULL;
Protocol__FlexHeader *header = NULL;
Protocol__FlexUeStateChange *ue_state_change_msg = NULL;
Protocol__FlexUeConfig *config = NULL;
void *data;
int priority = 0;
err_code_t err_code=0;
@@ -56,7 +55,6 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UE_STATE_CHANGE, &header) != 0)
goto error;
Protocol__FlexUeStateChange *ue_state_change_msg;
ue_state_change_msg = malloc(sizeof(Protocol__FlexUeStateChange));
if(ue_state_change_msg == NULL) {
goto error;
@@ -65,160 +63,26 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch
ue_state_change_msg->has_type = 1;
ue_state_change_msg->type = state_change;
Protocol__FlexUeConfig *config;
config = malloc(sizeof(Protocol__FlexUeConfig));
if (config == NULL) {
goto error;
}
protocol__flex_ue_config__init(config);
if (state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED) {
// Simply set the rnti of the UE
switch (state_change) {
case PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED:
config->has_rnti = 1;
config->rnti = rnti;
} else if (state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_UPDATED
|| state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED) {
int i = find_UE_id(mod_id, rnti);
config->has_rnti = 1;
config->rnti = rnti;
config->imsi = flexran_get_ue_imsi(mod_id, i);
config->has_imsi = 1;
config->dl_slice_id = flexran_get_ue_dl_slice_id(mod_id, i);
config->has_dl_slice_id = 1;
config->ul_slice_id = flexran_get_ue_ul_slice_id(mod_id, i);
config->has_ul_slice_id = 1;
if(flexran_get_time_alignment_timer(mod_id,i) != -1) {
config->time_alignment_timer = flexran_get_time_alignment_timer(mod_id,i);
config->has_time_alignment_timer = 1;
}
if(flexran_get_meas_gap_config(mod_id,i) != -1){
config->meas_gap_config_pattern = flexran_get_meas_gap_config(mod_id,i);
config->has_meas_gap_config_pattern = 1;
}
if(config->has_meas_gap_config_pattern == 1 &&
config->meas_gap_config_pattern != PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF) {
config->meas_gap_config_sf_offset = flexran_get_meas_gap_config_offset(mod_id,i);
config->has_meas_gap_config_sf_offset = 1;
}
//TODO: Set the SPS configuration (Optional)
//Not supported for now, so we do not set it
//TODO: Set the SR configuration (Optional)
//We do not set it for now
//TODO: Set the CQI configuration (Optional)
//We do not set it for now
if(flexran_get_ue_transmission_mode(mod_id,i) != -1) {
config->transmission_mode = flexran_get_ue_transmission_mode(mod_id,i);
config->has_transmission_mode = 1;
}
config->ue_aggregated_max_bitrate_ul = flexran_get_ue_aggregated_max_bitrate_ul(mod_id,i);
config->has_ue_aggregated_max_bitrate_ul = 1;
config->ue_aggregated_max_bitrate_dl = flexran_get_ue_aggregated_max_bitrate_dl(mod_id,i);
config->has_ue_aggregated_max_bitrate_dl = 1;
Protocol__FlexUeCapabilities *c_capabilities;
c_capabilities = malloc(sizeof(Protocol__FlexUeCapabilities));
protocol__flex_ue_capabilities__init(c_capabilities);
c_capabilities->has_half_duplex = 1;
c_capabilities->half_duplex = flexran_get_half_duplex(mod_id, i);
c_capabilities->has_intra_sf_hopping = 1;
c_capabilities->intra_sf_hopping = flexran_get_intra_sf_hopping(mod_id, i);
c_capabilities->has_type2_sb_1 = 1;
c_capabilities->type2_sb_1 = flexran_get_type2_sb_1(mod_id, i);
c_capabilities->has_ue_category = 1;
c_capabilities->ue_category = flexran_get_ue_category(mod_id, i);
c_capabilities->has_res_alloc_type1 = 1;
c_capabilities->res_alloc_type1 = flexran_get_res_alloc_type1(mod_id, i);
//Set the capabilites to the message
config->capabilities = c_capabilities;
if(flexran_get_ue_transmission_antenna(mod_id,i) != -1) {
config->has_ue_transmission_antenna = 1;
config->ue_transmission_antenna = flexran_get_ue_transmission_antenna(mod_id,i);
}
if(flexran_get_tti_bundling(mod_id,i) != -1) {
config->has_tti_bundling = 1;
config->tti_bundling = flexran_get_tti_bundling(mod_id,i);
}
if(flexran_get_maxHARQ_TX(mod_id,i) != -1){
config->has_max_harq_tx = 1;
config->max_harq_tx = flexran_get_maxHARQ_TX(mod_id,i);
}
if(flexran_get_beta_offset_ack_index(mod_id,i) != -1) {
config->has_beta_offset_ack_index = 1;
config->beta_offset_ack_index = flexran_get_beta_offset_ack_index(mod_id,i);
}
if(flexran_get_beta_offset_ri_index(mod_id,i) != -1) {
config->has_beta_offset_ri_index = 1;
config->beta_offset_ri_index = flexran_get_beta_offset_ri_index(mod_id,i);
}
if(flexran_get_beta_offset_cqi_index(mod_id,i) != -1) {
config->has_beta_offset_cqi_index = 1;
config->beta_offset_cqi_index = flexran_get_beta_offset_cqi_index(mod_id,i);
}
/* assume primary carrier */
if(flexran_get_ack_nack_simultaneous_trans(mod_id,i,0) != -1) {
config->has_ack_nack_simultaneous_trans = 1;
config->ack_nack_simultaneous_trans = flexran_get_ack_nack_simultaneous_trans(mod_id,i,0);
}
if(flexran_get_simultaneous_ack_nack_cqi(mod_id,i) != -1) {
config->has_simultaneous_ack_nack_cqi = 1;
config->simultaneous_ack_nack_cqi = flexran_get_simultaneous_ack_nack_cqi(mod_id,i);
}
if(flexran_get_aperiodic_cqi_rep_mode(mod_id,i) != -1) {
config->has_aperiodic_cqi_rep_mode = 1;
int mode = flexran_get_aperiodic_cqi_rep_mode(mod_id,i);
if (mode > 4) {
config->aperiodic_cqi_rep_mode = PROTOCOL__FLEX_APERIODIC_CQI_REPORT_MODE__FLACRM_NONE;
} else {
config->aperiodic_cqi_rep_mode = mode;
}
}
if(flexran_get_tdd_ack_nack_feedback_mode(mod_id, i) != -1) {
config->has_tdd_ack_nack_feedback = 1;
config->tdd_ack_nack_feedback = flexran_get_tdd_ack_nack_feedback_mode(mod_id,i);
}
if(flexran_get_ack_nack_repetition_factor(mod_id, i) != -1) {
config->has_ack_nack_repetition_factor = 1;
config->ack_nack_repetition_factor = flexran_get_ack_nack_repetition_factor(mod_id,i);
}
if(flexran_get_extended_bsr_size(mod_id, i) != -1) {
config->has_extended_bsr_size = 1;
config->extended_bsr_size = flexran_get_extended_bsr_size(mod_id,i);
}
config->has_pcell_carrier_index = 1;
config->pcell_carrier_index = UE_PCCID(mod_id, i);
//TODO: Set carrier aggregation support (boolean)
config->has_ca_support = 0;
config->ca_support = 0;
if(config->has_ca_support){
//TODO: Set cross carrier scheduling support (boolean)
config->has_cross_carrier_sched_support = 1;
config->cross_carrier_sched_support = 0;
//TODO: Set secondary cells configuration
// We do not set it for now. No carrier aggregation support
//TODO: Set deactivation timer for secondary cell
config->has_scell_deactivation_timer = 0;
config->scell_deactivation_timer = 0;
}
} else if (state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_MOVED) {
// TODO: Not supported for now. Leave blank
break;
case PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_UPDATED:
case PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED:
flexran_agent_fill_rrc_ue_config(mod_id, rnti, config);
/* we don't call into the MAC CM here; it will be called later through an
* ue_config_request */
break;
case PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_MOVED:
default:
LOG_E(FLEXRAN_AGENT, "state change FLUESC_MOVED or unknown state occured for RNTI %x\n",
rnti);
}
ue_state_change_msg->config = config;
@@ -239,19 +103,46 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch
}
LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size);
free(header);
return;
error:
if (err_code != 0)
LOG_E(FLEXRAN_AGENT, "Could not send UE state message becasue of %d \n",err_code);
LOG_E(FLEXRAN_AGENT, "Could not send UE state message becasue of %d for RNTI %x\n",
err_code, rnti);
if (header){
free(header);
}
if (ue_state_change_msg) {
free(ue_state_change_msg);
}
if (config) {
free(config);
}
if (msg) {
free(msg);
}
}
int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg) {
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG)
goto error;
free(msg->ue_state_change_msg->header);
//TODO: Free the contents of the UE config structure
if (msg->ue_state_change_msg->config->capabilities)
free(msg->ue_state_change_msg->config->capabilities);
if (msg->ue_state_change_msg->config->info) {
if (msg->ue_state_change_msg->config->info->cell_individual_offset) {
free(msg->ue_state_change_msg->config->info->cell_individual_offset);
}
if (msg->ue_state_change_msg->config->info->event) {
if (msg->ue_state_change_msg->config->info->event->a3) {
free(msg->ue_state_change_msg->config->info->event->a3);
}
free(msg->ue_state_change_msg->config->info->event);
}
free(msg->ue_state_change_msg->config->info);
}
free(msg->ue_state_change_msg->config);
free(msg->ue_state_change_msg);
free(msg);
return 0;
@@ -262,32 +153,29 @@ int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg) {
}
/* this is called by RRC as a part of rrc xface . The controller previously requested this*/
void flexran_trigger_rrc_measurements (mid_t mod_id, MeasResults_t* measResults) {
void flexran_trigger_rrc_measurements (mid_t mod_id, LTE_MeasResults_t* measResults) {
//int i;
// int priority = 0; // Warning Preventing
// void *data;
// int size;
// err_code_t err_code = -100;
triggered_rrc = true;
//int num;
/* TODO do we need this at the current state? meas_stats is never put into a
* protobuf message?!
num = flexran_get_num_ues (mod_id);
int num = flexran_get_rrc_num_ues (mod_id);
rnti_t rntis[num];
flexran_get_rrc_rnti_list(mod_id, rntis, num);
meas_stats = malloc(sizeof(rrc_meas_stats) * num);
for (i = 0; i < num; i++){
UE_id = flexran_get_ue_id(mod_id, i);
meas_stats[i].rnti = flexran_get_ue_crnti(mod_id, UE_id);
meas_stats[i].meas_id = flexran_get_rrc_pcell_measid(mod_id, UE_id);
meas_stats[i].rsrp = flexran_get_rrc_pcell_rsrp(mod_id, UE_id) - 140;
for (int i = 0; i < num; i++){
const rnti_t rnti = rntis[i];
meas_stats[i].rnti = rnti;
meas_stats[i].meas_id = flexran_get_rrc_pcell_measid(mod_id, rnti);
meas_stats[i].rsrp = flexran_get_rrc_pcell_rsrp(mod_id, rnti) - 140;
// measResults->measResultPCell.rsrpResult - 140;
meas_stats[i].rsrq = flexran_get_rrc_pcell_rsrq(mod_id, UE_id)/2 - 20;
// (measResults->measResultPCell.rsrqResult)/2 - 20;
}
meas_stats[i].rsrq = flexran_get_rrc_pcell_rsrq(mod_id, rnti)/2 - 20;
*/
// repl->neigh_meas = NULL;
@@ -496,165 +384,448 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
Protocol__FlexUeStatsReport **ue_report,
Protocol__FlexCellStatsReport **cell_report) {
// Protocol__FlexHeader *header;
int i,j;
int UE_id;
/* Allocate memory for list of UE reports */
if (report_config->nr_ue > 0) {
for (i = 0; i < report_config->nr_ue; i++) {
UE_id = flexran_get_ue_id(mod_id, i);
rnti_t rntis[report_config->nr_ue];
flexran_get_rrc_rnti_list(mod_id, rntis, report_config->nr_ue);
for (int i = 0; i < report_config->nr_ue; i++) {
const rnti_t rnti = rntis[i];
/* Check flag for creation of buffer status report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RRC_MEASUREMENTS) {
/*Source Cell*/
/*Source cell EUTRA Measurements*/
Protocol__FlexRrcMeasurements *rrc_measurements;
rrc_measurements = malloc(sizeof(Protocol__FlexRrcMeasurements));
if (rrc_measurements == NULL)
goto error;
protocol__flex_rrc_measurements__init(rrc_measurements);
rrc_measurements->measid = flexran_get_rrc_pcell_measid(mod_id, UE_id);
rrc_measurements->has_measid = 1;
rrc_measurements->pcell_rsrp = flexran_get_rrc_pcell_rsrp(mod_id, UE_id);
rrc_measurements->has_pcell_rsrp = 1;
rrc_measurements->pcell_rsrq = flexran_get_rrc_pcell_rsrq(mod_id, UE_id);
rrc_measurements->has_pcell_rsrq = 1 ;
rrc_measurements->measid = flexran_get_rrc_pcell_measid(mod_id, rnti);
rrc_measurements->has_measid = 1;
rrc_measurements->pcell_rsrp = flexran_get_rrc_pcell_rsrp(mod_id, rnti);
rrc_measurements->has_pcell_rsrp = 1;
rrc_measurements->pcell_rsrq = flexran_get_rrc_pcell_rsrq(mod_id, rnti);
rrc_measurements->has_pcell_rsrq = 1 ;
/* Target Cell, Neghibouring*/
/* Neighbouring cells EUTRA Measurements*/
Protocol__FlexNeighCellsMeasurements *neigh_meas;
neigh_meas = malloc(sizeof(Protocol__FlexNeighCellsMeasurements));
if (neigh_meas == NULL)
if (neigh_meas == NULL) {
free(rrc_measurements);
rrc_measurements = NULL;
goto error;
}
protocol__flex_neigh_cells_measurements__init(neigh_meas);
neigh_meas->n_eutra_meas = flexran_get_rrc_num_ncell(mod_id, UE_id);
neigh_meas->n_eutra_meas = flexran_get_rrc_num_ncell(mod_id, rnti);
Protocol__FlexEutraMeasurements **eutra_meas = NULL;
if (neigh_meas->n_eutra_meas > 0){
if (neigh_meas->n_eutra_meas > 0) {
eutra_meas = malloc(sizeof(Protocol__FlexEutraMeasurements) * neigh_meas->n_eutra_meas);
if (eutra_meas == NULL)
if (eutra_meas == NULL) {
free(neigh_meas);
free(rrc_measurements);
rrc_measurements = NULL;
goto error;
}
for (j = 0; j < neigh_meas->n_eutra_meas; j++ ){
for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ) {
eutra_meas[j] = malloc(sizeof(Protocol__FlexEutraMeasurements));
if (eutra_meas[j] == NULL) {
for (int k = 0 ; k < j ; k++)
free(eutra_meas[k]);
free(eutra_meas);
free(neigh_meas);
free(rrc_measurements);
rrc_measurements = NULL;
goto error;
}
protocol__flex_eutra_measurements__init(eutra_meas[j]);
eutra_meas[j] = malloc(sizeof(Protocol__FlexEutraMeasurements));
if (eutra_meas[j] == NULL)
goto error;
/* Fill in the physical cell identifier. */
eutra_meas[j]->phys_cell_id = flexran_get_rrc_neigh_phy_cell_id(mod_id, rnti, j);
eutra_meas[j]->has_phys_cell_id = 1;
protocol__flex_eutra_measurements__init(eutra_meas[j]);
/* The following is not correctly implemented */
//if (flexran_get_rrc_neigh_cgi(mod_id, rnti, j)) {
// /* Initialize CGI measurements. */
// Protocol__FlexEutraCgiMeasurements *cgi_meas;
// cgi_meas = malloc(sizeof(Protocol__FlexEutraCgiMeasurements));
eutra_meas[j]->phys_cell_id = flexran_get_rrc_neigh_phy_cell_id(mod_id, UE_id, j);
eutra_meas[j]->has_phys_cell_id = 1;
// if (cgi_meas) {
// protocol__flex_eutra_cgi_measurements__init(cgi_meas);
// cgi_meas->tracking_area_code = flexran_get_rrc_neigh_cgi_tac(mod_id, rnti, j);
// cgi_meas->has_tracking_area_code = 1;
/*TODO: Extend for CGI and PLMNID*/
// /* EUTRA Cell Global Identity (CGI) */
// Protocol__FlexCellGlobalEutraId *cgi;
// cgi = malloc(sizeof(Protocol__FlexCellGlobalEutraId));
Protocol__FlexEutraRefSignalMeas *meas_result;
meas_result = malloc(sizeof(Protocol__FlexEutraRefSignalMeas));
// if (cgi) {
// protocol__flex_cell_global_eutra_id__init(cgi);
protocol__flex_eutra_ref_signal_meas__init(meas_result);
// cgi->cell_id = flexran_get_rrc_neigh_cgi_cell_id(mod_id, rnti, j);
// cgi->has_cell_id = 1;
meas_result->rsrp = flexran_get_rrc_neigh_rsrp(mod_id, UE_id, eutra_meas[j]->phys_cell_id);
// /* PLMN for neighbouring cell */
// Protocol__FlexPlmnIdentity *plmn_id;
// plmn_id = malloc(sizeof(Protocol__FlexPlmnIdentity));
// if (plmn_id) {
// protocol__flex_plmn_identity__init(plmn_id);
// plmn_id->mcc = 0;
// plmn_id->n_mcc = flexran_get_rrc_neigh_cgi_num_mcc(mod_id, rnti, j);
// for (int m = 0; m < plmn_id->n_mcc; m++) {
// plmn_id->mcc += flexran_get_rrc_neigh_cgi_mcc(mod_id, rnti, j, m);
// }
// plmn_id->mnc = 0;
// plmn_id->n_mnc = flexran_get_rrc_neigh_cgi_num_mnc(mod_id, rnti, j);
// for (int m = 0; m < plmn_id->n_mnc; m++) {
// plmn_id->mnc += flexran_get_rrc_neigh_cgi_mnc(mod_id, rnti, j, m);
// }
// cgi->plmn_id = plmn_id;
// }
// cgi_meas->cgi = cgi;
// }
// eutra_meas[j]->cgi_meas = cgi_meas;
// }
//}
/*RSRP/RSRQ of the neighbouring cell */
Protocol__FlexEutraRefSignalMeas *meas_result;
meas_result = malloc(sizeof(Protocol__FlexEutraRefSignalMeas));
if (meas_result) {
protocol__flex_eutra_ref_signal_meas__init(meas_result);
meas_result->rsrp = flexran_get_rrc_neigh_rsrp(mod_id, rnti, j);
meas_result->has_rsrp = 1;
meas_result->rsrq = flexran_get_rrc_neigh_rsrq(mod_id, UE_id, eutra_meas[j]->phys_cell_id);
meas_result->rsrq = flexran_get_rrc_neigh_rsrq(mod_id, rnti, j);
meas_result->has_rsrq = 1;
eutra_meas[j]->meas_result = meas_result;
}
}
}
neigh_meas->eutra_meas = eutra_meas;
neigh_meas->eutra_meas = eutra_meas;
rrc_measurements->neigh_meas = neigh_meas;
rrc_measurements->neigh_meas = neigh_meas;
} else {
free(neigh_meas);
}
ue_report[i]->rrc_measurements = rrc_measurements;
ue_report[i]->rrc_measurements = rrc_measurements;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RRC_MEASUREMENTS;
}
}
}
}
/* To be considered for RRC signaling of cell*/
// if (report_config->nr_cc > 0) {
// // Fill in the Cell reports
// for (i = 0; i < report_config->nr_cc; i++) {
// /* Check flag for creation of noise and interference report */
// if(report_config->cc_report_type[i].cc_report_flags & PROTOCOL__FLEX_CELL_STATS_TYPE__FLCST_NOISE_INTERFERENCE) {
// // TODO: Fill in the actual noise and interference report for this cell
// Protocol__FlexNoiseInterferenceReport *ni_report;
// ni_report = malloc(sizeof(Protocol__FlexNoiseInterferenceReport));
// if(ni_report == NULL)
// goto error;
// protocol__flex_noise_interference_report__init(ni_report);
// // Current frame and subframe number
// ni_report->sfn_sf = flexran_get_sfn_sf(enb_id);
// ni_report->has_sfn_sf = 1;
// //TODO:Received interference power in dbm
// ni_report->rip = 0;
// ni_report->has_rip = 1;
// //TODO:Thermal noise power in dbm
// ni_report->tnp = 0;
// ni_report->has_tnp = 1;
// ni_report->p0_nominal_pucch = flexran_get_p0_nominal_pucch(enb_id, 0);
// ni_report->has_p0_nominal_pucch = 1;
// cell_report[i]->noise_inter_report = ni_report;
// }
// }
// }
return 0;
error:
for (i = 0; i < report_config->nr_ue; i++){
UE_id = flexran_get_ue_id(mod_id, i);
if (ue_report[i]->rrc_measurements->neigh_meas != NULL){
for (j = 0; j < flexran_get_rrc_num_ncell(mod_id, UE_id); j++){
free(ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]);
}
free(ue_report[i]->rrc_measurements->neigh_meas);
for (int i = 0; i < report_config->nr_ue; i++) {
if (ue_report[i]->rrc_measurements && ue_report[i]->rrc_measurements->neigh_meas != NULL) {
for (int j = 0; j < ue_report[i]->rrc_measurements->neigh_meas->n_eutra_meas; j++) {
free(ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]);
}
free(ue_report[i]->rrc_measurements->neigh_meas);
}
}
if (cell_report != NULL)
free(cell_report);
free(cell_report);
if (ue_report != NULL)
free(ue_report);
free(ue_report);
return -1;
}
int flexran_agent_rrc_destroy_stats_reply(Protocol__FlexStatsReply *reply)
{
for (int i = 0; i < reply->n_ue_report; i++){
if (reply->ue_report[i]->rrc_measurements && reply->ue_report[i]->rrc_measurements->neigh_meas) {
for (int j = 0; j < reply->ue_report[i]->rrc_measurements->neigh_meas->n_eutra_meas; j++) {
//if (reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas) {
// if (reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas->cgi) {
// if (reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas->plmn_id) {
// free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas->cgi->plmn_id);
// }
// free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas->cgi);
// }
// free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas);
//}
if (reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->meas_result) {
free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->meas_result);
}
free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]);
}
free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas);
free(reply->ue_report[i]->rrc_measurements->neigh_meas);
free(reply->ue_report[i]->rrc_measurements);
}
}
return 0;
}
int flexran_agent_register_rrc_xface(mid_t mod_id, AGENT_RRC_xface *xface) {
if (rrc_agent_registered[mod_id]) {
LOG_E(RRC, "RRC agent for eNB %d is already registered\n", mod_id);
int flexran_agent_rrc_gtp_stats_reply(mid_t mod_id,
const report_config_t *report_config,
Protocol__FlexUeStatsReport **ue_report,
Protocol__FlexCellStatsReport **cell_report) {
/* This function fills the GTP part of the statistics. The necessary
* information is, for our purposes, completely maintained in the RRC layer.
* It would be possible to add a GTP module that handles this, though. */
if (report_config->nr_ue > 0) {
rnti_t rntis[report_config->nr_ue];
flexran_get_rrc_rnti_list(mod_id, rntis, report_config->nr_ue);
for (int i = 0; i < report_config->nr_ue; i++) {
const rnti_t rnti = rntis[i];
/* Check flag for creation of buffer status report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_GTP_STATS) {
/* get number of rabs for this UE */
const int num_e_rab = flexran_agent_rrc_gtp_num_e_rab(mod_id, rnti);
Protocol__FlexGtpStats **gtp_stats = NULL;
if (num_e_rab > 0) {
gtp_stats = calloc(num_e_rab, sizeof(Protocol__FlexGtpStats *));
if (!gtp_stats) goto error;
for (int r = 0; r < num_e_rab; ++r) {
gtp_stats[r] = malloc(sizeof(Protocol__FlexGtpStats));
if (!gtp_stats[r]) goto error;
protocol__flex_gtp_stats__init(gtp_stats[r]);
gtp_stats[r]->e_rab_id = flexran_agent_rrc_gtp_get_e_rab_id(mod_id, rnti, r);
gtp_stats[r]->has_e_rab_id = 1;
gtp_stats[r]->teid_enb = flexran_agent_rrc_gtp_get_teid_enb(mod_id, rnti, r);
gtp_stats[r]->has_teid_enb = 1;
gtp_stats[r]->addr_enb = NULL;
gtp_stats[r]->teid_sgw = flexran_agent_rrc_gtp_get_teid_sgw(mod_id, rnti, r);
gtp_stats[r]->has_teid_sgw = 1;
gtp_stats[r]->addr_sgw = NULL;
}
}
ue_report[i]->n_gtp_stats = num_e_rab;
ue_report[i]->gtp_stats = gtp_stats;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_GTP_STATS;
}
}
}
return 0;
error:
for (int i = 0; i < report_config->nr_ue; i++) {
if (!ue_report[i]->gtp_stats) continue;
for (int r = 0; r < ue_report[i]->n_gtp_stats; ++r) {
if (ue_report[i]->gtp_stats[r]) {
free(ue_report[i]->gtp_stats[r]);
ue_report[i]->gtp_stats[r] = NULL;
}
}
free(ue_report[i]->gtp_stats);
ue_report[i]->gtp_stats = NULL;
}
return -1;
}
int flexran_agent_rrc_gtp_destroy_stats_reply(Protocol__FlexStatsReply *reply) {
for (int i = 0; i < reply->n_ue_report; ++i) {
if (!reply->ue_report[i]->n_gtp_stats == 0) continue;
for (int r = 0; r < reply->ue_report[i]->n_gtp_stats; ++r) {
//if (reply->ue_report[i]->gtp_stats[r]->addr_enb)
// free(reply->ue_report[i]->gtp_stats[r]->addr_enb);
//if (reply->ue_report[i]->gtp_stats[r]->addr_sgw)
// free(reply->ue_report[i]->gtp_stats[r]->addr_sgw);
free(reply->ue_report[i]->gtp_stats[r]);
}
}
return 0;
}
void flexran_agent_fill_rrc_ue_config(mid_t mod_id, rnti_t rnti,
Protocol__FlexUeConfig *ue_conf)
{
if (ue_conf->has_rnti && ue_conf->rnti != rnti) {
LOG_E(FLEXRAN_AGENT, "ue_config existing RNTI %x does not match RRC RNTI %x\n",
ue_conf->rnti, rnti);
return;
}
ue_conf->has_rnti = 1;
ue_conf->rnti = rnti;
ue_conf->imsi = flexran_get_ue_imsi(mod_id, rnti);
ue_conf->has_imsi = 1;
//TODO: Set the DRX configuration (optional)
//Not supported for now, so we do not set it
ue_conf->time_alignment_timer = flexran_get_time_alignment_timer(mod_id, rnti);
ue_conf->has_time_alignment_timer = 1;
ue_conf->meas_gap_config_pattern = flexran_get_meas_gap_config(mod_id, rnti);
ue_conf->has_meas_gap_config_pattern = 1;
if(ue_conf->meas_gap_config_pattern != PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF) {
ue_conf->meas_gap_config_sf_offset = flexran_get_meas_gap_config_offset(mod_id, rnti);
ue_conf->has_meas_gap_config_sf_offset = 1;
}
//TODO: Set the SPS configuration (Optional)
//Not supported for now, so we do not set it
//TODO: Set the SR configuration (Optional)
//We do not set it for now
//TODO: Set the CQI configuration (Optional)
//We do not set it for now
ue_conf->transmission_mode = flexran_get_ue_transmission_mode(mod_id, rnti);
ue_conf->has_transmission_mode = 1;
Protocol__FlexUeCapabilities *c_capabilities;
c_capabilities = malloc(sizeof(Protocol__FlexUeCapabilities));
if (c_capabilities) {
protocol__flex_ue_capabilities__init(c_capabilities);
c_capabilities->has_half_duplex = 1;
c_capabilities->half_duplex = flexran_get_half_duplex(mod_id, rnti);
c_capabilities->has_intra_sf_hopping = 1;
c_capabilities->intra_sf_hopping = flexran_get_intra_sf_hopping(mod_id, rnti);
c_capabilities->has_type2_sb_1 = 1;
c_capabilities->type2_sb_1 = flexran_get_type2_sb_1(mod_id, rnti);
c_capabilities->has_ue_category = 1;
c_capabilities->ue_category = flexran_get_ue_category(mod_id, rnti);
c_capabilities->has_res_alloc_type1 = 1;
c_capabilities->res_alloc_type1 = flexran_get_res_alloc_type1(mod_id, rnti);
ue_conf->capabilities = c_capabilities;
}
ue_conf->has_ue_transmission_antenna = 1;
ue_conf->ue_transmission_antenna = flexran_get_ue_transmission_antenna(mod_id, rnti);
ue_conf->has_tti_bundling = 1;
ue_conf->tti_bundling = flexran_get_tti_bundling(mod_id, rnti);
ue_conf->has_max_harq_tx = 1;
ue_conf->max_harq_tx = flexran_get_maxHARQ_TX(mod_id, rnti);
ue_conf->has_beta_offset_ack_index = 1;
ue_conf->beta_offset_ack_index = flexran_get_beta_offset_ack_index(mod_id, rnti);
ue_conf->has_beta_offset_ri_index = 1;
ue_conf->beta_offset_ri_index = flexran_get_beta_offset_ri_index(mod_id, rnti);
ue_conf->has_beta_offset_cqi_index = 1;
ue_conf->beta_offset_cqi_index = flexran_get_beta_offset_cqi_index(mod_id, rnti);
/* assume primary carrier */
ue_conf->has_ack_nack_simultaneous_trans = 1;
ue_conf->ack_nack_simultaneous_trans = flexran_get_ack_nack_simultaneous_trans(mod_id,0);
ue_conf->has_simultaneous_ack_nack_cqi = 1;
ue_conf->simultaneous_ack_nack_cqi = flexran_get_simultaneous_ack_nack_cqi(mod_id, rnti);
ue_conf->has_aperiodic_cqi_rep_mode = 1;
ue_conf->aperiodic_cqi_rep_mode = flexran_get_aperiodic_cqi_rep_mode(mod_id, rnti);
ue_conf->has_tdd_ack_nack_feedback = 1;
ue_conf->tdd_ack_nack_feedback = flexran_get_tdd_ack_nack_feedback_mode(mod_id, rnti);
ue_conf->has_ack_nack_repetition_factor = 1;
ue_conf->ack_nack_repetition_factor = flexran_get_ack_nack_repetition_factor(mod_id, rnti);
ue_conf->has_extended_bsr_size = 1;
ue_conf->extended_bsr_size = flexran_get_extended_bsr_size(mod_id, rnti);
Protocol__FlexMeasurementInfo *meas_info;
meas_info = malloc(sizeof(Protocol__FlexMeasurementInfo));
if (meas_info) {
protocol__flex_measurement_info__init(meas_info);
meas_info->has_offset_freq_serving = 1;
meas_info->offset_freq_serving = flexran_get_rrc_ofp(mod_id, rnti);
meas_info->has_offset_freq_neighbouring = 1;
meas_info->offset_freq_neighbouring = flexran_get_rrc_ofn(mod_id, rnti);
int num_adj_cells = flexran_get_rrc_num_adj_cells(mod_id);
meas_info->n_cell_individual_offset = num_adj_cells + 1;
int64_t *cell_individual_offset;
if (num_adj_cells > 0) {
cell_individual_offset = malloc(sizeof(int64_t)*(num_adj_cells+1));
if (cell_individual_offset) {
cell_individual_offset[0] = flexran_get_rrc_ocp(mod_id, rnti);
for (int i=0; i < num_adj_cells; i++) {
cell_individual_offset[i+1] = flexran_get_rrc_ocn(mod_id, rnti,i);
}
meas_info->cell_individual_offset = cell_individual_offset;
}
}
else {
cell_individual_offset = malloc(sizeof(int64_t));
if (cell_individual_offset) {
*cell_individual_offset = flexran_get_rrc_ocp(mod_id, rnti);
meas_info->cell_individual_offset = cell_individual_offset;
}
}
meas_info->has_filter_coefficient_rsrp = 1;
meas_info->filter_coefficient_rsrp = flexran_get_filter_coeff_rsrp(mod_id, rnti);
meas_info->has_filter_coefficient_rsrq = 1;
meas_info->filter_coefficient_rsrq = flexran_get_filter_coeff_rsrq(mod_id, rnti);
Protocol__FlexMeasurementEvent *event;
event = malloc(sizeof(Protocol__FlexMeasurementEvent));
if (event) {
protocol__flex_measurement_event__init(event);
Protocol__FlexA3Event *a3_event;
a3_event = malloc(sizeof(Protocol__FlexA3Event));
if (a3_event) {
protocol__flex_a3_event__init(a3_event);
a3_event->has_a3_offset = 1;
a3_event->a3_offset = flexran_get_rrc_a3_event_a3_offset(mod_id, rnti);
a3_event->has_report_on_leave = 1;
a3_event->report_on_leave = flexran_get_rrc_a3_event_reportOnLeave(mod_id, rnti);
a3_event->has_hysteresis = 1;
a3_event->hysteresis = flexran_get_rrc_a3_event_hysteresis(mod_id, rnti);
a3_event->has_time_to_trigger = 1;
a3_event->time_to_trigger = flexran_get_rrc_a3_event_timeToTrigger(mod_id, rnti);
a3_event->has_max_report_cells = 1;
a3_event->max_report_cells = flexran_get_rrc_a3_event_maxReportCells(mod_id, rnti);
event->a3 = a3_event;
}
meas_info->event = event;
}
ue_conf->info = meas_info;
}
}
int flexran_agent_register_rrc_xface(mid_t mod_id)
{
if (agent_rrc_xface[mod_id]) {
LOG_E(FLEXRAN_AGENT, "RRC agent for eNB %d is already registered\n", mod_id);
return -1;
}
AGENT_RRC_xface *xface = malloc(sizeof(AGENT_RRC_xface));
if (!xface) {
LOG_E(FLEXRAN_AGENT, "could not allocate memory for RRC agent xface %d\n", mod_id);
return -1;
}
@@ -663,21 +834,101 @@ int flexran_agent_register_rrc_xface(mid_t mod_id, AGENT_RRC_xface *xface) {
xface->flexran_agent_notify_ue_state_change = flexran_agent_ue_state_change;
xface->flexran_trigger_rrc_measurements = flexran_trigger_rrc_measurements;
rrc_agent_registered[mod_id] = 1;
agent_rrc_xface[mod_id] = xface;
return 0;
}
int flexran_agent_unregister_rrc_xface(mid_t mod_id, AGENT_RRC_xface *xface) {
void flexran_agent_fill_rrc_cell_config(mid_t mod_id, uint8_t cc_id,
Protocol__FlexCellConfig *conf) {
if (!conf->si_config) {
conf->si_config = malloc(sizeof(Protocol__FlexSiConfig));
if (conf->si_config)
protocol__flex_si_config__init(conf->si_config);
}
if (conf->si_config) {
// TODO THIS IS DU RRC
conf->si_config->sib1_length = flexran_get_sib1_length(mod_id, cc_id);
conf->si_config->has_sib1_length = 1;
conf->si_config->si_window_length = (uint32_t) flexran_get_si_window_length(mod_id, cc_id);
conf->si_config->has_si_window_length = 1;
conf->si_config->n_si_message = 0;
/* Protocol__FlexSiMessage **si_message; */
/* si_message = malloc(sizeof(Protocol__FlexSiMessage *) * 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__FlexSiMessage)); */
/* if(si_message[j] == NULL) */
/* goto error; */
/* protocol__flex_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; */
/* } */
}
conf->ra_response_window_size = flexran_get_ra_ResponseWindowSize(mod_id, cc_id);
conf->has_ra_response_window_size = 1;
// belongs to MAC but is read in RRC
conf->mac_contention_resolution_timer = flexran_get_mac_ContentionResolutionTimer(mod_id, cc_id);
conf->has_mac_contention_resolution_timer = 1;
conf->ul_pusch_power = flexran_agent_get_operating_pusch_p0 (mod_id, cc_id);
conf->has_ul_pusch_power = 1;
conf->n_plmn_id = flexran_get_rrc_num_plmn_ids(mod_id);
conf->plmn_id = calloc(conf->n_plmn_id, sizeof(Protocol__FlexPlmn *));
if (conf->plmn_id) {
for (int i = 0; i < conf->n_plmn_id; i++) {
conf->plmn_id[i] = malloc(sizeof(Protocol__FlexPlmn));
if (!conf->plmn_id[i]) continue;
protocol__flex_plmn__init(conf->plmn_id[i]);
conf->plmn_id[i]->mcc = flexran_get_rrc_mcc(mod_id, i);
conf->plmn_id[i]->has_mcc = 1;
conf->plmn_id[i]->mnc = flexran_get_rrc_mnc(mod_id, i);
conf->plmn_id[i]->has_mnc = 1;
conf->plmn_id[i]->mnc_length = flexran_get_rrc_mnc_digit_length(mod_id, i);
conf->plmn_id[i]->has_mnc_length = 1;
}
} else {
conf->n_plmn_id = 0;
}
conf->x2_ho_net_control = flexran_get_x2_ho_net_control(mod_id);
conf->has_x2_ho_net_control = 1;
}
int flexran_agent_unregister_rrc_xface(mid_t mod_id)
{
if (!agent_rrc_xface[mod_id]) {
LOG_E(FLEXRAN_AGENT, "RRC agent for eNB %d is not registered\n", mod_id);
return -1;
}
//xface->agent_ctxt = NULL;
// xface->flexran_agent_send_update_rrc_stats = NULL;
xface->flexran_agent_notify_ue_state_change = NULL;
xface->flexran_trigger_rrc_measurements = NULL;
rrc_agent_registered[mod_id] = 0;
agent_rrc_xface[mod_id]->flexran_agent_notify_ue_state_change = NULL;
agent_rrc_xface[mod_id]->flexran_trigger_rrc_measurements = NULL;
free(agent_rrc_xface[mod_id]);
agent_rrc_xface[mod_id] = NULL;
return 0;
}
AGENT_RRC_xface *flexran_agent_get_rrc_xface(mid_t mod_id)
{
return agent_rrc_xface[mod_id];
}
@@ -37,11 +37,10 @@
#include "flexran_agent_common.h"
#include "flexran_agent_rrc_defs.h"
// for flexran_agent_get_rrc_xface()
#include "flexran_agent_extern.h"
/* Initialization function for the agent structures etc */
void flexran_agent_init_rrc_agent(mid_t mod_id);
/* UE state change message constructor and destructor */
void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change);
int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg);
@@ -55,16 +54,29 @@ int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg);
// void flexran_agent_send_update_rrc_stats(mid_t mod_id);
/* this is called by RRC as a part of rrc xface . The controller previously requested this*/
void flexran_trigger_rrc_measurements (mid_t mod_id, MeasResults_t *);
void flexran_trigger_rrc_measurements (mid_t mod_id, LTE_MeasResults_t *);
/* Statistics reply protocol message constructor and destructor */
int flexran_agent_rrc_stats_reply(mid_t mod_id, const report_config_t *report_config, Protocol__FlexUeStatsReport **ue_report, Protocol__FlexCellStatsReport **cell_report);
int flexran_agent_rrc_destroy_stats_reply(Protocol__FlexranMessage *msg);
int flexran_agent_rrc_destroy_stats_reply(Protocol__FlexStatsReply *reply);
/* Statistic reply for GTP statistics which OAI stores also in the RRC layer.
* This might be moved to a separate GTP module in the future */
int flexran_agent_rrc_gtp_stats_reply(mid_t mod_id, const report_config_t *report_config, Protocol__FlexUeStatsReport **ue_report, Protocol__FlexCellStatsReport **cell_report);
int flexran_agent_rrc_gtp_destroy_stats_reply(Protocol__FlexStatsReply *reply);
/* Fill the RRC part of a ue_config message */
void flexran_agent_fill_rrc_ue_config(mid_t mod_id, rnti_t rnti,
Protocol__FlexUeConfig *ue_conf);
/* Fill the RRC part of an cell_config message */
void flexran_agent_fill_rrc_cell_config(mid_t mod_id, uint8_t cc_id,
Protocol__FlexCellConfig *conf);
/*Register technology specific interface callbacks*/
int flexran_agent_register_rrc_xface(mid_t mod_id, AGENT_RRC_xface *xface);
int flexran_agent_register_rrc_xface(mid_t mod_id);
/*Unregister technology specific callbacks*/
int flexran_agent_unregister_rrc_xface(mid_t mod_id, AGENT_RRC_xface*xface);
int flexran_agent_unregister_rrc_xface(mid_t mod_id);
#endif
@@ -34,7 +34,7 @@
#include "flexran_agent_defs.h"
#include "flexran.pb-c.h"
#include "header.pb-c.h"
#include "MeasResults.h"
#include "LTE_MeasResults.h"
#define RINGBUFFER_SIZE 100
@@ -62,7 +62,7 @@ typedef struct {
void (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
uint8_t state_change);
void (*flexran_trigger_rrc_measurements)(mid_t mod_id, MeasResults_t* measResults);
void (*flexran_trigger_rrc_measurements)(mid_t mod_id, LTE_MeasResults_t* measResults);
} AGENT_RRC_xface;
@@ -0,0 +1,147 @@
/*
* 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
*/
#include "flexran_agent_rrc_internal.h"
#include "flexran_agent_ran_api.h"
int update_rrc_reconfig(mid_t mod_id, rnti_t rnti, Protocol__FlexRrcTriggering *trigg) {
// Measurement info reconfiguration
if (trigg->meas_info) {
/* Set serving cell frequency offset */
if (trigg->meas_info->has_offset_freq_serving) {
if (flexran_set_rrc_ofp(mod_id, rnti, trigg->meas_info->offset_freq_serving) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Serving cell frequency offset\n");
return -1;
}
}
/* Set neighbouring cell frequency offset */
if (trigg->meas_info->has_offset_freq_neighbouring) {
if (flexran_set_rrc_ofn(mod_id, rnti, trigg->meas_info->offset_freq_neighbouring) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell frequency offset\n");
return -1;
}
}
if (trigg->meas_info->n_cell_individual_offset > 0) {
/* Set the serving cell offset */
if (flexran_set_rrc_ocp(mod_id, rnti, trigg->meas_info->cell_individual_offset[0]) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Serving cell offset\n");
return -1;
}
/* Set the neighbouring cell offset */
for (int i=0; i<(trigg->meas_info->n_cell_individual_offset-1); i++) {
if (flexran_set_rrc_ocn(mod_id, rnti, i, trigg->meas_info->cell_individual_offset[i+1]) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell offset\n");
return -1;
}
}
}
if (trigg->meas_info->has_offset_freq_neighbouring) {
if (flexran_set_rrc_ofn(mod_id, rnti, trigg->meas_info->offset_freq_neighbouring) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell frequency offset\n");
return -1;
}
}
/* Set rsrp filter coefficient */
if (trigg->meas_info->has_filter_coefficient_rsrp) {
if (flexran_set_filter_coeff_rsrp(mod_id, rnti, trigg->meas_info->filter_coefficient_rsrp) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set RSRP filter coefficient\n");
return -1;
}
}
/* Set rsrq filter coefficient */
if (trigg->meas_info->has_filter_coefficient_rsrq) {
if (flexran_set_filter_coeff_rsrq(mod_id, rnti, trigg->meas_info->filter_coefficient_rsrq) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set RSRQ filter coefficient\n");
return -1;
}
}
if (trigg->meas_info->event) {
/* Set Periodic event parameters */
if (trigg->meas_info->event->periodical) {
/* Set Periodic event maximum number of reported cells */
if (trigg->meas_info->event->periodical->has_max_report_cells) {
if (flexran_set_rrc_per_event_maxReportCells(mod_id, rnti, trigg->meas_info->event->periodical->max_report_cells) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Periodic event max\n");
return -1;
}
}
}
/* Set A3 event parameters */
if (trigg->meas_info->event->a3) {
/* Set A3 event a3 offset */
if (trigg->meas_info->event->a3->has_a3_offset) {
if (flexran_set_rrc_a3_event_a3_offset(mod_id, rnti, trigg->meas_info->event->a3->a3_offset) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event offset\n");
return -1;
}
}
/* Set A3 event report on leave */
if (trigg->meas_info->event->a3->has_report_on_leave) {
if (flexran_set_rrc_a3_event_reportOnLeave(mod_id, rnti, trigg->meas_info->event->a3->report_on_leave) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event report on leave\n");
return -1;
}
}
/* Set A3 event hysteresis */
if (trigg->meas_info->event->a3->has_hysteresis) {
if (flexran_set_rrc_a3_event_hysteresis(mod_id, rnti, trigg->meas_info->event->a3->hysteresis) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event hysteresis\n");
return -1;
}
}
/* Set A3 event time to trigger */
if (trigg->meas_info->event->a3->has_time_to_trigger) {
if (flexran_set_rrc_a3_event_timeToTrigger(mod_id, rnti, trigg->meas_info->event->a3->time_to_trigger) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event time to trigger\n");
return -1;
}
}
/* Set A3 event maximum number of reported cells */
if (trigg->meas_info->event->a3->has_max_report_cells) {
if (flexran_set_rrc_a3_event_maxReportCells(mod_id, rnti, trigg->meas_info->event->a3->max_report_cells) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event max report cells\n");
return -1;
}
}
}
}
}
return 0;
}
@@ -0,0 +1,31 @@
/*
* 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 FLEXRAN_AGENT_RRC_INTERNAL_H_
#define FLEXRAN_AGENT_RRC_INTERNAL_H_
#include "flexran_agent_rrc_internal.h"
#include "flexran_agent_ran_api.h"
int update_rrc_reconfig(mid_t mod_id, rnti_t rnti, Protocol__FlexRrcTriggering *trigg);
#endif /*FLEXRAN_AGENT_RRC_INTERNAL_H_*/
+46 -3
View File
@@ -44,7 +44,21 @@
#define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd"
#define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd"
#define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference"
#define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold"
#define CONFIG_STRING_L1_PUCCH1_DTX_THRESHOLD "pucch1_dtx_threshold"
#define CONFIG_STRING_L1_PUCCH1AB_DTX_THRESHOLD "pucch1ab_dtx_threshold"
#define CONFIG_STRING_L1_PRACH_DTX_EMTC0_THRESHOLD "prach_dtx_emtc0_threshold"
#define CONFIG_STRING_L1_PUCCH1_DTX_EMTC0_THRESHOLD "pucch1_dtx_emtc0_threshold"
#define CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC0_THRESHOLD "pucch1ab_dtx_emtc0_threshold"
#define CONFIG_STRING_L1_PRACH_DTX_EMTC1_THRESHOLD "prach_dtx_emtc1_threshold"
#define CONFIG_STRING_L1_PUCCH1_DTX_EMTC1_THRESHOLD "pucch1_dtx_emtc1_threshold"
#define CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC1_THRESHOLD "pucch1ab_dtx_emtc1_threshold"
#define CONFIG_STRING_L1_PRACH_DTX_EMTC2_THRESHOLD "prach_dtx_emtc2_threshold"
#define CONFIG_STRING_L1_PUCCH1_DTX_EMTC2_THRESHOLD "pucch1_dtx_emtc2_threshold"
#define CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC2_THRESHOLD "pucch1ab_dtx_emtc2_threshold"
#define CONFIG_STRING_L1_PRACH_DTX_EMTC3_THRESHOLD "prach_dtx_emtc3_threshold"
#define CONFIG_STRING_L1_PUCCH1_DTX_EMTC3_THRESHOLD "pucch1_dtx_emtc3_threshold"
#define CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC3_THRESHOLD "pucch1ab_dtx_emtc3_threshold"
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* L1 configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
@@ -59,7 +73,22 @@
{CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \
}
{CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, iptr:NULL, defintval:100, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1_DTX_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1AB_DTX_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PRACH_DTX_EMTC0_THRESHOLD, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1_DTX_EMTC0_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC0_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PRACH_DTX_EMTC1_THRESHOLD, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1_DTX_EMTC1_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC1_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PRACH_DTX_EMTC2_THRESHOLD, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1_DTX_EMTC2_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC2_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PRACH_DTX_EMTC3_THRESHOLD, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1_DTX_EMTC3_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC3_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0} \
}
#define L1_CC_IDX 0
#define L1_TRANSPORT_N_PREFERENCE_IDX 1
#define L1_LOCAL_N_IF_NAME_IDX 2
@@ -69,5 +98,19 @@
#define L1_REMOTE_N_PORTC_IDX 6
#define L1_LOCAL_N_PORTD_IDX 7
#define L1_REMOTE_N_PORTD_IDX 8
#define L1_PRACH_DTX_THRESHOLD_IDX 9
#define L1_PUCCH1_DTX_THRESHOLD_IDX 10
#define L1_PUCCH1AB_DTX_THRESHOLD_IDX 11
#define L1_PRACH_DTX_EMTC0_THRESHOLD_IDX 12
#define L1_PUCCH1_DTX_EMTC0_THRESHOLD_IDX 13
#define L1_PUCCH1AB_DTX_EMTC0_THRESHOLD_IDX 14
#define L1_PRACH_DTX_EMTC1_THRESHOLD_IDX 15
#define L1_PUCCH1_DTX_EMTC1_THRESHOLD_IDX 16
#define L1_PUCCH1AB_DTX_EMTC1_THRESHOLD_IDX 17
#define L1_PRACH_DTX_EMTC2_THRESHOLD_IDX 18
#define L1_PUCCH1_DTX_EMTC2_THRESHOLD_IDX 19
#define L1_PUCCH1AB_DTX_EMTC2_THRESHOLD_IDX 20
#define L1_PRACH_DTX_EMTC3_THRESHOLD_IDX 21
#define L1_PUCCH1_DTX_EMTC3_THRESHOLD_IDX 22
#define L1_PUCCH1AB_DTX_EMTC3_THRESHOLD_IDX 23
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
@@ -218,6 +218,9 @@ enum flex_aperiodic_cqi_report_mode {
FLACRM_RM30 = 3;
FLACRM_RM31 = 4;
FLACRM_NONE = 5;
FLACRM_RM32_v1250 = 6;
FLACRM_RM10_v1310 = 7;
FLACRM_RM11_v1310 = 8;
}
enum flex_tdd_ack_nack_feedback_mode {
@@ -259,3 +262,77 @@ enum flex_ue_state_change_type {
FLUESC_DEACTIVATED = 2;
FLUESC_MOVED = 3;
}
message flex_plmn {
optional uint32 mcc = 1;
optional uint32 mnc = 2;
optional uint32 mnc_length = 3;
}
//
// UE-related RRC configuration
message flex_measurement_info {
// arbitrary offset OFS, from TS
optional int64 offset_freq_serving = 1;
// arbitrary offset OFN
optional int64 offset_freq_neighbouring = 2;
// arbitrary offset OCS + OCN
repeated int64 cell_individual_offset = 3;
// Parameter k for exponential moving average calculation coefficient
// a = 1/2^(k/4) of all measured RSRPs
optional int64 filter_coefficient_rsrp = 4;
// Parameter k for RSRQ filtering
optional int64 filter_coefficient_rsrq = 5;
optional flex_measurement_event event = 6;
}
message flex_measurement_event {
optional flex_per_event periodical = 1;
optional flex_a1_event a1 = 2;
optional flex_a2_event a2 = 3;
optional flex_a3_event a3 = 4;
optional flex_a4_event a4 = 5;
optional flex_a5_event a5 = 6;
}
message flex_per_event {
optional int64 max_report_cells = 1;
}
message flex_a1_event {
optional int64 threshold_rsrp = 1;
optional int64 hysteresis = 2;
optional int64 time_to_trigger = 3;
optional int64 max_report_cells = 4;
}
message flex_a2_event {
optional int64 threshold_rsrp = 1;
optional int64 hysteresis = 2;
optional int64 time_to_trigger = 3;
optional int64 max_report_cells = 4;
}
message flex_a3_event {
optional int64 a3_offset = 1;
optional int32 report_on_leave = 2;
optional int64 hysteresis = 3;
optional int64 time_to_trigger = 4;
optional int64 max_report_cells = 5;
}
message flex_a4_event {
optional int64 threshold_rsrp = 1;
optional int64 hysteresis = 2;
optional int64 time_to_trigger = 3;
optional int64 max_report_cells = 4;
}
message flex_a5_event {
optional int64 threshold_rsrp_1 = 1;
optional int64 threshold_rsrp_2 = 2;
optional int64 hysteresis = 3;
optional int64 time_to_trigger = 4;
optional int64 max_report_cells = 5;
}
@@ -5,7 +5,6 @@ import "config_common.proto";
message flex_cell_config {
optional uint32 phy_cell_id = 1; // The PCI of this cell
optional uint32 cell_id = 2; // The PLMN cell id of this cell
optional uint32 pusch_hopping_offset = 3; // PUSCH resources in RBs for hopping
optional uint32 hopping_mode = 4; // One of the FLHM_* enum values
optional uint32 n_sb = 5; // The number of subbands
@@ -43,8 +42,10 @@ message flex_cell_config {
optional uint32 eutra_band= 37; // operating band
optional int32 dl_pdsch_power = 38; // operating downlink power
optional int32 ul_pusch_power = 39; // operating uplink power
repeated flex_plmn plmn_id = 40; // The PLMN cell id of this cell
optional flex_slice_config slice_config = 42;
optional bool x2_ho_net_control = 43;
}
message flex_slice_config {
@@ -97,6 +98,8 @@ message flex_ue_config {
optional uint64 imsi = 30;
optional uint32 dl_slice_id = 31;
optional uint32 ul_slice_id = 32;
// Configuration about RRC measurements
optional flex_measurement_info info = 33;
}
message flex_lc_ue_config {
+27 -5
View File
@@ -7,7 +7,7 @@ import "time_common.proto";
import "config_messages.proto";
import "controller_commands.proto";
import "control_delegation.proto";
import "config_common.proto";
message flexran_message {
optional flexran_direction msg_dir = 100;
@@ -31,6 +31,8 @@ message flexran_message {
flex_agent_reconfiguration agent_reconfiguration_msg = 17;
flex_rrc_triggering rrc_triggering = 18;
flex_ul_mac_config ul_mac_config_msg = 19;
flex_disconnect disconnect_msg = 20;
flex_ho_command ho_command_msg = 21;
}
}
@@ -64,9 +66,21 @@ enum flexran_err {
//
// Maintenance and discovery messages
//
enum flex_bs_capability {
LOPHY = 0;
HIPHY = 1;
LOMAC = 2;
HIMAC = 3;
RLC = 4;
PDCP = 5;
SDAP = 6;
RRC = 7;
}
message flex_hello {
optional flex_header header = 1;
optional flex_header header = 1;
optional uint64 bs_id = 2; // Unique id to distinguish the eNB
repeated flex_bs_capability capabilities = 3;
}
message flex_echo_request {
@@ -131,7 +145,6 @@ message flex_enb_config_request {
message flex_enb_config_reply {
optional flex_header header = 1;
optional uint64 eNB_id = 2; // Unique id to distinguish the eNB
repeated flex_cell_config cell_config = 3;
optional uint32 device_spec = 4;
}
@@ -176,7 +189,14 @@ message flex_ul_mac_config {
message flex_rrc_triggering {
optional flex_header header = 1;
optional string rrc_trigger = 2;
optional string rrc_trigger = 2;
optional flex_measurement_info meas_info = 3;
}
message flex_ho_command {
optional flex_header header = 1;
optional uint32 rnti = 2;
optional uint32 target_phy_cell_id = 3;
}
//
@@ -223,4 +243,6 @@ message flex_echo_reply_latency {
}
}
message flex_disconnect {
optional flex_header header = 1;
}
@@ -12,6 +12,7 @@ enum flex_type {
FLPT_HELLO = 0;
FLPT_ECHO_REQUEST = 1;
FLPT_ECHO_REPLY = 2;
FLPT_DISCONNECT = 20;
// Statistics and measurement messages
FLPT_STATS_REQUEST = 3;
@@ -33,6 +34,7 @@ enum flex_type {
//Controller command messages
FLPT_DL_MAC_CONFIG = 13;
FLPT_HO_COMMAND = 21;
// UE state change messages
FLPT_UE_STATE_CHANGE = 14;
@@ -305,3 +305,15 @@ message flex_mac_sdus_dl {
optional uint32 sdu_length = 1;
optional uint32 lcid = 2;
}
//
// GTP stats
//
message flex_gtp_stats {
optional uint32 e_rab_id = 1;
optional uint32 teid_enb = 2;
optional string addr_enb = 3;
optional uint32 teid_sgw = 4;
optional string addr_sgw = 5;
}
@@ -50,6 +50,7 @@ message flex_ue_stats_report {
optional flex_rrc_measurements rrc_measurements = 10;
optional flex_pdcp_stats pdcp_stats = 11;
optional flex_mac_stats mac_stats = 12;
repeated flex_gtp_stats gtp_stats = 13;
}
//
@@ -89,6 +90,7 @@ enum flex_ue_stats_type {
FLUST_MAC_STATS = 128;
FLUST_PDCP_STATS = 1024;
FLUST_GTP_STATS = 2048;
FLUST_RRC_MEASUREMENTS = 65536;
// To be extended with more types of stats
-7
View File
@@ -1,7 +0,0 @@
ENB_APP_DIR = $(OPENAIR2_TOP)/ENB_APP
ENB_APP_OBJS = $(ENB_APP_DIR)/enb_app.o \
$(ENB_APP_DIR)/enb_config.o
ENB_APP_incl = \
-I$(ENB_APP_DIR) -I$(OPENAIR2_TOP)
+120 -154
View File
@@ -33,13 +33,9 @@
#include "log.h"
#include "log_extern.h"
#include "assertions.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# endif
#endif
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#include "SystemInformationBlockType2.h"
#include "PHY/phy_extern.h"
@@ -56,11 +52,10 @@
void RCconfig_NbIoTL1(void) {
paramdef_t NbIoT_L1_Params[] = L1PARAMS_DESC;
paramlist_def_t NbIoT_L1_ParamList = {NBIOT_L1LIST_CONFIG_STRING,NULL,0};
/* No component carrier for NbIoT, ignore number of CC */
// NbIoT_L1_Params[L1_CC_IDX ].paramflags = PARAMFLAG_DONOTREAD;
config_getlist( &NbIoT_L1_ParamList,NbIoT_L1_Params,sizeof(NbIoT_L1_Params)/sizeof(paramdef_t), NULL);
/* No component carrier for NbIoT, ignore number of CC */
// NbIoT_L1_Params[L1_CC_IDX ].paramflags = PARAMFLAG_DONOTREAD;
config_getlist( &NbIoT_L1_ParamList,NbIoT_L1_Params,sizeof(NbIoT_L1_Params)/sizeof(paramdef_t), NULL);
if (NbIoT_L1_ParamList.numelt > 0) {
if (RC.L1_NB_IoT == NULL) {
RC.L1_NB_IoT = (PHY_VARS_eNB_NB_IoT **)malloc(RC.nb_nb_iot_L1_inst*sizeof(PHY_VARS_eNB_NB_IoT *));
@@ -68,219 +63,190 @@ void RCconfig_NbIoTL1(void) {
memset(RC.L1_NB_IoT,0,RC.nb_nb_iot_L1_inst*sizeof(PHY_VARS_eNB_NB_IoT *));
}
for(int j = 0; j <NbIoT_L1_ParamList.numelt ; j++) {
for(int j = 0; j <NbIoT_L1_ParamList.numelt ; j++) {
if (RC.L1_NB_IoT[j] == NULL) {
RC.L1_NB_IoT[j] = (PHY_VARS_eNB_NB_IoT *)malloc(sizeof(PHY_VARS_eNB_NB_IoT));
LOG_I(PHY,"RC.L1_NB_IoT[%d] = %p\n",j,RC.L1_NB_IoT[j]);
memset(RC.L1_NB_IoT[j],0,sizeof(PHY_VARS_eNB_NB_IoT));
RC.L1_NB_IoT[j] = (PHY_VARS_eNB_NB_IoT *)malloc(sizeof(PHY_VARS_eNB_NB_IoT));
LOG_I(PHY,"RC.L1_NB_IoT[%d] = %p\n",j,RC.L1_NB_IoT[j]);
memset(RC.L1_NB_IoT[j],0,sizeof(PHY_VARS_eNB_NB_IoT));
}
if (strcmp(*(NbIoT_L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) {
if (strcmp(*(NbIoT_L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) {
} else if (strcmp(*(NbIoT_L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) {
RC.L1_NB_IoT[j]->eth_params_n.local_if_name = strdup(*(NbIoT_L1_ParamList.paramarray[j][L1_LOCAL_N_IF_NAME_IDX].strptr));
RC.L1_NB_IoT[j]->eth_params_n.my_addr = strdup(*(NbIoT_L1_ParamList.paramarray[j][L1_LOCAL_N_ADDRESS_IDX].strptr));
RC.L1_NB_IoT[j]->eth_params_n.remote_addr = strdup(*(NbIoT_L1_ParamList.paramarray[j][L1_REMOTE_N_ADDRESS_IDX].strptr));
RC.L1_NB_IoT[j]->eth_params_n.my_portc = *(NbIoT_L1_ParamList.paramarray[j][L1_LOCAL_N_PORTC_IDX].iptr);
RC.L1_NB_IoT[j]->eth_params_n.remote_portc = *(NbIoT_L1_ParamList.paramarray[j][L1_REMOTE_N_PORTC_IDX].iptr);
RC.L1_NB_IoT[j]->eth_params_n.my_portd = *(NbIoT_L1_ParamList.paramarray[j][L1_LOCAL_N_PORTD_IDX].iptr);
RC.L1_NB_IoT[j]->eth_params_n.remote_portd = *(NbIoT_L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr);
RC.L1_NB_IoT[j]->eth_params_n.transp_preference = ETH_UDP_MODE;
} else { // other midhaul
}
else if (strcmp(*(NbIoT_L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) {
RC.L1_NB_IoT[j]->eth_params_n.local_if_name = strdup(*(NbIoT_L1_ParamList.paramarray[j][L1_LOCAL_N_IF_NAME_IDX].strptr));
RC.L1_NB_IoT[j]->eth_params_n.my_addr = strdup(*(NbIoT_L1_ParamList.paramarray[j][L1_LOCAL_N_ADDRESS_IDX].strptr));
RC.L1_NB_IoT[j]->eth_params_n.remote_addr = strdup(*(NbIoT_L1_ParamList.paramarray[j][L1_REMOTE_N_ADDRESS_IDX].strptr));
RC.L1_NB_IoT[j]->eth_params_n.my_portc = *(NbIoT_L1_ParamList.paramarray[j][L1_LOCAL_N_PORTC_IDX].iptr);
RC.L1_NB_IoT[j]->eth_params_n.remote_portc = *(NbIoT_L1_ParamList.paramarray[j][L1_REMOTE_N_PORTC_IDX].iptr);
RC.L1_NB_IoT[j]->eth_params_n.my_portd = *(NbIoT_L1_ParamList.paramarray[j][L1_LOCAL_N_PORTD_IDX].iptr);
RC.L1_NB_IoT[j]->eth_params_n.remote_portd = *(NbIoT_L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr);
RC.L1_NB_IoT[j]->eth_params_n.transp_preference = ETH_UDP_MODE;
}
else { // other midhaul
}
}// j=0..num_inst
printf("Initializing northbound interface for NB-IoT L1\n");
l1_north_init_NB_IoT();
} else {
LOG_I(PHY,"No " NBIOT_L1LIST_CONFIG_STRING " configuration found");
LOG_I(PHY,"No " NBIOT_L1LIST_CONFIG_STRING " configuration found");
}
}
void RCconfig_NbIoTmacrlc(void) {
paramdef_t NbIoT_MacRLC_Params[] = MACRLCPARAMS_DESC;
paramlist_def_t NbIoT_MacRLC_ParamList = {NBIOT_MACRLCLIST_CONFIG_STRING,NULL,0};
/* No component carrier for NbIoT, ignore number of CC */
// NbIoT_MacRLC_Params[MACRLC_CC_IDX ].paramflags = PARAMFLAG_DONOTREAD;
config_getlist( &NbIoT_MacRLC_ParamList,NbIoT_MacRLC_Params,sizeof(NbIoT_MacRLC_Params)/sizeof(paramdef_t), NULL);
/* No component carrier for NbIoT, ignore number of CC */
// NbIoT_MacRLC_Params[MACRLC_CC_IDX ].paramflags = PARAMFLAG_DONOTREAD;
config_getlist( &NbIoT_MacRLC_ParamList,NbIoT_MacRLC_Params,sizeof(NbIoT_MacRLC_Params)/sizeof(paramdef_t), NULL);
if ( NbIoT_MacRLC_ParamList.numelt > 0) {
mac_top_init_eNB_NB_IoT();
for (int j=0;j<RC.nb_nb_iot_macrlc_inst;j++) {
for (int j=0; j<RC.nb_nb_iot_macrlc_inst; j++) {
if (strcmp(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_RRC") == 0) {
// check number of instances is same as RRC/PDCP
// check number of instances is same as RRC/PDCP
} else if (strcmp(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "cudu") == 0) {
RC.nb_iot_mac[j]->eth_params_n.local_if_name = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_IF_NAME_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_n.my_addr = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_n.remote_addr = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_ADDRESS_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_n.my_portc = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTC_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_n.remote_portc = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTC_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_n.my_portd = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTD_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_n.remote_portd = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTD_IDX].iptr);;
RC.nb_iot_mac[j]->eth_params_n.transp_preference = ETH_UDP_MODE;
RC.nb_iot_mac[j]->eth_params_n.local_if_name = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_IF_NAME_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_n.my_addr = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_n.remote_addr = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_ADDRESS_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_n.my_portc = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTC_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_n.remote_portc = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTC_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_n.my_portd = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTD_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_n.remote_portd = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTD_IDX].iptr);;
RC.nb_iot_mac[j]->eth_params_n.transp_preference = ETH_UDP_MODE;
} else { // other midhaul
AssertFatal(1==0,"MACRLC %d: %s unknown northbound midhaul\n",j, *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr));
}
AssertFatal(1==0,"MACRLC %d: %s unknown northbound midhaul\n",j, *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr));
}
if (strcmp(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_L1") == 0) {
} else if (strcmp(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "nfapi") == 0) {
RC.nb_iot_mac[j]->eth_params_s.local_if_name = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_IF_NAME_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_s.my_addr = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_ADDRESS_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_s.remote_addr = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_ADDRESS_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_s.my_portc = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTC_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_s.remote_portc = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTC_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_s.my_portd = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTD_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_s.remote_portd = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTD_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_s.transp_preference = ETH_UDP_MODE;
RC.nb_iot_mac[j]->eth_params_s.local_if_name = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_IF_NAME_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_s.my_addr = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_ADDRESS_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_s.remote_addr = strdup(*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_ADDRESS_IDX].strptr));
RC.nb_iot_mac[j]->eth_params_s.my_portc = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTC_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_s.remote_portc = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTC_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_s.my_portd = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTD_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_s.remote_portd = *(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTD_IDX].iptr);
RC.nb_iot_mac[j]->eth_params_s.transp_preference = ETH_UDP_MODE;
} else { // other midhaul
AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr));
}
AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr));
}
}// j=0..num_inst */
} else {// MacRLC_ParamList.numelt > 0
AssertFatal (0,
"No " NBIOT_MACRLCLIST_CONFIG_STRING " configuration found");
AssertFatal (0,
"No " NBIOT_MACRLCLIST_CONFIG_STRING " configuration found");
}
}
int RCconfig_NbIoTRRC(MessageDef *msg_p, int nbiotrrc_id,eNB_RRC_INST_NB_IoT *nbiotrrc) {
char instprefix[MAX_OPTNAME_SIZE*3 + 32];
checkedparam_t NBIoTCheckParams[] = NBIOT_RRCPARAMS_CHECK_DESC;
checkedparam_t NBIoTCheckParams[] = NBIOT_RRCPARAMS_CHECK_DESC_0_14;
checkedparam_t NBIoTCheckParamsB[] = NBIOT_RRCPARAMS_CHECK_DESC_15_end;
paramdef_t NBIoTParams[] = NBIOTRRCPARAMS_DESC;
paramdef_t NBIoTPrachParams[] = NBIOTRRC_NPRACH_PARAMS_DESC;
checkedparam_t NBIoTPrachCheckParams[] = NBIOT_RRCLIST_NPRACHPARAMSCHECK_DESC;
paramdef_t NBIoTRRCRefParams[] = NBIOTRRCPARAMS_RRCREF_DESC;
paramdef_t NBIoTLteCCParams[] = NBIOT_LTECCPARAMS_DESC;
checkedparam_t NBIoTLteCCCheckParams[] = NBIOT_LTECCPARAMS_CHECK_DESC;
/* map parameter checking array instances to parameter definition array instances */
/* map parameter checking array instances to parameter definition array instances */
for (int i=0; (i<sizeof(NBIoTParams)/sizeof(paramdef_t)) && (i<sizeof(NBIoTCheckParams)/sizeof(checkedparam_t)); i++ ) {
NBIoTParams[i].chkPptr = &(NBIoTCheckParams[i]);
}
for (int i=0; (i<sizeof(NBIoTPrachParams)/sizeof(paramdef_t)) && (i<sizeof(NBIoTPrachCheckParams)/sizeof(checkedparam_t)); i++ ) {
NBIoTPrachParams[i].chkPptr = &(NBIoTPrachCheckParams[i]);
NBIoTParams[i].chkPptr = &(NBIoTCheckParams[i]);
}
/* brut force itti message fields assignment, to be redesigned with itti replacement */
for (int i=0; (i<sizeof(NBIoTParams)/sizeof(paramdef_t)) && (i<sizeof(NBIoTCheckParamsB)/sizeof(checkedparam_t)); i++ ) {
NBIoTParams[i+15].chkPptr = &(NBIoTCheckParamsB[i]);
}
for (int i=0; (i<sizeof(NBIoTPrachParams)/sizeof(paramdef_t)) && (i<sizeof(NBIoTPrachCheckParams)/sizeof(checkedparam_t)); i++ ) {
NBIoTPrachParams[i].chkPptr = &(NBIoTPrachCheckParams[i]);
}
/* brut force itti message fields assignment, to be redesigned with itti replacement */
NBIoTParams[NBIOT_RACH_RARESPONSEWINDOWSIZE_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).rach_raResponseWindowSize_NB);
NBIoTParams[NBIOT_RACH_MACCONTENTIONRESOLUTIONTIMER_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).rach_macContentionResolutionTimer_NB);
NBIoTParams[NBIOT_RACH_POWERRAMPINGSTEP_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).rach_powerRampingStep_NB);
NBIoTParams[NBIOT_RACH_POWERRAMPINGSTEP_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).rach_powerRampingStep_NB);
NBIoTParams[NBIOT_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).rach_preambleInitialReceivedTargetPower_NB);
NBIoTParams[NBIOT_RACH_PREAMBLETRANSMAX_CE_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax_CE_NB);
NBIoTParams[NBIOT_BCCH_MODIFICATIONPERIODCOEFF_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff_NB);
NBIoTParams[NBIOT_PCCH_DEFAULTPAGINGCYCLE_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle_NB);
NBIoTParams[NBIOT_NPRACH_CP_LENGTH_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_CP_Length);
NBIoTParams[NBIOT_NPRACH_RSRP_RANGE_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_rsrp_range);
NBIoTParams[NBIOT_RACH_PREAMBLETRANSMAX_CE_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax_CE_NB);
NBIoTParams[NBIOT_BCCH_MODIFICATIONPERIODCOEFF_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff_NB);
NBIoTParams[NBIOT_PCCH_DEFAULTPAGINGCYCLE_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle_NB);
NBIoTParams[NBIOT_NPRACH_CP_LENGTH_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_CP_Length);
NBIoTParams[NBIOT_NPRACH_RSRP_RANGE_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_rsrp_range);
NBIoTParams[NBIOT_MAXNUMPREAMBLEATTEMPTCE_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).maxNumPreambleAttemptCE_NB);
NBIoTParams[NBIOT_NPDSCH_NRS_POWER_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npdsch_nrs_Power);
NBIoTParams[NBIOT_NPUSCH_ACK_NACK_NUMREPETITIONS_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p). npusch_ack_nack_numRepetitions_NB);
NBIoTParams[NBIOT_NPUSCH_SRS_SUBFRAMECONFIG_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p). npusch_srs_SubframeConfig_NB);
NBIoTParams[NBIOT_NPUSCH_THREETONE_CYCLICSHIFT_R13_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npusch_threeTone_CyclicShift_r13);
NBIoTParams[NBIOT_NPDSCH_NRS_POWER_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npdsch_nrs_Power);
NBIoTParams[NBIOT_NPUSCH_ACK_NACK_NUMREPETITIONS_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p). npusch_ack_nack_numRepetitions_NB);
NBIoTParams[NBIOT_NPUSCH_SRS_SUBFRAMECONFIG_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p). npusch_srs_SubframeConfig_NB);
NBIoTParams[NBIOT_NPUSCH_THREETONE_CYCLICSHIFT_R13_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npusch_threeTone_CyclicShift_r13);
NBIoTParams[NBIOT_NPUSCH_SIXTONE_CYCLICSHIFT_R13_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npusch_sixTone_CyclicShift_r13);
NBIoTParams[NBIOT_NPUSCH_GROUPASSIGNMENTNPUSCH_R13_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npusch_groupAssignmentNPUSCH_r13);
NBIoTParams[NBIOT_DL_GAPTHRESHOLD_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).dl_GapThreshold_NB);
NBIoTParams[NBIOT_DL_GAPPERIODICITY_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).dl_GapPeriodicity_NB);
NBIoTParams[NBIOT_NPUSCH_P0_NOMINALNPUSCH_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npusch_p0_NominalNPUSCH);
NBIoTParams[NBIOT_DELTAPREAMBLEMSG3_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).deltaPreambleMsg3);
NBIoTParams[NBIOT_UE_TIMERSANDCONSTANTS_T300_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300_NB);
NBIoTParams[NBIOT_DL_GAPTHRESHOLD_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).dl_GapThreshold_NB);
NBIoTParams[NBIOT_DL_GAPPERIODICITY_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).dl_GapPeriodicity_NB);
NBIoTParams[NBIOT_NPUSCH_P0_NOMINALNPUSCH_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npusch_p0_NominalNPUSCH);
NBIoTParams[NBIOT_DELTAPREAMBLEMSG3_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).deltaPreambleMsg3);
NBIoTParams[NBIOT_UE_TIMERSANDCONSTANTS_T300_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300_NB);
NBIoTParams[NBIOT_UE_TIMERSANDCONSTANTS_T301_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301_NB);
NBIoTParams[NBIOT_UE_TIMERSANDCONSTANTS_T310_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310_NB);
NBIoTParams[NBIOT_UE_TIMERSANDCONSTANTS_T311_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311_NB);
NBIoTParams[NBIOT_UE_TIMERSANDCONSTANTS_N310_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310_NB);
NBIoTParams[NBIOT_UE_TIMERSANDCONSTANTS_T310_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310_NB);
NBIoTParams[NBIOT_UE_TIMERSANDCONSTANTS_T311_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311_NB);
NBIoTParams[NBIOT_UE_TIMERSANDCONSTANTS_N310_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310_NB);
NBIoTParams[NBIOT_UE_TIMERSANDCONSTANTS_N311_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311_NB);
sprintf(instprefix, NBIOT_RRCLIST_CONFIG_STRING ".[%i]",nbiotrrc_id);
config_get( NBIoTParams,sizeof(NBIoTParams)/sizeof(paramdef_t),instprefix);
config_get( NBIoTParams,sizeof(NBIoTParams)/sizeof(paramdef_t),instprefix);
NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_SubcarrierMSG3_RangeStart = config_get_processedint( &(NBIoTParams[NBIOT_NPRACH_SUBCARRIERMSG3_RANGESTART_IDX]) );
NBIOTRRC_CONFIGURATION_REQ (msg_p).npusch_groupHoppingEnabled = config_get_processedint( &(NBIoTParams[NBIOT_NPUSCH_GROUPHOPPINGENABLED_IDX] ) );
NBIOTRRC_CONFIGURATION_REQ (msg_p).dl_GapDurationCoeff_NB = config_get_processedint( &(NBIoTParams[NBIOT_DL_GAPDURATIONCOEFF_NB_IDX] ) );
NBIOTRRC_CONFIGURATION_REQ (msg_p).npusch_groupHoppingEnabled = config_get_processedint( &(NBIoTParams[NBIOT_NPUSCH_GROUPHOPPINGENABLED_IDX] ) );
NBIOTRRC_CONFIGURATION_REQ (msg_p).dl_GapDurationCoeff_NB = config_get_processedint( &(NBIoTParams[NBIOT_DL_GAPDURATIONCOEFF_NB_IDX] ) );
NBIOTRRC_CONFIGURATION_REQ (msg_p).npusch_alpha = config_get_processedint( &(NBIoTParams[NBIOT_NPUSCH_ALPHA_IDX] ) );
for (int i=0; i<MAX_NUM_NBIOT_CELEVELS; i++) {
char *tmpptr=NULL;
NBIoTPrachParams[NBIOT_NPRACH_PERIODICITY_IDX ].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_Periodicity[i]);
NBIoTPrachParams[NBIOT_NPRACH_STARTTIME_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_StartTime[i]);
NBIoTPrachParams[NBIOT_NPRACH_SUBCARRIEROFFSET_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_SubcarrierOffset[i]);
NBIoTPrachParams[NBIOT_NPRACH_NUMSUBCARRIERS_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_NumSubcarriers[i]);
NBIoTPrachParams[NBIOT_NUMREPETITIONSPERPREAMBLEATTEMPT_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).numRepetitionsPerPreambleAttempt_NB[i]);
NBIoTParams[NBIOT_NPDCCH_NUMREPETITIONS_RA_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npdcch_NumRepetitions_RA[i]);
NBIoTParams[NBIOT_NPDCCH_STARTSF_CSS_RA_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npdcch_StartSF_CSS_RA[i]);
NBIoTParams[NBIOT_NPDCCH_OFFSET_RA_IDX].strptr = &tmpptr;
sprintf(instprefix, "%s.[%i].%s.[%i]",NBIOT_RRCLIST_CONFIG_STRING, nbiotrrc_id,NBIOT_RRCLIST_NPRACHPARAMS_CONFIG_STRING,i);
config_get( NBIoTPrachParams,sizeof(NBIoTPrachParams)/sizeof(paramdef_t),instprefix);
NBIOTRRC_CONFIGURATION_REQ (msg_p).npdcch_Offset_RA[i] = config_get_processedint( &(NBIoTPrachParams[NBIOT_NPDCCH_OFFSET_RA_IDX]) );
char *tmpptr=NULL;
NBIoTPrachParams[NBIOT_NPRACH_PERIODICITY_IDX ].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_Periodicity[i]);
NBIoTPrachParams[NBIOT_NPRACH_STARTTIME_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_StartTime[i]);
NBIoTPrachParams[NBIOT_NPRACH_SUBCARRIEROFFSET_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_SubcarrierOffset[i]);
NBIoTPrachParams[NBIOT_NPRACH_NUMSUBCARRIERS_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).nprach_NumSubcarriers[i]);
NBIoTPrachParams[NBIOT_NUMREPETITIONSPERPREAMBLEATTEMPT_NB_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).numRepetitionsPerPreambleAttempt_NB[i]);
NBIoTParams[NBIOT_NPDCCH_NUMREPETITIONS_RA_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npdcch_NumRepetitions_RA[i]);
NBIoTParams[NBIOT_NPDCCH_STARTSF_CSS_RA_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).npdcch_StartSF_CSS_RA[i]);
NBIoTParams[NBIOT_NPDCCH_OFFSET_RA_IDX].strptr = &tmpptr;
sprintf(instprefix, "%s.[%i].%s.[%i]",NBIOT_RRCLIST_CONFIG_STRING, nbiotrrc_id,NBIOT_RRCLIST_NPRACHPARAMS_CONFIG_STRING,i);
config_get( NBIoTPrachParams,sizeof(NBIoTPrachParams)/sizeof(paramdef_t),instprefix);
NBIOTRRC_CONFIGURATION_REQ (msg_p).npdcch_Offset_RA[i] = config_get_processedint( &(NBIoTPrachParams[NBIOT_NPDCCH_OFFSET_RA_IDX]) );
}
/* get the LTE RRC and CC this NB-IoT RRC instance is attached to */
/* get the LTE RRC and CC this NB-IoT RRC instance is attached to */
sprintf(instprefix, NBIOT_RRCLIST_CONFIG_STRING ".[%i]." NBIOT_LTERRCREF_CONFIG_STRING, nbiotrrc_id );
config_get( NBIoTRRCRefParams,sizeof(NBIoTRRCRefParams)/sizeof(paramdef_t),instprefix);
/* read SIB1 parameters in the LTE RRC and CC sections */
config_get( NBIoTRRCRefParams,sizeof(NBIoTRRCRefParams)/sizeof(paramdef_t),instprefix);
/* read SIB1 parameters in the LTE RRC and CC sections */
sprintf(instprefix, ENB_CONFIG_STRING_ENB_LIST ".[%i]." ENB_CONFIG_STRING_COMPONENT_CARRIERS ".[%i]",
*(NBIoTRRCRefParams[NBIOT_RRCINST_IDX].uptr), *(NBIoTRRCRefParams[NBIOT_CCINST_IDX].uptr));
NBIoTLteCCParams[LTECCPARAMS_TDD_CONFIG_IDX ].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).tdd_config);
NBIoTLteCCParams[LTECCPARAMS_TDD_CONFIG_S_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).tdd_config_s);
NBIoTLteCCParams[LTECCPARAMS_EUTRA_BAND_IDX ].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).eutra_band);
NBIoTLteCCParams[LTECCPARAMS_DOWNLINK_FREQUENCY_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).downlink_frequency);
*(NBIoTRRCRefParams[NBIOT_RRCINST_IDX].uptr), *(NBIoTRRCRefParams[NBIOT_CCINST_IDX].uptr));
NBIoTLteCCParams[LTECCPARAMS_TDD_CONFIG_IDX ].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).tdd_config);
NBIoTLteCCParams[LTECCPARAMS_TDD_CONFIG_S_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).tdd_config_s);
NBIoTLteCCParams[LTECCPARAMS_EUTRA_BAND_IDX ].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).eutra_band);
NBIoTLteCCParams[LTECCPARAMS_DOWNLINK_FREQUENCY_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).downlink_frequency);
NBIoTLteCCParams[LTECCPARAMS_UPLINK_FREQUENCY_OFFSET_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset);
NBIoTLteCCParams[LTECCPARAMS_NID_CELL_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).Nid_cell);
NBIoTLteCCParams[LTECCPARAMS_N_RB_DL_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).N_RB_DL);
NBIoTLteCCParams[LTECCPARAMS_NID_CELL_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).Nid_cell);
NBIoTLteCCParams[LTECCPARAMS_N_RB_DL_IDX].uptr = (uint32_t *)&(NBIOTRRC_CONFIGURATION_REQ (msg_p).N_RB_DL);
for (int i=0; (i<sizeof(NBIoTLteCCParams)/sizeof(paramdef_t)) && (i<sizeof(NBIoTLteCCCheckParams)/sizeof(checkedparam_t)); i++ ) {
NBIoTLteCCParams[i].chkPptr = &(NBIoTLteCCCheckParams[i]);
NBIoTLteCCParams[i].chkPptr = &(NBIoTLteCCCheckParams[i]);
}
config_get( NBIoTLteCCParams,sizeof(NBIoTLteCCParams)/sizeof(paramdef_t),instprefix);
NBIOTRRC_CONFIGURATION_REQ (msg_p).frame_type = config_get_processedint( &(NBIoTLteCCParams[LTECCPARAMS_FRAME_TYPE_IDX]) );
config_get( NBIoTLteCCParams,sizeof(NBIoTLteCCParams)/sizeof(paramdef_t),instprefix);
NBIOTRRC_CONFIGURATION_REQ (msg_p).frame_type = config_get_processedint( &(NBIoTLteCCParams[LTECCPARAMS_FRAME_TYPE_IDX]) );
NBIOTRRC_CONFIGURATION_REQ (msg_p).prefix_type = config_get_processedint( &(NBIoTLteCCParams[LTECCPARAMS_PREFIX_TYPE_IDX]) );
NBIOTRRC_CONFIGURATION_REQ (msg_p).prefix_type = config_get_processedint( &(NBIoTLteCCParams[LTECCPARAMS_PREFIX_TYPE_UL_IDX]) );
return 0;
return 0;
}
void RCConfig_NbIoT(RAN_CONTEXT_t *RC) {
paramlist_def_t NbIoT_MACRLCParamList = {NBIOT_MACRLCLIST_CONFIG_STRING,NULL,0};
paramlist_def_t NbIoT_L1ParamList = {NBIOT_L1LIST_CONFIG_STRING,NULL,0};
paramlist_def_t NbIoT_ParamList = {NBIOT_RRCLIST_CONFIG_STRING,NULL,0};
config_getlist( &NbIoT_ParamList,NULL,0,NULL);
RC->nb_nb_iot_rrc_inst = NbIoT_ParamList.numelt;
config_getlist( &NbIoT_MACRLCParamList,NULL,0, NULL);
RC->nb_nb_iot_macrlc_inst = NbIoT_MACRLCParamList.numelt;
// Get num L1 instances
config_getlist( &NbIoT_L1ParamList,NULL,0, NULL);
RC->nb_nb_iot_L1_inst = NbIoT_L1ParamList.numelt;
config_getlist( &NbIoT_MACRLCParamList,NULL,0, NULL);
RC->nb_nb_iot_macrlc_inst = NbIoT_MACRLCParamList.numelt;
// Get num L1 instances
config_getlist( &NbIoT_L1ParamList,NULL,0, NULL);
RC->nb_nb_iot_L1_inst = NbIoT_L1ParamList.numelt;
}
+8 -17
View File
@@ -24,7 +24,7 @@
-------------------
AUTHOR : Francois TABURET
COMPANY : NOKIA BellLabs France
EMAIL : francois.taburet@nokia-bell-labs.com
EMAIL : francois.taburet@nokia-bell-labs.com
*/
@@ -33,18 +33,14 @@
#include "common/utils/LOG/log.h"
#include "assertions.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# endif
#endif
#include "SystemInformationBlockType2.h"
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#include "LTE_SystemInformationBlockType2.h"
#include "common/config/config_userapi.h"
#include "RRC_config_tools.h"
#include "DL-GapConfig-NB-r13.h"
#include "NPRACH-Parameters-NB-r13.h"
#include "LTE_DL-GapConfig-NB-r13.h"
#include "LTE_NPRACH-Parameters-NB-r13.h"
static const eutra_band_t eutra_bands[] = {
{ 1, 1920 * MHz, 1980 * MHz, 2110 * MHz, 2170 * MHz, FDD},
@@ -84,8 +80,7 @@ int config_check_band_frequencies( int ind,
int16_t band,
uint32_t downlink_frequency,
int32_t uplink_frequency_offset,
uint32_t frame_type)
{
uint32_t frame_type) {
int errors = 0;
if (band > 0) {
@@ -94,21 +89,18 @@ int config_check_band_frequencies( int ind,
for (band_index = 0; band_index < sizeof (eutra_bands) / sizeof (eutra_bands[0]); band_index++) {
if (band == eutra_bands[band_index].band) {
uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset;
AssertError (eutra_bands[band_index].dl_min < downlink_frequency, errors ++,
"enb %d downlink frequency %u too low (%u) for band %d!",
ind, downlink_frequency, eutra_bands[band_index].dl_min, band);
AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++,
"enb %d downlink frequency %u too high (%u) for band %d!",
ind, downlink_frequency, eutra_bands[band_index].dl_max, band);
AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++,
"enb %d uplink frequency %u too low (%u) for band %d!",
ind, uplink_frequency, eutra_bands[band_index].ul_min, band);
AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++,
"enb %d uplink frequency %u too high (%u) for band %d!",
ind, uplink_frequency, eutra_bands[band_index].ul_max, band);
AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++,
"enb %d invalid frame type (%d/%d) for band %d!",
ind, eutra_bands[band_index].frame_type, frame_type, band);
@@ -116,7 +108,6 @@ int config_check_band_frequencies( int ind,
}
}
return errors;
}
+1 -1
View File
@@ -30,7 +30,7 @@
#define RRC_CONFIG_TOOLS_H_
#define KHz (1000UL)
#define MHz (1000 * KHz)
#define MHz (1000*KHz)
typedef struct eutra_band_s {
int16_t band;
+10 -8
View File
@@ -35,6 +35,8 @@
#define ENB_CONFIG_STRING_ENB_LIST "eNBs"
/* component carriers configuration section name */
#define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers"
#define ENB_CONFIG_STRING_COMPONENT_BR_PARAMETERS "br_parameters"
#define ENB_CONFIG_STRING_FRAME_TYPE "frame_type"
#define ENB_CONFIG_STRING_PBCH_REPETITION "pbch_repetition"
@@ -68,27 +70,27 @@
#define NRBDL_OKVALUES {6,15,25,50,75,100}
#define UETIMER_T300_OKVALUES {100,200,300,400,600,1000,1500,2000}
#define UETT300(A) UE_TimersAndConstants__t300_ ## A
#define UETT300(A) LTE_UE_TimersAndConstants__t300_ ## A
#define UETIMER_T300_MODVALUES { UETT300(ms100), UETT300(ms200),UETT300(ms300),UETT300(ms400),UETT300(ms600),UETT300(ms1000),UETT300(ms1500),UETT300(ms2000)}
#define UETIMER_T301_OKVALUES {100,200,300,400,600,1000,1500,2000}
#define UETT301(A) UE_TimersAndConstants__t301_ ## A
#define UETT301(A) LTE_UE_TimersAndConstants__t301_ ## A
#define UETIMER_T301_MODVALUES { UETT301(ms100), UETT301(ms200),UETT301(ms300),UETT301(ms400),UETT301(ms600),UETT301(ms1000),UETT301(ms1500),UETT301(ms2000)}
#define UETIMER_T310_OKVALUES {0,50,100,200,500,1000,2000}
#define UETT310(A) UE_TimersAndConstants__t310_ ## A
#define UETT310(A) LTE_UE_TimersAndConstants__t310_ ## A
#define UETIMER_T310_MODVALUES { UETT310(ms0), UETT310(ms50),UETT310(ms100),UETT310(ms200),UETT310(ms500),UETT310(ms1000),UETT310(ms2000)}
#define UETIMER_T311_OKVALUES {1000,3110,5000,10000,15000,20000,31100}
#define UETT311(A) UE_TimersAndConstants__t311_ ## A
#define UETIMER_T311_MODVALUES { UETT311(ms1000), UETT311(ms3000),UETT311(ms5000),UETT311(ms10000),UETT311(ms15000),UETT311(ms20000),UETT311(ms30000)}
#define UETIMER_T311_OKVALUES {1000,3000,5000,10000,15000,20000,30000}
#define UETT311(A) LTE_UE_TimersAndConstants__t311_ ## A
#define UETIMER_T311_MODVALUES { UETT311(ms1000), UETT311(ms3000), UETT311(ms5000), UETT311(ms10000), UETT311(ms15000), UETT311(ms20000), UETT311(ms30000)}
#define UETIMER_N310_OKVALUES {1,2,3,4,6,8,10,20}
#define UETN310(A) UE_TimersAndConstants__n310_ ## A
#define UETN310(A) LTE_UE_TimersAndConstants__n310_ ## A
#define UETIMER_N310_MODVALUES { UETN310(n1), UETN310(n2),UETN310(n3),UETN310(n4),UETN310(n6),UETN310(n8),UETN310(n10),UETN310(n20)}
#define UETIMER_N311_OKVALUES {1,2,3,4,5,6,8,10}
#define UETN311(A) UE_TimersAndConstants__n311_ ## A
#define UETN311(A) LTE_UE_TimersAndConstants__n311_ ## A
#define UETIMER_N311_MODVALUES { UETN311(n1), UETN311(n2),UETN311(n3),UETN311(n4),UETN311(n5),UETN311(n6),UETN311(n8),UETN311(n10)}
#endif
+121 -170
View File
@@ -34,18 +34,15 @@
#include "enb_config.h"
#include "assertions.h"
#include "common/ran_context.h"
#include "targets/RT/USER/lte-softmodem.h"
#include "common/utils/LOG/log.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
# else
# define EPC_MODE_ENABLED 0
# endif
# include "flexran_agent.h"
# include "x2ap_eNB.h"
# include "x2ap_messages_types.h"
@@ -53,85 +50,44 @@
#include "openair1/PHY/INIT/phy_init.h"
extern unsigned char NB_eNB_INST;
#endif
#include <nr-softmodem.h>
extern RAN_CONTEXT_t RC;
#if defined(ENABLE_ITTI)
/*------------------------------------------------------------------------------*/
# if defined(ENABLE_USE_MME)
# define ENB_REGISTER_RETRY_DELAY 10
# endif
#include "targets/RT/USER/lte-softmodem.h"
/*------------------------------------------------------------------------------*/
/*
static void configure_phy(module_id_t enb_id, const Enb_properties_array_t* enb_properties)
{
MessageDef *msg_p;
int CC_id;
msg_p = itti_alloc_new_message (TASK_ENB_APP, PHY_CONFIGURATION_REQ);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
PHY_CONFIGURATION_REQ (msg_p).frame_type[CC_id] = enb_properties->properties[enb_id]->frame_type[CC_id];
PHY_CONFIGURATION_REQ (msg_p).prefix_type[CC_id] = enb_properties->properties[enb_id]->prefix_type[CC_id];
PHY_CONFIGURATION_REQ (msg_p).downlink_frequency[CC_id] = enb_properties->properties[enb_id]->downlink_frequency[CC_id];
PHY_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[CC_id] = enb_properties->properties[enb_id]->uplink_frequency_offset[CC_id];
PHY_CONFIGURATION_REQ (msg_p).nb_antennas_tx[CC_id] = enb_properties->properties[enb_id]->nb_antennas_tx[CC_id];
PHY_CONFIGURATION_REQ (msg_p).nb_antennas_rx[CC_id] = enb_properties->properties[enb_id]->nb_antennas_rx[CC_id];
PHY_CONFIGURATION_REQ (msg_p).tx_gain[CC_id] = enb_properties->properties[enb_id]->tx_gain[CC_id];
PHY_CONFIGURATION_REQ (msg_p).rx_gain[CC_id] = enb_properties->properties[enb_id]->rx_gain[CC_id];
}
itti_send_msg_to_task (TASK_PHY_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
}
*/
/*------------------------------------------------------------------------------*/
static void configure_rrc(uint32_t enb_id)
{
MessageDef *msg_p = NULL;
// int CC_id;
msg_p = itti_alloc_new_message (TASK_ENB_APP, RRC_CONFIGURATION_REQ);
if (RC.rrc[enb_id]) {
RCconfig_RRC(msg_p,enb_id, RC.rrc[enb_id]);
LOG_I(ENB_APP,"Sending configuration message to RRC task\n");
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
}
else AssertFatal(0,"RRC context for eNB %d not allocated\n",enb_id);
}
/*------------------------------------------------------------------------------*/
# if defined(ENABLE_USE_MME)
static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//, const Enb_properties_array_t *enb_properties)
{
static uint32_t eNB_app_register(ngran_node_t node_type,uint32_t enb_id_start, uint32_t enb_id_end) {
uint32_t enb_id;
MessageDef *msg_p;
uint32_t register_enb_pending = 0;
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
{
/* note: there is an implicit relationship between the data structure and the message name */
msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ);
if (NODE_IS_DU(node_type)) { // F1AP registration
// configure F1AP here for F1C
LOG_I(ENB_APP,"ngran_eNB_DU: Allocating ITTI message for F1AP_SETUP_REQ\n");
msg_p = itti_alloc_new_message (TASK_ENB_APP, F1AP_SETUP_REQ);
RCconfig_DU_F1(msg_p, enb_id);
RCconfig_S1(msg_p, enb_id);
LOG_I(ENB_APP,"[eNB %d] eNB_app_register via F1AP for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
itti_send_msg_to_task (TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
// configure GTPu here for F1U
}
else { // S1AP registration
/* note: there is an implicit relationship between the data structure and the message name */
msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ);
RCconfig_S1(msg_p, enb_id);
if (enb_id == 0) RCconfig_gtpu();
if (enb_id == 0) RCconfig_gtpu();
LOG_I(ENB_APP,"default drx %d\n",((S1AP_REGISTER_ENB_REQ(msg_p)).default_drx));
LOG_I(ENB_APP,"default drx %d\n",((S1AP_REGISTER_ENB_REQ(msg_p)).default_drx));
LOG_I(ENB_APP,"[eNB %d] eNB_app_register for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
LOG_I(ENB_APP,"[eNB %d] eNB_app_register via S1AP for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
}
register_enb_pending++;
}
@@ -139,26 +95,19 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//,
return register_enb_pending;
}
# endif
#endif
/*------------------------------------------------------------------------------*/
static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end)
{
static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end) {
uint32_t enb_id;
MessageDef *msg_p;
uint32_t register_enb_x2_pending = 0;
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
{
msg_p = itti_alloc_new_message (TASK_ENB_APP, X2AP_REGISTER_ENB_REQ);
RCconfig_X2(msg_p, enb_id);
itti_send_msg_to_task (TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
register_enb_x2_pending++;
}
}
@@ -167,73 +116,37 @@ static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end)
}
/*------------------------------------------------------------------------------*/
void *eNB_app_task(void *args_p)
{
#if defined(ENABLE_ITTI)
void *eNB_app_task(void *args_p) {
uint32_t enb_nb = RC.nb_inst;
uint32_t enb_id_start = 0;
uint32_t enb_id_end = enb_id_start + enb_nb;
# if defined(ENABLE_USE_MME)
uint32_t register_enb_pending=0;
uint32_t registered_enb;
uint32_t registered_enb=0;
long enb_register_retry_timer_id;
# endif
uint32_t x2_register_enb_pending;
uint32_t x2_registered_enb;
uint32_t x2_register_enb_pending = 0;
uint32_t x2_registered_enb = 0;
long x2_enb_register_retry_timer_id;
uint32_t enb_id;
MessageDef *msg_p = NULL;
instance_t instance;
int result;
/* for no gcc warnings */
(void)instance;
itti_mark_task_ready (TASK_ENB_APP);
LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__);
RCconfig_L1();
RCconfig_macrlc();
LOG_I(PHY, "%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst);
if (RC.nb_L1_inst>0) AssertFatal(l1_north_init_eNB()==0,"could not initialize L1 north interface\n");
AssertFatal (enb_nb <= RC.nb_inst,
"Number of eNB is greater than eNB defined in configuration file (%d/%d)!",
enb_nb, RC.nb_inst);
LOG_I(ENB_APP,"Allocating eNB_RRC_INST for %d instances\n",RC.nb_inst);
RC.rrc = (eNB_RRC_INST **)malloc(RC.nb_inst*sizeof(eNB_RRC_INST *));
LOG_I(PHY, "%s() RC.nb_inst:%d RC.rrc:%p\n", __FUNCTION__, RC.nb_inst, RC.rrc);
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
RC.rrc[enb_id] = (eNB_RRC_INST*)malloc(sizeof(eNB_RRC_INST));
LOG_I(PHY, "%s() Creating RRC instance RC.rrc[%d]:%p (%d of %d)\n", __FUNCTION__, enb_id, RC.rrc[enb_id], enb_id+1, enb_id_end);
memset((void *)RC.rrc[enb_id],0,sizeof(eNB_RRC_INST));
configure_rrc(enb_id);
/* Try to register each eNB */
// This assumes that node_type of all RRC instances is the same
if (EPC_MODE_ENABLED) {
register_enb_pending = eNB_app_register(RC.rrc[0]->node_type, enb_id_start, enb_id_end);
}
# if defined(ENABLE_USE_MME)
/* Try to register each eNB */
registered_enb = 0;
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
#else
/* Start L2L1 task */
msg_p = itti_alloc_new_message(TASK_ENB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task(TASK_L2L1, INSTANCE_DEFAULT, msg_p);
#endif
/* Try to register each eNB with each other */
x2_registered_enb = 0;
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
/* Try to register each eNB with each other */
if (is_x2ap_enabled() && !NODE_IS_DU(RC.rrc[0]->node_type)) {
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
}
do {
// Wait for a message
itti_receive_msg (TASK_ENB_APP, &msg_p);
instance = ITTI_MSG_INSTANCE (msg_p);
switch (ITTI_MSG_ID(msg_p)) {
@@ -251,63 +164,105 @@ void *eNB_app_task(void *args_p)
break;
case S1AP_REGISTER_ENB_CNF:
# if defined(ENABLE_USE_MME)
LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
AssertFatal(!NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received S1AP_REGISTER_ENB_CNF\n");
if (EPC_MODE_ENABLED) {
LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
DevAssert(register_enb_pending > 0);
register_enb_pending--;
DevAssert(register_enb_pending > 0);
register_enb_pending--;
/* Check if at least eNB is registered with one MME */
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
registered_enb++;
}
/* Check if at least eNB is registered with one MME */
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
registered_enb++;
}
/* Check if all register eNB requests have been processed */
if (register_enb_pending == 0) {
if (registered_enb == enb_nb) {
/* If all eNB are registered, start L2L1 task */
MessageDef *msg_init_p;
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
} else {
LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n",
enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY);
/* Check if all register eNB requests have been processed */
if (register_enb_pending == 0) {
if (registered_enb == enb_nb) {
/* If all eNB are registered, start L2L1 task */
MessageDef *msg_init_p;
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
NULL, &enb_register_retry_timer_id) < 0) {
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
sleep(ENB_REGISTER_RETRY_DELAY);
/* Restart the registration process */
registered_enb = 0;
register_enb_pending = eNB_app_register (RC.rrc[0]->node_type,enb_id_start, enb_id_end);
}
}
}
} /* if (EPC_MODE_ENABLED) */
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
break;
} else {
LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n",
enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY);
case F1AP_SETUP_RESP:
AssertFatal(NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received F1AP_REGISTER_ENB_CNF in CU/eNB\n");
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
NULL, &enb_register_retry_timer_id) < 0) {
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
LOG_I(ENB_APP, "Received %s: associated ngran_eNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate);
handle_f1ap_setup_resp(&F1AP_SETUP_RESP(msg_p));
DevAssert(register_enb_pending > 0);
register_enb_pending--;
/* Check if at least eNB is registered with one MME */
if (F1AP_SETUP_RESP(msg_p).num_cells_to_activate > 0) {
registered_enb++;
}
/* Check if all register eNB requests have been processed */
if (register_enb_pending == 0) {
if (registered_enb == enb_nb) {
/* If all eNB cells are registered, start L2L1 task */
MessageDef *msg_init_p;
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
} else {
LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n",
enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY);
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
NULL, &enb_register_retry_timer_id) < 0) {
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
sleep(ENB_REGISTER_RETRY_DELAY);
/* Restart the registration process */
registered_enb = 0;
register_enb_pending = eNB_app_register (RC.rrc[0]->node_type,enb_id_start, enb_id_end);//, enb_properties_p);
}
}
}
sleep(ENB_REGISTER_RETRY_DELAY);
/* Restart the registration process */
registered_enb = 0;
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
}
}
}
#endif
break;
case S1AP_DEREGISTERED_ENB_IND:
if (EPC_MODE_ENABLED) {
LOG_W(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme);
/* TODO handle recovering of registration */
}
break;
case TIMER_HAS_EXPIRED:
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
LOG_I(ENB_APP, " Received %s: timer_id %ld\n", ITTI_MSG_NAME (msg_p), TIMER_HAS_EXPIRED(msg_p).timer_id);
if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
/* Restart the registration process */
registered_enb = 0;
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
register_enb_pending = eNB_app_register (RC.rrc[0]->node_type, enb_id_start, enb_id_end);
}
if (TIMER_HAS_EXPIRED (msg_p).timer_id == x2_enb_register_retry_timer_id) {
@@ -315,20 +270,19 @@ void *eNB_app_task(void *args_p)
x2_registered_enb = 0;
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
}
# endif
} /* if (EPC_MODE_ENABLED) */
break;
case X2AP_DEREGISTERED_ENB_IND:
LOG_W(ENB_APP, "[eNB %d] Received %s: associated eNB %d\n", instance, ITTI_MSG_NAME (msg_p),
X2AP_DEREGISTERED_ENB_IND(msg_p).nb_x2);
/* TODO handle recovering of registration */
break;
case X2AP_REGISTER_ENB_CNF:
LOG_I(ENB_APP, "[eNB %d] Received %s: associated eNB %d\n", instance, ITTI_MSG_NAME (msg_p),
X2AP_REGISTER_ENB_CNF(msg_p).nb_x2);
DevAssert(x2_register_enb_pending > 0);
x2_register_enb_pending--;
@@ -341,19 +295,17 @@ void *eNB_app_task(void *args_p)
if (x2_register_enb_pending == 0) {
if (x2_registered_enb == enb_nb) {
/* If all eNB are registered, start RRC HO task */
}else {
} else {
uint32_t x2_not_associated = enb_nb - x2_registered_enb;
LOG_W(ENB_APP, " %d eNB %s not associated with the target\n",
x2_not_associated, x2_not_associated > 1 ? "are" : "is");
// timer to retry
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
if (timer_setup (X2AP_ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP,
INSTANCE_DEFAULT, TIMER_ONE_SHOT, NULL,
&x2_enb_register_retry_timer_id) < 0) {
LOG_E(ENB_APP, " Can not start eNB X2AP register: retry timer, use \"sleep\" instead!\n");
sleep(X2AP_ENB_REGISTER_RETRY_DELAY);
/* Restart the registration process */
x2_registered_enb = 0;
@@ -373,18 +325,13 @@ void *eNB_app_task(void *args_p)
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} while (1);
#endif
return NULL;
}
void handle_reconfiguration(module_id_t mod_id)
{
void handle_reconfiguration(module_id_t mod_id) {
struct timespec start, end;
clock_gettime(CLOCK_MONOTONIC, &start);
flexran_agent_info_t *flexran = RC.flexran[mod_id];
LOG_I(ENB_APP, "lte-softmodem soft-restart requested\n");
if (ENB_WAIT == flexran->node_ctrl_state) {
@@ -407,8 +354,10 @@ void handle_reconfiguration(module_id_t mod_id)
LOG_I(ENB_APP, " * eNB %d: Waiting for FlexRAN RTController command *\n", mod_id);
pthread_mutex_lock(&flexran->mutex_node_ctrl);
flexran->node_ctrl_state = ENB_WAIT;
while (ENB_NORMAL_OPERATION != flexran->node_ctrl_state)
pthread_cond_wait(&flexran->cond_node_ctrl, &flexran->mutex_node_ctrl);
pthread_mutex_unlock(&flexran->mutex_node_ctrl);
}
@@ -420,11 +369,13 @@ void handle_reconfiguration(module_id_t mod_id)
clock_gettime(CLOCK_MONOTONIC, &end);
end.tv_sec -= start.tv_sec;
if (end.tv_nsec >= start.tv_nsec) {
end.tv_nsec -= start.tv_nsec;
} else {
end.tv_sec -= 1;
end.tv_nsec = end.tv_nsec - start.tv_nsec + 1000000000;
}
LOG_I(ENB_APP, "lte-softmodem restart succeeded in %ld.%ld s\n", end.tv_sec, end.tv_nsec / 1000000);
}
+2091 -1695
View File
File diff suppressed because it is too large Load Diff
+23 -7
View File
@@ -39,14 +39,12 @@
#include "platform_constants.h"
#include "PHY/defs_eNB.h"
#include "s1ap_messages_types.h"
#ifdef CMAKER
#include "SystemInformationBlockType2.h"
#include "f1ap_messages_types.h"
#include "LTE_SystemInformationBlockType2.h"
#include "rrc_messages_types.h"
#else
#include "RRC/LTE/MESSAGES/SystemInformationBlockType2.h"
#endif
#include "RRC/LTE/rrc_defs.h"
#include <intertask_interface.h>
#include "enb_paramdef.h"
#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
struct in_addr inp;\
@@ -65,6 +63,9 @@
// Hard to find a defined value for max enb...
#define MAX_ENB 16
#define MAX_DU 4
#define CU_BALANCING_ALL 127
#define CU_BALANCING_ROUND_ROBIN 126
typedef struct mme_ip_address_s {
unsigned ipv4:1;
@@ -74,6 +75,13 @@ typedef struct mme_ip_address_s {
char *ipv6_address;
} mme_ip_address_t;
typedef struct cu_params {
const char *local_ipv4_address;
const uint16_t local_port;
const char *remote_ipv4_address;
const int16_t remote_port;
} cudu_params_t;
typedef struct ru_config_s {
// indicates if local or remote rf is used (1 == LOCAL)
unsigned local_rf:1;
@@ -95,7 +103,7 @@ typedef struct ru_config_s {
extern void RCconfig_RU(void);
extern void RCconfig_flexran(void);
extern void RCconfig_L1(void);
extern void RCconfig_macrlc(void);
extern void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]);
extern void UE_config_stub_pnf(void);
extern int RCconfig_gtpu(void );
extern void RCConfig(void);
@@ -103,9 +111,17 @@ extern void RCConfig(void);
void enb_config_display(void);
void ru_config_display(void);
int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc);
int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1);
int RCconfig_S1(MessageDef *msg_p, uint32_t i);
void read_config_and_init(void);
int RCconfig_X2(MessageDef *msg_p, uint32_t i);
void fill_SL_configuration(MessageDef *msg_p, ccparams_sidelink_t *SLconfig,int cell_idx,int cc_idx,char *config_fname);
void fill_eMTC_configuration(MessageDef *msg_p, ccparams_eMTC_t *eMTCconfig, int cell_idx,int cc_idx,char *config_fname,char *brparamspath);
int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i);
void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp);
#endif /* ENB_CONFIG_H_ */
/** @} */
+293
View File
@@ -0,0 +1,293 @@
/*
* 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
*/
/*
enb_config_SL.c
-------------------
AUTHOR : T.T.Nguyen / R. Knopp
COMPANY : EURECOM
EMAIL : raymond.knopp@eurecom.fr
*/
#include <string.h>
#include <inttypes.h>
#include "common/utils/LOG/log.h"
#include "assertions.h"
#include "enb_config.h"
#include "intertask_interface.h"
#include "LTE_SystemInformationBlockType2.h"
#include "common/config/config_userapi.h"
#include "RRC_config_tools.h"
#include "enb_paramdef.h"
#include "enb_paramdef_sidelink.h"
void fill_SL_configuration(MessageDef *msg_p, ccparams_sidelink_t *SLconfig,int cell_idx,int cc_idx,char *config_fname) {
printf("Configuring SL\n");
//SIB18
if (strcmp(SLconfig->rxPool_sc_CP_Len,"normal")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
} else if (strcmp(SLconfig->rxPool_sc_CP_Len,"extended")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rxPool_sc_CP_Len choice: normal,extended!\n",
config_fname, cell_idx, SLconfig->rxPool_sc_CP_Len);
if (strcmp(SLconfig->rxPool_sc_Period,"sf40")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf40;
} else if (strcmp(SLconfig->rxPool_sc_Period,"sf60")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf60;
} else if (strcmp(SLconfig->rxPool_sc_Period,"sf70")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf70;
} else if (strcmp(SLconfig->rxPool_sc_Period,"sf80")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf80;
} else if (strcmp(SLconfig->rxPool_sc_Period,"sf120")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf120;
} else if (strcmp(SLconfig->rxPool_sc_Period,"sf140")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf140;
} else if (strcmp(SLconfig->rxPool_sc_Period,"sf160")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf160;
} else if (strcmp(SLconfig->rxPool_sc_Period,"sf240")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf240;
} else if (strcmp(SLconfig->rxPool_sc_Period,"sf280")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf280;
} else if (strcmp(SLconfig->rxPool_sc_Period,"sf320")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf320;
} else if (strcmp(SLconfig->rxPool_sc_Period,"spare6")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare6;
} else if (strcmp(SLconfig->rxPool_sc_Period,"spare5")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare5;
} else if (strcmp(SLconfig->rxPool_sc_Period,"spare4")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare4;
} else if (strcmp(SLconfig->rxPool_sc_Period,"spare3")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare3;
} else if (strcmp(SLconfig->rxPool_sc_Period,"spare2")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare2;
} else if (strcmp(SLconfig->rxPool_sc_Period,"spare")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rxPool_sc_Period choice: sf40,sf60,sf70,sf80,sf120,sf140,sf160,sf240,sf280,sf320,spare6,spare5,spare4,spare3,spare2,spare!\n",
config_fname, cell_idx, SLconfig->rxPool_sc_Period);
if (strcmp(SLconfig->rxPool_data_CP_Len,"normal")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_data_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
} else if (strcmp(SLconfig->rxPool_data_CP_Len,"extended")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_data_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rxPool_data_CP_Len choice: normal,extended!\n",
config_fname, cell_idx, SLconfig->rxPool_data_CP_Len);
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_prb_Num[cc_idx] = SLconfig->rxPool_ResourceConfig_prb_Num;
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_prb_Start[cc_idx] = SLconfig->rxPool_ResourceConfig_prb_Start;
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_prb_End[cc_idx] = SLconfig->rxPool_ResourceConfig_prb_End;
if (strcmp(SLconfig->rxPool_ResourceConfig_offsetIndicator_present,"prNothing")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_NOTHING;
} else if (strcmp(SLconfig->rxPool_ResourceConfig_offsetIndicator_present,"prSmall")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_small_r12;
} else if (strcmp(SLconfig->rxPool_ResourceConfig_offsetIndicator_present,"prLarge")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_large_r12;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rxPool_ResourceConfig_offsetIndicator_present choice: prNothing,prSmal,prLarge!\n",
config_fname, cell_idx, SLconfig->rxPool_ResourceConfig_offsetIndicator_present);
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_offsetIndicator_choice[cc_idx] = SLconfig->rxPool_ResourceConfig_offsetIndicator_choice;
if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prNothing")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_NOTHING;
} else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs4")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs4_r12;
} else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs8")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs8_r12;
} else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs12")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs12_r12;
} else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs16")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs16_r12;
} else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs30")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs30_r12;
} else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs40")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs40_r12;
} else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs42")==0) {
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs42_r12;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rxPool_ResourceConfig_subframeBitmap_present choice: prNothing,prBs4,prBs8,prBs12,prBs16,prBs30,prBs40,prBs42!\n",
config_fname, cell_idx, SLconfig->rxPool_ResourceConfig_subframeBitmap_present);
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_choice_bs_buf[cc_idx] = SLconfig->rxPool_ResourceConfig_subframeBitmap_choice_bs_buf;
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_choice_bs_size[cc_idx] = SLconfig->rxPool_ResourceConfig_subframeBitmap_choice_bs_size;
RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[cc_idx] = SLconfig->rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused;
//SIB19 - for discRxPool
if (strcmp(SLconfig->discRxPool_cp_Len,"normal")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
} else if (strcmp(SLconfig->discRxPool_cp_Len,"extended")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPool_cp_Len choice: normal,extended!\n",
config_fname, cell_idx, SLconfig->discRxPool_cp_Len);
if (strcmp(SLconfig->discRxPool_discPeriod,"rf32")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf32;
} else if (strcmp(SLconfig->discRxPool_discPeriod,"rf64")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf64;
} else if (strcmp(SLconfig->discRxPool_discPeriod,"rf128")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf128;
} else if (strcmp(SLconfig->discRxPool_discPeriod,"rf256")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf256;
} else if (strcmp(SLconfig->discRxPool_discPeriod,"rf512")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf512;
} else if (strcmp(SLconfig->discRxPool_discPeriod,"rf1024")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf1024;
} else if (strcmp(SLconfig->discRxPool_discPeriod,"rf16")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf16_v1310;
} else if (strcmp(SLconfig->discRxPool_discPeriod,"spare")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_spare;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPool_discPeriod choice: rf32,rf64,rf128,rf512,rf1024,rf16,spare!\n",
config_fname, cell_idx, SLconfig->discRxPool_discPeriod);
RRC_CONFIGURATION_REQ (msg_p).discRxPool_numRetx[cc_idx] = SLconfig->discRxPool_numRetx;
RRC_CONFIGURATION_REQ (msg_p).discRxPool_numRepetition[cc_idx] = SLconfig->discRxPool_numRepetition;
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_prb_Num[cc_idx] = SLconfig->discRxPool_ResourceConfig_prb_Num;
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_prb_Start[cc_idx] = SLconfig->discRxPool_ResourceConfig_prb_Start;
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_prb_End[cc_idx] = SLconfig->discRxPool_ResourceConfig_prb_End;
if (strcmp(SLconfig->discRxPool_ResourceConfig_offsetIndicator_present,"prNothing")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_NOTHING;
} else if (strcmp(SLconfig->discRxPool_ResourceConfig_offsetIndicator_present,"prSmall")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_small_r12;
} else if (strcmp(SLconfig->discRxPool_ResourceConfig_offsetIndicator_present,"prLarge")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_large_r12;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPool_ResourceConfig_offsetIndicator_present choice: prNothing,prSmal,prLarge!\n",
config_fname, cell_idx, SLconfig->discRxPool_ResourceConfig_offsetIndicator_present);
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_offsetIndicator_choice[cc_idx] = SLconfig->discRxPool_ResourceConfig_offsetIndicator_choice;
if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prNothing")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_NOTHING;
} else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs4")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs4_r12;
} else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs8")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs8_r12;
} else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs12")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs12_r12;
} else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs16")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs16_r12;
} else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs30")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs30_r12;
} else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs40")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs40_r12;
} else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs42")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs42_r12;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPool_ResourceConfig_subframeBitmap_present choice: prNothing,prBs4,prBs8,prBs12,prBs16,prBs30,prBs40,prBs42!\n",
config_fname, cell_idx, SLconfig->discRxPool_ResourceConfig_subframeBitmap_present);
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf[cc_idx] = SLconfig->discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf;
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_choice_bs_size[cc_idx] = SLconfig->discRxPool_ResourceConfig_subframeBitmap_choice_bs_size;
RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[cc_idx] = SLconfig->discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused;
//SIB19 - For discRxPoolPS
if (strcmp(SLconfig->discRxPoolPS_cp_Len,"normal")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
} else if (strcmp(SLconfig->discRxPoolPS_cp_Len,"extended")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_cp_Len choice: normal,extended!\n",
config_fname, cell_idx, SLconfig->discRxPoolPS_cp_Len);
if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf32")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf32;
} else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf64")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf64;
} else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf128")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf128;
} else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf256")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf256;
} else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf512")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf512;
} else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf1024")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf1024;
} else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf16")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf16_v1310;
} else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"spare")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_spare;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_discPeriod choice: rf32,rf64,rf128,rf512,rf1024,rf16,spare!\n",
config_fname, cell_idx, SLconfig->discRxPoolPS_discPeriod);
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_numRetx[cc_idx] = SLconfig->discRxPoolPS_numRetx;
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_numRepetition[cc_idx] = SLconfig->discRxPoolPS_numRepetition;
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_prb_Num[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_prb_Num;
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_prb_Start[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_prb_Start;
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_prb_End[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_prb_End;
if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_present,"prNothing")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_NOTHING;
} else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_present,"prSmall")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_small_r12;
} else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_present,"prLarge")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_large_r12;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_ResourceConfig_offsetIndicator_present choice: prNothing,prSmal,prLarge!\n",
config_fname, cell_idx, SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_present);
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_choice[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_choice;
if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prNothing")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_NOTHING;
} else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs4")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs4_r12;
} else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs8")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs8_r12;
} else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs12")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs12_r12;
} else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs16")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs16_r12;
} else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs30")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs30_r12;
} else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs40")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs40_r12;
} else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs42")==0) {
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs42_r12;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_ResourceConfig_subframeBitmap_present choice: prNothing,prBs4,prBs8,prBs12,prBs16,prBs30,prBs40,prBs42!\n",
config_fname, cell_idx, SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present);
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf;
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size;
RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused;
} // sidelink_configured==1
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More