path: root/include/osmocom/bsc/abis_rsl.h
diff options
authorMax <msuraev@sysmocom.de>2017-09-06 18:20:36 +0200
committerMax <msuraev@sysmocom.de>2017-09-23 10:13:55 +0000
commitdc10ce90b29d42557f3d8c9499a320ffcc3a91c8 (patch)
tree2fda03fe73794a4862a825f1ccf8c3c875dbcabf /include/osmocom/bsc/abis_rsl.h
parent53daffbd994a47259868dee8f808123a31be9082 (diff)
Wrap channel state assignment in macro
Previously we've used function so debug print always pointed to the same place which is not very useful. Wrap it with macro so proper file:line is printed. Also, make sure that we always change state only through this wrapper and log only when the state has changed. Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321
Diffstat (limited to 'include/osmocom/bsc/abis_rsl.h')
1 files changed, 4 insertions, 1 deletions
diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h
index f983fceec..c09272304 100644
--- a/include/osmocom/bsc/abis_rsl.h
+++ b/include/osmocom/bsc/abis_rsl.h
@@ -34,6 +34,9 @@ struct gsm_bts_trx_ts;
#define GSM48_LEN2PLEN(a) (((a) << 2) | 1)
+#define rsl_lchan_set_state(lch_, st_) \
+ rsl_lchan_set_state_with_log(lch_, st_, __BASE_FILE__, __LINE__)
int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len);
int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type,
const uint8_t *data, int len);
@@ -74,7 +77,7 @@ uint64_t str_to_imsi(const char *imsi_str);
int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id,
enum rsl_rel_mode release_mode);
-int rsl_lchan_set_state(struct gsm_lchan *lchan, int);
+int rsl_lchan_set_state_with_log(struct gsm_lchan *lchan, enum gsm_lchan_state state, const char *file, unsigned line);
int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken);
/* to be provided by external code */