>>From 0093e2bd237fcf9825ab8d0c0deebb5bc8dff5c9 Mon Sep 17 00:00:00 2001 From: Manu Abraham Date: Thu, 4 Sep 2008 13:55:49 +0200 Subject: [PATCH] DVB Fix backward compatibility Backward compatibility was broken in terms that it was all around non-legacy devices being selected for device control and hence drivers with the old callbacks never worked. The patch fixes the approach where both set of drivers are working now. tested with a TT S2 3200 (new) and a FF S2300 (legacy) devices From: Marco Schluessler Signed-off-by: Marco Schluessler Signed-off-by: Manu Abraham diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 93b08fa..784acbd 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -1730,6 +1730,9 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, enum dvbfe_delsys delsys = fepriv->fe_info.delivery; fe->legacy = 0; + if (!(fe->ops.set_params || fe->ops.search)) + fe->legacy = 1; + memcpy(&fepriv->fe_params, parg, sizeof (struct dvbfe_params)); memset(&fetunesettings, 0, sizeof (struct dvb_frontend_tune_settings)); memcpy(&fetunesettings.fe_params, parg, sizeof (struct dvbfe_params)); @@ -1830,6 +1833,22 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, fe->legacy = 0; if (fe->ops.get_delsys) { err = fe->ops.get_delsys(fe, (enum dvbfe_delsys *) parg); + } else { + switch (fe->ops.info.type) { + case FE_QPSK: + *((enum dvbfe_delsys *) parg) = DVBFE_DELSYS_DVBS; + break; + case FE_QAM: + *((enum dvbfe_delsys *) parg) = DVBFE_DELSYS_DVBC; + break; + case FE_OFDM: + *((enum dvbfe_delsys *) parg) = DVBFE_DELSYS_DVBT; + break; + default: + up (&fepriv->sem); + return -EINVAL; + } + err = 0; } break; case DVBFE_GET_INFO: @@ -1839,6 +1858,9 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, memcpy(&fepriv->fe_info, (struct dvbfe_info *) parg, sizeof (struct dvbfe_info)); err = fe->ops.get_info(fe, &fepriv->fe_info); memcpy((struct dvbfe_info *) parg, &fepriv->fe_info, sizeof (struct dvbfe_info)); + } else { + memcpy(&fepriv->fe_info, (struct dvbfe_info *) parg, sizeof (struct dvbfe_info)); + err = 0; } break; };