diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-31 18:45:59 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-04-03 02:13:04 +0200 |
commit | 4d3a66b3f8d39ecf1eefbe44d2bea28698ed8dd5 (patch) | |
tree | 8789a6be41cc342fe075c5123138ec849107d8d2 /src | |
parent | ae73d2b16f8c80afd60d37a8b7d60773c207ee35 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/libmsc/gsm_04_08.c | 8 | ||||
-rw-r--r-- | src/libmsc/msc_vty.c | 2 | ||||
-rw-r--r-- | src/libmsc/osmo_msc.c | 30 | ||||
-rw-r--r-- | src/libmsc/subscr_conn.c | 18 | ||||
-rw-r--r-- | src/libmsc/transaction.c | 4 |
5 files changed, 31 insertions, 31 deletions
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 105bd1f30..1bb6fa76d 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -393,7 +393,7 @@ int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg) 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 @@ int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *ms 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 @@ int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *ms } 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 @@ static int gsm48_rx_rr_pag_resp(struct gsm_subscriber_connection *conn, struct m 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 b96f6cdbe..33613e959 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -481,7 +481,7 @@ static void vty_dump_one_conn(struct vty *vty, const struct gsm_subscriber_conne 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 62a7e8a22..34f705cbb 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -88,16 +88,16 @@ void subscr_conn_release_when_unused(struct gsm_subscriber_connection *conn) { 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 @@ int msc_compl_l3(struct gsm_subscriber_connection *conn, 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 @@ void msc_subscr_con_cleanup(struct gsm_subscriber_connection *conn) 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 @@ static void msc_subscr_conn_release_all(struct gsm_subscriber_connection *conn, } } -/* 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 @@ void msc_subscr_conn_close(struct gsm_subscriber_connection *conn, 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 ca93a0369..248c463eb 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -225,7 +225,7 @@ static void subscr_conn_fsm_cleanup(struct osmo_fsm_inst *fi, 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 @@ int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id) 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 @@ int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id) "%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 @@ bool msc_subscr_conn_is_accepted(const struct gsm_subscriber_connection *conn) 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 @@ void msc_subscr_conn_communicating(struct gsm_subscriber_connection *conn) /* 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 4a3b064db..5b033dc80 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -158,8 +158,8 @@ void trans_free(struct gsm_trans *trans) 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); |