once again same topic. after short discussion with felix domke on irc, we found that the attached solution is more suitable. also comments are welcome. regards marcel
# HG changeset patch # User Marcel Siegert <mws@xxxxxxxxxxx> # Date Wed Feb 22 22:26:35 2006 +0200 # Node ID de50adc80fa00d9da4c7d9887ff6a023c3aca61e # parent: f13939e6120ba64013534c5f3c37700db2354026 v4l-dvb_add_dvbs2_capabilities.patch From: Marcel Siegert <mws@xxxxxxxxxxx> renamed the fe_type enums to report system instead of used modulation type added new fe_caps enumerations to report new caps for dvb-s2 - fec_rates / modulation types added new fe_code_rates introduced for dvb-s2 by ETSI 300468 V1.7.1 added new modulation types from ETSI 300468 V1.7.1 added new rolloff_factor enums - also defined in ETSI 300468 V1.7.1 renamed dvb_XXXX_parameters to their corresponding fe_type values added new dvb_dvbs2_parameters struct for all renamed flags/enums added backwards compatibility defines added the FE_SET_MODE ioctl that is needed to differ between DVB-S and DVB-S2 tuning modes as on DVB-S2 frontends both modes are supported. this ioctl is ONLY needed that we can use the same dvb_frontend_parameters struct, also extended for the dvbs2_params but with backwards compatibility. on normal "old" frontends (DVB-S/C/T/ATSC) the FE_SET_MODE ioctl is not needed, because these frontend drivers do know about the actual size they will receive/send via the FE_SET_FRONTEND/FE_GET_FRONTEND ioctl's. so backwards compatibility is kept. only an application that has dvb-s2 support will have to use the FE_SET_MODE ioctl explicit to tell the driver what type it should be. Signed-off-by: Marcel Siegert <mws@xxxxxxxxxxx> --- a/linux/include/linux/dvb/frontend.h Sun Feb 19 11:07:47 2006 -0300 +++ b/linux/include/linux/dvb/frontend.h Wed Feb 22 22:26:35 2006 +0200 @@ -30,12 +30,16 @@ typedef enum fe_type { - FE_QPSK, - FE_QAM, - FE_OFDM, - FE_ATSC + FE_DVB_S, + FE_DVB_C, + FE_DVB_T, + FE_ATSC, + FE_DVB_S2 } fe_type_t; +#define FE_QPSK FE_DVB_S +#define FE_QAM FE_DVB_C +#define FE_OFDM FE_DVB_T typedef enum fe_caps { FE_IS_STUPID = 0, @@ -62,6 +66,11 @@ typedef enum fe_caps { FE_CAN_HIERARCHY_AUTO = 0x100000, FE_CAN_8VSB = 0x200000, FE_CAN_16VSB = 0x400000, + FE_CAN_QPSK8 = 0x800000, + FE_CAN_FEC_3_5 = 0x1000000, + FE_CAN_FEC_4_5 = 0x2000000, + FE_CAN_FEC_9_10 = 0x4000000, + FE_CAN_QPSKB = 0x8000000, FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending) FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output @@ -147,7 +156,10 @@ typedef enum fe_code_rate { FEC_6_7, FEC_7_8, FEC_8_9, - FEC_AUTO + FEC_AUTO, + FEC_3_5, + FEC_4_5, + FEC_9_10 } fe_code_rate_t; @@ -160,8 +172,16 @@ typedef enum fe_modulation { QAM_256, QAM_AUTO, VSB_8, - VSB_16 + VSB_16, + QPSK_8, + QPSK_B } fe_modulation_t; + +typedef enum fe_rolloff_factor { + ROLLOFF_ALPHA_0_35, + ROLLOFF_ALPHA_0_25, + ROLLOFF_ALPHA_0_20 +} fe_rolloff_factor_t; typedef enum fe_transmit_mode { TRANSMISSION_MODE_2K, @@ -195,12 +215,12 @@ typedef enum fe_hierarchy { } fe_hierarchy_t; -struct dvb_qpsk_parameters { +struct dvb_dvbs_parameters { __u32 symbol_rate; /* symbol rate in Symbols per second */ fe_code_rate_t fec_inner; /* forward error correction (see above) */ }; -struct dvb_qam_parameters { +struct dvb_dvbc_parameters { __u32 symbol_rate; /* symbol rate in Symbols per second */ fe_code_rate_t fec_inner; /* forward error correction (see above) */ fe_modulation_t modulation; /* modulation type (see above) */ @@ -210,7 +230,7 @@ struct dvb_vsb_parameters { fe_modulation_t modulation; /* modulation type (see above) */ }; -struct dvb_ofdm_parameters { +struct dvb_dvbt_parameters { fe_bandwidth_t bandwidth; fe_code_rate_t code_rate_HP; /* high priority stream code rate */ fe_code_rate_t code_rate_LP; /* low priority stream code rate */ @@ -220,19 +240,29 @@ struct dvb_ofdm_parameters { fe_hierarchy_t hierarchy_information; }; +struct dvb_dvbs2_parameters { + __u32 symbol_rate; /* symbol rate in Symbols per second */ + fe_code_rate_t fec_inner; /* forward error correction (see above) */ + fe_rolloff_factor_t rolloff_factor; /* rolloff factor needed for dvb-s2 */ + fe_modulation_t modulation; /* modulation type (see above) */ +}; + +#define dvb_qpsk_parameters dvb_dvbs_parameters +#define dvb_qam_parameters dvb_dvbc_parameters +#define dvb_ofdm_parameters dvb_dvbt_parameters struct dvb_frontend_parameters { __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */ /* intermediate frequency in kHz for QPSK */ fe_spectral_inversion_t inversion; union { - struct dvb_qpsk_parameters qpsk; - struct dvb_qam_parameters qam; - struct dvb_ofdm_parameters ofdm; + struct dvb_dvbs_parameters qpsk; + struct dvb_dvbc_parameters qam; + struct dvb_dvbt_parameters ofdm; struct dvb_vsb_parameters vsb; + struct dvb_dvbs2_parameters qpsk2; } u; }; - struct dvb_frontend_event { fe_status_t status; @@ -270,6 +300,8 @@ struct dvb_frontend_event { #define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) #define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) #define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */ +#define FE_SET_MODE _IO('o', 82) /* fe_type_t */ + #define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event) #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
_______________________________________________ linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb