neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/32911 )
(
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: drop dead code: cnlink.T_RafC ......................................................................
drop dead code: cnlink.T_RafC
This looks like working RANAP RESET handling, but is in fact dead code. Instead of testing and completing this implementation, I will copy the RESET handling FSM from osmo-bsc, which is proven to work well.
See Id3eefdea889a736fd5957b80280fa45b9547b792 "detect in/active CN links by RANAP RESET"
The future patch will start to use transmit_rst(). So instead of dropping now and resurrecting later, let's keep the code -- but it has to be '#if 0'-ed to avoid compiler complaints about the unused function.
Related: SYS#6412 Change-Id: I7cacaec631051cf5420202f2f0dd9665a5565b17 --- M include/osmocom/hnbgw/hnbgw.h M src/osmo-hnbgw/hnbgw_cn.c 2 files changed, 28 insertions(+), 55 deletions(-)
Approvals: neels: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified
diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h index e3ec38b..e67a86a 100644 --- a/include/osmocom/hnbgw/hnbgw.h +++ b/include/osmocom/hnbgw/hnbgw.h @@ -61,24 +61,9 @@ uint32_t cid; /*!< Cell ID */ };
-enum hnbgw_cnlink_state { - /* we have just been initialized or were disconnected */ - CNLINK_S_NULL, - /* establishment of the SUA/SCCP link is pending */ - CNLINK_S_EST_PEND, - /* establishment of the SUA/SCCP link was confirmed */ - CNLINK_S_EST_CONF, - /* we have esnt the RANAP RESET and wait for the ACK */ - CNLINK_S_EST_RST_TX_WAIT_ACK, - /* we have received the RANAP RESET ACK and are active */ - CNLINK_S_EST_ACTIVE, -}; - struct hnbgw_cnlink { struct llist_head list; - enum hnbgw_cnlink_state state; - /* timer for re-transmitting the RANAP Reset */ - struct osmo_timer_list T_RafC; + /* reference to the SCCP User SAP by which we communicate */ struct osmo_sccp_instance *sccp; struct osmo_sccp_user *sccp_user; diff --git a/src/osmo-hnbgw/hnbgw_cn.c b/src/osmo-hnbgw/hnbgw_cn.c index a256b24..d9e35af 100644 --- a/src/osmo-hnbgw/hnbgw_cn.c +++ b/src/osmo-hnbgw/hnbgw_cn.c @@ -37,14 +37,9 @@ #include <osmocom/ranap/ranap_msg_factory.h> #include <osmocom/hnbgw/context_map.h>
-/*********************************************************************** - * Outbound RANAP RESET to CN - ***********************************************************************/ - -void hnbgw_cnlink_change_state(struct hnbgw_cnlink *cnlink, enum hnbgw_cnlink_state state); - -static int transmit_rst(RANAP_CN_DomainIndicator_t domain, - struct osmo_sccp_addr *remote_addr) +#if 0 +this code will soon move to new file cnlink.c +static int transmit_rst(struct hnbgw_cnlink *cnlink) { struct msgb *msg; RANAP_Cause_t cause = { @@ -63,6 +58,7 @@ remote_addr, msg); } +#endif
static int transmit_reset_ack(RANAP_CN_DomainIndicator_t domain, const struct osmo_sccp_addr *remote_addr) @@ -81,35 +77,6 @@ msg); }
-/* Timer callback once T_RafC expires */ -static void cnlink_trafc_cb(void *unused) -{ - transmit_rst(RANAP_CN_DomainIndicator_cs_domain, &g_hnbgw->sccp.iucs_remote_addr); - transmit_rst(RANAP_CN_DomainIndicator_ps_domain, &g_hnbgw->sccp.iups_remote_addr); - hnbgw_cnlink_change_state(g_hnbgw->sccp.cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); - /* The spec states that we should abandon after a configurable - * number of times. We decide to simply continue trying */ -} - -/* change the state of a CN Link */ -void hnbgw_cnlink_change_state(struct hnbgw_cnlink *cnlink, enum hnbgw_cnlink_state state) -{ - switch (state) { - case CNLINK_S_NULL: - case CNLINK_S_EST_PEND: - break; - case CNLINK_S_EST_CONF: - cnlink_trafc_cb(NULL); - break; - case CNLINK_S_EST_RST_TX_WAIT_ACK: - osmo_timer_schedule(&cnlink->T_RafC, 5, 0); - break; - case CNLINK_S_EST_ACTIVE: - osmo_timer_del(&cnlink->T_RafC); - break; - } -} - /*********************************************************************** * Incoming primitives from SCCP User SAP ***********************************************************************/ @@ -148,7 +115,8 @@
rc = ranap_decode_resetacknowledgeies(&ies, &omsg->value);
- hnbgw_cnlink_change_state(cnlink, CNLINK_S_EST_ACTIVE); + /* FUTURE: will do something useful in commit 'detect in/active CN links by RANAP RESET' + * Id3eefdea889a736fd5957b80280fa45b9547b792 */
ranap_free_resetacknowledgeies(&ies); return rc; @@ -527,7 +495,6 @@
cnlink = talloc_zero(g_hnbgw, struct hnbgw_cnlink); INIT_LLIST_HEAD(&cnlink->map_list); - cnlink->T_RafC.cb = cnlink_trafc_cb; cnlink->next_conn_id = 1000;
cnlink->sccp_user = osmo_sccp_user_bind_pc(g_hnbgw->sccp.client, "OsmoHNBGW", sccp_sap_up,