4.6. ioctl MEDIA_IOC_ENUM_ENTITIES¶
MEDIA_IOC_ENUM_ENTITIES - Enumerate entities and their properties
ioctl(int fd, MEDIA_IOC_ENUM_ENTITIES, struct media_entity_desc *argp)¶
To query the attributes of an entity, applications set the id field of a
media_entity_desc structure and
call the MEDIA_IOC_ENUM_ENTITIES ioctl with a pointer to this
structure. The driver fills the rest of the structure or returns an
EINVAL error code when the id is invalid.
Entities can be enumerated by or’ing the id with the
MEDIA_ENT_ID_FLAG_NEXT flag. The driver will return information
about the entity with the smallest id strictly larger than the requested
one (‘next entity’), or the
EINVAL error code if there is none.
Entity IDs can be non-contiguous. Applications must not try to enumerate entities by calling MEDIA_IOC_ENUM_ENTITIES with increasing id’s until they get an error.
||Entity id, set by the application. When the id is or’ed with
||Entity name as an UTF-8 NULL-terminated string.|
||Entity type, see Media entity types for details.|
||Entity revision. Always zero (obsolete)|
||Entity flags, see Media entity flags for details.|
||Entity group ID. Always zero (obsolete)|
||Number of pads|
||Total number of outbound links. Inbound links are not counted in this field.|
||Valid for (sub-)devices that create a single device node.|
||Device node major number.|
||Device node minor number.|
4.6.5. Return Value¶
On success 0 is returned, on error -1 and the
errno variable is set
appropriately. The generic error codes are described at the
Generic Error Codes chapter.
- The struct
idreferences a non-existing entity.