From 82a9223e1afac8f52c54cd0c94e65f05063be6bd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 26 Dec 2018 22:42:57 +0100 Subject: [PATCH] simplify some more USE_STB_HAL defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/591b34eb42705a2e9e27230464f6cda8e1f283e6 Author: vanhofen Date: 2018-12-26 (Wed, 26 Dec 2018) Origin message was: ------------------ - simplify some more USE_STB_HAL defines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 2 +- src/system/settings.h | 2 +- src/zapit/include/private/linux/dvb/dmx.h | 10 +- .../include/private/linux/dvb/frontend.h | 251 +++++++++--------- src/zapit/include/private/linux/dvb/video.h | 5 +- 5 files changed, 139 insertions(+), 131 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 3eb8e961d..a23db8987 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -306,7 +306,7 @@ const lcd_setting_struct_t lcd_setting[SNeutrinoSettings::LCD_SETTING_COUNT] = {"lcd_show_volume" , DEFAULT_LCD_SHOW_VOLUME }, {"lcd_autodimm" , DEFAULT_LCD_AUTODIMM }, {"lcd_deepbrightness" , DEFAULT_VFD_STANDBYBRIGHTNESS } -#if HAVE_TRIPLEDRAGON || USE_STB_HAL +#if USE_STB_HAL ,{ "lcd_epgmode" , 0 /*DEFAULT_LCD_EPGMODE*/ } #endif }; diff --git a/src/system/settings.h b/src/system/settings.h index c3a47886a..6dcee2ad9 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -780,7 +780,7 @@ struct SNeutrinoSettings LCD_SHOW_VOLUME , LCD_AUTODIMM , LCD_DEEPSTANDBY_BRIGHTNESS, -#if HAVE_TRIPLEDRAGON || USE_STB_HAL +#if USE_STB_HAL LCD_EPGMODE , #endif LCD_SETTING_COUNT diff --git a/src/zapit/include/private/linux/dvb/dmx.h b/src/zapit/include/private/linux/dvb/dmx.h index b4fb650d9..427e4899e 100644 --- a/src/zapit/include/private/linux/dvb/dmx.h +++ b/src/zapit/include/private/linux/dvb/dmx.h @@ -32,7 +32,7 @@ #define DMX_FILTER_SIZE 16 -typedef enum +enum dmx_output { DMX_OUT_DECODER, /* Streaming directly to decoder. */ DMX_OUT_TAP, /* Output going to a memory buffer */ @@ -41,10 +41,11 @@ typedef enum /* (to be retrieved by reading from the */ /* logical DVR device). */ DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */ -} dmx_output_t; +}; +typedef enum dmx_output dmx_output_t; -typedef enum +typedef enum dmx_input { DMX_IN_FRONTEND, /* Input from a front-end device. */ DMX_IN_DVR /* Input from the logical DVR device. */ @@ -122,7 +123,7 @@ typedef struct dmx_caps { int num_decoders; } dmx_caps_t; -typedef enum { +typedef enum dmx_source { DMX_SOURCE_FRONT0 = 0, DMX_SOURCE_FRONT1, DMX_SOURCE_FRONT2, @@ -139,7 +140,6 @@ struct dmx_stc { __u64 stc; /* output: stc in 'base'*90 kHz units */ }; - #define DMX_START _IO('o', 41) #define DMX_STOP _IO('o', 42) #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) diff --git a/src/zapit/include/private/linux/dvb/frontend.h b/src/zapit/include/private/linux/dvb/frontend.h index 838c05ede..00a20cd21 100644 --- a/src/zapit/include/private/linux/dvb/frontend.h +++ b/src/zapit/include/private/linux/dvb/frontend.h @@ -28,15 +28,14 @@ #include -typedef enum fe_type { +enum fe_type { FE_QPSK, FE_QAM, FE_OFDM, FE_ATSC -} fe_type_t; +}; - -typedef enum fe_caps { +enum fe_caps { FE_IS_STUPID = 0, FE_CAN_INVERSION_AUTO = 0x1, FE_CAN_FEC_1_2 = 0x2, @@ -68,12 +67,11 @@ typedef enum fe_caps { 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 */ -} fe_caps_t; - +}; struct dvb_frontend_info { char name[128]; - fe_type_t type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */ + enum fe_type type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */ __u32 frequency_min; __u32 frequency_max; __u32 frequency_stepsize; @@ -82,7 +80,7 @@ struct dvb_frontend_info { __u32 symbol_rate_max; __u32 symbol_rate_tolerance; /* ppm */ __u32 notifier_delay; /* DEPRECATED */ - fe_caps_t caps; + enum fe_caps caps; }; @@ -95,32 +93,27 @@ struct dvb_diseqc_master_cmd { __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 { +enum fe_sec_voltage { SEC_VOLTAGE_13, SEC_VOLTAGE_18, SEC_VOLTAGE_OFF -} fe_sec_voltage_t; +}; - -typedef enum fe_sec_tone_mode { +enum fe_sec_tone_mode { SEC_TONE_ON, SEC_TONE_OFF -} fe_sec_tone_mode_t; +}; - -typedef enum fe_sec_mini_cmd { +enum fe_sec_mini_cmd { SEC_MINI_A, SEC_MINI_B -} fe_sec_mini_cmd_t; - +}; /** * enum fe_status - enumerates the possible frontend status @@ -133,25 +126,23 @@ typedef enum fe_sec_mini_cmd { * @FE_REINIT: frontend was reinitialized, application is recommended * to reset DiSEqC, tone and parameters */ - -typedef enum fe_status { +enum fe_status { FE_HAS_SIGNAL = 0x01, FE_HAS_CARRIER = 0x02, FE_HAS_VITERBI = 0x04, FE_HAS_SYNC = 0x08, FE_HAS_LOCK = 0x10, FE_TIMEDOUT = 0x20, - FE_REINIT = 0x40 -} fe_status_t; + FE_REINIT = 0x40, +}; -typedef enum fe_spectral_inversion { +enum fe_spectral_inversion { INVERSION_OFF, INVERSION_ON, INVERSION_AUTO -} fe_spectral_inversion_t; +}; - -typedef enum fe_code_rate { +enum fe_code_rate { FEC_NONE = 0, FEC_1_2, FEC_2_3, @@ -164,11 +155,10 @@ typedef enum fe_code_rate { FEC_AUTO, FEC_3_5, FEC_9_10, - FEC_2_5 -} fe_code_rate_t; + FEC_2_5, +}; - -typedef enum fe_modulation { +enum fe_modulation { QPSK, QAM_16, QAM_32, @@ -182,10 +172,10 @@ typedef enum fe_modulation { APSK_16, APSK_32, DQPSK, - QAM_4_NR -} fe_modulation_t; + QAM_4_NR, +}; -typedef enum fe_transmit_mode { +enum fe_transmit_mode { TRANSMISSION_MODE_2K, TRANSMISSION_MODE_8K, TRANSMISSION_MODE_AUTO, @@ -194,22 +184,10 @@ typedef enum fe_transmit_mode { TRANSMISSION_MODE_16K, TRANSMISSION_MODE_32K, TRANSMISSION_MODE_C1, - TRANSMISSION_MODE_C3780 -} fe_transmit_mode_t; + TRANSMISSION_MODE_C3780, +}; -#if defined(__DVB_CORE__) || !defined (__KERNEL__) -typedef enum fe_bandwidth { - BANDWIDTH_8_MHZ, - BANDWIDTH_7_MHZ, - BANDWIDTH_6_MHZ, - BANDWIDTH_AUTO, - BANDWIDTH_5_MHZ, - BANDWIDTH_10_MHZ, - BANDWIDTH_1_712_MHZ -} fe_bandwidth_t; -#endif - -typedef enum fe_guard_interval { +enum fe_guard_interval { GUARD_INTERVAL_1_32, GUARD_INTERVAL_1_16, GUARD_INTERVAL_1_8, @@ -220,70 +198,24 @@ typedef enum fe_guard_interval { GUARD_INTERVAL_19_256, GUARD_INTERVAL_PN420, GUARD_INTERVAL_PN595, - GUARD_INTERVAL_PN945 -} fe_guard_interval_t; + GUARD_INTERVAL_PN945, +}; - -typedef enum fe_hierarchy { +enum fe_hierarchy { HIERARCHY_NONE, HIERARCHY_1, HIERARCHY_2, HIERARCHY_4, HIERARCHY_AUTO -} fe_hierarchy_t; +}; enum fe_interleaving { INTERLEAVING_NONE, INTERLEAVING_AUTO, INTERLEAVING_240, - INTERLEAVING_720 + INTERLEAVING_720, }; -#if defined(__DVB_CORE__) || !defined (__KERNEL__) -struct dvb_qpsk_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 { - __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) */ -}; - -struct dvb_vsb_parameters { - fe_modulation_t modulation; /* modulation type (see above) */ -}; - -struct dvb_ofdm_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 */ - fe_modulation_t constellation; /* modulation type (see above) */ - fe_transmit_mode_t transmission_mode; - fe_guard_interval_t guard_interval; - fe_hierarchy_t hierarchy_information; -}; - - -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_vsb_parameters vsb; - } u; -}; - -struct dvb_frontend_event { - fe_status_t status; - struct dvb_frontend_parameters parameters; -}; -#endif - /* S2API Commands */ #define DTV_UNDEFINED 0 #define DTV_TUNE 1 @@ -377,20 +309,20 @@ struct dvb_frontend_event { #define DTV_MAX_COMMAND DTV_STAT_TOTAL_BLOCK_COUNT -typedef enum fe_pilot { +enum fe_pilot { PILOT_ON, PILOT_OFF, - PILOT_AUTO -} fe_pilot_t; + PILOT_AUTO, +}; -typedef enum fe_rolloff { +enum fe_rolloff { ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */ ROLLOFF_20, ROLLOFF_25, - ROLLOFF_AUTO -} fe_rolloff_t; + ROLLOFF_AUTO, +}; -typedef enum fe_delivery_system { +enum fe_delivery_system { SYS_UNDEFINED, SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_B, @@ -409,8 +341,8 @@ typedef enum fe_delivery_system { SYS_DAB, SYS_DVBT2, SYS_TURBO, - SYS_DVBC_ANNEX_C -} fe_delivery_system_t; + SYS_DVBC_ANNEX_C, +}; /* backward compatibility */ #define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A @@ -421,31 +353,31 @@ typedef enum fe_delivery_system { enum atscmh_sccc_block_mode { ATSCMH_SCCC_BLK_SEP = 0, ATSCMH_SCCC_BLK_COMB = 1, - ATSCMH_SCCC_BLK_RES = 2 + ATSCMH_SCCC_BLK_RES = 2, }; enum atscmh_sccc_code_mode { ATSCMH_SCCC_CODE_HLF = 0, ATSCMH_SCCC_CODE_QTR = 1, - ATSCMH_SCCC_CODE_RES = 2 + ATSCMH_SCCC_CODE_RES = 2, }; enum atscmh_rs_frame_ensemble { ATSCMH_RSFRAME_ENS_PRI = 0, - ATSCMH_RSFRAME_ENS_SEC = 1 + ATSCMH_RSFRAME_ENS_SEC = 1, }; enum atscmh_rs_frame_mode { ATSCMH_RSFRAME_PRI_ONLY = 0, ATSCMH_RSFRAME_PRI_SEC = 1, - ATSCMH_RSFRAME_RES = 2 + ATSCMH_RSFRAME_RES = 2, }; enum atscmh_rs_code_mode { ATSCMH_RSCODE_211_187 = 0, ATSCMH_RSCODE_223_187 = 1, ATSCMH_RSCODE_235_187 = 2, - ATSCMH_RSCODE_RES = 3 + ATSCMH_RSCODE_RES = 3, }; #define NO_STREAM_ID_FILTER (~0U) @@ -467,7 +399,7 @@ struct dtv_cmds_h { * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That * could indicate a temporary or a permanent * condition. - * @FE_SCALE_DECIBEL: The scale is measured in 0.0001 dB steps, typically + * @FE_SCALE_DECIBEL: The scale is measured in 0.001 dB steps, typically * used on signal measures. * @FE_SCALE_RELATIVE: The scale is a relative percentual measure, * ranging from 0 (0%) to 0xffff (100%). @@ -503,20 +435,20 @@ enum fecap_scale_params { * * In other words, for ISDB, those values should be filled like: * u.st.stat.svalue[0] = global statistics; - * u.st.stat.scale[0] = FE_SCALE_DECIBELS; + * u.st.stat.scale[0] = FE_SCALE_DECIBEL; * u.st.stat.value[1] = layer A statistics; * u.st.stat.scale[1] = FE_SCALE_NOT_AVAILABLE (if not available); * u.st.stat.svalue[2] = layer B statistics; - * u.st.stat.scale[2] = FE_SCALE_DECIBELS; + * u.st.stat.scale[2] = FE_SCALE_DECIBEL; * u.st.stat.svalue[3] = layer C statistics; - * u.st.stat.scale[3] = FE_SCALE_DECIBELS; + * u.st.stat.scale[3] = FE_SCALE_DECIBEL; * u.st.len = 4; */ struct dtv_stats { __u8 scale; /* enum fecap_scale_params type */ union { __u64 uvalue; /* for counters and relative scales */ - __s64 svalue; /* for 0.0001 dB measures */ + __s64 svalue; /* for 0.001 dB measures */ }; } __attribute__ ((packed)); @@ -552,10 +484,88 @@ struct dtv_properties { struct dtv_property *props; }; +#if defined(__DVB_CORE__) || !defined (__KERNEL__) + +/* + * DEPRECATED: The DVBv3 ioctls, structs and enums should not be used on + * newer programs, as it doesn't support the second generation of digital + * TV standards, nor supports newer delivery systems. + */ + +enum fe_bandwidth { + BANDWIDTH_8_MHZ, + BANDWIDTH_7_MHZ, + BANDWIDTH_6_MHZ, + BANDWIDTH_AUTO, + BANDWIDTH_5_MHZ, + BANDWIDTH_10_MHZ, + BANDWIDTH_1_712_MHZ, +}; + +/* This is needed for legacy userspace support */ +typedef enum fe_sec_voltage fe_sec_voltage_t; +typedef enum fe_caps fe_caps_t; +typedef enum fe_type fe_type_t; +typedef enum fe_sec_tone_mode fe_sec_tone_mode_t; +typedef enum fe_sec_mini_cmd fe_sec_mini_cmd_t; +typedef enum fe_status fe_status_t; +typedef enum fe_spectral_inversion fe_spectral_inversion_t; +typedef enum fe_code_rate fe_code_rate_t; +typedef enum fe_modulation fe_modulation_t; +typedef enum fe_transmit_mode fe_transmit_mode_t; +typedef enum fe_bandwidth fe_bandwidth_t; +typedef enum fe_guard_interval fe_guard_interval_t; +typedef enum fe_hierarchy fe_hierarchy_t; +typedef enum fe_pilot fe_pilot_t; +typedef enum fe_rolloff fe_rolloff_t; +typedef enum fe_delivery_system fe_delivery_system_t; + +struct dvb_qpsk_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 { + __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) */ +}; + +struct dvb_vsb_parameters { + fe_modulation_t modulation; /* modulation type (see above) */ +}; + +struct dvb_ofdm_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 */ + fe_modulation_t constellation; /* modulation type (see above) */ + fe_transmit_mode_t transmission_mode; + fe_guard_interval_t guard_interval; + fe_hierarchy_t hierarchy_information; +}; + +struct dvb_frontend_parameters { + __u32 frequency; /* (absolute) frequency in Hz for DVB-C/DVB-T/ATSC */ + /* intermediate frequency in kHz for DVB-S */ + fe_spectral_inversion_t inversion; + union { + struct dvb_qpsk_parameters qpsk; /* DVB-S */ + struct dvb_qam_parameters qam; /* DVB-C */ + struct dvb_ofdm_parameters ofdm; /* DVB-T */ + struct dvb_vsb_parameters vsb; /* ATSC */ + } u; +}; + +struct dvb_frontend_event { + fe_status_t status; + struct dvb_frontend_parameters parameters; +}; +#endif + #define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties) #define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties) - /** * When set, this flag will disable any zigzagging or other "normal" tuning * behaviour. Additionally, there will be no automatic monitoring of the lock @@ -565,7 +575,6 @@ struct dtv_properties { */ #define FE_TUNE_MODE_ONESHOT 0x01 - #define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) #define FE_DISEQC_RESET_OVERLOAD _IO('o', 62) diff --git a/src/zapit/include/private/linux/dvb/video.h b/src/zapit/include/private/linux/dvb/video.h index a86ce29e6..49392564f 100644 --- a/src/zapit/include/private/linux/dvb/video.h +++ b/src/zapit/include/private/linux/dvb/video.h @@ -26,7 +26,6 @@ #include #ifndef __KERNEL__ -#include #include #endif @@ -154,7 +153,7 @@ struct video_status { struct video_still_picture { - char *iFrame; /* pointer to a single iframe in memory */ + char __user *iFrame; /* pointer to a single iframe in memory */ __s32 size; }; @@ -187,7 +186,7 @@ typedef struct video_spu { typedef struct video_spu_palette { /* SPU Palette information */ int length; - __u8 *palette; + __u8 __user *palette; } video_spu_palette_t;