1<programlisting>
2/*
3 * frontend.h
4 *
5 * Copyright (C) 2000 Marcus Metzler &lt;marcus@convergence.de&gt;
6 *                  Ralph  Metzler &lt;ralph@convergence.de&gt;
7 *                  Holger Waechtler &lt;holger@convergence.de&gt;
8 *                  Andre Draszik &lt;ad@convergence.de&gt;
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
27#ifndef _DVBFRONTEND_H_
28#define _DVBFRONTEND_H_
29
30#include &lt;linux/types.h&gt;
31
32typedef enum fe_type {
33        FE_QPSK,
34        FE_QAM,
35        FE_OFDM,
36        FE_ATSC
37} <link linkend="fe-type-t">fe_type_t</link>;
38
39
40typedef enum fe_caps {
41        FE_IS_STUPID                    = 0,
42        FE_CAN_INVERSION_AUTO           = 0x1,
43        FE_CAN_FEC_1_2                  = 0x2,
44        FE_CAN_FEC_2_3                  = 0x4,
45        FE_CAN_FEC_3_4                  = 0x8,
46        FE_CAN_FEC_4_5                  = 0x10,
47        FE_CAN_FEC_5_6                  = 0x20,
48        FE_CAN_FEC_6_7                  = 0x40,
49        FE_CAN_FEC_7_8                  = 0x80,
50        FE_CAN_FEC_8_9                  = 0x100,
51        FE_CAN_FEC_AUTO                 = 0x200,
52        FE_CAN_QPSK                     = 0x400,
53        FE_CAN_QAM_16                   = 0x800,
54        FE_CAN_QAM_32                   = 0x1000,
55        FE_CAN_QAM_64                   = 0x2000,
56        FE_CAN_QAM_128                  = 0x4000,
57        FE_CAN_QAM_256                  = 0x8000,
58        FE_CAN_QAM_AUTO                 = 0x10000,
59        FE_CAN_TRANSMISSION_MODE_AUTO   = 0x20000,
60        FE_CAN_BANDWIDTH_AUTO           = 0x40000,
61        FE_CAN_GUARD_INTERVAL_AUTO      = 0x80000,
62        FE_CAN_HIERARCHY_AUTO           = 0x100000,
63        FE_CAN_8VSB                     = 0x200000,
64        FE_CAN_16VSB                    = 0x400000,
65        FE_HAS_EXTENDED_CAPS            = 0x800000,   /* We need more bitspace for newer APIs, indicate this. */
66        FE_CAN_MULTISTREAM              = 0x4000000,  /* frontend supports multistream filtering */
67        FE_CAN_TURBO_FEC                = 0x8000000,  /* frontend supports "turbo fec modulation" */
68        FE_CAN_2G_MODULATION            = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
69        FE_NEEDS_BENDING                = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
70        FE_CAN_RECOVER                  = 0x40000000, /* frontend can recover from a cable unplug automatically */
71        FE_CAN_MUTE_TS                  = 0x80000000  /* frontend can stop spurious TS data output */
72} <link linkend="fe-caps-t">fe_caps_t</link>;
73
74
75struct <link linkend="dvb-frontend-info">dvb_frontend_info</link> {
76        char       name[128];
77        fe_type_t  type;                        /* DEPRECATED. Use DTV_ENUM_DELSYS instead */
78        __u32      frequency_min;
79        __u32      frequency_max;
80        __u32      frequency_stepsize;
81        __u32      frequency_tolerance;
82        __u32      symbol_rate_min;
83        __u32      symbol_rate_max;
84        __u32      symbol_rate_tolerance;       /* ppm */
85        __u32      notifier_delay;              /* DEPRECATED */
86        fe_caps_t  caps;
87};
88
89
90/**
91 *  Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
92 *  the meaning of this struct...
93 */
94struct <link linkend="dvb-diseqc-master-cmd">dvb_diseqc_master_cmd</link> {
95        __u8 msg [6];   /*  { framing, address, command, data [3] } */
96        __u8 msg_len;   /*  valid values are 3...6  */
97};
98
99
100struct <link linkend="dvb-diseqc-slave-reply">dvb_diseqc_slave_reply</link> {
101        __u8 msg [4];   /*  { framing, data [3] } */
102        __u8 msg_len;   /*  valid values are 0...4, 0 means no msg  */
103        int  timeout;   /*  return from ioctl after timeout ms with */
104};                      /*  errorcode when no message was received  */
105
106
107typedef enum fe_sec_voltage {
108        SEC_VOLTAGE_13,
109        SEC_VOLTAGE_18,
110        SEC_VOLTAGE_OFF
111} <link linkend="fe-sec-voltage-t">fe_sec_voltage_t</link>;
112
113
114typedef enum fe_sec_tone_mode {
115        SEC_TONE_ON,
116        SEC_TONE_OFF
117} <link linkend="fe-sec-tone-mode-t">fe_sec_tone_mode_t</link>;
118
119
120typedef enum fe_sec_mini_cmd {
121        SEC_MINI_A,
122        SEC_MINI_B
123} <link linkend="fe-sec-mini-cmd-t">fe_sec_mini_cmd_t</link>;
124
125
126/**
127 * enum fe_status - enumerates the possible frontend status
128 * @FE_HAS_SIGNAL:      found something above the noise level
129 * @FE_HAS_CARRIER:     found a DVB signal
130 * @FE_HAS_VITERBI:     FEC is stable
131 * @FE_HAS_SYNC:        found sync bytes
132 * @FE_HAS_LOCK:        everything's working
133 * @FE_TIMEDOUT:        no lock within the last ~2 seconds
134 * @FE_REINIT:          frontend was reinitialized, application is recommended
135 *                      to reset DiSEqC, tone and parameters
136 */
137
138typedef enum fe_status {
139        FE_HAS_SIGNAL           = 0x01,
140        FE_HAS_CARRIER          = 0x02,
141        FE_HAS_VITERBI          = 0x04,
142        FE_HAS_SYNC             = 0x08,
143        FE_HAS_LOCK             = 0x10,
144        FE_TIMEDOUT             = 0x20,
145        FE_REINIT               = 0x40,
146} <link linkend="fe-status-t">fe_status_t</link>;
147
148typedef enum fe_spectral_inversion {
149        INVERSION_OFF,
150        INVERSION_ON,
151        INVERSION_AUTO
152} <link linkend="fe-spectral-inversion-t">fe_spectral_inversion_t</link>;
153
154
155typedef enum fe_code_rate {
156        FEC_NONE = 0,
157        FEC_1_2,
158        FEC_2_3,
159        FEC_3_4,
160        FEC_4_5,
161        FEC_5_6,
162        FEC_6_7,
163        FEC_7_8,
164        FEC_8_9,
165        FEC_AUTO,
166        FEC_3_5,
167        FEC_9_10,
168        FEC_2_5,
169} <link linkend="fe-code-rate-t">fe_code_rate_t</link>;
170
171
172typedef enum fe_modulation {
173        QPSK,
174        QAM_16,
175        QAM_32,
176        QAM_64,
177        QAM_128,
178        QAM_256,
179        QAM_AUTO,
180        VSB_8,
181        VSB_16,
182        PSK_8,
183        APSK_16,
184        APSK_32,
185        DQPSK,
186        QAM_4_NR,
187} <link linkend="fe-modulation-t">fe_modulation_t</link>;
188
189typedef enum fe_transmit_mode {
190        TRANSMISSION_MODE_2K,
191        TRANSMISSION_MODE_8K,
192        TRANSMISSION_MODE_AUTO,
193        TRANSMISSION_MODE_4K,
194        TRANSMISSION_MODE_1K,
195        TRANSMISSION_MODE_16K,
196        TRANSMISSION_MODE_32K,
197        TRANSMISSION_MODE_C1,
198        TRANSMISSION_MODE_C3780,
199} <link linkend="fe-transmit-mode-t">fe_transmit_mode_t</link>;
200
201#if defined(__DVB_CORE__) || !defined (__KERNEL__)
202typedef enum fe_bandwidth {
203        BANDWIDTH_8_MHZ,
204        BANDWIDTH_7_MHZ,
205        BANDWIDTH_6_MHZ,
206        BANDWIDTH_AUTO,
207        BANDWIDTH_5_MHZ,
208        BANDWIDTH_10_MHZ,
209        BANDWIDTH_1_712_MHZ,
210} <link linkend="fe-bandwidth-t">fe_bandwidth_t</link>;
211#endif
212
213typedef enum fe_guard_interval {
214        GUARD_INTERVAL_1_32,
215        GUARD_INTERVAL_1_16,
216        GUARD_INTERVAL_1_8,
217        GUARD_INTERVAL_1_4,
218        GUARD_INTERVAL_AUTO,
219        GUARD_INTERVAL_1_128,
220        GUARD_INTERVAL_19_128,
221        GUARD_INTERVAL_19_256,
222        GUARD_INTERVAL_PN420,
223        GUARD_INTERVAL_PN595,
224        GUARD_INTERVAL_PN945,
225} <link linkend="fe-guard-interval-t">fe_guard_interval_t</link>;
226
227
228typedef enum fe_hierarchy {
229        HIERARCHY_NONE,
230        HIERARCHY_1,
231        HIERARCHY_2,
232        HIERARCHY_4,
233        HIERARCHY_AUTO
234} <link linkend="fe-hierarchy-t">fe_hierarchy_t</link>;
235
236enum fe_interleaving {
237        INTERLEAVING_NONE,
238        INTERLEAVING_AUTO,
239        INTERLEAVING_240,
240        INTERLEAVING_720,
241};
242
243#if defined(__DVB_CORE__) || !defined (__KERNEL__)
244struct <link linkend="dvb-qpsk-parameters">dvb_qpsk_parameters</link> {
245        __u32           symbol_rate;  /* symbol rate in Symbols per second */
246        fe_code_rate_t  fec_inner;    /* forward error correction (see above) */
247};
248
249struct <link linkend="dvb-qam-parameters">dvb_qam_parameters</link> {
250        __u32           symbol_rate; /* symbol rate in Symbols per second */
251        fe_code_rate_t  fec_inner;   /* forward error correction (see above) */
252        fe_modulation_t modulation;  /* modulation type (see above) */
253};
254
255struct <link linkend="dvb-vsb-parameters">dvb_vsb_parameters</link> {
256        fe_modulation_t modulation;  /* modulation type (see above) */
257};
258
259struct <link linkend="dvb-ofdm-parameters">dvb_ofdm_parameters</link> {
260        fe_bandwidth_t      bandwidth;
261        fe_code_rate_t      code_rate_HP;  /* high priority stream code rate */
262        fe_code_rate_t      code_rate_LP;  /* low priority stream code rate */
263        fe_modulation_t     constellation; /* modulation type (see above) */
264        fe_transmit_mode_t  transmission_mode;
265        fe_guard_interval_t guard_interval;
266        fe_hierarchy_t      hierarchy_information;
267};
268
269
270struct <link linkend="dvb-frontend-parameters">dvb_frontend_parameters</link> {
271        __u32 frequency;     /* (absolute) frequency in Hz for QAM/OFDM/ATSC */
272                             /* intermediate frequency in kHz for QPSK */
273        fe_spectral_inversion_t inversion;
274        union {
275                struct dvb_qpsk_parameters qpsk;
276                struct dvb_qam_parameters  qam;
277                struct dvb_ofdm_parameters ofdm;
278                struct dvb_vsb_parameters vsb;
279        } u;
280};
281
282struct <link linkend="dvb-frontend-event">dvb_frontend_event</link> {
283        fe_status_t status;
284        struct dvb_frontend_parameters parameters;
285};
286#endif
287
288/* S2API Commands */
289#define <link linkend="DTV-UNDEFINED">DTV_UNDEFINED</link>           0
290#define <link linkend="DTV-TUNE">DTV_TUNE</link>                1
291#define <link linkend="DTV-CLEAR">DTV_CLEAR</link>               2
292#define <link linkend="DTV-FREQUENCY">DTV_FREQUENCY</link>           3
293#define <link linkend="DTV-MODULATION">DTV_MODULATION</link>          4
294#define <link linkend="DTV-BANDWIDTH-HZ">DTV_BANDWIDTH_HZ</link>        5
295#define <link linkend="DTV-INVERSION">DTV_INVERSION</link>           6
296#define <link linkend="DTV-DISEQC-MASTER">DTV_DISEQC_MASTER</link>       7
297#define <link linkend="DTV-SYMBOL-RATE">DTV_SYMBOL_RATE</link>         8
298#define <link linkend="DTV-INNER-FEC">DTV_INNER_FEC</link>           9
299#define <link linkend="DTV-VOLTAGE">DTV_VOLTAGE</link>             10
300#define <link linkend="DTV-TONE">DTV_TONE</link>                11
301#define <link linkend="DTV-PILOT">DTV_PILOT</link>               12
302#define <link linkend="DTV-ROLLOFF">DTV_ROLLOFF</link>             13
303#define <link linkend="DTV-DISEQC-SLAVE-REPLY">DTV_DISEQC_SLAVE_REPLY</link>  14
304
305/* Basic enumeration set for querying unlimited capabilities */
306#define <link linkend="DTV-FE-CAPABILITY-COUNT">DTV_FE_CAPABILITY_COUNT</link> 15
307#define <link linkend="DTV-FE-CAPABILITY">DTV_FE_CAPABILITY</link>       16
308#define <link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link>     17
309
310/* ISDB-T and ISDB-Tsb */
311#define <link linkend="DTV-ISDBT-PARTIAL-RECEPTION">DTV_ISDBT_PARTIAL_RECEPTION</link>     18
312#define <link linkend="DTV-ISDBT-SOUND-BROADCASTING">DTV_ISDBT_SOUND_BROADCASTING</link>    19
313
314#define <link linkend="DTV-ISDBT-SB-SUBCHANNEL-ID">DTV_ISDBT_SB_SUBCHANNEL_ID</link>      20
315#define <link linkend="DTV-ISDBT-SB-SEGMENT-IDX">DTV_ISDBT_SB_SEGMENT_IDX</link>        21
316#define <link linkend="DTV-ISDBT-SB-SEGMENT-COUNT">DTV_ISDBT_SB_SEGMENT_COUNT</link>      22
317
318#define <link linkend="DTV-ISDBT-LAYER-FEC">DTV_ISDBT_LAYERA_FEC</link>                    23
319#define <link linkend="DTV-ISDBT-LAYER-MODULATION">DTV_ISDBT_LAYERA_MODULATION</link>             24
320#define <link linkend="DTV-ISDBT-LAYER-SEGMENT-COUNT">DTV_ISDBT_LAYERA_SEGMENT_COUNT</link>          25
321#define <link linkend="DTV-ISDBT-LAYER-TIME-INTERLEAVING">DTV_ISDBT_LAYERA_TIME_INTERLEAVING</link>      26
322
323#define <link linkend="DTV-ISDBT-LAYER-FEC">DTV_ISDBT_LAYERB_FEC</link>                    27
324#define <link linkend="DTV-ISDBT-LAYER-MODULATION">DTV_ISDBT_LAYERB_MODULATION</link>             28
325#define <link linkend="DTV-ISDBT-LAYER-SEGMENT-COUNT">DTV_ISDBT_LAYERB_SEGMENT_COUNT</link>          29
326#define <link linkend="DTV-ISDBT-LAYER-TIME-INTERLEAVING">DTV_ISDBT_LAYERB_TIME_INTERLEAVING</link>      30
327
328#define <link linkend="DTV-ISDBT-LAYER-FEC">DTV_ISDBT_LAYERC_FEC</link>                    31
329#define <link linkend="DTV-ISDBT-LAYER-MODULATION">DTV_ISDBT_LAYERC_MODULATION</link>             32
330#define <link linkend="DTV-ISDBT-LAYER-SEGMENT-COUNT">DTV_ISDBT_LAYERC_SEGMENT_COUNT</link>          33
331#define <link linkend="DTV-ISDBT-LAYER-TIME-INTERLEAVING">DTV_ISDBT_LAYERC_TIME_INTERLEAVING</link>      34
332
333#define <link linkend="DTV-API-VERSION">DTV_API_VERSION</link>         35
334
335#define <link linkend="DTV-CODE-RATE-HP">DTV_CODE_RATE_HP</link>        36
336#define <link linkend="DTV-CODE-RATE-LP">DTV_CODE_RATE_LP</link>        37
337#define <link linkend="DTV-GUARD-INTERVAL">DTV_GUARD_INTERVAL</link>      38
338#define <link linkend="DTV-TRANSMISSION-MODE">DTV_TRANSMISSION_MODE</link>   39
339#define <link linkend="DTV-HIERARCHY">DTV_HIERARCHY</link>           40
340
341#define <link linkend="DTV-ISDBT-LAYER-ENABLED">DTV_ISDBT_LAYER_ENABLED</link> 41
342
343#define <link linkend="DTV-STREAM-ID">DTV_STREAM_ID</link>           42
344#define DTV_ISDBS_TS_ID_LEGACY  DTV_STREAM_ID
345#define <link linkend="DTV-DVBT2-PLP-ID-LEGACY">DTV_DVBT2_PLP_ID_LEGACY</link> 43
346
347#define <link linkend="DTV-ENUM-DELSYS">DTV_ENUM_DELSYS</link>         44
348
349/* ATSC-MH */
350#define <link linkend="DTV-ATSCMH-FIC-VER">DTV_ATSCMH_FIC_VER</link>              45
351#define <link linkend="DTV-ATSCMH-PARADE-ID">DTV_ATSCMH_PARADE_ID</link>            46
352#define <link linkend="DTV-ATSCMH-NOG">DTV_ATSCMH_NOG</link>                  47
353#define <link linkend="DTV-ATSCMH-TNOG">DTV_ATSCMH_TNOG</link>                 48
354#define <link linkend="DTV-ATSCMH-SGN">DTV_ATSCMH_SGN</link>                  49
355#define <link linkend="DTV-ATSCMH-PRC">DTV_ATSCMH_PRC</link>                  50
356#define <link linkend="DTV-ATSCMH-RS-FRAME-MODE">DTV_ATSCMH_RS_FRAME_MODE</link>        51
357#define <link linkend="DTV-ATSCMH-RS-FRAME-ENSEMBLE">DTV_ATSCMH_RS_FRAME_ENSEMBLE</link>    52
358#define <link linkend="DTV-ATSCMH-RS-CODE-MODE-PRI">DTV_ATSCMH_RS_CODE_MODE_PRI</link>     53
359#define <link linkend="DTV-ATSCMH-RS-CODE-MODE-SEC">DTV_ATSCMH_RS_CODE_MODE_SEC</link>     54
360#define <link linkend="DTV-ATSCMH-SCCC-BLOCK-MODE">DTV_ATSCMH_SCCC_BLOCK_MODE</link>      55
361#define <link linkend="DTV-ATSCMH-SCCC-CODE-MODE-A">DTV_ATSCMH_SCCC_CODE_MODE_A</link>     56
362#define <link linkend="DTV-ATSCMH-SCCC-CODE-MODE-B">DTV_ATSCMH_SCCC_CODE_MODE_B</link>     57
363#define <link linkend="DTV-ATSCMH-SCCC-CODE-MODE-C">DTV_ATSCMH_SCCC_CODE_MODE_C</link>     58
364#define <link linkend="DTV-ATSCMH-SCCC-CODE-MODE-D">DTV_ATSCMH_SCCC_CODE_MODE_D</link>     59
365
366#define <link linkend="DTV-INTERLEAVING">DTV_INTERLEAVING</link>                        60
367#define <link linkend="DTV-LNA">DTV_LNA</link>                                 61
368
369/* Quality parameters */
370#define <link linkend="DTV-STAT-SIGNAL-STRENGTH">DTV_STAT_SIGNAL_STRENGTH</link>        62
371#define <link linkend="DTV-STAT-CNR">DTV_STAT_CNR</link>                    63
372#define <link linkend="DTV-STAT-PRE-ERROR-BIT-COUNT">DTV_STAT_PRE_ERROR_BIT_COUNT</link>    64
373#define <link linkend="DTV-STAT-PRE-TOTAL-BIT-COUNT">DTV_STAT_PRE_TOTAL_BIT_COUNT</link>    65
374#define <link linkend="DTV-STAT-POST-ERROR-BIT-COUNT">DTV_STAT_POST_ERROR_BIT_COUNT</link>   66
375#define <link linkend="DTV-STAT-POST-TOTAL-BIT-COUNT">DTV_STAT_POST_TOTAL_BIT_COUNT</link>   67
376#define <link linkend="DTV-STAT-ERROR-BLOCK-COUNT">DTV_STAT_ERROR_BLOCK_COUNT</link>      68
377#define <link linkend="DTV-STAT-TOTAL-BLOCK-COUNT">DTV_STAT_TOTAL_BLOCK_COUNT</link>      69
378
379#define DTV_MAX_COMMAND         DTV_STAT_TOTAL_BLOCK_COUNT
380
381typedef enum fe_pilot {
382        PILOT_ON,
383        PILOT_OFF,
384        PILOT_AUTO,
385} <link linkend="fe-pilot-t">fe_pilot_t</link>;
386
387typedef enum fe_rolloff {
388        ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */
389        ROLLOFF_20,
390        ROLLOFF_25,
391        ROLLOFF_AUTO,
392} <link linkend="fe-rolloff-t">fe_rolloff_t</link>;
393
394typedef enum fe_delivery_system {
395        SYS_UNDEFINED,
396        SYS_DVBC_ANNEX_A,
397        SYS_DVBC_ANNEX_B,
398        SYS_DVBT,
399        SYS_DSS,
400        SYS_DVBS,
401        SYS_DVBS2,
402        SYS_DVBH,
403        SYS_ISDBT,
404        SYS_ISDBS,
405        SYS_ISDBC,
406        SYS_ATSC,
407        SYS_ATSCMH,
408        SYS_DTMB,
409        SYS_CMMB,
410        SYS_DAB,
411        SYS_DVBT2,
412        SYS_TURBO,
413        SYS_DVBC_ANNEX_C,
414} <link linkend="fe-delivery-system-t">fe_delivery_system_t</link>;
415
416/* backward compatibility */
417#define SYS_DVBC_ANNEX_AC       SYS_DVBC_ANNEX_A
418#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB instead */
419
420/* ATSC-MH */
421
422enum atscmh_sccc_block_mode {
423        ATSCMH_SCCC_BLK_SEP      = 0,
424        ATSCMH_SCCC_BLK_COMB     = 1,
425        ATSCMH_SCCC_BLK_RES      = 2,
426};
427
428enum atscmh_sccc_code_mode {
429        ATSCMH_SCCC_CODE_HLF     = 0,
430        ATSCMH_SCCC_CODE_QTR     = 1,
431        ATSCMH_SCCC_CODE_RES     = 2,
432};
433
434enum atscmh_rs_frame_ensemble {
435        ATSCMH_RSFRAME_ENS_PRI   = 0,
436        ATSCMH_RSFRAME_ENS_SEC   = 1,
437};
438
439enum atscmh_rs_frame_mode {
440        ATSCMH_RSFRAME_PRI_ONLY  = 0,
441        ATSCMH_RSFRAME_PRI_SEC   = 1,
442        ATSCMH_RSFRAME_RES       = 2,
443};
444
445enum atscmh_rs_code_mode {
446        ATSCMH_RSCODE_211_187    = 0,
447        ATSCMH_RSCODE_223_187    = 1,
448        ATSCMH_RSCODE_235_187    = 2,
449        ATSCMH_RSCODE_RES        = 3,
450};
451
452#define NO_STREAM_ID_FILTER     (~0U)
453#define LNA_AUTO                (~0U)
454
455struct dtv_cmds_h {
456        char    *name;          /* A display name for debugging purposes */
457
458        __u32   cmd;            /* A unique ID */
459
460        /* Flags */
461        __u32   set:1;          /* Either a set or get property */
462        __u32   buffer:1;       /* Does this property use the buffer? */
463        __u32   reserved:30;    /* Align */
464};
465
466/**
467 * Scale types for the quality parameters.
468 * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That
469 *                          could indicate a temporary or a permanent
470 *                          condition.
471 * @FE_SCALE_DECIBEL: The scale is measured in 0.0001 dB steps, typically
472 *                used on signal measures.
473 * @FE_SCALE_RELATIVE: The scale is a relative percentual measure,
474 *                      ranging from 0 (0%) to 0xffff (100%).
475 * @FE_SCALE_COUNTER: The scale counts the occurrence of an event, like
476 *                      bit error, block error, lapsed time.
477 */
478enum fecap_scale_params {
479        FE_SCALE_NOT_AVAILABLE = 0,
480        FE_SCALE_DECIBEL,
481        FE_SCALE_RELATIVE,
482        FE_SCALE_COUNTER
483};
484
485/**
486 * struct dtv_stats - Used for reading a DTV status property
487 *
488 * @value:      value of the measure. Should range from 0 to 0xffff;
489 * @scale:      Filled with enum fecap_scale_params - the scale
490 *              in usage for that parameter
491 *
492 * For most delivery systems, this will return a single value for each
493 * parameter.
494 * It should be noticed, however, that new OFDM delivery systems like
495 * ISDB can use different modulation types for each group of carriers.
496 * On such standards, up to 8 groups of statistics can be provided, one
497 * for each carrier group (called "layer" on ISDB).
498 * In order to be consistent with other delivery systems, the first
499 * value refers to the entire set of carriers ("global").
500 * dtv_status:scale should use the value FE_SCALE_NOT_AVAILABLE when
501 * the value for the entire group of carriers or from one specific layer
502 * is not provided by the hardware.
503 * st.len should be filled with the latest filled status + 1.
504 *
505 * In other words, for ISDB, those values should be filled like:
506 *      u.st.stat.svalue[0] = global statistics;
507 *      u.st.stat.scale[0] = FE_SCALE_DECIBELS;
508 *      u.st.stat.value[1] = layer A statistics;
509 *      u.st.stat.scale[1] = FE_SCALE_NOT_AVAILABLE (if not available);
510 *      u.st.stat.svalue[2] = layer B statistics;
511 *      u.st.stat.scale[2] = FE_SCALE_DECIBELS;
512 *      u.st.stat.svalue[3] = layer C statistics;
513 *      u.st.stat.scale[3] = FE_SCALE_DECIBELS;
514 *      u.st.len = 4;
515 */
516struct <link linkend="dtv-stats">dtv_stats</link> {
517        __u8 scale;     /* enum fecap_scale_params type */
518        union {
519                __u64 uvalue;   /* for counters and relative scales */
520                __s64 svalue;   /* for 0.0001 dB measures */
521        };
522} __attribute__ ((packed));
523
524
525#define MAX_DTV_STATS   4
526
527struct <link linkend="dtv-fe-stats">dtv_fe_stats</link> {
528        __u8 len;
529        struct dtv_stats stat[MAX_DTV_STATS];
530} __attribute__ ((packed));
531
532struct <link linkend="dtv-property">dtv_property</link> {
533        __u32 cmd;
534        __u32 reserved[3];
535        union {
536                __u32 data;
537                struct dtv_fe_stats st;
538                struct {
539                        __u8 data[32];
540                        __u32 len;
541                        __u32 reserved1[3];
542                        void *reserved2;
543                } buffer;
544        } u;
545        int result;
546} __attribute__ ((packed));
547
548/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
549#define DTV_IOCTL_MAX_MSGS 64
550
551struct <link linkend="dtv-properties">dtv_properties</link> {
552        __u32 num;
553        struct dtv_property *props;
554};
555
556#define <link linkend="FE_SET_PROPERTY">FE_SET_PROPERTY</link>            _IOW('o', 82, struct dtv_properties)
557#define <link linkend="FE_GET_PROPERTY">FE_GET_PROPERTY</link>            _IOR('o', 83, struct dtv_properties)
558
559
560/**
561 * When set, this flag will disable any zigzagging or other "normal" tuning
562 * behaviour. Additionally, there will be no automatic monitoring of the lock
563 * status, and hence no frontend events will be generated. If a frontend device
564 * is closed, this flag will be automatically turned off when the device is
565 * reopened read-write.
566 */
567#define FE_TUNE_MODE_ONESHOT 0x01
568
569
570#define <link linkend="FE_GET_INFO">FE_GET_INFO</link>                _IOR('o', 61, struct dvb_frontend_info)
571
572#define <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link>   _IO('o', 62)
573#define <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link>  _IOW('o', 63, struct dvb_diseqc_master_cmd)
574#define <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link> _IOR('o', 64, struct dvb_diseqc_slave_reply)
575#define <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link>       _IO('o', 65)  /* fe_sec_mini_cmd_t */
576
577#define <link linkend="FE_SET_TONE">FE_SET_TONE</link>                _IO('o', 66)  /* fe_sec_tone_mode_t */
578#define <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link>             _IO('o', 67)  /* fe_sec_voltage_t */
579#define <link linkend="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</link> _IO('o', 68)  /* int */
580
581#define <link linkend="FE_READ_STATUS">FE_READ_STATUS</link>             _IOR('o', 69, fe_status_t)
582#define <link linkend="FE_READ_BER">FE_READ_BER</link>                _IOR('o', 70, __u32)
583#define <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link>    _IOR('o', 71, __u16)
584#define <link linkend="FE_READ_SNR">FE_READ_SNR</link>                _IOR('o', 72, __u16)
585#define <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link> _IOR('o', 73, __u32)
586
587#define <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link>            _IOW('o', 76, struct dvb_frontend_parameters)
588#define <link linkend="FE_GET_FRONTEND">FE_GET_FRONTEND</link>            _IOR('o', 77, struct dvb_frontend_parameters)
589#define <link linkend="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</link>  _IO('o', 81) /* unsigned int */
590#define <link linkend="FE_GET_EVENT">FE_GET_EVENT</link>               _IOR('o', 78, struct dvb_frontend_event)
591
592#define <link linkend="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</link> _IO('o', 80) /* unsigned int */
593
594#endif /*_DVBFRONTEND_H_*/
595</programlisting>
596