dvb_frontend.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * dvb_frontend.h
  3. *
  4. * Copyright (C) 2001 convergence integrated media GmbH
  5. * Copyright (C) 2004 convergence GmbH
  6. *
  7. * Written by Ralph Metzler
  8. * Overhauled by Holger Waechtler
  9. * Kernel I2C stuff by Michael Hunold <hunold@convergence.de>
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU Lesser General Public License
  13. * as published by the Free Software Foundation; either version 2.1
  14. * of the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Lesser General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  24. *
  25. */
  26. #ifndef _DVB_FRONTEND_H_
  27. #define _DVB_FRONTEND_H_
  28. #include <linux/types.h>
  29. #include <linux/sched.h>
  30. #include <linux/ioctl.h>
  31. #include <linux/i2c.h>
  32. #include <linux/module.h>
  33. #include <linux/errno.h>
  34. #include <linux/delay.h>
  35. #include <linux/dvb/frontend.h>
  36. #include "dvbdev.h"
  37. struct dvb_frontend_tune_settings {
  38. int min_delay_ms;
  39. int step_size;
  40. int max_drift;
  41. struct dvb_frontend_parameters parameters;
  42. };
  43. struct dvb_frontend;
  44. struct dvb_frontend_ops {
  45. struct dvb_frontend_info info;
  46. void (*release)(struct dvb_frontend* fe);
  47. int (*init)(struct dvb_frontend* fe);
  48. int (*sleep)(struct dvb_frontend* fe);
  49. int (*set_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
  50. int (*get_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
  51. int (*get_tune_settings)(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* settings);
  52. int (*read_status)(struct dvb_frontend* fe, fe_status_t* status);
  53. int (*read_ber)(struct dvb_frontend* fe, u32* ber);
  54. int (*read_signal_strength)(struct dvb_frontend* fe, u16* strength);
  55. int (*read_snr)(struct dvb_frontend* fe, u16* snr);
  56. int (*read_ucblocks)(struct dvb_frontend* fe, u32* ucblocks);
  57. int (*diseqc_reset_overload)(struct dvb_frontend* fe);
  58. int (*diseqc_send_master_cmd)(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd);
  59. int (*diseqc_recv_slave_reply)(struct dvb_frontend* fe, struct dvb_diseqc_slave_reply* reply);
  60. int (*diseqc_send_burst)(struct dvb_frontend* fe, fe_sec_mini_cmd_t minicmd);
  61. int (*set_tone)(struct dvb_frontend* fe, fe_sec_tone_mode_t tone);
  62. int (*set_voltage)(struct dvb_frontend* fe, fe_sec_voltage_t voltage);
  63. int (*enable_high_lnb_voltage)(struct dvb_frontend* fe, int arg);
  64. int (*dishnetwork_send_legacy_command)(struct dvb_frontend* fe, unsigned int cmd);
  65. };
  66. #define MAX_EVENT 8
  67. struct dvb_fe_events {
  68. struct dvb_frontend_event events[MAX_EVENT];
  69. int eventw;
  70. int eventr;
  71. int overflow;
  72. wait_queue_head_t wait_queue;
  73. struct semaphore sem;
  74. };
  75. struct dvb_frontend {
  76. struct dvb_frontend_ops* ops;
  77. struct dvb_adapter *dvb;
  78. void* demodulator_priv;
  79. void* frontend_priv;
  80. };
  81. extern int dvb_register_frontend(struct dvb_adapter* dvb,
  82. struct dvb_frontend* fe);
  83. extern int dvb_unregister_frontend(struct dvb_frontend* fe);
  84. #endif