1061 lines · c
1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */2/*3 * frontend.h4 *5 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>6 * Ralph Metzler <ralph@convergence.de>7 * Holger Waechtler <holger@convergence.de>8 * Andre Draszik <ad@convergence.de>9 * for convergence integrated media GmbH10 */11 12#ifndef _DVBFRONTEND_H_13#define _DVBFRONTEND_H_14 15#include <linux/types.h>16 17/**18 * enum fe_caps - Frontend capabilities19 *20 * @FE_IS_STUPID: There's something wrong at the21 * frontend, and it can't report its22 * capabilities.23 * @FE_CAN_INVERSION_AUTO: Can auto-detect frequency spectral24 * band inversion25 * @FE_CAN_FEC_1_2: Supports FEC 1/226 * @FE_CAN_FEC_2_3: Supports FEC 2/327 * @FE_CAN_FEC_3_4: Supports FEC 3/428 * @FE_CAN_FEC_4_5: Supports FEC 4/529 * @FE_CAN_FEC_5_6: Supports FEC 5/630 * @FE_CAN_FEC_6_7: Supports FEC 6/731 * @FE_CAN_FEC_7_8: Supports FEC 7/832 * @FE_CAN_FEC_8_9: Supports FEC 8/933 * @FE_CAN_FEC_AUTO: Can auto-detect FEC34 * @FE_CAN_QPSK: Supports QPSK modulation35 * @FE_CAN_QAM_16: Supports 16-QAM modulation36 * @FE_CAN_QAM_32: Supports 32-QAM modulation37 * @FE_CAN_QAM_64: Supports 64-QAM modulation38 * @FE_CAN_QAM_128: Supports 128-QAM modulation39 * @FE_CAN_QAM_256: Supports 256-QAM modulation40 * @FE_CAN_QAM_AUTO: Can auto-detect QAM modulation41 * @FE_CAN_TRANSMISSION_MODE_AUTO: Can auto-detect transmission mode42 * @FE_CAN_BANDWIDTH_AUTO: Can auto-detect bandwidth43 * @FE_CAN_GUARD_INTERVAL_AUTO: Can auto-detect guard interval44 * @FE_CAN_HIERARCHY_AUTO: Can auto-detect hierarchy45 * @FE_CAN_8VSB: Supports 8-VSB modulation46 * @FE_CAN_16VSB: Supporta 16-VSB modulation47 * @FE_HAS_EXTENDED_CAPS: Unused48 * @FE_CAN_MULTISTREAM: Supports multistream filtering49 * @FE_CAN_TURBO_FEC: Supports "turbo FEC" modulation50 * @FE_CAN_2G_MODULATION: Supports "2nd generation" modulation,51 * e. g. DVB-S2, DVB-T2, DVB-C252 * @FE_NEEDS_BENDING: Unused53 * @FE_CAN_RECOVER: Can recover from a cable unplug54 * automatically55 * @FE_CAN_MUTE_TS: Can stop spurious TS data output56 */57enum fe_caps {58 FE_IS_STUPID = 0,59 FE_CAN_INVERSION_AUTO = 0x1,60 FE_CAN_FEC_1_2 = 0x2,61 FE_CAN_FEC_2_3 = 0x4,62 FE_CAN_FEC_3_4 = 0x8,63 FE_CAN_FEC_4_5 = 0x10,64 FE_CAN_FEC_5_6 = 0x20,65 FE_CAN_FEC_6_7 = 0x40,66 FE_CAN_FEC_7_8 = 0x80,67 FE_CAN_FEC_8_9 = 0x100,68 FE_CAN_FEC_AUTO = 0x200,69 FE_CAN_QPSK = 0x400,70 FE_CAN_QAM_16 = 0x800,71 FE_CAN_QAM_32 = 0x1000,72 FE_CAN_QAM_64 = 0x2000,73 FE_CAN_QAM_128 = 0x4000,74 FE_CAN_QAM_256 = 0x8000,75 FE_CAN_QAM_AUTO = 0x10000,76 FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,77 FE_CAN_BANDWIDTH_AUTO = 0x40000,78 FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,79 FE_CAN_HIERARCHY_AUTO = 0x100000,80 FE_CAN_8VSB = 0x200000,81 FE_CAN_16VSB = 0x400000,82 FE_HAS_EXTENDED_CAPS = 0x800000,83 FE_CAN_MULTISTREAM = 0x4000000,84 FE_CAN_TURBO_FEC = 0x8000000,85 FE_CAN_2G_MODULATION = 0x10000000,86 FE_NEEDS_BENDING = 0x20000000,87 FE_CAN_RECOVER = 0x40000000,88 FE_CAN_MUTE_TS = 0x8000000089};90 91/*92 * DEPRECATED: Should be kept just due to backward compatibility.93 */94enum fe_type {95 FE_QPSK,96 FE_QAM,97 FE_OFDM,98 FE_ATSC99};100 101/**102 * struct dvb_frontend_info - Frontend properties and capabilities103 *104 * @name: Name of the frontend105 * @type: **DEPRECATED**.106 * Should not be used on modern programs,107 * as a frontend may have more than one type.108 * In order to get the support types of a given109 * frontend, use :c:type:`DTV_ENUM_DELSYS`110 * instead.111 * @frequency_min: Minimal frequency supported by the frontend.112 * @frequency_max: Minimal frequency supported by the frontend.113 * @frequency_stepsize: All frequencies are multiple of this value.114 * @frequency_tolerance: Frequency tolerance.115 * @symbol_rate_min: Minimal symbol rate, in bauds116 * (for Cable/Satellite systems).117 * @symbol_rate_max: Maximal symbol rate, in bauds118 * (for Cable/Satellite systems).119 * @symbol_rate_tolerance: Maximal symbol rate tolerance, in ppm120 * (for Cable/Satellite systems).121 * @notifier_delay: **DEPRECATED**. Not used by any driver.122 * @caps: Capabilities supported by the frontend,123 * as specified in &enum fe_caps.124 *125 * .. note:126 *127 * #. The frequencies are specified in Hz for Terrestrial and Cable128 * systems.129 * #. The frequencies are specified in kHz for Satellite systems.130 */131struct dvb_frontend_info {132 char name[128];133 enum fe_type type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */134 __u32 frequency_min;135 __u32 frequency_max;136 __u32 frequency_stepsize;137 __u32 frequency_tolerance;138 __u32 symbol_rate_min;139 __u32 symbol_rate_max;140 __u32 symbol_rate_tolerance;141 __u32 notifier_delay; /* DEPRECATED */142 enum fe_caps caps;143};144 145/**146 * struct dvb_diseqc_master_cmd - DiSEqC master command147 *148 * @msg:149 * DiSEqC message to be sent. It contains a 3 bytes header with:150 * framing + address + command, and an optional argument151 * of up to 3 bytes of data.152 * @msg_len:153 * Length of the DiSEqC message. Valid values are 3 to 6.154 *155 * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for156 * the possible messages that can be used.157 */158struct dvb_diseqc_master_cmd {159 __u8 msg[6];160 __u8 msg_len;161};162 163/**164 * struct dvb_diseqc_slave_reply - DiSEqC received data165 *166 * @msg:167 * DiSEqC message buffer to store a message received via DiSEqC.168 * It contains one byte header with: framing and169 * an optional argument of up to 3 bytes of data.170 * @msg_len:171 * Length of the DiSEqC message. Valid values are 0 to 4,172 * where 0 means no message.173 * @timeout:174 * Return from ioctl after timeout ms with errorcode when175 * no message was received.176 *177 * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for178 * the possible messages that can be used.179 */180struct dvb_diseqc_slave_reply {181 __u8 msg[4];182 __u8 msg_len;183 int timeout;184};185 186/**187 * enum fe_sec_voltage - DC Voltage used to feed the LNBf188 *189 * @SEC_VOLTAGE_13: Output 13V to the LNBf190 * @SEC_VOLTAGE_18: Output 18V to the LNBf191 * @SEC_VOLTAGE_OFF: Don't feed the LNBf with a DC voltage192 */193enum fe_sec_voltage {194 SEC_VOLTAGE_13,195 SEC_VOLTAGE_18,196 SEC_VOLTAGE_OFF197};198 199/**200 * enum fe_sec_tone_mode - Type of tone to be send to the LNBf.201 * @SEC_TONE_ON: Sends a 22kHz tone burst to the antenna.202 * @SEC_TONE_OFF: Don't send a 22kHz tone to the antenna (except203 * if the ``FE_DISEQC_*`` ioctls are called).204 */205enum fe_sec_tone_mode {206 SEC_TONE_ON,207 SEC_TONE_OFF208};209 210/**211 * enum fe_sec_mini_cmd - Type of mini burst to be sent212 *213 * @SEC_MINI_A: Sends a mini-DiSEqC 22kHz '0' Tone Burst to select214 * satellite-A215 * @SEC_MINI_B: Sends a mini-DiSEqC 22kHz '1' Data Burst to select216 * satellite-B217 */218enum fe_sec_mini_cmd {219 SEC_MINI_A,220 SEC_MINI_B221};222 223/**224 * enum fe_status - Enumerates the possible frontend status.225 * @FE_NONE: The frontend doesn't have any kind of lock.226 * That's the initial frontend status227 * @FE_HAS_SIGNAL: Has found something above the noise level.228 * @FE_HAS_CARRIER: Has found a signal.229 * @FE_HAS_VITERBI: FEC inner coding (Viterbi, LDPC or other inner code).230 * is stable.231 * @FE_HAS_SYNC: Synchronization bytes was found.232 * @FE_HAS_LOCK: Digital TV were locked and everything is working.233 * @FE_TIMEDOUT: Fo lock within the last about 2 seconds.234 * @FE_REINIT: Frontend was reinitialized, application is recommended235 * to reset DiSEqC, tone and parameters.236 */237enum fe_status {238 FE_NONE = 0x00,239 FE_HAS_SIGNAL = 0x01,240 FE_HAS_CARRIER = 0x02,241 FE_HAS_VITERBI = 0x04,242 FE_HAS_SYNC = 0x08,243 FE_HAS_LOCK = 0x10,244 FE_TIMEDOUT = 0x20,245 FE_REINIT = 0x40,246};247 248/**249 * enum fe_spectral_inversion - Type of inversion band250 *251 * @INVERSION_OFF: Don't do spectral band inversion.252 * @INVERSION_ON: Do spectral band inversion.253 * @INVERSION_AUTO: Autodetect spectral band inversion.254 *255 * This parameter indicates if spectral inversion should be presumed or256 * not. In the automatic setting (``INVERSION_AUTO``) the hardware will try257 * to figure out the correct setting by itself. If the hardware doesn't258 * support, the %dvb_frontend will try to lock at the carrier first with259 * inversion off. If it fails, it will try to enable inversion.260 */261enum fe_spectral_inversion {262 INVERSION_OFF,263 INVERSION_ON,264 INVERSION_AUTO265};266 267/**268 * enum fe_code_rate - Type of Forward Error Correction (FEC)269 *270 * @FEC_NONE: No Forward Error Correction Code271 * @FEC_1_2: Forward Error Correction Code 1/2272 * @FEC_2_3: Forward Error Correction Code 2/3273 * @FEC_3_4: Forward Error Correction Code 3/4274 * @FEC_4_5: Forward Error Correction Code 4/5275 * @FEC_5_6: Forward Error Correction Code 5/6276 * @FEC_6_7: Forward Error Correction Code 6/7277 * @FEC_7_8: Forward Error Correction Code 7/8278 * @FEC_8_9: Forward Error Correction Code 8/9279 * @FEC_AUTO: Autodetect Error Correction Code280 * @FEC_3_5: Forward Error Correction Code 3/5281 * @FEC_9_10: Forward Error Correction Code 9/10282 * @FEC_2_5: Forward Error Correction Code 2/5283 * @FEC_1_3: Forward Error Correction Code 1/3284 * @FEC_1_4: Forward Error Correction Code 1/4285 * @FEC_5_9: Forward Error Correction Code 5/9286 * @FEC_7_9: Forward Error Correction Code 7/9287 * @FEC_8_15: Forward Error Correction Code 8/15288 * @FEC_11_15: Forward Error Correction Code 11/15289 * @FEC_13_18: Forward Error Correction Code 13/18290 * @FEC_9_20: Forward Error Correction Code 9/20291 * @FEC_11_20: Forward Error Correction Code 11/20292 * @FEC_23_36: Forward Error Correction Code 23/36293 * @FEC_25_36: Forward Error Correction Code 25/36294 * @FEC_13_45: Forward Error Correction Code 13/45295 * @FEC_26_45: Forward Error Correction Code 26/45296 * @FEC_28_45: Forward Error Correction Code 28/45297 * @FEC_32_45: Forward Error Correction Code 32/45298 * @FEC_77_90: Forward Error Correction Code 77/90299 * @FEC_11_45: Forward Error Correction Code 11/45300 * @FEC_4_15: Forward Error Correction Code 4/15301 * @FEC_14_45: Forward Error Correction Code 14/45302 * @FEC_7_15: Forward Error Correction Code 7/15303 *304 * Please note that not all FEC types are supported by a given standard.305 */306enum fe_code_rate {307 FEC_NONE = 0,308 FEC_1_2,309 FEC_2_3,310 FEC_3_4,311 FEC_4_5,312 FEC_5_6,313 FEC_6_7,314 FEC_7_8,315 FEC_8_9,316 FEC_AUTO,317 FEC_3_5,318 FEC_9_10,319 FEC_2_5,320 FEC_1_3,321 FEC_1_4,322 FEC_5_9,323 FEC_7_9,324 FEC_8_15,325 FEC_11_15,326 FEC_13_18,327 FEC_9_20,328 FEC_11_20,329 FEC_23_36,330 FEC_25_36,331 FEC_13_45,332 FEC_26_45,333 FEC_28_45,334 FEC_32_45,335 FEC_77_90,336 FEC_11_45,337 FEC_4_15,338 FEC_14_45,339 FEC_7_15,340};341 342/**343 * enum fe_modulation - Type of modulation/constellation344 * @QPSK: QPSK modulation345 * @QAM_16: 16-QAM modulation346 * @QAM_32: 32-QAM modulation347 * @QAM_64: 64-QAM modulation348 * @QAM_128: 128-QAM modulation349 * @QAM_256: 256-QAM modulation350 * @QAM_AUTO: Autodetect QAM modulation351 * @VSB_8: 8-VSB modulation352 * @VSB_16: 16-VSB modulation353 * @PSK_8: 8-PSK modulation354 * @APSK_16: 16-APSK modulation355 * @APSK_32: 32-APSK modulation356 * @DQPSK: DQPSK modulation357 * @QAM_4_NR: 4-QAM-NR modulation358 * @QAM_1024: 1024-QAM modulation359 * @QAM_4096: 4096-QAM modulation360 * @APSK_8_L: 8APSK-L modulation361 * @APSK_16_L: 16APSK-L modulation362 * @APSK_32_L: 32APSK-L modulation363 * @APSK_64: 64APSK modulation364 * @APSK_64_L: 64APSK-L modulation365 *366 * Please note that not all modulations are supported by a given standard.367 *368 */369enum fe_modulation {370 QPSK,371 QAM_16,372 QAM_32,373 QAM_64,374 QAM_128,375 QAM_256,376 QAM_AUTO,377 VSB_8,378 VSB_16,379 PSK_8,380 APSK_16,381 APSK_32,382 DQPSK,383 QAM_4_NR,384 QAM_1024,385 QAM_4096,386 APSK_8_L,387 APSK_16_L,388 APSK_32_L,389 APSK_64,390 APSK_64_L,391};392 393/**394 * enum fe_transmit_mode - Transmission mode395 *396 * @TRANSMISSION_MODE_AUTO:397 * Autodetect transmission mode. The hardware will try to find the398 * correct FFT-size (if capable) to fill in the missing parameters.399 * @TRANSMISSION_MODE_1K:400 * Transmission mode 1K401 * @TRANSMISSION_MODE_2K:402 * Transmission mode 2K403 * @TRANSMISSION_MODE_8K:404 * Transmission mode 8K405 * @TRANSMISSION_MODE_4K:406 * Transmission mode 4K407 * @TRANSMISSION_MODE_16K:408 * Transmission mode 16K409 * @TRANSMISSION_MODE_32K:410 * Transmission mode 32K411 * @TRANSMISSION_MODE_C1:412 * Single Carrier (C=1) transmission mode (DTMB only)413 * @TRANSMISSION_MODE_C3780:414 * Multi Carrier (C=3780) transmission mode (DTMB only)415 *416 * Please note that not all transmission modes are supported by a given417 * standard.418 */419enum fe_transmit_mode {420 TRANSMISSION_MODE_2K,421 TRANSMISSION_MODE_8K,422 TRANSMISSION_MODE_AUTO,423 TRANSMISSION_MODE_4K,424 TRANSMISSION_MODE_1K,425 TRANSMISSION_MODE_16K,426 TRANSMISSION_MODE_32K,427 TRANSMISSION_MODE_C1,428 TRANSMISSION_MODE_C3780,429};430 431/**432 * enum fe_guard_interval - Guard interval433 *434 * @GUARD_INTERVAL_AUTO: Autodetect the guard interval435 * @GUARD_INTERVAL_1_128: Guard interval 1/128436 * @GUARD_INTERVAL_1_32: Guard interval 1/32437 * @GUARD_INTERVAL_1_16: Guard interval 1/16438 * @GUARD_INTERVAL_1_8: Guard interval 1/8439 * @GUARD_INTERVAL_1_4: Guard interval 1/4440 * @GUARD_INTERVAL_19_128: Guard interval 19/128441 * @GUARD_INTERVAL_19_256: Guard interval 19/256442 * @GUARD_INTERVAL_PN420: PN length 420 (1/4)443 * @GUARD_INTERVAL_PN595: PN length 595 (1/6)444 * @GUARD_INTERVAL_PN945: PN length 945 (1/9)445 * @GUARD_INTERVAL_1_64: Guard interval 1/64446 *447 * Please note that not all guard intervals are supported by a given standard.448 */449enum fe_guard_interval {450 GUARD_INTERVAL_1_32,451 GUARD_INTERVAL_1_16,452 GUARD_INTERVAL_1_8,453 GUARD_INTERVAL_1_4,454 GUARD_INTERVAL_AUTO,455 GUARD_INTERVAL_1_128,456 GUARD_INTERVAL_19_128,457 GUARD_INTERVAL_19_256,458 GUARD_INTERVAL_PN420,459 GUARD_INTERVAL_PN595,460 GUARD_INTERVAL_PN945,461 GUARD_INTERVAL_1_64,462};463 464/**465 * enum fe_hierarchy - Hierarchy466 * @HIERARCHY_NONE: No hierarchy467 * @HIERARCHY_AUTO: Autodetect hierarchy (if supported)468 * @HIERARCHY_1: Hierarchy 1469 * @HIERARCHY_2: Hierarchy 2470 * @HIERARCHY_4: Hierarchy 4471 *472 * Please note that not all hierarchy types are supported by a given standard.473 */474enum fe_hierarchy {475 HIERARCHY_NONE,476 HIERARCHY_1,477 HIERARCHY_2,478 HIERARCHY_4,479 HIERARCHY_AUTO480};481 482/**483 * enum fe_interleaving - Interleaving484 * @INTERLEAVING_NONE: No interleaving.485 * @INTERLEAVING_AUTO: Auto-detect interleaving.486 * @INTERLEAVING_240: Interleaving of 240 symbols.487 * @INTERLEAVING_720: Interleaving of 720 symbols.488 *489 * Please note that, currently, only DTMB uses it.490 */491enum fe_interleaving {492 INTERLEAVING_NONE,493 INTERLEAVING_AUTO,494 INTERLEAVING_240,495 INTERLEAVING_720,496};497 498/* DVBv5 property Commands */499 500#define DTV_UNDEFINED 0501#define DTV_TUNE 1502#define DTV_CLEAR 2503#define DTV_FREQUENCY 3504#define DTV_MODULATION 4505#define DTV_BANDWIDTH_HZ 5506#define DTV_INVERSION 6507#define DTV_DISEQC_MASTER 7508#define DTV_SYMBOL_RATE 8509#define DTV_INNER_FEC 9510#define DTV_VOLTAGE 10511#define DTV_TONE 11512#define DTV_PILOT 12513#define DTV_ROLLOFF 13514#define DTV_DISEQC_SLAVE_REPLY 14515 516/* Basic enumeration set for querying unlimited capabilities */517#define DTV_FE_CAPABILITY_COUNT 15518#define DTV_FE_CAPABILITY 16519#define DTV_DELIVERY_SYSTEM 17520 521/* ISDB-T and ISDB-Tsb */522#define DTV_ISDBT_PARTIAL_RECEPTION 18523#define DTV_ISDBT_SOUND_BROADCASTING 19524 525#define DTV_ISDBT_SB_SUBCHANNEL_ID 20526#define DTV_ISDBT_SB_SEGMENT_IDX 21527#define DTV_ISDBT_SB_SEGMENT_COUNT 22528 529#define DTV_ISDBT_LAYERA_FEC 23530#define DTV_ISDBT_LAYERA_MODULATION 24531#define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25532#define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26533 534#define DTV_ISDBT_LAYERB_FEC 27535#define DTV_ISDBT_LAYERB_MODULATION 28536#define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29537#define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30538 539#define DTV_ISDBT_LAYERC_FEC 31540#define DTV_ISDBT_LAYERC_MODULATION 32541#define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33542#define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34543 544#define DTV_API_VERSION 35545 546#define DTV_CODE_RATE_HP 36547#define DTV_CODE_RATE_LP 37548#define DTV_GUARD_INTERVAL 38549#define DTV_TRANSMISSION_MODE 39550#define DTV_HIERARCHY 40551 552#define DTV_ISDBT_LAYER_ENABLED 41553 554#define DTV_STREAM_ID 42555#define DTV_ISDBS_TS_ID_LEGACY DTV_STREAM_ID556#define DTV_DVBT2_PLP_ID_LEGACY 43557 558#define DTV_ENUM_DELSYS 44559 560/* ATSC-MH */561#define DTV_ATSCMH_FIC_VER 45562#define DTV_ATSCMH_PARADE_ID 46563#define DTV_ATSCMH_NOG 47564#define DTV_ATSCMH_TNOG 48565#define DTV_ATSCMH_SGN 49566#define DTV_ATSCMH_PRC 50567#define DTV_ATSCMH_RS_FRAME_MODE 51568#define DTV_ATSCMH_RS_FRAME_ENSEMBLE 52569#define DTV_ATSCMH_RS_CODE_MODE_PRI 53570#define DTV_ATSCMH_RS_CODE_MODE_SEC 54571#define DTV_ATSCMH_SCCC_BLOCK_MODE 55572#define DTV_ATSCMH_SCCC_CODE_MODE_A 56573#define DTV_ATSCMH_SCCC_CODE_MODE_B 57574#define DTV_ATSCMH_SCCC_CODE_MODE_C 58575#define DTV_ATSCMH_SCCC_CODE_MODE_D 59576 577#define DTV_INTERLEAVING 60578#define DTV_LNA 61579 580/* Quality parameters */581#define DTV_STAT_SIGNAL_STRENGTH 62582#define DTV_STAT_CNR 63583#define DTV_STAT_PRE_ERROR_BIT_COUNT 64584#define DTV_STAT_PRE_TOTAL_BIT_COUNT 65585#define DTV_STAT_POST_ERROR_BIT_COUNT 66586#define DTV_STAT_POST_TOTAL_BIT_COUNT 67587#define DTV_STAT_ERROR_BLOCK_COUNT 68588#define DTV_STAT_TOTAL_BLOCK_COUNT 69589 590/* Physical layer scrambling */591#define DTV_SCRAMBLING_SEQUENCE_INDEX 70592 593#define DTV_MAX_COMMAND DTV_SCRAMBLING_SEQUENCE_INDEX594 595/**596 * enum fe_pilot - Type of pilot tone597 *598 * @PILOT_ON: Pilot tones enabled599 * @PILOT_OFF: Pilot tones disabled600 * @PILOT_AUTO: Autodetect pilot tones601 */602enum fe_pilot {603 PILOT_ON,604 PILOT_OFF,605 PILOT_AUTO,606};607 608/**609 * enum fe_rolloff - Rolloff factor610 * @ROLLOFF_35: Roloff factor: α=35%611 * @ROLLOFF_20: Roloff factor: α=20%612 * @ROLLOFF_25: Roloff factor: α=25%613 * @ROLLOFF_AUTO: Auto-detect the roloff factor.614 * @ROLLOFF_15: Rolloff factor: α=15%615 * @ROLLOFF_10: Rolloff factor: α=10%616 * @ROLLOFF_5: Rolloff factor: α=5%617 *618 * .. note:619 *620 * Roloff factor of 35% is implied on DVB-S. On DVB-S2, it is default.621 */622enum fe_rolloff {623 ROLLOFF_35,624 ROLLOFF_20,625 ROLLOFF_25,626 ROLLOFF_AUTO,627 ROLLOFF_15,628 ROLLOFF_10,629 ROLLOFF_5,630};631 632/**633 * enum fe_delivery_system - Type of the delivery system634 *635 * @SYS_UNDEFINED:636 * Undefined standard. Generally, indicates an error637 * @SYS_DVBC_ANNEX_A:638 * Cable TV: DVB-C following ITU-T J.83 Annex A spec639 * @SYS_DVBC_ANNEX_B:640 * Cable TV: DVB-C following ITU-T J.83 Annex B spec (ClearQAM)641 * @SYS_DVBC_ANNEX_C:642 * Cable TV: DVB-C following ITU-T J.83 Annex C spec643 * @SYS_DVBC2:644 * Cable TV: DVB-C2645 * @SYS_ISDBC:646 * Cable TV: ISDB-C (no drivers yet)647 * @SYS_DVBT:648 * Terrestrial TV: DVB-T649 * @SYS_DVBT2:650 * Terrestrial TV: DVB-T2651 * @SYS_ISDBT:652 * Terrestrial TV: ISDB-T653 * @SYS_ATSC:654 * Terrestrial TV: ATSC655 * @SYS_ATSCMH:656 * Terrestrial TV (mobile): ATSC-M/H657 * @SYS_DTMB:658 * Terrestrial TV: DTMB659 * @SYS_DVBS:660 * Satellite TV: DVB-S661 * @SYS_DVBS2:662 * Satellite TV: DVB-S2 and DVB-S2X663 * @SYS_TURBO:664 * Satellite TV: DVB-S Turbo665 * @SYS_ISDBS:666 * Satellite TV: ISDB-S667 * @SYS_DAB:668 * Digital audio: DAB (not fully supported)669 * @SYS_DSS:670 * Satellite TV: DSS (not fully supported)671 * @SYS_CMMB:672 * Terrestrial TV (mobile): CMMB (not fully supported)673 * @SYS_DVBH:674 * Terrestrial TV (mobile): DVB-H (standard deprecated)675 */676enum fe_delivery_system {677 SYS_UNDEFINED,678 SYS_DVBC_ANNEX_A,679 SYS_DVBC_ANNEX_B,680 SYS_DVBT,681 SYS_DSS,682 SYS_DVBS,683 SYS_DVBS2,684 SYS_DVBH,685 SYS_ISDBT,686 SYS_ISDBS,687 SYS_ISDBC,688 SYS_ATSC,689 SYS_ATSCMH,690 SYS_DTMB,691 SYS_CMMB,692 SYS_DAB,693 SYS_DVBT2,694 SYS_TURBO,695 SYS_DVBC_ANNEX_C,696 SYS_DVBC2,697};698 699/* backward compatibility definitions for delivery systems */700#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A701#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB */702 703/* ATSC-MH specific parameters */704 705/**706 * enum atscmh_sccc_block_mode - Type of Series Concatenated Convolutional707 * Code Block Mode.708 *709 * @ATSCMH_SCCC_BLK_SEP:710 * Separate SCCC: the SCCC outer code mode shall be set independently711 * for each Group Region (A, B, C, D)712 * @ATSCMH_SCCC_BLK_COMB:713 * Combined SCCC: all four Regions shall have the same SCCC outer714 * code mode.715 * @ATSCMH_SCCC_BLK_RES:716 * Reserved. Shouldn't be used.717 */718enum atscmh_sccc_block_mode {719 ATSCMH_SCCC_BLK_SEP = 0,720 ATSCMH_SCCC_BLK_COMB = 1,721 ATSCMH_SCCC_BLK_RES = 2,722};723 724/**725 * enum atscmh_sccc_code_mode - Type of Series Concatenated Convolutional726 * Code Rate.727 *728 * @ATSCMH_SCCC_CODE_HLF:729 * The outer code rate of a SCCC Block is 1/2 rate.730 * @ATSCMH_SCCC_CODE_QTR:731 * The outer code rate of a SCCC Block is 1/4 rate.732 * @ATSCMH_SCCC_CODE_RES:733 * Reserved. Should not be used.734 */735enum atscmh_sccc_code_mode {736 ATSCMH_SCCC_CODE_HLF = 0,737 ATSCMH_SCCC_CODE_QTR = 1,738 ATSCMH_SCCC_CODE_RES = 2,739};740 741/**742 * enum atscmh_rs_frame_ensemble - Reed Solomon(RS) frame ensemble.743 *744 * @ATSCMH_RSFRAME_ENS_PRI: Primary Ensemble.745 * @ATSCMH_RSFRAME_ENS_SEC: Secondary Ensemble.746 */747enum atscmh_rs_frame_ensemble {748 ATSCMH_RSFRAME_ENS_PRI = 0,749 ATSCMH_RSFRAME_ENS_SEC = 1,750};751 752/**753 * enum atscmh_rs_frame_mode - Reed Solomon (RS) frame mode.754 *755 * @ATSCMH_RSFRAME_PRI_ONLY:756 * Single Frame: There is only a primary RS Frame for all Group757 * Regions.758 * @ATSCMH_RSFRAME_PRI_SEC:759 * Dual Frame: There are two separate RS Frames: Primary RS Frame for760 * Group Region A and B and Secondary RS Frame for Group Region C and761 * D.762 * @ATSCMH_RSFRAME_RES:763 * Reserved. Shouldn't be used.764 */765enum atscmh_rs_frame_mode {766 ATSCMH_RSFRAME_PRI_ONLY = 0,767 ATSCMH_RSFRAME_PRI_SEC = 1,768 ATSCMH_RSFRAME_RES = 2,769};770 771/**772 * enum atscmh_rs_code_mode - ATSC-M/H Reed Solomon modes773 * @ATSCMH_RSCODE_211_187: Reed Solomon code (211,187).774 * @ATSCMH_RSCODE_223_187: Reed Solomon code (223,187).775 * @ATSCMH_RSCODE_235_187: Reed Solomon code (235,187).776 * @ATSCMH_RSCODE_RES: Reserved. Shouldn't be used.777 */778enum atscmh_rs_code_mode {779 ATSCMH_RSCODE_211_187 = 0,780 ATSCMH_RSCODE_223_187 = 1,781 ATSCMH_RSCODE_235_187 = 2,782 ATSCMH_RSCODE_RES = 3,783};784 785#define NO_STREAM_ID_FILTER (~0U)786#define LNA_AUTO (~0U)787 788/**789 * enum fecap_scale_params - scale types for the quality parameters.790 *791 * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That792 * could indicate a temporary or a permanent793 * condition.794 * @FE_SCALE_DECIBEL: The scale is measured in 0.001 dB steps, typically795 * used on signal measures.796 * @FE_SCALE_RELATIVE: The scale is a relative percentual measure,797 * ranging from 0 (0%) to 0xffff (100%).798 * @FE_SCALE_COUNTER: The scale counts the occurrence of an event, like799 * bit error, block error, lapsed time.800 */801enum fecap_scale_params {802 FE_SCALE_NOT_AVAILABLE = 0,803 FE_SCALE_DECIBEL,804 FE_SCALE_RELATIVE,805 FE_SCALE_COUNTER806};807 808/**809 * struct dtv_stats - Used for reading a DTV status property810 *811 * @scale:812 * Filled with enum fecap_scale_params - the scale in usage813 * for that parameter814 *815 * @svalue:816 * integer value of the measure, for %FE_SCALE_DECIBEL,817 * used for dB measures. The unit is 0.001 dB.818 *819 * @uvalue:820 * unsigned integer value of the measure, used when @scale is821 * either %FE_SCALE_RELATIVE or %FE_SCALE_COUNTER.822 *823 * For most delivery systems, this will return a single value for each824 * parameter.825 *826 * It should be noticed, however, that new OFDM delivery systems like827 * ISDB can use different modulation types for each group of carriers.828 * On such standards, up to 8 groups of statistics can be provided, one829 * for each carrier group (called "layer" on ISDB).830 *831 * In order to be consistent with other delivery systems, the first832 * value refers to the entire set of carriers ("global").833 *834 * @scale should use the value %FE_SCALE_NOT_AVAILABLE when835 * the value for the entire group of carriers or from one specific layer836 * is not provided by the hardware.837 *838 * @len should be filled with the latest filled status + 1.839 *840 * In other words, for ISDB, those values should be filled like::841 *842 * u.st.stat.svalue[0] = global statistics;843 * u.st.stat.scale[0] = FE_SCALE_DECIBEL;844 * u.st.stat.value[1] = layer A statistics;845 * u.st.stat.scale[1] = FE_SCALE_NOT_AVAILABLE (if not available);846 * u.st.stat.svalue[2] = layer B statistics;847 * u.st.stat.scale[2] = FE_SCALE_DECIBEL;848 * u.st.stat.svalue[3] = layer C statistics;849 * u.st.stat.scale[3] = FE_SCALE_DECIBEL;850 * u.st.len = 4;851 */852struct dtv_stats {853 __u8 scale; /* enum fecap_scale_params type */854 union {855 __u64 uvalue; /* for counters and relative scales */856 __s64 svalue; /* for 0.001 dB measures */857 } __attribute__ ((packed));858} __attribute__ ((packed));859 860 861#define MAX_DTV_STATS 4862 863/**864 * struct dtv_fe_stats - store Digital TV frontend statistics865 *866 * @len: length of the statistics - if zero, stats is disabled.867 * @stat: array with digital TV statistics.868 *869 * On most standards, @len can either be 0 or 1. However, for ISDB, each870 * layer is modulated in separate. So, each layer may have its own set871 * of statistics. If so, stat[0] carries on a global value for the property.872 * Indexes 1 to 3 means layer A to B.873 */874struct dtv_fe_stats {875 __u8 len;876 struct dtv_stats stat[MAX_DTV_STATS];877} __attribute__ ((packed));878 879/**880 * struct dtv_property - store one of frontend command and its value881 *882 * @cmd: Digital TV command.883 * @reserved: Not used.884 * @u: Union with the values for the command.885 * @u.data: A unsigned 32 bits integer with command value.886 * @u.buffer: Struct to store bigger properties.887 * Currently unused.888 * @u.buffer.data: an unsigned 32-bits array.889 * @u.buffer.len: number of elements of the buffer.890 * @u.buffer.reserved1: Reserved.891 * @u.buffer.reserved2: Reserved.892 * @u.st: a &struct dtv_fe_stats array of statistics.893 * @result: Currently unused.894 *895 */896struct dtv_property {897 __u32 cmd;898 __u32 reserved[3];899 union {900 __u32 data;901 struct dtv_fe_stats st;902 struct {903 __u8 data[32];904 __u32 len;905 __u32 reserved1[3];906 void *reserved2;907 } buffer;908 } u;909 int result;910} __attribute__ ((packed));911 912/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */913#define DTV_IOCTL_MAX_MSGS 64914 915/**916 * struct dtv_properties - a set of command/value pairs.917 *918 * @num: amount of commands stored at the struct.919 * @props: a pointer to &struct dtv_property.920 */921struct dtv_properties {922 __u32 num;923 struct dtv_property *props;924};925 926/*927 * When set, this flag will disable any zigzagging or other "normal" tuning928 * behavior. Additionally, there will be no automatic monitoring of the lock929 * status, and hence no frontend events will be generated. If a frontend device930 * is closed, this flag will be automatically turned off when the device is931 * reopened read-write.932 */933#define FE_TUNE_MODE_ONESHOT 0x01934 935/* Digital TV Frontend API calls */936 937#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)938 939#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)940#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)941#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)942#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */943 944#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */945#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */946#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */947 948#define FE_READ_STATUS _IOR('o', 69, fe_status_t)949#define FE_READ_BER _IOR('o', 70, __u32)950#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16)951#define FE_READ_SNR _IOR('o', 72, __u16)952#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)953 954#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */955#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)956 957#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */958 959#define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties)960#define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties)961 962#if defined(__DVB_CORE__) || !defined(__KERNEL__)963 964/*965 * DEPRECATED: Everything below is deprecated in favor of DVBv5 API966 *967 * The DVBv3 only ioctls, structs and enums should not be used on968 * newer programs, as it doesn't support the second generation of969 * digital TV standards, nor supports newer delivery systems.970 * They also don't support modern frontends with usually support multiple971 * delivery systems.972 *973 * Drivers shouldn't use them.974 *975 * New applications should use DVBv5 delivery system instead976 */977 978/*979 */980 981enum fe_bandwidth {982 BANDWIDTH_8_MHZ,983 BANDWIDTH_7_MHZ,984 BANDWIDTH_6_MHZ,985 BANDWIDTH_AUTO,986 BANDWIDTH_5_MHZ,987 BANDWIDTH_10_MHZ,988 BANDWIDTH_1_712_MHZ,989};990 991/* This is kept for legacy userspace support */992typedef enum fe_sec_voltage fe_sec_voltage_t;993typedef enum fe_caps fe_caps_t;994typedef enum fe_type fe_type_t;995typedef enum fe_sec_tone_mode fe_sec_tone_mode_t;996typedef enum fe_sec_mini_cmd fe_sec_mini_cmd_t;997typedef enum fe_status fe_status_t;998typedef enum fe_spectral_inversion fe_spectral_inversion_t;999typedef enum fe_code_rate fe_code_rate_t;1000typedef enum fe_modulation fe_modulation_t;1001typedef enum fe_transmit_mode fe_transmit_mode_t;1002typedef enum fe_bandwidth fe_bandwidth_t;1003typedef enum fe_guard_interval fe_guard_interval_t;1004typedef enum fe_hierarchy fe_hierarchy_t;1005typedef enum fe_pilot fe_pilot_t;1006typedef enum fe_rolloff fe_rolloff_t;1007typedef enum fe_delivery_system fe_delivery_system_t;1008 1009/* DVBv3 structs */1010 1011struct dvb_qpsk_parameters {1012 __u32 symbol_rate; /* symbol rate in Symbols per second */1013 fe_code_rate_t fec_inner; /* forward error correction (see above) */1014};1015 1016struct dvb_qam_parameters {1017 __u32 symbol_rate; /* symbol rate in Symbols per second */1018 fe_code_rate_t fec_inner; /* forward error correction (see above) */1019 fe_modulation_t modulation; /* modulation type (see above) */1020};1021 1022struct dvb_vsb_parameters {1023 fe_modulation_t modulation; /* modulation type (see above) */1024};1025 1026struct dvb_ofdm_parameters {1027 fe_bandwidth_t bandwidth;1028 fe_code_rate_t code_rate_HP; /* high priority stream code rate */1029 fe_code_rate_t code_rate_LP; /* low priority stream code rate */1030 fe_modulation_t constellation; /* modulation type (see above) */1031 fe_transmit_mode_t transmission_mode;1032 fe_guard_interval_t guard_interval;1033 fe_hierarchy_t hierarchy_information;1034};1035 1036struct dvb_frontend_parameters {1037 __u32 frequency; /* (absolute) frequency in Hz for DVB-C/DVB-T/ATSC */1038 /* intermediate frequency in kHz for DVB-S */1039 fe_spectral_inversion_t inversion;1040 union {1041 struct dvb_qpsk_parameters qpsk; /* DVB-S */1042 struct dvb_qam_parameters qam; /* DVB-C */1043 struct dvb_ofdm_parameters ofdm; /* DVB-T */1044 struct dvb_vsb_parameters vsb; /* ATSC */1045 } u;1046};1047 1048struct dvb_frontend_event {1049 fe_status_t status;1050 struct dvb_frontend_parameters parameters;1051};1052 1053/* DVBv3 API calls */1054 1055#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)1056#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)1057 1058#endif1059 1060#endif /*_DVBFRONTEND_H_*/1061