Commit c7a3b608 authored by Haruki NAOI's avatar Haruki NAOI

cleanup NNSF

(cherry picked from commit aeeaf30a989c61a59e2d16d02629d145e4f5beda)
parent 91dc960d
...@@ -788,34 +788,16 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ( ...@@ -788,34 +788,16 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
S1AP_NAS_FIRST_REQ (message_p).ue_identity.presenceMask |= UE_IDENTITIES_gummei; S1AP_NAS_FIRST_REQ (message_p).ue_identity.presenceMask |= UE_IDENTITIES_gummei;
if (r_mme->plmn_Identity != NULL) { if (r_mme->plmn_Identity != NULL) {
/* ----- %%%%% KDDI DEMO KCN 削除 ここから ----- */
// if ((r_mme->plmn_Identity->mcc != NULL) && (r_mme->plmn_Identity->mcc->list.count > 0)) {
/* Use first indicated PLMN MCC if it is defined */
// S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = *r_mme->plmn_Identity->mcc->list.array[selected_plmn_identity];
/* ----- %%%%% KDDI DEMO KCN 削除 ここまで ----- */
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
if ((r_mme->plmn_Identity->mcc != NULL) && (r_mme->plmn_Identity->mcc->list.count == 3)) if ((r_mme->plmn_Identity->mcc != NULL) && (r_mme->plmn_Identity->mcc->list.count == 3))
{ {
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = (*r_mme->plmn_Identity->mcc->list.array[0] & 0xf) * 100 + S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = (*r_mme->plmn_Identity->mcc->list.array[0] & 0xf) * 100 +
(*r_mme->plmn_Identity->mcc->list.array[1] & 0xf) * 10 + (*r_mme->plmn_Identity->mcc->list.array[1] & 0xf) * 10 +
(*r_mme->plmn_Identity->mcc->list.array[2] & 0xf); (*r_mme->plmn_Identity->mcc->list.array[2] & 0xf);
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
LOG_I(S1AP, "[eNB %d] Build S1AP_NAS_FIRST_REQ adding in s_TMSI: GUMMEI MCC %u ue %x\n", LOG_I(S1AP, "[eNB %d] Build S1AP_NAS_FIRST_REQ adding in s_TMSI: GUMMEI MCC %u ue %x\n",
ctxt_pP->module_id, ctxt_pP->module_id,
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc, S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc,
ue_context_pP->ue_context.rnti); ue_context_pP->ue_context.rnti);
} }
/* ----- %%%%% KDDI DEMO KCN 削除 ここから ----- */
// if (r_mme->plmn_Identity->mnc.list.count > 0) {
/* Use first indicated PLMN MNC if it is defined */
// S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc = *r_mme->plmn_Identity->mnc.list.array[selected_plmn_identity];
// LOG_I(S1AP, "[eNB %d] Build S1AP_NAS_FIRST_REQ adding in s_TMSI: GUMMEI MNC %u ue %x\n",
// ctxt_pP->module_id,
// S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc,
// ue_context_pP->ue_context.rnti);
// }
/* ----- %%%%% KDDI DEMO KCN 削除 ここまで ----- */
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
if(r_mme->plmn_Identity->mnc.list.count == 3) if(r_mme->plmn_Identity->mnc.list.count == 3)
{ {
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc = (*r_mme->plmn_Identity->mnc.list.array[0] & 0xf) * 100 + S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc = (*r_mme->plmn_Identity->mnc.list.array[0] & 0xf) * 100 +
...@@ -839,7 +821,6 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ( ...@@ -839,7 +821,6 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len, S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len,
ue_context_pP->ue_context.rnti); ue_context_pP->ue_context.rnti);
} }
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
} else { // end if plmn_Identity != NULL } else { // end if plmn_Identity != NULL
S1AP_NAS_FIRST_REQ(message_p).ue_identity.gummei.mcc = rrc->configuration.mcc[selected_plmn_identity]; S1AP_NAS_FIRST_REQ(message_p).ue_identity.gummei.mcc = rrc->configuration.mcc[selected_plmn_identity];
S1AP_NAS_FIRST_REQ(message_p).ue_identity.gummei.mnc = rrc->configuration.mnc[selected_plmn_identity]; S1AP_NAS_FIRST_REQ(message_p).ue_identity.gummei.mnc = rrc->configuration.mnc[selected_plmn_identity];
......
...@@ -161,10 +161,8 @@ typedef struct s1ap_eNB_mme_data_s { ...@@ -161,10 +161,8 @@ typedef struct s1ap_eNB_mme_data_s {
/* Only meaningfull in virtual mode */ /* Only meaningfull in virtual mode */
struct s1ap_eNB_instance_s *s1ap_eNB_instance; struct s1ap_eNB_instance_s *s1ap_eNB_instance;
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
/* 接続呼数 */
uint32_t nb_calls; uint32_t nb_calls;
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
} s1ap_eNB_mme_data_t; } s1ap_eNB_mme_data_t;
typedef struct s1ap_eNB_instance_s { typedef struct s1ap_eNB_instance_s {
......
...@@ -112,43 +112,16 @@ int s1ap_eNB_handle_nas_first_req( ...@@ -112,43 +112,16 @@ int s1ap_eNB_handle_nas_first_req(
} }
} }
} }
/* ----- %%%%% KDDI DEMO KCN 削除 ここから ----- */
// if (mme_desc_p == NULL) {
// /* Select MME based on the selected PLMN identity, received through RRC
// * Connection Setup Complete */
// mme_desc_p = s1ap_eNB_nnsf_select_mme_by_plmn_id(
// instance_p,
// s1ap_nas_first_req_p->establishment_cause,
// s1ap_nas_first_req_p->selected_plmn_identity);
//
// if (mme_desc_p) {
// S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through selected PLMN Identity index %d MCC %d MNC %d\n",
// instance,
// mme_desc_p->mme_name,
// mme_desc_p->assoc_id,
// s1ap_nas_first_req_p->selected_plmn_identity,
// instance_p->mcc[s1ap_nas_first_req_p->selected_plmn_identity],
// instance_p->mnc[s1ap_nas_first_req_p->selected_plmn_identity]);
// }
// }
/* ----- %%%%% KDDI DEMO KCN 削除 ここまで ----- */
if (mme_desc_p == NULL) { if (mme_desc_p == NULL) {
/* /*
* If no MME corresponds to the GUMMEI, the s-TMSI, or the selected PLMN * If no MME corresponds to the GUMMEI, the s-TMSI, or the selected PLMN
* identity, selects the MME with the highest capacity. * identity, selects the MME with the highest capacity.
*/ */
/* ----- %%%%% KDDI DEMO KCN 削除 ここから ----- */
// mme_desc_p = s1ap_eNB_nnsf_select_mme(
// instance_p,
// s1ap_nas_first_req_p->establishment_cause);
/* ----- %%%%% KDDI DEMO KCN 削除 ここまで ----- */
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
mme_desc_p = s1ap_eNB_nnsf_select_mme( mme_desc_p = s1ap_eNB_nnsf_select_mme(
instance_p, instance_p,
s1ap_nas_first_req_p->establishment_cause, s1ap_nas_first_req_p->establishment_cause,
s1ap_nas_first_req_p->selected_plmn_identity); s1ap_nas_first_req_p->selected_plmn_identity);
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
if (mme_desc_p) { if (mme_desc_p) {
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through highest relative capacity\n", S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through highest relative capacity\n",
...@@ -241,18 +214,10 @@ int s1ap_eNB_handle_nas_first_req( ...@@ -241,18 +214,10 @@ int s1ap_eNB_handle_nas_first_req(
MACRO_ENB_ID_TO_CELL_IDENTITY(instance_p->eNB_id, MACRO_ENB_ID_TO_CELL_IDENTITY(instance_p->eNB_id,
0, // Cell ID 0, // Cell ID
&ie->value.choice.EUTRAN_CGI.cell_ID); &ie->value.choice.EUTRAN_CGI.cell_ID);
/* ----- %%%%% KDDI DEMO KCN 削除 ここから ----- */
// MCC_MNC_TO_TBCD(instance_p->mcc[ue_desc_p->selected_plmn_identity],
// instance_p->mnc[ue_desc_p->selected_plmn_identity],
// instance_p->mnc_digit_length[ue_desc_p->selected_plmn_identity],
// &ie->value.choice.EUTRAN_CGI.pLMNidentity);
/* ----- %%%%% KDDI DEMO KCN 削除 ここまで ----- */
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
MCC_MNC_TO_TBCD(instance_p->mcc[mme_desc_p->broadcast_plmn_index[0]], MCC_MNC_TO_TBCD(instance_p->mcc[mme_desc_p->broadcast_plmn_index[0]],
instance_p->mnc[mme_desc_p->broadcast_plmn_index[0]], instance_p->mnc[mme_desc_p->broadcast_plmn_index[0]],
instance_p->mnc_digit_length[mme_desc_p->broadcast_plmn_index[0]], instance_p->mnc_digit_length[mme_desc_p->broadcast_plmn_index[0]],
&ie->value.choice.EUTRAN_CGI.pLMNidentity); &ie->value.choice.EUTRAN_CGI.pLMNidentity);
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* Set the establishment cause according to those provided by RRC */ /* Set the establishment cause according to those provided by RRC */
DevCheck(s1ap_nas_first_req_p->establishment_cause < RRC_CAUSE_LAST, DevCheck(s1ap_nas_first_req_p->establishment_cause < RRC_CAUSE_LAST,
...@@ -653,20 +618,11 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_ ...@@ -653,20 +618,11 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
ie->id = S1AP_ProtocolIE_ID_id_EUTRAN_CGI; ie->id = S1AP_ProtocolIE_ID_id_EUTRAN_CGI;
ie->criticality = S1AP_Criticality_ignore; ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_EUTRAN_CGI; ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_EUTRAN_CGI;
/* ----- %%%%% KDDI DEMO KCN 削除 ここから ----- */
// MCC_MNC_TO_PLMNID(
// s1ap_eNB_instance_p->mcc[ue_context_p->selected_plmn_identity],
// s1ap_eNB_instance_p->mnc[ue_context_p->selected_plmn_identity],
// s1ap_eNB_instance_p->mnc_digit_length[ue_context_p->selected_plmn_identity],
// &ie->value.choice.EUTRAN_CGI.pLMNidentity);
/* ----- %%%%% KDDI DEMO KCN 削除 ここまで ----- */
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
MCC_MNC_TO_PLMNID( MCC_MNC_TO_PLMNID(
s1ap_eNB_instance_p->mcc[ue_context_p->mme_ref->broadcast_plmn_index[0]], s1ap_eNB_instance_p->mcc[ue_context_p->mme_ref->broadcast_plmn_index[0]],
s1ap_eNB_instance_p->mnc[ue_context_p->mme_ref->broadcast_plmn_index[0]], s1ap_eNB_instance_p->mnc[ue_context_p->mme_ref->broadcast_plmn_index[0]],
s1ap_eNB_instance_p->mnc_digit_length[ue_context_p->mme_ref->broadcast_plmn_index[0]], s1ap_eNB_instance_p->mnc_digit_length[ue_context_p->mme_ref->broadcast_plmn_index[0]],
&ie->value.choice.EUTRAN_CGI.pLMNidentity); &ie->value.choice.EUTRAN_CGI.pLMNidentity);
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
//#warning "TODO get cell id from RRC" //#warning "TODO get cell id from RRC"
MACRO_ENB_ID_TO_CELL_IDENTITY(s1ap_eNB_instance_p->eNB_id, MACRO_ENB_ID_TO_CELL_IDENTITY(s1ap_eNB_instance_p->eNB_id,
0, 0,
......
...@@ -36,24 +36,13 @@ ...@@ -36,24 +36,13 @@
#include "s1ap_eNB_defs.h" #include "s1ap_eNB_defs.h"
#include "s1ap_eNB_nnsf.h" #include "s1ap_eNB_nnsf.h"
/* ----- %%%%% KDDI DEMO KCN 削除 ここから ----- */
//struct s1ap_eNB_mme_data_s *
//s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p,
// rrc_establishment_cause_t cause)
/* ----- %%%%% KDDI DEMO KCN 削除 ここまで ----- */
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
struct s1ap_eNB_mme_data_s * struct s1ap_eNB_mme_data_s *
s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p, s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause, rrc_establishment_cause_t cause,
uint32_t plmn_id) uint32_t plmn_id)
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
{ {
struct s1ap_eNB_mme_data_s *mme_data_p = NULL; struct s1ap_eNB_mme_data_s *mme_data_p = NULL;
struct s1ap_eNB_mme_data_s *mme_highest_capacity_p = NULL; struct s1ap_eNB_mme_data_s *mme_highest_capacity_p = NULL;
/* ----- %%%%% KDDI DEMO KCN 削除 ここから ----- */
// uint8_t current_capacity = 0;
/* ----- %%%%% KDDI DEMO KCN 削除 ここまで ----- */
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
typedef struct MME_nnsf_inf { typedef struct MME_nnsf_inf {
struct s1ap_eNB_mme_data_s *mme_p; struct s1ap_eNB_mme_data_s *mme_p;
uint64_t weight; uint64_t weight;
...@@ -66,13 +55,10 @@ s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p, ...@@ -66,13 +55,10 @@ s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p,
uint64_t weight = 0; uint64_t weight = 0;
memset(mme_inf, 0, sizeof(mme_inf)); memset(mme_inf, 0, sizeof(mme_inf));
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
RB_FOREACH(mme_data_p, s1ap_mme_map, &instance_p->s1ap_mme_head) { RB_FOREACH(mme_data_p, s1ap_mme_map, &instance_p->s1ap_mme_head) {
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
struct served_gummei_s *gummei_p = NULL; struct served_gummei_s *gummei_p = NULL;
capacity_sum = capacity_sum + mme_data_p->relative_mme_capacity; capacity_sum = capacity_sum + mme_data_p->relative_mme_capacity;
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
if (mme_data_p->state != S1AP_ENB_STATE_CONNECTED) { if (mme_data_p->state != S1AP_ENB_STATE_CONNECTED) {
/* The association between MME and eNB is not ready for the moment, /* The association between MME and eNB is not ready for the moment,
* go to the next known MME. * go to the next known MME.
...@@ -107,14 +93,6 @@ s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p, ...@@ -107,14 +93,6 @@ s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p,
} }
} }
/* ----- %%%%% KDDI DEMO KCN 削除 ここから ----- */
// if (current_capacity < mme_data_p->relative_mme_capacity) {
// /* We find a better MME, keep a reference to it */
// current_capacity = mme_data_p->relative_mme_capacity;
// mme_highest_capacity_p = mme_data_p;
// }
/* ----- %%%%% KDDI DEMO KCN 削除 ここまで ----- */
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
gummei_p = mme_data_p->served_gummei.stqh_first; gummei_p = mme_data_p->served_gummei.stqh_first;
if( gummei_p != NULL ) if( gummei_p != NULL )
{ {
...@@ -138,9 +116,7 @@ s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p, ...@@ -138,9 +116,7 @@ s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p,
served_plmns_p = served_plmns_p->next.stqe_next; served_plmns_p = served_plmns_p->next.stqe_next;
} }
} }
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
} }
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
if( nb_mme != 0 ) if( nb_mme != 0 )
{ {
for( cnt = 0 ; cnt < nb_mme ; cnt++ ) for( cnt = 0 ; cnt < nb_mme ; cnt++ )
...@@ -167,7 +143,6 @@ s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p, ...@@ -167,7 +143,6 @@ s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p,
{ {
mme_highest_capacity_p->nb_calls++; mme_highest_capacity_p->nb_calls++;
} }
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
return mme_highest_capacity_p; return mme_highest_capacity_p;
} }
......
...@@ -22,17 +22,10 @@ ...@@ -22,17 +22,10 @@
#ifndef S1AP_ENB_NNSF_H_ #ifndef S1AP_ENB_NNSF_H_
#define S1AP_ENB_NNSF_H_ #define S1AP_ENB_NNSF_H_
/* ----- %%%%% KDDI DEMO KCN 削除 ここから ----- */
//struct s1ap_eNB_mme_data_s *
//s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p,
// rrc_establishment_cause_t cause);
/* ----- %%%%% KDDI DEMO KCN 削除 ここまで ----- */
/* ----- %%%%% KDDI DEMO KCN 追加 ここから ----- */
struct s1ap_eNB_mme_data_s * struct s1ap_eNB_mme_data_s *
s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p, s1ap_eNB_nnsf_select_mme(s1ap_eNB_instance_t *instance_p,
rrc_establishment_cause_t cause, rrc_establishment_cause_t cause,
uint32_t plmn_id); uint32_t plmn_id);
/* ----- %%%%% KDDI DEMO KCN 追加 ここまで ----- */
struct s1ap_eNB_mme_data_s * struct s1ap_eNB_mme_data_s *
s1ap_eNB_nnsf_select_mme_by_plmn_id(s1ap_eNB_instance_t *instance_p, s1ap_eNB_nnsf_select_mme_by_plmn_id(s1ap_eNB_instance_t *instance_p,
......
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