fixed the problem of pdu-session replace e-rab
This commit is contained in:
@@ -340,6 +340,8 @@ typedef struct gNB_RRC_UE_s {
|
|||||||
uint8_t setup_e_rabs;
|
uint8_t setup_e_rabs;
|
||||||
/* Total number of pdu session already setup in the list */
|
/* Total number of pdu session already setup in the list */
|
||||||
uint8_t setup_pdu_sessions;
|
uint8_t setup_pdu_sessions;
|
||||||
|
/* Number of e_rab to be setup in the list */
|
||||||
|
uint8_t nb_of_e_rabs;
|
||||||
/* Number of pdu session to be setup in the list */
|
/* Number of pdu session to be setup in the list */
|
||||||
uint8_t nb_of_pdusessions;
|
uint8_t nb_of_pdusessions;
|
||||||
/* Number of e_rab to be modified in the list */
|
/* Number of e_rab to be modified in the list */
|
||||||
@@ -347,6 +349,8 @@ typedef struct gNB_RRC_UE_s {
|
|||||||
uint8_t nb_of_failed_e_rabs;
|
uint8_t nb_of_failed_e_rabs;
|
||||||
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||||
/* list of e_rab to be setup by RRC layers */
|
/* list of e_rab to be setup by RRC layers */
|
||||||
|
/* list of pdu session to be setup by RRC layers */
|
||||||
|
e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||||
pdu_session_param_t pdusession[NR_NB_RB_MAX];//[NGAP_MAX_PDU_SESSION];
|
pdu_session_param_t pdusession[NR_NB_RB_MAX];//[NGAP_MAX_PDU_SESSION];
|
||||||
//release e_rabs
|
//release e_rabs
|
||||||
uint8_t nb_release_of_e_rabs;
|
uint8_t nb_release_of_e_rabs;
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ rrc_gNB_allocate_new_UE_context(
|
|||||||
new_p->local_uid = nr_uid_linear_allocator_new(rrc_instance_pP);
|
new_p->local_uid = nr_uid_linear_allocator_new(rrc_instance_pP);
|
||||||
|
|
||||||
for(int i = 0; i < NB_RB_MAX; i++) {
|
for(int i = 0; i < NB_RB_MAX; i++) {
|
||||||
|
new_p->ue_context.e_rab[i].xid = -1;
|
||||||
new_p->ue_context.pdusession[i].xid = -1;
|
new_p->ue_context.pdusession[i].xid = -1;
|
||||||
new_p->ue_context.modify_e_rab[i].xid = -1;
|
new_p->ue_context.modify_e_rab[i].xid = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,14 +186,14 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
|
|||||||
if (m->nb_e_rabs_tobeadded>0) {
|
if (m->nb_e_rabs_tobeadded>0) {
|
||||||
for (int i=0; i<m->nb_e_rabs_tobeadded; i++) {
|
for (int i=0; i<m->nb_e_rabs_tobeadded; i++) {
|
||||||
// Add the new E-RABs at the corresponding rrc ue context of the gNB
|
// Add the new E-RABs at the corresponding rrc ue context of the gNB
|
||||||
ue_context_p->ue_context.pdusession[i].param.pdusession_id = m->e_rabs_tobeadded[i].e_rab_id;
|
ue_context_p->ue_context.e_rab[i].param.e_rab_id = m->e_rabs_tobeadded[i].e_rab_id;
|
||||||
ue_context_p->ue_context.pdusession[i].param.gtp_teid = m->e_rabs_tobeadded[i].gtp_teid;
|
ue_context_p->ue_context.e_rab[i].param.gtp_teid = m->e_rabs_tobeadded[i].gtp_teid;
|
||||||
memcpy(&ue_context_p->ue_context.pdusession[i].param.upf_addr, &m->e_rabs_tobeadded[i].sgw_addr, sizeof(transport_layer_addr_t));
|
memcpy(&ue_context_p->ue_context.e_rab[i].param.sgw_addr, &m->e_rabs_tobeadded[i].sgw_addr, sizeof(transport_layer_addr_t));
|
||||||
ue_context_p->ue_context.nb_of_pdusessions++;
|
ue_context_p->ue_context.nb_of_e_rabs++;
|
||||||
//Fill the required E-RAB specific information for the creation of the S1-U tunnel between the gNB and the SGW
|
//Fill the required E-RAB specific information for the creation of the S1-U tunnel between the gNB and the SGW
|
||||||
create_tunnel_req.eps_bearer_id[i] = ue_context_p->ue_context.pdusession[i].param.pdusession_id;
|
create_tunnel_req.eps_bearer_id[i] = ue_context_p->ue_context.e_rab[i].param.e_rab_id;
|
||||||
create_tunnel_req.sgw_S1u_teid[i] = ue_context_p->ue_context.pdusession[i].param.gtp_teid;
|
create_tunnel_req.sgw_S1u_teid[i] = ue_context_p->ue_context.e_rab[i].param.gtp_teid;
|
||||||
memcpy(&create_tunnel_req.sgw_addr[i], &ue_context_p->ue_context.pdusession[i].param.upf_addr, sizeof(transport_layer_addr_t));
|
memcpy(&create_tunnel_req.sgw_addr[i], &ue_context_p->ue_context.e_rab[i].param.sgw_addr, sizeof(transport_layer_addr_t));
|
||||||
inde_list[i] = i;
|
inde_list[i] = i;
|
||||||
LOG_I(RRC,"S1-U tunnel: index %d target sgw ip %d.%d.%d.%d length %d gtp teid %u\n",
|
LOG_I(RRC,"S1-U tunnel: index %d target sgw ip %d.%d.%d.%d length %d gtp teid %u\n",
|
||||||
i,
|
i,
|
||||||
@@ -220,8 +220,8 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
|
|||||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).nb_e_rabs_admitted_tobeadded = m->nb_e_rabs_tobeadded;
|
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).nb_e_rabs_admitted_tobeadded = m->nb_e_rabs_tobeadded;
|
||||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).target_assoc_id = m->target_assoc_id;
|
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).target_assoc_id = m->target_assoc_id;
|
||||||
|
|
||||||
for(int i=0; i<ue_context_p->ue_context.nb_of_pdusessions; i++) {
|
for(int i=0; i<ue_context_p->ue_context.nb_of_e_rabs; i++) {
|
||||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].e_rab_id = ue_context_p->ue_context.pdusession[i].param.pdusession_id;
|
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].e_rab_id = ue_context_p->ue_context.e_rab[i].param.e_rab_id;
|
||||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gtp_teid = create_tunnel_resp.enb_S1u_teid[i];
|
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gtp_teid = create_tunnel_resp.enb_S1u_teid[i];
|
||||||
memcpy(&X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr, &create_tunnel_resp.enb_addr, sizeof(transport_layer_addr_t));
|
memcpy(&X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr, &create_tunnel_resp.enb_addr, sizeof(transport_layer_addr_t));
|
||||||
//The length field in the X2AP targetting structure is expected in bits but the create_tunnel_resp returns the address length in bytes
|
//The length field in the X2AP targetting structure is expected in bits but the create_tunnel_resp returns the address length in bytes
|
||||||
|
|||||||
Reference in New Issue
Block a user