diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2020-06-06 03:05:02 +0700 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-06-06 19:41:15 +0000 |
commit | 4977e135c886729835277780b30889ebec018ab2 (patch) | |
tree | 766bebda3b4386c14833efe6329bc22544ea2375 | |
parent | b8200203d8c650123c7e19cef195ad287f53812f (diff) |
common/scheduler: use boolean for channel activation state
Change-Id: I0cb1d915db8787050cdec1802894f66e885a9bf3
-rw-r--r-- | include/osmo-bts/scheduler.h | 5 | ||||
-rw-r--r-- | src/common/scheduler.c | 5 | ||||
-rw-r--r-- | src/osmo-bts-trx/l1_if.c | 10 | ||||
-rw-r--r-- | src/osmo-bts-virtual/l1_if.c | 8 |
4 files changed, 12 insertions, 16 deletions
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h index 7a9da8fb..74102f32 100644 --- a/include/osmo-bts/scheduler.h +++ b/include/osmo-bts/scheduler.h @@ -72,7 +72,7 @@ enum trx_burst_type { /* 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 @@ int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn, 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 276f3fd0..5b398d1f 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -586,7 +586,7 @@ int trx_sched_init(struct l1sched_trx *l1t, struct gsm_bts_trx *trx) 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 @@ int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn, } /* 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 b28c8947..b67d8faa 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -128,16 +128,14 @@ int bts_model_lchan_deactivate(struct gsm_lchan *lchan) /* 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 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) 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 289ef40e..8e84579f 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -388,9 +388,9 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) 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 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) 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); |