fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30452 )

Change subject: trxcon: add value-string defs for L1CTL Reset / CCCH Mode
......................................................................

trxcon: add value-string defs for L1CTL Reset / CCCH Mode

Change-Id: I045b2c771b24d301570c9556770e97afedc8274a
---
M src/host/trxcon/src/l1ctl.c
1 file changed, 24 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved



diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c
index 8c9372b..2f4881b 100644
--- a/src/host/trxcon/src/l1ctl.c
+++ b/src/host/trxcon/src/l1ctl.c
@@ -33,6 +33,7 @@
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/logging.h>
+#include <osmocom/core/utils.h>

 #include <osmocom/gsm/gsm0502.h>
 #include <osmocom/gsm/gsm_utils.h>
@@ -50,6 +51,21 @@
 int g_logc_l1c = DLGLOBAL;
 int g_logc_l1d = DLGLOBAL;

+static const struct value_string l1ctl_ccch_mode_names[] = {
+       { CCCH_MODE_NONE,               "NONE" },
+       { CCCH_MODE_NON_COMBINED,       "NON_COMBINED" },
+       { CCCH_MODE_COMBINED,           "COMBINED" },
+       { CCCH_MODE_COMBINED_CBCH,      "COMBINED_CBCH" },
+       { 0, NULL },
+};
+
+static const struct value_string l1ctl_reset_names[] = {
+       { L1CTL_RES_T_BOOT,             "BOOT" },
+       { L1CTL_RES_T_FULL,             "FULL" },
+       { L1CTL_RES_T_SCHED,            "SCHED" },
+       { 0, NULL },
+};
+
 static const char *arfcn2band_name(uint16_t arfcn)
 {
        enum gsm_band band;
@@ -121,7 +137,8 @@
        if (!msg)
                return -ENOMEM;

-       LOGPFSMSL(fi, g_logc_l1c, LOGL_DEBUG, "Send Reset Ind (%u)\n", type);
+       LOGPFSMSL(fi, g_logc_l1c, LOGL_DEBUG, "Send Reset Ind (%s)\n",
+                 get_value_string(l1ctl_reset_names, type));

        res = (struct l1ctl_reset *) msgb_put(msg, sizeof(*res));
        res->type = type;
@@ -139,7 +156,8 @@
        if (!msg)
                return -ENOMEM;

-       LOGPFSMSL(fi, g_logc_l1c, LOGL_DEBUG, "Send Reset Conf (%u)\n", type);
+       LOGPFSMSL(fi, g_logc_l1c, LOGL_DEBUG, "Send Reset Conf (%s)\n",
+                 get_value_string(l1ctl_reset_names, type));
        res = (struct l1ctl_reset *) msgb_put(msg, sizeof(*res));
        res->type = type;

@@ -417,7 +435,8 @@
        }

        LOGPFSMSL(fi, g_logc_l1c, LOGL_NOTICE,
-                 "Received reset request (%u)\n", res->type);
+                 "Received reset request (%s)\n",
+                 get_value_string(l1ctl_reset_names, res->type));

        switch (res->type) {
        case L1CTL_RES_T_FULL:
@@ -471,8 +490,8 @@
                goto exit;
        }

-       LOGPFSMSL(fi, g_logc_l1c, LOGL_NOTICE, "Received CCCH mode request 
(%u)\n",
-                 mode_req->ccch_mode); /* TODO: add value-string for ccch_mode 
*/
+       LOGPFSMSL(fi, g_logc_l1c, LOGL_NOTICE, "Received CCCH mode request 
(%s)\n",
+                 get_value_string(l1ctl_ccch_mode_names, mode_req->ccch_mode));

        struct trxcon_param_set_ccch_tch_mode_req req = {
                /* Choose corresponding channel combination */

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I045b2c771b24d301570c9556770e97afedc8274a
Gerrit-Change-Number: 30452
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to