[media] docs-rst: add tabularcolumns to all tables
[deliverable/linux.git] / Documentation / media / uapi / cec / cec-ioc-dqevent.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _CEC_DQEVENT:
4
5 *****************
6 ioctl CEC_DQEVENT
7 *****************
8
9 Name
10 ====
11
12 CEC_DQEVENT - Dequeue a CEC event
13
14
15 Synopsis
16 ========
17
18 .. cpp:function:: int ioctl( int fd, int request, struct cec_event *argp )
19
20 Arguments
21 =========
22
23 ``fd``
24 File descriptor returned by :ref:`open() <cec-func-open>`.
25
26 ``request``
27 CEC_DQEVENT
28
29 ``argp``
30
31
32 Description
33 ===========
34
35 .. note::
36
37 This documents the proposed CEC API. This API is not yet finalized
38 and is currently only available as a staging kernel module.
39
40 CEC devices can send asynchronous events. These can be retrieved by
41 calling :ref:`ioctl CEC_DQEVENT <CEC_DQEVENT>`. If the file descriptor is in
42 non-blocking mode and no event is pending, then it will return -1 and
43 set errno to the ``EAGAIN`` error code.
44
45 The internal event queues are per-filehandle and per-event type. If
46 there is no more room in a queue then the last event is overwritten with
47 the new one. This means that intermediate results can be thrown away but
48 that the latest event is always available. This also means that is it
49 possible to read two successive events that have the same value (e.g.
50 two :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>` events with
51 the same state). In that case the intermediate state changes were lost but
52 it is guaranteed that the state did change in between the two events.
53
54
55 .. _cec-event-state-change_s:
56
57 .. tabularcolumns:: |p{1.8cm}|p{1.8cm}|p{13.9cm}|
58
59 .. flat-table:: struct cec_event_state_change
60 :header-rows: 0
61 :stub-columns: 0
62 :widths: 1 1 8
63
64
65 - .. row 1
66
67 - __u16
68
69 - ``phys_addr``
70
71 - The current physical address.
72
73 - .. row 2
74
75 - __u16
76
77 - ``log_addr_mask``
78
79 - The current set of claimed logical addresses.
80
81
82
83 .. _cec-event-lost-msgs_s:
84
85 .. tabularcolumns:: |p{1.0cm}|p{1.0cm}|p{15.5cm}|
86
87 .. flat-table:: struct cec_event_lost_msgs
88 :header-rows: 0
89 :stub-columns: 0
90 :widths: 1 1 16
91
92
93 - .. row 1
94
95 - __u32
96
97 - ``lost_msgs``
98
99 - Set to the number of lost messages since the filehandle was opened
100 or since the last time this event was dequeued for this
101 filehandle. The messages lost are the oldest messages. So when a
102 new message arrives and there is no more room, then the oldest
103 message is discarded to make room for the new one. The internal
104 size of the message queue guarantees that all messages received in
105 the last two seconds will be stored. Since messages should be
106 replied to within a second according to the CEC specification,
107 this is more than enough.
108
109
110
111 .. _cec-event:
112
113 .. tabularcolumns:: |p{1.6cm}|p{1.6cm}|p{1.6cm}|p{12.7cm}|
114
115 .. flat-table:: struct cec_event
116 :header-rows: 0
117 :stub-columns: 0
118 :widths: 1 1 1 8
119
120
121 - .. row 1
122
123 - __u64
124
125 - ``ts``
126
127 - Timestamp of the event in ns.
128 The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To access
129 the same clock from userspace use :c:func:`clock_gettime(2)`.
130
131 -
132
133 - .. row 2
134
135 - __u32
136
137 - ``event``
138
139 - The CEC event type, see :ref:`cec-events`.
140
141 -
142
143 - .. row 3
144
145 - __u32
146
147 - ``flags``
148
149 - Event flags, see :ref:`cec-event-flags`.
150
151 -
152
153 - .. row 4
154
155 - union
156
157 - (anonymous)
158
159 -
160 -
161
162 - .. row 5
163
164 -
165 - struct cec_event_state_change
166
167 - ``state_change``
168
169 - The new adapter state as sent by the :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>`
170 event.
171
172 - .. row 6
173
174 -
175 - struct cec_event_lost_msgs
176
177 - ``lost_msgs``
178
179 - The number of lost messages as sent by the :ref:`CEC_EVENT_LOST_MSGS <CEC-EVENT-LOST-MSGS>`
180 event.
181
182
183
184 .. _cec-events:
185
186 .. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}|
187
188 .. flat-table:: CEC Events Types
189 :header-rows: 0
190 :stub-columns: 0
191 :widths: 3 1 16
192
193
194 - .. _`CEC-EVENT-STATE-CHANGE`:
195
196 - ``CEC_EVENT_STATE_CHANGE``
197
198 - 1
199
200 - Generated when the CEC Adapter's state changes. When open() is
201 called an initial event will be generated for that filehandle with
202 the CEC Adapter's state at that time.
203
204 - .. _`CEC-EVENT-LOST-MSGS`:
205
206 - ``CEC_EVENT_LOST_MSGS``
207
208 - 2
209
210 - Generated if one or more CEC messages were lost because the
211 application didn't dequeue CEC messages fast enough.
212
213
214
215 .. _cec-event-flags:
216
217 .. tabularcolumns:: |p{4.4cm}|p{1.5cm}|p{11.6cm}|
218
219 .. flat-table:: CEC Event Flags
220 :header-rows: 0
221 :stub-columns: 0
222 :widths: 3 1 8
223
224
225 - .. _`CEC-EVENT-FL-INITIAL-VALUE`:
226
227 - ``CEC_EVENT_FL_INITIAL_VALUE``
228
229 - 1
230
231 - Set for the initial events that are generated when the device is
232 opened. See the table above for which events do this. This allows
233 applications to learn the initial state of the CEC adapter at
234 open() time.
235
236
237
238 Return Value
239 ============
240
241 On success 0 is returned, on error -1 and the ``errno`` variable is set
242 appropriately. The generic error codes are described at the
243 :ref:`Generic Error Codes <gen-errors>` chapter.
This page took 0.034996 seconds and 5 git commands to generate.