fc8300.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*****************************************************************************
  2. Copyright(c) 2013 FCI Inc. All Rights Reserved
  3. File name : fc8300.h
  4. Description : Header file of Driver
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. History :
  17. ----------------------------------------------------------------------
  18. *******************************************************************************/
  19. #ifndef __ISDBT_H__
  20. #define __ISDBT_H__
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #include <linux/list.h>
  25. #include "fci_types.h"
  26. #include "fci_ringbuffer.h"
  27. #define CTL_TYPE 0
  28. #define TS_TYPE 1
  29. #define MAX_OPEN_NUM 8
  30. #define IOCTL_MAGIC 't'
  31. struct ioctl_info{
  32. unsigned long size;
  33. unsigned long buff[128];
  34. };
  35. typedef struct _tuner_sts_data {
  36. unsigned long open_cnt;
  37. unsigned long moni_cnt;
  38. } TUNER_STS_DATA;
  39. #define IOCTL_MAXNR 28
  40. #define IOCTL_ISDBT_RESET \
  41. _IO(IOCTL_MAGIC, 0)
  42. #define IOCTL_ISDBT_PROBE \
  43. _IO(IOCTL_MAGIC, 1)
  44. #define IOCTL_ISDBT_INIT \
  45. _IO(IOCTL_MAGIC, 2)
  46. #define IOCTL_ISDBT_DEINIT \
  47. _IO(IOCTL_MAGIC, 3)
  48. #define IOCTL_ISDBT_BYTE_READ \
  49. _IOWR(IOCTL_MAGIC, 4, struct ioctl_info)
  50. #define IOCTL_ISDBT_WORD_READ \
  51. _IOWR(IOCTL_MAGIC, 5, struct ioctl_info)
  52. #define IOCTL_ISDBT_LONG_READ \
  53. _IOWR(IOCTL_MAGIC, 6, struct ioctl_info)
  54. #define IOCTL_ISDBT_BULK_READ \
  55. _IOWR(IOCTL_MAGIC, 7, struct ioctl_info)
  56. #define IOCTL_ISDBT_BYTE_WRITE \
  57. _IOW(IOCTL_MAGIC, 8, struct ioctl_info)
  58. #define IOCTL_ISDBT_WORD_WRITE \
  59. _IOW(IOCTL_MAGIC, 9, struct ioctl_info)
  60. #define IOCTL_ISDBT_LONG_WRITE \
  61. _IOW(IOCTL_MAGIC, 10, struct ioctl_info)
  62. #define IOCTL_ISDBT_BULK_WRITE \
  63. _IOW(IOCTL_MAGIC, 11, struct ioctl_info)
  64. #define IOCTL_ISDBT_TUNER_READ \
  65. _IOWR(IOCTL_MAGIC, 12, struct ioctl_info)
  66. #define IOCTL_ISDBT_TUNER_WRITE \
  67. _IOW(IOCTL_MAGIC, 13, struct ioctl_info)
  68. #define IOCTL_ISDBT_TUNER_SET_FREQ \
  69. _IOW(IOCTL_MAGIC, 14, struct ioctl_info)
  70. #define IOCTL_ISDBT_TUNER_SELECT \
  71. _IOW(IOCTL_MAGIC, 15, struct ioctl_info)
  72. #define IOCTL_ISDBT_TUNER_DESELECT \
  73. _IO(IOCTL_MAGIC, 16)
  74. #define IOCTL_ISDBT_SCAN_STATUS \
  75. _IO(IOCTL_MAGIC, 17)
  76. #define IOCTL_ISDBT_TS_START \
  77. _IO(IOCTL_MAGIC, 18)
  78. #define IOCTL_ISDBT_TS_STOP \
  79. _IO(IOCTL_MAGIC, 19)
  80. #define IOCTL_ISDBT_TUNER_GET_RSSI \
  81. _IOWR(IOCTL_MAGIC, 20, struct ioctl_info)
  82. #define IOCTL_ISDBT_HOSTIF_SELECT \
  83. _IOW(IOCTL_MAGIC, 21, struct ioctl_info)
  84. #define IOCTL_ISDBT_HOSTIF_DESELECT \
  85. _IO(IOCTL_MAGIC, 22)
  86. #define IOCTL_ISDBT_POWER_ON \
  87. _IO(IOCTL_MAGIC, 23)
  88. #define IOCTL_ISDBT_POWER_OFF \
  89. _IO(IOCTL_MAGIC, 24)
  90. #define TUNER_IOCTL_VALGET_OPENCNT \
  91. _IO(IOCTL_MAGIC, 25)
  92. #define TUNER_IOCTL_VALSET_MONICNT \
  93. _IO(IOCTL_MAGIC, 26)
  94. #define IOCTL_ISDBT_TUNER_PKT_MODE \
  95. _IOW(IOCTL_MAGIC, 27,struct ioctl_info)
  96. struct ISDBT_OPEN_INFO_T{
  97. HANDLE *hInit;
  98. struct list_head hList;
  99. struct fci_ringbuffer RingBuffer;
  100. u8 *buf;
  101. u8 isdbttype;
  102. };
  103. struct ISDBT_INIT_INFO_T{
  104. struct list_head hHead;
  105. };
  106. enum ISDBT_MODE{
  107. ISDBT_POWERON = 0,
  108. ISDBT_POWEROFF = 1,
  109. ISDBT_DATAREAD = 2
  110. };
  111. extern int isdbt_open(struct inode *inode, struct file *filp);
  112. extern long isdbt_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
  113. extern int isdbt_release(struct inode *inode, struct file *filp);
  114. extern ssize_t isdbt_read(struct file *filp
  115. , char *buf, size_t count, loff_t *f_pos);
  116. #ifdef __cplusplus
  117. }
  118. #endif
  119. #endif