Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 1 | .. -*- coding: utf-8; mode: rst -*- |
| 2 | |
| 3 | .. _media-ioc-setup-link: |
| 4 | |
| 5 | ************************** |
| 6 | ioctl MEDIA_IOC_SETUP_LINK |
| 7 | ************************** |
| 8 | |
| 9 | *man MEDIA_IOC_SETUP_LINK(2)* |
| 10 | |
| 11 | Modify the properties of a link |
| 12 | |
| 13 | |
| 14 | Synopsis |
| 15 | ======== |
| 16 | |
Mauro Carvalho Chehab | b7e67f6 | 2016-07-02 09:49:16 -0300 | [diff] [blame] | 17 | .. cpp:function:: int ioctl( int fd, int request, struct media_link_desc *argp ) |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 18 | |
| 19 | Arguments |
| 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 | |
| 31 | Description |
| 32 | =========== |
| 33 | |
| 34 | To change link properties applications fill a struct |
| 35 | :ref:`media_link_desc <media-link-desc>` with link identification |
| 36 | information (source and sink pad) and the new requested link flags. They |
| 37 | then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to that |
| 38 | structure. |
| 39 | |
| 40 | The only configurable property is the ``ENABLED`` link flag to |
| 41 | enable/disable a link. Links marked with the ``IMMUTABLE`` link flag can |
| 42 | not be enabled or disabled. |
| 43 | |
| 44 | Link configuration has no side effect on other links. If an enabled link |
| 45 | at the sink pad prevents the link from being enabled, the driver returns |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame^] | 46 | with an ``EBUSY`` error code. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 47 | |
| 48 | Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled |
| 49 | while streaming media data. Attempting to enable or disable a streaming |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame^] | 50 | non-dynamic link will return an ``EBUSY`` error code. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 51 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame^] | 52 | If the specified link can't be found the driver returns with an ``EINVAL`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 53 | error code. |
| 54 | |
| 55 | |
| 56 | Return Value |
| 57 | ============ |
| 58 | |
| 59 | On success 0 is returned, on error -1 and the ``errno`` variable is set |
| 60 | appropriately. The generic error codes are described at the |
| 61 | :ref:`Generic Error Codes <gen-errors>` chapter. |
| 62 | |
| 63 | EINVAL |
| 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 | .. ------------------------------------------------------------------------------ |