5.6. ioctl MEDIA_IOC_ENUM_ENTITIES¶
5.6.1. Name¶
MEDIA_IOC_ENUM_ENTITIES - Enumerate entities and their properties
5.6.2. Synopsis¶
-
MEDIA_IOC_ENUM_ENTITIES¶
int ioctl(int fd, MEDIA_IOC_ENUM_ENTITIES, struct media_entity_desc *argp)
5.6.3. Arguments¶
fd
File descriptor returned by
open()
.argp
Pointer to struct
media_entity_desc
.
5.6.4. Description¶
To query the attributes of an entity, applications set the id field of a
struct 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.
-
type media_entity_desc¶
__u32 |
|
Entity ID, set by the application. When the ID is or'ed with
|
|
char |
|
Entity name as an UTF-8 NULL-terminated string. This name must be unique within the media topology. |
|
__u32 |
|
Entity type, see Media entity functions for details. |
|
__u32 |
|
Entity revision. Always zero (obsolete) |
|
__u32 |
|
Entity flags, see Media entity flags for details. |
|
__u32 |
|
Entity group ID. Always zero (obsolete) |
|
__u16 |
|
Number of pads |
|
__u16 |
|
Total number of outbound links. Inbound links are not counted in this field. |
|
__u32 |
|
Reserved for future extensions. Drivers and applications must set the array to zero. |
|
union { |
(anonymous) |
||
struct |
|
Valid for (sub-)devices that create a single device node. |
|
__u32 |
|
Device node major number. |
|
__u32 |
|
Device node minor number. |
|
__u8 |
|
||
} |
5.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.
- EINVAL
The struct
media_entity_desc
id
references a non-existing entity.