Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
0002 /*
0003  * frontend.h
0004  *
0005  * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
0006  *          Ralph  Metzler <ralph@convergence.de>
0007  *          Holger Waechtler <holger@convergence.de>
0008  *          Andre Draszik <ad@convergence.de>
0009  *          for convergence integrated media GmbH
0010  *
0011  * This program is free software; you can redistribute it and/or
0012  * modify it under the terms of the GNU Lesser General Public License
0013  * as published by the Free Software Foundation; either version 2.1
0014  * of the License, or (at your option) any later version.
0015  *
0016  * This program is distributed in the hope that it will be useful,
0017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0019  * GNU General Public License for more details.
0020  *
0021  * You should have received a copy of the GNU Lesser General Public License
0022  * along with this program; if not, write to the Free Software
0023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
0024  *
0025  */
0026 
0027 #ifndef _DVBFRONTEND_H_
0028 #define _DVBFRONTEND_H_
0029 
0030 #include <linux/types.h>
0031 
0032 /**
0033  * enum fe_caps - Frontend capabilities
0034  *
0035  * @FE_IS_STUPID:           There's something wrong at the
0036  *                  frontend, and it can't report its
0037  *                  capabilities.
0038  * @FE_CAN_INVERSION_AUTO:      Can auto-detect frequency spectral
0039  *                  band inversion
0040  * @FE_CAN_FEC_1_2:         Supports FEC 1/2
0041  * @FE_CAN_FEC_2_3:         Supports FEC 2/3
0042  * @FE_CAN_FEC_3_4:         Supports FEC 3/4
0043  * @FE_CAN_FEC_4_5:         Supports FEC 4/5
0044  * @FE_CAN_FEC_5_6:         Supports FEC 5/6
0045  * @FE_CAN_FEC_6_7:         Supports FEC 6/7
0046  * @FE_CAN_FEC_7_8:         Supports FEC 7/8
0047  * @FE_CAN_FEC_8_9:         Supports FEC 8/9
0048  * @FE_CAN_FEC_AUTO:            Can auto-detect FEC
0049  * @FE_CAN_QPSK:            Supports QPSK modulation
0050  * @FE_CAN_QAM_16:          Supports 16-QAM modulation
0051  * @FE_CAN_QAM_32:          Supports 32-QAM modulation
0052  * @FE_CAN_QAM_64:          Supports 64-QAM modulation
0053  * @FE_CAN_QAM_128:         Supports 128-QAM modulation
0054  * @FE_CAN_QAM_256:         Supports 256-QAM modulation
0055  * @FE_CAN_QAM_AUTO:            Can auto-detect QAM modulation
0056  * @FE_CAN_TRANSMISSION_MODE_AUTO:  Can auto-detect transmission mode
0057  * @FE_CAN_BANDWIDTH_AUTO:      Can auto-detect bandwidth
0058  * @FE_CAN_GUARD_INTERVAL_AUTO:     Can auto-detect guard interval
0059  * @FE_CAN_HIERARCHY_AUTO:      Can auto-detect hierarchy
0060  * @FE_CAN_8VSB:            Supports 8-VSB modulation
0061  * @FE_CAN_16VSB:           Supporta 16-VSB modulation
0062  * @FE_HAS_EXTENDED_CAPS:       Unused
0063  * @FE_CAN_MULTISTREAM:         Supports multistream filtering
0064  * @FE_CAN_TURBO_FEC:           Supports "turbo FEC" modulation
0065  * @FE_CAN_2G_MODULATION:       Supports "2nd generation" modulation,
0066  *                  e. g. DVB-S2, DVB-T2, DVB-C2
0067  * @FE_NEEDS_BENDING:           Unused
0068  * @FE_CAN_RECOVER:         Can recover from a cable unplug
0069  *                  automatically
0070  * @FE_CAN_MUTE_TS:         Can stop spurious TS data output
0071  */
0072 enum fe_caps {
0073     FE_IS_STUPID            = 0,
0074     FE_CAN_INVERSION_AUTO       = 0x1,
0075     FE_CAN_FEC_1_2          = 0x2,
0076     FE_CAN_FEC_2_3          = 0x4,
0077     FE_CAN_FEC_3_4          = 0x8,
0078     FE_CAN_FEC_4_5          = 0x10,
0079     FE_CAN_FEC_5_6          = 0x20,
0080     FE_CAN_FEC_6_7          = 0x40,
0081     FE_CAN_FEC_7_8          = 0x80,
0082     FE_CAN_FEC_8_9          = 0x100,
0083     FE_CAN_FEC_AUTO         = 0x200,
0084     FE_CAN_QPSK         = 0x400,
0085     FE_CAN_QAM_16           = 0x800,
0086     FE_CAN_QAM_32           = 0x1000,
0087     FE_CAN_QAM_64           = 0x2000,
0088     FE_CAN_QAM_128          = 0x4000,
0089     FE_CAN_QAM_256          = 0x8000,
0090     FE_CAN_QAM_AUTO         = 0x10000,
0091     FE_CAN_TRANSMISSION_MODE_AUTO   = 0x20000,
0092     FE_CAN_BANDWIDTH_AUTO       = 0x40000,
0093     FE_CAN_GUARD_INTERVAL_AUTO  = 0x80000,
0094     FE_CAN_HIERARCHY_AUTO       = 0x100000,
0095     FE_CAN_8VSB         = 0x200000,
0096     FE_CAN_16VSB            = 0x400000,
0097     FE_HAS_EXTENDED_CAPS        = 0x800000,
0098     FE_CAN_MULTISTREAM      = 0x4000000,
0099     FE_CAN_TURBO_FEC        = 0x8000000,
0100     FE_CAN_2G_MODULATION        = 0x10000000,
0101     FE_NEEDS_BENDING        = 0x20000000,
0102     FE_CAN_RECOVER          = 0x40000000,
0103     FE_CAN_MUTE_TS          = 0x80000000
0104 };
0105 
0106 /*
0107  * DEPRECATED: Should be kept just due to backward compatibility.
0108  */
0109 enum fe_type {
0110     FE_QPSK,
0111     FE_QAM,
0112     FE_OFDM,
0113     FE_ATSC
0114 };
0115 
0116 /**
0117  * struct dvb_frontend_info - Frontend properties and capabilities
0118  *
0119  * @name:           Name of the frontend
0120  * @type:           **DEPRECATED**.
0121  *              Should not be used on modern programs,
0122  *              as a frontend may have more than one type.
0123  *              In order to get the support types of a given
0124  *              frontend, use :c:type:`DTV_ENUM_DELSYS`
0125  *              instead.
0126  * @frequency_min:      Minimal frequency supported by the frontend.
0127  * @frequency_max:      Minimal frequency supported by the frontend.
0128  * @frequency_stepsize:     All frequencies are multiple of this value.
0129  * @frequency_tolerance:    Frequency tolerance.
0130  * @symbol_rate_min:        Minimal symbol rate, in bauds
0131  *              (for Cable/Satellite systems).
0132  * @symbol_rate_max:        Maximal symbol rate, in bauds
0133  *              (for Cable/Satellite systems).
0134  * @symbol_rate_tolerance:  Maximal symbol rate tolerance, in ppm
0135  *              (for Cable/Satellite systems).
0136  * @notifier_delay:     **DEPRECATED**. Not used by any driver.
0137  * @caps:           Capabilities supported by the frontend,
0138  *              as specified in &enum fe_caps.
0139  *
0140  * .. note:
0141  *
0142  *    #. The frequencies are specified in Hz for Terrestrial and Cable
0143  *       systems.
0144  *    #. The frequencies are specified in kHz for Satellite systems.
0145  */
0146 struct dvb_frontend_info {
0147     char       name[128];
0148     enum fe_type type;  /* DEPRECATED. Use DTV_ENUM_DELSYS instead */
0149     __u32      frequency_min;
0150     __u32      frequency_max;
0151     __u32      frequency_stepsize;
0152     __u32      frequency_tolerance;
0153     __u32      symbol_rate_min;
0154     __u32      symbol_rate_max;
0155     __u32      symbol_rate_tolerance;
0156     __u32      notifier_delay;      /* DEPRECATED */
0157     enum fe_caps caps;
0158 };
0159 
0160 /**
0161  * struct dvb_diseqc_master_cmd - DiSEqC master command
0162  *
0163  * @msg:
0164  *  DiSEqC message to be sent. It contains a 3 bytes header with:
0165  *  framing + address + command, and an optional argument
0166  *  of up to 3 bytes of data.
0167  * @msg_len:
0168  *  Length of the DiSEqC message. Valid values are 3 to 6.
0169  *
0170  * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
0171  * the possible messages that can be used.
0172  */
0173 struct dvb_diseqc_master_cmd {
0174     __u8 msg[6];
0175     __u8 msg_len;
0176 };
0177 
0178 /**
0179  * struct dvb_diseqc_slave_reply - DiSEqC received data
0180  *
0181  * @msg:
0182  *  DiSEqC message buffer to store a message received via DiSEqC.
0183  *  It contains one byte header with: framing and
0184  *  an optional argument of up to 3 bytes of data.
0185  * @msg_len:
0186  *  Length of the DiSEqC message. Valid values are 0 to 4,
0187  *  where 0 means no message.
0188  * @timeout:
0189  *  Return from ioctl after timeout ms with errorcode when
0190  *  no message was received.
0191  *
0192  * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
0193  * the possible messages that can be used.
0194  */
0195 struct dvb_diseqc_slave_reply {
0196     __u8 msg[4];
0197     __u8 msg_len;
0198     int  timeout;
0199 };
0200 
0201 /**
0202  * enum fe_sec_voltage - DC Voltage used to feed the LNBf
0203  *
0204  * @SEC_VOLTAGE_13: Output 13V to the LNBf
0205  * @SEC_VOLTAGE_18: Output 18V to the LNBf
0206  * @SEC_VOLTAGE_OFF:    Don't feed the LNBf with a DC voltage
0207  */
0208 enum fe_sec_voltage {
0209     SEC_VOLTAGE_13,
0210     SEC_VOLTAGE_18,
0211     SEC_VOLTAGE_OFF
0212 };
0213 
0214 /**
0215  * enum fe_sec_tone_mode - Type of tone to be send to the LNBf.
0216  * @SEC_TONE_ON:    Sends a 22kHz tone burst to the antenna.
0217  * @SEC_TONE_OFF:   Don't send a 22kHz tone to the antenna (except
0218  *          if the ``FE_DISEQC_*`` ioctls are called).
0219  */
0220 enum fe_sec_tone_mode {
0221     SEC_TONE_ON,
0222     SEC_TONE_OFF
0223 };
0224 
0225 /**
0226  * enum fe_sec_mini_cmd - Type of mini burst to be sent
0227  *
0228  * @SEC_MINI_A:     Sends a mini-DiSEqC 22kHz '0' Tone Burst to select
0229  *          satellite-A
0230  * @SEC_MINI_B:     Sends a mini-DiSEqC 22kHz '1' Data Burst to select
0231  *          satellite-B
0232  */
0233 enum fe_sec_mini_cmd {
0234     SEC_MINI_A,
0235     SEC_MINI_B
0236 };
0237 
0238 /**
0239  * enum fe_status - Enumerates the possible frontend status.
0240  * @FE_NONE:        The frontend doesn't have any kind of lock.
0241  *          That's the initial frontend status
0242  * @FE_HAS_SIGNAL:  Has found something above the noise level.
0243  * @FE_HAS_CARRIER: Has found a signal.
0244  * @FE_HAS_VITERBI: FEC inner coding (Viterbi, LDPC or other inner code).
0245  *          is stable.
0246  * @FE_HAS_SYNC:    Synchronization bytes was found.
0247  * @FE_HAS_LOCK:    Digital TV were locked and everything is working.
0248  * @FE_TIMEDOUT:    Fo lock within the last about 2 seconds.
0249  * @FE_REINIT:      Frontend was reinitialized, application is recommended
0250  *          to reset DiSEqC, tone and parameters.
0251  */
0252 enum fe_status {
0253     FE_NONE         = 0x00,
0254     FE_HAS_SIGNAL       = 0x01,
0255     FE_HAS_CARRIER      = 0x02,
0256     FE_HAS_VITERBI      = 0x04,
0257     FE_HAS_SYNC     = 0x08,
0258     FE_HAS_LOCK     = 0x10,
0259     FE_TIMEDOUT     = 0x20,
0260     FE_REINIT       = 0x40,
0261 };
0262 
0263 /**
0264  * enum fe_spectral_inversion - Type of inversion band
0265  *
0266  * @INVERSION_OFF:  Don't do spectral band inversion.
0267  * @INVERSION_ON:   Do spectral band inversion.
0268  * @INVERSION_AUTO: Autodetect spectral band inversion.
0269  *
0270  * This parameter indicates if spectral inversion should be presumed or
0271  * not. In the automatic setting (``INVERSION_AUTO``) the hardware will try
0272  * to figure out the correct setting by itself. If the hardware doesn't
0273  * support, the %dvb_frontend will try to lock at the carrier first with
0274  * inversion off. If it fails, it will try to enable inversion.
0275  */
0276 enum fe_spectral_inversion {
0277     INVERSION_OFF,
0278     INVERSION_ON,
0279     INVERSION_AUTO
0280 };
0281 
0282 /**
0283  * enum fe_code_rate - Type of Forward Error Correction (FEC)
0284  *
0285  *
0286  * @FEC_NONE: No Forward Error Correction Code
0287  * @FEC_1_2:  Forward Error Correction Code 1/2
0288  * @FEC_2_3:  Forward Error Correction Code 2/3
0289  * @FEC_3_4:  Forward Error Correction Code 3/4
0290  * @FEC_4_5:  Forward Error Correction Code 4/5
0291  * @FEC_5_6:  Forward Error Correction Code 5/6
0292  * @FEC_6_7:  Forward Error Correction Code 6/7
0293  * @FEC_7_8:  Forward Error Correction Code 7/8
0294  * @FEC_8_9:  Forward Error Correction Code 8/9
0295  * @FEC_AUTO: Autodetect Error Correction Code
0296  * @FEC_3_5:  Forward Error Correction Code 3/5
0297  * @FEC_9_10: Forward Error Correction Code 9/10
0298  * @FEC_2_5:  Forward Error Correction Code 2/5
0299  *
0300  * Please note that not all FEC types are supported by a given standard.
0301  */
0302 enum fe_code_rate {
0303     FEC_NONE = 0,
0304     FEC_1_2,
0305     FEC_2_3,
0306     FEC_3_4,
0307     FEC_4_5,
0308     FEC_5_6,
0309     FEC_6_7,
0310     FEC_7_8,
0311     FEC_8_9,
0312     FEC_AUTO,
0313     FEC_3_5,
0314     FEC_9_10,
0315     FEC_2_5,
0316 };
0317 
0318 /**
0319  * enum fe_modulation - Type of modulation/constellation
0320  * @QPSK:   QPSK modulation
0321  * @QAM_16: 16-QAM modulation
0322  * @QAM_32: 32-QAM modulation
0323  * @QAM_64: 64-QAM modulation
0324  * @QAM_128:    128-QAM modulation
0325  * @QAM_256:    256-QAM modulation
0326  * @QAM_AUTO:   Autodetect QAM modulation
0327  * @VSB_8:  8-VSB modulation
0328  * @VSB_16: 16-VSB modulation
0329  * @PSK_8:  8-PSK modulation
0330  * @APSK_16:    16-APSK modulation
0331  * @APSK_32:    32-APSK modulation
0332  * @DQPSK:  DQPSK modulation
0333  * @QAM_4_NR:   4-QAM-NR modulation
0334  *
0335  * Please note that not all modulations are supported by a given standard.
0336  *
0337  */
0338 enum fe_modulation {
0339     QPSK,
0340     QAM_16,
0341     QAM_32,
0342     QAM_64,
0343     QAM_128,
0344     QAM_256,
0345     QAM_AUTO,
0346     VSB_8,
0347     VSB_16,
0348     PSK_8,
0349     APSK_16,
0350     APSK_32,
0351     DQPSK,
0352     QAM_4_NR,
0353 };
0354 
0355 /**
0356  * enum fe_transmit_mode - Transmission mode
0357  *
0358  * @TRANSMISSION_MODE_AUTO:
0359  *  Autodetect transmission mode. The hardware will try to find the
0360  *  correct FFT-size (if capable) to fill in the missing parameters.
0361  * @TRANSMISSION_MODE_1K:
0362  *  Transmission mode 1K
0363  * @TRANSMISSION_MODE_2K:
0364  *  Transmission mode 2K
0365  * @TRANSMISSION_MODE_8K:
0366  *  Transmission mode 8K
0367  * @TRANSMISSION_MODE_4K:
0368  *  Transmission mode 4K
0369  * @TRANSMISSION_MODE_16K:
0370  *  Transmission mode 16K
0371  * @TRANSMISSION_MODE_32K:
0372  *  Transmission mode 32K
0373  * @TRANSMISSION_MODE_C1:
0374  *  Single Carrier (C=1) transmission mode (DTMB only)
0375  * @TRANSMISSION_MODE_C3780:
0376  *  Multi Carrier (C=3780) transmission mode (DTMB only)
0377  *
0378  * Please note that not all transmission modes are supported by a given
0379  * standard.
0380  */
0381 enum fe_transmit_mode {
0382     TRANSMISSION_MODE_2K,
0383     TRANSMISSION_MODE_8K,
0384     TRANSMISSION_MODE_AUTO,
0385     TRANSMISSION_MODE_4K,
0386     TRANSMISSION_MODE_1K,
0387     TRANSMISSION_MODE_16K,
0388     TRANSMISSION_MODE_32K,
0389     TRANSMISSION_MODE_C1,
0390     TRANSMISSION_MODE_C3780,
0391 };
0392 
0393 /**
0394  * enum fe_guard_interval - Guard interval
0395  *
0396  * @GUARD_INTERVAL_AUTO:    Autodetect the guard interval
0397  * @GUARD_INTERVAL_1_128:   Guard interval 1/128
0398  * @GUARD_INTERVAL_1_32:    Guard interval 1/32
0399  * @GUARD_INTERVAL_1_16:    Guard interval 1/16
0400  * @GUARD_INTERVAL_1_8:     Guard interval 1/8
0401  * @GUARD_INTERVAL_1_4:     Guard interval 1/4
0402  * @GUARD_INTERVAL_19_128:  Guard interval 19/128
0403  * @GUARD_INTERVAL_19_256:  Guard interval 19/256
0404  * @GUARD_INTERVAL_PN420:   PN length 420 (1/4)
0405  * @GUARD_INTERVAL_PN595:   PN length 595 (1/6)
0406  * @GUARD_INTERVAL_PN945:   PN length 945 (1/9)
0407  *
0408  * Please note that not all guard intervals are supported by a given standard.
0409  */
0410 enum fe_guard_interval {
0411     GUARD_INTERVAL_1_32,
0412     GUARD_INTERVAL_1_16,
0413     GUARD_INTERVAL_1_8,
0414     GUARD_INTERVAL_1_4,
0415     GUARD_INTERVAL_AUTO,
0416     GUARD_INTERVAL_1_128,
0417     GUARD_INTERVAL_19_128,
0418     GUARD_INTERVAL_19_256,
0419     GUARD_INTERVAL_PN420,
0420     GUARD_INTERVAL_PN595,
0421     GUARD_INTERVAL_PN945,
0422 };
0423 
0424 /**
0425  * enum fe_hierarchy - Hierarchy
0426  * @HIERARCHY_NONE: No hierarchy
0427  * @HIERARCHY_AUTO: Autodetect hierarchy (if supported)
0428  * @HIERARCHY_1:    Hierarchy 1
0429  * @HIERARCHY_2:    Hierarchy 2
0430  * @HIERARCHY_4:    Hierarchy 4
0431  *
0432  * Please note that not all hierarchy types are supported by a given standard.
0433  */
0434 enum fe_hierarchy {
0435     HIERARCHY_NONE,
0436     HIERARCHY_1,
0437     HIERARCHY_2,
0438     HIERARCHY_4,
0439     HIERARCHY_AUTO
0440 };
0441 
0442 /**
0443  * enum fe_interleaving - Interleaving
0444  * @INTERLEAVING_NONE:  No interleaving.
0445  * @INTERLEAVING_AUTO:  Auto-detect interleaving.
0446  * @INTERLEAVING_240:   Interleaving of 240 symbols.
0447  * @INTERLEAVING_720:   Interleaving of 720 symbols.
0448  *
0449  * Please note that, currently, only DTMB uses it.
0450  */
0451 enum fe_interleaving {
0452     INTERLEAVING_NONE,
0453     INTERLEAVING_AUTO,
0454     INTERLEAVING_240,
0455     INTERLEAVING_720,
0456 };
0457 
0458 /* DVBv5 property Commands */
0459 
0460 #define DTV_UNDEFINED       0
0461 #define DTV_TUNE        1
0462 #define DTV_CLEAR       2
0463 #define DTV_FREQUENCY       3
0464 #define DTV_MODULATION      4
0465 #define DTV_BANDWIDTH_HZ    5
0466 #define DTV_INVERSION       6
0467 #define DTV_DISEQC_MASTER   7
0468 #define DTV_SYMBOL_RATE     8
0469 #define DTV_INNER_FEC       9
0470 #define DTV_VOLTAGE     10
0471 #define DTV_TONE        11
0472 #define DTV_PILOT       12
0473 #define DTV_ROLLOFF     13
0474 #define DTV_DISEQC_SLAVE_REPLY  14
0475 
0476 /* Basic enumeration set for querying unlimited capabilities */
0477 #define DTV_FE_CAPABILITY_COUNT 15
0478 #define DTV_FE_CAPABILITY   16
0479 #define DTV_DELIVERY_SYSTEM 17
0480 
0481 /* ISDB-T and ISDB-Tsb */
0482 #define DTV_ISDBT_PARTIAL_RECEPTION 18
0483 #define DTV_ISDBT_SOUND_BROADCASTING    19
0484 
0485 #define DTV_ISDBT_SB_SUBCHANNEL_ID  20
0486 #define DTV_ISDBT_SB_SEGMENT_IDX    21
0487 #define DTV_ISDBT_SB_SEGMENT_COUNT  22
0488 
0489 #define DTV_ISDBT_LAYERA_FEC            23
0490 #define DTV_ISDBT_LAYERA_MODULATION     24
0491 #define DTV_ISDBT_LAYERA_SEGMENT_COUNT      25
0492 #define DTV_ISDBT_LAYERA_TIME_INTERLEAVING  26
0493 
0494 #define DTV_ISDBT_LAYERB_FEC            27
0495 #define DTV_ISDBT_LAYERB_MODULATION     28
0496 #define DTV_ISDBT_LAYERB_SEGMENT_COUNT      29
0497 #define DTV_ISDBT_LAYERB_TIME_INTERLEAVING  30
0498 
0499 #define DTV_ISDBT_LAYERC_FEC            31
0500 #define DTV_ISDBT_LAYERC_MODULATION     32
0501 #define DTV_ISDBT_LAYERC_SEGMENT_COUNT      33
0502 #define DTV_ISDBT_LAYERC_TIME_INTERLEAVING  34
0503 
0504 #define DTV_API_VERSION     35
0505 
0506 #define DTV_CODE_RATE_HP    36
0507 #define DTV_CODE_RATE_LP    37
0508 #define DTV_GUARD_INTERVAL  38
0509 #define DTV_TRANSMISSION_MODE   39
0510 #define DTV_HIERARCHY       40
0511 
0512 #define DTV_ISDBT_LAYER_ENABLED 41
0513 
0514 #define DTV_STREAM_ID       42
0515 #define DTV_ISDBS_TS_ID_LEGACY  DTV_STREAM_ID
0516 #define DTV_DVBT2_PLP_ID_LEGACY 43
0517 
0518 #define DTV_ENUM_DELSYS     44
0519 
0520 /* ATSC-MH */
0521 #define DTV_ATSCMH_FIC_VER      45
0522 #define DTV_ATSCMH_PARADE_ID        46
0523 #define DTV_ATSCMH_NOG          47
0524 #define DTV_ATSCMH_TNOG         48
0525 #define DTV_ATSCMH_SGN          49
0526 #define DTV_ATSCMH_PRC          50
0527 #define DTV_ATSCMH_RS_FRAME_MODE    51
0528 #define DTV_ATSCMH_RS_FRAME_ENSEMBLE    52
0529 #define DTV_ATSCMH_RS_CODE_MODE_PRI 53
0530 #define DTV_ATSCMH_RS_CODE_MODE_SEC 54
0531 #define DTV_ATSCMH_SCCC_BLOCK_MODE  55
0532 #define DTV_ATSCMH_SCCC_CODE_MODE_A 56
0533 #define DTV_ATSCMH_SCCC_CODE_MODE_B 57
0534 #define DTV_ATSCMH_SCCC_CODE_MODE_C 58
0535 #define DTV_ATSCMH_SCCC_CODE_MODE_D 59
0536 
0537 #define DTV_INTERLEAVING            60
0538 #define DTV_LNA                 61
0539 
0540 /* Quality parameters */
0541 #define DTV_STAT_SIGNAL_STRENGTH    62
0542 #define DTV_STAT_CNR            63
0543 #define DTV_STAT_PRE_ERROR_BIT_COUNT    64
0544 #define DTV_STAT_PRE_TOTAL_BIT_COUNT    65
0545 #define DTV_STAT_POST_ERROR_BIT_COUNT   66
0546 #define DTV_STAT_POST_TOTAL_BIT_COUNT   67
0547 #define DTV_STAT_ERROR_BLOCK_COUNT  68
0548 #define DTV_STAT_TOTAL_BLOCK_COUNT  69
0549 
0550 /* Physical layer scrambling */
0551 #define DTV_SCRAMBLING_SEQUENCE_INDEX   70
0552 
0553 #define DTV_MAX_COMMAND     DTV_SCRAMBLING_SEQUENCE_INDEX
0554 
0555 /**
0556  * enum fe_pilot - Type of pilot tone
0557  *
0558  * @PILOT_ON:   Pilot tones enabled
0559  * @PILOT_OFF:  Pilot tones disabled
0560  * @PILOT_AUTO: Autodetect pilot tones
0561  */
0562 enum fe_pilot {
0563     PILOT_ON,
0564     PILOT_OFF,
0565     PILOT_AUTO,
0566 };
0567 
0568 /**
0569  * enum fe_rolloff - Rolloff factor
0570  * @ROLLOFF_35:     Roloff factor: α=35%
0571  * @ROLLOFF_20:     Roloff factor: α=20%
0572  * @ROLLOFF_25:     Roloff factor: α=25%
0573  * @ROLLOFF_AUTO:   Auto-detect the roloff factor.
0574  *
0575  * .. note:
0576  *
0577  *    Roloff factor of 35% is implied on DVB-S. On DVB-S2, it is default.
0578  */
0579 enum fe_rolloff {
0580     ROLLOFF_35,
0581     ROLLOFF_20,
0582     ROLLOFF_25,
0583     ROLLOFF_AUTO,
0584 };
0585 
0586 /**
0587  * enum fe_delivery_system - Type of the delivery system
0588  *
0589  * @SYS_UNDEFINED:
0590  *  Undefined standard. Generally, indicates an error
0591  * @SYS_DVBC_ANNEX_A:
0592  *  Cable TV: DVB-C following ITU-T J.83 Annex A spec
0593  * @SYS_DVBC_ANNEX_B:
0594  *  Cable TV: DVB-C following ITU-T J.83 Annex B spec (ClearQAM)
0595  * @SYS_DVBC_ANNEX_C:
0596  *  Cable TV: DVB-C following ITU-T J.83 Annex C spec
0597  * @SYS_ISDBC:
0598  *  Cable TV: ISDB-C (no drivers yet)
0599  * @SYS_DVBT:
0600  *  Terrestrial TV: DVB-T
0601  * @SYS_DVBT2:
0602  *  Terrestrial TV: DVB-T2
0603  * @SYS_ISDBT:
0604  *  Terrestrial TV: ISDB-T
0605  * @SYS_ATSC:
0606  *  Terrestrial TV: ATSC
0607  * @SYS_ATSCMH:
0608  *  Terrestrial TV (mobile): ATSC-M/H
0609  * @SYS_DTMB:
0610  *  Terrestrial TV: DTMB
0611  * @SYS_DVBS:
0612  *  Satellite TV: DVB-S
0613  * @SYS_DVBS2:
0614  *  Satellite TV: DVB-S2
0615  * @SYS_TURBO:
0616  *  Satellite TV: DVB-S Turbo
0617  * @SYS_ISDBS:
0618  *  Satellite TV: ISDB-S
0619  * @SYS_DAB:
0620  *  Digital audio: DAB (not fully supported)
0621  * @SYS_DSS:
0622  *  Satellite TV: DSS (not fully supported)
0623  * @SYS_CMMB:
0624  *  Terrestrial TV (mobile): CMMB (not fully supported)
0625  * @SYS_DVBH:
0626  *  Terrestrial TV (mobile): DVB-H (standard deprecated)
0627  */
0628 enum fe_delivery_system {
0629     SYS_UNDEFINED,
0630     SYS_DVBC_ANNEX_A,
0631     SYS_DVBC_ANNEX_B,
0632     SYS_DVBT,
0633     SYS_DSS,
0634     SYS_DVBS,
0635     SYS_DVBS2,
0636     SYS_DVBH,
0637     SYS_ISDBT,
0638     SYS_ISDBS,
0639     SYS_ISDBC,
0640     SYS_ATSC,
0641     SYS_ATSCMH,
0642     SYS_DTMB,
0643     SYS_CMMB,
0644     SYS_DAB,
0645     SYS_DVBT2,
0646     SYS_TURBO,
0647     SYS_DVBC_ANNEX_C,
0648 };
0649 
0650 /* backward compatibility definitions for delivery systems */
0651 #define SYS_DVBC_ANNEX_AC   SYS_DVBC_ANNEX_A
0652 #define SYS_DMBTH       SYS_DTMB /* DMB-TH is legacy name, use DTMB */
0653 
0654 /* ATSC-MH specific parameters */
0655 
0656 /**
0657  * enum atscmh_sccc_block_mode - Type of Series Concatenated Convolutional
0658  *               Code Block Mode.
0659  *
0660  * @ATSCMH_SCCC_BLK_SEP:
0661  *  Separate SCCC: the SCCC outer code mode shall be set independently
0662  *  for each Group Region (A, B, C, D)
0663  * @ATSCMH_SCCC_BLK_COMB:
0664  *  Combined SCCC: all four Regions shall have the same SCCC outer
0665  *  code mode.
0666  * @ATSCMH_SCCC_BLK_RES:
0667  *  Reserved. Shouldn't be used.
0668  */
0669 enum atscmh_sccc_block_mode {
0670     ATSCMH_SCCC_BLK_SEP      = 0,
0671     ATSCMH_SCCC_BLK_COMB     = 1,
0672     ATSCMH_SCCC_BLK_RES      = 2,
0673 };
0674 
0675 /**
0676  * enum atscmh_sccc_code_mode - Type of Series Concatenated Convolutional
0677  *              Code Rate.
0678  *
0679  * @ATSCMH_SCCC_CODE_HLF:
0680  *  The outer code rate of a SCCC Block is 1/2 rate.
0681  * @ATSCMH_SCCC_CODE_QTR:
0682  *  The outer code rate of a SCCC Block is 1/4 rate.
0683  * @ATSCMH_SCCC_CODE_RES:
0684  *  Reserved. Should not be used.
0685  */
0686 enum atscmh_sccc_code_mode {
0687     ATSCMH_SCCC_CODE_HLF     = 0,
0688     ATSCMH_SCCC_CODE_QTR     = 1,
0689     ATSCMH_SCCC_CODE_RES     = 2,
0690 };
0691 
0692 /**
0693  * enum atscmh_rs_frame_ensemble - Reed Solomon(RS) frame ensemble.
0694  *
0695  * @ATSCMH_RSFRAME_ENS_PRI: Primary Ensemble.
0696  * @ATSCMH_RSFRAME_ENS_SEC: Secondary Ensemble.
0697  */
0698 enum atscmh_rs_frame_ensemble {
0699     ATSCMH_RSFRAME_ENS_PRI   = 0,
0700     ATSCMH_RSFRAME_ENS_SEC   = 1,
0701 };
0702 
0703 /**
0704  * enum atscmh_rs_frame_mode - Reed Solomon (RS) frame mode.
0705  *
0706  * @ATSCMH_RSFRAME_PRI_ONLY:
0707  *  Single Frame: There is only a primary RS Frame for all Group
0708  *  Regions.
0709  * @ATSCMH_RSFRAME_PRI_SEC:
0710  *  Dual Frame: There are two separate RS Frames: Primary RS Frame for
0711  *  Group Region A and B and Secondary RS Frame for Group Region C and
0712  *  D.
0713  * @ATSCMH_RSFRAME_RES:
0714  *  Reserved. Shouldn't be used.
0715  */
0716 enum atscmh_rs_frame_mode {
0717     ATSCMH_RSFRAME_PRI_ONLY  = 0,
0718     ATSCMH_RSFRAME_PRI_SEC   = 1,
0719     ATSCMH_RSFRAME_RES       = 2,
0720 };
0721 
0722 /**
0723  * enum atscmh_rs_code_mode
0724  * @ATSCMH_RSCODE_211_187:  Reed Solomon code (211,187).
0725  * @ATSCMH_RSCODE_223_187:  Reed Solomon code (223,187).
0726  * @ATSCMH_RSCODE_235_187:  Reed Solomon code (235,187).
0727  * @ATSCMH_RSCODE_RES:      Reserved. Shouldn't be used.
0728  */
0729 enum atscmh_rs_code_mode {
0730     ATSCMH_RSCODE_211_187    = 0,
0731     ATSCMH_RSCODE_223_187    = 1,
0732     ATSCMH_RSCODE_235_187    = 2,
0733     ATSCMH_RSCODE_RES        = 3,
0734 };
0735 
0736 #define NO_STREAM_ID_FILTER (~0U)
0737 #define LNA_AUTO                (~0U)
0738 
0739 /**
0740  * enum fecap_scale_params - scale types for the quality parameters.
0741  *
0742  * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That
0743  *              could indicate a temporary or a permanent
0744  *              condition.
0745  * @FE_SCALE_DECIBEL: The scale is measured in 0.001 dB steps, typically
0746  *            used on signal measures.
0747  * @FE_SCALE_RELATIVE: The scale is a relative percentual measure,
0748  *             ranging from 0 (0%) to 0xffff (100%).
0749  * @FE_SCALE_COUNTER: The scale counts the occurrence of an event, like
0750  *            bit error, block error, lapsed time.
0751  */
0752 enum fecap_scale_params {
0753     FE_SCALE_NOT_AVAILABLE = 0,
0754     FE_SCALE_DECIBEL,
0755     FE_SCALE_RELATIVE,
0756     FE_SCALE_COUNTER
0757 };
0758 
0759 /**
0760  * struct dtv_stats - Used for reading a DTV status property
0761  *
0762  * @scale:
0763  *  Filled with enum fecap_scale_params - the scale in usage
0764  *  for that parameter
0765  *
0766  * @svalue:
0767  *  integer value of the measure, for %FE_SCALE_DECIBEL,
0768  *  used for dB measures. The unit is 0.001 dB.
0769  *
0770  * @uvalue:
0771  *  unsigned integer value of the measure, used when @scale is
0772  *  either %FE_SCALE_RELATIVE or %FE_SCALE_COUNTER.
0773  *
0774  * For most delivery systems, this will return a single value for each
0775  * parameter.
0776  *
0777  * It should be noticed, however, that new OFDM delivery systems like
0778  * ISDB can use different modulation types for each group of carriers.
0779  * On such standards, up to 8 groups of statistics can be provided, one
0780  * for each carrier group (called "layer" on ISDB).
0781  *
0782  * In order to be consistent with other delivery systems, the first
0783  * value refers to the entire set of carriers ("global").
0784  *
0785  * @scale should use the value %FE_SCALE_NOT_AVAILABLE when
0786  * the value for the entire group of carriers or from one specific layer
0787  * is not provided by the hardware.
0788  *
0789  * @len should be filled with the latest filled status + 1.
0790  *
0791  * In other words, for ISDB, those values should be filled like::
0792  *
0793  *  u.st.stat.svalue[0] = global statistics;
0794  *  u.st.stat.scale[0] = FE_SCALE_DECIBEL;
0795  *  u.st.stat.value[1] = layer A statistics;
0796  *  u.st.stat.scale[1] = FE_SCALE_NOT_AVAILABLE (if not available);
0797  *  u.st.stat.svalue[2] = layer B statistics;
0798  *  u.st.stat.scale[2] = FE_SCALE_DECIBEL;
0799  *  u.st.stat.svalue[3] = layer C statistics;
0800  *  u.st.stat.scale[3] = FE_SCALE_DECIBEL;
0801  *  u.st.len = 4;
0802  */
0803 struct dtv_stats {
0804     __u8 scale; /* enum fecap_scale_params type */
0805     union {
0806         __u64 uvalue;   /* for counters and relative scales */
0807         __s64 svalue;   /* for 0.001 dB measures */
0808     };
0809 } __attribute__ ((packed));
0810 
0811 
0812 #define MAX_DTV_STATS   4
0813 
0814 /**
0815  * struct dtv_fe_stats - store Digital TV frontend statistics
0816  *
0817  * @len:    length of the statistics - if zero, stats is disabled.
0818  * @stat:   array with digital TV statistics.
0819  *
0820  * On most standards, @len can either be 0 or 1. However, for ISDB, each
0821  * layer is modulated in separate. So, each layer may have its own set
0822  * of statistics. If so, stat[0] carries on a global value for the property.
0823  * Indexes 1 to 3 means layer A to B.
0824  */
0825 struct dtv_fe_stats {
0826     __u8 len;
0827     struct dtv_stats stat[MAX_DTV_STATS];
0828 } __attribute__ ((packed));
0829 
0830 /**
0831  * struct dtv_property - store one of frontend command and its value
0832  *
0833  * @cmd:        Digital TV command.
0834  * @reserved:       Not used.
0835  * @u:          Union with the values for the command.
0836  * @u.data:     A unsigned 32 bits integer with command value.
0837  * @u.buffer:       Struct to store bigger properties.
0838  *          Currently unused.
0839  * @u.buffer.data:  an unsigned 32-bits array.
0840  * @u.buffer.len:   number of elements of the buffer.
0841  * @u.buffer.reserved1: Reserved.
0842  * @u.buffer.reserved2: Reserved.
0843  * @u.st:       a &struct dtv_fe_stats array of statistics.
0844  * @result:     Currently unused.
0845  *
0846  */
0847 struct dtv_property {
0848     __u32 cmd;
0849     __u32 reserved[3];
0850     union {
0851         __u32 data;
0852         struct dtv_fe_stats st;
0853         struct {
0854             __u8 data[32];
0855             __u32 len;
0856             __u32 reserved1[3];
0857             void *reserved2;
0858         } buffer;
0859     } u;
0860     int result;
0861 } __attribute__ ((packed));
0862 
0863 /* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
0864 #define DTV_IOCTL_MAX_MSGS 64
0865 
0866 /**
0867  * struct dtv_properties - a set of command/value pairs.
0868  *
0869  * @num:    amount of commands stored at the struct.
0870  * @props:  a pointer to &struct dtv_property.
0871  */
0872 struct dtv_properties {
0873     __u32 num;
0874     struct dtv_property *props;
0875 };
0876 
0877 /*
0878  * When set, this flag will disable any zigzagging or other "normal" tuning
0879  * behavior. Additionally, there will be no automatic monitoring of the lock
0880  * status, and hence no frontend events will be generated. If a frontend device
0881  * is closed, this flag will be automatically turned off when the device is
0882  * reopened read-write.
0883  */
0884 #define FE_TUNE_MODE_ONESHOT 0x01
0885 
0886 /* Digital TV Frontend API calls */
0887 
0888 #define FE_GET_INFO        _IOR('o', 61, struct dvb_frontend_info)
0889 
0890 #define FE_DISEQC_RESET_OVERLOAD   _IO('o', 62)
0891 #define FE_DISEQC_SEND_MASTER_CMD  _IOW('o', 63, struct dvb_diseqc_master_cmd)
0892 #define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
0893 #define FE_DISEQC_SEND_BURST       _IO('o', 65)  /* fe_sec_mini_cmd_t */
0894 
0895 #define FE_SET_TONE        _IO('o', 66)  /* fe_sec_tone_mode_t */
0896 #define FE_SET_VOLTAGE         _IO('o', 67)  /* fe_sec_voltage_t */
0897 #define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68)  /* int */
0898 
0899 #define FE_READ_STATUS         _IOR('o', 69, fe_status_t)
0900 #define FE_READ_BER        _IOR('o', 70, __u32)
0901 #define FE_READ_SIGNAL_STRENGTH    _IOR('o', 71, __u16)
0902 #define FE_READ_SNR        _IOR('o', 72, __u16)
0903 #define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
0904 
0905 #define FE_SET_FRONTEND_TUNE_MODE  _IO('o', 81) /* unsigned int */
0906 #define FE_GET_EVENT           _IOR('o', 78, struct dvb_frontend_event)
0907 
0908 #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
0909 
0910 #define FE_SET_PROPERTY        _IOW('o', 82, struct dtv_properties)
0911 #define FE_GET_PROPERTY        _IOR('o', 83, struct dtv_properties)
0912 
0913 #if defined(__DVB_CORE__) || !defined(__KERNEL__)
0914 
0915 /*
0916  * DEPRECATED: Everything below is deprecated in favor of DVBv5 API
0917  *
0918  * The DVBv3 only ioctls, structs and enums should not be used on
0919  * newer programs, as it doesn't support the second generation of
0920  * digital TV standards, nor supports newer delivery systems.
0921  * They also don't support modern frontends with usually support multiple
0922  * delivery systems.
0923  *
0924  * Drivers shouldn't use them.
0925  *
0926  * New applications should use DVBv5 delivery system instead
0927  */
0928 
0929 /*
0930  */
0931 
0932 enum fe_bandwidth {
0933     BANDWIDTH_8_MHZ,
0934     BANDWIDTH_7_MHZ,
0935     BANDWIDTH_6_MHZ,
0936     BANDWIDTH_AUTO,
0937     BANDWIDTH_5_MHZ,
0938     BANDWIDTH_10_MHZ,
0939     BANDWIDTH_1_712_MHZ,
0940 };
0941 
0942 /* This is kept for legacy userspace support */
0943 typedef enum fe_sec_voltage fe_sec_voltage_t;
0944 typedef enum fe_caps fe_caps_t;
0945 typedef enum fe_type fe_type_t;
0946 typedef enum fe_sec_tone_mode fe_sec_tone_mode_t;
0947 typedef enum fe_sec_mini_cmd fe_sec_mini_cmd_t;
0948 typedef enum fe_status fe_status_t;
0949 typedef enum fe_spectral_inversion fe_spectral_inversion_t;
0950 typedef enum fe_code_rate fe_code_rate_t;
0951 typedef enum fe_modulation fe_modulation_t;
0952 typedef enum fe_transmit_mode fe_transmit_mode_t;
0953 typedef enum fe_bandwidth fe_bandwidth_t;
0954 typedef enum fe_guard_interval fe_guard_interval_t;
0955 typedef enum fe_hierarchy fe_hierarchy_t;
0956 typedef enum fe_pilot fe_pilot_t;
0957 typedef enum fe_rolloff fe_rolloff_t;
0958 typedef enum fe_delivery_system fe_delivery_system_t;
0959 
0960 /* DVBv3 structs */
0961 
0962 struct dvb_qpsk_parameters {
0963     __u32       symbol_rate;  /* symbol rate in Symbols per second */
0964     fe_code_rate_t  fec_inner;    /* forward error correction (see above) */
0965 };
0966 
0967 struct dvb_qam_parameters {
0968     __u32       symbol_rate; /* symbol rate in Symbols per second */
0969     fe_code_rate_t  fec_inner;   /* forward error correction (see above) */
0970     fe_modulation_t modulation;  /* modulation type (see above) */
0971 };
0972 
0973 struct dvb_vsb_parameters {
0974     fe_modulation_t modulation;  /* modulation type (see above) */
0975 };
0976 
0977 struct dvb_ofdm_parameters {
0978     fe_bandwidth_t      bandwidth;
0979     fe_code_rate_t      code_rate_HP;  /* high priority stream code rate */
0980     fe_code_rate_t      code_rate_LP;  /* low priority stream code rate */
0981     fe_modulation_t     constellation; /* modulation type (see above) */
0982     fe_transmit_mode_t  transmission_mode;
0983     fe_guard_interval_t guard_interval;
0984     fe_hierarchy_t      hierarchy_information;
0985 };
0986 
0987 struct dvb_frontend_parameters {
0988     __u32 frequency;  /* (absolute) frequency in Hz for DVB-C/DVB-T/ATSC */
0989               /* intermediate frequency in kHz for DVB-S */
0990     fe_spectral_inversion_t inversion;
0991     union {
0992         struct dvb_qpsk_parameters qpsk;    /* DVB-S */
0993         struct dvb_qam_parameters  qam;     /* DVB-C */
0994         struct dvb_ofdm_parameters ofdm;    /* DVB-T */
0995         struct dvb_vsb_parameters vsb;      /* ATSC */
0996     } u;
0997 };
0998 
0999 struct dvb_frontend_event {
1000     fe_status_t status;
1001     struct dvb_frontend_parameters parameters;
1002 };
1003 
1004 /* DVBv3 API calls */
1005 
1006 #define FE_SET_FRONTEND        _IOW('o', 76, struct dvb_frontend_parameters)
1007 #define FE_GET_FRONTEND        _IOR('o', 77, struct dvb_frontend_parameters)
1008 
1009 #endif
1010 
1011 #endif /*_DVBFRONTEND_H_*/