aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/bsc/bssmap_reset.h
blob: ba6425701b806b55b2afbacf476abf44048c46ba (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
/* Manage RESET and disconnection detection on BSSMAP and BSSMAP-LE */
#pragma once

enum bssmap_reset_fsm_event {
	BSSMAP_RESET_EV_RX_RESET_ACK,
	BSSMAP_RESET_EV_CONN_CFM_SUCCESS,
	BSSMAP_RESET_EV_CONN_CFM_FAILURE,
};

struct bssmap_reset_cfg {
	int conn_cfm_failure_threshold;
	struct {
		void (*tx_reset)(void *data);
		void (*link_up)(void *data);
		void (*link_lost)(void *data);
	} ops;
	void *data;
};

struct bssmap_reset {
	struct osmo_fsm_inst *fi;
	struct bssmap_reset_cfg cfg;
	int conn_cfm_failures;
};

struct bssmap_reset *bssmap_reset_alloc(void *ctx, const char *label, const struct bssmap_reset_cfg *cfg);
bool bssmap_reset_is_conn_ready(const struct bssmap_reset *bssmap_reset);