+ else // linked frontend..
+ {
+ long ocsw = -1,
+ oucsw = -1,
+ oToneburst = -1;
+ while (linked_prev_ptr != -1)
+ {
+ eDVBRegisteredFrontend *linked_fe = (eDVBRegisteredFrontend*) linked_prev_ptr;
+ linked_fe->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, (long&)linked_prev_ptr);
+ if (linked_prev_ptr == -1)
+ {
+ iDVBFrontend *sec_fe = linked_fe->m_frontend;
+ sec_fe->getData(eDVBFrontend::ROTOR_POS, curRotorPos);
+ if (linked_fe->m_inuse)
+ {
+ sec_fe->getData(eDVBFrontend::CSW, ocsw);
+ sec_fe->getData(eDVBFrontend::UCSW, oucsw);
+ sec_fe->getData(eDVBFrontend::TONEBURST, oToneburst);
+ eSecDebug("(%ld != %ld) || \n(%d && (%ld != %ld || %ld != %ld) ) ||\n( %d && %ld != %d ) )",
+ csw, ocsw, diseqc, ucsw, oucsw, toneburst, oToneburst, rotor, curRotorPos, sat.orbital_position);
+ if ( (csw != ocsw) ||
+ ( diseqc && (ucsw != oucsw || toneburst != oToneburst) ) ||
+ ( rotor && curRotorPos != sat.orbital_position ) )
+ {
+ ret=0;
+ }
+ }
+ }
+ }
+ eSecDebugNoSimulate("ret4 %d", ret);
+ }
+
+ if (ret && rotor && curRotorPos != -1 && direct_connected) {
+ ret -= abs(curRotorPos-sat.orbital_position);
+ }
+
+ eSecDebugNoSimulate("ret5 %d", ret);
+
+ if (ret)
+ if (satpos_depends_ptr != -1)
+ {
+ eSecDebugNoSimulate("satpos depends");
+ eDVBRegisteredFrontend *satpos_depends_to_fe = (eDVBRegisteredFrontend*) satpos_depends_ptr;
+ if ( satpos_depends_to_fe->m_inuse )
+ {
+ if (!direct_connected)
+ satpos_depends_to_fe->m_frontend->getData(eDVBFrontend::ROTOR_POS, curRotorPos);
+ if (!rotor || curRotorPos != sat.orbital_position)
+ ret=0;
+ }
+ eSecDebugNoSimulate("ret6 %d", ret);
+ }
+
+ if (ret)
+ {
+ int lof = sat.frequency > lnb_param.m_lof_threshold ?
+ lnb_param.m_lof_hi : lnb_param.m_lof_lo;
+ int tuner_freq = abs(sat.frequency - lof);
+ if (tuner_freq < 900000 || tuner_freq > 2200000)
+ ret=0;
+ }
+
+ eSecDebugNoSimulate("ret %d, score old %d", ret, score);
+ if (ret > score)
+ {
+ score = ret;
+ if (highest_score_lnb)
+ *highest_score_lnb = idx;
+ }
+ eSecDebugNoSimulate("score new %d", score);