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) {
///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",
//instance, msg_name_p);
if (rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)
&& 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;
}
AssertFatal(false, "Removed double mechanism for same feature: now delete_tunnel() function should be called\n");
break;
#endif
......
......@@ -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) {
protocol_ctxt_t ctxt;
rrc_gNB_ue_context_t *ue_context;
MessageDef *msg_delete_tunnels_p;
int e_rab;
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) {
rrc_rlc_remove_ue(&ctxt);
mac_remove_nr_ue(rrc->module_id, rnti);
/* delete gtp tunnel */
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_GNB, 0, GTPV1U_ENB_DELETE_TUNNEL_REQ);
memset(&GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
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);
gtpv1u_enb_delete_tunnel_req_t tmp={0};
tmp.rnti=rnti;
tmp.from_gnb=1;
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);
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++] =
ue_context->ue_context.gnb_gtp_ebi[e_rab];
tmp.eps_bearer_id[tmp.num_erab++]= ue_context->ue_context.gnb_gtp_ebi[e_rab];
// erase data
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]));
ue_context->ue_context.gnb_gtp_ebi[e_rab] = 0;
}
itti_send_msg_to_task(TASK_VARIABLE, rrc->module_id, msg_delete_tunnels_p);
gtpv1u_delete_s1u_tunnel(rrc->module_id, &tmp);
/* remove context */
rrc_gNB_remove_ue_context(&ctxt, rrc, ue_context);
}
......@@ -272,7 +272,7 @@ static int sync_to_gps(openair0_device *device) {
*/
static int trx_usrp_start(openair0_device *device) {
usrp_state_t *s = (usrp_state_t *)device->priv;
#if 0
// setup GPIO for TDD, GPIO(4) = ATR_RX
//set data direction register (DDR) to output
s->usrp->set_gpio_attr("FP0", "DDR", 0xfff, 0xfff);
......@@ -286,6 +286,7 @@ static int trx_usrp_start(openair0_device *device) {
// set the output pins to 1
s->usrp->set_gpio_attr("FP0", "OUT", 7<<7, 0xf80);
#endif
s->wait_for_first_pps = 1;
s->rx_count = 0;
s->tx_count = 0;
......@@ -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);
usrp_state_t *s ;
if ( device->priv == NULL) {
s=(usrp_state_t *)calloc(sizeof(usrp_state_t),1);
device->priv=s;
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->trx_start_func = trx_usrp_start;
......@@ -1000,10 +996,12 @@ extern "C" {
if (device_adds.size() == 0) {
LOG_E(HW,"No USRP Device Found.\n ");
free(s);
abort();
return -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");
free(s);
abort();
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