Review at  https://gerrit.osmocom.org/6902

Merge duplicate SI3 in GSM_RR_Types and GSM_SystemInformation

Let's have one SI3 definition rather than multiple...

Change-Id: I3c4754c9a69cb2fa51d88ef6358d5399dbb29860
---
M bts/BTS_Tests.ttcn
M bts/gen_links.sh
M library/GSM_RR_Types.ttcn
M library/GSM_SystemInformation.ttcn
M sysinfo/Test.ttcn
5 files changed, 67 insertions(+), 107 deletions(-)


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

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index cc78057..ba76cf6 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -6,6 +6,7 @@
 import from Osmocom_Types all;
 import from GSM_Types all;
 import from GSM_RR_Types all;
+import from GSM_SystemInformation all;
 import from L1CTL_PortType all;
 import from L1CTL_Types all;
 import from LAPDm_Types all;
@@ -86,8 +87,16 @@
        ConnL1Pars l1_pars
 }
 
+template (value) RachControlParameters ts_RachCtrl_default := {
+       max_retrans := RACH_MAX_RETRANS_1,
+       tx_integer := '0000'B, /* 3 slots */
+       cell_barr_access := false,
+       re_not_allowed := true,
+       acc := '1111111111111111'B
+};
+
 /* Default SYSTEM INFORMATION 3 */
