1 /* 2 * Copyright (c) 2011-2014 - Mauro Carvalho Chehab 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License as published by 6 * the Free Software Foundation version 2.1 of the License. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU Lesser General Public License for more details. 12 * 13 * You should have received a copy of the GNU Lesser General Public License 14 * along with this program; if not, write to the Free Software 15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 16 * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 17 * 18 */ 19 20 #ifndef __DVB_FE_PRIV_H 21 #define __DVB_FE_PRIV_H 22 23 #include <libdvbv5/dvb-fe.h> 24 #include <libdvbv5/countries.h> 25 26 enum dvbv3_emulation_type { 27 DVBV3_UNKNOWN = -1, 28 DVBV3_QPSK, 29 DVBV3_QAM, 30 DVBV3_OFDM, 31 DVBV3_ATSC, 32 }; 33 34 struct dvb_v5_counters { 35 uint64_t pre_bit_count; 36 uint64_t pre_bit_error; 37 uint64_t post_bit_count; 38 uint64_t post_bit_error; 39 uint64_t block_count; 40 uint64_t block_error; 41 }; 42 43 struct dvb_v5_stats { 44 struct dtv_property prop[DTV_NUM_STATS_PROPS]; 45 46 struct dvb_v5_counters prev[MAX_DTV_STATS]; 47 struct dvb_v5_counters cur[MAX_DTV_STATS]; 48 49 int has_post_ber[MAX_DTV_STATS]; 50 int has_pre_ber[MAX_DTV_STATS]; 51 int has_per[MAX_DTV_STATS]; 52 53 fe_status_t prev_status; 54 55 }; 56 57 struct dvb_device_priv; 58 59 struct dvb_v5_fe_parms_priv { 60 /* dvbv_v4_fe_parms should be the first element on this struct */ 61 struct dvb_v5_fe_parms p; 62 63 struct dvb_device_priv *dvb; 64 65 int fd; 66 int fe_flags; /* open() flags */ 67 char *fname; 68 int n_props; 69 struct dtv_property dvb_prop[DTV_MAX_COMMAND]; 70 struct dvb_v5_stats stats; 71 72 /* country variant of the delivery system */ 73 enum dvb_country_t country; 74 75 /* Satellite specific stuff */ 76 int high_band; 77 unsigned freq_offset; 78 79 dvb_logfunc_priv logfunc_priv; 80 void *logpriv; 81 }; 82 83 /* Functions used internally by dvb-dev.c. Aren't part of the API */ 84 int dvb_fe_open_fname(struct dvb_v5_fe_parms_priv *parms, char *fname, 85 int flags); 86 void dvb_v5_free(struct dvb_v5_fe_parms_priv *parms); 87 void __dvb_fe_close(struct dvb_v5_fe_parms_priv *parms); 88 89 /* Functions that can be overriden to be executed remotely */ 90 int __dvb_set_sys(struct dvb_v5_fe_parms *p, fe_delivery_system_t sys); 91 int __dvb_fe_get_parms(struct dvb_v5_fe_parms *p); 92 int __dvb_fe_set_parms(struct dvb_v5_fe_parms *p); 93 int __dvb_fe_get_stats(struct dvb_v5_fe_parms *p); 94 95 #endif 96