aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/bsc/bsc_subscr_conn_fsm.h
blob: 91cfccce2f897513491efaae9a27b33deef6f719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#pragma once
#include <osmocom/core/fsm.h>

enum gscon_fsm_event {
	/* local SCCP stack tells us incoming conn from MSC */
	GSCON_EV_A_CONN_IND,
	/* RSL side requests CONNECT to MSC */
	GSCON_EV_A_CONN_REQ,
	/* MSC confirms the SCCP connection */
	GSCON_EV_A_CONN_CFM,
	/* MSC requests assignment */
	GSCON_EV_A_ASSIGNMENT_CMD,
	/* MSC has sent BSSMAP CLEAR CMD */
	GSCON_EV_A_CLEAR_CMD,
	/* MSC SCCP disconnect indication */
	GSCON_EV_A_DISC_IND,
	/* MSC sends Handover Request (in CR) */
	GSCON_EV_A_HO_REQ,

	/* RR ASSIGNMENT COMPLETE received */
	GSCON_EV_RR_ASS_COMPL,
	/* RR ASSIGNMENT FAIL received */
	GSCON_EV_RR_ASS_FAIL,

	/* RSL RLL Release Indication */
	GSCON_EV_RLL_REL_IND,
	/* RSL CONNection FAILure Indication */
	GSCON_EV_RSL_CONN_FAIL,

	/* RSL/lchan tells us clearing is complete */
	GSCON_EV_RSL_CLEAR_COMPL,

	/* Mobile-originated DTAP (from MS) */
	GSCON_EV_MO_DTAP,
	/* Mobile-terminated DTAP (from MSC) */
	GSCON_EV_MT_DTAP,

	/* Transmit custom SCCP message */
	GSCON_EV_TX_SCCP,

	/* MGW is indicating failure (BTS) */
	GSCON_EV_MGW_FAIL_BTS,
	/* MGW is indicating failure (MSC) */
	GSCON_EV_MGW_FAIL_MSC,
	/* CRCX response received (BTS) */
	GSCON_EV_MGW_CRCX_RESP_BTS,
	/* MDCX response received (BTS) */
	GSCON_EV_MGW_MDCX_RESP_BTS,
	/* CRCX response received (MSC) */
	GSCON_EV_MGW_CRCX_RESP_MSC,
	/* MDCX response received (MSC) - triggered by LCLS */
	GSCON_EV_MGW_MDCX_RESP_MSC,

	/* Internal handover request (intra-BSC handover) */
	GSCON_EV_HO_START,
	/* Handover timed out (T3103 in handover_logic.c) */
	GSCON_EV_HO_TIMEOUT,
	/* Handover failed (handover_logic.c) */
	GSCON_EV_HO_FAIL,
	/* Handover completed successfully (handover_logic.c) */
	GSCON_EV_HO_COMPL,

	/* LCLS child FSM has terminated due to hard failure */
	GSCON_EV_LCLS_FAIL,
};

struct gsm_subscriber_connection;
struct gsm_network;
struct mgcp_conn_peer;
struct msgb;

/* Allocate a subscriber connection and its associated FSM */
struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net);

void bsc_subscr_pick_codec(struct mgcp_conn_peer *conn_peer, struct gsm_subscriber_connection *conn);

void gscon_submit_rsl_dtap(struct gsm_subscriber_connection *conn,
			   struct msgb *msg, int link_id, int allow_sacch);
void gscon_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send);