On Mon, May 08, 2006, Manu Abraham wrote: > Updated Patch. > > I hope it addresses a lot of small things here and there .. I will > attach the STB0899's interface to the API in another mail. > Hope i haven't missed out anything that was mentioned. I worked my way though your patch and changed coding style the way *I* like it; maybe it'll upset you, but I think it is more Linuxy this way. Relevant changes: - consistent dvb_ naming for all new enums; looks better and avoids name clashes with the old types (e.g. fe_bandwidth vs. fe_bandwidths) - removed useless _RESERVEDs from the enums - make sure all new enums have a (1 << 31) value so they are 32bit sized even on strange ARM architecturs - moved all legacy cruft at the bottom - shrunk comments - moved modcod to dvb_frontend.h -- I'm relatively convinced there's no use for this in the API (dvbs2_params takes mod + fec instead) - removed coderate_LP and modcod from dvbs2_params -- not needed - added flags field to dvbs2_params (future use, e.g. to add ISI stream filter) - deprecate FE_GET_EVENT and add FE_ACK_EVENTS TODO: - DVB-S2 has physical layer signalling, which I think is similar to DVB-T TPS. I.e. the demod can figure out modulation and fec all by itself. Similarly, roll-off is part fo base-band signalling. So maybe we don't need to set these for tuning and just need the fields for FE_GET_PARAMS (for informational purposes). The hierarchical stuff is till unclear to me. Probably the hardware will just tell you if it detected hierarchical coding, and then you can select one stream. If so, an enum dvb_fe_hierarchy will have to be added to struct dvbs2_params for FE_GET_PARAMS. - DVB-T and maybe DVB-H have cell-ids which can be read from TPS. Should we add support? - FE_GET_PARAMS semantics are still not clear: when calling it, the current delsys is unknow, thus it is not possible to set specific fields to *_IGNORE or != *_IGNORE; one could memset() the struct dvb_frontend_params to zero, then call FE_GET_PARAMS once to find out the current delsys, and then set the interesting fields to != *_IGNORE That's somehow ugly... - I'm still unhappy witht he capabilites; IMHO it doesn't make sense to put full struct foo_params in there. E.g. a DVB-S frontend is usually 100% compliant (I don't know any which isn't), so why have capability flags for e.g. each FEC required by the DVB-S standard? Similar for DVB-C and T. For DVB-S2 it might make sense to check for broadcast vs. advance data modes and have that as capability flags. Or special stuff like CAP_BANDWIDTH_AUTO (assuming there's a device which can do it) etc. I have spent way more time on this than I planned. Someone else will have to take it from there. My patch is totally untested and probably constains lots of syntax errors. Thanks, Johannes
diff -r 38162695285b linux/drivers/media/dvb/dvb-core/dvb_frontend.c --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c Tue May 09 10:15:42 2006 -0300 +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c Wed May 10 03:50:19 2006 +0200 @@ -93,7 +93,11 @@ struct dvb_frontend_private { /* thread/frontend values */ struct dvb_device *dvbdev; + /* Legacy datatype, superseded by params */ struct dvb_frontend_parameters parameters; + /* params supersedes parameters */ + struct dvb_frontend_params params; + struct dvb_frontend_cap caps; struct dvb_fe_events events; struct semaphore sem; struct list_head list_head; @@ -124,6 +128,63 @@ struct dvb_frontend_private { unsigned int check_wrapped; }; +struct modcod_table { + enum dvb_fe_modcod modcod; + enum dvb_fe_modulation modulation; + enum dvb_fe_fec fecrate; +}; + +static struct modcod_table dvbs2_modcod_lookup[] = { + { FE_MODCOD_DUMMY_PLFRAME, FE_MOD_UNKNOWN, FE_FEC_UNKNOWN }, + { FE_MODCOD_QPSK_1_4, FE_MOD_QPSK, FE_FEC_1_4 }, + { FE_MODCOD_QPSK_1_3, FE_MOD_QPSK, FE_FEC_1_3 }, + { FE_MODCOD_QPSK_2_5, FE_MOD_QPSK, FE_FEC_2_5 }, + { FE_MODCOD_QPSK_1_2, FE_MOD_QPSK, FE_FEC_1_2 }, + { FE_MODCOD_QPSK_3_5, FE_MOD_QPSK, FE_FEC_3_5 }, + { FE_MODCOD_QPSK_2_3, FE_MOD_QPSK, FE_FEC_2_3 }, + { FE_MODCOD_QPSK_3_4, FE_MOD_QPSK, FE_FEC_3_4 }, + { FE_MODCOD_QPSK_4_5, FE_MOD_QPSK, FE_FEC_4_5 }, + { FE_MODCOD_QPSK_5_6, FE_MOD_QPSK, FE_FEC_5_6 }, + { FE_MODCOD_QPSK_8_9, FE_MOD_QPSK, FE_FEC_8_9 }, + { FE_MODCOD_QPSK_9_10, FE_MOD_QPSK, FE_FEC_9_10 }, + { FE_MODCOD_8PSK_3_5, FE_MOD_8PSK, FE_FEC_3_5 }, + { FE_MODCOD_8PSK_2_3, FE_MOD_8PSK, FE_FEC_2_3 }, + { FE_MODCOD_8PSK_3_4, FE_MOD_8PSK, FE_FEC_3_4 }, + { FE_MODCOD_8PSK_5_6, FE_MOD_8PSK, FE_FEC_5_6 }, + { FE_MODCOD_8PSK_8_9, FE_MOD_8PSK, FE_FEC_8_9 }, + { FE_MODCOD_8PSK_9_10, FE_MOD_8PSK, FE_FEC_9_10 }, + { FE_MODCOD_16APSK_2_3, FE_MOD_16APSK, FE_FEC_2_3 }, + { FE_MODCOD_16APSK_3_4, FE_MOD_16APSK, FE_FEC_3_4 }, + { FE_MODCOD_16APSK_4_5, FE_MOD_16APSK, FE_FEC_4_5 }, + { FE_MODCOD_16APSK_5_6, FE_MOD_16APSK, FE_FEC_5_6 }, + { FE_MODCOD_16APSK_8_9, FE_MOD_16APSK, FE_FEC_8_9 }, + { FE_MODCOD_16APSK_9_10, FE_MOD_16APSK, FE_FEC_9_10 }, + { FE_MODCOD_32APSK_3_4, FE_MOD_32APSK, FE_FEC_3_4 }, + { FE_MODCOD_32APSK_4_5, FE_MOD_32APSK, FE_FEC_4_5 }, + { FE_MODCOD_32APSK_5_6, FE_MOD_32APSK, FE_FEC_5_6 }, + { FE_MODCOD_32APSK_8_9, FE_MOD_32APSK, FE_FEC_8_9 }, + { FE_MODCOD_32APSK_9_10, FE_MOD_32APSK, FE_FEC_9_10 }, + { FE_MODCOD_RESERVED_1, FE_MOD_UNKNOWN, FE_FEC_UNKNOWN }, + { FE_MODCOD_BPSK_1_3, FE_MOD_BPSK, FE_FEC_1_3 }, + { FE_MODCOD_BPSK_1_4, FE_MOD_BPSK, FE_FEC_1_4 }, + { FE_MODCOD_RESERVED_2, FE_MOD_UNKNOWN, FE_FEC_UNKNOWN } +}; + +/** + * Decode DVB-S2 MODCOD field as defined in EN 302 307 + * Section 5.5.2 + */ +void decode_dvbs2_modcod(u32 modcod, + enum dvb_fe_modulation *modulation, + enum dvb_fe_fec *fec) +{ + BUG_ON(modcod >= ARRAY_SIZE(dvbs2_modcod_lookup)); + *modulation = dvbs2_modcod_lookup[modcod].modulation; + *fec = dvbs2_modcod_lookup[modcod].fecrate; + +} +EXPORT_SYMBOL(decode_dvbs2_modcod); + static void dvb_frontend_wakeup(struct dvb_frontend *fe); static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status) @@ -508,7 +569,7 @@ static int dvb_frontend_thread(void *dat unsigned long timeout; char name [15]; fe_status_t s; - struct dvb_frontend_parameters *params; + struct dvb_frontend_params *params; dprintk("%s\n", __FUNCTION__); @@ -564,7 +625,7 @@ static int dvb_frontend_thread(void *dat /* have we been asked to retune? */ params = NULL; if (fepriv->state & FESTATE_RETUNE) { - params = &fepriv->parameters; + params = &fepriv->params; fepriv->state = FESTATE_TUNED; } @@ -977,6 +1038,20 @@ static int dvb_frontend_ioctl(struct ino case FE_SET_FRONTEND_TUNE_MODE: fepriv->tune_mode_flags = (unsigned long) parg; break; + + case FE_GET_CAPS: + if (fe->ops->get_caps) + err = fe->ops->get_caps(fe, (struct dvb_frontend_cap*) parg); + break; + + case FE_SET_PARAMS: + if (fe->ops->set_params) + err = fe->ops->set_params(fe, (struct dvb_frontend_params*) parg); + break; + + case FE_GET_PARAMS: + if (fe->ops->get_params) + err = fe->ops->get_params(fe, (struct dvb_frontend_params*) parg); }; up (&fepriv->sem); diff -r 38162695285b linux/drivers/media/dvb/dvb-core/dvb_frontend.h --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.h Tue May 09 10:15:42 2006 -0300 +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.h Wed May 10 03:50:19 2006 +0200 @@ -98,7 +98,7 @@ struct dvb_frontend_ops { /* if this is set, it overrides the default swzigzag */ int (*tune)(struct dvb_frontend* fe, - struct dvb_frontend_parameters* params, + struct dvb_frontend_params* params, unsigned int mode_flags, int *delay, fe_status_t *status); @@ -125,6 +125,11 @@ struct dvb_frontend_ops { int (*dishnetwork_send_legacy_command)(struct dvb_frontend* fe, unsigned long cmd); int (*i2c_gate_ctrl)(struct dvb_frontend* fe, int enable); + /* These callbacks are based on the superseded IOCTL's */ + int (*get_caps)(struct dvb_frontend* fe, struct dvb_frontend_cap* caps); + int (*set_params)(struct dvb_frontend* fe, struct dvb_frontend_params* params); + int (*get_params)(struct dvb_frontend* fe, struct dvb_frontend_params* params); + struct dvb_tuner_ops tuner_ops; }; @@ -158,4 +163,47 @@ extern void dvb_frontend_sleep_until(str extern void dvb_frontend_sleep_until(struct timeval *waketime, u32 add_usec); extern s32 timeval_usec_diff(struct timeval lasttime, struct timeval curtime); +/* + * DVB-S2 MODCOD values + */ +enum dvb_fe_modcod { + FE_MODCOD_DUMMY_PLFRAME = 0, + FE_MODCOD_QPSK_1_4, + FE_MODCOD_QPSK_1_3, + FE_MODCOD_QPSK_2_5, + FE_MODCOD_QPSK_1_2, + FE_MODCOD_QPSK_3_5, + FE_MODCOD_QPSK_2_3, + FE_MODCOD_QPSK_3_4, + FE_MODCOD_QPSK_4_5, + FE_MODCOD_QPSK_5_6, + FE_MODCOD_QPSK_8_9, + FE_MODCOD_QPSK_9_10, + FE_MODCOD_8PSK_3_5, + FE_MODCOD_8PSK_2_3, + FE_MODCOD_8PSK_3_4, + FE_MODCOD_8PSK_5_6, + FE_MODCOD_8PSK_8_9, + FE_MODCOD_8PSK_9_10, + FE_MODCOD_16APSK_2_3, + FE_MODCOD_16APSK_3_4, + FE_MODCOD_16APSK_4_5, + FE_MODCOD_16APSK_5_6, + FE_MODCOD_16APSK_8_9, + FE_MODCOD_16APSK_9_10, + FE_MODCOD_32APSK_3_4, + FE_MODCOD_32APSK_4_5, + FE_MODCOD_32APSK_5_6, + FE_MODCOD_32APSK_8_9, + FE_MODCOD_32APSK_9_10, + FE_MODCOD_RESERVED_1, + FE_MODCOD_BPSK_1_3, + FE_MODCOD_BPSK_1_4, + FE_MODCOD_RESERVED_2 +}; + +extern void decode_dvbs2_modcod(u32 modcod, + enum dvb_fe_modulation *modulation, + enum dvb_fe_fec *fec); + #endif diff -r 38162695285b linux/include/linux/dvb/frontend.h --- a/linux/include/linux/dvb/frontend.h Tue May 09 10:15:42 2006 -0300 +++ b/linux/include/linux/dvb/frontend.h Wed May 10 03:50:19 2006 +0200 @@ -23,11 +23,407 @@ * */ +/* + * References: + * DVB-S: EN 300 421 + * DVB-S2: EN 302 307, TR 102 376, EN 301 210 + * DVB-C: EN 300 429 + * DVB-T: EN 300 744 + * DVB-H: EN 302 304 + * ATSC: A/53A + */ + #ifndef _DVBFRONTEND_H_ #define _DVBFRONTEND_H_ #include <asm/types.h> + +/* Digital Satellite Equipment Control: + * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for + * the meaning of this struct... + */ +struct dvb_diseqc_master_cmd { + __u8 msg [6]; /* { framing, address, command, data [3] } */ + __u8 msg_len; /* valid values are 3...6 */ +}; + +struct dvb_diseqc_slave_reply { + __u8 msg [4]; /* { framing, data [3] } */ + __u8 msg_len; /* valid values are 0...4, 0 means no msg */ + int timeout; /* return from ioctl after timeout ms with */ +}; /* errorcode when no message was received */ + +typedef enum fe_sec_voltage { + SEC_VOLTAGE_13, + SEC_VOLTAGE_18, + SEC_VOLTAGE_OFF +} fe_sec_voltage_t; + +typedef enum fe_sec_tone_mode { + SEC_TONE_ON, + SEC_TONE_OFF +} fe_sec_tone_mode_t; + +typedef enum fe_sec_mini_cmd { + SEC_MINI_A, + SEC_MINI_B +} fe_sec_mini_cmd_t; + + +#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62) +#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd) +#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply) +#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */ + +#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ + +#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */ +#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */ +#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */ + + +typedef enum fe_status { + FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ + FE_HAS_CARRIER = 0x02, /* found a DVB signal */ + FE_HAS_VITERBI = 0x04, /* FEC is stable */ + FE_HAS_SYNC = 0x08, /* found sync bytes */ + FE_HAS_LOCK = 0x10, /* everything's working... */ + FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ + FE_REINIT = 0x40 /* frontend was reinitialized, */ +} fe_status_t; /* application is recommended to reset */ + /* DiSEqC, tone and parameters */ +#define FE_READ_STATUS _IOR('o', 69, fe_status_t) + +#define FE_READ_BER _IOR('o', 70, __u32) +#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16) +#define FE_READ_SNR _IOR('o', 72, __u16) +#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32) + + +/* When set, this flag will disable any zigzagging or other "normal" tuning + * behaviour. Additionally, there will be no automatic monitoring of the lock + * status, and hence no frontend events will be generated. If a frontend device + * is closed, this flag will be automatically turned off when the device is + * reopened read-write. + */ +#define FE_TUNE_MODE_ONESHOT 0x01 +#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */ + + +/* Support for frontends capable of receiving multiple delivery systems */ +enum dvb_fe_delsys { + FE_DELSYS_DVBS = (1 << 0), + FE_DELSYS_DVBS2 = (1 << 1), + FE_DELSYS_DVBC = (1 << 2), + FE_DELSYS_DVBT = (1 << 3), + FE_DELSYS_DVBH = (1 << 4), + FE_DELSYS_ATSC = (1 << 5), + FE_DELSYS_DSS = (1 << 6), + FE_DELSYS_DUMMY = (1 << 31) // ensure enum has 32bit size +}; + +/* DVB-T/DVB-H/DVB-S2 Nyquist RollOff rate */ +enum dvb_fe_rolloff { + FE_ROLLOFF_35 = 0, + FE_ROLLOFF_25 = 1, + FE_ROLLOFF_20 = 2, + FE_ROLLOFF_RESERVED = 3, + FE_ROLLOFF_DUMMY = (1 << 31) // ensure enum has 32bit size +}; + +/* DVB-T/DVB-S2 Stream Priority for selecting stream in hierarchical coding */ +enum dvb_fe_stream_priority { + FE_STREAM_PRIORITY_HP = (1 << 0), + FE_STREAM_PRIORITY_LP = (1 << 1), + FE_STREAM_PRIORITY_DUMMY= (1 << 31) // ensure enum has 32bit size +}; + +/* Modulation type */ +enum dvb_fe_modulation { + FE_MOD_IGNORE = 0, + FE_MOD_UNKNOWN = (1 << 0), + FE_MOD_BPSK = (1 << 1), + FE_MOD_QPSK = (1 << 2), + FE_MOD_OQPSK = (1 << 3), + FE_MOD_8PSK = (1 << 4), + FE_MOD_16APSK = (1 << 5), + FE_MOD_32APSK = (1 << 6), + FE_MOD_QAM16 = (1 << 7), + FE_MOD_QAM32 = (1 << 8), + FE_MOD_QAM64 = (1 << 9), + FE_MOD_QAM128 = (1 << 10), + FE_MOD_QAM256 = (1 << 11), + FE_MOD_QAM512 = (1 << 12), + FE_MOD_QAM1024 = (1 << 13), + FE_MOD_QAMAUTO = (1 << 14), + FE_MOD_OFDM = (1 << 15), + FE_MOD_COFDM = (1 << 16), + FE_MOD_VSB8 = (1 << 17), + FE_MOD_VSB16 = (1 << 18), + FE_MOD_AUTO = (1 << 31) +}; + +/* FEC (Forward Error Correction) Punctured Coderate */ +enum dvb_fe_fec { + FE_FEC_IGNORE = 0, + FE_FEC_UNKNOWN = (1 << 0), + FE_FEC_1_4 = (1 << 1), + FE_FEC_1_3 = (1 << 2), + FE_FEC_2_5 = (1 << 3), + FE_FEC_1_2 = (1 << 4), + FE_FEC_3_5 = (1 << 5), + FE_FEC_2_3 = (1 << 6), + FE_FEC_3_4 = (1 << 7), + FE_FEC_4_5 = (1 << 8), + FE_FEC_5_6 = (1 << 9), + FE_FEC_6_7 = (1 << 10), + FE_FEC_7_8 = (1 << 11), + FE_FEC_8_9 = (1 << 12), + FE_FEC_9_10 = (1 << 13), + FE_FEC_AUTO = (1 << 31) +}; + +/* DVB-T Channel Bandwidth */ +enum dvb_fe_bandwidth { + FE_BANDWIDTH_IGNORE = 0, + FE_BANDWIDTH_8_MHZ = (1 << 1), + FE_BANDWIDTH_7_MHZ = (1 << 2), + FE_BANDWIDTH_6_MHZ = (1 << 3), + FE_BANDWIDTH_5_MHZ = (1 << 4), + FE_BANDWIDTH_AUTO = (1 << 31) +}; + +/* Spectral Inversion (I/Q swap) */ +enum dvb_fe_inversion { + FE_INVERSION_IGNORE = 0, + FE_INVERSION_OFF = (1 << 0), + FE_INVERSION_ON = (1 << 1), + FE_INVERSION_AUTO = (1 << 31) +}; + +/* DVB-T/DVB-H Transmission mode */ +enum dvb_fe_transmission_mode { + FE_TRANSMISSION_MODE_IGNORE = 0, + FE_TRANSMISSION_MODE_2K = (1 << 1), + FE_TRANSMISSION_MODE_4K = (1 << 2), + FE_TRANSMISSION_MODE_8K = (1 << 3), + FE_TRANSMISSION_MODE_AUTO = (1 << 31) +}; + +/* DVB-T/DVB-H Guard Interval */ +enum dvb_fe_guard_interval { + FE_GUARD_INTERVAL_IGNORE = 0, + FE_GUARD_INTERVAL_1_32 = (1 << 1), + FE_GUARD_INTERVAL_1_16 = (1 << 2), + FE_GUARD_INTERVAL_1_8 = (1 << 3), + FE_GUARD_INTERVAL_1_4 = (1 << 4), + FE_GUARD_INTERVAL_AUTO = (1 << 31) +}; + +/* DVB-T/DVB-H Hierarchial Modulation */ +enum dvb_fe_hierarchy { + FE_HIERARCHY_IGNORE = 0, + FE_HIERARCHY_OFF = (1 << 1), + FE_HIERARCHY_ON = (1 << 2), + FE_HIERARCHY_AUTO = (1 << 31) +}; + +/* DVB-H Interleaver type */ +enum dvb_fe_interleaver { + FE_INTERLEAVER_IGNORE = (0 << 0), + FE_INTERLEAVER_NATIVE = (1 << 1), + FE_INTERLEAVER_INDEPTH = (1 << 2), + FE_INTERLEAVER_AUTO = (1 << 31) +}; + + +/* DVB-H MPE-FEC mode */ +enum dvb_fe_mpefec { + FE_MPEFEC_IGNORE = 0, + FE_MPEFEC_ON = (1 << 1), + FE_MPEFEC_OFF = (1 << 2), + FE_MPEFEC_DUMMY = (1 << 31) +}; + +/* DVB-H Timeslicing mode */ +enum dvb_fe_timeslicing { + FE_TIMESLICING_IGNORE = 0, + FE_TIMESLICING_ON = (1 << 1), + FE_TIMESLICING_OFF = (1 << 2), + FE_TIMESLICING_DUMMY = (1 << 31) +}; + + +/* + * DVB-S parameters + * ETSI EN 300 421 + */ +struct dvbs_params { + __u32 symbol_rate; + + enum dvb_fe_modulation modulation; + enum dvb_fe_fec fec; +}; + +/* + * DVB-S2 parameters + * ETSI EN 302 307, TR 102 376, EN 301 210 + */ +struct dvbs2_params { + __u32 symbol_rate; + __u32 flags; /* for future use, must be 0 for now */ + + enum dvb_fe_modulation modulation; + enum dvb_fe_fec fec; + enum dvb_fe_rolloff rolloff; + enum dvb_fe_stream_priority priority; +}; + +/* + * DSS parameters + */ +struct dss_params { + __u32 symbol_rate; + + enum dvb_fe_modulation modulation; + enum dvb_fe_fec coderate; +}; + +/* + * DVB-C parameters + * ETSI EN 300 429 + */ +struct dvbc_params { + __u32 symbol_rate; + + enum dvb_fe_modulation modulation; + enum dvb_fe_fec fec; +}; + +/* + * DVB-T parameters + * ETSI EN 300 744 + */ +struct dvbt_params { + enum dvb_fe_modulation constellation; + enum dvb_fe_bandwidth bandwidth; + enum dvb_fe_fec code_rate_HP; + enum dvb_fe_fec code_rate_LP; + enum dvb_fe_transmission_mode transmission_mode; + enum dvb_fe_guard_interval guard_interval; + enum dvb_fe_hierarchy hierarchy; + enum dvb_fe_rolloff alpha; + enum dvb_fe_stream_priority priority; +}; + +/* + * DVB-H parameters + * ETSI EN 302 304 + */ +struct dvbh_params { + enum dvb_fe_modulation constellation; + enum dvb_fe_fec code_rate_HP; + enum dvb_fe_fec code_rate_LP; + enum dvb_fe_transmission_mode transmission_mode; + enum dvb_fe_guard_interval guard_interval; + enum dvb_fe_hierarchy hierarchy; + enum dvb_fe_rolloff alpha; + enum dvb_fe_interleaver interleaver; + enum dvb_fe_mpefec mpefec; + enum dvb_fe_timeslicing timeslicing; + enum dvb_fe_stream_priority priority; + __u32 bandwidth; +}; + +/* + * ATSC parameters + * A/53A + */ +struct atsc_params { + enum dvb_fe_modulation modulation; +}; + +/* + * Frontend capability information + */ +struct dvb_frontend_cap { + enum dvb_fe_delsys delsys; /* input */ + + /* outputs: */ + char name[128]; + + __u32 frequency_min; + __u32 frequency_max; + __u32 frequency_stepsize; + __u32 frequency_tolerance; + __u32 symbol_rate_min; + __u32 symbol_rate_max; + __u32 symbol_rate_tolerance; + + __u8 pad[32]; + + union { + struct dvbs_params dvbs; + struct dvbs2_params dvbs2; + struct dss_params dss; + struct dvbc_params dvbc; + struct dvbt_params dvbt; + struct dvbh_params dvbh; + struct atsc_params atsc; + __u8 pad[128]; + }; +}; + +/* Query bitset of supported delivery systems */ +#define FE_GET_DELSYS _IOR('o', 82, enum dvb_fe_delsys) + +/* Get frontend capabilities + * + * struct dvb_frontend_cap.delsys has to be set prior to calling + * the ioctl + */ +#define FE_GET_CAPS _IOWR('o', 83, struct dvb_frontend_cap) + +/* + * Frontend tuning parameters + */ +struct dvb_frontend_params { + __u32 frequency; + + enum dvb_fe_delsys delsys; + enum dvb_fe_inversion inversion; + __u8 pad[32]; + union { + struct dvbs_params dvbs; + struct dvbs2_params dvbs2; + struct dss_params dss; + struct dvbc_params dvbc; + struct dvbt_params dvbt; + struct dvbh_params dvbh; + struct atsc_params atsc; + __u8 pad[128]; + } delsys; +}; + +/* set frontend parameters */ +#define FE_SET_PARAMS _IOW('o', 84, struct dvb_frontend_params) + +/* Get Frontend Parameters + * + * To reduce I2C bus traffic fields which have been set + * to *_IGNORE won't be queried. + */ +#define FE_GET_PARAMS _IOWR('o', 85, struct dvb_frontend_params) + +/* reset frontend fd poll(2) state (by discarding all queued events) */ +#define FE_ACK_EVENTS _IO('o', 86) + + + +/***********************************************************************************/ +/* deprecated legacy types and ioctls, do not use in new applications */ +/***********************************************************************************/ typedef enum fe_type { FE_QPSK, @@ -82,54 +478,6 @@ struct dvb_frontend_info { fe_caps_t caps; }; - -/** - * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for - * the meaning of this struct... - */ -struct dvb_diseqc_master_cmd { - __u8 msg [6]; /* { framing, address, command, data [3] } */ - __u8 msg_len; /* valid values are 3...6 */ -}; - - -struct dvb_diseqc_slave_reply { - __u8 msg [4]; /* { framing, data [3] } */ - __u8 msg_len; /* valid values are 0...4, 0 means no msg */ - int timeout; /* return from ioctl after timeout ms with */ -}; /* errorcode when no message was received */ - - -typedef enum fe_sec_voltage { - SEC_VOLTAGE_13, - SEC_VOLTAGE_18, - SEC_VOLTAGE_OFF -} fe_sec_voltage_t; - - -typedef enum fe_sec_tone_mode { - SEC_TONE_ON, - SEC_TONE_OFF -} fe_sec_tone_mode_t; - - -typedef enum fe_sec_mini_cmd { - SEC_MINI_A, - SEC_MINI_B -} fe_sec_mini_cmd_t; - - -typedef enum fe_status { - FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ - FE_HAS_CARRIER = 0x02, /* found a DVB signal */ - FE_HAS_VITERBI = 0x04, /* FEC is stable */ - FE_HAS_SYNC = 0x08, /* found sync bytes */ - FE_HAS_LOCK = 0x10, /* everything's working... */ - FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ - FE_REINIT = 0x40 /* frontend was reinitialized, */ -} fe_status_t; /* application is recommended to reset */ - /* DiSEqC, tone and parameters */ - typedef enum fe_spectral_inversion { INVERSION_OFF, INVERSION_ON, @@ -240,38 +588,16 @@ struct dvb_frontend_event { }; -/** - * When set, this flag will disable any zigzagging or other "normal" tuning - * behaviour. Additionally, there will be no automatic monitoring of the lock - * status, and hence no frontend events will be generated. If a frontend device - * is closed, this flag will be automatically turned off when the device is - * reopened read-write. - */ -#define FE_TUNE_MODE_ONESHOT 0x01 - - +/* superseded by FE_GET_CAPS */ #define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) -#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62) -#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd) -#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply) -#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */ - -#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */ -#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */ -#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */ - -#define FE_READ_STATUS _IOR('o', 69, fe_status_t) -#define FE_READ_BER _IOR('o', 70, __u32) -#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16) -#define FE_READ_SNR _IOR('o', 72, __u16) -#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32) - +/* superseded by FE_SET_PARAMS */ #define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) +/* superseded by FE_GET_PARAMS */ #define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) -#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */ + +/* superseded by FE_ACK_EVENTS */ #define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event) -#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ #endif /*_DVBFRONTEND_H_*/ diff -r 38162695285b linux/include/linux/dvb/version.h --- a/linux/include/linux/dvb/version.h Tue May 09 10:15:42 2006 -0300 +++ b/linux/include/linux/dvb/version.h Wed May 10 03:50:19 2006 +0200 @@ -24,6 +24,6 @@ #define _DVBVERSION_H_ #define DVB_API_VERSION 3 -#define DVB_API_VERSION_MINOR 1 +#define DVB_API_VERSION_MINOR 2 #endif /*_DVBVERSION_H_*/
_______________________________________________ linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb