summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorJanne Grunau <j@jannau.net>2009-09-02 00:24:08 +0200
committerJanne Grunau <j@jannau.net>2009-09-02 00:24:08 +0200
commit47515034f52a7a8848e3636668e31e1af4a79fbe (patch)
treeb801b778fbe2bdd28f93758471138ad40fed3c4e /linux/drivers/media
parent39c7c8c56d56cc3a3fd5128d0598944303a929df (diff)
downloadmediapointer-dvb-s2-47515034f52a7a8848e3636668e31e1af4a79fbe.tar.gz
mediapointer-dvb-s2-47515034f52a7a8848e3636668e31e1af4a79fbe.tar.bz2
dvb-core: check supported QAM modulations
From: Janne Grunau <j@jannau.net> Check the modulation in dvb_frontend_check_parameters against frontend's capabilties for FE_QAM devices. Priority: normal Signed-off-by: Janne Grunau <j@jannau.net>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_frontend.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index fbfccbd91..56a11d32a 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -849,6 +849,15 @@ static int dvb_frontend_check_parameters(struct dvb_frontend *fe,
}
}
+ /* check for supported modulation */
+ if (fe->ops.info.type == FE_QAM &&
+ (parms->u.qam.modulation > QAM_AUTO ||
+ !((1 << (parms->u.qam.modulation + 10)) & fe->ops.info.caps))) {
+ printk(KERN_WARNING "DVB: adapter %i frontend %i modulation %u not supported\n",
+ fe->dvb->num, fe->id, parms->u.qam.modulation);
+ return -EINVAL;
+ }
+
return 0;
}