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