Max has uploaded this change for review. ( https://gerrit.osmocom.org/12519


Change subject: transaction: drop unused ti_flag
......................................................................

transaction: drop unused ti_flag

The ti_flag parameter in trans_assign_trans_id() is undocumented and
unused. It's unclear what was the initial intention for it so let's just
drop it to avoid confusion.

Change-Id: Ie11999900b1789652ee078d34636dcda1e137eb0
---
M include/osmocom/msc/transaction.h
M src/libmsc/gsm_04_08_cc.c
M src/libmsc/gsm_04_11.c
M src/libmsc/gsm_09_11.c
M src/libmsc/transaction.c
5 files changed, 8 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/19/12519/1

diff --git a/include/osmocom/msc/transaction.h 
b/include/osmocom/msc/transaction.h
index 6e67f39..2826af7 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -110,7 +110,7 @@
 void trans_free(struct gsm_trans *trans);

 int trans_assign_trans_id(const struct gsm_network *net, const struct 
vlr_subscr *vsub,
-                         uint8_t protocol, uint8_t ti_flag);
+                         uint8_t protocol);
 struct gsm_trans *trans_has_conn(const struct ran_conn *conn);
 void trans_conn_closed(const struct ran_conn *conn);

diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index be9a451..b91fbc8 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -631,7 +631,7 @@

        /* Get free transaction_id */
        trans_id = trans_assign_trans_id(trans->net, trans->vsub,
-                                        GSM48_PDISC_CC, 0);
+                                        GSM48_PDISC_CC);
        if (trans_id < 0) {
                /* no free transaction ID */
                rc = mncc_release_ind(trans->net, trans, trans->callref,
diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index 788a0a9..96eaa30 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -1005,7 +1005,7 @@
        LOGP(DLSMS, LOGL_INFO, "Going to send a MT SMS\n");

        /* Generate a new transaction ID */
-       tid = trans_assign_trans_id(net, vsub, GSM48_PDISC_SMS, 0);
+       tid = trans_assign_trans_id(net, vsub, GSM48_PDISC_SMS);
        if (tid == -1) {
                LOGP(DLSMS, LOGL_ERROR, "No available transaction IDs\n");
                return NULL;
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index 3ee6e92..0461e79 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -308,7 +308,7 @@

        /* Assign transaction ID */
        tid = trans_assign_trans_id(trans->net,
-               trans->vsub, GSM48_PDISC_NC_SS, 0);
+               trans->vsub, GSM48_PDISC_NC_SS);
        if (tid < 0) {
                LOGP(DMM, LOGL_ERROR, "No free transaction ID\n");
                /* TODO: inform HLR about this */
diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index f62d6b4..5b29a7a 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -176,22 +176,18 @@
 }

 /*! allocate an unused transaction ID for the given subscriber
- * in the given protocol using the ti_flag specified
+ * in the given protocol
  * \param[in] net GSM network
  * \param[in] subscr Subscriber for which to find ID
  * \param[in] protocol Protocol for whihc to find ID
- * \param[in] ti_flag FIXME
  */
 int trans_assign_trans_id(const struct gsm_network *net, const struct 
vlr_subscr *vsub,
-                         uint8_t protocol, uint8_t ti_flag)
+                         uint8_t protocol)
 {
        struct gsm_trans *trans;
        unsigned int used_tid_bitmask = 0;
        int i, j, h;

-       if (ti_flag)
-               ti_flag = 0x8;
-
        /* generate bitmask of already-used TIDs for this (subscr,proto) */
        llist_for_each_entry(trans, &net->trans_list, entry) {
                if (trans->vsub != vsub ||
@@ -203,10 +199,10 @@

        /* find a new one, trying to go in a 'circular' pattern */
        for (h = 6; h > 0; h--)
-               if (used_tid_bitmask & (1 << (h | ti_flag)))
+               if (used_tid_bitmask & (1 << h))
                        break;
        for (i = 0; i < 7; i++) {
-               j = ((h + i) % 7) | ti_flag;
+               j = (h + i) % 7;
                if ((used_tid_bitmask & (1 << j)) == 0)
                        return j;
        }

--
To view, visit https://gerrit.osmocom.org/12519
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie11999900b1789652ee078d34636dcda1e137eb0
Gerrit-Change-Number: 12519
Gerrit-PatchSet: 1
Gerrit-Owner: Max <[email protected]>

Reply via email to