Commit b7530528 authored by Konstantinos Alexandris's avatar Konstantinos Alexandris Committed by Robert Schmidt

To be tested: Add code for measurement report based on the neighbouring cells...

To be tested: Add code for measurement report based on the neighbouring cells after x2 setup, ocs/ocn for multiple cells
parent 5dfec716
...@@ -39,6 +39,8 @@ MESSAGE_DEF(X2AP_REGISTER_ENB_CNF , MESSAGE_PRIORITY_MED, x2ap_reg ...@@ -39,6 +39,8 @@ MESSAGE_DEF(X2AP_REGISTER_ENB_CNF , MESSAGE_PRIORITY_MED, x2ap_reg
MESSAGE_DEF(X2AP_DEREGISTERED_ENB_IND , MESSAGE_PRIORITY_MED, x2ap_deregistered_enb_ind_t , x2ap_deregistered_enb_ind) MESSAGE_DEF(X2AP_DEREGISTERED_ENB_IND , MESSAGE_PRIORITY_MED, x2ap_deregistered_enb_ind_t , x2ap_deregistered_enb_ind)
/* handover messages X2AP <-> RRC */ /* 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 , 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_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) MESSAGE_DEF(X2AP_HANDOVER_CANCEL , MESSAGE_PRIORITY_MED, x2ap_handover_cancel_t , x2ap_handover_cancel)
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
// Defines to access message fields. // Defines to access message fields.
#define X2AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_req #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(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req
#define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack #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_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
...@@ -41,6 +43,16 @@ ...@@ -41,6 +43,16 @@
// eNB application layer -> X2AP messages // 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 */ /* X2AP UE CONTEXT RELEASE */
typedef struct x2ap_ue_context_release_s { typedef struct x2ap_ue_context_release_s {
/* used for X2AP->RRC in source and RRC->X2AP in target */ /* used for X2AP->RRC in source and RRC->X2AP in target */
......
...@@ -1586,15 +1586,15 @@ long flexran_get_rrc_ocp(mid_t mod_id, rnti_t rnti) { ...@@ -1586,15 +1586,15 @@ long flexran_get_rrc_ocp(mid_t mod_id, rnti_t rnti) {
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti); struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1; if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measurement_info) return -1; if (!ue_context_p->ue_context.measurement_info) return -1;
return ue_context_p->ue_context.measurement_info->cellIndividualOffset; return ue_context_p->ue_context.measurement_info->cellIndividualOffset[0];
} }
long flexran_get_rrc_ocn(mid_t mod_id, rnti_t rnti) { long flexran_get_rrc_ocn(mid_t mod_id, rnti_t rnti, long cell_id) {
if (!rrc_is_present(mod_id)) return -1; if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti); struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1; if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measurement_info) return -1; if (!ue_context_p->ue_context.measurement_info) return -1;
return ue_context_p->ue_context.measurement_info->cellIndividualOffset; return ue_context_p->ue_context.measurement_info->cellIndividualOffset[cell_id+1];
} }
/* Periodic event */ /* Periodic event */
......
...@@ -550,7 +550,7 @@ long flexran_get_rrc_ofn(mid_t mod_id, rnti_t rnti); ...@@ -550,7 +550,7 @@ long flexran_get_rrc_ofn(mid_t mod_id, rnti_t rnti);
long flexran_get_rrc_ocp(mid_t mod_id, rnti_t rnti); long flexran_get_rrc_ocp(mid_t mod_id, rnti_t rnti);
/* Get ocn offset */ /* Get ocn offset */
long flexran_get_rrc_ocn(mid_t mod_id, rnti_t rnti); long flexran_get_rrc_ocn(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get Periodic Event max reported cells */ /* Get Periodic Event max reported cells */
long flexran_get_rrc_per_event_maxReportCells(mid_t mod_id, rnti_t rnti); long flexran_get_rrc_per_event_maxReportCells(mid_t mod_id, rnti_t rnti);
......
...@@ -61,6 +61,8 @@ ...@@ -61,6 +61,8 @@
#define MAX_PAYLOAD 1024 /* maximum payload size*/ #define MAX_PAYLOAD 1024 /* maximum payload size*/
#define MAX_NUM_NEIGH_CELLs 6 /* maximum neighbouring cells number */
#define UE_STATE_NOTIFICATION_INTERVAL 50 #define UE_STATE_NOTIFICATION_INTERVAL 50
#define IPV4_ADDR "%u.%u.%u.%u" #define IPV4_ADDR "%u.%u.%u.%u"
...@@ -537,7 +539,7 @@ typedef struct MEASUREMENT_INFO_s { ...@@ -537,7 +539,7 @@ typedef struct MEASUREMENT_INFO_s {
//TODO: Extend to multiple meas objects for OFP/OFN offsets //TODO: Extend to multiple meas objects for OFP/OFN offsets
long offsetFreq; long offsetFreq;
//TODO: extend to multiple cells for OCP/OCN offsets //TODO: extend to multiple cells for OCP/OCN offsets
long cellIndividualOffset; long cellIndividualOffset[MAX_NUM_NEIGH_CELLs+1];
EVENTS_t *events; EVENTS_t *events;
} MEASUREMENT_INFO; } MEASUREMENT_INFO;
...@@ -822,6 +824,11 @@ typedef struct eNB_RRC_INST_s { ...@@ -822,6 +824,11 @@ typedef struct eNB_RRC_INST_s {
/// NR cell id /// NR cell id
uint64_t nr_cellid; uint64_t nr_cellid;
// Neighborouring cells id
int num_neigh_cells;
int num_neigh_cells_cc[MAX_NUM_CCs];
uint32_t neigh_cells_id[MAX_NUM_NEIGH_CELLs][MAX_NUM_CCs];
// other RAN parameters // other RAN parameters
int srb1_timer_poll_retransmit; int srb1_timer_poll_retransmit;
int srb1_poll_pdu; int srb1_poll_pdu;
......
This diff is collapsed.
...@@ -357,6 +357,9 @@ void *rrc_enb_task(void *args_p); ...@@ -357,6 +357,9 @@ void *rrc_enb_task(void *args_p);
\param void *args_p Pointer on arguments to start the task. */ \param void *args_p Pointer on arguments to start the task. */
void *rrc_ue_task(void *args_p); void *rrc_ue_task(void *args_p);
void rrc_eNB_process_x2_setup_request(int mod_id, x2ap_setup_req_t *m);
void rrc_eNB_process_x2_setup_response(int mod_id, x2ap_setup_resp_t *m);
void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_req_t *m); void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_req_t *m);
......
...@@ -291,6 +291,7 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance, ...@@ -291,6 +291,7 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance,
x2ap_eNB_instance_t *instance_p; x2ap_eNB_instance_t *instance_p;
x2ap_eNB_data_t *x2ap_eNB_data; x2ap_eNB_data_t *x2ap_eNB_data;
MessageDef *msg;
uint32_t eNB_id = 0; uint32_t eNB_id = 0;
DevAssert (pdu != NULL); DevAssert (pdu != NULL);
...@@ -391,17 +392,25 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance, ...@@ -391,17 +392,25 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance,
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__); X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
return -1; return -1;
} }
msg = itti_alloc_new_message(TASK_X2AP, X2AP_SETUP_REQ);
X2AP_SETUP_REQ(msg).num_cc = ie->value.choice.ServedCells.list.count;
if (ie->value.choice.ServedCells.list.count > 0) { if (ie->value.choice.ServedCells.list.count > 0) {
x2ap_eNB_data->num_cc = ie->value.choice.ServedCells.list.count; x2ap_eNB_data->num_cc = ie->value.choice.ServedCells.list.count;
for (int i=0; i<ie->value.choice.ServedCells.list.count;i++) { for (int i=0; i<ie->value.choice.ServedCells.list.count;i++) {
servedCellMember = (ServedCells__Member *)ie->value.choice.ServedCells.list.array[i]; servedCellMember = (ServedCells__Member *)ie->value.choice.ServedCells.list.array[i];
x2ap_eNB_data->Nid_cell[i] = servedCellMember->servedCellInfo.pCI; x2ap_eNB_data->Nid_cell[i] = servedCellMember->servedCellInfo.pCI;
X2AP_SETUP_REQ(msg).Nid_cell[i] = x2ap_eNB_data->Nid_cell[i];
} }
} }
instance_p = x2ap_eNB_get_instance(instance); instance_p = x2ap_eNB_get_instance(instance);
DevAssert(instance_p != NULL); DevAssert(instance_p != NULL);
itti_send_msg_to_task(TASK_RRC_ENB, instance_p->instance, msg);
return x2ap_eNB_generate_x2_setup_response(instance_p, x2ap_eNB_data); return x2ap_eNB_generate_x2_setup_response(instance_p, x2ap_eNB_data);
} }
...@@ -418,6 +427,7 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance, ...@@ -418,6 +427,7 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance,
x2ap_eNB_instance_t *instance_p; x2ap_eNB_instance_t *instance_p;
x2ap_eNB_data_t *x2ap_eNB_data; x2ap_eNB_data_t *x2ap_eNB_data;
MessageDef *msg;
uint32_t eNB_id = 0; uint32_t eNB_id = 0;
DevAssert (pdu != NULL); DevAssert (pdu != NULL);
...@@ -500,11 +510,16 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance, ...@@ -500,11 +510,16 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance,
return -1; return -1;
} }
msg = itti_alloc_new_message(TASK_X2AP, X2AP_SETUP_RESP);
X2AP_SETUP_RESP(msg).num_cc = ie->value.choice.ServedCells.list.count;
if (ie->value.choice.ServedCells.list.count > 0) { if (ie->value.choice.ServedCells.list.count > 0) {
x2ap_eNB_data->num_cc = ie->value.choice.ServedCells.list.count; x2ap_eNB_data->num_cc = ie->value.choice.ServedCells.list.count;
for (int i=0; i<ie->value.choice.ServedCells.list.count;i++) { for (int i=0; i<ie->value.choice.ServedCells.list.count;i++) {
servedCellMember = (ServedCells__Member *)ie->value.choice.ServedCells.list.array[i]; servedCellMember = (ServedCells__Member *)ie->value.choice.ServedCells.list.array[i];
x2ap_eNB_data->Nid_cell[i] = servedCellMember->servedCellInfo.pCI; x2ap_eNB_data->Nid_cell[i] = servedCellMember->servedCellInfo.pCI;
X2AP_SETUP_RESP(msg).Nid_cell[i] = x2ap_eNB_data->Nid_cell[i];
} }
} }
...@@ -521,6 +536,8 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance, ...@@ -521,6 +536,8 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance,
instance_p->x2_target_enb_associated_nb ++; instance_p->x2_target_enb_associated_nb ++;
x2ap_handle_x2_setup_message(instance_p, x2ap_eNB_data, 0); x2ap_handle_x2_setup_message(instance_p, x2ap_eNB_data, 0);
itti_send_msg_to_task(TASK_RRC_ENB, instance_p->instance, msg);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment