frontend.h 29 KB

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