logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

frontend.h (30393B)


  1. /* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
  2. /*
  3. * frontend.h
  4. *
  5. * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
  6. * Ralph Metzler <ralph@convergence.de>
  7. * Holger Waechtler <holger@convergence.de>
  8. * Andre Draszik <ad@convergence.de>
  9. * for convergence integrated media GmbH
  10. */
  11. #ifndef _DVBFRONTEND_H_
  12. #define _DVBFRONTEND_H_
  13. #include <linux/types.h>
  14. /**
  15. * enum fe_caps - Frontend capabilities
  16. *
  17. * @FE_IS_STUPID: There's something wrong at the
  18. * frontend, and it can't report its
  19. * capabilities.
  20. * @FE_CAN_INVERSION_AUTO: Can auto-detect frequency spectral
  21. * band inversion
  22. * @FE_CAN_FEC_1_2: Supports FEC 1/2
  23. * @FE_CAN_FEC_2_3: Supports FEC 2/3
  24. * @FE_CAN_FEC_3_4: Supports FEC 3/4
  25. * @FE_CAN_FEC_4_5: Supports FEC 4/5
  26. * @FE_CAN_FEC_5_6: Supports FEC 5/6
  27. * @FE_CAN_FEC_6_7: Supports FEC 6/7
  28. * @FE_CAN_FEC_7_8: Supports FEC 7/8
  29. * @FE_CAN_FEC_8_9: Supports FEC 8/9
  30. * @FE_CAN_FEC_AUTO: Can auto-detect FEC
  31. * @FE_CAN_QPSK: Supports QPSK modulation
  32. * @FE_CAN_QAM_16: Supports 16-QAM modulation
  33. * @FE_CAN_QAM_32: Supports 32-QAM modulation
  34. * @FE_CAN_QAM_64: Supports 64-QAM modulation
  35. * @FE_CAN_QAM_128: Supports 128-QAM modulation
  36. * @FE_CAN_QAM_256: Supports 256-QAM modulation
  37. * @FE_CAN_QAM_AUTO: Can auto-detect QAM modulation
  38. * @FE_CAN_TRANSMISSION_MODE_AUTO: Can auto-detect transmission mode
  39. * @FE_CAN_BANDWIDTH_AUTO: Can auto-detect bandwidth
  40. * @FE_CAN_GUARD_INTERVAL_AUTO: Can auto-detect guard interval
  41. * @FE_CAN_HIERARCHY_AUTO: Can auto-detect hierarchy
  42. * @FE_CAN_8VSB: Supports 8-VSB modulation
  43. * @FE_CAN_16VSB: Supporta 16-VSB modulation
  44. * @FE_HAS_EXTENDED_CAPS: Unused
  45. * @FE_CAN_MULTISTREAM: Supports multistream filtering
  46. * @FE_CAN_TURBO_FEC: Supports "turbo FEC" modulation
  47. * @FE_CAN_2G_MODULATION: Supports "2nd generation" modulation,
  48. * e. g. DVB-S2, DVB-T2, DVB-C2
  49. * @FE_NEEDS_BENDING: Unused
  50. * @FE_CAN_RECOVER: Can recover from a cable unplug
  51. * automatically
  52. * @FE_CAN_MUTE_TS: Can stop spurious TS data output
  53. */
  54. enum fe_caps {
  55. FE_IS_STUPID = 0,
  56. FE_CAN_INVERSION_AUTO = 0x1,
  57. FE_CAN_FEC_1_2 = 0x2,
  58. FE_CAN_FEC_2_3 = 0x4,
  59. FE_CAN_FEC_3_4 = 0x8,
  60. FE_CAN_FEC_4_5 = 0x10,
  61. FE_CAN_FEC_5_6 = 0x20,
  62. FE_CAN_FEC_6_7 = 0x40,
  63. FE_CAN_FEC_7_8 = 0x80,
  64. FE_CAN_FEC_8_9 = 0x100,
  65. FE_CAN_FEC_AUTO = 0x200,
  66. FE_CAN_QPSK = 0x400,
  67. FE_CAN_QAM_16 = 0x800,
  68. FE_CAN_QAM_32 = 0x1000,
  69. FE_CAN_QAM_64 = 0x2000,
  70. FE_CAN_QAM_128 = 0x4000,
  71. FE_CAN_QAM_256 = 0x8000,
  72. FE_CAN_QAM_AUTO = 0x10000,
  73. FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
  74. FE_CAN_BANDWIDTH_AUTO = 0x40000,
  75. FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
  76. FE_CAN_HIERARCHY_AUTO = 0x100000,
  77. FE_CAN_8VSB = 0x200000,
  78. FE_CAN_16VSB = 0x400000,
  79. FE_HAS_EXTENDED_CAPS = 0x800000,
  80. FE_CAN_MULTISTREAM = 0x4000000,
  81. FE_CAN_TURBO_FEC = 0x8000000,
  82. FE_CAN_2G_MODULATION = 0x10000000,
  83. FE_NEEDS_BENDING = 0x20000000,
  84. FE_CAN_RECOVER = 0x40000000,
  85. FE_CAN_MUTE_TS = 0x80000000
  86. };
  87. /*
  88. * DEPRECATED: Should be kept just due to backward compatibility.
  89. */
  90. enum fe_type {
  91. FE_QPSK,
  92. FE_QAM,
  93. FE_OFDM,
  94. FE_ATSC
  95. };
  96. /**
  97. * struct dvb_frontend_info - Frontend properties and capabilities
  98. *
  99. * @name: Name of the frontend
  100. * @type: **DEPRECATED**.
  101. * Should not be used on modern programs,
  102. * as a frontend may have more than one type.
  103. * In order to get the support types of a given
  104. * frontend, use :c:type:`DTV_ENUM_DELSYS`
  105. * instead.
  106. * @frequency_min: Minimal frequency supported by the frontend.
  107. * @frequency_max: Minimal frequency supported by the frontend.
  108. * @frequency_stepsize: All frequencies are multiple of this value.
  109. * @frequency_tolerance: Frequency tolerance.
  110. * @symbol_rate_min: Minimal symbol rate, in bauds
  111. * (for Cable/Satellite systems).
  112. * @symbol_rate_max: Maximal symbol rate, in bauds
  113. * (for Cable/Satellite systems).
  114. * @symbol_rate_tolerance: Maximal symbol rate tolerance, in ppm
  115. * (for Cable/Satellite systems).
  116. * @notifier_delay: **DEPRECATED**. Not used by any driver.
  117. * @caps: Capabilities supported by the frontend,
  118. * as specified in &enum fe_caps.
  119. *
  120. * .. note:
  121. *
  122. * #. The frequencies are specified in Hz for Terrestrial and Cable
  123. * systems.
  124. * #. The frequencies are specified in kHz for Satellite systems.
  125. */
  126. struct dvb_frontend_info {
  127. char name[128];
  128. enum fe_type type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */
  129. __u32 frequency_min;
  130. __u32 frequency_max;
  131. __u32 frequency_stepsize;
  132. __u32 frequency_tolerance;
  133. __u32 symbol_rate_min;
  134. __u32 symbol_rate_max;
  135. __u32 symbol_rate_tolerance;
  136. __u32 notifier_delay; /* DEPRECATED */
  137. enum fe_caps caps;
  138. };
  139. /**
  140. * struct dvb_diseqc_master_cmd - DiSEqC master command
  141. *
  142. * @msg:
  143. * DiSEqC message to be sent. It contains a 3 bytes header with:
  144. * framing + address + command, and an optional argument
  145. * of up to 3 bytes of data.
  146. * @msg_len:
  147. * Length of the DiSEqC message. Valid values are 3 to 6.
  148. *
  149. * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
  150. * the possible messages that can be used.
  151. */
  152. struct dvb_diseqc_master_cmd {
  153. __u8 msg[6];
  154. __u8 msg_len;
  155. };
  156. /**
  157. * struct dvb_diseqc_slave_reply - DiSEqC received data
  158. *
  159. * @msg:
  160. * DiSEqC message buffer to store a message received via DiSEqC.
  161. * It contains one byte header with: framing and
  162. * an optional argument of up to 3 bytes of data.
  163. * @msg_len:
  164. * Length of the DiSEqC message. Valid values are 0 to 4,
  165. * where 0 means no message.
  166. * @timeout:
  167. * Return from ioctl after timeout ms with errorcode when
  168. * no message was received.
  169. *
  170. * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
  171. * the possible messages that can be used.
  172. */
  173. struct dvb_diseqc_slave_reply {
  174. __u8 msg[4];
  175. __u8 msg_len;
  176. int timeout;
  177. };
  178. /**
  179. * enum fe_sec_voltage - DC Voltage used to feed the LNBf
  180. *
  181. * @SEC_VOLTAGE_13: Output 13V to the LNBf
  182. * @SEC_VOLTAGE_18: Output 18V to the LNBf
  183. * @SEC_VOLTAGE_OFF: Don't feed the LNBf with a DC voltage
  184. */
  185. enum fe_sec_voltage {
  186. SEC_VOLTAGE_13,
  187. SEC_VOLTAGE_18,
  188. SEC_VOLTAGE_OFF
  189. };
  190. /**
  191. * enum fe_sec_tone_mode - Type of tone to be send to the LNBf.
  192. * @SEC_TONE_ON: Sends a 22kHz tone burst to the antenna.
  193. * @SEC_TONE_OFF: Don't send a 22kHz tone to the antenna (except
  194. * if the ``FE_DISEQC_*`` ioctls are called).
  195. */
  196. enum fe_sec_tone_mode {
  197. SEC_TONE_ON,
  198. SEC_TONE_OFF
  199. };
  200. /**
  201. * enum fe_sec_mini_cmd - Type of mini burst to be sent
  202. *
  203. * @SEC_MINI_A: Sends a mini-DiSEqC 22kHz '0' Tone Burst to select
  204. * satellite-A
  205. * @SEC_MINI_B: Sends a mini-DiSEqC 22kHz '1' Data Burst to select
  206. * satellite-B
  207. */
  208. enum fe_sec_mini_cmd {
  209. SEC_MINI_A,
  210. SEC_MINI_B
  211. };
  212. /**
  213. * enum fe_status - Enumerates the possible frontend status.
  214. * @FE_NONE: The frontend doesn't have any kind of lock.
  215. * That's the initial frontend status
  216. * @FE_HAS_SIGNAL: Has found something above the noise level.
  217. * @FE_HAS_CARRIER: Has found a signal.
  218. * @FE_HAS_VITERBI: FEC inner coding (Viterbi, LDPC or other inner code).
  219. * is stable.
  220. * @FE_HAS_SYNC: Synchronization bytes was found.
  221. * @FE_HAS_LOCK: Digital TV were locked and everything is working.
  222. * @FE_TIMEDOUT: Fo lock within the last about 2 seconds.
  223. * @FE_REINIT: Frontend was reinitialized, application is recommended
  224. * to reset DiSEqC, tone and parameters.
  225. */
  226. enum fe_status {
  227. FE_NONE = 0x00,
  228. FE_HAS_SIGNAL = 0x01,
  229. FE_HAS_CARRIER = 0x02,
  230. FE_HAS_VITERBI = 0x04,
  231. FE_HAS_SYNC = 0x08,
  232. FE_HAS_LOCK = 0x10,
  233. FE_TIMEDOUT = 0x20,
  234. FE_REINIT = 0x40,
  235. };
  236. /**
  237. * enum fe_spectral_inversion - Type of inversion band
  238. *
  239. * @INVERSION_OFF: Don't do spectral band inversion.
  240. * @INVERSION_ON: Do spectral band inversion.
  241. * @INVERSION_AUTO: Autodetect spectral band inversion.
  242. *
  243. * This parameter indicates if spectral inversion should be presumed or
  244. * not. In the automatic setting (``INVERSION_AUTO``) the hardware will try
  245. * to figure out the correct setting by itself. If the hardware doesn't
  246. * support, the %dvb_frontend will try to lock at the carrier first with
  247. * inversion off. If it fails, it will try to enable inversion.
  248. */
  249. enum fe_spectral_inversion {
  250. INVERSION_OFF,
  251. INVERSION_ON,
  252. INVERSION_AUTO
  253. };
  254. /**
  255. * enum fe_code_rate - Type of Forward Error Correction (FEC)
  256. *
  257. * @FEC_NONE: No Forward Error Correction Code
  258. * @FEC_1_2: Forward Error Correction Code 1/2
  259. * @FEC_2_3: Forward Error Correction Code 2/3
  260. * @FEC_3_4: Forward Error Correction Code 3/4
  261. * @FEC_4_5: Forward Error Correction Code 4/5
  262. * @FEC_5_6: Forward Error Correction Code 5/6
  263. * @FEC_6_7: Forward Error Correction Code 6/7
  264. * @FEC_7_8: Forward Error Correction Code 7/8
  265. * @FEC_8_9: Forward Error Correction Code 8/9
  266. * @FEC_AUTO: Autodetect Error Correction Code
  267. * @FEC_3_5: Forward Error Correction Code 3/5
  268. * @FEC_9_10: Forward Error Correction Code 9/10
  269. * @FEC_2_5: Forward Error Correction Code 2/5
  270. * @FEC_1_3: Forward Error Correction Code 1/3
  271. * @FEC_1_4: Forward Error Correction Code 1/4
  272. * @FEC_5_9: Forward Error Correction Code 5/9
  273. * @FEC_7_9: Forward Error Correction Code 7/9
  274. * @FEC_8_15: Forward Error Correction Code 8/15
  275. * @FEC_11_15: Forward Error Correction Code 11/15
  276. * @FEC_13_18: Forward Error Correction Code 13/18
  277. * @FEC_9_20: Forward Error Correction Code 9/20
  278. * @FEC_11_20: Forward Error Correction Code 11/20
  279. * @FEC_23_36: Forward Error Correction Code 23/36
  280. * @FEC_25_36: Forward Error Correction Code 25/36
  281. * @FEC_13_45: Forward Error Correction Code 13/45
  282. * @FEC_26_45: Forward Error Correction Code 26/45
  283. * @FEC_28_45: Forward Error Correction Code 28/45
  284. * @FEC_32_45: Forward Error Correction Code 32/45
  285. * @FEC_77_90: Forward Error Correction Code 77/90
  286. * @FEC_11_45: Forward Error Correction Code 11/45
  287. * @FEC_4_15: Forward Error Correction Code 4/15
  288. * @FEC_14_45: Forward Error Correction Code 14/45
  289. * @FEC_7_15: Forward Error Correction Code 7/15
  290. *
  291. * Please note that not all FEC types are supported by a given standard.
  292. */
  293. enum fe_code_rate {
  294. FEC_NONE = 0,
  295. FEC_1_2,
  296. FEC_2_3,
  297. FEC_3_4,
  298. FEC_4_5,
  299. FEC_5_6,
  300. FEC_6_7,
  301. FEC_7_8,
  302. FEC_8_9,
  303. FEC_AUTO,
  304. FEC_3_5,
  305. FEC_9_10,
  306. FEC_2_5,
  307. FEC_1_3,
  308. FEC_1_4,
  309. FEC_5_9,
  310. FEC_7_9,
  311. FEC_8_15,
  312. FEC_11_15,
  313. FEC_13_18,
  314. FEC_9_20,
  315. FEC_11_20,
  316. FEC_23_36,
  317. FEC_25_36,
  318. FEC_13_45,
  319. FEC_26_45,
  320. FEC_28_45,
  321. FEC_32_45,
  322. FEC_77_90,
  323. FEC_11_45,
  324. FEC_4_15,
  325. FEC_14_45,
  326. FEC_7_15,
  327. };
  328. /**
  329. * enum fe_modulation - Type of modulation/constellation
  330. * @QPSK: QPSK modulation
  331. * @QAM_16: 16-QAM modulation
  332. * @QAM_32: 32-QAM modulation
  333. * @QAM_64: 64-QAM modulation
  334. * @QAM_128: 128-QAM modulation
  335. * @QAM_256: 256-QAM modulation
  336. * @QAM_AUTO: Autodetect QAM modulation
  337. * @VSB_8: 8-VSB modulation
  338. * @VSB_16: 16-VSB modulation
  339. * @PSK_8: 8-PSK modulation
  340. * @APSK_16: 16-APSK modulation
  341. * @APSK_32: 32-APSK modulation
  342. * @DQPSK: DQPSK modulation
  343. * @QAM_4_NR: 4-QAM-NR modulation
  344. * @QAM_1024: 1024-QAM modulation
  345. * @QAM_4096: 4096-QAM modulation
  346. * @APSK_8_L: 8APSK-L modulation
  347. * @APSK_16_L: 16APSK-L modulation
  348. * @APSK_32_L: 32APSK-L modulation
  349. * @APSK_64: 64APSK modulation
  350. * @APSK_64_L: 64APSK-L modulation
  351. *
  352. * Please note that not all modulations are supported by a given standard.
  353. *
  354. */
  355. enum fe_modulation {
  356. QPSK,
  357. QAM_16,
  358. QAM_32,
  359. QAM_64,
  360. QAM_128,
  361. QAM_256,
  362. QAM_AUTO,
  363. VSB_8,
  364. VSB_16,
  365. PSK_8,
  366. APSK_16,
  367. APSK_32,
  368. DQPSK,
  369. QAM_4_NR,
  370. QAM_1024,
  371. QAM_4096,
  372. APSK_8_L,
  373. APSK_16_L,
  374. APSK_32_L,
  375. APSK_64,
  376. APSK_64_L,
  377. };
  378. /**
  379. * enum fe_transmit_mode - Transmission mode
  380. *
  381. * @TRANSMISSION_MODE_AUTO:
  382. * Autodetect transmission mode. The hardware will try to find the
  383. * correct FFT-size (if capable) to fill in the missing parameters.
  384. * @TRANSMISSION_MODE_1K:
  385. * Transmission mode 1K
  386. * @TRANSMISSION_MODE_2K:
  387. * Transmission mode 2K
  388. * @TRANSMISSION_MODE_8K:
  389. * Transmission mode 8K
  390. * @TRANSMISSION_MODE_4K:
  391. * Transmission mode 4K
  392. * @TRANSMISSION_MODE_16K:
  393. * Transmission mode 16K
  394. * @TRANSMISSION_MODE_32K:
  395. * Transmission mode 32K
  396. * @TRANSMISSION_MODE_C1:
  397. * Single Carrier (C=1) transmission mode (DTMB only)
  398. * @TRANSMISSION_MODE_C3780:
  399. * Multi Carrier (C=3780) transmission mode (DTMB only)
  400. *
  401. * Please note that not all transmission modes are supported by a given
  402. * standard.
  403. */
  404. enum fe_transmit_mode {
  405. TRANSMISSION_MODE_2K,
  406. TRANSMISSION_MODE_8K,
  407. TRANSMISSION_MODE_AUTO,
  408. TRANSMISSION_MODE_4K,
  409. TRANSMISSION_MODE_1K,
  410. TRANSMISSION_MODE_16K,
  411. TRANSMISSION_MODE_32K,
  412. TRANSMISSION_MODE_C1,
  413. TRANSMISSION_MODE_C3780,
  414. };
  415. /**
  416. * enum fe_guard_interval - Guard interval
  417. *
  418. * @GUARD_INTERVAL_AUTO: Autodetect the guard interval
  419. * @GUARD_INTERVAL_1_128: Guard interval 1/128
  420. * @GUARD_INTERVAL_1_32: Guard interval 1/32
  421. * @GUARD_INTERVAL_1_16: Guard interval 1/16
  422. * @GUARD_INTERVAL_1_8: Guard interval 1/8
  423. * @GUARD_INTERVAL_1_4: Guard interval 1/4
  424. * @GUARD_INTERVAL_19_128: Guard interval 19/128
  425. * @GUARD_INTERVAL_19_256: Guard interval 19/256
  426. * @GUARD_INTERVAL_PN420: PN length 420 (1/4)
  427. * @GUARD_INTERVAL_PN595: PN length 595 (1/6)
  428. * @GUARD_INTERVAL_PN945: PN length 945 (1/9)
  429. * @GUARD_INTERVAL_1_64: Guard interval 1/64
  430. *
  431. * Please note that not all guard intervals are supported by a given standard.
  432. */
  433. enum fe_guard_interval {
  434. GUARD_INTERVAL_1_32,
  435. GUARD_INTERVAL_1_16,
  436. GUARD_INTERVAL_1_8,
  437. GUARD_INTERVAL_1_4,
  438. GUARD_INTERVAL_AUTO,
  439. GUARD_INTERVAL_1_128,
  440. GUARD_INTERVAL_19_128,
  441. GUARD_INTERVAL_19_256,
  442. GUARD_INTERVAL_PN420,
  443. GUARD_INTERVAL_PN595,
  444. GUARD_INTERVAL_PN945,
  445. GUARD_INTERVAL_1_64,
  446. };
  447. /**
  448. * enum fe_hierarchy - Hierarchy
  449. * @HIERARCHY_NONE: No hierarchy
  450. * @HIERARCHY_AUTO: Autodetect hierarchy (if supported)
  451. * @HIERARCHY_1: Hierarchy 1
  452. * @HIERARCHY_2: Hierarchy 2
  453. * @HIERARCHY_4: Hierarchy 4
  454. *
  455. * Please note that not all hierarchy types are supported by a given standard.
  456. */
  457. enum fe_hierarchy {
  458. HIERARCHY_NONE,
  459. HIERARCHY_1,
  460. HIERARCHY_2,
  461. HIERARCHY_4,
  462. HIERARCHY_AUTO
  463. };
  464. /**
  465. * enum fe_interleaving - Interleaving
  466. * @INTERLEAVING_NONE: No interleaving.
  467. * @INTERLEAVING_AUTO: Auto-detect interleaving.
  468. * @INTERLEAVING_240: Interleaving of 240 symbols.
  469. * @INTERLEAVING_720: Interleaving of 720 symbols.
  470. *
  471. * Please note that, currently, only DTMB uses it.
  472. */
  473. enum fe_interleaving {
  474. INTERLEAVING_NONE,
  475. INTERLEAVING_AUTO,
  476. INTERLEAVING_240,
  477. INTERLEAVING_720,
  478. };
  479. /* DVBv5 property Commands */
  480. #define DTV_UNDEFINED 0
  481. #define DTV_TUNE 1
  482. #define DTV_CLEAR 2
  483. #define DTV_FREQUENCY 3
  484. #define DTV_MODULATION 4
  485. #define DTV_BANDWIDTH_HZ 5
  486. #define DTV_INVERSION 6
  487. #define DTV_DISEQC_MASTER 7
  488. #define DTV_SYMBOL_RATE 8
  489. #define DTV_INNER_FEC 9
  490. #define DTV_VOLTAGE 10
  491. #define DTV_TONE 11
  492. #define DTV_PILOT 12
  493. #define DTV_ROLLOFF 13
  494. #define DTV_DISEQC_SLAVE_REPLY 14
  495. /* Basic enumeration set for querying unlimited capabilities */
  496. #define DTV_FE_CAPABILITY_COUNT 15
  497. #define DTV_FE_CAPABILITY 16
  498. #define DTV_DELIVERY_SYSTEM 17
  499. /* ISDB-T and ISDB-Tsb */
  500. #define DTV_ISDBT_PARTIAL_RECEPTION 18
  501. #define DTV_ISDBT_SOUND_BROADCASTING 19
  502. #define DTV_ISDBT_SB_SUBCHANNEL_ID 20
  503. #define DTV_ISDBT_SB_SEGMENT_IDX 21
  504. #define DTV_ISDBT_SB_SEGMENT_COUNT 22
  505. #define DTV_ISDBT_LAYERA_FEC 23
  506. #define DTV_ISDBT_LAYERA_MODULATION 24
  507. #define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25
  508. #define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26
  509. #define DTV_ISDBT_LAYERB_FEC 27
  510. #define DTV_ISDBT_LAYERB_MODULATION 28
  511. #define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29
  512. #define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30
  513. #define DTV_ISDBT_LAYERC_FEC 31
  514. #define DTV_ISDBT_LAYERC_MODULATION 32
  515. #define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33
  516. #define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34
  517. #define DTV_API_VERSION 35
  518. #define DTV_CODE_RATE_HP 36
  519. #define DTV_CODE_RATE_LP 37
  520. #define DTV_GUARD_INTERVAL 38
  521. #define DTV_TRANSMISSION_MODE 39
  522. #define DTV_HIERARCHY 40
  523. #define DTV_ISDBT_LAYER_ENABLED 41
  524. #define DTV_STREAM_ID 42
  525. #define DTV_ISDBS_TS_ID_LEGACY DTV_STREAM_ID
  526. #define DTV_DVBT2_PLP_ID_LEGACY 43
  527. #define DTV_ENUM_DELSYS 44
  528. /* ATSC-MH */
  529. #define DTV_ATSCMH_FIC_VER 45
  530. #define DTV_ATSCMH_PARADE_ID 46
  531. #define DTV_ATSCMH_NOG 47
  532. #define DTV_ATSCMH_TNOG 48
  533. #define DTV_ATSCMH_SGN 49
  534. #define DTV_ATSCMH_PRC 50
  535. #define DTV_ATSCMH_RS_FRAME_MODE 51
  536. #define DTV_ATSCMH_RS_FRAME_ENSEMBLE 52
  537. #define DTV_ATSCMH_RS_CODE_MODE_PRI 53
  538. #define DTV_ATSCMH_RS_CODE_MODE_SEC 54
  539. #define DTV_ATSCMH_SCCC_BLOCK_MODE 55
  540. #define DTV_ATSCMH_SCCC_CODE_MODE_A 56
  541. #define DTV_ATSCMH_SCCC_CODE_MODE_B 57
  542. #define DTV_ATSCMH_SCCC_CODE_MODE_C 58
  543. #define DTV_ATSCMH_SCCC_CODE_MODE_D 59
  544. #define DTV_INTERLEAVING 60
  545. #define DTV_LNA 61
  546. /* Quality parameters */
  547. #define DTV_STAT_SIGNAL_STRENGTH 62
  548. #define DTV_STAT_CNR 63
  549. #define DTV_STAT_PRE_ERROR_BIT_COUNT 64
  550. #define DTV_STAT_PRE_TOTAL_BIT_COUNT 65
  551. #define DTV_STAT_POST_ERROR_BIT_COUNT 66
  552. #define DTV_STAT_POST_TOTAL_BIT_COUNT 67
  553. #define DTV_STAT_ERROR_BLOCK_COUNT 68
  554. #define DTV_STAT_TOTAL_BLOCK_COUNT 69
  555. /* Physical layer scrambling */
  556. #define DTV_SCRAMBLING_SEQUENCE_INDEX 70
  557. #define DTV_MAX_COMMAND DTV_SCRAMBLING_SEQUENCE_INDEX
  558. /**
  559. * enum fe_pilot - Type of pilot tone
  560. *
  561. * @PILOT_ON: Pilot tones enabled
  562. * @PILOT_OFF: Pilot tones disabled
  563. * @PILOT_AUTO: Autodetect pilot tones
  564. */
  565. enum fe_pilot {
  566. PILOT_ON,
  567. PILOT_OFF,
  568. PILOT_AUTO,
  569. };
  570. /**
  571. * enum fe_rolloff - Rolloff factor
  572. * @ROLLOFF_35: Roloff factor: α=35%
  573. * @ROLLOFF_20: Roloff factor: α=20%
  574. * @ROLLOFF_25: Roloff factor: α=25%
  575. * @ROLLOFF_AUTO: Auto-detect the roloff factor.
  576. * @ROLLOFF_15: Rolloff factor: α=15%
  577. * @ROLLOFF_10: Rolloff factor: α=10%
  578. * @ROLLOFF_5: Rolloff factor: α=5%
  579. *
  580. * .. note:
  581. *
  582. * Roloff factor of 35% is implied on DVB-S. On DVB-S2, it is default.
  583. */
  584. enum fe_rolloff {
  585. ROLLOFF_35,
  586. ROLLOFF_20,
  587. ROLLOFF_25,
  588. ROLLOFF_AUTO,
  589. ROLLOFF_15,
  590. ROLLOFF_10,
  591. ROLLOFF_5,
  592. };
  593. /**
  594. * enum fe_delivery_system - Type of the delivery system
  595. *
  596. * @SYS_UNDEFINED:
  597. * Undefined standard. Generally, indicates an error
  598. * @SYS_DVBC_ANNEX_A:
  599. * Cable TV: DVB-C following ITU-T J.83 Annex A spec
  600. * @SYS_DVBC_ANNEX_B:
  601. * Cable TV: DVB-C following ITU-T J.83 Annex B spec (ClearQAM)
  602. * @SYS_DVBC_ANNEX_C:
  603. * Cable TV: DVB-C following ITU-T J.83 Annex C spec
  604. * @SYS_DVBC2:
  605. * Cable TV: DVB-C2
  606. * @SYS_ISDBC:
  607. * Cable TV: ISDB-C (no drivers yet)
  608. * @SYS_DVBT:
  609. * Terrestrial TV: DVB-T
  610. * @SYS_DVBT2:
  611. * Terrestrial TV: DVB-T2
  612. * @SYS_ISDBT:
  613. * Terrestrial TV: ISDB-T
  614. * @SYS_ATSC:
  615. * Terrestrial TV: ATSC
  616. * @SYS_ATSCMH:
  617. * Terrestrial TV (mobile): ATSC-M/H
  618. * @SYS_DTMB:
  619. * Terrestrial TV: DTMB
  620. * @SYS_DVBS:
  621. * Satellite TV: DVB-S
  622. * @SYS_DVBS2:
  623. * Satellite TV: DVB-S2 and DVB-S2X
  624. * @SYS_TURBO:
  625. * Satellite TV: DVB-S Turbo
  626. * @SYS_ISDBS:
  627. * Satellite TV: ISDB-S
  628. * @SYS_DAB:
  629. * Digital audio: DAB (not fully supported)
  630. * @SYS_DSS:
  631. * Satellite TV: DSS (not fully supported)
  632. * @SYS_CMMB:
  633. * Terrestrial TV (mobile): CMMB (not fully supported)
  634. * @SYS_DVBH:
  635. * Terrestrial TV (mobile): DVB-H (standard deprecated)
  636. */
  637. enum fe_delivery_system {
  638. SYS_UNDEFINED,
  639. SYS_DVBC_ANNEX_A,
  640. SYS_DVBC_ANNEX_B,
  641. SYS_DVBT,
  642. SYS_DSS,
  643. SYS_DVBS,
  644. SYS_DVBS2,
  645. SYS_DVBH,
  646. SYS_ISDBT,
  647. SYS_ISDBS,
  648. SYS_ISDBC,
  649. SYS_ATSC,
  650. SYS_ATSCMH,
  651. SYS_DTMB,
  652. SYS_CMMB,
  653. SYS_DAB,
  654. SYS_DVBT2,
  655. SYS_TURBO,
  656. SYS_DVBC_ANNEX_C,
  657. SYS_DVBC2,
  658. };
  659. /* backward compatibility definitions for delivery systems */
  660. #define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A
  661. #define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB */
  662. /* ATSC-MH specific parameters */
  663. /**
  664. * enum atscmh_sccc_block_mode - Type of Series Concatenated Convolutional
  665. * Code Block Mode.
  666. *
  667. * @ATSCMH_SCCC_BLK_SEP:
  668. * Separate SCCC: the SCCC outer code mode shall be set independently
  669. * for each Group Region (A, B, C, D)
  670. * @ATSCMH_SCCC_BLK_COMB:
  671. * Combined SCCC: all four Regions shall have the same SCCC outer
  672. * code mode.
  673. * @ATSCMH_SCCC_BLK_RES:
  674. * Reserved. Shouldn't be used.
  675. */
  676. enum atscmh_sccc_block_mode {
  677. ATSCMH_SCCC_BLK_SEP = 0,
  678. ATSCMH_SCCC_BLK_COMB = 1,
  679. ATSCMH_SCCC_BLK_RES = 2,
  680. };
  681. /**
  682. * enum atscmh_sccc_code_mode - Type of Series Concatenated Convolutional
  683. * Code Rate.
  684. *
  685. * @ATSCMH_SCCC_CODE_HLF:
  686. * The outer code rate of a SCCC Block is 1/2 rate.
  687. * @ATSCMH_SCCC_CODE_QTR:
  688. * The outer code rate of a SCCC Block is 1/4 rate.
  689. * @ATSCMH_SCCC_CODE_RES:
  690. * Reserved. Should not be used.
  691. */
  692. enum atscmh_sccc_code_mode {
  693. ATSCMH_SCCC_CODE_HLF = 0,
  694. ATSCMH_SCCC_CODE_QTR = 1,
  695. ATSCMH_SCCC_CODE_RES = 2,
  696. };
  697. /**
  698. * enum atscmh_rs_frame_ensemble - Reed Solomon(RS) frame ensemble.
  699. *
  700. * @ATSCMH_RSFRAME_ENS_PRI: Primary Ensemble.
  701. * @ATSCMH_RSFRAME_ENS_SEC: Secondary Ensemble.
  702. */
  703. enum atscmh_rs_frame_ensemble {
  704. ATSCMH_RSFRAME_ENS_PRI = 0,
  705. ATSCMH_RSFRAME_ENS_SEC = 1,
  706. };
  707. /**
  708. * enum atscmh_rs_frame_mode - Reed Solomon (RS) frame mode.
  709. *
  710. * @ATSCMH_RSFRAME_PRI_ONLY:
  711. * Single Frame: There is only a primary RS Frame for all Group
  712. * Regions.
  713. * @ATSCMH_RSFRAME_PRI_SEC:
  714. * Dual Frame: There are two separate RS Frames: Primary RS Frame for
  715. * Group Region A and B and Secondary RS Frame for Group Region C and
  716. * D.
  717. * @ATSCMH_RSFRAME_RES:
  718. * Reserved. Shouldn't be used.
  719. */
  720. enum atscmh_rs_frame_mode {
  721. ATSCMH_RSFRAME_PRI_ONLY = 0,
  722. ATSCMH_RSFRAME_PRI_SEC = 1,
  723. ATSCMH_RSFRAME_RES = 2,
  724. };
  725. /**
  726. * enum atscmh_rs_code_mode - ATSC-M/H Reed Solomon modes
  727. * @ATSCMH_RSCODE_211_187: Reed Solomon code (211,187).
  728. * @ATSCMH_RSCODE_223_187: Reed Solomon code (223,187).
  729. * @ATSCMH_RSCODE_235_187: Reed Solomon code (235,187).
  730. * @ATSCMH_RSCODE_RES: Reserved. Shouldn't be used.
  731. */
  732. enum atscmh_rs_code_mode {
  733. ATSCMH_RSCODE_211_187 = 0,
  734. ATSCMH_RSCODE_223_187 = 1,
  735. ATSCMH_RSCODE_235_187 = 2,
  736. ATSCMH_RSCODE_RES = 3,
  737. };
  738. #define NO_STREAM_ID_FILTER (~0U)
  739. #define LNA_AUTO (~0U)
  740. /**
  741. * enum fecap_scale_params - scale types for the quality parameters.
  742. *
  743. * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That
  744. * could indicate a temporary or a permanent
  745. * condition.
  746. * @FE_SCALE_DECIBEL: The scale is measured in 0.001 dB steps, typically
  747. * used on signal measures.
  748. * @FE_SCALE_RELATIVE: The scale is a relative percentual measure,
  749. * ranging from 0 (0%) to 0xffff (100%).
  750. * @FE_SCALE_COUNTER: The scale counts the occurrence of an event, like
  751. * bit error, block error, lapsed time.
  752. */
  753. enum fecap_scale_params {
  754. FE_SCALE_NOT_AVAILABLE = 0,
  755. FE_SCALE_DECIBEL,
  756. FE_SCALE_RELATIVE,
  757. FE_SCALE_COUNTER
  758. };
  759. /**
  760. * struct dtv_stats - Used for reading a DTV status property
  761. *
  762. * @scale:
  763. * Filled with enum fecap_scale_params - the scale in usage
  764. * for that parameter
  765. *
  766. * @svalue:
  767. * integer value of the measure, for %FE_SCALE_DECIBEL,
  768. * used for dB measures. The unit is 0.001 dB.
  769. *
  770. * @uvalue:
  771. * unsigned integer value of the measure, used when @scale is
  772. * either %FE_SCALE_RELATIVE or %FE_SCALE_COUNTER.
  773. *
  774. * For most delivery systems, this will return a single value for each
  775. * parameter.
  776. *
  777. * It should be noticed, however, that new OFDM delivery systems like
  778. * ISDB can use different modulation types for each group of carriers.
  779. * On such standards, up to 8 groups of statistics can be provided, one
  780. * for each carrier group (called "layer" on ISDB).
  781. *
  782. * In order to be consistent with other delivery systems, the first
  783. * value refers to the entire set of carriers ("global").
  784. *
  785. * @scale should use the value %FE_SCALE_NOT_AVAILABLE when
  786. * the value for the entire group of carriers or from one specific layer
  787. * is not provided by the hardware.
  788. *
  789. * @len should be filled with the latest filled status + 1.
  790. *
  791. * In other words, for ISDB, those values should be filled like::
  792. *
  793. * u.st.stat.svalue[0] = global statistics;
  794. * u.st.stat.scale[0] = FE_SCALE_DECIBEL;
  795. * u.st.stat.value[1] = layer A statistics;
  796. * u.st.stat.scale[1] = FE_SCALE_NOT_AVAILABLE (if not available);
  797. * u.st.stat.svalue[2] = layer B statistics;
  798. * u.st.stat.scale[2] = FE_SCALE_DECIBEL;
  799. * u.st.stat.svalue[3] = layer C statistics;
  800. * u.st.stat.scale[3] = FE_SCALE_DECIBEL;
  801. * u.st.len = 4;
  802. */
  803. struct dtv_stats {
  804. __u8 scale; /* enum fecap_scale_params type */
  805. union {
  806. __u64 uvalue; /* for counters and relative scales */
  807. __s64 svalue; /* for 0.001 dB measures */
  808. } __attribute__ ((packed));
  809. } __attribute__ ((packed));
  810. #define MAX_DTV_STATS 4
  811. /**
  812. * struct dtv_fe_stats - store Digital TV frontend statistics
  813. *
  814. * @len: length of the statistics - if zero, stats is disabled.
  815. * @stat: array with digital TV statistics.
  816. *
  817. * On most standards, @len can either be 0 or 1. However, for ISDB, each
  818. * layer is modulated in separate. So, each layer may have its own set
  819. * of statistics. If so, stat[0] carries on a global value for the property.
  820. * Indexes 1 to 3 means layer A to B.
  821. */
  822. struct dtv_fe_stats {
  823. __u8 len;
  824. struct dtv_stats stat[MAX_DTV_STATS];
  825. } __attribute__ ((packed));
  826. /**
  827. * struct dtv_property - store one of frontend command and its value
  828. *
  829. * @cmd: Digital TV command.
  830. * @reserved: Not used.
  831. * @u: Union with the values for the command.
  832. * @u.data: A unsigned 32 bits integer with command value.
  833. * @u.buffer: Struct to store bigger properties.
  834. * Currently unused.
  835. * @u.buffer.data: an unsigned 32-bits array.
  836. * @u.buffer.len: number of elements of the buffer.
  837. * @u.buffer.reserved1: Reserved.
  838. * @u.buffer.reserved2: Reserved.
  839. * @u.st: a &struct dtv_fe_stats array of statistics.
  840. * @result: Currently unused.
  841. *
  842. */
  843. struct dtv_property {
  844. __u32 cmd;
  845. __u32 reserved[3];
  846. union {
  847. __u32 data;
  848. struct dtv_fe_stats st;
  849. struct {
  850. __u8 data[32];
  851. __u32 len;
  852. __u32 reserved1[3];
  853. void *reserved2;
  854. } buffer;
  855. } u;
  856. int result;
  857. } __attribute__ ((packed));
  858. /* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
  859. #define DTV_IOCTL_MAX_MSGS 64
  860. /**
  861. * struct dtv_properties - a set of command/value pairs.
  862. *
  863. * @num: amount of commands stored at the struct.
  864. * @props: a pointer to &struct dtv_property.
  865. */
  866. struct dtv_properties {
  867. __u32 num;
  868. struct dtv_property *props;
  869. };
  870. /*
  871. * When set, this flag will disable any zigzagging or other "normal" tuning
  872. * behavior. Additionally, there will be no automatic monitoring of the lock
  873. * status, and hence no frontend events will be generated. If a frontend device
  874. * is closed, this flag will be automatically turned off when the device is
  875. * reopened read-write.
  876. */
  877. #define FE_TUNE_MODE_ONESHOT 0x01
  878. /* Digital TV Frontend API calls */
  879. #define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)
  880. #define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)
  881. #define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)
  882. #define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
  883. #define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */
  884. #define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */
  885. #define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */
  886. #define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */
  887. #define FE_READ_STATUS _IOR('o', 69, fe_status_t)
  888. #define FE_READ_BER _IOR('o', 70, __u32)
  889. #define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16)
  890. #define FE_READ_SNR _IOR('o', 72, __u16)
  891. #define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
  892. #define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */
  893. #define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
  894. #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
  895. #define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties)
  896. #define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties)
  897. /*
  898. * DEPRECATED: Everything below is deprecated in favor of DVBv5 API
  899. *
  900. * The DVBv3 only ioctls, structs and enums should not be used on
  901. * newer programs, as it doesn't support the second generation of
  902. * digital TV standards, nor supports newer delivery systems.
  903. * They also don't support modern frontends with usually support multiple
  904. * delivery systems.
  905. *
  906. * Drivers shouldn't use them.
  907. *
  908. * New applications should use DVBv5 delivery system instead
  909. */
  910. /*
  911. */
  912. enum fe_bandwidth {
  913. BANDWIDTH_8_MHZ,
  914. BANDWIDTH_7_MHZ,
  915. BANDWIDTH_6_MHZ,
  916. BANDWIDTH_AUTO,
  917. BANDWIDTH_5_MHZ,
  918. BANDWIDTH_10_MHZ,
  919. BANDWIDTH_1_712_MHZ,
  920. };
  921. /* This is kept for legacy userspace support */
  922. typedef enum fe_sec_voltage fe_sec_voltage_t;
  923. typedef enum fe_caps fe_caps_t;
  924. typedef enum fe_type fe_type_t;
  925. typedef enum fe_sec_tone_mode fe_sec_tone_mode_t;
  926. typedef enum fe_sec_mini_cmd fe_sec_mini_cmd_t;
  927. typedef enum fe_status fe_status_t;
  928. typedef enum fe_spectral_inversion fe_spectral_inversion_t;
  929. typedef enum fe_code_rate fe_code_rate_t;
  930. typedef enum fe_modulation fe_modulation_t;
  931. typedef enum fe_transmit_mode fe_transmit_mode_t;
  932. typedef enum fe_bandwidth fe_bandwidth_t;
  933. typedef enum fe_guard_interval fe_guard_interval_t;
  934. typedef enum fe_hierarchy fe_hierarchy_t;
  935. typedef enum fe_pilot fe_pilot_t;
  936. typedef enum fe_rolloff fe_rolloff_t;
  937. typedef enum fe_delivery_system fe_delivery_system_t;
  938. /* DVBv3 structs */
  939. struct dvb_qpsk_parameters {
  940. __u32 symbol_rate; /* symbol rate in Symbols per second */
  941. fe_code_rate_t fec_inner; /* forward error correction (see above) */
  942. };
  943. struct dvb_qam_parameters {
  944. __u32 symbol_rate; /* symbol rate in Symbols per second */
  945. fe_code_rate_t fec_inner; /* forward error correction (see above) */
  946. fe_modulation_t modulation; /* modulation type (see above) */
  947. };
  948. struct dvb_vsb_parameters {
  949. fe_modulation_t modulation; /* modulation type (see above) */
  950. };
  951. struct dvb_ofdm_parameters {
  952. fe_bandwidth_t bandwidth;
  953. fe_code_rate_t code_rate_HP; /* high priority stream code rate */
  954. fe_code_rate_t code_rate_LP; /* low priority stream code rate */
  955. fe_modulation_t constellation; /* modulation type (see above) */
  956. fe_transmit_mode_t transmission_mode;
  957. fe_guard_interval_t guard_interval;
  958. fe_hierarchy_t hierarchy_information;
  959. };
  960. struct dvb_frontend_parameters {
  961. __u32 frequency; /* (absolute) frequency in Hz for DVB-C/DVB-T/ATSC */
  962. /* intermediate frequency in kHz for DVB-S */
  963. fe_spectral_inversion_t inversion;
  964. union {
  965. struct dvb_qpsk_parameters qpsk; /* DVB-S */
  966. struct dvb_qam_parameters qam; /* DVB-C */
  967. struct dvb_ofdm_parameters ofdm; /* DVB-T */
  968. struct dvb_vsb_parameters vsb; /* ATSC */
  969. } u;
  970. };
  971. struct dvb_frontend_event {
  972. fe_status_t status;
  973. struct dvb_frontend_parameters parameters;
  974. };
  975. /* DVBv3 API calls */
  976. #define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)
  977. #define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
  978. #endif /*_DVBFRONTEND_H_*/