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

host/trxcon/trx_if.c: separate logging of data messages

Change-Id: I74ebe0441aeb41c324eafb6b586b2edd9ef4fd1a
---
M src/host/trxcon/logging.c
M src/host/trxcon/logging.h
M src/host/trxcon/trx_if.c
3 files changed, 16 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/82/6782/1

diff --git a/src/host/trxcon/logging.c b/src/host/trxcon/logging.c
index 338deaf..119456b 100644
--- a/src/host/trxcon/logging.c
+++ b/src/host/trxcon/logging.c
@@ -48,7 +48,13 @@
        },
        [DTRX] = {
                .name = "DTRX",
-               .description = "Transceiver interface",
+               .description = "Transceiver control interface",
+               .color = "\033[1;33m",
+               .enabled = 1, .loglevel = LOGL_NOTICE,
+       },
+       [DTRXD] = {
+               .name = "DTRXD",
+               .description = "Transceiver data interface",
                .color = "\033[1;33m",
                .enabled = 1, .loglevel = LOGL_NOTICE,
        },
diff --git a/src/host/trxcon/logging.h b/src/host/trxcon/logging.h
index 22f3251..6221c55 100644
--- a/src/host/trxcon/logging.h
+++ b/src/host/trxcon/logging.h
@@ -2,13 +2,14 @@
 
 #include <osmocom/core/logging.h>
 
-#define DEBUG_DEFAULT "DAPP:DL1C:DL1D:DTRX:DSCH"
+#define DEBUG_DEFAULT "DAPP:DL1C:DL1D:DTRX:DTRXD:DSCH"
 
 enum {
        DAPP,
        DL1C,
        DL1D,
        DTRX,
+       DTRXD,
        DSCH,
 };
 
diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 368c474..6a84af6 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -545,8 +545,8 @@
                return len;
 
        if (len != 158) {
-               LOGP(DTRX, LOGL_ERROR, "Got data message with invalid length "
-                       "'%d'\n", len);
+               LOGP(DTRXD, LOGL_ERROR, "Got data message with invalid "
+                       "length '%d'\n", len);
                return -EINVAL;
        }
 
@@ -564,16 +564,16 @@
        }
 
        if (tn >= 8) {
-               LOGP(DTRX, LOGL_ERROR, "Illegal TS %d\n", tn);
+               LOGP(DTRXD, LOGL_ERROR, "Illegal TS %d\n", tn);
                return -EINVAL;
        }
 
        if (fn >= 2715648) {
-               LOGP(DTRX, LOGL_ERROR, "Illegal FN %u\n", fn);
+               LOGP(DTRXD, LOGL_ERROR, "Illegal FN %u\n", fn);
                return -EINVAL;
        }
 
-       LOGP(DTRX, LOGL_DEBUG, "RX burst tn=%u fn=%u rssi=%d toa=%.2f\n",
+       LOGP(DTRXD, LOGL_DEBUG, "RX burst tn=%u fn=%u rssi=%d toa=%.2f\n",
                tn, fn, rssi, toa);
 
        /* Poke scheduler */
@@ -598,12 +598,12 @@
         * TODO: should we wait in TRX_STATE_RSP_WAIT state?
         */
        if (trx->fsm->state != TRX_STATE_ACTIVE) {
-               LOGP(DTRX, LOGL_DEBUG, "Ignoring TX data, "
+               LOGP(DTRXD, LOGL_DEBUG, "Ignoring TX data, "
                        "transceiver isn't ready\n");
                return -EAGAIN;
        }
 
-       LOGP(DTRX, LOGL_DEBUG, "TX burst tn=%u fn=%u pwr=%u\n", tn, fn, pwr);
+       LOGP(DTRXD, LOGL_DEBUG, "TX burst tn=%u fn=%u pwr=%u\n", tn, fn, pwr);
 
        buf[0] = tn;
        buf[1] = (fn >> 24) & 0xff;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74ebe0441aeb41c324eafb6b586b2edd9ef4fd1a
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>

Reply via email to