Path: blob/main/multimedia/dvbsnoop/files/frontend.h
16462 views
/*1* frontend.h2*3* Copyright (C) 2000 Marcus Metzler <[email protected]>4* Ralph Metzler <[email protected]>5* Holger Waechtler <[email protected]>6* Andre Draszik <[email protected]>7* for convergence integrated media GmbH8*9* This program is free software; you can redistribute it and/or10* modify it under the terms of the GNU Lesser General Public License11* as published by the Free Software Foundation; either version 2.112* of the License, or (at your option) any later version.13*14* This program is distributed in the hope that it will be useful,15* but WITHOUT ANY WARRANTY; without even the implied warranty of16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17* GNU General Public License for more details.18*19* You should have received a copy of the GNU Lesser General Public License20* along with this program; if not, write to the Free Software21* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.22*23*/2425#ifndef _DVBFRONTEND_H_26#define _DVBFRONTEND_H_2728#ifndef LINUX_TYPES_ADDED29#define LINUX_TYPES_ADDED30#include <sys/types.h>31typedef uint64_t __u64;32typedef uint32_t __u32;33typedef uint16_t __u16;34typedef uint8_t __u8;35#endif36373839typedef enum fe_type {40FE_QPSK,41FE_QAM,42FE_OFDM,43FE_ATSC44} fe_type_t;454647typedef enum fe_caps {48FE_IS_STUPID = 0,49FE_CAN_INVERSION_AUTO = 0x1,50FE_CAN_FEC_1_2 = 0x2,51FE_CAN_FEC_2_3 = 0x4,52FE_CAN_FEC_3_4 = 0x8,53FE_CAN_FEC_4_5 = 0x10,54FE_CAN_FEC_5_6 = 0x20,55FE_CAN_FEC_6_7 = 0x40,56FE_CAN_FEC_7_8 = 0x80,57FE_CAN_FEC_8_9 = 0x100,58FE_CAN_FEC_AUTO = 0x200,59FE_CAN_QPSK = 0x400,60FE_CAN_QAM_16 = 0x800,61FE_CAN_QAM_32 = 0x1000,62FE_CAN_QAM_64 = 0x2000,63FE_CAN_QAM_128 = 0x4000,64FE_CAN_QAM_256 = 0x8000,65FE_CAN_QAM_AUTO = 0x10000,66FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,67FE_CAN_BANDWIDTH_AUTO = 0x40000,68FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,69FE_CAN_HIERARCHY_AUTO = 0x100000,70FE_CAN_8VSB = 0x200000,71FE_CAN_16VSB = 0x400000,72FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending)73FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically74FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output75} fe_caps_t;767778struct dvb_frontend_info {79char name[128];80fe_type_t type;81__u32 frequency_min;82__u32 frequency_max;83__u32 frequency_stepsize;84__u32 frequency_tolerance;85__u32 symbol_rate_min;86__u32 symbol_rate_max;87__u32 symbol_rate_tolerance; /* ppm */88__u32 notifier_delay; /* DEPRECATED */89fe_caps_t caps;90};919293/**94* Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for95* the meaning of this struct...96*/97struct dvb_diseqc_master_cmd {98__u8 msg [6]; /* { framing, address, command, data [3] } */99__u8 msg_len; /* valid values are 3...6 */100};101102103struct dvb_diseqc_slave_reply {104__u8 msg [4]; /* { framing, data [3] } */105__u8 msg_len; /* valid values are 0...4, 0 means no msg */106int timeout; /* return from ioctl after timeout ms with */107}; /* errorcode when no message was received */108109110typedef enum fe_sec_voltage {111SEC_VOLTAGE_13,112SEC_VOLTAGE_18,113SEC_VOLTAGE_OFF114} fe_sec_voltage_t;115116117typedef enum fe_sec_tone_mode {118SEC_TONE_ON,119SEC_TONE_OFF120} fe_sec_tone_mode_t;121122123typedef enum fe_sec_mini_cmd {124SEC_MINI_A,125SEC_MINI_B126} fe_sec_mini_cmd_t;127128129typedef enum fe_status {130FE_HAS_SIGNAL = 0x01, /* found something above the noise level */131FE_HAS_CARRIER = 0x02, /* found a DVB signal */132FE_HAS_VITERBI = 0x04, /* FEC is stable */133FE_HAS_SYNC = 0x08, /* found sync bytes */134FE_HAS_LOCK = 0x10, /* everything's working... */135FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */136FE_REINIT = 0x40 /* frontend was reinitialized, */137} fe_status_t; /* application is recommended to reset */138/* DiSEqC, tone and parameters */139140typedef enum fe_spectral_inversion {141INVERSION_OFF,142INVERSION_ON,143INVERSION_AUTO144} fe_spectral_inversion_t;145146147typedef enum fe_code_rate {148FEC_NONE = 0,149FEC_1_2,150FEC_2_3,151FEC_3_4,152FEC_4_5,153FEC_5_6,154FEC_6_7,155FEC_7_8,156FEC_8_9,157FEC_AUTO158} fe_code_rate_t;159160161typedef enum fe_modulation {162QPSK,163QAM_16,164QAM_32,165QAM_64,166QAM_128,167QAM_256,168QAM_AUTO,169VSB_8,170VSB_16171} fe_modulation_t;172173typedef enum fe_transmit_mode {174TRANSMISSION_MODE_2K,175TRANSMISSION_MODE_8K,176TRANSMISSION_MODE_AUTO177} fe_transmit_mode_t;178179typedef enum fe_bandwidth {180BANDWIDTH_8_MHZ,181BANDWIDTH_7_MHZ,182BANDWIDTH_6_MHZ,183BANDWIDTH_AUTO184} fe_bandwidth_t;185186187typedef enum fe_guard_interval {188GUARD_INTERVAL_1_32,189GUARD_INTERVAL_1_16,190GUARD_INTERVAL_1_8,191GUARD_INTERVAL_1_4,192GUARD_INTERVAL_AUTO193} fe_guard_interval_t;194195196typedef enum fe_hierarchy {197HIERARCHY_NONE,198HIERARCHY_1,199HIERARCHY_2,200HIERARCHY_4,201HIERARCHY_AUTO202} fe_hierarchy_t;203204205struct dvb_qpsk_parameters {206__u32 symbol_rate; /* symbol rate in Symbols per second */207fe_code_rate_t fec_inner; /* forward error correction (see above) */208};209210211struct dvb_qam_parameters {212__u32 symbol_rate; /* symbol rate in Symbols per second */213fe_code_rate_t fec_inner; /* forward error correction (see above) */214fe_modulation_t modulation; /* modulation type (see above) */215};216217struct dvb_vsb_parameters {218fe_modulation_t modulation; /* modulation type (see above) */219};220221struct dvb_ofdm_parameters {222fe_bandwidth_t bandwidth;223fe_code_rate_t code_rate_HP; /* high priority stream code rate */224fe_code_rate_t code_rate_LP; /* low priority stream code rate */225fe_modulation_t constellation; /* modulation type (see above) */226fe_transmit_mode_t transmission_mode;227fe_guard_interval_t guard_interval;228fe_hierarchy_t hierarchy_information;229};230231232struct dvb_frontend_parameters {233__u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */234/* intermediate frequency in kHz for QPSK */235fe_spectral_inversion_t inversion;236union {237struct dvb_qpsk_parameters qpsk;238struct dvb_qam_parameters qam;239struct dvb_ofdm_parameters ofdm;240struct dvb_vsb_parameters vsb;241} u;242};243244245struct dvb_frontend_event {246fe_status_t status;247struct dvb_frontend_parameters parameters;248};249250251252#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)253254#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)255#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)256#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)257#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */258259#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */260#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */261#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */262263#define FE_READ_STATUS _IOR('o', 69, fe_status_t)264#define FE_READ_BER _IOR('o', 70, __u32)265#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16)266#define FE_READ_SNR _IOR('o', 72, __u16)267#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)268269#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)270#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)271#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)272273#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */274275276#endif /*_DVBFRONTEND_H_*/277278279280