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/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/18700 ) Change subject: common/scheduler: use boolean for channel activation state ...................................................................... common/scheduler: use boolean for channel activation state Change-Id: I0cb1d915db8787050cdec1802894f66e885a9bf3 --- M include/osmo-bts/scheduler.h M src/common/scheduler.c M src/osmo-bts-trx/l1_if.c M src/osmo-bts-virtual/l1_if.c 4 files changed, 12 insertions(+), 16 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h index 7a9da8f..74102f3 100644 --- a/include/osmo-bts/scheduler.h +++ b/include/osmo-bts/scheduler.h @@ -72,7 +72,7 @@ /* States each channel on a multiframe */ struct l1sched_chan_state { /* scheduler */ - uint8_t active; /* Channel is active */ + bool active; /* Channel is active */ ubit_t *dl_bursts; /* burst buffer for TX */ enum trx_burst_type dl_burst_type; /* GMSK or 8PSK burst type */ sbit_t *ul_bursts; /* burst buffer for RX */ @@ -175,8 +175,7 @@ enum gsm_phys_chan_config pchan); /*! \brief set all matching logical channels active/inactive */ -int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_id, - int active); +int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_id, bool active); /*! \brief set mode of all matching logical channels to given mode(s) */ int trx_sched_set_mode(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t rsl_cmode, diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 276f3fd..5b398d1 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -586,7 +586,7 @@ for (i = 0; i < ARRAY_SIZE(l1ts->chan_state); i++) { struct l1sched_chan_state *chan_state; chan_state = &l1ts->chan_state[i]; - chan_state->active = 0; + chan_state->active = false; } } @@ -960,8 +960,7 @@ } /* setting all logical channels given attributes to active/inactive */ -int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_id, - int active) +int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_id, bool active) { uint8_t tn = L1SAP_CHAN2TS(chan_nr); struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index b28c894..b67d8fa 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -128,16 +128,14 @@ /* set lchan inactive */ lchan_set_state(lchan, LCHAN_S_NONE); - return trx_sched_set_lchan(&l1h->l1s, gsm_lchan2chan_nr(lchan), - LID_DEDIC, 0); + return trx_sched_set_lchan(&l1h->l1s, gsm_lchan2chan_nr(lchan), LID_DEDIC, false); } int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) { struct phy_instance *pinst = trx_phy_instance(lchan->ts->trx); struct trx_l1h *l1h = pinst->u.osmotrx.hdl; - return trx_sched_set_lchan(&l1h->l1s, gsm_lchan2chan_nr(lchan), - LID_SACCH, 0); + return trx_sched_set_lchan(&l1h->l1s, gsm_lchan2chan_nr(lchan), LID_SACCH, false); } static void l1if_setslot_cb(struct trx_l1h *l1h, uint8_t tn, uint8_t type, int rc) @@ -632,9 +630,9 @@ chan_nr = RSL_CHAN_OSMO_PDCH | (chan_nr & ~RSL_CHAN_NR_MASK); /* activate dedicated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_DEDIC, 1); + trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_DEDIC, true); /* activate associated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_SACCH, 1); + trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_SACCH, true); /* set mode */ trx_sched_set_mode(&l1h->l1s, chan_nr, lchan->rsl_cmode, lchan->tch_mode, diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index 289ef40..8e84579 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -388,9 +388,9 @@ break; } /* activate dedicated channel */ - trx_sched_set_lchan(sched, chan_nr, LID_DEDIC, 1); + trx_sched_set_lchan(sched, chan_nr, LID_DEDIC, true); /* activate associated channel */ - trx_sched_set_lchan(sched, chan_nr, LID_SACCH, 1); + trx_sched_set_lchan(sched, chan_nr, LID_SACCH, true); /* set mode */ trx_sched_set_mode(sched, chan_nr, lchan->rsl_cmode, lchan->tch_mode, @@ -437,12 +437,12 @@ break; } /* deactivate associated channel */ - trx_sched_set_lchan(sched, chan_nr, LID_SACCH, 0); + trx_sched_set_lchan(sched, chan_nr, LID_SACCH, false); if (!l1sap->u.info.u.act_req.sacch_only) { /* set lchan inactive */ lchan_set_state(lchan, LCHAN_S_NONE); /* deactivate dedicated channel */ - trx_sched_set_lchan(sched, chan_nr, LID_DEDIC, 0); + trx_sched_set_lchan(sched, chan_nr, LID_DEDIC, false); /* confirm only on dedicated channel */ mph_info_chan_confirm(trx, chan_nr, PRIM_INFO_DEACTIVATE, 0); -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/18700 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I0cb1d915db8787050cdec1802894f66e885a9bf3 Gerrit-Change-Number: 18700 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200606/f1aa7d5d/attachment.htm>