smsdvb.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /***********************************************************************
  3. *
  4. ***********************************************************************/
  5. struct smsdvb_debugfs;
  6. struct smsdvb_client_t;
  7. typedef void (*sms_prt_dvb_stats_t)(struct smsdvb_debugfs *debug_data,
  8. struct sms_stats *p);
  9. typedef void (*sms_prt_isdb_stats_t)(struct smsdvb_debugfs *debug_data,
  10. struct sms_isdbt_stats *p);
  11. typedef void (*sms_prt_isdb_stats_ex_t)
  12. (struct smsdvb_debugfs *debug_data,
  13. struct sms_isdbt_stats_ex *p);
  14. struct smsdvb_client_t {
  15. struct list_head entry;
  16. struct smscore_device_t *coredev;
  17. struct smscore_client_t *smsclient;
  18. struct dvb_adapter adapter;
  19. struct dvb_demux demux;
  20. struct dmxdev dmxdev;
  21. struct dvb_frontend frontend;
  22. enum fe_status fe_status;
  23. struct completion tune_done;
  24. struct completion stats_done;
  25. int last_per;
  26. int legacy_ber, legacy_per;
  27. int event_fe_state;
  28. int event_unc_state;
  29. unsigned long get_stats_jiffies;
  30. int feed_users;
  31. bool has_tuned;
  32. /* stats debugfs data */
  33. struct dentry *debugfs;
  34. struct smsdvb_debugfs *debug_data;
  35. sms_prt_dvb_stats_t prt_dvb_stats;
  36. sms_prt_isdb_stats_t prt_isdb_stats;
  37. sms_prt_isdb_stats_ex_t prt_isdb_stats_ex;
  38. };
  39. /*
  40. * This struct is a mix of struct sms_rx_stats_ex and
  41. * struct sms_srvm_signal_status.
  42. * It was obtained by comparing the way it was filled by the original code
  43. */
  44. struct RECEPTION_STATISTICS_PER_SLICES_S {
  45. u32 result;
  46. u32 snr;
  47. s32 in_band_power;
  48. u32 ts_packets;
  49. u32 ets_packets;
  50. u32 constellation;
  51. u32 hp_code;
  52. u32 tps_srv_ind_lp;
  53. u32 tps_srv_ind_hp;
  54. u32 cell_id;
  55. u32 reason;
  56. u32 request_id;
  57. u32 modem_state; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
  58. u32 ber; /* Post Viterbi BER [1E-5] */
  59. s32 RSSI; /* dBm */
  60. s32 carrier_offset; /* Carrier Offset in bin/1024 */
  61. u32 is_rf_locked; /* 0 - not locked, 1 - locked */
  62. u32 is_demod_locked; /* 0 - not locked, 1 - locked */
  63. u32 ber_bit_count; /* Total number of SYNC bits. */
  64. u32 ber_error_count; /* Number of erroneous SYNC bits. */
  65. s32 MRC_SNR; /* dB */
  66. s32 mrc_in_band_pwr; /* In band power in dBM */
  67. s32 MRC_RSSI; /* dBm */
  68. };
  69. /* From smsdvb-debugfs.c */
  70. #ifdef CONFIG_SMS_SIANO_DEBUGFS
  71. int smsdvb_debugfs_create(struct smsdvb_client_t *client);
  72. void smsdvb_debugfs_release(struct smsdvb_client_t *client);
  73. void smsdvb_debugfs_register(void);
  74. void smsdvb_debugfs_unregister(void);
  75. #else
  76. static inline int smsdvb_debugfs_create(struct smsdvb_client_t *client)
  77. {
  78. return 0;
  79. }
  80. static inline void smsdvb_debugfs_release(struct smsdvb_client_t *client) {}
  81. static inline void smsdvb_debugfs_register(void) {}
  82. static inline void smsdvb_debugfs_unregister(void) {};
  83. #endif