Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14332


Change subject: LAPDm_RAW_PT: Switch to dedicated channel without RACH+IMM.ASS
......................................................................

LAPDm_RAW_PT: Switch to dedicated channel without RACH+IMM.ASS

Change-Id: I07dd9191ca441bfd1e43e3521e98f88ad2d0489a
---
M library/LAPDm_RAW_PT.ttcn
1 file changed, 36 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/32/14332/1

diff --git a/library/LAPDm_RAW_PT.ttcn b/library/LAPDm_RAW_PT.ttcn
index fe2d321..222c1aa 100644
--- a/library/LAPDm_RAW_PT.ttcn
+++ b/library/LAPDm_RAW_PT.ttcn
@@ -36,6 +36,17 @@
                charstring err optional
        }

+       /* directly switch to a dedicated channel (without RACH/IMM.ASS */
+       type record DCCH_switch_req {
+               Arfcn arfcn,
+               RslChannelNr chan_nr,
+               GsmTsc tsc
+       }
+
+       type record DCCH_switch_res {
+               charstring err optional
+       }
+
        type record length(8) of uint8_t TfiList;
        type record TbfPars {
                GsmArfcn        arfcn optional,
@@ -104,12 +115,14 @@
        type port LAPDm_SP_PT message {
                in      BCCH_tune_req,
                        DCCH_establish_req,
+                       DCCH_switch_req,
                        DCCH_release_req,
                        TBF_UL_establish_req,
                        TBF_DL_establish_req,
                        RLCMAC_ph_data_req,
                        LAPDm_ph_data;
                out     DCCH_establish_res,
+                       DCCH_switch_res,
                        TBF_UL_establish_res,
                        RLCMAC_ph_data_ind,
                        LAPDm_ph_data;
@@ -118,11 +131,13 @@
        /* port from user (external) point of view */
        type port LAPDm_PT message {
                in      DCCH_establish_res,
+                       DCCH_switch_res,
                        TBF_UL_establish_res,
                        RLCMAC_ph_data_ind,
                        LAPDm_ph_data;
                out     BCCH_tune_req,
                        DCCH_establish_req,
+                       DCCH_switch_req,
                        DCCH_release_req,
                        TBF_UL_establish_req,
                        TBF_DL_establish_req,
@@ -222,6 +237,15 @@
                set_ph_state(PH_STATE_DCH);
        }

+       /* switching directly to a dedicated channel *without RACH/IMM-ASS */
+       private function f_switch_dcch(Arfcn arfcn, RslChannelNr chan_nr, 
GsmTsc tsc) runs on lapdm_CT {
+               set_ph_state(PH_STATE_TUNING_DCH);
+               /* store/save channel description */
+               chan_desc.chan_nr := chan_nr;
+               f_L1CTL_DM_EST_REQ(L1CTL,arfcn, chan_nr, tsc);
+               set_ph_state(PH_STATE_DCH);
+       }
+
        /* initialize a tfi_usf array with "not used" value 255 for all TN */
        function f_TfiUsfArrInit() return TfiUsfArr {
                var TfiUsfArr tua := { 255, 255, 255, 255, 255, 255, 255, 255 };
@@ -374,6 +398,7 @@
                var RLCMAC_ph_data_ind rpdi;
                var RLCMAC_ph_data_req rpdr;
                var DCCH_establish_req est_req;
+               var DCCH_switch_req sw_req;
                var DCCH_establish_res est_res;

                f_init_tbf();
@@ -422,6 +447,17 @@
                                }
                                LAPDM_SP.send(res);
                        }
+                       [] LAPDM_SP.receive(DCCH_switch_req:?) -> value sw_req {
+                               var DCCH_switch_res res;
+                               f_switch_dcch(sw_req.arfcn, sw_req.chan_nr, 
sw_req.tsc);
+                               if (ph_state == PH_STATE_DCH) {
+                                       res := { omit };
+                               } else {
+                                       res := { "Unable to switch to DCCH" };
+                               }
+                               LAPDM_SP.send(res);
+                       }
+

                        [] as_tbf_ul_est();
                        [] as_tbf_dl_est();

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14332
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I07dd9191ca441bfd1e43e3521e98f88ad2d0489a
Gerrit-Change-Number: 14332
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-MessageType: newchange

Reply via email to