diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-05-29 23:08:22 +0000 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-10 16:15:35 +0200 |
commit | 426941e87f5476d1220ddf657a84bcfc9204a185 (patch) | |
tree | 8e7f6dcb0a59469724f09abf7c4bfff12eafc127 /include/osmocom | |
parent | d163aa380588bb8628c45d7ce34838595dc6e1f2 (diff) |
update the lchan name to always reflect VAMOS shadowness
Change gsm_lchan_name_compute() to a function that in-place updates the
lchan->name. That allows calling it numerous times with the talloc
handled internally. Rename it to lchan_update_name().
Add 'shadow' to lchan_update_name() and lchan_fsm_update_id() for VAMOS
shadow lchans, and also print the lchan index that it is a shadow for,
instead of the index in the lchan array.
When set_pchan_is() updates the VAMOSness of the lchans, call
lchan_fsm_update_id(). From lchan_fsm_update_id() also call
lchan_update_name().
This is a bit convoluted for legacy reasons. There are utility programs
and C tests using bts_trx.c but not lchan_fsm.c. lchan_update_name()
lives in gsm_data.c for that reason. This patch calls
lchan_update_name() from lchan_fsm_update_id() and not vice versa to
avoid having to add stubbed lchan_fsm_update_id() functions to all
utility programs and C tests.
We can't easily unify the lchan->name and lchan->fi->id without lots of
refactoring rippling through all those little utility programs and C
tests.
Change-Id: I7c2bae3b895a91f1b99b4147ecc0e3009cb7439a
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/bsc/gsm_data.h | 2 | ||||
-rw-r--r-- | include/osmocom/bsc/lchan_fsm.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 88adb9ff5..8ea199b3f 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1008,7 +1008,7 @@ const char *gsm_lchant_name(enum gsm_chan_t c); const char *gsm_chreq_name(enum gsm_chreq_reason_t c); char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); -char *gsm_lchan_name_compute(void *ctx, const struct gsm_lchan *lchan); +void lchan_update_name(struct gsm_lchan *lchan); static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) { diff --git a/include/osmocom/bsc/lchan_fsm.h b/include/osmocom/bsc/lchan_fsm.h index 74e2a9668..e7a06d56a 100644 --- a/include/osmocom/bsc/lchan_fsm.h +++ b/include/osmocom/bsc/lchan_fsm.h @@ -83,3 +83,4 @@ bool lchan_may_receive_data(struct gsm_lchan *lchan); void lchan_forget_conn(struct gsm_lchan *lchan); void lchan_fsm_skip_error(struct gsm_lchan *lchan); +void lchan_fsm_update_id(struct gsm_lchan *lchan); |