Harald Welte | c997ceb | 2018-05-30 01:39:43 +0200 | [diff] [blame] | 1 | #pragma once |
Pau Espin Pedrol | 2cfd000 | 2019-03-12 18:53:26 +0100 | [diff] [blame] | 2 | |
| 3 | #include "gsm_data.h" |
| 4 | |
Harald Welte | c997ceb | 2018-05-30 01:39:43 +0200 | [diff] [blame] | 5 | #include <osmocom/core/fsm.h> |
| 6 | |
| 7 | enum lcls_fsm_state { |
| 8 | ST_NO_LCLS, |
| 9 | ST_NOT_YET_LS, |
| 10 | ST_NOT_POSSIBLE_LS, |
| 11 | ST_NO_LONGER_LS, |
| 12 | ST_REQ_LCLS_NOT_SUPP, |
| 13 | ST_LOCALLY_SWITCHED, |
| 14 | /* locally switched; received remote break; wait for "local" break */ |
| 15 | ST_LOCALLY_SWITCHED_WAIT_BREAK, |
| 16 | /* locally switched; received break; wait for "other" break */ |
| 17 | ST_LOCALLY_SWITCHED_WAIT_OTHER_BREAK, |
| 18 | }; |
| 19 | |
| 20 | enum lcls_event { |
| 21 | /* update LCLS config/control based on some BSSMAP signaling */ |
| 22 | LCLS_EV_UPDATE_CFG_CSC, |
| 23 | /* apply LCLS config/control */ |
| 24 | LCLS_EV_APPLY_CFG_CSC, |
| 25 | /* we have been identified as the correlation peer of another conn */ |
| 26 | LCLS_EV_CORRELATED, |
| 27 | /* "other" LCLS connection has enabled local switching */ |
| 28 | LCLS_EV_OTHER_ENABLED, |
| 29 | /* "other" LCLS connection is breaking local switch */ |
| 30 | LCLS_EV_OTHER_BREAK, |
| 31 | /* "other" LCLS connection is dying */ |
| 32 | LCLS_EV_OTHER_DEAD, |
| 33 | }; |
| 34 | |
Pau Espin Pedrol | 2cfd000 | 2019-03-12 18:53:26 +0100 | [diff] [blame] | 35 | enum bsc_lcls_mode { |
| 36 | BSC_LCLS_MODE_DISABLED, |
| 37 | BSC_LCLS_MODE_MGW_LOOP, |
| 38 | BSC_LCLS_MODE_BTS_LOOP, |
| 39 | }; |
| 40 | |
| 41 | extern const struct value_string bsc_lcls_mode_names[]; |
| 42 | |
| 43 | static inline const char *bsc_lcls_mode_name(enum bsc_lcls_mode m) |
| 44 | { |
| 45 | return get_value_string(bsc_lcls_mode_names, m); |
| 46 | } |
| 47 | |
Max | 09273b7 | 2019-01-08 15:08:59 +0100 | [diff] [blame] | 48 | enum gsm0808_lcls_status lcls_get_status(const struct gsm_subscriber_connection *conn); |
Harald Welte | c997ceb | 2018-05-30 01:39:43 +0200 | [diff] [blame] | 49 | |
| 50 | void lcls_update_config(struct gsm_subscriber_connection *conn, |
| 51 | const uint8_t *config, const uint8_t *control); |
| 52 | |
| 53 | void lcls_apply_config(struct gsm_subscriber_connection *conn); |
| 54 | |
| 55 | extern struct osmo_fsm lcls_fsm; |