WIP FPC-III support
[linux/fpc-iii.git] / drivers / media / common / siano / smsdvb.h
blobb43cbb5c0dee138762356e5d8240d6890a3d9708
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /***********************************************************************
4 ***********************************************************************/
6 struct smsdvb_debugfs;
7 struct smsdvb_client_t;
9 typedef void (*sms_prt_dvb_stats_t)(struct smsdvb_debugfs *debug_data,
10 struct sms_stats *p);
12 typedef void (*sms_prt_isdb_stats_t)(struct smsdvb_debugfs *debug_data,
13 struct sms_isdbt_stats *p);
15 typedef void (*sms_prt_isdb_stats_ex_t)
16 (struct smsdvb_debugfs *debug_data,
17 struct sms_isdbt_stats_ex *p);
20 struct smsdvb_client_t {
21 struct list_head entry;
23 struct smscore_device_t *coredev;
24 struct smscore_client_t *smsclient;
26 struct dvb_adapter adapter;
27 struct dvb_demux demux;
28 struct dmxdev dmxdev;
29 struct dvb_frontend frontend;
31 enum fe_status fe_status;
33 struct completion tune_done;
34 struct completion stats_done;
36 int last_per;
38 int legacy_ber, legacy_per;
40 int event_fe_state;
41 int event_unc_state;
43 unsigned long get_stats_jiffies;
45 int feed_users;
46 bool has_tuned;
48 /* stats debugfs data */
49 struct dentry *debugfs;
51 struct smsdvb_debugfs *debug_data;
53 sms_prt_dvb_stats_t prt_dvb_stats;
54 sms_prt_isdb_stats_t prt_isdb_stats;
55 sms_prt_isdb_stats_ex_t prt_isdb_stats_ex;
59 * This struct is a mix of struct sms_rx_stats_ex and
60 * struct sms_srvm_signal_status.
61 * It was obtained by comparing the way it was filled by the original code
63 struct RECEPTION_STATISTICS_PER_SLICES_S {
64 u32 result;
65 u32 snr;
66 s32 in_band_power;
67 u32 ts_packets;
68 u32 ets_packets;
69 u32 constellation;
70 u32 hp_code;
71 u32 tps_srv_ind_lp;
72 u32 tps_srv_ind_hp;
73 u32 cell_id;
74 u32 reason;
75 u32 request_id;
76 u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
78 u32 ber; /* Post Viterbi BER [1E-5] */
79 s32 RSSI; /* dBm */
80 s32 carrier_offset; /* Carrier Offset in bin/1024 */
82 u32 is_rf_locked; /* 0 - not locked, 1 - locked */
83 u32 is_demod_locked; /* 0 - not locked, 1 - locked */
85 u32 ber_bit_count; /* Total number of SYNC bits. */
86 u32 ber_error_count; /* Number of erroneous SYNC bits. */
88 s32 MRC_SNR; /* dB */
89 s32 mrc_in_band_pwr; /* In band power in dBM */
90 s32 MRC_RSSI; /* dBm */
93 /* From smsdvb-debugfs.c */
94 #ifdef CONFIG_SMS_SIANO_DEBUGFS
96 int smsdvb_debugfs_create(struct smsdvb_client_t *client);
97 void smsdvb_debugfs_release(struct smsdvb_client_t *client);
98 void smsdvb_debugfs_register(void);
99 void smsdvb_debugfs_unregister(void);
101 #else
103 static inline int smsdvb_debugfs_create(struct smsdvb_client_t *client)
105 return 0;
108 static inline void smsdvb_debugfs_release(struct smsdvb_client_t *client) {}
110 static inline void smsdvb_debugfs_register(void) {}
112 static inline void smsdvb_debugfs_unregister(void) {};
114 #endif