aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Fjeldtvedt <jaffe1@gmail.com>2016-08-15 10:58:31 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2016-08-15 11:03:26 +0200
commitc47af538fc9f0f809f186c4fcedd47e56452df68 (patch)
tree2f8b6ea456227042da8d1f5d79090d68d8ea9b53
parentac0f9ae5bf9e655524503397bd9ac8804960362c (diff)
final fixescec-johan
In cec-follower we keep track of whether messages that we have replied Feature Abort to, are re-sent within 200ms. This only applies to directly addressed messages, since those are the only ones we can reply FA to. In cec-compliance, we should treat a message as unrecognized if we received Undetermined as a Feature Abort reason. Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/cec-compliance/cec-compliance.cpp11
-rw-r--r--utils/cec-follower/cec-processing.cpp5
2 files changed, 11 insertions, 5 deletions
diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp
index 03ca6a29..d94e06ec 100644
--- a/utils/cec-compliance/cec-compliance.cpp
+++ b/utils/cec-compliance/cec-compliance.cpp
@@ -783,11 +783,12 @@ int cec_named_ioctl(struct node *node, const char *name,
Currently a message is registered as recognized if
- We receive a reply that is not Feature Abort with
- [Unrecognized Opcode]
+ [Unrecognized Opcode] or [Undetermined]
- We did not receive a reply, but also did not
expect one (other than Feature Abort)
- We manually receive (CEC_RECEIVE) and get a Feature Abort
- with reason different than [Unrecognized Opcode] */
+ with reason different than [Unrecognized Opcode] or
+ [Undetermined] */
if (request == CEC_TRANSMIT && msg->timeout > 0 &&
cec_msg_initiator(msg) != CEC_LOG_ADDR_UNREGISTERED &&
cec_msg_destination(msg) != CEC_LOG_ADDR_BROADCAST &&
@@ -796,7 +797,8 @@ int cec_named_ioctl(struct node *node, const char *name,
__u8 la = cec_msg_initiator(msg);
if (cec_msg_status_is_abort(msg) &&
- abort_reason(msg) == CEC_OP_ABORT_UNRECOGNIZED_OP)
+ (abort_reason(msg) == CEC_OP_ABORT_UNRECOGNIZED_OP ||
+ abort_reason(msg) == CEC_OP_ABORT_UNDETERMINED))
node->remote[la].unrecognized_op[opcode] = true;
else
node->remote[la].recognized_op[opcode] = true;
@@ -817,7 +819,8 @@ int cec_named_ioctl(struct node *node, const char *name,
__u8 la = cec_msg_initiator(msg);
__u8 abort_msg = msg->msg[2];
- if (abort_reason(msg) == CEC_OP_ABORT_UNRECOGNIZED_OP)
+ if (abort_reason(msg) == CEC_OP_ABORT_UNRECOGNIZED_OP ||
+ abort_reason(msg) == CEC_OP_ABORT_UNDETERMINED)
node->remote[la].unrecognized_op[abort_msg] = true;
else
node->remote[la].recognized_op[abort_msg] = true;
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index 6386215b..cd2d2276 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -204,6 +204,8 @@ static void reply_feature_abort(struct node *node, struct cec_msg *msg, __u8 rea
__u8 opcode = cec_msg_opcode(msg);
__u64 ts_now = get_ts();
+ if (cec_msg_is_broadcast(msg))
+ return;
if (reason == CEC_OP_ABORT_UNRECOGNIZED_OP) {
la_info[la].feature_aborted[opcode].count++;
if (la_info[la].feature_aborted[opcode].count == 2) {
@@ -960,7 +962,8 @@ void testProcessing(struct node *node)
__u8 to = cec_msg_destination(&msg);
__u8 opcode = cec_msg_opcode(&msg);
- if (la_info[from].feature_aborted[opcode].ts &&
+ if (from != CEC_LOG_ADDR_UNREGISTERED &&
+ la_info[from].feature_aborted[opcode].ts &&
ts_to_ms(get_ts() - la_info[from].feature_aborted[opcode].ts) < 200) {
warn("Received message %s from LA %d (%s) less than 200 ms after replying\n",
opcode2s(&msg).c_str(), from, la2s(from));

Privacy Policy