blob: ceb7d6ffd81c9e6ca627e31dd772e4e1a8edbc56 [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 *
Pau Espin Pedrol21d03d32019-07-22 12:05:52 +02008 * SPDX-License-Identifier: AGPL-3.0+
9 *
Pau Espin Pedroldb936b92018-09-03 16:50:49 +020010 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
19 *
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 *
23 */
24
25#pragma once
26
27#include <osmocom/core/signal.h>
28
29/* Signalling subsystems */
30enum signal_subsystems {
Pau Espin Pedrolb426e4a2019-06-04 12:39:28 +020031 SS_MAIN,
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +020032 SS_DEVICE,
Pau Espin Pedroldb936b92018-09-03 16:50:49 +020033};
34
Pau Espin Pedrolb426e4a2019-06-04 12:39:28 +020035/* SS_MAIN signals */
36enum SS_MAIN {
37 S_MAIN_STOP_REQUIRED, /* TRX fatal error, it should be stopped */
Pau Espin Pedroldb936b92018-09-03 16:50:49 +020038};
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +020039
40/* SS_DEVICE signals */
41enum SS_DEVICE {
42 /* Device internal counters changed. Counters are provided as cb data
43 (struct device_counters). Must be sent with PTHREAD_CANCEL_DISABLE
44 to avoid deadlocks in case osmo-trx process is asked to exit. */
45 S_DEVICE_COUNTER_CHANGE,
46};
47
48/* signal cb for signal <SS_DEVICE,S_DEVICE_COUNTER_CHANGE> */
49struct device_counters {
50 size_t chan;
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +020051 unsigned int rx_overruns;
52 unsigned int tx_underruns;
53 unsigned int rx_dropped_events;
54 unsigned int rx_dropped_samples;
Pau Espin Pedrol68a78092019-07-29 20:11:25 +020055 unsigned int tx_dropped_events;
56 unsigned int tx_dropped_samples;
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +020057};