blob: 5b9c44e4ee77f350d0509f01d622e8fe2eba6f9c [file] [log] [blame]
Markus Heiser5377d912016-06-30 15:18:56 +02001.. -*- coding: utf-8; mode: rst -*-
2
3.. _media-ioc-setup-link:
4
5**************************
6ioctl MEDIA_IOC_SETUP_LINK
7**************************
8
9*man MEDIA_IOC_SETUP_LINK(2)*
10
11Modify the properties of a link
12
13
14Synopsis
15========
16
Mauro Carvalho Chehabb7e67f62016-07-02 09:49:16 -030017.. cpp:function:: int ioctl( int fd, int request, struct media_link_desc *argp )
Markus Heiser5377d912016-06-30 15:18:56 +020018
19Arguments
20=========
21
22``fd``
23 File descriptor returned by :ref:`open() <media-func-open>`.
24
25``request``
26 MEDIA_IOC_SETUP_LINK
27
28``argp``
29
30
31Description
32===========
33
34To change link properties applications fill a struct
35:ref:`media_link_desc <media-link-desc>` with link identification
36information (source and sink pad) and the new requested link flags. They
37then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to that
38structure.
39
40The only configurable property is the ``ENABLED`` link flag to
41enable/disable a link. Links marked with the ``IMMUTABLE`` link flag can
42not be enabled or disabled.
43
44Link configuration has no side effect on other links. If an enabled link
45at the sink pad prevents the link from being enabled, the driver returns
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030046with an ``EBUSY`` error code.
Markus Heiser5377d912016-06-30 15:18:56 +020047
48Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled
49while streaming media data. Attempting to enable or disable a streaming
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030050non-dynamic link will return an ``EBUSY`` error code.
Markus Heiser5377d912016-06-30 15:18:56 +020051
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030052If the specified link can't be found the driver returns with an ``EINVAL``
Markus Heiser5377d912016-06-30 15:18:56 +020053error code.
54
55
56Return Value
57============
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
62
63EINVAL
64 The struct :ref:`media_link_desc <media-link-desc>` references a
65 non-existing link, or the link is immutable and an attempt to modify
66 its configuration was made.
67
68
69.. ------------------------------------------------------------------------------
70.. This file was automatically converted from DocBook-XML with the dbxml
71.. library (https://github.com/return42/sphkerneldoc). The origin XML comes
72.. from the linux kernel, refer to:
73..
74.. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
75.. ------------------------------------------------------------------------------