^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) .. c:namespace:: MC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) .. _media_ioc_enum_links:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) **************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) ioctl MEDIA_IOC_ENUM_LINKS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) **************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) MEDIA_IOC_ENUM_LINKS - Enumerate all pads and links for a given entity
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .. c:macro:: MEDIA_IOC_ENUM_LINKS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ``int ioctl(int fd, MEDIA_IOC_ENUM_LINKS, struct media_links_enum *argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) ``argp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) Pointer to struct :c:type:`media_links_enum`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) To enumerate pads and/or links for a given entity, applications set the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) entity field of a struct :c:type:`media_links_enum`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) structure and initialize the struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) :c:type:`media_pad_desc` and struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) :c:type:`media_link_desc` structure arrays pointed by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) the ``pads`` and ``links`` fields. They then call the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) MEDIA_IOC_ENUM_LINKS ioctl with a pointer to this structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) If the ``pads`` field is not NULL, the driver fills the ``pads`` array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) with information about the entity's pads. The array must have enough
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) room to store all the entity's pads. The number of pads can be retrieved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) with :ref:`MEDIA_IOC_ENUM_ENTITIES`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) If the ``links`` field is not NULL, the driver fills the ``links`` array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) with information about the entity's outbound links. The array must have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) enough room to store all the entity's outbound links. The number of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) outbound links can be retrieved with :ref:`MEDIA_IOC_ENUM_ENTITIES`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) Only forward links that originate at one of the entity's source pads are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) returned during the enumeration process.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) .. c:type:: media_links_enum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) .. flat-table:: struct media_links_enum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) :widths: 1 1 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) - ``entity``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) - Entity id, set by the application.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * - struct :c:type:`media_pad_desc`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) - \*\ ``pads``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) - Pointer to a pads array allocated by the application. Ignored if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) NULL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) * - struct :c:type:`media_link_desc`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) - \*\ ``links``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) - Pointer to a links array allocated by the application. Ignored if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) NULL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) - ``reserved[4]``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) - Reserved for future extensions. Drivers and applications must set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) the array to zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) .. c:type:: media_pad_desc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) .. flat-table:: struct media_pad_desc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) :widths: 1 1 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) - ``entity``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) - ID of the entity this pad belongs to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) * - __u16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) - ``index``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) - Pad index, starts at 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) - ``flags``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) - Pad flags, see :ref:`media-pad-flag` for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) - ``reserved[2]``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) - Reserved for future extensions. Drivers and applications must set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) the array to zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) .. c:type:: media_link_desc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) .. flat-table:: struct media_link_desc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) :widths: 1 1 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) * - struct :c:type:`media_pad_desc`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) - ``source``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) - Pad at the origin of this link.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) * - struct :c:type:`media_pad_desc`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) - ``sink``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) - Pad at the target of this link.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) - ``flags``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) - Link flags, see :ref:`media-link-flag` for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) - ``reserved[2]``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) - Reserved for future extensions. Drivers and applications must set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) the array to zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) appropriately. The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) :ref:`Generic Error Codes <gen-errors>` chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) The struct :c:type:`media_links_enum` ``id``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) references a non-existing entity.