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

Change-Id: I74ebe0441aeb41c324eafb6b586b2edd9ef4fd1a
This commit is contained in:
Vadim Yanitskiy 2017-08-19 12:28:39 +06:00
parent 3641fe6123
commit 5e9959cf6a
3 changed files with 16 additions and 9 deletions

View File

@ -48,7 +48,13 @@ static struct log_info_cat trx_log_info_cat[] = {
},
[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,
},

View File

@ -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,
};

View File

@ -545,8 +545,8 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what)
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 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what)
}
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 @@ int trx_if_tx_burst(struct trx_instance *trx, uint8_t tn, uint32_t fn,
* 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;