laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/32114 )


Change subject: cosmetic: Change LOGPLCFN argument order
......................................................................

cosmetic: Change LOGPLCFN argument order

As it has come up during code review of Change-ID
I214af0448652a9f321ccbab77977b67663ba28f9 introducing LOGPLCNF, my
approach to the strict preserval of argument order (lchan first from
LOGPLCHAN and fn *after* loglevel from LOGPFN) was considered
sub-optimal.

I used the following spatch rule to clean this up:

@@
expression lc, ss, logl, fn;
expression list trailer;
@@

-LOGPLCFN(lc, ss, logl, fn, trailer);
+LOGPLCFN(lc, fn, ss, logl, trailer);

Change-Id: Iba4a8416545673d03cb057e4855f8b1ecae3e1ec
---
M include/osmo-bts/logging.h
M src/common/l1sap.c
M src/common/measurement.c
M src/osmo-bts-lc15/l1_if.c
M src/osmo-bts-lc15/tch.c
M src/osmo-bts-oc2g/l1_if.c
M src/osmo-bts-oc2g/tch.c
M src/osmo-bts-octphy/l1_if.c
M src/osmo-bts-octphy/l1_tch.c
M src/osmo-bts-sysmo/l1_if.c
M src/osmo-bts-sysmo/tch.c
M src/osmo-bts-virtual/l1_if.c
12 files changed, 96 insertions(+), 80 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/32114/1

diff --git a/include/osmo-bts/logging.h b/include/osmo-bts/logging.h
index d452cde..cf46352 100644
--- a/include/osmo-bts/logging.h
+++ b/include/osmo-bts/logging.h
@@ -38,7 +38,7 @@
        LOGP(ss, LOGL_DEBUG, "%s " fmt, gsm_fn_as_gsmtime_str(fn), ## args)

 /* LOGP with lchan + frame number prefix */
-#define LOGPLCFN(lchan, ss, lvl, fn, fmt, args...) \
+#define LOGPLCFN(lchan, fn, ss, lvl, fmt, args...) \
        LOGP(ss, lvl, "%s %s " fmt, gsm_lchan_name(lchan), 
gsm_fn_as_gsmtime_str(fn), ## args)

 /* LOGP with lchan + gsm_time prefix */
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 8543f2c..07fc794 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -751,9 +751,9 @@
                OSMO_ASSERT(false);
        }

-       LOGPLCFN(lchan, DL1P, LOGL_DEBUG, fn,
-                "%s meas ind, ta_offs_256bits=%d, ber10k=%d, inv_rssi=%u, 
C/I=%d cB\n",
-                ind_name, ulm.ta_offs_256bits, ulm.ber10k, ulm.inv_rssi, 
ulm.ci_cb);
+       LOGPLCFN(lchan, fn, DL1P, LOGL_DEBUG,
+                "%s meas ind, ta_offs_256bits=%d, ber10k=%d, inv_rssi=%u, 
C/I=%d cB\n", ind_name,
+                ulm.ta_offs_256bits, ulm.ber10k, ulm.inv_rssi, ulm.ci_cb);

        /* we assume that symbol period is 1 bit: */
        set_ms_to_data(lchan, ulm.ta_offs_256bits / 256, true);
diff --git a/src/common/measurement.c b/src/common/measurement.c
index b6cfee0..459b586 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -73,8 +73,7 @@
                         * SUB */
                        return true;
                default:
-                       LOGPLCFN(lchan, DMEAS, LOGL_ERROR, fn, "Unsupported 
lchan->tch_mode %u\n",
-                                lchan->tch_mode);
+                       LOGPLCFN(lchan, fn, DMEAS, LOGL_ERROR, "Unsupported 
lchan->tch_mode %u\n", lchan->tch_mode);
                        break;
                }
                break;
@@ -89,8 +88,7 @@
                         * SUB */
                        return true;
                default:
-                       LOGPLCFN(lchan, DMEAS, LOGL_ERROR, fn, "Unsupported 
lchan->tch_mode %u\n",
-                                lchan->tch_mode);
+                       LOGPLCFN(lchan, fn, DMEAS, LOGL_ERROR, "Unsupported 
lchan->tch_mode %u\n", lchan->tch_mode);
                        break;
                }
                break;
@@ -269,9 +267,8 @@
        }

        if (rc == 1) {
-               LOGPLCFN(lchan, DMEAS, LOGL_DEBUG, fn,
-                      "meas period end fn_mod:%d, status:%d, pchan:%s\n",
-                      fn_mod, rc, gsm_pchan_name(pchan));
+               LOGPLCFN(lchan, fn, DMEAS, LOGL_DEBUG, "meas period end 
fn_mod:%d, status:%d, pchan:%s\n", fn_mod,
+                        rc, gsm_pchan_name(pchan));
        }

        return rc;
