Change in osmo-bts[master]: vty: resurrect per-lchan BS/MS Power Control information

2020-12-09 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21481 )

Change subject: vty: resurrect per-lchan BS/MS Power Control information
..

vty: resurrect per-lchan BS/MS Power Control information

Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Related: SYS#4918
---
M src/common/vty.c
1 file changed, 47 insertions(+), 7 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/common/vty.c b/src/common/vty.c
index bbb0ba1..ada871a 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1307,6 +1307,49 @@
}
 }

+static void lchan_bs_power_ctrl_state_dump(struct vty *vty, const char *prefix,
+  const struct gsm_lchan *lchan)
+{
+   const struct lchan_power_ctrl_state *st = &lchan->bs_power_ctrl;
+   const struct gsm_bts_trx *trx = lchan->ts->trx;
+
+   vty_out(vty, "%sBS (Downlink) Power Control (%s):%s",
+   prefix, st->fixed ? "fixed" : "autonomous",
+   VTY_NEWLINE);
+
+   vty_out(vty, "%s  Channel reduction: %u dB", prefix, st->current);
+   if (!st->fixed)
+   vty_out(vty, " (max %u dB)", st->max);
+   vty_out(vty, "%s", VTY_NEWLINE);
+
+   vty_out(vty, "%s  TRX reduction: %u dB%s",
+   prefix, trx->max_power_red, VTY_NEWLINE);
+
+   int actual = trx->nominal_power - (trx->max_power_red + st->current);
+   vty_out(vty, "%s  Actual / Nominal power: %d dBm / %d dBm%s",
+   prefix, actual, trx->nominal_power, VTY_NEWLINE);
+}
+
+static void lchan_ms_power_ctrl_state_dump(struct vty *vty, const char *prefix,
+  const struct gsm_lchan *lchan)
+{
+   const struct lchan_power_ctrl_state *st = &lchan->ms_power_ctrl;
+   const struct gsm_bts_trx *trx = lchan->ts->trx;
+
+   vty_out(vty, "%sMS (Uplink) Power Control (%s):%s",
+   prefix, st->fixed ? "fixed" : "autonomous",
+   VTY_NEWLINE);
+
+   int current_dbm = ms_pwr_dbm(trx->bts->band, st->current);
+   int max_dbm = ms_pwr_dbm(trx->bts->band, st->max);
+
+   vty_out(vty, "%s  Current power level: %u, -%d dBm",
+   prefix, st->current, current_dbm);
+   if (!st->fixed)
+   vty_out(vty, " (max %u, -%d dBm)", st->max, max_dbm);
+   vty_out(vty, "%s", VTY_NEWLINE);
+}
+
 static void lchan_dump_full_vty(struct vty *vty, const struct gsm_lchan *lchan)
 {
struct in_addr ia;
@@ -1335,13 +1378,6 @@
lchan->state == LCHAN_S_BROKEN ? " Error reason: " : "",
lchan->state == LCHAN_S_BROKEN ? lchan->broken_reason : "",
VTY_NEWLINE);
-#if 0
-   /* TODO: print more info about MS/BS Power Control */
-   vty_out(vty, "  BS Power: %d dBm, MS Power: %u dBm%s",
-   lchan->ts->trx->nominal_power - (lchan->ts->trx->max_power_red 
+ lchan->bs_power_red),
-   ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power_ctrl.max),
-   VTY_NEWLINE);
-#endif
vty_out(vty, "  Channel Mode / Codec: %s%s",
gsm48_chan_mode_name(lchan->tch_mode),
VTY_NEWLINE);
@@ -1383,6 +1419,10 @@
if (lchan->loopback)
vty_out(vty, "  RTP/PDCH Loopback Enabled%s", VTY_NEWLINE);
vty_out(vty, "  Radio Link Failure Counter 'S': %d%s", lchan->s, 
VTY_NEWLINE);
+
+   /* BS/MS Power Control state */
+   lchan_bs_power_ctrl_state_dump(vty, "  ", lchan);
+   lchan_ms_power_ctrl_state_dump(vty, "  ", lchan);
 }

 static void lchan_dump_short_vty(struct vty *vty, const struct gsm_lchan 
*lchan)

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Gerrit-Change-Number: 21481
Gerrit-PatchSet: 6
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-bts[master]: vty: resurrect per-lchan BS/MS Power Control information

2020-12-08 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21481 )

Change subject: vty: resurrect per-lchan BS/MS Power Control information
..


Patch Set 4: Code-Review+2


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Gerrit-Change-Number: 21481
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 08 Dec 2020 09:46:40 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: vty: resurrect per-lchan BS/MS Power Control information

2020-12-04 Thread fixeria
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bts/+/21481

to look at the new patch set (#3).

Change subject: vty: resurrect per-lchan BS/MS Power Control information
..

vty: resurrect per-lchan BS/MS Power Control information

Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Related: SYS#4918
---
M src/common/vty.c
1 file changed, 47 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/81/21481/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21481
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Gerrit-Change-Number: 21481
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-bts[master]: vty: resurrect per-lchan BS/MS Power Control information

2020-12-03 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21481 )

