blob: 003e7afc42af1ef5f32fa40b84981d1580d1969e [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,
Pau Espin Pedrol92ba59d2020-06-29 14:34:59 +020046 S_TRX_COUNTER_CHANGE, /* same, but for Transceiver class */
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +020047};
48
49/* signal cb for signal <SS_DEVICE,S_DEVICE_COUNTER_CHANGE> */
50struct device_counters {
51 size_t chan;
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +020052 unsigned int rx_overruns;
53 unsigned int tx_underruns;
54 unsigned int rx_dropped_events;
55 unsigned int rx_dropped_samples;
Pau Espin Pedrol68a78092019-07-29 20:11:25 +020056 unsigned int tx_dropped_events;
57 unsigned int tx_dropped_samples;
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +020058};
Pau Espin Pedrol92ba59d2020-06-29 14:34:59 +020059
60/* signal cb for signal <SS_DEVICE,S_TRX_COUNTER_CHANGE> */
61struct trx_counters {
62 size_t chan;
Pau Espin Pedrol1d0c6fe2020-07-09 18:09:10 +020063 unsigned int tx_stale_bursts;
64 unsigned int tx_unavailable_bursts;
Pau Espin Pedrolc0d6fd22020-07-09 16:51:47 +020065 unsigned int tx_trxd_fn_repeated;
66 unsigned int tx_trxd_fn_outoforder;
67 unsigned int tx_trxd_fn_skipped;
Pau Espin Pedrol1d165a02020-07-27 11:52:42 +020068 unsigned int rx_empty_burst;
69 unsigned int rx_clipping;
70 unsigned int rx_no_burst_detected;
Pau Espin Pedrol92ba59d2020-06-29 14:34:59 +020071};