-template (value) GsmRrMessage ts_SI3_default := {
+template (value) SystemInformation ts_SI3_default := {
        header := t_RrHeader(SYSTEM_INFORMATION_TYPE_3, 0),
        payload := {
                si3 := {
@@ -101,32 +110,26 @@
                                att := true,
                                bs_ag_blks_res := 1,
                                ccch_conf := CCHAN_DESC_1CCCH_COMBINED,
-                               si22_ind := false,
+                               si22ind := false,
                                cbq3 := CBQ3_IU_MODE_NOT_SUPPORTED,
                                spare := '00'B,
                                bs_pa_mfrms := 0, /* 2 multiframes */
                                t3212 := 1 /* 6 minutes */
                        },
-                       cell_opts := {
+                       cell_options := {
                                dn_ind := false,
                                pwrc := false,
                                dtx := MS_MAY_USE_UL_DTX,
                                radio_link_tout_div4 := 4/4
                        },
-                       cell_sel_pars := {
+                       cell_sel_par := {
                                cell_resel_hyst_2dB := 0,
                                ms_txpwr_max_cch := 0,
                                acs := '0'B,
                                neci := true,
                                rxlev_access_min := 0
                        },
-                       rach_ctrl_pars := {
-                               max_retrans := RACH_MAX_RETRANS_1,
-                               tx_integer := '0000'B, /* 3 slots */
-                               cell_bar_access := false,
-                               re_not_allowed := true,
-                               acc := '1111111111111111'B
-                       },
+                       rach_control := ts_RachCtrl_default,
                        rest_octets := ''O
                }
        }
@@ -139,9 +142,9 @@
        f_sleep(0.5);   /* workaround for OS#3000 */
 
        /* Send SI3 to the BTS, it is needed for various computations */
-       var GsmRrMessage si3 := valueof(ts_SI3_default);
+       var SystemInformation si3 := valueof(ts_SI3_default);
        log("Sending SI3 ", si3);
-       var octetstring si3_enc := enc_GsmRrMessage(si3);
+       var octetstring si3_enc := enc_SystemInformation(si3);
        RSL_CCHAN.send(ts_RSL_UD(ts_RSL_BCCH_INFO(RSL_SYSTEM_INFO_3, si3_enc)));
 }
 
diff --git a/bts/gen_links.sh b/bts/gen_links.sh
index 81df7bb..eaafd19 100755
--- a/bts/gen_links.sh
+++ b/bts/gen_links.sh
@@ -36,7 +36,7 @@
 gen_links $DIR $FILES
 
 DIR=../library
-FILES="General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn 
RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn 
L1CTL_PortType.ttcn LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn "
+FILES="General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn 
GSM_SystemInformation.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn 
RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn 
LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn "
 #FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn 
NS_CodecPort_CtrlFunctDef.cc "
 #FILES+="BSSGP_Emulation.ttcn Osmocom_Gb_Types.ttcn "
 FILES+="IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn 
IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp IPA_CodecPort.ttcn 
RSL_Types.ttcn RSL_Emulation.ttcn "
diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn
index a8b6db2..75be6f8 100644
--- a/library/GSM_RR_Types.ttcn
+++ b/library/GSM_RR_Types.ttcn
@@ -366,68 +366,6 @@
                uint3_t         non_drx_timer
        } with { variant "" };
 
-       /* 44.018 10.5.2.3 */
-       type enumerated CellOptions_DTX {
-               MS_MAY_USE_UL_DTX       ('00'B),
-               MS_SHALL_USE_UL_DTX     ('01'B),
-               MS_SHALL_NOT_USE_UL_DTX ('10'B)
-       } with { variant "FIELDLENGTH(2)" };
-       type record CellOptions {
-               boolean         dn_ind,
-               boolean         pwrc,
-               CellOptions_DTX dtx,
-               uint4_t         radio_link_tout_div4
-       } with { variant "" };
-
-       /* 44.018 10.5.2.4 */
-       type record CellSelectionPars {
-               uint3_t         cell_resel_hyst_2dB,
-               uint5_t         ms_txpwr_max_cch,
-               BIT1            acs,
-               boolean         neci,
-               uint6_t         rxlev_access_min
-       } with { variant "" };
-
-       /* 44.018 10.5.2.29 */
-       type enumerated RachCtrlPar_MR {
-               RACH_MAX_RETRANS_1      ('00'B),
-               RACH_MAX_RETRANS_2      ('01'B),
-               RACH_MAX_RETRANS_4      ('10'B),
-               RACH_MAX_RETRANS_7      ('11'B)
-       } with { variant "FIELDLENGTH(2)" };
-       type record RachControlPars {
-               RachCtrlPar_MR  max_retrans,
-               BIT4            tx_integer,
-               boolean         cell_bar_access,
-               boolean         re_not_allowed,
-               BIT16           acc
-       } with { variant "" };
-
-       /* 44.018 10.5.2.11 */
-       type enumerated CtrlChanDesc_CC {
-               CCHAN_DESC_1CCCH_NOT_COMBINED   ('000'B),
-               CCHAN_DESC_1CCCH_COMBINED       ('001'B),
-               CCHAN_DESC_2CCCH_NOT_COMBINED   ('010'B),
-               CCHAN_DESC_3CCCH_NOT_COMBINED   ('100'B),
-               CCHAN_DESC_4CCCH_NOT_COMBINED   ('110'B)
-       } with { variant "FIELDLENGTH(3)" };
-       type enumerated CBQ3 {
-               CBQ3_IU_MODE_NOT_SUPPORTED      ('00'B),
-               CBQ3_IU_MODE_MS_BARRED          ('01'B),
-               CBQ3_IU_MODE_NOT_BARRED         ('10'B)
-       } with { variant "FIELDLENGTH(2)" };
-       type record CtrlChanDesc {
-               boolean         msc_r99,
-               boolean         att,
-               uint3_t         bs_ag_blks_res,
-               CtrlChanDesc_CC ccch_conf,
-               boolean         si22_ind,
-               CBQ3            cbq3,
-               BIT2            spare,
-               uint3_t         bs_pa_mfrms, /* off by 2 */
-               uint8_t         t3212
-       } with { variant "" };
-
        /* 24.008 10.5.5.15 */
        type record RoutingAreaIdentification {
                LocationAreaIdentification      lai,
@@ -639,30 +577,19 @@
                RestOctets                      rest_octets
        } with { variant "" };
 
-       /* 9.1.35 */
-       type record SystemInformationType3 {
-               CellIdentity                    cell_id,
-               LocationAreaIdentification      lai,
-               CtrlChanDesc                    ctrl_chan_desc,
-               CellOptions                     cell_opts,
-               CellSelectionPars               cell_sel_pars,
-               RachControlPars                 rach_ctrl_pars,
-               RestOctets                      rest_octets
-       } with { variant (rest_octets) "FIELDLENGTH(4)" };
-
        type union RrUnion {
 /*
                SystemInformationType1          si1,
                SystemInformationType2          si2,
                SystemInformationType2bis       si2bis,
                SystemInformationType2ter       si2ter,
+               SystemInformationType3          si3,
                SystemInformationType4          si4,
                SystemInformationType5          si5,
                SystemInformationType5bis       si5bis,
                SystemInformationType5ter       si5ter,
                SystemInformationType6          si6,
 */
-               SystemInformationType3          si3,
                ImmediateAssignment             imm_ass,
                ImmediateAssignmentReject       imm_ass_rej,
                PagingRequestType1              pag_req_1,
diff --git a/library/GSM_SystemInformation.ttcn 
b/library/GSM_SystemInformation.ttcn
index b53d5f2..1d06aa1 100644
--- a/library/GSM_SystemInformation.ttcn
+++ b/library/GSM_SystemInformation.ttcn
@@ -22,11 +22,16 @@
        type octetstring CellChannelDescription with { variant 
"FIELDLENGTH(16)" };
 
        /* 44.018 10.5.2.3 */
+       type enumerated CellOptions_DTX {
+               MS_MAY_USE_UL_DTX       ('00'B),
+               MS_SHALL_USE_UL_DTX     ('01'B),
+               MS_SHALL_NOT_USE_UL_DTX ('10'B)
+       } with { variant "FIELDLENGTH(2)" };
        type record CellOptions {
                boolean         dn_ind,
                boolean         pwrc,
-               BIT2            dtx,
-               BIT4            radio_link_timeout
+               CellOptions_DTX dtx,
+               uint4_t         radio_link_tout_div4
        } with { variant "" };
 
        /* 44.018 10.5.2.3a */
@@ -39,23 +44,35 @@
 
        /* 44.018 10.5.2.4 */
        type record CellSelectionParameters {
-               uint3_t         cell_resel_hyst,
+               uint3_t         cell_resel_hyst_2dB,
                uint5_t         ms_txpwr_max_cch,
-               boolean         acs,
+               BIT1            acs,
                boolean         neci,
                uint6_t         rxlev_access_min
        } with { variant "" };
 
        /* 44.018 10.5.2.11 */
+       type enumerated CtrlChanDesc_CC {
+               CCHAN_DESC_1CCCH_NOT_COMBINED   ('000'B),
+               CCHAN_DESC_1CCCH_COMBINED       ('001'B),
+               CCHAN_DESC_2CCCH_NOT_COMBINED   ('010'B),
+               CCHAN_DESC_3CCCH_NOT_COMBINED   ('100'B),
+               CCHAN_DESC_4CCCH_NOT_COMBINED   ('110'B)
+       } with { variant "FIELDLENGTH(3)" };
+       type enumerated CBQ3 {
+               CBQ3_IU_MODE_NOT_SUPPORTED      ('00'B),
+               CBQ3_IU_MODE_MS_BARRED          ('01'B),
+               CBQ3_IU_MODE_NOT_BARRED         ('10'B)
+       } with { variant "FIELDLENGTH(2)" };
        type record ControlChannelDescription {
-               boolean         mscrr,
+               boolean         msc_r99,
                boolean         att,
                uint3_t         bs_ag_blks_res,
-               uint3_t         ccch_conf,
+               CtrlChanDesc_CC ccch_conf,
                boolean         si22ind,
-               uint2_t         cbq3,
+               CBQ3            cbq3,
                BIT2            spare,
-               uint3_t         bs_pa_mfrms,
+               uint3_t         bs_pa_mfrms, /* off by 2 */
                uint8_t         t3212
        } with { variant "" };
 
@@ -77,13 +94,19 @@
        type bitstring AccessControlClass with { variant "FIELDLENGTH(16), 
BYTEORDER(last)" };
 
        /* 44.018 10.5.2.29 */
+       type enumerated RachCtrlPar_MR {
+               RACH_MAX_RETRANS_1      ('00'B),
+               RACH_MAX_RETRANS_2      ('01'B),
+               RACH_MAX_RETRANS_4      ('10'B),
+               RACH_MAX_RETRANS_7      ('11'B)
+       } with { variant "FIELDLENGTH(2)" };
        type record RachControlParameters {
-               BIT2            max_retrans,
+               RachCtrlPar_MR  max_retrans,
                BIT4            tx_integer,
                boolean         cell_barr_access,
-               boolean         re,
-               AccessControlClass ac
-       } with { variant (ac) "FIELDLENGTH(16)" };
+               boolean         re_not_allowed,
+               AccessControlClass acc
+       } with { variant (acc) "FIELDLENGTH(16)" };
 
        /* 44.018 10.5.2.32 */
        type RestOctets Si1RestOctets with { variant "FIELDLENGTH(1)" };
diff --git a/sysinfo/Test.ttcn b/sysinfo/Test.ttcn
index e7cdcfe..02a2279 100644
--- a/sysinfo/Test.ttcn
+++ b/sysinfo/Test.ttcn
@@ -751,8 +751,12 @@
        testcase TC_rach_max_tx() runs on dummy_CT {
                var uint16_t r := float2int(rnd() * 3.0);
                const integer max_tx_map[4] := { 1, 2, 4, 7 };
+               const RachCtrlPar_MR max_tx_map2[4] := { RACH_MAX_RETRANS_1,
+                                                        RACH_MAX_RETRANS_2,
+                                                        RACH_MAX_RETRANS_4,
+                                                        RACH_MAX_RETRANS_7 };
                var template SystemInformation t := t_SI_SI3;
-               t.payload.si3.rach_control.max_retrans := int2bit(r, 2);
+               t.payload.si3.rach_control.max_retrans := max_tx_map2[r];
 
                f_init();
                f_vty_enter_cfg_bts(BSCVTY, 0);
@@ -764,9 +768,12 @@
        }
 
        testcase TC_dtx_ul() runs on dummy_CT {
-               var integer i := float2int(rnd() * 2.0);
+               var integer i := float2int(rnd() * 3.0);
                var template SystemInformation t := t_SI_SI3;
-               t.payload.si3.cell_options.dtx := int2bit(i, 2);
+               var CellOptions_DTX dtx_map[3] := { MS_MAY_USE_UL_DTX,
+                                                   MS_SHALL_USE_UL_DTX,
+                                                   MS_SHALL_NOT_USE_UL_DTX };
+               t.payload.si3.cell_options.dtx := dtx_map[i];
 
                f_init();
                f_vty_enter_cfg_bts(BSCVTY, 0);
@@ -826,7 +833,7 @@
        testcase TC_radio_link_timeout() runs on dummy_CT {
                var integer i := float2int(rnd() * 15.0);
                var template SystemInformation t := t_SI_SI3;
-               t.payload.si3.cell_options.radio_link_timeout := int2bit(i, 4);
+               t.payload.si3.cell_options.radio_link_tout_div4 := i;
 
                f_init();
                f_vty_enter_cfg_bts(BSCVTY, 0);
@@ -840,7 +847,7 @@
        testcase TC_cell_resel_hyst() runs on dummy_CT {
                var integer i := float2int(rnd() * 7.0);
                var template SystemInformation t := t_SI_SI3;
-               t.payload.si3.cell_sel_par.cell_resel_hyst := i;
+               t.payload.si3.cell_sel_par.cell_resel_hyst_2dB := i;
 
                f_init();
                f_vty_enter_cfg_bts(BSCVTY, 0);
@@ -883,9 +890,9 @@
                var integer i := float2int(rnd());
                var template SystemInformation t := t_SI_SI3;
                if (i == 1) {
-                       t.payload.si3.rach_control.ac := '?????0??????????'B;
+                       t.payload.si3.rach_control.acc := '?????0??????????'B;
                } else {
-                       t.payload.si3.rach_control.ac := '?????1??????????'B;
+                       t.payload.si3.rach_control.acc := '?????1??????????'B;
                }
 
                f_init();

-- 
To view, visit https://gerrit.osmocom.org/6902
To unsubscribe, visit https://gerrit.osmocom.org/settings

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

Reply via email to