1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/userspace-api/media/fdl-appendix.rst.
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
10 .. _media_ioc_enum_links:
12 **************************
13 ioctl MEDIA_IOC_ENUM_LINKS
14 **************************
19 MEDIA_IOC_ENUM_LINKS - Enumerate all pads and links for a given entity
25 .. c:function:: int ioctl( int fd, MEDIA_IOC_ENUM_LINKS, struct media_links_enum *argp )
26 :name: MEDIA_IOC_ENUM_LINKS
33 File descriptor returned by :ref:`open() <media-func-open>`.
36 Pointer to struct :c:type:`media_links_enum`.
42 To enumerate pads and/or links for a given entity, applications set the
43 entity field of a struct :c:type:`media_links_enum`
44 structure and initialize the struct
45 :c:type:`media_pad_desc` and struct
46 :c:type:`media_link_desc` structure arrays pointed by
47 the ``pads`` and ``links`` fields. They then call the
48 MEDIA_IOC_ENUM_LINKS ioctl with a pointer to this structure.
50 If the ``pads`` field is not NULL, the driver fills the ``pads`` array
51 with information about the entity's pads. The array must have enough
52 room to store all the entity's pads. The number of pads can be retrieved
53 with :ref:`MEDIA_IOC_ENUM_ENTITIES`.
55 If the ``links`` field is not NULL, the driver fills the ``links`` array
56 with information about the entity's outbound links. The array must have
57 enough room to store all the entity's outbound links. The number of
58 outbound links can be retrieved with :ref:`MEDIA_IOC_ENUM_ENTITIES`.
60 Only forward links that originate at one of the entity's source pads are
61 returned during the enumeration process.
64 .. c:type:: media_links_enum
66 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
68 .. flat-table:: struct media_links_enum
75 - Entity id, set by the application.
77 * - struct :c:type:`media_pad_desc`
79 - Pointer to a pads array allocated by the application. Ignored if
82 * - struct :c:type:`media_link_desc`
84 - Pointer to a links array allocated by the application. Ignored if
89 - Reserved for future extensions. Drivers and applications must set
93 .. c:type:: media_pad_desc
95 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
97 .. flat-table:: struct media_pad_desc
104 - ID of the entity this pad belongs to.
108 - Pad index, starts at 0.
112 - Pad flags, see :ref:`media-pad-flag` for more details.
116 - Reserved for future extensions. Drivers and applications must set
121 .. c:type:: media_link_desc
123 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
125 .. flat-table:: struct media_link_desc
130 * - struct :c:type:`media_pad_desc`
132 - Pad at the origin of this link.
134 * - struct :c:type:`media_pad_desc`
136 - Pad at the target of this link.
140 - Link flags, see :ref:`media-link-flag` for more details.
144 - Reserved for future extensions. Drivers and applications must set
151 On success 0 is returned, on error -1 and the ``errno`` variable is set
152 appropriately. The generic error codes are described at the
153 :ref:`Generic Error Codes <gen-errors>` chapter.
156 The struct :c:type:`media_links_enum` ``id``
157 references a non-existing entity.