smsdvb.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. *
  15. ***********************************************************************/
  16. struct smsdvb_debugfs;
  17. struct smsdvb_client_t;
  18. typedef void (*sms_prt_dvb_stats_t)(struct smsdvb_debugfs *debug_data,
  19. struct sms_stats *p);
  20. typedef void (*sms_prt_isdb_stats_t)(struct smsdvb_debugfs *debug_data,
  21. struct sms_isdbt_stats *p);
  22. typedef void (*sms_prt_isdb_stats_ex_t)
  23. (struct smsdvb_debugfs *debug_data,
  24. struct sms_isdbt_stats_ex *p);
  25. struct smsdvb_client_t {
  26. struct list_head entry;
  27. struct smscore_device_t *coredev;
  28. struct smscore_client_t *smsclient;
  29. struct dvb_adapter adapter;
  30. struct dvb_demux demux;
  31. struct dmxdev dmxdev;
  32. struct dvb_frontend frontend;
  33. enum fe_status fe_status;
  34. struct completion tune_done;
  35. struct completion stats_done;
  36. int last_per;
  37. int legacy_ber, legacy_per;
  38. int event_fe_state;
  39. int event_unc_state;
  40. unsigned long get_stats_jiffies;
  41. int feed_users;
  42. bool has_tuned;
  43. /* stats debugfs data */
  44. struct dentry *debugfs;
  45. struct smsdvb_debugfs *debug_data;
  46. sms_prt_dvb_stats_t prt_dvb_stats;
  47. sms_prt_isdb_stats_t prt_isdb_stats;
  48. sms_prt_isdb_stats_ex_t prt_isdb_stats_ex;
  49. };
  50. /*
  51. * This struct is a mix of struct sms_rx_stats_ex and
  52. * struct sms_srvm_signal_status.
  53. * It was obtained by comparing the way it was filled by the original code
  54. */
  55. struct RECEPTION_STATISTICS_PER_SLICES_S {
  56. u32 result;
  57. u32 snr;
  58. s32 in_band_power;
  59. u32 ts_packets;
  60. u32 ets_packets;
  61. u32 constellation;
  62. u32 hp_code;
  63. u32 tps_srv_ind_lp;
  64. u32 tps_srv_ind_hp;
  65. u32 cell_id;
  66. u32 reason;
  67. u32 request_id;
  68. u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
  69. u32 ber; /* Post Viterbi BER [1E-5] */
  70. s32 RSSI; /* dBm */
  71. s32 carrier_offset; /* Carrier Offset in bin/1024 */
  72. u32 is_rf_locked; /* 0 - not locked, 1 - locked */
  73. u32 is_demod_locked; /* 0 - not locked, 1 - locked */
  74. u32 ber_bit_count; /* Total number of SYNC bits. */
  75. u32 ber_error_count; /* Number of erroneous SYNC bits. */
  76. s32 MRC_SNR; /* dB */
  77. s32 mrc_in_band_pwr; /* In band power in dBM */
  78. s32 MRC_RSSI; /* dBm */
  79. };
  80. /* From smsdvb-debugfs.c */
  81. #ifdef CONFIG_SMS_SIANO_DEBUGFS
  82. int smsdvb_debugfs_create(struct smsdvb_client_t *client);
  83. void smsdvb_debugfs_release(struct smsdvb_client_t *client);
  84. void smsdvb_debugfs_register(void);
  85. void smsdvb_debugfs_unregister(void);
  86. #else
  87. static inline int smsdvb_debugfs_create(struct smsdvb_client_t *client)
  88. {
  89. return 0;
  90. }
  91. static inline void smsdvb_debugfs_release(struct smsdvb_client_t *client) {}
  92. static inline void smsdvb_debugfs_register(void) {}
  93. static inline void smsdvb_debugfs_unregister(void) {};
  94. #endif