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 | * |
| 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 */ |
| 28 | enum signal_subsystems { |
Pau Espin Pedrol | b426e4a | 2019-06-04 12:39:28 +0200 | [diff] [blame^] | 29 | SS_MAIN, |
Pau Espin Pedrol | 4456b6f | 2019-05-24 16:54:19 +0200 | [diff] [blame] | 30 | SS_DEVICE, |
Pau Espin Pedrol | db936b9 | 2018-09-03 16:50:49 +0200 | [diff] [blame] | 31 | }; |
| 32 | |
Pau Espin Pedrol | b426e4a | 2019-06-04 12:39:28 +0200 | [diff] [blame^] | 33 | /* SS_MAIN signals */ |
| 34 | enum SS_MAIN { |
| 35 | S_MAIN_STOP_REQUIRED, /* TRX fatal error, it should be stopped */ |
Pau Espin Pedrol | db936b9 | 2018-09-03 16:50:49 +0200 | [diff] [blame] | 36 | }; |
Pau Espin Pedrol | 4456b6f | 2019-05-24 16:54:19 +0200 | [diff] [blame] | 37 | |
| 38 | /* SS_DEVICE signals */ |
| 39 | enum 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> */ |
| 47 | struct 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 | }; |