fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/35578?usp=email )


Change subject: mobile: store MNCC Bearer Capability in CC transaction
......................................................................

mobile: store MNCC Bearer Capability in CC transaction

We will need to know the current Bearer Capability of a CC
transaction in the upcoming patches adding CSD support.

Change-Id: Ifc3ecf832a552c65444f49711ac836b6cd984715
Related: OS#4396
---
M src/host/layer23/include/osmocom/bb/mobile/transaction.h
M src/host/layer23/src/mobile/gsm48_cc.c
2 files changed, 34 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/78/35578/1

diff --git a/src/host/layer23/include/osmocom/bb/mobile/transaction.h 
b/src/host/layer23/include/osmocom/bb/mobile/transaction.h
index 103ae4e..c1e9429 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/transaction.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/transaction.h
@@ -38,6 +38,7 @@
                        int T308_second;        /* used to send release again */
                        struct osmo_timer_list timer;
                        struct gsm_mncc msg;    /* stores 
setup/disconnect/release message */
+                       struct gsm_mncc_bearer_cap *bcap;
                } cc;
                struct {
                        /* current supp.serv. state */
diff --git a/src/host/layer23/src/mobile/gsm48_cc.c 
b/src/host/layer23/src/mobile/gsm48_cc.c
index 523ae99..485426b 100644
--- a/src/host/layer23/src/mobile/gsm48_cc.c
+++ b/src/host/layer23/src/mobile/gsm48_cc.c
@@ -43,6 +43,8 @@
                     uint32_t callref, int location, int value);
 static int gsm48_cc_tx_disconnect(struct gsm_trans *trans, void *arg);
 static int gsm48_cc_tx_connect_ack(struct gsm_trans *trans, void *arg);
+static void gsm48_cc_trans_bcap_update(struct gsm_trans *trans,
+                                      const struct gsm_mncc *mncc);

 /*
  * init
@@ -182,11 +184,13 @@

 /* enqueue message to application (MNCC-SAP) */
 static int mncc_recvmsg(struct osmocom_ms *ms, struct gsm_trans *trans,
-               int msg_type, struct gsm_mncc *mncc)
+                       uint32_t msg_type, struct gsm_mncc *mncc)
 {
        struct gsm48_cclayer *cc = &ms->cclayer;
        struct msgb *msg;

+       gsm48_cc_trans_bcap_update(trans, mncc);
+
        if (trans)
                LOGP(DCC, LOGL_INFO, "(ms %s ti %x) Sending '%s' to MNCC.\n",
                        ms->name, trans->transaction_id,
@@ -370,6 +374,9 @@
 {
        gsm48_stop_cc_timer(trans);

+       talloc_free(trans->cc.bcap);
+       trans->cc.bcap = NULL;
+
        /* disable audio distribution */
        if (trans->ms->mncc_entity.ref == trans->callref)
                trans->ms->mncc_entity.ref = 0;
@@ -385,6 +392,16 @@
                new_cc_state(trans, GSM_CSTATE_NULL);
 }

+static void gsm48_cc_trans_bcap_update(struct gsm_trans *trans,
+                                      const struct gsm_mncc *mncc)
+{
+       if (~mncc->fields & MNCC_F_BEARER_CAP)
+               return;
+       if (trans->cc.bcap == NULL)
+               trans->cc.bcap = talloc(trans, struct gsm_mncc_bearer_cap);
+       memcpy(trans->cc.bcap, &mncc->bearer_cap, sizeof(mncc->bearer_cap));
+}
+
 /* release MM connection, go NULL state, free transaction */
 static int gsm48_rel_null_free(struct gsm_trans *trans)
 {
@@ -2020,6 +2037,8 @@
                }
        }

+       gsm48_cc_trans_bcap_update(trans, data);
+
        switch (msg_type) {
        case GSM_TCHF_FRAME:
        case GSM_TCHF_FRAME_EFR:

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35578?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ifc3ecf832a552c65444f49711ac836b6cd984715
Gerrit-Change-Number: 35578
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanits...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to