This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/19365 )
Change subject: bts-trx: Use bool type for on/off state variables
......................................................................
bts-trx: Use bool type for on/off state variables
Change-Id: Icb1b7bd8852417ab7b9a7dbc205aa6f6db97d64d
---
M src/osmo-bts-trx/l1_if.h
M src/osmo-bts-trx/trx_provision_fsm.c
M src/osmo-bts-trx/trx_vty.c
3 files changed, 36 insertions(+), 36 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/65/19365/1
diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h
index 07751f2..f35936e 100644
--- a/src/osmo-bts-trx/l1_if.h
+++ b/src/osmo-bts-trx/l1_if.h
@@ -60,44 +60,44 @@
struct trx_config {
uint8_t trxd_hdr_ver_req; /* requested TRXD header version */
uint8_t trxd_hdr_ver_use; /* actual TRXD header version in use */
- int setformat_sent;
+ bool setformat_sent;
bool enabled;
- int arfcn_valid;
+ bool arfcn_valid;
uint16_t arfcn;
- int arfcn_sent;
+ bool arfcn_sent;
- int tsc_valid;
+ bool tsc_valid;
uint8_t tsc;
- int tsc_sent;
+ bool tsc_sent;
- int bsic_valid;
+ bool bsic_valid;
uint8_t bsic;
- int bsic_sent;
+ bool bsic_sent;
- int rxgain_valid;
+ bool rxgain_valid;
uint8_t rxgain;
- int rxgain_sent;
+ bool rxgain_sent;
int forced_max_power_red; /* -1 if not forced by VTY config (default) */
bool nominal_power_set_by_vty; /* whether nominal trx power was enforced/retreived from VTY config "nominal-tx-power" */
- int maxdly_valid;
+ bool maxdly_valid;
int maxdly;
- int maxdly_sent;
+ bool maxdly_sent;
- int maxdlynb_valid;
+ bool maxdlynb_valid;
int maxdlynb;
- int maxdlynb_sent;
+ bool maxdlynb_sent;
uint8_t slotmask;
- int slottype_valid[TRX_NR_TS];
+ bool slottype_valid[TRX_NR_TS];
uint8_t slottype[TRX_NR_TS];
- int slottype_sent[TRX_NR_TS];
+ bool slottype_sent[TRX_NR_TS];
};
struct trx_l1h {
diff --git a/src/osmo-bts-trx/trx_provision_fsm.c b/src/osmo-bts-trx/trx_provision_fsm.c
index c3b266d..00e6ef4 100644
--- a/src/osmo-bts-trx/trx_provision_fsm.c
+++ b/src/osmo-bts-trx/trx_provision_fsm.c
@@ -102,15 +102,15 @@
* provide broken values) */
if (!l1h->config.nominal_power_set_by_vty)
trx_if_cmd_getnompower(l1h, l1if_getnompower_cb);
- l1h->config.arfcn_sent = 1;
+ l1h->config.arfcn_sent = true;
}
if (!l1h->config.tsc_sent) {
trx_if_cmd_settsc(l1h, l1h->config.tsc);
- l1h->config.tsc_sent = 1;
+ l1h->config.tsc_sent = true;
}
if (!l1h->config.bsic_sent) {
trx_if_cmd_setbsic(l1h, l1h->config.bsic);
- l1h->config.bsic_sent = 1;
+ l1h->config.bsic_sent = true;
}
/* Ask transceiver to use the newest TRXD header version if not using it yet */
@@ -124,7 +124,7 @@
"already using maximum configured one: %" PRIu8 "\n",
l1h->config.trxd_hdr_ver_use);
}
- l1h->config.setformat_sent = 1;
+ l1h->config.setformat_sent = true;
}
if (pinst->num == 0 && !plink->u.osmotrx.powered && !plink->u.osmotrx.poweronoff_sent) {
@@ -175,8 +175,8 @@
if (l1h->config.slottype[ts_data->tn] != ts_data->slottype ||
!l1h->config.slottype_valid[ts_data->tn]) {
l1h->config.slottype[ts_data->tn] = ts_data->slottype;
- l1h->config.slottype_valid[ts_data->tn] = 1;
- l1h->config.slottype_sent[ts_data->tn] = 0;
+ l1h->config.slottype_valid[ts_data->tn] = true;
+ l1h->config.slottype_sent[ts_data->tn] = false;
return true;
}
return false;
@@ -218,7 +218,7 @@
if (l1h->config.bsic != bsic || !l1h->config.bsic_valid) {
l1h->config.bsic = bsic;
l1h->config.bsic_valid = 1;
- l1h->config.bsic_sent = 0;
+ l1h->config.bsic_sent = false;
}
break;
case TRX_PROV_EV_CFG_ARFCN:
@@ -226,7 +226,7 @@
if (l1h->config.arfcn != arfcn || !l1h->config.arfcn_valid) {
l1h->config.arfcn = arfcn;
l1h->config.arfcn_valid = 1;
- l1h->config.arfcn_sent = 0;
+ l1h->config.arfcn_sent = false;
}
break;
case TRX_PROV_EV_CFG_TSC:
@@ -234,7 +234,7 @@
if (l1h->config.tsc != tsc || !l1h->config.tsc_valid) {
l1h->config.tsc = tsc;
l1h->config.tsc_valid = 1;
- l1h->config.tsc_sent = 0;
+ l1h->config.tsc_sent = false;
}
break;
case TRX_PROV_EV_CFG_TS:
@@ -291,15 +291,15 @@
/* after power on */
if (l1h->config.rxgain_valid && !l1h->config.rxgain_sent) {
trx_if_cmd_setrxgain(l1h, l1h->config.rxgain);
- l1h->config.rxgain_sent = 1;
+ l1h->config.rxgain_sent = true;
}
if (l1h->config.maxdly_valid && !l1h->config.maxdly_sent) {
trx_if_cmd_setmaxdly(l1h, l1h->config.maxdly);
- l1h->config.maxdly_sent = 1;
+ l1h->config.maxdly_sent = true;
}
if (l1h->config.maxdlynb_valid && !l1h->config.maxdlynb_sent) {
trx_if_cmd_setmaxdlynb(l1h, l1h->config.maxdlynb);
- l1h->config.maxdlynb_sent = 1;
+ l1h->config.maxdlynb_sent = true;
}
for (tn = 0; tn < TRX_NR_TS; tn++) {
@@ -307,7 +307,7 @@
&& !l1h->config.slottype_sent[tn]) {
trx_if_cmd_setslot(l1h, tn,
l1h->config.slottype[tn], l1if_setslot_cb);
- l1h->config.slottype_sent[tn] = 1;
+ l1h->config.slottype_sent[tn] = true;
}
}
}
@@ -328,11 +328,11 @@
trx_if_cmd_poweroff(l1h, l1if_poweronoff_cb);
plink->u.osmotrx.poweronoff_sent = true;
}
- l1h->config.rxgain_sent = 0;
- l1h->config.maxdly_sent = 0;
- l1h->config.maxdlynb_sent = 0;
+ l1h->config.rxgain_sent = false;
+ l1h->config.maxdly_sent = false;
+ l1h->config.maxdlynb_sent = false;
for (tn = 0; tn < TRX_NR_TS; tn++)
- l1h->config.slottype_sent[tn] = 0;
+ l1h->config.slottype_sent[tn] = false;
} else if (!pinst->phy_link->u.osmotrx.poweronoff_sent) {
bts_model_trx_close_cb(pinst->trx, 0);
} /* else: poweroff in progress, cb will be called upon TRXC RSP */
@@ -347,7 +347,7 @@
if (update_ts_data(l1h, ts_data)) {
trx_if_cmd_setslot(l1h, ts_data->tn,
l1h->config.slottype[ ts_data->tn], l1if_setslot_cb);
- l1h->config.slottype_sent[ ts_data->tn] = 1;
+ l1h->config.slottype_sent[ts_data->tn] = true;
}
break;
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index fb75a4e..6b8ca77 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -245,7 +245,7 @@
l1h->config.maxdly = atoi(argv[0]);
l1h->config.maxdly_valid = 1;
- l1h->config.maxdly_sent = 0;
+ l1h->config.maxdly_sent = false;
l1if_provision_transceiver_trx(l1h);
return CMD_SUCCESS;
@@ -271,7 +271,7 @@
l1h->config.maxdlynb = atoi(argv[0]);
l1h->config.maxdlynb_valid = 1;
- l1h->config.maxdlynb_sent = 0;
+ l1h->config.maxdlynb_sent = false;
l1if_provision_transceiver_trx(l1h);
return CMD_SUCCESS;
@@ -358,7 +358,7 @@
l1h->config.rxgain = atoi(argv[0]);
l1h->config.rxgain_valid = 1;
- l1h->config.rxgain_sent = 0;
+ l1h->config.rxgain_sent = false;
l1if_provision_transceiver_trx(l1h);
return CMD_SUCCESS;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/19365
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Icb1b7bd8852417ab7b9a7dbc205aa6f6db97d64d
Gerrit-Change-Number: 19365
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200722/0117e414/attachment.htm>