@@ -307,15 +304,15 @@
        struct bts_ul_meas *dest;

        if (lchan->state != LCHAN_S_ACTIVE) {
-               LOGPLCFN(lchan, DMEAS, LOGL_NOTICE, fn,
+               LOGPLCFN(lchan, fn, DMEAS, LOGL_NOTICE,
                         "measurement during state: %s, num_ul_meas=%d, 
fn_mod=%u\n",
                         gsm_lchans_name(lchan->state), 
lchan->meas.num_ul_meas, fn_mod);
        }

        if (lchan->meas.num_ul_meas >= ARRAY_SIZE(lchan->meas.uplink)) {
-               LOGPLCFN(lchan, DMEAS, LOGL_NOTICE, fn,
-                        "no space for uplink measurement, num_ul_meas=%d, 
fn_mod=%u\n",
-                        lchan->meas.num_ul_meas, fn_mod);
+               LOGPLCFN(lchan, fn, DMEAS, LOGL_NOTICE,
+                        "no space for uplink measurement, num_ul_meas=%d, 
fn_mod=%u\n", lchan->meas.num_ul_meas,
+                        fn_mod);
                return -ENOSPC;
        }

@@ -327,10 +324,9 @@
        if (!ulm->is_sub)
                dest->is_sub = ts45008_83_is_sub(lchan, fn);

-       LOGPLCFN(lchan, DMEAS, LOGL_DEBUG, fn,
+       LOGPLCFN(lchan, fn, DMEAS, LOGL_DEBUG,
                 "adding a %s measurement (ber10k=%u, ta_offs=%d, ci_cB=%d, 
rssi=-%u), num_ul_meas=%d, fn_mod=%u\n",
-                dest->is_sub ? "SUB" : "FULL",
-                ulm->ber10k, ulm->ta_offs_256bits, ulm->ci_cb, ulm->inv_rssi,
+                dest->is_sub ? "SUB" : "FULL", ulm->ber10k, 
ulm->ta_offs_256bits, ulm->ci_cb, ulm->inv_rssi,
                 lchan->meas.num_ul_meas, fn_mod);

        lchan->meas.last_fn = fn;
diff --git a/src/osmo-bts-lc15/l1_if.c b/src/osmo-bts-lc15/l1_if.c
index 3d6d90e..e999527 100644
--- a/src/osmo-bts-lc15/l1_if.c
+++ b/src/osmo-bts-lc15/l1_if.c
@@ -395,7 +395,7 @@
                else
                        sapi = GsmL1_Sapi_Agch;
        } else {
-               LOGPLCFN(lchan, DL1C, LOGL_NOTICE, u32Fn, "unknown prim %d op 
%d chan_nr %d link_id %d\n",
+               LOGPLCFN(lchan, u32Fn, DL1C, LOGL_NOTICE, "unknown prim %d op 
%d chan_nr %d link_id %d\n",
                         l1sap->oph.primitive, l1sap->oph.operation, chan_nr, 
link_id);
                msgb_free(l1msg);
                return -EINVAL;
@@ -457,9 +457,8 @@
                        memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, msg->l2h,
                               msgb_l2len(msg));
                }
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, u32Fn, "PH-DATA.req(%s)\n",
-                        osmo_hexdump(l1p->u.phDataReq.msgUnitParam.u8Buffer,
-                                     l1p->u.phDataReq.msgUnitParam.u8Size));
+               LOGPLCFN(lchan, u32Fn, DL1P, LOGL_DEBUG, "PH-DATA.req(%s)\n",
+                        osmo_hexdump(l1p->u.phDataReq.msgUnitParam.u8Buffer, 
l1p->u.phDataReq.msgUnitParam.u8Size));
        } else {
                /* empty frame */
                GsmL1_Prim_t *l1p = msgb_l1prim(l1msg);
@@ -469,7 +468,7 @@

        /* send message to DSP's queue */
        if (osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], l1msg) != 0) {
-               LOGPLCFN(lchan, DL1P, LOGL_ERROR, u32Fn, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
+               LOGPLCFN(lchan, u32Fn, DL1P, LOGL_ERROR, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
                msgb_free(l1msg);
        } else
                dtx_int_signal(lchan);
@@ -552,7 +551,7 @@
        }
        /* send message to DSP's queue */
        if (osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], nmsg) < 0) {
-               LOGPLCFN(lchan, DL1P, LOGL_ERROR, u32Fn, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
+               LOGPLCFN(lchan, u32Fn, DL1P, LOGL_ERROR, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
                msgb_free(nmsg);
                return -ENOBUFS;
        }
diff --git a/src/osmo-bts-lc15/tch.c b/src/osmo-bts-lc15/tch.c
index f9a4e21..65cd8aa 100644
--- a/src/osmo-bts-lc15/tch.c
+++ b/src/osmo-bts-lc15/tch.c
@@ -368,7 +368,7 @@
                return -EAGAIN;

        if (data_ind->msgUnitParam.u8Size < 1) {
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d 
Rx Payload size 0\n", chan_nr);
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "chan_nr %d 
Rx Payload size 0\n", chan_nr);
                /* Push empty payload to upper layers */
                rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
                return add_l1sap_header(trx, rmsg, lchan, chan_nr, 
data_ind->u32Fn,
@@ -399,8 +399,8 @@
                if (lchan->type != GSM_LCHAN_TCH_H &&
                    lchan->type != GSM_LCHAN_TCH_F)
                        goto err_payload_match;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received ONSET from L1 "
-                        "(%d bytes)\n", payload_len);
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received ONSET from L1 " "(%d bytes)\n",
+                        payload_len);
                /* according to 3GPP TS 26.093 ONSET frames precede the first
                   speech frame of a speech burst - set the marker for next RTP
                   frame */
@@ -409,31 +409,31 @@
        case GsmL1_TchPlType_Amr_SidFirstP1:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_FIRST_P1 from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_FIRST_P1 from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        case GsmL1_TchPlType_Amr_SidFirstP2:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_FIRST_P2 from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_FIRST_P2 from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        case GsmL1_TchPlType_Amr_SidFirstInH:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
                lchan->rtp_tx_marker = true;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_FIRST_INH from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_FIRST_INH from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        case GsmL1_TchPlType_Amr_SidUpdateInH:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
                lchan->rtp_tx_marker = true;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_UPDATE_INH from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_UPDATE_INH from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        default:
-               LOGPLCFN(lchan, DL1P, LOGL_NOTICE, data_ind->u32Fn, "%s Rx 
Payload Type %s is unsupported\n",
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_NOTICE, "%s Rx 
Payload Type %s is unsupported\n",
                         gsm_lchan_name(lchan), 
get_value_string(lc15bts_tch_pl_names, payload_type));
                break;
        }
@@ -463,7 +463,7 @@
        return 0;

 err_payload_match:
-       LOGPLCFN(lchan, DL1P, LOGL_ERROR, data_ind->u32Fn, "%s Rx Payload Type 
%s incompatible with lchan\n",
+       LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_ERROR, "%s Rx Payload Type 
%s incompatible with lchan\n",
                 gsm_lchan_name(lchan), get_value_string(lc15bts_tch_pl_names, 
payload_type));
        return -EINVAL;
 }
diff --git a/src/osmo-bts-oc2g/l1_if.c b/src/osmo-bts-oc2g/l1_if.c
index 8762063..4f99097 100644
--- a/src/osmo-bts-oc2g/l1_if.c
+++ b/src/osmo-bts-oc2g/l1_if.c
@@ -440,9 +440,8 @@
                else
                        sapi = GsmL1_Sapi_Agch;
        } else {
-               LOGPLCFN(lchan, DL1C, LOGL_NOTICE, u32Fn, "unknown prim %d op 
%d "
-                        "chan_nr %d link_id %d\n", l1sap->oph.primitive,
-                        l1sap->oph.operation, chan_nr, link_id);
+               LOGPLCFN(lchan, u32Fn, DL1C, LOGL_NOTICE, "unknown prim %d op 
%d " "chan_nr %d link_id %d\n",
+                        l1sap->oph.primitive, l1sap->oph.operation, chan_nr, 
link_id);
                msgb_free(l1msg);
                return -EINVAL;
        }
@@ -503,9 +502,8 @@
                        memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, msg->l2h,
                               msgb_l2len(msg));
                }
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, u32Fn, "PH-DATA.req(%s)\n",
-                        osmo_hexdump(l1p->u.phDataReq.msgUnitParam.u8Buffer,
-                                     l1p->u.phDataReq.msgUnitParam.u8Size));
+               LOGPLCFN(lchan, u32Fn, DL1P, LOGL_DEBUG, "PH-DATA.req(%s)\n",
+                        osmo_hexdump(l1p->u.phDataReq.msgUnitParam.u8Buffer, 
l1p->u.phDataReq.msgUnitParam.u8Size));
        } else {
                GsmL1_Prim_t *l1p = msgb_l1prim(l1msg);
                if (lchan->rsl_cmode == RSL_CMOD_SPD_SIGN)
@@ -523,7 +521,7 @@

        /* send message to DSP's queue */
        if (osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], l1msg) != 0) {
-               LOGPLCFN(lchan, DL1P, LOGL_ERROR, u32Fn, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
+               LOGPLCFN(lchan, u32Fn, DL1P, LOGL_ERROR, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
                msgb_free(l1msg);
        } else
                dtx_int_signal(lchan);
@@ -606,7 +604,7 @@
        }
        /* send message to DSP's queue */
        if (osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], nmsg) < 0) {
-               LOGPLCFN(lchan, DL1P, LOGL_ERROR, u32Fn, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
+               LOGPLCFN(lchan, u32Fn, DL1P, LOGL_ERROR, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
                msgb_free(nmsg);
                return -ENOBUFS;
        }
diff --git a/src/osmo-bts-oc2g/tch.c b/src/osmo-bts-oc2g/tch.c
index bd97959..bcfdced 100644
--- a/src/osmo-bts-oc2g/tch.c
+++ b/src/osmo-bts-oc2g/tch.c
@@ -368,7 +368,7 @@
                return -EAGAIN;

        if (data_ind->msgUnitParam.u8Size < 1) {
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d 
Rx Payload size 0\n", chan_nr);
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "chan_nr %d 
Rx Payload size 0\n", chan_nr);
                /* Push empty payload to upper layers */
                rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
                return add_l1sap_header(trx, rmsg, lchan, chan_nr, 
data_ind->u32Fn,
@@ -403,8 +403,8 @@
                if (lchan->type != GSM_LCHAN_TCH_H &&
                    lchan->type != GSM_LCHAN_TCH_F)
                        goto err_payload_match;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received ONSET from L1 "
-                        "(%d bytes)\n", payload_len);
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received ONSET from L1 " "(%d bytes)\n",
+                        payload_len);
                /* according to 3GPP TS 26.093 ONSET frames precede the first
                   speech frame of a speech burst - set the marker for next RTP
                   frame */
@@ -414,13 +414,13 @@
        case GsmL1_TchPlType_Amr_SidFirstP1:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_FIRST_P1 from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_FIRST_P1 from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        case GsmL1_TchPlType_Amr_SidFirstP2:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_FIRST_P2 from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_FIRST_P2 from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        case GsmL1_TchPlType_Amr_SidFirstInH:
@@ -428,19 +428,19 @@
                        goto err_payload_match;
                lchan->tch.dtx.is_speech_resume = true;
                lchan->rtp_tx_marker = true;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_FIRST_INH from L1 "
-                       "(%d bytes)\n", payload_len);
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_FIRST_INH from L1 "
+                        "(%d bytes)\n", payload_len);
                break;
        case GsmL1_TchPlType_Amr_SidUpdateInH:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
                lchan->tch.dtx.is_speech_resume = true;
                lchan->rtp_tx_marker = true;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_UPDATE_INH from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_UPDATE_INH from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        default:
-               LOGPLCFN(lchan, DL1P, LOGL_NOTICE, data_ind->u32Fn, "%s Rx 
Payload Type %s is unsupported\n",
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_NOTICE, "%s Rx 
Payload Type %s is unsupported\n",
                         gsm_lchan_name(lchan), 
get_value_string(oc2gbts_tch_pl_names, payload_type));
                break;
        }
@@ -473,7 +473,7 @@
        return 0;

 err_payload_match:
-       LOGPLCFN(lchan, DL1P, LOGL_ERROR, data_ind->u32Fn, "%s Rx Payload Type 
%s incompatible with lchan\n",
+       LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_ERROR, "%s Rx Payload Type 
%s incompatible with lchan\n",
                 gsm_lchan_name(lchan), get_value_string(oc2gbts_tch_pl_names, 
payload_type));
        return -EINVAL;
 }
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 1488a9d..f132cdd 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -589,7 +589,7 @@
        if (msg) {
                nmsg = l1p_msgb_alloc();
                if (!nmsg) {
-                       LOGPLCFN(lchan, DL1C, LOGL_FATAL, u32Fn, "L1SAP 
PH-TCH.req msg alloc failed\n");
+                       LOGPLCFN(lchan, u32Fn, DL1C, LOGL_FATAL, "L1SAP 
PH-TCH.req msg alloc failed\n");
                        return -ENOMEM;
                }

diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c
index f8800fd..4b542d1 100644
--- a/src/osmo-bts-octphy/l1_tch.c
+++ b/src/osmo-bts-octphy/l1_tch.c
@@ -146,7 +146,7 @@
            &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];

        if (data_ind->Data.ulDataLength < 1) {
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, fn, "chan_nr %d Rx Payload 
size 0\n", chan_nr);
+               LOGPLCFN(lchan, fn, DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload 
size 0\n", chan_nr);
                /* Push empty payload to upper layers */
                rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
                return add_l1sap_header(trx, rmsg, lchan, chan_nr,
@@ -173,13 +173,13 @@
                        goto err_payload_match;
                break;
        default:
-               LOGPLCFN(lchan, DL1P, LOGL_NOTICE, fn, "%s Rx Payload Type %d 
is unsupported\n",
+               LOGPLCFN(lchan, fn, DL1P, LOGL_NOTICE, "%s Rx Payload Type %d 
is unsupported\n",
                         gsm_lchan_name(lchan), payload_type);
                break;
        }

-       LOGPLCFN(lchan, DL1P, LOGL_DEBUG, fn, "%s Rx codec frame (%u): %s\n", 
gsm_lchan_name(lchan),
-                payload_len, osmo_hexdump(payload, payload_len));
+       LOGPLCFN(lchan, fn, DL1P, LOGL_DEBUG, "%s Rx codec frame (%u): %s\n", 
gsm_lchan_name(lchan), payload_len,
+                osmo_hexdump(payload, payload_len));

        switch (payload_type) {
        case cOCTVC1_GSM_PAYLOAD_TYPE_ENUM_FULL_RATE:
@@ -201,7 +201,7 @@
                rmsg = l1_to_rtppayload_amr(payload, payload_len,
                                &lchan->tch.amr_mr);
 #else
-               LOGPLCFN(lchan, DL1P, LOGL_ERROR, fn, "OctPHY only supports 
FR!\n");
+               LOGPLCFN(lchan, fn, DL1P, LOGL_ERROR, "OctPHY only supports 
FR!\n");
                return -1;
 #endif
                break;
@@ -215,7 +215,7 @@
        return 0;

 err_payload_match:
-       LOGPLCFN(lchan, DL1P, LOGL_ERROR, fn, "%s Rx Payload Type %d 
incompatible with lchan\n",
+       LOGPLCFN(lchan, fn, DL1P, LOGL_ERROR, "%s Rx Payload Type %d 
incompatible with lchan\n",
                 gsm_lchan_name(lchan), payload_type);
        return -EINVAL;
 }
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 19f0c5a..fafbe62 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -392,9 +392,8 @@
                else
                        sapi = GsmL1_Sapi_Agch;
        } else {
-               LOGPLCFN(lchan, DL1C, LOGL_NOTICE, u32Fn, "unknown prim %d op 
%d "
-                       "chan_nr %d link_id %d\n", l1sap->oph.primitive,
-                       l1sap->oph.operation, chan_nr, link_id);
+               LOGPLCFN(lchan, u32Fn, DL1C, LOGL_NOTICE, "unknown prim %d op 
%d " "chan_nr %d link_id %d\n",
+                        l1sap->oph.primitive, l1sap->oph.operation, chan_nr, 
link_id);
                msgb_free(l1msg);
                return -EINVAL;
        }
@@ -455,9 +454,8 @@
                        memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, msg->l2h,
                               msgb_l2len(msg));
                }
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, u32Fn, "PH-DATA.req(%s)\n",
-                    osmo_hexdump(l1p->u.phDataReq.msgUnitParam.u8Buffer,
-                                         
l1p->u.phDataReq.msgUnitParam.u8Size));
+               LOGPLCFN(lchan, u32Fn, DL1P, LOGL_DEBUG, "PH-DATA.req(%s)\n",
+                        osmo_hexdump(l1p->u.phDataReq.msgUnitParam.u8Buffer, 
l1p->u.phDataReq.msgUnitParam.u8Size));
        } else {
                /* empty frame */
                GsmL1_Prim_t *l1p = msgb_l1prim(l1msg);
@@ -467,7 +465,7 @@

        /* send message to DSP's queue */
        if (osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], l1msg) != 0) {
-               LOGPLCFN(lchan, DL1P, LOGL_ERROR, u32Fn, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
+               LOGPLCFN(lchan, u32Fn, DL1P, LOGL_ERROR, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
                msgb_free(l1msg);
        } else
                dtx_int_signal(lchan);
@@ -550,7 +548,7 @@
        }
        /* send message to DSP's queue */
        if (osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], nmsg) != 0) {
-               LOGPLCFN(lchan, DL1P, LOGL_ERROR, u32Fn, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
+               LOGPLCFN(lchan, u32Fn, DL1P, LOGL_ERROR, "MQ_L1_WRITE queue 
full. Dropping msg.\n");
                msgb_free(nmsg);
                return -ENOBUFS;
        }
diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c
index e901d47..8965014 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -513,7 +513,7 @@
                return -EAGAIN;

        if (data_ind->msgUnitParam.u8Size < 1) {
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d 
Rx Payload size 0\n", chan_nr);
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "chan_nr %d 
Rx Payload size 0\n", chan_nr);
                /* Push empty payload to upper layers */
                rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
                return add_l1sap_header(trx, rmsg, lchan, chan_nr, 
data_ind->u32Fn,
@@ -549,8 +549,8 @@
                if (lchan->type != GSM_LCHAN_TCH_H &&
                    lchan->type != GSM_LCHAN_TCH_F)
                        goto err_payload_match;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received ONSET from L1 "
-                        "(%d bytes)\n", payload_len);
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received ONSET from L1 " "(%d bytes)\n",
+                        payload_len);
                /* according to 3GPP TS 26.093 ONSET frames precede the first
                   speech frame of a speech burst - set the marker for next RTP
                   frame */
@@ -559,31 +559,31 @@
        case GsmL1_TchPlType_Amr_SidFirstP1:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_FIRST_P1 from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_FIRST_P1 from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        case GsmL1_TchPlType_Amr_SidFirstP2:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_FIRST_P2 from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_FIRST_P2 from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        case GsmL1_TchPlType_Amr_SidFirstInH:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
                lchan->rtp_tx_marker = true;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_FIRST_INH from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_FIRST_INH from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        case GsmL1_TchPlType_Amr_SidUpdateInH:
                if (lchan->type != GSM_LCHAN_TCH_H)
                        goto err_payload_match;
                lchan->rtp_tx_marker = true;
-               LOGPLCFN(lchan, DL1P, LOGL_DEBUG, data_ind->u32Fn, "DTX: 
received SID_UPDATE_INH from L1 "
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_DEBUG, "DTX: 
received SID_UPDATE_INH from L1 "
                         "(%d bytes)\n", payload_len);
                break;
        default:
-               LOGPLCFN(lchan, DL1P, LOGL_NOTICE, data_ind->u32Fn, "%s Rx 
Payload Type %s is unsupported\n",
+               LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_NOTICE, "%s Rx 
Payload Type %s is unsupported\n",
                         gsm_lchan_name(lchan), 
get_value_string(femtobts_tch_pl_names, payload_type));
                break;
        }
@@ -619,8 +619,8 @@
        return 0;

 err_payload_match:
-       LOGPLCFN(lchan, DL1P, LOGL_ERROR, data_ind->u32Fn, "%s Rx Payload Type 
%s incompatible with lchan\n",
-               gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, 
payload_type));
+       LOGPLCFN(lchan, data_ind->u32Fn, DL1P, LOGL_ERROR, "%s Rx Payload Type 
%s incompatible with lchan\n",
+                gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, 
payload_type));
        return -EINVAL;
 }

diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c
index 105e726..469e84f 100644
--- a/src/osmo-bts-virtual/l1_if.c
+++ b/src/osmo-bts-virtual/l1_if.c
@@ -319,10 +319,10 @@
        /* 100% BER is n_bits_total is 0 */
        float ber = n_bits_total==0 ? 1.0 : (float)n_errors / 
(float)n_bits_total;

-       LOGPLCFN(lchan, DMEAS, LOGL_DEBUG, fn, "RX L1 frame chan_nr=0x%02x MS 
pwr=%ddBm rssi=%.1f dBFS "
-                "ber=%.2f%% (%d/%d bits) L1_ta=%d ta_ctrl.current=%d 
toa=%.2f\n",
-                chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, 
lchan->ms_power_ctrl.max),
-                rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info.ta, 
lchan->ta_ctrl.current, toa);
+       LOGPLCFN(lchan, fn, DMEAS, LOGL_DEBUG, "RX L1 frame chan_nr=0x%02x MS 
pwr=%ddBm rssi=%.1f dBFS "
+                "ber=%.2f%% (%d/%d bits) L1_ta=%d ta_ctrl.current=%d 
toa=%.2f\n", chan_nr,
+                ms_pwr_dbm(lchan->ts->trx->bts->band, 
lchan->ms_power_ctrl.max), rssi, ber * 100, n_errors,
+                n_bits_total, lchan->meas.l1_info.ta, lchan->ta_ctrl.current, 
toa);

        l1if_fill_meas_res(&l1sap, chan_nr, lchan->ta_ctrl.current + toa, ber, 
rssi, fn);


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iba4a8416545673d03cb057e4855f8b1ecae3e1ec
Gerrit-Change-Number: 32114
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-MessageType: newchange

Reply via email to