Commit 1208ae0d authored by Cedric Roux's avatar Cedric Roux Committed by Sakthivel Velumani

replace rnti by ue_id in pdcp

some sdap and gtp files had to be touched, the work is not finished in there

some changes in nr_pdcp_oai_api.c simply assume ue_id is indeed rnti
(will functions in this file be used by cu-up?)
parent e67d1c88
...@@ -33,6 +33,7 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, ...@@ -33,6 +33,7 @@ void apply_macrlc_config(gNB_RRC_INST *rrc,
} }
bool sdap_data_req(protocol_ctxt_t *ctxt_p, bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const ue_id_t ue_id,
const srb_flag_t srb_flag, const srb_flag_t srb_flag,
const rb_id_t rb_id, const rb_id_t rb_id,
const mui_t mui, const mui_t mui,
......
...@@ -404,8 +404,9 @@ static void *enb_tun_read_thread(void *_) ...@@ -404,8 +404,9 @@ static void *enb_tun_read_thread(void *_)
extern int nas_sock_fd[]; extern int nas_sock_fd[];
char rx_buf[NL_MAX_PAYLOAD]; char rx_buf[NL_MAX_PAYLOAD];
int len; int len;
int rnti;
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
ue_id_t ue_id;
int has_ue;
int rb_id = 1; int rb_id = 1;
pthread_setname_np( pthread_self(),"enb_tun_read"); pthread_setname_np( pthread_self(),"enb_tun_read");
...@@ -420,10 +421,10 @@ static void *enb_tun_read_thread(void *_) ...@@ -420,10 +421,10 @@ static void *enb_tun_read_thread(void *_)
LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len); LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len);
nr_pdcp_manager_lock(nr_pdcp_ue_manager); nr_pdcp_manager_lock(nr_pdcp_ue_manager);
rnti = nr_pdcp_get_first_rnti(nr_pdcp_ue_manager); has_ue = nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager, &ue_id);
nr_pdcp_manager_unlock(nr_pdcp_ue_manager); nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
if (rnti == -1) continue; if (!has_ue) continue;
ctxt.module_id = 0; ctxt.module_id = 0;
ctxt.enb_flag = 1; ctxt.enb_flag = 1;
...@@ -432,14 +433,13 @@ static void *enb_tun_read_thread(void *_) ...@@ -432,14 +433,13 @@ static void *enb_tun_read_thread(void *_)
ctxt.subframe = 0; ctxt.subframe = 0;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.brOption = 0; ctxt.brOption = 0;
ctxt.rnti = 0;
ctxt.rnti = rnti;
uint8_t qfi = 7; uint8_t qfi = 7;
bool rqi = 0; bool rqi = 0;
int pdusession_id = 10; int pdusession_id = 10;
sdap_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, sdap_data_req(&ctxt, ue_id, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
PDCP_TRANSMISSION_MODE_DATA, NULL, NULL, qfi, rqi, pdusession_id); PDCP_TRANSMISSION_MODE_DATA, NULL, NULL, qfi, rqi, pdusession_id);
} }
...@@ -452,8 +452,9 @@ static void *ue_tun_read_thread(void *_) ...@@ -452,8 +452,9 @@ static void *ue_tun_read_thread(void *_)
extern int nas_sock_fd[]; extern int nas_sock_fd[];
char rx_buf[NL_MAX_PAYLOAD]; char rx_buf[NL_MAX_PAYLOAD];
int len; int len;
int rnti;
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
ue_id_t ue_id;
int has_ue;
int rb_id = 1; int rb_id = 1;
pthread_setname_np( pthread_self(),"ue_tun_read"); pthread_setname_np( pthread_self(),"ue_tun_read");
...@@ -467,10 +468,10 @@ static void *ue_tun_read_thread(void *_) ...@@ -467,10 +468,10 @@ static void *ue_tun_read_thread(void *_)
LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len); LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len);
nr_pdcp_manager_lock(nr_pdcp_ue_manager); nr_pdcp_manager_lock(nr_pdcp_ue_manager);
rnti = nr_pdcp_get_first_rnti(nr_pdcp_ue_manager); has_ue = nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager, &ue_id);
nr_pdcp_manager_unlock(nr_pdcp_ue_manager); nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
if (rnti == -1) continue; if (!has_ue) continue;
ctxt.module_id = 0; ctxt.module_id = 0;
ctxt.enb_flag = 0; ctxt.enb_flag = 0;
...@@ -479,14 +480,13 @@ static void *ue_tun_read_thread(void *_) ...@@ -479,14 +480,13 @@ static void *ue_tun_read_thread(void *_)
ctxt.subframe = 0; ctxt.subframe = 0;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.brOption = 0; ctxt.brOption = 0;
ctxt.rnti = 0;
ctxt.rnti = rnti;
bool dc = SDAP_HDR_UL_DATA_PDU; bool dc = SDAP_HDR_UL_DATA_PDU;
extern uint8_t nas_qfi; extern uint8_t nas_qfi;
extern uint8_t nas_pduid; extern uint8_t nas_pduid;
sdap_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, sdap_data_req(&ctxt, ue_id, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
PDCP_TRANSMISSION_MODE_DATA, NULL, NULL, nas_qfi, dc, nas_pduid); PDCP_TRANSMISSION_MODE_DATA, NULL, NULL, nas_qfi, dc, nas_pduid);
} }
...@@ -619,13 +619,13 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, ...@@ -619,13 +619,13 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
int i; int i;
if (IS_SOFTMODEM_NOS1 || UE_NAS_USE_TUN) { if (IS_SOFTMODEM_NOS1 || UE_NAS_USE_TUN) {
LOG_D(PDCP, "IP packet received with size %d, to be sent to SDAP interface, UE rnti: %d\n", size, ue->rnti); LOG_D(PDCP, "IP packet received with size %d, to be sent to SDAP interface, UE rnti: %d\n", size, (int)ue->ue_id);
sdap_data_ind(entity->rb_id, sdap_data_ind(entity->rb_id,
entity->is_gnb, entity->is_gnb,
entity->has_sdap, entity->has_sdap,
entity->has_sdapULheader, entity->has_sdapULheader,
entity->pdusession_id, entity->pdusession_id,
ue->rnti, ue->ue_id,
buf, buf,
size); size);
} }
...@@ -638,7 +638,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, ...@@ -638,7 +638,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
} }
LOG_E(PDCP, "%s:%d:%s: fatal, no RB found for ue %d\n", LOG_E(PDCP, "%s:%d:%s: fatal, no RB found for ue %d\n",
__FILE__, __LINE__, __FUNCTION__, ue->rnti); __FILE__, __LINE__, __FUNCTION__, (int)ue->ue_id);
exit(1); exit(1);
rb_found: rb_found:
...@@ -649,7 +649,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, ...@@ -649,7 +649,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
ue->drb[rb_id-1]->has_sdap, ue->drb[rb_id-1]->has_sdap,
ue->drb[rb_id-1]->has_sdapULheader, ue->drb[rb_id-1]->has_sdapULheader,
ue->drb[rb_id-1]->pdusession_id, ue->drb[rb_id-1]->pdusession_id,
ue->rnti, ue->ue_id,
buf, buf,
size); size);
} }
...@@ -673,7 +673,7 @@ static void deliver_pdu_drb(void *_ue, nr_pdcp_entity_t *entity, ...@@ -673,7 +673,7 @@ static void deliver_pdu_drb(void *_ue, nr_pdcp_entity_t *entity,
} }
LOG_E(PDCP, "%s:%d:%s: fatal, no RB found for ue %d\n", LOG_E(PDCP, "%s:%d:%s: fatal, no RB found for ue %d\n",
__FILE__, __LINE__, __FUNCTION__, ue->rnti); __FILE__, __LINE__, __FUNCTION__, (int)ue->ue_id);
exit(1); exit(1);
rb_found: rb_found:
...@@ -685,7 +685,7 @@ rb_found: ...@@ -685,7 +685,7 @@ rb_found:
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.brOption = 0; ctxt.brOption = 0;
ctxt.rnti = ue->rnti; ctxt.rnti = ue->ue_id;
if (RC.nrrrc != NULL && NODE_IS_CU(RC.nrrrc[0]->node_type)) { if (RC.nrrrc != NULL && NODE_IS_CU(RC.nrrrc[0]->node_type)) {
MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0,
GTPV1U_GNB_TUNNEL_DATA_REQ, GTPV1U_GNB_TUNNEL_DATA_REQ,
...@@ -700,7 +700,7 @@ rb_found: ...@@ -700,7 +700,7 @@ rb_found:
req->buffer = gtpu_buffer_p; req->buffer = gtpu_buffer_p;
req->length = size; req->length = size;
req->offset = GTPU_HEADER_OVERHEAD_MAX; req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ue->rnti; req->rnti = ue->ue_id;
req->pdusession_id = rb_id; req->pdusession_id = rb_id;
LOG_I(PDCP, "%s() (drb %d) sending message to gtp size %d\n", LOG_I(PDCP, "%s() (drb %d) sending message to gtp size %d\n",
__func__, rb_id, size); __func__, rb_id, size);
...@@ -732,7 +732,7 @@ static void deliver_sdu_srb(void *_ue, nr_pdcp_entity_t *entity, ...@@ -732,7 +732,7 @@ static void deliver_sdu_srb(void *_ue, nr_pdcp_entity_t *entity,
} }
LOG_E(PDCP, "%s:%d:%s: fatal, no SRB found for ue %d\n", LOG_E(PDCP, "%s:%d:%s: fatal, no SRB found for ue %d\n",
__FILE__, __LINE__, __FUNCTION__, ue->rnti); __FILE__, __LINE__, __FUNCTION__, (int)ue->ue_id);
exit(1); exit(1);
srb_found: srb_found:
...@@ -740,7 +740,7 @@ srb_found: ...@@ -740,7 +740,7 @@ srb_found:
MessageDef *message_p = itti_alloc_new_message(TASK_PDCP_GNB, 0, F1AP_UL_RRC_MESSAGE); MessageDef *message_p = itti_alloc_new_message(TASK_PDCP_GNB, 0, F1AP_UL_RRC_MESSAGE);
AssertFatal(message_p != NULL, "OUT OF MEMORY\n"); AssertFatal(message_p != NULL, "OUT OF MEMORY\n");
f1ap_ul_rrc_message_t *ul_rrc = &F1AP_UL_RRC_MESSAGE(message_p); f1ap_ul_rrc_message_t *ul_rrc = &F1AP_UL_RRC_MESSAGE(message_p);
ul_rrc->rnti = ue->rnti; ul_rrc->rnti = ue->ue_id;
ul_rrc->srb_id = srb_id; ul_rrc->srb_id = srb_id;
ul_rrc->rrc_container = malloc(size); ul_rrc->rrc_container = malloc(size);
AssertFatal(ul_rrc->rrc_container != NULL, "OUT OF MEMORY\n"); AssertFatal(ul_rrc->rrc_container != NULL, "OUT OF MEMORY\n");
...@@ -756,7 +756,7 @@ srb_found: ...@@ -756,7 +756,7 @@ srb_found:
NR_RRC_DCCH_DATA_IND(message_p).dcch_index = srb_id; NR_RRC_DCCH_DATA_IND(message_p).dcch_index = srb_id;
NR_RRC_DCCH_DATA_IND(message_p).sdu_p = rrc_buffer_p; NR_RRC_DCCH_DATA_IND(message_p).sdu_p = rrc_buffer_p;
NR_RRC_DCCH_DATA_IND(message_p).sdu_size = size; NR_RRC_DCCH_DATA_IND(message_p).sdu_size = size;
NR_RRC_DCCH_DATA_IND(message_p).rnti = ue->rnti; NR_RRC_DCCH_DATA_IND(message_p).rnti = ue->ue_id;
itti_send_msg_to_task(TASK_RRC_NRUE, 0, message_p); itti_send_msg_to_task(TASK_RRC_NRUE, 0, message_p);
} }
} }
...@@ -778,7 +778,7 @@ static void deliver_pdu_srb(void *_ue, nr_pdcp_entity_t *entity, ...@@ -778,7 +778,7 @@ static void deliver_pdu_srb(void *_ue, nr_pdcp_entity_t *entity,
} }
LOG_E(PDCP, "%s:%d:%s: fatal, no SRB found for ue %d\n", LOG_E(PDCP, "%s:%d:%s: fatal, no SRB found for ue %d\n",
__FILE__, __LINE__, __FUNCTION__, ue->rnti); __FILE__, __LINE__, __FUNCTION__, (int)ue->ue_id);
exit(1); exit(1);
srb_found: srb_found:
...@@ -796,7 +796,7 @@ srb_found: ...@@ -796,7 +796,7 @@ srb_found:
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.brOption = 0; ctxt.brOption = 0;
ctxt.rnti = ue->rnti; ctxt.rnti = ue->ue_id;
memblock = get_free_mem_block(size, __FUNCTION__); memblock = get_free_mem_block(size, __FUNCTION__);
memcpy(memblock->data, buf, size); memcpy(memblock->data, buf, size);
...@@ -811,7 +811,7 @@ srb_found: ...@@ -811,7 +811,7 @@ srb_found:
F1AP_DL_RRC_MESSAGE (message_p).gNB_CU_ue_id = 0; F1AP_DL_RRC_MESSAGE (message_p).gNB_CU_ue_id = 0;
F1AP_DL_RRC_MESSAGE (message_p).gNB_DU_ue_id = 0; F1AP_DL_RRC_MESSAGE (message_p).gNB_DU_ue_id = 0;
F1AP_DL_RRC_MESSAGE (message_p).old_gNB_DU_ue_id = 0xFFFFFFFF; // unknown F1AP_DL_RRC_MESSAGE (message_p).old_gNB_DU_ue_id = 0xFFFFFFFF; // unknown
F1AP_DL_RRC_MESSAGE (message_p).rnti = ue->rnti; F1AP_DL_RRC_MESSAGE (message_p).rnti = ue->ue_id;
F1AP_DL_RRC_MESSAGE (message_p).srb_id = srb_id; F1AP_DL_RRC_MESSAGE (message_p).srb_id = srb_id;
F1AP_DL_RRC_MESSAGE (message_p).execute_duplication = 1; F1AP_DL_RRC_MESSAGE (message_p).execute_duplication = 1;
F1AP_DL_RRC_MESSAGE (message_p).RAT_frequency_priority_information.en_dc = 0; F1AP_DL_RRC_MESSAGE (message_p).RAT_frequency_priority_information.en_dc = 0;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <pthread.h> #include <pthread.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include "LOG/log.h" #include "LOG/log.h"
...@@ -75,17 +76,17 @@ void nr_pdcp_manager_unlock(nr_pdcp_ue_manager_t *_m) ...@@ -75,17 +76,17 @@ void nr_pdcp_manager_unlock(nr_pdcp_ue_manager_t *_m)
} }
/* must be called with lock acquired */ /* must be called with lock acquired */
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, int rnti) nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, ue_id_t ue_id)
{ {
/* TODO: optimze */ /* TODO: optimze */
nr_pdcp_ue_manager_internal_t *m = _m; nr_pdcp_ue_manager_internal_t *m = _m;
int i; int i;
for (i = 0; i < m->ue_count; i++) for (i = 0; i < m->ue_count; i++)
if (m->ue_list[i]->rnti == rnti) if (m->ue_list[i]->ue_id == ue_id)
return m->ue_list[i]; return m->ue_list[i];
LOG_D(PDCP, "%s:%d:%s: new UE 0x%x\n", __FILE__, __LINE__, __FUNCTION__, rnti); LOG_D(PDCP, "%s:%d:%s: new UE 0x%"PRIx64"\n", __FILE__, __LINE__, __FUNCTION__, ue_id);
m->ue_count++; m->ue_count++;
m->ue_list = realloc(m->ue_list, sizeof(nr_pdcp_ue_t *) * m->ue_count); m->ue_list = realloc(m->ue_list, sizeof(nr_pdcp_ue_t *) * m->ue_count);
...@@ -99,13 +100,13 @@ nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, int rnti) ...@@ -99,13 +100,13 @@ nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, int rnti)
exit(1); exit(1);
} }
m->ue_list[m->ue_count-1]->rnti = rnti; m->ue_list[m->ue_count-1]->ue_id = ue_id;
return m->ue_list[m->ue_count-1]; return m->ue_list[m->ue_count-1];
} }
/* must be called with lock acquired */ /* must be called with lock acquired */
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, int rnti) void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, ue_id_t ue_id)
{ {
nr_pdcp_ue_manager_internal_t *m = _m; nr_pdcp_ue_manager_internal_t *m = _m;
nr_pdcp_ue_t *ue; nr_pdcp_ue_t *ue;
...@@ -113,13 +114,13 @@ void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, int rnti) ...@@ -113,13 +114,13 @@ void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, int rnti)
int j; int j;
for (i = 0; i < m->ue_count; i++) for (i = 0; i < m->ue_count; i++)
if (m->ue_list[i]->rnti == rnti) if (m->ue_list[i]->ue_id == ue_id)
break; break;
if (i == m->ue_count) { if (i == m->ue_count) {
LOG_D(PDCP, "%s:%d:%s: warning: ue %d not found\n", LOG_D(PDCP, "%s:%d:%s: warning: ue 0x%"PRIx64" not found\n",
__FILE__, __LINE__, __FUNCTION__, __FILE__, __LINE__, __FUNCTION__,
rnti); ue_id);
return; return;
} }
...@@ -203,10 +204,11 @@ int nr_pdcp_manager_get_ue_count(nr_pdcp_ue_manager_t *_m) ...@@ -203,10 +204,11 @@ int nr_pdcp_manager_get_ue_count(nr_pdcp_ue_manager_t *_m)
return m->ue_count; return m->ue_count;
} }
int nr_pdcp_get_first_rnti(nr_pdcp_ue_manager_t *_m) int nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager_t *_m, ue_id_t *ret)
{ {
nr_pdcp_ue_manager_internal_t *m = _m; nr_pdcp_ue_manager_internal_t *m = _m;
if (m->ue_count == 0) if (m->ue_count == 0)
return -1; return 0;
return m->ue_list[0]->rnti; *ret = m->ue_list[0]->ue_id;
return 1;
} }
...@@ -24,10 +24,12 @@ ...@@ -24,10 +24,12 @@
#include "nr_pdcp_entity.h" #include "nr_pdcp_entity.h"
#include "platform_types.h"
typedef void nr_pdcp_ue_manager_t; typedef void nr_pdcp_ue_manager_t;
typedef struct nr_pdcp_ue_t { typedef struct nr_pdcp_ue_t {
int rnti; ue_id_t ue_id;
nr_pdcp_entity_t *srb[3]; nr_pdcp_entity_t *srb[3];
nr_pdcp_entity_t *drb[5]; nr_pdcp_entity_t *drb[5];
} nr_pdcp_ue_t; } nr_pdcp_ue_t;
...@@ -43,8 +45,8 @@ int nr_pdcp_manager_get_enb_flag(nr_pdcp_ue_manager_t *m); ...@@ -43,8 +45,8 @@ int nr_pdcp_manager_get_enb_flag(nr_pdcp_ue_manager_t *m);
void nr_pdcp_manager_lock(nr_pdcp_ue_manager_t *m); void nr_pdcp_manager_lock(nr_pdcp_ue_manager_t *m);
void nr_pdcp_manager_unlock(nr_pdcp_ue_manager_t *m); void nr_pdcp_manager_unlock(nr_pdcp_ue_manager_t *m);
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *m, int rnti); nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *m, ue_id_t ue_id);
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *m, int rnti); void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *m, ue_id_t ue_id);
nr_pdcp_ue_t **nr_pdcp_manager_get_ue_list(nr_pdcp_ue_manager_t *_m); nr_pdcp_ue_t **nr_pdcp_manager_get_ue_list(nr_pdcp_ue_manager_t *_m);
int nr_pdcp_manager_get_ue_count(nr_pdcp_ue_manager_t *_m); int nr_pdcp_manager_get_ue_count(nr_pdcp_ue_manager_t *_m);
...@@ -62,7 +64,7 @@ void nr_pdcp_ue_add_drb_pdcp_entity(nr_pdcp_ue_t *ue, int drb_id, ...@@ -62,7 +64,7 @@ void nr_pdcp_ue_add_drb_pdcp_entity(nr_pdcp_ue_t *ue, int drb_id,
/* hacks */ /* hacks */
/***********************************************************************/ /***********************************************************************/
/* returns -1 if no UE */ /* returns 0 if no UE, 1 otherwise */
int nr_pdcp_get_first_rnti(nr_pdcp_ue_manager_t *m); int nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager_t *m, ue_id_t *ret);
#endif /* _NR_PDCP_UE_MANAGER_H_ */ #endif /* _NR_PDCP_UE_MANAGER_H_ */
...@@ -25,6 +25,7 @@ uint8_t nas_qfi; ...@@ -25,6 +25,7 @@ uint8_t nas_qfi;
uint8_t nas_pduid; uint8_t nas_pduid;
bool sdap_data_req(protocol_ctxt_t *ctxt_p, bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const ue_id_t ue_id,
const srb_flag_t srb_flag, const srb_flag_t srb_flag,
const rb_id_t rb_id, const rb_id_t rb_id,
const mui_t mui, const mui_t mui,
...@@ -38,10 +39,10 @@ bool sdap_data_req(protocol_ctxt_t *ctxt_p, ...@@ -38,10 +39,10 @@ bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const bool rqi, const bool rqi,
const int pdusession_id) { const int pdusession_id) {
nr_sdap_entity_t *sdap_entity; nr_sdap_entity_t *sdap_entity;
sdap_entity = nr_sdap_get_entity(ctxt_p->rnti, pdusession_id); sdap_entity = nr_sdap_get_entity(ue_id, pdusession_id);
if(sdap_entity == NULL) { if(sdap_entity == NULL) {
LOG_E(SDAP, "%s:%d:%s: Entity not found with ue rnti: %x and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ctxt_p->rnti, pdusession_id); LOG_E(SDAP, "%s:%d:%s: Entity not found with ue: 0x%"PRIx64" and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ue_id, pdusession_id);
return 0; return 0;
} }
...@@ -66,11 +67,11 @@ void sdap_data_ind(rb_id_t pdcp_entity, ...@@ -66,11 +67,11 @@ void sdap_data_ind(rb_id_t pdcp_entity,
int has_sdap, int has_sdap,
int has_sdapULheader, int has_sdapULheader,
int pdusession_id, int pdusession_id,
int rnti, ue_id_t ue_id,
char *buf, char *buf,
int size) { int size) {
nr_sdap_entity_t *sdap_entity; nr_sdap_entity_t *sdap_entity;
sdap_entity = nr_sdap_get_entity(rnti, pdusession_id); sdap_entity = nr_sdap_get_entity(ue_id, pdusession_id);
if(sdap_entity == NULL) { if(sdap_entity == NULL) {
LOG_E(SDAP, "%s:%d:%s: Entity not found\n", __FILE__, __LINE__, __FUNCTION__); LOG_E(SDAP, "%s:%d:%s: Entity not found\n", __FILE__, __LINE__, __FUNCTION__);
...@@ -83,7 +84,7 @@ void sdap_data_ind(rb_id_t pdcp_entity, ...@@ -83,7 +84,7 @@ void sdap_data_ind(rb_id_t pdcp_entity,
has_sdap, has_sdap,
has_sdapULheader, has_sdapULheader,
pdusession_id, pdusession_id,
rnti, ue_id,
buf, buf,
size); size);
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
* Uplink - nrUE * Uplink - nrUE
*/ */
bool sdap_data_req(protocol_ctxt_t *ctxt_p, bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const ue_id_t ue_id,
const srb_flag_t srb_flag, const srb_flag_t srb_flag,
const rb_id_t rb_id, const rb_id_t rb_id,
const mui_t mui, const mui_t mui,
...@@ -57,7 +58,7 @@ void sdap_data_ind(rb_id_t pdcp_entity, ...@@ -57,7 +58,7 @@ void sdap_data_ind(rb_id_t pdcp_entity,
int has_sdap, int has_sdap,
int has_sdapULheader, int has_sdapULheader,
int pdusession_id, int pdusession_id,
int rnti, ue_id_t ue_id,
char *buf, char *buf,
int size int size
); );
......
...@@ -171,7 +171,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, ...@@ -171,7 +171,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
int has_sdap, int has_sdap,
int has_sdapHeader, int has_sdapHeader,
int pdusession_id, int pdusession_id,
int rnti, ue_id_t ue_id,
char *buf, char *buf,
int size) { int size) {
/* The offset of the SDAP header, it might be 0 if the has_sdap is not true in the pdcp entity. */ /* The offset of the SDAP header, it might be 0 if the has_sdap is not true in the pdcp entity. */
...@@ -203,13 +203,13 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, ...@@ -203,13 +203,13 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
sizeof(gtpv1u_gnb_tunnel_data_req_t) sizeof(gtpv1u_gnb_tunnel_data_req_t)
+ size + GTPU_HEADER_OVERHEAD_MAX - offset); + size + GTPU_HEADER_OVERHEAD_MAX - offset);
AssertFatal(message_p != NULL, "OUT OF MEMORY"); AssertFatal(message_p != NULL, "OUT OF MEMORY");
gtpv1u_gnb_tunnel_data_req_t *req = &GTPV1U_GNB_TUNNEL_DATA_REQ(message_p); gtpv1u_gnb_tunnel_data_req_t *req = &GTPV1U_TUNNEL_DATA_REQ(message_p);
uint8_t *gtpu_buffer_p = (uint8_t *) (req + 1); uint8_t *gtpu_buffer_p = (uint8_t *) (req + 1);
memcpy(gtpu_buffer_p + GTPU_HEADER_OVERHEAD_MAX, buf + offset, size - offset); memcpy(gtpu_buffer_p + GTPU_HEADER_OVERHEAD_MAX, buf + offset, size - offset);
req->buffer = gtpu_buffer_p; req->buffer = gtpu_buffer_p;
req->length = size - offset; req->length = size - offset;
req->offset = GTPU_HEADER_OVERHEAD_MAX; req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = rnti; req->rnti = ur_id;
req->pdusession_id = pdusession_id; req->pdusession_id = pdusession_id;
LOG_D(SDAP, "%s() sending message to gtp size %d\n", __func__, size-offset); LOG_D(SDAP, "%s() sending message to gtp size %d\n", __func__, size-offset);
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
...@@ -245,7 +245,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, ...@@ -245,7 +245,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
if(!entity->qfi2drb_table[sdap_hdr->QFI].drb_id && entity->default_drb){ if(!entity->qfi2drb_table[sdap_hdr->QFI].drb_id && entity->default_drb){
nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI); nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI);
rb_id_t sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, sdap_hdr->QFI); rb_id_t sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, sdap_hdr->QFI);
entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu); entity->sdap_submit_ctrl_pdu(ue_id, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
} }
/* /*
...@@ -261,7 +261,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, ...@@ -261,7 +261,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
has_sdapHeader ){ has_sdapHeader ){
nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI); nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI);
rb_id_t sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, sdap_hdr->QFI); rb_id_t sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, sdap_hdr->QFI);
entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu); entity->sdap_submit_ctrl_pdu(ue_id, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
} }
/* /*
......
...@@ -104,7 +104,7 @@ typedef struct nr_sdap_entity_s { ...@@ -104,7 +104,7 @@ typedef struct nr_sdap_entity_s {
int has_sdap, int has_sdap,
int has_sdapULheader, int has_sdapULheader,
int pdusession_id, int pdusession_id,
int rnti, ue_id_t ue_id,
char *buf, char *buf,
int size); int size);
......
...@@ -20,6 +20,7 @@ typedef bool (*gtpCallback)(protocol_ctxt_t *ctxt_pP, ...@@ -20,6 +20,7 @@ typedef bool (*gtpCallback)(protocol_ctxt_t *ctxt_pP,
const uint32_t *destinationL2Id); const uint32_t *destinationL2Id);
typedef bool (*gtpCallbackSDAP)(protocol_ctxt_t *ctxt_pP, typedef bool (*gtpCallbackSDAP)(protocol_ctxt_t *ctxt_pP,
const ue_id_t ue_id,
const srb_flag_t srb_flagP, const srb_flag_t srb_flagP,
const rb_id_t rb_idP, const rb_id_t rb_idP,
const mui_t muiP, const mui_t muiP,
......
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