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


Change subject: Use boolean for DL resegmentation parameter
......................................................................

Use boolean for DL resegmentation parameter

In some places #define was used for DL resegmentation parameter, in
other int, in some other bool. Let's clarify this and always use boolean
value.

Change-Id: I4d4fe5fe12068a4532cb3b61d4eeb229a77c1476
---
M src/bts.h
M src/gprs_coding_scheme.h
M src/pcu_main.cpp
M src/pcu_vty.c
M tests/tbf/TbfTest.cpp
5 files changed, 9 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/57/13057/1

diff --git a/src/bts.h b/src/bts.h
index 578cece..51edc82 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -135,8 +135,8 @@
        uint32_t dl_tbf_idle_msec; /* hold time for idle DL TBFs */
        uint8_t si13[GSM_MACBLOCK_LEN];
        bool si13_is_set;
-       /* 0 to support resegmentation in DL, 1 for no reseg */
-       uint8_t dl_arq_type;
+       /* false to support resegmentation in DL, true for no resegmentation */
+       bool dl_arq_type;

        uint32_t ms_idle_sec;
        uint8_t cs_adj_enabled;
diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h
index 76cab0f..3c47266 100644
--- a/src/gprs_coding_scheme.h
+++ b/src/gprs_coding_scheme.h
@@ -32,8 +32,6 @@

 #define MAX_NUM_ARQ           2      /* max. number of ARQ */
 #define MAX_NUM_MCS           9     /* max. number of MCS */
-#define EGPRS_ARQ1            0x0
-#define EGPRS_ARQ2            0x1

        enum Scheme {
                UNKNOWN,
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index fe85160..8414ae3 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -263,7 +263,7 @@
         * By default resegmentation is supported in DL
         * can also be configured through VTY
         */
-       bts->dl_arq_type = EGPRS_ARQ1;
+       bts->dl_arq_type = false;

        bts->pcu_sock_path = talloc_strdup(tall_pcu_ctx, PCU_SOCK_DEFAULT);

diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 960c90d..2d1903d 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -594,9 +594,9 @@
        struct gprs_rlcmac_bts *bts = bts_main_data();

        if (!strcmp(argv[0], "arq2"))
-               bts->dl_arq_type = 1;
+               bts->dl_arq_type = true;
        else
-               bts->dl_arq_type = 0;
+               bts->dl_arq_type = false;

        return CMD_SUCCESS;
 }
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index dfed79e..f96956f 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -2487,7 +2487,7 @@
        bts->dl_tbf_idle_msec = 200;
        bts->egprs_enabled = 1;
        /* ARQ II */
-       bts->dl_arq_type = EGPRS_ARQ2;
+       bts->dl_arq_type = true;

        /*
         * Simulate a message captured during over-the-air testing,
@@ -3022,7 +3022,7 @@
        bts->dl_tbf_idle_msec = 200;
        bts->egprs_enabled = 1;
        /* ARQ II */
-       bts->dl_arq_type = EGPRS_ARQ2;
+       bts->dl_arq_type = true;


        /* First parameter is current MCS, second one is demanded_mcs */
@@ -3052,7 +3052,7 @@
        bts->egprs_enabled = 1;

        /* ARQ I resegmentation support */
-       bts->dl_arq_type = EGPRS_ARQ1;
+       bts->dl_arq_type = false;

        /*
         * First parameter is current MCS, second one is demanded_mcs
@@ -3083,7 +3083,7 @@
        bts->dl_tbf_idle_msec = 200;
        bts->egprs_enabled = 1;
        /* ARQ II */
-       bts->dl_arq_type = EGPRS_ARQ2;
+       bts->dl_arq_type = true;

        for (i = 1; i <= 9; i++)
                establish_and_use_egprs_dl_tbf(&the_bts, i);

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d4fe5fe12068a4532cb3b61d4eeb229a77c1476
Gerrit-Change-Number: 13057
Gerrit-PatchSet: 1
Gerrit-Owner: Max <msur...@sysmocom.de>

Reply via email to