linux/Documentation/media/uapi/cec
Hans Verkuil f5580d8d6f [media] cec: accept two replies for CEC_MSG_INITIATE_ARC
The CEC_MSG_INITIATE_ARC message is special since it is the ONLY
CEC message that accepts two possible valid replies:

CEC_MSG_REPORT_ARC_INITIATED and CEC_MSG_REPORT_ARC_TERMINATED.

So if the transmitted message is CEC_MSG_INITIATE_ARC and the remote
side replied with CEC_MSG_REPORT_ARC_INITIATED or CEC_MSG_REPORT_ARC_TERMINATED,
then a msg->reply value of CEC_MSG_REPORT_ARC_INITIATED or
CEC_MSG_REPORT_ARC_TERMINATED will match either reply.

I thought about either adding a second reply2 field, but that's ugly
for all other messages that have only one reply, and what if in the
future a new message is added that can have three replies?

Another option would be to add a cec_msg flag, but really, the combination
of CEC_MSG_REPORT_ARC_INITIATED and a reply value of one of the two
possible replies already functions as a flag.

Another advantage of this approach is that it is safe to re-use a
cec_msg struct. No need to zero a flags field or a reply2 field.

So since this really is an exception in the CEC specification, I
decided to implement it as an exception as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:34:55 -02:00
..
cec-api.rst [media] doc-rst: better organize the media books 2016-07-23 08:03:24 -03:00
cec-func-close.rst [media] docs-rst: Convert CEC uAPI to use C function references 2016-08-22 21:23:40 -03:00
cec-func-ioctl.rst [media] docs-rst: Convert CEC uAPI to use C function references 2016-08-22 21:23:40 -03:00
cec-func-open.rst [media] docs-rst: Convert CEC uAPI to use C function references 2016-08-22 21:23:40 -03:00
cec-func-poll.rst [media] docs-rst: fix some broken struct references 2016-09-09 09:55:18 -03:00
cec-funcs.rst [media] doc-rst: make CEC look more like other parts of the book 2016-07-09 11:20:46 -03:00
cec-header.rst [media] doc-rst: add CEC header file to the documentation 2016-07-09 11:07:10 -03:00
cec-intro.rst [media] docs-rst: better use the .. note:: tag 2016-08-22 10:02:29 -03:00
cec-ioc-adap-g-caps.rst [media] cec rst: convert tables and drop the 'row' comments 2016-11-16 15:30:54 -02:00
cec-ioc-adap-g-log-addrs.rst [media] cec: add flag to cec_log_addrs to enable RC passthrough 2016-11-16 15:32:07 -02:00
cec-ioc-adap-g-phys-addr.rst [media] docs-rst: Convert CEC uAPI to use C function references 2016-08-22 21:23:40 -03:00
cec-ioc-dqevent.rst [media] cec rst: convert tables and drop the 'row' comments 2016-11-16 15:30:54 -02:00
cec-ioc-g-mode.rst [media] cec rst: convert tables and drop the 'row' comments 2016-11-16 15:30:54 -02:00
cec-ioc-receive.rst [media] cec: accept two replies for CEC_MSG_INITIATE_ARC 2016-11-16 15:34:55 -02:00