Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 1 | .. -*- coding: utf-8; mode: rst -*- |
2 | |||||
Mauro Carvalho Chehab | d2c6815 | 2016-07-09 08:54:35 -0300 | [diff] [blame] | 3 | .. _media_ioc_enum_entities: |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 4 | |
5 | ***************************** | ||||
6 | ioctl MEDIA_IOC_ENUM_ENTITIES | ||||
7 | ***************************** | ||||
8 | |||||
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 9 | Name |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 10 | ==== |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 11 | |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 12 | MEDIA_IOC_ENUM_ENTITIES - Enumerate entities and their properties |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 13 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 14 | |
15 | Synopsis | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 16 | ======== |
17 | |||||
Mauro Carvalho Chehab | b7e67f6 | 2016-07-02 09:49:16 -0300 | [diff] [blame] | 18 | .. cpp:function:: int ioctl( int fd, int request, struct media_entity_desc *argp ) |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 19 | |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 20 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 21 | Arguments |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 22 | ========= |
23 | |||||
24 | ``fd`` | ||||
25 | File descriptor returned by :ref:`open() <media-func-open>`. | ||||
26 | |||||
27 | ``request`` | ||||
28 | MEDIA_IOC_ENUM_ENTITIES | ||||
29 | |||||
30 | ``argp`` | ||||
31 | |||||
32 | |||||
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 33 | Description |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 34 | =========== |
35 | |||||
36 | To query the attributes of an entity, applications set the id field of a | ||||
37 | struct :ref:`media_entity_desc <media-entity-desc>` structure and | ||||
38 | call the MEDIA_IOC_ENUM_ENTITIES ioctl with a pointer to this | ||||
39 | structure. The driver fills the rest of the structure or returns an | ||||
40 | EINVAL error code when the id is invalid. | ||||
41 | |||||
Mauro Carvalho Chehab | d2c6815 | 2016-07-09 08:54:35 -0300 | [diff] [blame] | 42 | .. _media-ent-id-flag-next: |
43 | |||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 44 | Entities can be enumerated by or'ing the id with the |
45 | ``MEDIA_ENT_ID_FLAG_NEXT`` flag. The driver will return information | ||||
46 | about the entity with the smallest id strictly larger than the requested | ||||
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 47 | one ('next entity'), or the ``EINVAL`` error code if there is none. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 48 | |
49 | Entity IDs can be non-contiguous. Applications must *not* try to | ||||
50 | enumerate entities by calling MEDIA_IOC_ENUM_ENTITIES with increasing | ||||
51 | id's until they get an error. | ||||
52 | |||||
53 | |||||
54 | .. _media-entity-desc: | ||||
55 | |||||
56 | .. flat-table:: struct media_entity_desc | ||||
57 | :header-rows: 0 | ||||
58 | :stub-columns: 0 | ||||
Mauro Carvalho Chehab | 2ceb5d7 | 2016-07-06 07:55:55 -0300 | [diff] [blame] | 59 | :widths: 1 1 1 1 8 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 60 | |
61 | |||||
62 | - .. row 1 | ||||
63 | |||||
64 | - __u32 | ||||
65 | |||||
66 | - ``id`` | ||||
67 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 68 | - |
69 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 70 | - Entity id, set by the application. When the id is or'ed with |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 71 | ``MEDIA_ENT_ID_FLAG_NEXT``, the driver clears the flag and returns |
72 | the first entity with a larger id. | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 73 | |
74 | - .. row 2 | ||||
75 | |||||
76 | - char | ||||
77 | |||||
Mauro Carvalho Chehab | 8968da9 | 2016-07-13 08:43:30 -0300 | [diff] [blame] | 78 | - ``name``\ [32] |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 79 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 80 | - |
81 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 82 | - Entity name as an UTF-8 NULL-terminated string. |
83 | |||||
84 | - .. row 3 | ||||
85 | |||||
86 | - __u32 | ||||
87 | |||||
88 | - ``type`` | ||||
89 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 90 | - |
91 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 92 | - Entity type, see :ref:`media-entity-type` for details. |
93 | |||||
94 | - .. row 4 | ||||
95 | |||||
96 | - __u32 | ||||
97 | |||||
98 | - ``revision`` | ||||
99 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 100 | - |
101 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 102 | - Entity revision. Always zero (obsolete) |
103 | |||||
104 | - .. row 5 | ||||
105 | |||||
106 | - __u32 | ||||
107 | |||||
108 | - ``flags`` | ||||
109 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 110 | - |
111 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 112 | - Entity flags, see :ref:`media-entity-flag` for details. |
113 | |||||
114 | - .. row 6 | ||||
115 | |||||
116 | - __u32 | ||||
117 | |||||
118 | - ``group_id`` | ||||
119 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 120 | - |
121 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 122 | - Entity group ID. Always zero (obsolete) |
123 | |||||
124 | - .. row 7 | ||||
125 | |||||
126 | - __u16 | ||||
127 | |||||
128 | - ``pads`` | ||||
129 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 130 | - |
131 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 132 | - Number of pads |
133 | |||||
134 | - .. row 8 | ||||
135 | |||||
136 | - __u16 | ||||
137 | |||||
138 | - ``links`` | ||||
139 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 140 | - |
141 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 142 | - Total number of outbound links. Inbound links are not counted in |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 143 | this field. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 144 | |
145 | - .. row 9 | ||||
146 | |||||
147 | - union | ||||
148 | |||||
149 | - .. row 10 | ||||
150 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 151 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 152 | - struct |
153 | |||||
154 | - ``dev`` | ||||
155 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 156 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 157 | - Valid for (sub-)devices that create a single device node. |
158 | |||||
159 | - .. row 11 | ||||
160 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 161 | - |
162 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 163 | - __u32 |
164 | |||||
165 | - ``major`` | ||||
166 | |||||
167 | - Device node major number. | ||||
168 | |||||
169 | - .. row 12 | ||||
170 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 171 | - |
172 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 173 | - __u32 |
174 | |||||
175 | - ``minor`` | ||||
176 | |||||
177 | - Device node minor number. | ||||
178 | |||||
179 | - .. row 13 | ||||
180 | |||||
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 181 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 182 | - __u8 |
183 | |||||
Mauro Carvalho Chehab | 8968da9 | 2016-07-13 08:43:30 -0300 | [diff] [blame] | 184 | - ``raw``\ [184] |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 185 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 186 | - |
187 | - | ||||
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 188 | |
189 | |||||
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 190 | Return Value |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 191 | ============ |
192 | |||||
193 | On success 0 is returned, on error -1 and the ``errno`` variable is set | ||||
194 | appropriately. The generic error codes are described at the | ||||
195 | :ref:`Generic Error Codes <gen-errors>` chapter. | ||||
196 | |||||
197 | EINVAL | ||||
198 | The struct :ref:`media_entity_desc <media-entity-desc>` ``id`` | ||||
199 | references a non-existing entity. |