aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-06-18 16:56:22 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-06-18 19:11:55 +0200
commitd819a57c60a28dcad4478f041e82b9da818e0373 (patch)
tree77451e002f037f479157cb87ab26f5a84ee95bd9 /src
parentcec19e6324b43f141a03fbc72f20534099b20be1 (diff)
Introduce LOGPTRX macro and use it in tx_power.c
Rename OCTPHY specific LOPGTRX macro to avoid redefine conflicts. Change-Id: I02878611501aca51039e2ac7e35784ccb93b1db6
Diffstat (limited to 'src')
-rw-r--r--src/common/tx_power.c20
-rw-r--r--src/osmo-bts-octphy/l1_oml.c16
2 files changed, 18 insertions, 18 deletions
diff --git a/src/common/tx_power.c b/src/common/tx_power.c
index db3121d8..705038c5 100644
--- a/src/common/tx_power.c
+++ b/src/common/tx_power.c
@@ -171,13 +171,13 @@ static void power_ramp_timer_cb(void *_trx)
/* compute new effective (= minus ramp and thermal attenuation) TRX output required */
p_trxout_eff_mdBm = get_p_trxout_eff_mdBm(trx, tpp->p_total_tgt_mdBm);
- LOGP(DL1C, LOGL_DEBUG, "ramp_timer_cb(cur_pout=%d, tgt_pout=%d, "
+ LOGPTRX(trx, DL1C, LOGL_DEBUG, "ramp_timer_cb(cur_pout=%d, tgt_pout=%d, "
"ramp_att=%d, therm_att=%d, user_gain=%d)\n",
tpp->p_total_cur_mdBm, tpp->p_total_tgt_mdBm,
tpp->ramp.attenuation_mdB, tpp->thermal_attenuation_mdB,
tpp->user_gain_mdB);
- LOGP(DL1C, LOGL_INFO,
+ LOGPTRX(trx, DL1C, LOGL_INFO,
"ramping TRX board output power to %d mdBm.\n", p_trxout_eff_mdBm);
/* Instruct L1 to apply new effective TRX output power required */
@@ -196,9 +196,9 @@ void power_trx_change_compl(struct gsm_bts_trx *trx, int p_trxout_cur_mdBm)
/* for now we simply write an error message, but in the future
* we might use the value (again) as part of our math? */
if (p_trxout_cur_mdBm != p_trxout_should_mdBm) {
- LOGP(DL1C, LOGL_ERROR, "bts_model notifies us of %u mdBm TRX "
- "output power. However, it should be %u mdBm!\n",
- p_trxout_cur_mdBm, p_trxout_should_mdBm);
+ LOGPTRX(trx, DL1C, LOGL_ERROR, "bts_model notifies us of %u mdBm TRX "
+ "output power. However, it should be %u mdBm!\n",
+ p_trxout_cur_mdBm, p_trxout_should_mdBm);
}
/* and do another step... */
@@ -244,13 +244,13 @@ int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass)
* the maximum total system power subtracted by OML as well as RSL
* reductions */
- LOGP(DL1C, LOGL_INFO, "power_ramp_start(cur=%d, tgt=%d)\n",
+ LOGPTRX(trx, DL1C, LOGL_INFO, "power_ramp_start(cur=%d, tgt=%d)\n",
tpp->p_total_cur_mdBm, p_total_tgt_mdBm);
if (!bypass && (p_total_tgt_mdBm > get_p_nominal_mdBm(trx))) {
- LOGP(DL1C, LOGL_ERROR, "Asked to ramp power up to "
- "%d mdBm, which exceeds P_max_out (%d)\n",
- p_total_tgt_mdBm, get_p_nominal_mdBm(trx));
+ LOGPTRX(trx, DL1C, LOGL_ERROR, "Asked to ramp power up to "
+ "%d mdBm, which exceeds P_max_out (%d)\n",
+ p_total_tgt_mdBm, get_p_nominal_mdBm(trx));
return -ERANGE;
}
@@ -262,7 +262,7 @@ int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass)
if (we_are_ramping_up(trx)) {
if (tpp->p_total_tgt_mdBm <= tpp->ramp.max_initial_pout_mdBm) {
- LOGP(DL1C, LOGL_INFO,
+ LOGPTRX(trx, DL1C, LOGL_INFO,
"target_power(%d) is below max.initial power\n",
tpp->p_total_tgt_mdBm);
/* new setting is below the maximum initial output
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 9c5dd199..0f366621 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -54,7 +54,7 @@
bool no_fw_check = 0;
-#define LOGPTRX(byTrxId, level, fmt, args...) \
+#define LOGPOCTTRX(byTrxId, level, fmt, args...) \
LOGP(DL1C, level, "(byTrxId %u) " fmt, byTrxId, ## args)
/* Map OSMOCOM logical channel type to OctPHY Logical channel type */
@@ -381,7 +381,7 @@ static int lchan_act_compl_cb(struct octphy_hdl *fl1, struct msgb *resp, void *d
mOCTVC1_GSM_MSG_TRX_ACTIVATE_LOGICAL_CHANNEL_RSP_SWAP(ar);
trx = trx_by_l1h(fl1, ar->TrxId.byTrxId);
if (!trx) {
- LOGPTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during lchan activation\n");
+ LOGPOCTTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during lchan activation\n");
return -EINVAL;
}
@@ -496,7 +496,7 @@ static int set_ciph_compl_cb(struct octphy_hdl *fl1, struct msgb *resp, void *da
trx = trx_by_l1h(fl1, pcr->TrxId.byTrxId);
if (!trx) {
- LOGPTRX(pcr->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during cipher mode activation\n");
+ LOGPOCTTRX(pcr->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during cipher mode activation\n");
return -EINVAL;
}
@@ -700,7 +700,7 @@ static int lchan_deact_compl_cb(struct octphy_hdl *fl1, struct msgb *resp, void
mOCTVC1_GSM_MSG_TRX_DEACTIVATE_LOGICAL_CHANNEL_RSP_SWAP(ldr);
trx = trx_by_l1h(fl1, ldr->TrxId.byTrxId);
if (!trx) {
- LOGPTRX(ldr->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during lchan deactivation\n");
+ LOGPOCTTRX(ldr->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during lchan deactivation\n");
return -EINVAL;
}
@@ -1283,7 +1283,7 @@ static int trx_open_compl_cb(struct octphy_hdl *fl1h, struct msgb *resp, void *d
mOCTVC1_GSM_MSG_TRX_OPEN_RSP_SWAP(or);
trx = trx_by_l1h(fl1h, or->TrxId.byTrxId);
if (!trx) {
- LOGPTRX(or->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during TRX opening procedure -- abort\n");
+ LOGPOCTTRX(or->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during TRX opening procedure -- abort\n");
exit(1);
}
@@ -1470,7 +1470,7 @@ static int pchan_act_compl_cb(struct octphy_hdl *fl1, struct msgb *resp, void *d
mOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_RSP_SWAP(ar);
trx = trx_by_l1h(fl1, ar->TrxId.byTrxId);
if (!trx) {
- LOGPTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during physical channel activation -- abort\n");
+ LOGPOCTTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during physical channel activation -- abort\n");
exit(1);
}
@@ -1553,7 +1553,7 @@ static int ts_disconnect_cb(struct octphy_hdl *fl1, struct msgb *resp,
trx = trx_by_l1h(fl1, ar->TrxId.byTrxId);
if (!trx) {
- LOGPTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during ts disconnection\n");
+ LOGPOCTTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during ts disconnection\n");
return -EINVAL;
}
@@ -1581,7 +1581,7 @@ static int ts_connect_cb(struct octphy_hdl *fl1, struct msgb *resp, void *data)
mOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_RSP_SWAP(ar);
trx = trx_by_l1h(fl1, ar->TrxId.byTrxId);
if (!trx) {
- LOGPTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id while connecting ts\n");
+ LOGPOCTTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id while connecting ts\n");
return -EINVAL;
}