aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/dvb
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-30 08:12:38 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-09-05 05:56:18 -0400
commit8220ead805b6bab4ade2839857a198e9708b07de (patch)
tree59057cf7630ce87c09d3c94f2e2eb9eda2c91c2a /include/uapi/linux/dvb
parentf35afa4f60c868d7c7811ba747133acbf39410ac (diff)
media: dvb/frontend.h: document the uAPI file
Most of the stuff at the Digital TV frontend header file are documented only at the Documentation. However, a few kernel-doc markups are there, several of them with parsing issues. Add the missing documentation, copying definitions from the Documentation when it applies, fixing some bugs. Please notice that DVBv3 stuff that were deprecated weren't commented by purpose. Instead, they were clearly tagged as such. This patch prepares to move part of the documentation from Documentation/ to kernel-doc comments. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/uapi/linux/dvb')
-rw-r--r--include/uapi/linux/dvb/frontend.h580
1 files changed, 498 insertions, 82 deletions
diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h
index 3a80f3d1da1c..16a318fc469a 100644
--- a/include/uapi/linux/dvb/frontend.h
+++ b/include/uapi/linux/dvb/frontend.h
@@ -28,13 +28,46 @@
28 28
29#include <linux/types.h> 29#include <linux/types.h>
30 30
31enum fe_type { 31/**
32 FE_QPSK, 32 * enum fe_caps - Frontend capabilities
33 FE_QAM, 33 *
34 FE_OFDM, 34 * @FE_IS_STUPID: There's something wrong at the
35 FE_ATSC 35 * frontend, and it can't report its
36}; 36 * capabilities.
37 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 */
38enum fe_caps { 71enum fe_caps {
39 FE_IS_STUPID = 0, 72 FE_IS_STUPID = 0,
40 FE_CAN_INVERSION_AUTO = 0x1, 73 FE_CAN_INVERSION_AUTO = 0x1,
@@ -60,15 +93,55 @@ enum fe_caps {
60 FE_CAN_HIERARCHY_AUTO = 0x100000, 93 FE_CAN_HIERARCHY_AUTO = 0x100000,
61 FE_CAN_8VSB = 0x200000, 94 FE_CAN_8VSB = 0x200000,
62 FE_CAN_16VSB = 0x400000, 95 FE_CAN_16VSB = 0x400000,
63 FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ 96 FE_HAS_EXTENDED_CAPS = 0x800000,
64 FE_CAN_MULTISTREAM = 0x4000000, /* frontend supports multistream filtering */ 97 FE_CAN_MULTISTREAM = 0x4000000,
65 FE_CAN_TURBO_FEC = 0x8000000, /* frontend supports "turbo fec modulation" */ 98 FE_CAN_TURBO_FEC = 0x8000000,
66 FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ 99 FE_CAN_2G_MODULATION = 0x10000000,
67 FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ 100 FE_NEEDS_BENDING = 0x20000000,
68 FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ 101 FE_CAN_RECOVER = 0x40000000,
69 FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */ 102 FE_CAN_MUTE_TS = 0x80000000
103};
104
105/*
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
70}; 113};
71 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 */
72struct dvb_frontend_info { 145struct dvb_frontend_info {
73 char name[128]; 146 char name[128];
74 enum fe_type type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */ 147 enum fe_type type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */
@@ -78,53 +151,102 @@ struct dvb_frontend_info {
78 __u32 frequency_tolerance; 151 __u32 frequency_tolerance;
79 __u32 symbol_rate_min; 152 __u32 symbol_rate_min;
80 __u32 symbol_rate_max; 153 __u32 symbol_rate_max;
81 __u32 symbol_rate_tolerance; /* ppm */ 154 __u32 symbol_rate_tolerance;
82 __u32 notifier_delay; /* DEPRECATED */ 155 __u32 notifier_delay; /* DEPRECATED */
83 enum fe_caps caps; 156 enum fe_caps caps;
84}; 157};
85 158
86
87/** 159/**
88 * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for 160 * struct dvb_diseqc_master_cmd - DiSEqC master command
89 * the meaning of this struct... 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.
90 */ 171 */
91struct dvb_diseqc_master_cmd { 172struct dvb_diseqc_master_cmd {
92 __u8 msg [6]; /* { framing, address, command, data [3] } */ 173 __u8 msg[6];
93 __u8 msg_len; /* valid values are 3...6 */ 174 __u8 msg_len;
94}; 175};
95 176
177/**
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 */
96struct dvb_diseqc_slave_reply { 194struct dvb_diseqc_slave_reply {
97 __u8 msg [4]; /* { framing, data [3] } */ 195 __u8 msg[4];
98 __u8 msg_len; /* valid values are 0...4, 0 means no msg */ 196 __u8 msg_len;
99 int timeout; /* return from ioctl after timeout ms with */ 197 int timeout;
100}; /* errorcode when no message was received */ 198};
101 199
200/**
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 */
102enum fe_sec_voltage { 207enum fe_sec_voltage {
103 SEC_VOLTAGE_13, 208 SEC_VOLTAGE_13,
104 SEC_VOLTAGE_18, 209 SEC_VOLTAGE_18,
105 SEC_VOLTAGE_OFF 210 SEC_VOLTAGE_OFF
106}; 211};
107 212
213/**
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 */
108enum fe_sec_tone_mode { 219enum fe_sec_tone_mode {
109 SEC_TONE_ON, 220 SEC_TONE_ON,
110 SEC_TONE_OFF 221 SEC_TONE_OFF
111}; 222};
112 223
224/**
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 */
113enum fe_sec_mini_cmd { 232enum fe_sec_mini_cmd {
114 SEC_MINI_A, 233 SEC_MINI_A,
115 SEC_MINI_B 234 SEC_MINI_B
116}; 235};
117 236
118/** 237/**
119 * enum fe_status - enumerates the possible frontend status 238 * enum fe_status - Enumerates the possible frontend status.
120 * @FE_HAS_SIGNAL: found something above the noise level 239 * @FE_NONE: The frontend doesn't have any kind of lock.
121 * @FE_HAS_CARRIER: found a DVB signal 240 * That's the initial frontend status
122 * @FE_HAS_VITERBI: FEC is stable 241 * @FE_HAS_SIGNAL: Has found something above the noise level.
123 * @FE_HAS_SYNC: found sync bytes 242 * @FE_HAS_CARRIER: Has found a DVB signal.
124 * @FE_HAS_LOCK: everything's working 243 * @FE_HAS_VITERBI: FEC inner coding (Viterbi, LDPC or other inner code).
125 * @FE_TIMEDOUT: no lock within the last ~2 seconds 244 * is stable.
126 * @FE_REINIT: frontend was reinitialized, application is recommended 245 * @FE_HAS_SYNC: Synchronization bytes was found.
127 * to reset DiSEqC, tone and parameters 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.
128 */ 250 */
129enum fe_status { 251enum fe_status {
130 FE_NONE = 0x00, 252 FE_NONE = 0x00,
@@ -137,12 +259,45 @@ enum fe_status {
137 FE_REINIT = 0x40, 259 FE_REINIT = 0x40,
138}; 260};
139 261
262/**
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 */
140enum fe_spectral_inversion { 275enum fe_spectral_inversion {
141 INVERSION_OFF, 276 INVERSION_OFF,
142 INVERSION_ON, 277 INVERSION_ON,
143 INVERSION_AUTO 278 INVERSION_AUTO
144}; 279};
145 280
281/**
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 */
146enum fe_code_rate { 301enum fe_code_rate {
147 FEC_NONE = 0, 302 FEC_NONE = 0,
148 FEC_1_2, 303 FEC_1_2,
@@ -159,6 +314,26 @@ enum fe_code_rate {
159 FEC_2_5, 314 FEC_2_5,
160}; 315};
161 316
317/**
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 */
162enum fe_modulation { 337enum fe_modulation {
163 QPSK, 338 QPSK,
164 QAM_16, 339 QAM_16,
@@ -176,6 +351,32 @@ enum fe_modulation {
176 QAM_4_NR, 351 QAM_4_NR,
177}; 352};
178 353
354/**
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 */
179enum fe_transmit_mode { 380enum fe_transmit_mode {
180 TRANSMISSION_MODE_2K, 381 TRANSMISSION_MODE_2K,
181 TRANSMISSION_MODE_8K, 382 TRANSMISSION_MODE_8K,
@@ -188,6 +389,23 @@ enum fe_transmit_mode {
188 TRANSMISSION_MODE_C3780, 389 TRANSMISSION_MODE_C3780,
189}; 390};
190 391
392/**
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 */
191enum fe_guard_interval { 409enum fe_guard_interval {
192 GUARD_INTERVAL_1_32, 410 GUARD_INTERVAL_1_32,
193 GUARD_INTERVAL_1_16, 411 GUARD_INTERVAL_1_16,
@@ -202,6 +420,16 @@ enum fe_guard_interval {
202 GUARD_INTERVAL_PN945, 420 GUARD_INTERVAL_PN945,
203}; 421};
204 422
423/**
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 */
205enum fe_hierarchy { 433enum fe_hierarchy {
206 HIERARCHY_NONE, 434 HIERARCHY_NONE,
207 HIERARCHY_1, 435 HIERARCHY_1,
@@ -210,6 +438,15 @@ enum fe_hierarchy {
210 HIERARCHY_AUTO 438 HIERARCHY_AUTO
211}; 439};
212 440
441/**
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 */
213enum fe_interleaving { 450enum fe_interleaving {
214 INTERLEAVING_NONE, 451 INTERLEAVING_NONE,
215 INTERLEAVING_AUTO, 452 INTERLEAVING_AUTO,
@@ -217,7 +454,8 @@ enum fe_interleaving {
217 INTERLEAVING_720, 454 INTERLEAVING_720,
218}; 455};
219 456
220/* S2API Commands */ 457/* DVBv5 property Commands */
458
221#define DTV_UNDEFINED 0 459#define DTV_UNDEFINED 0
222#define DTV_TUNE 1 460#define DTV_TUNE 1
223#define DTV_CLEAR 2 461#define DTV_CLEAR 2
@@ -310,19 +548,79 @@ enum fe_interleaving {
310 548
311#define DTV_MAX_COMMAND DTV_STAT_TOTAL_BLOCK_COUNT 549#define DTV_MAX_COMMAND DTV_STAT_TOTAL_BLOCK_COUNT
312 550
551/**
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 */
313enum fe_pilot { 558enum fe_pilot {
314 PILOT_ON, 559 PILOT_ON,
315 PILOT_OFF, 560 PILOT_OFF,
316 PILOT_AUTO, 561 PILOT_AUTO,
317}; 562};
318 563
564/**
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 */
319enum fe_rolloff { 575enum fe_rolloff {
320 ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */ 576 ROLLOFF_35,
321 ROLLOFF_20, 577 ROLLOFF_20,
322 ROLLOFF_25, 578 ROLLOFF_25,
323 ROLLOFF_AUTO, 579 ROLLOFF_AUTO,
324}; 580};
325 581
582/**
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 */
326enum fe_delivery_system { 624enum fe_delivery_system {
327 SYS_UNDEFINED, 625 SYS_UNDEFINED,
328 SYS_DVBC_ANNEX_A, 626 SYS_DVBC_ANNEX_A,
@@ -345,35 +643,85 @@ enum fe_delivery_system {
345 SYS_DVBC_ANNEX_C, 643 SYS_DVBC_ANNEX_C,
346}; 644};
347 645
348/* backward compatibility */ 646/* backward compatibility definitions for delivery systems */
349#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A 647#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A
350#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB instead */ 648#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB */
351 649
352/* ATSC-MH */ 650/* ATSC-MH specific parameters */
353 651
652/**
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 */
354enum atscmh_sccc_block_mode { 665enum atscmh_sccc_block_mode {
355 ATSCMH_SCCC_BLK_SEP = 0, 666 ATSCMH_SCCC_BLK_SEP = 0,
356 ATSCMH_SCCC_BLK_COMB = 1, 667 ATSCMH_SCCC_BLK_COMB = 1,
357 ATSCMH_SCCC_BLK_RES = 2, 668 ATSCMH_SCCC_BLK_RES = 2,
358}; 669};
359 670
671/**
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 */
360enum atscmh_sccc_code_mode { 682enum atscmh_sccc_code_mode {
361 ATSCMH_SCCC_CODE_HLF = 0, 683 ATSCMH_SCCC_CODE_HLF = 0,
362 ATSCMH_SCCC_CODE_QTR = 1, 684 ATSCMH_SCCC_CODE_QTR = 1,
363 ATSCMH_SCCC_CODE_RES = 2, 685 ATSCMH_SCCC_CODE_RES = 2,
364}; 686};
365 687
688/**
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 */
366enum atscmh_rs_frame_ensemble { 694enum atscmh_rs_frame_ensemble {
367 ATSCMH_RSFRAME_ENS_PRI = 0, 695 ATSCMH_RSFRAME_ENS_PRI = 0,
368 ATSCMH_RSFRAME_ENS_SEC = 1, 696 ATSCMH_RSFRAME_ENS_SEC = 1,
369}; 697};
370 698
699/**
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 */
371enum atscmh_rs_frame_mode { 712enum atscmh_rs_frame_mode {
372 ATSCMH_RSFRAME_PRI_ONLY = 0, 713 ATSCMH_RSFRAME_PRI_ONLY = 0,
373 ATSCMH_RSFRAME_PRI_SEC = 1, 714 ATSCMH_RSFRAME_PRI_SEC = 1,
374 ATSCMH_RSFRAME_RES = 2, 715 ATSCMH_RSFRAME_RES = 2,
375}; 716};
376 717
718/**
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 */
377enum atscmh_rs_code_mode { 725enum atscmh_rs_code_mode {
378 ATSCMH_RSCODE_211_187 = 0, 726 ATSCMH_RSCODE_211_187 = 0,
379 ATSCMH_RSCODE_223_187 = 1, 727 ATSCMH_RSCODE_223_187 = 1,
@@ -385,16 +733,17 @@ enum atscmh_rs_code_mode {
385#define LNA_AUTO (~0U) 733#define LNA_AUTO (~0U)
386 734
387/** 735/**
388 * Scale types for the quality parameters. 736 * enum fecap_scale_params - scale types for the quality parameters.
737 *
389 * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That 738 * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That
390 * could indicate a temporary or a permanent 739 * could indicate a temporary or a permanent
391 * condition. 740 * condition.
392 * @FE_SCALE_DECIBEL: The scale is measured in 0.001 dB steps, typically 741 * @FE_SCALE_DECIBEL: The scale is measured in 0.001 dB steps, typically
393 * used on signal measures. 742 * used on signal measures.
394 * @FE_SCALE_RELATIVE: The scale is a relative percentual measure, 743 * @FE_SCALE_RELATIVE: The scale is a relative percentual measure,
395 * ranging from 0 (0%) to 0xffff (100%). 744 * ranging from 0 (0%) to 0xffff (100%).
396 * @FE_SCALE_COUNTER: The scale counts the occurrence of an event, like 745 * @FE_SCALE_COUNTER: The scale counts the occurrence of an event, like
397 * bit error, block error, lapsed time. 746 * bit error, block error, lapsed time.
398 */ 747 */
399enum fecap_scale_params { 748enum fecap_scale_params {
400 FE_SCALE_NOT_AVAILABLE = 0, 749 FE_SCALE_NOT_AVAILABLE = 0,
@@ -406,24 +755,38 @@ enum fecap_scale_params {
406/** 755/**
407 * struct dtv_stats - Used for reading a DTV status property 756 * struct dtv_stats - Used for reading a DTV status property
408 * 757 *
409 * @value: value of the measure. Should range from 0 to 0xffff;
410 * @scale: Filled with enum fecap_scale_params - the scale 758 * @scale: Filled with enum fecap_scale_params - the scale
411 * in usage for that parameter 759 * in usage for that parameter
412 * 760 *
761 * 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 *
413 * For most delivery systems, this will return a single value for each 771 * For most delivery systems, this will return a single value for each
414 * parameter. 772 * parameter.
773 *
415 * It should be noticed, however, that new OFDM delivery systems like 774 * It should be noticed, however, that new OFDM delivery systems like
416 * ISDB can use different modulation types for each group of carriers. 775 * ISDB can use different modulation types for each group of carriers.
417 * On such standards, up to 8 groups of statistics can be provided, one 776 * On such standards, up to 8 groups of statistics can be provided, one
418 * for each carrier group (called "layer" on ISDB). 777 * for each carrier group (called "layer" on ISDB).
778 *
419 * In order to be consistent with other delivery systems, the first 779 * In order to be consistent with other delivery systems, the first
420 * value refers to the entire set of carriers ("global"). 780 * value refers to the entire set of carriers ("global").
421 * dtv_status:scale should use the value FE_SCALE_NOT_AVAILABLE when 781 *
782 * @scale should use the value %FE_SCALE_NOT_AVAILABLE when
422 * the value for the entire group of carriers or from one specific layer 783 * the value for the entire group of carriers or from one specific layer
423 * is not provided by the hardware. 784 * is not provided by the hardware.
424 * st.len should be filled with the latest filled status + 1.
425 * 785 *
426 * In other words, for ISDB, those values should be filled like: 786 * @len should be filled with the latest filled status + 1.
787 *
788 * In other words, for ISDB, those values should be filled like::
789 *
427 * u.st.stat.svalue[0] = global statistics; 790 * u.st.stat.svalue[0] = global statistics;
428 * u.st.stat.scale[0] = FE_SCALE_DECIBEL; 791 * u.st.stat.scale[0] = FE_SCALE_DECIBEL;
429 * u.st.stat.value[1] = layer A statistics; 792 * u.st.stat.value[1] = layer A statistics;
@@ -445,11 +808,39 @@ struct dtv_stats {
445 808
446#define MAX_DTV_STATS 4 809#define MAX_DTV_STATS 4
447 810
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 */
448struct dtv_fe_stats { 822struct dtv_fe_stats {
449 __u8 len; 823 __u8 len;
450 struct dtv_stats stat[MAX_DTV_STATS]; 824 struct dtv_stats stat[MAX_DTV_STATS];
451} __attribute__ ((packed)); 825} __attribute__ ((packed));
452 826
827/**
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 */
453struct dtv_property { 844struct dtv_property {
454 __u32 cmd; 845 __u32 cmd;
455 __u32 reserved[3]; 846 __u32 reserved[3];
@@ -469,17 +860,70 @@ struct dtv_property {
469/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */ 860/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
470#define DTV_IOCTL_MAX_MSGS 64 861#define DTV_IOCTL_MAX_MSGS 64
471 862
863/**
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 */
472struct dtv_properties { 869struct dtv_properties {
473 __u32 num; 870 __u32 num;
474 struct dtv_property *props; 871 struct dtv_property *props;
475}; 872};
476 873
874/*
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
477#if defined(__DVB_CORE__) || !defined (__KERNEL__) 910#if defined(__DVB_CORE__) || !defined (__KERNEL__)
478 911
479/* 912/*
480 * DEPRECATED: The DVBv3 ioctls, structs and enums should not be used on 913 * DEPRECATED: Everything below is deprecated in favor of DVBv5 API
481 * newer programs, as it doesn't support the second generation of digital 914 *
482 * TV standards, nor supports newer delivery systems. 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/*
483 */ 927 */
484 928
485enum fe_bandwidth { 929enum fe_bandwidth {
@@ -492,7 +936,7 @@ enum fe_bandwidth {
492 BANDWIDTH_1_712_MHZ, 936 BANDWIDTH_1_712_MHZ,
493}; 937};
494 938
495/* This is needed for legacy userspace support */ 939/* This is kept for legacy userspace support */
496typedef enum fe_sec_voltage fe_sec_voltage_t; 940typedef enum fe_sec_voltage fe_sec_voltage_t;
497typedef enum fe_caps fe_caps_t; 941typedef enum fe_caps fe_caps_t;
498typedef enum fe_type fe_type_t; 942typedef enum fe_type fe_type_t;
@@ -510,6 +954,8 @@ typedef enum fe_pilot fe_pilot_t;
510typedef enum fe_rolloff fe_rolloff_t; 954typedef enum fe_rolloff fe_rolloff_t;
511typedef enum fe_delivery_system fe_delivery_system_t; 955typedef enum fe_delivery_system fe_delivery_system_t;
512 956
957/* DVBv3 structs */
958
513struct dvb_qpsk_parameters { 959struct dvb_qpsk_parameters {
514 __u32 symbol_rate; /* symbol rate in Symbols per second */ 960 __u32 symbol_rate; /* symbol rate in Symbols per second */
515 fe_code_rate_t fec_inner; /* forward error correction (see above) */ 961 fe_code_rate_t fec_inner; /* forward error correction (see above) */
@@ -551,42 +997,12 @@ struct dvb_frontend_event {
551 fe_status_t status; 997 fe_status_t status;
552 struct dvb_frontend_parameters parameters; 998 struct dvb_frontend_parameters parameters;
553}; 999};
554#endif
555
556#define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties)
557#define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties)
558
559/**
560 * When set, this flag will disable any zigzagging or other "normal" tuning
561 * behaviour. Additionally, there will be no automatic monitoring of the lock
562 * status, and hence no frontend events will be generated. If a frontend device
563 * is closed, this flag will be automatically turned off when the device is
564 * reopened read-write.
565 */
566#define FE_TUNE_MODE_ONESHOT 0x01
567 1000
568#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) 1001/* DVBv3 API calls */
569
570#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)
571#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)
572#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
573#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */
574
575#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */
576#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */
577#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */
578
579#define FE_READ_STATUS _IOR('o', 69, fe_status_t)
580#define FE_READ_BER _IOR('o', 70, __u32)
581#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16)
582#define FE_READ_SNR _IOR('o', 72, __u16)
583#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
584 1002
585#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) 1003#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)
586#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) 1004#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
587#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */
588#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
589 1005
590#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ 1006#endif
591 1007
592#endif /*_DVBFRONTEND_H_*/ 1008#endif /*_DVBFRONTEND_H_*/