blob: 16a318fc469a8de2676f1997698e8b871cea7ba1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * frontend.h
3 *
4 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
5 * Ralph Metzler <ralph@convergence.de>
6 * Holger Waechtler <holger@convergence.de>
7 * Andre Draszik <ad@convergence.de>
8 * for convergence integrated media GmbH
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public License
12 * as published by the Free Software Foundation; either version 2.1
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 *
24 */
25
26#ifndef _DVBFRONTEND_H_
27#define _DVBFRONTEND_H_
28
Jaswinder Singh Rajputde189f02009-01-30 19:56:41 +053029#include <linux/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -040031/**
32 * enum fe_caps - Frontend capabilities
33 *
34 * @FE_IS_STUPID: There's something wrong at the
35 * frontend, and it can't report its
36 * capabilities.
37 * @FE_CAN_INVERSION_AUTO: Can auto-detect frequency spectral
38 * band inversion
39 * @FE_CAN_FEC_1_2: Supports FEC 1/2
40 * @FE_CAN_FEC_2_3: Supports FEC 2/3
41 * @FE_CAN_FEC_3_4: Supports FEC 3/4
42 * @FE_CAN_FEC_4_5: Supports FEC 4/5
43 * @FE_CAN_FEC_5_6: Supports FEC 5/6
44 * @FE_CAN_FEC_6_7: Supports FEC 6/7
45 * @FE_CAN_FEC_7_8: Supports FEC 7/8
46 * @FE_CAN_FEC_8_9: Supports FEC 8/9
47 * @FE_CAN_FEC_AUTO: Can auto-detect FEC
48 * @FE_CAN_QPSK: Supports QPSK modulation
49 * @FE_CAN_QAM_16: Supports 16-QAM modulation
50 * @FE_CAN_QAM_32: Supports 32-QAM modulation
51 * @FE_CAN_QAM_64: Supports 64-QAM modulation
52 * @FE_CAN_QAM_128: Supports 128-QAM modulation
53 * @FE_CAN_QAM_256: Supports 256-QAM modulation
54 * @FE_CAN_QAM_AUTO: Can auto-detect QAM modulation
55 * @FE_CAN_TRANSMISSION_MODE_AUTO: Can auto-detect transmission mode
56 * @FE_CAN_BANDWIDTH_AUTO: Can auto-detect bandwidth
57 * @FE_CAN_GUARD_INTERVAL_AUTO: Can auto-detect guard interval
58 * @FE_CAN_HIERARCHY_AUTO: Can auto-detect hierarchy
59 * @FE_CAN_8VSB: Supports 8-VSB modulation
60 * @FE_CAN_16VSB: Supporta 16-VSB modulation
61 * @FE_HAS_EXTENDED_CAPS: Unused
62 * @FE_CAN_MULTISTREAM: Supports multistream filtering
63 * @FE_CAN_TURBO_FEC: Supports "turbo FEC" modulation
64 * @FE_CAN_2G_MODULATION: Supports "2nd generation" modulation,
65 * e. g. DVB-S2, DVB-T2, DVB-C2
66 * @FE_NEEDS_BENDING: Unused
67 * @FE_CAN_RECOVER: Can recover from a cable unplug
68 * automatically
69 * @FE_CAN_MUTE_TS: Can stop spurious TS data output
70 */
Mauro Carvalho Chehab97f411d2015-05-26 07:34:21 -030071enum fe_caps {
Linus Torvalds1da177e2005-04-16 15:20:36 -070072 FE_IS_STUPID = 0,
73 FE_CAN_INVERSION_AUTO = 0x1,
74 FE_CAN_FEC_1_2 = 0x2,
75 FE_CAN_FEC_2_3 = 0x4,
76 FE_CAN_FEC_3_4 = 0x8,
77 FE_CAN_FEC_4_5 = 0x10,
78 FE_CAN_FEC_5_6 = 0x20,
79 FE_CAN_FEC_6_7 = 0x40,
80 FE_CAN_FEC_7_8 = 0x80,
81 FE_CAN_FEC_8_9 = 0x100,
82 FE_CAN_FEC_AUTO = 0x200,
83 FE_CAN_QPSK = 0x400,
84 FE_CAN_QAM_16 = 0x800,
85 FE_CAN_QAM_32 = 0x1000,
86 FE_CAN_QAM_64 = 0x2000,
87 FE_CAN_QAM_128 = 0x4000,
88 FE_CAN_QAM_256 = 0x8000,
89 FE_CAN_QAM_AUTO = 0x10000,
90 FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
91 FE_CAN_BANDWIDTH_AUTO = 0x40000,
92 FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
93 FE_CAN_HIERARCHY_AUTO = 0x100000,
94 FE_CAN_8VSB = 0x200000,
95 FE_CAN_16VSB = 0x400000,
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -040096 FE_HAS_EXTENDED_CAPS = 0x800000,
97 FE_CAN_MULTISTREAM = 0x4000000,
98 FE_CAN_TURBO_FEC = 0x8000000,
99 FE_CAN_2G_MODULATION = 0x10000000,
100 FE_NEEDS_BENDING = 0x20000000,
101 FE_CAN_RECOVER = 0x40000000,
102 FE_CAN_MUTE_TS = 0x80000000
Mauro Carvalho Chehab97f411d2015-05-26 07:34:21 -0300103};
104
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400105/*
106 * DEPRECATED: Should be kept just due to backward compatibility.
107 */
108enum fe_type {
109 FE_QPSK,
110 FE_QAM,
111 FE_OFDM,
112 FE_ATSC
113};
114
115/**
116 * struct dvb_frontend_info - Frontend properties and capabilities
117 *
118 * @name: Name of the frontend
119 * @type: **DEPRECATED**.
120 * Should not be used on modern programs,
121 * as a frontend may have more than one type.
122 * In order to get the support types of a given
123 * frontend, use :c:type:`DTV_ENUM_DELSYS`
124 * instead.
125 * @frequency_min: Minimal frequency supported by the frontend.
126 * @frequency_max: Minimal frequency supported by the frontend.
127 * @frequency_stepsize: All frequencies are multiple of this value.
128 * @frequency_tolerance: Frequency tolerance.
129 * @symbol_rate_min: Minimal symbol rate, in bauds
130 * (for Cable/Satellite systems).
131 * @symbol_rate_max: Maximal symbol rate, in bauds
132 * (for Cable/Satellite systems).
133 * @symbol_rate_tolerance: Maximal symbol rate tolerance, in ppm
134 * (for Cable/Satellite systems).
135 * @notifier_delay: **DEPRECATED**. Not used by any driver.
136 * @caps: Capabilities supported by the frontend,
137 * as specified in &enum fe_caps.
138 *
139 * .. note:
140 *
141 * #. The frequencies are specified in Hz for Terrestrial and Cable
142 * systems.
143 * #. The frequencies are specified in kHz for Satellite systems.
144 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145struct dvb_frontend_info {
146 char name[128];
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300147 enum fe_type type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148 __u32 frequency_min;
149 __u32 frequency_max;
150 __u32 frequency_stepsize;
151 __u32 frequency_tolerance;
152 __u32 symbol_rate_min;
153 __u32 symbol_rate_max;
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400154 __u32 symbol_rate_tolerance;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155 __u32 notifier_delay; /* DEPRECATED */
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300156 enum fe_caps caps;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157};
158
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159/**
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400160 * struct dvb_diseqc_master_cmd - DiSEqC master command
161 *
162 * @msg:
163 * DiSEqC message to be sent. It contains a 3 bytes header with:
164 * framing + address + command, and an optional argument
165 * of up to 3 bytes of data.
166 * @msg_len:
167 * Length of the DiSEqC message. Valid values are 3 to 6.
168 *
169 * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
170 * the possible messages that can be used.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171 */
172struct dvb_diseqc_master_cmd {
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400173 __u8 msg[6];
174 __u8 msg_len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175};
176
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400177/**
178 * struct dvb_diseqc_slave_reply - DiSEqC received data
179 *
180 * @msg:
181 * DiSEqC message buffer to store a message received via DiSEqC.
182 * It contains one byte header with: framing and
183 * an optional argument of up to 3 bytes of data.
184 * @msg_len:
185 * Length of the DiSEqC message. Valid values are 0 to 4,
186 * where 0 means no message.
187 * @timeout:
188 * Return from ioctl after timeout ms with errorcode when
189 * no message was received.
190 *
191 * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
192 * the possible messages that can be used.
193 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194struct dvb_diseqc_slave_reply {
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400195 __u8 msg[4];
196 __u8 msg_len;
197 int timeout;
198};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400200/**
201 * enum fe_sec_voltage - DC Voltage used to feed the LNBf
202 *
203 * @SEC_VOLTAGE_13: Output 13V to the LNBf
204 * @SEC_VOLTAGE_18: Output 18V to the LNBf
205 * @SEC_VOLTAGE_OFF: Don't feed the LNBf with a DC voltage
206 */
Mauro Carvalho Chehabd6b6d342015-05-26 19:33:58 -0300207enum fe_sec_voltage {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208 SEC_VOLTAGE_13,
209 SEC_VOLTAGE_18,
210 SEC_VOLTAGE_OFF
Mauro Carvalho Chehabd6b6d342015-05-26 19:33:58 -0300211};
212
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400213/**
214 * enum fe_sec_tone_mode - Type of tone to be send to the LNBf.
215 * @SEC_TONE_ON: Sends a 22kHz tone burst to the antenna.
216 * @SEC_TONE_OFF: Don't send a 22kHz tone to the antenna (except
217 * if the ``FE_DISEQC_*`` ioctls are called).
218 */
Mauro Carvalho Chehab6dc59e72015-05-27 07:15:50 -0300219enum fe_sec_tone_mode {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220 SEC_TONE_ON,
221 SEC_TONE_OFF
Mauro Carvalho Chehab6dc59e72015-05-27 07:15:50 -0300222};
223
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400224/**
225 * enum fe_sec_mini_cmd - Type of mini burst to be sent
226 *
227 * @SEC_MINI_A: Sends a mini-DiSEqC 22kHz '0' Tone Burst to select
228 * satellite-A
229 * @SEC_MINI_B: Sends a mini-DiSEqC 22kHz '1' Data Burst to select
230 * satellite-B
231 */
Mauro Carvalho Chehab81959d92015-05-27 22:20:14 -0300232enum fe_sec_mini_cmd {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233 SEC_MINI_A,
234 SEC_MINI_B
Mauro Carvalho Chehab81959d92015-05-27 22:20:14 -0300235};
236
Mauro Carvalho Chehab0d27bbf2012-08-13 17:03:12 -0300237/**
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400238 * enum fe_status - Enumerates the possible frontend status.
239 * @FE_NONE: The frontend doesn't have any kind of lock.
240 * That's the initial frontend status
241 * @FE_HAS_SIGNAL: Has found something above the noise level.
242 * @FE_HAS_CARRIER: Has found a DVB signal.
243 * @FE_HAS_VITERBI: FEC inner coding (Viterbi, LDPC or other inner code).
244 * is stable.
245 * @FE_HAS_SYNC: Synchronization bytes was found.
246 * @FE_HAS_LOCK: DVB were locked and everything is working.
247 * @FE_TIMEDOUT: Fo lock within the last about 2 seconds.
248 * @FE_REINIT: Frontend was reinitialized, application is recommended
249 * to reset DiSEqC, tone and parameters.
Mauro Carvalho Chehab0d27bbf2012-08-13 17:03:12 -0300250 */
Mauro Carvalho Chehab97f411d2015-05-26 07:34:21 -0300251enum fe_status {
Colin Ian Kinga9e49982017-07-20 18:12:07 -0400252 FE_NONE = 0x00,
Mauro Carvalho Chehab0d27bbf2012-08-13 17:03:12 -0300253 FE_HAS_SIGNAL = 0x01,
254 FE_HAS_CARRIER = 0x02,
255 FE_HAS_VITERBI = 0x04,
256 FE_HAS_SYNC = 0x08,
257 FE_HAS_LOCK = 0x10,
258 FE_TIMEDOUT = 0x20,
259 FE_REINIT = 0x40,
Mauro Carvalho Chehab97f411d2015-05-26 07:34:21 -0300260};
261
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400262/**
263 * enum fe_spectral_inversion - Type of inversion band
264 *
265 * @INVERSION_OFF: Don't do spectral band inversion.
266 * @INVERSION_ON: Do spectral band inversion.
267 * @INVERSION_AUTO: Autodetect spectral band inversion.
268 *
269 * This parameter indicates if spectral inversion should be presumed or
270 * not. In the automatic setting (``INVERSION_AUTO``) the hardware will try
271 * to figure out the correct setting by itself. If the hardware doesn't
272 * support, the DVB core will try to lock at the carrier first with
273 * inversion off. If it fails, it will try to enable inversion.
274 */
Mauro Carvalho Chehab58e11cc2015-05-28 20:00:43 -0300275enum fe_spectral_inversion {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 INVERSION_OFF,
277 INVERSION_ON,
278 INVERSION_AUTO
Mauro Carvalho Chehab58e11cc2015-05-28 20:00:43 -0300279};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400281/**
282 * enum fe_code_rate - Type of Forward Error Correction (FEC)
283 *
284 *
285 * @FEC_NONE: No Forward Error Correction Code
286 * @FEC_1_2: Forward Error Correction Code 1/2
287 * @FEC_2_3: Forward Error Correction Code 2/3
288 * @FEC_3_4: Forward Error Correction Code 3/4
289 * @FEC_4_5: Forward Error Correction Code 4/5
290 * @FEC_5_6: Forward Error Correction Code 5/6
291 * @FEC_6_7: Forward Error Correction Code 6/7
292 * @FEC_7_8: Forward Error Correction Code 7/8
293 * @FEC_8_9: Forward Error Correction Code 8/9
294 * @FEC_AUTO: Autodetect Error Correction Code
295 * @FEC_3_5: Forward Error Correction Code 3/5
296 * @FEC_9_10: Forward Error Correction Code 9/10
297 * @FEC_2_5: Forward Error Correction Code 2/5
298 *
299 * Please note that not all FEC types are supported by a given standard.
300 */
Mauro Carvalho Chehab2d457b82015-05-28 21:38:44 -0300301enum fe_code_rate {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 FEC_NONE = 0,
303 FEC_1_2,
304 FEC_2_3,
305 FEC_3_4,
306 FEC_4_5,
307 FEC_5_6,
308 FEC_6_7,
309 FEC_7_8,
310 FEC_8_9,
Steven Toth6b73eea2008-09-04 01:12:25 -0300311 FEC_AUTO,
312 FEC_3_5,
313 FEC_9_10,
Antti Palosaari224b6642012-08-12 22:33:21 -0300314 FEC_2_5,
Mauro Carvalho Chehab2d457b82015-05-28 21:38:44 -0300315};
316
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400317/**
318 * enum fe_modulation - Type of modulation/constellation
319 * @QPSK: QPSK modulation
320 * @QAM_16: 16-QAM modulation
321 * @QAM_32: 32-QAM modulation
322 * @QAM_64: 64-QAM modulation
323 * @QAM_128: 128-QAM modulation
324 * @QAM_256: 256-QAM modulation
325 * @QAM_AUTO: Autodetect QAM modulation
326 * @VSB_8: 8-VSB modulation
327 * @VSB_16: 16-VSB modulation
328 * @PSK_8: 8-PSK modulation
329 * @APSK_16: 16-APSK modulation
330 * @APSK_32: 32-APSK modulation
331 * @DQPSK: DQPSK modulation
332 * @QAM_4_NR: 4-QAM-NR modulation
333 *
334 * Please note that not all modulations are supported by a given standard.
335 *
336 */
Mauro Carvalho Chehab997eb9032015-05-28 17:21:05 -0300337enum fe_modulation {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338 QPSK,
339 QAM_16,
340 QAM_32,
341 QAM_64,
342 QAM_128,
343 QAM_256,
344 QAM_AUTO,
345 VSB_8,
Steven Toth6b73eea2008-09-04 01:12:25 -0300346 VSB_16,
Steven Toth0a6393a2008-10-06 21:06:48 -0300347 PSK_8,
348 APSK_16,
Manu Abraham97854822008-10-14 19:48:07 -0300349 APSK_32,
Steven Toth6b73eea2008-09-04 01:12:25 -0300350 DQPSK,
Antti Palosaari224b6642012-08-12 22:33:21 -0300351 QAM_4_NR,
Mauro Carvalho Chehab997eb9032015-05-28 17:21:05 -0300352};
353
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400354/**
355 * enum fe_transmit_mode - Transmission mode
356 *
357 * @TRANSMISSION_MODE_AUTO:
358 * Autodetect transmission mode. The hardware will try to find the
359 * correct FFT-size (if capable) to fill in the missing parameters.
360 * @TRANSMISSION_MODE_1K:
361 * Transmission mode 1K
362 * @TRANSMISSION_MODE_2K:
363 * Transmission mode 2K
364 * @TRANSMISSION_MODE_8K:
365 * Transmission mode 8K
366 * @TRANSMISSION_MODE_4K:
367 * Transmission mode 4K
368 * @TRANSMISSION_MODE_16K:
369 * Transmission mode 16K
370 * @TRANSMISSION_MODE_32K:
371 * Transmission mode 32K
372 * @TRANSMISSION_MODE_C1:
373 * Single Carrier (C=1) transmission mode (DTMB only)
374 * @TRANSMISSION_MODE_C3780:
375 * Multi Carrier (C=3780) transmission mode (DTMB only)
376 *
377 * Please note that not all transmission modes are supported by a given
378 * standard.
379 */
Mauro Carvalho Chehab0577a2f2015-05-28 20:52:52 -0300380enum fe_transmit_mode {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381 TRANSMISSION_MODE_2K,
382 TRANSMISSION_MODE_8K,
Patrick Boettcherb6e760f2009-08-03 14:39:15 -0300383 TRANSMISSION_MODE_AUTO,
Andreas Oberritter94d56ff2011-05-12 18:11:06 -0300384 TRANSMISSION_MODE_4K,
385 TRANSMISSION_MODE_1K,
386 TRANSMISSION_MODE_16K,
387 TRANSMISSION_MODE_32K,
Antti Palosaari224b6642012-08-12 22:33:21 -0300388 TRANSMISSION_MODE_C1,
389 TRANSMISSION_MODE_C3780,
Mauro Carvalho Chehab0577a2f2015-05-28 20:52:52 -0300390};
391
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400392/**
393 * enum fe_guard_interval - Guard interval
394 *
395 * @GUARD_INTERVAL_AUTO: Autodetect the guard interval
396 * @GUARD_INTERVAL_1_128: Guard interval 1/128
397 * @GUARD_INTERVAL_1_32: Guard interval 1/32
398 * @GUARD_INTERVAL_1_16: Guard interval 1/16
399 * @GUARD_INTERVAL_1_8: Guard interval 1/8
400 * @GUARD_INTERVAL_1_4: Guard interval 1/4
401 * @GUARD_INTERVAL_19_128: Guard interval 19/128
402 * @GUARD_INTERVAL_19_256: Guard interval 19/256
403 * @GUARD_INTERVAL_PN420: PN length 420 (1/4)
404 * @GUARD_INTERVAL_PN595: PN length 595 (1/6)
405 * @GUARD_INTERVAL_PN945: PN length 945 (1/9)
406 *
407 * Please note that not all guard intervals are supported by a given standard.
408 */
Mauro Carvalho Chehab903142e2015-05-28 22:01:41 -0300409enum fe_guard_interval {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700410 GUARD_INTERVAL_1_32,
411 GUARD_INTERVAL_1_16,
412 GUARD_INTERVAL_1_8,
413 GUARD_INTERVAL_1_4,
Andreas Oberritter94d56ff2011-05-12 18:11:06 -0300414 GUARD_INTERVAL_AUTO,
415 GUARD_INTERVAL_1_128,
416 GUARD_INTERVAL_19_128,
417 GUARD_INTERVAL_19_256,
Antti Palosaari224b6642012-08-12 22:33:21 -0300418 GUARD_INTERVAL_PN420,
419 GUARD_INTERVAL_PN595,
420 GUARD_INTERVAL_PN945,
Mauro Carvalho Chehab903142e2015-05-28 22:01:41 -0300421};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400423/**
424 * enum fe_hierarchy - Hierarchy
425 * @HIERARCHY_NONE: No hierarchy
426 * @HIERARCHY_AUTO: Autodetect hierarchy (if supported)
427 * @HIERARCHY_1: Hierarchy 1
428 * @HIERARCHY_2: Hierarchy 2
429 * @HIERARCHY_4: Hierarchy 4
430 *
431 * Please note that not all hierarchy types are supported by a given standard.
432 */
Mauro Carvalho Chehab9df4fc52015-05-28 22:06:56 -0300433enum fe_hierarchy {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434 HIERARCHY_NONE,
435 HIERARCHY_1,
436 HIERARCHY_2,
437 HIERARCHY_4,
438 HIERARCHY_AUTO
Mauro Carvalho Chehab9df4fc52015-05-28 22:06:56 -0300439};
440
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400441/**
442 * enum fe_interleaving - Interleaving
443 * @INTERLEAVING_NONE: No interleaving.
444 * @INTERLEAVING_AUTO: Auto-detect interleaving.
445 * @INTERLEAVING_240: Interleaving of 240 symbols.
446 * @INTERLEAVING_720: Interleaving of 720 symbols.
447 *
448 * Please note that, currently, only DTMB uses it.
449 */
Antti Palosaari224b6642012-08-12 22:33:21 -0300450enum fe_interleaving {
451 INTERLEAVING_NONE,
Antti Palosaari8746add2012-08-12 22:33:22 -0300452 INTERLEAVING_AUTO,
Antti Palosaari224b6642012-08-12 22:33:21 -0300453 INTERLEAVING_240,
454 INTERLEAVING_720,
455};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400457/* DVBv5 property Commands */
458
Steven Toth459702b2008-09-26 00:04:52 -0300459#define DTV_UNDEFINED 0
460#define DTV_TUNE 1
461#define DTV_CLEAR 2
462#define DTV_FREQUENCY 3
463#define DTV_MODULATION 4
464#define DTV_BANDWIDTH_HZ 5
465#define DTV_INVERSION 6
466#define DTV_DISEQC_MASTER 7
467#define DTV_SYMBOL_RATE 8
468#define DTV_INNER_FEC 9
469#define DTV_VOLTAGE 10
470#define DTV_TONE 11
471#define DTV_PILOT 12
472#define DTV_ROLLOFF 13
473#define DTV_DISEQC_SLAVE_REPLY 14
Steven Toth6b73eea2008-09-04 01:12:25 -0300474
Steven Toth459702b2008-09-26 00:04:52 -0300475/* Basic enumeration set for querying unlimited capabilities */
476#define DTV_FE_CAPABILITY_COUNT 15
477#define DTV_FE_CAPABILITY 16
478#define DTV_DELIVERY_SYSTEM 17
Steven Toth75b7f942008-09-13 16:56:34 -0300479
Patrick Boettcherb6e760f2009-08-03 14:39:15 -0300480/* ISDB-T and ISDB-Tsb */
481#define DTV_ISDBT_PARTIAL_RECEPTION 18
482#define DTV_ISDBT_SOUND_BROADCASTING 19
Steven Toth6b73eea2008-09-04 01:12:25 -0300483
Patrick Boettcherb6e760f2009-08-03 14:39:15 -0300484#define DTV_ISDBT_SB_SUBCHANNEL_ID 20
485#define DTV_ISDBT_SB_SEGMENT_IDX 21
486#define DTV_ISDBT_SB_SEGMENT_COUNT 22
487
488#define DTV_ISDBT_LAYERA_FEC 23
489#define DTV_ISDBT_LAYERA_MODULATION 24
490#define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25
491#define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26
492
493#define DTV_ISDBT_LAYERB_FEC 27
494#define DTV_ISDBT_LAYERB_MODULATION 28
495#define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29
496#define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30
497
498#define DTV_ISDBT_LAYERC_FEC 31
499#define DTV_ISDBT_LAYERC_MODULATION 32
500#define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33
501#define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34
502
503#define DTV_API_VERSION 35
504
505#define DTV_CODE_RATE_HP 36
506#define DTV_CODE_RATE_LP 37
507#define DTV_GUARD_INTERVAL 38
508#define DTV_TRANSMISSION_MODE 39
509#define DTV_HIERARCHY 40
510
511#define DTV_ISDBT_LAYER_ENABLED 41
512
Evgeny Plehov287cefd2012-09-13 10:13:30 -0300513#define DTV_STREAM_ID 42
514#define DTV_ISDBS_TS_ID_LEGACY DTV_STREAM_ID
515#define DTV_DVBT2_PLP_ID_LEGACY 43
Andreas Oberritter94d56ff2011-05-12 18:11:06 -0300516
Manu Abrahamba2780c2011-11-13 18:47:44 -0300517#define DTV_ENUM_DELSYS 44
518
Michael Krufkyca689482012-01-29 15:44:58 -0300519/* ATSC-MH */
520#define DTV_ATSCMH_FIC_VER 45
521#define DTV_ATSCMH_PARADE_ID 46
522#define DTV_ATSCMH_NOG 47
523#define DTV_ATSCMH_TNOG 48
524#define DTV_ATSCMH_SGN 49
525#define DTV_ATSCMH_PRC 50
526#define DTV_ATSCMH_RS_FRAME_MODE 51
527#define DTV_ATSCMH_RS_FRAME_ENSEMBLE 52
528#define DTV_ATSCMH_RS_CODE_MODE_PRI 53
529#define DTV_ATSCMH_RS_CODE_MODE_SEC 54
530#define DTV_ATSCMH_SCCC_BLOCK_MODE 55
531#define DTV_ATSCMH_SCCC_CODE_MODE_A 56
532#define DTV_ATSCMH_SCCC_CODE_MODE_B 57
533#define DTV_ATSCMH_SCCC_CODE_MODE_C 58
534#define DTV_ATSCMH_SCCC_CODE_MODE_D 59
Michael Krufkyca689482012-01-29 15:44:58 -0300535
Antti Palosaari224b6642012-08-12 22:33:21 -0300536#define DTV_INTERLEAVING 60
Antti Palosaari8a2697a2012-07-11 21:54:50 -0300537#define DTV_LNA 61
Antti Palosaari224b6642012-08-12 22:33:21 -0300538
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300539/* Quality parameters */
540#define DTV_STAT_SIGNAL_STRENGTH 62
541#define DTV_STAT_CNR 63
542#define DTV_STAT_PRE_ERROR_BIT_COUNT 64
543#define DTV_STAT_PRE_TOTAL_BIT_COUNT 65
544#define DTV_STAT_POST_ERROR_BIT_COUNT 66
545#define DTV_STAT_POST_TOTAL_BIT_COUNT 67
546#define DTV_STAT_ERROR_BLOCK_COUNT 68
547#define DTV_STAT_TOTAL_BLOCK_COUNT 69
548
549#define DTV_MAX_COMMAND DTV_STAT_TOTAL_BLOCK_COUNT
Steven Toth82d76692008-10-06 20:44:04 -0300550
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400551/**
552 * enum fe_pilot - Type of pilot tone
553 *
554 * @PILOT_ON: Pilot tones enabled
555 * @PILOT_OFF: Pilot tones disabled
556 * @PILOT_AUTO: Autodetect pilot tones
557 */
Mauro Carvalho Chehab448bac12015-06-07 11:18:16 -0300558enum fe_pilot {
Steven Toth6b73eea2008-09-04 01:12:25 -0300559 PILOT_ON,
560 PILOT_OFF,
561 PILOT_AUTO,
Mauro Carvalho Chehab448bac12015-06-07 11:18:16 -0300562};
563
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400564/**
565 * enum fe_rolloff - Rolloff factor (also known as alpha)
566 * @ROLLOFF_35: Roloff factor: 35%
567 * @ROLLOFF_20: Roloff factor: 20%
568 * @ROLLOFF_25: Roloff factor: 25%
569 * @ROLLOFF_AUTO: Auto-detect the roloff factor.
570 *
571 * .. note:
572 *
573 * Roloff factor of 35% is implied on DVB-S. On DVB-S2, it is default.
574 */
Mauro Carvalho Chehabb35f6ba2015-06-07 11:59:27 -0300575enum fe_rolloff {
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400576 ROLLOFF_35,
Steven Toth6b73eea2008-09-04 01:12:25 -0300577 ROLLOFF_20,
578 ROLLOFF_25,
Steven Toth6b73eea2008-09-04 01:12:25 -0300579 ROLLOFF_AUTO,
Mauro Carvalho Chehabb35f6ba2015-06-07 11:59:27 -0300580};
581
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400582/**
583 * enum fe_delivery_system - Type of the delivery system
584 *
585 * @SYS_UNDEFINED:
586 * Undefined standard. Generally, indicates an error
587 * @SYS_DVBC_ANNEX_A:
588 * Cable TV: DVB-C following ITU-T J.83 Annex A spec
589 * @SYS_DVBC_ANNEX_B:
590 * Cable TV: DVB-C following ITU-T J.83 Annex B spec (ClearQAM)
591 * @SYS_DVBC_ANNEX_C:
592 * Cable TV: DVB-C following ITU-T J.83 Annex C spec
593 * @SYS_ISDBC:
594 * Cable TV: ISDB-C (no drivers yet)
595 * @SYS_DVBT:
596 * Terrestrial TV: DVB-T
597 * @SYS_DVBT2:
598 * Terrestrial TV: DVB-T2
599 * @SYS_ISDBT:
600 * Terrestrial TV: ISDB-T
601 * @SYS_ATSC:
602 * Terrestrial TV: ATSC
603 * @SYS_ATSCMH:
604 * Terrestrial TV (mobile): ATSC-M/H
605 * @SYS_DTMB:
606 * Terrestrial TV: DTMB
607 * @SYS_DVBS:
608 * Satellite TV: DVB-S
609 * @SYS_DVBS2:
610 * Satellite TV: DVB-S2
611 * @SYS_TURBO:
612 * Satellite TV: DVB-S Turbo
613 * @SYS_ISDBS:
614 * Satellite TV: ISDB-S
615 * @SYS_DAB:
616 * Digital audio: DAB (not fully supported)
617 * @SYS_DSS:
618 * Satellite TV: DSS (not fully supported)
619 * @SYS_CMMB:
620 * Terrestrial TV (mobile): CMMB (not fully supported)
621 * @SYS_DVBH:
622 * Terrestrial TV (mobile): DVB-H (standard deprecated)
623 */
Mauro Carvalho Chehabd21ddba2015-06-07 14:21:09 -0300624enum fe_delivery_system {
Steven Toth6b73eea2008-09-04 01:12:25 -0300625 SYS_UNDEFINED,
Manu Abrahambf3b8402011-12-17 20:36:55 -0300626 SYS_DVBC_ANNEX_A,
Steven Toth6b73eea2008-09-04 01:12:25 -0300627 SYS_DVBC_ANNEX_B,
628 SYS_DVBT,
Manu Abraham5ba4ecc2008-10-14 19:50:03 -0300629 SYS_DSS,
Steven Toth6b73eea2008-09-04 01:12:25 -0300630 SYS_DVBS,
631 SYS_DVBS2,
632 SYS_DVBH,
633 SYS_ISDBT,
634 SYS_ISDBS,
635 SYS_ISDBC,
636 SYS_ATSC,
637 SYS_ATSCMH,
Antti Palosaari224b6642012-08-12 22:33:21 -0300638 SYS_DTMB,
Steven Toth6b73eea2008-09-04 01:12:25 -0300639 SYS_CMMB,
640 SYS_DAB,
Andreas Oberritter94d56ff2011-05-12 18:11:06 -0300641 SYS_DVBT2,
Andreas Oberritter83dc3142011-08-08 11:54:35 -0300642 SYS_TURBO,
Manu Abrahambf3b8402011-12-17 20:36:55 -0300643 SYS_DVBC_ANNEX_C,
Mauro Carvalho Chehabd21ddba2015-06-07 14:21:09 -0300644};
645
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400646/* backward compatibility definitions for delivery systems */
Manu Abrahambf3b8402011-12-17 20:36:55 -0300647#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400648#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB */
Manu Abrahambf3b8402011-12-17 20:36:55 -0300649
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400650/* ATSC-MH specific parameters */
Michael Krufkyca689482012-01-29 15:44:58 -0300651
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400652/**
653 * enum atscmh_sccc_block_mode - Type of Series Concatenated Convolutional
654 * Code Block Mode.
655 *
656 * @ATSCMH_SCCC_BLK_SEP:
657 * Separate SCCC: the SCCC outer code mode shall be set independently
658 * for each Group Region (A, B, C, D)
659 * @ATSCMH_SCCC_BLK_COMB:
660 * Combined SCCC: all four Regions shall have the same SCCC outer
661 * code mode.
662 * @ATSCMH_SCCC_BLK_RES:
663 * Reserved. Shouldn't be used.
664 */
Michael Krufkyca689482012-01-29 15:44:58 -0300665enum atscmh_sccc_block_mode {
666 ATSCMH_SCCC_BLK_SEP = 0,
667 ATSCMH_SCCC_BLK_COMB = 1,
668 ATSCMH_SCCC_BLK_RES = 2,
669};
670
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400671/**
672 * enum atscmh_sccc_code_mode - Type of Series Concatenated Convolutional
673 * Code Rate.
674 *
675 * @ATSCMH_SCCC_CODE_HLF:
676 * The outer code rate of a SCCC Block is 1/2 rate.
677 * @ATSCMH_SCCC_CODE_QTR:
678 * The outer code rate of a SCCC Block is 1/4 rate.
679 * @ATSCMH_SCCC_CODE_RES:
680 * Reserved. Should not be used.
681 */
Michael Krufkyca689482012-01-29 15:44:58 -0300682enum atscmh_sccc_code_mode {
683 ATSCMH_SCCC_CODE_HLF = 0,
684 ATSCMH_SCCC_CODE_QTR = 1,
685 ATSCMH_SCCC_CODE_RES = 2,
686};
687
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400688/**
689 * enum atscmh_rs_frame_ensemble - Reed Solomon(RS) frame ensemble.
690 *
691 * @ATSCMH_RSFRAME_ENS_PRI: Primary Ensemble.
692 * @ATSCMH_RSFRAME_ENS_SEC: Secondary Ensemble.
693 */
Michael Krufkyca689482012-01-29 15:44:58 -0300694enum atscmh_rs_frame_ensemble {
695 ATSCMH_RSFRAME_ENS_PRI = 0,
696 ATSCMH_RSFRAME_ENS_SEC = 1,
697};
698
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400699/**
700 * enum atscmh_rs_frame_mode - Reed Solomon (RS) frame mode.
701 *
702 * @ATSCMH_RSFRAME_PRI_ONLY:
703 * Single Frame: There is only a primary RS Frame for all Group
704 * Regions.
705 * @ATSCMH_RSFRAME_PRI_SEC:
706 * Dual Frame: There are two separate RS Frames: Primary RS Frame for
707 * Group Region A and B and Secondary RS Frame for Group Region C and
708 * D.
709 * @ATSCMH_RSFRAME_RES:
710 * Reserved. Shouldn't be used.
711 */
Michael Krufkyca689482012-01-29 15:44:58 -0300712enum atscmh_rs_frame_mode {
713 ATSCMH_RSFRAME_PRI_ONLY = 0,
714 ATSCMH_RSFRAME_PRI_SEC = 1,
715 ATSCMH_RSFRAME_RES = 2,
716};
717
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400718/**
719 * enum atscmh_rs_code_mode
720 * @ATSCMH_RSCODE_211_187: Reed Solomon code (211,187).
721 * @ATSCMH_RSCODE_223_187: Reed Solomon code (223,187).
722 * @ATSCMH_RSCODE_235_187: Reed Solomon code (235,187).
723 * @ATSCMH_RSCODE_RES: Reserved. Shouldn't be used.
724 */
Michael Krufkyca689482012-01-29 15:44:58 -0300725enum atscmh_rs_code_mode {
726 ATSCMH_RSCODE_211_187 = 0,
727 ATSCMH_RSCODE_223_187 = 1,
728 ATSCMH_RSCODE_235_187 = 2,
729 ATSCMH_RSCODE_RES = 3,
730};
731
Evgeny Plehov287cefd2012-09-13 10:13:30 -0300732#define NO_STREAM_ID_FILTER (~0U)
Antti Palosaari8a2697a2012-07-11 21:54:50 -0300733#define LNA_AUTO (~0U)
Manu Abrahambf3b8402011-12-17 20:36:55 -0300734
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300735/**
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400736 * enum fecap_scale_params - scale types for the quality parameters.
737 *
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300738 * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That
739 * could indicate a temporary or a permanent
740 * condition.
David Howells4c12ada2015-04-09 16:36:49 -0300741 * @FE_SCALE_DECIBEL: The scale is measured in 0.001 dB steps, typically
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400742 * used on signal measures.
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300743 * @FE_SCALE_RELATIVE: The scale is a relative percentual measure,
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400744 * ranging from 0 (0%) to 0xffff (100%).
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300745 * @FE_SCALE_COUNTER: The scale counts the occurrence of an event, like
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400746 * bit error, block error, lapsed time.
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300747 */
748enum fecap_scale_params {
749 FE_SCALE_NOT_AVAILABLE = 0,
750 FE_SCALE_DECIBEL,
751 FE_SCALE_RELATIVE,
752 FE_SCALE_COUNTER
753};
754
755/**
756 * struct dtv_stats - Used for reading a DTV status property
757 *
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300758 * @scale: Filled with enum fecap_scale_params - the scale
759 * in usage for that parameter
760 *
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400761 * The ``{unnamed_union}`` may have either one of the values below:
762 *
763 * %svalue
764 * integer value of the measure, for %FE_SCALE_DECIBEL,
765 * used for dB measures. The unit is 0.001 dB.
766 *
767 * %uvalue
768 * unsigned integer value of the measure, used when @scale is
769 * either %FE_SCALE_RELATIVE or %FE_SCALE_COUNTER.
770 *
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300771 * For most delivery systems, this will return a single value for each
772 * parameter.
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400773 *
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300774 * It should be noticed, however, that new OFDM delivery systems like
775 * ISDB can use different modulation types for each group of carriers.
776 * On such standards, up to 8 groups of statistics can be provided, one
777 * for each carrier group (called "layer" on ISDB).
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400778 *
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300779 * In order to be consistent with other delivery systems, the first
780 * value refers to the entire set of carriers ("global").
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400781 *
782 * @scale should use the value %FE_SCALE_NOT_AVAILABLE when
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300783 * the value for the entire group of carriers or from one specific layer
784 * is not provided by the hardware.
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300785 *
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400786 * @len should be filled with the latest filled status + 1.
787 *
788 * In other words, for ISDB, those values should be filled like::
789 *
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300790 * u.st.stat.svalue[0] = global statistics;
Mauro Carvalho Chehab76add032015-06-07 16:28:33 -0300791 * u.st.stat.scale[0] = FE_SCALE_DECIBEL;
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300792 * u.st.stat.value[1] = layer A statistics;
793 * u.st.stat.scale[1] = FE_SCALE_NOT_AVAILABLE (if not available);
794 * u.st.stat.svalue[2] = layer B statistics;
Mauro Carvalho Chehab76add032015-06-07 16:28:33 -0300795 * u.st.stat.scale[2] = FE_SCALE_DECIBEL;
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300796 * u.st.stat.svalue[3] = layer C statistics;
Mauro Carvalho Chehab76add032015-06-07 16:28:33 -0300797 * u.st.stat.scale[3] = FE_SCALE_DECIBEL;
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300798 * u.st.len = 4;
799 */
800struct dtv_stats {
801 __u8 scale; /* enum fecap_scale_params type */
802 union {
803 __u64 uvalue; /* for counters and relative scales */
David Howells4c12ada2015-04-09 16:36:49 -0300804 __s64 svalue; /* for 0.001 dB measures */
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300805 };
806} __attribute__ ((packed));
807
808
809#define MAX_DTV_STATS 4
810
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400811/**
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 */
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300822struct dtv_fe_stats {
823 __u8 len;
824 struct dtv_stats stat[MAX_DTV_STATS];
825} __attribute__ ((packed));
826
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400827/**
828 * struct dtv_property - store one of frontend command and its value
829 *
830 * @cmd: Digital TV command.
831 * @reserved: Not used.
832 * @u: Union with the values for the command.
833 * @result: Result of the command set (currently unused).
834 *
835 * The @u union may have either one of the values below:
836 *
837 * %data
838 * an unsigned 32-bits number.
839 * %st
840 * a &struct dtv_fe_stats array of statistics.
841 * %buffer
842 * a buffer of up to 32 characters (currently unused).
843 */
Steven Tothe7fee0f32008-09-11 10:23:01 -0300844struct dtv_property {
Steven Toth6b73eea2008-09-04 01:12:25 -0300845 __u32 cmd;
Steven Tothe7fee0f32008-09-11 10:23:01 -0300846 __u32 reserved[3];
Steven Toth6b73eea2008-09-04 01:12:25 -0300847 union {
848 __u32 data;
Mauro Carvalho Chehab95697932013-01-06 12:22:06 -0300849 struct dtv_fe_stats st;
Steven Toth6b73eea2008-09-04 01:12:25 -0300850 struct {
851 __u8 data[32];
852 __u32 len;
Steven Tothe7fee0f32008-09-11 10:23:01 -0300853 __u32 reserved1[3];
854 void *reserved2;
Steven Toth6b73eea2008-09-04 01:12:25 -0300855 } buffer;
856 } u;
Steven Tothd48cb402008-09-26 00:16:25 -0300857 int result;
Steven Tothe7fee0f32008-09-11 10:23:01 -0300858} __attribute__ ((packed));
Steven Toth6b73eea2008-09-04 01:12:25 -0300859
Brandon Philipscc7d7052008-10-06 21:31:48 -0300860/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
861#define DTV_IOCTL_MAX_MSGS 64
862
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400863/**
864 * struct dtv_properties - a set of command/value pairs.
865 *
866 * @num: amount of commands stored at the struct.
867 * @props: a pointer to &struct dtv_property.
868 */
Steven Tothe7fee0f32008-09-11 10:23:01 -0300869struct dtv_properties {
870 __u32 num;
871 struct dtv_property *props;
872};
Steven Toth6b73eea2008-09-04 01:12:25 -0300873
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400874/*
875 * When set, this flag will disable any zigzagging or other "normal" tuning
876 * behavior. Additionally, there will be no automatic monitoring of the lock
877 * status, and hence no frontend events will be generated. If a frontend device
878 * is closed, this flag will be automatically turned off when the device is
879 * reopened read-write.
880 */
881#define FE_TUNE_MODE_ONESHOT 0x01
882
883/* Digital TV Frontend API calls */
884
885#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)
886
887#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)
888#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)
889#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
890#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */
891
892#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */
893#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */
894#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */
895
896#define FE_READ_STATUS _IOR('o', 69, fe_status_t)
897#define FE_READ_BER _IOR('o', 70, __u32)
898#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16)
899#define FE_READ_SNR _IOR('o', 72, __u16)
900#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
901
902#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */
903#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
904
905#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
906
907#define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties)
908#define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties)
909
Mauro Carvalho Chehabaf6392d2015-06-07 15:00:17 -0300910#if defined(__DVB_CORE__) || !defined (__KERNEL__)
911
Mauro Carvalho Chehab486ef852015-06-07 16:44:21 -0300912/*
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400913 * DEPRECATED: Everything below is deprecated in favor of DVBv5 API
914 *
915 * The DVBv3 only ioctls, structs and enums should not be used on
916 * newer programs, as it doesn't support the second generation of
917 * digital TV standards, nor supports newer delivery systems.
918 * They also don't support modern frontends with usually support multiple
919 * delivery systems.
920 *
921 * Drivers shouldn't use them.
922 *
923 * New applications should use DVBv5 delivery system instead
924 */
925
926/*
Mauro Carvalho Chehab486ef852015-06-07 16:44:21 -0300927 */
928
Mauro Carvalho Chehabaf6392d2015-06-07 15:00:17 -0300929enum fe_bandwidth {
930 BANDWIDTH_8_MHZ,
931 BANDWIDTH_7_MHZ,
932 BANDWIDTH_6_MHZ,
933 BANDWIDTH_AUTO,
934 BANDWIDTH_5_MHZ,
935 BANDWIDTH_10_MHZ,
936 BANDWIDTH_1_712_MHZ,
937};
938
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400939/* This is kept for legacy userspace support */
Mauro Carvalho Chehabb1e28ff2015-06-07 15:01:15 -0300940typedef enum fe_sec_voltage fe_sec_voltage_t;
941typedef enum fe_caps fe_caps_t;
942typedef enum fe_type fe_type_t;
943typedef enum fe_sec_tone_mode fe_sec_tone_mode_t;
944typedef enum fe_sec_mini_cmd fe_sec_mini_cmd_t;
945typedef enum fe_status fe_status_t;
946typedef enum fe_spectral_inversion fe_spectral_inversion_t;
947typedef enum fe_code_rate fe_code_rate_t;
948typedef enum fe_modulation fe_modulation_t;
949typedef enum fe_transmit_mode fe_transmit_mode_t;
Mauro Carvalho Chehabaf6392d2015-06-07 15:00:17 -0300950typedef enum fe_bandwidth fe_bandwidth_t;
Mauro Carvalho Chehabb1e28ff2015-06-07 15:01:15 -0300951typedef enum fe_guard_interval fe_guard_interval_t;
952typedef enum fe_hierarchy fe_hierarchy_t;
953typedef enum fe_pilot fe_pilot_t;
954typedef enum fe_rolloff fe_rolloff_t;
955typedef enum fe_delivery_system fe_delivery_system_t;
Mauro Carvalho Chehabaf6392d2015-06-07 15:00:17 -0300956
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -0400957/* DVBv3 structs */
958
Mauro Carvalho Chehabaf6392d2015-06-07 15:00:17 -0300959struct dvb_qpsk_parameters {
960 __u32 symbol_rate; /* symbol rate in Symbols per second */
961 fe_code_rate_t fec_inner; /* forward error correction (see above) */
962};
963
964struct dvb_qam_parameters {
965 __u32 symbol_rate; /* symbol rate in Symbols per second */
966 fe_code_rate_t fec_inner; /* forward error correction (see above) */
967 fe_modulation_t modulation; /* modulation type (see above) */
968};
969
970struct dvb_vsb_parameters {
971 fe_modulation_t modulation; /* modulation type (see above) */
972};
973
974struct dvb_ofdm_parameters {
975 fe_bandwidth_t bandwidth;
976 fe_code_rate_t code_rate_HP; /* high priority stream code rate */
977 fe_code_rate_t code_rate_LP; /* low priority stream code rate */
978 fe_modulation_t constellation; /* modulation type (see above) */
979 fe_transmit_mode_t transmission_mode;
980 fe_guard_interval_t guard_interval;
981 fe_hierarchy_t hierarchy_information;
982};
983
Mauro Carvalho Chehabaf6392d2015-06-07 15:00:17 -0300984struct dvb_frontend_parameters {
Mauro Carvalho Chehab81a7c6d2015-06-07 16:33:30 -0300985 __u32 frequency; /* (absolute) frequency in Hz for DVB-C/DVB-T/ATSC */
986 /* intermediate frequency in kHz for DVB-S */
Mauro Carvalho Chehabaf6392d2015-06-07 15:00:17 -0300987 fe_spectral_inversion_t inversion;
988 union {
Mauro Carvalho Chehab81a7c6d2015-06-07 16:33:30 -0300989 struct dvb_qpsk_parameters qpsk; /* DVB-S */
990 struct dvb_qam_parameters qam; /* DVB-C */
991 struct dvb_ofdm_parameters ofdm; /* DVB-T */
992 struct dvb_vsb_parameters vsb; /* ATSC */
Mauro Carvalho Chehabaf6392d2015-06-07 15:00:17 -0300993 } u;
994};
995
996struct dvb_frontend_event {
997 fe_status_t status;
998 struct dvb_frontend_parameters parameters;
999};
Mauro Carvalho Chehabaf6392d2015-06-07 15:00:17 -03001000
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -04001001/* DVBv3 API calls */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001002
1003#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)
1004#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001005
Mauro Carvalho Chehab8220ead2017-08-30 08:12:38 -04001006#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001007
1008#endif /*_DVBFRONTEND_H_*/