blob: 6ee1bf955f9441d1770f7d1dbe9de29dfe8ce65d [file] [log] [blame]
Pau Espin Pedroldb936b92018-09-03 16:50:49 +02001/* Generic signalling/notification infrastructure */
2/* (C) 2018 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
3 *
4 * Author: Pau Espin Pedrol <pespin@sysmocom.de>
5 *
6 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#pragma once
24
25#include <osmocom/core/signal.h>
26
27/* Signalling subsystems */
28enum signal_subsystems {
Pau Espin Pedrolb426e4a2019-06-04 12:39:28 +020029 SS_MAIN,
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +020030 SS_DEVICE,
Pau Espin Pedroldb936b92018-09-03 16:50:49 +020031};
32
Pau Espin Pedrolb426e4a2019-06-04 12:39:28 +020033/* SS_MAIN signals */
34enum SS_MAIN {
35 S_MAIN_STOP_REQUIRED, /* TRX fatal error, it should be stopped */
Pau Espin Pedroldb936b92018-09-03 16:50:49 +020036};
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +020037
38/* SS_DEVICE signals */
39enum SS_DEVICE {
40 /* Device internal counters changed. Counters are provided as cb data
41 (struct device_counters). Must be sent with PTHREAD_CANCEL_DISABLE
42 to avoid deadlocks in case osmo-trx process is asked to exit. */
43 S_DEVICE_COUNTER_CHANGE,
44};
45
46/* signal cb for signal <SS_DEVICE,S_DEVICE_COUNTER_CHANGE> */
47struct device_counters {
48 size_t chan;
49 unsigned int rx_underruns;
50 unsigned int rx_overruns;
51 unsigned int tx_underruns;
52 unsigned int rx_dropped_events;
53 unsigned int rx_dropped_samples;
54};