Commit 48caa6f1 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] dvb_frontend: do not allow statistic IOCTLs when sleeping

Demodulator cannot perform statistic IOCTLs when it is not tuned.
Return -EAGAIN in such case.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3c16b2b3
...@@ -2131,27 +2131,43 @@ static int dvb_frontend_ioctl_legacy(struct file *file, ...@@ -2131,27 +2131,43 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
err = fe->ops.read_status(fe, status); err = fe->ops.read_status(fe, status);
break; break;
} }
case FE_READ_BER: case FE_READ_BER:
if (fe->ops.read_ber) if (fe->ops.read_ber) {
err = fe->ops.read_ber(fe, (__u32*) parg); if (fepriv->thread)
err = fe->ops.read_ber(fe, (__u32 *) parg);
else
err = -EAGAIN;
}
break; break;
case FE_READ_SIGNAL_STRENGTH: case FE_READ_SIGNAL_STRENGTH:
if (fe->ops.read_signal_strength) if (fe->ops.read_signal_strength) {
err = fe->ops.read_signal_strength(fe, (__u16*) parg); if (fepriv->thread)
err = fe->ops.read_signal_strength(fe, (__u16 *) parg);
else
err = -EAGAIN;
}
break; break;
case FE_READ_SNR: case FE_READ_SNR:
if (fe->ops.read_snr) if (fe->ops.read_snr) {
err = fe->ops.read_snr(fe, (__u16*) parg); if (fepriv->thread)
err = fe->ops.read_snr(fe, (__u16 *) parg);
else
err = -EAGAIN;
}
break; break;
case FE_READ_UNCORRECTED_BLOCKS: case FE_READ_UNCORRECTED_BLOCKS:
if (fe->ops.read_ucblocks) if (fe->ops.read_ucblocks) {
err = fe->ops.read_ucblocks(fe, (__u32*) parg); if (fepriv->thread)
err = fe->ops.read_ucblocks(fe, (__u32 *) parg);
else
err = -EAGAIN;
}
break; break;
case FE_DISEQC_RESET_OVERLOAD: case FE_DISEQC_RESET_OVERLOAD:
if (fe->ops.diseqc_reset_overload) { if (fe->ops.diseqc_reset_overload) {
err = fe->ops.diseqc_reset_overload(fe); err = fe->ops.diseqc_reset_overload(fe);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment