Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
d2c68150 | 3 | .. _media_ioc_enum_links: |
5377d91f MH |
4 | |
5 | ************************** | |
6 | ioctl MEDIA_IOC_ENUM_LINKS | |
7 | ************************** | |
8 | ||
15e7d615 | 9 | Name |
586027ce | 10 | ==== |
5377d91f | 11 | |
586027ce | 12 | MEDIA_IOC_ENUM_LINKS - Enumerate all pads and links for a given entity |
5377d91f | 13 | |
15e7d615 MCC |
14 | |
15 | Synopsis | |
5377d91f MH |
16 | ======== |
17 | ||
5ccbb182 MCC |
18 | .. c:function:: int ioctl( int fd, MEDIA_IOC_ENUM_LINKS, struct media_links_enum *argp ) |
19 | :name: MEDIA_IOC_ENUM_LINKS | |
5377d91f | 20 | |
586027ce | 21 | |
15e7d615 | 22 | Arguments |
5377d91f MH |
23 | ========= |
24 | ||
25 | ``fd`` | |
26 | File descriptor returned by :ref:`open() <media-func-open>`. | |
27 | ||
5377d91f MH |
28 | ``argp`` |
29 | ||
30 | ||
15e7d615 | 31 | Description |
5377d91f MH |
32 | =========== |
33 | ||
34 | To enumerate pads and/or links for a given entity, applications set the | |
e8be7e97 | 35 | entity field of a struct :c:type:`media_links_enum` |
5377d91f | 36 | structure and initialize the struct |
e8be7e97 MCC |
37 | :c:type:`media_pad_desc` and struct |
38 | :c:type:`media_link_desc` structure arrays pointed by | |
5377d91f MH |
39 | the ``pads`` and ``links`` fields. They then call the |
40 | MEDIA_IOC_ENUM_LINKS ioctl with a pointer to this structure. | |
41 | ||
42 | If the ``pads`` field is not NULL, the driver fills the ``pads`` array | |
43 | with information about the entity's pads. The array must have enough | |
44 | room to store all the entity's pads. The number of pads can be retrieved | |
d2c68150 | 45 | with :ref:`MEDIA_IOC_ENUM_ENTITIES`. |
5377d91f MH |
46 | |
47 | If the ``links`` field is not NULL, the driver fills the ``links`` array | |
48 | with information about the entity's outbound links. The array must have | |
49 | enough room to store all the entity's outbound links. The number of | |
d2c68150 | 50 | outbound links can be retrieved with :ref:`MEDIA_IOC_ENUM_ENTITIES`. |
5377d91f MH |
51 | |
52 | Only forward links that originate at one of the entity's source pads are | |
53 | returned during the enumeration process. | |
54 | ||
55 | ||
e8be7e97 | 56 | .. c:type:: media_links_enum |
5377d91f | 57 | |
5bd4bb78 MCC |
58 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
59 | ||
5377d91f MH |
60 | .. flat-table:: struct media_links_enum |
61 | :header-rows: 0 | |
62 | :stub-columns: 0 | |
63 | :widths: 1 1 2 | |
64 | ||
65 | ||
66 | - .. row 1 | |
67 | ||
68 | - __u32 | |
69 | ||
70 | - ``entity`` | |
71 | ||
72 | - Entity id, set by the application. | |
73 | ||
74 | - .. row 2 | |
75 | ||
e8be7e97 | 76 | - struct :c:type:`media_pad_desc` |
5377d91f | 77 | |
5d2b3f12 | 78 | - \*\ ``pads`` |
5377d91f MH |
79 | |
80 | - Pointer to a pads array allocated by the application. Ignored if | |
0579e6e3 | 81 | NULL. |
5377d91f MH |
82 | |
83 | - .. row 3 | |
84 | ||
e8be7e97 | 85 | - struct :c:type:`media_link_desc` |
5377d91f | 86 | |
5d2b3f12 | 87 | - \*\ ``links`` |
5377d91f MH |
88 | |
89 | - Pointer to a links array allocated by the application. Ignored if | |
0579e6e3 | 90 | NULL. |
5377d91f MH |
91 | |
92 | ||
93 | ||
e8be7e97 | 94 | .. c:type:: media_pad_desc |
5377d91f | 95 | |
5bd4bb78 MCC |
96 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
97 | ||
5377d91f MH |
98 | .. flat-table:: struct media_pad_desc |
99 | :header-rows: 0 | |
100 | :stub-columns: 0 | |
101 | :widths: 1 1 2 | |
102 | ||
103 | ||
104 | - .. row 1 | |
105 | ||
106 | - __u32 | |
107 | ||
108 | - ``entity`` | |
109 | ||
110 | - ID of the entity this pad belongs to. | |
111 | ||
112 | - .. row 2 | |
113 | ||
114 | - __u16 | |
115 | ||
116 | - ``index`` | |
117 | ||
118 | - 0-based pad index. | |
119 | ||
120 | - .. row 3 | |
121 | ||
122 | - __u32 | |
123 | ||
124 | - ``flags`` | |
125 | ||
126 | - Pad flags, see :ref:`media-pad-flag` for more details. | |
127 | ||
128 | ||
129 | ||
e8be7e97 | 130 | .. c:type:: media_link_desc |
5377d91f | 131 | |
5bd4bb78 MCC |
132 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
133 | ||
5377d91f MH |
134 | .. flat-table:: struct media_link_desc |
135 | :header-rows: 0 | |
136 | :stub-columns: 0 | |
137 | :widths: 1 1 2 | |
138 | ||
139 | ||
140 | - .. row 1 | |
141 | ||
e8be7e97 | 142 | - struct :c:type:`media_pad_desc` |
5377d91f MH |
143 | |
144 | - ``source`` | |
145 | ||
146 | - Pad at the origin of this link. | |
147 | ||
148 | - .. row 2 | |
149 | ||
e8be7e97 | 150 | - struct :c:type:`media_pad_desc` |
5377d91f MH |
151 | |
152 | - ``sink`` | |
153 | ||
154 | - Pad at the target of this link. | |
155 | ||
156 | - .. row 3 | |
157 | ||
158 | - __u32 | |
159 | ||
160 | - ``flags`` | |
161 | ||
162 | - Link flags, see :ref:`media-link-flag` for more details. | |
163 | ||
164 | ||
15e7d615 | 165 | Return Value |
5377d91f MH |
166 | ============ |
167 | ||
168 | On success 0 is returned, on error -1 and the ``errno`` variable is set | |
169 | appropriately. The generic error codes are described at the | |
170 | :ref:`Generic Error Codes <gen-errors>` chapter. | |
171 | ||
172 | EINVAL | |
e8be7e97 | 173 | The struct :c:type:`media_links_enum` ``id`` |
5377d91f | 174 | references a non-existing entity. |