smsdvb.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 SMSHOSTLIB_STATISTICS_ST *p);
  20. typedef void (*sms_prt_isdb_stats_t)(struct smsdvb_debugfs *debug_data,
  21. struct SMSHOSTLIB_STATISTICS_ISDBT_ST *p);
  22. typedef void (*sms_prt_isdb_stats_ex_t)
  23. (struct smsdvb_debugfs *debug_data,
  24. struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST *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. fe_status_t 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. /* Stats debugfs data */
  42. struct dentry *debugfs;
  43. struct smsdvb_debugfs *debug_data;
  44. sms_prt_dvb_stats_t prt_dvb_stats;
  45. sms_prt_isdb_stats_t prt_isdb_stats;
  46. sms_prt_isdb_stats_ex_t prt_isdb_stats_ex;
  47. };
  48. /*
  49. * This struct is a mix of RECEPTION_STATISTICS_EX_S and SRVM_SIGNAL_STATUS_S.
  50. * It was obtained by comparing the way it was filled by the original code
  51. */
  52. struct RECEPTION_STATISTICS_PER_SLICES_S {
  53. u32 result;
  54. u32 snr;
  55. s32 inBandPower;
  56. u32 tsPackets;
  57. u32 etsPackets;
  58. u32 constellation;
  59. u32 hpCode;
  60. u32 tpsSrvIndLP;
  61. u32 tpsSrvIndHP;
  62. u32 cellId;
  63. u32 reason;
  64. u32 requestId;
  65. u32 ModemState; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
  66. u32 BER; /* Post Viterbi BER [1E-5] */
  67. s32 RSSI; /* dBm */
  68. s32 CarrierOffset; /* Carrier Offset in bin/1024 */
  69. u32 IsRfLocked; /* 0 - not locked, 1 - locked */
  70. u32 IsDemodLocked; /* 0 - not locked, 1 - locked */
  71. u32 BERBitCount; /* Total number of SYNC bits. */
  72. u32 BERErrorCount; /* Number of erronous SYNC bits. */
  73. s32 MRC_SNR; /* dB */
  74. s32 MRC_InBandPwr; /* In band power in dBM */
  75. s32 MRC_RSSI; /* dBm */
  76. };
  77. /* From smsdvb-debugfs.c */
  78. #ifdef CONFIG_SMS_SIANO_DEBUGFS
  79. int smsdvb_debugfs_create(struct smsdvb_client_t *client);
  80. void smsdvb_debugfs_release(struct smsdvb_client_t *client);
  81. int smsdvb_debugfs_register(void);
  82. void smsdvb_debugfs_unregister(void);
  83. #else
  84. static inline int smsdvb_debugfs_create(struct smsdvb_client_t *client)
  85. {
  86. return 0;
  87. }
  88. static inline void smsdvb_debugfs_release(struct smsdvb_client_t *client) {}
  89. static inline int smsdvb_debugfs_register(void)
  90. {
  91. return 0;
  92. };
  93. static inline void smsdvb_debugfs_unregister(void) {};
  94. #endif