cosmetic: rename gsm_subscriber_connection->conn_fsm to ->fi
Match osmo-bsc's naming of the subscriber connection's FSM instance; 'conn->fi'
makes more sense anyway than 'conn->conn_fsm'.
BTW, an upcoming commit will do away with the legacy from libbsc/libmsc duality
and firmly glue the conn allocation to the fi.
Related: OS#3122
Change-Id: If442f2ba78d9722b1065ec30c9a13f372b6a8caa
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 105bd1f..1bb6fa7 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -393,7 +393,7 @@
DEBUGP(DMM, "LU/new-LAC: %u/%u\n", old_lai.lac, new_lai.lac);
is_utran = (conn->via_ran == RAN_UTRAN_IU);
- lu_fsm = vlr_loc_update(conn->conn_fsm,
+ lu_fsm = vlr_loc_update(conn->fi,
SUBSCR_CONN_E_ACCEPTED,
SUBSCR_CONN_E_CN_CLOSE,
(void*)&conn_from_lu,
@@ -759,7 +759,7 @@
memcpy(conn->classmark.classmark2, classmark2, classmark2_len);
conn->classmark.classmark2_len = classmark2_len;
- if (conn->conn_fsm) {
+ if (conn->fi) {
if (msc_subscr_conn_is_accepted(conn))
return cm_serv_reuse_conn(conn, mi-1);
LOGP(DMM, LOGL_ERROR, "%s: connection already in use\n",
@@ -776,7 +776,7 @@
}
is_utran = (conn->via_ran == RAN_UTRAN_IU);
- vlr_proc_acc_req(conn->conn_fsm,
+ vlr_proc_acc_req(conn->fi,
SUBSCR_CONN_E_ACCEPTED,
SUBSCR_CONN_E_CN_CLOSE,
(void*)&conn_from_cm_service_req,
@@ -1181,7 +1181,7 @@
conn->classmark.classmark2_len = *classmark2_lv;
is_utran = (conn->via_ran == RAN_UTRAN_IU);
- vlr_proc_acc_req(conn->conn_fsm,
+ vlr_proc_acc_req(conn->fi,
SUBSCR_CONN_E_ACCEPTED,
SUBSCR_CONN_E_CN_CLOSE,
(void*)&conn_from_paging_resp,
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index b96f6cd..33613e9 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -481,7 +481,7 @@
conn->use_tokens,
conn->received_cm_service_request ? 'C' : '-',
conn->encr.alg_id,
- conn->conn_fsm ? osmo_fsm_inst_state_name(conn->conn_fsm) : "-",
+ conn->fi ? osmo_fsm_inst_state_name(conn->fi) : "-",
VTY_NEWLINE);
}
diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c
index 62a7e8a..34f705c 100644
--- a/src/libmsc/osmo_msc.c
+++ b/src/libmsc/osmo_msc.c
@@ -88,16 +88,16 @@
{
if (!conn)
return;
- if (!conn->conn_fsm)
+ if (!conn->fi)
return;
- if (!(conn->conn_fsm->state == SUBSCR_CONN_S_ACCEPTED
- || conn->conn_fsm->state == SUBSCR_CONN_S_COMMUNICATING)) {
+ if (!(conn->fi->state == SUBSCR_CONN_S_ACCEPTED
+ || conn->fi->state == SUBSCR_CONN_S_COMMUNICATING)) {
DEBUGP(DMM, "%s: %s: conn still being established (%s)\n",
vlr_subscr_name(conn->vsub), __func__,
- osmo_fsm_inst_state_name(conn->conn_fsm));
+ osmo_fsm_inst_state_name(conn->fi));
return;
}
- osmo_fsm_inst_dispatch(conn->conn_fsm, SUBSCR_CONN_E_RELEASE_WHEN_UNUSED, NULL);
+ osmo_fsm_inst_dispatch(conn->fi, SUBSCR_CONN_E_RELEASE_WHEN_UNUSED, NULL);
}
/* receive a Level 3 Complete message and return MSC_CONN_ACCEPT or
@@ -110,7 +110,7 @@
subscr_conn_release_when_unused(conn);
- /* If this should be kept, the conn->conn_fsm has placed a use_count */
+ /* If this should be kept, the conn->fi has placed a use_count */
msc_subscr_conn_put(conn, MSC_CONN_USE_COMPL_L3);
/* Always return acceptance, because even if the conn was not accepted,
@@ -268,11 +268,11 @@
DEBUGP(DRLL, "Freeing subscriber connection"
" with NULL subscriber\n");
- if (!conn->conn_fsm)
+ if (!conn->fi)
return;
- osmo_fsm_inst_term(conn->conn_fsm,
- (conn->conn_fsm->state == SUBSCR_CONN_S_RELEASED)
+ osmo_fsm_inst_term(conn->fi,
+ (conn->fi->state == SUBSCR_CONN_S_RELEASED)
? OSMO_FSM_TERM_REGULAR
: OSMO_FSM_TERM_ERROR,
NULL);
@@ -322,8 +322,8 @@
}
}
-/* If the conn->conn_fsm is still present, dispatch SUBSCR_CONN_E_CN_CLOSE
- * event to gracefully terminate the connection. If the conn_fsm is already
+/* If the conn->fi is still present, dispatch SUBSCR_CONN_E_CN_CLOSE
+ * event to gracefully terminate the connection. If the fi is already
* cleared, call msc_subscr_conn_release_all() to take release actions.
* \param cause a GSM_CAUSE_* constant, e.g. GSM_CAUSE_AUTH_FAILED.
*/
@@ -338,22 +338,22 @@
vlr_subscr_name(conn->vsub), cause);
return;
}
- if (!conn->conn_fsm) {
+ if (!conn->fi) {
DEBUGP(DMM, "msc_subscr_conn_close(vsub=%s, cause=%u): no conn fsm,"
" releasing directly without release event.\n",
vlr_subscr_name(conn->vsub), cause);
- /* In case of an IMSI Detach, we don't have conn_fsm. Release
+ /* In case of an IMSI Detach, we don't have fi. Release
* anyway to ensure a timely Iu Release / BSSMAP Clear. */
msc_subscr_conn_release_all(conn, cause);
return;
}
- if (conn->conn_fsm->state == SUBSCR_CONN_S_RELEASED) {
+ if (conn->fi->state == SUBSCR_CONN_S_RELEASED) {
DEBUGP(DMM, "msc_subscr_conn_close(vsub=%s, cause=%u):"
" conn fsm already releasing, ignore.\n",
vlr_subscr_name(conn->vsub), cause);
return;
}
- osmo_fsm_inst_dispatch(conn->conn_fsm, SUBSCR_CONN_E_CN_CLOSE, &cause);
+ osmo_fsm_inst_dispatch(conn->fi, SUBSCR_CONN_E_CN_CLOSE, &cause);
}
/* increment the ref-count. Needs to be called by every user */
diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c
index ca93a03..248c463 100644
--- a/src/libmsc/subscr_conn.c
+++ b/src/libmsc/subscr_conn.c
@@ -225,7 +225,7 @@
if (!conn)
return;
- conn->conn_fsm = NULL;
+ conn->fi = NULL;
msc_subscr_conn_close(conn, cause);
msc_subscr_conn_put(conn, MSC_CONN_USE_FSM);
}
@@ -329,7 +329,7 @@
struct osmo_fsm_inst *fi;
OSMO_ASSERT(conn);
- if (conn->conn_fsm) {
+ if (conn->fi) {
LOGP(DMM, LOGL_ERROR,
"%s: Error: connection already in use\n", id);
return -EINVAL;
@@ -349,8 +349,8 @@
"%s: Failed to allocate subscr conn master FSM\n", id);
return -ENOMEM;
}
- conn->conn_fsm = fi;
- osmo_fsm_inst_dispatch(conn->conn_fsm, SUBSCR_CONN_E_START, NULL);
+ conn->fi = fi;
+ osmo_fsm_inst_dispatch(conn->fi, SUBSCR_CONN_E_START, NULL);
return 0;
}
@@ -360,10 +360,10 @@
return false;
if (!conn->vsub)
return false;
- if (!conn->conn_fsm)
+ if (!conn->fi)
return false;
- if (!(conn->conn_fsm->state == SUBSCR_CONN_S_ACCEPTED
- || conn->conn_fsm->state == SUBSCR_CONN_S_COMMUNICATING))
+ if (!(conn->fi->state == SUBSCR_CONN_S_ACCEPTED
+ || conn->fi->state == SUBSCR_CONN_S_COMMUNICATING))
return false;
return true;
}
@@ -374,8 +374,8 @@
/* This function is called to indicate that *some* communication is happening with the phone.
* Late in the process, that may be a Release Confirm and the FSM and conn are already in
* teardown. No need to signal SUBSCR_CONN_E_COMMUNICATING then. */
- if (conn->conn_fsm)
- osmo_fsm_inst_dispatch(conn->conn_fsm, SUBSCR_CONN_E_COMMUNICATING, NULL);
+ if (conn->fi)
+ osmo_fsm_inst_dispatch(conn->fi, SUBSCR_CONN_E_COMMUNICATING, NULL);
}
void msc_subscr_conn_init(void)
diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index 4a3b064..5b033dc 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -158,8 +158,8 @@
trans->conn = NULL;
talloc_free(trans);
- /* trans_free() should always happen while the conn_fsm is still around. */
- OSMO_ASSERT(conn->conn_fsm);
+ /* trans_free() should always happen while the fi is still around. */
+ OSMO_ASSERT(conn->fi);
/* Possibly this was the last transaction used by this conn. */
subscr_conn_release_when_unused(conn);