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


Change subject: ASCI: Add channel description to messages from MM to RR layer
......................................................................

ASCI: Add channel description to messages from MM to RR layer

This is required to specify channel when activating the group channel.
In this implementation GCC/BCC layer maintains the channel.

Related: OS#5364
Change-Id: I154f1f0e49ffa508d01a026da8e73faa7fdbab40
---
M src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
M src/host/layer23/src/mobile/gsm48_mm.c
2 files changed, 27 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/90/34490/1

diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h 
b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
index fb07cc9..9b73ab2 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
@@ -62,6 +62,7 @@
        uint32_t                msg_type; /* RR-* primitive */
        uint8_t                 sapi;
        uint8_t                 cause;
+       struct gsm48_chan_desc  ch_desc;
 } __attribute__((packed));

 /* GSM 04.07 9.1.1 */
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c 
b/src/host/layer23/src/mobile/gsm48_mm.c
index 20bbae2..dc6e079 100644
--- a/src/host/layer23/src/mobile/gsm48_mm.c
+++ b/src/host/layer23/src/mobile/gsm48_mm.c
@@ -868,7 +868,7 @@

 /* push RR header and send to RR */
 static int gsm48_mm_to_rr(struct osmocom_ms *ms, struct msgb *msg, int 
msg_type,
-       uint8_t sapi, uint8_t cause)
+       uint8_t sapi, uint8_t cause, struct gsm48_chan_desc *ch_desc)
 {
        struct gsm48_rr_hdr *rrh;

@@ -878,6 +878,8 @@
        rrh->msg_type = msg_type;
        rrh->sapi = sapi;
        rrh->cause = cause;
+       if (ch_desc)
+               memcpy(&rrh->ch_desc, ch_desc, sizeof(rrh->ch_desc));

        /* send message to RR */
        return gsm48_rr_downmsg(ms, msg);
@@ -1610,7 +1612,7 @@
        *reject_cause = cause;

        /* push RR header and send down */
-       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_DATA_REQ, 0, 0);
+       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_DATA_REQ, 0, 0, NULL);
 }

 /* 4.3.1.2 sending TMSI REALLOCATION COMPLETE message */
@@ -1630,7 +1632,7 @@
        ngh->msg_type = GSM48_MT_MM_TMSI_REALL_COMPL;

        /* push RR header and send down */
-       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_DATA_REQ, 0, 0);
+       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_DATA_REQ, 0, 0, NULL);
 }

 /* 4.3.1 TMSI REALLOCATION COMMAND is received */
@@ -1746,7 +1748,7 @@
        memcpy(sres, mme->sres, 4);

        /* push RR header and send down */
-       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_DATA_REQ, 0, 0);
+       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_DATA_REQ, 0, 0, NULL);
 }

 /* 4.3.2.5 AUTHENTICATION REJECT is received */
@@ -1850,7 +1852,7 @@
        gsm48_encode_mi(ms, nmsg, false, mi_type, false);

        /* push RR header and send down */
-       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_DATA_REQ, 0, 0);
+       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_DATA_REQ, 0, 0, NULL);
 }

 /* 4.3.4.1 sending IMSI DETACH INDICATION message */
@@ -1897,7 +1899,7 @@

        /* push RR header and send down */
        mm->est_cause = RR_EST_CAUSE_OTHER_SDCCH;
-       return gsm48_mm_to_rr(ms, nmsg, rr_prim, 0, mm->est_cause);
+       return gsm48_mm_to_rr(ms, nmsg, rr_prim, 0, mm->est_cause, NULL);
 }

 /* detach has ended */
@@ -2429,7 +2431,7 @@

        /* push RR header and send down */
        mm->est_cause = RR_EST_CAUSE_LOC_UPD;
-       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_EST_REQ, 0, mm->est_cause);
+       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_EST_REQ, 0, mm->est_cause, 
NULL);
 }

 /* 4.4.4.1 RR is esablised during location update */
@@ -2885,7 +2887,7 @@
        /* prio is optional for eMLPP */

        /* push RR header and send down */
-       return gsm48_mm_to_rr(ms, nmsg, rr_prim, 0, mm->est_cause);
+       return gsm48_mm_to_rr(ms, nmsg, rr_prim, 0, mm->est_cause, NULL);
 }

 /* cm service abort message from upper layer
@@ -2907,7 +2909,7 @@
        ngh->msg_type = GSM48_MT_MM_CM_SERV_ABORT;

        /* push RR header and send down */
-       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_DATA_REQ, 0, 0);
+       return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_DATA_REQ, 0, 0, NULL);
 }

 /* cm service acknowledge is received from lower layer */
@@ -3312,7 +3314,7 @@
                        if (!nmsg)
                                return -ENOMEM;
                        return gsm48_mm_to_rr(ms, nmsg, GSM48_RR_EST_REQ,
-                               conn_found->sapi, 0);
+                               conn_found->sapi, 0, NULL);
                }
                nmsg = gsm48_mmxx_msgb_alloc(GSM48_MMSMS_EST_CNF,
                        conn_found->ref, conn_found->transaction_id,
@@ -3481,7 +3483,7 @@
        msgb_pull(msg, sizeof(struct gsm48_mmxx_hdr));

        /* push RR header and send down */
-       return gsm48_mm_to_rr(ms, msg, GSM48_RR_DATA_REQ, conn->sapi, 0);
+       return gsm48_mm_to_rr(ms, msg, GSM48_RR_DATA_REQ, conn->sapi, 0, NULL);
 }

 /* release of MM connection (active state) */

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34490?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: I154f1f0e49ffa508d01a026da8e73faa7fdbab40
Gerrit-Change-Number: 34490
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <[email protected]>
Gerrit-MessageType: newchange

Reply via email to