From dc56784fdd00537482b0b21f99e2706831e9d2fb Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sun, 21 Sep 2014 09:18:19 +0200 Subject: [PATCH] Revert "linuxdvb: rotor - add Max Rotor Movement field to the frontend config" This reverts commit aaedddc7e05e54af12e1c543bc32ebc4b8b2622c. --- src/input/mpegts/linuxdvb/linuxdvb_en50494.c | 5 ++-- src/input/mpegts/linuxdvb/linuxdvb_frontend.c | 11 +------- src/input/mpegts/linuxdvb/linuxdvb_lnb.c | 10 +++---- src/input/mpegts/linuxdvb/linuxdvb_private.h | 8 +++--- src/input/mpegts/linuxdvb/linuxdvb_rotor.c | 27 +++++++++---------- src/input/mpegts/linuxdvb/linuxdvb_satconf.c | 7 +++-- src/input/mpegts/linuxdvb/linuxdvb_switch.c | 5 ++-- 7 files changed, 27 insertions(+), 46 deletions(-) diff --git a/src/input/mpegts/linuxdvb/linuxdvb_en50494.c b/src/input/mpegts/linuxdvb/linuxdvb_en50494.c index 7119724b..3a888de6 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_en50494.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_en50494.c @@ -157,11 +157,10 @@ const idclass_t linuxdvb_en50494_class = static int linuxdvb_en50494_tune - ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *sc, - linuxdvb_frontend_t *lfe ) + ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *sc, int fd ) { int ret = 0; - int i, fd = lfe->lfe_fe_fd; + int i; linuxdvb_en50494_t *le = (linuxdvb_en50494_t*) ld; linuxdvb_lnb_t *lnb = sc->lse_lnb; diff --git a/src/input/mpegts/linuxdvb/linuxdvb_frontend.c b/src/input/mpegts/linuxdvb/linuxdvb_frontend.c index 19050c91..be3cb32c 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_frontend.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_frontend.c @@ -154,14 +154,6 @@ const idclass_t linuxdvb_frontend_dvbs_class = .list = linuxdvb_satconf_type_list, .def.s = "simple" }, - { - .type = PT_U32, - .id = "max_rotor_move", - .name = "Max Rotor Movement (seconds)", - .off = offsetof(linuxdvb_frontend_t, lfe_max_rotor_move), - .opts = PO_ADVANCED, - .def.u32 = 120 - }, { .id = "networks", .type = PT_NONE, @@ -257,7 +249,7 @@ linuxdvb_frontend_get_grace ( mpegts_input_t *mi, mpegts_mux_t *mm ) linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)mi; int r = 5; if (lfe->lfe_satconf) - r = linuxdvb_satconf_get_grace(lfe, mm); + r = linuxdvb_satconf_get_grace(lfe->lfe_satconf, mm); return r; } @@ -1343,7 +1335,6 @@ linuxdvb_frontend_create lfe->lfe_type = type; strncpy(lfe->lfe_name, name, sizeof(lfe->lfe_name)); lfe->lfe_name[sizeof(lfe->lfe_name)-1] = '\0'; - lfe->lfe_max_rotor_move = 120; lfe = (linuxdvb_frontend_t*)mpegts_input_create0((mpegts_input_t*)lfe, idc, uuid, conf); if (!lfe) return NULL; diff --git a/src/input/mpegts/linuxdvb/linuxdvb_lnb.c b/src/input/mpegts/linuxdvb/linuxdvb_lnb.c index 71085740..f7607f42 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_lnb.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_lnb.c @@ -103,15 +103,14 @@ linuxdvb_lnb_standard_pol static int linuxdvb_lnb_standard_tune - ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, - linuxdvb_frontend_t *lfe ) + ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd ) { /* en50494 does not use the voltage tune. this is happend in the switch */ if (ls->lse_en50494) return 0; int pol = linuxdvb_lnb_standard_pol((linuxdvb_lnb_t*)ld, lm); - return linuxdvb_diseqc_set_volt(lfe->lfe_fe_fd, pol); + return linuxdvb_diseqc_set_volt(fd, pol); } /* @@ -153,11 +152,10 @@ linuxdvb_lnb_bandstack_pol static int linuxdvb_lnb_bandstack_tune - ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, - linuxdvb_frontend_t *lfe ) + ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd ) { int pol = linuxdvb_lnb_bandstack_pol((linuxdvb_lnb_t*)ld, lm); - return linuxdvb_diseqc_set_volt(lfe->lfe_fe_fd, pol); + return linuxdvb_diseqc_set_volt(fd, pol); } /* ************************************************************************** diff --git a/src/input/mpegts/linuxdvb/linuxdvb_private.h b/src/input/mpegts/linuxdvb/linuxdvb_private.h index a0c1c6f8..38bb2b0c 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_private.h +++ b/src/input/mpegts/linuxdvb/linuxdvb_private.h @@ -111,7 +111,6 @@ struct linuxdvb_frontend * Configuration */ int lfe_powersave; - uint32_t lfe_max_rotor_move; /* * Satconf (DVB-S only) @@ -192,10 +191,9 @@ struct linuxdvb_diseqc idnode_t ld_id; const char *ld_type; linuxdvb_satconf_ele_t *ld_satconf; - int (*ld_grace) (linuxdvb_diseqc_t *ld, dvb_mux_t *lm, - linuxdvb_frontend_t *lfe); + int (*ld_grace) (linuxdvb_diseqc_t *ld, dvb_mux_t *lm); int (*ld_tune) (linuxdvb_diseqc_t *ld, dvb_mux_t *lm, - linuxdvb_satconf_ele_t *ls, linuxdvb_frontend_t *lfe); + linuxdvb_satconf_ele_t *ls, int fd); }; struct linuxdvb_lnb @@ -320,7 +318,7 @@ int linuxdvb_satconf_get_priority ( linuxdvb_satconf_t *ls, mpegts_mux_t *mm ); int linuxdvb_satconf_get_grace - ( linuxdvb_frontend_t *lfe, mpegts_mux_t *mm ); + ( linuxdvb_satconf_t *ls, mpegts_mux_t *mm ); void linuxdvb_satconf_post_stop_mux( linuxdvb_satconf_t *ls ); diff --git a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c index e920bd4c..e83ad681 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c @@ -131,14 +131,14 @@ const idclass_t linuxdvb_rotor_usals_class = static int linuxdvb_rotor_grace - ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_frontend_t *lfe ) + ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm ) { linuxdvb_rotor_t *lr = (linuxdvb_rotor_t*)ld; linuxdvb_satconf_t *ls = ld->ld_satconf->lse_parent; int newpos, curpos, delta; if (!ls->ls_orbital_dir || lr->lr_rate == 0) - return lfe->lfe_max_rotor_move; + return 120; if (idnode_is_instance(&lr->ld_id, &linuxdvb_rotor_gotox_class)) newpos = lr->lr_position; /* GotoX */ @@ -183,8 +183,7 @@ linuxdvb_rotor_check_orbital_pos /* GotoX */ static int linuxdvb_rotor_gotox_tune - ( linuxdvb_rotor_t *lr, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, - linuxdvb_frontend_t *lfe ) + ( linuxdvb_rotor_t *lr, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd ) { int i; @@ -192,7 +191,7 @@ linuxdvb_rotor_gotox_tune return 0; for (i = 0; i <= ls->lse_parent->ls_diseqc_repeats; i++) { - if (linuxdvb_diseqc_send(lfe->lfe_fe_fd, 0xE0, 0x31, 0x6B, 1, (int)lr->lr_position)) { + if (linuxdvb_diseqc_send(fd, 0xE0, 0x31, 0x6B, 1, (int)lr->lr_position)) { tvherror("diseqc", "failed to set GOTOX pos %d", lr->lr_position); return -1; } @@ -201,14 +200,13 @@ linuxdvb_rotor_gotox_tune tvhdebug("diseqc", "rotor GOTOX pos %d sent", lr->lr_position); - return linuxdvb_rotor_grace((linuxdvb_diseqc_t*)lr, lm, lfe); + return linuxdvb_rotor_grace((linuxdvb_diseqc_t*)lr,lm); } /* USALS */ static int linuxdvb_rotor_usals_tune - ( linuxdvb_rotor_t *lr, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, - linuxdvb_frontend_t *lfe ) + ( linuxdvb_rotor_t *lr, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd ) { /* * Code originally written in PR #238 by Jason Millard jsm174 @@ -265,14 +263,14 @@ linuxdvb_rotor_usals_tune motor_angle, (motor_angle > 0.0) ? "counter-" : ""); for (i = 0; i <= ls->lse_parent->ls_diseqc_repeats; i++) { - if (linuxdvb_diseqc_send(lfe->lfe_fe_fd, 0xE0, 0x31, 0x6E, 2, angle_1, angle_2)) { + if (linuxdvb_diseqc_send(fd, 0xE0, 0x31, 0x6E, 2, angle_1, angle_2)) { tvherror("diseqc", "failed to send USALS command"); return -1; } usleep(25000); } - return linuxdvb_rotor_grace((linuxdvb_diseqc_t*)lr, lm, lfe); + return linuxdvb_rotor_grace((linuxdvb_diseqc_t*)lr,lm); #undef TO_RAD #undef TO_DEG @@ -280,13 +278,12 @@ linuxdvb_rotor_usals_tune static int linuxdvb_rotor_tune - ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, - linuxdvb_frontend_t *lfe ) + ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd ) { linuxdvb_rotor_t *lr = (linuxdvb_rotor_t*)ld; /* Force to 18v (quicker movement) */ - if (ioctl(lfe->lfe_fe_fd, FE_SET_VOLTAGE, SEC_VOLTAGE_18)) { + if (ioctl(fd, FE_SET_VOLTAGE, SEC_VOLTAGE_18)) { tvherror("diseqc", "failed to set 18v for rotor movement"); return -1; } @@ -294,10 +291,10 @@ linuxdvb_rotor_tune /* GotoX */ if (idnode_is_instance(&lr->ld_id, &linuxdvb_rotor_gotox_class)) - return linuxdvb_rotor_gotox_tune(lr, lm, ls, lfe); + return linuxdvb_rotor_gotox_tune(lr, lm, ls, fd); /* USALS */ - return linuxdvb_rotor_usals_tune(lr, lm, ls, lfe); + return linuxdvb_rotor_usals_tune(lr, lm, ls, fd); } /* ************************************************************************** diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index bdfefdbf..41ad0de8 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -590,9 +590,8 @@ linuxdvb_satconf_post_stop_mux int linuxdvb_satconf_get_grace - ( linuxdvb_frontend_t *lfe, mpegts_mux_t *mm ) + ( linuxdvb_satconf_t *ls, mpegts_mux_t *mm ) { - linuxdvb_satconf_t *ls = lfe->lfe_satconf; linuxdvb_satconf_ele_t *lse = linuxdvb_satconf_find_ele(ls, mm); int i, r = 10; linuxdvb_diseqc_t *lds[] = { @@ -605,7 +604,7 @@ linuxdvb_satconf_get_grace /* Add diseqc delay */ for (i = 0; i < 3; i++) { if (lds[i] && lds[i]->ld_grace) - r += lds[i]->ld_grace(lds[i], (dvb_mux_t*)mm, lfe); + r += lds[i]->ld_grace(lds[i], (dvb_mux_t*)mm); } return r; @@ -645,7 +644,7 @@ linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse ) /* Diseqc */ for (i = ls->ls_diseqc_idx; i < ARRAY_SIZE(lds); i++) { if (!lds[i]) continue; - r = lds[i]->ld_tune(lds[i], lm, lse, lfe); + r = lds[i]->ld_tune(lds[i], lm, lse, lfe->lfe_fe_fd); /* Error */ if (r < 0) return r; diff --git a/src/input/mpegts/linuxdvb/linuxdvb_switch.c b/src/input/mpegts/linuxdvb/linuxdvb_switch.c index 9c430faf..2044c74d 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_switch.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_switch.c @@ -144,10 +144,9 @@ const idclass_t linuxdvb_switch_class = static int linuxdvb_switch_tune - ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *sc, - linuxdvb_frontend_t *lfe ) + ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *sc, int fd ) { - int i, com, r1 = 0, r2 = 0, fd = lfe->lfe_fe_fd; + int i, com, r1 = 0, r2 = 0; int pol, band; linuxdvb_switch_t *ls = (linuxdvb_switch_t*)ld;