diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-06-18 16:56:22 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-06-18 19:11:55 +0200 |
commit | d819a57c60a28dcad4478f041e82b9da818e0373 (patch) | |
tree | 77451e002f037f479157cb87ab26f5a84ee95bd9 | |
parent | cec19e6324b43f141a03fbc72f20534099b20be1 (diff) |
Introduce LOGPTRX macro and use it in tx_power.c
Rename OCTPHY specific LOPGTRX macro to avoid redefine conflicts.
Change-Id: I02878611501aca51039e2ac7e35784ccb93b1db6
-rw-r--r-- | include/osmo-bts/gsm_data.h | 1 | ||||
-rw-r--r-- | src/common/tx_power.c | 20 | ||||
-rw-r--r-- | src/osmo-bts-octphy/l1_oml.c | 16 | ||||
-rw-r--r-- | tests/tx_power/tx_power_test.err | 74 |
4 files changed, 56 insertions, 55 deletions
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 80cc0be7..9032aeba 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -44,6 +44,7 @@ #define GSM_BTS_AGCH_QUEUE_HIGH_LEVEL_DEFAULT 91 #define LOGPLCHAN(lchan, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_lchan_name(lchan), ## args) +#define LOGPTRX(trx, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_trx_name(trx), ## args) struct gsm_network { struct llist_head bts_list; 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; } diff --git a/tests/tx_power/tx_power_test.err b/tests/tx_power/tx_power_test.err index bf33b424..03130b24 100644 --- a/tests/tx_power/tx_power_test.err +++ b/tests/tx_power/tx_power_test.err @@ -1,38 +1,38 @@ -power_ramp_start(cur=0, tgt=40000) -[0;mAsked to ramp power up to 40000 mdBm, which exceeds P_max_out (33000) -[0;mpower_ramp_start(cur=0, tgt=33000) -[0;mramp_timer_cb(cur_pout=2000, tgt_pout=33000, ramp_att=31000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to -8000 mdBm. -[0;mramp_timer_cb(cur_pout=4000, tgt_pout=33000, ramp_att=29000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to -6000 mdBm. -[0;mramp_timer_cb(cur_pout=6000, tgt_pout=33000, ramp_att=27000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to -4000 mdBm. -[0;mramp_timer_cb(cur_pout=8000, tgt_pout=33000, ramp_att=25000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to -2000 mdBm. -[0;mramp_timer_cb(cur_pout=10000, tgt_pout=33000, ramp_att=23000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 0 mdBm. -[0;mramp_timer_cb(cur_pout=12000, tgt_pout=33000, ramp_att=21000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 2000 mdBm. -[0;mramp_timer_cb(cur_pout=14000, tgt_pout=33000, ramp_att=19000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 4000 mdBm. -[0;mramp_timer_cb(cur_pout=16000, tgt_pout=33000, ramp_att=17000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 6000 mdBm. -[0;mramp_timer_cb(cur_pout=18000, tgt_pout=33000, ramp_att=15000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 8000 mdBm. -[0;mramp_timer_cb(cur_pout=20000, tgt_pout=33000, ramp_att=13000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 10000 mdBm. -[0;mramp_timer_cb(cur_pout=22000, tgt_pout=33000, ramp_att=11000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 12000 mdBm. -[0;mramp_timer_cb(cur_pout=24000, tgt_pout=33000, ramp_att=9000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 14000 mdBm. -[0;mramp_timer_cb(cur_pout=26000, tgt_pout=33000, ramp_att=7000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 16000 mdBm. -[0;mramp_timer_cb(cur_pout=28000, tgt_pout=33000, ramp_att=5000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 18000 mdBm. -[0;mramp_timer_cb(cur_pout=30000, tgt_pout=33000, ramp_att=3000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 20000 mdBm. -[0;mramp_timer_cb(cur_pout=32000, tgt_pout=33000, ramp_att=1000, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 22000 mdBm. -[0;mramp_timer_cb(cur_pout=33000, tgt_pout=33000, ramp_att=0, therm_att=0, user_gain=0) -[0;mramping TRX board output power to 23000 mdBm. +(bts=0,trx=1) power_ramp_start(cur=0, tgt=40000) +[0;m(bts=0,trx=1) Asked to ramp power up to 40000 mdBm, which exceeds P_max_out (33000) +[0;m(bts=0,trx=1) power_ramp_start(cur=0, tgt=33000) +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=2000, tgt_pout=33000, ramp_att=31000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to -8000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=4000, tgt_pout=33000, ramp_att=29000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to -6000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=6000, tgt_pout=33000, ramp_att=27000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to -4000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=8000, tgt_pout=33000, ramp_att=25000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to -2000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=10000, tgt_pout=33000, ramp_att=23000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 0 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=12000, tgt_pout=33000, ramp_att=21000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 2000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=14000, tgt_pout=33000, ramp_att=19000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 4000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=16000, tgt_pout=33000, ramp_att=17000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 6000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=18000, tgt_pout=33000, ramp_att=15000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 8000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=20000, tgt_pout=33000, ramp_att=13000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 10000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=22000, tgt_pout=33000, ramp_att=11000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 12000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=24000, tgt_pout=33000, ramp_att=9000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 14000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=26000, tgt_pout=33000, ramp_att=7000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 16000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=28000, tgt_pout=33000, ramp_att=5000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 18000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=30000, tgt_pout=33000, ramp_att=3000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 20000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=32000, tgt_pout=33000, ramp_att=1000, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 22000 mdBm. +[0;m(bts=0,trx=1) ramp_timer_cb(cur_pout=33000, tgt_pout=33000, ramp_att=0, therm_att=0, user_gain=0) +[0;m(bts=0,trx=1) ramping TRX board output power to 23000 mdBm. [0;m
\ No newline at end of file |