fixeria submitted this change.

View Change

Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved
trxcon: ensure are TRXC/TRXD logging is using LOGPFSML()

Change-Id: Ic253903e7b8635bb13e210acfe929c73f8870632
---
M src/host/trxcon/src/trx_if.c
1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c
index dc0c0dc..1ab6ffd 100644
--- a/src/host/trxcon/src/trx_if.c
+++ b/src/host/trxcon/src/trx_if.c
@@ -145,7 +145,7 @@
tcm = llist_entry(trx->trx_ctrl_list.next, struct trx_ctrl_msg, list);

/* Send command */
- LOGP(DTRX, LOGL_DEBUG, "Sending control '%s'\n", tcm->cmd);
+ LOGPFSML(trx->fi, LOGL_DEBUG, "Sending control '%s'\n", tcm->cmd);
send(trx->trx_ofd_ctrl.fd, tcm->cmd, strlen(tcm->cmd) + 1, 0);

/* Trigger state machine */
@@ -170,11 +170,11 @@
if (llist_empty(&trx->trx_ctrl_list))
return;

- LOGP(DTRX, LOGL_NOTICE, "No response from transceiver...\n");
+ LOGPFSML(trx->fi, LOGL_NOTICE, "No response from transceiver...\n");

tcm = llist_entry(trx->trx_ctrl_list.next, struct trx_ctrl_msg, list);
if (++tcm->retry_cnt > 3) {
- LOGP(DTRX, LOGL_NOTICE, "Transceiver offline\n");
+ LOGPFSML(trx->fi, LOGL_NOTICE, "Transceiver offline\n");
osmo_fsm_inst_state_chg(trx->fi, TRX_STATE_OFFLINE, 0, 0);
osmo_fsm_inst_dispatch(trxcon->fi, TRX_EVENT_OFFLINE, trx);
return;
@@ -215,7 +215,7 @@
tcm->cmd_len = strlen(cmd);
tcm->critical = critical;
llist_add_tail(&tcm->list, &trx->trx_ctrl_list);
- LOGP(DTRX, LOGL_INFO, "Adding new control '%s'\n", tcm->cmd);
+ LOGPFSML(trx->fi, LOGL_INFO, "Adding new control '%s'\n", tcm->cmd);

/* Send message, if no pending messages */
if (!pending)
@@ -259,7 +259,7 @@
{
if (trx->powered_up) {
/* FIXME: this should be handled by the FSM, not here! */
- LOGP(DTRX, LOGL_ERROR, "Suppressing POWERON as we're already powered up\n");
+ LOGPFSML(trx->fi, LOGL_ERROR, "Suppressing POWERON as we're already powered up\n");
return -EAGAIN;
}
return trx_ctrl_cmd(trx, 1, "POWERON", "");
@@ -315,7 +315,7 @@
/* RX is downlink on MS side */
freq10 = gsm_arfcn2freq10(band_arfcn, 0);
if (freq10 == 0xffff) {
- LOGP(DTRX, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn);
+ LOGPFSML(trx->fi, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn);
return -ENOTSUP;
}

@@ -329,7 +329,7 @@
/* TX is uplink on MS side */
freq10 = gsm_arfcn2freq10(band_arfcn, 1);
if (freq10 == 0xffff) {
- LOGP(DTRX, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn);
+ LOGPFSML(trx->fi, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn);
return -ENOTSUP;
}

@@ -360,7 +360,7 @@
/* Calculate a frequency for current ARFCN (DL) */
freq10 = gsm_arfcn2freq10(band_arfcn_start, 0);
if (freq10 == 0xffff) {
- LOGP(DTRX, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn_start);
+ LOGPFSML(trx->fi, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn_start);
return -ENOTSUP;
}

@@ -381,7 +381,7 @@
/* Check received ARFCN against expected */
band_arfcn = gsm_freq102arfcn((uint16_t) freq10, 0);
if (band_arfcn != trx->pm_band_arfcn_start) {
- LOGP(DTRX, LOGL_ERROR, "Power measurement error: "
+ LOGPFSML(trx->fi, LOGL_ERROR, "Power measurement error: "
"response ARFCN=%u doesn't match expected ARFCN=%u\n",
band_arfcn & ~ARFCN_FLAG_MASK,
trx->pm_band_arfcn_start & ~ARFCN_FLAG_MASK);
@@ -440,7 +440,7 @@

/* Make sure that Mobile Allocation has at least one ARFCN */
if (!ma_len || ma == NULL) {
- LOGP(DTRX, LOGL_ERROR, "Mobile Allocation is empty?!?\n");
+ LOGPFSML(trx->fi, LOGL_ERROR, "Mobile Allocation is empty?!?\n");
return -EINVAL;
}

@@ -450,7 +450,7 @@
rx_freq = gsm_arfcn2freq10(ma[i], 0); /* Rx: Downlink */
tx_freq = gsm_arfcn2freq10(ma[i], 1); /* Tx: Uplink */
if (rx_freq == 0xffff || tx_freq == 0xffff) {
- LOGP(DTRX, LOGL_ERROR, "Failed to convert ARFCN %u "
+ LOGPFSML(trx->fi, LOGL_ERROR, "Failed to convert ARFCN %u "
"to a pair of Rx/Tx frequencies\n",
ma[i] & ~ARFCN_FLAG_MASK);
return -EINVAL;
@@ -459,7 +459,7 @@
/* Append a pair of Rx/Tx frequencies (in kHz) to the buffer */
rc = snprintf(ptr, ma_buf_len, "%u %u ", rx_freq * 100, tx_freq * 100);
if (rc < 0 || rc > ma_buf_len) { /* Prevent buffer overflow */
- LOGP(DTRX, LOGL_ERROR, "Not enough room to encode "
+ LOGPFSML(trx->fi, LOGL_ERROR, "Not enough room to encode "
"Mobile Allocation (N=%zu)\n", ma_len);
return -ENOSPC;
}
@@ -487,13 +487,13 @@

read_len = read(ofd->fd, buf, sizeof(buf) - 1);
if (read_len <= 0) {
- LOGP(DTRX, LOGL_ERROR, "read() failed with rc=%zd\n", read_len);
+ LOGPFSML(trx->fi, LOGL_ERROR, "read() failed with rc=%zd\n", read_len);
return read_len;
}
buf[read_len] = '\0';

if (!!strncmp(buf, "RSP ", 4)) {
- LOGP(DTRX, LOGL_NOTICE, "Unknown message on CTRL port: %s\n", buf);
+ LOGPFSML(trx->fi, LOGL_NOTICE, "Unknown message on CTRL port: %s\n", buf);
return 0;
}

@@ -501,7 +501,7 @@
p = strchr(buf + 4, ' ');
rsp_len = p ? p - buf - 4 : strlen(buf) - 4;

- LOGP(DTRX, LOGL_INFO, "Response message: '%s'\n", buf);
+ LOGPFSML(trx->fi, LOGL_INFO, "Response message: '%s'\n", buf);

/* Abort expire timer */
if (osmo_timer_pending(&trx->trx_ctrl_timer))
@@ -509,7 +509,7 @@

/* Get command for response message */
if (llist_empty(&trx->trx_ctrl_list)) {
- LOGP(DTRX, LOGL_NOTICE, "Response message without command\n");
+ LOGPFSML(trx->fi, LOGL_NOTICE, "Response message without command\n");
return -EINVAL;
}

@@ -518,7 +518,7 @@

/* Check if response matches command */
if (!!strncmp(buf + 4, tcm->cmd + 4, rsp_len)) {
- LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_ERROR,
+ LOGPFSML(trx->fi, (tcm->critical) ? LOGL_FATAL : LOGL_ERROR,
"Response message '%s' does not match command "
"message '%s'\n", buf, tcm->cmd);
goto rsp_error;
@@ -527,7 +527,7 @@
/* Check for response code */
sscanf(p + 1, "%d", &resp);
if (resp) {
- LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_ERROR,
+ LOGPFSML(trx->fi, (tcm->critical) ? LOGL_FATAL : LOGL_ERROR,
"Transceiver rejected TRX command with "
"response: '%s'\n", buf);

@@ -699,20 +699,20 @@
struct trx_instance *trx;
int rc;

- LOGP(DTRX, LOGL_NOTICE, "Init transceiver interface "
+ LOGPFSML(trxcon->fi, LOGL_NOTICE, "Init transceiver interface "
"(%s:%u)\n", remote_host, base_port);

/* Try to allocate memory */
trx = talloc_zero(trxcon, struct trx_instance);
if (!trx) {
- LOGP(DTRX, LOGL_ERROR, "Failed to allocate memory\n");
+ LOGPFSML(trx->fi, LOGL_ERROR, "Failed to allocate memory\n");
return NULL;
}

/* Allocate a new dedicated state machine */
trx->fi = osmo_fsm_inst_alloc_child(&trx_fsm, trxcon->fi, TRX_EVENT_OFFLINE);
if (trx->fi == NULL) {
- LOGP(DTRX, LOGL_ERROR, "Failed to allocate an instance "
+ LOGPFSML(trx->fi, LOGL_ERROR, "Failed to allocate an instance "
"of FSM '%s'\n", trx_fsm.name);
talloc_free(trx);
return NULL;
@@ -737,7 +737,7 @@
return trx;

udp_error:
- LOGP(DTRX, LOGL_ERROR, "Couldn't establish UDP connection\n");
+ LOGPFSML(trx->fi, LOGL_ERROR, "Couldn't establish UDP connection\n");
osmo_fsm_inst_free(trx->fi);
talloc_free(trx);
return NULL;
@@ -766,7 +766,7 @@
if (!trx)
return;

- LOGP(DTRX, LOGL_NOTICE, "Shutdown transceiver interface\n");
+ LOGPFSML(trx->fi, LOGL_NOTICE, "Shutdown transceiver interface\n");

/* Flush CTRL message list */
trx_if_flush_ctrl(trx);

1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.

To view, visit change 28676. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ic253903e7b8635bb13e210acfe929c73f8870632
Gerrit-Change-Number: 28676
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged