Commit 2f230479 authored by Robert Schmidt's avatar Robert Schmidt

Restructure F1AP UE list

* Restructure the code handling the UEs F1AP knows
* This fixes a bug that only two phones can be connected
parent 032fc48a
......@@ -62,37 +62,28 @@ uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_
return transaction_identifier[enb_mod_idP+cu_mod_idP];
}
module_id_t F1AP_get_UE_identifier(module_id_t enb_mod_idP, int CC_idP, int UE_id) {
static module_id_t UE_identifier[NUMBER_OF_eNB_MAX];
UE_identifier[enb_mod_idP+CC_idP+UE_id] = (UE_identifier[enb_mod_idP+CC_idP+UE_id] + 1) % F1AP_UE_IDENTIFIER_NUMBER;
//LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+du_mod_idP]);
return UE_identifier[enb_mod_idP+CC_idP+UE_id];
}
int f1ap_add_ue(f1ap_cudu_ue_inst_t *f1_ue_inst,
int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
module_id_t module_idP,
int CC_idP,
int UE_id,
rnti_t rntiP){
int i;
for (i=0; i < MAX_MOBILES_PER_ENB; i++){
if (f1_ue_inst->rnti[i] == rntiP) {
f1_ue_inst->f1ap_uid[i] = i;
f1_ue_inst->mac_uid[i] = UE_id;
LOG_I(F1AP, "Updating the index of UE with RNTI %x and du_ue_f1ap_id %d\n", f1_ue_inst->rnti[i], f1_ue_inst->du_ue_f1ap_id[i]);
return i;
rnti_t rntiP) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
f1_inst->f1ap_ue[i].f1ap_uid = i;
f1_inst->f1ap_ue[i].mac_uid = UE_id;
LOG_I(F1AP, "Updating the index of UE with RNTI %x and du_ue_f1ap_id %d\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
return i;
}
}
for (i=0; i < MAX_MOBILES_PER_ENB ; i++){
if (f1_ue_inst->rnti[i] == 0 ){
f1_ue_inst->rnti[i]=rntiP;
f1_ue_inst->f1ap_uid[i]=i;
f1_ue_inst->mac_uid[i]=UE_id;
f1_ue_inst->du_ue_f1ap_id[i] = F1AP_get_UE_identifier(module_idP, CC_idP, i);
f1_ue_inst->cu_ue_f1ap_id[i] = F1AP_get_UE_identifier(module_idP, CC_idP, i);
f1_ue_inst->num_ues++;
LOG_I(F1AP, "Adding a new UE with RNTI %x and cu/du ue_f1ap_id %d\n", f1_ue_inst->rnti[i], f1_ue_inst->du_ue_f1ap_id[i]);
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == 0 ) {
f1_inst->f1ap_ue[i].rnti = rntiP;
f1_inst->f1ap_ue[i].f1ap_uid = i;
f1_inst->f1ap_ue[i].mac_uid = UE_id;
f1_inst->f1ap_ue[i].du_ue_f1ap_id = rntiP;
f1_inst->f1ap_ue[i].cu_ue_f1ap_id = rntiP;
f1_inst->num_ues++;
LOG_I(F1AP, "Adding a new UE with RNTI %x and cu/du ue_f1ap_id %d\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
return i;
}
}
......@@ -100,122 +91,104 @@ int f1ap_add_ue(f1ap_cudu_ue_inst_t *f1_ue_inst,
}
int f1ap_remove_ue(f1ap_cudu_ue_inst_t *f1_ue_inst,
rnti_t rntiP){
int i;
for (i=0; i < MAX_MOBILES_PER_ENB; i++){
if (f1_ue_inst->rnti[i] == rntiP) {
f1_ue_inst->rnti[i] = 0;
break;
int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
f1_inst->f1ap_ue[i].rnti = 0;
break;
}
}
return 0 ;
f1_inst->num_ues--;
return 0;
}
int f1ap_get_du_ue_f1ap_id (f1ap_cudu_ue_inst_t *f1_ue_inst,
rnti_t rntiP){
int i;
for (i=0; i < MAX_MOBILES_PER_ENB; i++){
if (f1_ue_inst->rnti[i] == rntiP) {
return f1_ue_inst->du_ue_f1ap_id[i];
int f1ap_get_du_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return f1_inst->f1ap_ue[i].du_ue_f1ap_id;
}
}
return -1;
}
return -1;
}
int f1ap_get_cu_ue_f1ap_id (f1ap_cudu_ue_inst_t *f1_ue_inst,
rnti_t rntiP){
int i;
for (i=0; i < MAX_MOBILES_PER_ENB; i++){
if (f1_ue_inst->rnti[i] == rntiP) {
return f1_ue_inst->cu_ue_f1ap_id[i];
int f1ap_get_cu_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return f1_inst->f1ap_ue[i].cu_ue_f1ap_id;
}
}
return -1;
}
return -1;
}
int f1ap_get_rnti_by_du_id(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t du_ue_f1ap_id ){
int i;
for (i=0; i < MAX_MOBILES_PER_ENB; i++){
if (f1_ue_inst->du_ue_f1ap_id[i] == du_ue_f1ap_id) {
return f1_ue_inst->rnti[i];
}
}
return -1;
int f1ap_get_rnti_by_du_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
return f1_inst->f1ap_ue[i].rnti;
}
}
return -1;
}
int f1ap_get_rnti_by_cu_id(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t cu_ue_f1ap_id ){
int i;
for (i=0; i < MAX_MOBILES_PER_ENB; i++){
if (f1_ue_inst->cu_ue_f1ap_id[i] == cu_ue_f1ap_id) {
return f1_ue_inst->rnti[i];
}
}
return -1;
int f1ap_get_rnti_by_cu_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].cu_ue_f1ap_id == cu_ue_f1ap_id) {
return f1_inst->f1ap_ue[i].rnti;
}
}
return -1;
}
int f1ap_get_du_uid(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t du_ue_f1ap_id ){
int i;
for (i=0; i < MAX_MOBILES_PER_ENB; i++){
if (f1_ue_inst->du_ue_f1ap_id[i] == du_ue_f1ap_id) {
int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
return i;
}
}
return -1;
}
}
return -1;
}
int f1ap_get_cu_uid(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t cu_ue_f1ap_id ){
int i;
for (i=0; i < MAX_MOBILES_PER_ENB; i++){
if (f1_ue_inst->cu_ue_f1ap_id[i] == cu_ue_f1ap_id) {
int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].cu_ue_f1ap_id == cu_ue_f1ap_id) {
return i;
}
}
return -1;
}
}
return -1;
}
int f1ap_get_uid_by_rnti(f1ap_cudu_ue_inst_t *f1_ue_inst,
rnti_t rntiP ){
int i;
for (i=0; i < MAX_MOBILES_PER_ENB; i++){
if (f1_ue_inst->rnti[i] == rntiP) {
int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return i;
}
}
return -1;
}
}
return -1;
}
int f1ap_du_add_cu_ue_id(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t du_ue_f1ap_id,
module_id_t cu_ue_f1ap_id){
module_id_t f1ap_uid = f1ap_get_du_uid(f1_ue_inst,du_ue_f1ap_id);
if (f1ap_uid < 0 )
return -1 ;
f1_ue_inst->cu_ue_f1ap_id[f1ap_uid]=cu_ue_f1ap_id;
LOG_I(F1AP, "Adding cu_ue_f1ap_id %d for UE with RNTI %x \n", cu_ue_f1ap_id, f1_ue_inst->rnti[f1ap_uid]);
return 0 ;
int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id,
module_id_t cu_ue_f1ap_id) {
module_id_t f1ap_uid = f1ap_get_du_uid(f1_inst,du_ue_f1ap_id);
if (f1ap_uid < 0) return -1;
f1_inst->f1ap_ue[f1ap_uid].cu_ue_f1ap_id = cu_ue_f1ap_id;
LOG_I(F1AP, "Adding cu_ue_f1ap_id %d for UE with RNTI %x\n", cu_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
return 0;
}
int f1ap_cu_add_du_ue_id(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t cu_ue_f1ap_id,
module_id_t du_ue_f1ap_id){
module_id_t f1ap_uid = f1ap_get_cu_uid(f1_ue_inst,cu_ue_f1ap_id);
if (f1ap_uid < 0 )
return -1 ;
f1_ue_inst->du_ue_f1ap_id[f1ap_uid]=du_ue_f1ap_id;
LOG_I(F1AP, "Adding du_ue_f1ap_id %d for UE with RNTI %x \n", du_ue_f1ap_id, f1_ue_inst->rnti[f1ap_uid]);
return 0 ;
}
\ No newline at end of file
int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id,
module_id_t du_ue_f1ap_id) {
module_id_t f1ap_uid = f1ap_get_cu_uid(f1_inst,cu_ue_f1ap_id);
if (f1ap_uid < 0) return -1;
f1_inst->f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
LOG_I(F1AP, "Adding du_ue_f1ap_id %d for UE with RNTI %x\n", du_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
return 0;
}
......@@ -425,67 +425,64 @@ typedef int (*f1ap_message_decoded_callback)(
F1AP_F1AP_PDU_t *message_p
);
// instance and module_id are assumed to be the same
typedef struct f1ap_cudu_ue_inst_s {
// used for eNB stats generation
rnti_t rnti[MAX_MOBILES_PER_ENB];
module_id_t f1ap_uid[MAX_MOBILES_PER_ENB];
module_id_t mac_uid[MAX_MOBILES_PER_ENB];
module_id_t du_ue_f1ap_id[MAX_MOBILES_PER_ENB];
module_id_t cu_ue_f1ap_id[MAX_MOBILES_PER_ENB];
rnti_t rnti;
module_id_t f1ap_uid;
module_id_t mac_uid;
module_id_t du_ue_f1ap_id;
module_id_t cu_ue_f1ap_id;
} f1ap_cudu_ue_t;
typedef struct f1ap_cudu_inst_s {
uint16_t num_ues;
} f1ap_cudu_ue_inst_t;
f1ap_cudu_ue_t f1ap_ue[MAX_MOBILES_PER_ENB];
} f1ap_cudu_inst_t;
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP);
module_id_t F1AP_get_UE_identifier(module_id_t enb_mod_idP, int CC_idP, int UE_id);
int f1ap_add_ue(f1ap_cudu_ue_inst_t *f1_ue_inst,
int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
module_id_t module_idP,
int CC_idP,
int UE_id,
rnti_t rntiP);
int f1ap_remove_ue(f1ap_cudu_ue_inst_t *f1_ue_inst,
rnti_t rntiP);
int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP);
int f1ap_get_du_ue_f1ap_id (f1ap_cudu_ue_inst_t *f1_ue_inst,
rnti_t rntiP);
int f1ap_get_du_ue_f1ap_id (f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP);
int f1ap_get_cu_ue_f1ap_id (f1ap_cudu_ue_inst_t *f1_ue_inst,
rnti_t rntiP);
//rnti
int f1ap_get_cu_ue_f1ap_id (f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP);
int f1ap_get_rnti_by_du_id(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t du_ue_f1ap_id );
int f1ap_get_rnti_by_du_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id );
int f1ap_get_rnti_by_cu_id(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t cu_ue_f1ap_id );
int f1ap_get_rnti_by_cu_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id );
int f1ap_get_du_uid(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t du_ue_f1ap_id );
int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id );
int f1ap_get_cu_uid(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t cu_ue_f1ap_id );
int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id );
int f1ap_get_uid_by_rnti(f1ap_cudu_ue_inst_t *f1_ue_inst,
rnti_t rntiP );
int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP );
int f1ap_du_add_cu_ue_id(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t du_ue_f1ap_id,
module_id_t cu_ue_f1ap_id);
int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id,
module_id_t cu_ue_f1ap_id);
int f1ap_cu_add_du_ue_id(f1ap_cudu_ue_inst_t *f1_ue_inst,
module_id_t cu_ue_f1ap_id,
module_id_t du_ue_f1ap_id);
int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id,
module_id_t du_ue_f1ap_id);
#endif /* F1AP_COMMON_H_ */
......@@ -51,7 +51,7 @@ uint32_t f1ap_assoc_id = 0;
uint32_t f1ap_stream = 0;
extern f1ap_cudu_ue_inst_t f1ap_cu_ue[MAX_eNB];
extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
/*
Initial UL RRC Message Transfer
......@@ -138,12 +138,12 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
}
AssertFatal(rrc_inst>=0,"couldn't find an RRC instance for nr_cell %llu\n",(unsigned long long int)nr_cellid);
int f1ap_uid = f1ap_add_ue(&f1ap_cu_ue[rrc_inst], rrc_inst, CC_id, 0, rnti);
int f1ap_uid = f1ap_add_ue(&f1ap_cu_inst[rrc_inst], rrc_inst, CC_id, 0, rnti);
if (f1ap_uid < 0 ) {
LOG_E(CU_F1AP, "Failed to add UE \n");
return -1;
}
f1ap_cu_ue[rrc_inst].du_ue_f1ap_id[f1ap_uid] = du_ue_f1ap_id;
f1ap_cu_inst[rrc_inst].f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
......@@ -192,7 +192,7 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_cu_ue[instance],f1ap_dl_rrc->rnti);
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_cu_inst[instance], f1ap_dl_rrc->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
LOG_I(CU_F1AP, "Setting GNB_CU_UE_F1AP_ID %llu associated with UE RNTI %x (instance %d)\n",
(unsigned long long int)ie->value.choice.GNB_CU_UE_F1AP_ID, f1ap_dl_rrc->rnti, instance);
......@@ -204,7 +204,7 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_cu_ue[instance],f1ap_dl_rrc->rnti); //f1ap_dl_rrc->gNB_DU_ue_id; // TODO: f1ap_dl_rrc->gNB_DU_ue_id
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_cu_inst[instance], f1ap_dl_rrc->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
LOG_I(CU_F1AP, "GNB_DU_UE_F1AP_ID %llu associated with UE RNTI %x \n", (unsigned long long int)ie->value.choice.GNB_DU_UE_F1AP_ID, f1ap_dl_rrc->rnti);
......@@ -311,14 +311,14 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
LOG_D(CU_F1AP, "cu_ue_f1ap_id %lu associated with RNTI %x \n", cu_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_ue[instance],cu_ue_f1ap_id));
LOG_D(CU_F1AP, "cu_ue_f1ap_id %lu associated with RNTI %x\n", cu_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id));
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(CU_F1AP, "du_ue_f1ap_id %lu associated with RNTI %x \n", du_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_ue[instance],du_ue_f1ap_id));
LOG_D(CU_F1AP, "du_ue_f1ap_id %lu associated with RNTI %x\n", du_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], du_ue_f1ap_id));
/* mandatory */
......@@ -351,7 +351,7 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ie->value.choice.RRCContainer.size);
RRC_DCCH_DATA_IND (message_p).dcch_index = srb_id;
RRC_DCCH_DATA_IND (message_p).rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_ue[instance],cu_ue_f1ap_id);
RRC_DCCH_DATA_IND (message_p).rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id);
RRC_DCCH_DATA_IND (message_p).module_id = instance;
RRC_DCCH_DATA_IND (message_p).eNB_index = instance; // not needed for CU
......@@ -360,7 +360,7 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
protocol_ctxt_t ctxt;
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_ue[instance],cu_ue_f1ap_id);
ctxt.rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id);
ctxt.enb_flag = 1;
mem_block_t *mb = get_free_mem_block(ie->value.choice.RRCContainer.size,__func__);
memcpy((void*)mb->data,(void*)ie->value.choice.RRCContainer.buf,ie->value.choice.RRCContainer.size);
......
......@@ -41,7 +41,7 @@
extern RAN_CONTEXT_t RC;
f1ap_setup_req_t *f1ap_du_data_from_du;
f1ap_cudu_ue_inst_t f1ap_cu_ue[MAX_eNB];
f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind) {
// Nothing
......
......@@ -44,7 +44,7 @@
#include "rrc_eNB_GTPV1U.h"
extern f1ap_setup_req_t *f1ap_du_data_from_du;
extern f1ap_cudu_ue_inst_t f1ap_cu_ue[MAX_eNB];
extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
extern RAN_CONTEXT_t RC;
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
......@@ -787,13 +787,13 @@ int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
const rnti_t rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_ue[instance],
const rnti_t rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance],
ie->value.choice.GNB_CU_UE_F1AP_ID);
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
const rnti_t rnti2 = f1ap_get_rnti_by_du_id(&f1ap_cu_ue[instance],
const rnti_t rnti2 = f1ap_get_rnti_by_du_id(&f1ap_cu_inst[instance],
ie->value.choice.GNB_DU_UE_F1AP_ID);
AssertFatal(rnti == rnti2, "RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
rnti2, rnti);
......@@ -861,7 +861,7 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_cu_ue[instance], cmd->rnti);
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_cu_inst[instance], cmd->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -870,7 +870,7 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_cu_ue[instance], cmd->rnti);
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_cu_inst[instance], cmd->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -939,13 +939,13 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCompleteIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
const rnti_t rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_ue[instance],
const rnti_t rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance],
ie->value.choice.GNB_CU_UE_F1AP_ID);
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCompleteIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
const rnti_t rnti2 = f1ap_get_rnti_by_du_id(&f1ap_cu_ue[instance],
const rnti_t rnti2 = f1ap_get_rnti_by_du_id(&f1ap_cu_inst[instance],
ie->value.choice.GNB_DU_UE_F1AP_ID);
AssertFatal(rnti == rnti2, "RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
rnti2, rnti);
......@@ -1001,7 +1001,7 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
instance, rnti, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
LOG_I(CU_F1AP, "Received UE CONTEXT RELEASE COMPLETE: Removing CU UE entry for RNTI %x\n", rnti);
f1ap_remove_ue(&f1ap_cu_ue[instance], rnti);
f1ap_remove_ue(&f1ap_cu_inst[instance], rnti);
return 0;
}
......
......@@ -57,7 +57,7 @@
extern f1ap_setup_req_t *f1ap_du_data;
extern RAN_CONTEXT_t RC;
extern f1ap_cudu_ue_inst_t f1ap_du_ue[MAX_eNB];
extern f1ap_cudu_inst_t f1ap_du_inst[MAX_eNB];
......@@ -104,9 +104,9 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(DU_F1AP, "du_ue_f1ap_id %lu associated with UE RNTI %x \n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(&f1ap_du_ue[instance],du_ue_f1ap_id)); // this should be the one transmitted via initial ul rrc message transfer
f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id)); // this should be the one transmitted via initial ul rrc message transfer
if (f1ap_du_add_cu_ue_id(&f1ap_du_ue[instance],du_ue_f1ap_id,cu_ue_f1ap_id) < 0 ) {
if (f1ap_du_add_cu_ue_id(&f1ap_du_inst[instance],du_ue_f1ap_id, cu_ue_f1ap_id) < 0 ) {
LOG_E(DU_F1AP, "Failed to find the F1AP UID \n");
//return -1;
}
......@@ -174,7 +174,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
AssertFatal(srb_id<3,"illegal srb_id\n");
protocol_ctxt_t ctxt;
ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_ue[instance],du_ue_f1ap_id);
ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id);
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
......@@ -217,7 +217,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
LOG_I(DU_F1AP,
"Logical Channel DL-CCCH (SRB0), Received RRCConnectionSetup DU_ID %lx/RNTI %x\n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(&f1ap_du_ue[instance], du_ue_f1ap_id));
f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id));
// Get configuration
RRCConnectionSetup_t* rrcConnectionSetup = &dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup;
......@@ -260,7 +260,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
// This should be somewhere in the f1ap_cudu_ue_inst_t
/*int macrlc_instance = 0;
rnti_t rnti = f1ap_get_rnti_by_du_id(&f1ap_du_ue[0],du_ue_f1ap_id);
rnti_t rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[0], du_ue_f1ap_id);
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[macrlc_instance],rnti);
*/
eNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
......@@ -356,7 +356,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
LOG_I(DU_F1AP,
"Logical Channel DL-DCCH (SRB1), Received RRCConnectionReconfiguration DU_ID %lx/RNTI %x\n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(&f1ap_du_ue[instance],du_ue_f1ap_id));
f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id));
RRCConnectionReconfiguration_t* rrcConnectionReconfiguration = &dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration;
......@@ -613,7 +613,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP,
instance_t instance = ctxt_pP->module_id;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_du_ue[instance].cu_ue_f1ap_id[f1ap_get_uid_by_rnti(&f1ap_du_ue[instance], rnti)];
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_du_inst[instance], rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
......@@ -623,7 +623,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP,
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_du_ue[instance].du_ue_f1ap_id[f1ap_get_uid_by_rnti(&f1ap_du_ue[instance], rnti)];
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_du_inst[instance], rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -762,7 +762,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
uint8_t *buffer;
uint32_t len;
int f1ap_uid = f1ap_add_ue (&f1ap_du_ue[module_idP], module_idP, CC_idP,UE_id, rntiP);
int f1ap_uid = f1ap_add_ue (&f1ap_du_inst[module_idP], module_idP, CC_idP,UE_id, rntiP);
if (f1ap_uid < 0 ) {
LOG_E(DU_F1AP, "Failed to add UE \n");
......@@ -786,7 +786,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_du_ue[module_idP].du_ue_f1ap_id[f1ap_uid];
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_du_inst[module_idP].f1ap_ue[f1ap_uid].du_ue_f1ap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -856,7 +856,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
void init_f1ap_du_ue_inst (void) {
memset(f1ap_du_ue, 0, sizeof(f1ap_du_ue));
memset(f1ap_du_inst, 0, sizeof(f1ap_du_inst));
}
......@@ -39,7 +39,7 @@
extern RAN_CONTEXT_t RC;
f1ap_setup_req_t *f1ap_du_data;
f1ap_cudu_ue_inst_t f1ap_du_ue[MAX_eNB];
f1ap_cudu_inst_t f1ap_du_inst[MAX_eNB];
void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) {
......
......@@ -47,7 +47,7 @@
#undef C_RNTI
extern f1ap_setup_req_t *f1ap_du_data;
extern f1ap_cudu_ue_inst_t f1ap_du_ue[MAX_eNB];
extern f1ap_cudu_inst_t f1ap_du_inst[MAX_eNB];
extern RAN_CONTEXT_t RC;
int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
......@@ -585,7 +585,7 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextReleaseRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_du_ue[instance], req->rnti);
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_du_inst[instance], req->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -594,7 +594,7 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextReleaseRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_du_ue[instance], req->rnti);
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_du_inst[instance], req->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -661,7 +661,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
ctxt.rnti = f1ap_get_rnti_by_cu_id(&f1ap_du_ue[instance], ie->value.choice.GNB_CU_UE_F1AP_ID);
ctxt.rnti = f1ap_get_rnti_by_cu_id(&f1ap_du_inst[instance], ie->value.choice.GNB_CU_UE_F1AP_ID);
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
......@@ -669,7 +669,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
const rnti_t rnti = f1ap_get_rnti_by_du_id(&f1ap_du_ue[instance],
const rnti_t rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance],
ie->value.choice.GNB_DU_UE_F1AP_ID);
AssertFatal(ctxt.rnti == rnti,
"RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
......@@ -789,7 +789,7 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextReleaseCompleteIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_du_ue[instance], cplt->rnti);
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_du_inst[instance], cplt->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -798,7 +798,7 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextReleaseCompleteIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_du_ue[instance], cplt->rnti);
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_du_inst[instance], cplt->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional -> currently not used */
......@@ -871,7 +871,7 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
len,
f1ap_du_data->default_sctp_stream_id);
f1ap_remove_ue(&f1ap_du_ue[instance], cplt->rnti);
f1ap_remove_ue(&f1ap_du_inst[instance], cplt->rnti);
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