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

Philip Prindeville philipp_subx at redfish-solutions.com
Wed Nov 2 08:27:52 CET 2005


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






More information about the linux-dvb mailing list