[PATCH] Re: [linux-dvb] Sending diseqc commands on DST frontend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



One other comment about the code:

+	if ((cmd->msg_len == 3) && (state->dst_hw_cap & DST_TYPE_HAS_DISEQC3)) {
+		memcpy(&paket[3], cmd->msg, cmd->msg_len);
+		paket[2] = 0x03;
+	} else if ((cmd->msg_len == 4) && (state->dst_hw_cap & DST_TYPE_HAS_DISEQC4)) {
+		memcpy(&paket[3], cmd->msg, cmd->msg_len);
+		paket[2] = 0x04;
+	} else if ((cmd->msg_len == 5) && (state->dst_hw_cap & DST_TYPE_HAS_DISEQC5)) {
+		memcpy(&paket[2], cmd->msg, cmd->msg_len);
+	}



Why isn't the length being saved into paket[2] in the last case?

Should we have:

+	if ((cmd->msg_len == 3) && (state->dst_hw_cap & DST_TYPE_HAS_DISEQC3)) {
+		memcpy(&paket[3], cmd->msg, cmd->msg_len);
+	} else if ((cmd->msg_len == 4) && (state->dst_hw_cap & DST_TYPE_HAS_DISEQC4)) {
+		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;
+	}
+	paket[2] = msg_len;


instead?

-Philip





[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux