Pau Espin Pedrol | db936b9 | 2018-09-03 16:50:49 +0200 | [diff] [blame] | 1 | /* 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 Pedrol | 21d03d3 | 2019-07-22 12:05:52 +0200 | [diff] [blame^] | 8 | * SPDX-License-Identifier: AGPL-3.0+ |
| 9 | * |
Pau Espin Pedrol | db936b9 | 2018-09-03 16:50:49 +0200 | [diff] [blame] | 10 | * 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 */ |
| 30 | enum signal_subsystems { |
Pau Espin Pedrol | b426e4a | 2019-06-04 12:39:28 +0200 | [diff] [blame] | 31 | SS_MAIN, |
Pau Espin Pedrol | 4456b6f | 2019-05-24 16:54:19 +0200 | [diff] [blame] | 32 | SS_DEVICE, |
Pau Espin Pedrol | db936b9 | 2018-09-03 16:50:49 +0200 | [diff] [blame] | 33 | }; |
| 34 | |
Pau Espin Pedrol | b426e4a | 2019-06-04 12:39:28 +0200 | [diff] [blame] | 35 | /* SS_MAIN signals */ |
| 36 | enum SS_MAIN { |
| 37 | S_MAIN_STOP_REQUIRED, /* TRX fatal error, it should be stopped */ |
Pau Espin Pedrol | db936b9 | 2018-09-03 16:50:49 +0200 | [diff] [blame] | 38 | }; |
Pau Espin Pedrol | 4456b6f | 2019-05-24 16:54:19 +0200 | [diff] [blame] | 39 | |
| 40 | /* SS_DEVICE signals */ |
| 41 | enum 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> */ |
| 49 | struct device_counters { |
| 50 | size_t chan; |
| 51 | unsigned int rx_underruns; |
| 52 | unsigned int rx_overruns; |
| 53 | unsigned int tx_underruns; |
| 54 | unsigned int rx_dropped_events; |
| 55 | unsigned int rx_dropped_samples; |
| 56 | }; |