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