aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/bsc/lchan_fsm.h
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-05-05 14:12:16 +0000
committerNeels Hofmeyr <neels@hofmeyr.de>2021-05-21 15:43:30 +0200
commitd60b21cc6b3fd43897e97789423a94095dda0f18 (patch)
tree2c33dfda714edd05b1376e44ec4c57e34f36935f /include/osmocom/bsc/lchan_fsm.h
parentf3cce79f146d39840639aa60bddccbc49298c2bc (diff)
log: show src file,line of lchan_set_last_error
Change lchan_set_last_error() to macro so that the error log reflects where the error was encountered. Change-Id: I571fdf2d418c52d120215cf19e57a3c96d67af07
Diffstat (limited to 'include/osmocom/bsc/lchan_fsm.h')
-rw-r--r--include/osmocom/bsc/lchan_fsm.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/osmocom/bsc/lchan_fsm.h b/include/osmocom/bsc/lchan_fsm.h
index ded7f5481..2d5307a23 100644
--- a/include/osmocom/bsc/lchan_fsm.h
+++ b/include/osmocom/bsc/lchan_fsm.h
@@ -12,6 +12,13 @@
LOGP(DRSL, level, "%s (not initialized) " fmt, gsm_lchan_name(lchan), ## args); \
} while(0)
+#define LCHAN_SET_LAST_ERROR(LCHAN, fmt, args...) do { \
+ if ((LCHAN)->last_error) \
+ talloc_free((LCHAN)->last_error); \
+ (LCHAN)->last_error = talloc_asprintf((LCHAN)->ts->trx, fmt, ##args); \
+ LOG_LCHAN(LCHAN, LOGL_ERROR, "%s\n", (LCHAN)->last_error); \
+ } while(0)
+
enum lchan_fsm_state {
LCHAN_ST_UNUSED,
LCHAN_ST_CBCH, /*< Blocked by CBCH channel combination, not usable as SDCCH. */
@@ -74,6 +81,4 @@ bool lchan_may_receive_data(struct gsm_lchan *lchan);
void lchan_forget_conn(struct gsm_lchan *lchan);
-void lchan_set_last_error(struct gsm_lchan *lchan, const char *fmt, ...);
-
void lchan_fsm_skip_error(struct gsm_lchan *lchan);