aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmo-bts/gsm_data_shared.h2
-rw-r--r--src/common/rsl.c16
-rw-r--r--tests/power/power_test.c4
3 files changed, 11 insertions, 11 deletions
diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h
index 8678ea53..50613103 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -323,7 +323,7 @@ struct gsm_lchan {
/* power handling */
struct {
uint8_t current;
- uint8_t fixed;
+ bool fixed;
} ms_power_ctrl;
struct msgb *pending_rel_ind_msg;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index d8ce016b..9a4afb31 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -999,7 +999,7 @@ static void clear_lchan_for_pdch_activ(struct gsm_lchan *lchan)
* cleared, or we would enable encryption on PDCH with parameters remaining from the TCH. */
lchan->ms_power = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, 0);
lchan->ms_power_ctrl.current = lchan->ms_power;
- lchan->ms_power_ctrl.fixed = 0;
+ lchan->ms_power_ctrl.fixed = false;
lchan->rsl_cmode = 0;
lchan->tch_mode = 0;
memset(&lchan->encr, 0, sizeof(lchan->encr));
@@ -1104,7 +1104,7 @@ static int rsl_rx_chan_activ(struct msgb *msg)
/* Initialize channel defaults */
lchan->ms_power = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, 0);
lchan->ms_power_ctrl.current = lchan->ms_power;
- lchan->ms_power_ctrl.fixed = 0;
+ lchan->ms_power_ctrl.fixed = false;
rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg));
@@ -1156,7 +1156,7 @@ static int rsl_rx_chan_activ(struct msgb *msg)
if (TLVP_PRES_LEN(&tp, RSL_IE_MS_POWER, 1)) {
lchan->ms_power = *TLVP_VAL(&tp, RSL_IE_MS_POWER);
lchan->ms_power_ctrl.current = lchan->ms_power;
- lchan->ms_power_ctrl.fixed = 0;
+ lchan->ms_power_ctrl.fixed = false;
}
/* 9.3.24 Timing Advance */
if (TLVP_PRES_LEN(&tp, RSL_IE_TIMING_ADVANCE, 1))
@@ -1165,12 +1165,12 @@ static int rsl_rx_chan_activ(struct msgb *msg)
/* 9.3.32 BS Power Parameters */
/* 9.3.31 MS Power Parameters */
if (TLVP_PRESENT(&tp, RSL_IE_MS_POWER_PARAM))
- lchan->ms_power_ctrl.fixed = 0;
+ lchan->ms_power_ctrl.fixed = false;
else {
/* Spec explicitly states BTS should only perform
* autonomous MS power control loop in BTS if 'MS Power
* Parameters' IE is present! */
- lchan->ms_power_ctrl.fixed = 1;
+ lchan->ms_power_ctrl.fixed = true;
}
/* 9.3.16 Physical Context */
@@ -1642,16 +1642,16 @@ static int rsl_rx_ms_pwr_ctrl(struct msgb *msg)
/* 9.3.31 MS Power Parameters (O) */
if (TLVP_PRESENT(&tp, RSL_IE_MS_POWER_PARAM))
- lchan->ms_power_ctrl.fixed = 0;
+ lchan->ms_power_ctrl.fixed = false;
else {
/* Spec explicitly states BTS should only perform
* autonomous MS power control loop in BTS if 'MS Power
* Parameters' IE is present! */
- lchan->ms_power_ctrl.fixed = 1;
+ lchan->ms_power_ctrl.fixed = true;
}
/* Only set current to lchan->ms_power if actual value of current
- in dBm > value in dBm from lchan->ms_power, or if fixed=1. */
+ in dBm > value in dBm from lchan->ms_power, or if fixed. */
if (lchan->ms_power_ctrl.fixed) {
lchan->ms_power_ctrl.current = lchan->ms_power;
} else {
diff --git a/tests/power/power_test.c b/tests/power/power_test.c
index 8df6d693..dbae8fa6 100644
--- a/tests/power/power_test.c
+++ b/tests/power/power_test.c
@@ -68,11 +68,11 @@ static void test_power_loop(void)
apply_power_test(lchan, -100, 1, 0);
/* Fix it and jump down */
- lchan->ms_power_ctrl.fixed = 1;
+ lchan->ms_power_ctrl.fixed = true;
apply_power_test(lchan, -60, 0, 0);
/* And leave it again */
- lchan->ms_power_ctrl.fixed = 0;
+ lchan->ms_power_ctrl.fixed = false;
apply_power_test(lchan, -40, 1, 15);
}