diff options
Diffstat (limited to 'include/osmocom/bsc')
-rw-r--r-- | include/osmocom/bsc/Makefile.am | 1 | ||||
-rw-r--r-- | include/osmocom/bsc/gsm_data.h | 22 | ||||
-rw-r--r-- | include/osmocom/bsc/gsm_data_shared.h | 6 | ||||
-rw-r--r-- | include/osmocom/bsc/handover.h | 2 | ||||
-rw-r--r-- | include/osmocom/bsc/handover_cfg.h | 10 | ||||
-rw-r--r-- | include/osmocom/bsc/handover_decision_2.h | 8 | ||||
-rw-r--r-- | include/osmocom/bsc/signal.h | 1 |
7 files changed, 46 insertions, 4 deletions
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 699aeb339..a3d9adfd8 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -27,6 +27,7 @@ noinst_HEADERS = \ handover.h \ handover_cfg.h \ handover_decision.h \ + handover_decision_2.h \ handover_vty.h \ ipaccess.h \ meas_feed.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index cd4997c8a..28314835c 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -10,6 +10,7 @@ #include <osmocom/core/rate_ctr.h> #include <osmocom/core/select.h> #include <osmocom/core/stats.h> +#include <osmocom/gsm/protocol/gsm_08_08.h> #include <osmocom/crypt/auth.h> #include <osmocom/sigtran/sccp_sap.h> @@ -72,8 +73,8 @@ struct gsm_classmark { /* penalty timers for handover */ struct ho_penalty_timer { struct llist_head entry; - uint8_t bts; - time_t timeout; + uint8_t bts_nr; + unsigned int timeout; }; /* active radio connection of a mobile subscriber */ @@ -108,10 +109,20 @@ struct gsm_subscriber_connection { /* penalty timers for handover */ struct llist_head ho_penalty_timers; + int ho_failure; /* Cache DTAP messages during handover/assignment (msgb_enqueue()/msgb_dequeue())*/ struct llist_head ho_dtap_cache; unsigned int ho_dtap_cache_len; + + /* "Codec List (MSC Preferred)" as received by the BSSAP Assignment Request. 3GPP 48.008 + * 3.2.2.103 says: + * The "Codec List (MSC Preferred)" shall not include codecs + * that are not supported by the MS. + * i.e. by heeding the "Codec list (MSC Preferred)", we inherently heed the MS bearer + * capabilities, which the MSC is required to translate into the codec list. */ + struct gsm0808_speech_codec_list codec_list; + bool codec_list_present; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { @@ -441,4 +452,11 @@ void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value); bool classmark_is_r99(struct gsm_classmark *cm); +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout); +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); + #endif /* _GSM_DATA_H */ diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 277366dd9..0f325ecba 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -801,7 +801,11 @@ struct gsm_bts { struct rate_ctr_group *bts_ctrs; - struct handover_cfg *ho; + struct { + struct handover_cfg *cfg; + struct osmo_timer_list congestion_check_timer; + /* todo: move them here */ //struct llist_head penalty_timeouts; + } ho; }; diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index a9349eeda..f76445695 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -5,6 +5,8 @@ struct gsm_bts; struct gsm_subscriber_connection; int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *bts, + enum gsm_chan_t new_lchan_type); void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index b5a0d1b7d..ff73fa328 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -20,6 +20,13 @@ struct handover_cfg *ho_cfg_init(void *ctx, enum handover_cfg_ctx_type ctx_type, typedef void (*ho_cfg_on_change_cb_t)(void *ctx, enum handover_cfg_ctx_type ctx_type); +/* ho_cfg_* code gets called during initialization of the global gsm_network struct, which is included in + * various utility programs that don't need most of gsm_data.c, definitely no handover. The on_change + * callback from the ho_cfg touches internals of the handover decision, which would cause utility + * programs to require linking of most of the handover code. To break this linking cascade, have the + * on_change callbacks as function pointers. */ +extern ho_cfg_on_change_cb_t ho_cfg_on_change_congestion_check_interval_cb; + #define HO_CFG_STR_HANDOVER "Handover options\n" #define HO_CFG_STR_WIN HO_CFG_STR_HANDOVER "Measurement averaging settings\n" #define HO_CFG_STR_WIN_RXLEV HO_CFG_STR_WIN "Received-Level averaging\n" @@ -157,7 +164,8 @@ static inline const char *congestion_check_interval2a(int val) "Disable in-call assignment\n" \ "Enable in-call assignment\n") \ \ - HO_CFG_ONE_MEMBER(int, congestion_check_interval, 10, NULL, \ + HO_CFG_ONE_MEMBER(int, congestion_check_interval, 10, \ + ho_cfg_on_change_congestion_check_interval_cb, \ "handover congestion-check", "disabled|<1-60>", \ a2congestion_check_interval, "%s", congestion_check_interval2a, \ HO_CFG_STR_HANDOVER \ diff --git a/include/osmocom/bsc/handover_decision_2.h b/include/osmocom/bsc/handover_decision_2.h new file mode 100644 index 000000000..94e9c8663 --- /dev/null +++ b/include/osmocom/bsc/handover_decision_2.h @@ -0,0 +1,8 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC */ + +#pragma once +struct gsm_bts; + +void handover_decision_2_init(struct gsm_network *net); + +void handover_decision_2_bts_congestion_check(struct gsm_bts *bts); diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h index 9c0d5a3de..1c8b51e3c 100644 --- a/include/osmocom/bsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -104,6 +104,7 @@ enum signal_ipaccess { enum signal_global { S_GLOBAL_BTS_CLOSE_OM, + S_GLOBAL_BTS_NEW, }; /* SS_RF signals */ |