Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 1 | .. -*- coding: utf-8; mode: rst -*- |
| 2 | |
Markus Heiser | 21c6269 | 2016-07-08 20:55:43 +0200 | [diff] [blame] | 3 | .. _CEC_TRANSMIT: |
| 4 | .. _CEC_RECEIVE: |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 5 | |
Hans Verkuil | 1267c60 | 2016-07-13 08:48:54 -0300 | [diff] [blame] | 6 | *********************************** |
| 7 | ioctls CEC_RECEIVE and CEC_TRANSMIT |
| 8 | *********************************** |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 9 | |
Markus Heiser | 21c6269 | 2016-07-08 20:55:43 +0200 | [diff] [blame] | 10 | Name |
| 11 | ==== |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 12 | |
Markus Heiser | 21c6269 | 2016-07-08 20:55:43 +0200 | [diff] [blame] | 13 | CEC_RECEIVE, CEC_TRANSMIT - Receive or transmit a CEC message |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 14 | |
| 15 | |
| 16 | Synopsis |
| 17 | ======== |
| 18 | |
Markus Heiser | 21c6269 | 2016-07-08 20:55:43 +0200 | [diff] [blame] | 19 | .. cpp:function:: int ioctl( int fd, int request, struct cec_msg *argp ) |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 20 | |
| 21 | Arguments |
| 22 | ========= |
| 23 | |
| 24 | ``fd`` |
| 25 | File descriptor returned by :ref:`open() <cec-func-open>`. |
| 26 | |
| 27 | ``request`` |
| 28 | CEC_RECEIVE, CEC_TRANSMIT |
| 29 | |
| 30 | ``argp`` |
| 31 | |
| 32 | |
| 33 | Description |
| 34 | =========== |
| 35 | |
Mauro Carvalho Chehab | b6b6e67 | 2016-08-15 17:49:50 -0300 | [diff] [blame] | 36 | .. note:: |
| 37 | |
| 38 | This documents the proposed CEC API. This API is not yet finalized |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 39 | and is currently only available as a staging kernel module. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 40 | |
| 41 | To receive a CEC message the application has to fill in the |
Hans Verkuil | e5208ed | 2016-07-19 06:26:13 -0300 | [diff] [blame] | 42 | ``timeout`` field of :c:type:`struct cec_msg` and pass it to :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 43 | If the file descriptor is in non-blocking mode and there are no received |
Hans Verkuil | e5208ed | 2016-07-19 06:26:13 -0300 | [diff] [blame] | 44 | messages pending, then it will return -1 and set errno to the ``EAGAIN`` |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 45 | error code. If the file descriptor is in blocking mode and ``timeout`` |
| 46 | is non-zero and no message arrived within ``timeout`` milliseconds, then |
Hans Verkuil | e5208ed | 2016-07-19 06:26:13 -0300 | [diff] [blame] | 47 | it will return -1 and set errno to the ``ETIMEDOUT`` error code. |
| 48 | |
| 49 | A received message can be: |
| 50 | |
| 51 | 1. a message received from another CEC device (the ``sequence`` field will |
| 52 | be 0). |
| 53 | 2. the result of an earlier non-blocking transmit (the ``sequence`` field will |
| 54 | be non-zero). |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 55 | |
| 56 | To send a CEC message the application has to fill in the |
Hans Verkuil | 1267c60 | 2016-07-13 08:48:54 -0300 | [diff] [blame] | 57 | :c:type:`struct cec_msg` and pass it to |
| 58 | :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`. The :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` is only available if |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 59 | ``CEC_CAP_TRANSMIT`` is set. If there is no more room in the transmit |
Hans Verkuil | e5208ed | 2016-07-19 06:26:13 -0300 | [diff] [blame] | 60 | queue, then it will return -1 and set errno to the ``EBUSY`` error code. |
| 61 | The transmit queue has enough room for 18 messages (about 1 second worth |
| 62 | of 2-byte messages). Note that the CEC kernel framework will also reply |
| 63 | to core messages (see :ref:cec-core-processing), so it is not a good |
| 64 | idea to fully fill up the transmit queue. |
| 65 | |
| 66 | If the file descriptor is in non-blocking mode then the transmit will |
| 67 | return 0 and the result of the transmit will be available via |
| 68 | :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>` once the transmit has finished |
| 69 | (including waiting for a reply, if requested). |
| 70 | |
| 71 | The ``sequence`` field is filled in for every transmit and this can be |
| 72 | checked against the received messages to find the corresponding transmit |
| 73 | result. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 74 | |
| 75 | |
| 76 | .. _cec-msg: |
| 77 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame^] | 78 | .. tabularcolumns:: |p{1.0cm}|p{1.0cm}|p{15.5cm}| |
| 79 | |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 80 | .. flat-table:: struct cec_msg |
| 81 | :header-rows: 0 |
| 82 | :stub-columns: 0 |
Mauro Carvalho Chehab | b2a5843 | 2016-07-08 17:59:27 -0300 | [diff] [blame] | 83 | :widths: 1 1 16 |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 84 | |
| 85 | |
| 86 | - .. row 1 |
| 87 | |
| 88 | - __u64 |
| 89 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 90 | - ``tx_ts`` |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 91 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 92 | - Timestamp in ns of when the last byte of the message was transmitted. |
Hans Verkuil | e5208ed | 2016-07-19 06:26:13 -0300 | [diff] [blame] | 93 | The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To access |
| 94 | the same clock from userspace use :c:func:`clock_gettime(2)`. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 95 | |
| 96 | - .. row 2 |
| 97 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 98 | - __u64 |
| 99 | |
| 100 | - ``rx_ts`` |
| 101 | |
| 102 | - Timestamp in ns of when the last byte of the message was received. |
Hans Verkuil | e5208ed | 2016-07-19 06:26:13 -0300 | [diff] [blame] | 103 | The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To access |
| 104 | the same clock from userspace use :c:func:`clock_gettime(2)`. |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 105 | |
| 106 | - .. row 3 |
| 107 | |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 108 | - __u32 |
| 109 | |
| 110 | - ``len`` |
| 111 | |
Hans Verkuil | 1267c60 | 2016-07-13 08:48:54 -0300 | [diff] [blame] | 112 | - The length of the message. For :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` this is filled in |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 113 | by the application. The driver will fill this in for |
Hans Verkuil | 1267c60 | 2016-07-13 08:48:54 -0300 | [diff] [blame] | 114 | :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`. For :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` it will be |
| 115 | filled in by the driver with the length of the reply message if ``reply`` was set. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 116 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 117 | - .. row 4 |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 118 | |
| 119 | - __u32 |
| 120 | |
| 121 | - ``timeout`` |
| 122 | |
| 123 | - The timeout in milliseconds. This is the time the device will wait |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 124 | for a message to be received before timing out. If it is set to 0, |
Hans Verkuil | 1267c60 | 2016-07-13 08:48:54 -0300 | [diff] [blame] | 125 | then it will wait indefinitely when it is called by :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`. |
| 126 | If it is 0 and it is called by :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`, |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 127 | then it will be replaced by 1000 if the ``reply`` is non-zero or |
| 128 | ignored if ``reply`` is 0. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 129 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 130 | - .. row 5 |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 131 | |
| 132 | - __u32 |
| 133 | |
| 134 | - ``sequence`` |
| 135 | |
Hans Verkuil | e5208ed | 2016-07-19 06:26:13 -0300 | [diff] [blame] | 136 | - A non-zero sequence number is automatically assigned by the CEC framework |
| 137 | for all transmitted messages. It is used by the CEC framework when it queues |
| 138 | the transmit result (when transmit was called in non-blocking mode). This |
| 139 | allows the application to associate the received message with the original |
| 140 | transmit. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 141 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 142 | - .. row 6 |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 143 | |
| 144 | - __u32 |
| 145 | |
| 146 | - ``flags`` |
| 147 | |
| 148 | - Flags. No flags are defined yet, so set this to 0. |
| 149 | |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 150 | - .. row 7 |
| 151 | |
| 152 | - __u8 |
| 153 | |
| 154 | - ``tx_status`` |
| 155 | |
| 156 | - The status bits of the transmitted message. See |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 157 | :ref:`cec-tx-status` for the possible status values. It is 0 if |
| 158 | this messages was received, not transmitted. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 159 | |
| 160 | - .. row 8 |
| 161 | |
| 162 | - __u8 |
| 163 | |
Hans Verkuil | e5208ed | 2016-07-19 06:26:13 -0300 | [diff] [blame] | 164 | - ``msg[16]`` |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 165 | |
Hans Verkuil | 1267c60 | 2016-07-13 08:48:54 -0300 | [diff] [blame] | 166 | - The message payload. For :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` this is filled in by the |
| 167 | application. The driver will fill this in for :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`. |
| 168 | For :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` it will be filled in by the driver with |
| 169 | the payload of the reply message if ``timeout`` was set. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 170 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 171 | - .. row 8 |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 172 | |
| 173 | - __u8 |
| 174 | |
| 175 | - ``reply`` |
| 176 | |
| 177 | - Wait until this message is replied. If ``reply`` is 0 and the |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 178 | ``timeout`` is 0, then don't wait for a reply but return after |
Hans Verkuil | e5208ed | 2016-07-19 06:26:13 -0300 | [diff] [blame] | 179 | transmitting the message. Ignored by :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`. |
| 180 | The case where ``reply`` is 0 (this is the opcode for the Feature Abort |
| 181 | message) and ``timeout`` is non-zero is specifically allowed to make it |
| 182 | possible to send a message and wait up to ``timeout`` milliseconds for a |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 183 | Feature Abort reply. In this case ``rx_status`` will either be set |
Hans Verkuil | e5208ed | 2016-07-19 06:26:13 -0300 | [diff] [blame] | 184 | to :ref:`CEC_RX_STATUS_TIMEOUT <CEC-RX-STATUS-TIMEOUT>` or |
| 185 | :ref:`CEC_RX_STATUS_FEATURE_ABORT <CEC-RX-STATUS-FEATURE-ABORT>`. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 186 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 187 | - .. row 9 |
| 188 | |
| 189 | - __u8 |
| 190 | |
| 191 | - ``rx_status`` |
| 192 | |
| 193 | - The status bits of the received message. See |
| 194 | :ref:`cec-rx-status` for the possible status values. It is 0 if |
| 195 | this message was transmitted, not received, unless this is the |
| 196 | reply to a transmitted message. In that case both ``rx_status`` |
| 197 | and ``tx_status`` are set. |
| 198 | |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 199 | - .. row 10 |
| 200 | |
| 201 | - __u8 |
| 202 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 203 | - ``tx_status`` |
| 204 | |
| 205 | - The status bits of the transmitted message. See |
| 206 | :ref:`cec-tx-status` for the possible status values. It is 0 if |
| 207 | this messages was received, not transmitted. |
| 208 | |
| 209 | - .. row 11 |
| 210 | |
| 211 | - __u8 |
| 212 | |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 213 | - ``tx_arb_lost_cnt`` |
| 214 | |
| 215 | - A counter of the number of transmit attempts that resulted in the |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 216 | Arbitration Lost error. This is only set if the hardware supports |
| 217 | this, otherwise it is always 0. This counter is only valid if the |
| 218 | :ref:`CEC_TX_STATUS_ARB_LOST <CEC-TX-STATUS-ARB-LOST>` status bit is set. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 219 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 220 | - .. row 12 |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 221 | |
| 222 | - __u8 |
| 223 | |
| 224 | - ``tx_nack_cnt`` |
| 225 | |
| 226 | - A counter of the number of transmit attempts that resulted in the |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 227 | Not Acknowledged error. This is only set if the hardware supports |
| 228 | this, otherwise it is always 0. This counter is only valid if the |
| 229 | :ref:`CEC_TX_STATUS_NACK <CEC-TX-STATUS-NACK>` status bit is set. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 230 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 231 | - .. row 13 |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 232 | |
| 233 | - __u8 |
| 234 | |
| 235 | - ``tx_low_drive_cnt`` |
| 236 | |
| 237 | - A counter of the number of transmit attempts that resulted in the |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 238 | Arbitration Lost error. This is only set if the hardware supports |
| 239 | this, otherwise it is always 0. This counter is only valid if the |
| 240 | :ref:`CEC_TX_STATUS_LOW_DRIVE <CEC-TX-STATUS-LOW-DRIVE>` status bit is set. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 241 | |
Hans Verkuil | d2cd627 | 2016-07-12 15:07:44 -0300 | [diff] [blame] | 242 | - .. row 14 |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 243 | |
| 244 | - __u8 |
| 245 | |
| 246 | - ``tx_error_cnt`` |
| 247 | |
| 248 | - A counter of the number of transmit errors other than Arbitration |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 249 | Lost or Not Acknowledged. This is only set if the hardware |
| 250 | supports this, otherwise it is always 0. This counter is only |
| 251 | valid if the :ref:`CEC_TX_STATUS_ERROR <CEC-TX-STATUS-ERROR>` status bit is set. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 252 | |
| 253 | |
| 254 | |
| 255 | .. _cec-tx-status: |
| 256 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame^] | 257 | .. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}| |
| 258 | |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 259 | .. flat-table:: CEC Transmit Status |
| 260 | :header-rows: 0 |
| 261 | :stub-columns: 0 |
Mauro Carvalho Chehab | b2a5843 | 2016-07-08 17:59:27 -0300 | [diff] [blame] | 262 | :widths: 3 1 16 |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 263 | |
| 264 | |
Mauro Carvalho Chehab | 96f69e0 | 2016-07-09 10:25:05 -0300 | [diff] [blame] | 265 | - .. _`CEC-TX-STATUS-OK`: |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 266 | |
| 267 | - ``CEC_TX_STATUS_OK`` |
| 268 | |
| 269 | - 0x01 |
| 270 | |
| 271 | - The message was transmitted successfully. This is mutually |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 272 | exclusive with :ref:`CEC_TX_STATUS_MAX_RETRIES <CEC-TX-STATUS-MAX-RETRIES>`. Other bits can still |
| 273 | be set if earlier attempts met with failure before the transmit |
| 274 | was eventually successful. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 275 | |
Mauro Carvalho Chehab | 96f69e0 | 2016-07-09 10:25:05 -0300 | [diff] [blame] | 276 | - .. _`CEC-TX-STATUS-ARB-LOST`: |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 277 | |
| 278 | - ``CEC_TX_STATUS_ARB_LOST`` |
| 279 | |
| 280 | - 0x02 |
| 281 | |
| 282 | - CEC line arbitration was lost. |
| 283 | |
Mauro Carvalho Chehab | 96f69e0 | 2016-07-09 10:25:05 -0300 | [diff] [blame] | 284 | - .. _`CEC-TX-STATUS-NACK`: |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 285 | |
| 286 | - ``CEC_TX_STATUS_NACK`` |
| 287 | |
| 288 | - 0x04 |
| 289 | |
| 290 | - Message was not acknowledged. |
| 291 | |
Mauro Carvalho Chehab | 96f69e0 | 2016-07-09 10:25:05 -0300 | [diff] [blame] | 292 | - .. _`CEC-TX-STATUS-LOW-DRIVE`: |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 293 | |
| 294 | - ``CEC_TX_STATUS_LOW_DRIVE`` |
| 295 | |
| 296 | - 0x08 |
| 297 | |
| 298 | - Low drive was detected on the CEC bus. This indicates that a |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 299 | follower detected an error on the bus and requests a |
| 300 | retransmission. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 301 | |
Mauro Carvalho Chehab | 96f69e0 | 2016-07-09 10:25:05 -0300 | [diff] [blame] | 302 | - .. _`CEC-TX-STATUS-ERROR`: |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 303 | |
| 304 | - ``CEC_TX_STATUS_ERROR`` |
| 305 | |
| 306 | - 0x10 |
| 307 | |
| 308 | - Some error occurred. This is used for any errors that do not fit |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 309 | the previous two, either because the hardware could not tell which |
| 310 | error occurred, or because the hardware tested for other |
| 311 | conditions besides those two. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 312 | |
Mauro Carvalho Chehab | 96f69e0 | 2016-07-09 10:25:05 -0300 | [diff] [blame] | 313 | - .. _`CEC-TX-STATUS-MAX-RETRIES`: |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 314 | |
| 315 | - ``CEC_TX_STATUS_MAX_RETRIES`` |
| 316 | |
| 317 | - 0x20 |
| 318 | |
| 319 | - The transmit failed after one or more retries. This status bit is |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 320 | mutually exclusive with :ref:`CEC_TX_STATUS_OK <CEC-TX-STATUS-OK>`. Other bits can still |
| 321 | be set to explain which failures were seen. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 322 | |
| 323 | |
| 324 | |
| 325 | .. _cec-rx-status: |
| 326 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame^] | 327 | .. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}| |
| 328 | |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 329 | .. flat-table:: CEC Receive Status |
| 330 | :header-rows: 0 |
| 331 | :stub-columns: 0 |
Mauro Carvalho Chehab | b2a5843 | 2016-07-08 17:59:27 -0300 | [diff] [blame] | 332 | :widths: 3 1 16 |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 333 | |
| 334 | |
Mauro Carvalho Chehab | 96f69e0 | 2016-07-09 10:25:05 -0300 | [diff] [blame] | 335 | - .. _`CEC-RX-STATUS-OK`: |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 336 | |
| 337 | - ``CEC_RX_STATUS_OK`` |
| 338 | |
| 339 | - 0x01 |
| 340 | |
| 341 | - The message was received successfully. |
| 342 | |
Mauro Carvalho Chehab | 96f69e0 | 2016-07-09 10:25:05 -0300 | [diff] [blame] | 343 | - .. _`CEC-RX-STATUS-TIMEOUT`: |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 344 | |
| 345 | - ``CEC_RX_STATUS_TIMEOUT`` |
| 346 | |
| 347 | - 0x02 |
| 348 | |
| 349 | - The reply to an earlier transmitted message timed out. |
| 350 | |
Mauro Carvalho Chehab | 96f69e0 | 2016-07-09 10:25:05 -0300 | [diff] [blame] | 351 | - .. _`CEC-RX-STATUS-FEATURE-ABORT`: |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 352 | |
| 353 | - ``CEC_RX_STATUS_FEATURE_ABORT`` |
| 354 | |
| 355 | - 0x04 |
| 356 | |
| 357 | - The message was received successfully but the reply was |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 358 | ``CEC_MSG_FEATURE_ABORT``. This status is only set if this message |
| 359 | was the reply to an earlier transmitted message. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 360 | |
| 361 | |
| 362 | |
| 363 | Return Value |
| 364 | ============ |
| 365 | |
| 366 | On success 0 is returned, on error -1 and the ``errno`` variable is set |
| 367 | appropriately. The generic error codes are described at the |
| 368 | :ref:`Generic Error Codes <gen-errors>` chapter. |