Skip to content

Commit

Permalink
V4L/DVB (12686): dvb-core: check supported QAM modulations
Browse files Browse the repository at this point in the history
Check the modulation in dvb_frontend_check_parameters against
frontend's capabilties for FE_QAM devices.

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Janne Grunau authored and Mauro Carvalho Chehab committed Sep 12, 2009
1 parent 0188625 commit f51fad8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/media/dvb/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,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;
}

Expand Down

0 comments on commit f51fad8

Please sign in to comment.