1 <refentry id="cec-ioc-adap-g-log-addrs">
3 <refentrytitle>ioctl CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS</refentrytitle>
8 <refname>CEC_ADAP_G_LOG_ADDRS</refname>
9 <refname>CEC_ADAP_S_LOG_ADDRS</refname>
10 <refpurpose>Get or set the logical addresses</refpurpose>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct cec_log_addrs *<parameter>argp</parameter></paramdef>
25 <title>Arguments</title>
29 <term><parameter>fd</parameter></term>
31 <para>File descriptor returned by
32 <link linkend='cec-func-open'><function>open()</function></link>.</para>
36 <term><parameter>request</parameter></term>
38 <para>CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS</para>
42 <term><parameter>argp</parameter></term>
51 <title>Description</title>
54 Note: this documents the proposed CEC API. This API is not yet finalized and
55 is currently only available as a staging kernel module.
58 <para>To query the current CEC logical addresses, applications call the
59 <constant>CEC_ADAP_G_LOG_ADDRS</constant> ioctl with a pointer to a
60 <structname>cec_log_addrs</structname> structure where the drivers stores the
61 logical addresses.</para>
63 <para>To set new logical addresses, applications fill in struct <structname>cec_log_addrs</structname>
64 and call the <constant>CEC_ADAP_S_LOG_ADDRS</constant> ioctl with a pointer to this struct.
65 The <constant>CEC_ADAP_S_LOG_ADDRS</constant> ioctl is only available if
66 <constant>CEC_CAP_LOG_ADDRS</constant> is set (&ENOTTY; is returned otherwise). This ioctl will block until all
67 requested logical addresses have been claimed. <constant>CEC_ADAP_S_LOG_ADDRS</constant>
68 can only be called by a file handle in initiator mode (see &CEC-S-MODE;).</para>
70 <table pgwide="1" frame="none" id="cec-log-addrs">
71 <title>struct <structname>cec_log_addrs</structname></title>
77 <entry><structfield>log_addr</structfield>[CEC_MAX_LOG_ADDRS]</entry>
78 <entry>The actual logical addresses that were claimed. This is set by the
79 driver. If no logical address could be claimed, then it is set to
80 <constant>CEC_LOG_ADDR_INVALID</constant>. If this adapter is Unregistered,
81 then <structfield>log_addr[0]</structfield> is set to 0xf and all others to
82 <constant>CEC_LOG_ADDR_INVALID</constant>.</entry>
86 <entry><structfield>log_addr_mask</structfield></entry>
87 <entry>The bitmask of all logical addresses this adapter has claimed.
88 If this adapter is Unregistered then <structfield>log_addr_mask</structfield>
89 sets bit 15 and clears all other bits. If this adapter is not configured at all, then
90 <structfield>log_addr_mask</structfield> is set to 0. Set by the driver.</entry>
94 <entry><structfield>cec_version</structfield></entry>
95 <entry>The CEC version that this adapter shall use. See
96 <xref linkend="cec-versions" />.
97 Used to implement the <constant>CEC_MSG_CEC_VERSION</constant> and
98 <constant>CEC_MSG_REPORT_FEATURES</constant> messages. Note that
99 <constant>CEC_OP_CEC_VERSION_1_3A</constant> is not allowed
100 by the CEC framework.
105 <entry><structfield>num_log_addrs</structfield></entry>
106 <entry>Number of logical addresses to set up. Must be ≤
107 <structfield>available_log_addrs</structfield> as returned by
108 &CEC-ADAP-G-CAPS;. All arrays in this structure are only filled up to
109 index <structfield>available_log_addrs</structfield>-1. The remaining
110 array elements will be ignored. Note that the CEC 2.0 standard allows
111 for a maximum of 2 logical addresses, although some hardware has support
112 for more. <constant>CEC_MAX_LOG_ADDRS</constant> is 4. The driver will
113 return the actual number of logical addresses it could claim, which may
114 be less than what was requested. If this field is set to 0, then the
115 CEC adapter shall clear all claimed logical addresses and all other
116 fields will be ignored.</entry>
120 <entry><structfield>vendor_id</structfield></entry>
121 <entry>The vendor ID is a 24-bit number that identifies the specific
122 vendor or entity. Based on this ID vendor specific commands may be
123 defined. If you do not want a vendor ID then set it to
124 <constant>CEC_VENDOR_ID_NONE</constant>.</entry>
128 <entry><structfield>flags</structfield></entry>
129 <entry>Flags. No flags are defined yet, so set this to 0.</entry>
133 <entry><structfield>osd_name</structfield>[15]</entry>
134 <entry>The On-Screen Display name as is returned by the
135 <constant>CEC_MSG_SET_OSD_NAME</constant> message.</entry>
139 <entry><structfield>primary_device_type</structfield>[CEC_MAX_LOG_ADDRS]</entry>
140 <entry>Primary device type for each logical address. See
141 <xref linkend="cec-prim-dev-types" /> for possible types.</entry>
145 <entry><structfield>log_addr_type</structfield>[CEC_MAX_LOG_ADDRS]</entry>
146 <entry>Logical address types. See <xref linkend="cec-log-addr-types" /> for
147 possible types. The driver will update this with the actual logical address
148 type that it claimed (e.g. it may have to fallback to
149 <constant>CEC_LOG_ADDR_TYPE_UNREGISTERED</constant>).</entry>
153 <entry><structfield>all_device_types</structfield>[CEC_MAX_LOG_ADDRS]</entry>
154 <entry>CEC 2.0 specific: all device types. See <xref linkend="cec-all-dev-types-flags" />.
155 Used to implement the <constant>CEC_MSG_REPORT_FEATURES</constant> message.
156 This field is ignored if <structfield>cec_version</structfield> <
157 <constant>CEC_OP_CEC_VERSION_2_0</constant>.</entry>
161 <entry><structfield>features</structfield>[CEC_MAX_LOG_ADDRS][12]</entry>
162 <entry>Features for each logical address. Used to implement the
163 <constant>CEC_MSG_REPORT_FEATURES</constant> message. The 12 bytes include
164 both the RC Profile and the Device Features.
165 This field is ignored if <structfield>cec_version</structfield> <
166 <constant>CEC_OP_CEC_VERSION_2_0</constant>.</entry>
172 <table pgwide="1" frame="none" id="cec-versions">
173 <title>CEC Versions</title>
178 <entry><constant>CEC_OP_CEC_VERSION_1_3A</constant></entry>
180 <entry>CEC version according to the HDMI 1.3a standard.</entry>
183 <entry><constant>CEC_OP_CEC_VERSION_1_4B</constant></entry>
185 <entry>CEC version according to the HDMI 1.4b standard.</entry>
188 <entry><constant>CEC_OP_CEC_VERSION_2_0</constant></entry>
190 <entry>CEC version according to the HDMI 2.0 standard.</entry>
196 <table pgwide="1" frame="none" id="cec-prim-dev-types">
197 <title>CEC Primary Device Types</title>
202 <entry><constant>CEC_OP_PRIM_DEVTYPE_TV</constant></entry>
204 <entry>Use for a TV.</entry>
207 <entry><constant>CEC_OP_PRIM_DEVTYPE_RECORD</constant></entry>
209 <entry>Use for a recording device.</entry>
212 <entry><constant>CEC_OP_PRIM_DEVTYPE_TUNER</constant></entry>
214 <entry>Use for a device with a tuner.</entry>
217 <entry><constant>CEC_OP_PRIM_DEVTYPE_PLAYBACK</constant></entry>
219 <entry>Use for a playback device.</entry>
222 <entry><constant>CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM</constant></entry>
224 <entry>Use for an audio system (e.g. an audio/video receiver).</entry>
227 <entry><constant>CEC_OP_PRIM_DEVTYPE_SWITCH</constant></entry>
229 <entry>Use for a CEC switch.</entry>
232 <entry><constant>CEC_OP_PRIM_DEVTYPE_VIDEOPROC</constant></entry>
234 <entry>Use for a video processor device.</entry>
240 <table pgwide="1" frame="none" id="cec-log-addr-types">
241 <title>CEC Logical Address Types</title>
246 <entry><constant>CEC_LOG_ADDR_TYPE_TV</constant></entry>
248 <entry>Use for a TV.</entry>
251 <entry><constant>CEC_LOG_ADDR_TYPE_RECORD</constant></entry>
253 <entry>Use for a recording device.</entry>
256 <entry><constant>CEC_LOG_ADDR_TYPE_TUNER</constant></entry>
258 <entry>Use for a tuner device.</entry>
261 <entry><constant>CEC_LOG_ADDR_TYPE_PLAYBACK</constant></entry>
263 <entry>Use for a playback device.</entry>
266 <entry><constant>CEC_LOG_ADDR_TYPE_AUDIOSYSTEM</constant></entry>
268 <entry>Use for an audio system device.</entry>
271 <entry><constant>CEC_LOG_ADDR_TYPE_SPECIFIC</constant></entry>
273 <entry>Use for a second TV or for a video processor device.</entry>
276 <entry><constant>CEC_LOG_ADDR_TYPE_UNREGISTERED</constant></entry>
278 <entry>Use this if you just want to remain unregistered.
279 Used for pure CEC switches or CDC-only devices (CDC:
280 Capability Discovery and Control).</entry>
286 <table pgwide="1" frame="none" id="cec-all-dev-types-flags">
287 <title>CEC All Device Types Flags</title>
292 <entry><constant>CEC_OP_ALL_DEVTYPE_TV</constant></entry>
294 <entry>This supports the TV type.</entry>
297 <entry><constant>CEC_OP_ALL_DEVTYPE_RECORD</constant></entry>
299 <entry>This supports the Recording type.</entry>
302 <entry><constant>CEC_OP_ALL_DEVTYPE_TUNER</constant></entry>
304 <entry>This supports the Tuner type.</entry>
307 <entry><constant>CEC_OP_ALL_DEVTYPE_PLAYBACK</constant></entry>
309 <entry>This supports the Playback type.</entry>
312 <entry><constant>CEC_OP_ALL_DEVTYPE_AUDIOSYSTEM</constant></entry>
314 <entry>This supports the Audio System type.</entry>
317 <entry><constant>CEC_OP_ALL_DEVTYPE_SWITCH</constant></entry>
319 <entry>This supports the CEC Switch or Video Processing type.</entry>