Change subject: vty: resurrect per-lchan BS/MS Power Control information
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Gerrit-Change-Number: 21481
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Dec 2020 19:29:39 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: vty: resurrect per-lchan BS/MS Power Control information

2020-12-03 Thread fixeria
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bts/+/21481

to look at the new patch set (#2).

Change subject: vty: resurrect per-lchan BS/MS Power Control information
..

vty: resurrect per-lchan BS/MS Power Control information

Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Related: SYS#4918
---
M src/common/vty.c
1 file changed, 47 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/81/21481/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21481
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Gerrit-Change-Number: 21481
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-bts[master]: vty: resurrect per-lchan BS/MS Power Control information

2020-12-03 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21481 )

Change subject: vty: resurrect per-lchan BS/MS Power Control information
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Gerrit-Change-Number: 21481
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Dec 2020 12:54:18 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: vty: resurrect per-lchan BS/MS Power Control information

2020-12-02 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21481 )


Change subject: vty: resurrect per-lchan BS/MS Power Control information
..

vty: resurrect per-lchan BS/MS Power Control information

Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
---
M src/common/vty.c
1 file changed, 47 insertions(+), 7 deletions(-)



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

diff --git a/src/common/vty.c b/src/common/vty.c
index f366956..b2099ec 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1353,6 +1353,49 @@
}
 }

+static void lchan_bs_power_ctrl_state_dump(struct vty *vty, const char *prefix,
+  const struct gsm_lchan *lchan)
+{
+   const struct lchan_power_ctrl_state *st = &lchan->bs_power_ctrl;
+   const struct gsm_bts_trx *trx = lchan->ts->trx;
+
+   vty_out(vty, "%sBS (Downlink) Power Control (%s):%s",
+   prefix, st->fixed ? "fixed" : "autonomous",
+   VTY_NEWLINE);
+
+   vty_out(vty, "%s  Channel reduction: %u dB", prefix, st->current);
+   if (!st->fixed)
+   vty_out(vty, " (max %u dB)", st->max);
+   vty_out(vty, "%s", VTY_NEWLINE);
+
+   vty_out(vty, "%s  TRX reduction: %u dB%s",
+   prefix, trx->max_power_red, VTY_NEWLINE);
+
+   int actual = trx->nominal_power - (trx->max_power_red + st->current);
+   vty_out(vty, "%s  Actual / Nominal power: %d dBm / %d dBm%s",
+   prefix, actual, trx->nominal_power, VTY_NEWLINE);
+}
+
+static void lchan_ms_power_ctrl_state_dump(struct vty *vty, const char *prefix,
+  const struct gsm_lchan *lchan)
+{
+   const struct lchan_power_ctrl_state *st = &lchan->ms_power_ctrl;
+   const struct gsm_bts_trx *trx = lchan->ts->trx;
+
+   vty_out(vty, "%sMS (Uplink) Power Control (%s):%s",
+   prefix, st->fixed ? "fixed" : "autonomous",
+   VTY_NEWLINE);
+
+   int current_dbm = ms_pwr_dbm(trx->bts->band, st->current);
+   int max_dbm = ms_pwr_dbm(trx->bts->band, st->max);
+
+   vty_out(vty, "%s  Current power level: %u, -%d dBm",
+   prefix, st->current, current_dbm);
+   if (!st->fixed)
+   vty_out(vty, " (max %u, -%d dBm)", st->max, max_dbm);
+   vty_out(vty, "%s", VTY_NEWLINE);
+}
+
 static void lchan_dump_full_vty(struct vty *vty, const struct gsm_lchan *lchan)
 {
struct in_addr ia;
@@ -1381,13 +1424,6 @@
lchan->state == LCHAN_S_BROKEN ? " Error reason: " : "",
lchan->state == LCHAN_S_BROKEN ? lchan->broken_reason : "",
VTY_NEWLINE);
-#if 0
-   /* TODO: print more info about MS/BS Power Control */
-   vty_out(vty, "  BS Power: %d dBm, MS Power: %u dBm%s",
-   lchan->ts->trx->nominal_power - (lchan->ts->trx->max_power_red 
+ lchan->bs_power_red),
-   ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power_ctrl.max),
-   VTY_NEWLINE);
-#endif
vty_out(vty, "  Channel Mode / Codec: %s%s",
gsm48_chan_mode_name(lchan->tch_mode),
VTY_NEWLINE);
@@ -1429,6 +1465,10 @@
if (lchan->loopback)
vty_out(vty, "  RTP/PDCH Loopback Enabled%s", VTY_NEWLINE);
vty_out(vty, "  Radio Link Failure Counter 'S': %d%s", lchan->s, 
VTY_NEWLINE);
+
+   /* BS/MS Power Control state */
+   lchan_bs_power_ctrl_state_dump(vty, "  ", lchan);
+   lchan_ms_power_ctrl_state_dump(vty, "  ", lchan);
 }

 static void lchan_dump_short_vty(struct vty *vty, const struct gsm_lchan 
*lchan)

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Gerrit-Change-Number: 21481
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange