diff options
author | Harald Welte <laforge@gnumonks.org> | 2014-01-19 17:18:21 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2014-01-19 17:32:59 +0100 |
commit | 1fe241294960e91057d215ff8260f1047e8a7cd0 (patch) | |
tree | 906625aedc0476a93f992f062cb13b2cc64552e6 /openbsc/include | |
parent | 903aaea6689cc08c0e33fb05659c808a5e5f754f (diff) |
TSC: Add new gsm_ts_tsc() function to resolve TSC of TS
We don't want every caller to check for ts->tsc == -1 and then
using ts->trx->bts->tsc instead. Rather, introduce a new inline
function to retrieve the correct value.
Diffstat (limited to 'openbsc/include')
-rw-r--r-- | openbsc/include/openbsc/gsm_data_shared.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 6eafed8c1..2b405a007 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -769,6 +769,13 @@ uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan); int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) __attribute__ ((warn_unused_result)); +static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts) +{ + if (ts->tsc != -1) + return ts->tsc; + else + return ts->trx->bts->tsc; +} #endif |