Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) .. c:namespace:: CEC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) .. _CEC_MODE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) .. _CEC_G_MODE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) .. _CEC_S_MODE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) ********************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) ioctls CEC_G_MODE and CEC_S_MODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) ********************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) CEC_G_MODE, CEC_S_MODE - Get or set exclusive use of the CEC adapter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) .. c:macro:: CEC_G_MODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) ``int ioctl(int fd, CEC_G_MODE, __u32 *argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) .. c:macro:: CEC_S_MODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) ``int ioctl(int fd, CEC_S_MODE, __u32 *argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)     File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) ``argp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)     Pointer to CEC mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) By default any filehandle can use :ref:`CEC_TRANSMIT`, but in order to prevent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) applications from stepping on each others toes it must be possible to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) obtain exclusive access to the CEC adapter. This ioctl sets the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) filehandle to initiator and/or follower mode which can be exclusive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) depending on the chosen mode. The initiator is the filehandle that is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) used to initiate messages, i.e. it commands other CEC devices. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) follower is the filehandle that receives messages sent to the CEC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) adapter and processes them. The same filehandle can be both initiator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) and follower, or this role can be taken by two different filehandles.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) When a CEC message is received, then the CEC framework will decide how
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) it will be processed. If the message is a reply to an earlier
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) transmitted message, then the reply is sent back to the filehandle that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) is waiting for it. In addition the CEC framework will process it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) If the message is not a reply, then the CEC framework will process it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) first. If there is no follower, then the message is just discarded and a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) feature abort is sent back to the initiator if the framework couldn't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) process it. If there is a follower, then the message is passed on to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) follower who will use :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>` to dequeue
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) the new message. The framework expects the follower to make the right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) decisions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) The CEC framework will process core messages unless requested otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) by the follower. The follower can enable the passthrough mode. In that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) case, the CEC framework will pass on most core messages without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) processing them and the follower will have to implement those messages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) There are some messages that the core will always process, regardless of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) the passthrough mode. See :ref:`cec-core-processing` for details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) If there is no initiator, then any CEC filehandle can use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`. If there is an exclusive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) initiator then only that initiator can call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) :ref:`CEC_TRANSMIT`. The follower can of course
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) always call :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) Available initiator modes are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) .. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{11.0cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) .. _cec-mode-initiator_e:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) .. flat-table:: Initiator Modes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)     :widths:       3 1 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)     * .. _`CEC-MODE-NO-INITIATOR`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)       - ``CEC_MODE_NO_INITIATOR``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)       - 0x0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)       - This is not an initiator, i.e. it cannot transmit CEC messages or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	make any other changes to the CEC adapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)     * .. _`CEC-MODE-INITIATOR`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)       - ``CEC_MODE_INITIATOR``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)       - 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)       - This is an initiator (the default when the device is opened) and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	it can transmit CEC messages and make changes to the CEC adapter,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	unless there is an exclusive initiator.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)     * .. _`CEC-MODE-EXCL-INITIATOR`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)       - ``CEC_MODE_EXCL_INITIATOR``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)       - 0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)       - This is an exclusive initiator and this file descriptor is the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	only one that can transmit CEC messages and make changes to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	CEC adapter. If someone else is already the exclusive initiator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	then an attempt to become one will return the ``EBUSY`` error code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	error.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) Available follower modes are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) .. tabularcolumns:: |p{6.6cm}|p{0.9cm}|p{10.0cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) .. _cec-mode-follower_e:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) .. cssclass:: longtable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) .. flat-table:: Follower Modes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)     :widths:       3 1 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)     * .. _`CEC-MODE-NO-FOLLOWER`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)       - ``CEC_MODE_NO_FOLLOWER``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)       - 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)       - This is not a follower (the default when the device is opened).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)     * .. _`CEC-MODE-FOLLOWER`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)       - ``CEC_MODE_FOLLOWER``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)       - 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)       - This is a follower and it will receive CEC messages unless there
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	is an exclusive follower. You cannot become a follower if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	:ref:`CEC_CAP_TRANSMIT <CEC-CAP-TRANSMIT>` is not set or if :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	was specified, the ``EINVAL`` error code is returned in that case.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)     * .. _`CEC-MODE-EXCL-FOLLOWER`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)       - ``CEC_MODE_EXCL_FOLLOWER``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)       - 0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)       - This is an exclusive follower and only this file descriptor will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	receive CEC messages for processing. If someone else is already
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	the exclusive follower then an attempt to become one will return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	the ``EBUSY`` error code. You cannot become a follower if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	:ref:`CEC_CAP_TRANSMIT <CEC-CAP-TRANSMIT>` is not set or if :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	was specified, the ``EINVAL`` error code is returned in that case.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)     * .. _`CEC-MODE-EXCL-FOLLOWER-PASSTHRU`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)       - ``CEC_MODE_EXCL_FOLLOWER_PASSTHRU``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)       - 0x30
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)       - This is an exclusive follower and only this file descriptor will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	receive CEC messages for processing. In addition it will put the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	CEC device into passthrough mode, allowing the exclusive follower
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	to handle most core messages instead of relying on the CEC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	framework for that. If someone else is already the exclusive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	follower then an attempt to become one will return the ``EBUSY`` error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	code. You cannot become a follower if :ref:`CEC_CAP_TRANSMIT <CEC-CAP-TRANSMIT>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	is not set or if :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>` was specified,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	the ``EINVAL`` error code is returned in that case.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)     * .. _`CEC-MODE-MONITOR-PIN`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)       - ``CEC_MODE_MONITOR_PIN``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)       - 0xd0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)       - Put the file descriptor into pin monitoring mode. Can only be used in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	combination with :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>`,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	otherwise the ``EINVAL`` error code will be returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	This mode requires that the :ref:`CEC_CAP_MONITOR_PIN <CEC-CAP-MONITOR-PIN>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	capability is set, otherwise the ``EINVAL`` error code is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	While in pin monitoring mode this file descriptor can receive the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	``CEC_EVENT_PIN_CEC_LOW`` and ``CEC_EVENT_PIN_CEC_HIGH`` events to see the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	low-level CEC pin transitions. This is very useful for debugging.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	This mode is only allowed if the process has the ``CAP_NET_ADMIN``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	capability. If that is not set, then the ``EPERM`` error code is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)     * .. _`CEC-MODE-MONITOR`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)       - ``CEC_MODE_MONITOR``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)       - 0xe0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)       - Put the file descriptor into monitor mode. Can only be used in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	combination with :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>`,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	otherwise the ``EINVAL`` error code will be returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	In monitor mode all messages this CEC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	device transmits and all messages it receives (both broadcast
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	messages and directed messages for one its logical addresses) will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	be reported. This is very useful for debugging. This is only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	allowed if the process has the ``CAP_NET_ADMIN`` capability. If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	that is not set, then the ``EPERM`` error code is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)     * .. _`CEC-MODE-MONITOR-ALL`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)       - ``CEC_MODE_MONITOR_ALL``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)       - 0xf0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)       - Put the file descriptor into 'monitor all' mode. Can only be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	in combination with :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>`, otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	the ``EINVAL`` error code will be returned. In 'monitor all' mode all messages
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	this CEC device transmits and all messages it receives, including
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	directed messages for other CEC devices will be reported. This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	very useful for debugging, but not all devices support this. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	mode requires that the :ref:`CEC_CAP_MONITOR_ALL <CEC-CAP-MONITOR-ALL>` capability is set,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	otherwise the ``EINVAL`` error code is returned. This is only allowed if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	the process has the ``CAP_NET_ADMIN`` capability. If that is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	set, then the ``EPERM`` error code is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) Core message processing details:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) .. tabularcolumns:: |p{6.6cm}|p{10.9cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) .. _cec-core-processing:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) .. flat-table:: Core Message Processing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)     :widths: 1 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)     * .. _`CEC-MSG-GET-CEC-VERSION`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)       - ``CEC_MSG_GET_CEC_VERSION``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)       - The core will return the CEC version that was set with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	:ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	except when in passthrough mode. In passthrough mode the core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	does nothing and this message has to be handled by a follower
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)     * .. _`CEC-MSG-GIVE-DEVICE-VENDOR-ID`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)       - ``CEC_MSG_GIVE_DEVICE_VENDOR_ID``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)       - The core will return the vendor ID that was set with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	:ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	except when in passthrough mode. In passthrough mode the core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	does nothing and this message has to be handled by a follower
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)     * .. _`CEC-MSG-ABORT`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)       - ``CEC_MSG_ABORT``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)       - The core will return a Feature Abort message with reason
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)         'Feature Refused' as per the specification, except when in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	passthrough mode. In passthrough mode the core does nothing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	and this message has to be handled by a follower instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)     * .. _`CEC-MSG-GIVE-PHYSICAL-ADDR`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)       - ``CEC_MSG_GIVE_PHYSICAL_ADDR``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)       - The core will report the current physical address, except when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)         in passthrough mode. In passthrough mode the core does nothing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	and this message has to be handled by a follower instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)     * .. _`CEC-MSG-GIVE-OSD-NAME`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)       - ``CEC_MSG_GIVE_OSD_NAME``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)       - The core will report the current OSD name that was set with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	:ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	except when in passthrough mode. In passthrough mode the core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	does nothing and this message has to be handled by a follower
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)     * .. _`CEC-MSG-GIVE-FEATURES`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)       - ``CEC_MSG_GIVE_FEATURES``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)       - The core will do nothing if the CEC version is older than 2.0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)         otherwise it will report the current features that were set with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	:ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 	except when in passthrough mode. In passthrough mode the core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	does nothing (for any CEC version) and this message has to be handled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	by a follower instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)     * .. _`CEC-MSG-USER-CONTROL-PRESSED`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257)       - ``CEC_MSG_USER_CONTROL_PRESSED``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)       - If :ref:`CEC_CAP_RC <CEC-CAP-RC>` is set and if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)         :ref:`CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU <CEC-LOG-ADDRS-FL-ALLOW-RC-PASSTHRU>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	is set, then generate a remote control key
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	press. This message is always passed on to the follower(s).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)     * .. _`CEC-MSG-USER-CONTROL-RELEASED`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)       - ``CEC_MSG_USER_CONTROL_RELEASED``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)       - If :ref:`CEC_CAP_RC <CEC-CAP-RC>` is set and if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)         :ref:`CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU <CEC-LOG-ADDRS-FL-ALLOW-RC-PASSTHRU>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)         is set, then generate a remote control key
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	release. This message is always passed on to the follower(s).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)     * .. _`CEC-MSG-REPORT-PHYSICAL-ADDR`:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)       - ``CEC_MSG_REPORT_PHYSICAL_ADDR``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)       - The CEC framework will make note of the reported physical address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	and then just pass the message on to the follower(s).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) appropriately. The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) :ref:`Generic Error Codes <gen-errors>` chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) The :ref:`ioctl CEC_S_MODE <CEC_S_MODE>` can return the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) error codes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287)     The requested mode is invalid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) EPERM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)     Monitor mode is requested, but the process does have the ``CAP_NET_ADMIN``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)     capability.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) EBUSY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)     Someone else is already an exclusive follower or initiator.