dvb: undo mod to frequency range testing and add additional tuning check

The previous check was garbage because for -S adapters the frequency range
reported by the adapter is in local units (i.e. hi/low band taken into
account) and not simple kHz. This makes checking more difficult and while
its possible I think this should be left for dvb rewrite.

Instead I've re-instated the old code, but muxes are only disable if the
return is EINVAL, which should only be returned if the DVB layer decides
the params are out of range.
This commit is contained in:
Adam Sutton 2013-01-18 15:55:29 +00:00
parent 73652e9377
commit 7f89b3d552
2 changed files with 3 additions and 9 deletions

View file

@ -510,6 +510,8 @@ dvb_fe_tune(th_dvb_mux_instance_t *tdmi, const char *reason)
}
/* Mark as bad */
if (errno == EINVAL)
dvb_mux_set_enable(tdmi, 0);
return SM_CODE_TUNING_FAILED;
}

View file

@ -162,14 +162,6 @@ dvb_mux_create(th_dvb_adapter_t *tda, const struct dvb_mux_conf *dmc,
lock_assert(&global_lock);
/* Reject out of range */
if ((dmc->dmc_fe_params.frequency < tda->tda_fe_info->frequency_min) ||
(dmc->dmc_fe_params.frequency > tda->tda_fe_info->frequency_max)) {
tvhlog(LOG_DEBUG, "dvb", "mux rejected with frequency %d",
dmc->dmc_fe_params.frequency);
return NULL;
}
/* HACK - we hash/compare based on 2KHz spacing and compare on +/-500Hz */
LIST_FOREACH(tdmi, &tda->tda_mux_list, tdmi_adapter_hash_link) {
if(tdmi_compare_key(&tdmi->tdmi_conf, dmc))
@ -1179,7 +1171,7 @@ dvb_mux_add_by_params(th_dvb_adapter_t *tda,
tdmi = dvb_mux_create(tda, &dmc, 0, 0xffff, NULL, NULL, 1, 1, NULL, NULL);
if(tdmi == NULL)
return "Mux already exists or bad parameters";
return "Mux already exist";
return NULL;
}