For what it is worth, here is my change to dvb_frontend.c I would welcome comments on whether I am going about this the right way, or whether I am wasting my time. I will start testing with this tomorrow. static int dvb_frontend_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *parg) { ... case FE_SET_FRONTEND: { struct dvb_frontend_tune_settings fetunesettings; if (dvb_frontend_check_parameters(fe, parg) < 0) { err = -EINVAL; break; } memcpy(&fepriv->parameters, parg, sizeof (struct dvb_frontend_parameters)); if (fe->legacy) { memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings)); memcpy(&fetunesettings.parameters, parg, sizeof (struct dvb_frontend_parameters)); /* force auto frequency inversion if requested */ if (dvb_force_auto_inversion) { fepriv->parameters.inversion = INVERSION_AUTO; fetunesettings.parameters.inversion = INVERSION_AUTO; } if (fe->ops.info.type == FE_OFDM) { /* without hierarchical coding code_rate_LP is irrelevant, * so we tolerate the otherwise invalid FEC_NONE setting */ if (fepriv->parameters.u.ofdm.hierarchy_information == HIERARCHY_NONE && fepriv->parameters.u.ofdm.code_rate_LP == FEC_NONE) fepriv->parameters.u.ofdm.code_rate_LP = FEC_AUTO; } } else { if (olddrv_to_newapi(fe, &fepriv->fe_params, &fepriv->parameters, fe->ops.info.type) == -EINVAL) printk("%s: ERROR !!! Converting Old parameters --> New parameters\n", __func__); memset(&fetunesettings, 0, sizeof (struct dvb_frontend_tune_settings)); memcpy(&fetunesettings.fe_params, &fepriv->fe_params, sizeof (struct dvbfe_params)); /* Request the search algorithm to search */ fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN; /* force auto frequency inversion if requested */ if (dvb_force_auto_inversion) { fepriv->fe_params.inversion = DVBFE_INVERSION_AUTO; fetunesettings.fe_params.inversion = DVBFE_INVERSION_AUTO; } if (fe->ops.get_delsys) { enum dvbfe_delsys delsys; fe->ops.get_delsys(fe, &delsys); if ((delsys == DVBFE_DELSYS_DVBT) || (delsys == DVBFE_DELSYS_DVBH)) { /* without hierachical coding code_rate_LP is irrelevant, * so we tolerate the otherwise invalid FEC_NONE setting */ if (fepriv->fe_params.delsys.dvbt.hierarchy == DVBFE_HIERARCHY_OFF && fepriv->fe_params.delsys.dvbt.code_rate_LP == DVBFE_FEC_NONE) fepriv->fe_params.delsys.dvbt.code_rate_LP = DVBFE_FEC_AUTO; } } } /* get frontend-specific tuning settings */ if (fe->ops.get_tune_settings && (fe->ops.get_tune_settings(fe, &fetunesettings) == 0)) { fepriv->min_delay = (fetunesettings.min_delay_ms * HZ) / 1000; fepriv->max_drift = fetunesettings.max_drift; fepriv->step_size = fetunesettings.step_size; } else { /* default values */ switch(fe->ops.info.type) { case FE_QPSK: fepriv->min_delay = HZ/20; fepriv->step_size = fepriv->parameters.u.qpsk.symbol_rate / 16000; fepriv->max_drift = fepriv->parameters.u.qpsk.symbol_rate / 2000; break; case FE_QAM: fepriv->min_delay = HZ/20; fepriv->step_size = 0; /* no zigzag */ fepriv->max_drift = 0; break; case FE_OFDM: fepriv->min_delay = HZ/20; fepriv->step_size = fe->ops.info.frequency_stepsize * 2; fepriv->max_drift = (fe->ops.info.frequency_stepsize * 2) + 1; break; case FE_ATSC: fepriv->min_delay = HZ/20; fepriv->step_size = 0; fepriv->max_drift = 0; break; } } if (dvb_override_tune_delay > 0) fepriv->min_delay = (dvb_override_tune_delay * HZ) / 1000; fepriv->state = FESTATE_RETUNE; dvb_frontend_wakeup(fe); dvb_frontend_add_event(fe, 0); fepriv->status = 0; err = 0; break; } ... case FE_GET_FRONTEND: if (fe->legacy) { if (fe->ops.get_frontend) { memcpy (parg, &fepriv->parameters, sizeof (struct dvb_frontend_parameters)); err = fe->ops.get_frontend(fe, (struct dvb_frontend_parameters*) parg); } } else { if (fe->ops.get_params) { struct dvbfe_params temporary_params; memcpy(&temporary_params, &fepriv->fe_params, sizeof (struct dvbfe_params)); err = fe->ops.get_params(fe, &temporary_params); if (newapi_to_olddrv(&temporary_params, (struct dvb_frontend_parameters*) parg, fepriv->delsys) == -EINVAL) printk("%s: ERROR !!! Converting New parameters --> Old parameters\n", __func__); } } break; Roger Roger James wrote:
|
_______________________________________________ linux-dvb mailing list linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb