Mauro Carvalho Chehab | 503efe5 | 2013-03-10 09:04:44 -0300 | [diff] [blame] | 1 | /*********************************************************************** |
| 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation, either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | * |
| 16 | ***********************************************************************/ |
| 17 | |
| 18 | struct smsdvb_debugfs; |
| 19 | struct smsdvb_client_t; |
| 20 | |
| 21 | typedef void (*sms_prt_dvb_stats_t)(struct smsdvb_debugfs *debug_data, |
| 22 | struct SMSHOSTLIB_STATISTICS_ST *p); |
| 23 | |
| 24 | typedef void (*sms_prt_isdb_stats_t)(struct smsdvb_debugfs *debug_data, |
| 25 | struct SMSHOSTLIB_STATISTICS_ISDBT_ST *p); |
| 26 | |
| 27 | typedef void (*sms_prt_isdb_stats_ex_t) |
| 28 | (struct smsdvb_debugfs *debug_data, |
| 29 | struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST *p); |
| 30 | |
| 31 | |
| 32 | struct smsdvb_client_t { |
| 33 | struct list_head entry; |
| 34 | |
| 35 | struct smscore_device_t *coredev; |
| 36 | struct smscore_client_t *smsclient; |
| 37 | |
| 38 | struct dvb_adapter adapter; |
| 39 | struct dvb_demux demux; |
| 40 | struct dmxdev dmxdev; |
| 41 | struct dvb_frontend frontend; |
| 42 | |
| 43 | fe_status_t fe_status; |
| 44 | |
| 45 | struct completion tune_done; |
| 46 | struct completion stats_done; |
| 47 | |
| 48 | int last_per; |
| 49 | |
| 50 | int legacy_ber, legacy_per; |
| 51 | |
| 52 | int event_fe_state; |
| 53 | int event_unc_state; |
| 54 | |
Mauro Carvalho Chehab | a9b9fbd | 2013-03-10 10:51:25 -0300 | [diff] [blame^] | 55 | unsigned long get_stats_jiffies; |
| 56 | |
Mauro Carvalho Chehab | 503efe5 | 2013-03-10 09:04:44 -0300 | [diff] [blame] | 57 | /* Stats debugfs data */ |
| 58 | struct dentry *debugfs; |
| 59 | |
| 60 | struct smsdvb_debugfs *debug_data; |
| 61 | |
| 62 | sms_prt_dvb_stats_t prt_dvb_stats; |
| 63 | sms_prt_isdb_stats_t prt_isdb_stats; |
| 64 | sms_prt_isdb_stats_ex_t prt_isdb_stats_ex; |
| 65 | }; |
| 66 | |
| 67 | /* |
| 68 | * This struct is a mix of RECEPTION_STATISTICS_EX_S and SRVM_SIGNAL_STATUS_S. |
| 69 | * It was obtained by comparing the way it was filled by the original code |
| 70 | */ |
| 71 | struct RECEPTION_STATISTICS_PER_SLICES_S { |
| 72 | u32 result; |
| 73 | u32 snr; |
| 74 | s32 inBandPower; |
| 75 | u32 tsPackets; |
| 76 | u32 etsPackets; |
| 77 | u32 constellation; |
| 78 | u32 hpCode; |
| 79 | u32 tpsSrvIndLP; |
| 80 | u32 tpsSrvIndHP; |
| 81 | u32 cellId; |
| 82 | u32 reason; |
| 83 | u32 requestId; |
| 84 | u32 ModemState; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */ |
| 85 | |
| 86 | u32 BER; /* Post Viterbi BER [1E-5] */ |
| 87 | s32 RSSI; /* dBm */ |
| 88 | s32 CarrierOffset; /* Carrier Offset in bin/1024 */ |
| 89 | |
| 90 | u32 IsRfLocked; /* 0 - not locked, 1 - locked */ |
| 91 | u32 IsDemodLocked; /* 0 - not locked, 1 - locked */ |
| 92 | |
| 93 | u32 BERBitCount; /* Total number of SYNC bits. */ |
| 94 | u32 BERErrorCount; /* Number of erronous SYNC bits. */ |
| 95 | |
| 96 | s32 MRC_SNR; /* dB */ |
| 97 | s32 MRC_InBandPwr; /* In band power in dBM */ |
| 98 | s32 MRC_RSSI; /* dBm */ |
| 99 | }; |
| 100 | |
| 101 | /* From smsdvb-debugfs.c */ |
| 102 | #ifdef CONFIG_SMS_SIANO_DEBUGFS |
| 103 | |
| 104 | int smsdvb_debugfs_create(struct smsdvb_client_t *client); |
| 105 | void smsdvb_debugfs_release(struct smsdvb_client_t *client); |
| 106 | int smsdvb_debugfs_register(void); |
| 107 | void smsdvb_debugfs_unregister(void); |
| 108 | |
| 109 | #else |
| 110 | |
| 111 | static inline int smsdvb_debugfs_create(struct smsdvb_client_t *client) |
| 112 | { |
| 113 | return 0; |
| 114 | } |
| 115 | |
| 116 | static inline void smsdvb_debugfs_release(struct smsdvb_client_t *client) {} |
| 117 | |
| 118 | static inline int smsdvb_debugfs_register(void) |
| 119 | { |
| 120 | return 0; |
| 121 | }; |
| 122 | |
| 123 | static inline void smsdvb_debugfs_unregister(void) {}; |
| 124 | |
| 125 | #endif |
| 126 | |