summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorManu Abraham <manu@linuxtv.org>2006-06-22 01:28:13 +0400
committerManu Abraham <manu@linuxtv.org>2006-06-22 01:28:13 +0400
commit6c77cd22beed5cf93434acd107b8b2652502d213 (patch)
treec4d7c63750fd6410039a997cb3f4885fcac5b1e7 /linux/drivers/media/dvb
parentf0c7b3e62d7304644b89198879d0054dee9b8915 (diff)
downloadmediapointer-dvb-s2-6c77cd22beed5cf93434acd107b8b2652502d213.tar.gz
mediapointer-dvb-s2-6c77cd22beed5cf93434acd107b8b2652502d213.tar.bz2
conditionally enable 5 byte diseqc commands
From: Yeasah Pell <yeasah@schwide.net> Signed-off-by: Yeasah Pell <yeasah@schwide.net> Signed-off-by: Manu Abraham <manu@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/bt8xx/dst.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/bt8xx/dst.c b/linux/drivers/media/dvb/bt8xx/dst.c
index c538d272c..d687a14ec 100644
--- a/linux/drivers/media/dvb/bt8xx/dst.c
+++ b/linux/drivers/media/dvb/bt8xx/dst.c
@@ -1466,9 +1466,12 @@ static int dst_set_diseqc(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd
if (state->dst_type != DST_TYPE_IS_SAT)
return 0;
- if (cmd->msg_len == 0 || cmd->msg_len > 4)
+ if (cmd->msg_len > 0 && cmd->msg_len < 5)
+ memcpy(&paket[3], cmd->msg, cmd->msg_len);
+ else if (cmd->msg_len == 5 && state->dst_hw_cap & DST_TYPE_HAS_DISEQC5)
+ memcpy(&paket[2], cmd->msg, cmd->msg_len);
+ else
return -EINVAL;
- memcpy(&paket[3], cmd->msg, cmd->msg_len);
paket[7] = dst_check_sum(&paket[0], 7);
dst_command(state, paket, 8);
return 0;