Commit 6fb9f92b authored by Laurent THOMAS's avatar Laurent THOMAS

replace itti message GTPV1U_DELETE_TUNNEL_REQ by direct call to gtpv1u_delete_s1u_tunnel()

parent 7076ac9a
...@@ -2946,11 +2946,7 @@ void *rrc_gnb_task(void *args_p) { ...@@ -2946,11 +2946,7 @@ void *rrc_gnb_task(void *args_p) {
///Nothing to do. Apparently everything is done in S1AP processing ///Nothing to do. Apparently everything is done in S1AP processing
//LOG_I(RRC, "[eNB %d] Received message %s, not processed because procedure not synched\n", //LOG_I(RRC, "[eNB %d] Received message %s, not processed because procedure not synched\n",
//instance, msg_name_p); //instance, msg_name_p);
if (rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti) AssertFatal(false, "Removed double mechanism for same feature: now delete_tunnel() function should be called\n");
&& rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc > 0) {
rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc =
rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_thres_rrc;
}
break; break;
#endif #endif
......
...@@ -402,7 +402,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ...@@ -402,7 +402,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) { void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) {
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
rrc_gNB_ue_context_t *ue_context; rrc_gNB_ue_context_t *ue_context;
MessageDef *msg_delete_tunnels_p;
int e_rab; int e_rab;
LOG_D(RRC, "calling rrc_remove_nsa_user rnti %d\n", rnti); LOG_D(RRC, "calling rrc_remove_nsa_user rnti %d\n", rnti);
...@@ -419,25 +418,18 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) { ...@@ -419,25 +418,18 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) {
rrc_rlc_remove_ue(&ctxt); rrc_rlc_remove_ue(&ctxt);
mac_remove_nr_ue(rrc->module_id, rnti); mac_remove_nr_ue(rrc->module_id, rnti);
gtpv1u_enb_delete_tunnel_req_t tmp={0};
/* delete gtp tunnel */ tmp.rnti=rnti;
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_GNB, 0, GTPV1U_ENB_DELETE_TUNNEL_REQ); tmp.from_gnb=1;
memset(&GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p))); LOG_D(RRC, "ue_context->ue_context.nb_of_e_rabs %d will be deleted for rnti %d\n", ue_context->ue_context.nb_of_e_rabs, rnti);
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = rnti;
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).from_gnb = 1;
LOG_D(RRC, "ue_context->ue_context.nb_of_e_rabs %d\n", ue_context->ue_context.nb_of_e_rabs);
for (e_rab = 0; e_rab < ue_context->ue_context.nb_of_e_rabs; e_rab++) { for (e_rab = 0; e_rab < ue_context->ue_context.nb_of_e_rabs; e_rab++) {
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] = tmp.eps_bearer_id[tmp.num_erab++]= ue_context->ue_context.gnb_gtp_ebi[e_rab];
ue_context->ue_context.gnb_gtp_ebi[e_rab];
// erase data // erase data
ue_context->ue_context.gnb_gtp_teid[e_rab] = 0; ue_context->ue_context.gnb_gtp_teid[e_rab] = 0;
memset(&ue_context->ue_context.gnb_gtp_addrs[e_rab], 0, sizeof(ue_context->ue_context.gnb_gtp_addrs[e_rab])); memset(&ue_context->ue_context.gnb_gtp_addrs[e_rab], 0, sizeof(ue_context->ue_context.gnb_gtp_addrs[e_rab]));
ue_context->ue_context.gnb_gtp_ebi[e_rab] = 0; ue_context->ue_context.gnb_gtp_ebi[e_rab] = 0;
} }
gtpv1u_delete_s1u_tunnel(rrc->module_id, &tmp);
itti_send_msg_to_task(TASK_VARIABLE, rrc->module_id, msg_delete_tunnels_p);
/* remove context */ /* remove context */
rrc_gNB_remove_ue_context(&ctxt, rrc, ue_context); rrc_gNB_remove_ue_context(&ctxt, rrc, ue_context);
} }
...@@ -272,7 +272,7 @@ static int sync_to_gps(openair0_device *device) { ...@@ -272,7 +272,7 @@ static int sync_to_gps(openair0_device *device) {
*/ */
static int trx_usrp_start(openair0_device *device) { static int trx_usrp_start(openair0_device *device) {
usrp_state_t *s = (usrp_state_t *)device->priv; usrp_state_t *s = (usrp_state_t *)device->priv;
#if 0
// setup GPIO for TDD, GPIO(4) = ATR_RX // setup GPIO for TDD, GPIO(4) = ATR_RX
//set data direction register (DDR) to output //set data direction register (DDR) to output
s->usrp->set_gpio_attr("FP0", "DDR", 0xfff, 0xfff); s->usrp->set_gpio_attr("FP0", "DDR", 0xfff, 0xfff);
...@@ -286,6 +286,7 @@ static int trx_usrp_start(openair0_device *device) { ...@@ -286,6 +286,7 @@ static int trx_usrp_start(openair0_device *device) {
// set the output pins to 1 // set the output pins to 1
s->usrp->set_gpio_attr("FP0", "OUT", 7<<7, 0xf80); s->usrp->set_gpio_attr("FP0", "OUT", 7<<7, 0xf80);
#endif
s->wait_for_first_pps = 1; s->wait_for_first_pps = 1;
s->rx_count = 0; s->rx_count = 0;
s->tx_count = 0; s->tx_count = 0;
...@@ -953,14 +954,9 @@ extern "C" { ...@@ -953,14 +954,9 @@ extern "C" {
LOG_I(HW, "openair0_cfg[0].clock_source == '%d' (internal = %d, external = %d)\n", openair0_cfg[0].clock_source,internal,external); LOG_I(HW, "openair0_cfg[0].clock_source == '%d' (internal = %d, external = %d)\n", openair0_cfg[0].clock_source,internal,external);
usrp_state_t *s ; usrp_state_t *s ;
if ( device->priv == NULL) {
s=(usrp_state_t *)calloc(sizeof(usrp_state_t),1); s=(usrp_state_t *)calloc(sizeof(usrp_state_t),1);
device->priv=s; device->priv=s;
AssertFatal( s!=NULL,"USRP device: memory allocation failure\n"); AssertFatal( s!=NULL,"USRP device: memory allocation failure\n");
} else {
LOG_E(HW, "multiple device init detected\n");
return 0;
}
device->openair0_cfg = openair0_cfg; device->openair0_cfg = openair0_cfg;
device->trx_start_func = trx_usrp_start; device->trx_start_func = trx_usrp_start;
...@@ -1000,10 +996,12 @@ extern "C" { ...@@ -1000,10 +996,12 @@ extern "C" {
if (device_adds.size() == 0) { if (device_adds.size() == 0) {
LOG_E(HW,"No USRP Device Found.\n "); LOG_E(HW,"No USRP Device Found.\n ");
free(s); free(s);
abort();
return -1; return -1;
} else if (device_adds.size() > 1) { } else if (device_adds.size() > 1) {
LOG_E(HW,"More than one USRP Device Found. Please specify device more precisely in config file.\n"); LOG_E(HW,"More than one USRP Device Found. Please specify device more precisely in config file.\n");
free(s); free(s);
abort();
return -1; return -1;
} }
......
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