Commit 6bade236 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: cec: core: not all messages were passed on when monitoring

The valid_la boolean is used to check if the destination logical
address is either 15 (broadcast) or our logical address. If it is
for another logical address, then only adapters that have the
CEC_CAP_MONITOR_ALL capability can pass it on.

However, it is also used to do more detailed validity checks,
such as whether the message was broadcast when it should have been
directed, or vice versa, in which case the message must be ignored
according to the spec. But that should not apply to monitoring.

Add a new bool that just checks the LA and nothing else.
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent f100ce3b
...@@ -1052,6 +1052,7 @@ void cec_received_msg_ts(struct cec_adapter *adap, ...@@ -1052,6 +1052,7 @@ void cec_received_msg_ts(struct cec_adapter *adap,
u8 cmd = msg->msg[1]; u8 cmd = msg->msg[1];
bool is_reply = false; bool is_reply = false;
bool valid_la = true; bool valid_la = true;
bool monitor_valid_la = true;
u8 min_len = 0; u8 min_len = 0;
if (WARN_ON(!msg->len || msg->len > CEC_MAX_MSG_SIZE)) if (WARN_ON(!msg->len || msg->len > CEC_MAX_MSG_SIZE))
...@@ -1093,8 +1094,10 @@ void cec_received_msg_ts(struct cec_adapter *adap, ...@@ -1093,8 +1094,10 @@ void cec_received_msg_ts(struct cec_adapter *adap,
adap->last_initiator = 0xff; adap->last_initiator = 0xff;
/* Check if this message was for us (directed or broadcast). */ /* Check if this message was for us (directed or broadcast). */
if (!cec_msg_is_broadcast(msg)) if (!cec_msg_is_broadcast(msg)) {
valid_la = cec_has_log_addr(adap, msg_dest); valid_la = cec_has_log_addr(adap, msg_dest);
monitor_valid_la = valid_la;
}
/* /*
* Check if the length is not too short or if the message is a * Check if the length is not too short or if the message is a
...@@ -1227,7 +1230,7 @@ void cec_received_msg_ts(struct cec_adapter *adap, ...@@ -1227,7 +1230,7 @@ void cec_received_msg_ts(struct cec_adapter *adap,
mutex_unlock(&adap->lock); mutex_unlock(&adap->lock);
/* Pass the message on to any monitoring filehandles */ /* Pass the message on to any monitoring filehandles */
cec_queue_msg_monitor(adap, msg, valid_la); cec_queue_msg_monitor(adap, msg, monitor_valid_la);
/* We're done if it is not for us or a poll message */ /* We're done if it is not for us or a poll message */
if (!valid_la || msg->len <= 1) if (!valid_la || msg->len <= 1)
......
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