diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-09-16 14:37:19 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-09-16 19:30:38 +0200 |
commit | c9079d91069eaadf181a6e26e3c7205f1f05cbda (patch) | |
tree | cf5ea4b7493b55fbcadefe6b198d940ded6f218f /src | |
parent | 666adf6a9781fced8543241dad14a65d01510858 (diff) |
Improve error handling and logging in gsm_pchan2chan_nr()
It was spotted that sometimes chan_nr BCCH was printed for a TS
containing configured as GSM_PCHAN_TCH_F_TCH_H_PDCH, which was totally
confusing. Indeed the problem is somewhere else, but let's log an error
and return 0 in this case, which will be converted to "UNKNOWN" string
later on.
Change-Id: Ic455af39c668481a13d579f33ac09033fd5c4009
Diffstat (limited to 'src')
-rw-r--r-- | src/common/gsm_data.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/gsm_data.c b/src/common/gsm_data.c index 383a31d2..978edc45 100644 --- a/src/common/gsm_data.c +++ b/src/common/gsm_data.c @@ -38,6 +38,7 @@ #include <osmo-bts/gsm_data.h> #include <osmo-bts/bts.h> #include <osmo-bts/bts_trx.h> +#include <osmo-bts/logging.h> const struct value_string gsm_pchant_names[13] = { { GSM_PCHAN_NONE, "NONE" }, @@ -219,7 +220,16 @@ static uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, cbits += lchan_nr; break; case GSM_PCHAN_CCCH: + cbits = 0x10; + break; + case GSM_PCHAN_NONE: + LOGP(DRSL, LOGL_ERROR, "Physical channel %s not expected!\n", + gsm_pchan_name(pchan)); + cbits = 0x00; + break; default: + LOGP(DRSL, LOGL_ERROR, "Physical channel %s (0x%02x) not expected!\n", + gsm_pchan_name(pchan), (int)pchan); /* OSMO_ASSERT(lchan_nr == 0); * FIXME: On octphy and litecell, we hit above assertion (see * Max's comment at https://gerrit.osmocom.org/589 ); disabled |